@carbon/charts 1.11.13 → 1.11.14

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 (65) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/{_baseEach-c7ca68a6.mjs → _baseEach-9c20c3b4.mjs} +2 -2
  3. package/dist/_baseEach-9c20c3b4.mjs.map +1 -0
  4. package/dist/{_baseEach-e8e98018.js → _baseEach-c254cbf6.js} +2 -2
  5. package/dist/_baseEach-c254cbf6.js.map +1 -0
  6. package/dist/{angle-utils-7efc92a5.mjs → angle-utils-edabc527.mjs} +2 -2
  7. package/dist/angle-utils-edabc527.mjs.map +1 -0
  8. package/dist/{angle-utils-a22da679.js → angle-utils-f4be8d20.js} +2 -2
  9. package/dist/angle-utils-f4be8d20.js.map +1 -0
  10. package/dist/{choropleth-16598e45.js → choropleth-161e9be8.js} +3 -3
  11. package/dist/choropleth-161e9be8.js.map +1 -0
  12. package/dist/{choropleth-8d45a771.mjs → choropleth-ebfc4dda.mjs} +6 -6
  13. package/dist/choropleth-ebfc4dda.mjs.map +1 -0
  14. package/dist/{color-scale-utils-a737b2e5.mjs → color-scale-utils-149f8038.mjs} +758 -694
  15. package/dist/color-scale-utils-149f8038.mjs.map +1 -0
  16. package/dist/color-scale-utils-f797f768.js +2 -0
  17. package/dist/color-scale-utils-f797f768.js.map +1 -0
  18. package/dist/components/index.js +1 -1
  19. package/dist/components/index.mjs +67 -68
  20. package/dist/components/index.mjs.map +1 -1
  21. package/dist/demo/charts/bar.d.ts +16 -4
  22. package/dist/demo/charts/line.d.ts +1 -1
  23. package/dist/demo/charts/time-series-axis.d.ts +10 -3
  24. package/dist/demo/index.js +47 -40
  25. package/dist/demo/index.js.map +1 -1
  26. package/dist/demo/index.mjs +1605 -2125
  27. package/dist/demo/index.mjs.map +1 -1
  28. package/dist/demo/styles.css +11273 -10550
  29. package/dist/demo/styles.css.map +1 -1
  30. package/dist/demo/utils/stackblitz/object-to-string.d.ts +5 -0
  31. package/dist/{index-daeaa9f4.mjs → index-38625a66.mjs} +3 -3
  32. package/dist/index-38625a66.mjs.map +1 -0
  33. package/dist/{index-e014597a.js → index-c5b4f8ab.js} +2 -2
  34. package/dist/index-c5b4f8ab.js.map +1 -0
  35. package/dist/index.js +1 -1
  36. package/dist/index.js.map +1 -1
  37. package/dist/index.mjs +153 -154
  38. package/dist/index.mjs.map +1 -1
  39. package/dist/interfaces/axis-scales.d.ts +1 -1
  40. package/dist/model/index.js +1 -1
  41. package/dist/model/index.js.map +1 -1
  42. package/dist/model/index.mjs +30 -31
  43. package/dist/model/index.mjs.map +1 -1
  44. package/dist/services/index.js +1 -1
  45. package/dist/services/index.mjs +26 -27
  46. package/dist/services/index.mjs.map +1 -1
  47. package/dist/styles.css.map +1 -1
  48. package/dist/styles.min.css.map +1 -1
  49. package/package.json +48 -41
  50. package/scss/demos.scss +4 -0
  51. package/dist/_baseEach-c7ca68a6.mjs.map +0 -1
  52. package/dist/_baseEach-e8e98018.js.map +0 -1
  53. package/dist/angle-utils-7efc92a5.mjs.map +0 -1
  54. package/dist/angle-utils-a22da679.js.map +0 -1
  55. package/dist/choropleth-16598e45.js.map +0 -1
  56. package/dist/choropleth-8d45a771.mjs.map +0 -1
  57. package/dist/color-scale-utils-56bbe3f2.js +0 -2
  58. package/dist/color-scale-utils-56bbe3f2.js.map +0 -1
  59. package/dist/color-scale-utils-a737b2e5.mjs.map +0 -1
  60. package/dist/index-becfb567.mjs +0 -72
  61. package/dist/index-becfb567.mjs.map +0 -1
  62. package/dist/index-d865d500.js +0 -2
  63. package/dist/index-d865d500.js.map +0 -1
  64. package/dist/index-daeaa9f4.mjs.map +0 -1
  65. package/dist/index-e014597a.js.map +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";const y=require("d3"),c=require("./color-scale-utils-56bbe3f2.js"),r=require("./enums-aa2efd99.js"),B=require("./a11y-c7c9d087.js"),O=require("./angle-utils-a22da679.js"),ie=require("d3-sankey"),dt=require("./_baseEach-e8e98018.js"),Nt=require("d3-cloud");function Bt(l,e,t,s){var n=-1,a=l==null?0:l.length;for(s&&a&&(t=l[++n]);++n<a;)t=e(t,l[n],n,l);return t}function Gt(l){return function(e){return l==null?void 0:l[e]}}var $t={À:"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"},Ht=Gt($t);const zt=Ht;var Ft=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Wt="\\u0300-\\u036f",jt="\\ufe20-\\ufe2f",Zt="\\u20d0-\\u20ff",Xt=Wt+jt+Zt,qt="["+Xt+"]",Yt=RegExp(qt,"g");function Kt(l){return l=c.toString(l),l&&l.replace(Ft,zt).replace(Yt,"")}var Jt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Qt(l){return l.match(Jt)||[]}var es=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function ts(l){return es.test(l)}var ht="\\ud800-\\udfff",ss="\\u0300-\\u036f",ns="\\ufe20-\\ufe2f",as="\\u20d0-\\u20ff",is=ss+ns+as,ut="\\u2700-\\u27bf",pt="a-z\\xdf-\\xf6\\xf8-\\xff",rs="\\xac\\xb1\\xd7\\xf7",os="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ls="\\u2000-\\u206f",cs=" \\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",gt="A-Z\\xc0-\\xd6\\xd8-\\xde",ds="\\ufe0e\\ufe0f",mt=rs+os+ls+cs,vt="['’]",Fe="["+mt+"]",hs="["+is+"]",ft="\\d+",us="["+ut+"]",yt="["+pt+"]",Et="[^"+ht+mt+ft+ut+pt+gt+"]",ps="\\ud83c[\\udffb-\\udfff]",gs="(?:"+hs+"|"+ps+")",ms="[^"+ht+"]",Ot="(?:\\ud83c[\\udde6-\\uddff]){2}",bt="[\\ud800-\\udbff][\\udc00-\\udfff]",te="["+gt+"]",vs="\\u200d",We="(?:"+yt+"|"+Et+")",fs="(?:"+te+"|"+Et+")",je="(?:"+vt+"(?:d|ll|m|re|s|t|ve))?",Ze="(?:"+vt+"(?:D|LL|M|RE|S|T|VE))?",St=gs+"?",xt="["+ds+"]?",ys="(?:"+vs+"(?:"+[ms,Ot,bt].join("|")+")"+xt+St+")*",Es="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Os="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",bs=xt+St+ys,Ss="(?:"+[us,Ot,bt].join("|")+")"+bs,xs=RegExp([te+"?"+yt+"+"+je+"(?="+[Fe,te,"$"].join("|")+")",fs+"+"+Ze+"(?="+[Fe,te+We,"$"].join("|")+")",te+"?"+We+"+"+je,te+"+"+Ze,Os,Es,ft,Ss].join("|"),"g");function Ts(l){return l.match(xs)||[]}function Ms(l,e,t){return l=c.toString(l),e=t?void 0:e,e===void 0?ts(l)?Ts(l):Qt(l):l.match(e)||[]}var Cs="['’]",Ls=RegExp(Cs,"g");function Tt(l){return function(e){return Bt(Ms(Kt(e).replace(Ls,"")),l,"")}}function As(l,e,t){return l===l&&(t!==void 0&&(l=l<=t?l:t),e!==void 0&&(l=l>=e?l:e)),l}function Mt(l,e,t){return t===void 0&&(t=e,e=void 0),t!==void 0&&(t=O.toNumber(t),t=t===t?t:0),e!==void 0&&(e=O.toNumber(e),e=e===e?e:0),As(O.toNumber(l),e,t)}function Ds(l,e){var t=-1,s=c.isArrayLike(l)?Array(l.length):[];return dt.baseEach(l,function(n,a,i){s[++t]=e(n,a,i)}),s}function ws(l,e){var t=c.isArray(l)?c.arrayMap:Ds;return t(l,c.baseIteratee(e))}var Ps=1/0;function Rs(l,e){return c.baseFlatten(ws(l,e),Ps)}function Ct(l,e){return c.baseIsEqual(l,e)}var ks=Tt(function(l,e,t){return l+(t?"-":"")+e.toLowerCase()});const J=ks;function Is(l,e){var t;return dt.baseEach(l,function(s,n,a){return t=e(s,n,a),!t}),!!t}function _s(l,e,t){var s=c.isArray(l)?c.arraySome:Is;return t&&c.isIterateeCall(l,e,t)&&(e=void 0),s(l,c.baseIteratee(e))}class G{constructor(e,t,s){if(this.type="",this.renderType=r.RenderTypes.HTML,this.id="",this.parent=void 0,this.configs={},this.model=e,this.services=t,s&&(this.configs=s,this.configs.id)){const n=c.getProperty(this.model.getOptions(),"style","prefix");this.id=`${n}--${this.configs.id}`}this.parent||this.setParent(y.select(this.services.domUtils.getMainContainer()))}init(){}render(e=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(e){this.model=e}setServices(e){this.services=e}setParent(e){var s;const t=this.parent;if(this.parent=e,!(t&&t.node()===e.node())&&this.type){const n=c.getProperty(this.model.getOptions(),"style","prefix");(s=this.parent)==null||s.classed(`${c.carbonPrefix}--${n}--${this.type}`,!0),t&&t.classed(`${c.carbonPrefix}--${n}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(e={withinChartClip:!1}){if(this.type){const t=c.getProperty(this.model.getOptions(),"style","prefix"),s=this.id?`#${this.id}`:"",n=O.DOMUtils.appendOrSelect(this.parent,`${this.renderType===r.RenderTypes.SVG?"svg":"div"}${s}.${c.carbonPrefix}--${t}--${this.type}`);if(e.withinChartClip){const a=this.model.get("chartClipId");if(a){const o=y.select(`#${a}`).select("rect");o.size()!==0&&parseFloat(o.attr("height"))>0&&n.attr("clip-path",`url(#${a})`)}}return n.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?c.merge({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}const ge=class ge extends G{constructor(){super(...arguments),this.type="toolbar",this.renderType=r.RenderTypes.HTML}init(){const e=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(r.Events.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",e)}),this.services.events.addEventListener(r.Events.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",e)})}render(e=!0){const t=this.getComponentContainer().attr("role","toolbar").attr("aria-label",`chart-${this.services.domUtils.getChartID()} toolbar`);if(c.getProperty(this.getOptions(),"data","loading"))t.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=t.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:n,overflowMenuItemList:a}=this.getControlConfigs();a&&n.push(this.getOverflowButtonConfig());const i=t.selectAll("div.toolbar-control").data(n,h=>h.id);i.exit().remove();const o=i.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu").attr("role","button"),d=this;o.merge(i).classed("disabled",h=>h.shouldBeDisabled()).attr("aria-disabled",h=>h.shouldBeDisabled()).attr("aria-label",h=>h.title).html(h=>`
1
+ "use strict";const y=require("d3"),c=require("./color-scale-utils-f797f768.js"),r=require("./enums-aa2efd99.js"),B=require("./a11y-c7c9d087.js"),O=require("./angle-utils-f4be8d20.js"),ie=require("d3-sankey"),dt=require("./_baseEach-c254cbf6.js"),Nt=require("d3-cloud");function Bt(l,e,t,s){var n=-1,a=l==null?0:l.length;for(s&&a&&(t=l[++n]);++n<a;)t=e(t,l[n],n,l);return t}function Gt(l){return function(e){return l==null?void 0:l[e]}}var $t={À:"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"},Ht=Gt($t);const zt=Ht;var Ft=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Wt="\\u0300-\\u036f",jt="\\ufe20-\\ufe2f",Zt="\\u20d0-\\u20ff",Xt=Wt+jt+Zt,qt="["+Xt+"]",Yt=RegExp(qt,"g");function Kt(l){return l=c.toString(l),l&&l.replace(Ft,zt).replace(Yt,"")}var Jt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Qt(l){return l.match(Jt)||[]}var es=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function ts(l){return es.test(l)}var ht="\\ud800-\\udfff",ss="\\u0300-\\u036f",ns="\\ufe20-\\ufe2f",as="\\u20d0-\\u20ff",is=ss+ns+as,ut="\\u2700-\\u27bf",pt="a-z\\xdf-\\xf6\\xf8-\\xff",rs="\\xac\\xb1\\xd7\\xf7",os="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ls="\\u2000-\\u206f",cs=" \\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",gt="A-Z\\xc0-\\xd6\\xd8-\\xde",ds="\\ufe0e\\ufe0f",mt=rs+os+ls+cs,vt="['’]",Fe="["+mt+"]",hs="["+is+"]",ft="\\d+",us="["+ut+"]",yt="["+pt+"]",Et="[^"+ht+mt+ft+ut+pt+gt+"]",ps="\\ud83c[\\udffb-\\udfff]",gs="(?:"+hs+"|"+ps+")",ms="[^"+ht+"]",Ot="(?:\\ud83c[\\udde6-\\uddff]){2}",bt="[\\ud800-\\udbff][\\udc00-\\udfff]",te="["+gt+"]",vs="\\u200d",We="(?:"+yt+"|"+Et+")",fs="(?:"+te+"|"+Et+")",je="(?:"+vt+"(?:d|ll|m|re|s|t|ve))?",Ze="(?:"+vt+"(?:D|LL|M|RE|S|T|VE))?",St=gs+"?",xt="["+ds+"]?",ys="(?:"+vs+"(?:"+[ms,Ot,bt].join("|")+")"+xt+St+")*",Es="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Os="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",bs=xt+St+ys,Ss="(?:"+[us,Ot,bt].join("|")+")"+bs,xs=RegExp([te+"?"+yt+"+"+je+"(?="+[Fe,te,"$"].join("|")+")",fs+"+"+Ze+"(?="+[Fe,te+We,"$"].join("|")+")",te+"?"+We+"+"+je,te+"+"+Ze,Os,Es,ft,Ss].join("|"),"g");function Ts(l){return l.match(xs)||[]}function Ms(l,e,t){return l=c.toString(l),e=t?void 0:e,e===void 0?ts(l)?Ts(l):Qt(l):l.match(e)||[]}var Cs="['’]",Ls=RegExp(Cs,"g");function Tt(l){return function(e){return Bt(Ms(Kt(e).replace(Ls,"")),l,"")}}function As(l,e,t){return l===l&&(t!==void 0&&(l=l<=t?l:t),e!==void 0&&(l=l>=e?l:e)),l}function Mt(l,e,t){return t===void 0&&(t=e,e=void 0),t!==void 0&&(t=O.toNumber(t),t=t===t?t:0),e!==void 0&&(e=O.toNumber(e),e=e===e?e:0),As(O.toNumber(l),e,t)}function Ds(l,e){var t=-1,s=c.isArrayLike(l)?Array(l.length):[];return dt.baseEach(l,function(n,a,i){s[++t]=e(n,a,i)}),s}function ws(l,e){var t=c.isArray(l)?c.arrayMap:Ds;return t(l,c.baseIteratee(e))}var Ps=1/0;function Rs(l,e){return c.baseFlatten(ws(l,e),Ps)}function Ct(l,e){return c.baseIsEqual(l,e)}var ks=Tt(function(l,e,t){return l+(t?"-":"")+e.toLowerCase()});const J=ks;function Is(l,e){var t;return dt.baseEach(l,function(s,n,a){return t=e(s,n,a),!t}),!!t}function _s(l,e,t){var s=c.isArray(l)?c.arraySome:Is;return t&&c.isIterateeCall(l,e,t)&&(e=void 0),s(l,c.baseIteratee(e))}class G{constructor(e,t,s){if(this.type="",this.renderType=r.RenderTypes.HTML,this.id="",this.parent=void 0,this.configs={},this.model=e,this.services=t,s&&(this.configs=s,this.configs.id)){const n=c.getProperty(this.model.getOptions(),"style","prefix");this.id=`${n}--${this.configs.id}`}this.parent||this.setParent(y.select(this.services.domUtils.getMainContainer()))}init(){}render(e=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(e){this.model=e}setServices(e){this.services=e}setParent(e){var s;const t=this.parent;if(this.parent=e,!(t&&t.node()===e.node())&&this.type){const n=c.getProperty(this.model.getOptions(),"style","prefix");(s=this.parent)==null||s.classed(`${c.carbonPrefix}--${n}--${this.type}`,!0),t&&t.classed(`${c.carbonPrefix}--${n}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(e={withinChartClip:!1}){if(this.type){const t=c.getProperty(this.model.getOptions(),"style","prefix"),s=this.id?`#${this.id}`:"",n=O.DOMUtils.appendOrSelect(this.parent,`${this.renderType===r.RenderTypes.SVG?"svg":"div"}${s}.${c.carbonPrefix}--${t}--${this.type}`);if(e.withinChartClip){const a=this.model.get("chartClipId");if(a){const o=y.select(`#${a}`).select("rect");o.size()!==0&&parseFloat(o.attr("height"))>0&&n.attr("clip-path",`url(#${a})`)}}return n.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?c.merge({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}const ge=class ge extends G{constructor(){super(...arguments),this.type="toolbar",this.renderType=r.RenderTypes.HTML}init(){const e=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(r.Events.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",e)}),this.services.events.addEventListener(r.Events.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",e)})}render(e=!0){const t=this.getComponentContainer().attr("role","toolbar").attr("aria-label",`chart-${this.services.domUtils.getChartID()} toolbar`);if(c.getProperty(this.getOptions(),"data","loading"))t.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=t.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:n,overflowMenuItemList:a}=this.getControlConfigs();a&&n.push(this.getOverflowButtonConfig());const i=t.selectAll("div.toolbar-control").data(n,h=>h.id);i.exit().remove();const o=i.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu").attr("role","button"),d=this;o.merge(i).classed("disabled",h=>h.shouldBeDisabled()).attr("aria-disabled",h=>h.shouldBeDisabled()).attr("aria-label",h=>h.title).html(h=>`
2
2
  <button
3
3
  class="cds--overflow-menu__trigger cds--overflow-menu__trigger"
4
4
  aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${h.id}`)}" aria-label="${h.title}">
@@ -66,7 +66,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
66
66
  </div>
67
67
  ${t.value===void 0||t.value===null?"":`<p class="value"/>${t.value}</p>`}
68
68
  </div>
69
- </li>`).join("")+"</ul>"}valueFormatter(e,t){const s=this.getOptions(),n=c.getProperty(s,"tooltip","valueFormatter");if(n)return n(e,t);if(typeof e.getTime=="function")return c.format(e,"MMM d, yyyy");try{if(typeof e=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(e))return c.format(Date.parse(e),"MMM d, yyyy")}catch{}return e.toLocaleString()}render(e=!1){const t=this.getOptions(),s=c.getProperty(t,"tooltip","enabled");if(s){const n=y.select(this.services.domUtils.getHolder()),a=c.getProperty(t,"style","prefix");this.tooltip=O.DOMUtils.appendOrSelect(n,`div.${c.carbonPrefix}--${a}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!s&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}positionTooltip(e){const t=this.services.domUtils.getHolder(),s=this.tooltip.node(),n=this.getOptions(),a=c.getProperty(n,"zoomBar","top","enabled");let i=c.getProperty(e,"detail","mousePosition");if(!i)i=y.pointer(c.getProperty(e,"detail","event"),t);else{const p=c.getProperty(n,"zoomBar","top","type"),g=c.zoomBar.height[p];a&&(i[1]+=g+c.zoomBar.spacerHeight)}const o=t.offsetWidth,d=t.offsetHeight;let h;i[0]/o>.9?h=Z.LEFT:i[0]/o<.1?h=Z.RIGHT:h=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},s,[Z.RIGHT,Z.LEFT,Z.TOP,Z.BOTTOM],()=>({top:void 0,left:void 0,width:o,height:d}));let{horizontalOffset:u}=c.tooltips;h===Z.LEFT&&(u*=-1);const m=this.positionService.findPositionAt({left:i[0]+u,top:i[1]},s,h);this.positionService.setElement(s,m)}}const se=class se extends G{constructor(){super(...arguments),this.type="grid-brush",this.renderType=r.RenderTypes.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(e=!0){const t=this.parent,s=this.getComponentContainer();if(!t)throw new Error("SVG was not defined");const n=O.DOMUtils.appendOrSelect(t,"svg.chart-grid-backdrop"),a=O.DOMUtils.appendOrSelect(n,`g.${this.type}`),i=O.DOMUtils.appendOrSelect(a,this.selectionSelector),{width:o,height:d}=O.DOMUtils.getSVGElementSize(n,{useAttrs:!0}),{cartesianScales:h}=this.services,u=h.getMainXScaleType(),m=h.getMainXScale(),[p]=m.range();s.attr("transform",`translate(${p},0)`);const g=O.DOMUtils.appendOrSelect(s,this.frontSelectionSelector);if(m&&u===r.ScaleTypes.TIME){let v=this.model.get("zoomDomain");v===void 0&&(v=this.services.zoom.getDefaultZoomBarDomain(),v&&this.model.set({zoomDomain:v},{animate:!1}));const f=M=>{const x=M[1]-M[0];let w="0,"+x.toString();const P=Math.floor(d/se.DASH_LENGTH),$=P*se.DASH_LENGTH;for(let _=0;_<P;_++)w+=","+se.DASH_LENGTH;w+=","+(d-$),P%2===1&&(w+=",0"),w+=","+x.toString(),w+=","+d.toString(),g.attr("stroke-dasharray",w)},b=M=>{const x=M.selection;x===null||x[0]===x[1]||(g.attr("x",parseFloat(i.attr("x"))+parseFloat(n.attr("x"))).attr("y",i.attr("y")).attr("width",i.attr("width")).attr("height",i.attr("height")).style("cursor","pointer").style("display",null),f(x))},E=(M,x)=>{const w=y.scaleTime().range([0,o]).domain(v);let P=[w.invert(M),w.invert(x)];P[0].valueOf()===P[1].valueOf()&&(P=this.services.zoom.getDefaultZoomBarDomain()),(v[0].valueOf()!==P[0].valueOf()||v[1].valueOf()!==P[1].valueOf())&&this.services.zoom.handleDomainChange(P)};let S;const T=M=>{const x=M.selection;x!==null&&(E(x[0],x[1]),a.call(S.move,null),g.style("display","none"))};d!=0&&o!=0&&(S=y.brushX().extent([[0,0],[o-1,d]]).on("start brush end",b).on("end.brushed",T),a.call(S));const C=this.services.zoom.getZoomRatio();n.on("click",function(M){if(M.shiftKey){const x=this.services.domUtils.getHolder(),w=y.pointer(a.node(),x)[0];let P=w-o*C/2;P<0&&(P=0);let $=w+o*C/2;$>o&&($=o),E(P,$)}})}}};se.DASH_LENGTH=4;let Be=se;class ea extends G{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=r.RenderTypes.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=y.brushX(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(r.Events.ZoomBar.UPDATE,this.render.bind(this));const e=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"data");this.model.setZoomBarData(e)}render(e=!0){const t=this.getComponentContainer(),s=this.services.zoom.isZoomBarLoading(r.AxisPositions.TOP),n=this.services.zoom.isZoomBarLocked(r.AxisPositions.TOP),a=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.getProperty(this.getOptions(),"axes",r.AxisPositions.BOTTOM,"highlights"),o=c.zoomBar.height[a],{width:d}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});if(d===0)return;let h=0;const u=this.model.get("axesMargins");u&&u.left&&(h=u.left);const m=O.DOMUtils.appendOrSelect(t,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(O.DOMUtils.appendOrSelect(t,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",c.zoomBar.spacerHeight).attr("opacity",1).attr("fill","none"),a===r.ZoomBarTypes.GRAPH_VIEW?O.DOMUtils.appendOrSelect(m,"rect.zoom-bg").attr("x",h).attr("y",0).attr("width",d-h).attr("height","100%").classed("zoom-bg-skeleton",s).style("stroke",s?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):a===r.ZoomBarTypes.SLIDER_VIEW&&O.DOMUtils.appendOrSelect(m,"rect.zoom-slider-bg").attr("x",h).attr("y",o/2-1).attr("width",d-h).attr("height",2).classed("zoom-slider-bg-skeleton",s).style("stroke",s?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),s){this.renderSkeleton(m,h,d);return}const{cartesianScales:p}=this.services,g=p.getMainXScale(),v=p.getMainYScale(),f=p.getMainXScaleType();if(g&&f===r.ScaleTypes.TIME){let b=this.services.zoom.getZoomBarData();if(c.isEmpty(b)||b.length===1)return;this.xScale=g.copy(),this.yScale=v.copy();const E=this.services.zoom.getDefaultZoomBarDomain(b);b=this.compensateDataForDefaultDomain(b,E);const S=this.model.get("initialZoomDomain"),T=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"initialZoomDomain");T&&T[0]&&T[1]&&(T[0]=new Date(T[0]),T[1]=new Date(T[1])),T&&!(S&&S[0].valueOf()===T[0].valueOf()&&S[1].valueOf()===T[1].valueOf())?this.model.set({initialZoomDomain:c.merge([],T),zoomDomain:T?c.merge([],T):E},{skipUpdate:!0}):T===null&&S!==null&&this.model.set({initialZoomDomain:null,zoomDomain:c.merge([],E)},{skipUpdate:!0}),this.xScale.range([h,d]).domain(E),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(y.extent(b,x=>x.value));const C=this.model.get("zoomDomain");if(a===r.ZoomBarTypes.GRAPH_VIEW&&(this.renderZoomBarArea(m,"path.zoom-graph-area-unselected",b,null),this.updateClipPath(t,this.clipId,0,0,0,0),this.renderZoomBarArea(m,"path.zoom-graph-area",b,this.clipId),this.renderZoomBarBaseline(m,h,d),i)){const x=i.highlightStartMapsTo,w=i.highlightEndMapsTo,P=i.color,$=i.labelMapsTo;i.data.forEach((_,A)=>{O.DOMUtils.appendOrSelect(m,`rect.highlight-${A}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(_[x])).attr("width",this.xScale(_[w])-this.xScale(_[x])).style("fill",P&&P.scale[_[$]]?P.scale[_[$]]:null).style("fill-opacity",.1).style("stroke",P&&P.scale[_[$]]?P.scale[_[$]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(C,h,d);const M=O.DOMUtils.appendOrSelect(t,this.brushSelector).call(this.brush);if(C!==void 0)if(C[0].valueOf()===C[1].valueOf())M.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const x=C.map(w=>this.xScale(w));x[1]-x[0]<this.MIN_SELECTION_DIFF||(M.call(this.brush.move,x),this.updateBrushHandle(this.getComponentContainer(),x))}n&&(this.brush.filter(()=>!1),M.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(e,t,s){const n=o=>{const d=o.selection;d===null?this.handleBrushedEvent(o,e,this.xScale,this.xScale.range()):d[0]===d[1]||this.handleBrushedEvent(o,e,this.xScale,d)},a=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.zoomBar.height[a];this.brush.extent([[t,0],[s,i]]).on("start brush end",null).on("start brush end",n)}handleBrushedEvent(e,t,s,n){const a=[s.invert(n[0]),s.invert(n[1])];if(this.updateBrushHandle(this.getComponentContainer(),n),e.sourceEvent!=null&&(e.sourceEvent.type==="mousemove"||e.sourceEvent.type==="mouseup"||e.sourceEvent.type==="mousedown"||e.sourceEvent.type==="touchstart"||e.sourceEvent.type==="touchmove"||e.sourceEvent.type==="touchend")){(t===void 0||t[0]!==a[0]||t[1]!==a[1])&&this.services.zoom.handleDomainChange(a,{dispatchEvent:!1});let i;e.type==="start"?i=r.Events.ZoomBar.SELECTION_START:e.type==="brush"?i=r.Events.ZoomBar.SELECTION_IN_PROGRESS:e.type==="end"&&(i=r.Events.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(r.Events.ZoomDomain.CHANGE,{newDomain:a})),this.services.events.dispatchEvent(i,{selection:n,newDomain:a})}}updateBrushHandle(e,t){const s=this,n=c.zoomBar.handleWidth,a=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.zoomBar.height[a],o=-n/2,d=c.zoomBar.handleBarWidth,h=a===r.ZoomBarTypes.GRAPH_VIEW?c.zoomBar.handleBarHeight:6,u=-d/2,m=(i-h)/2;e.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(g){if(g.type==="w")return Math.max(t[0]+o,s.maxSelectionRange[0]);if(g.type==="e")return Math.min(t[1]+o,s.maxSelectionRange[1]-n)}).attr("y",0).attr("width",n).attr("height",i).attr("cursor","ew-resize").style("display",null);const p=e.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);p.enter().append("rect").attr("class",function(g){return"handle-bar handle-bar--"+g.type}),p.attr("x",function(g){if(g.type==="w")return Math.max(t[0]+u,s.maxSelectionRange[0]-o+u);if(g.type==="e")return Math.min(t[1]+u,s.maxSelectionRange[1]+o+u)}).attr("y",m).attr("width",d).attr("height",h).attr("cursor","ew-resize"),a===r.ZoomBarTypes.SLIDER_VIEW&&this.updateSliderSelectedArea(t),this.updateClipPath(e,this.clipId,t[0],0,t[1]-t[0],i)}updateSliderSelectedArea(e){const t=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),s=c.zoomBar.height[t],a=this.getComponentContainer().select("svg.zoom-container");O.DOMUtils.appendOrSelect(a,"rect.zoom-slider-selected-area").attr("x",e[0]).attr("y",s/2-1).attr("width",e[1]-e[0]).attr("height",2)}renderZoomBarArea(e,t,s,n){const{cartesianScales:a}=this.services,i=a.getMainXAxisPosition(),o=a.getMainYAxisPosition(),d=a.getMainXScaleType(),h=a.getMainYScaleType(),u=(E,S,T)=>C=>a.getValueFromScale(E,S,T,C),m=u(this.xScale,d,i),p=u(this.yScale,h,o),g=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),v=c.zoomBar.height[g],f=y.area().x(E=>m(E)).y0(v).y1(E=>v-p(E)),b=O.DOMUtils.appendOrSelect(e,t).datum(s).attr("d",f);n&&b.attr("clip-path",`url(#${n})`)}updateClipPath(e,t,s,n,a,i){const o=O.DOMUtils.appendOrSelect(e,"clipPath").attr("id",t);O.DOMUtils.appendOrSelect(o,"rect").attr("x",s).attr("y",n).attr("width",a).attr("height",i)}compensateDataForDefaultDomain(e,t){if(!e||e.length<2)return;const s=c.cloneDeep(e),n=this.services.cartesianScales.getDomainIdentifier(),a=this.services.cartesianScales.getRangeIdentifier();if(Number(t[0])<Number(s[0][n])){const i={};i[n]=t[0],i[a]=0,s.unshift(i)}if(Number(t[1])>Number(s[s.length-1][n])){const i={};i[n]=t[1],i[a]=0,s.push(i)}return s}renderZoomBarBaseline(e,t,s,n=!1){const a=c.getProperty(this.model.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.zoomBar.height[a],o=y.line()([[t,i],[s,i]]);O.DOMUtils.appendOrSelect(e,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",n).style("stroke",n?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(e,t,s){this.renderZoomBarArea(e,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(e,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),O.DOMUtils.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type")===r.ZoomBarTypes.GRAPH_VIEW&&this.renderZoomBarBaseline(e,t,s,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(r.Events.ZoomBar.UPDATE,this.render.bind(this))}}class ta extends G{constructor(e,t){super(e,t),this.type="threshold",this.renderType=r.RenderTypes.SVG,this.positionService=new ve}render(e=!1){const t=c.getProperty(this.getOptions(),"axes"),s=[];Object.keys(t).forEach(p=>{if(Object.values(r.AxisPositions).includes(p)){const g=t[p];g.thresholds&&g.thresholds.length>0&&s.push({axisPosition:p,thresholds:g.thresholds,correspondingDatasets:g==null?void 0:g.correspondingDatasets,mapsTo:g==null?void 0:g.mapsTo})}});const a=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-thresholds").data(s,p=>p.axisPosition);a.exit().attr("opacity",0).remove();const o=a.enter().append("g").merge(a);o.attr("class",p=>`axis-thresholds ${p.axisPosition}`);const d=o.selectAll("g.threshold-group").data(p=>p.thresholds.map(g=>(g.axisPosition=p.axisPosition,g.datum=this.constructDatumObj(p,g),g)));d.exit().attr("opacity",0).remove();const h=d.enter().append("g");h.append("line").attr("class","threshold-line"),h.append("rect").attr("class","threshold-hoverable-area"),h.merge(d).attr("class","threshold-group");const m=this;o.each(function({axisPosition:p}){const g=m.services.cartesianScales.getScaleByPosition(p),v=m.services.cartesianScales.getScaleTypeByPosition(p);let f=null,b=null;p===r.AxisPositions.LEFT||p===r.AxisPositions.RIGHT?(b=g,f=m.services.cartesianScales.getMainXScale()):(f=g,b=m.services.cartesianScales.getMainYScale());const E=v===r.ScaleTypes.LABELS,[S,T]=f.range(),[C,M]=b.range(),{cartesianScales:x}=m.services,w=x.getOrientation(),P=V=>x.getDomainValue(V),$=V=>x.getRangeValue(V),[_,A]=c.flipDomainAndRangeBasedOnOrientation(P,$,w),L=y.select(this);p===r.AxisPositions.TOP||p===r.AxisPositions.BOTTOM?(L.selectAll("line.threshold-line").transition().call(V=>m.services.transitions.setupTransition({transition:V,name:"threshold-line-update",animate:e})).attr("y1",M).attr("y2",C).attr("x1",({datum:V})=>_(V)+(E?g.step()/2:0)).attr("x2",({datum:V})=>_(V)+(E?g.step()/2:0)).style("stroke",({fillColor:V})=>V),L.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:V})=>-_(V)).attr("width",Math.abs(C-M)).classed("rotate",!0)):(L.selectAll("line.threshold-line").transition().call(V=>m.services.transitions.setupTransition({transition:V,name:"threshold-line-update",animate:e})).attr("x1",S).attr("x2",T).attr("y1",({datum:V})=>A(V)+(E?g.step()/2:0)).attr("y2",({datum:V})=>A(V)+(E?g.step()/2:0)).style("stroke",({fillColor:V})=>V),L.selectAll("rect.threshold-hoverable-area").attr("x",S).attr("y",({datum:V})=>A(V)).attr("width",Math.abs(T-S)).classed("rotate",!1))}),this.services.events.addEventListener(r.Events.Threshold.SHOW,p=>{this.setThresholdLabelPosition(p.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(r.Events.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(e){const{value:t,axisPosition:s}=e,n=this.getOptions();if(this.services.cartesianScales.getScaleTypeByPosition(s)===r.ScaleTypes.TIME){const i=[r.AxisPositions.LEFT,r.AxisPositions.RIGHT].includes(s),o=this.services.cartesianScales.getMainXScale(),d=this.services.cartesianScales.getMainYScale(),h=i?d:o,u=c.getProperty(n,"timeScale"),m=c.computeTimeIntervalName(h.ticks(),c.getProperty(u,"timeInterval"));return c.formatTick(t,0,h.ticks(),m,u)}return t.toLocaleString("en")}appendThresholdLabel(){const e=y.select(this.services.domUtils.getHolder()),t=c.getProperty(this.getOptions(),"style","prefix");this.label=O.DOMUtils.appendOrSelect(e,`div.${c.carbonPrefix}--${t}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:e,datum:t}){const s=this.services.domUtils.getHolder(),n=y.pointer(e,s),a=t.valueFormatter?t.valueFormatter(t.value):this.getFormattedValue(t);this.label.html(`${t.label||"Threshold"}: ${a}`).style("background-color",t.fillColor);const i=this.label.node(),o=this.positionService.findBestPlacementAt({left:n[0],top:n[1]},i,[Z.RIGHT,Z.LEFT,Z.TOP,Z.BOTTOM],()=>({top:void 0,left:void 0,width:s.offsetWidth,height:s.offsetHeight})),d=this.positionService.findPositionAt({left:n[0],top:n[1]},i,o);this.positionService.setElement(i,d)}constructDatumObj(e,t){const s={};return e.correspondingDatasets&&(s.group=c.getProperty(e,"correspondingDatasets",0)),s[e.mapsTo]=t.value,s}addEventListeners(){const e=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(s){y.select(this.parentNode).select("line.threshold-line").classed("active",!0),e.services.events.dispatchEvent(r.Events.Threshold.SHOW,{event:s,hoveredElement:y.select(this),datum:y.select(this).datum()})}).on("mouseout",function(s){y.select(this.parentNode).select("line.threshold-line").classed("active",!1),e.services.events.dispatchEvent(r.Events.Threshold.HIDE,{event:s,hoveredElement:y.select(this),datum:y.select(this).datum()})})}}class sa extends G{constructor(e,t){super(e,t),this.type="highlight",this.renderType=r.RenderTypes.SVG,this.positionService=new ve,this.highlightStrokeWidth=1}render(e=!1){const t=c.getProperty(this.getOptions(),"axes"),s=[];Object.keys(t).forEach(p=>{if(Object.values(r.AxisPositions).includes(p)){const g=t[p];g.highlights&&g.highlights.data.length>0&&s.push({axisPosition:p,highlightStartMapsTo:g.highlights.highlightStartMapsTo,highlightEndMapsTo:g.highlights.highlightEndMapsTo,labelMapsTo:g.highlights.labelMapsTo,highlight:g.highlights.data,color:g.highlights.color})}});const a=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-highlight").data(s,p=>p.axisPosition);a.exit().attr("opacity",0).remove();const o=a.enter().append("g").merge(a);o.attr("class",p=>`axis-highlight ${p.axisPosition}`);const d=o.selectAll("g.highlight-group").data(p=>p.highlight.map(g=>(g.axisPosition=p.axisPosition,g.highlightStartMapsTo=p.highlightStartMapsTo,g.labelMapsTo=p.labelMapsTo,g.color=p.color,g.highlightEndMapsTo=p.highlightEndMapsTo,g)));d.exit().attr("opacity",0).remove();const h=d.enter().append("g");h.append("rect").attr("class","highlight-bar"),h.append("line").attr("class","highlight-line"),h.merge(d).attr("class","highlight-group");const m=this;o.each(function({axisPosition:p}){const g=m.services.cartesianScales.getMainXScale(),v=m.services.cartesianScales.getMainYScale(),[f,b]=g.range(),[E,S]=v.range(),{cartesianScales:T}=m.services,C=T.getOrientation(),M=_=>T.getDomainValue(_),x=_=>T.getRangeValue(_),[w,P]=c.flipDomainAndRangeBasedOnOrientation(M,x,C),$=y.select(this);p===r.AxisPositions.TOP||p===r.AxisPositions.BOTTOM?$.selectAll("rect.highlight-bar").transition().call(_=>m.services.transitions.setupTransition({transition:_,name:"highlight-bar-update",animate:e})).attr("y",Math.max(S+m.highlightStrokeWidth,0)).attr("height",Math.max(E-2*m.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:_,...A})=>w(A[_])).attr("width",({highlightStartMapsTo:_,highlightEndMapsTo:A,...L})=>Math.max(w(L[A])-w(L[_]),0)).style("stroke",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",m.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null):$.selectAll("rect.highlight-bar").transition().call(_=>m.services.transitions.setupTransition({transition:_,name:"highlight-bar-update",animate:e})).attr("x",f).attr("width",Math.max(b-f,0)).attr("y",({highlightEndMapsTo:_,...A})=>P(A[_])).attr("height",({highlightStartMapsTo:_,highlightEndMapsTo:A,...L})=>Math.max(P(L[_])-P(L[A]),0)).style("stroke",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",m.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null)})}}class na extends kt{getItems(e){if(e.detail.items)return e.detail.items;const t=e.detail.data;if(!t.length||!t[0])return[];const s=this.getOptions(),{cartesianScales:n}=this.services,a=n.getDomainIdentifier(),i=n.isDualAxes(),{groupMapsTo:o}=s.data,d=n.getDomainLabel();let h=n.getRangeLabel();const u=t[0][a];let m;if(t.length===1){const p=t[0],g=n.getRangeIdentifier(p);if(i){const f=n.getRangeAxisPosition({datum:p,groups:[p[o]]});h=n.getScaleLabel(f)}const v=p[g];m=[{label:d,value:u},...Array.isArray(v)&&v.length===2?[{label:"Start",value:v[0]},{label:"End",value:v[1]}]:[{label:h,value:p[g]}]],e.detail.additionalItems&&e.detail.additionalItems.forEach(f=>m.push({label:f.label,value:f.value})),m.push({label:s.tooltip.groupLabel,value:p[o],color:this.model.getFillColor(p[o]),class:this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:p[o]})})}else if(t.length>1&&(m=[{label:d,value:u}],m=m.concat(t.map(p=>{const g=p[n.getRangeIdentifier(p)];return{label:p[o],value:Array.isArray(g)&&g.length===2?`${g[0]} - ${g[1]}`:g,color:this.model.getFillColor(p[o]),class:this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:p[o]})}}).sort((p,g)=>g.value-p.value)),!i&&c.getProperty(s,"tooltip","showTotal")===!0)){const p=n.getRangeIdentifier();m.push({label:c.get(s,"tooltip.totalLabel")||"Total",value:t.reduce((g,v)=>g+v[p],0),bold:!0})}return m}}class aa extends G{constructor(){super(...arguments),this.type="alluvial",this.renderType=r.RenderTypes.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0});t.html("");const{width:s,height:n}=O.DOMUtils.getSVGElementSize(t,{useAttrs:!0});if(s<1||n<1)return;const a=this.model.getOptions(),i=this.model.getDisplayData(),o=c.getProperty(this.getOptions(),"color","gradient","enabled");let d=c.alluvial.minNodePadding;a.alluvial.nodePadding>c.alluvial.minNodePadding&&(d=a.alluvial.nodePadding);const h=c.getProperty(a,"alluvial","nodeAlignment");let u=ie.sankeyJustify;h===r.Alignments.LEFT?u=ie.sankeyLeft:h===r.Alignments.RIGHT&&(u=ie.sankeyRight);const m=ie.sankey().nodeId(E=>E.name).nodeWidth(c.alluvial.nodeWidth).nodePadding(d).nodeAlign(u).extent([[2,30],[s-2,n]]);this.graph=m({nodes:a.alluvial.nodes.map(E=>Object.assign({},E)),links:i.map(E=>Object.assign({},E))}),this.graph.nodes=this.graph.nodes.filter(E=>E.value!==0);const p={};this.graph.nodes.forEach(E=>{const S=E.x0;E.category&&(p[S]=E==null?void 0:E.category)}),t.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(p)).join("g").attr("transform",E=>`translate(${E}, 0)`).append("text").attr("id",(E,S)=>this.services.domUtils.generateElementIDString(`alluvial-category-${S}`)).style("font-size","14px").text(E=>p[E]?p[E]:"").attr("y",20).attr("x",(E,S)=>{const T=this.services.domUtils.generateElementIDString(`alluvial-category-${S}`),{width:C}=O.DOMUtils.getSVGElementSize(y.select(`text#${T}`),{useBBox:!0});let M=0;return E+M>=C&&(M=-C+4),M});const v=t.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(v.exit().remove(),o){const E=c.getProperty(this.getOptions(),"color","scale");E&&v.enter().append("linearGradient").attr("id",S=>`${this.gradient_id}-link-${S.index}`).attr("gradientUnits","userSpaceOnUse").call(S=>S.append("stop").attr("offset","0%").attr("stop-color",T=>E[T.source.name])).call(S=>S.append("stop").attr("offset","100%").attr("stop-color",T=>E[T.target.name])),v.exit().remove()}v.enter().append("path").classed("link",!0).attr("d",ie.sankeyLinkHorizontal()).attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-line-${E.index}`)).attr("class",E=>a.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:E.source.index,originalClassName:"link"})).style("stroke",E=>o?`url(#${this.gradient_id}-link-${E.index})`:this.model.getFillColor(E.source.name)).attr("stroke-width",E=>Math.max(1,E.width)).style("stroke-opacity",c.alluvial.opacity.default).attr("aria-label",E=>`${E.source.name} → ${E.target.name} (${E.value}${a.alluvial.units?" "+a.alluvial.units:""})`);const f=t.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-${E.index}`)).classed("node-group",!0).attr("transform",E=>`translate(${E.x0}, ${E.y0})`);f.append("rect").classed("node",!0).attr("height",E=>E.y1-E.y0).attr("width",E=>E.x1-E.x0).attr("fill","black");const b=f.append("g").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${E.index}`));b.append("text").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${E.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(E=>`${E.name} (${E.value})`).attr("aria-label",E=>`${E.name} (${E.value})`),b.append("rect").classed("node-text-bg",!0).attr("width",(E,S)=>{const T=this.services.domUtils.generateElementIDString(`alluvial-node-text-${S}`),{width:C}=O.DOMUtils.getSVGElementSize(y.select(`text#${T}`),{useBBox:!0});return C+8}).attr("height",18).attr("stroke-width",2).lower(),b.attr("transform",(E,S)=>{const T=this.services.domUtils.generateElementIDString(`alluvial-node-text-${S}`),{width:C}=O.DOMUtils.getSVGElementSize(y.select(`text#${T}`),{useBBox:!0}),M=(E.y1-E.y0)/2-9;let x=E.x1-E.x0;return E.x1>=C?x=x-(C+16):x+=4,`translate(${x}, ${M})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const e=this.getOptions(),t=this,s=O.debounce((n,a="mouseover")=>{const i=t.parent.selectAll("path.link").transition().call(o=>t.services.transitions.setupTransition({transition:o,name:"alluvial-links-mouse-highlight"}));a==="mouseout"?(y.select(n).lower(),i.style("stroke-opacity",c.alluvial.opacity.default)):i.style("stroke-opacity",function(){return n===this?(y.select(this).raise(),c.alluvial.opacity.selected):c.alluvial.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(n,a){const i=y.select(this);s(this,"mouseover"),i.classed("link-hovered",!0);const o=getComputedStyle(this).getPropertyValue("stroke");t.services.events.dispatchEvent(r.Events.Alluvial.LINE_MOUSEOVER,{event:n,element:i,datum:a}),t.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:a.target.name,value:a.value+(e.alluvial.units?` ${e.alluvial.units}`:""),color:o,labelIcon:t.getRightArrowIcon()}]})}).on("mousemove",function(n,a){t.services.events.dispatchEvent(r.Events.Alluvial.LINE_MOUSEMOVE,{event:n,element:y.select(this),datum:a}),t.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:n})}).on("click",function(n,a){t.services.events.dispatchEvent(r.Events.Alluvial.LINE_CLICK,{event:n,element:y.select(this),datum:a})}).on("mouseout",function(n,a){const i=y.select(this);s(this,"mouseout"),i.classed("link-hovered",!1),t.services.events.dispatchEvent(r.Events.Alluvial.LINE_MOUSEOUT,{event:n,element:i,datum:a}),t.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{event:n,hoveredElement:i})})}addNodeEventListener(){const e=this,t=O.debounce((s=[],n="mouseover")=>{if(n==="mouseout"||s.length===0){e.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,i=>i.index).order().style("stroke-opacity",c.alluvial.opacity.default);return}e.parent.selectAll("path.link").transition().call(i=>this.services.transitions.setupTransition({transition:i,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(i){return s.some(o=>o===i.index)?(y.select(this).classed("link-hovered",!0).raise(),c.alluvial.opacity.selected):c.alluvial.opacity.unfocus})},66);e.parent.selectAll(".node-group").on("mouseover",function(s,n){const a=y.select(this),i=[];if(e.traverse({link:"sourceLinks",node:"target"},n,i),e.traverse({link:"targetLinks",node:"source"},n,i),i.length){const o=c.getTransformOffsets(a.attr("transform"));if(a.attr("transform",`translate(${o.x-2}, ${o.y})`),a.classed("node-hovered",!0).selectAll("rect.node").attr("width",8),n.x0-2===0){const h=e.services.domUtils.generateElementIDString(`alluvial-node-title-${n.index}`),u=e.parent.select(`g#${h}`),m=c.getTransformOffsets(u.attr("transform"));u.attr("transform",`translate(${m.x+4},${m.y})`)}const d=e.services.domUtils.generateElementIDString(`alluvial-node-text-${n.index}`);e.parent.select(`text#${d}`).style("font-weight","bold"),t(i,"mouseover"),e.services.events.dispatchEvent(r.Events.Alluvial.NODE_MOUSEOVER,{event:s,element:a,datum:n})}}).on("mousemove",function(s,n){e.services.events.dispatchEvent(r.Events.Alluvial.NODE_MOUSEMOVE,{event:s,element:y.select(this),datum:n}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:s})}).on("click",function(s,n){e.services.events.dispatchEvent(r.Events.Alluvial.NODE_CLICK,{event:s,element:y.select(this),datum:n})}).on("mouseout",function(s,n){const a=y.select(this),i=c.getTransformOffsets(a.attr("transform"));if(a.classed("node-hovered",!1).attr("transform",`translate(${i.x+2}, ${i.y})`).select("rect.node").attr("width",c.alluvial.nodeWidth),n.x0-2===0){const d=e.services.domUtils.generateElementIDString(`alluvial-node-title-${n.index}`),h=e.parent.select(`g#${d}`),u=c.getTransformOffsets(h.attr("transform"));h.attr("transform",`translate(${u.x-4},${u.y})`)}const o=e.services.domUtils.generateElementIDString(`alluvial-node-text-${n.index}`);e.parent.select(`text#${o}`).style("font-weight","normal"),t([],"mouseout"),e.services.events.dispatchEvent(r.Events.Alluvial.NODE_MOUSEOUT,{event:s,element:a,datum:n}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:a})})}traverse(e,t,s=[]){t[e.link].map(a=>(s.push(a.index),a[e.node])).forEach(a=>this.traverse(e,a,s))}getRightArrowIcon(){return`
69
+ </li>`).join("")+"</ul>"}valueFormatter(e,t){const s=this.getOptions(),n=c.getProperty(s,"tooltip","valueFormatter");if(n)return n(e,t);if(typeof e.getTime=="function")return c.format(e,"MMM d, yyyy");try{if(typeof e=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(e))return c.format(Date.parse(e),"MMM d, yyyy")}catch{}return e.toLocaleString()}render(e=!1){const t=this.getOptions(),s=c.getProperty(t,"tooltip","enabled");if(s){const n=y.select(this.services.domUtils.getHolder()),a=c.getProperty(t,"style","prefix");this.tooltip=O.DOMUtils.appendOrSelect(n,`div.${c.carbonPrefix}--${a}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!s&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}positionTooltip(e){const t=this.services.domUtils.getHolder(),s=this.tooltip.node(),n=this.getOptions(),a=c.getProperty(n,"zoomBar","top","enabled");let i=c.getProperty(e,"detail","mousePosition");if(!i)i=y.pointer(c.getProperty(e,"detail","event"),t);else{const p=c.getProperty(n,"zoomBar","top","type"),g=c.zoomBar.height[p];a&&(i[1]+=g+c.zoomBar.spacerHeight)}const o=t.offsetWidth,d=t.offsetHeight;let h;i[0]/o>.9?h=Z.LEFT:i[0]/o<.1?h=Z.RIGHT:h=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},s,[Z.RIGHT,Z.LEFT,Z.TOP,Z.BOTTOM],()=>({top:void 0,left:void 0,width:o,height:d}));let{horizontalOffset:u}=c.tooltips;h===Z.LEFT&&(u*=-1);const m=this.positionService.findPositionAt({left:i[0]+u,top:i[1]},s,h);this.positionService.setElement(s,m)}}const se=class se extends G{constructor(){super(...arguments),this.type="grid-brush",this.renderType=r.RenderTypes.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(e=!0){const t=this.parent,s=this.getComponentContainer();if(!t)throw new Error("SVG was not defined");const n=O.DOMUtils.appendOrSelect(t,"svg.chart-grid-backdrop"),a=O.DOMUtils.appendOrSelect(n,`g.${this.type}`),i=O.DOMUtils.appendOrSelect(a,this.selectionSelector),{width:o,height:d}=O.DOMUtils.getSVGElementSize(n,{useAttrs:!0}),{cartesianScales:h}=this.services,u=h.getMainXScaleType(),m=h.getMainXScale(),[p]=m.range();s.attr("transform",`translate(${p},0)`);const g=O.DOMUtils.appendOrSelect(s,this.frontSelectionSelector);if(m&&u===r.ScaleTypes.TIME){let v=this.model.get("zoomDomain");v===void 0&&(v=this.services.zoom.getDefaultZoomBarDomain(),v&&this.model.set({zoomDomain:v},{animate:!1}));const f=M=>{const x=M[1]-M[0];let w="0,"+x.toString();const P=Math.floor(d/se.DASH_LENGTH),$=P*se.DASH_LENGTH;for(let _=0;_<P;_++)w+=","+se.DASH_LENGTH;w+=","+(d-$),P%2===1&&(w+=",0"),w+=","+x.toString(),w+=","+d.toString(),g.attr("stroke-dasharray",w)},b=M=>{const x=M.selection;x===null||x[0]===x[1]||(g.attr("x",parseFloat(i.attr("x"))+parseFloat(n.attr("x"))).attr("y",i.attr("y")).attr("width",i.attr("width")).attr("height",i.attr("height")).style("cursor","pointer").style("display",null),f(x))},E=(M,x)=>{const w=y.scaleTime().range([0,o]).domain(v);let P=[w.invert(M),w.invert(x)];P[0].valueOf()===P[1].valueOf()&&(P=this.services.zoom.getDefaultZoomBarDomain()),(v[0].valueOf()!==P[0].valueOf()||v[1].valueOf()!==P[1].valueOf())&&this.services.zoom.handleDomainChange(P)};let S;const T=M=>{const x=M.selection;x!==null&&(E(x[0],x[1]),a.call(S.move,null),g.style("display","none"))};d!=0&&o!=0&&(S=y.brushX().extent([[0,0],[o-1,d]]).on("start brush end",b).on("end.brushed",T),a.call(S));const C=this.services.zoom.getZoomRatio();n.on("click",function(M){if(M.shiftKey){const x=this.services.domUtils.getHolder(),w=y.pointer(a.node(),x)[0];let P=w-o*C/2;P<0&&(P=0);let $=w+o*C/2;$>o&&($=o),E(P,$)}})}}};se.DASH_LENGTH=4;let Be=se;class ea extends G{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=r.RenderTypes.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=y.brushX(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(r.Events.ZoomBar.UPDATE,this.render.bind(this));const e=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"data");this.model.setZoomBarData(e)}render(e=!0){const t=this.getComponentContainer(),s=this.services.zoom.isZoomBarLoading(r.AxisPositions.TOP),n=this.services.zoom.isZoomBarLocked(r.AxisPositions.TOP),a=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.getProperty(this.getOptions(),"axes",r.AxisPositions.BOTTOM,"highlights"),o=c.zoomBar.height[a],{width:d}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});if(d===0)return;let h=0;const u=this.model.get("axesMargins");u&&u.left&&(h=u.left);const m=O.DOMUtils.appendOrSelect(t,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(O.DOMUtils.appendOrSelect(t,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",c.zoomBar.spacerHeight).attr("opacity",1).attr("fill","none"),a===r.ZoomBarTypes.GRAPH_VIEW?O.DOMUtils.appendOrSelect(m,"rect.zoom-bg").attr("x",h).attr("y",0).attr("width",d-h).attr("height","100%").classed("zoom-bg-skeleton",s).style("stroke",s?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):a===r.ZoomBarTypes.SLIDER_VIEW&&O.DOMUtils.appendOrSelect(m,"rect.zoom-slider-bg").attr("x",h).attr("y",o/2-1).attr("width",d-h).attr("height",2).classed("zoom-slider-bg-skeleton",s).style("stroke",s?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),s){this.renderSkeleton(m,h,d);return}const{cartesianScales:p}=this.services,g=p.getMainXScale(),v=p.getMainYScale(),f=p.getMainXScaleType();if(g&&f===r.ScaleTypes.TIME){let b=this.services.zoom.getZoomBarData();if(c.isEmpty(b)||b.length===1)return;this.xScale=g.copy(),this.yScale=v.copy();const E=this.services.zoom.getDefaultZoomBarDomain(b);b=this.compensateDataForDefaultDomain(b,E);const S=this.model.get("initialZoomDomain"),T=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"initialZoomDomain");T&&T[0]&&T[1]&&(T[0]=new Date(T[0]),T[1]=new Date(T[1])),T&&!(S&&S[0].valueOf()===T[0].valueOf()&&S[1].valueOf()===T[1].valueOf())?this.model.set({initialZoomDomain:c.merge([],T),zoomDomain:T?c.merge([],T):E},{skipUpdate:!0}):T===null&&S!==null&&this.model.set({initialZoomDomain:null,zoomDomain:c.merge([],E)},{skipUpdate:!0}),this.xScale.range([h,d]).domain(E),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(y.extent(b,x=>x.value));const C=this.model.get("zoomDomain");if(a===r.ZoomBarTypes.GRAPH_VIEW&&(this.renderZoomBarArea(m,"path.zoom-graph-area-unselected",b,null),this.updateClipPath(t,this.clipId,0,0,0,0),this.renderZoomBarArea(m,"path.zoom-graph-area",b,this.clipId),this.renderZoomBarBaseline(m,h,d),i)){const x=i.highlightStartMapsTo,w=i.highlightEndMapsTo,P=i.color,$=i.labelMapsTo;i.data.forEach((_,A)=>{O.DOMUtils.appendOrSelect(m,`rect.highlight-${A}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(_[x])).attr("width",this.xScale(_[w])-this.xScale(_[x])).style("fill",P&&P.scale[_[$]]?P.scale[_[$]]:null).style("fill-opacity",.1).style("stroke",P&&P.scale[_[$]]?P.scale[_[$]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(C,h,d);const M=O.DOMUtils.appendOrSelect(t,this.brushSelector).call(this.brush);if(C!==void 0)if(C[0].valueOf()===C[1].valueOf())M.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const x=C.map(w=>this.xScale(w));x[1]-x[0]<this.MIN_SELECTION_DIFF||(M.call(this.brush.move,x),this.updateBrushHandle(this.getComponentContainer(),x))}n&&(this.brush.filter(()=>!1),M.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(e,t,s){const n=o=>{const d=o.selection;d===null?this.handleBrushedEvent(o,e,this.xScale,this.xScale.range()):d[0]===d[1]||this.handleBrushedEvent(o,e,this.xScale,d)},a=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.zoomBar.height[a];this.brush.extent([[t,0],[s,i]]).on("start brush end",null).on("start brush end",n)}handleBrushedEvent(e,t,s,n){const a=[s.invert(n[0]),s.invert(n[1])];if(this.updateBrushHandle(this.getComponentContainer(),n),e.sourceEvent!=null&&(e.sourceEvent.type==="mousemove"||e.sourceEvent.type==="mouseup"||e.sourceEvent.type==="mousedown"||e.sourceEvent.type==="touchstart"||e.sourceEvent.type==="touchmove"||e.sourceEvent.type==="touchend")){(t===void 0||t[0]!==a[0]||t[1]!==a[1])&&this.services.zoom.handleDomainChange(a,{dispatchEvent:!1});let i;e.type==="start"?i=r.Events.ZoomBar.SELECTION_START:e.type==="brush"?i=r.Events.ZoomBar.SELECTION_IN_PROGRESS:e.type==="end"&&(i=r.Events.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(r.Events.ZoomDomain.CHANGE,{newDomain:a})),this.services.events.dispatchEvent(i,{selection:n,newDomain:a})}}updateBrushHandle(e,t){const s=this,n=c.zoomBar.handleWidth,a=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.zoomBar.height[a],o=-n/2,d=c.zoomBar.handleBarWidth,h=a===r.ZoomBarTypes.GRAPH_VIEW?c.zoomBar.handleBarHeight:6,u=-d/2,m=(i-h)/2;e.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(g){if(g.type==="w")return Math.max(t[0]+o,s.maxSelectionRange[0]);if(g.type==="e")return Math.min(t[1]+o,s.maxSelectionRange[1]-n)}).attr("y",0).attr("width",n).attr("height",i).attr("cursor","ew-resize").style("display",null);const p=e.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);p.enter().append("rect").attr("class",function(g){return"handle-bar handle-bar--"+g.type}),p.attr("x",function(g){if(g.type==="w")return Math.max(t[0]+u,s.maxSelectionRange[0]-o+u);if(g.type==="e")return Math.min(t[1]+u,s.maxSelectionRange[1]+o+u)}).attr("y",m).attr("width",d).attr("height",h).attr("cursor","ew-resize"),a===r.ZoomBarTypes.SLIDER_VIEW&&this.updateSliderSelectedArea(t),this.updateClipPath(e,this.clipId,t[0],0,t[1]-t[0],i)}updateSliderSelectedArea(e){const t=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),s=c.zoomBar.height[t],a=this.getComponentContainer().select("svg.zoom-container");O.DOMUtils.appendOrSelect(a,"rect.zoom-slider-selected-area").attr("x",e[0]).attr("y",s/2-1).attr("width",e[1]-e[0]).attr("height",2)}renderZoomBarArea(e,t,s,n){const{cartesianScales:a}=this.services,i=a.getMainXAxisPosition(),o=a.getMainYAxisPosition(),d=a.getMainXScaleType(),h=a.getMainYScaleType(),u=(E,S,T)=>C=>a.getValueFromScale(E,S,T,C),m=u(this.xScale,d,i),p=u(this.yScale,h,o),g=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),v=c.zoomBar.height[g],f=y.area().x(E=>m(E)).y0(v).y1(E=>v-p(E)),b=O.DOMUtils.appendOrSelect(e,t).datum(s).attr("d",f);n&&b.attr("clip-path",`url(#${n})`)}updateClipPath(e,t,s,n,a,i){const o=O.DOMUtils.appendOrSelect(e,"clipPath").attr("id",t);O.DOMUtils.appendOrSelect(o,"rect").attr("x",s).attr("y",n).attr("width",a).attr("height",i)}compensateDataForDefaultDomain(e,t){if(!e||e.length<2)return;const s=c.cloneDeep(e),n=this.services.cartesianScales.getDomainIdentifier(),a=this.services.cartesianScales.getRangeIdentifier();if(Number(t[0])<Number(s[0][n])){const i={};i[n]=t[0],i[a]=0,s.unshift(i)}if(Number(t[1])>Number(s[s.length-1][n])){const i={};i[n]=t[1],i[a]=0,s.push(i)}return s}renderZoomBarBaseline(e,t,s,n=!1){const a=c.getProperty(this.model.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.zoomBar.height[a],o=y.line()([[t,i],[s,i]]);O.DOMUtils.appendOrSelect(e,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",n).style("stroke",n?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(e,t,s){this.renderZoomBarArea(e,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(e,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),O.DOMUtils.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type")===r.ZoomBarTypes.GRAPH_VIEW&&this.renderZoomBarBaseline(e,t,s,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(r.Events.ZoomBar.UPDATE,this.render.bind(this))}}class ta extends G{constructor(e,t){super(e,t),this.type="threshold",this.renderType=r.RenderTypes.SVG,this.positionService=new ve}render(e=!1){const t=c.getProperty(this.getOptions(),"axes"),s=[];Object.keys(t).forEach(p=>{if(Object.values(r.AxisPositions).includes(p)){const g=t[p];g.thresholds&&g.thresholds.length>0&&s.push({axisPosition:p,thresholds:g.thresholds,correspondingDatasets:g==null?void 0:g.correspondingDatasets,mapsTo:g==null?void 0:g.mapsTo})}});const a=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-thresholds").data(s,p=>p.axisPosition);a.exit().attr("opacity",0).remove();const o=a.enter().append("g").merge(a);o.attr("class",p=>`axis-thresholds ${p.axisPosition}`);const d=o.selectAll("g.threshold-group").data(p=>p.thresholds.map(g=>(g.axisPosition=p.axisPosition,g.datum=this.constructDatumObj(p,g),g)));d.exit().attr("opacity",0).remove();const h=d.enter().append("g");h.append("line").attr("class","threshold-line"),h.append("rect").attr("class","threshold-hoverable-area"),h.merge(d).attr("class","threshold-group");const m=this;o.each(function({axisPosition:p}){const g=m.services.cartesianScales.getScaleByPosition(p),v=m.services.cartesianScales.getScaleTypeByPosition(p);let f=null,b=null;p===r.AxisPositions.LEFT||p===r.AxisPositions.RIGHT?(b=g,f=m.services.cartesianScales.getMainXScale()):(f=g,b=m.services.cartesianScales.getMainYScale());const E=v===r.ScaleTypes.LABELS,[S,T]=f.range(),[C,M]=b.range(),{cartesianScales:x}=m.services,w=x.getOrientation(),P=V=>x.getDomainValue(V),$=V=>x.getRangeValue(V),[_,A]=c.flipDomainAndRangeBasedOnOrientation(P,$,w),L=y.select(this);p===r.AxisPositions.TOP||p===r.AxisPositions.BOTTOM?(L.selectAll("line.threshold-line").transition().call(V=>m.services.transitions.setupTransition({transition:V,name:"threshold-line-update",animate:e})).attr("y1",M).attr("y2",C).attr("x1",({datum:V})=>_(V)+(E?g.step()/2:0)).attr("x2",({datum:V})=>_(V)+(E?g.step()/2:0)).style("stroke",({fillColor:V})=>V),L.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:V})=>-_(V)).attr("width",Math.abs(C-M)).classed("rotate",!0)):(L.selectAll("line.threshold-line").transition().call(V=>m.services.transitions.setupTransition({transition:V,name:"threshold-line-update",animate:e})).attr("x1",S).attr("x2",T).attr("y1",({datum:V})=>A(V)+(E?g.step()/2:0)).attr("y2",({datum:V})=>A(V)+(E?g.step()/2:0)).style("stroke",({fillColor:V})=>V),L.selectAll("rect.threshold-hoverable-area").attr("x",S).attr("y",({datum:V})=>A(V)).attr("width",Math.abs(T-S)).classed("rotate",!1))}),this.services.events.addEventListener(r.Events.Threshold.SHOW,p=>{this.setThresholdLabelPosition(p.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(r.Events.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(e){const{value:t,axisPosition:s}=e,n=this.getOptions();if(this.services.cartesianScales.getScaleTypeByPosition(s)===r.ScaleTypes.TIME){const i=[r.AxisPositions.LEFT,r.AxisPositions.RIGHT].includes(s),o=this.services.cartesianScales.getMainXScale(),d=this.services.cartesianScales.getMainYScale(),h=i?d:o,u=c.getProperty(n,"timeScale"),m=c.computeTimeIntervalName(h.ticks(),c.getProperty(u,"timeInterval"));return c.formatTick(t,0,h.ticks(),m,u)}return t.toLocaleString("en")}appendThresholdLabel(){const e=y.select(this.services.domUtils.getHolder()),t=c.getProperty(this.getOptions(),"style","prefix");this.label=O.DOMUtils.appendOrSelect(e,`div.${c.carbonPrefix}--${t}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:e,datum:t}){const s=this.services.domUtils.getHolder(),n=y.pointer(e,s),a=t.valueFormatter?t.valueFormatter(t.value):this.getFormattedValue(t);this.label.html(`${t.label||"Threshold"}: ${a}`).style("background-color",t.fillColor);const i=this.label.node(),o=this.positionService.findBestPlacementAt({left:n[0],top:n[1]},i,[Z.RIGHT,Z.LEFT,Z.TOP,Z.BOTTOM],()=>({top:void 0,left:void 0,width:s.offsetWidth,height:s.offsetHeight})),d=this.positionService.findPositionAt({left:n[0],top:n[1]},i,o);this.positionService.setElement(i,d)}constructDatumObj(e,t){const s={};return e.correspondingDatasets&&(s.group=c.getProperty(e,"correspondingDatasets",0)),s[e.mapsTo]=t.value,s}addEventListeners(){const e=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(s){y.select(this.parentNode).select("line.threshold-line").classed("active",!0),e.services.events.dispatchEvent(r.Events.Threshold.SHOW,{event:s,hoveredElement:y.select(this),datum:y.select(this).datum()})}).on("mouseout",function(s){y.select(this.parentNode).select("line.threshold-line").classed("active",!1),e.services.events.dispatchEvent(r.Events.Threshold.HIDE,{event:s,hoveredElement:y.select(this),datum:y.select(this).datum()})})}}class sa extends G{constructor(e,t){super(e,t),this.type="highlight",this.renderType=r.RenderTypes.SVG,this.positionService=new ve,this.highlightStrokeWidth=1}render(e=!1){const t=c.getProperty(this.getOptions(),"axes"),s=[];Object.keys(t).forEach(p=>{if(Object.values(r.AxisPositions).includes(p)){const g=t[p];g.highlights&&g.highlights.data.length>0&&s.push({axisPosition:p,highlightStartMapsTo:g.highlights.highlightStartMapsTo,highlightEndMapsTo:g.highlights.highlightEndMapsTo,labelMapsTo:g.highlights.labelMapsTo,highlight:g.highlights.data,color:g.highlights.color})}});const a=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-highlight").data(s,p=>p.axisPosition);a.exit().attr("opacity",0).remove();const o=a.enter().append("g").merge(a);o.attr("class",p=>`axis-highlight ${p.axisPosition}`);const d=o.selectAll("g.highlight-group").data(p=>p.highlight.map(g=>(g.axisPosition=p.axisPosition,g.highlightStartMapsTo=p.highlightStartMapsTo,g.labelMapsTo=p.labelMapsTo,g.color=p.color,g.highlightEndMapsTo=p.highlightEndMapsTo,g)));d.exit().attr("opacity",0).remove();const h=d.enter().append("g");h.append("rect").attr("class","highlight-bar"),h.append("line").attr("class","highlight-line"),h.merge(d).attr("class","highlight-group");const m=this;o.each(function({axisPosition:p}){const g=m.services.cartesianScales.getMainXScale(),v=m.services.cartesianScales.getMainYScale(),[f,b]=g.range(),[E,S]=v.range(),{cartesianScales:T}=m.services,C=T.getOrientation(),M=_=>T.getDomainValue(_),x=_=>T.getRangeValue(_),[w,P]=c.flipDomainAndRangeBasedOnOrientation(M,x,C),$=y.select(this);p===r.AxisPositions.TOP||p===r.AxisPositions.BOTTOM?$.selectAll("rect.highlight-bar").transition().call(_=>m.services.transitions.setupTransition({transition:_,name:"highlight-bar-update",animate:e})).attr("y",Math.max(S+m.highlightStrokeWidth,0)).attr("height",Math.max(E-2*m.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:_,...A})=>w(A[_])).attr("width",({highlightStartMapsTo:_,highlightEndMapsTo:A,...L})=>Math.max(w(L[A])-w(L[_]),0)).style("stroke",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",m.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null):$.selectAll("rect.highlight-bar").transition().call(_=>m.services.transitions.setupTransition({transition:_,name:"highlight-bar-update",animate:e})).attr("x",f).attr("width",Math.max(b-f,0)).attr("y",({highlightEndMapsTo:_,...A})=>P(A[_])).attr("height",({highlightStartMapsTo:_,highlightEndMapsTo:A,...L})=>Math.max(P(L[_])-P(L[A]),0)).style("stroke",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",m.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null)})}}class na extends kt{getItems(e){if(e.detail.items)return e.detail.items;const{data:t}=e.detail;if(!t||!t.length||!t[0])return[];const s=this.getOptions(),{cartesianScales:n}=this.services,a=n.getDomainIdentifier(),i=n.isDualAxes(),{groupMapsTo:o}=s.data,d=n.getDomainLabel();let h=n.getRangeLabel();const u=t[0][a];let m;if(t.length===1){const p=t[0],g=n.getRangeIdentifier(p);if(i){const f=n.getRangeAxisPosition({datum:p,groups:[p[o]]});h=n.getScaleLabel(f)}const v=p[g];m=[{label:d,value:u},...Array.isArray(v)&&v.length===2?[{label:"Start",value:v[0]},{label:"End",value:v[1]}]:[{label:h,value:p[g]}]],e.detail.additionalItems&&e.detail.additionalItems.forEach(f=>m.push({label:f.label,value:f.value})),m.push({label:s.tooltip.groupLabel,value:p[o],color:this.model.getFillColor(p[o]),class:this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:p[o]})})}else if(t.length>1&&(m=[{label:d,value:u}],m=m.concat(t.map(p=>{const g=p[n.getRangeIdentifier(p)];return{label:p[o],value:Array.isArray(g)&&g.length===2?`${g[0]} - ${g[1]}`:g,color:this.model.getFillColor(p[o]),class:this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:p[o]})}}).sort((p,g)=>g.value-p.value)),!i&&c.getProperty(s,"tooltip","showTotal")===!0)){const p=n.getRangeIdentifier();m.push({label:c.get(s,"tooltip.totalLabel")||"Total",value:t.reduce((g,v)=>g+v[p],0),bold:!0})}return m}}class aa extends G{constructor(){super(...arguments),this.type="alluvial",this.renderType=r.RenderTypes.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0});t.html("");const{width:s,height:n}=O.DOMUtils.getSVGElementSize(t,{useAttrs:!0});if(s<1||n<1)return;const a=this.model.getOptions(),i=this.model.getDisplayData(),o=c.getProperty(this.getOptions(),"color","gradient","enabled");let d=c.alluvial.minNodePadding;a.alluvial.nodePadding>c.alluvial.minNodePadding&&(d=a.alluvial.nodePadding);const h=c.getProperty(a,"alluvial","nodeAlignment");let u=ie.sankeyJustify;h===r.Alignments.LEFT?u=ie.sankeyLeft:h===r.Alignments.RIGHT&&(u=ie.sankeyRight);const m=ie.sankey().nodeId(E=>E.name).nodeWidth(c.alluvial.nodeWidth).nodePadding(d).nodeAlign(u).extent([[2,30],[s-2,n]]);this.graph=m({nodes:a.alluvial.nodes.map(E=>Object.assign({},E)),links:i.map(E=>Object.assign({},E))}),this.graph.nodes=this.graph.nodes.filter(E=>E.value!==0);const p={};this.graph.nodes.forEach(E=>{const S=E.x0;E.category&&(p[S]=E==null?void 0:E.category)}),t.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(p)).join("g").attr("transform",E=>`translate(${E}, 0)`).append("text").attr("id",(E,S)=>this.services.domUtils.generateElementIDString(`alluvial-category-${S}`)).style("font-size","14px").text(E=>p[E]?p[E]:"").attr("y",20).attr("x",(E,S)=>{const T=this.services.domUtils.generateElementIDString(`alluvial-category-${S}`),{width:C}=O.DOMUtils.getSVGElementSize(y.select(`text#${T}`),{useBBox:!0});let M=0;return E+M>=C&&(M=-C+4),M});const v=t.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(v.exit().remove(),o){const E=c.getProperty(this.getOptions(),"color","scale");E&&v.enter().append("linearGradient").attr("id",S=>`${this.gradient_id}-link-${S.index}`).attr("gradientUnits","userSpaceOnUse").call(S=>S.append("stop").attr("offset","0%").attr("stop-color",T=>E[T.source.name])).call(S=>S.append("stop").attr("offset","100%").attr("stop-color",T=>E[T.target.name])),v.exit().remove()}v.enter().append("path").classed("link",!0).attr("d",ie.sankeyLinkHorizontal()).attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-line-${E.index}`)).attr("class",E=>a.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:E.source.index,originalClassName:"link"})).style("stroke",E=>o?`url(#${this.gradient_id}-link-${E.index})`:this.model.getFillColor(E.source.name)).attr("stroke-width",E=>Math.max(1,E.width)).style("stroke-opacity",c.alluvial.opacity.default).attr("aria-label",E=>`${E.source.name} → ${E.target.name} (${E.value}${a.alluvial.units?" "+a.alluvial.units:""})`);const f=t.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-${E.index}`)).classed("node-group",!0).attr("transform",E=>`translate(${E.x0}, ${E.y0})`);f.append("rect").classed("node",!0).attr("height",E=>E.y1-E.y0).attr("width",E=>E.x1-E.x0).attr("fill","black");const b=f.append("g").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${E.index}`));b.append("text").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${E.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(E=>`${E.name} (${E.value})`).attr("aria-label",E=>`${E.name} (${E.value})`),b.append("rect").classed("node-text-bg",!0).attr("width",(E,S)=>{const T=this.services.domUtils.generateElementIDString(`alluvial-node-text-${S}`),{width:C}=O.DOMUtils.getSVGElementSize(y.select(`text#${T}`),{useBBox:!0});return C+8}).attr("height",18).attr("stroke-width",2).lower(),b.attr("transform",(E,S)=>{const T=this.services.domUtils.generateElementIDString(`alluvial-node-text-${S}`),{width:C}=O.DOMUtils.getSVGElementSize(y.select(`text#${T}`),{useBBox:!0}),M=(E.y1-E.y0)/2-9;let x=E.x1-E.x0;return E.x1>=C?x=x-(C+16):x+=4,`translate(${x}, ${M})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const e=this.getOptions(),t=this,s=O.debounce((n,a="mouseover")=>{const i=t.parent.selectAll("path.link").transition().call(o=>t.services.transitions.setupTransition({transition:o,name:"alluvial-links-mouse-highlight"}));a==="mouseout"?(y.select(n).lower(),i.style("stroke-opacity",c.alluvial.opacity.default)):i.style("stroke-opacity",function(){return n===this?(y.select(this).raise(),c.alluvial.opacity.selected):c.alluvial.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(n,a){const i=y.select(this);s(this,"mouseover"),i.classed("link-hovered",!0);const o=getComputedStyle(this).getPropertyValue("stroke");t.services.events.dispatchEvent(r.Events.Alluvial.LINE_MOUSEOVER,{event:n,element:i,datum:a}),t.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:a.target.name,value:a.value+(e.alluvial.units?` ${e.alluvial.units}`:""),color:o,labelIcon:t.getRightArrowIcon()}]})}).on("mousemove",function(n,a){t.services.events.dispatchEvent(r.Events.Alluvial.LINE_MOUSEMOVE,{event:n,element:y.select(this),datum:a}),t.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:n})}).on("click",function(n,a){t.services.events.dispatchEvent(r.Events.Alluvial.LINE_CLICK,{event:n,element:y.select(this),datum:a})}).on("mouseout",function(n,a){const i=y.select(this);s(this,"mouseout"),i.classed("link-hovered",!1),t.services.events.dispatchEvent(r.Events.Alluvial.LINE_MOUSEOUT,{event:n,element:i,datum:a}),t.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{event:n,hoveredElement:i})})}addNodeEventListener(){const e=this,t=O.debounce((s=[],n="mouseover")=>{if(n==="mouseout"||s.length===0){e.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,i=>i.index).order().style("stroke-opacity",c.alluvial.opacity.default);return}e.parent.selectAll("path.link").transition().call(i=>this.services.transitions.setupTransition({transition:i,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(i){return s.some(o=>o===i.index)?(y.select(this).classed("link-hovered",!0).raise(),c.alluvial.opacity.selected):c.alluvial.opacity.unfocus})},66);e.parent.selectAll(".node-group").on("mouseover",function(s,n){const a=y.select(this),i=[];if(e.traverse({link:"sourceLinks",node:"target"},n,i),e.traverse({link:"targetLinks",node:"source"},n,i),i.length){const o=c.getTransformOffsets(a.attr("transform"));if(a.attr("transform",`translate(${o.x-2}, ${o.y})`),a.classed("node-hovered",!0).selectAll("rect.node").attr("width",8),n.x0-2===0){const h=e.services.domUtils.generateElementIDString(`alluvial-node-title-${n.index}`),u=e.parent.select(`g#${h}`),m=c.getTransformOffsets(u.attr("transform"));u.attr("transform",`translate(${m.x+4},${m.y})`)}const d=e.services.domUtils.generateElementIDString(`alluvial-node-text-${n.index}`);e.parent.select(`text#${d}`).style("font-weight","bold"),t(i,"mouseover"),e.services.events.dispatchEvent(r.Events.Alluvial.NODE_MOUSEOVER,{event:s,element:a,datum:n})}}).on("mousemove",function(s,n){e.services.events.dispatchEvent(r.Events.Alluvial.NODE_MOUSEMOVE,{event:s,element:y.select(this),datum:n}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:s})}).on("click",function(s,n){e.services.events.dispatchEvent(r.Events.Alluvial.NODE_CLICK,{event:s,element:y.select(this),datum:n})}).on("mouseout",function(s,n){const a=y.select(this),i=c.getTransformOffsets(a.attr("transform"));if(a.classed("node-hovered",!1).attr("transform",`translate(${i.x+2}, ${i.y})`).select("rect.node").attr("width",c.alluvial.nodeWidth),n.x0-2===0){const d=e.services.domUtils.generateElementIDString(`alluvial-node-title-${n.index}`),h=e.parent.select(`g#${d}`),u=c.getTransformOffsets(h.attr("transform"));h.attr("transform",`translate(${u.x-4},${u.y})`)}const o=e.services.domUtils.generateElementIDString(`alluvial-node-text-${n.index}`);e.parent.select(`text#${o}`).style("font-weight","normal"),t([],"mouseout"),e.services.events.dispatchEvent(r.Events.Alluvial.NODE_MOUSEOUT,{event:s,element:a,datum:n}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:a})})}traverse(e,t,s=[]){t[e.link].map(a=>(s.push(a.index),a[e.node])).forEach(a=>this.traverse(e,a,s))}getRightArrowIcon(){return`
70
70
  <svg xmlns="http://www.w3.org/2000/svg" class="arrow-right" width="32" height="32" viewBox="0 0 32 32">
71
71
  <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"/>
72
72
  <rect width="32" height="32"/>
@@ -79,4 +79,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
79
79
  <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"/>
80
80
  <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"/>
81
81
  </svg>`}addEventListeners(){const e=this;this.parent.selectAll("circle.node").on("mouseover",function(t,s){const n=y.select(this);n.classed("hovered",!0);const a=e.model.getHierarchyLevel(),i=a>2&&!n.classed("focal"),o=c.getProperty(e.model.getOptions(),"canvasZoom","enabled");let d=!1;if(!i){let h=[],u=[],m=null;if(s.children){s.depth>1&&o&&(d=!0,n.classed("clickable",!0)),h=s.children.map(v=>{if(v!==null)return typeof v.data.value=="number"?{label:v.data.name,value:v.data.value}:{label:v.data.name,labelIcon:o&&a<=2?e.getZoomIcon():null,value:v.value}});const g=e.model.getOptions();u=[{label:c.get(g,"tooltip.totalLabel")||"Total",value:s.value,bold:!0}],e.highlightChildren(s.children)}else m=s.value;const p=getComputedStyle(this,null).getPropertyValue("fill");e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,items:[{color:p,label:s.data.name,labelIcon:d&&o&&a<=2?e.getZoomIcon():null,value:m},...h,...u]})}e.services.events.dispatchEvent(r.Events.CirclePack.CIRCLE_MOUSEOVER,{event:t,element:n,datum:s})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.CirclePack.CIRCLE_MOUSEMOVE,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1),s.children&&e.unhighlightChildren(s.children),e.services.events.dispatchEvent(r.Events.CirclePack.CIRCLE_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})}).on("click",function(t,s){const n=y.select(this),a=n.classed("non-focal"),i=c.getProperty(e.model.getOptions(),"canvasZoom","enabled");if(i&&e.model.getHierarchyLevel()>2){const o=e.parent.selectAll("circle.node");y.select(e.services.domUtils.getMainContainer()).classed("zoomed-in",!1),e.focal=null,e.model.updateHierarchyLevel(2),e.services.canvasZoom.zoomOut(o,c.canvasZoomSettings)}else if(s.depth===2&&s.children&&!a&&i){const o=e.parent.selectAll("circle.node");y.select(e.services.domUtils.getMainContainer()).classed("zoomed-in",!0),e.focal=s,e.model.updateHierarchyLevel(3),e.services.canvasZoom.zoomIn(s,o,c.canvasZoomSettings),t.stopPropagation()}e.services.events.dispatchEvent(r.Events.CirclePack.CIRCLE_CLICK,{event:t,element:n,datum:s})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function Ua(l,e){const t=y.interpolate(this._current,l);return s=>(this._current=t(s),e(this._current))}class Ut extends G{constructor(){super(...arguments),this.type="pie",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-bar"})).attr("opacity",n=>n.data[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return c.pie.innerRadius}render(e=!0){const t=this,s=this.getComponentContainer(),n=this.getOptions(),{groupMapsTo:a}=n.data,{valueMapsTo:i}=n.pie,o=this.model.getDisplayData().filter(L=>L[i]>0),d=this.computeRadius();this.arc=y.arc().innerRadius(this.getInnerRadius()).outerRadius(d),this.hoverArc=y.arc().innerRadius(this.getInnerRadius()).outerRadius(d+c.pie.hoverArc.outerRadiusOffset);const u=y.pie().value(L=>L[i]).sort(c.getProperty(n,"pie","sortFunction")).padAngle(c.pie.padAngle)(o),p=O.DOMUtils.appendOrSelect(s,"g.slices").attr("role",B.Roles.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,L=>L.data[a]);p.exit().attr("opacity",0).remove(),p.enter().append("path").classed("slice",!0).attr("opacity",0).merge(p).attr("class",L=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:L.data[a],originalClassName:"slice"})).style("fill",L=>t.model.getFillColor(L.data[a])).attr("d",this.arc).transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"pie_slice_enter_update",animate:e})).attr("opacity",1).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",L=>`${L[i]}, ${c.convertValueToPercentage(L.data[i],o,i)+"%"}`).attrTween("d",function(L){return Ua.bind(this)(L,t.arc)});const f=n.pie.labels.enabled,b=f?u.filter(L=>L.data[i]>0):[],S=O.DOMUtils.appendOrSelect(s,"g.labels").attr("role",B.Roles.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(b,L=>L.data[a]);S.exit().attr("opacity",0).remove();const T=S.enter().append("text").classed("pie-label",!0),C=[];T.merge(S).style("text-anchor","middle").text(L=>n.pie.labels.formatter?n.pie.labels.formatter(L):c.convertValueToPercentage(L.data[i],o,i)+"%").datum(function(L){const V=d+7,k=(L.endAngle-L.startAngle)/2+L.startAngle,F=k/Math.PI*180,q=this.getComputedTextLength();return L.textOffsetX=q/2,L.textOffsetY=F>90&&F<270?10:0,L.xPosition=(L.textOffsetX+V)*Math.sin(k),L.yPosition=(L.textOffsetY+V)*-Math.cos(k),L}).attr("transform",function(L,V){const k=b.length,F=(L.endAngle-L.startAngle)*(180/Math.PI);if(V>=k-2&&F<c.pie.callout.minSliceDegree){let q,H;return L.index===k-1?(q=L.xPosition+c.pie.callout.offsetX+c.pie.callout.textMargin+L.textOffsetX,H=L.yPosition-c.pie.callout.offsetY,L.direction=r.CalloutDirections.RIGHT,C.push(L)):(q=L.xPosition-c.pie.callout.offsetX-L.textOffsetX-c.pie.callout.textMargin,H=L.yPosition-c.pie.callout.offsetY,L.direction=r.CalloutDirections.LEFT,C.push(L)),`translate(${q}, ${H})`}return`translate(${L.xPosition}, ${L.yPosition})`}),this.renderCallouts(C);const M=c.getProperty(n,"donut")?"donut":"pie",x=c.getProperty(n,M,"alignment"),{width:w}=O.DOMUtils.getSVGElementSize(this.getParent(),{useAttrs:!0}),P=f?c.pie.xOffset:0,$=f?c.pie.yOffset:0;let _=d+P;x===r.Alignments.CENTER?_=w/2:x===r.Alignments.RIGHT&&(_=w-d-c.pie.xOffset);let A=d+$;C.length>0&&(A+=c.pie.yOffsetCallout),s.attr("x",_+7).attr("y",A),this.addEventListeners()}renderCallouts(e){const t=O.DOMUtils.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",B.Roles.GROUP).attr("data-name","callouts"),s=t.selectAll("g.callout").data(e);s.exit().remove();const n=s.enter().append("g").classed("callout",!0).attr("role",B.Roles.GROUP).attr("aria-roledescription","label callout");n.merge(s).datum(function(o){const{xPosition:d,yPosition:h,direction:u}=o;return u===r.CalloutDirections.RIGHT?(o.startPos={x:d,y:h+o.textOffsetY},o.endPos={x:d+c.pie.callout.offsetX,y:h-c.pie.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x-c.pie.callout.horizontalLineLength):(o.startPos={x:d,y:h+o.textOffsetY},o.endPos={x:d-c.pie.callout.offsetX,y:h-c.pie.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x+c.pie.callout.horizontalLineLength),o}),n.append("line").classed("vertical-line",!0).merge(t.selectAll("line.vertical-line")).datum(function(){return y.select(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),n.append("line").classed("horizontal-line",!0).merge(t.selectAll("line.horizontal-line")).datum(function(){return y.select(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 e=this;this.parent.selectAll("path.slice").on("mouseover",function(t,s){const n=y.select(this);n.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>e.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",e.hoverArc),e.services.events.dispatchEvent(r.Events.Pie.SLICE_MOUSEOVER,{event:t,element:y.select(this),datum:s});const{groupMapsTo:a}=e.getOptions().data,{valueMapsTo:i}=e.getOptions().pie;e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,items:[{label:s.data[a],value:s.data[i]}]})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Pie.SLICE_MOUSEMOVE,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Pie.SLICE_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1).transition("pie_slice_mouseout").call(a=>e.services.transitions.setupTransition({transition:a,name:"pie_slice_mouseout"})).attr("d",e.arc),e.services.events.dispatchEvent(r.Events.Pie.SLICE_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})})}computeRadius(){const{width:e,height:t}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0}),s=this.getOptions(),n=Math.min(e,t)/2;return s.pie.labels.enabled?n+c.pie.radiusOffset:n}}class Va extends Ut{constructor(){super(...arguments),this.type="donut",this.renderType=r.RenderTypes.SVG}render(e=!0){super.render(e);const t=this;if(this.model.isDataEmpty()){this.getComponentContainer().select("g.center").remove();return}const s=O.DOMUtils.appendOrSelect(this.getComponentContainer(),"g.center"),n=this.getOptions(),a=this.computeRadius(),i=c.getProperty(n,"donut","center","label");O.DOMUtils.appendOrSelect(s,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>i===null||i===""?"central":"initial").style("font-size",()=>n.donut.center.numberFontSize(a)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:e})).tween("text",function(){return t.centerNumberTween(y.select(this))}),i!==null&&i!==""&&O.DOMUtils.appendOrSelect(s,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>n.donut.center.titleFontSize(a)).attr("y",n.donut.center.titleYPosition(a)).text(i)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(e){const t=this.getOptions();let s=c.getProperty(t,"donut","center","number");s===null&&(s=this.model.getDisplayData().reduce((o,d)=>o+d[t.pie.valueMapsTo],0));const n=parseInt(e.text().replace(/[, ]+/g,""),10)||0;let a;n%1===0&&s%1===0?a=y.interpolateRound:a=y.interpolateNumber;const i=a(n,s);return o=>{const{numberFormatter:d}=t.donut.center;e.text(d(i(o)))}}}const rt="4,10 8,6 12,10",ot="12,6 8,10 4,6";class Na extends G{constructor(){super(...arguments),this.type="gauge",this.renderType=r.RenderTypes.SVG}getValue(){var s;return((s=this.model.getData().find(n=>n.group==="value"))==null?void 0:s.value)??null}getValueRatio(){return Mt(this.getValue(),0,100)/100}getDelta(){var s;return((s=this.model.getData().find(n=>n.group==="delta"))==null?void 0:s.value)??null}getArcRatio(){const e=this.getOptions();return c.getProperty(e,"gauge","type")===r.GaugeTypes.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const e=this.getArcSize();return e===2*Math.PI?0:-e/2}getArrow(e){const t=this.getOptions();switch(c.getProperty(t,"gauge","deltaArrow","direction")){case r.ArrowDirections.UP:return rt;case r.ArrowDirections.DOWN:return ot;default:return e>0?rt:ot}}render(e=!0){const t=this.getComponentContainer().attr("width","100%").attr("height","100%"),s=this.getOptions(),n=this.getValue(),a=this.getValueRatio(),i=this.getArcSize(),o=this.getStartAngle(),d=a*i,h=o+d,u=o+i,m=this.computeRadius(),p=this.getInnerRadius();this.backgroundArc=y.arc().innerRadius(p).outerRadius(m).startAngle(h).endAngle(u),this.arc=y.arc().innerRadius(p).outerRadius(m).startAngle(o).endAngle(h),O.DOMUtils.appendOrSelect(t,"path.arc-background").attr("d",this.backgroundArc);const g=t.selectAll("path.arc-foreground").data([n]);g.enter().append("path").merge(g).attr("class",this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>c.getProperty(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",S=>S),this.drawValueNumber(),this.drawDelta(),g.exit().remove();const f=c.getProperty(s,"gauge","alignment"),{width:b}=O.DOMUtils.getSVGElementSize(this.getParent(),{useAttrs:!0});let E=m;f===r.Alignments.CENTER?E=b/2:f===r.Alignments.RIGHT&&(E=b-m),t.attr("x",E).attr("y",m),this.addEventListeners()}drawValueNumber(){const e=this.getComponentContainer(),t=this.getOptions(),s=c.getProperty(t,"gauge","type"),n=this.getValue(),a=this.getDelta(),i=this.computeRadius(),o=c.getProperty(t,"gauge","valueFontSize"),d=c.getProperty(t,"gauge","deltaFontSize"),h=c.getProperty(t,"gauge","numberSpacing"),u=c.getProperty(t,"gauge","showPercentageSymbol");let m=0;s===r.GaugeTypes.FULL&&!a?m=d(i):s===r.GaugeTypes.SEMI&&a&&(m=-(d(i)+h));const p=O.DOMUtils.appendOrSelect(e,"g.gauge-numbers").attr("transform",`translate(0, ${m})`),g=o(i),v=O.DOMUtils.appendOrSelect(p,"g.gauge-value-number"),f=c.getProperty(t,"gauge","numberFormatter"),b=v.selectAll("text.gauge-value-number").data([n]);b.enter().append("text").attr("class","gauge-value-number").merge(b).style("font-size",`${g}px`).attr("text-anchor","middle").text(w=>f(w));const{width:E}=O.DOMUtils.getSVGElementSize(O.DOMUtils.appendOrSelect(e,"text.gauge-value-number"),{useBBox:!0}),S=g/2,T=u?"%":"",C=O.DOMUtils.appendOrSelect(v,"text.gauge-value-symbol").style("font-size",`${S}px`).attr("x",E/2).text(T),{width:M,height:x}=O.DOMUtils.getSVGElementSize(C,{useBBox:!0});C.attr("y",`-${x/2}px`),v.attr("transform",`translate(-${M/2}, 0)`)}drawDelta(){const e=this,t=this.getComponentContainer(),s=this.getOptions(),n=this.getDelta();if(n){const a=this.computeRadius(),i=n?c.getProperty(s,"gauge","deltaFontSize"):()=>0,o=n?c.getProperty(s,"gauge","numberFormatter"):()=>null,d=c.getProperty(s,"gauge","deltaArrow","size"),h=c.getProperty(s,"gauge","numberSpacing"),u=c.getProperty(s,"gauge","showPercentageSymbol"),m=O.DOMUtils.appendOrSelect(t,"g.gauge-numbers"),p=O.DOMUtils.appendOrSelect(m,"g.gauge-delta").attr("transform",`translate(0, ${i(a)+h})`),g=O.DOMUtils.appendOrSelect(p,"text.gauge-delta-number"),v=u?"%":"";g.data(n===null?[]:[n]),g.enter().append("text").classed("gauge-delta-number",!0).merge(g).attr("text-anchor","middle").style("font-size",`${i(a)}px`).text(S=>`${o(S)}${v}`);const{width:f}=O.DOMUtils.getSVGElementSize(O.DOMUtils.appendOrSelect(t,".gauge-delta-number"),{useBBox:!0}),b=c.getProperty(s,"gauge","deltaArrow","enabled"),E=p.selectAll("svg.gauge-delta-arrow").data(n!==null&&b?[n]:[]);E.enter().append("svg").merge(E).attr("class","gauge-delta-arrow").attr("x",-d(a)-f/2).attr("y",-d(a)/2-i(a)*.35).attr("width",d(a)).attr("height",d(a)).attr("viewBox","0 0 16 16").each(function(){const S=y.select(this);O.DOMUtils.appendOrSelect(S,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const T=c.getProperty(s,"gauge","status");O.DOMUtils.appendOrSelect(S,"polygon.gauge-delta-arrow").attr("class",T!==null?`gauge-delta-arrow status--${T}`:"").attr("points",e.getArrow(n))}),E.exit().remove(),g.exit().remove()}else{const a=t.select("g.gauge-delta");a.empty()||a.remove()}}getInnerRadius(){const e=this.computeRadius(),t=c.getProperty(this.getOptions(),"gauge","arcWidth");return e-t}addEventListeners(){const e=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(t,s){e.services.events.dispatchEvent(r.Events.Gauge.ARC_MOUSEOVER,{event:t,element:y.select(this),datum:s})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Gauge.ARC_MOUSEMOVE,{event:t,element:n,datum:s})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Gauge.ARC_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Gauge.ARC_MOUSEOUT,{event:t,element:n,datum:s})})}computeRadius(){const e=this.getOptions(),t=c.getProperty(e,"gauge","type"),{width:s,height:n}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});return t===r.GaugeTypes.SEMI?Math.min(s/2,n):Math.min(s/2,n/2)}}class Ba extends ye{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=r.RenderTypes.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-bar"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.model.getDisplayData(this.configs.groups),s=this.getOptions(),{groupMapsTo:n}=s.data;this.setGroupScale();const a=this.getComponentContainer({withinChartClip:!0}),i=c.uniq(t.map(p=>{const g=this.services.cartesianScales.getDomainIdentifier(p);return p[g]&&typeof p[g].toString=="function"?p[g].toString():p[g]})),o=a.selectAll("g.bars").data(i,p=>p);o.exit().attr("opacity",0).remove();const h=o.enter().append("g").classed("bars",!0).attr("role",B.Roles.GROUP).attr("data-name","bars").merge(o);h.transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"bar-group-update-enter",animate:e})).attr("transform",p=>{const v=this.services.cartesianScales.getDomainValue(p)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===r.CartesianOrientations.VERTICAL?`translate(${v}, 0)`:`translate(0, ${v})`});const u=h.selectAll("path.bar").data(p=>this.getDataCorrespondingToLabel(p),p=>p[n]);u.exit().attr("opacity",0).remove(),u.enter().append("path").attr("opacity",0).merge(u).classed("bar",!0).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"bar-update-enter",animate:e})).attr("class",p=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:p[n],originalClassName:"bar"})).style("fill",p=>this.model.getFillColor(p[n])).attr("d",p=>{const g=this.groupScale(p[n]),v=this.getBarWidth(),f=g,b=g+v,E=this.services.cartesianScales.getRangeAxisPosition({datum:p}),S=this.services.cartesianScales.getValueThroughAxisPosition(E,0),T=this.services.cartesianScales.getRangeValue(p),C=this.services.cartesianScales.getDomainValue(p)-v/2,M=C+v;if(!this.isOutsideZoomedDomain(C,M))return c.generateSVGPathString({x0:f,x1:b,y0:S,y1:T},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",p=>p.value),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("path.bar").on("mouseover",function(t,s){const n=y.select(this);n.classed("hovered",!0),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOVER,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,data:[s]})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEMOVE,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Bar.BAR_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(e){return this.model.getDisplayData(this.configs.groups).filter(s=>{const n=this.services.cartesianScales.getDomainIdentifier(s);return s[n].toString()===e})}getGroupWidth(){const e=this.model.getGroupedData(this.configs.groups),t=this.getTotalGroupPadding();return this.getBarWidth()*e.length+t}getDomainScaleStep(){const e=this.services.cartesianScales.getDomainScale(),t=this.model.getGroupedData(this.configs.groups);let s=this.defaultStepFactor;if(typeof e.step=="function")s=e.step();else if(t.length>0){const n=t.find(a=>{var i;return((i=a.data)==null?void 0:i.length)>1});if(n){const a=this.services.cartesianScales.getDomainIdentifier(n.data[0]);s=Math.abs(e(n.data[1][a])-e(n.data[0][a]))}}return s}getTotalGroupPadding(){const e=this.model.getGroupedData(this.configs.groups);return e.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(e.length-1)}getBarWidth(){const e=this.getOptions(),t=c.getProperty(e,"bars","width"),s=c.getProperty(e,"bars","maxWidth");if(t!==null&&(s===null||t<=s))return t;const a=this.model.getGroupedData(this.configs.groups).length,i=this.getTotalGroupPadding();return Math.min(s,(this.getDomainScaleStep()-i)/a)}setGroupScale(){const e=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=y.scaleBand().domain(e).rangeRound([0,this.getGroupWidth()])}}class Ga extends G{constructor(){super(...arguments),this.type="heatmap",this.renderType=r.RenderTypes.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=e=>{const{detail:t}=e,{datum:s}=t,n=this.model.getUniqueRanges(),a=this.model.getUniqueDomain(),i=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),d=this.services.cartesianScales.getMainXScale(),h=this.services.cartesianScales.getMainYScale();let u="",m=null,p=null,g=null;this.matrix[s]!==void 0?(u=i,n.forEach(v=>{if(typeof this.matrix[s][v].value=="number"){const f=this.matrix[s][v].value;if(m===null){m=f,p=f,g=f;return}m+=f,p=f<p?f:p,g=f>g?f:g}})):(u=o,a.forEach(v=>{if(typeof this.matrix[v][s].value=="number"){const f=this.matrix[v][s].value;if(m===null){m=f,p=f,g=f;return}m+=f,p=f<p?f:p,g=f>g?f:g}})),d(s)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${d(s)}, ${y.min(h.range())})`):h(s)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${y.min(d.range())},${h(s)})`),this.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t.event,hoveredElement:y.select(e.detail.element),items:[{label:u,value:s,bold:!0},{label:"Min",value:p!==null?p:"-"},{label:"Max",value:g!==null?g:"-"},{label:"Average",value:m!==null?m/a.length:"-"}]})},this.handleAxisMouseOut=e=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{event:e})}}init(){const e=this.services.events;e.addEventListener(r.Events.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),e.addEventListener(r.Events.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),e.addEventListener(r.Events.Axis.LABEL_FOCUS,this.handleAxisOnHover),e.addEventListener(r.Events.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0});t.lower();const{cartesianScales:s}=this.services;if(this.matrix=this.model.getMatrix(),t.html(""),c.getProperty(this.getOptions(),"data","loading"))return;const n=s.getMainXScale(),a=s.getMainYScale(),i=s.getDomainIdentifier(),o=s.getRangeIdentifier(),d=this.model.getUniqueDomain(),h=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),m=n.range(),p=a.range();this.xBandwidth=Math.abs((m[1]-m[0])/d.length),this.yBandwidth=Math.abs((p[1]-p[0])/h.length);const g=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");t.append("defs").append("pattern").attr("id",g).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 v=t.selectAll().data(u).enter().append("g").attr("class",f=>`heat-${f.index}`).classed("cell",!0).attr("transform",f=>`translate(${n(f[i])}, ${a(f[o])})`).append("rect").attr("class",f=>this.model.getColorClassName({value:f.value,originalClassName:`heat-${f.index}`})).classed("heat",!0).classed("null-state",f=>f.index===-1||f.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",f=>f.index===-1||f.value===null?`url(#${g})`:this.model.getFillColor(Number(f.value))).attr("aria-label",f=>f.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(p[1]-p[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(m[1]-m[0]),this.yBandwidth),this.determineDividerStatus()&&(v.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(e,t,s){const n=O.DOMUtils.appendOrSelect(this.parent,e).classed("shadows",!0).classed("highlighter-hidden",!0);O.DOMUtils.appendOrSelect(n,"line.top").attr("x1",-1).attr("x2",t+1),O.DOMUtils.appendOrSelect(n,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",s+1),O.DOMUtils.appendOrSelect(n,"line.down").attr("x1",-1).attr("x2",t+1).attr("y1",s).attr("y2",s),O.DOMUtils.appendOrSelect(n,"line.right").attr("x1",t).attr("x2",t).attr("y1",-1).attr("y2",s+1)}determineDividerStatus(){const e=c.getProperty(this.getOptions(),"heatmap","divider","state");return e!==r.DividerStatus.OFF&&(e===r.DividerStatus.AUTO&&c.heatmap.minCellDividerDimension<=this.xBandwidth&&c.heatmap.minCellDividerDimension<=this.yBandwidth||e===r.DividerStatus.ON)}addEventListener(){const e=this,{cartesianScales:t}=this.services,s=this.getOptions(),n=c.get(s,"tooltip.totalLabel"),a=t.getDomainIdentifier(),i=t.getRangeIdentifier(),o=t.getDomainLabel(),d=t.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(h,u){const m=y.select(this),p=m.select("rect.heat");if(!p.classed("null-state")){const v=c.getTransformOffsets(m.attr("transform"));e.parent.select("g.cell-highlight").attr("transform",`translate(${v.x+e.translationUnits.x}, ${v.y+e.translationUnits.y})`).classed("highlighter-hidden",!1),e.services.events.dispatchEvent(r.Events.Heatmap.HEATMAP_MOUSEOVER,{event:h,element:p,datum:u}),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:h,items:[{label:o,value:u[a]},{label:d,value:u[i]},{label:n||"Total",value:u.value,color:p.style("fill")}]})}}).on("mousemove",function(h,u){e.services.events.dispatchEvent(r.Events.Heatmap.HEATMAP_MOUSEMOVE,{event:h,element:y.select(this),datum:u}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:h})}).on("click",function(h,u){e.services.events.dispatchEvent(r.Events.Heatmap.HEATMAP_CLICK,{event:h,element:y.select(this),datum:u})}).on("mouseout",function(h,u){const p=y.select(this).select("rect.heat"),g=p.classed("null-state");e.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),g||(e.services.events.dispatchEvent(r.Events.Heatmap.HEATMAP_MOUSEOUT,{event:h,element:p,datum:u}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{event:h,hoveredElement:p}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleAxisOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class $a extends G{constructor(){super(...arguments),this.type="histogram",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,s=this.getOptions(),{groupMapsTo:n}=s.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-bar"})).attr("opacity",a=>a[n]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getComponentContainer(),s=this.model.getOptions(),{groupIdentifier:n}=s,{groupMapsTo:a}=s.data,i=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),d=t.selectAll("g.bars").data(i,u=>c.get(u,`0.${a}`));d.exit().attr("opacity",0).remove(),d.enter().append("g").classed("bars",!0).attr("role",B.Roles.GROUP);const h=t.selectAll("g.bars").selectAll("path.bar").data(u=>u);h.exit().remove(),h.enter().append("path").merge(h).classed("bar",!0).attr(n,(u,m)=>m).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:e})).attr("class",u=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:u[a],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[a])).attr("d",u=>{const m=c.get(u,"data");if(!m)return;const p=o(m.x1)-o(m.x0)-1,g=this.services.cartesianScales.getDomainValue(m.x0),v=g+p,f=this.services.cartesianScales.getRangeValue(u[0]);let b=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(b-f)>0&&Math.abs(b-f)>s.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===r.CartesianOrientations.VERTICAL?b+=1:b-=1),c.generateSVGPathString({x0:g,x1:v,y0:f,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>c.getProperty(u,"data",u[a])),this.addEventListeners()}addEventListeners(){const e=this.model.getOptions(),{groupMapsTo:t}=e.data,s=this;this.parent.selectAll("path.bar").on("mouseover",function(n,a){const i=y.select(this);i.classed("hovered",!0);const o=parseFloat(c.get(a,"data.x0")),d=parseFloat(c.get(a,"data.x1")),h=s.services.cartesianScales.getRangeAxisPosition(),u=s.services.cartesianScales.getScaleLabel(h);s.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:c.get(e,"bins.rangeLabel")||"Range",value:`${o} – ${d}`},{label:e.tooltip.groupLabel||"Group",value:a[t],class:s.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:a[t]})},{label:u,value:c.get(a,`data.${a[t]}`)}]})}).on("mousemove",function(n){s.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:n})}).on("mouseout",function(){y.select(this).classed("hovered",!1),s.services.events.dispatchEvent(r.Events.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Ha extends fe{constructor(){super(...arguments),this.type="lollipop",this.renderType=r.RenderTypes.SVG,this.handleScatterOnHover=e=>{const t=e.detail,s=this.getOptions(),{groupMapsTo:n}=s.data;this.parent.selectAll("line.line").attr("stroke-width",a=>a[n]!==t.datum[n]?c.lines.weight.unselected:c.lines.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",c.lines.weight.unselected)},this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,s=this.getOptions(),{groupMapsTo:n}=s.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-line"})).attr("opacity",a=>a[n]!==t.datum().name?c.lines.opacity.unselected:c.lines.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-line"})).attr("opacity",c.lines.opacity.selected)}}init(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getComponentContainer({withinChartClip:!0}),s=this.model.getOptions(),{groupMapsTo:n}=s.data,{cartesianScales:a}=this.services,i=a.getMainXScale(),o=a.getMainYScale(),d=a.getDomainIdentifier(),h=E=>a.getDomainValue(E),u=E=>a.getRangeValue(E),m=a.getOrientation(),[p,g]=c.flipDomainAndRangeBasedOnOrientation(h,u,m),v=t.selectAll("line.line").data(this.getScatterData(),E=>`${E[n]}-${E[d]}`);v.exit().attr("opacity",0).remove();const b=v.enter().append("line").attr("opacity",0).merge(v).classed("line",!0).attr("class",E=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:E[n],originalClassName:"line"})).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"lollipop-line-update-enter",animate:e})).style("stroke",E=>this.model.getFillColor(E[n],E[d],E)).attr("opacity",1);m===r.CartesianOrientations.HORIZONTAL?b.attr("y1",g).attr("y2",g).attr("x1",i.range()[0]).attr("x2",E=>p(E)-s.points.radius):b.attr("x1",p).attr("x2",p).attr("y1",o.range()[0]).attr("y2",E=>g(E)+s.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(r.Events.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(r.Events.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),e.removeEventListener(r.Events.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),e.removeEventListener(r.Events.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class za extends G{constructor(){super(...arguments),this.type="meter",this.renderType=r.RenderTypes.SVG}getStackedBounds(e,t){let s=0;return e.map((a,i)=>i!==0?(s+=t(a.value),{...a,width:Math.abs(t(a.value)-c.meter.dividerWidth),x:s-t(a.value)}):(s=t(a.value),{...a,width:Math.abs(t(a.value)-c.meter.dividerWidth),x:0}))}render(e=!0){const t=this,s=this.getComponentContainer(),n=this.getOptions(),a=c.getProperty(n,"meter","proportional"),i=this.model.getDisplayData(),o=this.model.getStatus(),{width:d}=O.DOMUtils.getSVGElementSize(s,{useAttrs:!0}),{groupMapsTo:h}=n.data;let u;if(c.getProperty(n,"meter","proportional")===null)u=100;else{const T=c.getProperty(n,"meter","proportional","total");u=T||this.model.getMaximumDomain(this.model.getDisplayData())}const m=y.scaleLinear().domain([0,u]).range([0,d]),p=this.getStackedBounds(i,m),g=c.getProperty(n,"meter","height");O.DOMUtils.appendOrSelect(s,"rect.container").attr("x",0).attr("y",0).attr("width",d).attr("height",g||(a?c.meter.height.proportional:c.meter.height.default)),O.DOMUtils.appendOrSelect(s,"line.rangeIndicator").attr("x1",d).attr("x2",d).attr("y1",0).attr("y2",g||(a?c.meter.height.proportional:c.meter.height.default));const v=s.selectAll("rect.value").data(p),f=o!=null&&!t.model.isUserProvidedColorScaleValid()&&!a?`value status--${o}`:"value";v.enter().append("rect").classed("value",!0).merge(v).attr("x",T=>T.x).attr("y",0).attr("height",()=>g||(a?c.meter.height.proportional:c.meter.height.default)).attr("class",T=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:T[h],originalClassName:f})).transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"meter-bar-update",animate:e})).attr("width",T=>T.value>u?m(u):T.width).style("fill",T=>t.model.getFillColor(T[h])).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",T=>T.value),v.exit().remove();const b=c.getProperty(n,"meter","peak");let E=b;b!==null&&(b>u?E=u:b<i[0].value&&(E=i[0].value>u?u:i[0].value));const S=s.selectAll("line.peak").data(E==null?[]:[E]);S.enter().append("line").classed("peak",!0).merge(S).attr("y1",0).attr("y2",()=>g||(a?c.meter.height.proportional:c.meter.height.default)).transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"peak-line-update",animate:e})).attr("x1",T=>m(T)).attr("x2",T=>m(T)).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",T=>T),S.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const e=this.getOptions(),{groupMapsTo:t}=e.data,s=this,n=c.getProperty(e,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(a,i){const o=y.select(this);s.services.events.dispatchEvent(r.Events.Meter.METER_MOUSEOVER,{event:a,element:o,datum:i}),n&&(o.classed("hovered",!0),s.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:a,hoveredElement:o,items:[{label:i[t],value:i.value}]}))}).on("mousemove",function(a,i){const o=y.select(this);s.services.events.dispatchEvent(r.Events.Meter.METER_MOUSEMOVE,{event:a,element:o,datum:i}),n&&s.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:a})}).on("click",function(a,i){s.services.events.dispatchEvent(r.Events.Meter.METER_CLICK,{event:a,element:y.select(this),datum:i})}).on("mouseout",function(a,i){const o=y.select(this);s.services.events.dispatchEvent(r.Events.Meter.METER_MOUSEOUT,{event:a,element:o,datum:i}),n&&(o.classed("hovered",!1),s.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class Fa extends G{constructor(){super(...arguments),this.type="radar",this.renderType=r.RenderTypes.SVG,this.getLabelDimensions=e=>{const t=O.DOMUtils.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),s=O.DOMUtils.appendOrSelect(t,"text").text(e),{width:n,height:a}=O.DOMUtils.getSVGElementSize(s.node(),{useBBox:!0});return t.remove(),{width:n,height:a}},this.normalizeFlatData=e=>{const t=this.getOptions(),{angle:s,value:n}=c.getProperty(t,"radar","axes"),a=c.getProperty(t,"data","groupMapsTo"),i=Rs(this.uniqueKeys.map(o=>this.uniqueGroups.map(d=>({[s]:o,[a]:d,[n]:null}))));return c.merge(i,e)},this.normalizeGroupedData=e=>{const t=this.getOptions(),{angle:s,value:n}=c.getProperty(t,"radar","axes"),a=c.getProperty(t,"data","groupMapsTo");return e.map(({name:i,data:o})=>{const d=this.uniqueKeys.map(h=>({[a]:i,[s]:h,[n]:null}));return{name:i,data:c.merge(d,o)}})},this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-blob"})).style("fill-opacity",s=>s.name!==t.datum().name?c.radar.opacity.unselected:c.radar.opacity.selected).style("stroke-opacity",s=>s.name!==t.datum().name?c.radar.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-blob"})).style("fill-opacity",c.radar.opacity.selected).style("stroke-opacity",1)}}init(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer(),{width:s,height:n}=O.DOMUtils.getSVGElementSize(t,{useAttrs:!0}),a=this.model.getData(),i=this.model.getGroupedData(),o=this.getOptions(),d=c.getProperty(o,"data","groupMapsTo"),h=c.getProperty(o,"radar","axes","value"),{angle:u,value:m}=c.getProperty(o,"radar","axes"),{xLabelPadding:p,yLabelPadding:g,yTicksNumber:v,minRange:f,xAxisRectHeight:b}=c.radar;this.uniqueKeys=Array.from(new Set(a.map(D=>D[u]))),this.uniqueGroups=Array.from(new Set(a.map(D=>D[d]))),this.fullDataNormalized=this.normalizeFlatData(a),this.groupedDataNormalized=this.normalizeGroupedData(i);const S=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+g),M=(Math.min(s,n)-S)/2;if(M<=0)return;const x=y.scaleBand().domain(this.fullDataNormalized.map(D=>D[u])).range([0,2*Math.PI].map(D=>D-Math.PI/2)),w=y.min(this.fullDataNormalized.map(D=>D[m])),P=y.scaleLinear().domain([w>=0?0:w,y.max(this.fullDataNormalized.map(D=>D[m]))]).range([f,M]).nice(v),$=P.ticks(v),_=D=>this.model.getFillColor(D),A=y.lineRadial().angle(D=>x(D[u])+Math.PI/2).radius(D=>P(D[m])).curve(y.curveLinearClosed),L=this.uniqueKeys.map(D=>{const R=this.getLabelDimensions(D).width,I=O.distanceBetweenPointOnCircAndVerticalDiameter(x(D),M);return R+I}),k={x:y.max(L)+p,y:n/2},q=O.DOMUtils.appendOrSelect(t,"g.y-axes").attr("role",B.Roles.GROUP).selectAll("path").data($,D=>D),H=D=>this.uniqueKeys.map(R=>({[u]:R,[m]:D}));q.join(D=>D.append("path").attr("opacity",0).attr("transform",`translate(${k.x}, ${k.y})`).attr("fill","none").call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_y_axes_enter",animate:e})).attr("opacity",1).attr("d",I=>A(H(I)))),D=>D.call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_y_axes_update",animate:e})).attr("opacity",1).attr("transform",`translate(${k.x}, ${k.y})`).attr("d",I=>A(H(I)))),D=>D.call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_y_axes_exit",animate:e})).attr("d",I=>A(H(I))).attr("opacity",0).remove())),O.DOMUtils.appendOrSelect(t,"g.x-axes").attr("role",B.Roles.GROUP).selectAll("line").data(this.uniqueKeys,D=>D).join(D=>D.append("line").attr("opacity",0).attr("class",R=>`x-axis-${J(R)}`).attr("stroke-dasharray","0").attr("x1",R=>O.polarToCartesianCoords(x(R),0,k).x).attr("y1",R=>O.polarToCartesianCoords(x(R),0,k).y).attr("x2",R=>O.polarToCartesianCoords(x(R),0,k).x).attr("y2",R=>O.polarToCartesianCoords(x(R),0,k).y).call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_x_axes_enter",animate:e})).attr("opacity",1).attr("x1",I=>O.polarToCartesianCoords(x(I),P.range()[0],k).x).attr("y1",I=>O.polarToCartesianCoords(x(I),P.range()[0],k).y).attr("x2",I=>O.polarToCartesianCoords(x(I),P.range()[1],k).x).attr("y2",I=>O.polarToCartesianCoords(x(I),P.range()[1],k).y)),D=>D.call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_x_axes_update",animate:e})).attr("opacity",1).attr("x1",I=>O.polarToCartesianCoords(x(I),P.range()[0],k).x).attr("y1",I=>O.polarToCartesianCoords(x(I),P.range()[0],k).y).attr("x2",I=>O.polarToCartesianCoords(x(I),P.range()[1],k).x).attr("y2",I=>O.polarToCartesianCoords(x(I),P.range()[1],k).y)),D=>D.call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_x_axes_exit",animate:e})).attr("opacity",0).remove())),O.DOMUtils.appendOrSelect(t,"g.x-labels").attr("role",B.Roles.GROUP).selectAll("text").data(this.uniqueKeys).join(D=>D.append("text").text(R=>R).attr("opacity",0).attr("x",R=>O.polarToCartesianCoords(x(R),P.range()[1]+p,k).x).attr("y",R=>O.polarToCartesianCoords(x(R),P.range()[1]+p,k).y).style("text-anchor",R=>O.radialLabelPlacement(x(R)).textAnchor).style("dominant-baseline",R=>O.radialLabelPlacement(x(R)).dominantBaseline).call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_x_labels_enter",animate:e})).attr("opacity",1)),D=>D.call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_x_labels_update",animate:e})).attr("opacity",1).attr("x",I=>O.polarToCartesianCoords(x(I),P.range()[1]+p,k).x).attr("y",I=>O.polarToCartesianCoords(x(I),P.range()[1]+p,k).y).end().finally(()=>{const I=c.getProperty(o,"radar","alignment"),K=this.getAlignmentXOffset(I,t,this.getParent());t.attr("x",K)})),D=>D.call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_x_labels_exit",animate:e})).attr("opacity",0).remove())),O.DOMUtils.appendOrSelect(t,"g.blobs").attr("role",B.Roles.GROUP).selectAll("path").data(this.groupedDataNormalized,D=>D.name).join(D=>D.append("path").attr("class",R=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],dataGroupName:R.name,originalClassName:"blob"})).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-label",R=>R.name).attr("opacity",0).attr("transform",e?()=>`translate(${k.x}, ${k.y}) scale(${1+Math.random()*.35})`:`translate(${k.x}, ${k.y})`).style("fill",R=>_(R.name)).style("fill-opacity",c.radar.opacity.selected).style("stroke",R=>_(R.name)).call(R=>{const I=R.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"radar_blobs_enter",animate:e}));e&&I.delay(()=>Math.random()*30).attr("transform",`translate(${k.x}, ${k.y})`),I.attr("opacity",1).attr("d",K=>A(K.data))}),D=>(D.attr("class",R=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],dataGroupName:R.name,originalClassName:"blob"})).style("fill",R=>_(R.name)).style("stroke",R=>_(R.name)),D.call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_blobs_update",animate:e})).attr("opacity",1).attr("transform",`translate(${k.x}, ${k.y})`).attr("d",I=>A(I.data))),D),D=>D.call(R=>{const I=R.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"radar_blobs_exit",animate:e}));e&&I.delay(()=>Math.random()*30).attr("transform",()=>`translate(${k.x}, ${k.y}) scale(${1+Math.random()*.35})`),I.attr("opacity",0).remove()})),O.DOMUtils.appendOrSelect(t,"g.dots").attr("role",B.Roles.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(D=>c.getProperty(D,m)!==null)).join(D=>D.append("circle").attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-label",R=>R[h]),D=>D,D=>D.remove()).attr("class",D=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:D[d],originalClassName:J(D[u])})).attr("cx",D=>O.polarToCartesianCoords(x(D[u]),P(D[m]),k).x).attr("cy",D=>O.polarToCartesianCoords(x(D[u]),P(D[m]),k).y).attr("r",0).attr("opacity",0).style("fill",D=>_(D[d])),O.DOMUtils.appendOrSelect(t,"g.x-axes-rect").attr("role",B.Roles.GROUP).selectAll("rect").data(this.uniqueKeys).join(D=>D.append("rect"),D=>D,D=>D.remove()).attr("x",k.x).attr("y",k.y-b/2).attr("width",P.range()[1]).attr("height",b).style("fill","red").style("fill-opacity",0).attr("transform",D=>`rotate(${O.radToDeg(x(D))}, ${k.x}, ${k.y})`),O.DOMUtils.appendOrSelect(t,"g.y-labels").attr("role",B.Roles.GROUP).selectAll("text").data(y.extent($)).join(D=>D.append("text").attr("opacity",0).text(R=>R).attr("x",R=>O.polarToCartesianCoords(-Math.PI/2,P(R),k).x+g).attr("y",R=>O.polarToCartesianCoords(-Math.PI/2,P(R),k).y).style("text-anchor","start").style("dominant-baseline","middle").call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_y_labels_enter",animate:e})).attr("opacity",1)),D=>D.call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_y_labels_update",animate:e})).text(I=>I).attr("opacity",1).attr("x",I=>O.polarToCartesianCoords(-Math.PI/2,P(I),k).x+g).attr("y",I=>O.polarToCartesianCoords(-Math.PI/2,P(I),k).y)),D=>D.call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_y_labels_exit",animate:e})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(e,t,s){const n=O.DOMUtils.getSVGElementSize(t,{useBBox:!0}),{width:a}=O.DOMUtils.getSVGElementSize(s,{useAttrs:!0});let i=0;return e===r.Alignments.CENTER?i=Math.floor((a-n.width)/2):e===r.Alignments.RIGHT&&(i=a-n.width),i}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const e=this,{axes:{angle:t}}=c.getProperty(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(s,n){const a=y.select(this);e.services.events.dispatchEvent(r.Events.Radar.X_AXIS_MOUSEOVER,{event:s,element:a,datum:n});const i=e.parent.select(`.x-axes .x-axis-${J(n)}`),o=e.parent.selectAll(`.dots circle.${J(n)}`),d=e.model.getActiveDataGroupNames(),h=e.getOptions(),{groupMapsTo:u}=h.data,m=c.getProperty(h,"radar","axes","value");i.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",g=>d.indexOf(g[u])!==-1?1:0).attr("r",c.radar.dotsRadius);const p=e.fullDataNormalized.filter(g=>g[t]===n&&d.indexOf(g[u])!==-1);e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:s,hoveredElement:a,items:p.filter(g=>typeof g[m]=="number").map(g=>({label:g[u],value:g[m],color:e.model.getFillColor(g[u]),class:e.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:g[u]})}))})}).on("mousemove",function(s,n){const a=y.select(this);e.services.events.dispatchEvent(r.Events.Radar.X_AXIS_MOUSEMOVE,{event:s,element:a,datum:n}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:s})}).on("click",function(s,n){e.services.events.dispatchEvent(r.Events.Radar.X_AXIS_CLICK,{event:s,element:y.select(this),datum:n})}).on("mouseout",function(s,n){const a=y.select(this),i=e.parent.select(`.x-axes .x-axis-${J(n)}`),o=e.parent.selectAll(`.dots circle.${J(n)}`);i.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),e.services.events.dispatchEvent(r.Events.Radar.X_AXIS_MOUSEOUT,{event:s,element:a,datum:n}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE)})}}class Wa extends ye{constructor(){super(...arguments),this.type="simple-bar",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-simple-bar"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getOptions(),{groupMapsTo:s}=t.data,n=this.getComponentContainer({withinChartClip:!0}),a=this.model.getDisplayData(this.configs.groups),i=this.services.cartesianScales.getOrientation(),o=n.selectAll("path.bar").data(a,h=>h[s]);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(h=>this.services.transitions.setupTransition({transition:h,name:"bar-update-enter",animate:e})).attr("class",h=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:h[s],originalClassName:"bar"})).style("fill",h=>this.model.getFillColor(h[s])).attr("d",h=>{const u=this.services.cartesianScales.getRangeIdentifier(),m=this.getBarWidth(),p=h[u],g=this.services.cartesianScales.getDomainValue(h)-m/2,v=g+m;let f,b;if(Array.isArray(p)&&p.length===2)f=this.services.cartesianScales.getRangeValue(p[0]),b=this.services.cartesianScales.getRangeValue(p[1]);else{const T=this.services.cartesianScales.getRangeScale().domain()[0];f=this.services.cartesianScales.getRangeValue(Math.max(0,T)),b=this.services.cartesianScales.getRangeValue(h)}const E=Math.abs(b-f);if(E!==0&&E<2&&(p>0&&i===r.CartesianOrientations.VERTICAL||p<0&&i===r.CartesianOrientations.HORIZONTAL?b=f-2:b=f+2),!this.isOutsideZoomedDomain(g,v))return c.generateSVGPathString({x0:g,x1:v,y0:f,y1:b},i)}).attr("opacity",1).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h.value),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("path.bar").on("mouseover",function(t,s){const n=y.select(this);n.classed("hovered",!0),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOVER,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,data:[s]})}).on("mousemove",function(t,s){e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEMOVE,{event:t,element:y.select(this),datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Bar.BAR_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class ja extends _t{constructor(){super(...arguments),this.type="skeleton-lines"}render(e=!0){const t=c.getProperty(this.getOptions(),"data","loading"),s=!c.getProperty(this.getOptions(),"grid","x","enabled")&&!c.getProperty(this.getOptions(),"grid","y","enabled")&&!c.getProperty(this.getOptions(),"axes","bottom","visible")&&!c.getProperty(this.getOptions(),"axes","left","visible");t&&!s?super.renderGridSkeleton(t):t&&s?this.renderSparklineSkeleton(t):this.removeSkeleton()}renderSparklineSkeleton(e){this.setScales(),this.drawBackdrop(e),this.drawSparkline(e),this.updateBackdropStyle(),e&&this.setShimmerEffect("shimmer-lines")}drawSparkline(e){const t=this.backdrop.attr("width"),s=[100],n=O.DOMUtils.appendOrSelect(this.backdrop,"g.y.skeleton"),a=n.selectAll("line").data(s);a.enter().append("line").merge(a).attr("x1",0).attr("x2",t).attr("y1",i=>i).attr("y2",i=>i),n.selectAll("line").classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const e=this.parent;this.backdrop=O.DOMUtils.appendOrSelect(e,"svg.chart-skeleton.DAII"),O.DOMUtils.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class Za extends G{constructor(){super(...arguments),this.type="area-stacked",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,s=this.getOptions(),{groupMapsTo:n}=s.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-area"})).attr("opacity",a=>c.getProperty(a,0,n)!==t.datum().name?c.area.opacity.unselected:c.area.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-area"})).attr("opacity",c.area.opacity.selected)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0}),s=this,n=this.getOptions(),{groupMapsTo:a}=n.data,i=Object.keys(n.axes).some(v=>n.axes[v].percentage),o=this.model.getStackedData({percentage:i,groups:this.configs.groups}),d=c.getProperty(o,0,0),h=this.services.cartesianScales.getDomainAxisPosition({datum:d}),u=this.services.cartesianScales.getRangeAxisPosition({datum:d}),m=this.services.cartesianScales.getScaleByPosition(u),p=t.selectAll("path.area").data(o,v=>c.getProperty(v,0,a));this.areaGenerator=y.area().x(v=>this.services.cartesianScales.getValueThroughAxisPosition(h,v.data.sharedStackKey)).y0(v=>m(v[0])).y1(v=>m(v[1])).curve(this.services.curves.getD3Curve()),p.exit().attr("opacity",0).remove(),p.enter().append("path").attr("opacity",0).merge(p).data(o,v=>c.getProperty(v,0,a)).attr("class","area").attr("class",v=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:c.getProperty(v,0,a),originalClassName:"area"})).style("fill",v=>s.model.getFillColor(c.getProperty(v,0,a))).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",v=>c.getProperty(v,0,a)).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"area-update-enter",animate:e})).attr("opacity",c.area.opacity.selected).attr("d",this.areaGenerator)}}class Xa extends ye{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-bar"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getComponentContainer({withinChartClip:!0}),s=this.getOptions(),{groupMapsTo:n}=s.data,a=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),i=this.model.getActiveDataGroupNames(),o=t.selectAll("g.bars").data(a,h=>c.getProperty(h,0,n));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",B.Roles.GROUP).attr("data-name","bars");const d=t.selectAll("g.bars").selectAll("path.bar").data(h=>h,h=>h.data.sharedStackKey);d.exit().remove(),d.enter().append("path").merge(d).classed("bar",!0).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-update-enter",animate:e})).attr("class",h=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:h[n],originalClassName:"bar"})).style("fill",h=>this.model.getFillColor(h[n])).attr("d",h=>{const u=h.data.sharedStackKey,m=this.getBarWidth(),p=this.services.cartesianScales.getDomainValue(u)-m/2,g=p+m,v=this.services.cartesianScales.getRangeValue(h[0]);let f=this.services.cartesianScales.getRangeValue(h[1]);if(!this.isOutsideZoomedDomain(p,g)){if(Math.abs(f-v)>0&&Math.abs(f-v)>s.bars.dividerSize){const b=h[0]<0&&h[1]<=0;b&&i.length>1?this.services.cartesianScales.getOrientation()===r.CartesianOrientations.VERTICAL?f+=h[1]===0?2:1:f-=1:b||(this.services.cartesianScales.getOrientation()===r.CartesianOrientations.VERTICAL?f+=1:f-=1)}return c.generateSVGPathString({x0:p,x1:g,y0:v,y1:f},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h[1]-h[0]),this.addEventListeners()}addEventListeners(){const e=this.getOptions(),{groupMapsTo:t}=e.data,s=this;this.parent.selectAll("path.bar").on("mouseover",function(n,a){const i=y.select(this);i.classed("hovered",!0),s.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:a});let d=s.model.getDisplayData(s.configs.groups).find(h=>{const u=s.services.cartesianScales.getDomainIdentifier(h),m=s.services.cartesianScales.getRangeIdentifier(h);return h[m]===a.data[a[t]]&&h[u].toString()===a.data.sharedStackKey&&h[t]===a[t]});if(d===void 0){const h=s.services.cartesianScales.getDomainIdentifier(),u=s.services.cartesianScales.getRangeIdentifier();d={[h]:a.data.sharedStackKey,[u]:a.data[a[t]],[t]:a[t]}}s.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:n,hoveredElement:i,data:[d]})}).on("mousemove",function(n,a){const i=y.select(this);s.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:a}),s.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:n})}).on("click",function(n,a){s.services.events.dispatchEvent(r.Events.Bar.BAR_CLICK,{event:n,element:y.select(this),datum:a})}).on("mouseout",function(n,a){const i=y.select(this);i.classed("hovered",!1),s.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:a}),s.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:i})})}getBarWidth(){const e=this.getOptions();if(c.getProperty(e,"bars","width"))return e.bars.width;const t=this.services.cartesianScales.getMainXScale(),s=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0}).width,n=this.model.getStackKeys().length,a=c.getProperty(e,"bars","spacingFactor");return t.step?Math.min(e.bars.maxWidth,t.step()/2):Math.min(e.bars.maxWidth,s*a/n)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class qa extends fe{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=r.RenderTypes.SVG}render(e){if(!c.getProperty(this.getOptions(),"points","enabled"))return;const s=this.getComponentContainer({withinChartClip:!0}),n=this.getOptions(),{groupMapsTo:a}=n.data,i=Object.keys(n.axes).some(g=>n.axes[g].percentage),o=this.model.getStackedData({groups:this.configs.groups,percentage:i}),d=s.selectAll("g.dots").data(o,g=>c.getProperty(g,0,a));d.exit().attr("opacity",0).remove();const u=d.enter().append("g").classed("dots",!0).attr("role",B.Roles.GROUP).merge(d).selectAll("circle.dot").data(g=>g);u.exit().attr("opacity",0).remove();const p=u.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(u).datum(g=>{const v=g[a],f=this.services.cartesianScales.getDomainIdentifier(g),b=this.services.cartesianScales.getRangeIdentifier(g);return{[a]:v,[f]:g.data.sharedStackKey,[b]:g[1]}});this.styleCircles(p,e),this.addEventListeners()}getTooltipData(e,t){const s=this.getOptions(),{groupMapsTo:n}=s.data,a=Object.keys(s.axes).some(d=>s.axes[d].percentage),i=this.model.getStackedData({groups:this.configs.groups,percentage:a}),o=[];return i.forEach((d,h)=>{d.forEach((u,m)=>{const p=u[n],g=u.data.sharedStackKey;let v=u.data[p];const f=u[1],b=this.services.cartesianScales.getDomainIdentifier(u),E=this.services.cartesianScales.getRangeIdentifier(u);v!=null&&e===this.services.cartesianScales.getDomainValue(g)&&t===this.services.cartesianScales.getRangeValue(f)&&(a&&(v=this.model.getStackedData({groups:this.configs.groups})[h][m].data[p]),v!==null&&o.push({[n]:p,[b]:g,[E]:v}))})}),this.model.getDisplayData(this.configs.groups).filter(d=>{const h=this.services.cartesianScales.getDomainIdentifier(d),u=this.services.cartesianScales.getRangeIdentifier(d);return o.find(m=>m[n]==d[n]&&m[h]==d[h]&&m[u]==d[u])!==void 0})}}const ee=6;class Ya extends G{constructor(){super(...arguments),this.type="tree",this.renderType=r.RenderTypes.SVG}getLongestLabel(e){let t="";return e.forEach(s=>{const n=s.children?this.getLongestLabel(s.children):"";(n.length>t.length||s.name.length>t.length)&&(t=n.length>s.name.length?n:s.name)}),t}getMockLabelWidth(e,t){const s=e.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(t),{width:n}=O.DOMUtils.getSVGElementSize(s.node(),{useBBox:!0});return s.remove(),n}render(e=!0){const t=this.getComponentContainer();t.html("");const{width:s,height:n}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});if(s<1||n<1)return;const a=this.model.getOptions(),i=this.model.getDisplayData(),o=c.getProperty(a,"tree","rootTitle")||"Tree",d=this.getMockLabelWidth(t,o),h=this.getLongestLabel(i),u=this.getMockLabelWidth(t,h),m={top:0,right:0,bottom:0,left:d>0?d+ee:30-ee},p=y.hierarchy({name:o,children:i}),g=10,v=s/6,f=x=>{const w=p.descendants().reverse(),P=p.links();let $=p,_=p;p.eachBefore(N=>{N.x<$.x&&($=N),N.x>_.x&&(_=N)});const A=_.x-$.x,L=t.transition().call(N=>this.services.transitions.setupTransition({transition:N,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-m.left,$.x,s,A].join(" ")),V=M.selectAll("g").data(w,N=>N.id),k=this,F=V.enter().append("g").attr("transform",()=>`translate(${x.y0},${x.x0})`).attr("class",N=>N.depth!==0&&N.children&&N.children.length>0?"clickable":null).on("mouseover",function(N,X){k.services.events.dispatchEvent(r.Events.Tree.NODE_MOUSEOVER,{event:N,element:y.select(this),datum:X})}).on("click",function(N,X){X.depth!==0&&(X.children=X.children?null:X._children,f(X)),k.services.events.dispatchEvent(r.Events.Tree.NODE_CLICK,{event:N,element:y.select(this),datum:X})}).on("mouseout",function(N,X){k.services.events.dispatchEvent(r.Events.Tree.NODE_MOUSEOUT,{event:N,element:y.select(this),datum:X})});F.append("circle").attr("r",2.5).attr("class",N=>N._children?"parent":"child").attr("stroke-width",10),F.append("text").attr("dy","0.31em").attr("x",N=>N._children?-ee:ee).attr("text-anchor",N=>N._children?"end":"start").text(N=>N.data.name).clone(!0).attr("class","text-stroke").lower(),V.merge(F).transition(L).attr("transform",N=>`translate(${N.y},${N.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),V.exit().transition(L).remove().attr("transform",()=>`translate(${x.y},${x.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const q=C.selectAll("path").data(P,N=>N.target.id),H=q.enter().append("path").attr("d",()=>{const N={x:x.x0,y:x.y0};return T({source:N,target:N})});q.merge(H).transition(L).attr("d",T),q.exit().transition(L).remove().attr("d",()=>{const N={x:x.x,y:x.y};return T({source:N,target:N})}),p.eachBefore(N=>{N.x0=N.x,N.y0=N.y})},b=p.descendants(),E=b[b.length-1].depth,S=c.getProperty(a,"tree","type")===r.TreeTypes.DENDROGRAM?y.cluster().size([n,s-u-E*ee-d]):y.tree().nodeSize([g,v]).size([n,s-u-E*ee-d]),T=y.linkHorizontal().x(x=>x.y).y(x=>x.x);p.x0=v/2,p.y0=0,p.descendants().forEach((x,w)=>{x.id=w,x._children=x.children}),S(p),t.attr("viewBox",[-m.left,-m.top,s,g]).style("user-select","none");const C=t.append("g").attr("class","links"),M=t.append("g").attr("class","nodes");f(p)}}var Ka="#000000",Ja="#ffffff",Qa="#fcf4d6",ei="#fddc69",ti="#f1c21b",si="#d2a106",ni="#b28600",ai="#8e6a00",ii="#684e00",ri="#483700",oi="#302400",li="#1c1500",ci={10:Qa,20:ei,30:ti,40:si,50:ni,60:ai,70:ii,80:ri,90:oi,100:li},di="#fff2e8",hi="#ffd9be",ui="#ffb784",pi="#ff832b",gi="#eb6200",mi="#ba4e00",vi="#8a3800",fi="#5e2900",yi="#3e1a00",Ei="#231000",Oi={10:di,20:hi,30:ui,40:pi,50:gi,60:mi,70:vi,80:fi,90:yi,100:Ei},bi="#fff1f1",Si="#ffd7d9",xi="#ffb3b8",Ti="#ff8389",Mi="#fa4d56",Ci="#da1e28",Li="#a2191f",Ai="#750e13",Di="#520408",wi="#2d0709",Pi={10:bi,20:Si,30:xi,40:Ti,50:Mi,60:Ci,70:Li,80:Ai,90:Di,100:wi},Ri="#fff0f7",ki="#ffd6e8",Ii="#ffafd2",_i="#ff7eb6",Ui="#ee5396",Vi="#d02670",Ni="#9f1853",Bi="#740937",Gi="#510224",$i="#2a0a18",Hi={10:Ri,20:ki,30:Ii,40:_i,50:Ui,60:Vi,70:Ni,80:Bi,90:Gi,100:$i},zi="#f6f2ff",Fi="#e8daff",Wi="#d4bbff",ji="#be95ff",Zi="#a56eff",Xi="#8a3ffc",qi="#6929c4",Yi="#491d8b",Ki="#31135e",Ji="#1c0f30",Qi={10:zi,20:Fi,30:Wi,40:ji,50:Zi,60:Xi,70:qi,80:Yi,90:Ki,100:Ji},er="#edf5ff",tr="#d0e2ff",sr="#a6c8ff",nr="#78a9ff",ar="#4589ff",ir="#0f62fe",rr="#0043ce",or="#002d9c",lr="#001d6c",cr="#001141",dr={10:er,20:tr,30:sr,40:nr,50:ar,60:ir,70:rr,80:or,90:lr,100:cr},hr="#e5f6ff",ur="#bae6ff",pr="#82cfff",gr="#33b1ff",mr="#1192e8",vr="#0072c3",fr="#00539a",yr="#003a6d",Er="#012749",Or="#061727",br={10:hr,20:ur,30:pr,40:gr,50:mr,60:vr,70:fr,80:yr,90:Er,100:Or},Sr="#d9fbfb",xr="#9ef0f0",Tr="#3ddbd9",Mr="#08bdba",Cr="#009d9a",Lr="#007d79",Ar="#005d5d",Dr="#004144",wr="#022b30",Pr="#081a1c",Rr={10:Sr,20:xr,30:Tr,40:Mr,50:Cr,60:Lr,70:Ar,80:Dr,90:wr,100:Pr},kr="#defbe6",Ir="#a7f0ba",_r="#6fdc8c",Ur="#42be65",Vr="#24a148",Nr="#198038",Br="#0e6027",Gr="#044317",$r="#022d0d",Hr="#071908",zr={10:kr,20:Ir,30:_r,40:Ur,50:Vr,60:Nr,70:Br,80:Gr,90:$r,100:Hr},Fr="#f2f4f8",Wr="#dde1e6",jr="#c1c7cd",Zr="#a2a9b0",Xr="#878d96",qr="#697077",Yr="#4d5358",Kr="#343a3f",Jr="#21272a",Qr="#121619",eo={10:Fr,20:Wr,30:jr,40:Zr,50:Xr,60:qr,70:Yr,80:Kr,90:Jr,100:Qr},to="#f4f4f4",so="#e0e0e0",no="#c6c6c6",ao="#a8a8a8",io="#8d8d8d",ro="#6f6f6f",oo="#525252",lo="#393939",co="#262626",ho="#161616",uo={10:to,20:so,30:no,40:ao,50:io,60:ro,70:oo,80:lo,90:co,100:ho},po="#f7f3f2",go="#e5e0df",mo="#cac5c4",vo="#ada8a8",fo="#8f8b8b",yo="#726e6e",Eo="#565151",Oo="#3c3838",bo="#272525",So="#171414",xo={10:po,20:go,30:mo,40:vo,50:fo,60:yo,70:Eo,80:Oo,90:bo,100:So},lt={black:{100:Ka},blue:dr,coolGray:eo,cyan:br,gray:uo,green:zr,magenta:Hi,orange:Oi,purple:Qi,red:Pi,teal:Rr,warmGray:xo,white:{0:Ja},yellow:ci};const To=l=>{if(!l)return null;for(const e of Object.keys(lt)){const t=lt[e];for(const s of Object.keys(t))if(t[+s]===l)return s}return null},ct=function(){const l=y.select(this.parentNode).select("rect.leaf"),e=getComputedStyle(l.node(),null).getPropertyValue("fill"),t=y.color(e);let s;if(t&&(s=To(t?t.hex():null)),s==null){const n=y.hsl(t).l;s=Math.abs(n*100-100)}return s>50?"white":"black"};let Mo=0;class Co extends G{constructor(){super(...arguments),this.type="treemap",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-treemap"})).attr("opacity",s=>s.parent.data.name===t.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer();this.model.getData();const s=this.model.getDisplayData(),n=this.model.getOptions(),a=c.getProperty(window,"location"),{width:i,height:o}=O.DOMUtils.getSVGElementSize(t,{useAttrs:!0}),d=y.hierarchy({name:n.title||"Treemap",children:s}).sum(f=>f.value).sort((f,b)=>b.value-f.value),h=y.treemap().size([i,o]).paddingInner(1).paddingOuter(0).round(!0)(d),u=t.selectAll("g[data-name='leaf']").data(h.leaves(),f=>f.data.name);u.exit().attr("opacity",0).remove();const p=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>Mo++).merge(u);p.attr("data-name","leaf").transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"treemap-group-update",animate:e})).attr("transform",f=>`translate(${f.x0},${f.y0})`);const g=p.selectAll("rect.leaf").data(f=>[f]);g.exit().attr("width",0).attr("height",0).remove(),g.enter().append("rect").classed("leaf",!0).merge(g).attr("width",0).attr("height",0).attr("id",function(){const f=y.select(this.parentNode).attr("data-uid");return`${n.style.prefix}-leaf-${f}`}).attr("class",f=>{for(;f.depth>1;)f=f.parent;return this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:f.data.name,originalClassName:"leaf"})}).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"treemap-leaf-update-enter",animate:e})).attr("width",f=>f.x1-f.x0).attr("height",f=>f.y1-f.y0).style("fill",f=>{for(;f.depth>1;)f=f.parent;return this.model.getFillColor(f.data.name)}),p.selectAll("clipPath").data(f=>f.data.showLabel!==!0?[]:[1],f=>f).join(f=>f.append("clipPath").attr("id",function(){const b=y.select(this.parentNode).attr("data-uid");return`${n.style.prefix}-clip-${b}`}).append("use").attr("xlink:href",function(){const b=y.select(this.parentNode.parentNode).attr("data-uid"),E=`${n.style.prefix}-leaf-${b}`;return new URL(`#${E}`,a)+""}),f=>null,f=>f.remove()),p.selectAll("text").data(f=>{if(f.data.showLabel!==!0)return[];let b=f;for(;b.depth>1;)b=b.parent;const E=y.hsl(this.model.getFillColor(b.data.name));return[{text:f.data.name,color:E.l<.5?"white":"black"}]},f=>f).join(f=>{const b=f.append("text").text(E=>E.text).style("fill",ct).attr("x",7).attr("y",18);return a&&b.attr("clip-path",function(){const E=y.select(this.parentNode).attr("data-uid"),S=`${n.style.prefix}-clip-${E}`;return`url(${new URL(`#${S}`,a)+""})`}),b},f=>f.text(b=>b.text).style("fill",ct),f=>f.remove()),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("rect.leaf").on("mouseover",function(t,s){const n=y.select(this);let a=getComputedStyle(this,null).getPropertyValue("fill"),i=s;for(;i.depth>1;)i=i.parent;n.transition("graph_element_mouseover_fill_update").call(o=>e.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const d=e.model.getFillColor(o.parent.data.name);return d&&(a=d),y.color(a).darker(.7).toString()}),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,items:[{color:a,label:i.data.name,bold:!0},{label:s.data.name,value:s.data.value}]}),e.services.events.dispatchEvent(r.Events.Treemap.LEAF_MOUSEOVER,{event:t,element:n,datum:s})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Treemap.LEAF_MOUSEMOVE,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Treemap.LEAF_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1);let a=s;for(;a.depth>1;)a=a.parent;n.transition().call(i=>e.services.transitions.setupTransition({transition:i,name:"graph_element_mouseout_fill_update"})).style("fill",i=>e.model.getFillColor(i.parent.data.name)),e.services.events.dispatchEvent(r.Events.Treemap.LEAF_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})})}}class Lo extends G{constructor(){super(...arguments),this.type="wordcloud",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-wordcloud"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this,s=this.getComponentContainer().attr("width","100%").attr("height","100%"),n=this.model.getDisplayData(),a=this.getFontSizeScale(n),i=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:d}=i.wordCloud,{groupMapsTo:h}=i.data,{width:u,height:m}=O.DOMUtils.getSVGElementSize(s,{useAttrs:!0});if(u===0||m===0)return;const p=Nt().size([u,m]).words(n.map(function(v){const f=v[o];if(typeof v[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[h]:v[h],text:v[d],size:f,value:f}})).padding(5).rotate(0).fontSize(v=>a(v.size)).on("end",g);p.start();function g(v){const f=O.DOMUtils.appendOrSelect(s,"g.words");f.attr("transform",`translate(${p.size()[0]/2}, ${p.size()[1]/2})`);const b=f.selectAll("text").data(v,S=>`${S[h]}-${S.text}`);b.exit().attr("opacity",0).remove(),b.enter().append("text").attr("opacity",0).merge(b).style("font-size",S=>`${S.size}px`).text(function(S){return S.text}).attr("class",S=>t.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:S[h],originalClassName:`word ${S.size>32?"light":""}`})).style("fill",S=>t.model.getFillColor(S[h],S.text,S)).attr("text-anchor","middle").transition().call(S=>t.services.transitions.setupTransition({transition:S,name:"wordcloud-text-update-enter",animate:e})).attr("transform",S=>`translate(${S.x}, ${S.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(e){const t=this.getOptions(),{fontSizeMapsTo:s}=t.wordCloud,n=e.map(d=>d[s]).filter(d=>d),a=O.DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer()),i=n.length>0,o=i?y.extent(n):[1,1];return y.scaleLinear().domain(o).range(i?t.wordCloud.fontSizeRange(a,e):[4,4])}addEventListeners(){const e=this.getOptions(),{groupMapsTo:t}=e.data,s=this,n=O.debounce(a=>{const i=s.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>s.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));a===null?i.attr("opacity",1):i.attr("opacity",function(){return a===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(a,i){const o=this;n(o),s.services.events.dispatchEvent(r.Events.WordCloud.WORD_MOUSEOVER,{event:a,element:y.select(this),datum:i}),s.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:a,hoveredElement:o,items:[{label:e.tooltip.wordLabel,value:i.text},{label:e.tooltip.valueLabel,value:i.value},{label:e.tooltip.groupLabel,value:i[t],class:s.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:i[t]})}]})}).on("mousemove",function(a,i){const o=y.select(this);s.services.events.dispatchEvent(r.Events.WordCloud.WORD_MOUSEMOVE,{element:o,datum:i}),s.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:a})}).on("click",function(a,i){s.services.events.dispatchEvent(r.Events.WordCloud.WORD_CLICK,{event:a,element:y.select(this),datum:i})}).on("mouseout",function(a,i){const o=y.select(this);n(null),s.services.events.dispatchEvent(r.Events.WordCloud.WORD_MOUSEOUT,{event:a,element:o,datum:i}),s.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:o})})}}class Vt extends G{constructor(){super(...arguments),this.type="geo",this.renderType=r.RenderTypes.SVG}render(){const e=this.getComponentContainer({withinChartClip:!0}),{width:t,height:s}=O.DOMUtils.getSVGElementSize(e,{useAttrs:!0});if(t<1||s<1)return;const n=this.getProjection(),a=c.getProperty(this.getOptions(),"geoData"),i=this.model.getCombinedData(),o={},d={};Object.keys(i).forEach(E=>{typeof i[E].value=="number"?o[E]=i[E]:d[E]=i[E]});const h=Oa(a,Object.values(d)),u=fa(a,{type:"GeometryCollection",geometries:Object.values(o)}),m=n.fitSize([t,s],u),p=y.geoPath().projection(m);O.DOMUtils.appendOrSelect(e,"g.geo").selectAll("path").data(u.features).join("path").attr("d",p);const v=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),f=O.DOMUtils.appendOrSelect(e,"defs");O.DOMUtils.appendOrSelect(f,"pattern").attr("id",v).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",y.line()([[0,0],[0,10]]));const b=O.DOMUtils.appendOrSelect(e,"g.missing-data");O.DOMUtils.appendOrSelect(b,"path").datum(h).attr("d",p).style("fill",`url(#${v})`)}getProjection(){let e=null;switch(c.getProperty(this.getOptions(),"thematic","projection")){case r.Projection.geoEqualEarth:e=y.geoEqualEarth();break;case r.Projection.geoAlbers:e=y.geoAlbers();break;case r.Projection.geoConicEqualArea:e=y.geoConicEqualArea();break;case r.Projection.geoConicEquidistant:e=y.geoConicEquidistant();break;case r.Projection.geoEquirectangular:e=y.geoEquirectangular();break;case r.Projection.geoMercator:e=y.geoMercator();break;case r.Projection.geoNaturalEarth1:e=y.geoNaturalEarth1();break;default:throw new Error("Projection is not supported.")}return e}}class Ao extends Vt{constructor(){super(...arguments),this.type="choropleth"}render(e=!0){super.render();const t=this.model.getCombinedData();this.getComponentContainer({withinChartClip:!0}).select("g.geo").selectAll("path").classed("border",!0).attr("class",a=>this.model.getColorClassName({value:t[a.properties.NAME].value,originalClassName:"border"})),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const e=this,t=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(s,n){const a=y.select(this);e.services.events.dispatchEvent(r.Choropleth.CHOROPLETH_MOUSEOVER,{event:s,element:a,datum:t[n.properties.NAME]}),e.services.events.dispatchEvent(r.Tooltip.SHOW,{event:s,hoveredElement:a,items:[{label:n.properties.NAME,value:t[n.properties.NAME].value}]})}).on("mousemove",function(s,n){e.services.events.dispatchEvent(r.Choropleth.CHOROPLETH_MOUSEMOVE,{event:s,element:y.select(this),datum:t[n.properties.NAME]}),e.services.events.dispatchEvent(r.Tooltip.MOVE,{event:s})}).on("click",function(s,n){e.services.events.dispatchEvent(r.Choropleth.CHOROPLETH_CLICK,{event:s,element:y.select(this),datum:t[n.properties.NAME]})}).on("mouseout",function(s,n){const a=y.select(this);e.services.events.dispatchEvent(r.Choropleth.CHOROPLETH_MOUSEOUT,{event:s,element:a,datum:t[n.properties.NAME]}),e.services.events.dispatchEvent(r.Tooltip.HIDE,{event:s,hoveredElement:a})})}}exports.Alluvial=aa;exports.Area=ra;exports.Axis=$e;exports.AxisChartsTooltip=na;exports.Bar=ye;exports.BinnedRuler=Sa;exports.Boxplot=da;exports.Bubble=ua;exports.Bullet=pa;exports.CanvasChartClip=Qn;exports.ChartBrush=Be;exports.ChartClip=Rt;exports.Choropleth=Ao;exports.CirclePack=_a;exports.ColorScaleLegend=ka;exports.Component=G;exports.Donut=Va;exports.Gauge=Na;exports.GeoProjection=Vt;exports.Grid=ia;exports.GroupedBar=Ba;exports.Heatmap=Ga;exports.Highlight=sa;exports.Histogram=$a;exports.HoverAxis=It;exports.LayoutComponent=xe;exports.Legend=Pt;exports.Line=oa;exports.Lollipop=Ha;exports.Meter=za;exports.MeterTitle=Ia;exports.Modal=Jn;exports.Pie=Ut;exports.Radar=Fa;exports.Ruler=Ge;exports.Scatter=fe;exports.SimpleBar=Wa;exports.Skeleton=_t;exports.SkeletonLines=ja;exports.Spacer=Us;exports.StackedArea=Za;exports.StackedBar=Xa;exports.StackedRuler=xa;exports.StackedScatter=qa;exports.Threshold=ta;exports.Title=wt;exports.Toolbar=Se;exports.Tooltip=kt;exports.Tree=Ya;exports.Treemap=Co;exports.TwoDimensionalAxes=ca;exports.WordCloud=Lo;exports.ZeroLine=ha;exports.ZoomBar=ea;exports.arrowLeft=La;exports.arrowRight=Aa;exports.buildBezierPathString=Ca;exports.buildElbowPathString=Ma;exports.buildStraightPathString=Ta;exports.circle=Da;exports.createCompounder=Tt;exports.diamond=wa;exports.square=Pa;exports.tee=Ra;
82
- //# sourceMappingURL=choropleth-16598e45.js.map
82
+ //# sourceMappingURL=choropleth-161e9be8.js.map