@carbon/charts 1.15.3 → 1.15.5

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 (41) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/_baseEach-BxXSF0fB.mjs +20 -0
  3. package/dist/{_baseEach-FYvKsL62.mjs.map → _baseEach-BxXSF0fB.mjs.map} +1 -1
  4. package/dist/{a11y-SOU26cr5.mjs → a11y-ePqvrObQ.mjs} +1 -1
  5. package/dist/{a11y-SOU26cr5.mjs.map → a11y-ePqvrObQ.mjs.map} +1 -1
  6. package/dist/{angle-utils-f1TpgqMV.mjs → angle-utils-CGNQcrjg.mjs} +98 -100
  7. package/dist/{angle-utils-f1TpgqMV.mjs.map → angle-utils-CGNQcrjg.mjs.map} +1 -1
  8. package/dist/{choropleth-nq4Ls6mL.mjs → choropleth-C_tUN7Ur.mjs} +1354 -1355
  9. package/dist/choropleth-C_tUN7Ur.mjs.map +1 -0
  10. package/dist/{color-scale-utils-ePX_zGmy.mjs → color-scale-utils-CbAVUUep.mjs} +803 -843
  11. package/dist/{color-scale-utils-ePX_zGmy.mjs.map → color-scale-utils-CbAVUUep.mjs.map} +1 -1
  12. package/dist/components/index.mjs +1 -1
  13. package/dist/demo/index.mjs +223 -223
  14. package/dist/demo/index.mjs.map +1 -1
  15. package/dist/demo/styles.css +872 -747
  16. package/dist/demo/styles.css.map +1 -1
  17. package/dist/{enums-sKf02OL8.mjs → enums-DwsxZqjR.mjs} +1 -1
  18. package/dist/{enums-sKf02OL8.mjs.map → enums-DwsxZqjR.mjs.map} +1 -1
  19. package/dist/{index-937eoUHH.mjs → index-zSuueE1Q.mjs} +3 -3
  20. package/dist/index-zSuueE1Q.mjs.map +1 -0
  21. package/dist/index.mjs +171 -173
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/interfaces/index.mjs +2 -2
  24. package/dist/model/index.mjs +1 -1
  25. package/dist/services/index.mjs +3 -3
  26. package/dist/styles.css +96 -148
  27. package/dist/styles.css.map +1 -1
  28. package/dist/styles.min.css +1 -1
  29. package/dist/styles.min.css.map +1 -1
  30. package/dist/umd/bundle.umd.js +18 -18
  31. package/dist/umd/bundle.umd.js.map +1 -1
  32. package/dist/{wordcloud-EFHcMnWt.mjs → wordcloud-DNFY5X97.mjs} +37 -38
  33. package/dist/{wordcloud-EFHcMnWt.mjs.map → wordcloud-DNFY5X97.mjs.map} +1 -1
  34. package/dist/{zoom-llJ5-h9M.mjs → zoom-DlSAWtwE.mjs} +4 -4
  35. package/dist/{zoom-llJ5-h9M.mjs.map → zoom-DlSAWtwE.mjs.map} +1 -1
  36. package/package.json +16 -16
  37. package/styles.css +96 -148
  38. package/styles.min.css +1 -1
  39. package/dist/_baseEach-FYvKsL62.mjs +0 -21
  40. package/dist/choropleth-nq4Ls6mL.mjs.map +0 -1
  41. package/dist/index-937eoUHH.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 E0(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===E0?e:b0,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 b0(){return 0}function x0(e){return e===null?NaN:+e}function*_0(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 S0=Oo(Re).right;Oo(x0).center;const wo=S0;function T0(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 Fn{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=M0){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(O0(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 O0({_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 M0(e){return e!==null&&typeof e=="object"?e.valueOf():e}function A0(e){return e}function C0(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 D0=Array.prototype,L0=D0.slice;function Mo(e){return()=>e}const R0=Math.sqrt(50),I0=Math.sqrt(10),k0=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>=R0?10:s>=I0?5:s>=k0?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 gr(e,t,n){return t=+t,e=+e,n=+n,_s(e,t,n)[2]}function Ao(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?gr(t,e,n):gr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function P0(e,t,n){let r;for(;;){const i=gr(e,t,n);if(i===r||i===0||!isFinite(i))return[e,t];i>0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function N0(e){return Math.max(1,Math.ceil(Math.log(T0(e))/Math.LN2)+1)}function $0(){var e=A0,t=Ie,n=N0;function r(i){Array.isArray(i)||(i=Array.from(i));var s,a=i.length,o,l,c=new Array(a);for(s=0;s<a;++s)c[s]=e(i[s],s,i);var u=t(c),d=u[0],h=u[1],f=n(c,d,h);if(!Array.isArray(f)){const y=h,x=+f;if(t===Ie&&([d,h]=P0(d,h,x)),f=Ss(d,h,x),f[0]<=d&&(l=gr(d,h,x)),f[f.length-1]>=h)if(y>=h&&t===Ie){const S=gr(d,h,x);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,m=p;f[g]<=d;)++g;for(;f[m-1]>h;)--m;(g||m<p)&&(f=f.slice(g,m),p=m-g);var v=new Array(p+1),E;for(s=0;s<=p;++s)E=v[s]=[],E.x0=s>0?f[s-1]:d,E.x1=s<p?f[s]:h;if(isFinite(l)){if(l>0)for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&v[Math.min(p,Math.floor((o-d)/l))].push(i[s]);else if(l<0){for(s=0;s<a;++s)if((o=c[s])!=null&&d<=o&&o<=h){const y=Math.floor((d-o)*l);v[Math.min(p,y+(f[y]<=o))].push(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&v[wo(f,o,0,p)].push(i[s]);return v}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:Mo(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:Mo([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Mo(Array.isArray(i)?L0.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 An(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:C0(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 Co(e,t,n){if(e=Float64Array.from(_0(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return An(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=An(e.subarray(s+1));return a+(o-a)*(i-s)}}function*F0(e){for(const t of e)yield*t}function ih(e){return Array.from(F0(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,Os=2,Do=3,ci=4,sh=1e-6;function H0(e){return"translate("+e+",0)"}function G0(e){return"translate(0,"+e+")"}function V0(e){return t=>+e(t)}function z0(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function W0(){return!this.__axis}function ws(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===Os?"x":"y",d=e===Ts||e===Do?H0:G0;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),m=Math.max(s,0)+o,v=t.range(),E=+v[0]+l,y=+v[v.length-1]+l,x=(t.bandwidth?z0:V0)(t.copy(),l),S=f.selection?f.selection():f,_=S.selectAll(".domain").data([null]),A=S.selectAll(".tick").data(p,t).order(),L=A.exit(),B=A.enter().append("g").attr("class","tick"),D=A.select("line"),O=A.select("text");_=_.merge(_.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),A=A.merge(B),D=D.merge(B.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),O=O.merge(B.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===Ts?"0em":e===Do?"0.71em":"0.32em")),f!==S&&(_=_.transition(f),A=A.transition(f),D=D.transition(f),O=O.transition(f),L=L.transition(f).attr("opacity",sh).attr("transform",function(H){return isFinite(H=x(H))?d(H+l):this.getAttribute("transform")}),B.attr("opacity",sh).attr("transform",function(H){var P=this.parentNode.__axis;return d((P&&isFinite(P=P(H))?P:x(H))+l)})),L.remove(),_.attr("d",e===ci||e===Os?a?"M"+c*a+","+E+"H"+l+"V"+y+"H"+c*a:"M"+l+","+E+"V"+y:a?"M"+E+","+c*a+"V"+l+"H"+y+"V"+c*a:"M"+E+","+l+"H"+y),A.attr("opacity",1).attr("transform",function(H){return d(x(H)+l)}),D.attr(u+"2",c*s),O.attr(u,c*m).text(g),S.filter(W0).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Os?"start":e===ci?"end":"middle"),S.each(function(){this.__axis=x})}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 Y0(e){return ws(Ts,e)}function q0(e){return ws(Os,e)}function Lo(e){return ws(Do,e)}function ah(e){return ws(ci,e)}var X0={value:()=>{}};function Ro(){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 j0(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=Ro.prototype={constructor:Ms,on:function(e,t){var n=this._,r=j0(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=Z0(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 Z0(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]=X0,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Io="http://www.w3.org/1999/xhtml";const lh={svg:"http://www.w3.org/2000/svg",xhtml:Io,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 K0(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Io&&t.documentElement.namespaceURI===Io?t.createElement(e):t.createElementNS(n,e)}}function Q0(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ch(e){var t=As(e);return(t.local?Q0:K0)(t)}function J0(){}function ko(e){return e==null?J0:function(){return this.querySelector(e)}}function ty(e){typeof e!="function"&&(e=ko(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 ey(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ny(){return[]}function uh(e){return e==null?ny:function(){return this.querySelectorAll(e)}}function ry(e){return function(){return ey(e.apply(this,arguments))}}function iy(e){typeof e=="function"?e=ry(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 sy=Array.prototype.find;function ay(e){return function(){return sy.call(this.children,e)}}function oy(){return this.firstElementChild}function ly(e){return this.select(e==null?oy:ay(typeof e=="function"?e:dh(e)))}var cy=Array.prototype.filter;function uy(){return Array.from(this.children)}function hy(e){return function(){return cy.call(this.children,e)}}function dy(e){return this.selectAll(e==null?uy:hy(typeof e=="function"?e:dh(e)))}function fy(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 py(){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 gy(e){return function(){return e}}function my(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 vy(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 yy(e){return e.__data__}function Ey(e,t){if(!arguments.length)return Array.from(this,yy);var n=t?vy:my,r=this._parents,i=this._groups;typeof e!="function"&&(e=gy(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=by(e.call(u,u&&u.__data__,c,r)),p=f.length,g=o[c]=new Array(p),m=a[c]=new Array(p),v=l[c]=new Array(h);n(u,d,g,m,v,f,t);for(var E=0,y=0,x,S;E<p;++E)if(x=g[E]){for(E>=y&&(y=E+1);!(S=m[y])&&++y<p;);x._next=S||null}}return a=new me(a,r),a._enter=o,a._exit=l,a}function by(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 _y(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 Sy(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 Ty(){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 Oy(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 My(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Ay(){return Array.from(this)}function Cy(){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 Dy(){let e=0;for(const t of this)++e;return e}function Ly(){return!this.node()}function Ry(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,o;s<a;++s)(o=i[s])&&e.call(o,o.__data__,s,i);return this}function Iy(e){return function(){this.removeAttribute(e)}}function ky(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Py(e,t){return function(){this.setAttribute(e,t)}}function Ny(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 Fy(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?ky:Iy:typeof t=="function"?n.local?Fy:$y:n.local?Ny:Py)(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 Hy(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Gy(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Vy(e,t,n){return arguments.length>1?this.each((t==null?By:typeof t=="function"?Gy:Hy)(e,t,n??"")):mr(this.node(),e)}function mr(e,t){return e.style.getPropertyValue(t)||ph(e).getComputedStyle(e,null).getPropertyValue(t)}function zy(e){return function(){delete this[e]}}function Wy(e,t){return function(){this[e]=t}}function Yy(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function qy(e,t){return arguments.length>1?this.each((t==null?zy:typeof t=="function"?Yy:Wy)(e,t)):this.node()[e]}function gh(e){return e.trim().split(/^|\s+/)}function Po(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=Po(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function yh(e,t){for(var n=Po(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Xy(e){return function(){vh(this,e)}}function jy(e){return function(){yh(this,e)}}function Zy(e,t){return function(){(t.apply(this,arguments)?vh:yh)(this,e)}}function Ky(e,t){var n=gh(e+"");if(arguments.length<2){for(var r=Po(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?Zy:t?Xy:jy)(n,t))}function Qy(){this.textContent=""}function Jy(e){return function(){this.textContent=e}}function t1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function e1(e){return arguments.length?this.each(e==null?Qy:(typeof e=="function"?t1:Jy)(e)):this.node().textContent}function n1(){this.innerHTML=""}function r1(e){return function(){this.innerHTML=e}}function i1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function s1(e){return arguments.length?this.each(e==null?n1:(typeof e=="function"?i1:r1)(e)):this.node().innerHTML}function a1(){this.nextSibling&&this.parentNode.appendChild(this)}function o1(){return this.each(a1)}function l1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function c1(){return this.each(l1)}function u1(e){var t=typeof e=="function"?e:ch(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function h1(){return null}function d1(e,t){var n=typeof e=="function"?e:ch(e),r=t==null?h1:typeof t=="function"?t:ko(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function f1(){var e=this.parentNode;e&&e.removeChild(this)}function p1(){return this.each(f1)}function g1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function m1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function v1(e){return this.select(e?m1:g1)}function y1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function E1(e){return function(t){e.call(this,t,this.__data__)}}function b1(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 _1(e,t,n){return function(){var r=this.__on,i,s=E1(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 S1(e,t,n){var r=b1(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?_1: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 T1(e,t){return function(){return Eh(this,e,t)}}function O1(e,t){return function(){return Eh(this,e,t.apply(this,arguments))}}function w1(e,t){return this.each((typeof t=="function"?O1:T1)(e,t))}function*M1(){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 bh=[null];function me(e,t){this._groups=e,this._parents=t}function ui(){return new me([[document.documentElement]],bh)}function A1(){return this}me.prototype=ui.prototype={constructor:me,select:ty,selectAll:iy,selectChild:ly,selectChildren:dy,filter:fy,data:Ey,enter:py,exit:xy,join:_y,merge:Sy,selection:A1,order:Ty,sort:Oy,call:My,nodes:Ay,node:Cy,size:Dy,empty:Ly,each:Ry,attr:Uy,style:Vy,property:qy,classed:Ky,text:e1,html:s1,raise:o1,lower:c1,append:u1,insert:d1,remove:p1,clone:v1,datum:y1,on:S1,dispatch:w1,[Symbol.iterator]:M1};function I(e){return typeof e=="string"?new me([[document.querySelector(e)]],[document.documentElement]):new me([[e]],bh)}function C1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Bn(e,t){if(e=C1(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 $o(e){e.preventDefault(),e.stopImmediatePropagation()}function D1(e){var t=e.document.documentElement,n=I(e).on("dragstart.drag",$o,No);"onselectstart"in t?n.on("selectstart.drag",$o,No):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function L1(e,t){var n=e.document.documentElement,r=I(e).on("dragstart.drag",null);t&&(r.on("click.drag",$o,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 Fo(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function xh(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,vr="\\s*([+-]?\\d+)\\s*",fi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",R1=/^#([0-9a-f]{3,8})$/,I1=new RegExp(`^rgb\\(${vr},${vr},${vr}\\)$`),k1=new RegExp(`^rgb\\(${Xe},${Xe},${Xe}\\)$`),P1=new RegExp(`^rgba\\(${vr},${vr},${vr},${fi}\\)$`),N1=new RegExp(`^rgba\\(${Xe},${Xe},${Xe},${fi}\\)$`),$1=new RegExp(`^hsl\\(${fi},${Xe},${Xe}\\)$`),F1=new RegExp(`^hsla\\(${fi},${Xe},${Xe},${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};Fo(hi,on,{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 on(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=R1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Oh(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=I1.exec(e))?new le(t[1],t[2],t[3],1):(t=k1.exec(e))?new le(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=P1.exec(e))?Ls(t[1],t[2],t[3],t[4]):(t=N1.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=F1.exec(e))?Ah(t[1],t[2]/100,t[3]/100,t[4]):_h.hasOwnProperty(e)?Oh(_h[e]):e==="transparent"?new le(NaN,NaN,NaN,0):null}function Oh(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 H1(e){return e instanceof hi||(e=on(e)),e?(e=e.rgb(),new le(e.r,e.g,e.b,e.opacity)):new le}function Uo(e,t,n,r){return arguments.length===1?H1(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}Fo(le,Uo,xh(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(Hn(this.r),Hn(this.g),Hn(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:wh,formatHex:wh,formatHex8:G1,formatRgb:Mh,toString:Mh}));function wh(){return`#${Gn(this.r)}${Gn(this.g)}${Gn(this.b)}`}function G1(){return`#${Gn(this.r)}${Gn(this.g)}${Gn(this.b)}${Gn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Mh(){const e=Rs(this.opacity);return`${e===1?"rgb(":"rgba("}${Hn(this.r)}, ${Hn(this.g)}, ${Hn(this.b)}${e===1?")":`, ${e})`}`}function Rs(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Hn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Gn(e){return e=Hn(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=on(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 Bo(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}Fo(ke,Bo,xh(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(Ho(e>=240?e-240:e+120,i,r),Ho(e,i,r),Ho(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 Ho(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 Go=e=>()=>e;function V1(e,t){return function(n){return e+n*t}}function z1(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 W1(e){return(e=+e)==1?Lh:function(t,n){return n-t?z1(t,n,e):Go(isNaN(t)?n:t)}}function Lh(e,t){var n=t-e;return n?V1(e,n):Go(isNaN(e)?t:e)}const ks=function e(t){var n=W1(t);function r(i,s){var a=n((i=Uo(i)).r,(s=Uo(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 Y1(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 q1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function X1(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 j1(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 Z1(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 Vo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,zo=new RegExp(Vo.source,"g");function K1(e){return function(){return e}}function Q1(e){return function(t){return e(t)+""}}function Rh(e,t){var n=Vo.lastIndex=zo.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=Vo.exec(e))&&(i=zo.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=zo.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?Q1(l[0].x):K1(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"?Go(t):(n==="number"?ve:n==="string"?(r=on(t))?(t=r,ks):Rh:t instanceof on?ks:t instanceof Date?j1:q1(t)?Y1:Array.isArray(t)?X1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Z1: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,Wo={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 J1(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Wo:Ph(t.a,t.b,t.c,t.d,t.e,t.f)}function tE(e){return e==null||(Ps||(Ps=document.createElementNS("http://www.w3.org/2000/svg","g")),Ps.setAttribute("transform",e),!(e=Ps.transform.baseVal.consolidate()))?Wo:(e=e.matrix,Ph(e.a,e.b,e.c,e.d,e.e,e.f))}function Nh(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,m;++p<g;)d[(m=h[p]).i]=m.x(f);return d.join("")}}}var eE=Nh(J1,"px, ","px)","deg)"),nE=Nh(tE,", ",")",")");function rE(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var yr=0,gi=0,mi=0,$h=1e3,Ns,vi,$s=0,Vn=0,Fs=0,yi=typeof performance=="object"&&performance.now?performance:Date,Fh=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Yo(){return Vn||(Fh(iE),Vn=yi.now()+Fs)}function iE(){Vn=0}function Us(){this._call=this._time=this._next=null}Us.prototype=Uh.prototype={constructor:Us,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Yo():+n)+(t==null?0:+t),!this._next&&vi!==this&&(vi?vi._next=this:Ns=this,vi=this),this._call=e,this._time=n,qo()},stop:function(){this._call&&(this._call=null,this._time=1/0,qo())}};function Uh(e,t,n){var r=new Us;return r.restart(e,t,n),r}function sE(){Yo(),++yr;for(var e=Ns,t;e;)(t=Vn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--yr}function Bh(){Vn=($s=yi.now())+Fs,yr=gi=0;try{sE()}finally{yr=0,oE(),Vn=0}}function aE(){var e=yi.now(),t=e-$s;t>$h&&(Fs-=t,$s=e)}function oE(){for(var e,t=Ns,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:Ns=n);vi=e,qo(r)}function qo(e){if(!yr){gi&&(gi=clearTimeout(gi));var t=e-Vn;t>24?(e<1/0&&(gi=setTimeout(Bh,e-yi.now()-Fs)),mi&&(mi=clearInterval(mi))):(mi||($s=yi.now(),mi=setInterval(aE,$h)),yr=1,Fh(Bh))}}function Hh(e,t,n){var r=new Us;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var lE=Ro("start","end","cancel","interrupt"),cE=[],Gh=0,Vh=1,Xo=2,Bs=3,zh=4,jo=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;uE(e,n,{name:t,index:r,group:i,on:lE,tween:cE,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Gh})}function Zo(e,t){var n=Pe(e,t);if(n.state>Gh)throw new Error("too late; already scheduled");return n}function je(e,t){var n=Pe(e,t);if(n.state>Bs)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 uE(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Uh(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===Bs)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===Bs&&(n.state=zh,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=Xo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Xo){for(n.state=Bs,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=jo,1),d=-1,h=i.length;++d<h;)i[d].call(e,u);n.state===jo&&(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 Ko(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>Xo&&r.state<jo,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 hE(e){return this.each(function(){Ko(this,e)})}function dE(e,t){var n,r;return function(){var i=je(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 fE(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=je(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 pE(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?dE:fE)(n,e,t))}function Qo(e,t,n){var r=e._id;return e.each(function(){var i=je(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 on?ks:(n=on(t))?(t=n,ks):Rh)(e,t)}function gE(e){return function(){this.removeAttribute(e)}}function mE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function vE(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 yE(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 EE(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 bE(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"?nE:Wh;return this.attrTween(e,typeof t=="function"?(n.local?bE:EE)(n,r,Qo(this,"attr."+e,t)):t==null?(n.local?mE:gE)(n):(n.local?yE:vE)(n,r,t))}function _E(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function SE(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function TE(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&SE(e,s)),n}return i._value=t,i}function OE(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 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?TE:OE)(r,t))}function ME(e,t){return function(){Zo(this,e).delay=+t.apply(this,arguments)}}function AE(e,t){return t=+t,function(){Zo(this,e).delay=t}}function CE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ME:AE)(t,e)):Pe(this.node(),t).delay}function DE(e,t){return function(){je(this,e).duration=+t.apply(this,arguments)}}function LE(e,t){return t=+t,function(){je(this,e).duration=t}}function RE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?DE:LE)(t,e)):Pe(this.node(),t).duration}function IE(e,t){if(typeof t!="function")throw new Error;return function(){je(this,e).ease=t}}function kE(e){var t=this._id;return arguments.length?this.each(IE(t,e)):Pe(this.node(),t).ease}function PE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;je(this,e).ease=n}}function NE(e){if(typeof e!="function")throw new Error;return this.each(PE(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 ln(r,this._parents,this._name,this._id)}function FE(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 ln(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)?Zo:je;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function HE(e,t){var n=this._id;return arguments.length<2?Pe(this.node(),n).on.on(e):this.each(BE(n,e,t))}function GE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function VE(){return this.on("end.remove",GE(this._id))}function zE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ko(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 ln(s,this._parents,t,n)}function WE(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,m=h.length;g<m;++g)(f=h[g])&&Gs(f,t,n,g,h,p);s.push(h),a.push(u)}return new ln(s,a,t,n)}var YE=ui.prototype.constructor;function qE(){return new YE(this._groups,this._parents)}function XE(e,t){var n,r,i;return function(){var s=mr(this,e),a=(this.style.removeProperty(e),mr(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 jE(e,t,n){var r,i=n+"",s;return function(){var a=mr(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function ZE(e,t,n){var r,i,s;return function(){var a=mr(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),mr(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function KE(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=je(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 QE(e,t,n){var r=(e+="")=="transform"?eE:Wh;return t==null?this.styleTween(e,XE(e,r)).on("end.style."+e,Yh(e)):typeof t=="function"?this.styleTween(e,ZE(e,r,Qo(this,"style."+e,t))).each(KE(this._id,e)):this.styleTween(e,jE(e,r,t),n).on("end.style."+e,null)}function JE(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function tb(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&JE(e,a,n)),r}return s._value=t,s}function eb(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,tb(e,t,n??""))}function nb(e){return function(){this.textContent=e}}function rb(e){return function(){var t=e(this);this.textContent=t??""}}function ib(e){return this.tween("text",typeof e=="function"?rb(Qo(this,"text",e)):nb(e==null?"":e+""))}function sb(e){return function(t){this.textContent=e.call(this,t)}}function ab(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&sb(i)),t}return r._value=e,r}function ob(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,ab(e))}function lb(){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 ln(r,this._parents,e,n)}function cb(){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=je(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 ub=0;function ln(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function qh(){return++ub}var cn=ui.prototype;ln.prototype={constructor:ln,select:zE,selectAll:WE,selectChild:cn.selectChild,selectChildren:cn.selectChildren,filter:$E,merge:FE,selection:qE,transition:lb,call:cn.call,nodes:cn.nodes,node:cn.node,size:cn.size,empty:cn.empty,each:cn.each,on:HE,attr:xE,attrTween:wE,style:QE,styleTween:eb,text:ib,textTween:ob,remove:VE,tween:pE,delay:CE,duration:RE,ease:kE,easeVarying:NE,end:cb,[Symbol.iterator]:cn[Symbol.iterator]};const hb=e=>+e;function Xh(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var db={time:null,delay:0,duration:250,ease:Xh};function fb(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 pb(e){var t,n;e instanceof ln?(t=e._id,e=e._name):(t=qh(),(n=db).time=Yo(),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||fb(l,t));return new ln(r,this._parents,e,t)}ui.prototype.interrupt=hE,ui.prototype.transition=pb;const Jo=e=>()=>e;function gb(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 mb(e){e.stopImmediatePropagation()}function tl(e){e.preventDefault(),e.stopImmediatePropagation()}var jh={name:"drag"},el={name:"space"},Er={name:"handle"},br={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]]}},nl={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]]}},un={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"},vb={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},yb={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 Eb(e){return!e.ctrlKey&&!e.button}function bb(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function xb(){return navigator.maxTouchPoints||"ontouchstart"in this}function rl(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function _b(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function ed(){return Sb(Vs)}function Sb(e){var t=bb,n=Eb,r=xb,i=!0,s=Ro("start","brush","end"),a=6,o;function l(m){var v=m.property("__brush",g).selectAll(".overlay").data([zs("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",un.overlay).merge(v).each(function(){var y=rl(this).extent;I(this).attr("x",y[0][0]).attr("y",y[0][1]).attr("width",y[1][0]-y[0][0]).attr("height",y[1][1]-y[0][1])}),m.selectAll(".selection").data([zs("selection")]).enter().append("rect").attr("class","selection").attr("cursor",un.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var E=m.selectAll(".handle").data(e.handles,function(y){return y.type});E.exit().remove(),E.enter().append("rect").attr("class",function(y){return"handle handle--"+y.type}).attr("cursor",function(y){return un[y.type]}),m.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(m,v,E){m.tween?m.on("start.brush",function(y){u(this,arguments).beforestart().start(y)}).on("interrupt.brush end.brush",function(y){u(this,arguments).end(y)}).tween("brush",function(){var y=this,x=y.__brush,S=u(y,arguments),_=x.selection,A=e.input(typeof v=="function"?v.apply(this,arguments):v,x.extent),L=pi(_,A);function B(D){x.selection=D===1&&A===null?null:L(D),c.call(y),S.brush()}return _!==null&&A!==null?B:B(1)}):m.each(function(){var y=this,x=arguments,S=y.__brush,_=e.input(typeof v=="function"?v.apply(y,x):v,S.extent),A=u(y,x).beforestart();Ko(y),S.selection=_===null?null:_,c.call(y),A.start(E).brush(E).end(E)})},l.clear=function(m,v){l.move(m,null,v)};function c(){var m=I(this),v=rl(this).selection;v?(m.selectAll(".selection").style("display",null).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(E){return E.type[E.type.length-1]==="e"?v[1][0]-a/2:v[0][0]-a/2}).attr("y",function(E){return E.type[0]==="s"?v[1][1]-a/2:v[0][1]-a/2}).attr("width",function(E){return E.type==="n"||E.type==="s"?v[1][0]-v[0][0]+a:a}).attr("height",function(E){return E.type==="e"||E.type==="w"?v[1][1]-v[0][1]+a:a})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(m,v,E){var y=m.__brush.emitter;return y&&(!E||!y.clean)?y:new d(m,v,E)}function d(m,v,E){this.that=m,this.args=v,this.state=m.__brush,this.active=0,this.clean=E}d.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,v){return this.starting?(this.starting=!1,this.emit("start",m,v)):this.emit("brush",m),this},brush:function(m,v){return this.emit("brush",m,v),this},end:function(m,v){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,v)),this},emit:function(m,v,E){var y=I(this.that).datum();s.call(m,this.that,new gb(m,{sourceEvent:v,target:l,selection:e.output(this.state.selection),mode:E,dispatch:s}),y)}};function h(m){if(o&&!m.touches||!n.apply(this,arguments))return;var v=this,E=m.target.__data__.type,y=(i&&m.metaKey?E="overlay":E)==="selection"?jh:i&&m.altKey?br:Er,x=e===nl?null:vb[E],S=e===Vs?null:yb[E],_=rl(v),A=_.extent,L=_.selection,B=A[0][0],D,O,H=A[0][1],P,M,w=A[1][0],U,F,$=A[1][1],N,j,q=0,at=0,nt,dt=x&&S&&i&&m.shiftKey,mt,Z,et=Array.from(m.touches||[m],st=>{const kt=st.identifier;return st=Bn(st,v),st.point0=st.slice(),st.identifier=kt,st});Ko(v);var vt=u(v,arguments,!0).beforestart();if(E==="overlay"){L&&(nt=!0);const st=[et[0],et[1]||et[0]];_.selection=L=[[D=e===nl?B:Kt(st[0][0],st[1][0]),P=e===Vs?H:Kt(st[0][1],st[1][1])],[U=e===nl?w:Zt(st[0][0],st[1][0]),N=e===Vs?$:Zt(st[0][1],st[1][1])]],et.length>1&&V(m)}else D=L[0][0],P=L[0][1],U=L[1][0],N=L[1][1];O=D,M=P,F=U,j=N;var Y=I(v).attr("pointer-events","none"),K=Y.selectAll(".overlay").attr("cursor",un[E]);if(m.touches)vt.moved=C,vt.ended=z;else{var ot=I(m.view).on("mousemove.brush",C,!0).on("mouseup.brush",z,!0);i&&ot.on("keydown.brush",Mt,!0).on("keyup.brush",zt,!0),D1(m.view)}c.call(v),vt.start(m,y.name);function C(st){for(const kt of st.changedTouches||[st])for(const dr of et)dr.identifier===kt.identifier&&(dr.cur=Bn(kt,v));if(dt&&!mt&&!Z&&et.length===1){const kt=et[0];Zh(kt.cur[0]-kt[0])>Zh(kt.cur[1]-kt[1])?Z=!0:mt=!0}for(const kt of et)kt.cur&&(kt[0]=kt.cur[0],kt[1]=kt.cur[1]);nt=!0,tl(st),V(st)}function V(st){const kt=et[0],dr=kt.point0;var Le;switch(q=kt[0]-dr[0],at=kt[1]-dr[1],y){case el:case jh:{x&&(q=Zt(B-D,Kt(w-U,q)),O=D+q,F=U+q),S&&(at=Zt(H-P,Kt($-N,at)),M=P+at,j=N+at);break}case Er:{et[1]?(x&&(O=Zt(B,Kt(w,et[0][0])),F=Zt(B,Kt(w,et[1][0])),x=1),S&&(M=Zt(H,Kt($,et[0][1])),j=Zt(H,Kt($,et[1][1])),S=1)):(x<0?(q=Zt(B-D,Kt(w-D,q)),O=D+q,F=U):x>0&&(q=Zt(B-U,Kt(w-U,q)),O=D,F=U+q),S<0?(at=Zt(H-P,Kt($-P,at)),M=P+at,j=N):S>0&&(at=Zt(H-N,Kt($-N,at)),M=P,j=N+at));break}case br:{x&&(O=Zt(B,Kt(w,D-q*x)),F=Zt(B,Kt(w,U+q*x))),S&&(M=Zt(H,Kt($,P-at*S)),j=Zt(H,Kt($,N+at*S)));break}}F<O&&(x*=-1,Le=D,D=U,U=Le,Le=O,O=F,F=Le,E in Jh&&K.attr("cursor",un[E=Jh[E]])),j<M&&(S*=-1,Le=P,P=N,N=Le,Le=M,M=j,j=Le,E in td&&K.attr("cursor",un[E=td[E]])),_.selection&&(L=_.selection),mt&&(O=L[0][0],F=L[1][0]),Z&&(M=L[0][1],j=L[1][1]),(L[0][0]!==O||L[0][1]!==M||L[1][0]!==F||L[1][1]!==j)&&(_.selection=[[O,M],[F,j]],c.call(v),vt.brush(st,y.name))}function z(st){if(mb(st),st.touches){if(st.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else L1(st.view,nt),ot.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);Y.attr("pointer-events","all"),K.attr("cursor",un.overlay),_.selection&&(L=_.selection),_b(L)&&(_.selection=null,c.call(v)),vt.end(st,y.name)}function Mt(st){switch(st.keyCode){case 16:{dt=x&&S;break}case 18:{y===Er&&(x&&(U=F-q*x,D=O+q*x),S&&(N=j-at*S,P=M+at*S),y=br,V(st));break}case 32:{(y===Er||y===br)&&(x<0?U=F-q:x>0&&(D=O-q),S<0?N=j-at:S>0&&(P=M-at),y=el,K.attr("cursor",un.selection),V(st));break}default:return}tl(st)}function zt(st){switch(st.keyCode){case 16:{dt&&(mt=Z=dt=!1,V(st));break}case 18:{y===br&&(x<0?U=F:x>0&&(D=O),S<0?N=j:S>0&&(P=M),y=Er,V(st));break}case 32:{y===el&&(st.altKey?(x&&(U=F-q*x,D=O+q*x),S&&(N=j-at*S,P=M+at*S),y=br):(x<0?U=F:x>0&&(D=O),S<0?N=j:S>0&&(P=M),y=Er),K.attr("cursor",un[E]),V(st));break}default:return}tl(st)}}function f(m){u(this,arguments).moved(m)}function p(m){u(this,arguments).ended(m)}function g(){var m=this.__brush||{selection:null};return m.extent=Qh(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:Jo(Qh(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:Jo(!!m),l):n},l.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:Jo(!!m),l):r},l.handleSize=function(m){return arguments.length?(a=+m,l):a},l.keyModifiers=function(m){return arguments.length?(i=!!m,l):i},l.on=function(){var m=s.on.apply(s,arguments);return m===s?l:m},l}const il=Math.PI,sl=2*il,zn=1e-6,Tb=sl-zn;function nd(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Ob(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 wb=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?nd:Ob(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>zn)if(!(Math.abs(d*l-c*u)>zn)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let f=r-a,p=i-o,g=l*l+c*c,m=f*f+p*p,v=Math.sqrt(g),E=Math.sqrt(h),y=s*Math.tan((il-Math.acos((g+h-m)/(2*v*E)))/2),x=y/E,S=y/v;Math.abs(x-1)>zn&&this._append`L${t+x*u},${n+x*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)>zn||Math.abs(this._y1-u)>zn)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%sl+sl),h>Tb?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>zn&&this._append`A${r},${r},0,${+(h>=il)},${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 Mb(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 Ab(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 Cb(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Db=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ei(e){if(!(t=Db.exec(e)))throw new Error("invalid format: "+e);var t;return new al({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=al.prototype;function al(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+""}al.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 Lb(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 Rb(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:Mb,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:Rb,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 Ib(e){var t=e.grouping===void 0||e.thousands===void 0?ad:Ab(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:Cb(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,m=d.zero,v=d.width,E=d.comma,y=d.precision,x=d.trim,S=d.type;S==="n"?(E=!0,S="g"):sd[S]||(y===void 0&&(y=12),x=!0,S="g"),(m||h==="0"&&f==="=")&&(m=!0,h="0",f="=");var _=g==="$"?n:g==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",A=g==="$"?r:/[%p]/.test(S)?a:"",L=sd[S],B=/[defgprs%]/.test(S);y=y===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y));function D(O){var H=_,P=A,M,w,U;if(S==="c")P=L(O)+P,O="";else{O=+O;var F=O<0||1/O<0;if(O=isNaN(O)?l:L(Math.abs(O),y),x&&(O=Lb(O)),F&&+O==0&&p!=="+"&&(F=!1),H=(F?p==="("?p:o:p==="-"||p==="("?"":p)+H,P=(S==="s"?ld[8+rd/3]:"")+P+(F&&p==="("?")":""),B){for(M=-1,w=O.length;++M<w;)if(U=O.charCodeAt(M),48>U||U>57){P=(U===46?i+O.slice(M+1):O.slice(M))+P,O=O.slice(0,M);break}}}E&&!m&&(O=t(O,1/0));var $=H.length+O.length+P.length,N=$<v?new Array(v-$+1).join(h):"";switch(E&&m&&(O=t(N+O,N.length?v-P.length:1/0),N=""),f){case"<":O=H+O+P+N;break;case"=":O=H+N+O+P;break;case"^":O=N.slice(0,$=N.length>>1)+H+O+P+N.slice($);break;default:O=N+H+O+P;break}return s(O)}return D.toString=function(){return d+""},D}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),m=ld[8+p/3];return function(v){return f(g*v)+m}}return{format:c,formatPrefix:u}}var Ys,ol,cd;kb({thousands:",",grouping:[3],currency:["$",""]});function kb(e){return Ys=Ib(e),ol=Ys.format,cd=Ys.formatPrefix,Ys}function Pb(e){return Math.max(0,-xr(Math.abs(e)))}function Nb(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(xr(t)/3)))*3-xr(Math.abs(e)))}function $b(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,xr(t)-xr(e))+1}var St=1e-6,ud=1e-12,ft=Math.PI,ce=ft/2,hd=ft/4,ye=ft*2,re=180/ft,$t=ft/180,Tt=Math.abs,dd=Math.atan,Wn=Math.atan2,wt=Math.cos,Fb=Math.exp,Ub=Math.log,xt=Math.sin,Cn=Math.sign||function(e){return e>0?1:e<0?-1:0},Ne=Math.sqrt,Bb=Math.tan;function Hb(e){return e>1?0:e<-1?ft:Math.acos(e)}function hn(e){return e>1?ce:e<-1?-ce:Math.asin(e)}function Oe(){}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){ll(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)ll(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 ll(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;)ll(e[n],t,1);t.polygonEnd()}function _r(e,t){e&&fd.hasOwnProperty(e.type)?fd[e.type](e,t):qs(e,t)}function cl(e){return[Wn(e[1],e[0]),hn(e[2])]}function Sr(e){var t=e[0],n=e[1],r=wt(n);return[r*wt(t),r*xt(t),xt(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 ul(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 hl(e){var t=Ne(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function dl(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 fl(e,t){return Tt(e)>ft&&(e-=Math.round(e/ye)*ye),[e,t]}fl.invert=fl;function md(e,t,n){return(e%=ye)?t||n?dl(yd(e),Ed(t,n)):yd(e):t||n?Ed(t,n):fl}function vd(e){return function(t,n){return t+=e,Tt(t)>ft&&(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=wt(e),r=xt(e),i=wt(t),s=xt(t);function a(o,l){var c=wt(l),u=wt(o)*c,d=xt(o)*c,h=xt(l),f=h*n+u*r;return[Wn(d*i-f*s,u*n-h*r),hn(f*i+d*s)]}return a.invert=function(o,l){var c=wt(l),u=wt(o)*c,d=xt(o)*c,h=xt(l),f=h*i-d*s;return[Wn(d*i+h*s,u*n+f*r),hn(f*n-u*r)]},a}function Gb(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 Vb(e,t,n,r,i,s){if(n){var a=wt(t),o=xt(t),l=r*n;i==null?(i=t+r*ye,s=t-l/2):(i=bd(a,i),s=bd(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=cl([a,-o*wt(u),-o*xt(u)]),e.point(c[0],c[1])}}function bd(e,t){t=Sr(t),t[0]-=e,hl(t);var n=Hb(-t[1]);return((-t[2]<0?-n:n)+ye-St)%ye}function xd(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Oe,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Ks(e,t){return Tt(e[0]-t[0])<St&&Tt(e[1]-t[1])<St}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,m=p[0],v=p[g],E;if(Ks(m,v)){if(!m[2]&&!v[2]){for(i.lineStart(),o=0;o<g;++o)i.point((m=p[o])[0],m[1]);i.lineEnd();return}v[0]+=2*St}s.push(E=new Qs(m,p,null,!0)),a.push(E.o=new Qs(m,null,E,!1)),s.push(E=new Qs(v,p,null,!1)),a.push(E.o=new Qs(v,null,E,!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 pl(e){return Tt(e[0])<=ft?e[0]:Cn(e[0])*((Tt(e[0])+ft)%ye-ft)}function zb(e,t){var n=pl(t),r=t[1],i=xt(r),s=[xt(n),-wt(n),0],a=0,o=0,l=new Fn;i===1?r=ce+St:i===-1&&(r=-ce-St);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=pl(f),g=f[1]/2+hd,m=xt(g),v=wt(g),E=0;E<h;++E,p=x,m=_,v=A,f=y){var y=d[E],x=pl(y),S=y[1]/2+hd,_=xt(S),A=wt(S),L=x-p,B=L>=0?1:-1,D=B*L,O=D>ft,H=m*_;if(l.add(Wn(H*B*xt(D),v*A+H*wt(D))),a+=O?L+B*ye:L,O^p>=n^x>=n){var P=js(Sr(f),Sr(y));hl(P);var M=js(s,P);hl(M);var w=(O^L>=0?-1:1)*hn(M[2]);(r>w||r===w&&(P[0]||P[1]))&&(o+=O^L>=0?1:-1)}}return(a<-St||a<St&&l<-ud)^o&1}function Td(e,t,n,r){return function(i){var s=t(i),a=xd(),o=t(a),l=!1,c,u,d,h={point:f,lineStart:g,lineEnd:m,polygonStart:function(){h.point=v,h.lineStart=E,h.lineEnd=y,u=[],c=[]},polygonEnd:function(){h.point=f,h.lineStart=g,h.lineEnd=m,u=ih(u);var x=zb(c,r);u.length?(l||(i.polygonStart(),l=!0),_d(u,Yb,x,n,i)):x&&(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(x,S){e(x,S)&&i.point(x,S)}function p(x,S){s.point(x,S)}function g(){h.point=p,s.lineStart()}function m(){h.point=f,s.lineEnd()}function v(x,S){d.push([x,S]),o.point(x,S)}function E(){o.lineStart(),d=[]}function y(){v(d[0][0],d[0][1]),o.lineEnd();var x=o.clean(),S=a.result(),_,A=S.length,L,B,D;if(d.pop(),c.push(d),d=null,!!A){if(x&1){if(B=S[0],(L=B.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),_=0;_<L;++_)i.point((D=B[_])[0],D[1]);i.lineEnd()}return}A>1&&x&2&&S.push(S.pop().concat(S.shift())),u.push(S.filter(Wb))}}return h}}function Wb(e){return e.length>1}function Yb(e,t){return((e=e.x)[0]<0?e[1]-ce-St:ce-e[1])-((t=t.x)[0]<0?t[1]-ce-St:ce-t[1])}const Od=Td(function(){return!0},qb,jb,[-ft,-ce]);function qb(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,a){var o=s>0?ft:-ft,l=Tt(s-t);Tt(l-ft)<St?(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>=ft&&(Tt(t-r)<St&&(t-=r*St),Tt(s-o)<St&&(s-=o*St),n=Xb(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 Xb(e,t,n,r){var i,s,a=xt(e-n);return Tt(a)>St?dd((xt(t)*(s=wt(r))*xt(n)-xt(r)*(i=wt(t))*xt(e))/(i*s*a)):(t+r)/2}function jb(e,t,n,r){var i;if(e==null)i=n*ce,r.point(-ft,i),r.point(0,i),r.point(ft,i),r.point(ft,0),r.point(ft,-i),r.point(0,-i),r.point(-ft,-i),r.point(-ft,0),r.point(-ft,i);else if(Tt(e[0]-t[0])>St){var s=e[0]<t[0]?ft:-ft;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function Zb(e){var t=wt(e),n=6*$t,r=t>0,i=Tt(t)>St;function s(u,d,h,f){Vb(f,e,n,h,u,d)}function a(u,d){return wt(u)*wt(d)>t}function o(u){var d,h,f,p,g;return{lineStart:function(){p=f=!1,g=1},point:function(m,v){var E=[m,v],y,x=a(m,v),S=r?x?0:c(m,v):x?c(m+(m<0?ft:-ft),v):0;if(!d&&(p=f=x)&&u.lineStart(),x!==f&&(y=l(d,E),(!y||Ks(d,y)||Ks(E,y))&&(E[2]=1)),x!==f)g=0,x?(u.lineStart(),y=l(E,d),u.point(y[0],y[1])):(y=l(d,E),u.point(y[0],y[1],2),u.lineEnd()),d=y;else if(i&&d&&r^x){var _;!(S&h)&&(_=l(E,d,!0))&&(g=0,r?(u.lineStart(),u.point(_[0][0],_[0][1]),u.point(_[1][0],_[1][1]),u.lineEnd()):(u.point(_[1][0],_[1][1]),u.lineEnd(),u.lineStart(),u.point(_[0][0],_[0][1],3)))}x&&(!d||!Ks(d,E))&&u.point(E[0],E[1]),d=E,f=x,h=S},lineEnd:function(){f&&u.lineEnd(),d=null},clean:function(){return g|(p&&f)<<1}}}function l(u,d,h){var f=Sr(u),p=Sr(d),g=[1,0,0],m=js(f,p),v=Xs(m,m),E=m[0],y=v-E*E;if(!y)return!h&&u;var x=t*v/y,S=-t*E/y,_=js(g,m),A=Zs(g,x),L=Zs(m,S);ul(A,L);var B=_,D=Xs(A,B),O=Xs(B,B),H=D*D-O*(Xs(A,A)-1);if(!(H<0)){var P=Ne(H),M=Zs(B,(-D-P)/O);if(ul(M,A),M=cl(M),!h)return M;var w=u[0],U=d[0],F=u[1],$=d[1],N;U<w&&(N=w,w=U,U=N);var j=U-w,q=Tt(j-ft)<St,at=q||j<St;if(!q&&$<F&&(N=F,F=$,$=N),at?q?F+$>0^M[1]<(Tt(M[0]-w)<St?F:$):F<=M[1]&&M[1]<=$:j>ft^(w<=M[0]&&M[0]<=U)){var nt=Zs(B,(-D+P)/O);return ul(nt,A),[M,cl(nt)]}}}function c(u,d){var h=r?e:ft-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]:[-ft,e-ft])}function Kb(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 bi=1e9,Js=-bi;function Qb(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 Tt(c[0]-e)<St?u>0?0:3:Tt(c[0]-n)<St?u>0?2:1:Tt(c[1]-t)<St?u>0?1:0:u>0?3:2}function o(c,u){return l(c.x,u.x)}function l(c,u){var 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=xd(),h,f,p,g,m,v,E,y,x,S,_,A={point:L,lineStart:H,lineEnd:P,polygonStart:D,polygonEnd:O};function L(w,U){i(w,U)&&u.point(w,U)}function B(){for(var w=0,U=0,F=f.length;U<F;++U)for(var $=f[U],N=1,j=$.length,q=$[0],at,nt,dt=q[0],mt=q[1];N<j;++N)at=dt,nt=mt,q=$[N],dt=q[0],mt=q[1],nt<=r?mt>r&&(dt-at)*(r-nt)>(mt-nt)*(e-at)&&++w:mt<=r&&(dt-at)*(r-nt)<(mt-nt)*(e-at)&&--w;return w}function D(){u=d,h=[],f=[],_=!0}function O(){var w=B(),U=_&&w,F=(h=ih(h)).length;(U||F)&&(c.polygonStart(),U&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),F&&_d(h,o,w,s,c),c.polygonEnd()),u=c,h=f=p=null}function H(){A.point=M,f&&f.push(p=[]),S=!0,x=!1,E=y=NaN}function P(){h&&(M(g,m),v&&x&&d.rejoin(),h.push(d.result())),A.point=L,x&&u.lineEnd()}function M(w,U){var F=i(w,U);if(f&&p.push([w,U]),S)g=w,m=U,v=F,S=!1,F&&(u.lineStart(),u.point(w,U));else if(F&&x)u.point(w,U);else{var $=[E=Math.max(Js,Math.min(bi,E)),y=Math.max(Js,Math.min(bi,y))],N=[w=Math.max(Js,Math.min(bi,w)),U=Math.max(Js,Math.min(bi,U))];Kb($,N,e,t,n,r)?(x||(u.lineStart(),u.point($[0],$[1])),u.point(N[0],N[1]),F||u.lineEnd(),_=!1):F&&(u.lineStart(),u.point(w,U),_=!1)}E=w,y=U,x=F}return A}}const gl=e=>e;var ml=new Fn,vl=new Fn,wd,Md,yl,El,Dn={point:Oe,lineStart:Oe,lineEnd:Oe,polygonStart:function(){Dn.lineStart=Jb,Dn.lineEnd=ex},polygonEnd:function(){Dn.lineStart=Dn.lineEnd=Dn.point=Oe,ml.add(Tt(vl)),vl=new Fn},result:function(){var e=ml/2;return ml=new Fn,e}};function Jb(){Dn.point=tx}function tx(e,t){Dn.point=Ad,wd=yl=e,Md=El=t}function Ad(e,t){vl.add(El*e-yl*t),yl=e,El=t}function ex(){Ad(wd,Md)}const Cd=Dn;var Tr=1/0,ta=Tr,xi=-Tr,ea=xi,nx={point:rx,lineStart:Oe,lineEnd:Oe,polygonStart:Oe,polygonEnd:Oe,result:function(){var e=[[Tr,ta],[xi,ea]];return xi=ea=-(ta=Tr=1/0),e}};function rx(e,t){e<Tr&&(Tr=e),e>xi&&(xi=e),t<ta&&(ta=t),t>ea&&(ea=t)}const na=nx;var bl=0,xl=0,_i=0,ra=0,ia=0,Or=0,_l=0,Sl=0,Si=0,Dd,Ld,Ze,Ke,$e={point:Yn,lineStart:Rd,lineEnd:Id,polygonStart:function(){$e.lineStart=ax,$e.lineEnd=ox},polygonEnd:function(){$e.point=Yn,$e.lineStart=Rd,$e.lineEnd=Id},result:function(){var e=Si?[_l/Si,Sl/Si]:Or?[ra/Or,ia/Or]:_i?[bl/_i,xl/_i]:[NaN,NaN];return bl=xl=_i=ra=ia=Or=_l=Sl=Si=0,e}};function Yn(e,t){bl+=e,xl+=t,++_i}function Rd(){$e.point=ix}function ix(e,t){$e.point=sx,Yn(Ze=e,Ke=t)}function sx(e,t){var n=e-Ze,r=t-Ke,i=Ne(n*n+r*r);ra+=i*(Ze+e)/2,ia+=i*(Ke+t)/2,Or+=i,Yn(Ze=e,Ke=t)}function Id(){$e.point=Yn}function ax(){$e.point=lx}function ox(){kd(Dd,Ld)}function lx(e,t){$e.point=kd,Yn(Dd=Ze=e,Ld=Ke=t)}function kd(e,t){var n=e-Ze,r=t-Ke,i=Ne(n*n+r*r);ra+=i*(Ze+e)/2,ia+=i*(Ke+t)/2,Or+=i,i=Ke*e-Ze*t,_l+=i*(Ze+e),Sl+=i*(Ke+t),Si+=i*3,Yn(Ze=e,Ke=t)}const Pd=$e;function Nd(e){this._context=e}Nd.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:Oe};var Tl=new Fn,Ol,$d,Fd,Ti,Oi,sa={point:Oe,lineStart:function(){sa.point=cx},lineEnd:function(){Ol&&Ud($d,Fd),sa.point=Oe},polygonStart:function(){Ol=!0},polygonEnd:function(){Ol=null},result:function(){var e=+Tl;return Tl=new Fn,e}};function cx(e,t){sa.point=Ud,$d=Ti=e,Fd=Oi=t}function Ud(e,t){Ti-=e,Oi-=t,Tl.add(Ne(Ti*Ti+Oi*Oi)),Ti=e,Oi=t}const Bd=sa;let Hd,aa,Gd,Vd;class zd{constructor(t){this._append=t==null?Wd:ux(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==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 ux(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 hx(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),_r(o,i(s))),s.result()}return a.area=function(o){return _r(o,i(Cd)),Cd.result()},a.measure=function(o){return _r(o,i(Bd)),Bd.result()},a.bounds=function(o){return _r(o,i(na)),na.result()},a.centroid=function(o){return _r(o,i(Pd)),Pd.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,gl):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new zd(n)):new Nd(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 wl(e){return function(t){var n=new Ml;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Ml(){}Ml.prototype={constructor:Ml,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 Al(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),_r(n,e.stream(na)),t(na.result()),r!=null&&e.clipExtent(r),e}function Yd(e,t,n){return Al(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 dx(e,t,n){return Yd(e,[[0,0],t],n)}function fx(e,t,n){return Al(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 px(e,t,n){return Al(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,gx=wt(30*$t);function Xd(e,t){return+t?vx(e,t):mx(e)}function mx(e){return wl({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function vx(e,t){function n(r,i,s,a,o,l,c,u,d,h,f,p,g,m){var v=c-r,E=u-i,y=v*v+E*E;if(y>4*t&&g--){var x=a+h,S=o+f,_=l+p,A=Ne(x*x+S*S+_*_),L=hn(_/=A),B=Tt(Tt(_)-1)<St||Tt(s-d)<St?(s+d)/2:Wn(S,x),D=e(B,L),O=D[0],H=D[1],P=O-r,M=H-i,w=E*P-v*M;(w*w/y>t||Tt((v*P+E*M)/y-.5)>.3||a*h+o*f+l*p<gx)&&(n(r,i,s,a,o,l,O,H,B,x/=A,S/=A,_,g,m),m.point(O,H),n(O,H,B,x,S,_,c,u,d,h,f,p,g,m))}}return function(r){var i,s,a,o,l,c,u,d,h,f,p,g,m={point:v,lineStart:E,lineEnd:x,polygonStart:function(){r.polygonStart(),m.lineStart=S},polygonEnd:function(){r.polygonEnd(),m.lineStart=E}};function v(L,B){L=e(L,B),r.point(L[0],L[1])}function E(){d=NaN,m.point=y,r.lineStart()}function y(L,B){var D=Sr([L,B]),O=e(L,B);n(d,h,u,f,p,g,d=O[0],h=O[1],u=L,f=D[0],p=D[1],g=D[2],qd,r),r.point(d,h)}function x(){m.point=v,r.lineEnd()}function S(){E(),m.point=_,m.lineEnd=A}function _(L,B){y(i=L,B),s=d,a=h,o=f,l=p,c=g,m.point=y}function A(){n(d,h,u,f,p,g,s,a,i,o,l,c,qd,r),m.lineEnd=x,x()}return m}}var yx=wl({point:function(e,t){this.stream.point(e*$t,t*$t)}});function Ex(e){return wl({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function bx(e,t,n,r,i){function s(a,o){return a*=r,o*=i,[t+e*a,n-e*o]}return s.invert=function(a,o){return[(a-t)/e*r,(n-o)/e*i]},s}function jd(e,t,n,r,i,s){if(!s)return bx(e,t,n,r,i);var a=wt(s),o=xt(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,m){return g*=r,m*=i,[l*g-c*m+t,n-c*g-l*m]}return p.invert=function(g,m){return[r*(u*g-d*m+h),i*(f-d*g-u*m)]},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=Od,m=null,v,E,y,x=gl,S=.5,_,A,L,B,D;function O(w){return L(w[0]*$t,w[1]*$t)}function H(w){return w=L.invert(w[0],w[1]),w&&[w[0]*re,w[1]*re]}O.stream=function(w){return B&&D===w?B:B=yx(Ex(u)(g(_(x(D=w)))))},O.preclip=function(w){return arguments.length?(g=w,p=void 0,M()):g},O.postclip=function(w){return arguments.length?(x=w,m=v=E=y=null,M()):x},O.clipAngle=function(w){return arguments.length?(g=+w?Zb(p=w*$t):(p=null,Od),M()):p*re},O.clipExtent=function(w){return arguments.length?(x=w==null?(m=v=E=y=null,gl):Qb(m=+w[0][0],v=+w[0][1],E=+w[1][0],y=+w[1][1]),M()):m==null?null:[[m,v],[E,y]]},O.scale=function(w){return arguments.length?(n=+w,P()):n},O.translate=function(w){return arguments.length?(r=+w[0],i=+w[1],P()):[r,i]},O.center=function(w){return arguments.length?(s=w[0]%360*$t,a=w[1]%360*$t,P()):[s*re,a*re]},O.rotate=function(w){return arguments.length?(o=w[0]%360*$t,l=w[1]%360*$t,c=w.length>2?w[2]%360*$t:0,P()):[o*re,l*re,c*re]},O.angle=function(w){return arguments.length?(d=w%360*$t,P()):d*re},O.reflectX=function(w){return arguments.length?(h=w?-1:1,P()):h<0},O.reflectY=function(w){return arguments.length?(f=w?-1:1,P()):f<0},O.precision=function(w){return arguments.length?(_=Xd(A,S=w*w),M()):Ne(S)},O.fitExtent=function(w,U){return Yd(O,w,U)},O.fitSize=function(w,U){return dx(O,w,U)},O.fitWidth=function(w,U){return fx(O,w,U)},O.fitHeight=function(w,U){return px(O,w,U)};function P(){var w=jd(n,0,0,h,f,d).apply(null,t(s,a)),U=jd(n,r-w[0],i-w[1],h,f,d);return u=md(o,l,c),A=dl(t,U),L=dl(u,A),_=Xd(A,S),M()}function M(){return B=D=null,O}return function(){return t=e.apply(this,arguments),O.invert=t.invert&&H,P()}}function Kd(e){var t=0,n=ft/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 xx(e){var t=wt(e);function n(r,i){return[r*t,xt(i)/t]}return n.invert=function(r,i){return[r/t,hn(i*t)]},n}function _x(e,t){var n=xt(e),r=(n+xt(t))/2;if(Tt(r)<St)return xx(e);var i=1+n*(2*r-n),s=Ne(i)/r;function a(o,l){var c=Ne(i-2*r*xt(l))/r;return[c*xt(o*=r),s-c*wt(o)]}return a.invert=function(o,l){var c=s-l,u=Wn(o,Tt(c))*Cn(c);return c*r<0&&(u-=ft*Cn(o)*Cn(c)),[u/r,hn((i-(o*o+c*c)*r*r)/(2*r))]},a}function Qd(){return Kd(_x).scale(155.424).center([0,33.6442])}function Sx(){return Qd().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Cl(e,t){return[e,Ub(Bb((ce+t)/2))]}Cl.invert=function(e,t){return[e,2*dd(Fb(t))-ce]};function Tx(){return Ox(Cl).scale(961/ye)}function Ox(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=ft*r(),h=t(Gb(t.rotate()).invert([0,0]));return s(a==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===Cl?[[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 wx(){return oa(la).scale(152.63)}function Mx(e,t){var n=wt(e),r=e===t?xt(e):(n-wt(t))/(t-e),i=n/r+e;if(Tt(r)<St)return la;function s(a,o){var l=i-o,c=r*a;return[l*xt(c),i-l*wt(c)]}return s.invert=function(a,o){var l=i-o,c=Wn(a,Tt(l))*Cn(l);return l*r<0&&(c-=ft*Cn(a)*Cn(l)),[c/r,i-Cn(r)*Ne(a*a+l*l)]},s}function Ax(){return Kd(Mx).scale(131.154).center([0,13.9389])}var wi=1.340264,Mi=-.081106,Ai=893e-6,Ci=.003796,ca=Ne(3)/2,Cx=12;function Jd(e,t){var n=hn(ca*xt(t)),r=n*n,i=r*r*r;return[e*wt(n)/(ca*(wi+3*Mi*r+i*(7*Ai+9*Ci*r))),n*(wi+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<Cx&&(o=n*(wi+Mi*r+i*(Ai+Ci*r))-t,l=wi+3*Mi*r+i*(7*Ai+9*Ci*r),n-=a=o/l,r=n*n,i=r*r*r,!(Tt(a)<ud));++s);return[ca*e*(wi+3*Mi*r+i*(7*Ai+9*Ci*r))/wt(n),hn(xt(n)/ca)]};function Dx(){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(Tt(i)>St&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function Lx(){return oa(tf).scale(175.295)}function Rx(e,t){return e.parent===t.parent?1:2}function Ix(e){return e.reduce(kx,0)/e.length}function kx(e,t){return e+t.x}function Px(e){return 1+e.reduce(Nx,0)}function Nx(e,t){return Math.max(e,t.y)}function $x(e){for(var t;t=e.children;)e=t[0];return e}function Fx(e){for(var t;t=e.children;)e=t[t.length-1];return e}function Ux(){var e=Rx,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(h){var f=h.children;f?(h.x=Ix(f),h.y=Px(f)):(h.x=a?o+=e(h,a):0,h.y=0,a=h)});var l=$x(s),c=Fx(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 Bx(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 Hx(){return this.eachAfter(Bx)}function Gx(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function Vx(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 zx(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 Wx(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function Yx(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 qx(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Xx(e){for(var t=this,n=jx(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 jx(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 Zx(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Kx(){return Array.from(this)}function Qx(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Jx(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*t_(){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=r_)):t===void 0&&(t=n_);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(s_)}function e_(){return Di(this).eachBefore(i_)}function n_(e){return e.children}function r_(e){return Array.isArray(e)?e[1]:null}function i_(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function s_(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:Hx,each:Gx,eachAfter:zx,eachBefore:Vx,find:Wx,sum:Yx,sort:qx,path:Xx,ancestors:Zx,descendants:Kx,leaves:Qx,links:Jx,copy:e_,[Symbol.iterator]:t_};function a_(e){return e==null?null:ef(e)}function ef(e){if(typeof e!="function")throw new Error;return e}function qn(){return 0}function wr(e){return function(){return e}}const o_=1664525,l_=1013904223,nf=4294967296;function c_(){let e=1;return()=>(e=(o_*e+l_)%nf)/nf}function u_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function h_(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 d_(e,t){for(var n=0,r=(e=h_(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&rf(a,s)?++n:(a=p_(i=f_(i,s)),n=0);return a}function f_(e,t){var n,r;if(Dl(t,e))return[t];for(n=0;n<e.length;++n)if(ua(t,e[n])&&Dl(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])&&Dl(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 Dl(e,t){for(var n=0;n<t.length;++n)if(!rf(e,t[n]))return!1;return!0}function p_(e){switch(e.length){case 1:return g_(e[0]);case 2:return Ri(e[0],e[1]);case 3:return sf(e[0],e[1],e[2])}}function g_(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,m=l-s,v=d-s,E=r*r+i*i-s*s,y=E-a*a-o*o+l*l,x=E-c*c-u*u+d*d,S=f*p-h*g,_=(p*x-g*y)/(S*2)-r,A=(g*m-p*v)/S,L=(f*y-h*x)/(S*2)-i,B=(h*v-f*m)/S,D=A*A+B*B-1,O=2*(s+_*A+L*B),H=_*_+L*L-s*s,P=-(Math.abs(D)>1e-6?(O+Math.sqrt(O*O-4*D*H))/(2*D):H/O);return{x:r+_+A*P,y:i+L+B*P,r:P}}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 m_(e,t){if(!(s=(e=u_(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=d_(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function v_(e){return Math.sqrt(e.value)}function y_(){var e=null,t=1,n=1,r=qn;function i(s){const a=c_();return s.x=t/2,s.y=n/2,e?s.eachBefore(cf(e)).eachAfter(Ll(r,.5,a)).eachBefore(uf(1)):s.eachBefore(cf(v_)).eachAfter(Ll(qn,1,a)).eachAfter(Ll(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=a_(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 Ll(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=m_(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 E_(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 b_(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 Rl(e){var t=e.children;return t?t[0]:e.t}function Il(e){var t=e.children;return t?t[t.length-1]:e.t}function __(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 S_(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 T_(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 O_(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=O_(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(E){E.x<d.x&&(d=E),E.x>h.x&&(h=E),E.depth>f.depth&&(f=E)});var p=d===h?1:e(d,h)/2,g=p-d.x,m=t/(h.x+p+g),v=n/(f.depth||1);c.eachBefore(function(E){E.x=(E.x+g)*m,E.y=E.depth*v})}return c}function s(c){var u=c.children,d=c.parent.children,h=c.i?d[c.i-1]:null;if(u){S_(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],m=h.m,v=f.m,E=p.m,y=g.m,x;p=Il(p),h=Rl(h),p&&h;)g=Rl(g),f=Il(f),f.a=c,x=p.z+E-h.z-m+e(p._,h._),x>0&&(__(T_(p,c,d),c,x),m+=x,v+=x),E+=p.m,m+=h.m,y+=g.m,v+=f.m;p&&!Il(f)&&(f.t=p,f.m+=E-v),h&&!Rl(g)&&(g.t=h,g.m+=m-y,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 M_(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 A_=(1+Math.sqrt(5))/2;function C_(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,m,v,E,y,x,S,_;u<h;){f=i-n,p=s-r;do m=o[d++].value;while(!m&&d<h);for(v=E=m,S=Math.max(p/f,f/p)/(g*e),_=m*m*S,x=Math.max(E/_,_/v);d<h;++d){if(m+=c=o[d].value,c<v&&(v=c),c>E&&(E=c),_=m*m*S,y=Math.max(E/_,_/v),y>x){m-=c;break}x=y}a.push(l={value:m,dice:f<p,children:o.slice(u,d)}),l.dice?b_(l,n,r,i,g?r+=p*m/g:s):M_(l,n,r,g?n+=f*m/g:i,s),g-=m,u=d}return a}const D_=function e(t){function n(r,i,s,a,o){C_(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(A_);function L_(){var e=D_,t=!1,n=1,r=1,i=[0],s=qn,a=qn,o=qn,l=qn,c=qn;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],t&&h.eachBefore(E_),h}function d(h){var f=i[h.depth],p=h.x0+f,g=h.y0+f,m=h.x1-f,v=h.y1-f;m<p&&(p=m=(p+m)/2),v<g&&(g=v=(g+v)/2),h.x0=p,h.y0=g,h.x1=m,h.y1=v,h.children&&(f=i[h.depth+1]=s(h)/2,p+=c(h)-f,g+=a(h)-f,m-=o(h)-f,v-=l(h)-f,m<p&&(p=m=(p+m)/2),v<g&&(g=v=(g+v)/2),e(h,p,g,m,v))}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 Mr(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)},Mr.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 m=U0(h).map(function(v){return p+s*v});return n(f?m.reverse():m)}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)},Mr.apply(d(),arguments)}function R_(e){return function(){return e}}function I_(e){return+e}var df=[0,1];function Ar(e){return e}function kl(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:R_(isNaN(t)?NaN:.5)}function k_(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function P_(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=kl(i,r),s=n(a,s)):(r=kl(r,i),s=n(s,a)),function(o){return s(r(o))}}function N_(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]=kl(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=wo(e,o,1,r)-1;return s[l](i[l](o))}}function Pl(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function ff(){var e=df,t=df,n=pi,r,i,s,a=Ar,o,l,c;function u(){var h=Math.min(e.length,t.length);return a!==Ar&&(a=k_(e[0],e[h-1])),o=h>2?N_:P_,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,I_),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:Ar,u()):a!==Ar},d.interpolate=function(h){return arguments.length?(n=h,u()):n},d.unknown=function(h){return arguments.length?(s=h,d):s},function(h,f){return r=h,i=f,u()}}function pf(){return ff()(Ar,Ar)}function $_(e,t,n,r){var i=Ao(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=Nb(i,a))&&(r.precision=s),cd(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=$b(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=Pb(i))&&(r.precision=s-(r.type==="%")*2);break}}return ol(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=gr(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 Fe(){var e=pf();return e.copy=function(){return Pl(e,Fe())},Mr.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 F_(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 H_(e){return e===10?B_:e===Math.E?Math.exp:t=>Math.pow(e,t)}function G_(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 V_(e){const t=e(vf,yf),n=t.domain;let r=10,i,s;function a(){return i=G_(r),s=H_(r),n()[0]<0?(i=Ef(i),s=Ef(s),e(F_,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 m=o==null?10:+o;let v=[];if(!(r%1)&&f-h<m){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;v.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;v.push(g)}v.length*2<m&&(v=Ss(c,u,m))}else v=Ss(h,f,Math.min(f-h,m)).map(s);return d?v.reverse():v},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=ol(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 bf(){const e=V_(ff()).domain([1,10]);return e.copy=()=>Pl(e,bf()).base(e.base()),Mr.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[wo(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)},Mr.apply(gf(a),arguments)}const $l=new Date,Fl=new Date;function Wt(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=>Wt(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)=>($l.setTime(+s),Fl.setTime(+a),e($l),e(Fl),Math.floor(n($l,Fl))),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=Wt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);pa.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Wt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):pa),pa.range;const dn=1e3,we=dn*60,fn=we*60,pn=fn*24,Ul=pn*7,xf=pn*30,Bl=pn*365,Cr=Wt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*dn)},(e,t)=>(t-e)/dn,e=>e.getUTCSeconds());Cr.range;const Hl=Wt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*dn)},(e,t)=>{e.setTime(+e+t*we)},(e,t)=>(t-e)/we,e=>e.getMinutes());Hl.range,Wt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*we)},(e,t)=>(t-e)/we,e=>e.getUTCMinutes()).range;const Gl=Wt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*dn-e.getMinutes()*we)},(e,t)=>{e.setTime(+e+t*fn)},(e,t)=>(t-e)/fn,e=>e.getHours());Gl.range,Wt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*fn)},(e,t)=>(t-e)/fn,e=>e.getUTCHours()).range;const ki=Wt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*we)/pn,e=>e.getDate()-1);ki.range;const Vl=Wt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/pn,e=>e.getUTCDate()-1);Vl.range,Wt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/pn,e=>Math.floor(e/pn)).range;function Xn(e){return Wt(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)/Ul)}const ga=Xn(0),ma=Xn(1),z_=Xn(2),W_=Xn(3),Dr=Xn(4),Y_=Xn(5),q_=Xn(6);ga.range,ma.range,z_.range,W_.range,Dr.range,Y_.range,q_.range;function jn(e){return Wt(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)/Ul)}const _f=jn(0),va=jn(1),X_=jn(2),j_=jn(3),Lr=jn(4),Z_=jn(5),K_=jn(6);_f.range,va.range,X_.range,j_.range,Lr.range,Z_.range,K_.range;const zl=Wt(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());zl.range,Wt(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 gn=Wt(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());gn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Wt(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)}),gn.range;const Zn=Wt(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());Zn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Wt(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)}),Zn.range;function Q_(e,t,n,r,i,s){const a=[[Cr,1,dn],[Cr,5,5*dn],[Cr,15,15*dn],[Cr,30,30*dn],[s,1,we],[s,5,5*we],[s,15,15*we],[s,30,30*we],[i,1,fn],[i,3,3*fn],[i,6,6*fn],[i,12,12*fn],[r,1,pn],[r,2,2*pn],[n,1,Ul],[t,1,xf],[t,3,3*xf],[e,1,Bl]];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(([,,m])=>m).right(a,h);if(f===a.length)return e.every(Ao(c/Bl,u/Bl,d));if(f===0)return pa.every(Math.max(Ao(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[J_,tS]=Q_(gn,zl,ga,ki,Gl,Hl);function Wl(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 Yl(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 eS(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=Ni(i),u=$i(i),d=Ni(s),h=$i(s),f=Ni(a),p=$i(a),g=Ni(o),m=$i(o),v=Ni(l),E=$i(l),y={a:F,A:$,b:N,B:j,c:null,d:Af,e:Af,f:TS,g:kS,G:NS,H:xS,I:_S,j:SS,L:Cf,m:OS,M:wS,p:q,q:at,Q:Pf,s:Nf,S:MS,u:AS,U:CS,V:DS,w:LS,W:RS,x:null,X:null,y:IS,Y:PS,Z:$S,"%":kf},x={a:nt,A:dt,b:mt,B:Z,c:null,d:Lf,e:Lf,f:HS,g:KS,G:JS,H:FS,I:US,j:BS,L:Rf,m:GS,M:VS,p:et,q:vt,Q:Pf,s:Nf,S:zS,u:WS,U:YS,V:qS,w:XS,W:jS,x:null,X:null,y:ZS,Y:QS,Z:tT,"%":kf},S={a:D,A:O,b:H,B:P,c:M,d:wf,e:wf,f:vS,g:Of,G:Tf,H:Mf,I:Mf,j:fS,L:mS,m:dS,M:pS,p:B,q:hS,Q:ES,s:bS,S:gS,u:aS,U:oS,V:lS,w:sS,W:cS,x:w,X:U,y:Of,Y:Tf,Z:uS,"%":yS};y.x=_(n,y),y.X=_(r,y),y.c=_(t,y),x.x=_(n,x),x.X=_(r,x),x.c=_(t,x);function _(Y,K){return function(ot){var C=[],V=-1,z=0,Mt=Y.length,zt,st,kt;for(ot instanceof Date||(ot=new Date(+ot));++V<Mt;)Y.charCodeAt(V)===37&&(C.push(Y.slice(z,V)),(st=Sf[zt=Y.charAt(++V)])!=null?zt=Y.charAt(++V):st=zt==="e"?" ":"0",(kt=K[zt])&&(zt=kt(ot,st)),C.push(zt),z=V+1);return C.push(Y.slice(z,V)),C.join("")}}function A(Y,K){return function(ot){var C=Pi(1900,void 0,1),V=L(C,Y,ot+="",0),z,Mt;if(V!=ot.length)return null;if("Q"in C)return new Date(C.Q);if("s"in C)return new Date(C.s*1e3+("L"in C?C.L:0));if(K&&!("Z"in C)&&(C.Z=0),"p"in C&&(C.H=C.H%12+C.p*12),C.m===void 0&&(C.m="q"in C?C.q:0),"V"in C){if(C.V<1||C.V>53)return null;"w"in C||(C.w=1),"Z"in C?(z=Yl(Pi(C.y,0,1)),Mt=z.getUTCDay(),z=Mt>4||Mt===0?va.ceil(z):va(z),z=Vl.offset(z,(C.V-1)*7),C.y=z.getUTCFullYear(),C.m=z.getUTCMonth(),C.d=z.getUTCDate()+(C.w+6)%7):(z=Wl(Pi(C.y,0,1)),Mt=z.getDay(),z=Mt>4||Mt===0?ma.ceil(z):ma(z),z=ki.offset(z,(C.V-1)*7),C.y=z.getFullYear(),C.m=z.getMonth(),C.d=z.getDate()+(C.w+6)%7)}else("W"in C||"U"in C)&&("w"in C||(C.w="u"in C?C.u%7:"W"in C?1:0),Mt="Z"in C?Yl(Pi(C.y,0,1)).getUTCDay():Wl(Pi(C.y,0,1)).getDay(),C.m=0,C.d="W"in C?(C.w+6)%7+C.W*7-(Mt+5)%7:C.w+C.U*7-(Mt+6)%7);return"Z"in C?(C.H+=C.Z/100|0,C.M+=C.Z%100,Yl(C)):Wl(C)}}function L(Y,K,ot,C){for(var V=0,z=K.length,Mt=ot.length,zt,st;V<z;){if(C>=Mt)return-1;if(zt=K.charCodeAt(V++),zt===37){if(zt=K.charAt(V++),st=S[zt in Sf?K.charAt(V++):zt],!st||(C=st(Y,ot,C))<0)return-1}else if(zt!=ot.charCodeAt(C++))return-1}return C}function B(Y,K,ot){var C=c.exec(K.slice(ot));return C?(Y.p=u.get(C[0].toLowerCase()),ot+C[0].length):-1}function D(Y,K,ot){var C=f.exec(K.slice(ot));return C?(Y.w=p.get(C[0].toLowerCase()),ot+C[0].length):-1}function O(Y,K,ot){var C=d.exec(K.slice(ot));return C?(Y.w=h.get(C[0].toLowerCase()),ot+C[0].length):-1}function H(Y,K,ot){var C=v.exec(K.slice(ot));return C?(Y.m=E.get(C[0].toLowerCase()),ot+C[0].length):-1}function P(Y,K,ot){var C=g.exec(K.slice(ot));return C?(Y.m=m.get(C[0].toLowerCase()),ot+C[0].length):-1}function M(Y,K,ot){return L(Y,t,K,ot)}function w(Y,K,ot){return L(Y,n,K,ot)}function U(Y,K,ot){return L(Y,r,K,ot)}function F(Y){return a[Y.getDay()]}function $(Y){return s[Y.getDay()]}function N(Y){return l[Y.getMonth()]}function j(Y){return o[Y.getMonth()]}function q(Y){return i[+(Y.getHours()>=12)]}function at(Y){return 1+~~(Y.getMonth()/3)}function nt(Y){return a[Y.getUTCDay()]}function dt(Y){return s[Y.getUTCDay()]}function mt(Y){return l[Y.getUTCMonth()]}function Z(Y){return o[Y.getUTCMonth()]}function et(Y){return i[+(Y.getUTCHours()>=12)]}function vt(Y){return 1+~~(Y.getUTCMonth()/3)}return{format:function(Y){var K=_(Y+="",y);return K.toString=function(){return Y},K},parse:function(Y){var K=A(Y+="",!1);return K.toString=function(){return Y},K},utcFormat:function(Y){var K=_(Y+="",x);return K.toString=function(){return Y},K},utcParse:function(Y){var K=A(Y+="",!0);return K.toString=function(){return Y},K}}}var Sf={"-":"",_:" ",0:"0"},Yt=/^\s*\d+/,nS=/^%/,rS=/[\\^$*+?|[\]().{}]/g;function Et(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 iS(e){return e.replace(rS,"\\$&")}function Ni(e){return new RegExp("^(?:"+e.map(iS).join("|")+")","i")}function $i(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function sS(e,t,n){var r=Yt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function aS(e,t,n){var r=Yt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function oS(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function lS(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function cS(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Tf(e,t,n){var r=Yt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Of(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function uS(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 hS(e,t,n){var r=Yt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function dS(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function wf(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function fS(e,t,n){var r=Yt.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=Yt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function pS(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function gS(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function mS(e,t,n){var r=Yt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function vS(e,t,n){var r=Yt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function yS(e,t,n){var r=nS.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function ES(e,t,n){var r=Yt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function bS(e,t,n){var r=Yt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Af(e,t){return Et(e.getDate(),t,2)}function xS(e,t){return Et(e.getHours(),t,2)}function _S(e,t){return Et(e.getHours()%12||12,t,2)}function SS(e,t){return Et(1+ki.count(gn(e),e),t,3)}function Cf(e,t){return Et(e.getMilliseconds(),t,3)}function TS(e,t){return Cf(e,t)+"000"}function OS(e,t){return Et(e.getMonth()+1,t,2)}function wS(e,t){return Et(e.getMinutes(),t,2)}function MS(e,t){return Et(e.getSeconds(),t,2)}function AS(e){var t=e.getDay();return t===0?7:t}function CS(e,t){return Et(ga.count(gn(e)-1,e),t,2)}function Df(e){var t=e.getDay();return t>=4||t===0?Dr(e):Dr.ceil(e)}function DS(e,t){return e=Df(e),Et(Dr.count(gn(e),e)+(gn(e).getDay()===4),t,2)}function LS(e){return e.getDay()}function RS(e,t){return Et(ma.count(gn(e)-1,e),t,2)}function IS(e,t){return Et(e.getFullYear()%100,t,2)}function kS(e,t){return e=Df(e),Et(e.getFullYear()%100,t,2)}function PS(e,t){return Et(e.getFullYear()%1e4,t,4)}function NS(e,t){var n=e.getDay();return e=n>=4||n===0?Dr(e):Dr.ceil(e),Et(e.getFullYear()%1e4,t,4)}function $S(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Et(t/60|0,"0",2)+Et(t%60,"0",2)}function Lf(e,t){return Et(e.getUTCDate(),t,2)}function FS(e,t){return Et(e.getUTCHours(),t,2)}function US(e,t){return Et(e.getUTCHours()%12||12,t,2)}function BS(e,t){return Et(1+Vl.count(Zn(e),e),t,3)}function Rf(e,t){return Et(e.getUTCMilliseconds(),t,3)}function HS(e,t){return Rf(e,t)+"000"}function GS(e,t){return Et(e.getUTCMonth()+1,t,2)}function VS(e,t){return Et(e.getUTCMinutes(),t,2)}function zS(e,t){return Et(e.getUTCSeconds(),t,2)}function WS(e){var t=e.getUTCDay();return t===0?7:t}function YS(e,t){return Et(_f.count(Zn(e)-1,e),t,2)}function If(e){var t=e.getUTCDay();return t>=4||t===0?Lr(e):Lr.ceil(e)}function qS(e,t){return e=If(e),Et(Lr.count(Zn(e),e)+(Zn(e).getUTCDay()===4),t,2)}function XS(e){return e.getUTCDay()}function jS(e,t){return Et(va.count(Zn(e)-1,e),t,2)}function ZS(e,t){return Et(e.getUTCFullYear()%100,t,2)}function KS(e,t){return e=If(e),Et(e.getUTCFullYear()%100,t,2)}function QS(e,t){return Et(e.getUTCFullYear()%1e4,t,4)}function JS(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Lr(e):Lr.ceil(e),Et(e.getUTCFullYear()%1e4,t,4)}function tT(){return"+0000"}function kf(){return"%"}function Pf(e){return+e}function Nf(e){return Math.floor(+e/1e3)}var Rr,$f;eT({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 eT(e){return Rr=eS(e),$f=Rr.format,Rr.parse,Rr.utcFormat,Rr.utcParse,Rr}function nT(e){return new Date(e)}function rT(e){return e instanceof Date?+e:+new Date(+e)}function Ff(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"),m=c("%I %p"),v=c("%a %d"),E=c("%b %d"),y=c("%B"),x=c("%Y");function S(_){return(l(_)<_?f:o(_)<_?p:a(_)<_?g:s(_)<_?m:r(_)<_?i(_)<_?v:E:n(_)<_?y:x)(_)}return u.invert=function(_){return new Date(d(_))},u.domain=function(_){return arguments.length?h(Array.from(_,rT)):h().map(nT)},u.ticks=function(_){var A=h();return e(A[0],A[A.length-1],_??10)},u.tickFormat=function(_,A){return A==null?S:c(A)},u.nice=function(_){var A=h();return(!_||typeof _.range!="function")&&(_=t(A[0],A[A.length-1],_??10)),_?h(mf(A,_)):u},u.copy=function(){return Pl(u,Ff(e,t,n,r,i,s,a,o,l,c))},u}function Uf(){return Mr.apply(Ff(J_,tS,gn,zl,ga,ki,Gl,Hl,Cr,$f).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ht(e){return function(){return e}}const Bf=Math.abs,Qt=Math.atan2,Kn=Math.cos,iT=Math.max,ql=Math.min,Qe=Math.sin,Ir=Math.sqrt,Jt=1e-12,Fi=Math.PI,ya=Fi/2,Ea=2*Fi;function sT(e){return e>1?0:e<-1?Fi:Math.acos(e)}function Hf(e){return e>=1?ya:e<=-1?-ya:Math.asin(e)}function ba(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 wb(t)}function aT(e){return e.innerRadius}function oT(e){return e.outerRadius}function lT(e){return e.startAngle}function cT(e){return e.endAngle}function uT(e){return e&&e.padAngle}function hT(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 xa(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/Ir(o*o+l*l),u=c*l,d=-c*o,h=e+u,f=t+d,p=n+u,g=r+d,m=(h+p)/2,v=(f+g)/2,E=p-h,y=g-f,x=E*E+y*y,S=i-s,_=h*g-p*f,A=(y<0?-1:1)*Ir(iT(0,S*S*x-_*_)),L=(_*y-E*A)/x,B=(-_*E-y*A)/x,D=(_*y+E*A)/x,O=(-_*E+y*A)/x,H=L-m,P=B-v,M=D-m,w=O-v;return H*H+P*P>M*M+w*w&&(L=D,B=O),{cx:L,cy:B,x01:-u,y01:-d,x11:L*(i/S-1),y11:B*(i/S-1)}}function Ui(){var e=aT,t=oT,n=ht(0),r=null,i=lT,s=cT,a=uT,o=null,l=ba(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,m=Bf(g-p),v=g>p;if(o||(o=u=l()),f<h&&(d=f,f=h,h=d),!(f>Jt))o.moveTo(0,0);else if(m>Ea-Jt)o.moveTo(f*Kn(p),f*Qe(p)),o.arc(0,0,f,p,g,!v),h>Jt&&(o.moveTo(h*Kn(g),h*Qe(g)),o.arc(0,0,h,g,p,v));else{var E=p,y=g,x=p,S=g,_=m,A=m,L=a.apply(this,arguments)/2,B=L>Jt&&(r?+r.apply(this,arguments):Ir(h*h+f*f)),D=ql(Bf(f-h)/2,+n.apply(this,arguments)),O=D,H=D,P,M;if(B>Jt){var w=Hf(B/h*Qe(L)),U=Hf(B/f*Qe(L));(_-=w*2)>Jt?(w*=v?1:-1,x+=w,S-=w):(_=0,x=S=(p+g)/2),(A-=U*2)>Jt?(U*=v?1:-1,E+=U,y-=U):(A=0,E=y=(p+g)/2)}var F=f*Kn(E),$=f*Qe(E),N=h*Kn(S),j=h*Qe(S);if(D>Jt){var q=f*Kn(y),at=f*Qe(y),nt=h*Kn(x),dt=h*Qe(x),mt;if(m<Fi)if(mt=hT(F,$,nt,dt,q,at,N,j)){var Z=F-mt[0],et=$-mt[1],vt=q-mt[0],Y=at-mt[1],K=1/Qe(sT((Z*vt+et*Y)/(Ir(Z*Z+et*et)*Ir(vt*vt+Y*Y)))/2),ot=Ir(mt[0]*mt[0]+mt[1]*mt[1]);O=ql(D,(h-ot)/(K-1)),H=ql(D,(f-ot)/(K+1))}else O=H=0}A>Jt?H>Jt?(P=xa(nt,dt,F,$,f,H,v),M=xa(q,at,N,j,f,H,v),o.moveTo(P.cx+P.x01,P.cy+P.y01),H<D?o.arc(P.cx,P.cy,H,Qt(P.y01,P.x01),Qt(M.y01,M.x01),!v):(o.arc(P.cx,P.cy,H,Qt(P.y01,P.x01),Qt(P.y11,P.x11),!v),o.arc(0,0,f,Qt(P.cy+P.y11,P.cx+P.x11),Qt(M.cy+M.y11,M.cx+M.x11),!v),o.arc(M.cx,M.cy,H,Qt(M.y11,M.x11),Qt(M.y01,M.x01),!v))):(o.moveTo(F,$),o.arc(0,0,f,E,y,!v)):o.moveTo(F,$),!(h>Jt)||!(_>Jt)?o.lineTo(N,j):O>Jt?(P=xa(N,j,q,at,h,-O,v),M=xa(F,$,nt,dt,h,-O,v),o.lineTo(P.cx+P.x01,P.cy+P.y01),O<D?o.arc(P.cx,P.cy,O,Qt(P.y01,P.x01),Qt(M.y01,M.x01),!v):(o.arc(P.cx,P.cy,O,Qt(P.y01,P.x01),Qt(P.y11,P.x11),!v),o.arc(0,0,h,Qt(P.cy+P.y11,P.cx+P.x11),Qt(M.cy+M.y11,M.cx+M.x11),v),o.arc(M.cx,M.cy,O,Qt(M.y11,M.x11),Qt(M.y01,M.x01),!v))):o.arc(0,0,h,S,x,v)}if(o.closePath(),u)return o=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-Fi/2;return[Kn(d)*u,Qe(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 dT=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 Xl(e){return e[0]}function jl(e){return e[1]}function Bi(e,t){var n=ht(!0),r=null,i=Sa,s=null,a=ba(o);e=typeof e=="function"?e:e===void 0?Xl:ht(e),t=typeof t=="function"?t:t===void 0?jl: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 Zl(e,t,n){var r=null,i=ht(!0),s=null,a=Sa,o=null,l=ba(c);e=typeof e=="function"?e:e===void 0?Xl:ht(+e),t=typeof t=="function"?t:ht(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?jl:ht(+n);function c(d){var h,f,p,g=(d=_a(d)).length,m,v=!1,E,y=new Array(g),x=new Array(g);for(s==null&&(o=a(E=l())),h=0;h<=g;++h){if(!(h<g&&i(m=d[h],h,d))===v)if(v=!v)f=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),p=h-1;p>=f;--p)o.point(y[p],x[p]);o.lineEnd(),o.areaEnd()}v&&(y[h]=+e(m,h,d),x[h]=+t(m,h,d),o.point(r?+r(m,h,d):y[h],n?+n(m,h,d):x[h]))}if(E)return o=null,E+""||null}function u(){return Bi().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 fT(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function pT(e){return e}function gT(){var e=pT,t=fT,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),m=Math.min(Ea,Math.max(-Ea,i.apply(this,arguments)-g)),v,E=Math.min(Math.abs(m)/c,s.apply(this,arguments)),y=E*(m<0?-1:1),x;for(l=0;l<c;++l)(x=p[f[l]=l]=+e(o[l],l,o))>0&&(h+=x);for(t!=null?f.sort(function(S,_){return t(p[S],p[_])}):n!=null&&f.sort(function(S,_){return n(o[S],o[_])}),l=0,d=h?(m-c*y)/h:0;l<c;++l,g=v)u=f[l],x=p[u],v=g+(x>0?x*d:0)+y,p[u]={data:o[u],index:l,value:x,startAngle:g,endAngle:v,padAngle:E};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 mT=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 vT(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 yT(){return vT(Bi().curve(mT))}class ET{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 bT(e){return new ET(e,!0)}function xT(e){return e.source}function _T(e){return e.target}function ST(e){let t=xT,n=_T,r=Xl,i=jl,s=null,a=null,o=ba(l);function l(){let c;const u=dT.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 TT(){return ST(bT)}function Ln(){}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 Oa(e){this._context=e}Oa.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 OT(e){return new Oa(e)}function Wf(e){this._context=e}Wf.prototype={areaStart:Ln,areaEnd:Ln,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 MT(e){return new Yf(e)}function qf(e,t){this._basis=new Oa(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 AT=function e(t){function n(r){return t===1?new Oa(r):new qf(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function wa(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 Kl(e,t){this._context=e,this._k=(1-t)/6}Kl.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:wa(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:wa(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 Kl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Ql(e,t){this._context=e,this._k=(1-t)/6}Ql.prototype={areaStart:Ln,areaEnd:Ln,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:wa(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 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: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:wa(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 LT=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,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:tc(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 Xf(r,t):new Kl(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:Ln,areaEnd:Ln,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:tc(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 jf(r,t):new Ql(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:tc(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 kT=function e(t){function n(r){return t?new Zf(r,t):new Jl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Kf(e){this._context=e}Kf.prototype={areaStart:Ln,areaEnd:Ln,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 ec(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:ec(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,ec(this,ep(this,n=tp(this,e,t)),n);break;default:ec(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 PT(e){return new Ma(e)}function NT(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 FT(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 HT(e,t){return e[t]}function GT(e){const t=[];return t.key=e,t}function nc(){var e=ht([]),t=op,n=ap,r=HT;function i(s){var a=Array.from(e.apply(this,arguments),GT),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 VT(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 zT=typeof global=="object"&&global&&global.Object===Object&&global;const lp=zT;var WT=typeof self=="object"&&self&&self.Object===Object&&self,YT=lp||WT||Function("return this")();const Ue=YT;var qT=Ue.Symbol;const Me=qT;var cp=Object.prototype,XT=cp.hasOwnProperty,jT=cp.toString,Gi=Me?Me.toStringTag:void 0;function ZT(e){var t=XT.call(e,Gi),n=e[Gi];try{e[Gi]=void 0;var r=!0}catch{}var i=jT.call(e);return r&&(t?e[Gi]=n:delete e[Gi]),i}var KT=Object.prototype,QT=KT.toString;function JT(e){return QT.call(e)}var tO="[object Null]",eO="[object Undefined]",up=Me?Me.toStringTag:void 0;function Qn(e){return e==null?e===void 0?eO:tO:up&&up in Object(e)?ZT(e):JT(e)}function Je(e){return e!=null&&typeof e=="object"}var nO="[object Symbol]";function Ca(e){return typeof e=="symbol"||Je(e)&&Qn(e)==nO}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 rO=Array.isArray;const Xt=rO;var iO=1/0,dp=Me?Me.prototype:void 0,fp=dp?dp.toString:void 0;function pp(e){if(typeof e=="string")return e;if(Xt(e))return hp(e,pp)+"";if(Ca(e))return fp?fp.call(e):"";var t=e+"";return t=="0"&&1/e==-iO?"-0":t}var sO=/\s/;function aO(e){for(var t=e.length;t--&&sO.test(e.charAt(t)););return t}var oO=/^\s+/;function lO(e){return e&&e.slice(0,aO(e)+1).replace(oO,"")}function Ae(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var gp=NaN,cO=/^[-+]0x[0-9a-f]+$/i,uO=/^0b[01]+$/i,hO=/^0o[0-7]+$/i,dO=parseInt;function kr(e){if(typeof e=="number")return e;if(Ca(e))return gp;if(Ae(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ae(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=lO(e);var n=uO.test(e);return n||hO.test(e)?dO(e.slice(2),n?2:8):cO.test(e)?gp:+e}function rc(e){return e}var fO="[object AsyncFunction]",pO="[object Function]",gO="[object GeneratorFunction]",mO="[object Proxy]";function ic(e){if(!Ae(e))return!1;var t=Qn(e);return t==pO||t==gO||t==fO||t==mO}var vO=Ue["__core-js_shared__"];const sc=vO;var mp=function(){var e=/[^.]+$/.exec(sc&&sc.keys&&sc.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function yO(e){return!!mp&&mp in e}var EO=Function.prototype,bO=EO.toString;function Jn(e){if(e!=null){try{return bO.call(e)}catch{}try{return e+""}catch{}}return""}var xO=/[\\^$.*+?()[\]{}|]/g,_O=/^\[object .+?Constructor\]$/,SO=Function.prototype,TO=Object.prototype,OO=SO.toString,wO=TO.hasOwnProperty,MO=RegExp("^"+OO.call(wO).replace(xO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function AO(e){if(!Ae(e)||yO(e))return!1;var t=ic(e)?MO:_O;return t.test(Jn(e))}function CO(e,t){return e==null?void 0:e[t]}function tr(e,t){var n=CO(e,t);return AO(n)?n:void 0}var DO=tr(Ue,"WeakMap");const ac=DO;var vp=Object.create,LO=function(){function e(){}return function(t){if(!Ae(t))return{};if(vp)return vp(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const RO=LO;function IO(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 kO(){}function yp(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var PO=800,NO=16,$O=Date.now;function FO(e){var t=0,n=0;return function(){var r=$O(),i=NO-(r-n);if(n=r,i>0){if(++t>=PO)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function UO(e){return function(){return e}}var BO=function(){try{var e=tr(Object,"defineProperty");return e({},"",{}),e}catch{}}();const Da=BO;var HO=Da?function(e,t){return Da(e,"toString",{configurable:!0,enumerable:!1,value:UO(t),writable:!0})}:rc,GO=FO(HO);const VO=GO;function zO(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function WO(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 YO(e){return e!==e}function qO(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function XO(e,t,n){return t===t?qO(e,t,n):WO(e,YO,n)}function jO(e,t){var n=e==null?0:e.length;return!!n&&XO(e,t,0)>-1}var ZO=9007199254740991,KO=/^(?:0|[1-9]\d*)$/;function oc(e,t){var n=typeof e;return t=t??ZO,!!t&&(n=="number"||n!="symbol"&&KO.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 Vi(e,t){return e===t||e!==e&&t!==t}var QO=Object.prototype,JO=QO.hasOwnProperty;function Ep(e,t,n){var r=e[t];(!(JO.call(e,t)&&Vi(r,n))||n===void 0&&!(t in e))&&La(e,t,n)}function zi(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 bp=Math.max;function tw(e,t,n){return t=bp(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=bp(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),IO(e,this,o)}}function lc(e,t){return VO(tw(e,t,rc),e+"")}var ew=9007199254740991;function cc(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ew}function er(e){return e!=null&&cc(e.length)&&!ic(e)}function xp(e,t,n){if(!Ae(n))return!1;var r=typeof t;return(r=="number"?er(n)&&oc(t,n.length):r=="string"&&t in n)?Vi(n[t],e):!1}function nw(e){return lc(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&&xp(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 rw=Object.prototype;function Ra(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||rw;return e===n}function iw(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var sw="[object Arguments]";function _p(e){return Je(e)&&Qn(e)==sw}var Sp=Object.prototype,aw=Sp.hasOwnProperty,ow=Sp.propertyIsEnumerable,lw=_p(function(){return arguments}())?_p:function(e){return Je(e)&&aw.call(e,"callee")&&!ow.call(e,"callee")};const Pr=lw;function cw(){return!1}var Tp=typeof W=="object"&&W&&!W.nodeType&&W,Op=Tp&&typeof module=="object"&&module&&!module.nodeType&&module,uw=Op&&Op.exports===Tp,wp=uw?Ue.Buffer:void 0,hw=wp?wp.isBuffer:void 0,dw=hw||cw;const Nr=dw;var fw="[object Arguments]",pw="[object Array]",gw="[object Boolean]",mw="[object Date]",vw="[object Error]",yw="[object Function]",Ew="[object Map]",bw="[object Number]",xw="[object Object]",_w="[object RegExp]",Sw="[object Set]",Tw="[object String]",Ow="[object WeakMap]",ww="[object ArrayBuffer]",Mw="[object DataView]",Aw="[object Float32Array]",Cw="[object Float64Array]",Dw="[object Int8Array]",Lw="[object Int16Array]",Rw="[object Int32Array]",Iw="[object Uint8Array]",kw="[object Uint8ClampedArray]",Pw="[object Uint16Array]",Nw="[object Uint32Array]",It={};It[Aw]=It[Cw]=It[Dw]=It[Lw]=It[Rw]=It[Iw]=It[kw]=It[Pw]=It[Nw]=!0,It[fw]=It[pw]=It[ww]=It[gw]=It[Mw]=It[mw]=It[vw]=It[yw]=It[Ew]=It[bw]=It[xw]=It[_w]=It[Sw]=It[Tw]=It[Ow]=!1;function $w(e){return Je(e)&&cc(e.length)&&!!It[Qn(e)]}function uc(e){return function(t){return e(t)}}var Mp=typeof W=="object"&&W&&!W.nodeType&&W,Wi=Mp&&typeof module=="object"&&module&&!module.nodeType&&module,Fw=Wi&&Wi.exports===Mp,hc=Fw&&lp.process,Uw=function(){try{var e=Wi&&Wi.require&&Wi.require("util").types;return e||hc&&hc.binding&&hc.binding("util")}catch{}}();const $r=Uw;var Ap=$r&&$r.isTypedArray,Bw=Ap?uc(Ap):$w;const Ia=Bw;var Hw=Object.prototype,Gw=Hw.hasOwnProperty;function Cp(e,t){var n=Xt(e),r=!n&&Pr(e),i=!n&&!r&&Nr(e),s=!n&&!r&&!i&&Ia(e),a=n||r||i||s,o=a?iw(e.length,String):[],l=o.length;for(var c in e)(t||Gw.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||oc(c,l)))&&o.push(c);return o}function Dp(e,t){return function(n){return e(t(n))}}var Vw=Dp(Object.keys,Object);const zw=Vw;var Ww=Object.prototype,Yw=Ww.hasOwnProperty;function Lp(e){if(!Ra(e))return zw(e);var t=[];for(var n in Object(e))Yw.call(e,n)&&n!="constructor"&&t.push(n);return t}function Yi(e){return er(e)?Cp(e):Lp(e)}function qw(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Xw=Object.prototype,jw=Xw.hasOwnProperty;function Zw(e){if(!Ae(e))return qw(e);var t=Ra(e),n=[];for(var r in e)r=="constructor"&&(t||!jw.call(e,r))||n.push(r);return n}function qi(e){return er(e)?Cp(e,!0):Zw(e)}var Kw=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Qw=/^\w*$/;function dc(e,t){if(Xt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Ca(e)?!0:Qw.test(e)||!Kw.test(e)||t!=null&&e in Object(t)}var Jw=tr(Object,"create");const Xi=Jw;function tM(){this.__data__=Xi?Xi(null):{},this.size=0}function eM(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var nM="__lodash_hash_undefined__",rM=Object.prototype,iM=rM.hasOwnProperty;function sM(e){var t=this.__data__;if(Xi){var n=t[e];return n===nM?void 0:n}return iM.call(t,e)?t[e]:void 0}var aM=Object.prototype,oM=aM.hasOwnProperty;function lM(e){var t=this.__data__;return Xi?t[e]!==void 0:oM.call(t,e)}var cM="__lodash_hash_undefined__";function uM(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Xi&&t===void 0?cM:t,this}function nr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}nr.prototype.clear=tM,nr.prototype.delete=eM,nr.prototype.get=sM,nr.prototype.has=lM,nr.prototype.set=uM;function hM(){this.__data__=[],this.size=0}function ka(e,t){for(var n=e.length;n--;)if(Vi(e[n][0],t))return n;return-1}var dM=Array.prototype,fM=dM.splice;function pM(e){var t=this.__data__,n=ka(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():fM.call(t,n,1),--this.size,!0}function gM(e){var t=this.__data__,n=ka(t,e);return n<0?void 0:t[n][1]}function mM(e){return ka(this.__data__,e)>-1}function vM(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 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=hM,mn.prototype.delete=pM,mn.prototype.get=gM,mn.prototype.has=mM,mn.prototype.set=vM;var yM=tr(Ue,"Map");const ji=yM;function EM(){this.size=0,this.__data__={hash:new nr,map:new(ji||mn),string:new nr}}function bM(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 bM(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 _M(e){return Pa(this,e).get(e)}function SM(e){return Pa(this,e).has(e)}function TM(e,t){var n=Pa(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function vn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}vn.prototype.clear=EM,vn.prototype.delete=xM,vn.prototype.get=_M,vn.prototype.has=SM,vn.prototype.set=TM;var OM="Expected a function";function fc(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(OM);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||vn),n}fc.Cache=vn;var wM=500;function MM(e){var t=fc(e,function(r){return n.size===wM&&n.clear(),r}),n=t.cache;return t}var AM=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,CM=/\\(\\)?/g,DM=MM(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(AM,function(n,r,i,s){t.push(i?s.replace(CM,"$1"):r||n)}),t});const LM=DM;function Zi(e){return e==null?"":pp(e)}function Rp(e,t){return Xt(e)?e:dc(e,t)?[e]:LM(Zi(e))}var RM=1/0;function Na(e){if(typeof e=="string"||Ca(e))return e;var t=e+"";return t=="0"&&1/e==-RM?"-0":t}function Ip(e,t){t=Rp(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Na(t[n++])];return n&&n==r?e:void 0}function yt(e,t,n){var r=e==null?void 0:Ip(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 kp=Me?Me.isConcatSpreadable:void 0;function IM(e){return Xt(e)||Pr(e)||!!(kp&&e&&e[kp])}function $a(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=IM),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?$a(o,t-1,n,r,i):pc(i,o):r||(i[i.length]=o)}return i}function Pp(e){var t=e==null?0:e.length;return t?$a(e,1):[]}var kM=Dp(Object.getPrototypeOf,Object);const gc=kM;var PM="[object Object]",NM=Function.prototype,$M=Object.prototype,Np=NM.toString,FM=$M.hasOwnProperty,UM=Np.call(Object);function BM(e){if(!Je(e)||Qn(e)!=PM)return!1;var t=gc(e);if(t===null)return!0;var n=FM.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Np.call(n)==UM}function HM(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 GM(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:HM(e,t,n)}var VM="\\ud800-\\udfff",zM="\\u0300-\\u036f",WM="\\ufe20-\\ufe2f",YM="\\u20d0-\\u20ff",qM=zM+WM+YM,XM="\\ufe0e\\ufe0f",jM="\\u200d",ZM=RegExp("["+jM+VM+qM+XM+"]");function $p(e){return ZM.test(e)}function KM(e){return e.split("")}var Fp="\\ud800-\\udfff",QM="\\u0300-\\u036f",JM="\\ufe20-\\ufe2f",tA="\\u20d0-\\u20ff",eA=QM+JM+tA,nA="\\ufe0e\\ufe0f",rA="["+Fp+"]",mc="["+eA+"]",vc="\\ud83c[\\udffb-\\udfff]",iA="(?:"+mc+"|"+vc+")",Up="[^"+Fp+"]",Bp="(?:\\ud83c[\\udde6-\\uddff]){2}",Hp="[\\ud800-\\udbff][\\udc00-\\udfff]",sA="\\u200d",Gp=iA+"?",Vp="["+nA+"]?",aA="(?:"+sA+"(?:"+[Up,Bp,Hp].join("|")+")"+Vp+Gp+")*",oA=Vp+Gp+aA,lA="(?:"+[Up+mc+"?",mc,Bp,Hp,rA].join("|")+")",cA=RegExp(vc+"(?="+vc+")|"+lA+oA,"g");function uA(e){return e.match(cA)||[]}function hA(e){return $p(e)?uA(e):KM(e)}function dA(e){return function(t){t=Zi(t);var n=$p(t)?hA(t):void 0,r=n?n[0]:t.charAt(0),i=n?GM(n,1).join(""):t.slice(1);return r[e]()+i}}var fA=dA("toUpperCase");const pA=fA;function gA(e){return pA(Zi(e).toLowerCase())}function mA(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 vA(e){return function(t){return e==null?void 0:e[t]}}var yA={À:"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"},EA=vA(yA);const bA=EA;var xA=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_A="\\u0300-\\u036f",SA="\\ufe20-\\ufe2f",TA="\\u20d0-\\u20ff",OA=_A+SA+TA,wA="["+OA+"]",MA=RegExp(wA,"g");function AA(e){return e=Zi(e),e&&e.replace(xA,bA).replace(MA,"")}var CA=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function DA(e){return e.match(CA)||[]}var LA=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function RA(e){return LA.test(e)}var zp="\\ud800-\\udfff",IA="\\u0300-\\u036f",kA="\\ufe20-\\ufe2f",PA="\\u20d0-\\u20ff",NA=IA+kA+PA,Wp="\\u2700-\\u27bf",Yp="a-z\\xdf-\\xf6\\xf8-\\xff",$A="\\xac\\xb1\\xd7\\xf7",FA="\\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",qp="A-Z\\xc0-\\xd6\\xd8-\\xde",HA="\\ufe0e\\ufe0f",Xp=$A+FA+UA+BA,jp="['’]",Zp="["+Xp+"]",GA="["+NA+"]",Kp="\\d+",VA="["+Wp+"]",Qp="["+Yp+"]",Jp="[^"+zp+Xp+Kp+Wp+Yp+qp+"]",zA="\\ud83c[\\udffb-\\udfff]",WA="(?:"+GA+"|"+zA+")",YA="[^"+zp+"]",tg="(?:\\ud83c[\\udde6-\\uddff]){2}",eg="[\\ud800-\\udbff][\\udc00-\\udfff]",Fr="["+qp+"]",qA="\\u200d",ng="(?:"+Qp+"|"+Jp+")",XA="(?:"+Fr+"|"+Jp+")",rg="(?:"+jp+"(?:d|ll|m|re|s|t|ve))?",ig="(?:"+jp+"(?:D|LL|M|RE|S|T|VE))?",sg=WA+"?",ag="["+HA+"]?",jA="(?:"+qA+"(?:"+[YA,tg,eg].join("|")+")"+ag+sg+")*",ZA="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",KA="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",QA=ag+sg+jA,JA="(?:"+[VA,tg,eg].join("|")+")"+QA,tC=RegExp([Fr+"?"+Qp+"+"+rg+"(?="+[Zp,Fr,"$"].join("|")+")",XA+"+"+ig+"(?="+[Zp,Fr+ng,"$"].join("|")+")",Fr+"?"+ng+"+"+rg,Fr+"+"+ig,KA,ZA,Kp,JA].join("|"),"g");function eC(e){return e.match(tC)||[]}function nC(e,t,n){return e=Zi(e),t=n?void 0:t,t===void 0?RA(e)?eC(e):DA(e):e.match(t)||[]}var rC="['’]",iC=RegExp(rC,"g");function og(e){return function(t){return mA(nC(AA(t).replace(iC,"")),e,"")}}var sC=og(function(e,t,n){return t=t.toLowerCase(),e+(n?gA(t):t)});const aC=sC;function oC(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function lg(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=kr(n),n=n===n?n:0),t!==void 0&&(t=kr(t),t=t===t?t:0),oC(kr(e),t,n)}function lC(){this.__data__=new mn,this.size=0}function cC(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function uC(e){return this.__data__.get(e)}function hC(e){return this.__data__.has(e)}var dC=200;function fC(e,t){var n=this.__data__;if(n instanceof mn){var r=n.__data__;if(!ji||r.length<dC-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new vn(r)}return n.set(e,t),this.size=n.size,this}function Be(e){var t=this.__data__=new mn(e);this.size=t.size}Be.prototype.clear=lC,Be.prototype.delete=cC,Be.prototype.get=uC,Be.prototype.has=hC,Be.prototype.set=fC;function pC(e,t){return e&&zi(t,Yi(t),e)}function gC(e,t){return e&&zi(t,qi(t),e)}var cg=typeof W=="object"&&W&&!W.nodeType&&W,ug=cg&&typeof module=="object"&&module&&!module.nodeType&&module,mC=ug&&ug.exports===cg,hg=mC?Ue.Buffer:void 0,dg=hg?hg.allocUnsafe:void 0;function fg(e,t){if(t)return e.slice();var n=e.length,r=dg?dg(n):new e.constructor(n);return e.copy(r),r}function vC(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 pg(){return[]}var yC=Object.prototype,EC=yC.propertyIsEnumerable,gg=Object.getOwnPropertySymbols,bC=gg?function(e){return e==null?[]:(e=Object(e),vC(gg(e),function(t){return EC.call(e,t)}))}:pg;const yc=bC;function xC(e,t){return zi(e,yc(e),t)}var _C=Object.getOwnPropertySymbols,SC=_C?function(e){for(var t=[];e;)pc(t,yc(e)),e=gc(e);return t}:pg;const mg=SC;function TC(e,t){return zi(e,mg(e),t)}function vg(e,t,n){var r=t(e);return Xt(e)?r:pc(r,n(e))}function Ec(e){return vg(e,Yi,yc)}function OC(e){return vg(e,qi,mg)}var wC=tr(Ue,"DataView");const bc=wC;var MC=tr(Ue,"Promise");const xc=MC;var AC=tr(Ue,"Set");const Ur=AC;var yg="[object Map]",CC="[object Object]",Eg="[object Promise]",bg="[object Set]",xg="[object WeakMap]",_g="[object DataView]",DC=Jn(bc),LC=Jn(ji),RC=Jn(xc),IC=Jn(Ur),kC=Jn(ac),rr=Qn;(bc&&rr(new bc(new ArrayBuffer(1)))!=_g||ji&&rr(new ji)!=yg||xc&&rr(xc.resolve())!=Eg||Ur&&rr(new Ur)!=bg||ac&&rr(new ac)!=xg)&&(rr=function(e){var t=Qn(e),n=t==CC?e.constructor:void 0,r=n?Jn(n):"";if(r)switch(r){case DC:return _g;case LC:return yg;case RC:return Eg;case IC:return bg;case kC:return xg}return t});const Br=rr;var PC=Object.prototype,NC=PC.hasOwnProperty;function $C(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&NC.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var FC=Ue.Uint8Array;const Fa=FC;function _c(e){var t=new e.constructor(e.byteLength);return new Fa(t).set(new Fa(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 HC(e){var t=new e.constructor(e.source,BC.exec(e));return t.lastIndex=e.lastIndex,t}var Sg=Me?Me.prototype:void 0,Tg=Sg?Sg.valueOf:void 0;function GC(e){return Tg?Object(Tg.call(e)):{}}function Og(e,t){var n=t?_c(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var VC="[object Boolean]",zC="[object Date]",WC="[object Map]",YC="[object Number]",qC="[object RegExp]",XC="[object Set]",jC="[object String]",ZC="[object Symbol]",KC="[object ArrayBuffer]",QC="[object DataView]",JC="[object Float32Array]",tD="[object Float64Array]",eD="[object Int8Array]",nD="[object Int16Array]",rD="[object Int32Array]",iD="[object Uint8Array]",sD="[object Uint8ClampedArray]",aD="[object Uint16Array]",oD="[object Uint32Array]";function lD(e,t,n){var r=e.constructor;switch(t){case KC:return _c(e);case VC:case zC:return new r(+e);case QC:return UC(e,n);case JC:case tD:case eD:case nD:case rD:case iD:case sD:case aD:case oD:return Og(e,n);case WC:return new r;case YC:case jC:return new r(e);case qC:return HC(e);case XC:return new r;case ZC:return GC(e)}}function wg(e){return typeof e.constructor=="function"&&!Ra(e)?RO(gc(e)):{}}var cD="[object Map]";function uD(e){return Je(e)&&Br(e)==cD}var Mg=$r&&$r.isMap,hD=Mg?uc(Mg):uD;const dD=hD;var fD="[object Set]";function pD(e){return Je(e)&&Br(e)==fD}var Ag=$r&&$r.isSet,gD=Ag?uc(Ag):pD;const mD=gD;var vD=1,yD=2,ED=4,Cg="[object Arguments]",bD="[object Array]",xD="[object Boolean]",_D="[object Date]",SD="[object Error]",Dg="[object Function]",TD="[object GeneratorFunction]",OD="[object Map]",wD="[object Number]",Lg="[object Object]",MD="[object RegExp]",AD="[object Set]",CD="[object String]",DD="[object Symbol]",LD="[object WeakMap]",RD="[object ArrayBuffer]",ID="[object DataView]",kD="[object Float32Array]",PD="[object Float64Array]",ND="[object Int8Array]",$D="[object Int16Array]",FD="[object Int32Array]",UD="[object Uint8Array]",BD="[object Uint8ClampedArray]",HD="[object Uint16Array]",GD="[object Uint32Array]",Dt={};Dt[Cg]=Dt[bD]=Dt[RD]=Dt[ID]=Dt[xD]=Dt[_D]=Dt[kD]=Dt[PD]=Dt[ND]=Dt[$D]=Dt[FD]=Dt[OD]=Dt[wD]=Dt[Lg]=Dt[MD]=Dt[AD]=Dt[CD]=Dt[DD]=Dt[UD]=Dt[BD]=Dt[HD]=Dt[GD]=!0,Dt[SD]=Dt[Dg]=Dt[LD]=!1;function Ua(e,t,n,r,i,s){var a,o=t&vD,l=t&yD,c=t&ED;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!Ae(e))return e;var u=Xt(e);if(u){if(a=$C(e),!o)return yp(e,a)}else{var d=Br(e),h=d==Dg||d==TD;if(Nr(e))return fg(e,o);if(d==Lg||d==Cg||h&&!i){if(a=l||h?{}:wg(e),!o)return l?TC(e,gC(a,e)):xC(e,pC(a,e))}else{if(!Dt[d])return i?e:{};a=lD(e,d,o)}}s||(s=new Be);var f=s.get(e);if(f)return f;s.set(e,a),mD(e)?e.forEach(function(m){a.add(Ua(m,t,n,m,e,s))}):dD(e)&&e.forEach(function(m,v){a.set(v,Ua(m,t,n,v,e,s))});var p=c?l?OC:Ec:l?qi:Yi,g=u?void 0:p(e);return zO(g||e,function(m,v){g&&(v=m,m=e[v]),Ep(a,v,Ua(m,t,n,v,e,s))}),a}var VD=1,zD=4;function yn(e){return Ua(e,VD|zD)}var WD="__lodash_hash_undefined__";function YD(e){return this.__data__.set(e,WD),this}function qD(e){return this.__data__.has(e)}function Ki(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new vn;++t<n;)this.add(e[t])}Ki.prototype.add=Ki.prototype.push=YD,Ki.prototype.has=qD;function Rg(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 Ig(e,t){return e.has(t)}var XD=1,jD=2;function kg(e,t,n,r,i,s){var a=n&XD,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&jD?new Ki:void 0;for(s.set(e,t),s.set(t,e);++d<o;){var p=e[d],g=t[d];if(r)var m=a?r(g,p,d,t,e,s):r(p,g,d,e,t,s);if(m!==void 0){if(m)continue;h=!1;break}if(f){if(!Rg(t,function(v,E){if(!Ig(f,E)&&(p===v||i(p,v,n,r,s)))return f.push(E)})){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 ZD(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 KD=1,QD=2,JD="[object Boolean]",tL="[object Date]",eL="[object Error]",nL="[object Map]",rL="[object Number]",iL="[object RegExp]",sL="[object Set]",aL="[object String]",oL="[object Symbol]",lL="[object ArrayBuffer]",cL="[object DataView]",Pg=Me?Me.prototype:void 0,Tc=Pg?Pg.valueOf:void 0;function uL(e,t,n,r,i,s,a){switch(n){case cL:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case lL:return!(e.byteLength!=t.byteLength||!s(new Fa(e),new Fa(t)));case JD:case tL:case rL:return Vi(+e,+t);case eL:return e.name==t.name&&e.message==t.message;case iL:case aL:return e==t+"";case nL:var o=ZD;case sL:var l=r&KD;if(o||(o=Sc),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=QD,a.set(e,t);var u=kg(o(e),o(t),r,i,s,a);return a.delete(e),u;case oL:if(Tc)return Tc.call(e)==Tc.call(t)}return!1}var hL=1,dL=Object.prototype,fL=dL.hasOwnProperty;function pL(e,t,n,r,i,s){var a=n&hL,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:fL.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 m=a;++d<l;){h=o[d];var v=e[h],E=t[h];if(r)var y=a?r(E,v,h,t,e,s):r(v,E,h,e,t,s);if(!(y===void 0?v===E||i(v,E,n,r,s):y)){g=!1;break}m||(m=h=="constructor")}if(g&&!m){var x=e.constructor,S=t.constructor;x!=S&&"constructor"in e&&"constructor"in t&&!(typeof x=="function"&&x instanceof x&&typeof S=="function"&&S instanceof S)&&(g=!1)}return s.delete(e),s.delete(t),g}var gL=1,Ng="[object Arguments]",$g="[object Array]",Ba="[object Object]",mL=Object.prototype,Fg=mL.hasOwnProperty;function vL(e,t,n,r,i,s){var a=Xt(e),o=Xt(t),l=a?$g:Br(e),c=o?$g:Br(t);l=l==Ng?Ba:l,c=c==Ng?Ba:c;var u=l==Ba,d=c==Ba,h=l==c;if(h&&Nr(e)){if(!Nr(t))return!1;a=!0,u=!1}if(h&&!u)return s||(s=new Be),a||Ia(e)?kg(e,t,n,r,i,s):uL(e,t,l,n,r,i,s);if(!(n&gL)){var f=u&&Fg.call(e,"__wrapped__"),p=d&&Fg.call(t,"__wrapped__");if(f||p){var g=f?e.value():e,m=p?t.value():t;return s||(s=new Be),i(g,m,n,r,s)}}return h?(s||(s=new Be),pL(e,t,n,r,i,s)):!1}function Ha(e,t,n,r,i){return e===t?!0:e==null||t==null||!Je(e)&&!Je(t)?e!==e&&t!==t:vL(e,t,n,r,Ha,i)}var yL=1,EL=2;function bL(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 Be;if(r)var h=r(c,u,l,e,t,d);if(!(h===void 0?Ha(u,c,yL|EL,r,d):h))return!1}}return!0}function Ug(e){return e===e&&!Ae(e)}function xL(e){for(var t=Yi(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Ug(i)]}return t}function Bg(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function _L(e){var t=xL(e);return t.length==1&&t[0][2]?Bg(t[0][0],t[0][1]):function(n){return n===e||bL(n,e,t)}}function SL(e,t){return e!=null&&t in Object(e)}function TL(e,t,n){t=Rp(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=Na(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)&&oc(a,i)&&(Xt(e)||Pr(e)))}function OL(e,t){return e!=null&&TL(e,t,SL)}var wL=1,ML=2;function AL(e,t){return dc(e)&&Ug(t)?Bg(Na(e),t):function(n){var r=yt(n,e);return r===void 0&&r===t?OL(n,e):Ha(t,r,wL|ML)}}function CL(e){return function(t){return t==null?void 0:t[e]}}function DL(e){return function(t){return Ip(t,e)}}function LL(e){return dc(e)?CL(Na(e)):DL(e)}function Ga(e){return typeof e=="function"?e:e==null?rc:typeof e=="object"?Xt(e)?AL(e[0],e[1]):_L(e):LL(e)}function RL(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 IL(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 kL=IL();const Hg=kL;function PL(e,t){return e&&Hg(e,t,Yi)}function NL(e,t){return function(n,r){if(n==null)return n;if(!er(n))return e(n,r);for(var i=n.length,s=t?i:-1,a=Object(n);(t?s--:++s<i)&&r(a[s],s,a)!==!1;);return n}}var $L=NL(PL);const Oc=$L;function FL(e,t,n,r){return Oc(e,function(i,s,a){t(r,i,n(i),a)}),r}function UL(e,t){return function(n,r){var i=Xt(n)?RL:FL,s=t?t():{};return i(n,e,Ga(r),s)}}var BL=function(){return Ue.Date.now()};const wc=BL;var HL="Expected a function",GL=Math.max,VL=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(HL);t=kr(t)||0,Ae(n)&&(u=!!n.leading,d="maxWait"in n,s=d?GL(kr(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function f(_){var A=r,L=i;return r=i=void 0,c=_,a=e.apply(L,A),a}function p(_){return c=_,o=setTimeout(v,t),u?f(_):a}function g(_){var A=_-l,L=_-c,B=t-A;return d?VL(B,s-L):B}function m(_){var A=_-l,L=_-c;return l===void 0||A>=t||A<0||d&&L>=s}function v(){var _=wc();if(m(_))return E(_);o=setTimeout(v,g(_))}function E(_){return o=void 0,h&&r?f(_):(r=i=void 0,a)}function y(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function x(){return o===void 0?a:E(wc())}function S(){var _=wc(),A=m(_);if(r=arguments,i=this,l=_,A){if(o===void 0)return p(l);if(d)return clearTimeout(o),o=setTimeout(v,t),f(l)}return o===void 0&&(o=setTimeout(v,t)),a}return S.cancel=y,S.flush=x,S}function Mc(e,t,n){(n!==void 0&&!Vi(e[t],n)||n===void 0&&!(t in e))&&La(e,t,n)}function Ac(e){return Je(e)&&er(e)}function Cc(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function zL(e){return zi(e,qi(e))}function WL(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=Xt(l),f=!h&&Nr(l),p=!h&&!f&&Ia(l);u=l,h||f||p?Xt(o)?u=o:Ac(o)?u=yp(o):f?(d=!1,u=fg(l,!0)):p?(d=!1,u=Og(l,!0)):u=[]:BM(l)||Pr(l)?(u=o,Pr(o)?u=zL(o):(!Ae(o)||ic(o))&&(u=wg(l))):d=!1}d&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),Mc(e,n,u)}function Gg(e,t,n,r,i){e!==t&&Hg(t,function(s,a){if(i||(i=new Be),Ae(s))WL(e,t,a,n,Gg,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)}},qi)}var YL="Expected a function";function qL(e,t,n){if(typeof e!="function")throw new TypeError(YL);return setTimeout(function(){e.apply(void 0,n)},t)}var XL=lc(function(e,t,n){return qL(e,kr(t)||0,n)});const jL=XL;function ZL(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 KL(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function QL(e,t){var n=-1,r=er(e)?Array(e.length):[];return Oc(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function JL(e,t){var n=Xt(e)?hp:QL;return n(e,Ga(t))}var tR=1/0;function eR(e,t){return $a(JL(e,t),tR)}function nR(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 rR=Object.prototype,iR=rR.hasOwnProperty,sR=UL(function(e,t,n){iR.call(e,n)?e[n].push(t):La(e,n,[t])});const aR=sR;var oR="[object Map]",lR="[object Set]",cR=Object.prototype,uR=cR.hasOwnProperty;function He(e){if(e==null)return!0;if(er(e)&&(Xt(e)||typeof e=="string"||typeof e.splice=="function"||Nr(e)||Ia(e)||Pr(e)))return!e.length;var t=Br(e);if(t==oR||t==lR)return!e.size;if(Ra(e))return!Lp(e).length;for(var n in e)if(uR.call(e,n))return!1;return!0}function Vg(e,t){return Ha(e,t)}var hR=og(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const Hr=hR;var dR=nw(function(e,t,n){Gg(e,t,n)});const lt=dR;function fR(e,t){var n;return Oc(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function pR(e,t,n){var r=Xt(e)?Rg:fR;return n&&xp(e,t,n)&&(t=void 0),r(e,Ga(t))}var gR=1/0,mR=Ur&&1/Sc(new Ur([,-0]))[1]==gR?function(e){return new Ur(e)}:kO;const vR=mR;var yR=200;function zg(e,t,n){var r=-1,i=jO,s=e.length,a=!0,o=[],l=o;if(n)a=!1,i=ZL;else if(s>=yR){var c=t?null:vR(e);if(c)return Sc(c);a=!1,i=Ig,l=new Ki}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 ER=lc(function(e){var t=KL(e);return Ac(t)&&(t=void 0),zg($a(e,1,Ac,!0),Ga(t))});const bR=ER;function Qi(e){return e&&e.length?zg(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||{}),Wg=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e.SHOW_TOOLTIP="toolbar-show-tooltip",e.HIDE_TOOLTIP="toolbar-hide-tooltip",e))(Wg||{}),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||{}),Nc=(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))(Nc||{}),$c=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))($c||{}),Fc=(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))(Fc||{}),Uc=(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))(Uc||{}),Bc=(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))(Bc||{}),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||{}),Gr=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(Gr||{}),Xc=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Xc||{}),Yg=(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))(Yg||{}),qg=(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))(qg||{}),Xg=(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))(Xg||{}),jg=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(jg||{}),Zg=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(Zg||{}),Vr=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(Vr||{});const T=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:Xg,Area:$c,Axis:Nc,Bar:Hc,Boxplot:Gc,CanvasZoom:Pc,Chart:Dc,Choropleth:Vr,CirclePack:qg,Gauge:Bc,Heatmap:Zg,Legend:Yg,Line:zc,Meter:jg,Modal:Lc,Model:Rc,Pie:Uc,Radar:Wc,Scatter:Vc,Threshold:Xc,Toolbar:Wg,Tooltip:Gr,Tree:Yc,Treemap:qc,WordCloud:Fc,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||{}),it=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(it||{}),G=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(G||{}),Ge=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(Ge||{}),Ce=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(Ce||{}),Bt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Bt||{}),Q=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(Q||{}),zr=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(zr||{}),Ht=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(Ht||{}),Wr=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(Wr||{}),za=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(za||{}),At=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(At||{}),ct=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(ct||{}),ir=(e=>(e.CENTER="center",e))(ir||{}),Ji=(e=>(e.LEFT="left",e.RIGHT="right",e))(Ji||{}),Gt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Gt||{}),tn=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(tn||{}),en=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(en||{}),sr=(e=>(e.SEMI="semi",e.FULL="full",e))(sr||{}),Wa=(e=>(e.UP="up",e.DOWN="down",e))(Wa||{}),ts=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(ts||{}),es=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(es||{}),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||{}),_t=(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.EXIT_FULLSCREEN="Exit fullscreen",e.SHOW_AS_DATATABLE="Show as data-table",e.CUSTOM="Custom",e))(_t||{}),Ya=(e=>(e.LEFT="left",e.RIGHT="right",e))(Ya||{}),Vt=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(Vt||{}),ns=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(ns||{}),Yr=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(Yr||{}),rs=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(rs||{}),nn=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(nn||{});const ue="cds",En={opacity:{unselected:.05,selected:.4}},Rn={ticks:{number:7,rotateIfSmallerThan:30,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},qr={duration:1e3,ease:Xh,zoomLevel:3},Xr={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},hierarchyLevel:2},Kg={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},De={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},xR={defaultBins:10},Nt={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}},bn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},jt={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},Lt={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}},ar={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}},Qg={minCellDividerDimension:16,chartPadding:.5},Jg={default:{size:24}},_R={defaultOffset:4,horizontalOffset:10},tm={default:{duration:300},pie_slice_mouseover:{duration:100},pie_slice_mouseout:{duration:100},pie_chart_titles:{duration:375},graph_element_mouseover_fill_update:{duration:100},graph_element_mouseout_fill_update:{duration:100}},be={height:{[Ge.GRAPH_VIEW]:32,[Ge.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},SR=[{type:Vt.RADIUS,name:"Radius"},{type:Vt.AREA,name:"Poor area"},{type:Vt.AREA,name:"Satisfactory area"},{type:Vt.AREA,name:"Great area"},{type:Vt.QUARTILE,name:"Quartiles"}];function TR(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 Pt(e,t){var i;const n=yn(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===Q.TIME?a.mapsTo="date":l===Q.LABELS&&(a.mapsTo="key")}}else delete n.axes[s];return Kc(n,t),lt(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 is(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 ss(e,t,n){if(n>e.length)return e;if(t===Ce.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===Ce.FRONT_LINE)return"..."+e.substr(-n);if(t===Ce.END_LINE)return e.substr(0,n)+"..."}function Kc(e,t){const n=b(e,"legend","additionalItems"),r=b(t,"legend","additionalItems");if(n&&r){const i=r.map(o=>o.type),s=n.map(o=>o.type),a=SR.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=bR(a,r,"name")}}const b=(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},em=(e,t)=>t===Bt.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}=em(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function _n(e,t,n){return n===Bt.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 as(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 os(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)?wR(o,d=>d.test(a)):OR(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 OR(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function wR(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function MR(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 bt(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 AR={};function qa(){return AR}function ls(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=bt(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 CR={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"}},DR=(e,t,n)=>{let r;const i=CR[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},LR={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},RR=(e,t,n,r)=>LR[e],IR={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},kR={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},PR={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"]},NR={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"]},$R={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"}},FR={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"}},UR={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:as({values:IR,defaultWidth:"wide"}),quarter:as({values:kR,defaultWidth:"wide",argumentCallback:e=>e-1}),month:as({values:PR,defaultWidth:"wide"}),day:as({values:NR,defaultWidth:"wide"}),dayPeriod:as({values:$R,defaultWidth:"wide",formattingValues:FR,defaultFormattingWidth:"wide"})},BR=/^(\d+)(th|st|nd|rd)?/i,HR=/\d+/i,GR={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},VR={any:[/^b/i,/^(a|c)/i]},zR={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},WR={any:[/1/i,/2/i,/3/i,/4/i]},YR={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},qR={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]},XR={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},jR={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]},ZR={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},KR={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:MR({matchPattern:BR,parsePattern:HR,valueCallback:e=>parseInt(e,10)}),era:os({matchPatterns:GR,defaultMatchWidth:"wide",parsePatterns:VR,defaultParseWidth:"any"}),quarter:os({matchPatterns:zR,defaultMatchWidth:"wide",parsePatterns:WR,defaultParseWidth:"any",valueCallback:e=>e+1}),month:os({matchPatterns:YR,defaultMatchWidth:"wide",parsePatterns:qR,defaultParseWidth:"any"}),day:os({matchPatterns:XR,defaultMatchWidth:"wide",parsePatterns:jR,defaultParseWidth:"any"}),dayPeriod:os({matchPatterns:ZR,defaultMatchWidth:"any",parsePatterns:KR,defaultParseWidth:"any"})},JR={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},tI={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},eI={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},nI={date:Qc({formats:JR,defaultWidth:"full"}),time:Qc({formats:tI,defaultWidth:"full"}),dateTime:Qc({formats:eI,defaultWidth:"full"})},nm={code:"en-US",formatDistance:DR,formatLong:nI,formatRelative:RR,localize:UR,match:QR,options:{weekStartsOn:0,firstWeekContainsDate:1}},jr={type:Ce.END_LINE,threshold:16,numCharacter:14},rI={code:typeof navigator<"u"&&(navigator==null?void 0:navigator.language)||"en-US",number:(e,t=(navigator==null?void 0:navigator.language)||"en-US")=>e.toLocaleString(t),date:(e,t=(navigator==null?void 0:navigator.language)||"en-US",n={},r=null)=>r||e.toLocaleDateString(t,n),time:(e,t=(navigator==null?void 0:navigator.language)||"en-US",n={},r=null)=>r||e.toLocaleTimeString(t,n),optionsObject:{"15seconds":{primary:{"MMM d, pp":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"MMM d, h:mm:ss.SSS a":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},secondary:{pp:{hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"h:mm:ss.SSS a":{hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},type:"time"},minute:{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},"30minutes":{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},hourly:{primary:{"MMM d, hh a":{month:"short",day:"numeric",hour:"2-digit",hourCycle:"h12"}},secondary:{"hh a":{hour:"2-digit",hourCycle:"h12"}},type:"time"},daily:{primary:{"MMM d":{month:"short",day:"numeric"}},secondary:{d:{day:"numeric"}},type:"date"},weekly:{primary:{"eee, MMM d":{weekday:"short",month:"short",day:"numeric"}},secondary:{eee:{weekday:"short"}},type:"date"},monthly:{primary:{"MMM yyyy":{month:"short",year:"numeric"}},secondary:{MMM:{month:"short"}},type:"date"},quarterly:{primary:{},secondary:{},type:"date"},yearly:{primary:{yyyy:{year:"numeric"}},secondary:{yyyy:{year:"numeric"}},type:"date"}},translations:{group:"Group",total:"Total",meter:{title:""},tabularRep:{title:"Tabular representation",downloadAsCSV:"Download as CSV"},toolbar:{exportAsCSV:"Export to CSV",exportAsJPG:"Export to JPG",exportAsPNG:"Export to PNG",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoom:"Reset zoom",moreOptions:"More options",makeFullScreen:"Make fullscreen",exitFullScreen:"Exit fullscreen",showAsTable:"Show as table"}}},iI={enabled:!0,position:zr.BOTTOM,clickable:!0,truncation:jr,alignment:Ht.LEFT,order:null,additionalItems:[]},sI={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},aI={enabled:!0},rm={enabled:!0,showTotal:!0,truncation:jr,groupLabel:"Group"},im={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}},Xa={addSpaceOnEdges:1,showDayName:!1,localeObject:nm,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"}}};let sm=!1;try{sm=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}catch(e){console.warn("Fullscreen capabilities check failed: ",e.message)}const te={width:null,height:null,resizable:!0,theme:jc.WHITE,tooltip:rm,legend:iI,locale: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:_t.SHOW_AS_DATATABLE},...sm?[{type:_t.MAKE_FULLSCREEN}]:[],{type:_t.EXPORT_CSV},{type:_t.EXPORT_PNG},{type:_t.EXPORT_JPG}]}},am=lt({},te,{thematic:{projection:nn.geoNaturalEarth1}}),cs=lt({},te,{axes:im,timeScale:Xa,grid:sI,ruler:aI,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:Ge.GRAPH_VIEW}}}),or=lt({},cs,{bars:{maxWidth:16,spacingFactor:.25},timeScale:lt(Xa,{addSpaceOnEdges:1})}),oI=lt({},or,{}),lI=lt({},or,{}),cI=lt({},or,{bars:lt({},or.bars,{dividerSize:1.5})}),uI=lt({},or,{}),Jc=lt({},cs,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),hI=Jc,om=lt({},Jc,{points:{radius:3,filled:!1,enabled:!0}}),lm=lt({},om,{timeScale:lt(Xa,{addSpaceOnEdges:0})}),dI=lm,fI=lt({},cs,{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:Vt.RADIUS,name:"Radius"}]}}),pI=lt({},cs,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:Vt.AREA,name:"Poor area"},{type:Vt.AREA,name:"Satisfactory area"},{type:Vt.AREA,name:"Great area"},{type:Vt.QUARTILE,name:"Quartiles"}]}}),gI=lt({},or,{bars:{dividerSize:1.5},timeScale:lt(Xa,{addSpaceOnEdges:0})}),mI=lt({},te,{tooltip:lt({},rm,{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=lt({},te,{pie:{labels:{formatter:null,enabled:!0},alignment:Ht.LEFT,sortFunction:null,valueMapsTo:"value"}}),vI=lt({},te,{legend:{enabled:!1},gauge:{type:sr.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,alignment:Ht.LEFT}}),yI=lt({},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)},alignment:Ht.LEFT}}),um=lt({},te,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),EI=lt({},um,{legend:{enabled:!0}}),bI=lt({},te,{radar:{axes:{angle:"key",value:"value"},alignment:Ht.LEFT},tooltip:{gridline:{enabled:!0}}}),xI=lt({},or,{comboChartTypes:[]}),_I=lt({tree:{type:za.TREE}},te,{}),SI=lt({},te,{data:lt(te.data,{groupMapsTo:"name"})}),TI=lt({},te,Xr,{data:lt(te.data,{groupMapsTo:"name"})}),OI=lt({},te,{alluvial:{data:lt(te.data,{groupMapsTo:"source"}),nodeAlignment:Ht.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),wI=lt({},te,{axes:im,heatmap:{divider:{state:Yr.AUTO},colorLegend:{type:"linear"}}}),MI=lt({},am,{choropleth:{colorLegend:{type:"linear"}}}),Ct={alluvialChart:OI,areaChart:lm,axisChart:cs,boxplotChart:uI,bubbleChart:fI,bulletChart:pI,chart:te,circlePackChart:TI,choroplethChart:MI,comboChart:xI,donutChart:yI,gaugeChart:vI,groupedBarChart:lI,heatmapChart:wI,histogramChart:gI,lineChart:om,lollipopChart:hI,meterChart:um,pieChart:cm,proportionalMeterChart:EI,radarChart:bI,scatterChart:Jc,simpleBarChart:oI,stackedAreaChart:dI,stackedBarChart:cI,thematicChart:am,treeChart:_I,treemapChart:SI,wordCloudChart:mI},hm=6048e5,AI=864e5,dm=6e4,fm=36e5;function pm(e){const t=bt(e);return t.setHours(0,0,0,0),t}function gm(e){const t=bt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function mm(e,t){const n=pm(e),r=pm(t),i=+n-gm(n),s=+r-gm(r);return Math.round((i-s)/AI)}function ze(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function CI(e){const t=bt(e),n=ze(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function DI(e){const t=bt(e);return mm(t,CI(t))+1}function ja(e){return ls(e,{weekStartsOn:1})}function vm(e){const t=bt(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 LI(e){const t=vm(e),n=ze(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),ja(n)}function RI(e){const t=bt(e),n=+ja(t)-+LI(t);return Math.round(n/hm)+1}function ym(e,t){var u,d,h,f;const n=bt(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=ls(a,t),l=ze(e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const c=ls(l,t);return n.getTime()>=o.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function II(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),ls(s,t)}function kI(e,t){const n=bt(e),r=+ls(n,t)-+II(n,t);return Math.round(r/hm)+1}function Ot(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const In={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ot(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ot(n+1,2)},d(e,t){return Ot(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 Ot(e.getHours()%12||12,t.length)},H(e,t){return Ot(e.getHours(),t.length)},m(e,t){return Ot(e.getMinutes(),t.length)},s(e,t){return Ot(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Ot(i,t.length)}},Zr={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Em={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 In.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 Ot(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Ot(s,t.length)},R:function(e,t){const n=vm(e);return Ot(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ot(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 Ot(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 Ot(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 In.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 Ot(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=kI(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Ot(i,t.length)},I:function(e,t,n){const r=RI(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ot(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):In.d(e,t)},D:function(e,t,n){const r=DI(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ot(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 Ot(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 Ot(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 Ot(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=Zr.noon:r===0?i=Zr.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=Zr.evening:r>=12?i=Zr.afternoon:r>=4?i=Zr.morning:i=Zr.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 In.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):In.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ot(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ot(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):In.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):In.s(e,t)},S:function(e,t){return In.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return xm(r);case"XXXX":case"XX":return lr(r);case"XXXXX":case"XXX":default:return lr(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return xm(r);case"xxxx":case"xx":return lr(r);case"xxxxx":case"xxx":default:return lr(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+bm(r,":");case"OOOO":default:return"GMT"+lr(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+bm(r,":");case"zzzz":default:return"GMT"+lr(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Ot(r,t.length)},T:function(e,t,n){const r=e.getTime();return Ot(r,t.length)}};function bm(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+Ot(s,2)}function xm(e,t){return e%60===0?(e>0?"-":"+")+Ot(Math.abs(e)/60,2):lr(e,t)}function lr(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Ot(Math.trunc(r/60),2),s=Ot(r%60,2);return n+i+t+s}const _m=(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"})}},Sm=(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"})}},PI={p:Sm,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return _m(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}}",_m(r,t)).replace("{{time}}",Sm(i,t))}},NI=/^D+$/,$I=/^Y+$/,FI=["D","DD","YY","YYYY"];function UI(e){return NI.test(e)}function BI(e){return $I.test(e)}function HI(e,t,n){const r=GI(e,t,n);if(console.warn(r),FI.includes(e))throw new RangeError(r)}function GI(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function VI(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function zI(e){if(!VI(e)&&typeof e!="number")return!1;const t=bt(e);return!isNaN(Number(t))}const WI=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,YI=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,qI=/^'([^]*?)'?$/,XI=/''/g,jI=/[a-zA-Z]/;function tu(e,t,n){var u,d,h,f,p,g,m,v;const r=qa(),i=(n==null?void 0:n.locale)??r.locale??nm,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??((v=(m=r.locale)==null?void 0:m.options)==null?void 0:v.weekStartsOn)??0,o=bt(e);if(!zI(o))throw new RangeError("Invalid time value");let l=t.match(YI).map(E=>{const y=E[0];if(y==="p"||y==="P"){const x=PI[y];return x(E,i.formatLong)}return E}).join("").match(WI).map(E=>{if(E==="''")return{isToken:!1,value:"'"};const y=E[0];if(y==="'")return{isToken:!1,value:ZI(E)};if(Em[y])return{isToken:!0,value:E};if(y.match(jI))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return{isToken:!1,value:E}});i.localize.preprocessor&&(l=i.localize.preprocessor(o,l));const c={firstWeekContainsDate:s,weekStartsOn:a,locale:i};return l.map(E=>{if(!E.isToken)return E.value;const y=E.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&BI(y)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&UI(y))&&HI(y,t,String(e));const x=Em[y[0]];return x(o,y,i.localize,c)}).join("")}function ZI(e){const t=e.match(qI);return t?t[1].replace(XI,"'"):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 eu=[["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 Om(e,t,n,r,i){const s=t===0,a=Number(tu(new Date(e),"c"))===2,o=Number(tu(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||Ka(e)||us(e,l)||kn(e);case"minute":return s||Ka(e)||us(e,l)||kn(e);case"30minutes":return s||Ka(e)||us(e,l)||kn(e);case"hourly":return s||Ka(e)||us(e,l)||kn(e);case"daily":return i?s||a||kn(e):s||us(e,l)||kn(e);case"weekly":return s||a||kn(e);case"monthly":return s||kn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function nu(e,t,n,r,i,s){const a=i.showDayName,o=r==="daily"&&a?"weekly":r,l=new Date(e),c=b(i,"timeIntervalFormats")[o],u=b(c,"primary"),d=b(c,"secondary"),h=Om(e,t,n,r,a);let f=h?u:d;r==="15seconds"&&l.getMilliseconds()!==0&&(f=f.replace("pp","h:mm:ss.SSS a"));const p=i.localeObject,{code:g,optionsObject:m}=s,v=m[r].type,E=m[r][h?"primary":"secondary"][f];if(r==="quarterly"||!E){const x=tu(l,f,{locale:p}).split("").map(S=>{let _=Number(S);return S!==" "&&!Number.isNaN(_)?_.toLocaleString(g):S});return s[v](l,g,{},x.join(""))}else return s[v](l,g,E)}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 KI(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function QI(e){const t=eu.reduce((n,[,r],i)=>{const s=eu[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return eu[t][0]}function ru(e,t){if(Tm[t])return t;if(e.length===1)return"15seconds";const n=KI(e),r=An(n);return QI(r)}function Ka(e){const{s:t,m:n,H:r}=Za(e);return r===0&&n===0&&t===0}function us(e,t){const n=Za(e).M,r=Za(t).M;return n!==r}function kn(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 wm(e){return e===void 0?"":e.toISOString()}function JI(e){const t=e.trim();return["=","+","-","@"," ","\r"].includes(t.charAt(0))?` ${t}`:/[,\"\n]/.test(t)?`"${t}"`:t}class rn{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}formatTable({headers:t,cells:n}){const r=this.getOptions(),{code:i,date:s,number:a}=b(r,"locale"),o=b(r,"tabularRepModal","tableHeadingFormatter"),l=b(r,"tabularRepModal","tableCellFormatter"),{cartesianScales:c}=this.services,u=c==null?void 0:c.getDomainAxisScaleType();let d;return u===Q.TIME&&(d=f=>s(f,i,{month:"short",day:"numeric",year:"numeric"})),[typeof o=="function"?o(t):t,...typeof l=="function"?l(n):n.map(f=>{d&&(f[1]=d(f[1]));for(let p in f){let g=f[p];typeof g=="number"&&(f[p]=a(g,i))}return f})]}getAllDataFromDomain(t){if(!this.getData())return null;const n=this.getOptions();let r=this.getData();const i=this.getDataGroups(),{groupMapsTo:s}=b(n,"data"),a=b(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===Q.LINEAR||c===Q.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===Q.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}=Nt.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(yn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),n}getDataGroups(t){return b(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(r=>t.includes(r.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Nt.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 aR(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=xR.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(m=>{h.push({group:m,key:p,value:g[m]||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 nc().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=Qi(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?wm(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===Q.TIME?s.sort((l,c)=>{const u=new Date(l),d=new Date(c);return u-d}):(o===Q.LOG||o===Q.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?wm(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=nR(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?nc().offset(VT):nc()).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:lt(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}=Nt.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=b(this.colorScale,t);return i.getFillColor?i.getFillColor(t,n,r,s):s}getStrokeColor(t,n,r){const i=this.getOptions(),s=b(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,n,r,s):s}isUserProvidedColorScaleValid(){const t=b(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=b(s,"label");if(c===null){const d=b(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=>JI(u)).join("")}"`)).map(a=>a.join(",")).join(`
2
- `),r=this.getOptions();let i="myChart";const s=b(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}=Nt.items.status,s=this.getOptions(),a=Qi(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=b(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=b(this.getOptions(),"color","pairing");let n=b(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let r=b(t,"option");const i=Kg.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 tk(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 ek=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Sn(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 nk(e){const t=Qa(e,"border-left-width"),n=Qa(e,"border-right-width");return e.clientWidth+t+n}function rk(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||nk(e),r=t.height||rk(e);return{width:n,height:r}}function ik(){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 xe=16384;function sk(e){(e.width>xe||e.height>xe)&&(e.width>xe&&e.height>xe?e.width>e.height?(e.height*=xe/e.width,e.width=xe):(e.width*=xe/e.height,e.height=xe):e.width>xe?(e.height*=xe/e.width,e.width=xe):(e.width*=xe/e.height,e.height=xe))}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 ak(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function ok(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),ak(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 lk(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function ck(e){return Sn(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function uk(e,t,n){const r=`.${e}:${t}`,i=n.cssText?lk(n):ck(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=ek();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(uk(s,n,r)),t.appendChild(a)}function hk(e,t){Am(e,t,":before"),Am(e,t,":after")}const Cm="application/font-woff",Dm="image/jpeg",dk={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 fk(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function iu(e){const t=fk(e).toLowerCase();return dk[t]||""}function pk(e){return e.split(/,/)[1]}function su(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 au={};function gk(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 ou(e,t,n){const r=gk(e,t,n.includeQueryParams);if(au[r]!=null)return au[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")||""),pk(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 au[r]=i,i}async function mk(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Ja(t)}async function vk(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=iu(n),i=await ou(n,r,t);return Ja(i)}async function yk(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 Ek(e,t){return he(e,HTMLCanvasElement)?mk(e):he(e,HTMLVideoElement)?vk(e,t):he(e,HTMLIFrameElement)?yk(e):e.cloneNode(!1)}const bk=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function xk(e,t,n){var r,i;let s=[];return bk(e)&&e.assignedNodes?s=Sn(e.assignedNodes()):he(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?s=Sn(e.contentDocument.body.childNodes):s=Sn(((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 _k(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):Sn(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 Sk(e,t){he(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),he(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Tk(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 Ok(e,t){return he(t,Element)&&(_k(e,t),hk(e,t),Sk(e,t),Tk(e,t)),t}async function wk(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=>Ek(r,t)).then(r=>xk(e,r,t)).then(r=>Ok(e,r)).then(r=>wk(r,t))}const Im=/url\((['"]?)([^'"]+?)\1\)/g,Mk=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Ak=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Ck(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Dk(e){const t=[];return e.replace(Im,(n,r,i)=>(t.push(i),n)),t.filter(n=>!su(n))}async function Lk(e,t,n,r,i){try{const s=n?tk(t,n):t,a=iu(t);let o;if(i){const l=await i(s);o=Lm(l,a)}else o=await ou(s,a,r);return e.replace(Ck(t),`$1${o}$3`)}catch{}return e}function Rk(e,{preferredFontFormat:t}){return t?e.replace(Ak,n=>{for(;;){const[r,,i]=Mk.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=Rk(e,n);return Dk(r).reduce((s,a)=>s.then(o=>Lk(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 Ik(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 kk(e,t){const n=he(e,HTMLImageElement);if(!(n&&!su(e.src))&&!(he(e,SVGImageElement)&&!su(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await ou(r,iu(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 Pk(e,t){const r=Sn(e.childNodes).map(i=>Nm(i,t));await Promise.all(r).then(()=>e)}async function Nm(e,t){he(e,Element)&&(await Ik(e,t),await kk(e,t),await Pk(e,t))}function Nk(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 $m={};async function Fm(e){let t=$m[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},$m[e]=t,t}async function Um(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 Bm(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 $k(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{Sn(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=Fm(l).then(u=>Um(u,t)).then(u=>Bm(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(Fm(i.href).then(o=>Um(o,t)).then(o=>Bm(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{Sn(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}function Fk(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>km(t.style.getPropertyValue("src")))}async function Uk(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=Sn(e.ownerDocument.styleSheets),r=await $k(n,t);return Fk(r)}async function Bk(e,t){const n=await Uk(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 Hk(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Bk(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 Gk(e,t={}){const{width:n,height:r}=Mm(e,t),i=await to(e,t,!0);return await Hk(i,t),await Nm(i,t),Nk(i,t),await ok(i,n,r)}async function Hm(e,t={}){const{width:n,height:r}=Mm(e,t),i=await Gk(e,t),s=await Ja(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||ik(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||sk(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 Vk(e,t={}){return(await Hm(e,t)).toDataURL()}async function zk(e,t={}){return(await Hm(e,t)).toDataURL("image/jpeg",t.quality||1)}class Tn{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}}const Wk="DONT_STYLE_ME_css_styles_verifier";class R extends Tn{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=I(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:b(t.node(),"width","baseVal","value"),height:b(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}getElementOffset(t,n=!1){const r={left:0,top:0},i=t.getBoundingClientRect(),s=n?{left:0,top:0}:this.getHolder().getBoundingClientRect();try{r.left=i.left-s.left,r.top=i.top-s.top}catch(a){console.error(a)}return r}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=b(t,"style","prefix"),r=I(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",Wk),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),I(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=I(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=b(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=I(r);i.classed("filled",!0),Vk(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var l;let a="myChart";const o=b(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)})}isFullScreenMode(){return I(this.getHolder()).classed("fullscreen")}toggleFullscreen(){const t=this.getHolder();I(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=I(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=R.getSVGElementSize(I(this.mainContainer),{useBBox:!0}),n=I(this.mainContainer).attr("class"),r=I(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(s){i+=Number(R.getSVGElementSize(I(s),{useBBox:!0}).height)}),i<=t?I(this.mainContainer).attr("height",i):I(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&I(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 pt{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=b(this.model.getOptions(),"style","prefix");this.id=`${i}--${this.configs.id}`}this.parent||this.setParent(I(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=b(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=b(this.model.getOptions(),"style","prefix"),r=this.id?`#${this.id}`:"",i=R.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=I(`#${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?lt({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}/*! @license DOMPurify 3.0.9 | (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.9/LICENSE */const{entries:Gm,setPrototypeOf:Vm,isFrozen:Yk,getPrototypeOf:qk,getOwnPropertyDescriptor:Xk}=Object;let{freeze:se,seal:We,create:zm}=Object,{apply:lu,construct:cu}=typeof Reflect<"u"&&Reflect;se||(se=function(t){return t}),We||(We=function(t){return t}),lu||(lu=function(t,n,r){return t.apply(n,r)}),cu||(cu=function(t,n){return new t(...n)});const no=Se(Array.prototype.forEach),Wm=Se(Array.prototype.pop),hs=Se(Array.prototype.push),ro=Se(String.prototype.toLowerCase),uu=Se(String.prototype.toString),jk=Se(String.prototype.match),ds=Se(String.prototype.replace),Zk=Se(String.prototype.indexOf),Kk=Se(String.prototype.trim),Ye=Se(Object.prototype.hasOwnProperty),_e=Se(RegExp.prototype.test),fs=Qk(TypeError);function Se(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 lu(e,t,r)}}function Qk(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return cu(e,n)}}function gt(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&&(Yk(t)||(t[r]=s),i=s)}e[i]=!0}return e}function Jk(e){for(let t=0;t<e.length;t++)Ye(e,t)||(e[t]=null);return e}function cr(e){const t=zm(null);for(const[n,r]of Gm(e))Ye(e,n)&&(Array.isArray(r)?t[n]=Jk(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=cr(r):t[n]=r);return t}function io(e,t){for(;e!==null;){const r=Xk(e,t);if(r){if(r.get)return Se(r.get);if(typeof r.value=="function")return Se(r.value)}e=qk(e)}function n(){return null}return n}const Ym=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"]),hu=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"]),du=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"]),t2=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"]),fu=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"]),e2=se(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),qm=se(["#text"]),Xm=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"]),pu=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"]),jm=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"]),n2=We(/\{\{[\w\W]*|[\w\W]*\}\}/gm),r2=We(/<%[\w\W]*|[\w\W]*%>/gm),i2=We(/\${[\w\W]*}/gm),s2=We(/^data-[\-\w.\u00B7-\uFFFF]/),a2=We(/^aria-[\-\w]+$/),Zm=We(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),o2=We(/^(?:\w+script|data):/i),l2=We(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Km=We(/^html$/i);var Qm=Object.freeze({__proto__:null,MUSTACHE_EXPR:n2,ERB_EXPR:r2,TMPLIT_EXPR:i2,DATA_ATTR:s2,ARIA_ATTR:a2,IS_ALLOWED_URI:Zm,IS_SCRIPT_OR_DATA:o2,ATTR_WHITESPACE:l2,DOCTYPE_NAME:Km});const c2=function(){return typeof window>"u"?null:window},u2=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 Jm(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c2();const t=rt=>Jm(rt);if(t.version="3.0.9",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"),m=io(p,"nextSibling"),v=io(p,"childNodes"),E=io(p,"parentNode");if(typeof a=="function"){const rt=n.createElement("template");rt.content&&rt.content.ownerDocument&&(n=rt.content.ownerDocument)}let y,x="";const{implementation:S,createNodeIterator:_,createDocumentFragment:A,getElementsByTagName:L}=n,{importNode:B}=r;let D={};t.isSupported=typeof Gm=="function"&&typeof E=="function"&&S&&S.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:O,ERB_EXPR:H,TMPLIT_EXPR:P,DATA_ATTR:M,ARIA_ATTR:w,IS_SCRIPT_OR_DATA:U,ATTR_WHITESPACE:F}=Qm;let{IS_ALLOWED_URI:$}=Qm,N=null;const j=gt({},[...Ym,...hu,...du,...fu,...qm]);let q=null;const at=gt({},[...Xm,...pu,...jm,...so]);let nt=Object.seal(zm(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}})),dt=null,mt=null,Z=!0,et=!0,vt=!1,Y=!0,K=!1,ot=!1,C=!1,V=!1,z=!1,Mt=!1,zt=!1,st=!0,kt=!1;const dr="user-content-";let Le=!0,Es=!1,ii={},si=null;const e0=gt({},["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 n0=null;const r0=gt({},["audio","video","img","source","image","track"]);let ju=null;const i0=gt({},["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,Zu=!1,Ku=null;const wB=gt({},[So,To,wn],uu);let bs=null;const MB=["application/xhtml+xml","text/html"],AB="text/html";let qt=null,oi=null;const CB=n.createElement("form"),s0=function(k){return k instanceof RegExp||k instanceof Function},Qu=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(oi&&oi===k)){if((!k||typeof k!="object")&&(k={}),k=cr(k),bs=MB.indexOf(k.PARSER_MEDIA_TYPE)===-1?AB:k.PARSER_MEDIA_TYPE,qt=bs==="application/xhtml+xml"?uu:ro,N=Ye(k,"ALLOWED_TAGS")?gt({},k.ALLOWED_TAGS,qt):j,q=Ye(k,"ALLOWED_ATTR")?gt({},k.ALLOWED_ATTR,qt):at,Ku=Ye(k,"ALLOWED_NAMESPACES")?gt({},k.ALLOWED_NAMESPACES,uu):wB,ju=Ye(k,"ADD_URI_SAFE_ATTR")?gt(cr(i0),k.ADD_URI_SAFE_ATTR,qt):i0,n0=Ye(k,"ADD_DATA_URI_TAGS")?gt(cr(r0),k.ADD_DATA_URI_TAGS,qt):r0,si=Ye(k,"FORBID_CONTENTS")?gt({},k.FORBID_CONTENTS,qt):e0,dt=Ye(k,"FORBID_TAGS")?gt({},k.FORBID_TAGS,qt):{},mt=Ye(k,"FORBID_ATTR")?gt({},k.FORBID_ATTR,qt):{},ii=Ye(k,"USE_PROFILES")?k.USE_PROFILES:!1,Z=k.ALLOW_ARIA_ATTR!==!1,et=k.ALLOW_DATA_ATTR!==!1,vt=k.ALLOW_UNKNOWN_PROTOCOLS||!1,Y=k.ALLOW_SELF_CLOSE_IN_ATTR!==!1,K=k.SAFE_FOR_TEMPLATES||!1,ot=k.WHOLE_DOCUMENT||!1,z=k.RETURN_DOM||!1,Mt=k.RETURN_DOM_FRAGMENT||!1,zt=k.RETURN_TRUSTED_TYPE||!1,V=k.FORCE_BODY||!1,st=k.SANITIZE_DOM!==!1,kt=k.SANITIZE_NAMED_PROPS||!1,Le=k.KEEP_CONTENT!==!1,Es=k.IN_PLACE||!1,$=k.ALLOWED_URI_REGEXP||Zm,ai=k.NAMESPACE||wn,nt=k.CUSTOM_ELEMENT_HANDLING||{},k.CUSTOM_ELEMENT_HANDLING&&s0(k.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(nt.tagNameCheck=k.CUSTOM_ELEMENT_HANDLING.tagNameCheck),k.CUSTOM_ELEMENT_HANDLING&&s0(k.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(nt.attributeNameCheck=k.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),k.CUSTOM_ELEMENT_HANDLING&&typeof k.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(nt.allowCustomizedBuiltInElements=k.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),K&&(et=!1),Mt&&(z=!0),ii&&(N=gt({},qm),q=[],ii.html===!0&&(gt(N,Ym),gt(q,Xm)),ii.svg===!0&&(gt(N,hu),gt(q,pu),gt(q,so)),ii.svgFilters===!0&&(gt(N,du),gt(q,pu),gt(q,so)),ii.mathMl===!0&&(gt(N,fu),gt(q,jm),gt(q,so))),k.ADD_TAGS&&(N===j&&(N=cr(N)),gt(N,k.ADD_TAGS,qt)),k.ADD_ATTR&&(q===at&&(q=cr(q)),gt(q,k.ADD_ATTR,qt)),k.ADD_URI_SAFE_ATTR&&gt(ju,k.ADD_URI_SAFE_ATTR,qt),k.FORBID_CONTENTS&&(si===e0&&(si=cr(si)),gt(si,k.FORBID_CONTENTS,qt)),Le&&(N["#text"]=!0),ot&&gt(N,["html","head","body"]),N.table&&(gt(N,["tbody"]),delete dt.tbody),k.TRUSTED_TYPES_POLICY){if(typeof k.TRUSTED_TYPES_POLICY.createHTML!="function")throw fs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof k.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw fs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=k.TRUSTED_TYPES_POLICY,x=y.createHTML("")}else y===void 0&&(y=u2(f,i)),y!==null&&typeof x=="string"&&(x=y.createHTML(""));se&&se(k),oi=k}},a0=gt({},["mi","mo","mn","ms","mtext"]),o0=gt({},["foreignobject","desc","title","annotation-xml"]),DB=gt({},["title","style","font","a","script"]),l0=gt({},[...hu,...du,...t2]),c0=gt({},[...fu,...e2]),LB=function(k){let X=E(k);(!X||!X.tagName)&&(X={namespaceURI:ai,tagName:"template"});const J=ro(k.tagName),Rt=ro(X.tagName);return Ku[k.namespaceURI]?k.namespaceURI===To?X.namespaceURI===wn?J==="svg":X.namespaceURI===So?J==="svg"&&(Rt==="annotation-xml"||a0[Rt]):!!l0[J]:k.namespaceURI===So?X.namespaceURI===wn?J==="math":X.namespaceURI===To?J==="math"&&o0[Rt]:!!c0[J]:k.namespaceURI===wn?X.namespaceURI===To&&!o0[Rt]||X.namespaceURI===So&&!a0[Rt]?!1:!c0[J]&&(DB[J]||!l0[J]):!!(bs==="application/xhtml+xml"&&Ku[k.namespaceURI]):!1},fr=function(k){hs(t.removed,{element:k});try{k.parentNode.removeChild(k)}catch{k.remove()}},Ju=function(k,X){try{hs(t.removed,{attribute:X.getAttributeNode(k),from:X})}catch{hs(t.removed,{attribute:null,from:X})}if(X.removeAttribute(k),k==="is"&&!q[k])if(z||Mt)try{fr(X)}catch{}else try{X.setAttribute(k,"")}catch{}},u0=function(k){let X=null,J=null;if(V)k="<remove></remove>"+k;else{const ne=jk(k,/^[\r\n\t ]+/);J=ne&&ne[0]}bs==="application/xhtml+xml"&&ai===wn&&(k='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+k+"</body></html>");const Rt=y?y.createHTML(k):k;if(ai===wn)try{X=new h().parseFromString(Rt,bs)}catch{}if(!X||!X.documentElement){X=S.createDocument(ai,"template",null);try{X.documentElement.innerHTML=Zu?x:Rt}catch{}}const ee=X.body||X.documentElement;return k&&J&&ee.insertBefore(n.createTextNode(J),ee.childNodes[0]||null),ai===wn?L.call(X,ot?"html":"body")[0]:ot?X.documentElement:ee},h0=function(k){return _.call(k.ownerDocument||k,k,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null)},RB=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")},d0=function(k){return typeof o=="function"&&k instanceof o},Mn=function(k,X,J){D[k]&&no(D[k],Rt=>{Rt.call(t,X,J,oi)})},f0=function(k){let X=null;if(Mn("beforeSanitizeElements",k,null),RB(k))return fr(k),!0;const J=qt(k.nodeName);if(Mn("uponSanitizeElement",k,{tagName:J,allowedTags:N}),k.hasChildNodes()&&!d0(k.firstElementChild)&&_e(/<[/\w]/g,k.innerHTML)&&_e(/<[/\w]/g,k.textContent))return fr(k),!0;if(!N[J]||dt[J]){if(!dt[J]&&g0(J)&&(nt.tagNameCheck instanceof RegExp&&_e(nt.tagNameCheck,J)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(J)))return!1;if(Le&&!si[J]){const Rt=E(k)||k.parentNode,ee=v(k)||k.childNodes;if(ee&&Rt){const ne=ee.length;for(let pe=ne-1;pe>=0;--pe)Rt.insertBefore(g(ee[pe],!0),m(k))}}return fr(k),!0}return k instanceof l&&!LB(k)||(J==="noscript"||J==="noembed"||J==="noframes")&&_e(/<\/no(script|embed|frames)/i,k.innerHTML)?(fr(k),!0):(K&&k.nodeType===3&&(X=k.textContent,no([O,H,P],Rt=>{X=ds(X,Rt," ")}),k.textContent!==X&&(hs(t.removed,{element:k.cloneNode()}),k.textContent=X)),Mn("afterSanitizeElements",k,null),!1)},p0=function(k,X,J){if(st&&(X==="id"||X==="name")&&(J in n||J in CB))return!1;if(!(et&&!mt[X]&&_e(M,X))){if(!(Z&&_e(w,X))){if(!q[X]||mt[X]){if(!(g0(k)&&(nt.tagNameCheck instanceof RegExp&&_e(nt.tagNameCheck,k)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(k))&&(nt.attributeNameCheck instanceof RegExp&&_e(nt.attributeNameCheck,X)||nt.attributeNameCheck instanceof Function&&nt.attributeNameCheck(X))||X==="is"&&nt.allowCustomizedBuiltInElements&&(nt.tagNameCheck instanceof RegExp&&_e(nt.tagNameCheck,J)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(J))))return!1}else if(!ju[X]){if(!_e($,ds(J,F,""))){if(!((X==="src"||X==="xlink:href"||X==="href")&&k!=="script"&&Zk(J,"data:")===0&&n0[k])){if(!(vt&&!_e(U,ds(J,F,"")))){if(J)return!1}}}}}}return!0},g0=function(k){return k!=="annotation-xml"&&k.indexOf("-")>0},m0=function(k){Mn("beforeSanitizeAttributes",k,null);const{attributes:X}=k;if(!X)return;const J={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:q};let Rt=X.length;for(;Rt--;){const ee=X[Rt],{name:ne,namespaceURI:pe,value:pr}=ee,xs=qt(ne);let ge=ne==="value"?pr:Kk(pr);if(J.attrName=xs,J.attrValue=ge,J.keepAttr=!0,J.forceKeepAttr=void 0,Mn("uponSanitizeAttribute",k,J),ge=J.attrValue,J.forceKeepAttr||(Ju(ne,k),!J.keepAttr))continue;if(!Y&&_e(/\/>/i,ge)){Ju(ne,k);continue}K&&no([O,H,P],y0=>{ge=ds(ge,y0," ")});const v0=qt(k.nodeName);if(p0(v0,xs,ge)){if(kt&&(xs==="id"||xs==="name")&&(Ju(ne,k),ge=dr+ge),y&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!pe)switch(f.getAttributeType(v0,xs)){case"TrustedHTML":{ge=y.createHTML(ge);break}case"TrustedScriptURL":{ge=y.createScriptURL(ge);break}}try{pe?k.setAttributeNS(pe,ne,ge):k.setAttribute(ne,ge),Wm(t.removed)}catch{}}}Mn("afterSanitizeAttributes",k,null)},IB=function rt(k){let X=null;const J=h0(k);for(Mn("beforeSanitizeShadowDOM",k,null);X=J.nextNode();)Mn("uponSanitizeShadowNode",X,null),!f0(X)&&(X.content instanceof s&&rt(X.content),m0(X));Mn("afterSanitizeShadowDOM",k,null)};return t.sanitize=function(rt){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X=null,J=null,Rt=null,ee=null;if(Zu=!rt,Zu&&(rt="<!-->"),typeof rt!="string"&&!d0(rt))if(typeof rt.toString=="function"){if(rt=rt.toString(),typeof rt!="string")throw fs("dirty is not a string, aborting")}else throw fs("toString is not a function");if(!t.isSupported)return rt;if(C||Qu(k),t.removed=[],typeof rt=="string"&&(Es=!1),Es){if(rt.nodeName){const pr=qt(rt.nodeName);if(!N[pr]||dt[pr])throw fs("root node is forbidden and cannot be sanitized in-place")}}else if(rt instanceof o)X=u0("<!---->"),J=X.ownerDocument.importNode(rt,!0),J.nodeType===1&&J.nodeName==="BODY"||J.nodeName==="HTML"?X=J:X.appendChild(J);else{if(!z&&!K&&!ot&&rt.indexOf("<")===-1)return y&&zt?y.createHTML(rt):rt;if(X=u0(rt),!X)return z?null:zt?x:""}X&&V&&fr(X.firstChild);const ne=h0(Es?rt:X);for(;Rt=ne.nextNode();)f0(Rt)||(Rt.content instanceof s&&IB(Rt.content),m0(Rt));if(Es)return rt;if(z){if(Mt)for(ee=A.call(X.ownerDocument);X.firstChild;)ee.appendChild(X.firstChild);else ee=X;return(q.shadowroot||q.shadowrootmode)&&(ee=B.call(r,ee,!0)),ee}let pe=ot?X.outerHTML:X.innerHTML;return ot&&N["!doctype"]&&X.ownerDocument&&X.ownerDocument.doctype&&X.ownerDocument.doctype.name&&_e(Km,X.ownerDocument.doctype.name)&&(pe="<!DOCTYPE "+X.ownerDocument.doctype.name+`>
4
- `+pe),K&&no([O,H,P],pr=>{pe=ds(pe,pr," ")}),y&&zt?y.createHTML(pe):pe},t.setConfig=function(){let rt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Qu(rt),C=!0},t.clearConfig=function(){oi=null,C=!1},t.isValidAttribute=function(rt,k,X){oi||Qu({});const J=qt(rt),Rt=qt(k);return p0(J,Rt,X)},t.addHook=function(rt,k){typeof k=="function"&&(D[rt]=D[rt]||[],hs(D[rt],k))},t.removeHook=function(rt){if(D[rt])return Wm(D[rt])},t.removeHooks=function(rt){D[rt]&&(D[rt]=[])},t.removeAllHooks=function(){D={}},t}var gu=Jm();const ao=e=>gu.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),h2=e=>gu.sanitize(e,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),sn=e=>gu.sanitize(e,{ALLOWED_TAGS:[]}),xo=class xo extends pt{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 toolbar");if(b(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("role","button").attr("aria-disabled",c=>c.shouldBeDisabled()).attr("aria-label",c=>c.title).html(c=>`
1
+ (function(W,Ie){typeof exports=="object"&&typeof module<"u"?Ie(exports):typeof define=="function"&&define.amd?define(["exports"],Ie):(W=typeof globalThis<"u"?globalThis:W||self,Ie(W.Charts={}))})(this,function(W){"use strict";function Ie(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=Ie,n=(o,l)=>Ie(e(o),l),r=(o,l)=>e(o)-l):(t=e===Ie||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 b0(e){return e===null?NaN:+e}function*x0(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 wo=Oo(Ie).right;Oo(b0).center;function _0(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 ke(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 Un{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 eh 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(nh(this,t))}has(t){return super.has(nh(this,t))}set(t,n){return super.set(S0(this,t),n)}delete(t){return super.delete(T0(this,t))}}function nh({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function S0({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function T0({_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 w0(e){return e}function M0(e=Ie){if(e===Ie)return rh;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 rh(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var A0=Array.prototype,C0=A0.slice;function Mo(e){return()=>e}const D0=Math.sqrt(50),L0=Math.sqrt(10),R0=Math.sqrt(2);function Ss(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>=D0?10:s>=L0?5:s>=R0?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?Ss(e,t,n*2):[o,l,c]}function Ts(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?Ss(t,e,n):Ss(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 gr(e,t,n){return t=+t,e=+e,n=+n,Ss(e,t,n)[2]}function Ao(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?gr(t,e,n):gr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function I0(e,t,n){let r;for(;;){const i=gr(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 k0(e){return Math.max(1,Math.ceil(Math.log(_0(e))/Math.LN2)+1)}function P0(){var e=w0,t=ke,n=k0;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 y=h,x=+f;if(t===ke&&([d,h]=I0(d,h,x)),f=Ts(d,h,x),f[0]<=d&&(l=gr(d,h,x)),f[f.length-1]>=h)if(y>=h&&t===ke){const S=gr(d,h,x);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,m=p;f[g]<=d;)++g;for(;f[m-1]>h;)--m;(g||m<p)&&(f=f.slice(g,m),p=m-g);var v=new Array(p+1),E;for(s=0;s<=p;++s)E=v[s]=[],E.x0=s>0?f[s-1]:d,E.x1=s<p?f[s]:h;if(isFinite(l)){if(l>0)for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&v[Math.min(p,Math.floor((o-d)/l))].push(i[s]);else if(l<0){for(s=0;s<a;++s)if((o=c[s])!=null&&d<=o&&o<=h){const y=Math.floor((d-o)*l);v[Math.min(p,y+(f[y]<=o))].push(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&v[wo(f,o,0,p)].push(i[s]);return v}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:Mo(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:Mo([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Mo(Array.isArray(i)?C0.call(i):i),r):n},r}function Bn(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function Cn(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ih(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?rh:M0(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));ih(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 Co(e,t,n){if(e=Float64Array.from(x0(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Cn(e);if(t>=1)return Bn(e);var r,i=(r-1)*t,s=Math.floor(i),a=Bn(ih(e,s).subarray(0,s+1)),o=Cn(e.subarray(s+1));return a+(o-a)*(i-s)}}function*N0(e){for(const t of e)yield*t}function sh(e){return Array.from(N0(e))}function $0(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 F0(e){return e}var Os=1,ws=2,Do=3,ci=4,ah=1e-6;function U0(e){return"translate("+e+",0)"}function B0(e){return"translate(0,"+e+")"}function H0(e){return t=>+e(t)}function G0(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function V0(){return!this.__axis}function Ms(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===Os||e===ci?-1:1,u=e===ci||e===ws?"x":"y",d=e===Os||e===Do?U0:B0;function h(f){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),g=i??(t.tickFormat?t.tickFormat.apply(t,n):F0),m=Math.max(s,0)+o,v=t.range(),E=+v[0]+l,y=+v[v.length-1]+l,x=(t.bandwidth?G0:H0)(t.copy(),l),S=f.selection?f.selection():f,_=S.selectAll(".domain").data([null]),C=S.selectAll(".tick").data(p,t).order(),L=C.exit(),B=C.enter().append("g").attr("class","tick"),D=C.select("line"),O=C.select("text");_=_.merge(_.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),C=C.merge(B),D=D.merge(B.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),O=O.merge(B.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===Os?"0em":e===Do?"0.71em":"0.32em")),f!==S&&(_=_.transition(f),C=C.transition(f),D=D.transition(f),O=O.transition(f),L=L.transition(f).attr("opacity",ah).attr("transform",function(H){return isFinite(H=x(H))?d(H+l):this.getAttribute("transform")}),B.attr("opacity",ah).attr("transform",function(H){var P=this.parentNode.__axis;return d((P&&isFinite(P=P(H))?P:x(H))+l)})),L.remove(),_.attr("d",e===ci||e===ws?a?"M"+c*a+","+E+"H"+l+"V"+y+"H"+c*a:"M"+l+","+E+"V"+y:a?"M"+E+","+c*a+"V"+l+"H"+y+"V"+c*a:"M"+E+","+l+"H"+y),C.attr("opacity",1).attr("transform",function(H){return d(x(H)+l)}),D.attr(u+"2",c*s),O.attr(u,c*m).text(g),S.filter(V0).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=x})}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 z0(e){return Ms(Os,e)}function W0(e){return Ms(ws,e)}function Lo(e){return Ms(Do,e)}function oh(e){return Ms(ci,e)}var Y0={value:()=>{}};function Ro(){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 As(n)}function As(e){this._=e}function q0(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}})}As.prototype=Ro.prototype={constructor:As,on:function(e,t){var n=this._,r=q0(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=X0(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]=lh(n[i],e.name,t);else if(t==null)for(i in n)n[i]=lh(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 As(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 X0(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function lh(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Y0,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Io="http://www.w3.org/1999/xhtml";const ch={svg:"http://www.w3.org/2000/svg",xhtml:Io,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Cs(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ch.hasOwnProperty(t)?{space:ch[t],local:e}:e}function j0(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Io&&t.documentElement.namespaceURI===Io?t.createElement(e):t.createElementNS(n,e)}}function Z0(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function uh(e){var t=Cs(e);return(t.local?Z0:j0)(t)}function K0(){}function ko(e){return e==null?K0:function(){return this.querySelector(e)}}function Q0(e){typeof e!="function"&&(e=ko(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 J0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ty(){return[]}function hh(e){return e==null?ty:function(){return this.querySelectorAll(e)}}function ey(e){return function(){return J0(e.apply(this,arguments))}}function ny(e){typeof e=="function"?e=ey(e):e=hh(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 dh(e){return function(){return this.matches(e)}}function fh(e){return function(t){return t.matches(e)}}var ry=Array.prototype.find;function iy(e){return function(){return ry.call(this.children,e)}}function sy(){return this.firstElementChild}function ay(e){return this.select(e==null?sy:iy(typeof e=="function"?e:fh(e)))}var oy=Array.prototype.filter;function ly(){return Array.from(this.children)}function cy(e){return function(){return oy.call(this.children,e)}}function uy(e){return this.selectAll(e==null?ly:cy(typeof e=="function"?e:fh(e)))}function hy(e){typeof e!="function"&&(e=dh(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 ph(e){return new Array(e.length)}function dy(){return new me(this._enter||this._groups.map(ph),this._parents)}function Ds(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ds.prototype={constructor:Ds,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 fy(e){return function(){return e}}function py(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 Ds(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function gy(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 Ds(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(i[o]=l)}function my(e){return e.__data__}function vy(e,t){if(!arguments.length)return Array.from(this,my);var n=t?gy:py,r=this._parents,i=this._groups;typeof e!="function"&&(e=fy(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=yy(e.call(u,u&&u.__data__,c,r)),p=f.length,g=o[c]=new Array(p),m=a[c]=new Array(p),v=l[c]=new Array(h);n(u,d,g,m,v,f,t);for(var E=0,y=0,x,S;E<p;++E)if(x=g[E]){for(E>=y&&(y=E+1);!(S=m[y])&&++y<p;);x._next=S||null}}return a=new me(a,r),a._enter=o,a._exit=l,a}function yy(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ey(){return new me(this._exit||this._groups.map(ph),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 xy(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 _y(){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 Sy(e){e||(e=Ty);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 Ty(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 wy(){return Array.from(this)}function My(){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 Ay(){let e=0;for(const t of this)++e;return e}function Cy(){return!this.node()}function Dy(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 Ly(e){return function(){this.removeAttribute(e)}}function Ry(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Iy(e,t){return function(){this.setAttribute(e,t)}}function ky(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Py(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 $y(e,t){var n=Cs(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?Ry:Ly:typeof t=="function"?n.local?Ny:Py:n.local?ky:Iy)(n,t))}function gh(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Fy(e){return function(){this.style.removeProperty(e)}}function Uy(e,t,n){return function(){this.style.setProperty(e,t,n)}}function By(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Hy(e,t,n){return arguments.length>1?this.each((t==null?Fy:typeof t=="function"?By:Uy)(e,t,n??"")):mr(this.node(),e)}function mr(e,t){return e.style.getPropertyValue(t)||gh(e).getComputedStyle(e,null).getPropertyValue(t)}function Gy(e){return function(){delete this[e]}}function Vy(e,t){return function(){this[e]=t}}function zy(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Wy(e,t){return arguments.length>1?this.each((t==null?Gy:typeof t=="function"?zy:Vy)(e,t)):this.node()[e]}function mh(e){return e.trim().split(/^|\s+/)}function Po(e){return e.classList||new vh(e)}function vh(e){this._node=e,this._names=mh(e.getAttribute("class")||"")}vh.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 yh(e,t){for(var n=Po(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Eh(e,t){for(var n=Po(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Yy(e){return function(){yh(this,e)}}function qy(e){return function(){Eh(this,e)}}function Xy(e,t){return function(){(t.apply(this,arguments)?yh:Eh)(this,e)}}function jy(e,t){var n=mh(e+"");if(arguments.length<2){for(var r=Po(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?Xy:t?Yy:qy)(n,t))}function Zy(){this.textContent=""}function Ky(e){return function(){this.textContent=e}}function Qy(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Jy(e){return arguments.length?this.each(e==null?Zy:(typeof e=="function"?Qy:Ky)(e)):this.node().textContent}function t1(){this.innerHTML=""}function e1(e){return function(){this.innerHTML=e}}function n1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function r1(e){return arguments.length?this.each(e==null?t1:(typeof e=="function"?n1:e1)(e)):this.node().innerHTML}function i1(){this.nextSibling&&this.parentNode.appendChild(this)}function s1(){return this.each(i1)}function a1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function o1(){return this.each(a1)}function l1(e){var t=typeof e=="function"?e:uh(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function c1(){return null}function u1(e,t){var n=typeof e=="function"?e:uh(e),r=t==null?c1:typeof t=="function"?t:ko(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function h1(){var e=this.parentNode;e&&e.removeChild(this)}function d1(){return this.each(h1)}function f1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function p1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function g1(e){return this.select(e?p1:f1)}function m1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function v1(e){return function(t){e.call(this,t,this.__data__)}}function y1(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 E1(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=v1(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 x1(e,t,n){var r=y1(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:E1,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function bh(e,t,n){var r=gh(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 _1(e,t){return function(){return bh(this,e,t)}}function S1(e,t){return function(){return bh(this,e,t.apply(this,arguments))}}function T1(e,t){return this.each((typeof t=="function"?S1:_1)(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 w1(){return this}me.prototype=ui.prototype={constructor:me,select:Q0,selectAll:ny,selectChild:ay,selectChildren:uy,filter:hy,data:vy,enter:dy,exit:Ey,join:by,merge:xy,selection:w1,order:_y,sort:Sy,call:Oy,nodes:wy,node:My,size:Ay,empty:Cy,each:Dy,attr:$y,style:Hy,property:Wy,classed:jy,text:Jy,html:r1,raise:s1,lower:o1,append:l1,insert:u1,remove:d1,clone:g1,datum:m1,on:x1,dispatch:T1,[Symbol.iterator]:O1};function I(e){return typeof e=="string"?new me([[document.querySelector(e)]],[document.documentElement]):new me([[e]],xh)}function M1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Hn(e,t){if(e=M1(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 $o(e){e.preventDefault(),e.stopImmediatePropagation()}function A1(e){var t=e.document.documentElement,n=I(e).on("dragstart.drag",$o,No);"onselectstart"in t?n.on("selectstart.drag",$o,No):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function C1(e,t){var n=e.document.documentElement,r=I(e).on("dragstart.drag",null);t&&(r.on("click.drag",$o,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 Fo(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _h(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function hi(){}var di=.7,Ls=1/di,vr="\\s*([+-]?\\d+)\\s*",fi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",D1=/^#([0-9a-f]{3,8})$/,L1=new RegExp(`^rgb\\(${vr},${vr},${vr}\\)$`),R1=new RegExp(`^rgb\\(${qe},${qe},${qe}\\)$`),I1=new RegExp(`^rgba\\(${vr},${vr},${vr},${fi}\\)$`),k1=new RegExp(`^rgba\\(${qe},${qe},${qe},${fi}\\)$`),P1=new RegExp(`^hsl\\(${fi},${qe},${qe}\\)$`),N1=new RegExp(`^hsla\\(${fi},${qe},${qe},${fi}\\)$`),Sh={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};Fo(hi,on,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Th,formatHex:Th,formatHex8:$1,formatHsl:F1,formatRgb:Oh,toString:Oh});function Th(){return this.rgb().formatHex()}function $1(){return this.rgb().formatHex8()}function F1(){return Dh(this).formatHsl()}function Oh(){return this.rgb().formatRgb()}function on(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=D1.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?Rs(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Rs(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=L1.exec(e))?new le(t[1],t[2],t[3],1):(t=R1.exec(e))?new le(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=I1.exec(e))?Rs(t[1],t[2],t[3],t[4]):(t=k1.exec(e))?Rs(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=P1.exec(e))?Ch(t[1],t[2]/100,t[3]/100,1):(t=N1.exec(e))?Ch(t[1],t[2]/100,t[3]/100,t[4]):Sh.hasOwnProperty(e)?wh(Sh[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 Rs(e,t,n,r){return r<=0&&(e=t=n=NaN),new le(e,t,n,r)}function U1(e){return e instanceof hi||(e=on(e)),e?(e=e.rgb(),new le(e.r,e.g,e.b,e.opacity)):new le}function Uo(e,t,n,r){return arguments.length===1?U1(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}Fo(le,Uo,_h(hi,{brighter(e){return e=e==null?Ls:Math.pow(Ls,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(Gn(this.r),Gn(this.g),Gn(this.b),Is(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:Mh,formatHex:Mh,formatHex8:B1,formatRgb:Ah,toString:Ah}));function Mh(){return`#${Vn(this.r)}${Vn(this.g)}${Vn(this.b)}`}function B1(){return`#${Vn(this.r)}${Vn(this.g)}${Vn(this.b)}${Vn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ah(){const e=Is(this.opacity);return`${e===1?"rgb(":"rgba("}${Gn(this.r)}, ${Gn(this.g)}, ${Gn(this.b)}${e===1?")":`, ${e})`}`}function Is(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Gn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Vn(e){return e=Gn(e),(e<16?"0":"")+e.toString(16)}function Ch(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Pe(e,t,n,r)}function Dh(e){if(e instanceof Pe)return new Pe(e.h,e.s,e.l,e.opacity);if(e instanceof hi||(e=on(e)),!e)return new Pe;if(e instanceof Pe)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 Pe(a,o,l,e.opacity)}function Bo(e,t,n,r){return arguments.length===1?Dh(e):new Pe(e,t,n,r??1)}function Pe(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Fo(Pe,Bo,_h(hi,{brighter(e){return e=e==null?Ls:Math.pow(Ls,e),new Pe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?di:Math.pow(di,e),new Pe(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(Ho(e>=240?e-240:e+120,i,r),Ho(e,i,r),Ho(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Pe(Lh(this.h),ks(this.s),ks(this.l),Is(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=Is(this.opacity);return`${e===1?"hsl(":"hsla("}${Lh(this.h)}, ${ks(this.s)*100}%, ${ks(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Lh(e){return e=(e||0)%360,e<0?e+360:e}function ks(e){return Math.max(0,Math.min(1,e||0))}function Ho(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 Go=e=>()=>e;function H1(e,t){return function(n){return e+n*t}}function G1(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function V1(e){return(e=+e)==1?Rh:function(t,n){return n-t?G1(t,n,e):Go(isNaN(t)?n:t)}}function Rh(e,t){var n=t-e;return n?H1(e,n):Go(isNaN(e)?t:e)}const Ps=function e(t){var n=V1(t);function r(i,s){var a=n((i=Uo(i)).r,(s=Uo(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=Rh(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 z1(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 W1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Y1(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 q1(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 X1(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 Vo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,zo=new RegExp(Vo.source,"g");function j1(e){return function(){return e}}function Z1(e){return function(t){return e(t)+""}}function Ih(e,t){var n=Vo.lastIndex=zo.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=Vo.exec(e))&&(i=zo.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=zo.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?Z1(l[0].x):j1(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"?Go(t):(n==="number"?ve:n==="string"?(r=on(t))?(t=r,Ps):Ih:t instanceof on?Ps:t instanceof Date?q1:W1(t)?z1:Array.isArray(t)?Y1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?X1:ve)(e,t)}function kh(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Ph=180/Math.PI,Wo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Nh(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)*Ph,skewX:Math.atan(l)*Ph,scaleX:a,scaleY:o}}var Ns;function K1(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Wo:Nh(t.a,t.b,t.c,t.d,t.e,t.f)}function Q1(e){return e==null||(Ns||(Ns=document.createElementNS("http://www.w3.org/2000/svg","g")),Ns.setAttribute("transform",e),!(e=Ns.transform.baseVal.consolidate()))?Wo:(e=e.matrix,Nh(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,m;++p<g;)d[(m=h[p]).i]=m.x(f);return d.join("")}}}var J1=$h(K1,"px, ","px)","deg)"),tE=$h(Q1,", ",")",")");function eE(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var yr=0,gi=0,mi=0,Fh=1e3,$s,vi,Fs=0,zn=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 Yo(){return zn||(Uh(nE),zn=yi.now()+Us)}function nE(){zn=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?Yo():+n)+(t==null?0:+t),!this._next&&vi!==this&&(vi?vi._next=this:$s=this,vi=this),this._call=e,this._time=n,qo()},stop:function(){this._call&&(this._call=null,this._time=1/0,qo())}};function Bh(e,t,n){var r=new Bs;return r.restart(e,t,n),r}function rE(){Yo(),++yr;for(var e=$s,t;e;)(t=zn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--yr}function Hh(){zn=(Fs=yi.now())+Us,yr=gi=0;try{rE()}finally{yr=0,sE(),zn=0}}function iE(){var e=yi.now(),t=e-Fs;t>Fh&&(Us-=t,Fs=e)}function sE(){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,qo(r)}function qo(e){if(!yr){gi&&(gi=clearTimeout(gi));var t=e-zn;t>24?(e<1/0&&(gi=setTimeout(Hh,e-yi.now()-Us)),mi&&(mi=clearInterval(mi))):(mi||(Fs=yi.now(),mi=setInterval(iE,Fh)),yr=1,Uh(Hh))}}function Gh(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 aE=Ro("start","end","cancel","interrupt"),oE=[],Vh=0,zh=1,Xo=2,Hs=3,Wh=4,jo=5,Gs=6;function Vs(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;lE(e,n,{name:t,index:r,group:i,on:aE,tween:oE,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Vh})}function Zo(e,t){var n=Ne(e,t);if(n.state>Vh)throw new Error("too late; already scheduled");return n}function Xe(e,t){var n=Ne(e,t);if(n.state>Hs)throw new Error("too late; already running");return n}function Ne(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function lE(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Bh(s,0,n.time);function s(c){n.state=zh,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!==zh)return l();for(u in r)if(f=r[u],f.name===n.name){if(f.state===Hs)return Gh(a);f.state===Wh?(f.state=Gs,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[u]):+u<t&&(f.state=Gs,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[u])}if(Gh(function(){n.state===Hs&&(n.state=Wh,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=Xo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Xo){for(n.state=Hs,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=jo,1),d=-1,h=i.length;++d<h;)i[d].call(e,u);n.state===jo&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Gs,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Ko(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>Xo&&r.state<jo,r.state=Gs,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function cE(e){return this.each(function(){Ko(this,e)})}function uE(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 hE(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 dE(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ne(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?uE:hE)(n,e,t))}function Qo(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 Ne(i,r).value[t]}}function Yh(e,t){var n;return(typeof t=="number"?ve:t instanceof on?Ps:(n=on(t))?(t=n,Ps):Ih)(e,t)}function fE(e){return function(){this.removeAttribute(e)}}function pE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function gE(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 mE(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 vE(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 yE(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 EE(e,t){var n=Cs(e),r=n==="transform"?tE:Yh;return this.attrTween(e,typeof t=="function"?(n.local?yE:vE)(n,r,Qo(this,"attr."+e,t)):t==null?(n.local?pE:fE)(n):(n.local?mE:gE)(n,r,t))}function bE(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function xE(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function _E(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&xE(e,s)),n}return i._value=t,i}function SE(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 TE(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=Cs(e);return this.tween(n,(r.local?_E:SE)(r,t))}function OE(e,t){return function(){Zo(this,e).delay=+t.apply(this,arguments)}}function wE(e,t){return t=+t,function(){Zo(this,e).delay=t}}function ME(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?OE:wE)(t,e)):Ne(this.node(),t).delay}function AE(e,t){return function(){Xe(this,e).duration=+t.apply(this,arguments)}}function CE(e,t){return t=+t,function(){Xe(this,e).duration=t}}function DE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?AE:CE)(t,e)):Ne(this.node(),t).duration}function LE(e,t){if(typeof t!="function")throw new Error;return function(){Xe(this,e).ease=t}}function RE(e){var t=this._id;return arguments.length?this.each(LE(t,e)):Ne(this.node(),t).ease}function IE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Xe(this,e).ease=n}}function kE(e){if(typeof e!="function")throw new Error;return this.each(IE(this._id,e))}function PE(e){typeof e!="function"&&(e=dh(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 ln(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 ln(a,this._parents,this._name,this._id)}function $E(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 FE(e,t,n){var r,i,s=$E(t)?Zo:Xe;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function UE(e,t){var n=this._id;return arguments.length<2?Ne(this.node(),n).on.on(e):this.each(FE(n,e,t))}function BE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function HE(){return this.on("end.remove",BE(this._id))}function GE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ko(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,Vs(c[h],t,n,h,c,Ne(u,n)));return new ln(s,this._parents,t,n)}function VE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=hh(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=Ne(u,n),g=0,m=h.length;g<m;++g)(f=h[g])&&Vs(f,t,n,g,h,p);s.push(h),a.push(u)}return new ln(s,a,t,n)}var zE=ui.prototype.constructor;function WE(){return new zE(this._groups,this._parents)}function YE(e,t){var n,r,i;return function(){var s=mr(this,e),a=(this.style.removeProperty(e),mr(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function qh(e){return function(){this.style.removeProperty(e)}}function qE(e,t,n){var r,i=n+"",s;return function(){var a=mr(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function XE(e,t,n){var r,i,s;return function(){var a=mr(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),mr(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function jE(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=qh(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function ZE(e,t,n){var r=(e+="")=="transform"?J1:Yh;return t==null?this.styleTween(e,YE(e,r)).on("end.style."+e,qh(e)):typeof t=="function"?this.styleTween(e,XE(e,r,Qo(this,"style."+e,t))).each(jE(this._id,e)):this.styleTween(e,qE(e,r,t),n).on("end.style."+e,null)}function KE(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function QE(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&KE(e,a,n)),r}return s._value=t,s}function JE(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,QE(e,t,n??""))}function tb(e){return function(){this.textContent=e}}function eb(e){return function(){var t=e(this);this.textContent=t??""}}function nb(e){return this.tween("text",typeof e=="function"?eb(Qo(this,"text",e)):tb(e==null?"":e+""))}function rb(e){return function(t){this.textContent=e.call(this,t)}}function ib(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&rb(i)),t}return r._value=e,r}function sb(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,ib(e))}function ab(){for(var e=this._name,t=this._id,n=Xh(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)if(l=a[c]){var u=Ne(l,t);Vs(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new ln(r,this._parents,e,n)}function ob(){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 lb=0;function ln(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Xh(){return++lb}var cn=ui.prototype;ln.prototype={constructor:ln,select:GE,selectAll:VE,selectChild:cn.selectChild,selectChildren:cn.selectChildren,filter:PE,merge:NE,selection:WE,transition:ab,call:cn.call,nodes:cn.nodes,node:cn.node,size:cn.size,empty:cn.empty,each:cn.each,on:UE,attr:EE,attrTween:TE,style:ZE,styleTween:JE,text:nb,textTween:sb,remove:HE,tween:dE,delay:ME,duration:DE,ease:RE,easeVarying:kE,end:ob,[Symbol.iterator]:cn[Symbol.iterator]};const cb=e=>+e;function jh(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var ub={time:null,delay:0,duration:250,ease:jh};function hb(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function db(e){var t,n;e instanceof ln?(t=e._id,e=e._name):(t=Xh(),(n=ub).time=Yo(),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])&&Vs(l,e,t,c,a,n||hb(l,t));return new ln(r,this._parents,e,t)}ui.prototype.interrupt=cE,ui.prototype.transition=db;const Jo=e=>()=>e;function fb(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 pb(e){e.stopImmediatePropagation()}function tl(e){e.preventDefault(),e.stopImmediatePropagation()}var Zh={name:"drag"},el={name:"space"},Er={name:"handle"},br={name:"center"};const{abs:Kh,max:Zt,min:Kt}=Math;function Qh(e){return[+e[0],+e[1]]}function Jh(e){return[Qh(e[0]),Qh(e[1])]}var zs={name:"x",handles:["w","e"].map(Ws),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]]}},nl={name:"y",handles:["n","s"].map(Ws),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]]}},un={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"},td={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},ed={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},gb={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},mb={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Ws(e){return{type:e}}function vb(e){return!e.ctrlKey&&!e.button}function yb(){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 Eb(){return navigator.maxTouchPoints||"ontouchstart"in this}function rl(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function bb(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function nd(){return xb(zs)}function xb(e){var t=yb,n=vb,r=Eb,i=!0,s=Ro("start","brush","end"),a=6,o;function l(m){var v=m.property("__brush",g).selectAll(".overlay").data([Ws("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",un.overlay).merge(v).each(function(){var y=rl(this).extent;I(this).attr("x",y[0][0]).attr("y",y[0][1]).attr("width",y[1][0]-y[0][0]).attr("height",y[1][1]-y[0][1])}),m.selectAll(".selection").data([Ws("selection")]).enter().append("rect").attr("class","selection").attr("cursor",un.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var E=m.selectAll(".handle").data(e.handles,function(y){return y.type});E.exit().remove(),E.enter().append("rect").attr("class",function(y){return"handle handle--"+y.type}).attr("cursor",function(y){return un[y.type]}),m.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(m,v,E){m.tween?m.on("start.brush",function(y){u(this,arguments).beforestart().start(y)}).on("interrupt.brush end.brush",function(y){u(this,arguments).end(y)}).tween("brush",function(){var y=this,x=y.__brush,S=u(y,arguments),_=x.selection,C=e.input(typeof v=="function"?v.apply(this,arguments):v,x.extent),L=pi(_,C);function B(D){x.selection=D===1&&C===null?null:L(D),c.call(y),S.brush()}return _!==null&&C!==null?B:B(1)}):m.each(function(){var y=this,x=arguments,S=y.__brush,_=e.input(typeof v=="function"?v.apply(y,x):v,S.extent),C=u(y,x).beforestart();Ko(y),S.selection=_===null?null:_,c.call(y),C.start(E).brush(E).end(E)})},l.clear=function(m,v){l.move(m,null,v)};function c(){var m=I(this),v=rl(this).selection;v?(m.selectAll(".selection").style("display",null).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(E){return E.type[E.type.length-1]==="e"?v[1][0]-a/2:v[0][0]-a/2}).attr("y",function(E){return E.type[0]==="s"?v[1][1]-a/2:v[0][1]-a/2}).attr("width",function(E){return E.type==="n"||E.type==="s"?v[1][0]-v[0][0]+a:a}).attr("height",function(E){return E.type==="e"||E.type==="w"?v[1][1]-v[0][1]+a:a})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(m,v,E){var y=m.__brush.emitter;return y&&(!E||!y.clean)?y:new d(m,v,E)}function d(m,v,E){this.that=m,this.args=v,this.state=m.__brush,this.active=0,this.clean=E}d.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,v){return this.starting?(this.starting=!1,this.emit("start",m,v)):this.emit("brush",m),this},brush:function(m,v){return this.emit("brush",m,v),this},end:function(m,v){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,v)),this},emit:function(m,v,E){var y=I(this.that).datum();s.call(m,this.that,new fb(m,{sourceEvent:v,target:l,selection:e.output(this.state.selection),mode:E,dispatch:s}),y)}};function h(m){if(o&&!m.touches||!n.apply(this,arguments))return;var v=this,E=m.target.__data__.type,y=(i&&m.metaKey?E="overlay":E)==="selection"?Zh:i&&m.altKey?br:Er,x=e===nl?null:gb[E],S=e===zs?null:mb[E],_=rl(v),C=_.extent,L=_.selection,B=C[0][0],D,O,H=C[0][1],P,M,w=C[1][0],U,$,N=C[1][1],F,Y,Z=0,K=0,dt,it=x&&S&&i&&m.shiftKey,ft,j,nt=Array.from(m.touches||[m],st=>{const kt=st.identifier;return st=Hn(st,v),st.point0=st.slice(),st.identifier=kt,st});Ko(v);var vt=u(v,arguments,!0).beforestart();if(E==="overlay"){L&&(dt=!0);const st=[nt[0],nt[1]||nt[0]];_.selection=L=[[D=e===nl?B:Kt(st[0][0],st[1][0]),P=e===zs?H:Kt(st[0][1],st[1][1])],[U=e===nl?w:Zt(st[0][0],st[1][0]),F=e===zs?N:Zt(st[0][1],st[1][1])]],nt.length>1&&V(m)}else D=L[0][0],P=L[0][1],U=L[1][0],F=L[1][1];O=D,M=P,$=U,Y=F;var q=I(v).attr("pointer-events","none"),Q=q.selectAll(".overlay").attr("cursor",un[E]);if(m.touches)vt.moved=A,vt.ended=z;else{var ot=I(m.view).on("mousemove.brush",A,!0).on("mouseup.brush",z,!0);i&&ot.on("keydown.brush",St,!0).on("keyup.brush",zt,!0),A1(m.view)}c.call(v),vt.start(m,y.name);function A(st){for(const kt of st.changedTouches||[st])for(const Fn of nt)Fn.identifier===kt.identifier&&(Fn.cur=Hn(kt,v));if(it&&!ft&&!j&&nt.length===1){const kt=nt[0];Kh(kt.cur[0]-kt[0])>Kh(kt.cur[1]-kt[1])?j=!0:ft=!0}for(const kt of nt)kt.cur&&(kt[0]=kt.cur[0],kt[1]=kt.cur[1]);dt=!0,tl(st),V(st)}function V(st){const kt=nt[0],Fn=kt.point0;var an;switch(Z=kt[0]-Fn[0],K=kt[1]-Fn[1],y){case el:case Zh:{x&&(Z=Zt(B-D,Kt(w-U,Z)),O=D+Z,$=U+Z),S&&(K=Zt(H-P,Kt(N-F,K)),M=P+K,Y=F+K);break}case Er:{nt[1]?(x&&(O=Zt(B,Kt(w,nt[0][0])),$=Zt(B,Kt(w,nt[1][0])),x=1),S&&(M=Zt(H,Kt(N,nt[0][1])),Y=Zt(H,Kt(N,nt[1][1])),S=1)):(x<0?(Z=Zt(B-D,Kt(w-D,Z)),O=D+Z,$=U):x>0&&(Z=Zt(B-U,Kt(w-U,Z)),O=D,$=U+Z),S<0?(K=Zt(H-P,Kt(N-P,K)),M=P+K,Y=F):S>0&&(K=Zt(H-F,Kt(N-F,K)),M=P,Y=F+K));break}case br:{x&&(O=Zt(B,Kt(w,D-Z*x)),$=Zt(B,Kt(w,U+Z*x))),S&&(M=Zt(H,Kt(N,P-K*S)),Y=Zt(H,Kt(N,F+K*S)));break}}$<O&&(x*=-1,an=D,D=U,U=an,an=O,O=$,$=an,E in td&&Q.attr("cursor",un[E=td[E]])),Y<M&&(S*=-1,an=P,P=F,F=an,an=M,M=Y,Y=an,E in ed&&Q.attr("cursor",un[E=ed[E]])),_.selection&&(L=_.selection),ft&&(O=L[0][0],$=L[1][0]),j&&(M=L[0][1],Y=L[1][1]),(L[0][0]!==O||L[0][1]!==M||L[1][0]!==$||L[1][1]!==Y)&&(_.selection=[[O,M],[$,Y]],c.call(v),vt.brush(st,y.name))}function z(st){if(pb(st),st.touches){if(st.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else C1(st.view,dt),ot.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);q.attr("pointer-events","all"),Q.attr("cursor",un.overlay),_.selection&&(L=_.selection),bb(L)&&(_.selection=null,c.call(v)),vt.end(st,y.name)}function St(st){switch(st.keyCode){case 16:{it=x&&S;break}case 18:{y===Er&&(x&&(U=$-Z*x,D=O+Z*x),S&&(F=Y-K*S,P=M+K*S),y=br,V(st));break}case 32:{(y===Er||y===br)&&(x<0?U=$-Z:x>0&&(D=O-Z),S<0?F=Y-K:S>0&&(P=M-K),y=el,Q.attr("cursor",un.selection),V(st));break}default:return}tl(st)}function zt(st){switch(st.keyCode){case 16:{it&&(ft=j=it=!1,V(st));break}case 18:{y===br&&(x<0?U=$:x>0&&(D=O),S<0?F=Y:S>0&&(P=M),y=Er,V(st));break}case 32:{y===el&&(st.altKey?(x&&(U=$-Z*x,D=O+Z*x),S&&(F=Y-K*S,P=M+K*S),y=br):(x<0?U=$:x>0&&(D=O),S<0?F=Y:S>0&&(P=M),y=Er),Q.attr("cursor",un[E]),V(st));break}default:return}tl(st)}}function f(m){u(this,arguments).moved(m)}function p(m){u(this,arguments).ended(m)}function g(){var m=this.__brush||{selection:null};return m.extent=Jh(t.apply(this,arguments)),m.dim=e,m}return l.extent=function(m){return arguments.length?(t=typeof m=="function"?m:Jo(Jh(m)),l):t},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:Jo(!!m),l):n},l.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:Jo(!!m),l):r},l.handleSize=function(m){return arguments.length?(a=+m,l):a},l.keyModifiers=function(m){return arguments.length?(i=!!m,l):i},l.on=function(){var m=s.on.apply(s,arguments);return m===s?l:m},l}const il=Math.PI,sl=2*il,Wn=1e-6,_b=sl-Wn;function rd(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Sb(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return rd;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 Tb=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?rd:Sb(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,s,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+s},${this._y1=+a}`}arcTo(t,n,r,i,s){if(t=+t,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,l=r-t,c=i-n,u=a-t,d=o-n,h=u*u+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>Wn)if(!(Math.abs(d*l-c*u)>Wn)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let f=r-a,p=i-o,g=l*l+c*c,m=f*f+p*p,v=Math.sqrt(g),E=Math.sqrt(h),y=s*Math.tan((il-Math.acos((g+h-m)/(2*v*E)))/2),x=y/E,S=y/v;Math.abs(x-1)>Wn&&this._append`L${t+x*u},${n+x*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)>Wn||Math.abs(this._y1-u)>Wn)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%sl+sl),h>_b?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>Wn&&this._append`A${r},${r},0,${+(h>=il)},${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 Ob(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ys(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=Ys(Math.abs(e)),e?e[1]:NaN}function wb(e,t){return function(n,r){for(var i=n.length,s=[],a=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),s.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function Mb(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Ab=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ei(e){if(!(t=Ab.exec(e)))throw new Error("invalid format: "+e);var t;return new al({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=al.prototype;function al(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+""}al.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 Cb(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 id;function Db(e,t){var n=Ys(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(id=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")+Ys(e,Math.max(0,t+s-1))[0]}function sd(e,t){var n=Ys(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 ad={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Ob,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>sd(e*100,t),r:sd,s:Db,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function od(e){return e}var ld=Array.prototype.map,cd=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Lb(e){var t=e.grouping===void 0||e.thousands===void 0?od:wb(ld.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?od:Mb(ld.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,m=d.zero,v=d.width,E=d.comma,y=d.precision,x=d.trim,S=d.type;S==="n"?(E=!0,S="g"):ad[S]||(y===void 0&&(y=12),x=!0,S="g"),(m||h==="0"&&f==="=")&&(m=!0,h="0",f="=");var _=g==="$"?n:g==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",C=g==="$"?r:/[%p]/.test(S)?a:"",L=ad[S],B=/[defgprs%]/.test(S);y=y===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y));function D(O){var H=_,P=C,M,w,U;if(S==="c")P=L(O)+P,O="";else{O=+O;var $=O<0||1/O<0;if(O=isNaN(O)?l:L(Math.abs(O),y),x&&(O=Cb(O)),$&&+O==0&&p!=="+"&&($=!1),H=($?p==="("?p:o:p==="-"||p==="("?"":p)+H,P=(S==="s"?cd[8+id/3]:"")+P+($&&p==="("?")":""),B){for(M=-1,w=O.length;++M<w;)if(U=O.charCodeAt(M),48>U||U>57){P=(U===46?i+O.slice(M+1):O.slice(M))+P,O=O.slice(0,M);break}}}E&&!m&&(O=t(O,1/0));var N=H.length+O.length+P.length,F=N<v?new Array(v-N+1).join(h):"";switch(E&&m&&(O=t(F+O,F.length?v-P.length:1/0),F=""),f){case"<":O=H+O+P+F;break;case"=":O=H+F+O+P;break;case"^":O=F.slice(0,N=F.length>>1)+H+O+P+F.slice(N);break;default:O=F+H+O+P;break}return s(O)}return D.toString=function(){return d+""},D}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),m=cd[8+p/3];return function(v){return f(g*v)+m}}return{format:c,formatPrefix:u}}var qs,ol,ud;Rb({thousands:",",grouping:[3],currency:["$",""]});function Rb(e){return qs=Lb(e),ol=qs.format,ud=qs.formatPrefix,qs}function Ib(e){return Math.max(0,-xr(Math.abs(e)))}function kb(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(xr(t)/3)))*3-xr(Math.abs(e)))}function Pb(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,xr(t)-xr(e))+1}var Tt=1e-6,hd=1e-12,pt=Math.PI,ce=pt/2,dd=pt/4,ye=pt*2,re=180/pt,$t=pt/180,Ot=Math.abs,fd=Math.atan,Yn=Math.atan2,Mt=Math.cos,Nb=Math.exp,$b=Math.log,xt=Math.sin,Dn=Math.sign||function(e){return e>0?1:e<0?-1:0},$e=Math.sqrt,Fb=Math.tan;function Ub(e){return e>1?0:e<-1?pt:Math.acos(e)}function hn(e){return e>1?ce:e<-1?-ce:Math.asin(e)}function Oe(){}function Xs(e,t){e&&gd.hasOwnProperty(e.type)&&gd[e.type](e,t)}var pd={Feature:function(e,t){Xs(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)Xs(n[r].geometry,t)}},gd={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){ll(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)ll(n[r],t,0)},Polygon:function(e,t){md(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)md(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)Xs(n[r],t)}};function ll(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 md(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)ll(e[n],t,1);t.polygonEnd()}function _r(e,t){e&&pd.hasOwnProperty(e.type)?pd[e.type](e,t):Xs(e,t)}function cl(e){return[Yn(e[1],e[0]),hn(e[2])]}function Sr(e){var t=e[0],n=e[1],r=Mt(n);return[r*Mt(t),r*xt(t),xt(n)]}function js(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Zs(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 ul(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Ks(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function hl(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 dl(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 fl(e,t){return Ot(e)>pt&&(e-=Math.round(e/ye)*ye),[e,t]}fl.invert=fl;function vd(e,t,n){return(e%=ye)?t||n?dl(Ed(e),bd(t,n)):Ed(e):t||n?bd(t,n):fl}function yd(e){return function(t,n){return t+=e,Ot(t)>pt&&(t-=Math.round(t/ye)*ye),[t,n]}}function Ed(e){var t=yd(e);return t.invert=yd(-e),t}function bd(e,t){var n=Mt(e),r=xt(e),i=Mt(t),s=xt(t);function a(o,l){var c=Mt(l),u=Mt(o)*c,d=xt(o)*c,h=xt(l),f=h*n+u*r;return[Yn(d*i-f*s,u*n-h*r),hn(f*i+d*s)]}return a.invert=function(o,l){var c=Mt(l),u=Mt(o)*c,d=xt(o)*c,h=xt(l),f=h*i-d*s;return[Yn(d*i+h*s,u*n+f*r),hn(f*n-u*r)]},a}function Bb(e){e=vd(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 Hb(e,t,n,r,i,s){if(n){var a=Mt(t),o=xt(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=cl([a,-o*Mt(u),-o*xt(u)]),e.point(c[0],c[1])}}function xd(e,t){t=Sr(t),t[0]-=e,hl(t);var n=Ub(-t[1]);return((-t[2]<0?-n:n)+ye-Tt)%ye}function _d(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Oe,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Qs(e,t){return Ot(e[0]-t[0])<Tt&&Ot(e[1]-t[1])<Tt}function Js(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 Sd(e,t,n,r,i){var s=[],a=[],o,l;if(e.forEach(function(p){if(!((g=p.length-1)<=0)){var g,m=p[0],v=p[g],E;if(Qs(m,v)){if(!m[2]&&!v[2]){for(i.lineStart(),o=0;o<g;++o)i.point((m=p[o])[0],m[1]);i.lineEnd();return}v[0]+=2*Tt}s.push(E=new Js(m,p,null,!0)),a.push(E.o=new Js(m,null,E,!1)),s.push(E=new Js(v,p,null,!1)),a.push(E.o=new Js(v,null,E,!0))}}),!!s.length){for(a.sort(t),Td(s),Td(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 Td(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 pl(e){return Ot(e[0])<=pt?e[0]:Dn(e[0])*((Ot(e[0])+pt)%ye-pt)}function Gb(e,t){var n=pl(t),r=t[1],i=xt(r),s=[xt(n),-Mt(n),0],a=0,o=0,l=new Un;i===1?r=ce+Tt:i===-1&&(r=-ce-Tt);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=pl(f),g=f[1]/2+dd,m=xt(g),v=Mt(g),E=0;E<h;++E,p=x,m=_,v=C,f=y){var y=d[E],x=pl(y),S=y[1]/2+dd,_=xt(S),C=Mt(S),L=x-p,B=L>=0?1:-1,D=B*L,O=D>pt,H=m*_;if(l.add(Yn(H*B*xt(D),v*C+H*Mt(D))),a+=O?L+B*ye:L,O^p>=n^x>=n){var P=Zs(Sr(f),Sr(y));hl(P);var M=Zs(s,P);hl(M);var w=(O^L>=0?-1:1)*hn(M[2]);(r>w||r===w&&(P[0]||P[1]))&&(o+=O^L>=0?1:-1)}}return(a<-Tt||a<Tt&&l<-hd)^o&1}function Od(e,t,n,r){return function(i){var s=t(i),a=_d(),o=t(a),l=!1,c,u,d,h={point:f,lineStart:g,lineEnd:m,polygonStart:function(){h.point=v,h.lineStart=E,h.lineEnd=y,u=[],c=[]},polygonEnd:function(){h.point=f,h.lineStart=g,h.lineEnd=m,u=sh(u);var x=Gb(c,r);u.length?(l||(i.polygonStart(),l=!0),Sd(u,zb,x,n,i)):x&&(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(x,S){e(x,S)&&i.point(x,S)}function p(x,S){s.point(x,S)}function g(){h.point=p,s.lineStart()}function m(){h.point=f,s.lineEnd()}function v(x,S){d.push([x,S]),o.point(x,S)}function E(){o.lineStart(),d=[]}function y(){v(d[0][0],d[0][1]),o.lineEnd();var x=o.clean(),S=a.result(),_,C=S.length,L,B,D;if(d.pop(),c.push(d),d=null,!!C){if(x&1){if(B=S[0],(L=B.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),_=0;_<L;++_)i.point((D=B[_])[0],D[1]);i.lineEnd()}return}C>1&&x&2&&S.push(S.pop().concat(S.shift())),u.push(S.filter(Vb))}}return h}}function Vb(e){return e.length>1}function zb(e,t){return((e=e.x)[0]<0?e[1]-ce-Tt:ce-e[1])-((t=t.x)[0]<0?t[1]-ce-Tt:ce-t[1])}const wd=Od(function(){return!0},Wb,qb,[-pt,-ce]);function Wb(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,a){var o=s>0?pt:-pt,l=Ot(s-t);Ot(l-pt)<Tt?(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>=pt&&(Ot(t-r)<Tt&&(t-=r*Tt),Ot(s-o)<Tt&&(s-=o*Tt),n=Yb(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 Yb(e,t,n,r){var i,s,a=xt(e-n);return Ot(a)>Tt?fd((xt(t)*(s=Mt(r))*xt(n)-xt(r)*(i=Mt(t))*xt(e))/(i*s*a)):(t+r)/2}function qb(e,t,n,r){var i;if(e==null)i=n*ce,r.point(-pt,i),r.point(0,i),r.point(pt,i),r.point(pt,0),r.point(pt,-i),r.point(0,-i),r.point(-pt,-i),r.point(-pt,0),r.point(-pt,i);else if(Ot(e[0]-t[0])>Tt){var s=e[0]<t[0]?pt:-pt;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function Xb(e){var t=Mt(e),n=2*$t,r=t>0,i=Ot(t)>Tt;function s(u,d,h,f){Hb(f,e,n,h,u,d)}function a(u,d){return Mt(u)*Mt(d)>t}function o(u){var d,h,f,p,g;return{lineStart:function(){p=f=!1,g=1},point:function(m,v){var E=[m,v],y,x=a(m,v),S=r?x?0:c(m,v):x?c(m+(m<0?pt:-pt),v):0;if(!d&&(p=f=x)&&u.lineStart(),x!==f&&(y=l(d,E),(!y||Qs(d,y)||Qs(E,y))&&(E[2]=1)),x!==f)g=0,x?(u.lineStart(),y=l(E,d),u.point(y[0],y[1])):(y=l(d,E),u.point(y[0],y[1],2),u.lineEnd()),d=y;else if(i&&d&&r^x){var _;!(S&h)&&(_=l(E,d,!0))&&(g=0,r?(u.lineStart(),u.point(_[0][0],_[0][1]),u.point(_[1][0],_[1][1]),u.lineEnd()):(u.point(_[1][0],_[1][1]),u.lineEnd(),u.lineStart(),u.point(_[0][0],_[0][1],3)))}x&&(!d||!Qs(d,E))&&u.point(E[0],E[1]),d=E,f=x,h=S},lineEnd:function(){f&&u.lineEnd(),d=null},clean:function(){return g|(p&&f)<<1}}}function l(u,d,h){var f=Sr(u),p=Sr(d),g=[1,0,0],m=Zs(f,p),v=js(m,m),E=m[0],y=v-E*E;if(!y)return!h&&u;var x=t*v/y,S=-t*E/y,_=Zs(g,m),C=Ks(g,x),L=Ks(m,S);ul(C,L);var B=_,D=js(C,B),O=js(B,B),H=D*D-O*(js(C,C)-1);if(!(H<0)){var P=$e(H),M=Ks(B,(-D-P)/O);if(ul(M,C),M=cl(M),!h)return M;var w=u[0],U=d[0],$=u[1],N=d[1],F;U<w&&(F=w,w=U,U=F);var Y=U-w,Z=Ot(Y-pt)<Tt,K=Z||Y<Tt;if(!Z&&N<$&&(F=$,$=N,N=F),K?Z?$+N>0^M[1]<(Ot(M[0]-w)<Tt?$:N):$<=M[1]&&M[1]<=N:Y>pt^(w<=M[0]&&M[0]<=U)){var dt=Ks(B,(-D+P)/O);return ul(dt,C),[M,cl(dt)]}}}function c(u,d){var h=r?e:pt-e,f=0;return u<-h?f|=1:u>h&&(f|=2),d<-h?f|=4:d>h&&(f|=8),f}return Od(a,o,s,r?[0,-e]:[-pt,e-pt])}function jb(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 bi=1e9,ta=-bi;function Zb(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 Ot(c[0]-e)<Tt?u>0?0:3:Ot(c[0]-n)<Tt?u>0?2:1:Ot(c[1]-t)<Tt?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=_d(),h,f,p,g,m,v,E,y,x,S,_,C={point:L,lineStart:H,lineEnd:P,polygonStart:D,polygonEnd:O};function L(w,U){i(w,U)&&u.point(w,U)}function B(){for(var w=0,U=0,$=f.length;U<$;++U)for(var N=f[U],F=1,Y=N.length,Z=N[0],K,dt,it=Z[0],ft=Z[1];F<Y;++F)K=it,dt=ft,Z=N[F],it=Z[0],ft=Z[1],dt<=r?ft>r&&(it-K)*(r-dt)>(ft-dt)*(e-K)&&++w:ft<=r&&(it-K)*(r-dt)<(ft-dt)*(e-K)&&--w;return w}function D(){u=d,h=[],f=[],_=!0}function O(){var w=B(),U=_&&w,$=(h=sh(h)).length;(U||$)&&(c.polygonStart(),U&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),$&&Sd(h,o,w,s,c),c.polygonEnd()),u=c,h=f=p=null}function H(){C.point=M,f&&f.push(p=[]),S=!0,x=!1,E=y=NaN}function P(){h&&(M(g,m),v&&x&&d.rejoin(),h.push(d.result())),C.point=L,x&&u.lineEnd()}function M(w,U){var $=i(w,U);if(f&&p.push([w,U]),S)g=w,m=U,v=$,S=!1,$&&(u.lineStart(),u.point(w,U));else if($&&x)u.point(w,U);else{var N=[E=Math.max(ta,Math.min(bi,E)),y=Math.max(ta,Math.min(bi,y))],F=[w=Math.max(ta,Math.min(bi,w)),U=Math.max(ta,Math.min(bi,U))];jb(N,F,e,t,n,r)?(x||(u.lineStart(),u.point(N[0],N[1])),u.point(F[0],F[1]),$||u.lineEnd(),_=!1):$&&(u.lineStart(),u.point(w,U),_=!1)}E=w,y=U,x=$}return C}}const gl=e=>e;var ml=new Un,vl=new Un,Md,Ad,yl,El,dn={point:Oe,lineStart:Oe,lineEnd:Oe,polygonStart:function(){dn.lineStart=Kb,dn.lineEnd=Jb},polygonEnd:function(){dn.lineStart=dn.lineEnd=dn.point=Oe,ml.add(Ot(vl)),vl=new Un},result:function(){var e=ml/2;return ml=new Un,e}};function Kb(){dn.point=Qb}function Qb(e,t){dn.point=Cd,Md=yl=e,Ad=El=t}function Cd(e,t){vl.add(El*e-yl*t),yl=e,El=t}function Jb(){Cd(Md,Ad)}var Tr=1/0,ea=Tr,xi=-Tr,na=xi,ra={point:tx,lineStart:Oe,lineEnd:Oe,polygonStart:Oe,polygonEnd:Oe,result:function(){var e=[[Tr,ea],[xi,na]];return xi=na=-(ea=Tr=1/0),e}};function tx(e,t){e<Tr&&(Tr=e),e>xi&&(xi=e),t<ea&&(ea=t),t>na&&(na=t)}var bl=0,xl=0,_i=0,ia=0,sa=0,Or=0,_l=0,Sl=0,Si=0,Dd,Ld,je,Ze,we={point:qn,lineStart:Rd,lineEnd:Id,polygonStart:function(){we.lineStart=rx,we.lineEnd=ix},polygonEnd:function(){we.point=qn,we.lineStart=Rd,we.lineEnd=Id},result:function(){var e=Si?[_l/Si,Sl/Si]:Or?[ia/Or,sa/Or]:_i?[bl/_i,xl/_i]:[NaN,NaN];return bl=xl=_i=ia=sa=Or=_l=Sl=Si=0,e}};function qn(e,t){bl+=e,xl+=t,++_i}function Rd(){we.point=ex}function ex(e,t){we.point=nx,qn(je=e,Ze=t)}function nx(e,t){var n=e-je,r=t-Ze,i=$e(n*n+r*r);ia+=i*(je+e)/2,sa+=i*(Ze+t)/2,Or+=i,qn(je=e,Ze=t)}function Id(){we.point=qn}function rx(){we.point=sx}function ix(){kd(Dd,Ld)}function sx(e,t){we.point=kd,qn(Dd=je=e,Ld=Ze=t)}function kd(e,t){var n=e-je,r=t-Ze,i=$e(n*n+r*r);ia+=i*(je+e)/2,sa+=i*(Ze+t)/2,Or+=i,i=Ze*e-je*t,_l+=i*(je+e),Sl+=i*(Ze+t),Si+=i*3,qn(je=e,Ze=t)}function Pd(e){this._context=e}Pd.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:Oe};var Tl=new Un,Ol,Nd,$d,Ti,Oi,wi={point:Oe,lineStart:function(){wi.point=ax},lineEnd:function(){Ol&&Fd(Nd,$d),wi.point=Oe},polygonStart:function(){Ol=!0},polygonEnd:function(){Ol=null},result:function(){var e=+Tl;return Tl=new Un,e}};function ax(e,t){wi.point=Fd,Nd=Ti=e,$d=Oi=t}function Fd(e,t){Ti-=e,Oi-=t,Tl.add($e(Ti*Ti+Oi*Oi)),Ti=e,Oi=t}let Ud,aa,Bd,Hd;class Gd{constructor(t){this._append=t==null?Vd:ox(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!==Bd||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`,Bd=r,aa=this._append,Hd=this._,this._=i}this._+=Hd;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Vd(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function ox(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Vd;if(t!==Ud){const n=10**t;Ud=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 lx(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),_r(o,i(s))),s.result()}return a.area=function(o){return _r(o,i(dn)),dn.result()},a.measure=function(o){return _r(o,i(wi)),wi.result()},a.bounds=function(o){return _r(o,i(ra)),ra.result()},a.centroid=function(o){return _r(o,i(we)),we.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,gl):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new Gd(n)):new Pd(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 Gd(n)),a},a.projection(e).digits(n).context(t)}function wl(e){return function(t){var n=new Ml;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Ml(){}Ml.prototype={constructor:Ml,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 Al(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),_r(n,e.stream(ra)),t(ra.result()),r!=null&&e.clipExtent(r),e}function zd(e,t,n){return Al(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 cx(e,t,n){return zd(e,[[0,0],t],n)}function ux(e,t,n){return Al(e,function(r){var i=+t,s=i/(r[1][0]-r[0][0]),a=(i-s*(r[1][0]+r[0][0]))/2,o=-s*r[0][1];e.scale(150*s).translate([a,o])},n)}function hx(e,t,n){return Al(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 Wd=16,dx=Mt(30*$t);function Yd(e,t){return+t?px(e,t):fx(e)}function fx(e){return wl({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function px(e,t){function n(r,i,s,a,o,l,c,u,d,h,f,p,g,m){var v=c-r,E=u-i,y=v*v+E*E;if(y>4*t&&g--){var x=a+h,S=o+f,_=l+p,C=$e(x*x+S*S+_*_),L=hn(_/=C),B=Ot(Ot(_)-1)<Tt||Ot(s-d)<Tt?(s+d)/2:Yn(S,x),D=e(B,L),O=D[0],H=D[1],P=O-r,M=H-i,w=E*P-v*M;(w*w/y>t||Ot((v*P+E*M)/y-.5)>.3||a*h+o*f+l*p<dx)&&(n(r,i,s,a,o,l,O,H,B,x/=C,S/=C,_,g,m),m.point(O,H),n(O,H,B,x,S,_,c,u,d,h,f,p,g,m))}}return function(r){var i,s,a,o,l,c,u,d,h,f,p,g,m={point:v,lineStart:E,lineEnd:x,polygonStart:function(){r.polygonStart(),m.lineStart=S},polygonEnd:function(){r.polygonEnd(),m.lineStart=E}};function v(L,B){L=e(L,B),r.point(L[0],L[1])}function E(){d=NaN,m.point=y,r.lineStart()}function y(L,B){var D=Sr([L,B]),O=e(L,B);n(d,h,u,f,p,g,d=O[0],h=O[1],u=L,f=D[0],p=D[1],g=D[2],Wd,r),r.point(d,h)}function x(){m.point=v,r.lineEnd()}function S(){E(),m.point=_,m.lineEnd=C}function _(L,B){y(i=L,B),s=d,a=h,o=f,l=p,c=g,m.point=y}function C(){n(d,h,u,f,p,g,s,a,i,o,l,c,Wd,r),m.lineEnd=x,x()}return m}}var gx=wl({point:function(e,t){this.stream.point(e*$t,t*$t)}});function mx(e){return wl({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function vx(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 qd(e,t,n,r,i,s){if(!s)return vx(e,t,n,r,i);var a=Mt(s),o=xt(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,m){return g*=r,m*=i,[l*g-c*m+t,n-c*g-l*m]}return p.invert=function(g,m){return[r*(u*g-d*m+h),i*(f-d*g-u*m)]},p}function oa(e){return Xd(function(){return e})()}function Xd(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,m=null,v,E,y,x=gl,S=.5,_,C,L,B,D;function O(w){return L(w[0]*$t,w[1]*$t)}function H(w){return w=L.invert(w[0],w[1]),w&&[w[0]*re,w[1]*re]}O.stream=function(w){return B&&D===w?B:B=gx(mx(u)(g(_(x(D=w)))))},O.preclip=function(w){return arguments.length?(g=w,p=void 0,M()):g},O.postclip=function(w){return arguments.length?(x=w,m=v=E=y=null,M()):x},O.clipAngle=function(w){return arguments.length?(g=+w?Xb(p=w*$t):(p=null,wd),M()):p*re},O.clipExtent=function(w){return arguments.length?(x=w==null?(m=v=E=y=null,gl):Zb(m=+w[0][0],v=+w[0][1],E=+w[1][0],y=+w[1][1]),M()):m==null?null:[[m,v],[E,y]]},O.scale=function(w){return arguments.length?(n=+w,P()):n},O.translate=function(w){return arguments.length?(r=+w[0],i=+w[1],P()):[r,i]},O.center=function(w){return arguments.length?(s=w[0]%360*$t,a=w[1]%360*$t,P()):[s*re,a*re]},O.rotate=function(w){return arguments.length?(o=w[0]%360*$t,l=w[1]%360*$t,c=w.length>2?w[2]%360*$t:0,P()):[o*re,l*re,c*re]},O.angle=function(w){return arguments.length?(d=w%360*$t,P()):d*re},O.reflectX=function(w){return arguments.length?(h=w?-1:1,P()):h<0},O.reflectY=function(w){return arguments.length?(f=w?-1:1,P()):f<0},O.precision=function(w){return arguments.length?(_=Yd(C,S=w*w),M()):$e(S)},O.fitExtent=function(w,U){return zd(O,w,U)},O.fitSize=function(w,U){return cx(O,w,U)},O.fitWidth=function(w,U){return ux(O,w,U)},O.fitHeight=function(w,U){return hx(O,w,U)};function P(){var w=qd(n,0,0,h,f,d).apply(null,t(s,a)),U=qd(n,r-w[0],i-w[1],h,f,d);return u=vd(o,l,c),C=dl(t,U),L=dl(u,C),_=Yd(C,S),M()}function M(){return B=D=null,O}return function(){return t=e.apply(this,arguments),O.invert=t.invert&&H,P()}}function jd(e){var t=0,n=pt/3,r=Xd(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 yx(e){var t=Mt(e);function n(r,i){return[r*t,xt(i)/t]}return n.invert=function(r,i){return[r/t,hn(i*t)]},n}function Ex(e,t){var n=xt(e),r=(n+xt(t))/2;if(Ot(r)<Tt)return yx(e);var i=1+n*(2*r-n),s=$e(i)/r;function a(o,l){var c=$e(i-2*r*xt(l))/r;return[c*xt(o*=r),s-c*Mt(o)]}return a.invert=function(o,l){var c=s-l,u=Yn(o,Ot(c))*Dn(c);return c*r<0&&(u-=pt*Dn(o)*Dn(c)),[u/r,hn((i-(o*o+c*c)*r*r)/(2*r))]},a}function Zd(){return jd(Ex).scale(155.424).center([0,33.6442])}function bx(){return Zd().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Cl(e,t){return[e,$b(Fb((ce+t)/2))]}Cl.invert=function(e,t){return[e,2*fd(Nb(t))-ce]};function xx(){return _x(Cl).scale(961/ye)}function _x(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=pt*r(),h=t(Bb(t.rotate()).invert([0,0]));return s(a==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===Cl?[[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 Sx(){return oa(la).scale(152.63)}function Tx(e,t){var n=Mt(e),r=e===t?xt(e):(n-Mt(t))/(t-e),i=n/r+e;if(Ot(r)<Tt)return la;function s(a,o){var l=i-o,c=r*a;return[l*xt(c),i-l*Mt(c)]}return s.invert=function(a,o){var l=i-o,c=Yn(a,Ot(l))*Dn(l);return l*r<0&&(c-=pt*Dn(a)*Dn(l)),[c/r,i-Dn(r)*$e(a*a+l*l)]},s}function Ox(){return jd(Tx).scale(131.154).center([0,13.9389])}var Mi=1.340264,Ai=-.081106,Ci=893e-6,Di=.003796,ca=$e(3)/2,wx=12;function Kd(e,t){var n=hn(ca*xt(t)),r=n*n,i=r*r*r;return[e*Mt(n)/(ca*(Mi+3*Ai*r+i*(7*Ci+9*Di*r))),n*(Mi+Ai*r+i*(Ci+Di*r))]}Kd.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<wx&&(o=n*(Mi+Ai*r+i*(Ci+Di*r))-t,l=Mi+3*Ai*r+i*(7*Ci+9*Di*r),n-=a=o/l,r=n*n,i=r*r*r,!(Ot(a)<hd));++s);return[ca*e*(Mi+3*Ai*r+i*(7*Ci+9*Di*r))/Mt(n),hn(xt(n)/ca)]};function Mx(){return oa(Kd).scale(177.158)}function Qd(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)))]}Qd.invert=function(e,t){var n=t,r=25,i;do{var s=n*n,a=s*s;n-=i=(n*(1.007226+s*(.015085+a*(-.044475+.028874*s-.005916*a)))-t)/(1.007226+s*(.015085*3+a*(-.044475*7+.028874*9*s-.005916*11*a)))}while(Ot(i)>Tt&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function Ax(){return oa(Qd).scale(175.295)}function Cx(e,t){return e.parent===t.parent?1:2}function Dx(e){return e.reduce(Lx,0)/e.length}function Lx(e,t){return e+t.x}function Rx(e){return 1+e.reduce(Ix,0)}function Ix(e,t){return Math.max(e,t.y)}function kx(e){for(var t;t=e.children;)e=t[0];return e}function Px(e){for(var t;t=e.children;)e=t[t.length-1];return e}function Nx(){var e=Cx,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(h){var f=h.children;f?(h.x=Dx(f),h.y=Rx(f)):(h.x=a?o+=e(h,a):0,h.y=0,a=h)});var l=kx(s),c=Px(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 $x(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 Fx(){return this.eachAfter($x)}function Ux(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function Bx(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 Hx(e,t){for(var n=this,r=[n],i=[],s,a,o,l=-1;n=r.pop();)if(i.push(n),s=n.children)for(a=0,o=s.length;a<o;++a)r.push(s[a]);for(;n=i.pop();)e.call(t,n,++l,this);return this}function Gx(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function Vx(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 zx(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Wx(e){for(var t=this,n=Yx(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 Yx(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 qx(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Xx(){return Array.from(this)}function jx(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Zx(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Kx(){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 Li(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=t_)):t===void 0&&(t=Jx);for(var n=new Ri(e),r,i=[n],s,a,o,l;r=i.pop();)if((a=t(r.data))&&(l=(a=Array.from(a)).length))for(r.children=a,o=l-1;o>=0;--o)i.push(s=a[o]=new Ri(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(n_)}function Qx(){return Li(this).eachBefore(e_)}function Jx(e){return e.children}function t_(e){return Array.isArray(e)?e[1]:null}function e_(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function n_(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Ri(e){this.data=e,this.depth=this.height=0,this.parent=null}Ri.prototype=Li.prototype={constructor:Ri,count:Fx,each:Ux,eachAfter:Hx,eachBefore:Bx,find:Gx,sum:Vx,sort:zx,path:Wx,ancestors:qx,descendants:Xx,leaves:jx,links:Zx,copy:Qx,[Symbol.iterator]:Kx};function r_(e){return e==null?null:Jd(e)}function Jd(e){if(typeof e!="function")throw new Error;return e}function Xn(){return 0}function wr(e){return function(){return e}}const i_=1664525,s_=1013904223,tf=4294967296;function a_(){let e=1;return()=>(e=(i_*e+s_)%tf)/tf}function o_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function l_(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 c_(e,t){for(var n=0,r=(e=l_(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&ef(a,s)?++n:(a=h_(i=u_(i,s)),n=0);return a}function u_(e,t){var n,r;if(Dl(t,e))return[t];for(n=0;n<e.length;++n)if(ua(t,e[n])&&Dl(Ii(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(ua(Ii(e[n],e[r]),t)&&ua(Ii(e[n],t),e[r])&&ua(Ii(e[r],t),e[n])&&Dl(nf(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 ef(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 Dl(e,t){for(var n=0;n<t.length;++n)if(!ef(e,t[n]))return!1;return!0}function h_(e){switch(e.length){case 1:return d_(e[0]);case 2:return Ii(e[0],e[1]);case 3:return nf(e[0],e[1],e[2])}}function d_(e){return{x:e.x,y:e.y,r:e.r}}function Ii(e,t){var n=e.x,r=e.y,i=e.r,s=t.x,a=t.y,o=t.r,l=s-n,c=a-r,u=o-i,d=Math.sqrt(l*l+c*c);return{x:(n+s+l/d*u)/2,y:(r+a+c/d*u)/2,r:(d+i+o)/2}}function nf(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,m=l-s,v=d-s,E=r*r+i*i-s*s,y=E-a*a-o*o+l*l,x=E-c*c-u*u+d*d,S=f*p-h*g,_=(p*x-g*y)/(S*2)-r,C=(g*m-p*v)/S,L=(f*y-h*x)/(S*2)-i,B=(h*v-f*m)/S,D=C*C+B*B-1,O=2*(s+_*C+L*B),H=_*_+L*L-s*s,P=-(Math.abs(D)>1e-6?(O+Math.sqrt(O*O-4*D*H))/(2*D):H/O);return{x:r+_+C*P,y:i+L+B*P,r:P}}function rf(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 sf(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 af(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 f_(e,t){if(!(s=(e=o_(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;rf(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){rf(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(sf(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}d+=c._.r,c=c.next}else{if(sf(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=af(n);(i=i.next)!==r;)(o=af(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=c_(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function p_(e){return Math.sqrt(e.value)}function g_(){var e=null,t=1,n=1,r=Xn;function i(s){const a=a_();return s.x=t/2,s.y=n/2,e?s.eachBefore(of(e)).eachAfter(Ll(r,.5,a)).eachBefore(lf(1)):s.eachBefore(of(p_)).eachAfter(Ll(Xn,1,a)).eachAfter(Ll(r,s.r/Math.min(t,n),a)).eachBefore(lf(Math.min(t,n)/(2*s.r))),s}return i.radius=function(s){return arguments.length?(e=r_(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 of(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Ll(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=f_(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function lf(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 m_(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 v_(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 y_(e,t){return e.parent===t.parent?1:2}function Rl(e){var t=e.children;return t?t[0]:e.t}function Il(e){var t=e.children;return t?t[t.length-1]:e.t}function E_(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 b_(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 x_(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(Ri.prototype);function __(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 S_(){var e=y_,t=1,n=1,r=null;function i(c){var u=__(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(E){E.x<d.x&&(d=E),E.x>h.x&&(h=E),E.depth>f.depth&&(f=E)});var p=d===h?1:e(d,h)/2,g=p-d.x,m=t/(h.x+p+g),v=n/(f.depth||1);c.eachBefore(function(E){E.x=(E.x+g)*m,E.y=E.depth*v})}return c}function s(c){var u=c.children,d=c.parent.children,h=c.i?d[c.i-1]:null;if(u){b_(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],m=h.m,v=f.m,E=p.m,y=g.m,x;p=Il(p),h=Rl(h),p&&h;)g=Rl(g),f=Il(f),f.a=c,x=p.z+E-h.z-m+e(p._,h._),x>0&&(E_(x_(p,c,d),c,x),m+=x,v+=x),E+=p.m,m+=h.m,y+=g.m,v+=f.m;p&&!Il(f)&&(f.t=p,f.m+=E-v),h&&!Rl(g)&&(g.t=h,g.m+=m-y,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 T_(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 O_=(1+Math.sqrt(5))/2;function w_(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,m,v,E,y,x,S,_;u<h;){f=i-n,p=s-r;do m=o[d++].value;while(!m&&d<h);for(v=E=m,S=Math.max(p/f,f/p)/(g*e),_=m*m*S,x=Math.max(E/_,_/v);d<h;++d){if(m+=c=o[d].value,c<v&&(v=c),c>E&&(E=c),_=m*m*S,y=Math.max(E/_,_/v),y>x){m-=c;break}x=y}a.push(l={value:m,dice:f<p,children:o.slice(u,d)}),l.dice?v_(l,n,r,i,g?r+=p*m/g:s):T_(l,n,r,g?n+=f*m/g:i,s),g-=m,u=d}return a}const M_=function e(t){function n(r,i,s,a,o){w_(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(O_);function A_(){var e=M_,t=!1,n=1,r=1,i=[0],s=Xn,a=Xn,o=Xn,l=Xn,c=Xn;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],t&&h.eachBefore(m_),h}function d(h){var f=i[h.depth],p=h.x0+f,g=h.y0+f,m=h.x1-f,v=h.y1-f;m<p&&(p=m=(p+m)/2),v<g&&(g=v=(g+v)/2),h.x0=p,h.y0=g,h.x1=m,h.y1=v,h.children&&(f=i[h.depth+1]=s(h)/2,p+=c(h)-f,g+=a(h)-f,m-=o(h)-f,v-=l(h)-f,m<p&&(p=m=(p+m)/2),v<g&&(g=v=(g+v)/2),e(h,p,g,m,v))}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=Jd(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 Mr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const cf=Symbol("implicit");function fa(){var e=new eh,t=[],n=[],r=cf;function i(s){let a=e.get(s);if(a===void 0){if(r!==cf)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 eh;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)},Mr.apply(i,arguments),i}function ki(){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 m=$0(h).map(function(v){return p+s*v});return n(f?m.reverse():m)}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 ki(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},Mr.apply(d(),arguments)}function C_(e){return function(){return e}}function D_(e){return+e}var uf=[0,1];function Ar(e){return e}function kl(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:C_(isNaN(t)?NaN:.5)}function L_(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function R_(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=kl(i,r),s=n(a,s)):(r=kl(r,i),s=n(s,a)),function(o){return s(r(o))}}function I_(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]=kl(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=wo(e,o,1,r)-1;return s[l](i[l](o))}}function Pl(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function hf(){var e=uf,t=uf,n=pi,r,i,s,a=Ar,o,l,c;function u(){var h=Math.min(e.length,t.length);return a!==Ar&&(a=L_(e[0],e[h-1])),o=h>2?I_:R_,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,D_),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=kh,u()},d.clamp=function(h){return arguments.length?(a=h?!0:Ar,u()):a!==Ar},d.interpolate=function(h){return arguments.length?(n=h,u()):n},d.unknown=function(h){return arguments.length?(s=h,d):s},function(h,f){return r=h,i=f,u()}}function df(){return hf()(Ar,Ar)}function k_(e,t,n,r){var i=Ao(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=kb(i,a))&&(r.precision=s),ud(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=Pb(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=Ib(i))&&(r.precision=s-(r.type==="%")*2);break}}return ol(r)}function ff(e){var t=e.domain;return e.ticks=function(n){var r=t();return Ts(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return k_(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=gr(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 Fe(){var e=df();return e.copy=function(){return Pl(e,Fe())},Mr.apply(e,arguments),ff(e)}function pf(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 gf(e){return Math.log(e)}function mf(e){return Math.exp(e)}function P_(e){return-Math.log(-e)}function N_(e){return-Math.exp(-e)}function $_(e){return isFinite(e)?+("1e"+e):e<0?0:e}function F_(e){return e===10?$_:e===Math.E?Math.exp:t=>Math.pow(e,t)}function U_(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 vf(e){return(t,n)=>-e(-t,n)}function B_(e){const t=e(gf,mf),n=t.domain;let r=10,i,s;function a(){return i=U_(r),s=F_(r),n()[0]<0?(i=vf(i),s=vf(s),e(P_,N_)):e(gf,mf),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 m=o==null?10:+o;let v=[];if(!(r%1)&&f-h<m){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;v.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;v.push(g)}v.length*2<m&&(v=Ts(c,u,m))}else v=Ts(h,f,Math.min(f-h,m)).map(s);return d?v.reverse():v},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=ol(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(pf(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function yf(){const e=B_(hf()).domain([1,10]);return e.copy=()=>Pl(e,yf()).base(e.base()),Mr.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[wo(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)},Mr.apply(ff(a),arguments)}const $l=new Date,Fl=new Date;function Wt(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=>Wt(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)=>($l.setTime(+s),Fl.setTime(+a),e($l),e(Fl),Math.floor(n($l,Fl))),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=Wt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);pa.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Wt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):pa),pa.range;const fn=1e3,Me=fn*60,pn=Me*60,gn=pn*24,Ul=gn*7,Ef=gn*30,Bl=gn*365,Cr=Wt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*fn)},(e,t)=>(t-e)/fn,e=>e.getUTCSeconds());Cr.range;const Hl=Wt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*fn)},(e,t)=>{e.setTime(+e+t*Me)},(e,t)=>(t-e)/Me,e=>e.getMinutes());Hl.range,Wt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Me)},(e,t)=>(t-e)/Me,e=>e.getUTCMinutes()).range;const Gl=Wt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*fn-e.getMinutes()*Me)},(e,t)=>{e.setTime(+e+t*pn)},(e,t)=>(t-e)/pn,e=>e.getHours());Gl.range,Wt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*pn)},(e,t)=>(t-e)/pn,e=>e.getUTCHours()).range;const Pi=Wt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Me)/gn,e=>e.getDate()-1);Pi.range;const Vl=Wt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/gn,e=>e.getUTCDate()-1);Vl.range,Wt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/gn,e=>Math.floor(e/gn)).range;function jn(e){return Wt(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())*Me)/Ul)}const ga=jn(0),ma=jn(1),H_=jn(2),G_=jn(3),Dr=jn(4),V_=jn(5),z_=jn(6);ga.range,ma.range,H_.range,G_.range,Dr.range,V_.range,z_.range;function Zn(e){return Wt(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)/Ul)}const bf=Zn(0),va=Zn(1),W_=Zn(2),Y_=Zn(3),Lr=Zn(4),q_=Zn(5),X_=Zn(6);bf.range,va.range,W_.range,Y_.range,Lr.range,q_.range,X_.range;const zl=Wt(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());zl.range,Wt(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 mn=Wt(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());mn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Wt(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)}),mn.range;const Kn=Wt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Kn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Wt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),Kn.range;function j_(e,t,n,r,i,s){const a=[[Cr,1,fn],[Cr,5,5*fn],[Cr,15,15*fn],[Cr,30,30*fn],[s,1,Me],[s,5,5*Me],[s,15,15*Me],[s,30,30*Me],[i,1,pn],[i,3,3*pn],[i,6,6*pn],[i,12,12*pn],[r,1,gn],[r,2,2*gn],[n,1,Ul],[t,1,Ef],[t,3,3*Ef],[e,1,Bl]];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(([,,m])=>m).right(a,h);if(f===a.length)return e.every(Ao(c/Bl,u/Bl,d));if(f===0)return pa.every(Math.max(Ao(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[Z_,K_]=j_(mn,zl,ga,Pi,Gl,Hl);function Wl(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 Yl(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 Ni(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Q_(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=Fi(i),d=$i(s),h=Fi(s),f=$i(a),p=Fi(a),g=$i(o),m=Fi(o),v=$i(l),E=Fi(l),y={a:$,A:N,b:F,B:Y,c:null,d:wf,e:wf,f:xS,g:LS,G:IS,H:yS,I:ES,j:bS,L:Mf,m:_S,M:SS,p:Z,q:K,Q:If,s:kf,S:TS,u:OS,U:wS,V:MS,w:AS,W:CS,x:null,X:null,y:DS,Y:RS,Z:kS,"%":Rf},x={a:dt,A:it,b:ft,B:j,c:null,d:Cf,e:Cf,f:FS,g:XS,G:ZS,H:PS,I:NS,j:$S,L:Df,m:US,M:BS,p:nt,q:vt,Q:If,s:kf,S:HS,u:GS,U:VS,V:zS,w:WS,W:YS,x:null,X:null,y:qS,Y:jS,Z:KS,"%":Rf},S={a:D,A:O,b:H,B:P,c:M,d:Tf,e:Tf,f:pS,g:Sf,G:_f,H:Of,I:Of,j:uS,L:fS,m:cS,M:hS,p:B,q:lS,Q:mS,s:vS,S:dS,u:rS,U:iS,V:sS,w:nS,W:aS,x:w,X:U,y:Sf,Y:_f,Z:oS,"%":gS};y.x=_(n,y),y.X=_(r,y),y.c=_(t,y),x.x=_(n,x),x.X=_(r,x),x.c=_(t,x);function _(q,Q){return function(ot){var A=[],V=-1,z=0,St=q.length,zt,st,kt;for(ot instanceof Date||(ot=new Date(+ot));++V<St;)q.charCodeAt(V)===37&&(A.push(q.slice(z,V)),(st=xf[zt=q.charAt(++V)])!=null?zt=q.charAt(++V):st=zt==="e"?" ":"0",(kt=Q[zt])&&(zt=kt(ot,st)),A.push(zt),z=V+1);return A.push(q.slice(z,V)),A.join("")}}function C(q,Q){return function(ot){var A=Ni(1900,void 0,1),V=L(A,q,ot+="",0),z,St;if(V!=ot.length)return null;if("Q"in A)return new Date(A.Q);if("s"in A)return new Date(A.s*1e3+("L"in A?A.L:0));if(Q&&!("Z"in A)&&(A.Z=0),"p"in A&&(A.H=A.H%12+A.p*12),A.m===void 0&&(A.m="q"in A?A.q:0),"V"in A){if(A.V<1||A.V>53)return null;"w"in A||(A.w=1),"Z"in A?(z=Yl(Ni(A.y,0,1)),St=z.getUTCDay(),z=St>4||St===0?va.ceil(z):va(z),z=Vl.offset(z,(A.V-1)*7),A.y=z.getUTCFullYear(),A.m=z.getUTCMonth(),A.d=z.getUTCDate()+(A.w+6)%7):(z=Wl(Ni(A.y,0,1)),St=z.getDay(),z=St>4||St===0?ma.ceil(z):ma(z),z=Pi.offset(z,(A.V-1)*7),A.y=z.getFullYear(),A.m=z.getMonth(),A.d=z.getDate()+(A.w+6)%7)}else("W"in A||"U"in A)&&("w"in A||(A.w="u"in A?A.u%7:"W"in A?1:0),St="Z"in A?Yl(Ni(A.y,0,1)).getUTCDay():Wl(Ni(A.y,0,1)).getDay(),A.m=0,A.d="W"in A?(A.w+6)%7+A.W*7-(St+5)%7:A.w+A.U*7-(St+6)%7);return"Z"in A?(A.H+=A.Z/100|0,A.M+=A.Z%100,Yl(A)):Wl(A)}}function L(q,Q,ot,A){for(var V=0,z=Q.length,St=ot.length,zt,st;V<z;){if(A>=St)return-1;if(zt=Q.charCodeAt(V++),zt===37){if(zt=Q.charAt(V++),st=S[zt in xf?Q.charAt(V++):zt],!st||(A=st(q,ot,A))<0)return-1}else if(zt!=ot.charCodeAt(A++))return-1}return A}function B(q,Q,ot){var A=c.exec(Q.slice(ot));return A?(q.p=u.get(A[0].toLowerCase()),ot+A[0].length):-1}function D(q,Q,ot){var A=f.exec(Q.slice(ot));return A?(q.w=p.get(A[0].toLowerCase()),ot+A[0].length):-1}function O(q,Q,ot){var A=d.exec(Q.slice(ot));return A?(q.w=h.get(A[0].toLowerCase()),ot+A[0].length):-1}function H(q,Q,ot){var A=v.exec(Q.slice(ot));return A?(q.m=E.get(A[0].toLowerCase()),ot+A[0].length):-1}function P(q,Q,ot){var A=g.exec(Q.slice(ot));return A?(q.m=m.get(A[0].toLowerCase()),ot+A[0].length):-1}function M(q,Q,ot){return L(q,t,Q,ot)}function w(q,Q,ot){return L(q,n,Q,ot)}function U(q,Q,ot){return L(q,r,Q,ot)}function $(q){return a[q.getDay()]}function N(q){return s[q.getDay()]}function F(q){return l[q.getMonth()]}function Y(q){return o[q.getMonth()]}function Z(q){return i[+(q.getHours()>=12)]}function K(q){return 1+~~(q.getMonth()/3)}function dt(q){return a[q.getUTCDay()]}function it(q){return s[q.getUTCDay()]}function ft(q){return l[q.getUTCMonth()]}function j(q){return o[q.getUTCMonth()]}function nt(q){return i[+(q.getUTCHours()>=12)]}function vt(q){return 1+~~(q.getUTCMonth()/3)}return{format:function(q){var Q=_(q+="",y);return Q.toString=function(){return q},Q},parse:function(q){var Q=C(q+="",!1);return Q.toString=function(){return q},Q},utcFormat:function(q){var Q=_(q+="",x);return Q.toString=function(){return q},Q},utcParse:function(q){var Q=C(q+="",!0);return Q.toString=function(){return q},Q}}}var xf={"-":"",_:" ",0:"0"},Yt=/^\s*\d+/,J_=/^%/,tS=/[\\^$*+?|[\]().{}]/g;function Et(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 eS(e){return e.replace(tS,"\\$&")}function $i(e){return new RegExp("^(?:"+e.map(eS).join("|")+")","i")}function Fi(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function nS(e,t,n){var r=Yt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function rS(e,t,n){var r=Yt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function iS(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function sS(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function aS(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function _f(e,t,n){var r=Yt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Sf(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function oS(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 lS(e,t,n){var r=Yt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function cS(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Tf(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function uS(e,t,n){var r=Yt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Of(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function hS(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function dS(e,t,n){var r=Yt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function fS(e,t,n){var r=Yt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function pS(e,t,n){var r=Yt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function gS(e,t,n){var r=J_.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function mS(e,t,n){var r=Yt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function vS(e,t,n){var r=Yt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function wf(e,t){return Et(e.getDate(),t,2)}function yS(e,t){return Et(e.getHours(),t,2)}function ES(e,t){return Et(e.getHours()%12||12,t,2)}function bS(e,t){return Et(1+Pi.count(mn(e),e),t,3)}function Mf(e,t){return Et(e.getMilliseconds(),t,3)}function xS(e,t){return Mf(e,t)+"000"}function _S(e,t){return Et(e.getMonth()+1,t,2)}function SS(e,t){return Et(e.getMinutes(),t,2)}function TS(e,t){return Et(e.getSeconds(),t,2)}function OS(e){var t=e.getDay();return t===0?7:t}function wS(e,t){return Et(ga.count(mn(e)-1,e),t,2)}function Af(e){var t=e.getDay();return t>=4||t===0?Dr(e):Dr.ceil(e)}function MS(e,t){return e=Af(e),Et(Dr.count(mn(e),e)+(mn(e).getDay()===4),t,2)}function AS(e){return e.getDay()}function CS(e,t){return Et(ma.count(mn(e)-1,e),t,2)}function DS(e,t){return Et(e.getFullYear()%100,t,2)}function LS(e,t){return e=Af(e),Et(e.getFullYear()%100,t,2)}function RS(e,t){return Et(e.getFullYear()%1e4,t,4)}function IS(e,t){var n=e.getDay();return e=n>=4||n===0?Dr(e):Dr.ceil(e),Et(e.getFullYear()%1e4,t,4)}function kS(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Et(t/60|0,"0",2)+Et(t%60,"0",2)}function Cf(e,t){return Et(e.getUTCDate(),t,2)}function PS(e,t){return Et(e.getUTCHours(),t,2)}function NS(e,t){return Et(e.getUTCHours()%12||12,t,2)}function $S(e,t){return Et(1+Vl.count(Kn(e),e),t,3)}function Df(e,t){return Et(e.getUTCMilliseconds(),t,3)}function FS(e,t){return Df(e,t)+"000"}function US(e,t){return Et(e.getUTCMonth()+1,t,2)}function BS(e,t){return Et(e.getUTCMinutes(),t,2)}function HS(e,t){return Et(e.getUTCSeconds(),t,2)}function GS(e){var t=e.getUTCDay();return t===0?7:t}function VS(e,t){return Et(bf.count(Kn(e)-1,e),t,2)}function Lf(e){var t=e.getUTCDay();return t>=4||t===0?Lr(e):Lr.ceil(e)}function zS(e,t){return e=Lf(e),Et(Lr.count(Kn(e),e)+(Kn(e).getUTCDay()===4),t,2)}function WS(e){return e.getUTCDay()}function YS(e,t){return Et(va.count(Kn(e)-1,e),t,2)}function qS(e,t){return Et(e.getUTCFullYear()%100,t,2)}function XS(e,t){return e=Lf(e),Et(e.getUTCFullYear()%100,t,2)}function jS(e,t){return Et(e.getUTCFullYear()%1e4,t,4)}function ZS(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Lr(e):Lr.ceil(e),Et(e.getUTCFullYear()%1e4,t,4)}function KS(){return"+0000"}function Rf(){return"%"}function If(e){return+e}function kf(e){return Math.floor(+e/1e3)}var Rr,Pf;QS({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 QS(e){return Rr=Q_(e),Pf=Rr.format,Rr.parse,Rr.utcFormat,Rr.utcParse,Rr}function JS(e){return new Date(e)}function tT(e){return e instanceof Date?+e:+new Date(+e)}function Nf(e,t,n,r,i,s,a,o,l,c){var u=df(),d=u.invert,h=u.domain,f=c(".%L"),p=c(":%S"),g=c("%I:%M"),m=c("%I %p"),v=c("%a %d"),E=c("%b %d"),y=c("%B"),x=c("%Y");function S(_){return(l(_)<_?f:o(_)<_?p:a(_)<_?g:s(_)<_?m:r(_)<_?i(_)<_?v:E:n(_)<_?y:x)(_)}return u.invert=function(_){return new Date(d(_))},u.domain=function(_){return arguments.length?h(Array.from(_,tT)):h().map(JS)},u.ticks=function(_){var C=h();return e(C[0],C[C.length-1],_??10)},u.tickFormat=function(_,C){return C==null?S:c(C)},u.nice=function(_){var C=h();return(!_||typeof _.range!="function")&&(_=t(C[0],C[C.length-1],_??10)),_?h(pf(C,_)):u},u.copy=function(){return Pl(u,Nf(e,t,n,r,i,s,a,o,l,c))},u}function $f(){return Mr.apply(Nf(Z_,K_,mn,zl,ga,Pi,Gl,Hl,Cr,Pf).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,Qn=Math.cos,eT=Math.max,ql=Math.min,Ke=Math.sin,Ir=Math.sqrt,Jt=1e-12,Ui=Math.PI,ya=Ui/2,Ea=2*Ui;function nT(e){return e>1?0:e<-1?Ui:Math.acos(e)}function Uf(e){return e>=1?ya:e<=-1?-ya:Math.asin(e)}function ba(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 Tb(t)}function rT(e){return e.innerRadius}function iT(e){return e.outerRadius}function sT(e){return e.startAngle}function aT(e){return e.endAngle}function oT(e){return e&&e.padAngle}function lT(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 xa(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/Ir(o*o+l*l),u=c*l,d=-c*o,h=e+u,f=t+d,p=n+u,g=r+d,m=(h+p)/2,v=(f+g)/2,E=p-h,y=g-f,x=E*E+y*y,S=i-s,_=h*g-p*f,C=(y<0?-1:1)*Ir(eT(0,S*S*x-_*_)),L=(_*y-E*C)/x,B=(-_*E-y*C)/x,D=(_*y+E*C)/x,O=(-_*E+y*C)/x,H=L-m,P=B-v,M=D-m,w=O-v;return H*H+P*P>M*M+w*w&&(L=D,B=O),{cx:L,cy:B,x01:-u,y01:-d,x11:L*(i/S-1),y11:B*(i/S-1)}}function Bi(){var e=rT,t=iT,n=ht(0),r=null,i=sT,s=aT,a=oT,o=null,l=ba(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,m=Ff(g-p),v=g>p;if(o||(o=u=l()),f<h&&(d=f,f=h,h=d),!(f>Jt))o.moveTo(0,0);else if(m>Ea-Jt)o.moveTo(f*Qn(p),f*Ke(p)),o.arc(0,0,f,p,g,!v),h>Jt&&(o.moveTo(h*Qn(g),h*Ke(g)),o.arc(0,0,h,g,p,v));else{var E=p,y=g,x=p,S=g,_=m,C=m,L=a.apply(this,arguments)/2,B=L>Jt&&(r?+r.apply(this,arguments):Ir(h*h+f*f)),D=ql(Ff(f-h)/2,+n.apply(this,arguments)),O=D,H=D,P,M;if(B>Jt){var w=Uf(B/h*Ke(L)),U=Uf(B/f*Ke(L));(_-=w*2)>Jt?(w*=v?1:-1,x+=w,S-=w):(_=0,x=S=(p+g)/2),(C-=U*2)>Jt?(U*=v?1:-1,E+=U,y-=U):(C=0,E=y=(p+g)/2)}var $=f*Qn(E),N=f*Ke(E),F=h*Qn(S),Y=h*Ke(S);if(D>Jt){var Z=f*Qn(y),K=f*Ke(y),dt=h*Qn(x),it=h*Ke(x),ft;if(m<Ui)if(ft=lT($,N,dt,it,Z,K,F,Y)){var j=$-ft[0],nt=N-ft[1],vt=Z-ft[0],q=K-ft[1],Q=1/Ke(nT((j*vt+nt*q)/(Ir(j*j+nt*nt)*Ir(vt*vt+q*q)))/2),ot=Ir(ft[0]*ft[0]+ft[1]*ft[1]);O=ql(D,(h-ot)/(Q-1)),H=ql(D,(f-ot)/(Q+1))}else O=H=0}C>Jt?H>Jt?(P=xa(dt,it,$,N,f,H,v),M=xa(Z,K,F,Y,f,H,v),o.moveTo(P.cx+P.x01,P.cy+P.y01),H<D?o.arc(P.cx,P.cy,H,Qt(P.y01,P.x01),Qt(M.y01,M.x01),!v):(o.arc(P.cx,P.cy,H,Qt(P.y01,P.x01),Qt(P.y11,P.x11),!v),o.arc(0,0,f,Qt(P.cy+P.y11,P.cx+P.x11),Qt(M.cy+M.y11,M.cx+M.x11),!v),o.arc(M.cx,M.cy,H,Qt(M.y11,M.x11),Qt(M.y01,M.x01),!v))):(o.moveTo($,N),o.arc(0,0,f,E,y,!v)):o.moveTo($,N),!(h>Jt)||!(_>Jt)?o.lineTo(F,Y):O>Jt?(P=xa(F,Y,Z,K,h,-O,v),M=xa($,N,dt,it,h,-O,v),o.lineTo(P.cx+P.x01,P.cy+P.y01),O<D?o.arc(P.cx,P.cy,O,Qt(P.y01,P.x01),Qt(M.y01,M.x01),!v):(o.arc(P.cx,P.cy,O,Qt(P.y01,P.x01),Qt(P.y11,P.x11),!v),o.arc(0,0,h,Qt(P.cy+P.y11,P.cx+P.x11),Qt(M.cy+M.y11,M.cx+M.x11),v),o.arc(M.cx,M.cy,O,Qt(M.y11,M.x11),Qt(M.y01,M.x01),!v))):o.arc(0,0,h,S,x,v)}if(o.closePath(),u)return o=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-Ui/2;return[Qn(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 cT=Array.prototype.slice;function _a(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Bf(e){this._context=e}Bf.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 Bf(e)}function Xl(e){return e[0]}function jl(e){return e[1]}function Hi(e,t){var n=ht(!0),r=null,i=Sa,s=null,a=ba(o);e=typeof e=="function"?e:e===void 0?Xl:ht(e),t=typeof t=="function"?t:t===void 0?jl: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 Zl(e,t,n){var r=null,i=ht(!0),s=null,a=Sa,o=null,l=ba(c);e=typeof e=="function"?e:e===void 0?Xl:ht(+e),t=typeof t=="function"?t:ht(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?jl:ht(+n);function c(d){var h,f,p,g=(d=_a(d)).length,m,v=!1,E,y=new Array(g),x=new Array(g);for(s==null&&(o=a(E=l())),h=0;h<=g;++h){if(!(h<g&&i(m=d[h],h,d))===v)if(v=!v)f=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),p=h-1;p>=f;--p)o.point(y[p],x[p]);o.lineEnd(),o.areaEnd()}v&&(y[h]=+e(m,h,d),x[h]=+t(m,h,d),o.point(r?+r(m,h,d):y[h],n?+n(m,h,d):x[h]))}if(E)return o=null,E+""||null}function u(){return Hi().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 uT(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function hT(e){return e}function dT(){var e=hT,t=uT,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),m=Math.min(Ea,Math.max(-Ea,i.apply(this,arguments)-g)),v,E=Math.min(Math.abs(m)/c,s.apply(this,arguments)),y=E*(m<0?-1:1),x;for(l=0;l<c;++l)(x=p[f[l]=l]=+e(o[l],l,o))>0&&(h+=x);for(t!=null?f.sort(function(S,_){return t(p[S],p[_])}):n!=null&&f.sort(function(S,_){return n(o[S],o[_])}),l=0,d=h?(m-c*y)/h:0;l<c;++l,g=v)u=f[l],x=p[u],v=g+(x>0?x*d:0)+y,p[u]={data:o[u],index:l,value:x,startAngle:g,endAngle:v,padAngle:E};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 fT=Gf(Sa);function Hf(e){this._curve=e}Hf.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 Gf(e){function t(n){return new Hf(e(n))}return t._curve=e,t}function pT(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(Gf(n)):t()._curve},e}function gT(){return pT(Hi().curve(fT))}class mT{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 vT(e){return new mT(e,!0)}function yT(e){return e.source}function ET(e){return e.target}function bT(e){let t=yT,n=ET,r=Xl,i=jl,s=null,a=null,o=ba(l);function l(){let c;const u=cT.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 xT(){return bT(vT)}function Ln(){}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 Oa(e){this._context=e}Oa.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 _T(e){return new Oa(e)}function Vf(e){this._context=e}Vf.prototype={areaStart:Ln,areaEnd:Ln,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 ST(e){return new Vf(e)}function zf(e){this._context=e}zf.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 TT(e){return new zf(e)}function Wf(e,t){this._basis=new Oa(e),this._beta=t}Wf.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 OT=function e(t){function n(r){return t===1?new Oa(r):new Wf(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function wa(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 Kl(e,t){this._context=e,this._k=(1-t)/6}Kl.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:wa(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:wa(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 wT=function e(t){function n(r){return new Kl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Ql(e,t){this._context=e,this._k=(1-t)/6}Ql.prototype={areaStart:Ln,areaEnd:Ln,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:wa(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 MT=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: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:wa(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 Jl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function tc(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 Yf(e,t){this._context=e,this._alpha=t}Yf.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:tc(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 CT=function e(t){function n(r){return t?new Yf(r,t):new Kl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function qf(e,t){this._context=e,this._alpha=t}qf.prototype={areaStart:Ln,areaEnd:Ln,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:tc(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 DT=function e(t){function n(r){return t?new qf(r,t):new Ql(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);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(){(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:tc(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 Jl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function jf(e){this._context=e}jf.prototype={areaStart:Ln,areaEnd:Ln,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 Zf(e){return new jf(e)}function Kf(e){return e<0?-1:1}function Qf(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(Kf(s)+Kf(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Jf(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function ec(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:ec(this,this._t0,Jf(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,ec(this,Jf(this,n=Qf(this,e,t)),n);break;default:ec(this,this._t0,n=Qf(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function tp(e){this._context=new ep(e)}(tp.prototype=Object.create(Ma.prototype)).point=function(e,t){Ma.prototype.point.call(this,t,e)};function ep(e){this._context=e}ep.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 RT(e){return new Ma(e)}function IT(e){return new tp(e)}function np(e){this._context=e}np.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=rp(e),i=rp(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 rp(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 kT(e){return new np(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 PT(e){return new Aa(e,.5)}function NT(e){return new Aa(e,0)}function $T(e){return new Aa(e,1)}function ip(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 sp(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 UT(e){const t=[];return t.key=e,t}function nc(){var e=ht([]),t=sp,n=ip,r=FT;function i(s){var a=Array.from(e.apply(this,arguments),UT),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?sp:typeof s=="function"?s:ht(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??ip,i):n},i}function BT(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 Gi(e,t,n){this.k=e,this.x=t,this.y=n}Gi.prototype={constructor:Gi,scale:function(e){return e===1?this:new Gi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Gi(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+")"}},Gi.prototype;var ap=typeof global=="object"&&global&&global.Object===Object&&global,HT=typeof self=="object"&&self&&self.Object===Object&&self,Ue=ap||HT||Function("return this")(),Ae=Ue.Symbol,op=Object.prototype,GT=op.hasOwnProperty,VT=op.toString,Vi=Ae?Ae.toStringTag:void 0;function zT(e){var t=GT.call(e,Vi),n=e[Vi];try{e[Vi]=void 0;var r=!0}catch{}var i=VT.call(e);return r&&(t?e[Vi]=n:delete e[Vi]),i}var WT=Object.prototype,YT=WT.toString;function qT(e){return YT.call(e)}var XT="[object Null]",jT="[object Undefined]",lp=Ae?Ae.toStringTag:void 0;function Jn(e){return e==null?e===void 0?jT:XT:lp&&lp in Object(e)?zT(e):qT(e)}function Qe(e){return e!=null&&typeof e=="object"}var ZT="[object Symbol]";function Ca(e){return typeof e=="symbol"||Qe(e)&&Jn(e)==ZT}function cp(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 Xt=Array.isArray,KT=1/0,up=Ae?Ae.prototype:void 0,hp=up?up.toString:void 0;function dp(e){if(typeof e=="string")return e;if(Xt(e))return cp(e,dp)+"";if(Ca(e))return hp?hp.call(e):"";var t=e+"";return t=="0"&&1/e==-KT?"-0":t}var QT=/\s/;function JT(e){for(var t=e.length;t--&&QT.test(e.charAt(t)););return t}var tO=/^\s+/;function eO(e){return e&&e.slice(0,JT(e)+1).replace(tO,"")}function Ce(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var fp=NaN,nO=/^[-+]0x[0-9a-f]+$/i,rO=/^0b[01]+$/i,iO=/^0o[0-7]+$/i,sO=parseInt;function kr(e){if(typeof e=="number")return e;if(Ca(e))return fp;if(Ce(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ce(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=eO(e);var n=rO.test(e);return n||iO.test(e)?sO(e.slice(2),n?2:8):nO.test(e)?fp:+e}function rc(e){return e}var aO="[object AsyncFunction]",oO="[object Function]",lO="[object GeneratorFunction]",cO="[object Proxy]";function ic(e){if(!Ce(e))return!1;var t=Jn(e);return t==oO||t==lO||t==aO||t==cO}var sc=Ue["__core-js_shared__"],pp=function(){var e=/[^.]+$/.exec(sc&&sc.keys&&sc.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function uO(e){return!!pp&&pp in e}var hO=Function.prototype,dO=hO.toString;function tr(e){if(e!=null){try{return dO.call(e)}catch{}try{return e+""}catch{}}return""}var fO=/[\\^$.*+?()[\]{}|]/g,pO=/^\[object .+?Constructor\]$/,gO=Function.prototype,mO=Object.prototype,vO=gO.toString,yO=mO.hasOwnProperty,EO=RegExp("^"+vO.call(yO).replace(fO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function bO(e){if(!Ce(e)||uO(e))return!1;var t=ic(e)?EO:pO;return t.test(tr(e))}function xO(e,t){return e==null?void 0:e[t]}function er(e,t){var n=xO(e,t);return bO(n)?n:void 0}var ac=er(Ue,"WeakMap"),gp=Object.create,_O=function(){function e(){}return function(t){if(!Ce(t))return{};if(gp)return gp(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function SO(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 TO(){}function mp(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var OO=800,wO=16,MO=Date.now;function AO(e){var t=0,n=0;return function(){var r=MO(),i=wO-(r-n);if(n=r,i>0){if(++t>=OO)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function CO(e){return function(){return e}}var Da=function(){try{var e=er(Object,"defineProperty");return e({},"",{}),e}catch{}}(),DO=Da?function(e,t){return Da(e,"toString",{configurable:!0,enumerable:!1,value:CO(t),writable:!0})}:rc,LO=AO(DO);function RO(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function IO(e,t,n,r){for(var i=e.length,s=n+(r?1:-1);r?s--:++s<i;)if(t(e[s],s,e))return s;return-1}function kO(e){return e!==e}function PO(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function NO(e,t,n){return t===t?PO(e,t,n):IO(e,kO,n)}function $O(e,t){var n=e==null?0:e.length;return!!n&&NO(e,t,0)>-1}var FO=9007199254740991,UO=/^(?:0|[1-9]\d*)$/;function oc(e,t){var n=typeof e;return t=t??FO,!!t&&(n=="number"||n!="symbol"&&UO.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 BO=Object.prototype,HO=BO.hasOwnProperty;function vp(e,t,n){var r=e[t];(!(HO.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):vp(n,o,l)}return n}var yp=Math.max;function GO(e,t,n){return t=yp(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=yp(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),SO(e,this,o)}}function lc(e,t){return LO(GO(e,t,rc),e+"")}var VO=9007199254740991;function cc(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=VO}function nr(e){return e!=null&&cc(e.length)&&!ic(e)}function Ep(e,t,n){if(!Ce(n))return!1;var r=typeof t;return(r=="number"?nr(n)&&oc(t,n.length):r=="string"&&t in n)?zi(n[t],e):!1}function zO(e){return lc(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&&Ep(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 WO=Object.prototype;function Ra(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||WO;return e===n}function YO(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var qO="[object Arguments]";function bp(e){return Qe(e)&&Jn(e)==qO}var xp=Object.prototype,XO=xp.hasOwnProperty,jO=xp.propertyIsEnumerable,Pr=bp(function(){return arguments}())?bp:function(e){return Qe(e)&&XO.call(e,"callee")&&!jO.call(e,"callee")};function ZO(){return!1}var _p=typeof W=="object"&&W&&!W.nodeType&&W,Sp=_p&&typeof module=="object"&&module&&!module.nodeType&&module,KO=Sp&&Sp.exports===_p,Tp=KO?Ue.Buffer:void 0,QO=Tp?Tp.isBuffer:void 0,Nr=QO||ZO,JO="[object Arguments]",tw="[object Array]",ew="[object Boolean]",nw="[object Date]",rw="[object Error]",iw="[object Function]",sw="[object Map]",aw="[object Number]",ow="[object Object]",lw="[object RegExp]",cw="[object Set]",uw="[object String]",hw="[object WeakMap]",dw="[object ArrayBuffer]",fw="[object DataView]",pw="[object Float32Array]",gw="[object Float64Array]",mw="[object Int8Array]",vw="[object Int16Array]",yw="[object Int32Array]",Ew="[object Uint8Array]",bw="[object Uint8ClampedArray]",xw="[object Uint16Array]",_w="[object Uint32Array]",It={};It[pw]=It[gw]=It[mw]=It[vw]=It[yw]=It[Ew]=It[bw]=It[xw]=It[_w]=!0,It[JO]=It[tw]=It[dw]=It[ew]=It[fw]=It[nw]=It[rw]=It[iw]=It[sw]=It[aw]=It[ow]=It[lw]=It[cw]=It[uw]=It[hw]=!1;function Sw(e){return Qe(e)&&cc(e.length)&&!!It[Jn(e)]}function uc(e){return function(t){return e(t)}}var Op=typeof W=="object"&&W&&!W.nodeType&&W,Yi=Op&&typeof module=="object"&&module&&!module.nodeType&&module,Tw=Yi&&Yi.exports===Op,hc=Tw&&ap.process,$r=function(){try{var e=Yi&&Yi.require&&Yi.require("util").types;return e||hc&&hc.binding&&hc.binding("util")}catch{}}(),wp=$r&&$r.isTypedArray,Ow=wp?uc(wp):Sw;const Ia=Ow;var ww=Object.prototype,Mw=ww.hasOwnProperty;function Mp(e,t){var n=Xt(e),r=!n&&Pr(e),i=!n&&!r&&Nr(e),s=!n&&!r&&!i&&Ia(e),a=n||r||i||s,o=a?YO(e.length,String):[],l=o.length;for(var c in e)(t||Mw.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||oc(c,l)))&&o.push(c);return o}function Ap(e,t){return function(n){return e(t(n))}}var Aw=Ap(Object.keys,Object),Cw=Object.prototype,Dw=Cw.hasOwnProperty;function Cp(e){if(!Ra(e))return Aw(e);var t=[];for(var n in Object(e))Dw.call(e,n)&&n!="constructor"&&t.push(n);return t}function qi(e){return nr(e)?Mp(e):Cp(e)}function Lw(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Rw=Object.prototype,Iw=Rw.hasOwnProperty;function kw(e){if(!Ce(e))return Lw(e);var t=Ra(e),n=[];for(var r in e)r=="constructor"&&(t||!Iw.call(e,r))||n.push(r);return n}function Xi(e){return nr(e)?Mp(e,!0):kw(e)}var Pw=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Nw=/^\w*$/;function dc(e,t){if(Xt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Ca(e)?!0:Nw.test(e)||!Pw.test(e)||t!=null&&e in Object(t)}var ji=er(Object,"create");function $w(){this.__data__=ji?ji(null):{},this.size=0}function Fw(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Uw="__lodash_hash_undefined__",Bw=Object.prototype,Hw=Bw.hasOwnProperty;function Gw(e){var t=this.__data__;if(ji){var n=t[e];return n===Uw?void 0:n}return Hw.call(t,e)?t[e]:void 0}var Vw=Object.prototype,zw=Vw.hasOwnProperty;function Ww(e){var t=this.__data__;return ji?t[e]!==void 0:zw.call(t,e)}var Yw="__lodash_hash_undefined__";function qw(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ji&&t===void 0?Yw:t,this}function rr(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])}}rr.prototype.clear=$w,rr.prototype.delete=Fw,rr.prototype.get=Gw,rr.prototype.has=Ww,rr.prototype.set=qw;function Xw(){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 jw=Array.prototype,Zw=jw.splice;function Kw(e){var t=this.__data__,n=ka(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Zw.call(t,n,1),--this.size,!0}function Qw(e){var t=this.__data__,n=ka(t,e);return n<0?void 0:t[n][1]}function Jw(e){return ka(this.__data__,e)>-1}function tM(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 vn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}vn.prototype.clear=Xw,vn.prototype.delete=Kw,vn.prototype.get=Qw,vn.prototype.has=Jw,vn.prototype.set=tM;var Zi=er(Ue,"Map");function eM(){this.size=0,this.__data__={hash:new rr,map:new(Zi||vn),string:new rr}}function nM(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 nM(t)?n[typeof t=="string"?"string":"hash"]:n.map}function rM(e){var t=Pa(this,e).delete(e);return this.size-=t?1:0,t}function iM(e){return Pa(this,e).get(e)}function sM(e){return Pa(this,e).has(e)}function aM(e,t){var n=Pa(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function yn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}yn.prototype.clear=eM,yn.prototype.delete=rM,yn.prototype.get=iM,yn.prototype.has=sM,yn.prototype.set=aM;var oM="Expected a function";function fc(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(oM);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||yn),n}fc.Cache=yn;var lM=500;function cM(e){var t=fc(e,function(r){return n.size===lM&&n.clear(),r}),n=t.cache;return t}var uM=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,hM=/\\(\\)?/g,dM=cM(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(uM,function(n,r,i,s){t.push(i?s.replace(hM,"$1"):r||n)}),t});function Ki(e){return e==null?"":dp(e)}function Dp(e,t){return Xt(e)?e:dc(e,t)?[e]:dM(Ki(e))}var fM=1/0;function Na(e){if(typeof e=="string"||Ca(e))return e;var t=e+"";return t=="0"&&1/e==-fM?"-0":t}function Lp(e,t){t=Dp(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Na(t[n++])];return n&&n==r?e:void 0}function yt(e,t,n){var r=e==null?void 0:Lp(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 Rp=Ae?Ae.isConcatSpreadable:void 0;function pM(e){return Xt(e)||Pr(e)||!!(Rp&&e&&e[Rp])}function $a(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=pM),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?$a(o,t-1,n,r,i):pc(i,o):r||(i[i.length]=o)}return i}function Ip(e){var t=e==null?0:e.length;return t?$a(e,1):[]}var gM=Ap(Object.getPrototypeOf,Object);const gc=gM;var mM="[object Object]",vM=Function.prototype,yM=Object.prototype,kp=vM.toString,EM=yM.hasOwnProperty,bM=kp.call(Object);function xM(e){if(!Qe(e)||Jn(e)!=mM)return!1;var t=gc(e);if(t===null)return!0;var n=EM.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&kp.call(n)==bM}function _M(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 SM(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:_M(e,t,n)}var TM="\\ud800-\\udfff",OM="\\u0300-\\u036f",wM="\\ufe20-\\ufe2f",MM="\\u20d0-\\u20ff",AM=OM+wM+MM,CM="\\ufe0e\\ufe0f",DM="\\u200d",LM=RegExp("["+DM+TM+AM+CM+"]");function Pp(e){return LM.test(e)}function RM(e){return e.split("")}var Np="\\ud800-\\udfff",IM="\\u0300-\\u036f",kM="\\ufe20-\\ufe2f",PM="\\u20d0-\\u20ff",NM=IM+kM+PM,$M="\\ufe0e\\ufe0f",FM="["+Np+"]",mc="["+NM+"]",vc="\\ud83c[\\udffb-\\udfff]",UM="(?:"+mc+"|"+vc+")",$p="[^"+Np+"]",Fp="(?:\\ud83c[\\udde6-\\uddff]){2}",Up="[\\ud800-\\udbff][\\udc00-\\udfff]",BM="\\u200d",Bp=UM+"?",Hp="["+$M+"]?",HM="(?:"+BM+"(?:"+[$p,Fp,Up].join("|")+")"+Hp+Bp+")*",GM=Hp+Bp+HM,VM="(?:"+[$p+mc+"?",mc,Fp,Up,FM].join("|")+")",zM=RegExp(vc+"(?="+vc+")|"+VM+GM,"g");function WM(e){return e.match(zM)||[]}function YM(e){return Pp(e)?WM(e):RM(e)}function qM(e){return function(t){t=Ki(t);var n=Pp(t)?YM(t):void 0,r=n?n[0]:t.charAt(0),i=n?SM(n,1).join(""):t.slice(1);return r[e]()+i}}var XM=qM("toUpperCase");function jM(e){return XM(Ki(e).toLowerCase())}function ZM(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 KM(e){return function(t){return e==null?void 0:e[t]}}var QM={À:"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"},JM=KM(QM);const tA=JM;var eA=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,nA="\\u0300-\\u036f",rA="\\ufe20-\\ufe2f",iA="\\u20d0-\\u20ff",sA=nA+rA+iA,aA="["+sA+"]",oA=RegExp(aA,"g");function lA(e){return e=Ki(e),e&&e.replace(eA,tA).replace(oA,"")}var cA=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function uA(e){return e.match(cA)||[]}var hA=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function dA(e){return hA.test(e)}var Gp="\\ud800-\\udfff",fA="\\u0300-\\u036f",pA="\\ufe20-\\ufe2f",gA="\\u20d0-\\u20ff",mA=fA+pA+gA,Vp="\\u2700-\\u27bf",zp="a-z\\xdf-\\xf6\\xf8-\\xff",vA="\\xac\\xb1\\xd7\\xf7",yA="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",EA="\\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",Wp="A-Z\\xc0-\\xd6\\xd8-\\xde",xA="\\ufe0e\\ufe0f",Yp=vA+yA+EA+bA,qp="['’]",Xp="["+Yp+"]",_A="["+mA+"]",jp="\\d+",SA="["+Vp+"]",Zp="["+zp+"]",Kp="[^"+Gp+Yp+jp+Vp+zp+Wp+"]",TA="\\ud83c[\\udffb-\\udfff]",OA="(?:"+_A+"|"+TA+")",wA="[^"+Gp+"]",Qp="(?:\\ud83c[\\udde6-\\uddff]){2}",Jp="[\\ud800-\\udbff][\\udc00-\\udfff]",Fr="["+Wp+"]",MA="\\u200d",tg="(?:"+Zp+"|"+Kp+")",AA="(?:"+Fr+"|"+Kp+")",eg="(?:"+qp+"(?:d|ll|m|re|s|t|ve))?",ng="(?:"+qp+"(?:D|LL|M|RE|S|T|VE))?",rg=OA+"?",ig="["+xA+"]?",CA="(?:"+MA+"(?:"+[wA,Qp,Jp].join("|")+")"+ig+rg+")*",DA="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",LA="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",RA=ig+rg+CA,IA="(?:"+[SA,Qp,Jp].join("|")+")"+RA,kA=RegExp([Fr+"?"+Zp+"+"+eg+"(?="+[Xp,Fr,"$"].join("|")+")",AA+"+"+ng+"(?="+[Xp,Fr+tg,"$"].join("|")+")",Fr+"?"+tg+"+"+eg,Fr+"+"+ng,LA,DA,jp,IA].join("|"),"g");function PA(e){return e.match(kA)||[]}function NA(e,t,n){return e=Ki(e),t=n?void 0:t,t===void 0?dA(e)?PA(e):uA(e):e.match(t)||[]}var $A="['’]",FA=RegExp($A,"g");function sg(e){return function(t){return ZM(NA(lA(t).replace(FA,"")),e,"")}}var UA=sg(function(e,t,n){return t=t.toLowerCase(),e+(n?jM(t):t)});function BA(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function ag(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=kr(n),n=n===n?n:0),t!==void 0&&(t=kr(t),t=t===t?t:0),BA(kr(e),t,n)}function HA(){this.__data__=new vn,this.size=0}function GA(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function VA(e){return this.__data__.get(e)}function zA(e){return this.__data__.has(e)}var WA=200;function YA(e,t){var n=this.__data__;if(n instanceof vn){var r=n.__data__;if(!Zi||r.length<WA-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new yn(r)}return n.set(e,t),this.size=n.size,this}function Be(e){var t=this.__data__=new vn(e);this.size=t.size}Be.prototype.clear=HA,Be.prototype.delete=GA,Be.prototype.get=VA,Be.prototype.has=zA,Be.prototype.set=YA;function qA(e,t){return e&&Wi(t,qi(t),e)}function XA(e,t){return e&&Wi(t,Xi(t),e)}var og=typeof W=="object"&&W&&!W.nodeType&&W,lg=og&&typeof module=="object"&&module&&!module.nodeType&&module,jA=lg&&lg.exports===og,cg=jA?Ue.Buffer:void 0,ug=cg?cg.allocUnsafe:void 0;function hg(e,t){if(t)return e.slice();var n=e.length,r=ug?ug(n):new e.constructor(n);return e.copy(r),r}function ZA(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 dg(){return[]}var KA=Object.prototype,QA=KA.propertyIsEnumerable,fg=Object.getOwnPropertySymbols,yc=fg?function(e){return e==null?[]:(e=Object(e),ZA(fg(e),function(t){return QA.call(e,t)}))}:dg;function JA(e,t){return Wi(e,yc(e),t)}var tC=Object.getOwnPropertySymbols,pg=tC?function(e){for(var t=[];e;)pc(t,yc(e)),e=gc(e);return t}:dg;function eC(e,t){return Wi(e,pg(e),t)}function gg(e,t,n){var r=t(e);return Xt(e)?r:pc(r,n(e))}function Ec(e){return gg(e,qi,yc)}function nC(e){return gg(e,Xi,pg)}var bc=er(Ue,"DataView"),xc=er(Ue,"Promise"),Ur=er(Ue,"Set"),mg="[object Map]",rC="[object Object]",vg="[object Promise]",yg="[object Set]",Eg="[object WeakMap]",bg="[object DataView]",iC=tr(bc),sC=tr(Zi),aC=tr(xc),oC=tr(Ur),lC=tr(ac),ir=Jn;(bc&&ir(new bc(new ArrayBuffer(1)))!=bg||Zi&&ir(new Zi)!=mg||xc&&ir(xc.resolve())!=vg||Ur&&ir(new Ur)!=yg||ac&&ir(new ac)!=Eg)&&(ir=function(e){var t=Jn(e),n=t==rC?e.constructor:void 0,r=n?tr(n):"";if(r)switch(r){case iC:return bg;case sC:return mg;case aC:return vg;case oC:return yg;case lC:return Eg}return t});const Br=ir;var cC=Object.prototype,uC=cC.hasOwnProperty;function hC(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&uC.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Fa=Ue.Uint8Array;function _c(e){var t=new e.constructor(e.byteLength);return new Fa(t).set(new Fa(e)),t}function dC(e,t){var n=t?_c(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var fC=/\w*$/;function pC(e){var t=new e.constructor(e.source,fC.exec(e));return t.lastIndex=e.lastIndex,t}var xg=Ae?Ae.prototype:void 0,_g=xg?xg.valueOf:void 0;function gC(e){return _g?Object(_g.call(e)):{}}function Sg(e,t){var n=t?_c(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var mC="[object Boolean]",vC="[object Date]",yC="[object Map]",EC="[object Number]",bC="[object RegExp]",xC="[object Set]",_C="[object String]",SC="[object Symbol]",TC="[object ArrayBuffer]",OC="[object DataView]",wC="[object Float32Array]",MC="[object Float64Array]",AC="[object Int8Array]",CC="[object Int16Array]",DC="[object Int32Array]",LC="[object Uint8Array]",RC="[object Uint8ClampedArray]",IC="[object Uint16Array]",kC="[object Uint32Array]";function PC(e,t,n){var r=e.constructor;switch(t){case TC:return _c(e);case mC:case vC:return new r(+e);case OC:return dC(e,n);case wC:case MC:case AC:case CC:case DC:case LC:case RC:case IC:case kC:return Sg(e,n);case yC:return new r;case EC:case _C:return new r(e);case bC:return pC(e);case xC:return new r;case SC:return gC(e)}}function Tg(e){return typeof e.constructor=="function"&&!Ra(e)?_O(gc(e)):{}}var NC="[object Map]";function $C(e){return Qe(e)&&Br(e)==NC}var Og=$r&&$r.isMap,FC=Og?uc(Og):$C,UC="[object Set]";function BC(e){return Qe(e)&&Br(e)==UC}var wg=$r&&$r.isSet,HC=wg?uc(wg):BC,GC=1,VC=2,zC=4,Mg="[object Arguments]",WC="[object Array]",YC="[object Boolean]",qC="[object Date]",XC="[object Error]",Ag="[object Function]",jC="[object GeneratorFunction]",ZC="[object Map]",KC="[object Number]",Cg="[object Object]",QC="[object RegExp]",JC="[object Set]",tD="[object String]",eD="[object Symbol]",nD="[object WeakMap]",rD="[object ArrayBuffer]",iD="[object DataView]",sD="[object Float32Array]",aD="[object Float64Array]",oD="[object Int8Array]",lD="[object Int16Array]",cD="[object Int32Array]",uD="[object Uint8Array]",hD="[object Uint8ClampedArray]",dD="[object Uint16Array]",fD="[object Uint32Array]",Dt={};Dt[Mg]=Dt[WC]=Dt[rD]=Dt[iD]=Dt[YC]=Dt[qC]=Dt[sD]=Dt[aD]=Dt[oD]=Dt[lD]=Dt[cD]=Dt[ZC]=Dt[KC]=Dt[Cg]=Dt[QC]=Dt[JC]=Dt[tD]=Dt[eD]=Dt[uD]=Dt[hD]=Dt[dD]=Dt[fD]=!0,Dt[XC]=Dt[Ag]=Dt[nD]=!1;function Ua(e,t,n,r,i,s){var a,o=t&GC,l=t&VC,c=t&zC;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!Ce(e))return e;var u=Xt(e);if(u){if(a=hC(e),!o)return mp(e,a)}else{var d=Br(e),h=d==Ag||d==jC;if(Nr(e))return hg(e,o);if(d==Cg||d==Mg||h&&!i){if(a=l||h?{}:Tg(e),!o)return l?eC(e,XA(a,e)):JA(e,qA(a,e))}else{if(!Dt[d])return i?e:{};a=PC(e,d,o)}}s||(s=new Be);var f=s.get(e);if(f)return f;s.set(e,a),HC(e)?e.forEach(function(m){a.add(Ua(m,t,n,m,e,s))}):FC(e)&&e.forEach(function(m,v){a.set(v,Ua(m,t,n,v,e,s))});var p=c?l?nC:Ec:l?Xi:qi,g=u?void 0:p(e);return RO(g||e,function(m,v){g&&(v=m,m=e[v]),vp(a,v,Ua(m,t,n,v,e,s))}),a}var pD=1,gD=4;function En(e){return Ua(e,pD|gD)}var mD="__lodash_hash_undefined__";function vD(e){return this.__data__.set(e,mD),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 yn;++t<n;)this.add(e[t])}Qi.prototype.add=Qi.prototype.push=vD,Qi.prototype.has=yD;function Dg(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 Lg(e,t){return e.has(t)}var ED=1,bD=2;function Rg(e,t,n,r,i,s){var a=n&ED,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&bD?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 m=a?r(g,p,d,t,e,s):r(p,g,d,e,t,s);if(m!==void 0){if(m)continue;h=!1;break}if(f){if(!Dg(t,function(v,E){if(!Lg(f,E)&&(p===v||i(p,v,n,r,s)))return f.push(E)})){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 xD(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 _D=1,SD=2,TD="[object Boolean]",OD="[object Date]",wD="[object Error]",MD="[object Map]",AD="[object Number]",CD="[object RegExp]",DD="[object Set]",LD="[object String]",RD="[object Symbol]",ID="[object ArrayBuffer]",kD="[object DataView]",Ig=Ae?Ae.prototype:void 0,Tc=Ig?Ig.valueOf:void 0;function PD(e,t,n,r,i,s,a){switch(n){case kD:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case ID:return!(e.byteLength!=t.byteLength||!s(new Fa(e),new Fa(t)));case TD:case OD:case AD:return zi(+e,+t);case wD:return e.name==t.name&&e.message==t.message;case CD:case LD:return e==t+"";case MD:var o=xD;case DD:var l=r&_D;if(o||(o=Sc),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=SD,a.set(e,t);var u=Rg(o(e),o(t),r,i,s,a);return a.delete(e),u;case RD:if(Tc)return Tc.call(e)==Tc.call(t)}return!1}var ND=1,$D=Object.prototype,FD=$D.hasOwnProperty;function UD(e,t,n,r,i,s){var a=n&ND,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:FD.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 m=a;++d<l;){h=o[d];var v=e[h],E=t[h];if(r)var y=a?r(E,v,h,t,e,s):r(v,E,h,e,t,s);if(!(y===void 0?v===E||i(v,E,n,r,s):y)){g=!1;break}m||(m=h=="constructor")}if(g&&!m){var x=e.constructor,S=t.constructor;x!=S&&"constructor"in e&&"constructor"in t&&!(typeof x=="function"&&x instanceof x&&typeof S=="function"&&S instanceof S)&&(g=!1)}return s.delete(e),s.delete(t),g}var BD=1,kg="[object Arguments]",Pg="[object Array]",Ba="[object Object]",HD=Object.prototype,Ng=HD.hasOwnProperty;function GD(e,t,n,r,i,s){var a=Xt(e),o=Xt(t),l=a?Pg:Br(e),c=o?Pg:Br(t);l=l==kg?Ba:l,c=c==kg?Ba:c;var u=l==Ba,d=c==Ba,h=l==c;if(h&&Nr(e)){if(!Nr(t))return!1;a=!0,u=!1}if(h&&!u)return s||(s=new Be),a||Ia(e)?Rg(e,t,n,r,i,s):PD(e,t,l,n,r,i,s);if(!(n&BD)){var f=u&&Ng.call(e,"__wrapped__"),p=d&&Ng.call(t,"__wrapped__");if(f||p){var g=f?e.value():e,m=p?t.value():t;return s||(s=new Be),i(g,m,n,r,s)}}return h?(s||(s=new Be),UD(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:GD(e,t,n,r,Ha,i)}var VD=1,zD=2;function WD(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 Be;if(r)var h=r(c,u,l,e,t,d);if(!(h===void 0?Ha(u,c,VD|zD,r,d):h))return!1}}return!0}function $g(e){return e===e&&!Ce(e)}function YD(e){for(var t=qi(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,$g(i)]}return t}function Fg(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function qD(e){var t=YD(e);return t.length==1&&t[0][2]?Fg(t[0][0],t[0][1]):function(n){return n===e||WD(n,e,t)}}function XD(e,t){return e!=null&&t in Object(e)}function jD(e,t,n){t=Dp(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=Na(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)&&oc(a,i)&&(Xt(e)||Pr(e)))}function ZD(e,t){return e!=null&&jD(e,t,XD)}var KD=1,QD=2;function JD(e,t){return dc(e)&&$g(t)?Fg(Na(e),t):function(n){var r=yt(n,e);return r===void 0&&r===t?ZD(n,e):Ha(t,r,KD|QD)}}function tL(e){return function(t){return t==null?void 0:t[e]}}function eL(e){return function(t){return Lp(t,e)}}function nL(e){return dc(e)?tL(Na(e)):eL(e)}function Ga(e){return typeof e=="function"?e:e==null?rc:typeof e=="object"?Xt(e)?JD(e[0],e[1]):qD(e):nL(e)}function rL(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 iL(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 Ug=iL();function sL(e,t){return e&&Ug(e,t,qi)}function aL(e,t){return function(n,r){if(n==null)return n;if(!nr(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 Oc=aL(sL);function oL(e,t,n,r){return Oc(e,function(i,s,a){t(r,i,n(i),a)}),r}function lL(e,t){return function(n,r){var i=Xt(n)?rL:oL,s=t?t():{};return i(n,e,Ga(r),s)}}var wc=function(){return Ue.Date.now()},cL="Expected a function",uL=Math.max,hL=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(cL);t=kr(t)||0,Ce(n)&&(u=!!n.leading,d="maxWait"in n,s=d?uL(kr(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function f(_){var C=r,L=i;return r=i=void 0,c=_,a=e.apply(L,C),a}function p(_){return c=_,o=setTimeout(v,t),u?f(_):a}function g(_){var C=_-l,L=_-c,B=t-C;return d?hL(B,s-L):B}function m(_){var C=_-l,L=_-c;return l===void 0||C>=t||C<0||d&&L>=s}function v(){var _=wc();if(m(_))return E(_);o=setTimeout(v,g(_))}function E(_){return o=void 0,h&&r?f(_):(r=i=void 0,a)}function y(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function x(){return o===void 0?a:E(wc())}function S(){var _=wc(),C=m(_);if(r=arguments,i=this,l=_,C){if(o===void 0)return p(l);if(d)return clearTimeout(o),o=setTimeout(v,t),f(l)}return o===void 0&&(o=setTimeout(v,t)),a}return S.cancel=y,S.flush=x,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)&&nr(e)}function Cc(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function dL(e){return Wi(e,Xi(e))}function fL(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=Xt(l),f=!h&&Nr(l),p=!h&&!f&&Ia(l);u=l,h||f||p?Xt(o)?u=o:Ac(o)?u=mp(o):f?(d=!1,u=hg(l,!0)):p?(d=!1,u=Sg(l,!0)):u=[]:xM(l)||Pr(l)?(u=o,Pr(o)?u=dL(o):(!Ce(o)||ic(o))&&(u=Tg(l))):d=!1}d&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),Mc(e,n,u)}function Bg(e,t,n,r,i){e!==t&&Ug(t,function(s,a){if(i||(i=new Be),Ce(s))fL(e,t,a,n,Bg,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)}var pL="Expected a function";function gL(e,t,n){if(typeof e!="function")throw new TypeError(pL);return setTimeout(function(){e.apply(void 0,n)},t)}var mL=lc(function(e,t,n){return gL(e,kr(t)||0,n)});function vL(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 EL(e,t){var n=-1,r=nr(e)?Array(e.length):[];return Oc(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function bL(e,t){var n=Xt(e)?cp:EL;return n(e,Ga(t))}var xL=1/0;function _L(e,t){return $a(bL(e,t),xL)}function SL(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 TL=Object.prototype,OL=TL.hasOwnProperty,wL=lL(function(e,t,n){OL.call(e,n)?e[n].push(t):La(e,n,[t])}),ML="[object Map]",AL="[object Set]",CL=Object.prototype,DL=CL.hasOwnProperty;function He(e){if(e==null)return!0;if(nr(e)&&(Xt(e)||typeof e=="string"||typeof e.splice=="function"||Nr(e)||Ia(e)||Pr(e)))return!e.length;var t=Br(e);if(t==ML||t==AL)return!e.size;if(Ra(e))return!Cp(e).length;for(var n in e)if(DL.call(e,n))return!1;return!0}function Hg(e,t){return Ha(e,t)}var Hr=sg(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),LL=zO(function(e,t,n){Bg(e,t,n)});const lt=LL;function RL(e,t){var n;return Oc(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function IL(e,t,n){var r=Xt(e)?Dg:RL;return n&&Ep(e,t,n)&&(t=void 0),r(e,Ga(t))}var kL=1/0,PL=Ur&&1/Sc(new Ur([,-0]))[1]==kL?function(e){return new Ur(e)}:TO,NL=200;function Gg(e,t,n){var r=-1,i=$O,s=e.length,a=!0,o=[],l=o;if(n)a=!1,i=vL;else if(s>=NL){var c=t?null:PL(e);if(c)return Sc(c);a=!1,i=Lg,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 $L=lc(function(e){var t=yL(e);return Ac(t)&&(t=void 0),Gg($a(e,1,Ac,!0),Ga(t))});function Ji(e){return e&&e.length?Gg(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||{}),Vg=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e.SHOW_TOOLTIP="toolbar-show-tooltip",e.HIDE_TOOLTIP="toolbar-hide-tooltip",e))(Vg||{}),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||{}),Nc=(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))(Nc||{}),$c=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))($c||{}),Fc=(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))(Fc||{}),Uc=(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))(Uc||{}),Bc=(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))(Bc||{}),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||{}),Gr=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(Gr||{}),Xc=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Xc||{}),zg=(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))(zg||{}),Wg=(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))(Wg||{}),Yg=(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))(Yg||{}),qg=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(qg||{}),Xg=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(Xg||{}),Vr=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(Vr||{});const T=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:Yg,Area:$c,Axis:Nc,Bar:Hc,Boxplot:Gc,CanvasZoom:Pc,Chart:Dc,Choropleth:Vr,CirclePack:Wg,Gauge:Bc,Heatmap:Xg,Legend:zg,Line:zc,Meter:qg,Modal:Lc,Model:Rc,Pie:Uc,Radar:Wc,Scatter:Vc,Threshold:Xc,Toolbar:Vg,Tooltip:Gr,Tree:Yc,Treemap:qc,WordCloud:Fc,ZoomBar:Ic,ZoomDomain:kc},Symbol.toStringTag,{value:"Module"}));var et=(e=>(e.HTML="html",e.SVG="svg",e))(et||{}),jc=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(jc||{}),at=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(at||{}),G=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(G||{}),Ge=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(Ge||{}),De=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(De||{}),Bt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Bt||{}),J=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(J||{}),zr=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(zr||{}),Ht=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(Ht||{}),Wr=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(Wr||{}),za=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(za||{}),At=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(At||{}),ct=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(ct||{}),sr=(e=>(e.CENTER="center",e))(sr||{}),ts=(e=>(e.LEFT="left",e.RIGHT="right",e))(ts||{}),Gt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Gt||{}),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||{}),ar=(e=>(e.SEMI="semi",e.FULL="full",e))(ar||{}),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||{}),_t=(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.EXIT_FULLSCREEN="Exit fullscreen",e.SHOW_AS_DATATABLE="Show as data-table",e.CUSTOM="Custom",e))(_t||{}),Ya=(e=>(e.LEFT="left",e.RIGHT="right",e))(Ya||{}),Vt=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(Vt||{}),rs=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(rs||{}),Yr=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(Yr||{}),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",bn={opacity:{unselected:.05,selected:.4}},Rn={ticks:{number:7,rotateIfSmallerThan:30,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},qr={duration:1e3,ease:jh,zoomLevel:3},Xr={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},hierarchyLevel:2},jg={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Le={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},FL={defaultBins:10},Nt={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}},xn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},jt={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},Lt={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}},or={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}},Zg={minCellDividerDimension:16,chartPadding:.5},Kg={default:{size:24}},UL={defaultOffset:4,horizontalOffset:10},Qg={default:{duration:300},pie_slice_mouseover:{duration:100},pie_slice_mouseout:{duration:100},pie_chart_titles:{duration:375},graph_element_mouseover_fill_update:{duration:100},graph_element_mouseout_fill_update:{duration:100}},be={height:{[Ge.GRAPH_VIEW]:32,[Ge.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},BL=[{type:Vt.RADIUS,name:"Radius"},{type:Vt.AREA,name:"Poor area"},{type:Vt.AREA,name:"Satisfactory area"},{type:Vt.AREA,name:"Great area"},{type:Vt.QUARTILE,name:"Quartiles"}];function HL(e,t,n){let r=null;return function(...i){const s=this;s.mousePosition=Hn(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function Pt(e,t){var i;const n=En(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===J.TIME?a.mapsTo="date":l===J.LABELS&&(a.mapsTo="key")}}else delete n.axes[s];return Kc(n,t),lt(n,t)}function _n(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===De.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===De.FRONT_LINE)return"..."+e.substr(-n);if(t===De.END_LINE)return e.substr(0,n)+"..."}function Kc(e,t){const n=b(e,"legend","additionalItems"),r=b(t,"legend","additionalItems");if(n&&r){const i=r.map(o=>o.type),s=n.map(o=>o.type),a=BL.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=$L(a,r,"name")}}const b=(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},Jg=(e,t)=>t===Bt.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}=Jg(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function Sn(e,t,n){return n===Bt.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)?VL(o,d=>d.test(a)):GL(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 GL(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function VL(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function zL(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 bt(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 WL={};function qa(){return WL}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=bt(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 YL={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"}},qL=(e,t,n)=>{let r;const i=YL[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},XL={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},jL=(e,t,n,r)=>XL[e],ZL={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},KL={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},QL={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},JL={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"]},tR={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"}},eR={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"}},nR={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:ZL,defaultWidth:"wide"}),quarter:os({values:KL,defaultWidth:"wide",argumentCallback:e=>e-1}),month:os({values:QL,defaultWidth:"wide"}),day:os({values:JL,defaultWidth:"wide"}),dayPeriod:os({values:tR,defaultWidth:"wide",formattingValues:eR,defaultFormattingWidth:"wide"})},rR=/^(\d+)(th|st|nd|rd)?/i,iR=/\d+/i,sR={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},aR={any:[/^b/i,/^(a|c)/i]},oR={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},lR={any:[/1/i,/2/i,/3/i,/4/i]},cR={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},uR={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]},hR={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},dR={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]},fR={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},pR={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}},gR={ordinalNumber:zL({matchPattern:rR,parsePattern:iR,valueCallback:e=>parseInt(e,10)}),era:ls({matchPatterns:sR,defaultMatchWidth:"wide",parsePatterns:aR,defaultParseWidth:"any"}),quarter:ls({matchPatterns:oR,defaultMatchWidth:"wide",parsePatterns:lR,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ls({matchPatterns:cR,defaultMatchWidth:"wide",parsePatterns:uR,defaultParseWidth:"any"}),day:ls({matchPatterns:hR,defaultMatchWidth:"wide",parsePatterns:dR,defaultParseWidth:"any"}),dayPeriod:ls({matchPatterns:fR,defaultMatchWidth:"any",parsePatterns:pR,defaultParseWidth:"any"})},mR={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},vR={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},yR={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ER={date:Qc({formats:mR,defaultWidth:"full"}),time:Qc({formats:vR,defaultWidth:"full"}),dateTime:Qc({formats:yR,defaultWidth:"full"})},tm={code:"en-US",formatDistance:qL,formatLong:ER,formatRelative:jL,localize:nR,match:gR,options:{weekStartsOn:0,firstWeekContainsDate:1}},jr={type:De.END_LINE,threshold:16,numCharacter:14},bR={code:typeof navigator<"u"&&(navigator==null?void 0:navigator.language)||"en-US",number:(e,t=(navigator==null?void 0:navigator.language)||"en-US")=>e.toLocaleString(t),date:(e,t=(navigator==null?void 0:navigator.language)||"en-US",n={},r=null)=>r||e.toLocaleDateString(t,n),time:(e,t=(navigator==null?void 0:navigator.language)||"en-US",n={},r=null)=>r||e.toLocaleTimeString(t,n),optionsObject:{"15seconds":{primary:{"MMM d, pp":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"MMM d, h:mm:ss.SSS a":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},secondary:{pp:{hour:"numeric",minute:"2-digit",second:"2-digit",hourCycle:"h12"},"h:mm:ss.SSS a":{hour:"numeric",minute:"2-digit",fractionalSecondDigits:3,hourCycle:"h12"}},type:"time"},minute:{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},"30minutes":{primary:{"MMM d, p":{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hourCycle:"h12"}},secondary:{p:{hour:"numeric",minute:"2-digit",hourCycle:"h12"}},type:"time"},hourly:{primary:{"MMM d, hh a":{month:"short",day:"numeric",hour:"2-digit",hourCycle:"h12"}},secondary:{"hh a":{hour:"2-digit",hourCycle:"h12"}},type:"time"},daily:{primary:{"MMM d":{month:"short",day:"numeric"}},secondary:{d:{day:"numeric"}},type:"date"},weekly:{primary:{"eee, MMM d":{weekday:"short",month:"short",day:"numeric"}},secondary:{eee:{weekday:"short"}},type:"date"},monthly:{primary:{"MMM yyyy":{month:"short",year:"numeric"}},secondary:{MMM:{month:"short"}},type:"date"},quarterly:{primary:{},secondary:{},type:"date"},yearly:{primary:{yyyy:{year:"numeric"}},secondary:{yyyy:{year:"numeric"}},type:"date"}},translations:{group:"Group",total:"Total",meter:{title:""},tabularRep:{title:"Tabular representation",downloadAsCSV:"Download as CSV"},toolbar:{exportAsCSV:"Export to CSV",exportAsJPG:"Export to JPG",exportAsPNG:"Export to PNG",zoomIn:"Zoom in",zoomOut:"Zoom out",resetZoom:"Reset zoom",moreOptions:"More options",makeFullScreen:"Make fullscreen",exitFullScreen:"Exit fullscreen",showAsTable:"Show as table"}}},xR={enabled:!0,position:zr.BOTTOM,clickable:!0,truncation:jr,alignment:Ht.LEFT,order:null,additionalItems:[]},_R={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},SR={enabled:!0},em={enabled:!0,showTotal:!0,truncation:jr,groupLabel:"Group"},nm={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}},Xa={addSpaceOnEdges:1,showDayName:!1,localeObject:tm,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"}}};let rm=!1;try{rm=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}catch(e){console.warn("Fullscreen capabilities check failed: ",e.message)}const te={width:null,height:null,resizable:!0,theme:jc.WHITE,tooltip:em,legend:xR,locale:bR,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:_t.SHOW_AS_DATATABLE},...rm?[{type:_t.MAKE_FULLSCREEN}]:[],{type:_t.EXPORT_CSV},{type:_t.EXPORT_PNG},{type:_t.EXPORT_JPG}]}},im=lt({},te,{thematic:{projection:en.geoNaturalEarth1}}),us=lt({},te,{axes:nm,timeScale:Xa,grid:_R,ruler:SR,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:Ge.GRAPH_VIEW}}}),lr=lt({},us,{bars:{maxWidth:16,spacingFactor:.25},timeScale:lt(Xa,{addSpaceOnEdges:1})}),TR=lt({},lr,{}),OR=lt({},lr,{}),wR=lt({},lr,{bars:lt({},lr.bars,{dividerSize:1.5})}),MR=lt({},lr,{}),Jc=lt({},us,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),AR=Jc,sm=lt({},Jc,{points:{radius:3,filled:!1,enabled:!0}}),am=lt({},sm,{timeScale:lt(Xa,{addSpaceOnEdges:0})}),CR=am,DR=lt({},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:Vt.RADIUS,name:"Radius"}]}}),LR=lt({},us,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:Vt.AREA,name:"Poor area"},{type:Vt.AREA,name:"Satisfactory area"},{type:Vt.AREA,name:"Great area"},{type:Vt.QUARTILE,name:"Quartiles"}]}}),RR=lt({},lr,{bars:{dividerSize:1.5},timeScale:lt(Xa,{addSpaceOnEdges:0})}),IR=lt({},te,{tooltip:lt({},em,{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"}}),om=lt({},te,{pie:{labels:{formatter:null,enabled:!0},alignment:Ht.LEFT,sortFunction:null,valueMapsTo:"value"}}),kR=lt({},te,{legend:{enabled:!1},gauge:{type:ar.SEMI,arcWidth:16,deltaArrow:{size:e=>e/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:e=>e/8,valueFontSize:e=>e/2.5,alignment:Ht.LEFT}}),PR=lt({},om,{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)},alignment:Ht.LEFT}}),lm=lt({},te,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),NR=lt({},lm,{legend:{enabled:!0}}),$R=lt({},te,{radar:{axes:{angle:"key",value:"value"},alignment:Ht.LEFT},tooltip:{gridline:{enabled:!0}}}),FR=lt({},lr,{comboChartTypes:[]}),UR=lt({tree:{type:za.TREE}},te,{}),BR=lt({},te,{data:lt(te.data,{groupMapsTo:"name"})}),HR=lt({},te,Xr,{data:lt(te.data,{groupMapsTo:"name"})}),GR=lt({},te,{alluvial:{data:lt(te.data,{groupMapsTo:"source"}),nodeAlignment:Ht.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),VR=lt({},te,{axes:nm,heatmap:{divider:{state:Yr.AUTO},colorLegend:{type:"linear"}}}),zR=lt({},im,{choropleth:{colorLegend:{type:"linear"}}}),Ct={alluvialChart:GR,areaChart:am,axisChart:us,boxplotChart:MR,bubbleChart:DR,bulletChart:LR,chart:te,circlePackChart:HR,choroplethChart:zR,comboChart:FR,donutChart:PR,gaugeChart:kR,groupedBarChart:OR,heatmapChart:VR,histogramChart:RR,lineChart:sm,lollipopChart:AR,meterChart:lm,pieChart:om,proportionalMeterChart:NR,radarChart:$R,scatterChart:Jc,simpleBarChart:TR,stackedAreaChart:CR,stackedBarChart:wR,thematicChart:im,treeChart:UR,treemapChart:BR,wordCloudChart:IR},cm=6048e5,WR=864e5,um=6e4,hm=36e5;function dm(e){const t=bt(e);return t.setHours(0,0,0,0),t}function fm(e){const t=bt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function pm(e,t){const n=dm(e),r=dm(t),i=+n-fm(n),s=+r-fm(r);return Math.round((i-s)/WR)}function ze(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function YR(e){const t=bt(e),n=ze(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function qR(e){const t=bt(e);return pm(t,YR(t))+1}function ja(e){return cs(e,{weekStartsOn:1})}function gm(e){const t=bt(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 XR(e){const t=gm(e),n=ze(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),ja(n)}function jR(e){const t=bt(e),n=+ja(t)-+XR(t);return Math.round(n/cm)+1}function mm(e,t){var u,d,h,f;const n=bt(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 ZR(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=mm(e,t),s=ze(e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),cs(s,t)}function KR(e,t){const n=bt(e),r=+cs(n,t)-+ZR(n,t);return Math.round(r/cm)+1}function wt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const In={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return wt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):wt(n+1,2)},d(e,t){return wt(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 wt(e.getHours()%12||12,t.length)},H(e,t){return wt(e.getHours(),t.length)},m(e,t){return wt(e.getMinutes(),t.length)},s(e,t){return wt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return wt(i,t.length)}},Zr={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},vm={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 In.y(e,t)},Y:function(e,t,n,r){const i=mm(e,r),s=i>0?i:1-i;if(t==="YY"){const a=s%100;return wt(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):wt(s,t.length)},R:function(e,t){const n=gm(e);return wt(n,t.length)},u:function(e,t){const n=e.getFullYear();return wt(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 wt(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 wt(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 In.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 wt(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=KR(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):wt(i,t.length)},I:function(e,t,n){const r=jR(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):wt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):In.d(e,t)},D:function(e,t,n){const r=qR(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):wt(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 wt(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 wt(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 wt(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=Zr.noon:r===0?i=Zr.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=Zr.evening:r>=12?i=Zr.afternoon:r>=4?i=Zr.morning:i=Zr.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 In.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):In.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):wt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):wt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):In.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):In.s(e,t)},S:function(e,t){return In.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Em(r);case"XXXX":case"XX":return cr(r);case"XXXXX":case"XXX":default:return cr(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Em(r);case"xxxx":case"xx":return cr(r);case"xxxxx":case"xxx":default:return cr(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ym(r,":");case"OOOO":default:return"GMT"+cr(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ym(r,":");case"zzzz":default:return"GMT"+cr(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return wt(r,t.length)},T:function(e,t,n){const r=e.getTime();return wt(r,t.length)}};function ym(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+wt(s,2)}function Em(e,t){return e%60===0?(e>0?"-":"+")+wt(Math.abs(e)/60,2):cr(e,t)}function cr(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=wt(Math.trunc(r/60),2),s=wt(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"})}},xm=(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"})}},QR={p:xm,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}}",xm(i,t))}},JR=/^D+$/,tI=/^Y+$/,eI=["D","DD","YY","YYYY"];function nI(e){return JR.test(e)}function rI(e){return tI.test(e)}function iI(e,t,n){const r=sI(e,t,n);if(console.warn(r),eI.includes(e))throw new RangeError(r)}function sI(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function aI(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function oI(e){if(!aI(e)&&typeof e!="number")return!1;const t=bt(e);return!isNaN(Number(t))}const lI=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,cI=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,uI=/^'([^]*?)'?$/,hI=/''/g,dI=/[a-zA-Z]/;function tu(e,t,n){var u,d,h,f,p,g,m,v;const r=qa(),i=(n==null?void 0:n.locale)??r.locale??tm,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??((v=(m=r.locale)==null?void 0:m.options)==null?void 0:v.weekStartsOn)??0,o=bt(e);if(!oI(o))throw new RangeError("Invalid time value");let l=t.match(cI).map(E=>{const y=E[0];if(y==="p"||y==="P"){const x=QR[y];return x(E,i.formatLong)}return E}).join("").match(lI).map(E=>{if(E==="''")return{isToken:!1,value:"'"};const y=E[0];if(y==="'")return{isToken:!1,value:fI(E)};if(vm[y])return{isToken:!0,value:E};if(y.match(dI))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return{isToken:!1,value:E}});i.localize.preprocessor&&(l=i.localize.preprocessor(o,l));const c={firstWeekContainsDate:s,weekStartsOn:a,locale:i};return l.map(E=>{if(!E.isToken)return E.value;const y=E.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&rI(y)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&nI(y))&&iI(y,t,String(e));const x=vm[y[0]];return x(o,y,i.localize,c)}).join("")}function fI(e){const t=e.match(uI);return t?t[1].replace(hI,"'"):e}var _m=(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))(_m||{});const eu=[["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 Sm(e,t,n,r,i){const s=t===0,a=Number(tu(new Date(e),"c"))===2,o=Number(tu(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||Ka(e)||hs(e,l)||kn(e);case"minute":return s||Ka(e)||hs(e,l)||kn(e);case"30minutes":return s||Ka(e)||hs(e,l)||kn(e);case"hourly":return s||Ka(e)||hs(e,l)||kn(e);case"daily":return i?s||a||kn(e):s||hs(e,l)||kn(e);case"weekly":return s||a||kn(e);case"monthly":return s||kn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function nu(e,t,n,r,i,s){const a=i.showDayName,o=r==="daily"&&a?"weekly":r,l=new Date(e),c=b(i,"timeIntervalFormats")[o],u=b(c,"primary"),d=b(c,"secondary"),h=Sm(e,t,n,r,a);let f=h?u:d;r==="15seconds"&&l.getMilliseconds()!==0&&(f=f.replace("pp","h:mm:ss.SSS a"));const p=i.localeObject,{code:g,optionsObject:m}=s,v=m[r].type,E=m[r][h?"primary":"secondary"][f];if(r==="quarterly"||!E){const x=tu(l,f,{locale:p}).split("").map(S=>{let _=Number(S);return S!==" "&&!Number.isNaN(_)?_.toLocaleString(g):S});return s[v](l,g,{},x.join(""))}else return s[v](l,g,E)}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 pI(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function gI(e){const t=eu.reduce((n,[,r],i)=>{const s=eu[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return eu[t][0]}function ru(e,t){if(_m[t])return t;if(e.length===1)return"15seconds";const n=pI(e),r=Cn(n);return gI(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 kn(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 Tm(e){return e===void 0?"":e.toISOString()}function mI(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(),{code:i,date:s,number:a}=b(r,"locale"),o=b(r,"tabularRepModal","tableHeadingFormatter"),l=b(r,"tabularRepModal","tableCellFormatter"),{cartesianScales:c}=this.services,u=c==null?void 0:c.getDomainAxisScaleType();let d;return u===J.TIME&&(d=f=>s(f,i,{month:"short",day:"numeric",year:"numeric"})),[typeof o=="function"?o(t):t,...typeof l=="function"?l(n):n.map(f=>{d&&(f[1]=d(f[1]));for(let p in f){let g=f[p];typeof g=="number"&&(f[p]=a(g,i))}return f})]}getAllDataFromDomain(t){if(!this.getData())return null;const n=this.getOptions();let r=this.getData();const i=this.getDataGroups(),{groupMapsTo:s}=b(n,"data"),a=b(n,"axes");return t&&(r=r.filter(o=>t.includes(o[s]))),a&&Object.keys(a).forEach(o=>{const l=a[o].mapsTo,c=a[o].scaleType;if((c===J.LINEAR||c===J.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===J.LABELS)r=r.filter(u=>a[o].domain.includes(u[l]));else{const[u,d]=a[o].domain;r=r.filter(h=>!(l in h)||h[l]>=u&&h[l]<=d)}}),r.filter(o=>i.find(l=>l.name===o[s]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=Nt.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(En(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),n}getDataGroups(t){return b(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(r=>t.includes(r.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Nt.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 wL(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=FL.defaultBins}=s,l=Array.isArray(o),c=P0().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(m=>{h.push({group:m,key:p,value:g[m]||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 nc().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?Tm(l[c]):l[c]&&typeof l[c].toString=="function"?l[c].toString():l[c]}));const a=this.services.cartesianScales.domainAxisPosition,o=r.axes[a].scaleType;return o===J.TIME?s.sort((l,c)=>{const u=new Date(l),d=new Date(c);return u-d}):(o===J.LOG||o===J.LINEAR)&&s.sort((l,c)=>l-c),s}getDataValuesGroupedByKeys({bins:t=null,groups:n=null}){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.getDisplayData(n),a=this.getDataGroupNames(),o=this.getStackKeys({bins:t,groups:n});return t?o.map(l=>{const[c,u]=l.split(":"),d={x0:c,x1:u},h=t.find(f=>f.x0.toString()===c.toString());return a.forEach(f=>{d[f]=h.filter(p=>p[i]===f).length}),d}):o.map(l=>{const c={sharedStackKey:l};return a.forEach(u=>{const d=s.find(f=>{const p=this.services.cartesianScales.getDomainIdentifier(f);return f[i]===u&&Object.prototype.hasOwnProperty.call(f,p)&&(f[p]instanceof Date?Tm(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=SL(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?nc().offset(BT):nc()).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:lt(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}=Nt.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=b(this.colorScale,t);return i.getFillColor?i.getFillColor(t,n,r,s):s}getStrokeColor(t,n,r){const i=this.getOptions(),s=b(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,n,r,s):s}isUserProvidedColorScaleValid(){const t=b(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=b(s,"label");if(c===null){const d=b(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=>mI(u)).join("")}"`)).map(a=>a.join(",")).join(`
2
+ `),r=this.getOptions();let i="myChart";const s=b(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}=Nt.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=b(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=b(this.getOptions(),"color","pairing");let n=b(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let r=b(t,"option");const i=jg.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 vI(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 yI=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Tn(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 EI(e){const t=Qa(e,"border-left-width"),n=Qa(e,"border-right-width");return e.clientWidth+t+n}function bI(e){const t=Qa(e,"border-top-width"),n=Qa(e,"border-bottom-width");return e.clientHeight+t+n}function Om(e,t={}){const n=t.width||EI(e),r=t.height||bI(e);return{width:n,height:r}}function xI(){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 xe=16384;function _I(e){(e.width>xe||e.height>xe)&&(e.width>xe&&e.height>xe?e.width>e.height?(e.height*=xe/e.width,e.width=xe):(e.width*=xe/e.height,e.height=xe):e.width>xe?(e.height*=xe/e.width,e.width=xe):(e.width*=xe/e.height,e.height=xe))}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 SI(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function TI(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),SI(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 OI(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function wI(e){return Tn(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function MI(e,t,n){const r=`.${e}:${t}`,i=n.cssText?OI(n):wI(n);return document.createTextNode(`${r}{${i}}`)}function wm(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const s=yI();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(MI(s,n,r)),t.appendChild(a)}function AI(e,t){wm(e,t,":before"),wm(e,t,":after")}const Mm="application/font-woff",Am="image/jpeg",CI={woff:Mm,woff2:Mm,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Am,jpeg:Am,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function DI(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function iu(e){const t=DI(e).toLowerCase();return CI[t]||""}function LI(e){return e.split(/,/)[1]}function su(e){return e.search(/^(data:)/)!==-1}function Cm(e,t){return`data:${t};base64,${e}`}async function Dm(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 au={};function RI(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 ou(e,t,n){const r=RI(e,t,n.includeQueryParams);if(au[r]!=null)return au[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const s=await Dm(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),LI(o)));i=Cm(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 au[r]=i,i}async function II(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Ja(t)}async function kI(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=iu(n),i=await ou(n,r,t);return Ja(i)}async function PI(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 NI(e,t){return he(e,HTMLCanvasElement)?II(e):he(e,HTMLVideoElement)?kI(e,t):he(e,HTMLIFrameElement)?PI(e):e.cloneNode(!1)}const $I=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function FI(e,t,n){var r,i;let s=[];return $I(e)&&e.assignedNodes?s=Tn(e.assignedNodes()):he(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?s=Tn(e.contentDocument.body.childNodes):s=Tn(((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 UI(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):Tn(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 BI(e,t){he(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),he(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function HI(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 GI(e,t){return he(t,Element)&&(UI(e,t),AI(e,t),BI(e,t),HI(e,t)),t}async function VI(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=>NI(r,t)).then(r=>FI(e,r,t)).then(r=>GI(e,r)).then(r=>VI(r,t))}const Lm=/url\((['"]?)([^'"]+?)\1\)/g,zI=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,WI=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function YI(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function qI(e){const t=[];return e.replace(Lm,(n,r,i)=>(t.push(i),n)),t.filter(n=>!su(n))}async function XI(e,t,n,r,i){try{const s=n?vI(t,n):t,a=iu(t);let o;if(i){const l=await i(s);o=Cm(l,a)}else o=await ou(s,a,r);return e.replace(YI(t),`$1${o}$3`)}catch{}return e}function jI(e,{preferredFontFormat:t}){return t?e.replace(WI,n=>{for(;;){const[r,,i]=zI.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Rm(e){return e.search(Lm)!==-1}async function Im(e,t,n){if(!Rm(e))return e;const r=jI(e,n);return qI(r).reduce((s,a)=>s.then(o=>XI(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 Im(i,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function ZI(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 KI(e,t){const n=he(e,HTMLImageElement);if(!(n&&!su(e.src))&&!(he(e,SVGImageElement)&&!su(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await ou(r,iu(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 QI(e,t){const r=Tn(e.childNodes).map(i=>km(i,t));await Promise.all(r).then(()=>e)}async function km(e,t){he(e,Element)&&(await ZI(e,t),await KI(e,t),await QI(e,t))}function JI(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 Pm={};async function Nm(e){let t=Pm[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},Pm[e]=t,t}async function $m(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),Dm(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 tk(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{Tn(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=Nm(l).then(u=>$m(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(Nm(i.href).then(o=>$m(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{Tn(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}function ek(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Rm(t.style.getPropertyValue("src")))}async function nk(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=Tn(e.ownerDocument.styleSheets),r=await tk(n,t);return ek(r)}async function rk(e,t){const n=await nk(e,t);return(await Promise.all(n.map(i=>{const s=i.parentStyleSheet?i.parentStyleSheet.href:null;return Im(i.cssText,s,t)}))).join(`
3
+ `)}async function ik(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await rk(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 sk(e,t={}){const{width:n,height:r}=Om(e,t),i=await to(e,t,!0);return await ik(i,t),await km(i,t),JI(i,t),await TI(i,n,r)}async function Um(e,t={}){const{width:n,height:r}=Om(e,t),i=await sk(e,t),s=await Ja(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||xI(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||_I(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 ak(e,t={}){return(await Um(e,t)).toDataURL()}async function ok(e,t={}){return(await Um(e,t)).toDataURL("image/jpeg",t.quality||1)}class On{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}}const lk="DONT_STYLE_ME_css_styles_verifier";class R extends On{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=I(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:b(t.node(),"width","baseVal","value"),height:b(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}getElementOffset(t,n=!1){const r={left:0,top:0},i=t.getBoundingClientRect(),s=n?{left:0,top:0}:this.getHolder().getBoundingClientRect();try{r.left=i.left-s.left,r.top=i.top-s.top}catch(a){console.error(a)}return r}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=b(t,"style","prefix"),r=I(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",lk),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),I(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=I(r);i.classed("filled",!0),ok(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var l;let a="myChart";const o=b(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=I(r);i.classed("filled",!0),ak(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var l;let a="myChart";const o=b(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)})}isFullScreenMode(){return I(this.getHolder()).classed("fullscreen")}toggleFullscreen(){const t=this.getHolder();I(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=I(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=R.getSVGElementSize(I(this.mainContainer),{useBBox:!0}),n=I(this.mainContainer).attr("class"),r=I(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(s){i+=Number(R.getSVGElementSize(I(s),{useBBox:!0}).height)}),i<=t?I(this.mainContainer).attr("height",i):I(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&I(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 gt{constructor(t,n,r){if(this.type="",this.renderType=et.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,r&&(this.configs=r,this.configs.id)){const i=b(this.model.getOptions(),"style","prefix");this.id=`${i}--${this.configs.id}`}this.parent||this.setParent(I(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=b(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=b(this.model.getOptions(),"style","prefix"),r=this.id?`#${this.id}`:"",i=R.appendOrSelect(this.parent,`${this.renderType===et.SVG?"svg":"div"}${r}.${ue}--${n}--${this.type}`);if(t.withinChartClip){const s=this.model.get("chartClipId");if(s){const o=I(`#${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?lt({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}/*! @license DOMPurify 3.0.10 | (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.10/LICENSE */const{entries:Bm,setPrototypeOf:Hm,isFrozen:ck,getPrototypeOf:uk,getOwnPropertyDescriptor:hk}=Object;let{freeze:se,seal:Re,create:Gm}=Object,{apply:lu,construct:cu}=typeof Reflect<"u"&&Reflect;se||(se=function(t){return t}),Re||(Re=function(t){return t}),lu||(lu=function(t,n,r){return t.apply(n,r)}),cu||(cu=function(t,n){return new t(...n)});const no=Se(Array.prototype.forEach),Vm=Se(Array.prototype.pop),ds=Se(Array.prototype.push),ro=Se(String.prototype.toLowerCase),uu=Se(String.prototype.toString),zm=Se(String.prototype.match),fs=Se(String.prototype.replace),dk=Se(String.prototype.indexOf),fk=Se(String.prototype.trim),We=Se(Object.prototype.hasOwnProperty),_e=Se(RegExp.prototype.test),ps=pk(TypeError);function Se(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 lu(e,t,r)}}function pk(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return cu(e,n)}}function mt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ro;Hm&&Hm(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=n(i);s!==i&&(ck(t)||(t[r]=s),i=s)}e[i]=!0}return e}function gk(e){for(let t=0;t<e.length;t++)We(e,t)||(e[t]=null);return e}function ur(e){const t=Gm(null);for(const[n,r]of Bm(e))We(e,n)&&(Array.isArray(r)?t[n]=gk(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=ur(r):t[n]=r);return t}function io(e,t){for(;e!==null;){const r=hk(e,t);if(r){if(r.get)return Se(r.get);if(typeof r.value=="function")return Se(r.value)}e=uk(e)}function n(){return null}return n}const Wm=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"]),hu=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"]),du=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"]),mk=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"]),fu=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"]),vk=se(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ym=se(["#text"]),qm=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"]),pu=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"]),Xm=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"]),yk=Re(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ek=Re(/<%[\w\W]*|[\w\W]*%>/gm),bk=Re(/\${[\w\W]*}/gm),xk=Re(/^data-[\-\w.\u00B7-\uFFFF]/),_k=Re(/^aria-[\-\w]+$/),jm=Re(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Sk=Re(/^(?:\w+script|data):/i),Tk=Re(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Zm=Re(/^html$/i),Ok=Re(/^[a-z][a-z\d]*(-[a-z\d]+)+$/i);var Km=Object.freeze({__proto__:null,MUSTACHE_EXPR:yk,ERB_EXPR:Ek,TMPLIT_EXPR:bk,DATA_ATTR:xk,ARIA_ATTR:_k,IS_ALLOWED_URI:jm,IS_SCRIPT_OR_DATA:Sk,ATTR_WHITESPACE:Tk,DOCTYPE_NAME:Zm,CUSTOM_ELEMENT:Ok});const wk=function(){return typeof window>"u"?null:window},Mk=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 Qm(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wk();const t=rt=>Qm(rt);if(t.version="3.0.10",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"),m=io(p,"nextSibling"),v=io(p,"childNodes"),E=io(p,"parentNode");if(typeof a=="function"){const rt=n.createElement("template");rt.content&&rt.content.ownerDocument&&(n=rt.content.ownerDocument)}let y,x="";const{implementation:S,createNodeIterator:_,createDocumentFragment:C,getElementsByTagName:L}=n,{importNode:B}=r;let D={};t.isSupported=typeof Bm=="function"&&typeof E=="function"&&S&&S.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:O,ERB_EXPR:H,TMPLIT_EXPR:P,DATA_ATTR:M,ARIA_ATTR:w,IS_SCRIPT_OR_DATA:U,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:N}=Km;let{IS_ALLOWED_URI:F}=Km,Y=null;const Z=mt({},[...Wm,...hu,...du,...fu,...Ym]);let K=null;const dt=mt({},[...qm,...pu,...Xm,...so]);let it=Object.seal(Gm(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}})),ft=null,j=null,nt=!0,vt=!0,q=!1,Q=!0,ot=!1,A=!1,V=!1,z=!1,St=!1,zt=!1,st=!1,kt=!0,Fn=!1;const an="user-content-";let ju=!0,bs=!1,ii={},si=null;const t0=mt({},["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 e0=null;const n0=mt({},["audio","video","img","source","image","track"]);let Zu=null;const r0=mt({},["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",Mn="http://www.w3.org/1999/xhtml";let ai=Mn,Ku=!1,Qu=null;const GU=mt({},[So,To,Mn],uu);let xs=null;const VU=["application/xhtml+xml","text/html"],zU="text/html";let qt=null,oi=null;const WU=n.createElement("form"),i0=function(k){return k instanceof RegExp||k instanceof Function},Ju=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(oi&&oi===k)){if((!k||typeof k!="object")&&(k={}),k=ur(k),xs=VU.indexOf(k.PARSER_MEDIA_TYPE)===-1?zU:k.PARSER_MEDIA_TYPE,qt=xs==="application/xhtml+xml"?uu:ro,Y=We(k,"ALLOWED_TAGS")?mt({},k.ALLOWED_TAGS,qt):Z,K=We(k,"ALLOWED_ATTR")?mt({},k.ALLOWED_ATTR,qt):dt,Qu=We(k,"ALLOWED_NAMESPACES")?mt({},k.ALLOWED_NAMESPACES,uu):GU,Zu=We(k,"ADD_URI_SAFE_ATTR")?mt(ur(r0),k.ADD_URI_SAFE_ATTR,qt):r0,e0=We(k,"ADD_DATA_URI_TAGS")?mt(ur(n0),k.ADD_DATA_URI_TAGS,qt):n0,si=We(k,"FORBID_CONTENTS")?mt({},k.FORBID_CONTENTS,qt):t0,ft=We(k,"FORBID_TAGS")?mt({},k.FORBID_TAGS,qt):{},j=We(k,"FORBID_ATTR")?mt({},k.FORBID_ATTR,qt):{},ii=We(k,"USE_PROFILES")?k.USE_PROFILES:!1,nt=k.ALLOW_ARIA_ATTR!==!1,vt=k.ALLOW_DATA_ATTR!==!1,q=k.ALLOW_UNKNOWN_PROTOCOLS||!1,Q=k.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ot=k.SAFE_FOR_TEMPLATES||!1,A=k.WHOLE_DOCUMENT||!1,St=k.RETURN_DOM||!1,zt=k.RETURN_DOM_FRAGMENT||!1,st=k.RETURN_TRUSTED_TYPE||!1,z=k.FORCE_BODY||!1,kt=k.SANITIZE_DOM!==!1,Fn=k.SANITIZE_NAMED_PROPS||!1,ju=k.KEEP_CONTENT!==!1,bs=k.IN_PLACE||!1,F=k.ALLOWED_URI_REGEXP||jm,ai=k.NAMESPACE||Mn,it=k.CUSTOM_ELEMENT_HANDLING||{},k.CUSTOM_ELEMENT_HANDLING&&i0(k.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(it.tagNameCheck=k.CUSTOM_ELEMENT_HANDLING.tagNameCheck),k.CUSTOM_ELEMENT_HANDLING&&i0(k.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(it.attributeNameCheck=k.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),k.CUSTOM_ELEMENT_HANDLING&&typeof k.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(it.allowCustomizedBuiltInElements=k.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ot&&(vt=!1),zt&&(St=!0),ii&&(Y=mt({},Ym),K=[],ii.html===!0&&(mt(Y,Wm),mt(K,qm)),ii.svg===!0&&(mt(Y,hu),mt(K,pu),mt(K,so)),ii.svgFilters===!0&&(mt(Y,du),mt(K,pu),mt(K,so)),ii.mathMl===!0&&(mt(Y,fu),mt(K,Xm),mt(K,so))),k.ADD_TAGS&&(Y===Z&&(Y=ur(Y)),mt(Y,k.ADD_TAGS,qt)),k.ADD_ATTR&&(K===dt&&(K=ur(K)),mt(K,k.ADD_ATTR,qt)),k.ADD_URI_SAFE_ATTR&&mt(Zu,k.ADD_URI_SAFE_ATTR,qt),k.FORBID_CONTENTS&&(si===t0&&(si=ur(si)),mt(si,k.FORBID_CONTENTS,qt)),ju&&(Y["#text"]=!0),A&&mt(Y,["html","head","body"]),Y.table&&(mt(Y,["tbody"]),delete ft.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.');y=k.TRUSTED_TYPES_POLICY,x=y.createHTML("")}else y===void 0&&(y=Mk(f,i)),y!==null&&typeof x=="string"&&(x=y.createHTML(""));se&&se(k),oi=k}},s0=mt({},["mi","mo","mn","ms","mtext"]),a0=mt({},["foreignobject","desc","title","annotation-xml"]),YU=mt({},["title","style","font","a","script"]),o0=mt({},[...hu,...du,...mk]),l0=mt({},[...fu,...vk]),qU=function(k){let X=E(k);(!X||!X.tagName)&&(X={namespaceURI:ai,tagName:"template"});const tt=ro(k.tagName),Rt=ro(X.tagName);return Qu[k.namespaceURI]?k.namespaceURI===To?X.namespaceURI===Mn?tt==="svg":X.namespaceURI===So?tt==="svg"&&(Rt==="annotation-xml"||s0[Rt]):!!o0[tt]:k.namespaceURI===So?X.namespaceURI===Mn?tt==="math":X.namespaceURI===To?tt==="math"&&a0[Rt]:!!l0[tt]:k.namespaceURI===Mn?X.namespaceURI===To&&!a0[Rt]||X.namespaceURI===So&&!s0[Rt]?!1:!l0[tt]&&(YU[tt]||!o0[tt]):!!(xs==="application/xhtml+xml"&&Qu[k.namespaceURI]):!1},fr=function(k){ds(t.removed,{element:k});try{k.parentNode.removeChild(k)}catch{k.remove()}},th=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"&&!K[k])if(St||zt)try{fr(X)}catch{}else try{X.setAttribute(k,"")}catch{}},c0=function(k){let X=null,tt=null;if(z)k="<remove></remove>"+k;else{const ne=zm(k,/^[\r\n\t ]+/);tt=ne&&ne[0]}xs==="application/xhtml+xml"&&ai===Mn&&(k='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+k+"</body></html>");const Rt=y?y.createHTML(k):k;if(ai===Mn)try{X=new h().parseFromString(Rt,xs)}catch{}if(!X||!X.documentElement){X=S.createDocument(ai,"template",null);try{X.documentElement.innerHTML=Ku?x:Rt}catch{}}const ee=X.body||X.documentElement;return k&&tt&&ee.insertBefore(n.createTextNode(tt),ee.childNodes[0]||null),ai===Mn?L.call(X,A?"html":"body")[0]:A?X.documentElement:ee},u0=function(k){return _.call(k.ownerDocument||k,k,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION,null)},XU=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},An=function(k,X,tt){D[k]&&no(D[k],Rt=>{Rt.call(t,X,tt,oi)})},d0=function(k){let X=null;if(An("beforeSanitizeElements",k,null),XU(k))return fr(k),!0;const tt=qt(k.nodeName);if(An("uponSanitizeElement",k,{tagName:tt,allowedTags:Y}),k.hasChildNodes()&&!h0(k.firstElementChild)&&_e(/<[/\w]/g,k.innerHTML)&&_e(/<[/\w]/g,k.textContent))return fr(k),!0;if(!Y[tt]||ft[tt]){if(!ft[tt]&&p0(tt)&&(it.tagNameCheck instanceof RegExp&&_e(it.tagNameCheck,tt)||it.tagNameCheck instanceof Function&&it.tagNameCheck(tt)))return!1;if(ju&&!si[tt]){const Rt=E(k)||k.parentNode,ee=v(k)||k.childNodes;if(ee&&Rt){const ne=ee.length;for(let pe=ne-1;pe>=0;--pe)Rt.insertBefore(g(ee[pe],!0),m(k))}}return fr(k),!0}return k instanceof l&&!qU(k)||(tt==="noscript"||tt==="noembed"||tt==="noframes")&&_e(/<\/no(script|embed|frames)/i,k.innerHTML)?(fr(k),!0):(ot&&k.nodeType===3&&(X=k.textContent,no([O,H,P],Rt=>{X=fs(X,Rt," ")}),k.textContent!==X&&(ds(t.removed,{element:k.cloneNode()}),k.textContent=X)),An("afterSanitizeElements",k,null),!1)},f0=function(k,X,tt){if(kt&&(X==="id"||X==="name")&&(tt in n||tt in WU))return!1;if(!(vt&&!j[X]&&_e(M,X))){if(!(nt&&_e(w,X))){if(!K[X]||j[X]){if(!(p0(k)&&(it.tagNameCheck instanceof RegExp&&_e(it.tagNameCheck,k)||it.tagNameCheck instanceof Function&&it.tagNameCheck(k))&&(it.attributeNameCheck instanceof RegExp&&_e(it.attributeNameCheck,X)||it.attributeNameCheck instanceof Function&&it.attributeNameCheck(X))||X==="is"&&it.allowCustomizedBuiltInElements&&(it.tagNameCheck instanceof RegExp&&_e(it.tagNameCheck,tt)||it.tagNameCheck instanceof Function&&it.tagNameCheck(tt))))return!1}else if(!Zu[X]){if(!_e(F,fs(tt,$,""))){if(!((X==="src"||X==="xlink:href"||X==="href")&&k!=="script"&&dk(tt,"data:")===0&&e0[k])){if(!(q&&!_e(U,fs(tt,$,"")))){if(tt)return!1}}}}}}return!0},p0=function(k){return k!=="annotation-xml"&&zm(k,N)},g0=function(k){An("beforeSanitizeAttributes",k,null);const{attributes:X}=k;if(!X)return;const tt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:K};let Rt=X.length;for(;Rt--;){const ee=X[Rt],{name:ne,namespaceURI:pe,value:pr}=ee,_s=qt(ne);let ge=ne==="value"?pr:fk(pr);if(tt.attrName=_s,tt.attrValue=ge,tt.keepAttr=!0,tt.forceKeepAttr=void 0,An("uponSanitizeAttribute",k,tt),ge=tt.attrValue,tt.forceKeepAttr||(th(ne,k),!tt.keepAttr))continue;if(!Q&&_e(/\/>/i,ge)){th(ne,k);continue}ot&&no([O,H,P],v0=>{ge=fs(ge,v0," ")});const m0=qt(k.nodeName);if(f0(m0,_s,ge)){if(Fn&&(_s==="id"||_s==="name")&&(th(ne,k),ge=an+ge),y&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!pe)switch(f.getAttributeType(m0,_s)){case"TrustedHTML":{ge=y.createHTML(ge);break}case"TrustedScriptURL":{ge=y.createScriptURL(ge);break}}try{pe?k.setAttributeNS(pe,ne,ge):k.setAttribute(ne,ge),Vm(t.removed)}catch{}}}An("afterSanitizeAttributes",k,null)},jU=function rt(k){let X=null;const tt=u0(k);for(An("beforeSanitizeShadowDOM",k,null);X=tt.nextNode();)An("uponSanitizeShadowNode",X,null),!d0(X)&&(X.content instanceof s&&rt(X.content),g0(X));An("afterSanitizeShadowDOM",k,null)};return t.sanitize=function(rt){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X=null,tt=null,Rt=null,ee=null;if(Ku=!rt,Ku&&(rt="<!-->"),typeof rt!="string"&&!h0(rt))if(typeof rt.toString=="function"){if(rt=rt.toString(),typeof rt!="string")throw ps("dirty is not a string, aborting")}else throw ps("toString is not a function");if(!t.isSupported)return rt;if(V||Ju(k),t.removed=[],typeof rt=="string"&&(bs=!1),bs){if(rt.nodeName){const pr=qt(rt.nodeName);if(!Y[pr]||ft[pr])throw ps("root node is forbidden and cannot be sanitized in-place")}}else if(rt instanceof o)X=c0("<!---->"),tt=X.ownerDocument.importNode(rt,!0),tt.nodeType===1&&tt.nodeName==="BODY"||tt.nodeName==="HTML"?X=tt:X.appendChild(tt);else{if(!St&&!ot&&!A&&rt.indexOf("<")===-1)return y&&st?y.createHTML(rt):rt;if(X=c0(rt),!X)return St?null:st?x:""}X&&z&&fr(X.firstChild);const ne=u0(bs?rt:X);for(;Rt=ne.nextNode();)d0(Rt)||(Rt.content instanceof s&&jU(Rt.content),g0(Rt));if(bs)return rt;if(St){if(zt)for(ee=C.call(X.ownerDocument);X.firstChild;)ee.appendChild(X.firstChild);else ee=X;return(K.shadowroot||K.shadowrootmode)&&(ee=B.call(r,ee,!0)),ee}let pe=A?X.outerHTML:X.innerHTML;return A&&Y["!doctype"]&&X.ownerDocument&&X.ownerDocument.doctype&&X.ownerDocument.doctype.name&&_e(Zm,X.ownerDocument.doctype.name)&&(pe="<!DOCTYPE "+X.ownerDocument.doctype.name+`>
4
+ `+pe),ot&&no([O,H,P],pr=>{pe=fs(pe,pr," ")}),y&&st?y.createHTML(pe):pe},t.setConfig=function(){let rt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ju(rt),V=!0},t.clearConfig=function(){oi=null,V=!1},t.isValidAttribute=function(rt,k,X){oi||Ju({});const tt=qt(rt),Rt=qt(k);return f0(tt,Rt,X)},t.addHook=function(rt,k){typeof k=="function"&&(D[rt]=D[rt]||[],ds(D[rt],k))},t.removeHook=function(rt){if(D[rt])return Vm(D[rt])},t.removeHooks=function(rt){D[rt]&&(D[rt]=[])},t.removeAllHooks=function(){D={}},t}var gu=Qm();const ao=e=>gu.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),Ak=e=>gu.sanitize(e,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),rn=e=>gu.sanitize(e,{ALLOWED_TAGS:[]}),xo=class xo extends gt{constructor(){super(...arguments),this.type="toolbar",this.renderType=et.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 toolbar");if(b(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("role","button").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
- aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${sn(c.id)}`)}" aria-label="${sn(c.title)}">
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
- ${h2(c.iconSVG.content)}
9
+ ${Ak(c.iconSVG.content)}
10
10
  </svg>
11
11
  </button>`).each(function(c,u){I(this).select("svg").style("pointer-events","none").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"),I(this).select("button").on("mouseover focus",function(d){const h=I(this);h.classed("hovered",!0),l.services.events.dispatchEvent(T.Toolbar.SHOW_TOOLTIP,{event:d,hoveredElement:h,content:c.title,noWrap:!0,placements:["top","bottom"]})}).on("mouseout blur",function(){l.services.events.dispatchEvent(T.Toolbar.HIDE_TOOLTIP)}).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=>b(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.title)}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),I(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=I(`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=I(`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=I(`#${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=I(`#${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=I(`#${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=b(this.getOptions(),"toolbar","numberOfIcons")-1,n=b(this.getOptions(),"toolbar","controls"),r=[],i=[],s=[];return n.forEach(a=>{let o=null;if(a.type===_t.CUSTOM)b(a,"id")===null&&(a.id=`toolbar-button-${xo.buttonID++}`),b(a,"shouldBeDisabled")===null&&(a.shouldBeDisabled=()=>!1),o=a;else{const l=this.services.domUtils.isFullScreenMode();a.type===_t.MAKE_FULLSCREEN&&l?a.type=_t.EXIT_FULLSCREEN:a.type===_t.EXIT_FULLSCREEN&&!l&&(a.type=_t.MAKE_FULLSCREEN),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?b(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(){const{moreOptions:t}=b(this.model.getOptions(),"locale","translations","toolbar");return{id:"toolbar-overflow-menu",title:t,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:n=>this.toggleOverflowMenu(n)}}getControlConfigByType(t){const n=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),r=this.model.getDisplayData(),i=this.model.getOptions(),{exportAsCSV:s,exportAsJPG:a,exportAsPNG:o,zoomIn:l,zoomOut:c,resetZoom:u,makeFullScreen:d,exitFullScreen:h,showAsTable:f}=b(i,"locale","translations","toolbar");let p;switch(t){case _t.ZOOM_IN:n&&(p={id:"toolbar-zoomIn",title:l,shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomIn()});break;case _t.ZOOM_OUT:n&&(p={id:"toolbar-zoomOut",title:c,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomOut()});break;case _t.RESET_ZOOM:n&&(p={id:"toolbar-resetZoom",title:u,shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case _t.MAKE_FULLSCREEN:p={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:d,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case _t.EXIT_FULLSCREEN:p={id:"toolbar-exitfullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:h,shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case _t.SHOW_AS_DATATABLE:p={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:f,shouldBeDisabled:()=>r.length===0,clickFunction:()=>this.services.events.dispatchEvent(T.Modal.SHOW)};break;case _t.EXPORT_CSV:p={id:"toolbar-export-CSV",title:s,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case _t.EXPORT_PNG:p={id:"toolbar-export-PNG",title:o,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case _t.EXPORT_JPG:p={id:"toolbar-export-JPG",title:a,shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToJPG()};break;default:throw Error("Not supported toolbar control type: "+t)}return p}getControlIconByType(t){switch(t){case _t.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 _t.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 _t.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 _t.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 _t.EXIT_FULLSCREEN:return'<polygon points="4 18 4 20 10.586 20 2 28.582 3.414 30 12 21.414 12 28 14 28 14 18 4 18"/><polygon points="30 3.416 28.592 2 20 10.586 20 4 18 4 18 14 28 14 28 12 21.414 12 30 3.416"/>';case _t.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 _t.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 _t.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 _t.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)}}};xo.buttonID=0;let Kr=xo;const _o=class _o extends pt{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=b(r,"growth");return i===ct.PREFERRED||i===ct.FIXED}).each(function(r){n+=r.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(n=>b(n,"growth")===ct.STRETCH).size()}render(t=!0){const n=this.parent,{width:r,height:i}=R.getHTMLElementSize(n.node()),s=this.configs.direction===At.ROW||this.configs.direction===At.ROW_REVERSE,a=b(this.model.getOptions(),"style","prefix"),o=n.classed(`${ue}--${a}--layout-row`,this.configs.direction===At.ROW).classed(`${ue}--${a}--layout-row-reverse`,this.configs.direction===At.ROW_REVERSE).classed(`${ue}--${a}--layout-column`,this.configs.direction===At.COLUMN).classed(`${ue}--${a}--layout-column-reverse`,this.configs.direction===At.COLUMN_REVERSE).classed(`${ue}--${a}--layout-alignitems-center`,this.configs.alignItems===ir.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=I(this),p=b(u,"renderType")===tt.SVG;d.setParent(p?R.appendOrSelect(h,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):h);const g=b(u,"growth");(g===ct.PREFERRED||g===ct.FIXED)&&d.render(t)})}),n.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(u){const d=b(u,"growth"),f=b(u,"renderType")===tt.SVG?R.getSVGElementSize(I(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):R.getHTMLElementSize(this);if(d===ct.PREFERRED){const p=s?f.width:f.height,g=s?r:i;u.size=p/g*100}}),o.exit().remove(),this.children.filter(u=>b(u,"growth")===ct.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=>{b(u,"growth")===ct.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 On extends pt{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer().style("width",`${this.configs.size||Jg.default.size}px`).style("height",`${this.configs.size||Jg.default.size}px`).attr("opacity",0)}}var d2={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 _t.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 _t.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 _t.EXIT_FULLSCREEN:return'<polygon points="4 18 4 20 10.586 20 2 28.582 3.414 30 12 21.414 12 28 14 28 14 18 4 18"/><polygon points="30 3.416 28.592 2 20 10.586 20 4 18 4 18 14 28 14 28 12 21.414 12 30 3.416"/>';case _t.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 _t.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 _t.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 _t.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)}}};xo.buttonID=0;let Kr=xo;const _o=class _o extends gt{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=b(r,"growth");return i===ct.PREFERRED||i===ct.FIXED}).each(function(r){n+=r.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(n=>b(n,"growth")===ct.STRETCH).size()}render(t=!0){const n=this.parent,{width:r,height:i}=R.getHTMLElementSize(n.node()),s=this.configs.direction===At.ROW||this.configs.direction===At.ROW_REVERSE,a=b(this.model.getOptions(),"style","prefix"),o=n.classed(`${ue}--${a}--layout-row`,this.configs.direction===At.ROW).classed(`${ue}--${a}--layout-row-reverse`,this.configs.direction===At.ROW_REVERSE).classed(`${ue}--${a}--layout-column`,this.configs.direction===At.COLUMN).classed(`${ue}--${a}--layout-column-reverse`,this.configs.direction===At.COLUMN_REVERSE).classed(`${ue}--${a}--layout-alignitems-center`,this.configs.alignItems===sr.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=I(this),p=b(u,"renderType")===et.SVG;d.setParent(p?R.appendOrSelect(h,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):h);const g=b(u,"growth");(g===ct.PREFERRED||g===ct.FIXED)&&d.render(t)})}),n.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(u){const d=b(u,"growth"),f=b(u,"renderType")===et.SVG?R.getSVGElementSize(I(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):R.getHTMLElementSize(this);if(d===ct.PREFERRED){const p=s?f.width:f.height,g=s?r:i;u.size=p/g*100}}),o.exit().remove(),this.children.filter(u=>b(u,"growth")===ct.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=>{b(u,"growth")===ct.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 wn extends gt{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer().style("width",`${this.configs.size||Kg.default.size}px`).style("height",`${this.configs.size||Kg.default.size}px`).attr("opacity",0)}}var Ck={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,15 +22,15 @@
22
22
  button:not([disabled]),select:not([disabled]),
23
23
  textarea:not([disabled]),
24
24
  iframe, object, embed, *[tabindex], *[contenteditable=true]
25
- `},mu=d2;function tv(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&&tv(e.prototype,t),n&&tv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function p2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g2(e){return E2(e)||y2(e)||v2(e)||m2()}function m2(){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 v2(e,t){if(e){if(typeof e=="string")return vu(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 vu(e,t)}}function y2(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function E2(e){if(Array.isArray(e))return vu(e)}function vu(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 ev(e){return e.reduce(function(t,n){return Array.isArray(n)?t.push.apply(t,g2(ev(n))):t.push(n),t},[])}function b2(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return ev(t).reduce(function(r,i){return i(r)},function(){function r(){p2(this,r)}return f2(r)}())}function yu(e){"@babel/helpers - typeof";return yu=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},yu(e)}function x2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nv(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 _2(e,t,n){return t&&nv(e.prototype,t),n&&nv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function S2(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&&Eu(e,t)}function Eu(e,t){return Eu=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Eu(e,t)}function T2(e){var t=w2();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 O2(this,i)}}function O2(e,t){if(t&&(yu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rv(e)}function rv(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w2(){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 M2(e){var t=function(n){S2(i,n);var r=T2(i);function i(s){var a,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(x2(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,rv(a)),a}return _2(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 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,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iv(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 C2(e,t,n){return t&&iv(e.prototype,t),n&&iv(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=D2(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 D2(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Qr(e),e!==null););return e}function L2(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 R2(e){var t=P2();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 I2(this,i)}}function I2(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 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 P2(){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 N2(e){var t=function(n){L2(i,n);var r=R2(i);function i(){var s;A2(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 C2(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 ps(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 _u(e){"@babel/helpers - typeof";return _u=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},_u(e)}function $2(e){return H2(e)||B2(e)||U2(e)||F2()}function F2(){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 U2(e,t){if(e){if(typeof e=="string")return Su(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 Su(e,t)}}function B2(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function H2(e){if(Array.isArray(e))return Su(e)}function Su(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 G2(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 V2(e,t,n){return t&&sv(e.prototype,t),n&&sv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function z2(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 W2(e){var t=X2();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 Y2(this,i)}}function Y2(e,t){if(t&&(_u(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return q2(e)}function q2(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function X2(){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){z2(i,n);var r=W2(i);function i(){return G2(this,i),r.apply(this,arguments)}return V2(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(x){return x[0].toUpperCase()+x.substr(1)}).join(""),g=new CustomEvent(this.options["eventBefore".concat(p)],{bubbles:!0,cancelable:!0,detail:d}),m=d&&d.delegatorNode||this.element,v=!m.dispatchEvent(g);if(v){if(h){var E=new Error("Changing state (".concat(JSON.stringify(f),") has been canceled."));E.canceled=!0,h(E)}}else{var y=[u,d].filter(Boolean);this._changeState.apply(this,$2(y).concat([function(){m.dispatchEvent(new CustomEvent(a.options["eventAfter".concat(p)],{bubbles:!0,cancelable:!0,detail:d})),h&&h()}]))}}}]),i}(e);return t}function Ou(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 av(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 Z2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ov(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&&ov(e.prototype,t),n&&ov(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Q2(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&&Mu(e,t)}function Mu(e,t){return Mu=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Mu(e,t)}function J2(e){var t=nP();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 tP(this,i)}}function tP(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 eP(e)}function eP(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nP(){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 rP(e){var t=function(n){Q2(i,n);var r=J2(i);function i(){return Z2(this,i),r.apply(this,arguments)}return K2(i,[{key:"show",value:function(a,o){(!a||typeof a=="function")&&(o=a),this.changeState("shown",av(a),o)}},{key:"hide",value:function(a,o){(!a||typeof a=="function")&&(o=a),this.changeState("hidden",av(a),o)}}]),i}(e);return t}var iP=[j2,rP];const sP=iP;function aP(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function oP(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 Au(e){"@babel/helpers - typeof";return Au=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},Au(e)}function lP(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 cP(e,t,n){return t&&lv(e.prototype,t),n&&lv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function uP(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 hP(e){var t=pP();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 dP(this,i)}}function dP(e,t){if(t&&(Au(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fP(e)}function fP(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pP(){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 gP(e){var t=function(n){uP(i,n);var r=hP(i);function i(){return lP(this,i),r.apply(this,arguments)}return cP(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 ps(o,d,function(h){var f=Ou(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 Du(e){"@babel/helpers - typeof";return Du=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},Du(e)}function mP(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 vP(e,t,n){return t&&cv(e.prototype,t),n&&cv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function yP(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&&Lu(e,t)}function Lu(e,t){return Lu=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Lu(e,t)}function EP(e){var t=_P();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 bP(this,i)}}function bP(e,t){if(t&&(Du(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xP(e)}function xP(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _P(){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 SP=function(e){yP(n,e);var t=EP(n);function n(r,i){var s;return mP(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!Ou(a,l)})&&s.element.querySelector(mu.selectorTabbable).focus()},s._hookCloseActions(),s}return vP(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(mu.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(ps(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(ps(this.element,"transitionend",c))}},{key:"_hookCloseActions",value:function(){var i=this;this.manage(ps(this.element,"click",function(s){var a=Ou(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(ps(this.element.ownerDocument.body,"keydown",function(s){s.which===27&&i.shouldStateBeChanged("hidden")&&(s.stopPropagation(),i.hide(s))}))}}],[{key:"options",get:function(){var i=mu.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}(b2(M2,gP,sP,N2));const TP=SP;class po extends pt{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()),TP.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(),{title:r,downloadAsCSV:i}=b(n,"locale","translations","tabularRep"),s=b(n,"style","prefix"),a=this.model.getTabularDataArray();return`
25
+ `},mu=Ck;function Jm(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 Dk(e,t,n){return t&&Jm(e.prototype,t),n&&Jm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Lk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rk(e){return Nk(e)||Pk(e)||kk(e)||Ik()}function Ik(){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 kk(e,t){if(e){if(typeof e=="string")return vu(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 vu(e,t)}}function Pk(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Nk(e){if(Array.isArray(e))return vu(e)}function vu(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 tv(e){return e.reduce(function(t,n){return Array.isArray(n)?t.push.apply(t,Rk(tv(n))):t.push(n),t},[])}function $k(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return tv(t).reduce(function(r,i){return i(r)},function(){function r(){Lk(this,r)}return Dk(r)}())}function yu(e){"@babel/helpers - typeof";return yu=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},yu(e)}function Fk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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 Uk(e,t,n){return t&&ev(e.prototype,t),n&&ev(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bk(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Eu(e,t)}function Eu(e,t){return Eu=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Eu(e,t)}function Hk(e){var t=Vk();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 Gk(this,i)}}function Gk(e,t){if(t&&(yu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nv(e)}function nv(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Vk(){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 zk(e){var t=function(n){Bk(i,n);var r=Hk(i);function i(s){var a,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Fk(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,nv(a)),a}return Uk(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 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 Wk(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 Yk(e,t,n){return t&&rv(e.prototype,t),n&&rv(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=qk(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 qk(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Qr(e),e!==null););return e}function Xk(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 jk(e){var t=Qk();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 Zk(this,i)}}function Zk(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 Kk(e)}function Kk(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qk(){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 Jk(e){var t=function(n){Xk(i,n);var r=jk(i);function i(){var s;Wk(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 Yk(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 _u(e){"@babel/helpers - typeof";return _u=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},_u(e)}function t2(e){return i2(e)||r2(e)||n2(e)||e2()}function e2(){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 n2(e,t){if(e){if(typeof e=="string")return Su(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 Su(e,t)}}function r2(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function i2(e){if(Array.isArray(e))return Su(e)}function Su(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 s2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iv(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 a2(e,t,n){return t&&iv(e.prototype,t),n&&iv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function o2(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 l2(e){var t=h2();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 c2(this,i)}}function c2(e,t){if(t&&(_u(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 h2(){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 d2(e){var t=function(n){o2(i,n);var r=l2(i);function i(){return s2(this,i),r.apply(this,arguments)}return a2(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(x){return x[0].toUpperCase()+x.substr(1)}).join(""),g=new CustomEvent(this.options["eventBefore".concat(p)],{bubbles:!0,cancelable:!0,detail:d}),m=d&&d.delegatorNode||this.element,v=!m.dispatchEvent(g);if(v){if(h){var E=new Error("Changing state (".concat(JSON.stringify(f),") has been canceled."));E.canceled=!0,h(E)}}else{var y=[u,d].filter(Boolean);this._changeState.apply(this,t2(y).concat([function(){m.dispatchEvent(new CustomEvent(a.options["eventAfter".concat(p)],{bubbles:!0,cancelable:!0,detail:d})),h&&h()}]))}}}]),i}(e);return t}function Ou(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 sv(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 f2(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 p2(e,t,n){return t&&av(e.prototype,t),n&&av(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function g2(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&&Mu(e,t)}function Mu(e,t){return Mu=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Mu(e,t)}function m2(e){var t=E2();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 v2(this,i)}}function v2(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 E2(){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 b2(e){var t=function(n){g2(i,n);var r=m2(i);function i(){return f2(this,i),r.apply(this,arguments)}return p2(i,[{key:"show",value:function(a,o){(!a||typeof a=="function")&&(o=a),this.changeState("shown",sv(a),o)}},{key:"hide",value:function(a,o){(!a||typeof a=="function")&&(o=a),this.changeState("hidden",sv(a),o)}}]),i}(e);return t}var x2=[d2,b2];const _2=x2;function S2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function T2(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 Au(e){"@babel/helpers - typeof";return Au=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},Au(e)}function O2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ov(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 w2(e,t,n){return t&&ov(e.prototype,t),n&&ov(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&&Cu(e,t)}function Cu(e,t){return Cu=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Cu(e,t)}function A2(e){var t=L2();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 C2(this,i)}}function C2(e,t){if(t&&(Au(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return D2(e)}function D2(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L2(){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 R2(e){var t=function(n){M2(i,n);var r=A2(i);function i(){return O2(this,i),r.apply(this,arguments)}return w2(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=Ou(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 Du(e){"@babel/helpers - typeof";return Du=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},Du(e)}function I2(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 k2(e,t,n){return t&&lv(e.prototype,t),n&&lv(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&&Lu(e,t)}function Lu(e,t){return Lu=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Lu(e,t)}function N2(e){var t=U2();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 $2(this,i)}}function $2(e,t){if(t&&(Du(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return F2(e)}function F2(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function U2(){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 B2=function(e){P2(n,e);var t=N2(n);function n(r,i){var s;return I2(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!Ou(a,l)})&&s.element.querySelector(mu.selectorTabbable).focus()},s._hookCloseActions(),s}return k2(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(mu.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=Ou(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=mu.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}($k(zk,R2,_2,Jk));class po extends gt{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()),B2.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(),{title:r,downloadAsCSV:i}=b(n,"locale","translations","tabularRep"),s=b(n,"style","prefix"),a=this.model.getTabularDataArray();return`
28
28
  <div class="cds--modal-container">
29
29
  <div class="cds--modal-header">
30
30
 
31
31
  <p class="cds--modal-header__label cds--type-delta" id="modal-title">${r}</p>
32
32
 
33
- <p class="cds--modal-header__heading cds--type-beta" id="${t}__modal-description">${sn(n.title)}</p>
33
+ <p class="cds--modal-header__heading cds--type-beta" id="${t}__modal-description">${rn(n.title)}</p>
34
34
 
35
35
  <button class="cds--modal-close" type="button" data-modal-close aria-label="close modal" data-modal-primary-focus>
36
36
  <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" aria-label="Close" width="20" height="20" viewBox="0 0 32 32" role="img" class="cds--modal-close__icon">
@@ -44,14 +44,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
44
44
  <thead>
45
45
  <tr>
46
46
  ${yt(a,0).map(o=>`<th scope="col">
47
- <div class="cds--table-header-label">${sn(o)}</div>
47
+ <div class="cds--table-header-label">${rn(o)}</div>
48
48
  </th>`).join("")}
49
49
  </tr>
50
50
  </thead>
51
51
 
52
52
  <tbody>${a.slice(1).map(o=>`
53
53
  <tr>
54
- ${o.map(l=>`<td>${sn(l)}</td>`).join("")}
54
+ ${o.map(l=>`<td>${rn(l)}</td>`).join("")}
55
55
  </tr>`).join("")}
56
56
  </tbody>
57
57
  </table>
@@ -61,7 +61,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
61
61
  <div class="${ue}--${s}-modal-footer-spacer"></div>
62
62
  <button class="cds--btn cds--btn--primary" type="button" data-modal-primary-focus>${i}</button>
63
63
  </div>
64
- </div>`}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const r=I(this.services.domUtils.getHolder()),i=b(n,"style","prefix");this.modal=R.appendOrSelect(r,`div.${ue}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class gs extends pt{constructor(){super(...arguments),this.type="title",this.renderType=tt.HTML}render(t=!1){const n=this.getComponentContainer(),r=b(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=>sn(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=R.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 R.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 ut=(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))(ut||{});class Ru extends pt{constructor(){super(...arguments),this.type="legend",this.renderType=tt.HTML}render(t=!1){const n=this.getOptions(),r=b(n,"legend"),i=b(r,"alignment"),s=b(n,"legend","orientation");let a=this.model.getDataGroups();const{DISABLED:o}=Nt.items.status,l=a.some(E=>E.status===o),c=b(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===Ht.CENTER).classed("right-aligned",i===Ht.RIGHT).classed(s,!0).classed("has-deactivated-items",l).attr("role",ut.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,E=>E.name),h=d.enter().append("div").attr("class","legend-item");h.merge(u.selectAll("div.legend-item")).classed("active",function(E){return E.status===Nt.items.status.ACTIVE});const f=b(this.getOptions(),"legend","clickable");u.classed("clickable",f&&a.length>1);const p=Nt.checkbox.radius,g=h.append("div").classed("checkbox",!0),m=g.merge(d.select("div.checkbox")).attr("role",ut.CHECKBOX).attr("tabindex",f?0:-1).attr("aria-labelledby",(E,y)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${y}-title`)).attr("aria-checked",({status:E})=>E===Nt.items.status.ACTIVE).attr("width",p*2).attr("height",p*2).attr("class",E=>this.model.getColorClassName({classNameTypes:[it.BACKGROUND],dataGroupName:E.name,originalClassName:"checkbox"})).style("background",E=>E.status===Nt.items.status.ACTIVE?this.model.getFillColor(E.name)||this.model.getStrokeColor(E.name):null).classed("active",function(E){return E.status===Nt.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 v=b(n,"legend","additionalItems");if(v&&a.length){const E=this,y=u.selectAll("div.additional-item").data(v);y.exit().remove();const x=y.enter().append("div").merge(y).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(A,L)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${m.size()+L}-title`));x.selectAll("*").remove();let S,_=1;x.append("svg").classed("icon",!0).each(function(A){const L=I(this);!S||S!=A.type?(S=A.type,_=1):_++,E.addAdditionalItem(L,A,_)}),x.append("p").merge(x.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}=Nt.area;if(n.type===Vt.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${i}px`).style("height",`${s}px`),n.type===Vt.RADIUS){const{iconData:a,fill:o,stroke:l}=Nt.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",ut.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===Vt.LINE){const a=Nt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",ut.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===Vt.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",ut.IMG).attr("aria-label","area").attr("width",i).attr("height",s).style("fill",r>3&&!n.fill?Nt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===Vt.SIZE){const{iconData:a,fill:o,stroke:l}=Nt.size;t.attr("fill","none").attr("role",ut.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===Vt.QUARTILE){const{iconData:a}=Nt.quartile;t.selectAll("rect").attr("role",ut.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===Vt.ZOOM){const{iconData:a,color:o}=b(Nt,"zoom"),l=t.attr("role",ut.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=b(this.getOptions(),"legend","truncation"),r=b(n,"type"),i=b(n,"threshold"),s=b(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!==Ce.NONE?a.html(function(o){const l=sn(o.name);return l.length>i&&l.length!==s?ss(l,r,s):l}):a.html(o=>sn(o.name))}addEventListeners(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=b(r,"legend"),s=b(i,"truncation");n.selectAll("div.legend-item").on("mouseover",function(a){t.services.events.dispatchEvent(T.Legend.ITEM_HOVER,{hoveredElement:I(this)});const o=I(this);o.select("div.checkbox").classed("hovered",!0);const l=o.datum();l.name.length>s.threshold&&s.numCharacter<l.name.length&&s.type!==Ce.NONE&&t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})}).on("mousemove",function(a){I(this).datum().name.length>s.threshold&&s.type!==Ce.NONE&&t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(T.Legend.ITEM_CLICK,{clickedElement:I(this)});const o=I(this).datum();t.model.toggleDataLabel(o.name)}).on("mouseout",function(){const a=I(this);a.select("div.checkbox").classed("hovered",!1),a.datum().name.length>s.threshold&&s.type!==Ce.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:I(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:I(this)})}),n.selectAll("g.additional-item").on("mouseover",function(a){const o=I(this),l=o.datum();l.name.length>s.threshold&&t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})})}}class uv extends pt{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=R.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=R.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 OP extends uv{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}=R.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=R.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const i=R.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,Ut;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(Ut||(Ut={}));var hv=(Jr={},Jr[Ut.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[Ut.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[Ut.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[Ut.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),dv=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},go=function(){function e(t){t===void 0&&(t={}),this.positions=hv,this.positions=Object.assign({},hv,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,m=p-g,v=m/p;return{placement:l,weight:v}});return o.sort(function(l,c){return c.weight-l.weight}),o[0].placement},e.prototype.findBestPlacementAt=function(t,n,r,i){var s=this;i===void 0&&(i=this.defaultContainerFunction.bind(this));var a=function(o,l,c){return s.findPositionAt(t,l,c)};return this.findBestPlacement(null,n,r,i,a)},e.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:dv.innerHeight,width:dv.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 Iu extends pt{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=tt.HTML,this.isEventListenerAdded=!1,this.lastTriggeredEventType="",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=R.appendOrSelect(this.tooltip,"div.content-box");if(b(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&&I(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.lastTriggeredEventType=i.type},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(T.Tooltip.MOVE,t=>{this.lastTriggeredEventType!==T.Toolbar.SHOW_TOOLTIP&&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),this.services.events.addEventListener(T.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.addEventListener(T.Toolbar.HIDE_TOOLTIP,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),this.services.events.removeEventListener(T.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.removeEventListener(T.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),r=b(n,"tooltip","truncation","type"),i=b(n,"tooltip","truncation","threshold"),s=b(n,"tooltip","truncation","numCharacter");return r!==Ce.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=ss(a.label,r,s)),a.value&&a.value.length>i&&(a.value=ss(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
+ </div>`}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const r=I(this.services.domUtils.getHolder()),i=b(n,"style","prefix");this.modal=R.appendOrSelect(r,`div.${ue}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class ms extends gt{constructor(){super(...arguments),this.type="title",this.renderType=et.HTML}render(t=!1){const n=this.getComponentContainer(),r=b(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=R.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 R.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 ut=(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))(ut||{});class Ru extends gt{constructor(){super(...arguments),this.type="legend",this.renderType=et.HTML}render(t=!1){const n=this.getOptions(),r=b(n,"legend"),i=b(r,"alignment"),s=b(n,"legend","orientation");let a=this.model.getDataGroups();const{DISABLED:o}=Nt.items.status,l=a.some(E=>E.status===o),c=b(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===Ht.CENTER).classed("right-aligned",i===Ht.RIGHT).classed(s,!0).classed("has-deactivated-items",l).attr("role",ut.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,E=>E.name),h=d.enter().append("div").attr("class","legend-item");h.merge(u.selectAll("div.legend-item")).classed("active",function(E){return E.status===Nt.items.status.ACTIVE});const f=b(this.getOptions(),"legend","clickable");u.classed("clickable",f&&a.length>1);const p=Nt.checkbox.radius,g=h.append("div").classed("checkbox",!0),m=g.merge(d.select("div.checkbox")).attr("role",ut.CHECKBOX).attr("tabindex",f?0:-1).attr("aria-labelledby",(E,y)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${y}-title`)).attr("aria-checked",({status:E})=>E===Nt.items.status.ACTIVE).attr("width",p*2).attr("height",p*2).attr("class",E=>this.model.getColorClassName({classNameTypes:[at.BACKGROUND],dataGroupName:E.name,originalClassName:"checkbox"})).style("background",E=>E.status===Nt.items.status.ACTIVE?this.model.getFillColor(E.name)||this.model.getStrokeColor(E.name):null).classed("active",function(E){return E.status===Nt.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 v=b(n,"legend","additionalItems");if(v&&a.length){const E=this,y=u.selectAll("div.additional-item").data(v);y.exit().remove();const x=y.enter().append("div").merge(y).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(C,L)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${m.size()+L}-title`));x.selectAll("*").remove();let S,_=1;x.append("svg").classed("icon",!0).each(function(C){const L=I(this);!S||S!=C.type?(S=C.type,_=1):_++,E.addAdditionalItem(L,C,_)}),x.append("p").merge(x.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}=Nt.area;if(n.type===Vt.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${i}px`).style("height",`${s}px`),n.type===Vt.RADIUS){const{iconData:a,fill:o,stroke:l}=Nt.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",ut.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===Vt.LINE){const a=Nt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",ut.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===Vt.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",ut.IMG).attr("aria-label","area").attr("width",i).attr("height",s).style("fill",r>3&&!n.fill?Nt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===Vt.SIZE){const{iconData:a,fill:o,stroke:l}=Nt.size;t.attr("fill","none").attr("role",ut.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===Vt.QUARTILE){const{iconData:a}=Nt.quartile;t.selectAll("rect").attr("role",ut.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===Vt.ZOOM){const{iconData:a,color:o}=b(Nt,"zoom"),l=t.attr("role",ut.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=b(this.getOptions(),"legend","truncation"),r=b(n,"type"),i=b(n,"threshold"),s=b(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!==De.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=b(r,"legend"),s=b(i,"truncation");n.selectAll("div.legend-item").on("mouseover",function(a){t.services.events.dispatchEvent(T.Legend.ITEM_HOVER,{hoveredElement:I(this)});const o=I(this);o.select("div.checkbox").classed("hovered",!0);const l=o.datum();l.name.length>s.threshold&&s.numCharacter<l.name.length&&s.type!==De.NONE&&t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})}).on("mousemove",function(a){I(this).datum().name.length>s.threshold&&s.type!==De.NONE&&t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(T.Legend.ITEM_CLICK,{clickedElement:I(this)});const o=I(this).datum();t.model.toggleDataLabel(o.name)}).on("mouseout",function(){const a=I(this);a.select("div.checkbox").classed("hovered",!1),a.datum().name.length>s.threshold&&s.type!==De.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:I(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:I(this)})}),n.selectAll("g.additional-item").on("mouseover",function(a){const o=I(this),l=o.datum();l.name.length>s.threshold&&t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})})}}class cv extends gt{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=et.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=R.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=R.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 H2 extends cv{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}=R.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=R.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const i=R.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,Ut;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(Ut||(Ut={}));var uv=(Jr={},Jr[Ut.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[Ut.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[Ut.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[Ut.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),hv=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},go=function(){function e(t){t===void 0&&(t={}),this.positions=uv,this.positions=Object.assign({},uv,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,m=p-g,v=m/p;return{placement:l,weight:v}});return o.sort(function(l,c){return c.weight-l.weight}),o[0].placement},e.prototype.findBestPlacementAt=function(t,n,r,i){var s=this;i===void 0&&(i=this.defaultContainerFunction.bind(this));var a=function(o,l,c){return s.findPositionAt(t,l,c)};return this.findBestPlacement(null,n,r,i,a)},e.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:hv.innerHeight,width:hv.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 Iu extends gt{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=et.HTML,this.isEventListenerAdded=!1,this.lastTriggeredEventType="",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=R.appendOrSelect(this.tooltip,"div.content-box");if(b(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&&I(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.lastTriggeredEventType=i.type},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(T.Tooltip.MOVE,t=>{this.lastTriggeredEventType!==T.Toolbar.SHOW_TOOLTIP&&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),this.services.events.addEventListener(T.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.addEventListener(T.Toolbar.HIDE_TOOLTIP,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),this.services.events.removeEventListener(T.Toolbar.SHOW_TOOLTIP,this.handleShowTooltip),this.services.events.removeEventListener(T.Toolbar.HIDE_TOOLTIP,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),r=b(n,"tooltip","truncation","type"),i=b(n,"tooltip","truncation","threshold"),s=b(n,"tooltip","truncation","numCharacter");return r!==De.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>
65
65
  <div class="datapoint-tooltip${n.bold?" bold":""}">
66
66
  ${n.class||n.color?`<div class="tooltip-color ${n.class}"></div>`:""}
67
67
  <div class="label">
@@ -70,17 +70,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
70
70
  </div>
71
71
  ${n.value===void 0||n.value===null?"":`<p class="value"/>${n.value}</p>`}
72
72
  </div>
73
- </li>`).join("")+"</ul>"}valueFormatter(t,n){const r=this.getOptions(),i=b(r,"tooltip","valueFormatter"),{code:s,number:a,date:o}=b(r,"locale");if(i)return i(t,n);if(typeof t.getTime=="function")return o(t,s,{month:"short",day:"numeric",year:"numeric"});try{if(typeof t=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(t)){const l=new Date(t);return o(l,s,{month:"short",day:"numeric",year:"numeric"})}}catch{}return a(t,s)}render(t=!1){const n=this.getOptions(),r=b(n,"tooltip","enabled");if(r){const i=I(this.services.domUtils.getHolder()),s=b(n,"style","prefix");this.tooltip=R.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)}addOffsetByPlacement(t,n,r){const i=Object.assign({},t);return n==Ut.LEFT?i.left-=r:n==Ut.RIGHT?i.left+=r:n==Ut.TOP?i.top-=r:n==Ut.BOTTOM&&(i.top+=r),i}positionTooltip(t){const n=this.services.domUtils.getHolder(),r=n.offsetWidth,i=n.offsetHeight,s=this.tooltip.node(),a=this.getOptions(),o=b(a,"zoomBar","top","enabled"),l=!!b(t,"detail","noWrap"),c=Array.isArray(b(t,"detail","placements")),u=c?b(t,"detail","placements"):[Ut.RIGHT,Ut.LEFT,Ut.TOP,Ut.BOTTOM];let d,{horizontalOffset:h,defaultOffset:f}=_R;if(this.tooltip.select("div.title-tooltip").classed("title-tooltip-nowrap",l),c){const m=b(t,"detail","event","target"),v=this.services.domUtils.getElementOffset(m,!0);d=this.positionService.findBestPlacementAt(v,s,u,()=>({top:0,left:0,width:r,height:i}));let E=this.positionService.findPosition(m,s,d,()=>this.services.domUtils.getElementOffset(m));E=this.addOffsetByPlacement(E,d,f),this.positionService.setElement(s,E);return}let p=b(t,"detail","mousePosition");if(!p)p=Bn(b(t,"detail","event"),n);else{const m=b(a,"zoomBar","top","type"),v=be.height[m];o&&(p[1]+=v+be.spacerHeight)}p[0]/r>.9?d=Ut.LEFT:p[0]/r<.1?d=Ut.RIGHT:d=this.positionService.findBestPlacementAt({left:p[0],top:p[1]},s,u,()=>({top:void 0,left:void 0,width:r,height:i})),d===Ut.LEFT&&(h*=-1);const g=this.positionService.findPositionAt({left:p[0]+h,top:p[1]},s,d);this.positionService.setElement(s,g)}}class wP extends Tn{zoomIn(t,n,r){let i,s,a;const o=r||qr;t&&(i=t.x,s=t.y,a=2);const{width:l,height:c}=R.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:I(t)})}zoomOut(t,n){const r=n||qr;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(T.CanvasZoom.CANVAS_ZOOM_OUT)}}class MP extends Tn{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 AP extends Tn{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 ms extends Tn{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:ms.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}}class CP extends Tn{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(b(tm,n,"duration")||tm.default.duration)}getPendingTransitions(){return this.pendingTransitions}}class qe{constructor(t,n){this.components=[],this.services={canvasZoom:wP,domUtils:R,events:MP,files:AP,gradientUtils:ms,transitions:CP},this.model=new rn(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=!!b(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=b(r,"toolbar","enabled"),s={id:"legend",components:[new Ru(this.model,this.services)],growth:ct.PREFERRED},a=b(r,"canvasZoom","enabled");a&&a===!0&&t.push(new OP(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new gs(this.model,this.services)],growth:ct.STRETCH},c={id:"toolbar",components:[new Kr(this.model,this.services)],growth:ct.PREFERRED},u={id:"header",components:[new ae(this.model,this.services,[l,...i?[c]:[]],{direction:At.ROW,alignItems:ir.CENTER})],growth:ct.PREFERRED},d={id:"graph-frame",components:t,growth:ct.STRETCH,renderType:b(n,"graphFrameRenderType")||tt.SVG},h=b(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let f=At.COLUMN;if(h){const v=b(r,"legend","position");v==="left"?(f=At.ROW,r.legend.orientation||(r.legend.orientation=Wr.VERTICAL)):v==="right"?(f=At.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=Wr.VERTICAL)):v==="bottom"&&(f=At.COLUMN_REVERSE)}const p={id:"spacer",components:[new On(this.model,this.services)],growth:ct.PREFERRED},g={id:"full-frame",components:[new ae(this.model,this.services,[...h?[s]:[],...h?[p]:[],d],{direction:f})],growth:ct.STRETCH},m=[];if(o||i){m.push(u);const v={id:"spacer",components:[new On(this.model,this.services,i?{size:15}:void 0)],growth:ct.PREFERRED};m.push(v)}return m.push(g),[new Iu(this.model,this.services),new po(this.model,this.services),new ae(this.model,this.services,m,{direction:At.COLUMN})]}}class ur extends rn{constructor(t){super(t),this.axisFlavor=rs.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:b(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(),{number:l,code:c}=b(this.getOptions(),"locale"),u=["Group",i.label,s.label,...a?[a.label]:[],...o?[o.label]:[]],d=t.map(h=>[h[r],h[i.identifier]===null?"&ndash;":h[i.identifier],h[s.identifier]===null||isNaN(h[s.identifier])?"&ndash;":l(h[s.identifier],c),...a?[h[a.identifier]===null?"&ndash;":h[a.identifier]]:[],...o?[h[o.identifier]===null||isNaN(h[o.identifier])?"&ndash;":h[o.identifier]]:[]]);return super.formatTable({headers:u,cells:d})}setData(t){let n;if(t&&(n=super.setData(t),b(this.getOptions(),"zoomBar",G.TOP,"enabled"))){const r=b(this.getOptions(),"zoomBar",G.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(yn(t)):this.getDisplayData();let r=n;const{cartesianScales:i}=this.services;if(n&&i.domainAxisPosition&&i.rangeAxisPosition){const s=i.getDomainIdentifier(),a=i.getRangeIdentifier();let o=n.map(l=>l[s].getTime());o=Qi(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(G).forEach(i=>{const s=G[i],a=n.axes[s];if(a&&a.scaleType===Q.TIME){const o=a.mapsTo;(o!==null||o!==void 0)&&r.push(o)}}),r.length>0&&t.forEach(i=>{r.forEach(s=>{b(i,s,"getTime")===null&&(i[s]=new Date(i[s]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}}class DP extends ur{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=b(this.getOptions(),"locale");t.sort((a,o)=>a.source.localeCompare(o.source));const i=["Source","Target","Value"],s=[...t.map(a=>[a.source,a.target,a.value===null?"&ndash;":n(a.value,r)])];return super.formatTable({headers:i,cells:s})}}function fv(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 LP(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 ku(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 RP(e){return e.depth}function IP(e,t){return t-1-e.height}function pv(e,t){return e.sourceLinks.length?e.depth:t-1}function mo(e){return function(){return e}}function gv(e,t){return vo(e.source,t.source)||e.index-t.index}function mv(e,t){return vo(e.target,t.target)||e.index-t.index}function vo(e,t){return e.y0-t.y0}function Pu(e){return e.value}function kP(e){return e.index}function PP(e){return e.nodes}function NP(e){return e.links}function vv(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function yv({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 $P(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=kP,l=pv,c,u,d=PP,h=NP,f=6;function p(){const w={nodes:d.apply(null,arguments),links:h.apply(null,arguments)};return g(w),m(w),v(w),E(w),S(w),yv(w),w}p.update=function(w){return yv(w),w},p.nodeId=function(w){return arguments.length?(o=typeof w=="function"?w:mo(w),p):o},p.nodeAlign=function(w){return arguments.length?(l=typeof w=="function"?w:mo(w),p):l},p.nodeSort=function(w){return arguments.length?(c=w,p):c},p.nodeWidth=function(w){return arguments.length?(i=+w,p):i},p.nodePadding=function(w){return arguments.length?(s=a=+w,p):s},p.nodes=function(w){return arguments.length?(d=typeof w=="function"?w:mo(w),p):d},p.links=function(w){return arguments.length?(h=typeof w=="function"?w:mo(w),p):h},p.linkSort=function(w){return arguments.length?(u=w,p):u},p.size=function(w){return arguments.length?(e=t=0,n=+w[0],r=+w[1],p):[n-e,r-t]},p.extent=function(w){return arguments.length?(e=+w[0][0],n=+w[1][0],t=+w[0][1],r=+w[1][1],p):[[e,t],[n,r]]},p.iterations=function(w){return arguments.length?(f=+w,p):f};function g({nodes:w,links:U}){for(const[$,N]of w.entries())N.index=$,N.sourceLinks=[],N.targetLinks=[];const F=new Map(w.map(($,N)=>[o($,N,w),$]));for(const[$,N]of U.entries()){N.index=$;let{source:j,target:q}=N;typeof j!="object"&&(j=N.source=vv(F,j)),typeof q!="object"&&(q=N.target=vv(F,q)),j.sourceLinks.push(N),q.targetLinks.push(N)}if(u!=null)for(const{sourceLinks:$,targetLinks:N}of w)$.sort(u),N.sort(u)}function m({nodes:w}){for(const U of w)U.value=U.fixedValue===void 0?Math.max(ku(U.sourceLinks,Pu),ku(U.targetLinks,Pu)):U.fixedValue}function v({nodes:w}){const U=w.length;let F=new Set(w),$=new Set,N=0;for(;F.size;){for(const j of F){j.depth=N;for(const{target:q}of j.sourceLinks)$.add(q)}if(++N>U)throw new Error("circular link");F=$,$=new Set}}function E({nodes:w}){const U=w.length;let F=new Set(w),$=new Set,N=0;for(;F.size;){for(const j of F){j.height=N;for(const{source:q}of j.targetLinks)$.add(q)}if(++N>U)throw new Error("circular link");F=$,$=new Set}}function y({nodes:w}){const U=fv(w,N=>N.depth)+1,F=(n-e-i)/(U-1),$=new Array(U);for(const N of w){const j=Math.max(0,Math.min(U-1,Math.floor(l.call(null,N,U))));N.layer=j,N.x0=e+j*F,N.x1=N.x0+i,$[j]?$[j].push(N):$[j]=[N]}if(c)for(const N of $)N.sort(c);return $}function x(w){const U=LP(w,F=>(r-t-(F.length-1)*a)/ku(F,Pu));for(const F of w){let $=t;for(const N of F){N.y0=$,N.y1=$+N.value*U,$=N.y1+a;for(const j of N.sourceLinks)j.width=j.value*U}$=(r-$+a)/(F.length+1);for(let N=0;N<F.length;++N){const j=F[N];j.y0+=$*(N+1),j.y1+=$*(N+1)}H(F)}}function S(w){const U=y(w);a=Math.min(s,(r-t)/(fv(U,F=>F.length)-1)),x(U);for(let F=0;F<f;++F){const $=Math.pow(.99,F),N=Math.max(1-$,(F+1)/f);A(U,$,N),_(U,$,N)}}function _(w,U,F){for(let $=1,N=w.length;$<N;++$){const j=w[$];for(const q of j){let at=0,nt=0;for(const{source:mt,value:Z}of q.targetLinks){let et=Z*(q.layer-mt.layer);at+=P(mt,q)*et,nt+=et}if(!(nt>0))continue;let dt=(at/nt-q.y0)*U;q.y0+=dt,q.y1+=dt,O(q)}c===void 0&&j.sort(vo),L(j,F)}}function A(w,U,F){for(let $=w.length,N=$-2;N>=0;--N){const j=w[N];for(const q of j){let at=0,nt=0;for(const{target:mt,value:Z}of q.sourceLinks){let et=Z*(mt.layer-q.layer);at+=M(q,mt)*et,nt+=et}if(!(nt>0))continue;let dt=(at/nt-q.y0)*U;q.y0+=dt,q.y1+=dt,O(q)}c===void 0&&j.sort(vo),L(j,F)}}function L(w,U){const F=w.length>>1,$=w[F];D(w,$.y0-a,F-1,U),B(w,$.y1+a,F+1,U),D(w,r,w.length-1,U),B(w,t,0,U)}function B(w,U,F,$){for(;F<w.length;++F){const N=w[F],j=(U-N.y0)*$;j>1e-6&&(N.y0+=j,N.y1+=j),U=N.y1+a}}function D(w,U,F,$){for(;F>=0;--F){const N=w[F],j=(N.y1-U)*$;j>1e-6&&(N.y0-=j,N.y1-=j),U=N.y0-a}}function O({sourceLinks:w,targetLinks:U}){if(u===void 0){for(const{source:{sourceLinks:F}}of U)F.sort(mv);for(const{target:{targetLinks:F}}of w)F.sort(gv)}}function H(w){if(u===void 0)for(const{sourceLinks:U,targetLinks:F}of w)U.sort(mv),F.sort(gv)}function P(w,U){let F=w.y0-(w.sourceLinks.length-1)*a/2;for(const{target:$,width:N}of w.sourceLinks){if($===U)break;F+=N+a}for(const{source:$,width:N}of U.targetLinks){if($===w)break;F-=N}return F}function M(w,U){let F=U.y0-(U.targetLinks.length-1)*a/2;for(const{source:$,width:N}of U.targetLinks){if($===w)break;F+=N+a}for(const{target:$,width:N}of w.sourceLinks){if($===U)break;F-=N}return F}return p}var Nu=Math.PI,$u=2*Nu,hr=1e-6,FP=$u-hr;function Fu(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Ev(){return new Fu}Fu.prototype=Ev.prototype={constructor:Fu,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>hr)if(!(Math.abs(u*o-l*c)>hr)||!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,m=Math.sqrt(p),v=Math.sqrt(d),E=i*Math.tan((Nu-Math.acos((p+d-g)/(2*m*v)))/2),y=E/v,x=E/m;Math.abs(y-1)>hr&&(this._+="L"+(e+y*c)+","+(t+y*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>c*f)+","+(this._x1=e+x*o)+","+(this._y1=t+x*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)>hr||Math.abs(this._y1-c)>hr)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%$u+$u),d>FP?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>hr&&(this._+="A"+n+","+n+",0,"+ +(d>=Nu)+","+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 UP(e){return e[0]}function BP(e){return e[1]}var HP=Array.prototype.slice;function GP(e){return e.source}function VP(e){return e.target}function zP(e){var t=GP,n=VP,r=UP,i=BP,s=null;function a(){var o,l=HP.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=Ev()),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 WP(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function YP(){return zP(WP)}function qP(e){return[e.source.x1,e.y0]}function XP(e){return[e.target.x0,e.y1]}function jP(){return YP().source(qP).target(XP)}class ZP extends pt{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}=R.getSVGElementSize(n,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=b(this.getOptions(),"color","gradient","enabled");let l=Ve.minNodePadding;s.alluvial.nodePadding>Ve.minNodePadding&&(l=s.alluvial.nodePadding);const c=b(s,"alluvial","nodeAlignment");let u=pv;c===Ht.LEFT?u=RP:c===Ht.RIGHT&&(u=IP);const d=$P().nodeId(y=>y.name).nodeWidth(Ve.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=d({nodes:s.alluvial.nodes.map(y=>Object.assign({},y)),links:a.map(y=>Object.assign({},y))}),this.graph.nodes=this.graph.nodes.filter(y=>y.value!==0);const h={};this.graph.nodes.forEach(y=>{const x=y.x0;y.category&&(h[x]=y==null?void 0:y.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(h)).join("g").attr("transform",y=>`translate(${y}, 0)`).append("text").attr("id",(y,x)=>this.services.domUtils.generateElementIDString(`alluvial-category-${x}`)).style("font-size","14px").text(y=>h[y]?h[y]:"").attr("y",20).attr("x",(y,x)=>{const S=this.services.domUtils.generateElementIDString(`alluvial-category-${x}`),{width:_}=R.getSVGElementSize(I(`text#${S}`),{useBBox:!0});let A=0;return y+A>=_&&(A=-_+4),A});const p=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(p.exit().remove(),o){const y=b(this.getOptions(),"color","scale");y&&p.enter().append("linearGradient").attr("id",x=>`${this.gradient_id}-link-${x.index}`).attr("gradientUnits","userSpaceOnUse").call(x=>x.append("stop").attr("offset","0%").attr("stop-color",S=>y[S.source.name])).call(x=>x.append("stop").attr("offset","100%").attr("stop-color",S=>y[S.target.name])),p.exit().remove()}p.enter().append("path").classed("link",!0).attr("d",jP()).attr("id",y=>this.services.domUtils.generateElementIDString(`alluvial-line-${y.index}`)).attr("class",y=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[it.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[it.STROKE],dataGroupName:y.source.index,originalClassName:"link"})).style("stroke",y=>o?`url(#${this.gradient_id}-link-${y.index})`:this.model.getFillColor(y.source.name,null,{...y,source:y.source.name,target:y.target.name})).attr("stroke-width",y=>Math.max(1,y.width)).style("stroke-opacity",Ve.opacity.default).attr("aria-label",y=>`${y.source.name} → ${y.target.name} (${y.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const g=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",y=>this.services.domUtils.generateElementIDString(`alluvial-node-${y.index}`)).classed("node-group",!0).attr("transform",y=>`translate(${y.x0}, ${y.y0})`);g.append("rect").classed("node",!0).attr("height",y=>y.y1-y.y0).attr("width",y=>y.x1-y.x0).attr("fill","black");const m=g.append("g").attr("id",y=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${y.index}`)),{code:v,number:E}=b(s,"locale");m.append("text").attr("id",y=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${y.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(y=>`${y.name} (${E(y.value,v)})`).attr("aria-label",y=>`${y.name} (${y.value})`),m.append("rect").classed("node-text-bg",!0).attr("width",(y,x)=>{const S=this.services.domUtils.generateElementIDString(`alluvial-node-text-${x}`),{width:_}=R.getSVGElementSize(I(`text#${S}`),{useBBox:!0});return _+8}).attr("height",18).attr("stroke-width",2).lower(),m.attr("transform",(y,x)=>{const S=this.services.domUtils.generateElementIDString(`alluvial-node-text-${x}`),{width:_}=R.getSVGElementSize(I(`text#${S}`),{useBBox:!0}),A=(y.y1-y.y0)/2-9;let L=y.x1-y.x0;return y.x1>=_?L=L-(_+16):L+=4,`translate(${L}, ${A})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,{number:r,code:i}=b(this.getOptions(),"locale"),s=Va((a,o="mouseover")=>{const l=n.parent.selectAll("path.link").transition().call(c=>n.services.transitions.setupTransition({transition:c,name:"alluvial-links-mouse-highlight"}));o==="mouseout"?(I(a).lower(),l.style("stroke-opacity",Ve.opacity.default)):l.style("stroke-opacity",function(){return a===this?(I(this).raise(),Ve.opacity.selected):Ve.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(a,o){const l=I(this);s(this,"mouseover"),l.classed("link-hovered",!0);const c=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEOVER,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:o.target.name,value:(r(o.value,i)?`${r(o.value,i)}`:"-")+(t.alluvial.units?` ${t.alluvial.units}`:""),color:c,labelIcon:n.getRightArrowIcon()}]})}).on("mousemove",function(a,o){n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEMOVE,{event:a,element:I(this),datum:o}),n.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("click",function(a,o){n.services.events.dispatchEvent(T.Alluvial.LINE_CLICK,{event:a,element:I(this),datum:o})}).on("mouseout",function(a,o){const l=I(this);s(this,"mouseout"),l.classed("link-hovered",!1),n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEOUT,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(T.Tooltip.HIDE,{event:a,hoveredElement:l})})}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)?(I(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=I(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},i,a),t.traverse({link:"targetLinks",node:"source"},i,a),a.length){const o=is(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=is(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:I(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:I(this),datum:i})}).on("mouseout",function(r,i){const s=I(this),a=is(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=is(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
+ </li>`).join("")+"</ul>"}valueFormatter(t,n){const r=this.getOptions(),i=b(r,"tooltip","valueFormatter"),{code:s,number:a,date:o}=b(r,"locale");if(i)return i(t,n);if(typeof t.getTime=="function")return o(t,s,{month:"short",day:"numeric",year:"numeric"});try{if(typeof t=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(t)){const l=new Date(t);return o(l,s,{month:"short",day:"numeric",year:"numeric"})}}catch{}return a(t,s)}render(t=!1){const n=this.getOptions(),r=b(n,"tooltip","enabled");if(r){const i=I(this.services.domUtils.getHolder()),s=b(n,"style","prefix");this.tooltip=R.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)}addOffsetByPlacement(t,n,r){const i=Object.assign({},t);return n==Ut.LEFT?i.left-=r:n==Ut.RIGHT?i.left+=r:n==Ut.TOP?i.top-=r:n==Ut.BOTTOM&&(i.top+=r),i}positionTooltip(t){const n=this.services.domUtils.getHolder(),r=n.offsetWidth,i=n.offsetHeight,s=this.tooltip.node(),a=this.getOptions(),o=b(a,"zoomBar","top","enabled"),l=!!b(t,"detail","noWrap"),c=Array.isArray(b(t,"detail","placements")),u=c?b(t,"detail","placements"):[Ut.RIGHT,Ut.LEFT,Ut.TOP,Ut.BOTTOM];let d,{horizontalOffset:h,defaultOffset:f}=UL;if(this.tooltip.select("div.title-tooltip").classed("title-tooltip-nowrap",l),c){const m=b(t,"detail","event","target"),v=this.services.domUtils.getElementOffset(m,!0);d=this.positionService.findBestPlacementAt(v,s,u,()=>({top:0,left:0,width:r,height:i}));let E=this.positionService.findPosition(m,s,d,()=>this.services.domUtils.getElementOffset(m));E=this.addOffsetByPlacement(E,d,f),this.positionService.setElement(s,E);return}let p=b(t,"detail","mousePosition");if(!p)p=Hn(b(t,"detail","event"),n);else{const m=b(a,"zoomBar","top","type"),v=be.height[m];o&&(p[1]+=v+be.spacerHeight)}p[0]/r>.9?d=Ut.LEFT:p[0]/r<.1?d=Ut.RIGHT:d=this.positionService.findBestPlacementAt({left:p[0],top:p[1]},s,u,()=>({top:void 0,left:void 0,width:r,height:i})),d===Ut.LEFT&&(h*=-1);const g=this.positionService.findPositionAt({left:p[0]+h,top:p[1]},s,d);this.positionService.setElement(s,g)}}class G2 extends On{zoomIn(t,n,r){let i,s,a;const o=r||qr;t&&(i=t.x,s=t.y,a=2);const{width:l,height:c}=R.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:I(t)})}zoomOut(t,n){const r=n||qr;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(T.CanvasZoom.CANVAS_ZOOM_OUT)}}class V2 extends On{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(t,n){this.documentFragment.addEventListener(t,n)}removeEventListener(t,n){this.documentFragment.removeEventListener(t,n)}dispatchEvent(t,n){let r;n?r=new CustomEvent(t,{detail:n}):(r=document.createEvent("Event"),r.initEvent(t,!1,!0)),this.documentFragment.dispatchEvent(r)}}class z2 extends On{constructor(t,n){super(t,n)}downloadCSV(t,n){const r=document.createElement("a"),i="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:i}),n);else if(URL&&"download"in r){const s=URL.createObjectURL(new Blob([t],{type:i}));r.href=s,r.setAttribute("download",n),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(s)}else location.href=`data:application/octet-stream,${encodeURIComponent(t)}`}downloadImage(t,n){const r=document.createElement("a");r.download=n,r.href=t,document.body.appendChild(r),r.click(),document.body.removeChild(r)}}class vs extends On{static appendOrUpdateLinearGradient(t){let n=t.svg.select(`defs linearGradient#${t.id}`);n.empty()&&(n=t.svg.append("defs").append("linearGradient").attr("id",t.id).attr("x1",t.x1).attr("x2",t.x2).attr("y1",t.y1).attr("y2",t.y2)),n.selectAll("stop").remove(),n.selectAll("stop").data(t.stops).enter().append("stop").attr("offset",r=>r.offset).style("stop-color",r=>r.color).style("stop-opacity",r=>r.opacity)}static getOffsetRatio(t){return(Math.abs(t[1])*100/Math.abs(t[0]-t[1])).toFixed(2)+"%"}static getStops(t,n){const r=t[0]<0&&t[1]>0;let i=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return r&&(i=[{offset:"0%",color:n,opacity:"0.6"},{offset:vs.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}}class W2 extends On{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(b(Qg,n,"duration")||Qg.default.duration)}getPendingTransitions(){return this.pendingTransitions}}class Ye{constructor(t,n){this.components=[],this.services={canvasZoom:G2,domUtils:R,events:V2,files:z2,gradientUtils:vs,transitions:W2},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=!!b(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=b(r,"toolbar","enabled"),s={id:"legend",components:[new Ru(this.model,this.services)],growth:ct.PREFERRED},a=b(r,"canvasZoom","enabled");a&&a===!0&&t.push(new H2(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new ms(this.model,this.services)],growth:ct.STRETCH},c={id:"toolbar",components:[new Kr(this.model,this.services)],growth:ct.PREFERRED},u={id:"header",components:[new ae(this.model,this.services,[l,...i?[c]:[]],{direction:At.ROW,alignItems:sr.CENTER})],growth:ct.PREFERRED},d={id:"graph-frame",components:t,growth:ct.STRETCH,renderType:b(n,"graphFrameRenderType")||et.SVG},h=b(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let f=At.COLUMN;if(h){const v=b(r,"legend","position");v==="left"?(f=At.ROW,r.legend.orientation||(r.legend.orientation=Wr.VERTICAL)):v==="right"?(f=At.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=Wr.VERTICAL)):v==="bottom"&&(f=At.COLUMN_REVERSE)}const p={id:"spacer",components:[new wn(this.model,this.services)],growth:ct.PREFERRED},g={id:"full-frame",components:[new ae(this.model,this.services,[...h?[s]:[],...h?[p]:[],d],{direction:f})],growth:ct.STRETCH},m=[];if(o||i){m.push(u);const v={id:"spacer",components:[new wn(this.model,this.services,i?{size:15}:void 0)],growth:ct.PREFERRED};m.push(v)}return m.push(g),[new Iu(this.model,this.services),new po(this.model,this.services),new ae(this.model,this.services,m,{direction:At.COLUMN})]}}class hr 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:b(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(),{number:l,code:c}=b(this.getOptions(),"locale"),u=["Group",i.label,s.label,...a?[a.label]:[],...o?[o.label]:[]],d=t.map(h=>[h[r],h[i.identifier]===null?"&ndash;":h[i.identifier],h[s.identifier]===null||isNaN(h[s.identifier])?"&ndash;":l(h[s.identifier],c),...a?[h[a.identifier]===null?"&ndash;":h[a.identifier]]:[],...o?[h[o.identifier]===null||isNaN(h[o.identifier])?"&ndash;":h[o.identifier]]:[]]);return super.formatTable({headers:u,cells:d})}setData(t){let n;if(t&&(n=super.setData(t),b(this.getOptions(),"zoomBar",G.TOP,"enabled"))){const r=b(this.getOptions(),"zoomBar",G.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(En(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(G).forEach(i=>{const s=G[i],a=n.axes[s];if(a&&a.scaleType===J.TIME){const o=a.mapsTo;(o!==null||o!==void 0)&&r.push(o)}}),r.length>0&&t.forEach(i=>{r.forEach(s=>{b(i,s,"getTime")===null&&(i[s]=new Date(i[s]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}}class Y2 extends hr{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=b(this.getOptions(),"locale");t.sort((a,o)=>a.source.localeCompare(o.source));const i=["Source","Target","Value"],s=[...t.map(a=>[a.source,a.target,a.value===null?"&ndash;":n(a.value,r)])];return super.formatTable({headers:i,cells:s})}}function dv(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 q2(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 ku(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 X2(e){return e.depth}function j2(e,t){return t-1-e.height}function fv(e,t){return e.sourceLinks.length?e.depth:t-1}function mo(e){return function(){return e}}function pv(e,t){return vo(e.source,t.source)||e.index-t.index}function gv(e,t){return vo(e.target,t.target)||e.index-t.index}function vo(e,t){return e.y0-t.y0}function Pu(e){return e.value}function Z2(e){return e.index}function K2(e){return e.nodes}function Q2(e){return e.links}function mv(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function vv({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 J2(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=Z2,l=fv,c,u,d=K2,h=Q2,f=6;function p(){const w={nodes:d.apply(null,arguments),links:h.apply(null,arguments)};return g(w),m(w),v(w),E(w),S(w),vv(w),w}p.update=function(w){return vv(w),w},p.nodeId=function(w){return arguments.length?(o=typeof w=="function"?w:mo(w),p):o},p.nodeAlign=function(w){return arguments.length?(l=typeof w=="function"?w:mo(w),p):l},p.nodeSort=function(w){return arguments.length?(c=w,p):c},p.nodeWidth=function(w){return arguments.length?(i=+w,p):i},p.nodePadding=function(w){return arguments.length?(s=a=+w,p):s},p.nodes=function(w){return arguments.length?(d=typeof w=="function"?w:mo(w),p):d},p.links=function(w){return arguments.length?(h=typeof w=="function"?w:mo(w),p):h},p.linkSort=function(w){return arguments.length?(u=w,p):u},p.size=function(w){return arguments.length?(e=t=0,n=+w[0],r=+w[1],p):[n-e,r-t]},p.extent=function(w){return arguments.length?(e=+w[0][0],n=+w[1][0],t=+w[0][1],r=+w[1][1],p):[[e,t],[n,r]]},p.iterations=function(w){return arguments.length?(f=+w,p):f};function g({nodes:w,links:U}){for(const[N,F]of w.entries())F.index=N,F.sourceLinks=[],F.targetLinks=[];const $=new Map(w.map((N,F)=>[o(N,F,w),N]));for(const[N,F]of U.entries()){F.index=N;let{source:Y,target:Z}=F;typeof Y!="object"&&(Y=F.source=mv($,Y)),typeof Z!="object"&&(Z=F.target=mv($,Z)),Y.sourceLinks.push(F),Z.targetLinks.push(F)}if(u!=null)for(const{sourceLinks:N,targetLinks:F}of w)N.sort(u),F.sort(u)}function m({nodes:w}){for(const U of w)U.value=U.fixedValue===void 0?Math.max(ku(U.sourceLinks,Pu),ku(U.targetLinks,Pu)):U.fixedValue}function v({nodes:w}){const U=w.length;let $=new Set(w),N=new Set,F=0;for(;$.size;){for(const Y of $){Y.depth=F;for(const{target:Z}of Y.sourceLinks)N.add(Z)}if(++F>U)throw new Error("circular link");$=N,N=new Set}}function E({nodes:w}){const U=w.length;let $=new Set(w),N=new Set,F=0;for(;$.size;){for(const Y of $){Y.height=F;for(const{source:Z}of Y.targetLinks)N.add(Z)}if(++F>U)throw new Error("circular link");$=N,N=new Set}}function y({nodes:w}){const U=dv(w,F=>F.depth)+1,$=(n-e-i)/(U-1),N=new Array(U);for(const F of w){const Y=Math.max(0,Math.min(U-1,Math.floor(l.call(null,F,U))));F.layer=Y,F.x0=e+Y*$,F.x1=F.x0+i,N[Y]?N[Y].push(F):N[Y]=[F]}if(c)for(const F of N)F.sort(c);return N}function x(w){const U=q2(w,$=>(r-t-($.length-1)*a)/ku($,Pu));for(const $ of w){let N=t;for(const F of $){F.y0=N,F.y1=N+F.value*U,N=F.y1+a;for(const Y of F.sourceLinks)Y.width=Y.value*U}N=(r-N+a)/($.length+1);for(let F=0;F<$.length;++F){const Y=$[F];Y.y0+=N*(F+1),Y.y1+=N*(F+1)}H($)}}function S(w){const U=y(w);a=Math.min(s,(r-t)/(dv(U,$=>$.length)-1)),x(U);for(let $=0;$<f;++$){const N=Math.pow(.99,$),F=Math.max(1-N,($+1)/f);C(U,N,F),_(U,N,F)}}function _(w,U,$){for(let N=1,F=w.length;N<F;++N){const Y=w[N];for(const Z of Y){let K=0,dt=0;for(const{source:ft,value:j}of Z.targetLinks){let nt=j*(Z.layer-ft.layer);K+=P(ft,Z)*nt,dt+=nt}if(!(dt>0))continue;let it=(K/dt-Z.y0)*U;Z.y0+=it,Z.y1+=it,O(Z)}c===void 0&&Y.sort(vo),L(Y,$)}}function C(w,U,$){for(let N=w.length,F=N-2;F>=0;--F){const Y=w[F];for(const Z of Y){let K=0,dt=0;for(const{target:ft,value:j}of Z.sourceLinks){let nt=j*(ft.layer-Z.layer);K+=M(Z,ft)*nt,dt+=nt}if(!(dt>0))continue;let it=(K/dt-Z.y0)*U;Z.y0+=it,Z.y1+=it,O(Z)}c===void 0&&Y.sort(vo),L(Y,$)}}function L(w,U){const $=w.length>>1,N=w[$];D(w,N.y0-a,$-1,U),B(w,N.y1+a,$+1,U),D(w,r,w.length-1,U),B(w,t,0,U)}function B(w,U,$,N){for(;$<w.length;++$){const F=w[$],Y=(U-F.y0)*N;Y>1e-6&&(F.y0+=Y,F.y1+=Y),U=F.y1+a}}function D(w,U,$,N){for(;$>=0;--$){const F=w[$],Y=(F.y1-U)*N;Y>1e-6&&(F.y0-=Y,F.y1-=Y),U=F.y0-a}}function O({sourceLinks:w,targetLinks:U}){if(u===void 0){for(const{source:{sourceLinks:$}}of U)$.sort(gv);for(const{target:{targetLinks:$}}of w)$.sort(pv)}}function H(w){if(u===void 0)for(const{sourceLinks:U,targetLinks:$}of w)U.sort(gv),$.sort(pv)}function P(w,U){let $=w.y0-(w.sourceLinks.length-1)*a/2;for(const{target:N,width:F}of w.sourceLinks){if(N===U)break;$+=F+a}for(const{source:N,width:F}of U.targetLinks){if(N===w)break;$-=F}return $}function M(w,U){let $=U.y0-(U.targetLinks.length-1)*a/2;for(const{source:N,width:F}of U.targetLinks){if(N===w)break;$+=F+a}for(const{target:N,width:F}of w.sourceLinks){if(N===U)break;$-=F}return $}return p}var Nu=Math.PI,$u=2*Nu,dr=1e-6,tP=$u-dr;function Fu(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function yv(){return new Fu}Fu.prototype=yv.prototype={constructor:Fu,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>dr)if(!(Math.abs(u*o-l*c)>dr)||!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,m=Math.sqrt(p),v=Math.sqrt(d),E=i*Math.tan((Nu-Math.acos((p+d-g)/(2*m*v)))/2),y=E/v,x=E/m;Math.abs(y-1)>dr&&(this._+="L"+(e+y*c)+","+(t+y*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>c*f)+","+(this._x1=e+x*o)+","+(this._y1=t+x*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)>dr||Math.abs(this._y1-c)>dr)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%$u+$u),d>tP?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>dr&&(this._+="A"+n+","+n+",0,"+ +(d>=Nu)+","+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 Ev(e){return function(){return e}}function eP(e){return e[0]}function nP(e){return e[1]}var rP=Array.prototype.slice;function iP(e){return e.source}function sP(e){return e.target}function aP(e){var t=iP,n=sP,r=eP,i=nP,s=null;function a(){var o,l=rP.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=yv()),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:Ev(+o),a):r},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:Ev(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function oP(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function lP(){return aP(oP)}function cP(e){return[e.source.x1,e.y0]}function uP(e){return[e.target.x0,e.y1]}function hP(){return lP().source(cP).target(uP)}class dP extends gt{constructor(){super(...arguments),this.type="alluvial",this.renderType=et.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}=R.getSVGElementSize(n,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=b(this.getOptions(),"color","gradient","enabled");let l=Ve.minNodePadding;s.alluvial.nodePadding>Ve.minNodePadding&&(l=s.alluvial.nodePadding);const c=b(s,"alluvial","nodeAlignment");let u=fv;c===Ht.LEFT?u=X2:c===Ht.RIGHT&&(u=j2);const d=J2().nodeId(y=>y.name).nodeWidth(Ve.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=d({nodes:s.alluvial.nodes.map(y=>Object.assign({},y)),links:a.map(y=>Object.assign({},y))}),this.graph.nodes=this.graph.nodes.filter(y=>y.value!==0);const h={};this.graph.nodes.forEach(y=>{const x=y.x0;y.category&&(h[x]=y==null?void 0:y.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(h)).join("g").attr("transform",y=>`translate(${y}, 0)`).append("text").attr("id",(y,x)=>this.services.domUtils.generateElementIDString(`alluvial-category-${x}`)).style("font-size","14px").text(y=>h[y]?h[y]:"").attr("y",20).attr("x",(y,x)=>{const S=this.services.domUtils.generateElementIDString(`alluvial-category-${x}`),{width:_}=R.getSVGElementSize(I(`text#${S}`),{useBBox:!0});let C=0;return y+C>=_&&(C=-_+4),C});const p=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(p.exit().remove(),o){const y=b(this.getOptions(),"color","scale");y&&p.enter().append("linearGradient").attr("id",x=>`${this.gradient_id}-link-${x.index}`).attr("gradientUnits","userSpaceOnUse").call(x=>x.append("stop").attr("offset","0%").attr("stop-color",S=>y[S.source.name])).call(x=>x.append("stop").attr("offset","100%").attr("stop-color",S=>y[S.target.name])),p.exit().remove()}p.enter().append("path").classed("link",!0).attr("d",hP()).attr("id",y=>this.services.domUtils.generateElementIDString(`alluvial-line-${y.index}`)).attr("class",y=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[at.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[at.STROKE],dataGroupName:y.source.index,originalClassName:"link"})).style("stroke",y=>o?`url(#${this.gradient_id}-link-${y.index})`:this.model.getFillColor(y.source.name,null,{...y,source:y.source.name,target:y.target.name})).attr("stroke-width",y=>Math.max(1,y.width)).style("stroke-opacity",Ve.opacity.default).attr("aria-label",y=>`${y.source.name} → ${y.target.name} (${y.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const g=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",y=>this.services.domUtils.generateElementIDString(`alluvial-node-${y.index}`)).classed("node-group",!0).attr("transform",y=>`translate(${y.x0}, ${y.y0})`);g.append("rect").classed("node",!0).attr("height",y=>y.y1-y.y0).attr("width",y=>y.x1-y.x0).attr("fill","black");const m=g.append("g").attr("id",y=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${y.index}`)),{code:v,number:E}=b(s,"locale");m.append("text").attr("id",y=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${y.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(y=>`${y.name} (${E(y.value,v)})`).attr("aria-label",y=>`${y.name} (${y.value})`),m.append("rect").classed("node-text-bg",!0).attr("width",(y,x)=>{const S=this.services.domUtils.generateElementIDString(`alluvial-node-text-${x}`),{width:_}=R.getSVGElementSize(I(`text#${S}`),{useBBox:!0});return _+8}).attr("height",18).attr("stroke-width",2).lower(),m.attr("transform",(y,x)=>{const S=this.services.domUtils.generateElementIDString(`alluvial-node-text-${x}`),{width:_}=R.getSVGElementSize(I(`text#${S}`),{useBBox:!0}),C=(y.y1-y.y0)/2-9;let L=y.x1-y.x0;return y.x1>=_?L=L-(_+16):L+=4,`translate(${L}, ${C})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,{number:r,code:i}=b(this.getOptions(),"locale"),s=Va((a,o="mouseover")=>{const l=n.parent.selectAll("path.link").transition().call(c=>n.services.transitions.setupTransition({transition:c,name:"alluvial-links-mouse-highlight"}));o==="mouseout"?(I(a).lower(),l.style("stroke-opacity",Ve.opacity.default)):l.style("stroke-opacity",function(){return a===this?(I(this).raise(),Ve.opacity.selected):Ve.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(a,o){const l=I(this);s(this,"mouseover"),l.classed("link-hovered",!0);const c=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEOVER,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:o.target.name,value:(r(o.value,i)?`${r(o.value,i)}`:"-")+(t.alluvial.units?` ${t.alluvial.units}`:""),color:c,labelIcon:n.getRightArrowIcon()}]})}).on("mousemove",function(a,o){n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEMOVE,{event:a,element:I(this),datum:o}),n.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("click",function(a,o){n.services.events.dispatchEvent(T.Alluvial.LINE_CLICK,{event:a,element:I(this),datum:o})}).on("mouseout",function(a,o){const l=I(this);s(this,"mouseout"),l.classed("link-hovered",!1),n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEOUT,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(T.Tooltip.HIDE,{event:a,hoveredElement:l})})}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)?(I(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=I(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:I(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:I(this),datum:i})}).on("mouseout",function(r,i){const s=I(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`
74
74
  <svg xmlns="http://www.w3.org/2000/svg" class="arrow-right" width="32" height="32" viewBox="0 0 32 32">
75
75
  <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"/>
76
76
  <rect width="32" height="32"/>
77
- </svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class KP extends qe{constructor(t,n){super(t,n),this.model=new DP(this.services),this.model.setOptions(Pt(Ct.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new ZP(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}const ri=class ri extends pt{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=R.appendOrSelect(n,"svg.chart-grid-backdrop"),s=R.appendOrSelect(i,`g.${this.type}`),a=R.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=R.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=R.appendOrSelect(r,this.frontSelectionSelector);if(d&&u===Q.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 _=S[1]-S[0];let A="0,"+_.toString();const L=Math.floor(l/ri.DASH_LENGTH),B=L*ri.DASH_LENGTH;for(let D=0;D<L;D++)A+=","+ri.DASH_LENGTH;A+=","+(l-B),L%2===1&&(A+=",0"),A+=","+_.toString(),A+=","+l.toString(),f.attr("stroke-dasharray",A)},m=S=>{const _=S.selection;_===null||_[0]===_[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(_))},v=(S,_)=>{const A=Uf().range([0,o]).domain(p);let L=[A.invert(S),A.invert(_)];L[0].valueOf()===L[1].valueOf()&&(L=this.services.zoom.getDefaultZoomBarDomain()),(p[0].valueOf()!==L[0].valueOf()||p[1].valueOf()!==L[1].valueOf())&&this.services.zoom.handleDomainChange(L)};let E;const y=S=>{const _=S.selection;_!==null&&(v(_[0],_[1]),s.call(E.move,null),f.style("display","none"))};l!=0&&o!=0&&(E=ed().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",y),s.call(E));const x=this.services.zoom.getZoomRatio();i.on("click",function(S){if(S.shiftKey){const _=this.services.domUtils.getHolder(),A=Bn(s.node(),_)[0];let L=A-o*x/2;L<0&&(L=0);let B=A+o*x/2;B>o&&(B=o),v(L,B)}})}}};ri.DASH_LENGTH=4;let Uu=ri;class QP extends pt{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=b(this.getOptions(),"zoomBar",G.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer(),r=this.services.zoom.isZoomBarLoading(G.TOP),i=this.services.zoom.isZoomBarLocked(G.TOP),s=b(this.getOptions(),"zoomBar",G.TOP,"type"),a=b(this.getOptions(),"axes",G.BOTTOM,"highlights"),o=be.height[s],{width:l}=R.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=R.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(R.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",be.spacerHeight).attr("opacity",1).attr("fill","none"),s===Ge.GRAPH_VIEW?R.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&&R.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===Q.TIME){let m=this.services.zoom.getZoomBarData();if(He(m)||m.length===1)return;this.xScale=f.copy(),this.yScale=p.copy();const v=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,v);const E=this.model.get("initialZoomDomain"),y=b(this.getOptions(),"zoomBar",G.TOP,"initialZoomDomain");y&&y[0]&&y[1]&&(y[0]=new Date(y[0]),y[1]=new Date(y[1])),y&&!(E&&E[0].valueOf()===y[0].valueOf()&&E[1].valueOf()===y[1].valueOf())?this.model.set({initialZoomDomain:lt([],y),zoomDomain:y?lt([],y):v},{skipUpdate:!0}):y===null&&E!==null&&this.model.set({initialZoomDomain:null,zoomDomain:lt([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Ie(m,_=>_.value));const x=this.model.get("zoomDomain");if(s===Ge.GRAPH_VIEW&&(this.renderZoomBarArea(d,"path.zoom-graph-area-unselected",m,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(d,"path.zoom-graph-area",m,this.clipId),this.renderZoomBarBaseline(d,c,l),a)){const _=a.highlightStartMapsTo,A=a.highlightEndMapsTo,L=a.color,B=a.labelMapsTo;a.data.forEach((D,O)=>{R.appendOrSelect(d,`rect.highlight-${O}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(D[_])).attr("width",this.xScale(D[A])-this.xScale(D[_])).style("fill",L&&L.scale[D[B]]?L.scale[D[B]]:null).style("fill-opacity",.1).style("stroke",L&&L.scale[D[B]]?L.scale[D[B]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(x,c,l);const S=R.appendOrSelect(n,this.brushSelector).call(this.brush);if(x!==void 0)if(x[0].valueOf()===x[1].valueOf())S.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const _=x.map(A=>this.xScale(A));_[1]-_[0]<this.MIN_SELECTION_DIFF||(S.call(this.brush.move,_),this.updateBrushHandle(this.getComponentContainer(),_))}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=b(this.getOptions(),"zoomBar",G.TOP,"type"),a=be.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=be.handleWidth,s=b(this.getOptions(),"zoomBar",G.TOP,"type"),a=be.height[s],o=-i/2,l=be.handleBarWidth,c=s===Ge.GRAPH_VIEW?be.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=b(this.getOptions(),"zoomBar",G.TOP,"type"),r=be.height[n],s=this.getComponentContainer().select("svg.zoom-container");R.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=(v,E,y)=>x=>s.getValueFromScale(v,E,y,x),d=u(this.xScale,l,a),h=u(this.yScale,c,o),f=b(this.getOptions(),"zoomBar",G.TOP,"type"),p=be.height[f],g=Zl().x(v=>d(v)).y0(p).y1(v=>p-h(v)),m=R.appendOrSelect(t,n).datum(r).attr("d",g);i&&m.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=R.appendOrSelect(t,"clipPath").attr("id",n);R.appendOrSelect(o,"rect").attr("x",r).attr("y",i).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const r=yn(t),i=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(r[0][i])){const a={};a[i]=n[0],a[s]=0,r.unshift(a)}if(Number(n[1])>Number(r[r.length-1][i])){const a={};a[i]=n[1],a[s]=0,r.push(a)}return r}renderZoomBarBaseline(t,n,r,i=!1){const s=b(this.model.getOptions(),"zoomBar",G.TOP,"type"),a=be.height[s],o=Bi()([[n,a],[r,a]]);R.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),R.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),b(this.getOptions(),"zoomBar",G.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 JP extends pt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=tt.SVG,this.positionService=new go}render(t=!1){const n=b(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(G).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,m=null;h===G.LEFT||h===G.RIGHT?(m=f,g=d.services.cartesianScales.getMainXScale()):(g=f,m=d.services.cartesianScales.getMainYScale());const v=p===Q.LABELS,[E,y]=g.range(),[x,S]=m.range(),{cartesianScales:_}=d.services,A=_.getOrientation(),L=P=>_.getDomainValue(P),B=P=>_.getRangeValue(P),[D,O]=_n(L,B,A),H=I(this);h===G.TOP||h===G.BOTTOM?(H.selectAll("line.threshold-line").transition().call(P=>d.services.transitions.setupTransition({transition:P,name:"threshold-line-update",animate:t})).attr("y1",S).attr("y2",x).attr("x1",({datum:P})=>D(P)+(v?f.step()/2:0)).attr("x2",({datum:P})=>D(P)+(v?f.step()/2:0)).style("stroke",({fillColor:P})=>P),H.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:P})=>-D(P)).attr("width",Math.abs(x-S)).classed("rotate",!0)):(H.selectAll("line.threshold-line").transition().call(P=>d.services.transitions.setupTransition({transition:P,name:"threshold-line-update",animate:t})).attr("x1",E).attr("x2",y).attr("y1",({datum:P})=>O(P)+(v?f.step()/2:0)).attr("y2",({datum:P})=>O(P)+(v?f.step()/2:0)).style("stroke",({fillColor:P})=>P),H.selectAll("rect.threshold-hoverable-area").attr("x",E).attr("y",({datum:P})=>O(P)).attr("width",Math.abs(y-E)).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(),s=this.services.cartesianScales.getScaleTypeByPosition(r),{code:a,number:o}=b(i,"locale");if(s===Q.TIME){const l=[G.LEFT,G.RIGHT].includes(r),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=b(i,"timeScale"),f=ru(d.ticks(),b(h,"timeInterval"));return nu(n,0,d.ticks(),f,h,i.locale)}return o(n,a)}appendThresholdLabel(){const t=I(this.services.domUtils.getHolder()),n=b(this.getOptions(),"style","prefix");this.label=R.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(sn(`${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,[Ut.RIGHT,Ut.LEFT,Ut.TOP,Ut.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=b(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){I(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(T.Threshold.SHOW,{event:r,hoveredElement:I(this),datum:I(this).datum()})}).on("mouseout",function(r){I(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(T.Threshold.HIDE,{event:r,hoveredElement:I(this),datum:I(this).datum()})})}}class tN extends pt{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=b(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(G).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,m]=f.range(),[v,E]=p.range(),{cartesianScales:y}=d.services,x=y.getOrientation(),S=D=>y.getDomainValue(D),_=D=>y.getRangeValue(D),[A,L]=_n(S,_,x),B=I(this);h===G.TOP||h===G.BOTTOM?B.selectAll("rect.highlight-bar").transition().call(D=>d.services.transitions.setupTransition({transition:D,name:"highlight-bar-update",animate:t})).attr("y",Math.max(E+d.highlightStrokeWidth,0)).attr("height",Math.max(v-2*d.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:D,...O})=>A(O[D])).attr("width",({highlightStartMapsTo:D,highlightEndMapsTo:O,...H})=>Math.max(A(H[O])-A(H[D]),0)).style("stroke",({color:D,labelMapsTo:O,...H})=>D&&D.scale[H[O]]?D.scale[H[O]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:D,labelMapsTo:O,...H})=>D&&D.scale[H[O]]?D.scale[H[O]]:null):B.selectAll("rect.highlight-bar").transition().call(D=>d.services.transitions.setupTransition({transition:D,name:"highlight-bar-update",animate:t})).attr("x",g).attr("width",Math.max(m-g,0)).attr("y",({highlightEndMapsTo:D,...O})=>L(O[D])).attr("height",({highlightStartMapsTo:D,highlightEndMapsTo:O,...H})=>Math.max(L(H[D])-L(H[O]),0)).style("stroke",({color:D,labelMapsTo:O,...H})=>D&&D.scale[H[O]]?D.scale[H[O]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:D,labelMapsTo:O,...H})=>D&&D.scale[H[O]]?D.scale[H[O]]:null)})}}class xv extends Iu{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:yt(r,"locale.translations.group")||yt(r,"tooltip.groupLabel"),value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[it.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:[it.TOOLTIP],dataGroupName:h[o]})}}).sort((h,f)=>f.value-h.value)),!a&&b(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[h],0),bold:!0})}return d}}function vs(e,t){const n=bt(e),r=bt(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function eN(e,t){const n=bt(e),r=bt(t);return n.getFullYear()-r.getFullYear()}function nN(e,t){const n=bt(e),r=bt(t),i=vs(n,r),s=Math.abs(eN(n,r));n.setFullYear(1584),r.setFullYear(1584);const a=vs(n,r)===-i,o=i*(s-+a);return o===0?0:o}function Bu(e,t){const n=bt(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 _v(e,t){return Bu(e,t*12)}function rN(e,t){return _v(e,-t)}function iN(e,t){const n=bt(e),r=bt(t),i=n.getFullYear()-r.getFullYear(),s=n.getMonth()-r.getMonth();return i*12+s}function sN(e){const t=bt(e);return t.setHours(23,59,59,999),t}function aN(e){const t=bt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function oN(e){const t=bt(e);return+sN(t)==+aN(t)}function lN(e,t){const n=bt(e),r=bt(t),i=vs(n,r),s=Math.abs(iN(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=vs(n,r)===-i;oN(bt(e))&&s===1&&vs(e,r)===1&&(o=!1),a=i*(s-Number(o))}return a===0?0:a}function cN(e,t){return Bu(e,-t)}function uN(e,t){const n=bt(e),r=bt(t),i=Sv(n,r),s=Math.abs(mm(n,r));n.setDate(n.getDate()-i*s);const a=+(Sv(n,r)===-i),o=i*(s-a);return o===0?0:o}function Sv(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 Tv(e,t){const n=bt(e);return isNaN(t)?ze(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function hN(e,t){return Tv(e,-t)}function Hu(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function Gu(e,t){return+bt(e)-+bt(t)}function dN(e,t,n){const r=Gu(e,t)/fm;return Hu(n==null?void 0:n.roundingMethod)(r)}function Vu(e,t){const n=+bt(e);return ze(e,n+t)}function Ov(e,t){return Vu(e,t*fm)}function fN(e,t){return Ov(e,-t)}function wv(e,t,n){const r=Gu(e,t)/dm;return Hu(n==null?void 0:n.roundingMethod)(r)}function zu(e,t){return Vu(e,t*dm)}function Mv(e,t){return zu(e,-t)}function Av(e,t,n){const r=Gu(e,t)/1e3;return Hu(n==null?void 0:n.roundingMethod)(r)}function Wu(e,t){return Vu(e,t*1e3)}function Cv(e,t){return Wu(e,-t)}class pN extends Tn{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=b(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=b(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 b(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===G.BOTTOM||t===G.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(G).map(n=>G[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===G.LEFT||this.rangeAxisPosition===G.RIGHT)&&(this.domainAxisPosition===G.BOTTOM||this.domainAxisPosition===G.TOP)?this.orientation=Bt.VERTICAL:this.orientation=Bt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var r,i,s,a;const t=this.model.getOptions(),n=b(t,"axes");((r=n[G.LEFT])!=null&&r.correspondingDatasets&&n[G.RIGHT]||(i=n[G.RIGHT])!=null&&i.correspondingDatasets&&n[G.LEFT]||(s=n[G.TOP])!=null&&s.correspondingDatasets&&n[G.BOTTOM]||(a=n[G.BOTTOM])!=null&&a.correspondingDatasets&&n[G.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=b(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]===Q.LINEAR||this.scaleTypes[t]===Q.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=[G.BOTTOM,G.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[G.LEFT,G.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=b(s,"axes")[r],{mapsTo:l}=o,c=b(i,l)!==null?i[l]:i;let u;switch(n){case Q.LABELS:u=t(c)+t.step()/2;break;case Q.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=b(s,"axes")[r],{mapsTo:l}=o,c=t[l]!==void 0?t[l]:t;return[i(b(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:c),i(b(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 b(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return b(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=b(r,"axes",t);if(i.scaleType===Q.TIME){const s=b(r,"timeScale","addSpaceOnEdges");return gN(n,s)}else return mN(n,Rn.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=b(t,"axes"),r=this.isDualAxes();return b(n,G.LEFT)===null&&b(n,G.RIGHT)!==null||b(n,G.RIGHT,"main")===!0||r&&b(n,G.LEFT,"correspondingDatasets")?{primary:G.RIGHT,secondary:G.LEFT}:{primary:G.LEFT,secondary:G.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=b(t,"axes"),r=this.isDualAxes();return b(n,G.BOTTOM)===null&&b(n,G.TOP)!==null||b(n,G.TOP,"main")===!0||r&&b(n,G.BOTTOM,"correspondingDatasets")?{primary:G.TOP,secondary:G.BOTTOM}:{primary:G.BOTTOM,secondary:G.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=b(r,"axes",t.primary),s=b(r,"axes",n.primary),a=i.scaleType||Q.LINEAR,o=s.scaleType||Q.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===Q.LABELS||o===Q.TIME)&&a===Q.LABELS||a===Q.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=b(n,"axes",t),i=b(n,"bounds"),{includeZero:s}=r,a=b(r,"scaleType")||Q.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:v}=this.model.getBinConfigurations();return[0,Un(v,E=>E.length)]}else if(r.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),E=this.model.getStackKeys({bins:v});return[E[0].split(":")[0],E[E.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:f}=Rn.ratio;if(r.domain)return a===Q.LABELS?r.domain:(a===Q.TIME&&(r.domain=r.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===Q.LABELS)return Qi(o.map(v=>v[c]));let p,g;const m=this.model.getDataGroupNames();if(a===Q.LABELS_RATIO)return o.map(v=>`${v[h]}/${v[f]}`);if(a===Q.TIME)g=o.map(v=>+new Date(v[c]));else if(i&&n.axes)g=[],o.forEach(v=>{g.push(v[c]),v[i.upperBoundMapsTo]&&g.push(v[i.upperBoundMapsTo]),v[i.lowerBoundMapsTo]&&g.push(v[i.lowerBoundMapsTo])});else if(r.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:v}=n.data,E=this.model.getDataValuesGroupedByKeys({groups:m}),y=o.filter(S=>!m.includes(S[v])),x=[];E.forEach(S=>{const{..._}=S;let A=0,L=0;Object.values(_).forEach(B=>{isNaN(B)||(B<0?L+=B:A+=B)}),x.push([L,A])}),g=[...Pp(x),...y.map(S=>S[c])]}else g=[],o.forEach(v=>{const E=v[c];Array.isArray(E)&&E.length===2?(g.push(E[0]),g.push(E[1])):(l&&g.push(Math.max(v[c],v[l])),g.push(E))});return a!==Q.TIME&&a!==Q.LOG&&s&&g.push(0),d&&d.length>0&&d.forEach(v=>{const E=b(v,"value");E!==null&&g.push(E)}),p=Ie(g),p=this.extendsDomain(t,p),p}createScale(t){const n=this.model.getOptions(),r=b(n,"axes",t);if(!r)return null;const i=b(r,"scaleType")||Q.LINEAR;this.scaleTypes[t]=i;let s;return i===Q.TIME?s=Uf():i===Q.LOG?s=bf().base(r.base||10):i===Q.LABELS||i===Q.LABELS_RATIO?s=Ii():s=Fe(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,r=0;return this.getOrientation()===Bt.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),b(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(r=n[0]),r}getHighestDomainThreshold(){const t=b(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)===Q.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=b(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 gN(e,t){const n=new Date(e[0]),r=new Date(e[1]);return nN(r,n)>1?[rN(n,t),_v(r,t)]:lN(r,n)>1?[cN(n,t),Bu(r,t)]:uN(r,n)>1?[hN(n,t),Tv(r,t)]:dN(r,n)>1?[fN(n,t),Ov(r,t)]:wv(r,n)>30?[Mv(n,t*30),zu(r,t*30)]:wv(r,n)>1?[Mv(n,t),zu(r,t)]:Av(r,n)>15?[Cv(n,t*15),Wu(r,t*15)]:Av(r,n)>1?[Cv(n,t),Wu(r,t)]:[n,r]}function mN([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===Q.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 vN extends Tn{constructor(){super(...arguments),this.curveTypes={curveLinear:Sa,curveLinearClosed:Qf,curveBasis:OT,curveBasisClosed:wT,curveBasisOpen:MT,curveBundle:AT,curveCardinal:CT,curveCardinalClosed:DT,curveCardinalOpen:LT,curveCatmullRom:RT,curveCatmullRomClosed:IT,curveCatmullRomOpen:kT,curveMonotoneX:PT,curveMonotoneY:NT,curveNatural:$T,curveStep:FT,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 yN extends Tn{isZoomBarEnabled(){if(!this.services.cartesianScales||!b(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=b(this.model.getOptions(),"axes",t,"scaleType");return t===G.BOTTOM&&n===Q.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=b(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 b(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var a;const r=this.model.get("zoomDomain"),i=Object.assign({stacked:!1},n),s=b(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=be.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=b(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 b(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return b(this.model.getOptions(),"zoomBar",t,"locked")}}class de extends qe{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:pN,curves:vN,zoom:yN}),this.model=new ur(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=b(r,"zoomBar",G.TOP,"enabled"),s=b(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=b(r,"axes",a,"scaleType"),l=i&&a===G.BOTTOM&&o===Q.TIME,c=this.services.zoom.isZoomBarLocked(G.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new gs(this.model,this.services)],growth:ct.STRETCH},h={id:"toolbar",components:[new Kr(this.model,this.services)],growth:ct.PREFERRED},f={id:"header",components:[new ae(this.model,this.services,[d,...s?[h]:[]],{direction:At.ROW,alignItems:ir.CENTER})],growth:ct.PREFERRED},p={id:"legend",components:[new Ru(this.model,this.services)],growth:ct.PREFERRED};l&&!c&&t.push(new uv(this.model,this.services),new Uu(this.model,this.services)),t.push(new JP(this.model,this.services)),t.push(new tN(this.model,this.services));const g={id:"graph-frame",components:t,growth:ct.STRETCH,renderType:tt.SVG},m=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=At.COLUMN;if(m){const _=b(this.model.getOptions(),"legend","position");_===zr.LEFT?(v=At.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Wr.VERTICAL)):_===zr.RIGHT?(v=At.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Wr.VERTICAL)):_===zr.BOTTOM&&(v=At.COLUMN_REVERSE)}const E={id:"spacer",components:[new On(this.model,this.services)],growth:ct.PREFERRED},y={id:"full-frame",components:[new ae(this.model,this.services,[...m?[p]:[],...m?[E]:[],g],{direction:v})],growth:ct.STRETCH},x={id:"zoom-bar",components:[new QP(this.model,this.services)],growth:ct.PREFERRED,renderType:tt.SVG},S=[];if(u||s){S.push(f);const _={id:"spacer",components:[new On(this.model,this.services,s?{size:15}:void 0)],growth:ct.PREFERRED};S.push(_)}return l&&S.push(x),S.push(y),[new xv(this.model,this.services),new po(this.model,this.services),new ae(this.model,this.services,S,{direction:At.COLUMN})]}}class Te extends pt{constructor(){super(...arguments),this.type="grid",this.renderType=tt.SVG}render(t=!0){const n=b(this.getOptions(),"grid","x","enabled"),r=b(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(R.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(R.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,r=this.backdrop.attr("height"),i=this.services.cartesianScales.getMainXScale(),s=Lo(i).tickSizeInner(-r).tickSizeOuter(0);if(b(this.getOptions(),"grid","x","alignWithAxisTicks")){const l=this.services.cartesianScales.getDomainAxisPosition(),c=b(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=b(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(b(this.getOptions(),"grid","y","alignWithAxisTicks")){const l=this.services.cartesianScales.getRangeAxisPosition(),c=b(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=b(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=R.getSVGElementSize(u).width-+xn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=b(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=R.appendOrSelect(r,"svg.chart-grid-backdrop");const u=R.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 Dv extends pt{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?En.opacity.unselected:En.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",En.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(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=Zl().curve(this.services.curves.getD3Curve()).defined(S=>{const _=s.getRangeIdentifier(),A=S[_];return A!=null}),l=this.model.getGroupedData(this.configs.groups),c=b(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(r,"axes",S,"includeZero")===!1&&_[0]>0&&_[1]>0&&(d=_[0])},f=S=>u?s.getBoundedScaledValues(S)[0]:s.getRangeValue(d),p=S=>u?s.getBoundedScaledValues(S)[1]:s.getRangeValue(S);a===Bt.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=b(r,"color","gradient","enabled"),m=l&&l.length===1&&g;l.length>1&&g&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(l,S=>S.name),E=I(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!l.length)return;if(m){const S=E.select(`path.${this.model.getColorClassName({classNameTypes:[it.STROKE],dataGroupName:l[0].name})}`).node();let _;if(S)_=getComputedStyle(S,null).getPropertyValue("stroke");else{const A=b(this.model.getOptions(),"color","scale");if(A!==null){const L=Object.keys(A);_=A[L[0]]}}ms.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:ms.getStops(i,_)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const y=this,x=v.enter().append("path");m?x.merge(v).style("fill",S=>`url(#${this.services.domUtils.generateElementIDString(`${S.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",S=>this.model.getColorClassName({classNameTypes:[it.FILL],dataGroupName:S.name,originalClassName:"area"})).attr("d",S=>{const{data:_}=S;return o(_)}):(x.attr("opacity",0).merge(v).attr("class","area").attr("class",S=>this.model.getColorClassName({classNameTypes:[it.FILL,it.STROKE],dataGroupName:S.name,originalClassName:"area"})).style("fill",S=>y.model.getFillColor(S.name,null,S.data)).transition().call(S=>this.services.transitions.setupTransition({transition:S,name:"area-update-enter",animate:t})).attr("opacity",u?1:En.opacity.selected).attr("d",S=>{const{data:_}=S;return o(_)}),u&&x.attr("fill-opacity",En.opacity.selected).style("stroke",S=>y.model.getStrokeColor(S.name,null,S.data)).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 pt{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?bn.opacity.unselected:bn.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",bn.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]=_n(s,a,r.getOrientation()),c=this.getOptions(),u=Bi().x(o).y(l).curve(i.getD3Curve()).defined(p=>{const g=r.getRangeIdentifier(p),m=p[g];return m!=null});let d=[];if(this.configs.stacked){const p=Object.keys(c.axes).some(v=>c.axes[v].percentage),{groupMapsTo:g}=c.data;d=this.model.getStackedData({groups:this.configs.groups,percentage:p}).map(v=>{const E=this.services.cartesianScales.getDomainIdentifier(v),y=this.services.cartesianScales.getRangeIdentifier(v);return{name:b(v,0,g),data:v.map(x=>({[E]:x.data.sharedStackKey,[g]:x[g],[y]:x[1]})),hidden:!pR(v,x=>x[0]!==x[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:[it.STROKE],dataGroupName:p.name,originalClassName:"line"})).style("stroke",p=>this.model.getStrokeColor(p.name,null,p.data)).attr("role",ut.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",p=>{const{data:g}=p;return g.map(m=>{const v=this.services.cartesianScales.getRangeIdentifier(m);return m[v]}).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 Lv=5;function EN(e,t){return e>t-Lv&&e<t+Lv}class Pn extends pt{constructor(){super(...arguments),this.type="ruler",this.renderType=tt.SVG,this.isXGridEnabled=b(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=b(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=b(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===Bt.HORIZONTAL?r:n,d=R.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),h=R.appendOrSelect(d,"line.ruler-line"),f=i.selectAll("[role=graphics-symbol]"),p=a.map(m=>({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>EN(m.domainValue,u));if(this.pointsWithinLine&&p.length===this.pointsWithinLine.length&&p.map(m=>m.domainValue).join()===this.pointsWithinLine.map(m=>m.domainValue).join())return this.pointsWithinLine=p,this.services.events.dispatchEvent(T.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=p;const g=this.pointsWithinLine.reduce((m,v)=>{if(m.length===0)return m.push(v),m;const E=m[0].domainValue,y=Math.abs(u-v.domainValue),x=Math.abs(u-E);return y>x||(y<x?m=[v]:m.push(v)),m},[]);if(g.length>0){const m=g.map(x=>x.originalData).filter(x=>{const S=this.services.cartesianScales.getRangeIdentifier(x),_=x[S];return _!=null}),v=g.map(x=>x.domainValue),E=f.filter(x=>{const S=this.services.cartesianScales.getDomainValue(x);return v.includes(S)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Vg(this.elementsToHighlight,E)&&this.hideRuler(),E.dispatch("mouseover"),this.elementsToHighlight=E,this.services.events.dispatchEvent(T.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const y=g[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",y.domainValue).attr("y2",y.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",y.domainValue).attr("x2",y.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=R.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=TR(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=R.appendOrSelect(t,"svg.chart-grid-backdrop")}}class an extends pt{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(!(b(this.getOptions(),"points","enabled")||b(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]=_n(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=_n(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]=_n(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",f=>{const p=a.getDomainIdentifier(f),m=this.model.getIsFilled(f[o],f[p],f,i)?[it.FILL,it.STROKE]:[it.STROKE];return this.model.getColorClassName({classNameTypes:m,dataGroupName:f[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",f=>this.isDatapointThresholdAnomaly(f)).classed("filled",f=>{const p=a.getDomainIdentifier(f);return this.model.getIsFilled(f[o],f[p],f,i)}).classed("unfilled",f=>{const p=a.getDomainIdentifier(f);return!this.model.getIsFilled(f[o],f[p],f,i)}).transition().call(f=>{var p;return(p=this.services.transitions)==null?void 0:p.setupTransition({transition:f,name:"scatter-update-enter",animate:n})}).attr("cx",u).attr("cy",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",ut.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=I(this);s.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[it.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=I(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:I(this),datum:i})}).on("mouseout",function(r,i){var a,o,l;const s=I(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 Rv extends pt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=tt.SVG,this.truncation={[G.LEFT]:!1,[G.RIGHT]:!1,[G.TOP]:!1,[G.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=b(r,"axes",n,"visible"),s=this.getComponentContainer(),{width:a,height:o}=R.getSVGElementSize(s,{useAttrs:!0}),l=R.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===G.BOTTOM||n===G.TOP?(c=this.configs.axes[G.LEFT]?this.margins.left:0,u=this.configs.axes[G.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===Q.LABELS||this.scaleType===Q.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case G.LEFT:h=ah;break;case G.BOTTOM:h=Lo;break;case G.RIGHT:h=q0;break;case G.TOP:h=Y0;break}l.attr("aria-label",`${n} axis`);const f=!l.select("g.ticks").empty();let p=R.appendOrSelect(l,"g.ticks");f||(p.attr("role",`${ut.GRAPHICS_OBJECT} ${ut.GROUP}`),p.attr("aria-label",`${n} ticks`));const g=R.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=b(r,"axes",n),v=this.scaleType===Q.TIME||m.scaleType===Q.TIME,E=n===G.LEFT||n===G.RIGHT,y=this.model.get("zoomDomain");if(y&&v&&!E&&d.domain(y),!i){p.attr("aria-hidden",!0);return}const x=b(m,"scaleType"),S=b(r,"data","loading"),_=b(m,"ticks","number"),A=b(m,"ticks","values"),L=b(m,"truncation","type"),B=b(m,"truncation","threshold"),D=b(m,"truncation","numCharacter"),O=_!==null,H=b(r,"timeScale"),P=R.appendOrSelect(g,"g.tick"),M=R.appendOrSelect(P,"text").text("0"),w=R.getSVGElementSize(M.node(),{useBBox:!0}).height;P.remove();const U=this.scaleType||m.scaleType||Q.LINEAR,F=h(d).tickSizeOuter(0);if(d.ticks){let Z;if(O?Z=_:(Z=Rn.ticks.number,E&&(Z=this.getNumberOfFittingTicks(o,w,Rn.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(Z=0),F.ticks(Z),v)if(!d.ticks(Z).length)F.tickValues([]);else{const et=b(r,"timeScale","addSpaceOnEdges"),vt=b(r,"axes",n,"domain"),Y=d.copy();et&&!vt&&Y.nice(Z);const K=Y.ticks(Z);et&&K.length>2&&!vt&&(K.splice(K.length-1,1),K.splice(0,1)),F.tickValues(K)}}let $;const N=b(m,"ticks","formatter"),{code:j,number:q}=b(r,"locale");if(v){const Z=ru(F.tickValues(),b(r,"timeScale","timeInterval"));N===null?$=(et,vt)=>nu(et,vt,F.tickValues(),Z,H,r.locale):$=(et,vt)=>{const Y=nu(et,vt,F.tickValues(),Z,H,r.locale);return N(et,vt,Y)}}else N===null?U===Q.LINEAR&&($=Z=>q(Z,j)):$=N;F.tickFormat($);const[at,nt]=this.services.cartesianScales.getScaleByPosition(n).domain();let dt;if(A){if(v)A.forEach((Z,et)=>{Z.getTime===void 0&&(A[et]=new Date(Z))}),dt=A.filter(Z=>{const et=Z.getTime();return et>=new Date(at).getTime()&&et<=new Date(nt).getTime()});else if(x===Q.LABELS){const Z=this.services.cartesianScales.getScaleByPosition(n).domain();dt=A.filter(et=>Z.includes(et))}else dt=A.filter(Z=>Z>=at&&Z<=nt);F.tickValues(dt)}switch(n){case G.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case G.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case G.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case G.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const mt=this.model.isDataEmpty();if(m.title){const Z=R.appendOrSelect(l,"text.axis-title").html(mt||S?"":sn(m.title)),et=b(m,"titleOrientation");let vt;switch(n){case G.LEFT:et===Ya.RIGHT?Z.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):Z.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case G.BOTTOM:Z.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case G.RIGHT:et===Ya.LEFT?Z.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):Z.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case G.TOP:vt=R.getSVGElementSize(Z,{useBBox:!0}).height,Z.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${vt/2})`).style("text-anchor","middle");break}}if(v){const Z=ru(F.tickValues(),b(r,"timeScale","timeInterval")),et=H.showDayName,vt=p;t&&(p=p.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"axis-update",animate:t}))),p=p.call(F),vt.selectAll(".tick").data(F.tickValues(),d).order().select("text").style("font-weight",(K,ot)=>Om(K,ot,F.tickValues(),Z,et)?"bold":"normal")}else!t||!f?p=p.call(F):p=p.transition().call(Z=>this.services.transitions.setupTransition({transition:Z,name:"axis-update",animate:t})).call(F);if(g.call(F),n===G.BOTTOM||n===G.TOP){let Z=!1;const et=b(m,"ticks","rotation");if(et===es.ALWAYS)Z=!0;else if(et===es.NEVER)Z=!1;else if(!et||et===es.AUTO)if(d.step)Z=g.selectAll("g.tick text").nodes().some(Y=>R.getSVGElementSize(Y,{useBBox:!0}).width>=d.step());else{Z=!1;const vt=g.append("text").text("A"),Y=R.getSVGElementSize(vt.node(),{useBBox:!0}).width;let K;g.selectAll("g.tick").each(function(){const ot=I(this),C=parseFloat(b(xn(this),"tx"));C!==null&&K+ot.text().length*Y*.8>=C&&(Z=!0),K=C}),vt.remove()}Z?(O||(F.ticks(this.getNumberOfFittingTicks(a,w,Rn.ticks.horizontalSpaceRatio)),g.call(F),p.call(F)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===G.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",Z=>Z),g.selectAll("g.tick").attr("aria-label",Z=>Z),L!==Ce.NONE&&x===Q.LABELS&&!A){const Z=this.services.cartesianScales.getScaleDomain(n);if(Z.length>0){const et=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(et);const vt=this;l.selectAll("g.tick text").data(Z).text(function(Y){return Y.length>B?(vt.truncation[n]=!0,ss(Y,L,D)):Y}),this.getInvisibleAxisRef().selectAll("g.tick text").data(Z).text(function(Y){return Y.length>B?ss(Y,L,D):Y}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(Z)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=R.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=b(i,"axes",n),a=b(s,"scaleType"),o=b(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:I(this),datum:u}),a===Q.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,hoveredElement:I(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:I(this),datum:u}),a===Q.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:I(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:I(this),datum:u}),a===Q.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 lg(i,2,Rn.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;R.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class bN extends Rv{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=R.appendOrSelect(r,`g.axis.${n}`),s=this;i.selectAll("g.tick").each(function(a,o){const l=I(this);l.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:d}=R.getSVGElementSize(c,{useBBox:!0}),h=R.appendOrSelect(l,"rect.axis-holder");let f=0,p=0;switch(n){case G.LEFT:f=-u+Number(c.attr("x")),p=-(d/2);break;case G.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(d/2);break;case G.TOP:f=-(u/2),p=-d+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,h.attr("transform","rotate(-45)"));break;case G.BOTTOM:f=-(u/2),p=d/2-2,s.truncation[n]&&(f=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",f-Rn.hover.rectanglePadding).attr("y",p).attr("width",u+Rn.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=R.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=b(i,"axes",n),a=b(s,"scaleType"),o=b(s,"truncation","threshold"),l=this;r.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===Q.LABELS&&d.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=I(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:I(this).select("text"),datum:I(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()}),a===Q.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:I(this),datum:I(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(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:I(this),datum:I(this).select("text").datum()})),n===G.LEFT||n===G.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;R.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 pt{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(G),i=b(this.getOptions(),"axes");r.forEach(o=>{i[G[o]]&&(n[G[o]]=!0)}),this.configs.axes=n,r.forEach(o=>{const l=G[o];if(this.configs.axes[l]&&!this.children[l]){const c={position:l,axes:this.configs.axes,margins:this.margins},u=this.model.axisFlavor===rs.DEFAULT?new Rv(this.model,this.services,c):new bN(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}=R.getSVGElementSize(u,{useBBox:!0});let f;switch(l.getTitleRef().empty()?f=0:(f=R.getSVGElementSize(l.getTitleRef(),{useBBox:!0}).height,(c===G.LEFT||c===G.RIGHT)&&(f+=5)),c){case G.TOP:s.top=h+f;break;case G.BOTTOM:s.bottom=h+f;break;case G.LEFT:s.left=d+f;break;case G.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 pt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=b(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Gt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Gt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Gt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Gt.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===Bt.VERTICAL&&this.drawYGrid(t),n===Bt.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=Fe().domain([0,1]).range(t),this.yScale=Fe().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:r,height:i}=R.getSVGElementSize(n,{useAttrs:!0});this.backdrop=R.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",r).attr("height",i);const s=R.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=b(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),s=R.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=b(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(i).map(l=>l*n),a=R.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}=R.getSVGElementSize(i,{useAttrs:!0}),o=R.appendOrSelect(i,"svg.chart-skeleton").attr("width",s).attr("height",a),l=n===0?"pie":"donut",c=b(this.getOptions(),l,"alignment");R.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=Ui().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(Lt.radiusOffset),h=t+(Math.min(s,a)-t*2)/2,f=R.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+Lt.xOffset;c===Ht.CENTER?p=s/2:c===Ht.RIGHT&&(p=s-t-Lt.xOffset);const g=t+Lt.yOffset;f.attr("transform",`translate(${p}, ${g})`)}computeOuterRadius(){const{width:t,height:n}=R.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Lt.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}=R.getSVGElementSize(this.parent,{useAttrs:!0}),c=0,u=l,d=R.appendOrSelect(o,"defs").lower(),h=R.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
+ </svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class fP extends Ye{constructor(t,n){super(t,n),this.model=new Y2(this.services),this.model.setOptions(Pt(Ct.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new dP(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}const ri=class ri extends gt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=et.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=R.appendOrSelect(n,"svg.chart-grid-backdrop"),s=R.appendOrSelect(i,`g.${this.type}`),a=R.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=R.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=R.appendOrSelect(r,this.frontSelectionSelector);if(d&&u===J.TIME){let p=this.model.get("zoomDomain");p===void 0&&(p=this.services.zoom.getDefaultZoomBarDomain(),p&&this.model.set({zoomDomain:p},{animate:!1}));const g=S=>{const _=S[1]-S[0];let C="0,"+_.toString();const L=Math.floor(l/ri.DASH_LENGTH),B=L*ri.DASH_LENGTH;for(let D=0;D<L;D++)C+=","+ri.DASH_LENGTH;C+=","+(l-B),L%2===1&&(C+=",0"),C+=","+_.toString(),C+=","+l.toString(),f.attr("stroke-dasharray",C)},m=S=>{const _=S.selection;_===null||_[0]===_[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(_))},v=(S,_)=>{const C=$f().range([0,o]).domain(p);let L=[C.invert(S),C.invert(_)];L[0].valueOf()===L[1].valueOf()&&(L=this.services.zoom.getDefaultZoomBarDomain()),(p[0].valueOf()!==L[0].valueOf()||p[1].valueOf()!==L[1].valueOf())&&this.services.zoom.handleDomainChange(L)};let E;const y=S=>{const _=S.selection;_!==null&&(v(_[0],_[1]),s.call(E.move,null),f.style("display","none"))};l!=0&&o!=0&&(E=nd().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",y),s.call(E));const x=this.services.zoom.getZoomRatio();i.on("click",function(S){if(S.shiftKey){const _=this.services.domUtils.getHolder(),C=Hn(s.node(),_)[0];let L=C-o*x/2;L<0&&(L=0);let B=C+o*x/2;B>o&&(B=o),v(L,B)}})}}};ri.DASH_LENGTH=4;let Uu=ri;class pP extends gt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=et.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=nd(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(T.ZoomBar.UPDATE,this.render.bind(this));const t=b(this.getOptions(),"zoomBar",G.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer(),r=this.services.zoom.isZoomBarLoading(G.TOP),i=this.services.zoom.isZoomBarLocked(G.TOP),s=b(this.getOptions(),"zoomBar",G.TOP,"type"),a=b(this.getOptions(),"axes",G.BOTTOM,"highlights"),o=be.height[s],{width:l}=R.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=R.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(R.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",be.spacerHeight).attr("opacity",1).attr("fill","none"),s===Ge.GRAPH_VIEW?R.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&&R.appendOrSelect(d,"rect.zoom-slider-bg").attr("x",c).attr("y",o/2-1).attr("width",l-c).attr("height",2).classed("zoom-slider-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),r){this.renderSkeleton(d,c,l);return}const{cartesianScales:h}=this.services,f=h.getMainXScale(),p=h.getMainYScale(),g=h.getMainXScaleType();if(f&&g===J.TIME){let m=this.services.zoom.getZoomBarData();if(He(m)||m.length===1)return;this.xScale=f.copy(),this.yScale=p.copy();const v=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,v);const E=this.model.get("initialZoomDomain"),y=b(this.getOptions(),"zoomBar",G.TOP,"initialZoomDomain");y&&y[0]&&y[1]&&(y[0]=new Date(y[0]),y[1]=new Date(y[1])),y&&!(E&&E[0].valueOf()===y[0].valueOf()&&E[1].valueOf()===y[1].valueOf())?this.model.set({initialZoomDomain:lt([],y),zoomDomain:y?lt([],y):v},{skipUpdate:!0}):y===null&&E!==null&&this.model.set({initialZoomDomain:null,zoomDomain:lt([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(ke(m,_=>_.value));const x=this.model.get("zoomDomain");if(s===Ge.GRAPH_VIEW&&(this.renderZoomBarArea(d,"path.zoom-graph-area-unselected",m,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(d,"path.zoom-graph-area",m,this.clipId),this.renderZoomBarBaseline(d,c,l),a)){const _=a.highlightStartMapsTo,C=a.highlightEndMapsTo,L=a.color,B=a.labelMapsTo;a.data.forEach((D,O)=>{R.appendOrSelect(d,`rect.highlight-${O}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(D[_])).attr("width",this.xScale(D[C])-this.xScale(D[_])).style("fill",L&&L.scale[D[B]]?L.scale[D[B]]:null).style("fill-opacity",.1).style("stroke",L&&L.scale[D[B]]?L.scale[D[B]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(x,c,l);const S=R.appendOrSelect(n,this.brushSelector).call(this.brush);if(x!==void 0)if(x[0].valueOf()===x[1].valueOf())S.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const _=x.map(C=>this.xScale(C));_[1]-_[0]<this.MIN_SELECTION_DIFF||(S.call(this.brush.move,_),this.updateBrushHandle(this.getComponentContainer(),_))}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=b(this.getOptions(),"zoomBar",G.TOP,"type"),a=be.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=be.handleWidth,s=b(this.getOptions(),"zoomBar",G.TOP,"type"),a=be.height[s],o=-i/2,l=be.handleBarWidth,c=s===Ge.GRAPH_VIEW?be.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=b(this.getOptions(),"zoomBar",G.TOP,"type"),r=be.height[n],s=this.getComponentContainer().select("svg.zoom-container");R.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=(v,E,y)=>x=>s.getValueFromScale(v,E,y,x),d=u(this.xScale,l,a),h=u(this.yScale,c,o),f=b(this.getOptions(),"zoomBar",G.TOP,"type"),p=be.height[f],g=Zl().x(v=>d(v)).y0(p).y1(v=>p-h(v)),m=R.appendOrSelect(t,n).datum(r).attr("d",g);i&&m.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=R.appendOrSelect(t,"clipPath").attr("id",n);R.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=En(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=b(this.model.getOptions(),"zoomBar",G.TOP,"type"),a=be.height[s],o=Hi()([[n,a],[r,a]]);R.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),R.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),b(this.getOptions(),"zoomBar",G.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 gP extends gt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=et.SVG,this.positionService=new go}render(t=!1){const n=b(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(G).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,m=null;h===G.LEFT||h===G.RIGHT?(m=f,g=d.services.cartesianScales.getMainXScale()):(g=f,m=d.services.cartesianScales.getMainYScale());const v=p===J.LABELS,[E,y]=g.range(),[x,S]=m.range(),{cartesianScales:_}=d.services,C=_.getOrientation(),L=P=>_.getDomainValue(P),B=P=>_.getRangeValue(P),[D,O]=Sn(L,B,C),H=I(this);h===G.TOP||h===G.BOTTOM?(H.selectAll("line.threshold-line").transition().call(P=>d.services.transitions.setupTransition({transition:P,name:"threshold-line-update",animate:t})).attr("y1",S).attr("y2",x).attr("x1",({datum:P})=>D(P)+(v?f.step()/2:0)).attr("x2",({datum:P})=>D(P)+(v?f.step()/2:0)).style("stroke",({fillColor:P})=>P),H.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:P})=>-D(P)).attr("width",Math.abs(x-S)).classed("rotate",!0)):(H.selectAll("line.threshold-line").transition().call(P=>d.services.transitions.setupTransition({transition:P,name:"threshold-line-update",animate:t})).attr("x1",E).attr("x2",y).attr("y1",({datum:P})=>O(P)+(v?f.step()/2:0)).attr("y2",({datum:P})=>O(P)+(v?f.step()/2:0)).style("stroke",({fillColor:P})=>P),H.selectAll("rect.threshold-hoverable-area").attr("x",E).attr("y",({datum:P})=>O(P)).attr("width",Math.abs(y-E)).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(),s=this.services.cartesianScales.getScaleTypeByPosition(r),{code:a,number:o}=b(i,"locale");if(s===J.TIME){const l=[G.LEFT,G.RIGHT].includes(r),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=b(i,"timeScale"),f=ru(d.ticks(),b(h,"timeInterval"));return nu(n,0,d.ticks(),f,h,i.locale)}return o(n,a)}appendThresholdLabel(){const t=I(this.services.domUtils.getHolder()),n=b(this.getOptions(),"style","prefix");this.label=R.appendOrSelect(t,`div.${ue}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=Hn(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(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,[Ut.RIGHT,Ut.LEFT,Ut.TOP,Ut.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=b(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){I(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(T.Threshold.SHOW,{event:r,hoveredElement:I(this),datum:I(this).datum()})}).on("mouseout",function(r){I(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(T.Threshold.HIDE,{event:r,hoveredElement:I(this),datum:I(this).datum()})})}}class mP extends gt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=et.SVG,this.positionService=new go,this.highlightStrokeWidth=1}render(t=!1){const n=b(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(G).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,m]=f.range(),[v,E]=p.range(),{cartesianScales:y}=d.services,x=y.getOrientation(),S=D=>y.getDomainValue(D),_=D=>y.getRangeValue(D),[C,L]=Sn(S,_,x),B=I(this);h===G.TOP||h===G.BOTTOM?B.selectAll("rect.highlight-bar").transition().call(D=>d.services.transitions.setupTransition({transition:D,name:"highlight-bar-update",animate:t})).attr("y",Math.max(E+d.highlightStrokeWidth,0)).attr("height",Math.max(v-2*d.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:D,...O})=>C(O[D])).attr("width",({highlightStartMapsTo:D,highlightEndMapsTo:O,...H})=>Math.max(C(H[O])-C(H[D]),0)).style("stroke",({color:D,labelMapsTo:O,...H})=>D&&D.scale[H[O]]?D.scale[H[O]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:D,labelMapsTo:O,...H})=>D&&D.scale[H[O]]?D.scale[H[O]]:null):B.selectAll("rect.highlight-bar").transition().call(D=>d.services.transitions.setupTransition({transition:D,name:"highlight-bar-update",animate:t})).attr("x",g).attr("width",Math.max(m-g,0)).attr("y",({highlightEndMapsTo:D,...O})=>L(O[D])).attr("height",({highlightStartMapsTo:D,highlightEndMapsTo:O,...H})=>Math.max(L(H[D])-L(H[O]),0)).style("stroke",({color:D,labelMapsTo:O,...H})=>D&&D.scale[H[O]]?D.scale[H[O]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:D,labelMapsTo:O,...H})=>D&&D.scale[H[O]]?D.scale[H[O]]:null)})}}class bv extends Iu{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:yt(r,"locale.translations.group")||yt(r,"tooltip.groupLabel"),value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[at.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:[at.TOOLTIP],dataGroupName:h[o]})}}).sort((h,f)=>f.value-h.value)),!a&&b(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[h],0),bold:!0})}return d}}function ys(e,t){const n=bt(e),r=bt(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function vP(e,t){const n=bt(e),r=bt(t);return n.getFullYear()-r.getFullYear()}function yP(e,t){const n=bt(e),r=bt(t),i=ys(n,r),s=Math.abs(vP(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=bt(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 xv(e,t){return Bu(e,t*12)}function EP(e,t){return xv(e,-t)}function bP(e,t){const n=bt(e),r=bt(t),i=n.getFullYear()-r.getFullYear(),s=n.getMonth()-r.getMonth();return i*12+s}function xP(e){const t=bt(e);return t.setHours(23,59,59,999),t}function _P(e){const t=bt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function SP(e){const t=bt(e);return+xP(t)==+_P(t)}function TP(e,t){const n=bt(e),r=bt(t),i=ys(n,r),s=Math.abs(bP(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;SP(bt(e))&&s===1&&ys(e,r)===1&&(o=!1),a=i*(s-Number(o))}return a===0?0:a}function OP(e,t){return Bu(e,-t)}function wP(e,t){const n=bt(e),r=bt(t),i=_v(n,r),s=Math.abs(pm(n,r));n.setDate(n.getDate()-i*s);const a=+(_v(n,r)===-i),o=i*(s-a);return o===0?0:o}function _v(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 Sv(e,t){const n=bt(e);return isNaN(t)?ze(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function MP(e,t){return Sv(e,-t)}function Hu(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function Gu(e,t){return+bt(e)-+bt(t)}function AP(e,t,n){const r=Gu(e,t)/hm;return Hu(n==null?void 0:n.roundingMethod)(r)}function Vu(e,t){const n=+bt(e);return ze(e,n+t)}function Tv(e,t){return Vu(e,t*hm)}function CP(e,t){return Tv(e,-t)}function Ov(e,t,n){const r=Gu(e,t)/um;return Hu(n==null?void 0:n.roundingMethod)(r)}function zu(e,t){return Vu(e,t*um)}function wv(e,t){return zu(e,-t)}function Mv(e,t,n){const r=Gu(e,t)/1e3;return Hu(n==null?void 0:n.roundingMethod)(r)}function Wu(e,t){return Vu(e,t*1e3)}function Av(e,t){return Wu(e,-t)}class DP extends On{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:r}=n.data,i=b(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=b(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 b(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===G.BOTTOM||t===G.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(G).map(n=>G[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===G.LEFT||this.rangeAxisPosition===G.RIGHT)&&(this.domainAxisPosition===G.BOTTOM||this.domainAxisPosition===G.TOP)?this.orientation=Bt.VERTICAL:this.orientation=Bt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var r,i,s,a;const t=this.model.getOptions(),n=b(t,"axes");((r=n[G.LEFT])!=null&&r.correspondingDatasets&&n[G.RIGHT]||(i=n[G.RIGHT])!=null&&i.correspondingDatasets&&n[G.LEFT]||(s=n[G.TOP])!=null&&s.correspondingDatasets&&n[G.BOTTOM]||(a=n[G.BOTTOM])!=null&&a.correspondingDatasets&&n[G.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=b(this.model.getOptions(),"axes",t,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[t]===J.LINEAR||this.scaleTypes[t]===J.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(t){return this.scales[t]}getScaleTypeByPosition(t){return this.scaleTypes[t]}getDomainAxisScaleType(){const t=this.getDomainAxisPosition();return this.getScaleTypeByPosition(t)}getRangeAxisScaleType(){const t=this.getRangeAxisPosition();return this.getScaleTypeByPosition(t)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const t=[G.BOTTOM,G.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[G.LEFT,G.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=b(s,"axes")[r],{mapsTo:l}=o,c=b(i,l)!==null?i[l]:i;let u;switch(n){case J.LABELS:u=t(c)+t.step()/2;break;case J.TIME:u=t(new Date(c));break;default:u=t(c)}return u}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),o=b(s,"axes")[r],{mapsTo:l}=o,c=t[l]!==void 0?t[l]:t;return[i(b(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:c),i(b(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 b(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return b(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=b(r,"axes",t);if(i.scaleType===J.TIME){const s=b(r,"timeScale","addSpaceOnEdges");return LP(n,s)}else return RP(n,Rn.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=b(t,"axes"),r=this.isDualAxes();return b(n,G.LEFT)===null&&b(n,G.RIGHT)!==null||b(n,G.RIGHT,"main")===!0||r&&b(n,G.LEFT,"correspondingDatasets")?{primary:G.RIGHT,secondary:G.LEFT}:{primary:G.LEFT,secondary:G.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=b(t,"axes"),r=this.isDualAxes();return b(n,G.BOTTOM)===null&&b(n,G.TOP)!==null||b(n,G.TOP,"main")===!0||r&&b(n,G.BOTTOM,"correspondingDatasets")?{primary:G.TOP,secondary:G.BOTTOM}:{primary:G.BOTTOM,secondary:G.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=b(r,"axes",t.primary),s=b(r,"axes",n.primary),a=i.scaleType||J.LINEAR,o=s.scaleType||J.LINEAR,l={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return l.primaryDomainAxisPosition=n.primary,l.primaryRangeAxisPosition=t.primary,l.secondaryDomainAxisPosition=n.secondary,l.secondaryRangeAxisPosition=t.secondary,(!(o===J.LABELS||o===J.TIME)&&a===J.LABELS||a===J.TIME)&&(l.primaryDomainAxisPosition=t.primary,l.primaryRangeAxisPosition=n.primary,l.secondaryDomainAxisPosition=t.secondary,l.secondaryRangeAxisPosition=n.secondary),l}getScaleDomain(t){const n=this.model.getOptions(),r=b(n,"axes",t),i=b(n,"bounds"),{includeZero:s}=r,a=b(r,"scaleType")||J.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:v}=this.model.getBinConfigurations();return[0,Bn(v,E=>E.length)]}else if(r.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),E=this.model.getStackKeys({bins:v});return[E[0].split(":")[0],E[E.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:f}=Rn.ratio;if(r.domain)return a===J.LABELS?r.domain:(a===J.TIME&&(r.domain=r.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===J.LABELS)return Ji(o.map(v=>v[c]));let p,g;const m=this.model.getDataGroupNames();if(a===J.LABELS_RATIO)return o.map(v=>`${v[h]}/${v[f]}`);if(a===J.TIME)g=o.map(v=>+new Date(v[c]));else if(i&&n.axes)g=[],o.forEach(v=>{g.push(v[c]),v[i.upperBoundMapsTo]&&g.push(v[i.upperBoundMapsTo]),v[i.lowerBoundMapsTo]&&g.push(v[i.lowerBoundMapsTo])});else if(r.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:v}=n.data,E=this.model.getDataValuesGroupedByKeys({groups:m}),y=o.filter(S=>!m.includes(S[v])),x=[];E.forEach(S=>{const{..._}=S;let C=0,L=0;Object.values(_).forEach(B=>{isNaN(B)||(B<0?L+=B:C+=B)}),x.push([L,C])}),g=[...Ip(x),...y.map(S=>S[c])]}else g=[],o.forEach(v=>{const E=v[c];Array.isArray(E)&&E.length===2?(g.push(E[0]),g.push(E[1])):(l&&g.push(Math.max(v[c],v[l])),g.push(E))});return a!==J.TIME&&a!==J.LOG&&s&&g.push(0),d&&d.length>0&&d.forEach(v=>{const E=b(v,"value");E!==null&&g.push(E)}),p=ke(g),p=this.extendsDomain(t,p),p}createScale(t){const n=this.model.getOptions(),r=b(n,"axes",t);if(!r)return null;const i=b(r,"scaleType")||J.LINEAR;this.scaleTypes[t]=i;let s;return i===J.TIME?s=$f():i===J.LOG?s=yf().base(r.base||10):i===J.LABELS||i===J.LABELS_RATIO?s=ki():s=Fe(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,r=0;return this.getOrientation()===Bt.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),b(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(r=n[0]),r}getHighestDomainThreshold(){const t=b(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getDomainScale(),s=r.sort((o,l)=>l.value-o.value)[0];return this.getScaleTypeByPosition(n)===J.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:i(s.value)}}getHighestRangeThreshold(){const t=b(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 LP(e,t){const n=new Date(e[0]),r=new Date(e[1]);return yP(r,n)>1?[EP(n,t),xv(r,t)]:TP(r,n)>1?[OP(n,t),Bu(r,t)]:wP(r,n)>1?[MP(n,t),Sv(r,t)]:AP(r,n)>1?[CP(n,t),Tv(r,t)]:Ov(r,n)>30?[wv(n,t*30),zu(r,t*30)]:Ov(r,n)>1?[wv(n,t),zu(r,t)]:Mv(r,n)>15?[Av(n,t*15),Wu(r,t*15)]:Mv(r,n)>1?[Av(n,t),Wu(r,t)]:[n,r]}function RP([e,t],n,r){const s=(t-e)*n,a=t<=0&&t+s>0?0:t+s;let o=e>=0&&e-s<0?0:e-s;if(r===J.LOG&&o<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");o=e}return[o,a]}class IP extends On{constructor(){super(...arguments),this.curveTypes={curveLinear:Sa,curveLinearClosed:Zf,curveBasis:_T,curveBasisClosed:ST,curveBasisOpen:TT,curveBundle:OT,curveCardinal:wT,curveCardinalClosed:MT,curveCardinalOpen:AT,curveCatmullRom:CT,curveCatmullRomClosed:DT,curveCatmullRomOpen:LT,curveMonotoneX:RT,curveMonotoneY:IT,curveNatural:kT,curveStep:PT,curveStepAfter:$T,curveStepBefore:NT}}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 kP extends On{isZoomBarEnabled(){if(!this.services.cartesianScales||!b(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=b(this.model.getOptions(),"axes",t,"scaleType");return t===G.BOTTOM&&n===J.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=t||this.services.zoom.getZoomBarData(),{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales undefined");const i=r.getMainXAxisPosition(),s=r.getDomainIdentifier(),a=b(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,ke(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 b(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var a;const r=this.model.get("zoomDomain"),i=Object.assign({stacked:!1},n),s=b(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=be.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=b(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 b(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return b(this.model.getOptions(),"zoomBar",t,"locked")}}class de extends Ye{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:DP,curves:IP,zoom:kP}),this.model=new hr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=b(r,"zoomBar",G.TOP,"enabled"),s=b(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=b(r,"axes",a,"scaleType"),l=i&&a===G.BOTTOM&&o===J.TIME,c=this.services.zoom.isZoomBarLocked(G.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new ms(this.model,this.services)],growth:ct.STRETCH},h={id:"toolbar",components:[new Kr(this.model,this.services)],growth:ct.PREFERRED},f={id:"header",components:[new ae(this.model,this.services,[d,...s?[h]:[]],{direction:At.ROW,alignItems:sr.CENTER})],growth:ct.PREFERRED},p={id:"legend",components:[new Ru(this.model,this.services)],growth:ct.PREFERRED};l&&!c&&t.push(new cv(this.model,this.services),new Uu(this.model,this.services)),t.push(new gP(this.model,this.services)),t.push(new mP(this.model,this.services));const g={id:"graph-frame",components:t,growth:ct.STRETCH,renderType:et.SVG},m=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=At.COLUMN;if(m){const _=b(this.model.getOptions(),"legend","position");_===zr.LEFT?(v=At.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Wr.VERTICAL)):_===zr.RIGHT?(v=At.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Wr.VERTICAL)):_===zr.BOTTOM&&(v=At.COLUMN_REVERSE)}const E={id:"spacer",components:[new wn(this.model,this.services)],growth:ct.PREFERRED},y={id:"full-frame",components:[new ae(this.model,this.services,[...m?[p]:[],...m?[E]:[],g],{direction:v})],growth:ct.STRETCH},x={id:"zoom-bar",components:[new pP(this.model,this.services)],growth:ct.PREFERRED,renderType:et.SVG},S=[];if(u||s){S.push(f);const _={id:"spacer",components:[new wn(this.model,this.services,s?{size:15}:void 0)],growth:ct.PREFERRED};S.push(_)}return l&&S.push(x),S.push(y),[new bv(this.model,this.services),new po(this.model,this.services),new ae(this.model,this.services,S,{direction:At.COLUMN})]}}class Te extends gt{constructor(){super(...arguments),this.type="grid",this.renderType=et.SVG}render(t=!0){const n=b(this.getOptions(),"grid","x","enabled"),r=b(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(R.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(R.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,r=this.backdrop.attr("height"),i=this.services.cartesianScales.getMainXScale(),s=Lo(i).tickSizeInner(-r).tickSizeOuter(0);if(b(this.getOptions(),"grid","x","alignWithAxisTicks")){const l=this.services.cartesianScales.getDomainAxisPosition(),c=b(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=b(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=oh(i).tickSizeInner(-r).tickSizeOuter(0);if(b(this.getOptions(),"grid","y","alignWithAxisTicks")){const l=this.services.cartesianScales.getRangeAxisPosition(),c=b(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=b(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(_n(u).tx)-Number(_n(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+_n(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+_n(o).tx;else if(o)l=+_n(o).tx-+_n(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=R.getSVGElementSize(u).width-+_n(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=b(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const a=_n(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=R.appendOrSelect(r,"svg.chart-grid-backdrop");const u=R.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 Cv extends gt{constructor(){super(...arguments),this.type="area",this.renderType=et.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?bn.opacity.unselected:bn.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",bn.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=Zl().curve(this.services.curves.getD3Curve()).defined(S=>{const _=s.getRangeIdentifier(),C=S[_];return C!=null}),l=this.model.getGroupedData(this.configs.groups),c=b(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(r,"axes",S,"includeZero")===!1&&_[0]>0&&_[1]>0&&(d=_[0])},f=S=>u?s.getBoundedScaledValues(S)[0]:s.getRangeValue(d),p=S=>u?s.getBoundedScaledValues(S)[1]:s.getRangeValue(S);a===Bt.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=b(r,"color","gradient","enabled"),m=l&&l.length===1&&g;l.length>1&&g&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(l,S=>S.name),E=I(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!l.length)return;if(m){const S=E.select(`path.${this.model.getColorClassName({classNameTypes:[at.STROKE],dataGroupName:l[0].name})}`).node();let _;if(S)_=getComputedStyle(S,null).getPropertyValue("stroke");else{const C=b(this.model.getOptions(),"color","scale");if(C!==null){const L=Object.keys(C);_=C[L[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,_)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const y=this,x=v.enter().append("path");m?x.merge(v).style("fill",S=>`url(#${this.services.domUtils.generateElementIDString(`${S.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",S=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:S.name,originalClassName:"area"})).attr("d",S=>{const{data:_}=S;return o(_)}):(x.attr("opacity",0).merge(v).attr("class","area").attr("class",S=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:S.name,originalClassName:"area"})).style("fill",S=>y.model.getFillColor(S.name,null,S.data)).transition().call(S=>this.services.transitions.setupTransition({transition:S,name:"area-update-enter",animate:t})).attr("opacity",u?1:bn.opacity.selected).attr("d",S=>{const{data:_}=S;return o(_)}),u&&x.attr("fill-opacity",bn.opacity.selected).style("stroke",S=>y.model.getStrokeColor(S.name,null,S.data)).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 gt{constructor(){super(...arguments),this.type="line",this.renderType=et.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?xn.opacity.unselected:xn.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",xn.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]=Sn(s,a,r.getOrientation()),c=this.getOptions(),u=Hi().x(o).y(l).curve(i.getD3Curve()).defined(p=>{const g=r.getRangeIdentifier(p),m=p[g];return m!=null});let d=[];if(this.configs.stacked){const p=Object.keys(c.axes).some(v=>c.axes[v].percentage),{groupMapsTo:g}=c.data;d=this.model.getStackedData({groups:this.configs.groups,percentage:p}).map(v=>{const E=this.services.cartesianScales.getDomainIdentifier(v),y=this.services.cartesianScales.getRangeIdentifier(v);return{name:b(v,0,g),data:v.map(x=>({[E]:x.data.sharedStackKey,[g]:x[g],[y]:x[1]})),hidden:!IL(v,x=>x[0]!==x[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:[at.STROKE],dataGroupName:p.name,originalClassName:"line"})).style("stroke",p=>this.model.getStrokeColor(p.name,null,p.data)).attr("role",ut.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",p=>{const{data:g}=p;return g.map(m=>{const v=this.services.cartesianScales.getRangeIdentifier(m);return m[v]}).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 Dv=5;function PP(e,t){return e>t-Dv&&e<t+Dv}class Pn extends gt{constructor(){super(...arguments),this.type="ruler",this.renderType=et.SVG,this.isXGridEnabled=b(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=b(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=b(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===Bt.HORIZONTAL?r:n,d=R.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),h=R.appendOrSelect(d,"line.ruler-line"),f=i.selectAll("[role=graphics-symbol]"),p=a.map(m=>({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>PP(m.domainValue,u));if(this.pointsWithinLine&&p.length===this.pointsWithinLine.length&&p.map(m=>m.domainValue).join()===this.pointsWithinLine.map(m=>m.domainValue).join())return this.pointsWithinLine=p,this.services.events.dispatchEvent(T.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=p;const g=this.pointsWithinLine.reduce((m,v)=>{if(m.length===0)return m.push(v),m;const E=m[0].domainValue,y=Math.abs(u-v.domainValue),x=Math.abs(u-E);return y>x||(y<x?m=[v]:m.push(v)),m},[]);if(g.length>0){const m=g.map(x=>x.originalData).filter(x=>{const S=this.services.cartesianScales.getRangeIdentifier(x),_=x[S];return _!=null}),v=g.map(x=>x.domainValue),E=f.filter(x=>{const S=this.services.cartesianScales.getDomainValue(x);return v.includes(S)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Hg(this.elementsToHighlight,E)&&this.hideRuler(),E.dispatch("mouseover"),this.elementsToHighlight=E,this.services.events.dispatchEvent(T.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const y=g[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",y.domainValue).attr("y2",y.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",y.domainValue).attr("x2",y.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=R.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=Hn(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=HL(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=R.appendOrSelect(t,"svg.chart-grid-backdrop")}}class sn extends gt{constructor(){super(...arguments),this.type="scatter",this.renderType=et.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(!(b(this.getOptions(),"points","enabled")||b(this.getOptions(),"bubble","enabled")))return;const r=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:s}=i.data,{cartesianScales:a}=this.services;if(!a)throw new Error("Services cartesianScales are undefined.");const o=a.getDomainIdentifier(),l=r.selectAll("circle.dot").data(this.getScatterData(),d=>`${d[s]}-${d[o]}`);l.exit().attr("opacity",0).remove();const u=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l);this.styleCircles(u,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:r}=this.services;if(!r)throw new Error("Cartesian scales service is undefined");const i=r.getOrientation(),[s,a]=Sn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=Sn(d=>r.getDomainValue(d),d=>r.getRangeValue(d),i),c=o(t),u=l(t);return a&&s?u<=a.scaleValue&&c>=s.scaleValue:a?u<=a.scaleValue:s?c>=s.scaleValue:!1}styleCircles(t,n){const r=this.getOptions(),{filled:i,fillOpacity:s}=r.points,{cartesianScales:a}=this.services;if(!a)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=r.data,l=f=>a.getDomainValue(f),c=f=>a.getRangeValue(f),[u,d]=Sn(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",f=>{const p=a.getDomainIdentifier(f),m=this.model.getIsFilled(f[o],f[p],f,i)?[at.FILL,at.STROKE]:[at.STROKE];return this.model.getColorClassName({classNameTypes:m,dataGroupName:f[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",f=>this.isDatapointThresholdAnomaly(f)).classed("filled",f=>{const p=a.getDomainIdentifier(f);return this.model.getIsFilled(f[o],f[p],f,i)}).classed("unfilled",f=>{const p=a.getDomainIdentifier(f);return!this.model.getIsFilled(f[o],f[p],f,i)}).transition().call(f=>{var p;return(p=this.services.transitions)==null?void 0:p.setupTransition({transition:f,name:"scatter-update-enter",animate:n})}).attr("cx",u).attr("cy",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",ut.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=I(this);s.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[at.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=I(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:I(this),datum:i})}).on("mouseout",function(r,i){var a,o,l;const s=I(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 Lv extends gt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=et.SVG,this.truncation={[G.LEFT]:!1,[G.RIGHT]:!1,[G.TOP]:!1,[G.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=b(r,"axes",n,"visible"),s=this.getComponentContainer(),{width:a,height:o}=R.getSVGElementSize(s,{useAttrs:!0}),l=R.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===G.BOTTOM||n===G.TOP?(c=this.configs.axes[G.LEFT]?this.margins.left:0,u=this.configs.axes[G.RIGHT]?a-this.margins.right:a):(c=o-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const d=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===J.LABELS||this.scaleType===J.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case G.LEFT:h=oh;break;case G.BOTTOM:h=Lo;break;case G.RIGHT:h=W0;break;case G.TOP:h=z0;break}l.attr("aria-label",`${n} axis`);const f=!l.select("g.ticks").empty();let p=R.appendOrSelect(l,"g.ticks");f||(p.attr("role",`${ut.GRAPHICS_OBJECT} ${ut.GROUP}`),p.attr("aria-label",`${n} ticks`));const g=R.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=b(r,"axes",n),v=this.scaleType===J.TIME||m.scaleType===J.TIME,E=n===G.LEFT||n===G.RIGHT,y=this.model.get("zoomDomain");if(y&&v&&!E&&d.domain(y),!i){p.attr("aria-hidden",!0);return}const x=b(m,"scaleType"),S=b(r,"data","loading"),_=b(m,"ticks","number"),C=b(m,"ticks","values"),L=b(m,"truncation","type"),B=b(m,"truncation","threshold"),D=b(m,"truncation","numCharacter"),O=_!==null,H=b(r,"timeScale"),P=R.appendOrSelect(g,"g.tick"),M=R.appendOrSelect(P,"text").text("0"),w=R.getSVGElementSize(M.node(),{useBBox:!0}).height;P.remove();const U=this.scaleType||m.scaleType||J.LINEAR,$=h(d).tickSizeOuter(0);if(d.ticks){let j;if(O?j=_:(j=Rn.ticks.number,E&&(j=this.getNumberOfFittingTicks(o,w,Rn.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(j=0),$.ticks(j),v)if(!d.ticks(j).length)$.tickValues([]);else{const nt=b(r,"timeScale","addSpaceOnEdges"),vt=b(r,"axes",n,"domain"),q=d.copy();nt&&!vt&&q.nice(j);const Q=q.ticks(j);nt&&Q.length>2&&!vt&&(Q.splice(Q.length-1,1),Q.splice(0,1)),$.tickValues(Q)}}let N;const F=b(m,"ticks","formatter"),{code:Y,number:Z}=b(r,"locale");if(v){const j=ru($.tickValues(),b(r,"timeScale","timeInterval"));F===null?N=(nt,vt)=>nu(nt,vt,$.tickValues(),j,H,r.locale):N=(nt,vt)=>{const q=nu(nt,vt,$.tickValues(),j,H,r.locale);return F(nt,vt,q)}}else F===null?U===J.LINEAR&&(N=j=>Z(j,Y)):N=F;$.tickFormat(N);const[K,dt]=this.services.cartesianScales.getScaleByPosition(n).domain();let it;if(C){if(v)C.forEach((j,nt)=>{j.getTime===void 0&&(C[nt]=new Date(j))}),it=C.filter(j=>{const nt=j.getTime();return nt>=new Date(K).getTime()&&nt<=new Date(dt).getTime()});else if(x===J.LABELS){const j=this.services.cartesianScales.getScaleByPosition(n).domain();it=C.filter(nt=>j.includes(nt))}else it=C.filter(j=>j>=K&&j<=dt);$.tickValues(it)}switch(n){case G.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case G.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case G.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case G.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const ft=this.model.isDataEmpty();if(m.title){const j=R.appendOrSelect(l,"text.axis-title").html(ft||S?"":rn(m.title)),nt=b(m,"titleOrientation");let vt;switch(n){case G.LEFT:nt===Ya.RIGHT?j.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):j.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case G.BOTTOM:j.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case G.RIGHT:nt===Ya.LEFT?j.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):j.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case G.TOP:vt=R.getSVGElementSize(j,{useBBox:!0}).height,j.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${vt/2})`).style("text-anchor","middle");break}}if(v){const j=ru($.tickValues(),b(r,"timeScale","timeInterval")),nt=H.showDayName,vt=p;t&&(p=p.transition().call(Q=>this.services.transitions.setupTransition({transition:Q,name:"axis-update",animate:t}))),p=p.call($),vt.selectAll(".tick").data($.tickValues(),d).order().select("text").style("font-weight",(Q,ot)=>Sm(Q,ot,$.tickValues(),j,nt)?"bold":"normal")}else!t||!f?p=p.call($):p=p.transition().call(j=>this.services.transitions.setupTransition({transition:j,name:"axis-update",animate:t})).call($);if(g.call($),n===G.BOTTOM||n===G.TOP){let j=!1;const nt=b(m,"ticks","rotation");if(nt===ns.ALWAYS)j=!0;else if(nt===ns.NEVER)j=!1;else if(!nt||nt===ns.AUTO)if(d.step)j=g.selectAll("g.tick text").nodes().some(q=>R.getSVGElementSize(q,{useBBox:!0}).width>=d.step());else{j=!1;const vt=g.append("text").text("A"),q=R.getSVGElementSize(vt.node(),{useBBox:!0}).width;let Q;g.selectAll("g.tick").each(function(){const ot=I(this),A=parseFloat(b(_n(this),"tx"));A!==null&&Q+ot.text().length*q*.8>=A&&(j=!0),Q=A}),vt.remove()}j?(O||($.ticks(this.getNumberOfFittingTicks(a,w,Rn.ticks.horizontalSpaceRatio)),g.call($),p.call($)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===G.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",j=>j),g.selectAll("g.tick").attr("aria-label",j=>j),L!==De.NONE&&x===J.LABELS&&!C){const j=this.services.cartesianScales.getScaleDomain(n);if(j.length>0){const nt=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(nt);const vt=this;l.selectAll("g.tick text").data(j).text(function(q){return q.length>B?(vt.truncation[n]=!0,as(q,L,D)):q}),this.getInvisibleAxisRef().selectAll("g.tick text").data(j).text(function(q){return q.length>B?as(q,L,D):q}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(j)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=R.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=b(i,"axes",n),a=b(s,"scaleType"),o=b(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:I(this),datum:u}),a===J.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,hoveredElement:I(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:I(this),datum:u}),a===J.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:I(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:I(this),datum:u}),a===J.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 ag(i,2,Rn.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;R.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class NP extends Lv{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=R.appendOrSelect(r,`g.axis.${n}`),s=this;i.selectAll("g.tick").each(function(a,o){const l=I(this);l.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:d}=R.getSVGElementSize(c,{useBBox:!0}),h=R.appendOrSelect(l,"rect.axis-holder");let f=0,p=0;switch(n){case G.LEFT:f=-u+Number(c.attr("x")),p=-(d/2);break;case G.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(d/2);break;case G.TOP:f=-(u/2),p=-d+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,h.attr("transform","rotate(-45)"));break;case G.BOTTOM:f=-(u/2),p=d/2-2,s.truncation[n]&&(f=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",f-Rn.hover.rectanglePadding).attr("y",p).attr("width",u+Rn.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=R.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=b(i,"axes",n),a=b(s,"scaleType"),o=b(s,"truncation","threshold"),l=this;r.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===J.LABELS&&d.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=I(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:I(this).select("text"),datum:I(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()}),a===J.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:I(this),datum:I(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(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:I(this),datum:I(this).select("text").datum()})),n===G.LEFT||n===G.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;R.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 gt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=et.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(G),i=b(this.getOptions(),"axes");r.forEach(o=>{i[G[o]]&&(n[G[o]]=!0)}),this.configs.axes=n,r.forEach(o=>{const l=G[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 Lv(this.model,this.services,c):new NP(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}=R.getSVGElementSize(u,{useBBox:!0});let f;switch(l.getTitleRef().empty()?f=0:(f=R.getSVGElementSize(l.getTitleRef(),{useBBox:!0}).height,(c===G.LEFT||c===G.RIGHT)&&(f+=5)),c){case G.TOP:s.top=h+f;break;case G.BOTTOM:s.bottom=h+f;break;case G.LEFT:s.left=d+f;break;case G.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 gt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=b(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Gt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Gt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Gt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Gt.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===Bt.VERTICAL&&this.drawYGrid(t),n===Bt.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius();this.drawRing(n,0,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=Fe().domain([0,1]).range(t),this.yScale=Fe().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:r,height:i}=R.getSVGElementSize(n,{useAttrs:!0});this.backdrop=R.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",r).attr("height",i);const s=R.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=b(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),s=R.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=b(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(i).map(l=>l*n),a=R.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}=R.getSVGElementSize(i,{useAttrs:!0}),o=R.appendOrSelect(i,"svg.chart-skeleton").attr("width",s).attr("height",a),l=n===0?"pie":"donut",c=b(this.getOptions(),l,"alignment");R.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(Lt.radiusOffset),h=t+(Math.min(s,a)-t*2)/2,f=R.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+Lt.xOffset;c===Ht.CENTER?p=s/2:c===Ht.RIGHT&&(p=s-t-Lt.xOffset);const g=t+Lt.yOffset;f.attr("transform",`translate(${p}, ${g})`)}computeOuterRadius(){const{width:t,height:n}=R.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Lt.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}=R.getSVGElementSize(this.parent,{useAttrs:!0}),c=0,u=l,d=R.appendOrSelect(o,"defs").lower(),h=R.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=`
78
78
  <stop class="${s}" offset="${c}"></stop>
79
79
  <stop class="${a}" offset="${c+.2}"></stop>
80
80
  <stop class="${s}" offset="${c+2*.2}"></stop>
81
- `;h.html(f),p();function p(){h.attr("gradientTransform",`translate(${c-3*.2*l}, 0)`).transition().duration(2e3).delay(1e3).ease(hb).attr("gradientTransform",`translate(${u+3*.2*l}, 0)`).on("end",p)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class xN extends de{constructor(t,n){super(t,n),this.model.setOptions(Pt(yn(Ct.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new Pn(this.model,this.services),new ti(this.model,this.services),new Dv(this.model,this.services),new an(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new oe(this.model,this.services,{skeleton:Gt.GRID})];return this.getAxisChartComponents(t)}}class _N extends ur{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:Co(t,.25),q_50:Co(t,.5),q_75:Co(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(y=>y[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=[],m=[];for(const y of l)y<f||y>p?g.push(y):m.push(y);c.outliers=g;const v=An(m),E=Un(m);c.whiskers={min:v||An([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:E||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(),{number:i,code:s}=b(t,"locale"),a=["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],o=[...r.map(l=>{let c=b(l,"outliers");return(c===null||c.length===0)&&(c=["&ndash;"]),[l[n],b(l,"whiskers","min")!==null?i(b(l,"whiskers","min"),s):"&ndash;",b(l,"quartiles","q_25")!==null?i(b(l,"quartiles","q_25"),s):"&ndash;",b(l,"quartiles","q_50")!==null?i(b(l,"quartiles","q_50"),s):"&ndash;",b(l,"quartiles","q_75")!==null?i(b(l,"quartiles","q_75"),s):"&ndash;",b(l,"whiskers","max")!==null?i(b(l,"whiskers","max"),s):"&ndash;",b(l,"quartiles","q_75")!==null&&b(l,"quartiles","q_25")!==null?(i(b(l,"quartiles","q_75")-b(l,"quartiles","q_25")),s):"&ndash;",c.map(u=>i(u,s)).join(",")]})];return super.formatTable({headers:a,cells:o})}setColorClassNames(){const n=b(this.getOptions(),"color","pairing");let r=b(n,"option");const i=Kg.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 SN extends pt{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(),m=g===Bt.VERTICAL,[v,E]=_n(O=>this.services.cartesianScales.getDomainValue(O),O=>this.services.cartesianScales.getRangeValue(O),g),y=Math.floor((m?h:f)/s.length),x=Math.min(y/2,16),S=this.model.getBoxplotData(),_=n.selectAll(".box-group").data(S);_.exit().remove();const A=_.enter().append("g").attr("class","box-group"),L=_.merge(A);A.append("path").merge(_.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[it.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",De.strokeWidth.default).attr("fill","none").transition().call(O=>this.services.transitions.setupTransition({transition:O,name:"boxplot-update-verticalstartline",animate:t})).attr("d",O=>{const H=p.getDomainValue(O[i]),P=H,M=p.getRangeValue(O.whiskers.min),w=p.getRangeValue(O.quartiles.q_25);return ie({x0:H,x1:P,y0:M,y1:w},g)}),A.append("path").merge(_.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[it.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",De.strokeWidth.default).attr("fill","none").transition().call(O=>this.services.transitions.setupTransition({transition:O,name:"boxplot-update-verticalendline",animate:t})).attr("d",O=>{const H=p.getDomainValue(O[i]),P=H,M=p.getRangeValue(O.whiskers.max),w=p.getRangeValue(O.quartiles.q_75);return ie({x0:H,x1:P,y0:M,y1:w},g)}),A.append("path").merge(_.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[it.FILL,it.STROKE],originalClassName:"box"})).attr("fill-opacity",De.box.opacity.default).attr("stroke-width",De.strokeWidth.default).attr("role",ut.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",O=>O[i]).transition().call(O=>this.services.transitions.setupTransition({transition:O,name:"boxplot-update-quartiles",animate:t})).attr("d",O=>{const H=p.getDomainValue(O[i])-x/2,P=H+x,M=p.getRangeValue(Math[m?"max":"min"](O.quartiles.q_75,O.quartiles.q_25)),w=M+Math.abs(p.getRangeValue(O.quartiles.q_75)-p.getRangeValue(O.quartiles.q_25));return ie({x0:H,x1:P,y0:M,y1:w},g)}),A.append("path").merge(_.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",O=>{const H=p.getDomainValue(O[i])-x/2,P=H+x,M=p.getRangeValue(O.whiskers.min),w=p.getRangeValue(O.whiskers.max);return ie({x0:H,x1:P,y0:M,y1:w},g)}),A.append("path").merge(_.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[it.STROKE],originalClassName:"whisker start"})).attr("stroke-width",De.strokeWidth.thicker).attr("fill","none").transition().call(O=>this.services.transitions.setupTransition({transition:O,name:"boxplot-update-startingwhisker",animate:t})).attr("d",O=>{const H=p.getDomainValue(O[i])-x/4,P=H+x/2,M=p.getRangeValue(O.whiskers.min),w=p.getRangeValue(O.whiskers.min);return ie({x0:H,x1:P,y0:M,y1:w},g)}),A.append("path").merge(_.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[it.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(O=>this.services.transitions.setupTransition({transition:O,name:"boxplot-update-median",animate:t})).attr("d",O=>{const H=p.getDomainValue(O[i])-x/2,P=H+x,M=p.getRangeValue(O.quartiles.q_50);return ie({x0:H,x1:P,y0:M,y1:M},g)}),A.append("path").merge(_.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[it.STROKE],originalClassName:"whisker end"})).attr("stroke-width",De.strokeWidth.thicker).attr("fill","none").transition().call(O=>this.services.transitions.setupTransition({transition:O,name:"boxplot-update-endingwhisker",animate:t})).attr("d",O=>{const H=p.getDomainValue(O[i])-x/4,P=H+x/2,M=p.getRangeValue(O.whiskers.max),w=p.getRangeValue(O.whiskers.max);return ie({x0:H,x1:P,y0:M,y1:w},g)});const B=L.selectAll("circle.outlier").data(O=>O.outliers.map(H=>({min:O.whiskers.min,max:O.whiskers.max,[i]:O[i],value:H})));B.exit().remove();const D=B.enter().append("circle");B.merge(D).attr("r",De.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[it.FILL,it.STROKE],originalClassName:"outlier"})).attr("fill-opacity",De.circle.opacity.default).attr("cx",v).transition().call(O=>this.services.transitions.setupTransition({transition:O,name:"boxplot-update-circles",animate:t})).attr("cy",E),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=I(this);I(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",De.box.opacity.hovered),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:b(n,"locale","translations","group")||b(n,"tooltip","groupLabel")||"Group",value:s[r],class:t.model.getColorClassName({classNameTypes:[it.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=I(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:I(this),datum:s})}).on("mouseout",function(i,s){const a=I(this);I(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",De.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=I(this);o.classed("hovered",!0).attr("fill-opacity",De.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:b(n,"locale","translations","group")||b(n,"tooltip","groupLabel")||"Group",value:a[r],class:t.model.getColorClassName({classNameTypes:[it.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=I(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:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);o.classed("hovered",!1).attr("fill-opacity",De.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 pt{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=em({x0:l,x1:c,y0:u,y1:u},this.services.cartesianScales.getOrientation());R.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 TN extends de{constructor(t,n){super(t,n),this.model=new _N(this.services),this.model.setOptions(Pt(Ct.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new SN(this.model,this.services),new ei(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class ON extends an{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=R.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=s.length>0,l=o?Ie(s):[1,1];return Fe().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]=_n(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",ut.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:[it.FILL,it.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=b(this.getOptions(),"bubble");return[{label:b(n,"radiusLabel"),value:t[b(n,"radiusMapsTo")]}]}}class wN extends de{constructor(t,n){super(t,n),this.model.setOptions(Pt(Ct.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new Pn(this.model,this.services),new ON(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.GRID})];return this.getAxisChartComponents(t)}}class MN extends ur{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(),{number:s,code:a}=b(n,"locale"),o=b(n,"bullet","performanceAreaTitles"),l=["Title","Group","Value","Target","Percentage","Performance"],c=[...t.map(u=>[u.title,u[r],u.value===null?"&ndash;":s(u.value,a),b(u,"marker")===null?"&ndash;":s(u.marker,a),b(u,"marker")===null?"&ndash;":`${s(Math.floor(u[i]/u.marker*100),a)}%`,o[this.getMatchingRangeIndexForDatapoint(u)]])];return super.formatTable({headers:l,cells:c})}}class AN extends pt{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(E=>{E.ranges?E.ranges.forEach((y,x)=>{y!=null&&y<u&&g.push({datum:E,value:y,order:x+1})}):g.push({datum:E,order:1})});const m=R.appendOrSelect(i,"g.range-boxes").selectAll("path.range-box").data(g,E=>`${E[r]}-${E.order}`);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",E=>`range-box order-${E.order}`).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"bullet-range-box-update-enter",animate:t})).attr("d",E=>{let x,S,_,A;return E.order===1?(x=this.services.cartesianScales.getDomainValue(E.datum)-16/2,S=x+16,_=c-2,A=l+1):(x=this.services.cartesianScales.getDomainValue(E.datum)-16/2,S=x+16,_=this.services.cartesianScales.getRangeValue(E.value),A=c),ie({x0:x,x1:S,y0:_,y1:A},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},h=()=>{const g=R.appendOrSelect(i,"g.bars").selectAll("path.bar").data(s,v=>v[r]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).classed("bar",!0).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-bar-update-enter",animate:t})).attr("class",v=>this.model.getColorClassName({classNameTypes:[it.FILL],dataGroupName:v[r],originalClassName:"bar"})).style("fill",v=>{const E=this.services.cartesianScales.getDomainIdentifier(v);return this.model.getFillColor(v[r],v[E],v)}).attr("d",v=>{const y=this.services.cartesianScales.getDomainValue(v)-4,x=y+8,S=this.services.cartesianScales.getRangeValue(0)+1,_=this.services.cartesianScales.getRangeValue(v);return ie({x0:y,x1:x,y0:S,y1:_},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ut.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",v=>v.value)},f=()=>{const g=R.appendOrSelect(i,"g.markers").selectAll("path.marker").data(s.filter(v=>b(v,"marker")!==null),v=>v[r]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).classed("marker",!0).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-marker-update-enter",animate:t})).attr("d",v=>{const y=this.services.cartesianScales.getDomainValue(v)-12,x=y+24,S=this.services.cartesianScales.getRangeValue(v.marker);return ie({x0:y,x1:x,y0:S,y1:S},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{let g=[];s.filter(E=>b(E,"marker")!==null).forEach(E=>{const y=E.marker,x=E[o];g=g.concat([{datum:E,value:y*.25,barValue:x},{datum:E,value:y*.5,barValue:x},{datum:E,value:y*.75,barValue:x}])});const m=R.appendOrSelect(i,"g.quartiles").selectAll("path.quartile").data(g,E=>E[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",E=>`quartile ${E.value<=E.barValue?"over-bar":""}`).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:E,value:y})=>{let x=4;E.ranges&&E.ranges.indexOf(y)!==-1&&(x=8);const S=this.services.cartesianScales.getDomainValue(E)-x/2,_=S+x,A=this.services.cartesianScales.getRangeValue(y);return ie({x0:S,x1:_,y0:A,y1:A},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(),{code:s,number:a}=b(n,"locale");this.parent.selectAll("path.bar").on("mouseover",function(o,l){const c=I(this);c.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:o,element:c,datum:l});const u=b(n,"bullet","performanceAreaTitles"),d=t.model.getMatchingRangeIndexForDatapoint(l);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:o,hoveredElement:c,items:[{label:b(n,"locale","translations","group")||b(n,"tooltip","groupLabel")||"Group",value:l[r],class:t.model.getColorClassName({classNameTypes:[it.TOOLTIP],dataGroupName:l[r]})},{label:"Value",value:l[i]},{label:"Target",value:l.marker},{label:"Percentage",value:`${a(Math.floor(l[i]/l.marker*100),s)}%`},{label:"Performance",value:u[d]}]})}).on("mousemove",function(o,l){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:o,element:I(this),datum:l}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:o})}).on("click",function(o,l){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:o,element:I(this),datum:l})}).on("mouseout",function(o,l){const c=I(this);c.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:o,element:c,datum:l}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:c})})}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 CN extends de{constructor(t,n){super(t,n),this.model=new MN(this.services),this.model.setOptions(Pt(Ct.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new AN(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.GRID})];return this.getAxisChartComponents(t)}}function Iv(e){const t=Ie(e,r=>r.value),n=Fe().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 kv(e,t){const n=b(t,"gradient","colors"),r=!He(n);let i=b(t,"pairing","option");const s=Iv(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 DN extends rn{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(),{number:n,code:r}=b(this.getOptions(),"locale"),i=["Country ID","Country Name","Value"],s=[...t.map(a=>[a.id===null?"&ndash;":a.id,a.name,a.value===null?"&ndash;":n(a.value,r)])];return super.formatTable({headers:i,cells:s})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=b(this.getOptions(),"color");this._colorScale=kv(this.getDisplayData(),t)}}function LN(e){return e}function RN(e){if(e==null)return LN;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 IN(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function kN(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return Pv(e,n)})}:Pv(e,t)}function Pv(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,s=Yu(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 Yu(e,t){var n=RN(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&&IN(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 PN(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 m=p===f?f:p.concat(f);r[m.start=p.start]=i[m.end=f.end]=m}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 NN(e){for(var t=-1,n=e.length,r,i=e[n-1],s=0;++t<n;)r=i,i=e[t],s+=r[0]*i[1]-r[1]*i[0];return Math.abs(s)}function $N(e){return Yu(e,FN.apply(this,arguments))}function FN(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 NN(Yu(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(m){m.forEach(function(v){n[v<0?~v:v].length<2&&c.push(v)})})}),c=PN(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 UN extends Pn{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===Bt.VERTICAL?n:r),f=R.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),p=R.appendOrSelect(f,"line.ruler-line"),m=i.selectAll("[role=graphics-symbol]").filter(v=>{if(parseFloat(yt(v,"data.x0"))<=h&&parseFloat(yt(v,"data.x1"))>=h)return!0});if(m.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Vg(this.elementsToHighlight,m)&&this.hideRuler(),m.dispatch("mouseover"),this.elementsToHighlight=m;const v=I(m.nodes()[0]).datum(),E=parseFloat(yt(v,"data.x0")),y=parseFloat(yt(v,"data.x1")),x=this.model.getActiveDataGroupNames(),S=x.reverse().map(A=>({label:A,value:yt(v,`data.${A}`),class:this.model.getColorClassName({classNameTypes:[it.TOOLTIP],dataGroupName:A})})).filter(A=>A.value!==0);if(S.length>0){this.services.events.dispatchEvent(T.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:p,items:[{label:yt(s,"bins.rangeLabel")||"Range",value:`${E} – ${y}`},...S,...b(s,"tooltip","showTotal")===!0?[{label:yt(s,"locale.translations.total")||yt(s,"tooltip.totalLabel")||"Total",value:x.reduce((L,B)=>L+parseFloat(yt(v,`data.${B}`)),0)}]:[]]}),f.attr("opacity",1);const A=d((E+y)/2);o==="horizontal"?p.attr("x1",u).attr("x2",c).attr("y1",A).attr("y2",A):p.attr("y1",u).attr("y2",c).attr("x1",A).attr("x2",A)}else this.hideRuler()}else this.hideRuler()}}class yo extends Pn{formatTooltipData(t){return t.reverse()}}class Nv extends Ru{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}=R.getSVGElementSize(i,{useAttrs:!0}),a=b(this.getOptions(),"data","loading");if(s>Nt.color.barWidth&&!a){const o=b(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}=R.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}=R.getSVGElementSize(r,{useAttrs:!0}),s=b(n,"color","gradient","colors"),a=b(n,this.chartType,"colorLegend","type");let o=b(n,"color","pairing","option");const l=b(n,"heatmap","colorLegend","title");if(b(this.getOptions(),"data","loading")){r.html("");return}const u=!He(s),d=Iv(this.model.getDisplayData()),h=!(i<=Nt.color.barWidth),f=h?Nt.color.barWidth:i,p=R.appendOrSelect(r,"g.legend"),g=R.appendOrSelect(p,"g.legend-axis");if(l){const D=R.appendOrSelect(r,"g.legend-title");R.appendOrSelect(D,"text").text(l).attr("dy","0.7em"),p.attr("transform","translate(0, 16)")}const m=d[0]<0&&d[1]>0?"diverge":"mono";(o<1&&o>4&&m==="mono"||o<1&&o>2&&m==="diverge")&&(o=1);let v=[];const E=m==="diverge"?17:11;if(u)v=s;else for(let D=1;D<E+1;D++)v.push(a===ns.LINEAR?`stop-color-${m}-${o}-${D}`:`fill-${m}-${o}-${D}`);const y=ve(d[0],d[1]),x=rE(y,3),S=Fe().domain(d).range([0,f]),_=Lo(S).tickSize(0).tickValues(x),{code:A,number:L}=b(n,"locale");_.tickFormat(D=>L(D,A));let B;switch(a){case ns.LINEAR:this.drawLinear(v,p,f);break;case ns.QUANTIZE:B=this.drawQuantize(v,m,u,p,f),S.range([B,f]);break;default:throw Error("Entered color legend type is not supported.")}g.attr("transform",`translate(0,${Nt.color.axisYTranslation})`).call(_),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);R.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),R.appendOrSelect(n,"rect").attr("width",r).attr("height",Nt.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 R.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",Nt.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 BN extends gs{constructor(){super(...arguments),this.type="meter-title",this.renderType=tt.SVG}render(t=!1){const n=b(this.model.getDisplayData(),0),r=this.getOptions(),i=this.getComponentContainer(),{groupMapsTo:s}=r.data,a=r.locale.translations.meter.title;if(b(r,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const u=i.selectAll("text.meter-title").data(a?[a]:[n[s]]);u.enter().append("text").classed("meter-title",!0).merge(u).attr("x",0).attr("y","1em").text(d=>d),u.exit().remove(),this.appendPercentage()}this.displayStatus();const l=this.getMaxTitleWidth(),c=R.appendOrSelect(i,"text.meter-title");l>0&&c.node().getComputedTextLength()>l&&this.truncateTitle(c,l)}displayBreakdownTitle(){const t=this.getComponentContainer(),n=this.getOptions(),r=this.model.getMaximumDomain(this.model.getDisplayData()),i=b(n,"meter","proportional","total"),s=b(n,"meter","proportional","unit")?b(n,"meter","proportional","unit"):"";let a;if(r===i)a=null;else{const u=i!==null?i-r:r,d=b(n,"meter","proportional","breakdownFormatter"),{code:h,number:f}=b(n,"locale");a=d!==null?d({datasetsTotal:r,total:i}):`${f(r,h)} ${s} used (${f(u,h)} ${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=R.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=b(n,"meter","proportional","total"),i=r?b(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),s=b(n,"meter","proportional","unit")?b(n,"meter","proportional","unit"):"",a=b(n,"meter","proportional","totalFormatter"),{code:o,number:l}=b(n,"locale"),c=a!==null?a(i):`${l(r,o)} ${s} total`,u=R.getHTMLElementSize(this.parent.node()).width,d=t.selectAll("text.proportional-meter-total").data([c]);d.enter().append("text").classed("proportional-meter-total",!0).merge(d).attr("x",this.model.getStatus()&&typeof u!="string"?u-jt.total.paddingRight:u).attr("y","1em").attr("text-anchor","end").text(h=>h),d.exit().remove()}displayStatus(){const t=this,n=this.getComponentContainer(),r=R.getHTMLElementSize(this.parent.node()).width||0,i=this.model.getStatus(),s=jt.status.indicatorSize/2,a=R.appendOrSelect(n,"g.status-indicator").attr("class",i!==null?`status-indicator status--${i}`:"").attr("transform",`translate(${r-s}, 0)`),o=i?[i]:[],l=a.selectAll("circle.status").data(o);l.enter().append("circle").merge(l).attr("class","status").attr("r",s).attr("cx",0).attr("cy",8);const c=a.selectAll("path.innerFill").data(o);c.enter().append("path").merge(c).attr("d",t.getStatusIconPathString(i)).attr("transform",`translate(-${s}, 0)`).attr("class","innerFill"),c.exit().remove(),l.exit().remove()}appendPercentage(){const t=b(this.model.getDisplayData(),0,"value"),{code:n,number:r}=b(this.getOptions(),"locale"),i=this.getComponentContainer(),s=R.appendOrSelect(i,"text.meter-title"),a=b(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],o=i.selectAll("text.percent-value").data(a),l=jt.statusBar.paddingRight;o.enter().append("text").classed("percent-value",!0).merge(o).text(c=>`${c!=null?r(c,n):0}%`).attr("x",+s.attr("x")+s.node().getComputedTextLength()+l).attr("y",s.attr("y")),o.exit().remove()}truncateTitle(t,n){super.truncateTitle(t,n);const r=R.appendOrSelect(this.parent,"tspan"),i=jt.statusBar.paddingRight,s=Math.ceil(r.node().getComputedTextLength());R.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+s+i)}getMaxTitleWidth(){const t=b(this.getOptions(),"meter","proportional"),n=R.getHTMLElementSize(this.parent.node()).width;if(t!==null){const r=R.appendOrSelect(this.parent,"text.proportional-meter-total").node(),i=R.getSVGElementSize(r,{useBBox:!0}).width;return n-i-jt.total.paddingLeft}else{const r=R.appendOrSelect(this.parent,"text.percent-value"),i=jt.statusBar.paddingRight,s=r.node().getComputedTextLength(),a=R.appendOrSelect(this.parent,"g.status-indicator").node(),o=R.getSVGElementSize(a,{useBBox:!0}).width+jt.status.paddingLeft;return n-s-i-o}}getStatusIconPathString(t){switch(t){case ts.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 ts.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case ts.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 qu extends pt{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=R.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!r.step){const s=b(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 HN extends pt{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:Xr.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}=R.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=b(l,"canvasZoom","enabled");a&&b(s,0,"children")&&(s=b(s,0,"children"));const u=Di({children:s}).sum(g=>g.value).sort((g,m)=>m.value-g.value),h=y_().size([r,i]).padding(g=>g.depth>=1?Xr.padding.children+3:Xr.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 m=c&&o===3?this.getZoomClass(g):"";return this.model.getColorClassName({classNameTypes:[it.FILL,it.STROKE],dataGroupName:g.data.dataGroupName,originalClassName:g.children?`node ${m}`:`node node-leaf ${m}`})}).style("fill",g=>this.model.getFillColor(g.data.dataGroupName,null,g.data)).style("stroke",g=>this.model.getFillColor(g.data.dataGroupName,null,g.data)).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",Xr.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,p,qr),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,null,r.data))}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",Xr.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(){I(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=I(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,qr)})}getZoomIcon(){return`
81
+ `;h.html(f),p();function p(){h.attr("gradientTransform",`translate(${c-3*.2*l}, 0)`).transition().duration(2e3).delay(1e3).ease(cb).attr("gradientTransform",`translate(${u+3*.2*l}, 0)`).on("end",p)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class $P extends de{constructor(t,n){super(t,n),this.model.setOptions(Pt(En(Ct.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new Pn(this.model,this.services),new ti(this.model,this.services),new Cv(this.model,this.services),new sn(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new oe(this.model,this.services,{skeleton:Gt.GRID})];return this.getAxisChartComponents(t)}}class FP extends hr{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:Co(t,.25),q_50:Co(t,.5),q_75:Co(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(y=>y[o]).sort(Ie),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=[],m=[];for(const y of l)y<f||y>p?g.push(y):m.push(y);c.outliers=g;const v=Cn(m),E=Bn(m);c.whiskers={min:v||Cn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:E||Bn([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(),{number:i,code:s}=b(t,"locale"),a=["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],o=[...r.map(l=>{let c=b(l,"outliers");return(c===null||c.length===0)&&(c=["&ndash;"]),[l[n],b(l,"whiskers","min")!==null?i(b(l,"whiskers","min"),s):"&ndash;",b(l,"quartiles","q_25")!==null?i(b(l,"quartiles","q_25"),s):"&ndash;",b(l,"quartiles","q_50")!==null?i(b(l,"quartiles","q_50"),s):"&ndash;",b(l,"quartiles","q_75")!==null?i(b(l,"quartiles","q_75"),s):"&ndash;",b(l,"whiskers","max")!==null?i(b(l,"whiskers","max"),s):"&ndash;",b(l,"quartiles","q_75")!==null&&b(l,"quartiles","q_25")!==null?(i(b(l,"quartiles","q_75")-b(l,"quartiles","q_25")),s):"&ndash;",c.map(u=>i(u,s)).join(",")]})];return super.formatTable({headers:a,cells:o})}setColorClassNames(){const n=b(this.getOptions(),"color","pairing");let r=b(n,"option");const i=jg.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 UP extends gt{constructor(){super(...arguments),this.type="boxplot",this.renderType=et.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(),m=g===Bt.VERTICAL,[v,E]=Sn(O=>this.services.cartesianScales.getDomainValue(O),O=>this.services.cartesianScales.getRangeValue(O),g),y=Math.floor((m?h:f)/s.length),x=Math.min(y/2,16),S=this.model.getBoxplotData(),_=n.selectAll(".box-group").data(S);_.exit().remove();const C=_.enter().append("g").attr("class","box-group"),L=_.merge(C);C.append("path").merge(_.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",Le.strokeWidth.default).attr("fill","none").transition().call(O=>this.services.transitions.setupTransition({transition:O,name:"boxplot-update-verticalstartline",animate:t})).attr("d",O=>{const H=p.getDomainValue(O[i]),P=H,M=p.getRangeValue(O.whiskers.min),w=p.getRangeValue(O.quartiles.q_25);return ie({x0:H,x1:P,y0:M,y1:w},g)}),C.append("path").merge(_.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",Le.strokeWidth.default).attr("fill","none").transition().call(O=>this.services.transitions.setupTransition({transition:O,name:"boxplot-update-verticalendline",animate:t})).attr("d",O=>{const H=p.getDomainValue(O[i]),P=H,M=p.getRangeValue(O.whiskers.max),w=p.getRangeValue(O.quartiles.q_75);return ie({x0:H,x1:P,y0:M,y1:w},g)}),C.append("path").merge(_.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],originalClassName:"box"})).attr("fill-opacity",Le.box.opacity.default).attr("stroke-width",Le.strokeWidth.default).attr("role",ut.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",O=>O[i]).transition().call(O=>this.services.transitions.setupTransition({transition:O,name:"boxplot-update-quartiles",animate:t})).attr("d",O=>{const H=p.getDomainValue(O[i])-x/2,P=H+x,M=p.getRangeValue(Math[m?"max":"min"](O.quartiles.q_75,O.quartiles.q_25)),w=M+Math.abs(p.getRangeValue(O.quartiles.q_75)-p.getRangeValue(O.quartiles.q_25));return ie({x0:H,x1:P,y0:M,y1:w},g)}),C.append("path").merge(_.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",O=>{const H=p.getDomainValue(O[i])-x/2,P=H+x,M=p.getRangeValue(O.whiskers.min),w=p.getRangeValue(O.whiskers.max);return ie({x0:H,x1:P,y0:M,y1:w},g)}),C.append("path").merge(_.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.STROKE],originalClassName:"whisker start"})).attr("stroke-width",Le.strokeWidth.thicker).attr("fill","none").transition().call(O=>this.services.transitions.setupTransition({transition:O,name:"boxplot-update-startingwhisker",animate:t})).attr("d",O=>{const H=p.getDomainValue(O[i])-x/4,P=H+x/2,M=p.getRangeValue(O.whiskers.min),w=p.getRangeValue(O.whiskers.min);return ie({x0:H,x1:P,y0:M,y1:w},g)}),C.append("path").merge(_.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[at.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(O=>this.services.transitions.setupTransition({transition:O,name:"boxplot-update-median",animate:t})).attr("d",O=>{const H=p.getDomainValue(O[i])-x/2,P=H+x,M=p.getRangeValue(O.quartiles.q_50);return ie({x0:H,x1:P,y0:M,y1:M},g)}),C.append("path").merge(_.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.STROKE],originalClassName:"whisker end"})).attr("stroke-width",Le.strokeWidth.thicker).attr("fill","none").transition().call(O=>this.services.transitions.setupTransition({transition:O,name:"boxplot-update-endingwhisker",animate:t})).attr("d",O=>{const H=p.getDomainValue(O[i])-x/4,P=H+x/2,M=p.getRangeValue(O.whiskers.max),w=p.getRangeValue(O.whiskers.max);return ie({x0:H,x1:P,y0:M,y1:w},g)});const B=L.selectAll("circle.outlier").data(O=>O.outliers.map(H=>({min:O.whiskers.min,max:O.whiskers.max,[i]:O[i],value:H})));B.exit().remove();const D=B.enter().append("circle");B.merge(D).attr("r",Le.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],originalClassName:"outlier"})).attr("fill-opacity",Le.circle.opacity.default).attr("cx",v).transition().call(O=>this.services.transitions.setupTransition({transition:O,name:"boxplot-update-circles",animate:t})).attr("cy",E),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=I(this);I(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",Le.box.opacity.hovered),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:b(n,"locale","translations","group")||b(n,"tooltip","groupLabel")||"Group",value:s[r],class:t.model.getColorClassName({classNameTypes:[at.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=I(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:I(this),datum:s})}).on("mouseout",function(i,s){const a=I(this);I(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",Le.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=I(this);o.classed("hovered",!0).attr("fill-opacity",Le.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:b(n,"locale","translations","group")||b(n,"tooltip","groupLabel")||"Group",value:a[r],class:t.model.getColorClassName({classNameTypes:[at.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=I(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:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);o.classed("hovered",!1).attr("fill-opacity",Le.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 gt{constructor(){super(...arguments),this.type="zero-line",this.renderType=et.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=Jg({x0:l,x1:c,y0:u,y1:u},this.services.cartesianScales.getOrientation());R.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 BP extends de{constructor(t,n){super(t,n),this.model=new FP(this.services),this.model.setOptions(Pt(Ct.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new UP(this.model,this.services),new ei(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class HP extends sn{constructor(){super(...arguments),this.type="bubble",this.renderType=et.SVG}getRadiusScale(t){const n=this.getOptions(),{radiusMapsTo:r}=n.bubble,i=t.data(),s=i.map(c=>c[r]).filter(c=>c),a=R.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=s.length>0,l=o?ke(s):[1,1];return Fe().domain(l).range(o?n.bubble.radiusRange(a,i):[4,4])}styleCircles(t,n){const r=this.getOptions(),{radiusMapsTo:i}=r.bubble,s=this.getRadiusScale(t),{groupMapsTo:a}=r.data,{cartesianScales:o}=this.services,l=h=>o.getDomainValue(h),c=h=>o.getRangeValue(h),[u,d]=Sn(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",ut.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:[at.FILL,at.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=b(this.getOptions(),"bubble");return[{label:b(n,"radiusLabel"),value:t[b(n,"radiusMapsTo")]}]}}class GP extends de{constructor(t,n){super(t,n),this.model.setOptions(Pt(Ct.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new Pn(this.model,this.services),new HP(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.GRID})];return this.getAxisChartComponents(t)}}class VP extends hr{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(),{number:s,code:a}=b(n,"locale"),o=b(n,"bullet","performanceAreaTitles"),l=["Title","Group","Value","Target","Percentage","Performance"],c=[...t.map(u=>[u.title,u[r],u.value===null?"&ndash;":s(u.value,a),b(u,"marker")===null?"&ndash;":s(u.marker,a),b(u,"marker")===null?"&ndash;":`${s(Math.floor(u[i]/u.marker*100),a)}%`,o[this.getMatchingRangeIndexForDatapoint(u)]])];return super.formatTable({headers:l,cells:c})}}class zP extends gt{constructor(){super(...arguments),this.type="bullet",this.renderType=et.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(E=>{E.ranges?E.ranges.forEach((y,x)=>{y!=null&&y<u&&g.push({datum:E,value:y,order:x+1})}):g.push({datum:E,order:1})});const m=R.appendOrSelect(i,"g.range-boxes").selectAll("path.range-box").data(g,E=>`${E[r]}-${E.order}`);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",E=>`range-box order-${E.order}`).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"bullet-range-box-update-enter",animate:t})).attr("d",E=>{let x,S,_,C;return E.order===1?(x=this.services.cartesianScales.getDomainValue(E.datum)-16/2,S=x+16,_=c-2,C=l+1):(x=this.services.cartesianScales.getDomainValue(E.datum)-16/2,S=x+16,_=this.services.cartesianScales.getRangeValue(E.value),C=c),ie({x0:x,x1:S,y0:_,y1:C},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},h=()=>{const g=R.appendOrSelect(i,"g.bars").selectAll("path.bar").data(s,v=>v[r]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).classed("bar",!0).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-bar-update-enter",animate:t})).attr("class",v=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:v[r],originalClassName:"bar"})).style("fill",v=>{const E=this.services.cartesianScales.getDomainIdentifier(v);return this.model.getFillColor(v[r],v[E],v)}).attr("d",v=>{const y=this.services.cartesianScales.getDomainValue(v)-4,x=y+8,S=this.services.cartesianScales.getRangeValue(0)+1,_=this.services.cartesianScales.getRangeValue(v);return ie({x0:y,x1:x,y0:S,y1:_},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ut.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",v=>v.value)},f=()=>{const g=R.appendOrSelect(i,"g.markers").selectAll("path.marker").data(s.filter(v=>b(v,"marker")!==null),v=>v[r]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).classed("marker",!0).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-marker-update-enter",animate:t})).attr("d",v=>{const y=this.services.cartesianScales.getDomainValue(v)-12,x=y+24,S=this.services.cartesianScales.getRangeValue(v.marker);return ie({x0:y,x1:x,y0:S,y1:S},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{let g=[];s.filter(E=>b(E,"marker")!==null).forEach(E=>{const y=E.marker,x=E[o];g=g.concat([{datum:E,value:y*.25,barValue:x},{datum:E,value:y*.5,barValue:x},{datum:E,value:y*.75,barValue:x}])});const m=R.appendOrSelect(i,"g.quartiles").selectAll("path.quartile").data(g,E=>E[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).attr("class",E=>`quartile ${E.value<=E.barValue?"over-bar":""}`).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:E,value:y})=>{let x=4;E.ranges&&E.ranges.indexOf(y)!==-1&&(x=8);const S=this.services.cartesianScales.getDomainValue(E)-x/2,_=S+x,C=this.services.cartesianScales.getRangeValue(y);return ie({x0:S,x1:_,y0:C,y1:C},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(),{code:s,number:a}=b(n,"locale");this.parent.selectAll("path.bar").on("mouseover",function(o,l){const c=I(this);c.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:o,element:c,datum:l});const u=b(n,"bullet","performanceAreaTitles"),d=t.model.getMatchingRangeIndexForDatapoint(l);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:o,hoveredElement:c,items:[{label:b(n,"locale","translations","group")||b(n,"tooltip","groupLabel")||"Group",value:l[r],class:t.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:l[r]})},{label:"Value",value:l[i]},{label:"Target",value:l.marker},{label:"Percentage",value:`${a(Math.floor(l[i]/l.marker*100),s)}%`},{label:"Performance",value:u[d]}]})}).on("mousemove",function(o,l){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:o,element:I(this),datum:l}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:o})}).on("click",function(o,l){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:o,element:I(this),datum:l})}).on("mouseout",function(o,l){const c=I(this);c.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:o,element:c,datum:l}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:c})})}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 WP extends de{constructor(t,n){super(t,n),this.model=new VP(this.services),this.model.setOptions(Pt(Ct.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new zP(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.GRID})];return this.getAxisChartComponents(t)}}function Rv(e){const t=ke(e,r=>r.value),n=Fe().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 Iv(e,t){const n=b(t,"gradient","colors"),r=!He(n);let i=b(t,"pairing","option");const s=Rv(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 YP 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(),{number:n,code:r}=b(this.getOptions(),"locale"),i=["Country ID","Country Name","Value"],s=[...t.map(a=>[a.id===null?"&ndash;":a.id,a.name,a.value===null?"&ndash;":n(a.value,r)])];return super.formatTable({headers:i,cells:s})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=b(this.getOptions(),"color");this._colorScale=Iv(this.getDisplayData(),t)}}function qP(e){return e}function XP(e){if(e==null)return qP;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 jP(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function ZP(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return kv(e,n)})}:kv(e,t)}function kv(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,s=Yu(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 Yu(e,t){var n=XP(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&&jP(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 KP(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 m=p===f?f:p.concat(f);r[m.start=p.start]=i[m.end=f.end]=m}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 QP(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 JP(e){return Yu(e,tN.apply(this,arguments))}function tN(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 QP(Yu(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(m){m.forEach(function(v){n[v<0?~v:v].length<2&&c.push(v)})})}),c=KP(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 eN extends Pn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=et.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===Bt.VERTICAL?n:r),f=R.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),p=R.appendOrSelect(f,"line.ruler-line"),m=i.selectAll("[role=graphics-symbol]").filter(v=>{if(parseFloat(yt(v,"data.x0"))<=h&&parseFloat(yt(v,"data.x1"))>=h)return!0});if(m.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Hg(this.elementsToHighlight,m)&&this.hideRuler(),m.dispatch("mouseover"),this.elementsToHighlight=m;const v=I(m.nodes()[0]).datum(),E=parseFloat(yt(v,"data.x0")),y=parseFloat(yt(v,"data.x1")),x=this.model.getActiveDataGroupNames(),S=x.reverse().map(C=>({label:C,value:yt(v,`data.${C}`),class:this.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:C})})).filter(C=>C.value!==0);if(S.length>0){this.services.events.dispatchEvent(T.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:p,items:[{label:yt(s,"bins.rangeLabel")||"Range",value:`${E} – ${y}`},...S,...b(s,"tooltip","showTotal")===!0?[{label:yt(s,"locale.translations.total")||yt(s,"tooltip.totalLabel")||"Total",value:x.reduce((L,B)=>L+parseFloat(yt(v,`data.${B}`)),0)}]:[]]}),f.attr("opacity",1);const C=d((E+y)/2);o==="horizontal"?p.attr("x1",u).attr("x2",c).attr("y1",C).attr("y2",C):p.attr("y1",u).attr("y2",c).attr("x1",C).attr("x2",C)}else this.hideRuler()}else this.hideRuler()}}class yo extends Pn{formatTooltipData(t){return t.reverse()}}class Pv extends Ru{constructor(t,n,r){super(t,n,r),this.type="color-legend",this.renderType=et.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const i=this.getComponentContainer(),{width:s}=R.getSVGElementSize(i,{useAttrs:!0}),a=b(this.getOptions(),"data","loading");if(s>Nt.color.barWidth&&!a){const o=b(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}=R.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}=R.getSVGElementSize(r,{useAttrs:!0}),s=b(n,"color","gradient","colors"),a=b(n,this.chartType,"colorLegend","type");let o=b(n,"color","pairing","option");const l=b(n,"heatmap","colorLegend","title");if(b(this.getOptions(),"data","loading")){r.html("");return}const u=!He(s),d=Rv(this.model.getDisplayData()),h=!(i<=Nt.color.barWidth),f=h?Nt.color.barWidth:i,p=R.appendOrSelect(r,"g.legend"),g=R.appendOrSelect(p,"g.legend-axis");if(l){const D=R.appendOrSelect(r,"g.legend-title");R.appendOrSelect(D,"text").text(l).attr("dy","0.7em"),p.attr("transform","translate(0, 16)")}const m=d[0]<0&&d[1]>0?"diverge":"mono";(o<1&&o>4&&m==="mono"||o<1&&o>2&&m==="diverge")&&(o=1);let v=[];const E=m==="diverge"?17:11;if(u)v=s;else for(let D=1;D<E+1;D++)v.push(a===rs.LINEAR?`stop-color-${m}-${o}-${D}`:`fill-${m}-${o}-${D}`);const y=ve(d[0],d[1]),x=eE(y,3),S=Fe().domain(d).range([0,f]),_=Lo(S).tickSize(0).tickValues(x),{code:C,number:L}=b(n,"locale");_.tickFormat(D=>L(D,C));let B;switch(a){case rs.LINEAR:this.drawLinear(v,p,f);break;case rs.QUANTIZE:B=this.drawQuantize(v,m,u,p,f),S.range([B,f]);break;default:throw Error("Entered color legend type is not supported.")}g.attr("transform",`translate(0,${Nt.color.axisYTranslation})`).call(_),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);R.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),R.appendOrSelect(n,"rect").attr("width",r).attr("height",Nt.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=ki().domain(t).range([0,s]);return R.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",Nt.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 nN extends ms{constructor(){super(...arguments),this.type="meter-title",this.renderType=et.SVG}render(t=!1){const n=b(this.model.getDisplayData(),0),r=this.getOptions(),i=this.getComponentContainer(),{groupMapsTo:s}=r.data,a=r.locale.translations.meter.title;if(b(r,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const u=i.selectAll("text.meter-title").data(a?[a]:[n[s]]);u.enter().append("text").classed("meter-title",!0).merge(u).attr("x",0).attr("y","1em").text(d=>d),u.exit().remove(),this.appendPercentage()}this.displayStatus();const l=this.getMaxTitleWidth(),c=R.appendOrSelect(i,"text.meter-title");l>0&&c.node().getComputedTextLength()>l&&this.truncateTitle(c,l)}displayBreakdownTitle(){const t=this.getComponentContainer(),n=this.getOptions(),r=this.model.getMaximumDomain(this.model.getDisplayData()),i=b(n,"meter","proportional","total"),s=b(n,"meter","proportional","unit")?b(n,"meter","proportional","unit"):"";let a;if(r===i)a=null;else{const u=i!==null?i-r:r,d=b(n,"meter","proportional","breakdownFormatter"),{code:h,number:f}=b(n,"locale");a=d!==null?d({datasetsTotal:r,total:i}):`${f(r,h)} ${s} used (${f(u,h)} ${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=R.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=b(n,"meter","proportional","total"),i=r?b(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),s=b(n,"meter","proportional","unit")?b(n,"meter","proportional","unit"):"",a=b(n,"meter","proportional","totalFormatter"),{code:o,number:l}=b(n,"locale"),c=a!==null?a(i):`${l(r,o)} ${s} total`,u=R.getHTMLElementSize(this.parent.node()).width,d=t.selectAll("text.proportional-meter-total").data([c]);d.enter().append("text").classed("proportional-meter-total",!0).merge(d).attr("x",this.model.getStatus()&&typeof u!="string"?u-jt.total.paddingRight:u).attr("y","1em").attr("text-anchor","end").text(h=>h),d.exit().remove()}displayStatus(){const t=this,n=this.getComponentContainer(),r=R.getHTMLElementSize(this.parent.node()).width||0,i=this.model.getStatus(),s=jt.status.indicatorSize/2,a=R.appendOrSelect(n,"g.status-indicator").attr("class",i!==null?`status-indicator status--${i}`:"").attr("transform",`translate(${r-s}, 0)`),o=i?[i]:[],l=a.selectAll("circle.status").data(o);l.enter().append("circle").merge(l).attr("class","status").attr("r",s).attr("cx",0).attr("cy",8);const c=a.selectAll("path.innerFill").data(o);c.enter().append("path").merge(c).attr("d",t.getStatusIconPathString(i)).attr("transform",`translate(-${s}, 0)`).attr("class","innerFill"),c.exit().remove(),l.exit().remove()}appendPercentage(){const t=b(this.model.getDisplayData(),0,"value"),{code:n,number:r}=b(this.getOptions(),"locale"),i=this.getComponentContainer(),s=R.appendOrSelect(i,"text.meter-title"),a=b(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],o=i.selectAll("text.percent-value").data(a),l=jt.statusBar.paddingRight;o.enter().append("text").classed("percent-value",!0).merge(o).text(c=>`${c!=null?r(c,n):0}%`).attr("x",+s.attr("x")+s.node().getComputedTextLength()+l).attr("y",s.attr("y")),o.exit().remove()}truncateTitle(t,n){super.truncateTitle(t,n);const r=R.appendOrSelect(this.parent,"tspan"),i=jt.statusBar.paddingRight,s=Math.ceil(r.node().getComputedTextLength());R.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+s+i)}getMaxTitleWidth(){const t=b(this.getOptions(),"meter","proportional"),n=R.getHTMLElementSize(this.parent.node()).width;if(t!==null){const r=R.appendOrSelect(this.parent,"text.proportional-meter-total").node(),i=R.getSVGElementSize(r,{useBBox:!0}).width;return n-i-jt.total.paddingLeft}else{const r=R.appendOrSelect(this.parent,"text.percent-value"),i=jt.statusBar.paddingRight,s=r.node().getComputedTextLength(),a=R.appendOrSelect(this.parent,"g.status-indicator").node(),o=R.getSVGElementSize(a,{useBBox:!0}).width+jt.status.paddingLeft;return n-s-i-o}}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 qu extends gt{getBarWidth(){const t=this.getOptions();if(t.bars.width)return t.bars.width;const n=this.model.getDisplayData().length,r=this.services.cartesianScales.getMainXScale(),i=R.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!r.step){const s=b(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 rN extends gt{constructor(){super(...arguments),this.type="circle-pack",this.renderType=et.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:Xr.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}=R.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=b(l,"canvasZoom","enabled");a&&b(s,0,"children")&&(s=b(s,0,"children"));const u=Li({children:s}).sum(g=>g.value).sort((g,m)=>m.value-g.value),h=g_().size([r,i]).padding(g=>g.depth>=1?Xr.padding.children+3:Xr.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 m=c&&o===3?this.getZoomClass(g):"";return this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:g.data.dataGroupName,originalClassName:g.children?`node ${m}`:`node node-leaf ${m}`})}).style("fill",g=>this.model.getFillColor(g.data.dataGroupName,null,g.data)).style("stroke",g=>this.model.getFillColor(g.data.dataGroupName,null,g.data)).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",Xr.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,p,qr),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,null,r.data))}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",Xr.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(){I(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=I(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,qr)})}getZoomIcon(){return`
82
82
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
83
83
  <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"/>
84
84
  <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"/>
85
- </svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=b(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:yt(f,"locale.translations.total")||yt(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=I(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=I(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=I(this),s=i.classed("non-focal"),a=b(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,qr)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,qr),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 GN(e,t){const n=pi(this._current,e);return r=>(this._current=n(r),t(this._current))}class $v extends pt{constructor(){super(...arguments),this.type="pie",this.renderType=tt.SVG,this.isRendering=!1,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 Lt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(M=>M[a]>0),l=this.computeRadius();this.arc=Ui().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Ui().innerRadius(this.getInnerRadius()).outerRadius(l+Lt.hoverArc.outerRadiusOffset);const u=gT().value(M=>M[a]).sort(b(i,"pie","sortFunction")).padAngle(Lt.padAngle)(o),h=R.appendOrSelect(r,"g.slices").attr("role",ut.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,M=>M.data[s]);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("slice",!0).attr("opacity",0).merge(h).attr("class",M=>this.model.getColorClassName({classNameTypes:[it.FILL],dataGroupName:M.data[s],originalClassName:"slice"})).style("fill",M=>n.model.getFillColor(M.data[s],null,M.data)).attr("d",this.arc).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",ut.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",M=>`${M[a]}, ${Zc(M.data[a],o,a)+"%"}`).attrTween("d",function(M){return GN.bind(this)(M,n.arc)}).end().finally(()=>{n.isRendering=!1});const{code:g,number:m}=b(i,"locale"),v=i.pie.labels.enabled,E=v?u.filter(M=>M.data[a]>0):[],x=R.appendOrSelect(r,"g.labels").attr("role",ut.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(E,M=>M.data[s]);x.exit().attr("opacity",0).remove();const S=x.enter().append("text").classed("pie-label",!0),_=[];S.merge(x).style("text-anchor","middle").text(M=>i.pie.labels.formatter?i.pie.labels.formatter({...M,percentageValue:Zc(M.data[a],o,a,!0)}):m(Zc(M.data[a],o,a),g)+"%").datum(function(M){const w=l+7,U=(M.endAngle-M.startAngle)/2+M.startAngle,F=U/Math.PI*180,$=this.getComputedTextLength();return M.textOffsetX=$/2,M.textOffsetY=F>90&&F<270?10:0,M.xPosition=(M.textOffsetX+w)*Math.sin(U),M.yPosition=(M.textOffsetY+w)*-Math.cos(U),M}).attr("transform",function(M,w){const U=E.length,F=(M.endAngle-M.startAngle)*(180/Math.PI);if(w>=U-2&&F<Lt.callout.minSliceDegree){let $,N;return M.index===U-1?($=M.xPosition+Lt.callout.offsetX+Lt.callout.textMargin+M.textOffsetX,N=M.yPosition-Lt.callout.offsetY,M.direction=Ji.RIGHT,_.push(M)):($=M.xPosition-Lt.callout.offsetX-M.textOffsetX-Lt.callout.textMargin,N=M.yPosition-Lt.callout.offsetY,M.direction=Ji.LEFT,_.push(M)),`translate(${$}, ${N})`}return`translate(${M.xPosition}, ${M.yPosition})`}),this.renderCallouts(_);const A=b(i,"donut")?"donut":"pie",L=b(i,A,"alignment"),{width:B}=R.getSVGElementSize(this.getParent(),{useAttrs:!0}),D=v?Lt.xOffset:0,O=v?Lt.yOffset:0;let H=l+D;L===Ht.CENTER?H=B/2:L===Ht.RIGHT&&(H=B-l-Lt.xOffset);let P=l+O;_.length>0&&(P+=Lt.yOffsetCallout),r.attr("x",H+7).attr("y",P),this.addEventListeners()}renderCallouts(t){const n=R.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",ut.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",ut.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(o){const{xPosition:l,yPosition:c,direction:u}=o;return u===Ji.RIGHT?(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l+Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x-Lt.callout.horizontalLineLength):(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l-Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x+Lt.callout.horizontalLineLength),o}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return I(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 I(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=I(this);t.isRendering||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:I(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=I(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:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);jL(()=>{t.isRendering||i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),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}=R.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Lt.radiusOffset:i}}class VN extends $v{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=R.appendOrSelect(this.getComponentContainer(),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=b(i,"donut","center","label");R.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(I(this))}),a!==null&&a!==""&&R.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=b(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;if(l)t.text(l(a(o)));else{const{code:c,number:u}=b(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const Fv="4,10 8,6 12,10",Uv="12,6 8,10 4,6";class zN extends pt{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 lg(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 b(t,"gauge","type")===sr.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(b(n,"gauge","deltaArrow","direction")){case Wa.UP:return Fv;case Wa.DOWN:return Uv;default:return t>0?Fv:Uv}}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=Ui().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=Ui().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),R.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:[it.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>b(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",ut.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",E=>E),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const g=b(r,"gauge","alignment"),{width:m}=R.getSVGElementSize(this.getParent(),{useAttrs:!0});let v=d;g===Ht.CENTER?v=m/2:g===Ht.RIGHT&&(v=m-d),n.attr("x",v).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=b(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=b(n,"gauge","valueFontSize"),l=b(n,"gauge","deltaFontSize"),c=b(n,"gauge","numberSpacing"),u=b(n,"gauge","showPercentageSymbol");let d=0;r===sr.FULL&&!s?d=l(a):r===sr.SEMI&&s&&(d=-(l(a)+c));const h=R.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),f=o(a),p=R.appendOrSelect(h,"g.gauge-value-number"),{code:g,number:m}=b(n,"locale"),v=b(n,"gauge","numberFormatter"),E=p.selectAll("text.gauge-value-number").data([i]);E.enter().append("text").attr("class","gauge-value-number").merge(E).style("font-size",`${f}px`).attr("text-anchor","middle").text(B=>{let D;return B!=null?D=Number(B.toFixed(2))%1!==0?B.toFixed(2):B.toFixed():D=0,v?v(D):m(Number(D),g)});const{width:y}=R.getSVGElementSize(R.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),x=f/2,S=u?"%":"",_=R.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${x}px`).attr("x",y/2).text(S),{width:A,height:L}=R.getSVGElementSize(_,{useBBox:!0});_.attr("y",`-${L/2}px`),p.attr("transform",`translate(-${A/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta(),{code:s,number:a}=b(r,"locale");if(i){const o=this.computeRadius(),l=i?b(r,"gauge","deltaFontSize"):()=>0,c=i?b(r,"gauge","numberFormatter"):()=>null,u=b(r,"gauge","deltaArrow","size"),d=b(r,"gauge","numberSpacing"),h=b(r,"gauge","showPercentageSymbol"),f=R.appendOrSelect(n,"g.gauge-numbers"),p=R.appendOrSelect(f,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),g=R.appendOrSelect(p,"text.gauge-delta-number"),m=h?"%":"";g.data(i===null?[]:[i]),g.enter().append("text").classed("gauge-delta-number",!0).merge(g).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(x=>{let S;return x!=null?S=Number(x.toFixed(2))%1!==0?x.toFixed(2):x.toFixed():S=0,c?`${c(S)}${m}`:`${a(Number(S),s)}${m}`});const{width:v}=R.getSVGElementSize(R.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),E=b(r,"gauge","deltaArrow","enabled"),y=p.selectAll("svg.gauge-delta-arrow").data(i!==null&&E?[i]:[]);y.enter().append("svg").merge(y).attr("class","gauge-delta-arrow").attr("x",-u(o)-v/2).attr("y",-u(o)/2-l(o)*.35).attr("width",u(o)).attr("height",u(o)).attr("viewBox","0 0 16 16").each(function(){const x=I(this);R.appendOrSelect(x,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const S=b(r,"gauge","status");R.appendOrSelect(x,"polygon.gauge-delta-arrow").attr("class",S!==null?`gauge-delta-arrow status--${S}`:"").attr("points",t.getArrow(i))}),y.exit().remove(),g.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=b(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:I(this),datum:r})}).on("mousemove",function(n,r){const i=I(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:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=b(t,"gauge","type"),{width:r,height:i}=R.getSVGElementSize(this.parent,{useAttrs:!0});return n===sr.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class Bv extends qu{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=Qi(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",ut.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()===Bt.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:[it.FILL],dataGroupName:h[i],originalClassName:"bar"})).style("fill",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[i],h[f],h)}).attr("d",h=>{const f=this.groupScale(h[i]),p=this.getBarWidth(),g=f,m=f+p,v=this.services.cartesianScales.getRangeAxisPosition({datum:h}),E=this.services.cartesianScales.getDomainLowerBound(v),y=this.services.cartesianScales.getValueThroughAxisPosition(v,E),x=this.services.cartesianScales.getRangeValue(h),S=this.services.cartesianScales.getDomainValue(h)-p/2,_=S+p;if(!this.isOutsideZoomedDomain(S,_))return ie({x0:g,x1:m,y0:y,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ut.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=I(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=I(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:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(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=b(t,"bars","width"),r=b(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 WN extends pt{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)}, ${An(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${An(l.range())},${c(r)})`),this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n.event,hoveredElement:I(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(""),b(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=>{const m=this.services.cartesianScales.getDomainIdentifier(g);return g.index===-1||g.value===null?`url(#${f})`:this.model.getFillColor(Number(g.value),g[m],g)}).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=R.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);R.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),R.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),R.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),R.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=b(this.getOptions(),"heatmap","divider","state");return t!==Yr.OFF&&(t===Yr.AUTO&&Qg.minCellDividerDimension<=this.xBandwidth&&Qg.minCellDividerDimension<=this.yBandwidth||t===Yr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=I(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=is(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,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:I(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:I(this),datum:u})}).on("mouseout",function(c,u){const h=I(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 YN extends pt{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=>yt(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",ut.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:[it.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=yt(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 m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-g)>0&&Math.abs(m-g)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Bt.VERTICAL?m+=1:m-=1),ie({x0:f,x1:p,y0:g,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ut.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>b(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:r,number:i}=b(t,"locale"),s=this;this.parent.selectAll("path.bar").on("mouseover",function(a,o){const l=I(this);l.classed("hovered",!0);const c=i(parseFloat(yt(o,"data.x0")),r),u=i(parseFloat(yt(o,"data.x1")),r),d=s.services.cartesianScales.getRangeAxisPosition(),h=s.services.cartesianScales.getScaleLabel(d);s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:yt(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:s.model.getColorClassName({classNameTypes:[it.TOOLTIP],dataGroupName:o[n]})},{label:h,value:yt(o,`data.${o[n]}`)}]})}).on("mousemove",function(a){s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("mouseout",function(){I(this).classed("hovered",!1),s.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 qN extends an{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]?bn.weight.unselected:bn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",bn.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?bn.opacity.unselected:bn.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",bn.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=v=>s.getDomainValue(v),u=v=>s.getRangeValue(v),d=s.getOrientation(),[h,f]=_n(c,u,d),p=n.selectAll("line.line").data(this.getScatterData(),v=>`${v[i]}-${v[l]}`);p.exit().attr("opacity",0).remove();const m=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",v=>this.model.getColorClassName({classNameTypes:[it.STROKE],dataGroupName:v[i],originalClassName:"line"})).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"lollipop-line-update-enter",animate:t})).style("stroke",v=>this.model.getFillColor(v[i],v[l],v)).attr("opacity",1);d===Bt.HORIZONTAL?m.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",v=>h(v)-r.points.radius):m.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",v=>f(v)+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 XN extends pt{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)-jt.dividerWidth),x:r-n(s.value)}):(r=n(s.value),{...s,width:Math.abs(n(s.value)-jt.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),s=b(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=R.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;if(b(i,"meter","proportional")===null)u=100;else{const y=b(i,"meter","proportional","total");u=y||this.model.getMaximumDomain(this.model.getDisplayData())}const d=Fe().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=b(i,"meter","height");R.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?jt.height.proportional:jt.height.default)),R.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?jt.height.proportional:jt.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",y=>y.x).attr("y",0).attr("height",()=>f||(s?jt.height.proportional:jt.height.default)).attr("class",y=>this.model.getColorClassName({classNameTypes:[it.FILL],dataGroupName:y[c],originalClassName:g})).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"meter-bar-update",animate:t})).attr("width",y=>y.value>u?d(u):y.width).style("fill",y=>n.model.getFillColor(y[c],null,y)).attr("role",ut.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",y=>y.value),p.exit().remove();const m=b(i,"meter","peak");let v=m;m!==null&&(m>u?v=u:m<a[0].value&&(v=a[0].value>u?u:a[0].value));const E=r.selectAll("line.peak").data(v==null?[]:[v]);E.enter().append("line").classed("peak",!0).merge(E).attr("y1",0).attr("y2",()=>f||(s?jt.height.proportional:jt.height.default)).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"peak-line-update",animate:t})).attr("x1",y=>d(y)).attr("x2",y=>d(y)).attr("role",ut.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",y=>y),E.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=b(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=I(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=I(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:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(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 Hv(e){const t=jN(Gv(e),360);return Nn(t,[0,10])||Nn(t,[350,0])?{textAnchor:tn.START,dominantBaseline:en.MIDDLE}:Nn(t,[10,80])?{textAnchor:tn.START,dominantBaseline:en.HANGING}:Nn(t,[80,100])?{textAnchor:tn.MIDDLE,dominantBaseline:en.HANGING}:Nn(t,[100,170])?{textAnchor:tn.END,dominantBaseline:en.HANGING}:Nn(t,[170,190])?{textAnchor:tn.END,dominantBaseline:en.MIDDLE}:Nn(t,[190,260])?{textAnchor:tn.END,dominantBaseline:en.BASELINE}:Nn(t,[260,280])?{textAnchor:tn.MIDDLE,dominantBaseline:en.BASELINE}:{textAnchor:tn.START,dominantBaseline:en.BASELINE}}function jN(e,t){return(e%t+t)%t}function Nn(e,[t,n]){return e>=t&&e<=n}function Gv(e){return e*(180/Math.PI)}function Ft(e,t,n={x:0,y:0}){const r=t*Math.cos(e)+n.x,i=t*Math.sin(e)+n.y;return{x:isNaN(r)?0:r,y:isNaN(i)?0:i}}function ZN(e,t){return t*Math.sin(e-Math.PI/2)}class KN extends pt{constructor(){super(...arguments),this.type="radar",this.renderType=tt.SVG,this.getLabelDimensions=t=>{const n=R.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=R.appendOrSelect(n,"text").text(t),{width:i,height:s}=R.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=b(n,"radar","axes"),s=b(n,"data","groupMapsTo"),a=eR(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return lt(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=b(n,"radar","axes"),s=b(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:lt(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?ar.opacity.unselected:ar.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?ar.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",ar.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}=R.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=b(o,"data","groupMapsTo"),c=b(o,"radar","axes","value"),{angle:u,value:d}=b(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:f,yTicksNumber:p,minRange:g,xAxisRectHeight:m}=ar;this.uniqueKeys=Array.from(new Set(s.map(C=>C[u]))),this.uniqueGroups=Array.from(new Set(s.map(C=>C[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const E=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),S=(Math.min(r,i)-E)/2;if(S<=0)return;const _=Ii().domain(this.fullDataNormalized.map(C=>C[u])).range([0,2*Math.PI].map(C=>C-Math.PI/2)),A=An(this.fullDataNormalized.map(C=>C[d])),L=Fe().domain([A>=0?0:A,Un(this.fullDataNormalized.map(C=>C[d]))]).range([g,S]).nice(p),B=L.ticks(p),D=(C,V,z)=>this.model.getFillColor(C,V,z),O=yT().angle(C=>_(C[u])+Math.PI/2).radius(C=>L(C[d])).curve(Qf),H=this.uniqueKeys.map(C=>{const V=this.getLabelDimensions(C).width,z=ZN(_(C),S);return V+z}),M={x:Un(H)+h,y:i/2},U=R.appendOrSelect(n,"g.y-axes").attr("role",ut.GROUP).selectAll("path").data(B,C=>C),F=C=>this.uniqueKeys.map(V=>({[u]:V,[d]:C}));U.join(C=>C.append("path").attr("opacity",0).attr("transform",`translate(${M.x}, ${M.y})`).attr("fill","none").call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",z=>O(F(z)))),C=>C.call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${M.x}, ${M.y})`).attr("d",z=>O(F(z)))),C=>C.call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_y_axes_exit",animate:t})).attr("d",z=>O(F(z))).attr("opacity",0).remove())),R.appendOrSelect(n,"g.x-axes").attr("role",ut.GROUP).selectAll("line").data(this.uniqueKeys,C=>C).join(C=>C.append("line").attr("opacity",0).attr("class",V=>`x-axis-${Hr(V)}`).attr("stroke-dasharray","0").attr("x1",V=>Ft(_(V),0,M).x).attr("y1",V=>Ft(_(V),0,M).y).attr("x2",V=>Ft(_(V),0,M).x).attr("y2",V=>Ft(_(V),0,M).y).call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",z=>Ft(_(z),L.range()[0],M).x).attr("y1",z=>Ft(_(z),L.range()[0],M).y).attr("x2",z=>Ft(_(z),L.range()[1],M).x).attr("y2",z=>Ft(_(z),L.range()[1],M).y)),C=>C.call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",z=>Ft(_(z),L.range()[0],M).x).attr("y1",z=>Ft(_(z),L.range()[0],M).y).attr("x2",z=>Ft(_(z),L.range()[1],M).x).attr("y2",z=>Ft(_(z),L.range()[1],M).y)),C=>C.call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),R.appendOrSelect(n,"g.x-labels").attr("role",ut.GROUP).selectAll("text").data(this.uniqueKeys).join(C=>C.append("text").text(V=>V).attr("opacity",0).attr("x",V=>Ft(_(V),L.range()[1]+h,M).x).attr("y",V=>Ft(_(V),L.range()[1]+h,M).y).style("text-anchor",V=>Hv(_(V)).textAnchor).style("dominant-baseline",V=>Hv(_(V)).dominantBaseline).call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),C=>C.call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",z=>Ft(_(z),L.range()[1]+h,M).x).attr("y",z=>Ft(_(z),L.range()[1]+h,M).y).end().finally(()=>{const z=b(o,"radar","alignment"),Mt=this.getAlignmentXOffset(z,n,this.getParent());n.attr("x",Mt)})),C=>C.call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),R.appendOrSelect(n,"g.blobs").attr("role",ut.GROUP).selectAll("path").data(this.groupedDataNormalized,C=>C.name).join(C=>C.append("path").attr("class",V=>this.model.getColorClassName({classNameTypes:[it.FILL,it.STROKE],dataGroupName:V.name,originalClassName:"blob"})).attr("role",ut.GRAPHICS_SYMBOL).attr("aria-label",V=>V.name).attr("opacity",0).attr("transform",t?()=>`translate(${M.x}, ${M.y}) scale(${1+Math.random()*.35})`:`translate(${M.x}, ${M.y})`).style("fill",V=>D(V.name,null,V.data)).style("fill-opacity",ar.opacity.selected).style("stroke",V=>D(V.name,null,V.data)).call(V=>{const z=V.transition().call(Mt=>this.services.transitions.setupTransition({transition:Mt,name:"radar_blobs_enter",animate:t}));t&&z.delay(()=>Math.random()*30).attr("transform",`translate(${M.x}, ${M.y})`),z.attr("opacity",1).attr("d",Mt=>O(Mt.data))}),C=>(C.attr("class",V=>this.model.getColorClassName({classNameTypes:[it.FILL,it.STROKE],dataGroupName:V.name,originalClassName:"blob"})).style("fill",V=>D(V.name,null,V.data)).style("stroke",V=>D(V.name,null,V.data)),C.call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${M.x}, ${M.y})`).attr("d",z=>O(z.data))),C),C=>C.call(V=>{const z=V.transition().call(Mt=>this.services.transitions.setupTransition({transition:Mt,name:"radar_blobs_exit",animate:t}));t&&z.delay(()=>Math.random()*30).attr("transform",()=>`translate(${M.x}, ${M.y}) scale(${1+Math.random()*.35})`),z.attr("opacity",0).remove()})),R.appendOrSelect(n,"g.dots").attr("role",ut.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(C=>b(C,d)!==null)).join(C=>C.append("circle").attr("role",ut.GRAPHICS_SYMBOL).attr("aria-label",V=>V[c]),C=>C,C=>C.remove()).attr("class",C=>this.model.getColorClassName({classNameTypes:[it.FILL],dataGroupName:C[l],originalClassName:Hr(C[u])})).attr("cx",C=>Ft(_(C[u]),L(C[d]),M).x).attr("cy",C=>Ft(_(C[u]),L(C[d]),M).y).attr("r",0).attr("opacity",0).style("fill",C=>D(C[l])),R.appendOrSelect(n,"g.x-axes-rect").attr("role",ut.GROUP).selectAll("rect").data(this.uniqueKeys).join(C=>C.append("rect"),C=>C,C=>C.remove()).attr("x",M.x).attr("y",M.y-m/2).attr("width",L.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",C=>`rotate(${Gv(_(C))}, ${M.x}, ${M.y})`);const{code:vt,number:Y}=b(o,"locale");R.appendOrSelect(n,"g.y-labels").attr("role",ut.GROUP).selectAll("text").data(Ie(B)).join(C=>C.append("text").attr("opacity",0).text(V=>Y(V,vt)).attr("x",V=>Ft(-Math.PI/2,L(V),M).x+f).attr("y",V=>Ft(-Math.PI/2,L(V),M).y).style("text-anchor","start").style("dominant-baseline","middle").call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),C=>C.call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_y_labels_update",animate:t})).text(z=>z).attr("opacity",1).attr("x",z=>Ft(-Math.PI/2,L(z),M).x+f).attr("y",z=>Ft(-Math.PI/2,L(z),M).y)),C=>C.call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=R.getSVGElementSize(n,{useBBox:!0}),{width:s}=R.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===Ht.CENTER?a=Math.floor((s-i.width)/2):t===Ht.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}}=b(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=I(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-${Hr(i)}`),o=t.parent.selectAll(`.dots circle.${Hr(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=b(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",ar.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],null,f),class:t.model.getColorClassName({classNameTypes:[it.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=I(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:I(this),datum:i})}).on("mouseout",function(r,i){const s=I(this),a=t.parent.select(`.x-axes .x-axis-${Hr(i)}`),o=t.parent.selectAll(`.dots circle.${Hr(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE)})}}class Vv extends qu{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:[it.FILL],dataGroupName:c[r],originalClassName:"bar"})).style("fill",c=>{const u=this.services.cartesianScales.getDomainIdentifier(c);return this.model.getFillColor(c[r],c[u],c)}).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,m;if(Array.isArray(h)&&h.length===2)g=this.services.cartesianScales.getRangeValue(h[0]),m=this.services.cartesianScales.getRangeValue(h[1]);else{const y=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,y)),m=this.services.cartesianScales.getRangeValue(c)}const v=Math.abs(m-g);if(v!==0&&v<2&&(h>0&&a===Bt.VERTICAL||h<0&&a===Bt.HORIZONTAL?m=g-2:m=g+2),!this.isOutsideZoomedDomain(f,p))return ie({x0:f,x1:p,y0:g,y1:m},a)}).attr("opacity",1).attr("role",ut.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=I(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:I(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:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(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 QN extends oe{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=b(this.getOptions(),"data","loading"),r=!b(this.getOptions(),"grid","x","enabled")&&!b(this.getOptions(),"grid","y","enabled")&&!b(this.getOptions(),"axes","bottom","visible")&&!b(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=R.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=R.appendOrSelect(t,"svg.chart-skeleton.DAII"),R.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class zv extends pt{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=>b(s,0,i)!==n.datum().name?En.opacity.unselected:En.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",En.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(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=b(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=>b(p,0,s));this.areaGenerator=Zl().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=>b(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[it.FILL],dataGroupName:b(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(b(p,0,s),null,p)).attr("role",ut.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>b(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",En.opacity.selected).attr("d",this.areaGenerator)}}class Wv extends qu{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=>b(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",ut.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:[it.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i],c.data.sharedStackKey,c.data)).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 m=c[0]<0&&c[1]<=0;m&&a.length>1?this.services.cartesianScales.getOrientation()===Bt.VERTICAL?g+=c[1]===0?2:1:g-=1:m||(this.services.cartesianScales.getOrientation()===Bt.VERTICAL?g+=1:g-=1)}return ie({x0:h,x1:f,y0:p,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",ut.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=I(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=I(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:I(this),datum:s})}).on("mouseout",function(i,s){const a=I(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(b(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=R.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=b(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 Yv extends an{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=tt.SVG}render(t){if(!b(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=>b(f,0,s));l.exit().attr("opacity",0).remove();const u=l.enter().append("g").classed("dots",!0).attr("role",ut.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),m=this.services.cartesianScales.getRangeIdentifier(f);return{[s]:p,[g]:f.data.sharedStackKey,[m]: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],m=this.services.cartesianScales.getDomainIdentifier(u),v=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,[m]:f,[v]:p}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(d=>d[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const ni=6;class JN extends pt{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}=R.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer();n.html("");const{width:r,height:i}=R.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=b(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=_=>{const A=h.descendants().reverse(),L=h.links();let B=h,D=h;h.eachBefore($=>{$.x<B.x&&(B=$),$.x>D.x&&(D=$)});const O=D.x-B.x,H=n.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,B.x,r,O].join(" ")),P=S.selectAll("g").data(A,$=>$.id),M=this,w=P.enter().append("g").attr("transform",()=>`translate(${_.y0},${_.x0})`).attr("class",$=>$.depth!==0&&$.children&&$.children.length>0?"clickable":null).on("mouseover",function($,N){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOVER,{event:$,element:I(this),datum:N})}).on("click",function($,N){N.depth!==0&&(N.children=N.children?null:N._children,g(N)),M.services.events.dispatchEvent(T.Tree.NODE_CLICK,{event:$,element:I(this),datum:N})}).on("mouseout",function($,N){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOUT,{event:$,element:I(this),datum:N})});w.append("circle").attr("r",2.5).attr("class",$=>$._children?"parent":"child").attr("stroke-width",10),w.append("text").attr("dy","0.31em").attr("x",$=>$._children?-ni:ni).attr("text-anchor",$=>$._children?"end":"start").text($=>$.data.name).clone(!0).attr("class","text-stroke").lower(),P.merge(w).transition(H).attr("transform",$=>`translate(${$.y},${$.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),P.exit().transition(H).remove().attr("transform",()=>`translate(${_.y},${_.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const U=x.selectAll("path").data(L,$=>$.target.id),F=U.enter().append("path").attr("d",()=>{const $={x:_.x0,y:_.y0};return y({source:$,target:$})});U.merge(F).transition(H).attr("d",y),U.exit().transition(H).remove().attr("d",()=>{const $={x:_.x,y:_.y};return y({source:$,target:$})}),h.eachBefore($=>{$.x0=$.x,$.y0=$.y})},m=h.descendants(),v=m[m.length-1].depth,E=b(s,"tree","type")===za.DENDROGRAM?Ux().size([i,r-u-v*ni-l]):w_().nodeSize([f,p]).size([i,r-u-v*ni-l]),y=TT().x(_=>_.y).y(_=>_.x);h.x0=p/2,h.y0=0,h.descendants().forEach((_,A)=>{_.id=A,_._children=_.children}),E(h),n.attr("viewBox",[-d.left,-d.top,r,f]).style("user-select","none");const x=n.append("g").attr("class","links"),S=n.append("g").attr("class","nodes");g(h)}}var t$="#000000",e$="#ffffff",n$="#fcf4d6",r$="#fddc69",i$="#f1c21b",s$="#d2a106",a$="#b28600",o$="#8e6a00",l$="#684e00",c$="#483700",u$="#302400",h$="#1c1500",d$={10:n$,20:r$,30:i$,40:s$,50:a$,60:o$,70:l$,80:c$,90:u$,100:h$},f$="#fff2e8",p$="#ffd9be",g$="#ffb784",m$="#ff832b",v$="#eb6200",y$="#ba4e00",E$="#8a3800",b$="#5e2900",x$="#3e1a00",_$="#231000",S$={10:f$,20:p$,30:g$,40:m$,50:v$,60:y$,70:E$,80:b$,90:x$,100:_$},T$="#fff1f1",O$="#ffd7d9",w$="#ffb3b8",M$="#ff8389",A$="#fa4d56",C$="#da1e28",D$="#a2191f",L$="#750e13",R$="#520408",I$="#2d0709",k$={10:T$,20:O$,30:w$,40:M$,50:A$,60:C$,70:D$,80:L$,90:R$,100:I$},P$="#fff0f7",N$="#ffd6e8",$$="#ffafd2",F$="#ff7eb6",U$="#ee5396",B$="#d02670",H$="#9f1853",G$="#740937",V$="#510224",z$="#2a0a18",W$={10:P$,20:N$,30:$$,40:F$,50:U$,60:B$,70:H$,80:G$,90:V$,100:z$},Y$="#f6f2ff",q$="#e8daff",X$="#d4bbff",j$="#be95ff",Z$="#a56eff",K$="#8a3ffc",Q$="#6929c4",J$="#491d8b",tF="#31135e",eF="#1c0f30",nF={10:Y$,20:q$,30:X$,40:j$,50:Z$,60:K$,70:Q$,80:J$,90:tF,100:eF},rF="#edf5ff",iF="#d0e2ff",sF="#a6c8ff",aF="#78a9ff",oF="#4589ff",lF="#0f62fe",cF="#0043ce",uF="#002d9c",hF="#001d6c",dF="#001141",fF={10:rF,20:iF,30:sF,40:aF,50:oF,60:lF,70:cF,80:uF,90:hF,100:dF},pF="#e5f6ff",gF="#bae6ff",mF="#82cfff",vF="#33b1ff",yF="#1192e8",EF="#0072c3",bF="#00539a",xF="#003a6d",_F="#012749",SF="#061727",TF={10:pF,20:gF,30:mF,40:vF,50:yF,60:EF,70:bF,80:xF,90:_F,100:SF},OF="#d9fbfb",wF="#9ef0f0",MF="#3ddbd9",AF="#08bdba",CF="#009d9a",DF="#007d79",LF="#005d5d",RF="#004144",IF="#022b30",kF="#081a1c",PF={10:OF,20:wF,30:MF,40:AF,50:CF,60:DF,70:LF,80:RF,90:IF,100:kF},NF="#defbe6",$F="#a7f0ba",FF="#6fdc8c",UF="#42be65",BF="#24a148",HF="#198038",GF="#0e6027",VF="#044317",zF="#022d0d",WF="#071908",YF={10:NF,20:$F,30:FF,40:UF,50:BF,60:HF,70:GF,80:VF,90:zF,100:WF},qF="#f2f4f8",XF="#dde1e6",jF="#c1c7cd",ZF="#a2a9b0",KF="#878d96",QF="#697077",JF="#4d5358",tU="#343a3f",eU="#21272a",nU="#121619",rU={10:qF,20:XF,30:jF,40:ZF,50:KF,60:QF,70:JF,80:tU,90:eU,100:nU},iU="#f4f4f4",sU="#e0e0e0",aU="#c6c6c6",oU="#a8a8a8",lU="#8d8d8d",cU="#6f6f6f",uU="#525252",hU="#393939",dU="#262626",fU="#161616",pU={10:iU,20:sU,30:aU,40:oU,50:lU,60:cU,70:uU,80:hU,90:dU,100:fU},gU="#f7f3f2",mU="#e5e0df",vU="#cac5c4",yU="#ada8a8",EU="#8f8b8b",bU="#726e6e",xU="#565151",_U="#3c3838",SU="#272525",TU="#171414",OU={10:gU,20:mU,30:vU,40:yU,50:EU,60:bU,70:xU,80:_U,90:SU,100:TU},qv={black:{100:t$},blue:fF,coolGray:rU,cyan:TF,gray:pU,green:YF,magenta:W$,orange:S$,purple:nF,red:k$,teal:PF,warmGray:OU,white:{0:e$},yellow:d$};const wU=e=>{if(!e)return null;for(const t of Object.keys(qv)){const n=qv[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},Xv=function(){const e=I(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=on(t);let r;if(n&&(r=wU(n?n.hex():null)),r==null){const i=Bo(n).l;r=Math.abs(i*100-100)}return r>50?"white":"black"};let MU=0;class AU extends pt{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=b(window,"location"),{width:a,height:o}=R.getSVGElementSize(n,{useAttrs:!0}),l=Di({name:i.title||"Treemap",children:r}).sum(g=>g.value).sort((g,m)=>m.value-g.value),c=L_().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",()=>MU++).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=I(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:[it.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,null,g.data)}),h.selectAll("clipPath").data(g=>g.data.showLabel!==!0?[]:[1],g=>g).join(g=>g.append("clipPath").attr("id",function(){const m=I(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${m}`}).append("use").attr("xlink:href",function(){const m=I(this.parentNode.parentNode).attr("data-uid"),v=`${i.style.prefix}-leaf-${m}`;return new URL(`#${v}`,s)+""}),g=>null,g=>g.remove()),h.selectAll("text").data(g=>{if(g.data.showLabel!==!0)return[];let m=g;for(;m.depth>1;)m=m.parent;const v=Bo(this.model.getFillColor(m.data.name));return[{text:g.data.name,color:v.l<.5?"white":"black"}]},g=>g).join(g=>{const m=g.append("text").text(v=>v.text).style("fill",Xv).attr("x",7).attr("y",18);return s&&m.attr("clip-path",function(){const v=I(this.parentNode).attr("data-uid"),E=`${i.style.prefix}-clip-${v}`;return`url(${new URL(`#${E}`,s)+""})`}),m},g=>g.text(m=>m.text).style("fill",Xv),g=>g.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=I(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,null,o.data);return l&&(s=l),on(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=I(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:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(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,null,a.data)),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}}var CU={value:function(){}};function jv(){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 DU(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=jv.prototype={constructor:Eo,on:function(e,t){var n=this._,r=DU(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=LU(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]=Zv(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Zv(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 LU(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Zv(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=CU,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const RU=oP(Object.freeze(Object.defineProperty({__proto__:null,dispatch:jv},Symbol.toStringTag,{value:"Module"}))).dispatch,Xu=Math.PI/180,IU={archimedean:Qv,rectangular:zU},ys=64,bo=2048;var kU=function(){var e=[256,256],t=PU,n=NU,r=$U,i=Kv,s=Kv,a=FU,o=UU,l=Qv,c=[],u=1/0,d=RU("word","end"),h=null,f=Math.random,p={},g=YU;p.canvas=function(E){return arguments.length?(g=$n(E),p):g},p.start=function(){var E=m(g()),y=WU((e[0]>>5)*e[1]),x=null,S=c.length,_=-1,A=[],L=c.map(function(D,O){return D.text=t.call(this,D,O),D.font=n.call(this,D,O),D.style=i.call(this,D,O),D.weight=s.call(this,D,O),D.rotate=a.call(this,D,O),D.size=~~r.call(this,D,O),D.padding=o.call(this,D,O),D}).sort(function(D,O){return O.size-D.size});return h&&clearInterval(h),h=setInterval(B,0),B(),p;function B(){for(var D=Date.now();Date.now()-D<u&&++_<S&&h;){var O=L[_];O.x=e[0]*(f()+.5)>>1,O.y=e[1]*(f()+.5)>>1,BU(E,O,L,_),O.hasText&&v(y,O,x)&&(A.push(O),d.call("word",p,O),x?GU(x,O):x=[{x:O.x+O.x0,y:O.y+O.y0},{x:O.x+O.x1,y:O.y+O.y1}],O.x-=e[0]>>1,O.y-=e[1]>>1)}_>=S&&(p.stop(),d.call("end",p,A,x))}},p.stop=function(){h&&(clearInterval(h),h=null);for(const E of c)delete E.sprite;return p};function m(E){const y=E.getContext("2d",{willReadFrequently:!0});E.width=E.height=1;const x=Math.sqrt(y.getImageData(0,0,1,1).data.length>>2);return E.width=(ys<<5)/x,E.height=bo/x,y.fillStyle=y.strokeStyle="red",{context:y,ratio:x}}function v(E,y,x){e[0],e[1];for(var S=y.x,_=y.y,A=Math.sqrt(e[0]*e[0]+e[1]*e[1]),L=l(e),B=f()<.5?1:-1,D=-B,O,H,P;(O=L(D+=B))&&(H=~~O[0],P=~~O[1],!(Math.min(Math.abs(H),Math.abs(P))>=A));)if(y.x=S+H,y.y=_+P,!(y.x+y.x0<0||y.y+y.y0<0||y.x+y.x1>e[0]||y.y+y.y1>e[1])&&(!x||VU(y,x))&&!HU(y,E,e[0])){for(var M=y.sprite,w=y.width>>5,U=e[0]>>5,F=y.x-(w<<4),$=F&127,N=32-$,j=y.y1-y.y0,q=(y.y+y.y0)*U+(F>>5),at,nt=0;nt<j;nt++){at=0;for(var dt=0;dt<=w;dt++)E[q+dt]|=at<<N|(dt<w?(at=M[nt*w+dt])>>>$:0);q+=U}return!0}return!1}return p.timeInterval=function(E){return arguments.length?(u=E??1/0,p):u},p.words=function(E){return arguments.length?(c=E,p):c},p.size=function(E){return arguments.length?(e=[+E[0],+E[1]],p):e},p.font=function(E){return arguments.length?(n=$n(E),p):n},p.fontStyle=function(E){return arguments.length?(i=$n(E),p):i},p.fontWeight=function(E){return arguments.length?(s=$n(E),p):s},p.rotate=function(E){return arguments.length?(a=$n(E),p):a},p.text=function(E){return arguments.length?(t=$n(E),p):t},p.spiral=function(E){return arguments.length?(l=IU[E]||E,p):l},p.fontSize=function(E){return arguments.length?(r=$n(E),p):r},p.padding=function(E){return arguments.length?(o=$n(E),p):o},p.random=function(E){return arguments.length?(f=E,p):f},p.on=function(){var E=d.on.apply(d,arguments);return E===d?p:E},p};function PU(e){return e.text}function NU(){return"serif"}function Kv(){return"normal"}function $U(e){return Math.sqrt(e.value)}function FU(){return(~~(random()*6)-3)*30}function UU(){return 1}function BU(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(ys<<5)/s,bo/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 O=i.measureText(t.text),H=-Math.floor(O.width/2);let P=(O.width+1)*s,M=t.size<<1;if(t.rotate){var u=Math.sin(t.rotate*Xu),d=Math.cos(t.rotate*Xu),h=P*d,f=P*u,p=M*d,g=M*u;P=Math.max(Math.abs(h+g),Math.abs(h-g))+31>>5<<5,M=~~Math.max(Math.abs(f+p),Math.abs(f-p))}else P=P+31>>5<<5;if(M>l&&(l=M),a+P>=ys<<5&&(a=0,o+=l,l=0),o+M>=bo)break;i.translate((a+(P>>1))/s,(o+(M>>1))/s),t.rotate&&i.rotate(t.rotate*Xu),i.fillText(t.text,H,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,H,0)),i.restore(),t.width=P,t.height=M,t.xoff=a,t.yoff=o,t.x1=P>>1,t.y1=M>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=P}for(var m=i.getImageData(0,0,(ys<<5)/s,bo/s).data,v=[];--r>=0;)if(t=n[r],!!t.hasText){for(var E=t.width,y=E>>5,x=t.y1-t.y0,S=0;S<x*y;S++)v[S]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var _=0,A=-1,L=0;L<x;L++){for(var S=0;S<E;S++){var B=y*L+(S>>5),D=m[(o+L)*(ys<<5)+(a+S)<<2]?1<<31-S%32:0;v[B]|=D,_|=D}_?A=L:(t.y0++,x--,L--,o++)}t.y1=t.y0+A,t.sprite=v.slice(0,(t.y1-t.y0)*y)}}}function HU(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 GU(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 VU(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 Qv(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function zU(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 WU(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function YU(){return document.createElement("canvas")}function $n(e){return typeof e=="function"?e:function(){return e}}const qU=aP(kU);class XU extends pt{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}=R.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=qU().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=R.appendOrSelect(r,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=g.selectAll("text").data(p,E=>`${E[c]}-${E.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",E=>`${E.size}px`).text(function(E){return E.text}).attr("class",E=>n.model.getColorClassName({classNameTypes:[it.FILL],dataGroupName:E[c],originalClassName:`word ${E.size>32?"light":""}`})).style("fill",E=>n.model.getFillColor(E[c],E.text,E)).attr("text-anchor","middle").transition().call(E=>n.services.transitions.setupTransition({transition:E,name:"wordcloud-text-update-enter",animate:t})).attr("transform",E=>`translate(${E.x}, ${E.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=R.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?Ie(i):[1,1];return Fe().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:I(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:yt(t,"locale.translations.group")||yt(t,"tooltip.groupLabel")||"Group",value:a[n],class:r.model.getColorClassName({classNameTypes:[it.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=I(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:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(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 jU extends pt{constructor(){super(...arguments),this.type="geo",this.renderType=tt.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=R.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=b(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(v=>{typeof a[v].value=="number"?o[v]=a[v]:l[v]=a[v]});const c=$N(s,Object.values(l)),u=kN(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=hx().projection(d);R.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),g=R.appendOrSelect(t,"defs");R.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",Bi()([[0,0],[0,10]]));const m=R.appendOrSelect(t,"g.missing-data");R.appendOrSelect(m,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(b(this.getOptions(),"thematic","projection")){case nn.geoEqualEarth:t=Dx();break;case nn.geoAlbers:t=Sx();break;case nn.geoConicEqualArea:t=Qd();break;case nn.geoConicEquidistant:t=Ax();break;case nn.geoEquirectangular:t=wx();break;case nn.geoMercator:t=Tx();break;case nn.geoNaturalEarth1:t=Lx();break;default:throw new Error("Projection is not supported.")}return t}}class ZU extends jU{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=I(this);t.services.events.dispatchEvent(Vr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Gr.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(Vr.CHOROPLETH_MOUSEMOVE,{event:r,element:I(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Gr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Vr.CHOROPLETH_CLICK,{event:r,element:I(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=I(this);t.services.events.dispatchEvent(Vr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Gr.HIDE,{event:r,hoveredElement:s})})}}class KU extends qe{constructor(t,n){super(t,n),this.model=new DN(this.services),this.model.setOptions(Pt(Ct.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=b(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new gs(this.model,this.services)],growth:ct.STRETCH},o={id:"toolbar",components:[new Kr(this.model,this.services)],growth:ct.PREFERRED},l={id:"header",components:[new ae(this.model,this.services,[a,...i?[o]:[]],{direction:At.ROW,alignItems:ir.CENTER})],growth:ct.PREFERRED},c={id:"legend",components:[new Nv(this.model,this.services,{chartType:"choropleth"})],growth:ct.PREFERRED,renderType:tt.SVG},u={id:"graph-frame",components:t,growth:ct.STRETCH,renderType:tt.SVG},d=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=At.COLUMN_REVERSE,f={id:"spacer",components:[new On(this.model,this.services,{size:15})],growth:ct.PREFERRED},p={id:"full-frame",components:[new ae(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:ct.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new On(this.model,this.services,i?{size:15}:void 0)],growth:ct.PREFERRED};g.push(m)}return g.push(p),[new Iu(this.model,this.services),new po(this.model,this.services),new ae(this.model,this.services,g,{direction:At.COLUMN})]}getComponents(){const t=[new ZU(this.model,this.services)];return this.getChartComponents(t)}}class QU extends rn{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=lt({},t,this.getZoomOptions(t));Kc(n,r);const i=this.getHierarchyLevel(),s=b(n,"circlePack","hierarchyLevel");this.set({options:lt(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&&b(n,0,"children")?b(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}),b(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:Vt.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(),{number:n,code:r}=b(this.getOptions(),"locale"),i=["Child","Parent","Value"],s=[];return t.forEach(a=>{let o=a.value?a.value:0;a.children&&(o+=this.getChildrenDatums(a.children,a.name,s,0)),s.push(["&ndash;",a.name,n(o,r)])}),super.formatTable({headers:i,cells:s})}getChildrenDatums(t,n,r=[],i=0){const s=n,{number:a,code:o}=b(this.getOptions(),"locale");return t.forEach(l=>{const c=l.name;let u=0;if(l.children)l.children.length>0&&(typeof l.value=="number"&&(i+=l.value),u+=this.getChildrenDatums(l.children,c,r,u),r.push([c,s,a(u,o)]),i+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,i+=l.value),r.push([l.name,s,a(d,o)])}}),i}}class JU extends qe{constructor(t,n){super(t,n),this.model=new QU(this.services),this.model.setOptions(Pt(Ct.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new HN(this.model,this.services)];return this.getChartComponents(t)}}const Jv={[Ee.LINE]:[ti,an],[Ee.SCATTER]:[an],[Ee.AREA]:[Dv,ti,an],[Ee.STACKED_AREA]:[zv,ti,Yv,yo],[Ee.SIMPLE_BAR]:[Vv],[Ee.GROUPED_BAR]:[Bv,ei],[Ee.STACKED_BAR]:[Wv,yo]};class tB extends de{constructor(t,n){super(t,n);const r=Pt(Ct.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(Jv).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=`${aC(i.type)}Chart`;return a=lt({},Ct[l],this.model.getOptions(),i.options),i.type===Ee.STACKED_AREA&&(o=!0),Jv[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=lt({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return Pp(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 Te(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.GRID}),...n?[]:[new Pn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class eB extends rn{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,{number:s,code:a}=b(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[r],c[i]===null?"&ndash;":s(c[i],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((r,i)=>i.value-r.value)}}class t0 extends qe{constructor(t,n,r=!1){super(t,n),this.model=new eB(this.services),!r&&(this.model.setOptions(Pt(Ct.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new $v(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.PIE})];return this.getChartComponents(t)}}class nB extends t0{constructor(t,n){super(t,n,!0),this.model.setOptions(Pt(Ct.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new VN(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.DONUT})];return this.getChartComponents(t)}}class rB extends rn{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,{number:i,code:s}=b(this.getOptions(),"locale"),a=["Group","Value"],o=[...t.map(l=>[l[r],l.value===null?"&ndash;":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}}class iB extends qe{constructor(t,n){super(t,n),this.model=new rB(this.services),this.model.setOptions(Pt(Ct.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new zN(this.model,this.services)];return this.getChartComponents(t)}}class sB extends de{constructor(t,n){super(t,n),this.model.setOptions(Pt(Ct.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new Bv(this.model,this.services),new ei(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class aB extends ur{constructor(t){super(t),this.axisFlavor=rs.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=b(this.getOptions(),"axes");if(b(n,"left","scaleType")&&b(n,"left","scaleType")!==Q.LABELS||b(n,"right","scaleType")&&b(n,"right","scaleType")!==Q.LABELS||b(n,"top","scaleType")&&b(n,"top","scaleType")!==Q.LABELS||b(n,"bottom","scaleType")&&b(n,"bottom","scaleType")!==Q.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=Ie(this.getDisplayData(),r=>r.value),n=Fe().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]=yn(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[r]][a[i]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(yn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){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(),{number:i,code:s}=b(this.getOptions(),"locale"),a=[n.label,r.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"&ndash;":l[n.identifier],l[r.identifier]===null?"&ndash;":l[r.identifier],l.value===null?"&ndash;":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=b(t,"color","gradient","colors"),r=!He(n);let i=b(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=b(this.getOptions(),"color");this._colorScale=kv(this.getDisplayData(),l)}}class oB extends de{constructor(t,n){super(t,n),this.model=new aB(this.services),this.model.setOptions(Pt(Ct.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=b(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 gs(this.model,this.services)],growth:ct.STRETCH},o={id:"toolbar",components:[new Kr(this.model,this.services)],growth:ct.PREFERRED},l={id:"header",components:[new ae(this.model,this.services,[a,...i?[o]:[]],{direction:At.ROW,alignItems:ir.CENTER})],growth:ct.PREFERRED},c={id:"legend",components:[new Nv(this.model,this.services,{chartType:"heatmap"})],growth:ct.PREFERRED,renderType:tt.SVG},u={id:"graph-frame",components:t,growth:ct.STRETCH,renderType:tt.SVG},d=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=At.COLUMN_REVERSE,f={id:"spacer",components:[new On(this.model,this.services,{size:15})],growth:ct.PREFERRED},p={id:"full-frame",components:[new ae(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:ct.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new On(this.model,this.services,i?{size:15}:void 0)],growth:ct.PREFERRED};g.push(m)}return g.push(p),[new xv(this.model,this.services),new po(this.model,this.services),new ae(this.model,this.services,g,{direction:At.COLUMN})]}getComponents(){const t=[new fe(this.model,this.services),new WN(this.model,this.services)];return this.getAxisChartComponents(t)}}class lB extends ur{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:r,code:i}=b(this.getOptions(),"locale"),s=this.getBinnedStackedData(),a=[yt(t,"bins.rangeLabel")||"Range",...s.map(l=>yt(l,`0.${n}`))],o=[...yt(s,0).map((l,c)=>[`${r(Number(yt(l,"data.x0")),i)} – ${r(Number(yt(l,"data.x1")),i)}`,...s.map(u=>r(yt(u[c],`data.${yt(u[c],n)}`),i))])];return super.formatTable({headers:a,cells:o})}}class cB extends de{constructor(t,n){super(t,n),this.model=new lB(this.services),this.model.setOptions(Pt(Ct.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new UN(this.model,this.services),new YN(this.model,this.services)];return this.getAxisChartComponents(t)}}class uB extends de{constructor(t,n){super(t,n),this.model.setOptions(Pt(Ct.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new Pn(this.model,this.services),new ti(this.model,this.services),new an(this.model,this.services,{handleThresholds:!0}),new QN(this.model,this.services),new ei(this.model,this.services)];return this.getAxisChartComponents(t)}}class hB extends de{constructor(t,n){super(t,n),this.model.setOptions(Pt(Ct.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new Pn(this.model,this.services),new qN(this.model,this.services),new an(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.GRID})];return this.getAxisChartComponents(t)}}class dB extends rn{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((r,i)=>r+i.value,0)}getFillColor(t){const n=this.getOptions(),r=b(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=b(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=b(t,"meter","proportional")?r:r>100?100:r,s=b(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=b(n,"meter","proportional"),{number:a,code:o}=b(this.getOptions(),"locale");let l=[],c=[],u;if(s===null){u=100;const d=t[0];l=["Group","Value",...i?["Status"]:[]],c=[[d[r],d.value===null?"&ndash;":a(d.value,o),...i?[i]:[]]]}else{const d=b(s,"total");u=d||this.getMaximumDomain(t),l=["Group","Value","Percentage of total"],c=[...t.map(h=>{let f;h.value!==null&&h.value!==void 0?f=Number(h.value):f=0;let p=Number((h.value/u*100).toFixed(2));return[h[r],h.value===null?"&ndash;":a(f,o),a(p,o)+" %"]})]}return super.formatTable({headers:l,cells:c})}}class fB extends qe{constructor(t,n){var i;super(t,n),this.model=new dB(this.services);const r=(i=n.options.meter)!=null&&i.proportional?lt(yn(Ct.proportionalMeterChart),n.options):lt(yn(Ct.meterChart),n.options);this.model.setOptions(r),this.init(t,n)}getComponents(){const n=[...b(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new BN(this.model,this.services)],growth:ct.STRETCH,renderType:tt.SVG},{id:"spacer",components:[new On(this.model,this.services,{size:8})],growth:ct.STRETCH}]:[],{id:"meter-graph",components:[new XN(this.model,this.services)],growth:ct.STRETCH,renderType:tt.SVG}],r=[new ae(this.model,this.services,n,{direction:At.COLUMN})];return this.getChartComponents(r,{graphFrameRenderType:tt.HTML})}}class pB extends ur{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=b(t,"radar","axes"),{number:s,code:a}=b(t,"locale"),o=b(n,"0","data").map(u=>u[r]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>b(u,"data",h,i)!==null?s(b(u,"data",h,i),a):"&ndash;")])];return super.formatTable({headers:l,cells:c})}}class gB extends qe{constructor(t,n){super(t,n),this.model=new pB(this.services),this.model.setOptions(Pt(Ct.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new KN(this.model,this.services)];return this.getChartComponents(t)}}class mB extends de{constructor(t,n){super(t,n),this.model.setOptions(Pt(Ct.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new Pn(this.model,this.services),new an(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.GRID})];return this.getAxisChartComponents(t)}}class vB extends rn{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 yB extends qe{constructor(t,n){super(t,n),this.model=new vB(this.services),this.model.setOptions(Pt(Ct.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new JN(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class EB extends rn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=b(this.getOptions(),"locale"),i=["Child","Group","Value"],s=[];return t.forEach(a=>{Array.isArray(a.children)?a.children.forEach(o=>{s.push([o.name,a.name,o.value===null?"&ndash;":n(o.value,r)])}):b(a.name)!==null&&b(a.value)&&s.push(["–",a.name,n(a.value,r)])}),super.formatTable({headers:i,cells:s})}}class bB extends qe{constructor(t,n){super(t,n),this.model=new EB(this.services),this.model.setOptions(Pt(Ct.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new AU(this.model,this.services)];return this.getChartComponents(t)}}class xB extends de{constructor(t,n){super(t,n),this.model.setOptions(Pt(Ct.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new Vv(this.model,this.services),new ei(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class _B extends de{constructor(t,n){super(t,n),this.model.setOptions(Pt(Ct.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new yo(this.model,this.services),new zv(this.model,this.services),new ti(this.model,this.services,{stacked:!0}),new Yv(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new oe(this.model,this.services,{skeleton:Gt.GRID})];return this.getAxisChartComponents(t)}}class SB extends de{constructor(t,n){super(t,n),this.model.setOptions(Pt(Ct.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new yo(this.model,this.services),new Wv(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.VERT_OR_HORIZ}),new ei(this.model,this.services)];return this.getAxisChartComponents(t)}}class TB extends rn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data,{code:a,number:o}=b(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[i],u[s],o(u[r],a)])];return super.formatTable({headers:l,cells:c})}}class OB extends qe{constructor(t,n){super(t,n),this.model=new TB(this.services),this.model.setOptions(Pt(Ct.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new XU(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.PIE})];return this.getChartComponents(t)}}W.Alignments=Ht,W.AlluvialChart=KP,W.AreaChart=xN,W.AreaEvent=$c,W.ArrowDirections=Wa,W.AxisEvent=Nc,W.AxisFlavor=rs,W.AxisPositions=G,W.AxisTitleOrientations=Ya,W.BarEvent=Hc,W.BoxplotChart=TN,W.BoxplotEvent=Gc,W.BubbleChart=wN,W.BulletChart=CN,W.CalloutDirections=Ji,W.CanvasZoomEvent=Pc,W.CartesianOrientations=Bt,W.ChartEvent=Dc,W.ChartTheme=jc,W.ChartTypes=Ee,W.CirclePackChart=JU,W.ColorClassNameTypes=it,W.ColorLegendType=ns,W.ComboChart=tB,W.DividerStatus=Yr,W.DominantBaseline=en,W.DonutChart=nB,W.ExperimentalChoroplethChart=KU,W.GaugeChart=iB,W.GaugeEvent=Bc,W.GaugeTypes=sr,W.GroupedBarChart=sB,W.HeatmapChart=oB,W.HistogramChart=cB,W.LayoutAlignItems=ir,W.LayoutDirection=At,W.LayoutGrowth=ct,W.LegendItemType=Vt,W.LegendOrientations=Wr,W.LegendPositions=zr,W.LineChart=uB,W.LineEvent=zc,W.LollipopChart=hB,W.MeterChart=fB,W.ModalEvent=Lc,W.ModelEvent=Rc,W.PieChart=t0,W.PieEvent=Uc,W.Projection=nn,W.RadarChart=gB,W.RadarEvent=Wc,W.RenderTypes=tt,W.ScaleTypes=Q,W.ScatterChart=mB,W.ScatterEvent=Vc,W.SimpleBarChart=xB,W.Skeletons=Gt,W.StackedAreaChart=_B,W.StackedBarChart=SB,W.Statuses=ts,W.TextAnchor=tn,W.ThresholdEvent=Xc,W.TickRotations=es,W.ToolbarControlTypes=_t,W.TooltipEvent=Gr,W.TreeChart=yB,W.TreeEvent=Yc,W.TreeTypes=za,W.TreemapChart=bB,W.TreemapEvent=qc,W.TruncationTypes=Ce,W.WordCloudChart=OB,W.WordCloudEvent=Fc,W.ZoomBarTypes=Ge,W.ZoomDomainEvent=kc,W.ZoombarEvent=Ic,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
85
+ </svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=b(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:yt(f,"locale.translations.total")||yt(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=I(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=I(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=I(this),s=i.classed("non-focal"),a=b(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,qr)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,qr),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 iN(e,t){const n=pi(this._current,e);return r=>(this._current=n(r),t(this._current))}class Nv extends gt{constructor(){super(...arguments),this.type="pie",this.renderType=et.SVG,this.isRendering=!1,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 Lt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(M=>M[a]>0),l=this.computeRadius();this.arc=Bi().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Bi().innerRadius(this.getInnerRadius()).outerRadius(l+Lt.hoverArc.outerRadiusOffset);const u=dT().value(M=>M[a]).sort(b(i,"pie","sortFunction")).padAngle(Lt.padAngle)(o),h=R.appendOrSelect(r,"g.slices").attr("role",ut.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,M=>M.data[s]);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("slice",!0).attr("opacity",0).merge(h).attr("class",M=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:M.data[s],originalClassName:"slice"})).style("fill",M=>n.model.getFillColor(M.data[s],null,M.data)).attr("d",this.arc).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",ut.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",M=>`${M[a]}, ${Zc(M.data[a],o,a)+"%"}`).attrTween("d",function(M){return iN.bind(this)(M,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:g,number:m}=b(i,"locale"),v=i.pie.labels.enabled,E=v?u.filter(M=>M.data[a]>0):[],x=R.appendOrSelect(r,"g.labels").attr("role",ut.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(E,M=>M.data[s]);x.exit().attr("opacity",0).remove();const S=x.enter().append("text").classed("pie-label",!0),_=[];S.merge(x).style("text-anchor","middle").text(M=>i.pie.labels.formatter?i.pie.labels.formatter({...M,percentageValue:Zc(M.data[a],o,a,!0)}):m(Zc(M.data[a],o,a),g)+"%").datum(function(M){const w=l+7,U=(M.endAngle-M.startAngle)/2+M.startAngle,$=U/Math.PI*180,N=this.getComputedTextLength();return M.textOffsetX=N/2,M.textOffsetY=$>90&&$<270?10:0,M.xPosition=(M.textOffsetX+w)*Math.sin(U),M.yPosition=(M.textOffsetY+w)*-Math.cos(U),M}).attr("transform",function(M,w){const U=E.length,$=(M.endAngle-M.startAngle)*(180/Math.PI);if(w>=U-2&&$<Lt.callout.minSliceDegree){let N,F;return M.index===U-1?(N=M.xPosition+Lt.callout.offsetX+Lt.callout.textMargin+M.textOffsetX,F=M.yPosition-Lt.callout.offsetY,M.direction=ts.RIGHT,_.push(M)):(N=M.xPosition-Lt.callout.offsetX-M.textOffsetX-Lt.callout.textMargin,F=M.yPosition-Lt.callout.offsetY,M.direction=ts.LEFT,_.push(M)),`translate(${N}, ${F})`}return`translate(${M.xPosition}, ${M.yPosition})`}),this.renderCallouts(_);const C=b(i,"donut")?"donut":"pie",L=b(i,C,"alignment"),{width:B}=R.getSVGElementSize(this.getParent(),{useAttrs:!0}),D=v?Lt.xOffset:0,O=v?Lt.yOffset:0;let H=l+D;L===Ht.CENTER?H=B/2:L===Ht.RIGHT&&(H=B-l-Lt.xOffset);let P=l+O;_.length>0&&(P+=Lt.yOffsetCallout),r.attr("x",H+7).attr("y",P),this.addEventListeners()}renderCallouts(t){const n=R.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",ut.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",ut.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+Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x-Lt.callout.horizontalLineLength):(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l-Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x+Lt.callout.horizontalLineLength),o}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return I(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 I(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=I(this);t.isRendering||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:I(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=I(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:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);mL(()=>{t.isRendering||i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),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}=R.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Lt.radiusOffset:i}}class sN extends Nv{constructor(){super(...arguments),this.type="donut",this.renderType=et.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer().select("g.center").remove();return}const r=R.appendOrSelect(this.getComponentContainer(),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=b(i,"donut","center","label");R.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(I(this))}),a!==null&&a!==""&&R.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=b(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=kh:s=ve;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(a(o)));else{const{code:c,number:u}=b(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const $v="4,10 8,6 12,10",Fv="12,6 8,10 4,6";class aN extends gt{constructor(){super(...arguments),this.type="gauge",this.renderType=et.SVG}getValue(){var r;return((r=this.model.getData().find(i=>i.group==="value"))==null?void 0:r.value)??null}getValueRatio(){return ag(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 b(t,"gauge","type")===ar.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(b(n,"gauge","deltaArrow","direction")){case Wa.UP:return $v;case Wa.DOWN:return Fv;default:return t>0?$v: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),R.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:[at.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>b(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",ut.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",E=>E),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const g=b(r,"gauge","alignment"),{width:m}=R.getSVGElementSize(this.getParent(),{useAttrs:!0});let v=d;g===Ht.CENTER?v=m/2:g===Ht.RIGHT&&(v=m-d),n.attr("x",v).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=b(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=b(n,"gauge","valueFontSize"),l=b(n,"gauge","deltaFontSize"),c=b(n,"gauge","numberSpacing"),u=b(n,"gauge","showPercentageSymbol");let d=0;r===ar.FULL&&!s?d=l(a):r===ar.SEMI&&s&&(d=-(l(a)+c));const h=R.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),f=o(a),p=R.appendOrSelect(h,"g.gauge-value-number"),{code:g,number:m}=b(n,"locale"),v=b(n,"gauge","numberFormatter"),E=p.selectAll("text.gauge-value-number").data([i]);E.enter().append("text").attr("class","gauge-value-number").merge(E).style("font-size",`${f}px`).attr("text-anchor","middle").text(B=>{let D;return B!=null?D=Number(B.toFixed(2))%1!==0?B.toFixed(2):B.toFixed():D=0,v?v(D):m(Number(D),g)});const{width:y}=R.getSVGElementSize(R.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),x=f/2,S=u?"%":"",_=R.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${x}px`).attr("x",y/2).text(S),{width:C,height:L}=R.getSVGElementSize(_,{useBBox:!0});_.attr("y",`-${L/2}px`),p.attr("transform",`translate(-${C/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta(),{code:s,number:a}=b(r,"locale");if(i){const o=this.computeRadius(),l=i?b(r,"gauge","deltaFontSize"):()=>0,c=i?b(r,"gauge","numberFormatter"):()=>null,u=b(r,"gauge","deltaArrow","size"),d=b(r,"gauge","numberSpacing"),h=b(r,"gauge","showPercentageSymbol"),f=R.appendOrSelect(n,"g.gauge-numbers"),p=R.appendOrSelect(f,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),g=R.appendOrSelect(p,"text.gauge-delta-number"),m=h?"%":"";g.data(i===null?[]:[i]),g.enter().append("text").classed("gauge-delta-number",!0).merge(g).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(x=>{let S;return x!=null?S=Number(x.toFixed(2))%1!==0?x.toFixed(2):x.toFixed():S=0,c?`${c(S)}${m}`:`${a(Number(S),s)}${m}`});const{width:v}=R.getSVGElementSize(R.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),E=b(r,"gauge","deltaArrow","enabled"),y=p.selectAll("svg.gauge-delta-arrow").data(i!==null&&E?[i]:[]);y.enter().append("svg").merge(y).attr("class","gauge-delta-arrow").attr("x",-u(o)-v/2).attr("y",-u(o)/2-l(o)*.35).attr("width",u(o)).attr("height",u(o)).attr("viewBox","0 0 16 16").each(function(){const x=I(this);R.appendOrSelect(x,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const S=b(r,"gauge","status");R.appendOrSelect(x,"polygon.gauge-delta-arrow").attr("class",S!==null?`gauge-delta-arrow status--${S}`:"").attr("points",t.getArrow(i))}),y.exit().remove(),g.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=b(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:I(this),datum:r})}).on("mousemove",function(n,r){const i=I(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:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=b(t,"gauge","type"),{width:r,height:i}=R.getSVGElementSize(this.parent,{useAttrs:!0});return n===ar.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class Uv extends qu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=et.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",ut.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()===Bt.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:[at.FILL],dataGroupName:h[i],originalClassName:"bar"})).style("fill",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[i],h[f],h)}).attr("d",h=>{const f=this.groupScale(h[i]),p=this.getBarWidth(),g=f,m=f+p,v=this.services.cartesianScales.getRangeAxisPosition({datum:h}),E=this.services.cartesianScales.getDomainLowerBound(v),y=this.services.cartesianScales.getValueThroughAxisPosition(v,E),x=this.services.cartesianScales.getRangeValue(h),S=this.services.cartesianScales.getDomainValue(h)-p/2,_=S+p;if(!this.isOutsideZoomedDomain(S,_))return ie({x0:g,x1:m,y0:y,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ut.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=I(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=I(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:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(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=b(t,"bars","width"),r=b(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=ki().domain(t).rangeRound([0,this.getGroupWidth()])}}class oN extends gt{constructor(){super(...arguments),this.type="heatmap",this.renderType=et.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",d=null,h=null,f=null;this.matrix[r]!==void 0?(u=a,i.forEach(p=>{if(typeof this.matrix[r][p].value=="number"){const g=this.matrix[r][p].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})):(u=o,s.forEach(p=>{if(typeof this.matrix[p][r].value=="number"){const g=this.matrix[p][r].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${Cn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Cn(l.range())},${c(r)})`),this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n.event,hoveredElement:I(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(""),b(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=>{const m=this.services.cartesianScales.getDomainIdentifier(g);return g.index===-1||g.value===null?`url(#${f})`:this.model.getFillColor(Number(g.value),g[m],g)}).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=R.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);R.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),R.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),R.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),R.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=b(this.getOptions(),"heatmap","divider","state");return t!==Yr.OFF&&(t===Yr.AUTO&&Zg.minCellDividerDimension<=this.xBandwidth&&Zg.minCellDividerDimension<=this.yBandwidth||t===Yr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=I(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,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:I(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:I(this),datum:u})}).on("mouseout",function(c,u){const h=I(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 lN extends gt{constructor(){super(...arguments),this.type="histogram",this.renderType=et.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=>yt(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",ut.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:[at.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=yt(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 m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-g)>0&&Math.abs(m-g)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Bt.VERTICAL?m+=1:m-=1),ie({x0:f,x1:p,y0:g,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ut.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>b(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:r,number:i}=b(t,"locale"),s=this;this.parent.selectAll("path.bar").on("mouseover",function(a,o){const l=I(this);l.classed("hovered",!0);const c=i(parseFloat(yt(o,"data.x0")),r),u=i(parseFloat(yt(o,"data.x1")),r),d=s.services.cartesianScales.getRangeAxisPosition(),h=s.services.cartesianScales.getScaleLabel(d);s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:yt(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:s.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:o[n]})},{label:h,value:yt(o,`data.${o[n]}`)}]})}).on("mousemove",function(a){s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("mouseout",function(){I(this).classed("hovered",!1),s.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 cN extends sn{constructor(){super(...arguments),this.type="lollipop",this.renderType=et.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]?xn.weight.unselected:xn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",xn.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?xn.opacity.unselected:xn.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",xn.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=v=>s.getDomainValue(v),u=v=>s.getRangeValue(v),d=s.getOrientation(),[h,f]=Sn(c,u,d),p=n.selectAll("line.line").data(this.getScatterData(),v=>`${v[i]}-${v[l]}`);p.exit().attr("opacity",0).remove();const m=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",v=>this.model.getColorClassName({classNameTypes:[at.STROKE],dataGroupName:v[i],originalClassName:"line"})).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"lollipop-line-update-enter",animate:t})).style("stroke",v=>this.model.getFillColor(v[i],v[l],v)).attr("opacity",1);d===Bt.HORIZONTAL?m.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",v=>h(v)-r.points.radius):m.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",v=>f(v)+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 uN extends gt{constructor(){super(...arguments),this.type="meter",this.renderType=et.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)-jt.dividerWidth),x:r-n(s.value)}):(r=n(s.value),{...s,width:Math.abs(n(s.value)-jt.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),s=b(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=R.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;if(b(i,"meter","proportional")===null)u=100;else{const y=b(i,"meter","proportional","total");u=y||this.model.getMaximumDomain(this.model.getDisplayData())}const d=Fe().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=b(i,"meter","height");R.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?jt.height.proportional:jt.height.default)),R.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?jt.height.proportional:jt.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",y=>y.x).attr("y",0).attr("height",()=>f||(s?jt.height.proportional:jt.height.default)).attr("class",y=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:y[c],originalClassName:g})).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"meter-bar-update",animate:t})).attr("width",y=>y.value>u?d(u):y.width).style("fill",y=>n.model.getFillColor(y[c],null,y)).attr("role",ut.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",y=>y.value),p.exit().remove();const m=b(i,"meter","peak");let v=m;m!==null&&(m>u?v=u:m<a[0].value&&(v=a[0].value>u?u:a[0].value));const E=r.selectAll("line.peak").data(v==null?[]:[v]);E.enter().append("line").classed("peak",!0).merge(E).attr("y1",0).attr("y2",()=>f||(s?jt.height.proportional:jt.height.default)).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"peak-line-update",animate:t})).attr("x1",y=>d(y)).attr("x2",y=>d(y)).attr("role",ut.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",y=>y),E.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=b(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=I(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=I(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:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(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 Bv(e){const t=hN(Hv(e),360);return Nn(t,[0,10])||Nn(t,[350,0])?{textAnchor:Je.START,dominantBaseline:tn.MIDDLE}:Nn(t,[10,80])?{textAnchor:Je.START,dominantBaseline:tn.HANGING}:Nn(t,[80,100])?{textAnchor:Je.MIDDLE,dominantBaseline:tn.HANGING}:Nn(t,[100,170])?{textAnchor:Je.END,dominantBaseline:tn.HANGING}:Nn(t,[170,190])?{textAnchor:Je.END,dominantBaseline:tn.MIDDLE}:Nn(t,[190,260])?{textAnchor:Je.END,dominantBaseline:tn.BASELINE}:Nn(t,[260,280])?{textAnchor:Je.MIDDLE,dominantBaseline:tn.BASELINE}:{textAnchor:Je.START,dominantBaseline:tn.BASELINE}}function hN(e,t){return(e%t+t)%t}function Nn(e,[t,n]){return e>=t&&e<=n}function Hv(e){return e*(180/Math.PI)}function Ft(e,t,n={x:0,y:0}){const r=t*Math.cos(e)+n.x,i=t*Math.sin(e)+n.y;return{x:isNaN(r)?0:r,y:isNaN(i)?0:i}}function dN(e,t){return t*Math.sin(e-Math.PI/2)}class fN extends gt{constructor(){super(...arguments),this.type="radar",this.renderType=et.SVG,this.getLabelDimensions=t=>{const n=R.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=R.appendOrSelect(n,"text").text(t),{width:i,height:s}=R.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=b(n,"radar","axes"),s=b(n,"data","groupMapsTo"),a=_L(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return lt(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=b(n,"radar","axes"),s=b(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:lt(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?or.opacity.unselected:or.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?or.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",or.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}=R.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=b(o,"data","groupMapsTo"),c=b(o,"radar","axes","value"),{angle:u,value:d}=b(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:f,yTicksNumber:p,minRange:g,xAxisRectHeight:m}=or;this.uniqueKeys=Array.from(new Set(s.map(A=>A[u]))),this.uniqueGroups=Array.from(new Set(s.map(A=>A[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const E=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),S=(Math.min(r,i)-E)/2;if(S<=0)return;const _=ki().domain(this.fullDataNormalized.map(A=>A[u])).range([0,2*Math.PI].map(A=>A-Math.PI/2)),C=Cn(this.fullDataNormalized.map(A=>A[d])),L=Fe().domain([C>=0?0:C,Bn(this.fullDataNormalized.map(A=>A[d]))]).range([g,S]).nice(p),B=L.ticks(p),D=(A,V,z)=>this.model.getFillColor(A,V,z),O=gT().angle(A=>_(A[u])+Math.PI/2).radius(A=>L(A[d])).curve(Zf),H=this.uniqueKeys.map(A=>{const V=this.getLabelDimensions(A).width,z=dN(_(A),S);return V+z}),M={x:Bn(H)+h,y:i/2},U=R.appendOrSelect(n,"g.y-axes").attr("role",ut.GROUP).selectAll("path").data(B,A=>A),$=A=>this.uniqueKeys.map(V=>({[u]:V,[d]:A}));U.join(A=>A.append("path").attr("opacity",0).attr("transform",`translate(${M.x}, ${M.y})`).attr("fill","none").call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",z=>O($(z)))),A=>A.call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${M.x}, ${M.y})`).attr("d",z=>O($(z)))),A=>A.call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_y_axes_exit",animate:t})).attr("d",z=>O($(z))).attr("opacity",0).remove())),R.appendOrSelect(n,"g.x-axes").attr("role",ut.GROUP).selectAll("line").data(this.uniqueKeys,A=>A).join(A=>A.append("line").attr("opacity",0).attr("class",V=>`x-axis-${Hr(V)}`).attr("stroke-dasharray","0").attr("x1",V=>Ft(_(V),0,M).x).attr("y1",V=>Ft(_(V),0,M).y).attr("x2",V=>Ft(_(V),0,M).x).attr("y2",V=>Ft(_(V),0,M).y).call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",z=>Ft(_(z),L.range()[0],M).x).attr("y1",z=>Ft(_(z),L.range()[0],M).y).attr("x2",z=>Ft(_(z),L.range()[1],M).x).attr("y2",z=>Ft(_(z),L.range()[1],M).y)),A=>A.call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",z=>Ft(_(z),L.range()[0],M).x).attr("y1",z=>Ft(_(z),L.range()[0],M).y).attr("x2",z=>Ft(_(z),L.range()[1],M).x).attr("y2",z=>Ft(_(z),L.range()[1],M).y)),A=>A.call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),R.appendOrSelect(n,"g.x-labels").attr("role",ut.GROUP).selectAll("text").data(this.uniqueKeys).join(A=>A.append("text").text(V=>V).attr("opacity",0).attr("x",V=>Ft(_(V),L.range()[1]+h,M).x).attr("y",V=>Ft(_(V),L.range()[1]+h,M).y).style("text-anchor",V=>Bv(_(V)).textAnchor).style("dominant-baseline",V=>Bv(_(V)).dominantBaseline).call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),A=>A.call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",z=>Ft(_(z),L.range()[1]+h,M).x).attr("y",z=>Ft(_(z),L.range()[1]+h,M).y).end().finally(()=>{const z=b(o,"radar","alignment"),St=this.getAlignmentXOffset(z,n,this.getParent());n.attr("x",St)})),A=>A.call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),R.appendOrSelect(n,"g.blobs").attr("role",ut.GROUP).selectAll("path").data(this.groupedDataNormalized,A=>A.name).join(A=>A.append("path").attr("class",V=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:V.name,originalClassName:"blob"})).attr("role",ut.GRAPHICS_SYMBOL).attr("aria-label",V=>V.name).attr("opacity",0).attr("transform",t?()=>`translate(${M.x}, ${M.y}) scale(${1+Math.random()*.35})`:`translate(${M.x}, ${M.y})`).style("fill",V=>D(V.name,null,V.data)).style("fill-opacity",or.opacity.selected).style("stroke",V=>D(V.name,null,V.data)).call(V=>{const z=V.transition().call(St=>this.services.transitions.setupTransition({transition:St,name:"radar_blobs_enter",animate:t}));t&&z.delay(()=>Math.random()*30).attr("transform",`translate(${M.x}, ${M.y})`),z.attr("opacity",1).attr("d",St=>O(St.data))}),A=>(A.attr("class",V=>this.model.getColorClassName({classNameTypes:[at.FILL,at.STROKE],dataGroupName:V.name,originalClassName:"blob"})).style("fill",V=>D(V.name,null,V.data)).style("stroke",V=>D(V.name,null,V.data)),A.call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${M.x}, ${M.y})`).attr("d",z=>O(z.data))),A),A=>A.call(V=>{const z=V.transition().call(St=>this.services.transitions.setupTransition({transition:St,name:"radar_blobs_exit",animate:t}));t&&z.delay(()=>Math.random()*30).attr("transform",()=>`translate(${M.x}, ${M.y}) scale(${1+Math.random()*.35})`),z.attr("opacity",0).remove()})),R.appendOrSelect(n,"g.dots").attr("role",ut.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(A=>b(A,d)!==null)).join(A=>A.append("circle").attr("role",ut.GRAPHICS_SYMBOL).attr("aria-label",V=>V[c]),A=>A,A=>A.remove()).attr("class",A=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:A[l],originalClassName:Hr(A[u])})).attr("cx",A=>Ft(_(A[u]),L(A[d]),M).x).attr("cy",A=>Ft(_(A[u]),L(A[d]),M).y).attr("r",0).attr("opacity",0).style("fill",A=>D(A[l])),R.appendOrSelect(n,"g.x-axes-rect").attr("role",ut.GROUP).selectAll("rect").data(this.uniqueKeys).join(A=>A.append("rect"),A=>A,A=>A.remove()).attr("x",M.x).attr("y",M.y-m/2).attr("width",L.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",A=>`rotate(${Hv(_(A))}, ${M.x}, ${M.y})`);const{code:vt,number:q}=b(o,"locale");R.appendOrSelect(n,"g.y-labels").attr("role",ut.GROUP).selectAll("text").data(ke(B)).join(A=>A.append("text").attr("opacity",0).text(V=>q(V,vt)).attr("x",V=>Ft(-Math.PI/2,L(V),M).x+f).attr("y",V=>Ft(-Math.PI/2,L(V),M).y).style("text-anchor","start").style("dominant-baseline","middle").call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),A=>A.call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_y_labels_update",animate:t})).text(z=>z).attr("opacity",1).attr("x",z=>Ft(-Math.PI/2,L(z),M).x+f).attr("y",z=>Ft(-Math.PI/2,L(z),M).y)),A=>A.call(V=>V.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=R.getSVGElementSize(n,{useBBox:!0}),{width:s}=R.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===Ht.CENTER?a=Math.floor((s-i.width)/2):t===Ht.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}}=b(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=I(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-${Hr(i)}`),o=t.parent.selectAll(`.dots circle.${Hr(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=b(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",or.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],null,f),class:t.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=I(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:I(this),datum:i})}).on("mouseout",function(r,i){const s=I(this),a=t.parent.select(`.x-axes .x-axis-${Hr(i)}`),o=t.parent.selectAll(`.dots circle.${Hr(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE)})}}class Gv extends qu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=et.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:[at.FILL],dataGroupName:c[r],originalClassName:"bar"})).style("fill",c=>{const u=this.services.cartesianScales.getDomainIdentifier(c);return this.model.getFillColor(c[r],c[u],c)}).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,m;if(Array.isArray(h)&&h.length===2)g=this.services.cartesianScales.getRangeValue(h[0]),m=this.services.cartesianScales.getRangeValue(h[1]);else{const y=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,y)),m=this.services.cartesianScales.getRangeValue(c)}const v=Math.abs(m-g);if(v!==0&&v<2&&(h>0&&a===Bt.VERTICAL||h<0&&a===Bt.HORIZONTAL?m=g-2:m=g+2),!this.isOutsideZoomedDomain(f,p))return ie({x0:f,x1:p,y0:g,y1:m},a)}).attr("opacity",1).attr("role",ut.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=I(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:I(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:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(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 pN extends oe{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=b(this.getOptions(),"data","loading"),r=!b(this.getOptions(),"grid","x","enabled")&&!b(this.getOptions(),"grid","y","enabled")&&!b(this.getOptions(),"axes","bottom","visible")&&!b(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=R.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=R.appendOrSelect(t,"svg.chart-skeleton.DAII"),R.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class Vv extends gt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=et.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=>b(s,0,i)!==n.datum().name?bn.opacity.unselected:bn.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",bn.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=b(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=>b(p,0,s));this.areaGenerator=Zl().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=>b(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:b(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(b(p,0,s),null,p)).attr("role",ut.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>b(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",bn.opacity.selected).attr("d",this.areaGenerator)}}class zv extends qu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=et.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=>b(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",ut.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:[at.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i],c.data.sharedStackKey,c.data)).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 m=c[0]<0&&c[1]<=0;m&&a.length>1?this.services.cartesianScales.getOrientation()===Bt.VERTICAL?g+=c[1]===0?2:1:g-=1:m||(this.services.cartesianScales.getOrientation()===Bt.VERTICAL?g+=1:g-=1)}return ie({x0:h,x1:f,y0:p,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",ut.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=I(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=I(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:I(this),datum:s})}).on("mouseout",function(i,s){const a=I(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(b(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=R.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=b(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 Wv extends sn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=et.SVG}render(t){if(!b(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=>b(f,0,s));l.exit().attr("opacity",0).remove();const u=l.enter().append("g").classed("dots",!0).attr("role",ut.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),m=this.services.cartesianScales.getRangeIdentifier(f);return{[s]:p,[g]:f.data.sharedStackKey,[m]: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],m=this.services.cartesianScales.getDomainIdentifier(u),v=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,[m]:f,[v]:p}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(d=>d[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const ni=6;class gN extends gt{constructor(){super(...arguments),this.type="tree",this.renderType=et.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}=R.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer();n.html("");const{width:r,height:i}=R.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=b(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=Li({name:o,children:a}),f=10,p=r/6,g=_=>{const C=h.descendants().reverse(),L=h.links();let B=h,D=h;h.eachBefore(N=>{N.x<B.x&&(B=N),N.x>D.x&&(D=N)});const O=D.x-B.x,H=n.transition().call(N=>this.services.transitions.setupTransition({transition:N,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,B.x,r,O].join(" ")),P=S.selectAll("g").data(C,N=>N.id),M=this,w=P.enter().append("g").attr("transform",()=>`translate(${_.y0},${_.x0})`).attr("class",N=>N.depth!==0&&N.children&&N.children.length>0?"clickable":null).on("mouseover",function(N,F){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOVER,{event:N,element:I(this),datum:F})}).on("click",function(N,F){F.depth!==0&&(F.children=F.children?null:F._children,g(F)),M.services.events.dispatchEvent(T.Tree.NODE_CLICK,{event:N,element:I(this),datum:F})}).on("mouseout",function(N,F){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOUT,{event:N,element:I(this),datum:F})});w.append("circle").attr("r",2.5).attr("class",N=>N._children?"parent":"child").attr("stroke-width",10),w.append("text").attr("dy","0.31em").attr("x",N=>N._children?-ni:ni).attr("text-anchor",N=>N._children?"end":"start").text(N=>N.data.name).clone(!0).attr("class","text-stroke").lower(),P.merge(w).transition(H).attr("transform",N=>`translate(${N.y},${N.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),P.exit().transition(H).remove().attr("transform",()=>`translate(${_.y},${_.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const U=x.selectAll("path").data(L,N=>N.target.id),$=U.enter().append("path").attr("d",()=>{const N={x:_.x0,y:_.y0};return y({source:N,target:N})});U.merge($).transition(H).attr("d",y),U.exit().transition(H).remove().attr("d",()=>{const N={x:_.x,y:_.y};return y({source:N,target:N})}),h.eachBefore(N=>{N.x0=N.x,N.y0=N.y})},m=h.descendants(),v=m[m.length-1].depth,E=b(s,"tree","type")===za.DENDROGRAM?Nx().size([i,r-u-v*ni-l]):S_().nodeSize([f,p]).size([i,r-u-v*ni-l]),y=xT().x(_=>_.y).y(_=>_.x);h.x0=p/2,h.y0=0,h.descendants().forEach((_,C)=>{_.id=C,_._children=_.children}),E(h),n.attr("viewBox",[-d.left,-d.top,r,f]).style("user-select","none");const x=n.append("g").attr("class","links"),S=n.append("g").attr("class","nodes");g(h)}}var mN="#000000",vN="#ffffff",yN="#fcf4d6",EN="#fddc69",bN="#f1c21b",xN="#d2a106",_N="#b28600",SN="#8e6a00",TN="#684e00",ON="#483700",wN="#302400",MN="#1c1500",AN={10:yN,20:EN,30:bN,40:xN,50:_N,60:SN,70:TN,80:ON,90:wN,100:MN},CN="#fff2e8",DN="#ffd9be",LN="#ffb784",RN="#ff832b",IN="#eb6200",kN="#ba4e00",PN="#8a3800",NN="#5e2900",$N="#3e1a00",FN="#231000",UN={10:CN,20:DN,30:LN,40:RN,50:IN,60:kN,70:PN,80:NN,90:$N,100:FN},BN="#fff1f1",HN="#ffd7d9",GN="#ffb3b8",VN="#ff8389",zN="#fa4d56",WN="#da1e28",YN="#a2191f",qN="#750e13",XN="#520408",jN="#2d0709",ZN={10:BN,20:HN,30:GN,40:VN,50:zN,60:WN,70:YN,80:qN,90:XN,100:jN},KN="#fff0f7",QN="#ffd6e8",JN="#ffafd2",t$="#ff7eb6",e$="#ee5396",n$="#d02670",r$="#9f1853",i$="#740937",s$="#510224",a$="#2a0a18",o$={10:KN,20:QN,30:JN,40:t$,50:e$,60:n$,70:r$,80:i$,90:s$,100:a$},l$="#f6f2ff",c$="#e8daff",u$="#d4bbff",h$="#be95ff",d$="#a56eff",f$="#8a3ffc",p$="#6929c4",g$="#491d8b",m$="#31135e",v$="#1c0f30",y$={10:l$,20:c$,30:u$,40:h$,50:d$,60:f$,70:p$,80:g$,90:m$,100:v$},E$="#edf5ff",b$="#d0e2ff",x$="#a6c8ff",_$="#78a9ff",S$="#4589ff",T$="#0f62fe",O$="#0043ce",w$="#002d9c",M$="#001d6c",A$="#001141",C$={10:E$,20:b$,30:x$,40:_$,50:S$,60:T$,70:O$,80:w$,90:M$,100:A$},D$="#e5f6ff",L$="#bae6ff",R$="#82cfff",I$="#33b1ff",k$="#1192e8",P$="#0072c3",N$="#00539a",$$="#003a6d",F$="#012749",U$="#061727",B$={10:D$,20:L$,30:R$,40:I$,50:k$,60:P$,70:N$,80:$$,90:F$,100:U$},H$="#d9fbfb",G$="#9ef0f0",V$="#3ddbd9",z$="#08bdba",W$="#009d9a",Y$="#007d79",q$="#005d5d",X$="#004144",j$="#022b30",Z$="#081a1c",K$={10:H$,20:G$,30:V$,40:z$,50:W$,60:Y$,70:q$,80:X$,90:j$,100:Z$},Q$="#defbe6",J$="#a7f0ba",tF="#6fdc8c",eF="#42be65",nF="#24a148",rF="#198038",iF="#0e6027",sF="#044317",aF="#022d0d",oF="#071908",lF={10:Q$,20:J$,30:tF,40:eF,50:nF,60:rF,70:iF,80:sF,90:aF,100:oF},cF="#f2f4f8",uF="#dde1e6",hF="#c1c7cd",dF="#a2a9b0",fF="#878d96",pF="#697077",gF="#4d5358",mF="#343a3f",vF="#21272a",yF="#121619",EF={10:cF,20:uF,30:hF,40:dF,50:fF,60:pF,70:gF,80:mF,90:vF,100:yF},bF="#f4f4f4",xF="#e0e0e0",_F="#c6c6c6",SF="#a8a8a8",TF="#8d8d8d",OF="#6f6f6f",wF="#525252",MF="#393939",AF="#262626",CF="#161616",DF={10:bF,20:xF,30:_F,40:SF,50:TF,60:OF,70:wF,80:MF,90:AF,100:CF},LF="#f7f3f2",RF="#e5e0df",IF="#cac5c4",kF="#ada8a8",PF="#8f8b8b",NF="#726e6e",$F="#565151",FF="#3c3838",UF="#272525",BF="#171414",HF={10:LF,20:RF,30:IF,40:kF,50:PF,60:NF,70:$F,80:FF,90:UF,100:BF},Yv={black:{100:mN},blue:C$,coolGray:EF,cyan:B$,gray:DF,green:lF,magenta:o$,orange:UN,purple:y$,red:ZN,teal:K$,warmGray:HF,white:{0:vN},yellow:AN};const GF=e=>{if(!e)return null;for(const t of Object.keys(Yv)){const n=Yv[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},qv=function(){const e=I(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=on(t);let r;if(n&&(r=GF(n?n.hex():null)),r==null){const i=Bo(n).l;r=Math.abs(i*100-100)}return r>50?"white":"black"};let VF=0;class zF extends gt{constructor(){super(...arguments),this.type="treemap",this.renderType=et.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=b(window,"location"),{width:a,height:o}=R.getSVGElementSize(n,{useAttrs:!0}),l=Li({name:i.title||"Treemap",children:r}).sum(g=>g.value).sort((g,m)=>m.value-g.value),c=A_().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",()=>VF++).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=I(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:[at.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,null,g.data)}),h.selectAll("clipPath").data(g=>g.data.showLabel!==!0?[]:[1],g=>g).join(g=>g.append("clipPath").attr("id",function(){const m=I(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${m}`}).append("use").attr("xlink:href",function(){const m=I(this.parentNode.parentNode).attr("data-uid"),v=`${i.style.prefix}-leaf-${m}`;return new URL(`#${v}`,s)+""}),g=>null,g=>g.remove()),h.selectAll("text").data(g=>{if(g.data.showLabel!==!0)return[];let m=g;for(;m.depth>1;)m=m.parent;const v=Bo(this.model.getFillColor(m.data.name));return[{text:g.data.name,color:v.l<.5?"white":"black"}]},g=>g).join(g=>{const m=g.append("text").text(v=>v.text).style("fill",qv).attr("x",7).attr("y",18);return s&&m.attr("clip-path",function(){const v=I(this.parentNode).attr("data-uid"),E=`${i.style.prefix}-clip-${v}`;return`url(${new URL(`#${E}`,s)+""})`}),m},g=>g.text(m=>m.text).style("fill",qv),g=>g.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=I(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,null,o.data);return l&&(s=l),on(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=I(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:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(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,null,a.data)),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}}var WF={value:function(){}};function Xv(){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 YF(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=Xv.prototype={constructor:Eo,on:function(e,t){var n=this._,r=YF(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=qF(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]=jv(n[i],e.name,t);else if(t==null)for(i in n)n[i]=jv(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 qF(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function jv(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=WF,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const XF=T2(Object.freeze(Object.defineProperty({__proto__:null,dispatch:Xv},Symbol.toStringTag,{value:"Module"}))).dispatch,Xu=Math.PI/180,jF={archimedean:Kv,rectangular:aU},Es=64,bo=2048;var ZF=function(){var e=[256,256],t=KF,n=QF,r=JF,i=Zv,s=Zv,a=tU,o=eU,l=Kv,c=[],u=1/0,d=XF("word","end"),h=null,f=Math.random,p={},g=lU;p.canvas=function(E){return arguments.length?(g=$n(E),p):g},p.start=function(){var E=m(g()),y=oU((e[0]>>5)*e[1]),x=null,S=c.length,_=-1,C=[],L=c.map(function(D,O){return D.text=t.call(this,D,O),D.font=n.call(this,D,O),D.style=i.call(this,D,O),D.weight=s.call(this,D,O),D.rotate=a.call(this,D,O),D.size=~~r.call(this,D,O),D.padding=o.call(this,D,O),D}).sort(function(D,O){return O.size-D.size});return h&&clearInterval(h),h=setInterval(B,0),B(),p;function B(){for(var D=Date.now();Date.now()-D<u&&++_<S&&h;){var O=L[_];O.x=e[0]*(f()+.5)>>1,O.y=e[1]*(f()+.5)>>1,nU(E,O,L,_),O.hasText&&v(y,O,x)&&(C.push(O),d.call("word",p,O),x?iU(x,O):x=[{x:O.x+O.x0,y:O.y+O.y0},{x:O.x+O.x1,y:O.y+O.y1}],O.x-=e[0]>>1,O.y-=e[1]>>1)}_>=S&&(p.stop(),d.call("end",p,C,x))}},p.stop=function(){h&&(clearInterval(h),h=null);for(const E of c)delete E.sprite;return p};function m(E){const y=E.getContext("2d",{willReadFrequently:!0});E.width=E.height=1;const x=Math.sqrt(y.getImageData(0,0,1,1).data.length>>2);return E.width=(Es<<5)/x,E.height=bo/x,y.fillStyle=y.strokeStyle="red",{context:y,ratio:x}}function v(E,y,x){e[0],e[1];for(var S=y.x,_=y.y,C=Math.sqrt(e[0]*e[0]+e[1]*e[1]),L=l(e),B=f()<.5?1:-1,D=-B,O,H,P;(O=L(D+=B))&&(H=~~O[0],P=~~O[1],!(Math.min(Math.abs(H),Math.abs(P))>=C));)if(y.x=S+H,y.y=_+P,!(y.x+y.x0<0||y.y+y.y0<0||y.x+y.x1>e[0]||y.y+y.y1>e[1])&&(!x||sU(y,x))&&!rU(y,E,e[0])){for(var M=y.sprite,w=y.width>>5,U=e[0]>>5,$=y.x-(w<<4),N=$&127,F=32-N,Y=y.y1-y.y0,Z=(y.y+y.y0)*U+($>>5),K,dt=0;dt<Y;dt++){K=0;for(var it=0;it<=w;it++)E[Z+it]|=K<<F|(it<w?(K=M[dt*w+it])>>>N:0);Z+=U}return!0}return!1}return p.timeInterval=function(E){return arguments.length?(u=E??1/0,p):u},p.words=function(E){return arguments.length?(c=E,p):c},p.size=function(E){return arguments.length?(e=[+E[0],+E[1]],p):e},p.font=function(E){return arguments.length?(n=$n(E),p):n},p.fontStyle=function(E){return arguments.length?(i=$n(E),p):i},p.fontWeight=function(E){return arguments.length?(s=$n(E),p):s},p.rotate=function(E){return arguments.length?(a=$n(E),p):a},p.text=function(E){return arguments.length?(t=$n(E),p):t},p.spiral=function(E){return arguments.length?(l=jF[E]||E,p):l},p.fontSize=function(E){return arguments.length?(r=$n(E),p):r},p.padding=function(E){return arguments.length?(o=$n(E),p):o},p.random=function(E){return arguments.length?(f=E,p):f},p.on=function(){var E=d.on.apply(d,arguments);return E===d?p:E},p};function KF(e){return e.text}function QF(){return"serif"}function Zv(){return"normal"}function JF(e){return Math.sqrt(e.value)}function tU(){return(~~(random()*6)-3)*30}function eU(){return 1}function nU(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(Es<<5)/s,bo/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 O=i.measureText(t.text),H=-Math.floor(O.width/2);let P=(O.width+1)*s,M=t.size<<1;if(t.rotate){var u=Math.sin(t.rotate*Xu),d=Math.cos(t.rotate*Xu),h=P*d,f=P*u,p=M*d,g=M*u;P=Math.max(Math.abs(h+g),Math.abs(h-g))+31>>5<<5,M=~~Math.max(Math.abs(f+p),Math.abs(f-p))}else P=P+31>>5<<5;if(M>l&&(l=M),a+P>=Es<<5&&(a=0,o+=l,l=0),o+M>=bo)break;i.translate((a+(P>>1))/s,(o+(M>>1))/s),t.rotate&&i.rotate(t.rotate*Xu),i.fillText(t.text,H,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,H,0)),i.restore(),t.width=P,t.height=M,t.xoff=a,t.yoff=o,t.x1=P>>1,t.y1=M>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=P}for(var m=i.getImageData(0,0,(Es<<5)/s,bo/s).data,v=[];--r>=0;)if(t=n[r],!!t.hasText){for(var E=t.width,y=E>>5,x=t.y1-t.y0,S=0;S<x*y;S++)v[S]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var _=0,C=-1,L=0;L<x;L++){for(var S=0;S<E;S++){var B=y*L+(S>>5),D=m[(o+L)*(Es<<5)+(a+S)<<2]?1<<31-S%32:0;v[B]|=D,_|=D}_?C=L:(t.y0++,x--,L--,o++)}t.y1=t.y0+C,t.sprite=v.slice(0,(t.y1-t.y0)*y)}}}function rU(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 iU(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 sU(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 Kv(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function aU(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 oU(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function lU(){return document.createElement("canvas")}function $n(e){return typeof e=="function"?e:function(){return e}}const cU=S2(ZF);class uU extends gt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=et.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}=R.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=cU().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=R.appendOrSelect(r,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=g.selectAll("text").data(p,E=>`${E[c]}-${E.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",E=>`${E.size}px`).text(function(E){return E.text}).attr("class",E=>n.model.getColorClassName({classNameTypes:[at.FILL],dataGroupName:E[c],originalClassName:`word ${E.size>32?"light":""}`})).style("fill",E=>n.model.getFillColor(E[c],E.text,E)).attr("text-anchor","middle").transition().call(E=>n.services.transitions.setupTransition({transition:E,name:"wordcloud-text-update-enter",animate:t})).attr("transform",E=>`translate(${E.x}, ${E.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=R.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?ke(i):[1,1];return Fe().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:I(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:yt(t,"locale.translations.group")||yt(t,"tooltip.groupLabel")||"Group",value:a[n],class:r.model.getColorClassName({classNameTypes:[at.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=I(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:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(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 hU extends gt{constructor(){super(...arguments),this.type="geo",this.renderType=et.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=R.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=b(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(v=>{typeof a[v].value=="number"?o[v]=a[v]:l[v]=a[v]});const c=JP(s,Object.values(l)),u=ZP(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=lx().projection(d);R.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),g=R.appendOrSelect(t,"defs");R.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",Hi()([[0,0],[0,10]]));const m=R.appendOrSelect(t,"g.missing-data");R.appendOrSelect(m,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(b(this.getOptions(),"thematic","projection")){case en.geoEqualEarth:t=Mx();break;case en.geoAlbers:t=bx();break;case en.geoConicEqualArea:t=Zd();break;case en.geoConicEquidistant:t=Ox();break;case en.geoEquirectangular:t=Sx();break;case en.geoMercator:t=xx();break;case en.geoNaturalEarth1:t=Ax();break;default:throw new Error("Projection is not supported.")}return t}}class dU extends hU{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=I(this);t.services.events.dispatchEvent(Vr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Gr.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(Vr.CHOROPLETH_MOUSEMOVE,{event:r,element:I(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Gr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Vr.CHOROPLETH_CLICK,{event:r,element:I(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=I(this);t.services.events.dispatchEvent(Vr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Gr.HIDE,{event:r,hoveredElement:s})})}}class fU extends Ye{constructor(t,n){super(t,n),this.model=new YP(this.services),this.model.setOptions(Pt(Ct.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=b(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new ms(this.model,this.services)],growth:ct.STRETCH},o={id:"toolbar",components:[new Kr(this.model,this.services)],growth:ct.PREFERRED},l={id:"header",components:[new ae(this.model,this.services,[a,...i?[o]:[]],{direction:At.ROW,alignItems:sr.CENTER})],growth:ct.PREFERRED},c={id:"legend",components:[new Pv(this.model,this.services,{chartType:"choropleth"})],growth:ct.PREFERRED,renderType:et.SVG},u={id:"graph-frame",components:t,growth:ct.STRETCH,renderType:et.SVG},d=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=At.COLUMN_REVERSE,f={id:"spacer",components:[new wn(this.model,this.services,{size:15})],growth:ct.PREFERRED},p={id:"full-frame",components:[new ae(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:ct.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new wn(this.model,this.services,i?{size:15}:void 0)],growth:ct.PREFERRED};g.push(m)}return g.push(p),[new Iu(this.model,this.services),new po(this.model,this.services),new ae(this.model,this.services,g,{direction:At.COLUMN})]}getComponents(){const t=[new dU(this.model,this.services)];return this.getChartComponents(t)}}class pU 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=lt({},t,this.getZoomOptions(t));Kc(n,r);const i=this.getHierarchyLevel(),s=b(n,"circlePack","hierarchyLevel");this.set({options:lt(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&&b(n,0,"children")?b(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}),b(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:Vt.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(),{number:n,code:r}=b(this.getOptions(),"locale"),i=["Child","Parent","Value"],s=[];return t.forEach(a=>{let o=a.value?a.value:0;a.children&&(o+=this.getChildrenDatums(a.children,a.name,s,0)),s.push(["&ndash;",a.name,n(o,r)])}),super.formatTable({headers:i,cells:s})}getChildrenDatums(t,n,r=[],i=0){const s=n,{number:a,code:o}=b(this.getOptions(),"locale");return t.forEach(l=>{const c=l.name;let u=0;if(l.children)l.children.length>0&&(typeof l.value=="number"&&(i+=l.value),u+=this.getChildrenDatums(l.children,c,r,u),r.push([c,s,a(u,o)]),i+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,i+=l.value),r.push([l.name,s,a(d,o)])}}),i}}class gU extends Ye{constructor(t,n){super(t,n),this.model=new pU(this.services),this.model.setOptions(Pt(Ct.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new rN(this.model,this.services)];return this.getChartComponents(t)}}const Qv={[Ee.LINE]:[ti,sn],[Ee.SCATTER]:[sn],[Ee.AREA]:[Cv,ti,sn],[Ee.STACKED_AREA]:[Vv,ti,Wv,yo],[Ee.SIMPLE_BAR]:[Gv],[Ee.GROUPED_BAR]:[Uv,ei],[Ee.STACKED_BAR]:[zv,yo]};class mU extends de{constructor(t,n){super(t,n);const r=Pt(Ct.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(Qv).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=`${UA(i.type)}Chart`;return a=lt({},Ct[l],this.model.getOptions(),i.options),i.type===Ee.STACKED_AREA&&(o=!0),Qv[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=lt({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return Ip(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 Te(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.GRID}),...n?[]:[new Pn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class vU 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,{number:s,code:a}=b(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[r],c[i]===null?"&ndash;":s(c[i],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((r,i)=>i.value-r.value)}}class Jv extends Ye{constructor(t,n,r=!1){super(t,n),this.model=new vU(this.services),!r&&(this.model.setOptions(Pt(Ct.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new Nv(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.PIE})];return this.getChartComponents(t)}}class yU extends Jv{constructor(t,n){super(t,n,!0),this.model.setOptions(Pt(Ct.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new sN(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.DONUT})];return this.getChartComponents(t)}}class EU 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,{number:i,code:s}=b(this.getOptions(),"locale"),a=["Group","Value"],o=[...t.map(l=>[l[r],l.value===null?"&ndash;":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}}class bU extends Ye{constructor(t,n){super(t,n),this.model=new EU(this.services),this.model.setOptions(Pt(Ct.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new aN(this.model,this.services)];return this.getChartComponents(t)}}class xU extends de{constructor(t,n){super(t,n),this.model.setOptions(Pt(Ct.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new Uv(this.model,this.services),new ei(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class _U extends hr{constructor(t){super(t),this.axisFlavor=is.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=b(this.getOptions(),"axes");if(b(n,"left","scaleType")&&b(n,"left","scaleType")!==J.LABELS||b(n,"right","scaleType")&&b(n,"right","scaleType")!==J.LABELS||b(n,"top","scaleType")&&b(n,"top","scaleType")!==J.LABELS||b(n,"bottom","scaleType")&&b(n,"bottom","scaleType")!==J.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=ke(this.getDisplayData(),r=>r.value),n=Fe().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]=En(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(En(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(),{number:i,code:s}=b(this.getOptions(),"locale"),a=[n.label,r.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"&ndash;":l[n.identifier],l[r.identifier]===null?"&ndash;":l[r.identifier],l.value===null?"&ndash;":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=b(t,"color","gradient","colors"),r=!He(n);let i=b(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=b(this.getOptions(),"color");this._colorScale=Iv(this.getDisplayData(),l)}}class SU extends de{constructor(t,n){super(t,n),this.model=new _U(this.services),this.model.setOptions(Pt(Ct.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=b(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:ct.STRETCH},o={id:"toolbar",components:[new Kr(this.model,this.services)],growth:ct.PREFERRED},l={id:"header",components:[new ae(this.model,this.services,[a,...i?[o]:[]],{direction:At.ROW,alignItems:sr.CENTER})],growth:ct.PREFERRED},c={id:"legend",components:[new Pv(this.model,this.services,{chartType:"heatmap"})],growth:ct.PREFERRED,renderType:et.SVG},u={id:"graph-frame",components:t,growth:ct.STRETCH,renderType:et.SVG},d=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=At.COLUMN_REVERSE,f={id:"spacer",components:[new wn(this.model,this.services,{size:15})],growth:ct.PREFERRED},p={id:"full-frame",components:[new ae(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:ct.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new wn(this.model,this.services,i?{size:15}:void 0)],growth:ct.PREFERRED};g.push(m)}return g.push(p),[new bv(this.model,this.services),new po(this.model,this.services),new ae(this.model,this.services,g,{direction:At.COLUMN})]}getComponents(){const t=[new fe(this.model,this.services),new oN(this.model,this.services)];return this.getAxisChartComponents(t)}}class TU extends hr{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:r,code:i}=b(this.getOptions(),"locale"),s=this.getBinnedStackedData(),a=[yt(t,"bins.rangeLabel")||"Range",...s.map(l=>yt(l,`0.${n}`))],o=[...yt(s,0).map((l,c)=>[`${r(Number(yt(l,"data.x0")),i)} – ${r(Number(yt(l,"data.x1")),i)}`,...s.map(u=>r(yt(u[c],`data.${yt(u[c],n)}`),i))])];return super.formatTable({headers:a,cells:o})}}class OU extends de{constructor(t,n){super(t,n),this.model=new TU(this.services),this.model.setOptions(Pt(Ct.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new eN(this.model,this.services),new lN(this.model,this.services)];return this.getAxisChartComponents(t)}}class wU extends de{constructor(t,n){super(t,n),this.model.setOptions(Pt(Ct.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new Pn(this.model,this.services),new ti(this.model,this.services),new sn(this.model,this.services,{handleThresholds:!0}),new pN(this.model,this.services),new ei(this.model,this.services)];return this.getAxisChartComponents(t)}}class MU extends de{constructor(t,n){super(t,n),this.model.setOptions(Pt(Ct.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new Pn(this.model,this.services),new cN(this.model,this.services),new sn(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.GRID})];return this.getAxisChartComponents(t)}}class AU extends nn{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((r,i)=>r+i.value,0)}getFillColor(t){const n=this.getOptions(),r=b(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=b(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=b(t,"meter","proportional")?r:r>100?100:r,s=b(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=b(n,"meter","proportional"),{number:a,code:o}=b(this.getOptions(),"locale");let l=[],c=[],u;if(s===null){u=100;const d=t[0];l=["Group","Value",...i?["Status"]:[]],c=[[d[r],d.value===null?"&ndash;":a(d.value,o),...i?[i]:[]]]}else{const d=b(s,"total");u=d||this.getMaximumDomain(t),l=["Group","Value","Percentage of total"],c=[...t.map(h=>{let f;h.value!==null&&h.value!==void 0?f=Number(h.value):f=0;let p=Number((h.value/u*100).toFixed(2));return[h[r],h.value===null?"&ndash;":a(f,o),a(p,o)+" %"]})]}return super.formatTable({headers:l,cells:c})}}class CU extends Ye{constructor(t,n){var i;super(t,n),this.model=new AU(this.services);const r=(i=n.options.meter)!=null&&i.proportional?lt(En(Ct.proportionalMeterChart),n.options):lt(En(Ct.meterChart),n.options);this.model.setOptions(r),this.init(t,n)}getComponents(){const n=[...b(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new nN(this.model,this.services)],growth:ct.STRETCH,renderType:et.SVG},{id:"spacer",components:[new wn(this.model,this.services,{size:8})],growth:ct.STRETCH}]:[],{id:"meter-graph",components:[new uN(this.model,this.services)],growth:ct.STRETCH,renderType:et.SVG}],r=[new ae(this.model,this.services,n,{direction:At.COLUMN})];return this.getChartComponents(r,{graphFrameRenderType:et.HTML})}}class DU extends hr{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=b(t,"radar","axes"),{number:s,code:a}=b(t,"locale"),o=b(n,"0","data").map(u=>u[r]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>b(u,"data",h,i)!==null?s(b(u,"data",h,i),a):"&ndash;")])];return super.formatTable({headers:l,cells:c})}}class LU extends Ye{constructor(t,n){super(t,n),this.model=new DU(this.services),this.model.setOptions(Pt(Ct.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new fN(this.model,this.services)];return this.getChartComponents(t)}}class RU extends de{constructor(t,n){super(t,n),this.model.setOptions(Pt(Ct.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new Pn(this.model,this.services),new sn(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.GRID})];return this.getAxisChartComponents(t)}}class IU 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 kU extends Ye{constructor(t,n){super(t,n),this.model=new IU(this.services),this.model.setOptions(Pt(Ct.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new gN(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class PU extends nn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=b(this.getOptions(),"locale"),i=["Child","Group","Value"],s=[];return t.forEach(a=>{Array.isArray(a.children)?a.children.forEach(o=>{s.push([o.name,a.name,o.value===null?"&ndash;":n(o.value,r)])}):b(a.name)!==null&&b(a.value)&&s.push(["–",a.name,n(a.value,r)])}),super.formatTable({headers:i,cells:s})}}class NU extends Ye{constructor(t,n){super(t,n),this.model=new PU(this.services),this.model.setOptions(Pt(Ct.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new zF(this.model,this.services)];return this.getChartComponents(t)}}class $U extends de{constructor(t,n){super(t,n),this.model.setOptions(Pt(Ct.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new Gv(this.model,this.services),new ei(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class FU extends de{constructor(t,n){super(t,n),this.model.setOptions(Pt(Ct.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new yo(this.model,this.services),new Vv(this.model,this.services),new ti(this.model,this.services,{stacked:!0}),new Wv(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new oe(this.model,this.services,{skeleton:Gt.GRID})];return this.getAxisChartComponents(t)}}class UU extends de{constructor(t,n){super(t,n),this.model.setOptions(Pt(Ct.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Te(this.model,this.services),new yo(this.model,this.services),new zv(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.VERT_OR_HORIZ}),new ei(this.model,this.services)];return this.getAxisChartComponents(t)}}class BU extends nn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data,{code:a,number:o}=b(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[i],u[s],o(u[r],a)])];return super.formatTable({headers:l,cells:c})}}class HU extends Ye{constructor(t,n){super(t,n),this.model=new BU(this.services),this.model.setOptions(Pt(Ct.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new uU(this.model,this.services),new oe(this.model,this.services,{skeleton:Gt.PIE})];return this.getChartComponents(t)}}W.Alignments=Ht,W.AlluvialChart=fP,W.AreaChart=$P,W.AreaEvent=$c,W.ArrowDirections=Wa,W.AxisEvent=Nc,W.AxisFlavor=is,W.AxisPositions=G,W.AxisTitleOrientations=Ya,W.BarEvent=Hc,W.BoxplotChart=BP,W.BoxplotEvent=Gc,W.BubbleChart=GP,W.BulletChart=WP,W.CalloutDirections=ts,W.CanvasZoomEvent=Pc,W.CartesianOrientations=Bt,W.ChartEvent=Dc,W.ChartTheme=jc,W.ChartTypes=Ee,W.CirclePackChart=gU,W.ColorClassNameTypes=at,W.ColorLegendType=rs,W.ComboChart=mU,W.DividerStatus=Yr,W.DominantBaseline=tn,W.DonutChart=yU,W.ExperimentalChoroplethChart=fU,W.GaugeChart=bU,W.GaugeEvent=Bc,W.GaugeTypes=ar,W.GroupedBarChart=xU,W.HeatmapChart=SU,W.HistogramChart=OU,W.LayoutAlignItems=sr,W.LayoutDirection=At,W.LayoutGrowth=ct,W.LegendItemType=Vt,W.LegendOrientations=Wr,W.LegendPositions=zr,W.LineChart=wU,W.LineEvent=zc,W.LollipopChart=MU,W.MeterChart=CU,W.ModalEvent=Lc,W.ModelEvent=Rc,W.PieChart=Jv,W.PieEvent=Uc,W.Projection=en,W.RadarChart=LU,W.RadarEvent=Wc,W.RenderTypes=et,W.ScaleTypes=J,W.ScatterChart=RU,W.ScatterEvent=Vc,W.SimpleBarChart=$U,W.Skeletons=Gt,W.StackedAreaChart=FU,W.StackedBarChart=UU,W.Statuses=es,W.TextAnchor=Je,W.ThresholdEvent=Xc,W.TickRotations=ns,W.ToolbarControlTypes=_t,W.TooltipEvent=Gr,W.TreeChart=kU,W.TreeEvent=Yc,W.TreeTypes=za,W.TreemapChart=NU,W.TreemapEvent=qc,W.TruncationTypes=De,W.WordCloudChart=HU,W.WordCloudEvent=Fc,W.ZoomBarTypes=Ge,W.ZoomDomainEvent=kc,W.ZoombarEvent=Ic,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
86
86
  //# sourceMappingURL=bundle.umd.js.map