apexcharts 8.2.0 → 8.3.1

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 (256) hide show
  1. package/README.md +7 -7
  2. package/dist/apexcharts.common.js +2 -2
  3. package/dist/apexcharts.core.js +19793 -19713
  4. package/dist/apexcharts.core.min.js +2 -2
  5. package/dist/apexcharts.css +38 -8
  6. package/dist/apexcharts.esm.js +1882 -1625
  7. package/dist/apexcharts.full.js +22044 -21634
  8. package/dist/apexcharts.full.min.js +2 -2
  9. package/dist/apexcharts.js +21414 -21124
  10. package/dist/apexcharts.min.js +2 -2
  11. package/dist/apexcharts.ssr.common.js +2 -2
  12. package/dist/apexcharts.ssr.esm.js +21413 -21123
  13. package/dist/area.common.js +2 -2
  14. package/dist/area.esm.js +91 -40
  15. package/dist/bar.common.js +2 -2
  16. package/dist/bar.esm.js +478 -406
  17. package/dist/bar.js +2 -2
  18. package/dist/boxPlot.common.js +2 -2
  19. package/dist/boxPlot.esm.js +409 -334
  20. package/dist/bubble.common.js +2 -2
  21. package/dist/bubble.esm.js +91 -40
  22. package/dist/candlestick.common.js +2 -2
  23. package/dist/candlestick.esm.js +409 -334
  24. package/dist/candlestick.js +2 -2
  25. package/dist/column.common.js +2 -2
  26. package/dist/column.esm.js +478 -406
  27. package/dist/core.common.js +2 -2
  28. package/dist/core.esm.js +19793 -19713
  29. package/dist/donut.common.js +2 -2
  30. package/dist/donut.esm.js +3 -9
  31. package/dist/dumbbell.common.js +2 -2
  32. package/dist/dumbbell.esm.js +478 -406
  33. package/dist/features/all.common.js +2 -2
  34. package/dist/features/all.esm.js +442 -324
  35. package/dist/features/annotations.common.js +2 -2
  36. package/dist/features/annotations.esm.js +65 -48
  37. package/dist/features/annotations.js +2 -2
  38. package/dist/features/context-menu.common.js +1 -1
  39. package/dist/features/context-menu.esm.js +1 -1
  40. package/dist/features/context-menu.js +1 -1
  41. package/dist/features/drilldown.common.js +2 -2
  42. package/dist/features/drilldown.esm.js +4 -2
  43. package/dist/features/drilldown.js +2 -2
  44. package/dist/features/dumbbell.common.js +1 -1
  45. package/dist/features/dumbbell.esm.js +1 -1
  46. package/dist/features/dumbbell.js +1 -1
  47. package/dist/features/exports.common.js +2 -2
  48. package/dist/features/exports.esm.js +10 -4
  49. package/dist/features/exports.js +2 -2
  50. package/dist/features/facet.common.js +1 -1
  51. package/dist/features/facet.esm.js +1 -1
  52. package/dist/features/facet.js +1 -1
  53. package/dist/features/highlight-filter.common.js +2 -2
  54. package/dist/features/highlight-filter.esm.js +14 -9
  55. package/dist/features/highlight-filter.js +2 -2
  56. package/dist/features/history.common.js +1 -1
  57. package/dist/features/history.esm.js +1 -1
  58. package/dist/features/history.js +1 -1
  59. package/dist/features/ink.common.js +1 -1
  60. package/dist/features/ink.esm.js +1 -1
  61. package/dist/features/ink.js +1 -1
  62. package/dist/features/keyboard.common.js +2 -2
  63. package/dist/features/keyboard.esm.js +97 -145
  64. package/dist/features/keyboard.js +2 -2
  65. package/dist/features/legend.common.js +2 -2
  66. package/dist/features/legend.esm.js +64 -44
  67. package/dist/features/legend.js +2 -2
  68. package/dist/features/link.common.js +1 -1
  69. package/dist/features/link.esm.js +1 -1
  70. package/dist/features/link.js +1 -1
  71. package/dist/features/marks.common.js +1 -1
  72. package/dist/features/marks.esm.js +1 -1
  73. package/dist/features/marks.js +1 -1
  74. package/dist/features/measure.common.js +1 -1
  75. package/dist/features/measure.esm.js +1 -1
  76. package/dist/features/measure.js +1 -1
  77. package/dist/features/morph.common.js +2 -2
  78. package/dist/features/morph.esm.js +9 -5
  79. package/dist/features/morph.js +2 -2
  80. package/dist/features/perspectives.common.js +2 -2
  81. package/dist/features/perspectives.esm.js +4 -1
  82. package/dist/features/perspectives.js +2 -2
  83. package/dist/features/raincloud.common.js +2 -2
  84. package/dist/features/raincloud.esm.js +26 -27
  85. package/dist/features/raincloud.js +2 -2
  86. package/dist/features/renderer-canvas.common.js +2 -2
  87. package/dist/features/renderer-canvas.esm.js +2 -1
  88. package/dist/features/renderer-canvas.js +2 -2
  89. package/dist/features/stats.common.js +2 -2
  90. package/dist/features/stats.esm.js +52 -59
  91. package/dist/features/stats.js +2 -2
  92. package/dist/features/storyboard.common.js +2 -2
  93. package/dist/features/storyboard.esm.js +4 -1
  94. package/dist/features/storyboard.js +2 -2
  95. package/dist/features/streamgraph.common.js +2 -2
  96. package/dist/features/streamgraph.esm.js +48 -14
  97. package/dist/features/streamgraph.js +2 -2
  98. package/dist/features/toolbar.common.js +2 -2
  99. package/dist/features/toolbar.esm.js +148 -18
  100. package/dist/features/toolbar.js +2 -2
  101. package/dist/features/trellis.common.js +2 -2
  102. package/dist/features/trellis.esm.js +150 -63
  103. package/dist/features/trellis.js +2 -2
  104. package/dist/features/waterfall.common.js +1 -1
  105. package/dist/features/waterfall.esm.js +1 -1
  106. package/dist/features/waterfall.js +1 -1
  107. package/dist/features/weave.common.js +2 -2
  108. package/dist/features/weave.esm.js +13 -12
  109. package/dist/features/weave.js +2 -2
  110. package/dist/full.common.js +2 -2
  111. package/dist/full.esm.js +1068 -842
  112. package/dist/heatmap.common.js +2 -2
  113. package/dist/heatmap.esm.js +3 -17
  114. package/dist/heatmap.js +2 -2
  115. package/dist/histogram.common.js +2 -2
  116. package/dist/histogram.esm.js +529 -464
  117. package/dist/icicle.common.js +2 -2
  118. package/dist/icicle.esm.js +80 -46
  119. package/dist/icicle.js +2 -2
  120. package/dist/line.common.js +2 -2
  121. package/dist/line.esm.js +91 -40
  122. package/dist/line.js +2 -2
  123. package/dist/locales/en.json +2 -1
  124. package/dist/locales/ro.json +3 -2
  125. package/dist/pictograms.common.js +1 -1
  126. package/dist/pictograms.esm.js +1 -1
  127. package/dist/pictograms.js +1 -1
  128. package/dist/pie.common.js +2 -2
  129. package/dist/pie.esm.js +3 -9
  130. package/dist/pie.js +2 -2
  131. package/dist/polarArea.common.js +2 -2
  132. package/dist/polarArea.esm.js +3 -9
  133. package/dist/radar.common.js +2 -2
  134. package/dist/radar.esm.js +5 -4
  135. package/dist/radar.js +2 -2
  136. package/dist/radialBar.common.js +2 -2
  137. package/dist/radialBar.esm.js +5 -12
  138. package/dist/radialBar.js +2 -2
  139. package/dist/raincloud.common.js +2 -2
  140. package/dist/raincloud.esm.js +97 -52
  141. package/dist/rangeArea.common.js +2 -2
  142. package/dist/rangeArea.esm.js +91 -40
  143. package/dist/rangeBar.common.js +2 -2
  144. package/dist/rangeBar.esm.js +478 -406
  145. package/dist/scatter.common.js +2 -2
  146. package/dist/scatter.esm.js +91 -40
  147. package/dist/streamgraph.common.js +2 -2
  148. package/dist/streamgraph.esm.js +138 -53
  149. package/dist/sunburst.common.js +2 -2
  150. package/dist/sunburst.esm.js +116 -94
  151. package/dist/sunburst.js +2 -2
  152. package/dist/treemap.common.js +2 -2
  153. package/dist/treemap.esm.js +138 -104
  154. package/dist/treemap.js +2 -2
  155. package/dist/unit-shapes.common.js +1 -1
  156. package/dist/unit-shapes.esm.js +1 -1
  157. package/dist/unit-shapes.js +1 -1
  158. package/dist/unit.common.js +2 -2
  159. package/dist/unit.esm.js +280 -202
  160. package/dist/unit.js +2 -2
  161. package/dist/violin.common.js +2 -2
  162. package/dist/violin.esm.js +72 -26
  163. package/dist/violin.js +2 -2
  164. package/dist/waterfall.common.js +2 -2
  165. package/dist/waterfall.esm.js +477 -405
  166. package/package.json +1 -1
  167. package/src/apexcharts.js +40 -59
  168. package/src/assets/apexcharts.css +38 -8
  169. package/src/charts/Bar.js +62 -55
  170. package/src/charts/BarStacked.js +80 -88
  171. package/src/charts/BoxCandleStick.js +28 -31
  172. package/src/charts/Icicle.js +68 -47
  173. package/src/charts/Line.js +118 -42
  174. package/src/charts/Pie.js +2 -8
  175. package/src/charts/Radar.js +5 -7
  176. package/src/charts/Radial.js +2 -6
  177. package/src/charts/RangeBar.js +47 -43
  178. package/src/charts/Sunburst.js +101 -98
  179. package/src/charts/Treemap.js +150 -88
  180. package/src/charts/Unit.js +368 -250
  181. package/src/charts/Violin.js +48 -30
  182. package/src/charts/common/Breadcrumb.js +2 -2
  183. package/src/charts/common/Hierarchy.js +32 -11
  184. package/src/charts/common/Jitter.js +32 -7
  185. package/src/charts/common/Stats.js +30 -23
  186. package/src/charts/common/bar/DataLabels.js +76 -81
  187. package/src/charts/common/bar/Helpers.js +43 -7
  188. package/src/charts/common/line/Helpers.js +12 -15
  189. package/src/charts/common/partition/NodeTooltip.js +29 -7
  190. package/src/charts/common/partition/Partition.js +33 -1
  191. package/src/charts/common/treemap/Helpers.js +3 -11
  192. package/src/charts/common/treemap/Nested.js +2 -3
  193. package/src/features/raincloud.js +16 -10
  194. package/src/features/stats.js +67 -62
  195. package/src/locales/en.json +2 -1
  196. package/src/locales/ro.json +3 -2
  197. package/src/modules/Animations.js +102 -95
  198. package/src/modules/AxisMapping.js +47 -12
  199. package/src/modules/Core.js +4 -0
  200. package/src/modules/CoreUtils.js +18 -42
  201. package/src/modules/Data.js +23 -24
  202. package/src/modules/DataLabels.js +6 -6
  203. package/src/modules/Exports.js +12 -5
  204. package/src/modules/Fill.js +17 -8
  205. package/src/modules/Filters.js +50 -50
  206. package/src/modules/Graphics.js +69 -51
  207. package/src/modules/Markers.js +3 -1
  208. package/src/modules/MorphTypeChange.js +13 -7
  209. package/src/modules/Range.js +44 -29
  210. package/src/modules/RendererController.js +17 -3
  211. package/src/modules/Scales.js +32 -9
  212. package/src/modules/Series.js +41 -19
  213. package/src/modules/Theme.js +1 -1
  214. package/src/modules/Toolbar.js +3 -2
  215. package/src/modules/UnitMarkRegistry.js +0 -5
  216. package/src/modules/ZoomPanSelection.js +123 -2
  217. package/src/modules/accessibility/KeyboardNavigation.js +114 -186
  218. package/src/modules/animations/Easing.js +2 -1
  219. package/src/modules/animations/LengthTransition.js +22 -2
  220. package/src/modules/annotations/Helpers.js +68 -52
  221. package/src/modules/axes/Grid.js +21 -7
  222. package/src/modules/axes/YAxis.js +8 -9
  223. package/src/modules/dimensions/Dimensions.js +9 -3
  224. package/src/modules/dimensions/Grid.js +2 -2
  225. package/src/modules/dimensions/XAxis.js +2 -5
  226. package/src/modules/drilldown/Breadcrumb.js +5 -2
  227. package/src/modules/helpers/Destroy.js +1 -1
  228. package/src/modules/helpers/UpdateHelpers.js +33 -15
  229. package/src/modules/highlightFilter/HighlightFilter.js +8 -9
  230. package/src/modules/highlightFilter/TreemapPart.js +2 -2
  231. package/src/modules/legend/HeatmapGradientLegend.js +76 -45
  232. package/src/modules/legend/Helpers.js +8 -1
  233. package/src/modules/legend/Legend.js +11 -12
  234. package/src/modules/license/LicenseEnforcer.js +5 -0
  235. package/src/modules/settings/Defaults.js +28 -56
  236. package/src/modules/settings/Globals.js +5 -0
  237. package/src/modules/settings/Options.js +7 -7
  238. package/src/modules/settings/TypeAliases.js +33 -16
  239. package/src/modules/streamgraph/StreamLabels.js +1 -0
  240. package/src/modules/tooltip/Labels.js +73 -76
  241. package/src/modules/tooltip/Marker.js +25 -21
  242. package/src/modules/tooltip/Position.js +88 -51
  243. package/src/modules/tooltip/Tooltip.js +242 -255
  244. package/src/modules/tooltip/Utils.js +71 -130
  245. package/src/modules/tooltip/constants.js +5 -5
  246. package/src/modules/trellis/Trellis.js +6 -0
  247. package/src/modules/trellis/TrellisChrome.js +18 -7
  248. package/src/modules/trellis/TrellisSync.js +2 -0
  249. package/src/modules/trellis/TrellisTooltip.js +2 -11
  250. package/src/modules/weave/WeaveHost.js +18 -12
  251. package/src/renderers/canvas/CanvasGraphics.js +1 -0
  252. package/src/ssr/DOMShim.js +10 -0
  253. package/src/svg/SVGFilter.js +26 -17
  254. package/src/types/internal.d.ts +9 -3
  255. package/src/utils/Utils.js +0 -14
  256. package/types/apexcharts.d.ts +33 -12
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.2.0
2
+ * ApexCharts v8.3.1
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- "use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,o=(e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,a=(t,e)=>{for(var i in e||(e={}))n.call(e,i)&&o(t,i,e[i]);if(s)for(var i of s(e))r.call(e,i)&&o(t,i,e[i]);return t},l=(t,s)=>e(t,i(s));function c(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const i in t)if("default"!==i){const s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const h=c(require("apexcharts/core")),d=h.__apex_axes_AxesUtils,u=h.__apex_Series,g=h.__apex_Utils,p=h.__apex_Environment_Environment,f=h.__apex_BrowserAPIs_BrowserAPIs,m=h.__apex_math_SVGNS;class x{constructor(t,e){this.w=t,this.ctx=e}svgStringToNode(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}scaleSvgNode(t,e){const i=parseFloat(t.getAttributeNS(null,"width")),s=parseFloat(t.getAttributeNS(null,"height"));t.setAttributeNS(null,"width",i*e),t.setAttributeNS(null,"height",s*e),t.setAttributeNS(null,"viewBox","0 0 "+i+" "+s)}inlineCanvasLayers(t){const e=this.w.dom.elWrap.querySelectorAll(".apexcharts-series-canvas");if(!e.length)return;const i=t.querySelectorAll(".apexcharts-canvas-series");for(let t=0;t<e.length&&t<i.length;t++){let s;try{s=e[t].toDataURL()}catch(t){continue}const n=i[t],r=document.createElementNS(m,"image");r.setAttribute("x",n.getAttribute("x")||"0"),r.setAttribute("y",n.getAttribute("y")||"0"),r.setAttribute("width",n.getAttribute("width")||"0"),r.setAttribute("height",n.getAttribute("height")||"0"),r.setAttribute("href",s),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s),n.parentNode&&n.parentNode.replaceChild(r,n)}}queryStyleable(t,e){return Array.prototype.slice.call(t.querySelectorAll(e))}setStyleDefaults(t,e){Object.keys(e).forEach(i=>{""===t.style.getPropertyValue(i)&&t.style.setProperty(i,e[i])})}applyExportStyles(t){const e=this.w;this.queryStyleable(t,"style").forEach(t=>t.remove()),this.queryStyleable(t,[".apexcharts-tooltip",".apexcharts-toolbar",".apexcharts-xaxistooltip",".apexcharts-yaxistooltip",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs",".apexcharts-zoom-rect",".apexcharts-selection-rect"].join(", ")).forEach(t=>{t.style.setProperty("display","none","important")}),this.queryStyleable(t,".apexcharts-flip-y").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleY(-1) translateY(-100%)","transform-origin":"top","transform-box":"fill-box"})}),this.queryStyleable(t,".apexcharts-flip-x").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleX(-1)","transform-origin":"center","transform-box":"fill-box"})}),e.config.legend.show&&e.dom.elLegendWrap&&e.dom.elLegendWrap.children.length&&(this.queryStyleable(t,".apexcharts-legend").forEach(t=>{this.setStyleDefaults(t,{display:"flex",overflow:"auto",padding:"0 10px"});const e=t.classList,i=e.contains("apx-legend-position-left")||e.contains("apx-legend-position-right"),s=e.contains("apx-legend-position-top")||e.contains("apx-legend-position-bottom");e.contains("apexcharts-legend-group-horizontal")&&this.setStyleDefaults(t,{"flex-direction":"column"}),i&&this.setStyleDefaults(t,{"flex-direction":"column",bottom:"0"}),s&&this.setStyleDefaults(t,{"flex-wrap":"wrap"}),i||s&&e.contains("apexcharts-align-left")?this.setStyleDefaults(t,{"justify-content":"flex-start","align-items":"flex-start"}):s&&e.contains("apexcharts-align-center")?this.setStyleDefaults(t,{"justify-content":"center","align-items":"center"}):s&&e.contains("apexcharts-align-right")&&this.setStyleDefaults(t,{"justify-content":"flex-end","align-items":"flex-end"})}),this.queryStyleable(t,".apexcharts-legend-group").forEach(t=>{this.setStyleDefaults(t,{display:"flex"})}),this.queryStyleable(t,".apexcharts-legend-group-vertical").forEach(t=>{this.setStyleDefaults(t,{"flex-direction":"column-reverse"})}),this.queryStyleable(t,".apexcharts-legend-series").forEach(t=>{this.setStyleDefaults(t,{cursor:t.classList.contains("apexcharts-no-click")?"auto":"pointer","line-height":"normal",display:"flex","align-items":"center"})}),this.queryStyleable(t,".apexcharts-legend-text").forEach(t=>{this.setStyleDefaults(t,{position:"relative","font-size":"14px"})}),this.queryStyleable(t,".apexcharts-legend-marker").forEach(t=>{this.setStyleDefaults(t,{position:"relative",display:"flex","align-items":"center","justify-content":"center",cursor:"pointer","margin-right":"1px"})}),this.queryStyleable(t,".apexcharts-inactive-legend").forEach(t=>{this.setStyleDefaults(t,{opacity:"0.45"})}),this.queryStyleable(t,".apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series").forEach(t=>{t.style.setProperty("display","none","important")}))}resolveExportBackground(){const t=this.w,e=t.config.chart.background;return e&&"transparent"!==e?e:"dark"===t.config.theme.mode?"#343A3F":"#fff"}collectFontFamilies(){const t=new Set,e=this.w;if(!p.isBrowser()||!e.dom.elWrap)return t;const i=this.queryStyleable(e.dom.elWrap,"text, tspan, .apexcharts-legend-text, .apexcharts-title-text, .apexcharts-subtitle-text");return[e.dom.elWrap,...i].forEach(e=>{const i=f.getComputedStyle(e),s=i&&i.fontFamily;s&&s.split(",").forEach(e=>{const i=e.trim().replace(/^['"]|['"]$/g,"");i&&t.add(i.toLowerCase())})}),t}collectFontFaceRules(){if(!p.isBrowser())return Promise.resolve([]);const t=[],e=[],i=(e,i)=>{(e.match(/@font-face\s*\{[^}]*\}/gi)||[]).forEach(e=>{const s=e.match(/font-family\s*:\s*([^;}]+)/i);if(!s)return;const n=s[1].trim().replace(/^['"]|['"]$/g,"");t.push({family:n.toLowerCase(),css:e,base:i})})},s=(t,e)=>{Array.from(t).forEach(t=>{5===t.type?t.cssText&&i(t.cssText,e):t.styleSheet?n(t.styleSheet):t.cssRules&&s(t.cssRules,e)})},n=t=>{let n=null;try{n=t.cssRules}catch(t){}n?s(n,t.href||document.baseURI):t.href&&e.push(fetch(t.href).then(t=>t.ok?t.text():"").then(e=>i(e,t.href)).catch(()=>{}))};return Array.from(document.styleSheets||[]).forEach(n),Promise.all(e).then(()=>t)}embedFonts(t){const e=this.w;if(!p.isBrowser()||!e.config.chart.toolbar.export.embedFonts||"function"!=typeof fetch)return Promise.resolve();const i=this.collectFontFamilies();return i.size?this.collectFontFaceRules().then(t=>{const e=t.filter(t=>i.has(t.family));return e.length?Promise.all(e.map(t=>this.inlineFontFaceUrls(t.css,t.base).catch(()=>null))):Promise.resolve([])}).then(e=>{const i=(e||[]).filter(Boolean).join("\n");if(!i)return;const s=document.createElementNS(m,"style");s.textContent=i,t.insertBefore(s,t.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(t,e){const i=[],s=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let n;for(;null!==(n=s.exec(t));)n[2].startsWith("data:")||i.push(n[2]);return i.length?Promise.all(i.map(t=>this.fetchAsDataUri(e?new URL(t,e).href:t).then(e=>({url:t,dataUri:e})).catch(()=>({url:t,dataUri:null})))).then(e=>{let i=t,s=0;return e.forEach(({url:t,dataUri:e})=>{e&&(i=i.split(t).join(e),s++)}),s?i:null}):Promise.resolve(t.includes("data:")?t:null)}fetchAsDataUri(t){return"function"!=typeof fetch||"function"!=typeof btoa?Promise.reject(new Error("fetch unavailable")):fetch(t).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status} for ${t}`);const i=e.headers.get("content-type")||"application/octet-stream";return e.arrayBuffer().then(t=>{const e=new Uint8Array(t);let s="";for(let t=0;t<e.length;t+=32768)s+=String.fromCharCode.apply(null,e.subarray(t,t+32768));return`data:${i};base64,${btoa(s)}`})})}getSvgString(t){return new Promise(e=>{var i,s,n;const r=this.w;let o=t||r.config.chart.toolbar.export.scale||r.config.chart.toolbar.export.width/r.globals.svgWidth;o||(o=1);const a=r.globals.svgWidth*o,l=r.globals.svgHeight*o;null==(i=r.globals.layoutTween)||i.finish(),null==(s=r.globals.circleTween)||s.finish(),null==(n=r.globals.highlightTween)||n.finish(),[...r.globals.chromeTweens||[]].forEach(t=>t());const c=r.dom.elWrap.cloneNode(!0);c.style.width=a+"px",c.style.height=l+"px",this.inlineCanvasLayers(c),this.applyExportStyles(c);const h=(new XMLSerializer).serializeToString(c);let d=`\n <svg xmlns="http://www.w3.org/2000/svg"\n version="1.1"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n class="apexcharts-svg"\n xmlns:data="ApexChartsNS"\n transform="translate(0, 0)"\n width="${r.globals.svgWidth}px" height="${r.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${a}px; height:${l}px;">\n ${h}\n </div>\n </foreignObject>\n </svg>\n `;const u=this.svgStringToNode(d);1!==o&&this.scaleSvgNode(u,o),Promise.all([this.convertImagesToBase64(u),this.embedFonts(u)]).then(()=>{d=(new XMLSerializer).serializeToString(u),e(d.replace(/&nbsp;/g,"&#160;"))})})}convertImagesToBase64(t){const e="http://www.w3.org/1999/xlink",i=t.getElementsByTagName("image"),s=Array.from(i).map(t=>{const i=t.getAttributeNS(e,"href"),s=t.getAttribute("href"),n=i||s;if(!n||n.startsWith("data:"))return Promise.resolve();const r=n=>{i&&t.setAttributeNS(e,"href",n),!s&&i||t.setAttribute("href",n)};return this.fetchAsDataUri(n).then(r).catch(()=>this.getBase64FromUrl(n).then(r).catch(t=>{console.error("Error converting image to base64:",t)}))});return Promise.all(s)}getBase64FromUrl(t){return p.isSSR()?Promise.resolve(t):new Promise((e,i)=>{const s=new Image;s.crossOrigin="Anonymous",s.onload=()=>{const t=document.createElement("canvas");t.width=s.width,t.height=s.height;const i=t.getContext("2d");i&&i.drawImage(s,0,0),e(t.toDataURL())},s.onerror=i,s.src=t})}svgUrl(){return new Promise(t=>{this.getSvgString().then(e=>{const i=new Blob([e],{type:"image/svg+xml;charset=utf-8"});t(URL.createObjectURL(i))})})}dataURI(t){return p.isSSR()?Promise.resolve({imgURI:""}):new Promise(e=>{const i=this.w,s=()=>{console.warn("ApexCharts: the PNG export could not be rendered"),e({imgURI:""})},n=t?t.scale||t.width/i.globals.svgWidth:1,r=document.createElement("canvas");r.width=i.globals.svgWidth*n,r.height=parseInt(i.dom.elWrap.style.height,10)*n;const o=this.resolveExportBackground(),a=r.getContext("2d");if(!a)return s();a.fillStyle=o,a.fillRect(0,0,r.width,r.height),this.getSvgString(n).then(t=>{const i="data:image/svg+xml,"+encodeURIComponent(t),n=new Image;n.crossOrigin="anonymous",n.onload=()=>{try{a.drawImage(n,0,0);const t=r;if(t.msToBlob){const i=t.msToBlob();e({blob:i})}else{const t=r.toDataURL("image/png");e({imgURI:t})}}catch(t){s()}},n.onerror=s,n.src=i}).catch(s)})}exportToSVG(){this.svgUrl().then(t=>{this.triggerDownload(t,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const t=this.w.config.chart.toolbar.export.scale,e=this.w.config.chart.toolbar.export.width,i=t?{scale:t}:e?{width:e}:void 0;this.dataURI(i).then(({imgURI:t,blob:e})=>{e?navigator.msSaveOrOpenBlob(e,this.w.globals.chartID+".png"):t&&this.triggerDownload(t,this.w.config.chart.toolbar.export.png.filename,".png")})}exportToCSV({series:t,fileName:e,columnDelimiter:i=",",lineDelimiter:s="\n"}){const n=this.w,r=n.globals,o=n.config.chart.toolbar.export.csv,a=!t&&(r.streamgraphRawSeries||r.waterfallRawSeries||r.dumbbellRawSeries);t||(t=a||n.config.series);const l=new Set(a&&a===r.dumbbellRawSeries?n.dumbbellData.hidden:r.collapsedSeriesIndices),c=[],h=[],p="datetime"===n.config.xaxis.type,f=n.config.xaxis.labels.datetimeUTC,m=t=>{if(null==t||g.isNumber(t))return t;const e=String(t);return/^[=+\-@\t\r]/.test(e)&&isNaN(+e)?`'${e}`:e},x=t=>p&&String(t).length>=10&&!isNaN(new Date(t).getTime()),y=(t,e)=>{const i=new Date(t);if(f||i.setTime(i.getTime()-6e4*i.getTimezoneOffset()),e)return i.toISOString().slice(0,23).replace("T"," ").replace(".000","");const[s,n,r,o]=i.toUTCString().split(" ");return`${s.slice(0,3)} ${r} ${n} ${o}`},b=(t,e)=>"function"==typeof o.categoryFormatter?o.categoryFormatter(t):null==t?"":x(t)?y(t,e):g.isNumber(t)?t:m(String(t).split(i).join("")),v=t=>"function"==typeof o.valueFormatter?o.valueFormatter(t):m(t),w=new d(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),_=t=>{let e="";if(r.axisCharts){if("category"===n.config.xaxis.type||n.config.xaxis.convertedCatToNumeric)if(r.isBarHorizontal){const i=n.formatters.yLabelFormatters[0],s=new u(this.ctx.w).getActiveConfigSeriesIndex();e=i(n.labelData.labels[t],{seriesIndex:s,dataPointIndex:t,w:n})}else e=w.getLabel(n.labelData.labels,n.labelData.timescaleLabels,0,t).text;p&&(n.config.xaxis.categories.length?e=n.config.xaxis.categories[t]:n.config.labels.length&&(e=n.config.labels[t]))}else e=n.config.labels[t];return Array.isArray(e)?e.join(" "):e},A=n.candleData,S=n.rangeData,C=n.violinData,E=t.length>1,k=t.map((t,e)=>{const s=a?"":t.type||n.config.chart.type,r="candlestick"===s?{open:A.seriesCandleO,high:A.seriesCandleH,low:A.seriesCandleL,close:A.seriesCandleC}:"boxPlot"===s?{minimum:A.seriesCandleO,q1:A.seriesCandleH,median:A.seriesCandleM,q3:A.seriesCandleL,maximum:A.seriesCandleC}:"rangeBar"===s||"rangeArea"===s?{minimum:S.seriesRangeStart,maximum:S.seriesRangeEnd}:"violin"===s?{minimum:C.seriesViolinMin,maximum:C.seriesViolinMax,observations:C.seriesViolinPoints}:null,o=String(t.name||`series-${e}`).split(i).join("")||`series-${e}`,c=r?Object.keys(r):[o];return{head:r&&E?c.map(t=>`${o} ${t}`):c,cells:i=>{var s;const n=l.has(e);if(!r){const e=n||null==(s=t.data)?void 0:s[i];return[v(e&&"object"==typeof e?Array.isArray(e)?e[1]:e.y:e)]}return Object.values(r).map(t=>{var s;const r=n||null==(s=null==t?void 0:t[e])?void 0:s[i];return v(Array.isArray(r)?r.length:r)})}}});if(r.axisCharts)if(c.push([o.headerCategory,...k.flatMap(t=>t.head)].join(i)),r.allSeriesHasEqualX||n.config.xaxis.categories.length||n.config.labels.length){const e=Math.max(0,...t.map(t=>{var e;return(null==(e=t.data)?void 0:e.length)||0}));for(let i=0;i<e;i++){let e=_(i);if(null!==e){if(!e){const s=t.map(t=>{var e;return null==(e=t.data)?void 0:e[i]}).find(t=>null!=t);e=null==s?"":Array.isArray(s)?s[0]:s.x}h.push([e,...k.flatMap(t=>t.cells(i))])}}}else{const e=new Map;t.forEach((t,i)=>{var s;null==(s=null==t?void 0:t.data)||s.forEach((t,s)=>{if(!t||"object"!=typeof t)return;const n=Array.isArray(t)?t[0]:t.x,r=String(n);let o=e.get(r);o||(o={cat:n,values:k.map(t=>t.head.map(()=>""))},e.set(r,o)),o.values[i]=k[i].cells(s)})}),Array.from(e.values()).sort((t,e)=>{const i="string"==typeof t.cat;return i!==("string"==typeof e.cat)?i?1:-1:i?n.axisFlags.isXNumeric?t.cat<e.cat?-1:1:0:t.cat-e.cat}).forEach(({cat:t,values:e})=>h.push([t,...e.flat()]))}else c.push([o.headerCategory,o.headerValue].join(i)),t.forEach((t,e)=>{c.push([b(n.labelData.labels[e]),v(l.has(e)?"":n.seriesData.series[e])].join(i))});const M=h.map(t=>t[0]).filter(x),P=new Set(M.map(t=>y(t))).size<M.length;h.forEach(t=>c.push([b(t[0],P),...t.slice(1)].join(i))),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+c.join(s)),e||o.filename,".csv")}triggerDownload(t,e,i){if(p.isSSR())return;const s=document.createElement("a");s.href=t,s.download=(e||this.w.globals.chartID)+i,document.body.appendChild(s),s.click(),document.body.removeChild(s)}}h.default.registerFeatures({exports:x});const y=h.__apex_CoreUtils,b=h.__apex_dimensions_Dimensions,v=h.__apex_Graphics;let w=class{constructor(t){this.w=t.w,this.lgCtx=t}getLegendStyles(){if(p.isSSR())return null;const t=document.createElement("style");t.setAttribute("type","text/css");const e=this.w.config.chart.nonce;e&&t.setAttribute("nonce",e);const i=document.createTextNode(".apexcharts-flip-y{transform:scaleY(-1) translateY(-100%);transform-origin:top;transform-box:fill-box}.apexcharts-flip-x{transform:scaleX(-1);transform-origin:center;transform-box:fill-box}.apexcharts-legend{display:flex;overflow:auto;padding:0 10px}.apexcharts-legend.apexcharts-legend-group-horizontal{flex-direction:column}.apexcharts-legend-group{display:flex}.apexcharts-legend-group-vertical{flex-direction:column-reverse}.apexcharts-legend.apx-legend-position-bottom,.apexcharts-legend.apx-legend-position-top{flex-wrap:wrap}.apexcharts-legend.apx-legend-position-right,.apexcharts-legend.apx-legend-position-left{flex-direction:column;bottom:0}.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left,.apexcharts-legend.apx-legend-position-top.apexcharts-align-left,.apexcharts-legend.apx-legend-position-right,.apexcharts-legend.apx-legend-position-left{justify-content:flex-start;align-items:flex-start}.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center,.apexcharts-legend.apx-legend-position-top.apexcharts-align-center{justify-content:center;align-items:center}.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right,.apexcharts-legend.apx-legend-position-top.apexcharts-align-right{justify-content:flex-end;align-items:flex-end}.apexcharts-legend-series{cursor:pointer;line-height:normal;display:flex;align-items:center}.apexcharts-legend-text{position:relative;font-size:14px}.apexcharts-legend-text *,.apexcharts-legend-marker *{pointer-events:none}.apexcharts-legend-marker{position:relative;display:flex;align-items:center;justify-content:center;cursor:pointer;margin-right:1px}.apexcharts-legend-series.apexcharts-no-click{cursor:auto}.apexcharts-legend .apexcharts-hidden-zero-series,.apexcharts-legend .apexcharts-hidden-null-series{display:none!important}.apexcharts-inactive-legend{opacity:.45}");return t.appendChild(i),t}getLegendDimensions(){const t=this.w.dom.baseEl.querySelector(".apexcharts-legend");if(!t)return{clwh:0,clww:0};const{width:e,height:i}=t.getBoundingClientRect();return{clwh:i,clww:e}}appendToForeignObject(){var t;const e=this.getLegendStyles();!1!==this.w.config.chart.injectStyleSheet&&e&&(null==(t=this.w.dom.elLegendForeign)||t.appendChild(e))}toggleDataSeries(t,e){var i,s,n;const r=this.w;if(r.globals.axisCharts||"radialBar"===r.config.chart.type){r.globals.resized=!0;let o=null,a=null;if(r.globals.risingSeries=[],r.globals.axisCharts){if(o=null!=(i=Array.prototype.find.call(r.dom.baseEl.querySelectorAll(".apexcharts-series"),e=>e.getAttribute("data:realIndex")===String(t)))?i:null,!o)return;a=parseInt(null!=(s=o.getAttribute("data:realIndex"))?s:"",10)}else{if(o=r.dom.baseEl.querySelector(`.apexcharts-series[rel='${t+1}']`),!o)return;a=parseInt(null!=(n=o.getAttribute("rel"))?n:"",10)-1}if(e){[{cs:r.globals.collapsedSeries,csi:r.globals.collapsedSeriesIndices},{cs:r.globals.ancillaryCollapsedSeries,csi:r.globals.ancillaryCollapsedSeriesIndices}].forEach(t=>{const e=t.cs,i=t.csi;this.riseCollapsedSeries(e,i,a)})}else this.hideSeries({seriesEl:o,realIndex:a});if(r.config.chart.accessibility.enabled){const e=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const i=r.globals.collapsedSeriesIndices.includes(a)||r.globals.ancillaryCollapsedSeriesIndices.includes(a);e.setAttribute("aria-pressed",i?"true":"false");const s=e.querySelector(".apexcharts-legend-text"),n=s?s.textContent:r.seriesData.seriesNames[t],o=i?"hidden":"visible";e.setAttribute("aria-label",`${n}, ${o}. Press Enter or Space to toggle.`)}}}else{if(r.globals.resized=!0,r.globals.risingSeries=[],e)this.riseCollapsedSeries(r.globals.collapsedSeries,r.globals.collapsedSeriesIndices,t);else{const e=this.getSeriesAfterCollapsing({realIndex:t});this.lgCtx.updateSeries(e,r.config.chart.animations.dynamicAnimation.enabled)}if(r.config.chart.accessibility.enabled){const e=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const i=r.globals.collapsedSeriesIndices.includes(t);e.setAttribute("aria-pressed",i?"true":"false");const s=e.querySelector(".apexcharts-legend-text"),n=s?s.textContent:r.seriesData.seriesNames[t],o=i?"hidden":"visible";e.setAttribute("aria-label",`${n}, ${o}. Press Enter or Space to toggle.`)}}}}_nonAxisSliceContainer(t){const e=this.w.config.chart.type;return("pie"===e||"donut"===e||"polarArea"===e||"sunburst"===e||"icicle"===e)&&1===t.length&&t[0]&&"object"==typeof t[0]&&Array.isArray(t[0].data)?t[0].data:t}_readSliceValue(t){return"unit"===this.w.config.chart.type&&t&&Array.isArray(t.data)?t.data:t&&"object"==typeof t?t.y:t}_writeSliceValue(t,e,i){const s=t[e];"unit"===this.w.config.chart.type&&s&&Array.isArray(s.data)?s.data=Array.isArray(i)?i:[]:s&&"object"==typeof s?s.y=i:t[e]=i}getSeriesAfterCollapsing({realIndex:t}){var e,i;const s=this.w,n=s.globals,r=g.clone(s.config.series);if(n.axisCharts){const e=s.config.yaxis[n.seriesYAxisReverseMap[t]],i={index:t,data:r[t].data.slice(),type:r[t].type||s.config.chart.type,name:(n.seriesNames||[])[t]};if(e&&e.show&&e.showAlways)n.ancillaryCollapsedSeriesIndices.indexOf(t)<0&&(n.ancillaryCollapsedSeries.push(i),n.ancillaryCollapsedSeriesIndices.push(t));else if(n.collapsedSeriesIndices.indexOf(t)<0){n.collapsedSeries.push(i),n.collapsedSeriesIndices.push(t);const e=n.risingSeries.indexOf(t);n.risingSeries.splice(e,1)}}else if(n.collapsedSeriesIndices.indexOf(t)<0){const o=this._nonAxisSliceContainer(r);n.collapsedSeries.push({index:t,data:this._readSliceValue(o[t]),type:null!=(i=null==(e=s.config.series[t])?void 0:e.type)?i:"line",name:(n.seriesNames||[])[t]}),n.collapsedSeriesIndices.push(t)}const o=n.axisCharts?s.config.series.length:this._nonAxisSliceContainer(r).length;return n.allSeriesCollapsed=n.collapsedSeries.length+n.ancillaryCollapsedSeries.length===o,this._getSeriesBasedOnCollapsedState(r)}hideSeries({seriesEl:t,realIndex:e}){const i=this.w,s=this.getSeriesAfterCollapsing({realIndex:e}),n=t.childNodes;for(let t=0;t<n.length;t++)n[t].classList.contains("apexcharts-series-markers-wrap")&&(n[t].classList.contains("apexcharts-hide")?n[t].classList.remove("apexcharts-hide"):n[t].classList.add("apexcharts-hide"));const r=i.config.chart.animations.dynamicAnimation.enabled;r&&(i.globals.collapsingSeriesIndices=[e]);const o=()=>{i.globals.collapsingSeriesIndices=[]},a=this.lgCtx.updateSeries(s,r);o(),a&&"function"==typeof a.then&&a.then(o,o)}riseCollapsedSeries(t,e,i){const s=this.w;let n=g.clone(s.config.series);if(t.length>0){for(let r=0;r<t.length;r++)if(t[r].index===i){if(s.globals.axisCharts)n[i].data=t[r].data.slice(),n[i].hidden=!1;else{const e=this._nonAxisSliceContainer(n);this._writeSliceValue(e,i,t[r].data)}t.splice(r,1),e.splice(r,1),s.globals.risingSeries.push(i),r--}n=this._getSeriesBasedOnCollapsedState(n);const r=this.lgCtx.updateSeries(n,s.config.chart.animations.dynamicAnimation.enabled),o=()=>{s.globals.risingSeries=[]};r&&"function"==typeof r.then?r.then(o,o):o()}}_getSeriesBasedOnCollapsedState(t){const e=this.w;let i=0;if(e.globals.axisCharts)t.forEach((s,n)=>{e.globals.collapsedSeriesIndices.indexOf(n)<0&&e.globals.ancillaryCollapsedSeriesIndices.indexOf(n)<0||(t[n].data=[],i++)});else{const s=this._nonAxisSliceContainer(t);s.forEach((t,n)=>{e.globals.collapsedSeriesIndices.indexOf(n)<0||(this._writeSliceValue(s,n,0),i++)})}const s=e.globals.axisCharts?t.length:this._nonAxisSliceContainer(t).length;return e.globals.allSeriesCollapsed=i===s,t}};const _=["#cf4d3f","#8f9499","#26a75b"],A=(t,e,i)=>t+(e-t)*i;function S(t){return Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")}function C(t,e,i){const s=g.parseHex(E(t)),n=g.parseHex(E(e));return s&&n?"#"+S(A(s[0],n[0],i))+S(A(s[1],n[1],i))+S(A(s[2],n[2],i)):t}function E(t){if("string"!=typeof t)return"#000000";if(g.isColorHex(t))return t;return g.rgb2hex(t)||"#000000"}function k(t,e,i,s){var n,r,o;if(!e||"object"!=typeof e)return null;const a=null==(o=null==(r=null==(n=t.config.plotOptions)?void 0:n.treemap)?void 0:r.colorScale)?void 0:o.colorValue;let l;if(l="function"==typeof a?a(e,{seriesIndex:i,dataPointIndex:s,w:t}):"string"==typeof a?e[a]:e.colorValue,null==l)return null;const c=Number(l);return Number.isFinite(c)?c:null}function M(t){var e,i,s;const n=null==(s=null==(i=null==(e=t.config)?void 0:e.plotOptions)?void 0:i.treemap)?void 0:s.colorScale,r=n&&n.gradient;if(!r)return null;if(!1===r.enabled)return null;const o=t.config.series||[];let a=1/0,l=-1/0,c=!1;for(let e=0;e<o.length;e++){const i=o[e]&&o[e].data;if(Array.isArray(i))for(let s=0;s<i.length;s++){const n=k(t,i[s],e,s);null!=n&&(c=!0,n<a&&(a=n),n>l&&(l=n))}}if(!c&&!0!==r.enabled)return null;Number.isFinite(a)||(a=0,l=0);let h=Number.isFinite(Number(r.min))?Number(r.min):a,d=Number.isFinite(Number(r.max))?Number(r.max):l,u=null;if(null===r.midpoint?u=null:Number.isFinite(Number(r.midpoint))?u=Number(r.midpoint):h<0&&d>0&&(u=0),null!=u&&!1!==r.symmetric&&!Number.isFinite(Number(r.min))&&!Number.isFinite(Number(r.max))){const t=Math.max(Math.abs(h-u),Math.abs(d-u));h=u-t,d=u+t}d===h&&(h-=.5,d+=.5);const g=function(t,e,i,s){if(Array.isArray(t.stops)&&t.stops.length>=2)return t.stops.filter(t=>t&&Number.isFinite(Number(t.value))).map(t=>({value:Number(t.value),color:E(t.color)})).sort((t,e)=>t.value-e.value);const n=(Array.isArray(t.colors)&&t.colors.length>=2?t.colors:_).map(E),r=n.length;if(null!=s&&r>=3){const t=Math.floor((r-1)/2),o=[];for(let i=0;i<=t;i++)o.push({value:A(e,s,i/t),color:n[i]});for(let e=t+1;e<r;e++)o.push({value:A(s,i,(e-t)/(r-1-t)),color:n[e]});return o}return n.map((t,s)=>({value:A(e,i,s/(r-1)),color:t}))}(r,h,d,u);if(g.length<2)return null;const p=d-h,f=g.map(t=>({percent:0===p?0:(t.value-h)/p,color:t.color}));return{min:h,max:d,midpoint:u,stops:g,at:t=>{if(!Number.isFinite(t))return g[Math.floor(g.length/2)].color;if(t<=g[0].value)return g[0].color;const e=g[g.length-1];if(t>=e.value)return e.color;for(let e=1;e<g.length;e++){const i=g[e];if(t<=i.value){const s=g[e-1],n=i.value-s.value,r=0===n?0:(t-s.value)/n;return C(s.color,i.color,r)}}return e.color},legendStops:f}}const P=h.__apex_tooltip_Utils,I="http://www.w3.org/2000/svg";class L{constructor(t,e){this.w=t,this.ctx=e,this.svgEl=null,this.arrowEl=null,this.hoverValueEl=null,this._min=0,this._max=0,this._geom=null,this._bandHitEls=[],this._activeBandIndex=-1,this._targetEl=null,this._onCellEnter=this._onCellEnter.bind(this),this._onCellLeave=this._onCellLeave.bind(this),this._onBandEnter=this._onBandEnter.bind(this),this._onBandLeave=this._onBandLeave.bind(this)}_getFormatter(){const t=this._cfg();return"function"==typeof t.formatter?t.formatter:t=>{if(!Number.isFinite(t))return String(t);const e=Math.abs(t);return e>=1e3?t.toFixed(0):e>=10?t.toFixed(1):t.toFixed(2)}}static colorScaleOf(t){var e,i,s,n,r;const o=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.type;return o&&(null==(r=null==(n=null==(s=null==t?void 0:t.config)?void 0:s.plotOptions)?void 0:n[o])?void 0:r.colorScale)||null}static configFor(t){const e=L.colorScaleOf(t);return e&&e.gradientLegend||null}_cfg(){return L.configFor(this.w)||{}}static isEnabled(t){if(!L.supports(t))return!1;const e=L.configFor(t);return!(!e||!e.enabled)}static supports(t){var e,i;const s=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.type;return"heatmap"===s||"treemap"===s}draw(t=null){var e,i,s,n,r,o,a,l;const c=this.w;this._targetEl=t;const h=t||c.dom.elLegendWrap;if(!h)return;const d=this._cfg(),u=c.config.legend.position,g="left"===u||"right"===u,p=null!=(i=null==(e=d.arrow)?void 0:e.size)?i:8,m=p+4,x=d.showLabels?28:4,y=d.showLabels?20:4,b=d.showLabels?44:0,v=this._resolveStripLength(g?d.height:d.width,g),w=d.thickness,_=g?Math.max(w+m+4,b):v+2*x,A=g?v+2*y:w+m+4,S=(_-(w+m))/2,C=g?"left"===u?S:S+m:x,E=g?y:"top"===u?m:4,k=f.createElementNS(I,"svg");k.setAttribute("class","apexcharts-heatmap-gradient-legend apexcharts-gradient-legend"),k.setAttribute("width",String(_)),k.setAttribute("height",String(A)),k.setAttribute("overflow","visible");const M=f.createElementNS(I,"defs"),P=`apexcharts-heatmap-gradient-${c.globals.cuid}`,L=f.createElementNS(I,"linearGradient");L.setAttribute("id",P),g?(L.setAttribute("x1","0"),L.setAttribute("y1","1"),L.setAttribute("x2","0"),L.setAttribute("y2","0")):(L.setAttribute("x1","0"),L.setAttribute("y1","0"),L.setAttribute("x2","1"),L.setAttribute("y2","0"));const{min:T,max:R,stops:D,bands:F}=this._computeStops();this._min=T,this._max=R,D.forEach(t=>{const e=f.createElementNS(I,"stop");e.setAttribute("offset",`${(100*t.percent).toFixed(2)}%`),e.setAttribute("stop-color",t.color),L.appendChild(e)}),M.appendChild(L),k.appendChild(M);const X=f.createElementNS(I,"rect");if(X.setAttribute("x",String(C)),X.setAttribute("y",String(E)),X.setAttribute("width",String(g?w:v)),X.setAttribute("height",String(g?v:w)),X.setAttribute("rx","2"),X.setAttribute("fill",`url(#${P})`),k.appendChild(X),d.showLabels){const t=(null==(s=d.labelStyle)?void 0:s.colors)||(Array.isArray(c.config.legend.labels.colors)?c.config.legend.labels.colors[0]:c.config.legend.labels.colors)||c.config.chart.foreColor,e=(null==(n=d.labelStyle)?void 0:n.fontSize)||"11px",i=(null==(r=d.labelStyle)?void 0:r.fontFamily)||c.config.chart.fontFamily,o=this._getFormatter(),a=(s,n,r,o)=>{const a=f.createElementNS(I,"text");return a.setAttribute("x",String(n)),a.setAttribute("y",String(r)),a.setAttribute("text-anchor",o),a.setAttribute("dominant-baseline","middle"),a.setAttribute("fill",t),a.setAttribute("font-size",e),i&&a.setAttribute("font-family",i),a.textContent=String(s),a};if(g){const t=C+w/2;k.appendChild(a(o(T),t,E+v+10,"middle")),k.appendChild(a(o(R),t,E-10,"middle"))}else{const t=E+w/2;k.appendChild(a(o(T),C-6,t,"end")),k.appendChild(a(o(R),C+v+6,t,"start"))}}const $=(null==(o=d.arrow)?void 0:o.color)||c.config.chart.foreColor,z=this._buildArrow(p,$,u);if(k.appendChild(z),this.arrowEl=z,this._bandHitEls=[],c.config.legend.onItemHover.highlightDataSeries&&F.length>0&&F.forEach(t=>{const e=f.createElementNS(I,"rect");if(g){const i=E+v-t.p2*v,s=E+v-t.p1*v;e.setAttribute("x",String(C)),e.setAttribute("y",String(i)),e.setAttribute("width",String(w)),e.setAttribute("height",String(Math.max(0,s-i)))}else e.setAttribute("x",String(C+t.p1*v)),e.setAttribute("y",String(E)),e.setAttribute("width",String(Math.max(0,(t.p2-t.p1)*v))),e.setAttribute("height",String(w));e.setAttribute("fill","transparent"),e.setAttribute("class","apexcharts-heatmap-gradient-band"),e.setAttribute("data:range-index",String(t.index)),e.style.cursor="pointer",k.appendChild(e),this._bandHitEls.push(e)}),this._geom={isVertical:g,position:u,stripX:C,stripY:E,stripLength:v,stripThickness:w,arrowSize:p,svgWidth:_,svgHeight:A},d.showHoverValue){const t=f.createElement("div");t.classList.add("apexcharts-heatmap-gradient-legend-value"),t.style.position="absolute",t.style.fontSize=(null==(a=d.labelStyle)?void 0:a.fontSize)||"11px",t.style.fontFamily=(null==(l=d.labelStyle)?void 0:l.fontFamily)||c.config.chart.fontFamily||"",t.style.color=c.config.chart.foreColor,t.style.background="rgba(0,0,0,0.65)",t.style.color="#fff",t.style.padding="2px 6px",t.style.borderRadius="3px",t.style.pointerEvents="none",t.style.whiteSpace="nowrap",t.style.opacity="0",t.style.transition="opacity 120ms ease",this.hoverValueEl=t}h.classList.add("apexcharts-heatmap-gradient-legend-wrap"),h.classList.add("apx-legend-position-"+u),h.appendChild(k),this.hoverValueEl&&h.appendChild(this.hoverValueEl),this.svgEl=k,t?(h.style.width=_+"px",h.style.height=A+"px",h.style.position="relative",h.style.overflow="visible"):this._applyWrapAlignment(h,u,g,_,A),this._attachHoverListeners(),this._attachBandHoverListeners()}_resolveStripLength(t,e){const i=this.w,s=e?i.globals.svgHeight||i.config.chart.height||300:i.globals.svgWidth||i.config.chart.width||600;if("string"==typeof t){const e=t.trim();if(e.endsWith("%")){const t=parseFloat(e)||0;return Math.max(20,s*t/100)}const i=parseFloat(e);return Number.isFinite(i)?i:200}return"number"==typeof t&&Number.isFinite(t)?t:200}_applyWrapAlignment(t,e,i,s,n){const r=this.w,o=this._cfg().align||"center",a=12,l=r.globals.svgWidth||r.config.chart.width||600,c=r.globals.svgHeight||r.config.chart.height||300,h=r.config.legend.offsetX||0,d=r.config.legend.offsetY||0;if(t.style.position="absolute",t.style.display="block",t.style.overflow="visible",t.style.padding="0",t.style.width=s+"px",t.style.height=n+"px",t.style.right="auto",t.style.bottom="auto",i){const i=c-n-24;let r;r="start"===o?a:"end"===o?a+Math.max(0,i):a+Math.max(0,i)/2,t.style.top=r+d+"px",t.style.left="left"===e?a+h+"px":l-s-a+h+"px"}else{const i=l-s-24;let r;r="start"===o?a:"end"===o?a+Math.max(0,i):a+Math.max(0,i)/2,t.style.left=r+h+"px",t.style.top="top"===e?a+d+"px":c-n-a+d+"px"}}repositionToPlot(){var t,e;if(!p.isBrowser())return;if(this._targetEl)return;const i=this.w,s=i.globals,n=i.dom.elLegendWrap;if(!n||!this._geom)return;if(!Number.isFinite(s.gridWidth)||!Number.isFinite(s.gridHeight))return;const{isVertical:r,position:o,svgWidth:a,svgHeight:l,stripX:c,stripY:h,stripThickness:d}=this._geom,u=this._cfg().align||"center",g=i.config.legend.offsetX||0,m=i.config.legend.offsetY||0,x=null==(e=null==(t=this.ctx)?void 0:t.dimensions)?void 0:e.dimHelpers,y=x?x.getTitleSubtitleCoords("title").height+x.getTitleSubtitleCoords("subtitle").height:0,b=i.layout.xAxisHeight||0,v=(t,e)=>{const i=Math.max(0,t-e);return"start"===u?0:"end"===u?i:i/2};if(r){n.style.top=s.translateY+v(s.gridHeight,l)+m+"px";const t=(("left"===o?0:s.translateX+s.gridWidth)+("left"===o?s.translateX:s.svgWidth))/2;n.style.left=t-c-d/2+g+"px"}else{n.style.left=s.translateX+v(s.gridWidth,a)+g+"px";const t=(("top"===o?y:s.translateY+s.gridHeight+b)+("top"===o?s.translateY:s.svgHeight))/2;n.style.top=t-h-d/2+m+"px"}f.requestAnimationFrame(()=>this._enforceMinPlotGap())}_enforceMinPlotGap(){const t=this.w,e=t.dom.elLegendWrap,i=this.svgEl&&this.svgEl.querySelector("rect");if(!e||!i||!this._geom)return;if(!t.dom.baseEl||!t.dom.baseEl.querySelector(".apexcharts-svg"))return;const s=i.getBoundingClientRect(),n=P.plotRect(t);if(!(s.width&&s.height&&n.width&&n.height))return;const r=n.left,o=n.left+n.width,a=n.top,l=n.top+n.height,c=n.zoom,{isVertical:h,position:d}=this._geom;if(h){const t=("left"===d?r-s.right:s.left-o)/c;if(t<16){const i=parseFloat(e.style.left)||0,s=16-t;e.style.left=i+("left"===d?-s:s)+"px"}}else{const t=("top"===d?a-s.bottom:s.top-l)/c;if(t<16){const i=parseFloat(e.style.top)||0,s=16-t;e.style.top=i+("top"===d?-s:s)+"px"}}}destroy(){var t,e,i,s,n,r,o;for(let i=0;i<this._bandHitEls.length;i++){const s=this._bandHitEls[i];null==(t=s.removeEventListener)||t.call(s,"mousemove",this._onBandEnter),null==(e=s.removeEventListener)||e.call(s,"mouseout",this._onBandLeave)}if(this._bandHitEls=[],this._activeBandIndex=-1,null==(i=this.ctx)?void 0:i.events)try{null==(n=(s=this.ctx.events).removeEventListener)||n.call(s,"dataPointMouseEnter",this._onCellEnter),null==(o=(r=this.ctx.events).removeEventListener)||o.call(r,"dataPointMouseLeave",this._onCellLeave)}catch(t){}}_attachBandHoverListeners(){if(p.isBrowser())for(let t=0;t<this._bandHitEls.length;t++){const e=this._bandHitEls[t];e.addEventListener("mousemove",this._onBandEnter),e.addEventListener("mouseout",this._onBandLeave)}}_onBandEnter(t){var e,i,s,n;const r=this.w,o=t.currentTarget,a=parseInt(null!=(e=o.getAttribute("data:range-index"))?e:"-1",10);a<0||a===this._activeBandIndex||(this._activeBandIndex=a,null==(n=null==(s=null==(i=this.ctx)?void 0:i.events)?void 0:s.fireEvent)||n.call(s,"legendHover",[this.ctx,a,r]),new u(r).highlightRangeInSeries(a,"highlight"))}_onBandLeave(){if(this._activeBandIndex<0)return;const t=this._activeBandIndex;this._activeBandIndex=-1,new u(this.w).highlightRangeInSeries(t,"reset")}_attachHoverListeners(){var t,e;p.isBrowser()&&(null==(e=null==(t=this.ctx)?void 0:t.events)?void 0:e.addEventListener)&&(this.ctx.events.addEventListener("dataPointMouseEnter",this._onCellEnter),this.ctx.events.addEventListener("dataPointMouseLeave",this._onCellLeave))}_onCellEnter(...t){var e,i,s;const n=this.w;if(!this.arrowEl)return;const r=t[t.length-1];if(!r||"object"!=typeof r)return;const o=r.seriesIndex,a=r.dataPointIndex;if("number"!=typeof o||"number"!=typeof a)return;if(!L.supports(n))return;let l;l=this._continuous?function(t,e,i){const s=t.config.series[e];return k(t,s&&Array.isArray(s.data)?s.data[i]:null,e,i)}(n,o,a):null==(s=null==(i=null==(e=n.seriesData)?void 0:e.series)?void 0:i[o])?void 0:s[a],null==l||Number.isNaN(l)||this._positionArrow(l)}_onCellLeave(){this.arrowEl&&(this.arrowEl.setAttribute("opacity","0"),this.hoverValueEl&&(this.hoverValueEl.style.opacity="0"))}_positionArrow(t){if(!this.arrowEl||!this._geom)return;const{isVertical:e,position:i,stripX:s,stripY:n,stripLength:r,stripThickness:o,arrowSize:a}=this._geom,l=this._min,c=this._max-l;let h;if(h=0===c?.5:(t-l)/c,h<0&&(h=0),h>1&&(h=1),e){const t=n+r-h*r;let e,l;"left"===i?(e=s+o,l=e+a):(e=s,l=e-a);const c=[`${e},${t}`,`${l},${t-a/2}`,`${l},${t+a/2}`].join(" ");this.arrowEl.setAttribute("points",c)}else{const t=s+h*r;let e,l;"top"===i?(e=n+o,l=e+a):(e=n,l=e-a);const c=[`${t},${e}`,`${t-a/2},${l}`,`${t+a/2},${l}`].join(" ");this.arrowEl.setAttribute("points",c)}if(this.arrowEl.setAttribute("opacity","1"),this.hoverValueEl){const l=this._getFormatter();if(this.hoverValueEl.textContent=l(t),e){const t=n+r-h*r;"left"===i?this.hoverValueEl.style.left=`${s+o+a+8}px`:(this.hoverValueEl.style.left=s-a-8+"px",this.hoverValueEl.style.transform="translateX(-100%)"),this.hoverValueEl.style.top=t-9+"px"}else{const t=s+h*r;this.hoverValueEl.style.left=`${t}px`,this.hoverValueEl.style.transform="translateX(-50%)",this.hoverValueEl.style.top="top"===i?`${n+o+a+8}px`:n-a-18+"px"}this.hoverValueEl.style.opacity="1"}}_buildArrow(t,e,i){const s=f.createElementNS(I,"polygon");return s.setAttribute("fill",e),s.setAttribute("opacity","0"),s.setAttribute("class","apexcharts-heatmap-gradient-arrow"),s.setAttribute("points","0,0 0,0 0,0"),s.setAttribute("pointer-events","none"),s}_computeStops(){var t,e;const i=this.w,s=L.colorScaleOf(i)||{},n=this._cfg(),r=M(i);if(r)return this._continuous=!0,{min:r.min,max:r.max,stops:r.legendStops,bands:[]};this._continuous=!1;let o=1/0,c=-1/0;const h=(null==(t=i.seriesData)?void 0:t.series)||[];for(let t=0;t<h.length;t++){const e=h[t];if(e)for(let t=0;t<e.length;t++){const i=e[t];null==i||Number.isNaN(i)||(i<o&&(o=i),i>c&&(c=i))}}Number.isFinite(o)||(o=0),Number.isFinite(c)||(c=0);let d=o,u=c;void 0!==s.min&&void 0!==s.max&&s.max>s.min?(d=s.min,u=s.max):(void 0!==s.min&&(d=s.min<o?s.min:o),void 0!==s.max&&(u=s.max>c?s.max:c));const p=[],f=[];if(s.ranges&&s.ranges.length>0){const t=s.ranges.map((t,e)=>l(a({},t),{_originalIndex:e})).sort((t,e)=>t.from-e.from),e=t[0].from,i=t[t.length-1].to;d=e,u=i;const n=i-e||1;t.forEach(t=>{const i=(t.from-e)/n,s=(t.to-e)/n;p.push({percent:(i+s)/2,color:t.color}),f.push({index:t._originalIndex,p1:i,p2:s})})}else{const t=i.globals.colors[0]||"#008FFB",s=new g,r=i.config.plotOptions[i.config.chart.type]||{},o=null!=(e=r.shadeIntensity)?e:.5,a=i.globals.hasNegs,l=Math.max(2,n.stops||16);for(let e=0;e<l;e++){const n=e/(l-1),c=d+n*(u-d),h=Math.abs(u)+Math.abs(d),g=0===h?0:100*c/h;let f;f=a?r.reverseNegativeShade?g<0?g/100*(1.25*o):1.25*o*(1-g/100):g<=0?1-(1+g/100)*o:(1-g/100)*o:1-g/100,f>1&&(f=1),f<-1&&(f=-1);const m=r.enableShades?s.shadeColor("dark"===i.config.theme.mode?-1*f:f,t):t;p.push({percent:n,color:m})}}return{min:d,max:u,stops:p,bands:f}}}const T=h.__apex_Markers;function R(t){return t.classList.contains("apexcharts-legend-series")||t.classList.contains("apexcharts-legend-text")||t.classList.contains("apexcharts-legend-marker")}h.default.registerFeatures({legend:class{constructor(t,e){this.w=t,this.ctx=e,this.updateSeries=(...t)=>e.updateHelpers._updateSeries(...t),this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.onLegendClickEvent=this.onLegendClickEvent.bind(this),this.onLegendPointerDown=this.onLegendPointerDown.bind(this),this.onLegendPointerUp=this.onLegendPointerUp.bind(this),this.legendPress=null,this.recoveredRel=null,this.isBarsDistributed="bar"===this.w.config.chart.type&&this.w.config.plotOptions.bar.distributed&&1===this.w.config.series.length,this.legendHelpers=new w(this)}init(){const t=this.w,e=t.globals,i=t.config;this.isBarsDistributed="bar"===i.chart.type&&i.plotOptions.bar.distributed&&1===i.series.length;const s=i.legend.showForSingleSeries&&1===this.w.seriesData.series.length||this.isBarsDistributed||"heatmap"===i.chart.type||L.isEnabled(t)||this.w.seriesData.series.length>1;if(this.legendHelpers.appendToForeignObject(),(s||!e.axisCharts)&&i.legend.show){const e=t.dom.elLegendWrap;for(;e.firstChild;)e.removeChild(e.firstChild);this.heatmapGradientLegend&&(this.heatmapGradientLegend.destroy(),this.heatmapGradientLegend=null),L.isEnabled(t)?(this.heatmapGradientLegend=new L(t,this.ctx),this.heatmapGradientLegend.draw()):(this.drawLegends(),"bottom"===i.legend.position||"top"===i.legend.position?this.legendAlignHorizontal():"right"!==i.legend.position&&"left"!==i.legend.position||this.legendAlignVertical())}}createLegendMarker({i:t,fillcolor:e}){const i=this.w,s=f.createElement("span");s.classList.add("apexcharts-legend-marker");const n=i.config.legend.markers.shape||i.config.markers.shape;let r=n;Array.isArray(n)&&(r=n[t]);const o=Array.isArray(i.config.legend.markers.size)?parseFloat(i.config.legend.markers.size[t]):parseFloat(i.config.legend.markers.size),c=Array.isArray(i.config.legend.markers.offsetX)?parseFloat(i.config.legend.markers.offsetX[t]):parseFloat(i.config.legend.markers.offsetX),h=Array.isArray(i.config.legend.markers.offsetY)?parseFloat(i.config.legend.markers.offsetY[t]):parseFloat(i.config.legend.markers.offsetY),d=Array.isArray(i.config.legend.markers.strokeWidth)?parseFloat(i.config.legend.markers.strokeWidth[t]):parseFloat(i.config.legend.markers.strokeWidth),u=s.style;if(u.height=2*(o+d)+"px",u.width=2*(o+d)+"px",u.left=c+"px",u.top=h+"px",i.config.legend.markers.customHTML)u.background="transparent",u.color=e[t],Array.isArray(i.config.legend.markers.customHTML)?i.config.legend.markers.customHTML[t]&&(s.innerHTML=i.config.legend.markers.customHTML[t]()):s.innerHTML=i.config.legend.markers.customHTML();else{const i=new T(this.ctx.w,this.ctx).getMarkerConfig({cssClass:`apexcharts-legend-marker apexcharts-marker apexcharts-marker-${r}`,seriesIndex:t,strokeWidth:d,size:o}),n=(p.isBrowser()?window.SVG:global.SVG)().addTo(s).size("100%","100%"),c=new v(this.w).drawMarker(0,0,l(a({},i),{pointFillColor:Array.isArray(e)?e[t]:i.pointFillColor,shape:r}));c.node.style.transform="triangle"===r?"translate(50%, 45%)":"translate(50%, 50%)",n.add(c)}return s}drawLegends(){var t;const e=this,i=this.w,s=i.dom.elLegendWrap,n=i.config.legend.fontFamily;let r=i.seriesData.seriesNames,o=i.config.legend.markers.fillColors?i.config.legend.markers.fillColors.slice():i.globals.colors.slice();if("heatmap"===i.config.chart.type){const t=i.config.plotOptions.heatmap.colorScale.ranges;r=t.map(t=>t.name?t.name:t.from+" - "+t.to),o=t.map(t=>t.color)}else this.isBarsDistributed&&(r=i.labelData.labels.slice());i.config.legend.customLegendItems.length&&(r=i.config.legend.customLegendItems);const a=i.formatters.legendFormatter,l=i.config.legend.inverseOrder,c=[];i.labelData.seriesGroups.length>1&&i.config.legend.clusterGroupedSeries&&i.labelData.seriesGroups.forEach((t,e)=>{c[e]=f.createElement("div"),c[e].classList.add("apexcharts-legend-group",`apexcharts-legend-group-${e}`),"horizontal"===i.config.legend.clusterGroupedSeriesOrientation?s.classList.add("apexcharts-legend-group-horizontal"):c[e].classList.add("apexcharts-legend-group-vertical")});for(let e=l?r.length-1:0;l?e>=0:e<=r.length-1;l?e--:e++){const l=a(r[e],{seriesIndex:e,w:i});let h=!1,d=!1;if(i.globals.collapsedSeries.length>0)for(let t=0;t<i.globals.collapsedSeries.length;t++)i.globals.collapsedSeries[t].index===e&&(h=!0);if(i.globals.ancillaryCollapsedSeriesIndices.length>0)for(let t=0;t<i.globals.ancillaryCollapsedSeriesIndices.length;t++)i.globals.ancillaryCollapsedSeriesIndices[t]===e&&(d=!0);const u=this.createLegendMarker({i:e,fillcolor:o});v.setAttrs(u,{rel:e+1,"data:collapsed":h||d}),(h||d)&&u.classList.add("apexcharts-inactive-legend");const p=f.createElement("div");if(i.config.chart.accessibility.enabled&&i.config.chart.accessibility.keyboard.enabled){p.setAttribute("role","button"),p.setAttribute("tabindex","0");const t=Array.isArray(l)?l.join(" "):l,e=h||d,i=e?"hidden":"visible";p.setAttribute("aria-label",`${t}, ${i}. Press Enter or Space to toggle.`),p.setAttribute("aria-pressed",e?"true":"false")}const m=f.createElement("span");m.classList.add("apexcharts-legend-text"),m.innerHTML=Array.isArray(l)?l.join(" "):l;let x=i.config.legend.labels.useSeriesColors?i.globals.colors[e]:Array.isArray(i.config.legend.labels.colors)?null==(t=i.config.legend.labels.colors)?void 0:t[e]:i.config.legend.labels.colors;x||(x=i.config.chart.foreColor),m.style.color=x,m.style.fontSize=i.config.legend.fontSize,m.style.fontWeight=i.config.legend.fontWeight,m.style.fontFamily=n||i.config.chart.fontFamily,v.setAttrs(m,{rel:e+1,i:e,"data:default-text":encodeURIComponent(l),"data:collapsed":h||d}),p.appendChild(u),p.appendChild(m);const b=new y(this.w);if(!i.config.legend.showForZeroSeries){0===b.getSeriesTotalByIndex(e)&&b.seriesHaveSameValues(e)&&!b.isSeriesNull(e)&&-1===i.globals.collapsedSeriesIndices.indexOf(e)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&p.classList.add("apexcharts-hidden-zero-series")}i.config.legend.showForNullSeries||b.isSeriesNull(e)&&-1===i.globals.collapsedSeriesIndices.indexOf(e)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&p.classList.add("apexcharts-hidden-null-series");const w=c[i.labelData.seriesGroupIndex[e]];w&&s.appendChild(w),(w||s).appendChild(p),s.classList.add(`apexcharts-align-${i.config.legend.horizontalAlign}`),s.classList.add("apx-legend-position-"+i.config.legend.position),p.classList.add("apexcharts-legend-series"),p.style.margin=`${i.config.legend.itemMargin.vertical}px ${i.config.legend.itemMargin.horizontal}px`,s.style.width=i.config.legend.width?i.config.legend.width+"px":"",s.style.height=i.config.legend.height?i.config.legend.height+"px":"",v.setAttrs(p,{rel:e+1,seriesName:g.escapeString(r[e]),"data:collapsed":h||d}),(h||d)&&p.classList.add("apexcharts-inactive-legend"),i.config.legend.onItemClick.toggleDataSeries||p.classList.add("apexcharts-no-click")}i.dom.elWrap.addEventListener("click",e.onLegendClickEvent,!0),i.dom.elWrap.addEventListener("pointerdown",e.onLegendPointerDown,!0),i.dom.elWrap.addEventListener("pointerup",e.onLegendPointerUp,!0),i.config.legend.onItemHover.highlightDataSeries&&0===i.config.legend.customLegendItems.length&&(i.dom.elWrap.addEventListener("mousemove",e.onLegendHovered,!0),i.dom.elWrap.addEventListener("mouseout",e.onLegendHovered,!0)),i.config.chart.accessibility.enabled&&i.config.chart.accessibility.keyboard.enabled&&i.dom.elWrap.addEventListener("keydown",e.onLegendKeyDown.bind(e),!0)}setLegendWrapXY(t,e){const i=this.w,s=i.dom.elLegendWrap,n=s.clientHeight;let r=0,o=0;if("bottom"===i.config.legend.position)o=i.globals.svgHeight-Math.min(n,i.globals.svgHeight/2)-5;else if("top"===i.config.legend.position){const t=new b(this.w,this.ctx),e=t.dimHelpers.getTitleSubtitleCoords("title").height,i=t.dimHelpers.getTitleSubtitleCoords("subtitle").height;o=(e>0?e-10:0)+(i>0?i-10:0)}s.style.position="absolute",r=r+t+i.config.legend.offsetX,o=o+e+i.config.legend.offsetY,s.style.left=r+"px",s.style.top=o+"px","right"===i.config.legend.position&&(s.style.left="auto",s.style.right=25+i.config.legend.offsetX+"px");["width","height"].forEach(t=>{s&&s.style[t]&&(s.style[t]=parseInt(String(i.config.legend[t]),10)+"px")})}legendAlignHorizontal(){const t=this.w;t.dom.elLegendWrap.style.right="0";const e=new b(this.w,this.ctx),i=e.dimHelpers.getTitleSubtitleCoords("title"),s=e.dimHelpers.getTitleSubtitleCoords("subtitle");let n=0;"top"===t.config.legend.position&&(n=i.height+s.height+t.config.title.margin+t.config.subtitle.margin-10),this.setLegendWrapXY(20,n)}legendAlignVertical(){this.setLegendWrapXY("left"===this.w.config.legend.position?20:0,20)}onLegendHovered(t){var e;const i=this.w,s=t.target,n=R(s);if("heatmap"===i.config.chart.type||this.isBarsDistributed){if(n){const i=parseInt(null!=(e=s.getAttribute("rel"))?e:"0",10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,i,this.w]);const n=new u(this.ctx.w);"mousemove"===t.type?n.highlightRangeInSeries(i,"highlight"):"mouseout"===t.type&&n.highlightRangeInSeries(i,"reset")}}else if(!s.classList.contains("apexcharts-inactive-legend")&&n){new u(this.ctx.w).toggleSeriesOnHover(t,s)}}onLegendKeyDown(t){const e=this,i=this.w,s=t.target;if(R(s)&&("Enter"===t.key||" "===t.key)){t.preventDefault();const n=s.getAttribute("rel");e.onLegendClick(t),null!==n&&i.config.legend.onItemClick.toggleDataSeries&&requestAnimationFrame(()=>{const t=i.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${n}"]`);t&&t.focus()})}}onLegendPointerDown(t){const e=t.target;this.recoveredRel=null,this.legendPress=0===t.button&&R(e)?{el:e,rel:e.getAttribute("rel")}:null}onLegendPointerUp(t){const e=this.legendPress;this.legendPress=null;const i=t.target;e&&!e.el.isConnected&&R(i)&&i.getAttribute("rel")===e.rel&&(this.recoveredRel=e.rel,this.onLegendClick(t))}onLegendClickEvent(t){const e=this.recoveredRel;this.recoveredRel=null;const i=t.target;null!==e&&t.isTrusted&&i.getAttribute("rel")===e||this.onLegendClick(t)}onLegendClick(t){var e;const i=this.w,s=t.target;if(!i.config.legend.customLegendItems.length&&R(s)){const t=parseInt(null!=(e=s.getAttribute("rel"))?e:"0",10)-1,n="true"===s.getAttribute("data:collapsed"),r=this.w.config.chart.events.legendClick;"function"==typeof r&&r(this.ctx,t,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,t,this.w]);const o=this.w.config.legend.markers.onClick;"function"==typeof o&&s.classList.contains("apexcharts-legend-marker")&&(o(this.ctx,t,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,t,this.w]));"treemap"!==i.config.chart.type&&"heatmap"!==i.config.chart.type&&!this.isBarsDistributed&&i.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(t,n)}}}});class D{constructor(t,e){this.w=t,this.ctx=e,this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar,this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null,this.elMenu=null,this.elMenuItems=[],this.t=null,this._drawnForZoom=null}resetControlAllowed(){const t=this.w.config.chart;if(!t.zoom||!t.zoom.enabled)return!1;const e=void 0===t.zoom.resetControl?"auto":t.zoom.resetControl;if("auto"!==e)return!!e;return!(t.toolbar&&t.toolbar.show&&t.toolbar.tools&&t.toolbar.tools.reset)}resetControlDue(){return!!this.w.interact.zoomed&&this.resetControlAllowed()}createToolbar(t={}){var e,i,s;const n=this.w,r=!!t.resetOnly,o=()=>f.createElementNS("http://www.w3.org/1999/xhtml","div"),c=()=>{const t=f.createElementNS("http://www.w3.org/1999/xhtml","button");return t.setAttribute("type","button"),t},h=o();if(h.setAttribute("class","apexcharts-toolbar"),h.style.top=n.config.chart.toolbar.offsetY+"px",h.style.right=3-n.config.chart.toolbar.offsetX+"px",n.dom.elWrap.appendChild(h),this.elZoom=c(),this.elZoomIn=c(),this.elZoomOut=c(),this.elPan=c(),this.elSelection=c(),this.elMeasure=c(),this.elZoomReset=c(),this.elMenuIcon=c(),this.elMenu=o(),this.elCustomIcons=[],this.t=n.config.chart.toolbar.tools,this._drawnForZoom=null,r?(this.t={zoom:!1,zoomin:!1,zoomout:!1,selection:!1,pan:!1,measure:!1,download:!1,customIcons:[],reset:!0},this._drawnForZoom="wrap"):!this.t.reset&&this.resetControlDue()&&(this.t=l(a({},this.t),{reset:!0}),this._drawnForZoom="control"),Array.isArray(this.t.customIcons))for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons.push(c());const d=[],u=(t,e,i)=>{const s=t.toLowerCase();this.t[s]&&n.config.chart.zoom.enabled&&d.push({el:e,icon:"string"==typeof this.t[s]?this.t[s]:i,title:this.localeValues[t],class:`apexcharts-${s}-icon`})};u("zoomIn",this.elZoomIn,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M12 5v14M5 12h14"/>\n</svg>\n'),u("zoomOut",this.elZoomOut,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 12h14"/>\n</svg>\n');const p=t=>{this.t[t]&&n.config.chart[t].enabled&&d.push({el:"zoom"===t?this.elZoom:this.elSelection,icon:"string"==typeof this.t[t]?this.t[t]:"zoom"===t?'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="11" cy="11" r="7"/>\n <path d="m21 21-4.3-4.3M8 11h6M11 8v6"/>\n</svg>\n':'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 3a2 2 0 0 0-2 2"/>\n <path d="M19 3a2 2 0 0 1 2 2"/>\n <path d="M21 19a2 2 0 0 1-2 2"/>\n <path d="M5 21a2 2 0 0 1-2-2"/>\n <path d="M9 3h1M14 3h1M9 21h1M14 21h1M3 9v1M3 14v1M21 9v1M21 14v1"/>\n</svg>\n',title:this.localeValues["zoom"===t?"selectionZoom":"selection"],class:`apexcharts-${t}-icon`})};p("zoom"),p("selection"),this.t.pan&&n.config.chart.zoom.enabled&&d.push({el:this.elPan,icon:"string"==typeof this.t.pan?this.t.pan:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 9 2 12l3 3"/>\n <path d="M9 5l3-3 3 3"/>\n <path d="M15 19l-3 3-3-3"/>\n <path d="M19 9l3 3-3 3"/>\n <path d="M2 12h20"/>\n <path d="M12 2v20"/>\n</svg>\n',title:this.localeValues.pan,class:"apexcharts-pan-icon"}),this.t.measure&&n.config.chart.measure&&n.config.chart.measure.enabled&&d.push({el:this.elMeasure,icon:"string"==typeof this.t.measure?this.t.measure:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.4 2.4 0 0 1 0-3.4l2.6-2.6a2.4 2.4 0 0 1 3.4 0Z"/>\n <path d="m14.5 12.5 2-2"/>\n <path d="m11.5 9.5 2-2"/>\n <path d="m8.5 6.5 2-2"/>\n <path d="m17.5 15.5 2-2"/>\n</svg>\n',title:this.localeValues.measure||"Measure",class:"apexcharts-measure-icon"}),u("reset",this.elZoomReset,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/>\n <path d="M3 3v5h5"/>\n</svg>\n'),this.t.download&&d.push({el:this.elMenuIcon,icon:"string"==typeof this.t.download?this.t.download:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 6h16M4 12h16M4 18h16"/>\n</svg>\n',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(let t=0;t<this.elCustomIcons.length;t++)d.push({el:this.elCustomIcons[t],icon:this.t.customIcons[t].icon,title:this.t.customIcons[t].title,index:this.t.customIcons[t].index,class:"apexcharts-toolbar-custom-icon "+this.t.customIcons[t].class});d.forEach((t,e)=>{t.index&&g.moveIndexInArray(d,e,t.index)});for(let t=0;t<d.length;t++)v.setAttrs(d[t].el,{class:d[t].class,title:d[t].title,"aria-label":d[t].title}),d[t].el.innerHTML=d[t].icon,h.appendChild(d[t].el);this.elZoom.parentNode&&this.elZoom.setAttribute("aria-pressed",String(!!n.interact.zoomEnabled)),this.elSelection.parentNode&&this.elSelection.setAttribute("aria-pressed",String(!!n.interact.selectionEnabled)),this.elPan.parentNode&&this.elPan.setAttribute("aria-pressed",String(!!n.interact.panEnabled)),this.elMeasure.parentNode&&this.elMeasure.setAttribute("aria-pressed",String(!!n.interact.measureEnabled)),this.elMenuIcon.parentNode&&(this.elMenuIcon.setAttribute("aria-haspopup","true"),this.elMenuIcon.setAttribute("aria-expanded","false")),r||this._createHamburgerMenu(h),r?null==(e=this.elZoomReset)||e.addEventListener("click",this.handleZoomReset.bind(this)):(n.interact.zoomEnabled?this.elZoom.classList.add(this.selectedClass):n.interact.panEnabled?this.elPan.classList.add(this.selectedClass):n.interact.selectionEnabled?this.elSelection.classList.add(this.selectedClass):n.interact.measureEnabled&&this.elMeasure&&(this.elMeasure.classList.add(this.selectedClass),null==(s=null==(i=this.ctx.measure)?void 0:i.startMeasure)||s.call(i)),this.addToolbarEventListeners())}_createHamburgerMenu(t){this.elMenuItems=[],t.appendChild(this.elMenu),v.setAttrs(this.elMenu,{class:"apexcharts-menu",role:"menu"});const e=[{name:"exportSVG",title:this.localeValues.exportToSVG},{name:"exportPNG",title:this.localeValues.exportToPNG},{name:"exportCSV",title:this.localeValues.exportToCSV}];for(let t=0;t<e.length;t++)this.elMenuItems.push(f.createElementNS("http://www.w3.org/1999/xhtml","div")),this.elMenuItems[t].innerHTML=e[t].title,v.setAttrs(this.elMenuItems[t],{class:`apexcharts-menu-item ${e[t].name}`,title:e[t].title,role:"menuitem",tabindex:"-1"}),this.elMenu.appendChild(this.elMenuItems[t])}addToolbarEventListeners(){var t,e,i,s,n,r,o,a,l;null==(t=this.elZoomReset)||t.addEventListener("click",this.handleZoomReset.bind(this)),null==(e=this.elSelection)||e.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),null==(i=this.elZoom)||i.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),null==(s=this.elZoomIn)||s.addEventListener("click",this.handleZoomIn.bind(this)),null==(n=this.elZoomOut)||n.addEventListener("click",this.handleZoomOut.bind(this)),null==(r=this.elPan)||r.addEventListener("click",this.togglePanning.bind(this)),null==(o=this.elMeasure)||o.addEventListener("click",this.toggleMeasure.bind(this)),null==(a=this.elMenuIcon)||a.addEventListener("click",this.toggleMenu.bind(this)),this.elMenuItems.forEach(t=>{t.classList.contains("exportSVG")?t.addEventListener("click",this.handleDownload.bind(this,"svg")):t.classList.contains("exportPNG")?t.addEventListener("click",this.handleDownload.bind(this,"png")):t.classList.contains("exportCSV")&&t.addEventListener("click",this.handleDownload.bind(this,"csv"))});for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons[t].addEventListener("click",this.t.customIcons[t].click.bind(this,this.ctx,this.ctx.w));[this.elZoomReset,this.elSelection,this.elZoom,this.elZoomIn,this.elZoomOut,this.elPan,this.elMeasure,this.elMenuIcon,...this.elCustomIcons].forEach(t=>{t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const i=t.className;t.click(),requestAnimationFrame(()=>{const t=this.w.dom.baseEl;if(!t)return;const e=i.split(" ").find(t=>t.startsWith("apexcharts-"));if(!e)return;const s=t.querySelector(`.${e}`);s&&s.focus()})}})}),null==(l=this.elMenuIcon)||l.addEventListener("keydown",t=>{var e;"ArrowDown"!==t.key&&"ArrowUp"!==t.key||(t.preventDefault(),(null==(e=this.elMenu)?void 0:e.classList.contains("apexcharts-menu-open"))||this.toggleMenu(),window.setTimeout(()=>{const e="ArrowDown"===t.key?0:this.elMenuItems.length-1;this.elMenuItems[e]&&this.elMenuItems[e].focus()},20))}),this.elMenuItems.forEach((t,e)=>{t.addEventListener("keydown",i=>{var s;if("ArrowDown"===i.key){i.preventDefault();(this.elMenuItems[e+1]||this.elMenuItems[0]).focus()}else if("ArrowUp"===i.key){i.preventDefault();(this.elMenuItems[e-1]||this.elMenuItems[this.elMenuItems.length-1]).focus()}else"Escape"===i.key||"Tab"===i.key?(this._closeMenu(),null==(s=this.elMenuIcon)||s.focus(),"Tab"===i.key||i.preventDefault()):"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),t.click())})})}toggleZoomSelection(t){this.ctx.getSyncedCharts().forEach(e=>{const i=e.ctx.toolbar,s="selection"===t?"selectionEnabled":"zoomEnabled",n=!!e.w.interact[s];i.toggleOtherControls();const r="selection"===t?i.elSelection:i.elZoom;n||(e.w.interact[s]=!0,null==r||r.classList.add(i.selectedClass)),null==r||r.setAttribute("aria-pressed",String(!!e.w.interact[s]))})}toggleMeasure(){var t,e,i,s;const n=this.w,r=!n.interact.measureEnabled;this.toggleOtherControls(),r&&(n.interact.measureEnabled=!0,null==(t=this.elMeasure)||t.classList.add(this.selectedClass),null==(i=null==(e=this.ctx.measure)?void 0:e.startMeasure)||i.call(e)),null==(s=this.elMeasure)||s.setAttribute("aria-pressed",String(n.interact.measureEnabled))}getToolbarIconsReference(){const t=this.w;this.elZoom||(this.elZoom=t.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=t.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=t.dom.baseEl.querySelector(".apexcharts-selection-icon")),this.elMeasure||(this.elMeasure=t.dom.baseEl.querySelector(".apexcharts-measure-icon"))}enableZoomPanFromToolbar(t){this.toggleOtherControls(),"pan"===t?this.w.interact.panEnabled=!0:this.w.interact.zoomEnabled=!0;const e="pan"===t?this.elPan:this.elZoom,i="pan"===t?this.elZoom:this.elPan;e&&e.classList.add(this.selectedClass),i&&i.classList.remove(this.selectedClass)}togglePanning(){this.ctx.getSyncedCharts().forEach(t=>{var e,i;const s=t.ctx.toolbar,n=!!t.w.interact.panEnabled;s.toggleOtherControls(),n||(t.w.interact.panEnabled=!0,null==(e=s.elPan)||e.classList.add(s.selectedClass)),null==(i=s.elPan)||i.setAttribute("aria-pressed",String(!!t.w.interact.panEnabled))})}toggleOtherControls(){var t,e,i;const s=this.w;s.interact.panEnabled=!1,s.interact.zoomEnabled=!1,s.interact.selectionEnabled=!1,s.interact.measureEnabled&&(s.interact.measureEnabled=!1,null==(e=null==(t=this.ctx.measure)?void 0:t.stopMeasure)||e.call(t),null==(i=this.elMeasure)||i.setAttribute("aria-pressed","false")),this.getToolbarIconsReference();[this.elPan,this.elSelection,this.elZoom,this.elMeasure].forEach(t=>{t&&t.classList.remove(this.selectedClass)})}_currentXRange(){const t=this.w;return t.axisFlags.isRangeBar?{minX:t.globals.minY,maxX:t.globals.maxY}:{minX:t.globals.minX,maxX:t.globals.maxX}}handleZoomIn(){const t=this.w,{minX:e,maxX:i}=this._currentXRange(),s=(e+i)/2,n=(e+s)/2,r=(i+s)/2,o=this._getNewMinXMaxX(n,r);t.interact.disableZoomIn||this.zoomUpdateOptions(o.minX,o.maxX)}handleZoomOut(){const t=this.w,{minX:e,maxX:i}=this._currentXRange();if("datetime"===t.config.xaxis.type&&new Date(e).getUTCFullYear()<1e3)return;const s=(e+i)/2,n=e-(s-e),r=i-(s-i),o=this._getNewMinXMaxX(n,r);t.interact.disableZoomOut||this.zoomUpdateOptions(o.minX,o.maxX)}_getNewMinXMaxX(t,e){const i=this.w.config.xaxis.convertedCatToNumeric;return{minX:i?Math.floor(t):t,maxX:i?Math.floor(e):e}}zoomUpdateOptions(t,e){const i=this.w;if(void 0===t&&void 0===e)return void this.handleZoomReset();if(i.config.xaxis.convertedCatToNumeric&&(t<1&&(t=1,e=i.globals.dataPoints),e-t<2))return;let s={min:t,max:e};const n=this.getBeforeZoomRange(s,void 0);n&&(s=n.xaxis);const r={xaxis:s};if(!i.globals.initialConfig)return;const o=g.clone(i.globals.initialConfig.yaxis);i.config.chart.group||(r.yaxis=o),this.w.interact.zoomed=!0,this.ctx.updateHelpers._updateOptions(r,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(s,o)}zoomCallback(t,e){"function"==typeof this.ev.zoomed&&(this.ev.zoomed(this.ctx,{xaxis:t,yaxis:e}),this.ctx.events.fireEvent("zoomed",{xaxis:t,yaxis:e}))}getBeforeZoomRange(t,e){let i=null;return"function"==typeof this.ev.beforeZoom&&(i=this.ev.beforeZoom(this,{xaxis:t,yaxis:e})),i}toggleMenu(){window.setTimeout(()=>{var t,e,i;(null==(t=this.elMenu)?void 0:t.classList.contains("apexcharts-menu-open"))?this._closeMenu():(null==(e=this.elMenu)||e.classList.add("apexcharts-menu-open"),null==(i=this.elMenuIcon)||i.setAttribute("aria-expanded","true"))},0)}_closeMenu(){var t,e;null==(t=this.elMenu)||t.classList.remove("apexcharts-menu-open"),null==(e=this.elMenuIcon)||e.setAttribute("aria-expanded","false")}handleDownload(t){const e=this.w,i=new x(this.w,this.ctx);switch(t){case"svg":i.exportToSVG();break;case"png":i.exportToPng();break;case"csv":i.exportToCSV({series:e.config.series,columnDelimiter:e.config.chart.toolbar.export.csv.columnDelimiter})}}clearZoomAffordance(){const t=this._drawnForZoom;if(this._drawnForZoom=null,!t||!this.elZoomReset)return;const e=this.elZoomReset.parentNode,i="wrap"===t?e:this.elZoomReset;i&&i.parentNode&&i.parentNode.removeChild(i)}handleZoomReset(){this.ctx.getSyncedCharts().forEach(t=>{var e;const i=t.w;if(!i.interact.zoomed)return;if(i.globals.lastXAxis.min=i.globals.initialConfig.xaxis.min,i.globals.lastXAxis.max=i.globals.initialConfig.xaxis.max,t.updateHelpers.revertDefaultAxisMinMax(),"function"==typeof i.config.chart.events.beforeResetZoom){const e=i.config.chart.events.beforeResetZoom(t,i);e&&t.updateHelpers.revertDefaultAxisMinMax(e)}"function"==typeof i.config.chart.events.zoomed&&t.ctx.toolbar.zoomCallback({min:i.config.xaxis.min,max:i.config.xaxis.max});const s=t.ctx.series.emptyCollapsedSeries(g.clone(i.globals.initialSeries));t.updateHelpers._updateSeries(s,i.config.chart.animations.dynamicAnimation.enabled),i.interact.zoomed=!1,null==(e=t.ctx.toolbar)||e.clearZoomAffordance()})}destroy(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null}}class F{static xRatio(t){const e=t.layout.gridWidth||1;return(t.globals.maxX-t.globals.minX)/e}static dataXToPx(t,e){return(e-t.globals.minX)/F.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*F.xRatio(t)}static screenXToPlotPx(t,e){const i=t.dom.baseEl,s=i&&i.querySelector(".apexcharts-svg");if(!s)return e-t.layout.translateX;const n=s.getBoundingClientRect(),r=t.globals.svgWidth?n.width/t.globals.svgWidth:1;return(e-n.left)/(r||1)-t.layout.translateX}}const X=h.__apex_index_Box;h.default.registerFeatures({toolbar:D,zoomPanSelection:class extends D{constructor(t,e){super(t,e),this.w=t,this.ctx=e,this.dragged=!1,this.graphics=new v(this.w),this.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend"],this.clientX=0,this.clientY=0,this.startX=0,this.endX=0,this.dragX=0,this.startY=0,this.endY=0,this.dragY=0,this.moveDirection="none"}init({xyRatios:t}){const e=this.w,i=this;this.xyRatios=t,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.constraints=new X(0,0,e.layout.gridWidth,e.layout.gridHeight),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),e.dom.Paper.add(this.zoomRect),e.dom.Paper.add(this.selectionRect),"x"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:e.layout.gridWidth,maxY:e.layout.gridHeight}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):"y"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:e.layout.gridWidth}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):this.slDraggableRect=this.selectionRect.draggable().on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")),this.preselectedSelection(),this.hoverArea=e.dom.baseEl.querySelector(`${e.globals.chartClass} .apexcharts-svg`),this.hoverArea&&(this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach(e=>{var s;null==(s=this.hoverArea)||s.addEventListener(e,i.svgMouseEvents.bind(i,t),{capture:!1,passive:!0})}),this._wheelZoomEnabled()&&this.hoverArea.addEventListener("wheel",i.mouseWheelEvent.bind(i),{capture:!1,passive:!1}),this.hoverArea.addEventListener("keydown",i.escapeResetEvent.bind(i),{capture:!1,passive:!0}),this._momentumEnabled()&&["touchstart","touchmove","touchend","touchcancel"].forEach(t=>{var e;null==(e=this.hoverArea)||e.addEventListener(t,i.momentumTouch.bind(i),{capture:!1,passive:!1})}))}destroy(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null}svgMouseEvents(t,e){const i=this.w,s=this.ctx.toolbar;if(i.interact.momentum&&i.interact.momentum.busy)return;if(this._momentumEnabled()&&e.touches&&e.touches.length>1)return;const n=i.interact.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type,r=i.config.chart.toolbar.autoSelected;if("measure"!==r&&(e.shiftKey?(i.interact.shiftWasPressed=!0,s.enableZoomPanFromToolbar("pan"===r?"zoom":"pan")):i.interact.shiftWasPressed&&(s.enableZoomPanFromToolbar(r),i.interact.shiftWasPressed=!1)),!e.target)return;const o=e.target.classList;let a;e.target.parentNode&&null!==e.target.parentNode&&(a=e.target.parentNode.classList);if(!(o.contains("apexcharts-legend-marker")||o.contains("apexcharts-legend-text")||a&&a.contains("apexcharts-toolbar"))){if(this.clientX="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientX:"touchend"===e.type?e.changedTouches[0].clientX:e.clientX,this.clientY="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientY:"touchend"===e.type?e.changedTouches[0].clientY:e.clientY,"mousedown"===e.type&&1===e.which||"touchstart"===e.type){if(!this._hasPlot())return;this.startX=this._screenXToPlotPx(this.clientX),this.startY=this._screenYToPlotPx(this.clientY),this.dragged=!1,this.w.interact.mousedown=!0}("mousemove"===e.type&&1===e.which||"touchmove"===e.type)&&(this.dragged=!0,i.interact.panEnabled?(i.interact.selection=null,this.w.interact.mousedown&&this.panDragging({context:this,zoomtype:n,xyRatios:this.xyRatios})):(this.w.interact.mousedown&&i.interact.zoomEnabled||this.w.interact.mousedown&&i.interact.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:n}))),"mouseup"!==e.type&&"touchend"!==e.type&&"mouseleave"!==e.type||this.handleMouseUp({zoomtype:n}),this.makeSelectionRectDraggable()}}handleMouseUp({zoomtype:t,isResized:e}){const i=this.w;this._hasPlot()&&(this.w.interact.mousedown||e)&&(this.endX=this._screenXToPlotPx(this.clientX),this.endY=this._screenYToPlotPx(this.clientY),this.dragX=Math.abs(this.endX-this.startX),this.dragY=Math.abs(this.endY-this.startY),(i.interact.zoomEnabled||i.interact.selectionEnabled)&&this.selectionDrawn({context:this,zoomtype:t})),i.interact.zoomEnabled&&this.hideSelectionRect(this.selectionRect),this.dragged=!1,this.w.interact.mousedown=!1}_incidentalZoomEnabled(t){var e,i,s;const n=this.w.config.chart;return!(!n.zoom||!n.zoom.enabled)&&("auto"!==t?!!t:!(!(null==(e=n.toolbar)?void 0:e.show)||!(null==(s=null==(i=n.toolbar)?void 0:i.tools)?void 0:s.reset)))}_wheelZoomEnabled(){const{zoom:t}=this.w.config.chart;return this._incidentalZoomEnabled(t&&t.allowMouseWheelZoom)}_focusForKeyboard(){var t,e;const i=this.w.dom.Paper&&this.w.dom.Paper.node;if(i&&"function"==typeof i.focus&&null!==i.getAttribute("tabindex")){null==(e=null==(t=this.ctx.keyboardNavigation)?void 0:t.notePointerFocus)||e.call(t);try{i.focus({preventScroll:!0})}catch(t){i.focus()}}}escapeResetEvent(t){if("Escape"!==t.key&&"Esc"!==t.key)return;if(!this.w.interact.zoomed)return;const e=this.ctx.keyboardNavigation;e&&e.active||this.resetControlAllowed()&&this.handleZoomReset()}_wheel(){const t=this.w.interact;return t.wheel||(t.wheel={factor:1,clientX:0,rafId:null,endTimer:null}),t.wheel}mouseWheelEvent(t){t.preventDefault();const e=this._wheel();let i=t.deltaY;1===t.deltaMode?i*=33:2===t.deltaMode&&(i*=330),e.factor*=Math.pow(2,i/240),e.clientX=t.clientX,null==e.rafId&&(e.rafId=requestAnimationFrame(()=>this._applyWheelZoom())),e.endTimer&&clearTimeout(e.endTimer),e.endTimer=setTimeout(()=>this._endWheelZoom(),150)}_applyWheelZoom(){const t=this.w,e=this._wheel();e.rafId=null;const i=e.factor;if(e.factor=1,1===i||t.globals.isDestroyed)return;const s=t.layout.gridWidth;if(!this._hasPlot()||!s)return;const{min:n,max:r}=this._currentXWindow(),o=r-n,a=Math.min(Math.max(this._screenXToPlotPx(e.clientX)/s,0),1);let l=o*i;const c=this._clampBounds();if(c){const e=t.globals.minXDiff>0&&isFinite(t.globals.minXDiff)?t.globals.minXDiff:0,i=Math.max(2*e,1e-6*(c.max-c.min));l<i&&(l=i),l>c.max-c.min&&(l=c.max-c.min)}let h=n+a*o-a*l,d=h+l;const u=1e-9*o;if(Math.abs(h-n)<u&&Math.abs(d-r)<u)return;if(isNaN(h)||isNaN(d))return;const g=this.getBeforeZoomRange({min:h,max:d},void 0);g&&g.xaxis&&(h=g.xaxis.min,d=g.xaxis.max),this._applyXRange(h,d,!0)}_endWheelZoom(){const t=this.w;if(this._wheel().endTimer=null,t.globals.isDestroyed||!t.interact.zoomed)return;const{min:e,max:i}=this._currentXWindow(),s=t.globals.initialConfig?g.clone(t.globals.initialConfig.yaxis):[],n=this.ctx.toolbar;n&&n.zoomCallback({min:e,max:i},s)}makeSelectionRectDraggable(){const t=this.w;if(!this.selectionRect)return;const e=this.selectionRect.node.getBoundingClientRect();e.width>0&&e.height>0&&(this.selectionRect.select(!1).resize(!1),this.selectionRect.select({createRot:()=>{},updateRot:()=>{},createHandle:(t,e,i,s,n)=>"l"===n||"r"===n?t.circle(8).css({"stroke-width":1,stroke:"#333",fill:"#fff"}):t.circle(0),updateHandle:(t,e)=>t.center(e[0],e[1])}).resize().on("resize",()=>{var e;if(this._clampSelectionRectToPlot(),t.interact.selectionEnabled)t.interact.selection={x:parseFloat(this.selectionRect.node.getAttribute("x")),y:parseFloat(this.selectionRect.node.getAttribute("y")),width:parseFloat(this.selectionRect.node.getAttribute("width")),height:parseFloat(this.selectionRect.node.getAttribute("height"))},clearTimeout(null!=(e=this.w.globals.selectionResizeTimer)?e:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},30);else{const e=t.interact.zoomEnabled?t.config.chart.zoom.type:t.config.chart.selection.type;this.handleMouseUp({zoomtype:e,isResized:!0})}}))}preselectedSelection(){const t=this.w,e=this.xyRatios;if(!t.interact.zoomEnabled)if(void 0!==t.interact.selection&&null!==t.interact.selection)this.drawSelectionRect(l(a({},t.interact.selection),{translateX:t.layout.translateX,translateY:t.layout.translateY}));else if(void 0!==t.config.chart.selection.xaxis.min&&void 0!==t.config.chart.selection.xaxis.max){let i=F.dataXToPx(t,t.config.chart.selection.xaxis.min),s=F.dataXToPx(t,t.config.chart.selection.xaxis.max)-i;t.axisFlags.isRangeBar&&(i=(t.config.chart.selection.xaxis.min-t.globals.yAxisScale[0].niceMin)/e.invertedYRatio,s=(t.config.chart.selection.xaxis.max-t.config.chart.selection.xaxis.min)/e.invertedYRatio);const n={x:i,y:0,width:s,height:t.layout.gridHeight,translateX:t.layout.translateX,translateY:t.layout.translateY,selectionEnabled:!0};this.drawSelectionRect(n),this.makeSelectionRectDraggable(),"function"==typeof t.config.chart.events.selection&&t.config.chart.events.selection(this.ctx,{xaxis:{min:t.config.chart.selection.xaxis.min,max:t.config.chart.selection.xaxis.max},yaxis:{}})}}drawSelectionRect({x:t,y:e,width:i,height:s,translateX:n=0,translateY:r=0}){const o=this.w,a=this.zoomRect,l=this.selectionRect;if(this.dragged||null!==o.interact.selection){const c={transform:"translate("+n+", "+r+")"};o.interact.zoomEnabled&&this.dragged&&(i<0&&(i=1),a.attr({x:t,y:e,width:i,height:s,fill:o.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":o.config.chart.zoom.zoomedArea.fill.opacity,stroke:o.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":o.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":o.config.chart.zoom.zoomedArea.stroke.opacity}),v.setAttrs(a.node,c)),o.interact.selectionEnabled&&(l.attr({x:t,y:e,width:i>0?i:0,height:s>0?s:0,fill:o.config.chart.selection.fill.color,"fill-opacity":o.config.chart.selection.fill.opacity,stroke:o.config.chart.selection.stroke.color,"stroke-width":o.config.chart.selection.stroke.width,"stroke-dasharray":o.config.chart.selection.stroke.dashArray,"stroke-opacity":o.config.chart.selection.stroke.opacity}),v.setAttrs(l.node,c))}}_clampSelectionRectToPlot(){const t=this.selectionRect;if(!t||!t.node)return;const e=this.w.layout.gridWidth;if(!(e>0))return;const i=parseFloat(t.node.getAttribute("x"))||0,s=parseFloat(t.node.getAttribute("width"))||0,n=t=>Math.min(Math.max(t,0),e),r=n(i),o=n(i+s);r===i&&o===i+s||(t.attr({x:r,width:o-r}),t._updateSelectPositions&&t._updateSelectPositions())}hideSelectionRect(t){t&&t.attr({x:0,y:0,width:0,height:0})}selectionDrawing({context:t,zoomtype:e}){const i=this.w,s=t;if(!this._hasPlot())return;const n=s.startX,r=s.startY;let o=!1,c=!1;const h=this._screenXToPlotPx(s.clientX),d=this._screenYToPlotPx(s.clientY);let u=h-n,g=d-r,p={translateX:i.layout.translateX,translateY:i.layout.translateY};return Math.abs(u+n)>i.layout.gridWidth?u=i.layout.gridWidth-n:h<0&&(u=n),n>h&&(o=!0,u=Math.abs(u)),r>d&&(c=!0,g=Math.abs(g)),p="x"===e?{x:o?n-u:n,y:0,width:u,height:i.layout.gridHeight}:"y"===e?{x:0,y:c?r-g:r,width:i.layout.gridWidth,height:g}:{x:o?n-u:n,y:c?r-g:r,width:u,height:g},p=l(a({},p),{translateX:i.layout.translateX,translateY:i.layout.translateY}),s.drawSelectionRect(p),s.selectionDragging("resizing"),p}selectionDragging(t,e){var i;const s=this.w;if(!e)return;e.preventDefault();const{handler:n,box:r}=e.detail,o=this.constraints;let{x:a,y:l}=r;a<o.x&&(a=o.x),l<o.y&&(l=o.y),r.x2>o.x2&&(a=o.x2-r.w),r.y2>o.y2&&(l=o.y2-r.h),n.move(a,l);const c=this.selectionRect;let h=0;"resizing"===t&&(h=30);const d=t=>parseFloat(c.node.getAttribute(t)),u={x:d("x"),y:d("y"),width:d("width"),height:d("height")};s.interact.selection=u;const g=s.config.chart.link,p=!(!g||!g.enabled&&"function"!=typeof g.dimension);("function"==typeof s.config.chart.events.selection||p)&&s.interact.selectionEnabled&&(clearTimeout(null!=(i=this.w.globals.selectionResizeTimer)?i:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},h))}_emitSelectionFromRect(){var t;const e=this.w;if(!e.interact.selectionEnabled)return;const i=e.config.chart.link,s=!(!i||!i.enabled&&"function"!=typeof i.dimension);if("function"!=typeof e.config.chart.events.selection&&!s)return;if(!this._hasPlot())return;const n=this.selectionRect.node.getBoundingClientRect(),r=this.xyRatios;let o,a,l,c;const h=this._screenXToPlotPx(n.left),d=this._screenXToPlotPx(n.right);if(e.axisFlags.isRangeBar)o=e.globals.yAxisScale[0].niceMin+h*r.invertedYRatio,a=e.globals.yAxisScale[0].niceMin+d*r.invertedYRatio,l=0,c=1;else{if(!e.globals.xAxisScale)return;o=F.pxToDataX(e,h),a=F.pxToDataX(e,d),l=e.globals.yAxisScale[0].niceMin+(e.layout.gridHeight-this._screenYToPlotPx(n.bottom))*r.yRatio[0],c=e.globals.yAxisScale[0].niceMax-this._screenYToPlotPx(n.top)*r.yRatio[0]}const u={xaxis:{min:o,max:a},yaxis:{min:l,max:c}};"function"==typeof e.config.chart.events.selection&&e.config.chart.events.selection(this.ctx,u),e.config.chart.brush.enabled&&void 0!==e.config.chart.events.brushScrolled&&e.config.chart.events.brushScrolled(this.ctx,u),null==(t=this.ctx.linkedViews)||t.onSourceSelection(u.xaxis)}selectionDrawn({context:t,zoomtype:e}){var i;const s=this.w,n=t,r=this.xyRatios,o=this.ctx.toolbar,a=s.interact.zoomEnabled?n.zoomRect.node.getBoundingClientRect():n.selectionRect.node.getBoundingClientRect();if(!n._hasPlot())return;const l=this._screenXToPlotPx(a.left),c=this._screenXToPlotPx(a.right),h=this._screenYToPlotPx(a.top),d=this._screenYToPlotPx(a.bottom);let u,p;s.axisFlags.isRangeBar?(u=s.globals.yAxisScale[0].niceMin+l*r.invertedYRatio,p=s.globals.yAxisScale[0].niceMin+c*r.invertedYRatio):(u=F.pxToDataX(s,l),p=F.pxToDataX(s,c));const f=[],m=[];if(s.config.yaxis.forEach((t,e)=>{const i=s.globals.seriesYAxisMap[e][0],n=s.globals.yAxisScale[e].niceMax-r.yRatio[i]*h,o=s.globals.yAxisScale[e].niceMax-r.yRatio[i]*d;f.push(n),m.push(o)}),n.dragged&&(n.dragX>10||n.dragY>10)&&u!==p)if(s.interact.zoomEnabled){if(!s.globals.initialConfig)return;let t=g.clone(s.globals.initialConfig.yaxis),i=g.clone(s.globals.initialConfig.xaxis);if(s.interact.zoomed=!0,s.config.xaxis.convertedCatToNumeric&&(u=Math.floor(u),p=Math.floor(p),u<1&&(u=1,p=s.globals.dataPoints),p-u<2&&(p=u+1)),"xy"!==e&&"x"!==e||(i={min:u,max:p}),"xy"!==e&&"y"!==e||t.forEach((e,i)=>{t[i].min=m[i],t[i].max=f[i]}),o){const e=o.getBeforeZoomRange(i,t);e&&(i=e.xaxis?e.xaxis:i,t=e.yaxis?e.yaxis:t)}const r={xaxis:i};s.config.chart.group||(r.yaxis=t);const a=n.ctx.updateHelpers._updateOptions(r,!1,n.w.config.chart.animations.dynamicAnimation.enabled);a&&"function"==typeof a.then?a.then(()=>n._focusForKeyboard()):n._focusForKeyboard(),"function"==typeof s.config.chart.events.zoomed&&o.zoomCallback(i,t)}else if(s.interact.selectionEnabled){let t=null,r=null;if(r={min:u,max:p},"xy"===e||"y"===e){const e=g.clone(s.config.yaxis);t=e,e.forEach((t,i)=>{e[i].min=m[i],e[i].max=f[i]})}s.interact.selection=n.selection,"function"==typeof s.config.chart.events.selection&&s.config.chart.events.selection(n.ctx,{xaxis:r,yaxis:t}),null==(i=n.ctx.linkedViews)||i.onSourceSelection(r)}}panDragging({context:t}){var e;const i=this.w,s=t;if(void 0!==i.interact.lastClientPosition.x){const t=i.interact.lastClientPosition.x-s.clientX,n=(null!=(e=i.interact.lastClientPosition.y)?e:0)-s.clientY;Math.abs(t)>Math.abs(n)&&t>0?this.moveDirection="left":Math.abs(t)>Math.abs(n)&&t<0?this.moveDirection="right":Math.abs(n)>Math.abs(t)&&n>0?this.moveDirection="up":Math.abs(n)>Math.abs(t)&&n<0&&(this.moveDirection="down")}i.interact.lastClientPosition={x:s.clientX,y:s.clientY};const n=i.axisFlags.isRangeBar?i.globals.minY:i.globals.minX,r=i.axisFlags.isRangeBar?i.globals.maxY:i.globals.maxX;s.panScrolled(n,r)}panScrolled(t,e){var i,s;const n=this.w,r=this.xyRatios;if(!n.globals.initialConfig)return;const o=g.clone(n.globals.initialConfig.yaxis);let a=r.xRatio,l=n.globals.minX,c=n.globals.maxX;if(n.axisFlags.isRangeBar&&(a=r.invertedYRatio,l=n.globals.minY,c=n.globals.maxY),"left"===this.moveDirection?(t=l+n.layout.gridWidth/15*a,e=c+n.layout.gridWidth/15*a):"right"===this.moveDirection&&(t=l-n.layout.gridWidth/15*a,e=c-n.layout.gridWidth/15*a),!n.axisFlags.isRangeBar){const r=null!=(i=n.globals.dataReducerRawMinX)?i:n.globals.initialMinX,o=null!=(s=n.globals.dataReducerRawMaxX)?s:n.globals.initialMaxX;(t<r||e>o)&&(t=l,e=c)}const h={xaxis:{min:t,max:e}};n.config.chart.group||(h.yaxis=o),this.updateScrolledChart(h,t,e)}updateScrolledChart(t,e,i){const s=this.w;if(this.ctx.updateHelpers._updateOptions(t,!1,!1),"function"==typeof s.config.chart.events.scrolled){const t={xaxis:{min:e,max:i}};s.config.chart.events.scrolled(this.ctx,t),this.ctx.events.fireEvent("scrolled",t)}}_momentumEnabled(){return this._pinchEnabled()||this._panInertiaEnabled()}_pinchEnabled(){return this._incidentalZoomEnabled(this.w.config.chart.zoom.pinch)}_panInertiaEnabled(){const t=this.w.config.chart;return!(!t.pan||!t.pan.inertia)}_m(){const t=this.w.interact;return t.momentum||(t.momentum={busy:!1,pinch:null,panState:null,samples:[],inertiaRAF:null}),t.momentum}_currentXWindow(){const t=this.w;return t.axisFlags.isRangeBar?{min:t.globals.minY,max:t.globals.maxY}:{min:t.globals.minX,max:t.globals.maxX}}_hasPlot(){const t=this.w.dom.baseEl;return!(!t||!t.querySelector(".apexcharts-svg"))}_screenYToPlotPx(t){const e=P.plotRect(this.w);return(t-e.top)/e.zoom}_screenXToPlotPx(t){return F.screenXToPlotPx(this.w,t)}_clampBounds(){var t,e;const i=this.w;return i.axisFlags.isRangeBar?null:{min:null!=(t=i.globals.dataReducerRawMinX)?t:i.globals.initialMinX,max:null!=(e=i.globals.dataReducerRawMaxX)?e:i.globals.initialMaxX}}_applyXRange(t,e,i){const s=this.w;if(!s.globals.initialConfig)return!1;const n=this._currentXWindow(),r=i&&e-t>n.max-n.min,o=this._clampBounds();if(o){const i=e-t;t<o.min&&(e=(t=o.min)+i),e>o.max&&(t=(e=o.max)-i),t<o.min&&(t=o.min)}if(s.config.xaxis.convertedCatToNumeric&&(t=Math.floor(t),e=r?Math.ceil(e):Math.floor(e),t<1&&(t=1),o&&e>o.max&&(e=Math.floor(o.max)),e-t<2))return!1;if(!(e>t))return!1;const a={xaxis:{min:t,max:e}};return s.config.chart.group||(a.yaxis=g.clone(s.globals.initialConfig.yaxis)),i&&(s.interact.zoomed=!0),this.ctx.updateHelpers._updateOptions(a,!1,!1),{minX:t,maxX:e}}_cancelInertia(){const t=this._m();null!=t.inertiaRAF&&(cancelAnimationFrame(t.inertiaRAF),t.inertiaRAF=null)}_fireScrolled(){const t=this.w;if("function"!=typeof t.config.chart.events.scrolled)return;const{min:e,max:i}=this._currentXWindow(),s={xaxis:{min:e,max:i}};t.config.chart.events.scrolled(this.ctx,s),this.ctx.events.fireEvent("scrolled",s)}_pushSample(t,e){const i=this._m().samples;for(i.push({x:t,t:e});i.length>6;)i.shift()}momentumTouch(t){const e=this.w,i=this._m(),s=t.type;if("touchstart"!==s)"touchmove"!==s?(i.pinch?t.touches.length<2&&this._endPinch():i.panState&&0===t.touches.length&&this._endPan(),0===t.touches.length&&(e.interact.mousedown=!1,this.dragged=!1,null!=i.inertiaRAF||i.pinch||i.panState||(i.busy=!1))):i.pinch&&t.touches.length>=2?(t.preventDefault(),this._movePinch(t)):i.panState&&1===t.touches.length&&this._movePan(t);else{if(this._cancelInertia(),!this._hasPlot())return;if(t.touches.length>=2&&this._pinchEnabled())t.preventDefault(),i.busy=!0,i.panState=null,this._beginPinch(t);else if(1===t.touches.length&&this._panInertiaEnabled()&&e.interact.panEnabled){i.busy=!0,i.pinch=null;const s=t.touches[0],n=this._currentXWindow(),r=e.layout.gridWidth||1,o=P.plotRect(e).zoom;i.panState={startX:s.clientX,startY:s.clientY,axis:null,minX0:n.min,maxX0:n.max,zoom:o,ratio0:(n.max-n.min)/r/o},i.samples=[{x:s.clientX,t:t.timeStamp}]}}}_beginPinch(t){const e=this.w,i=t.touches[0],s=t.touches[1],n=Math.hypot(s.clientX-i.clientX,s.clientY-i.clientY)||1,r=this._screenXToPlotPx((i.clientX+s.clientX)/2),{min:o,max:a}=this._currentXWindow();this._m().pinch={d0:n,cx0:r,minX0:o,maxX0:a,gridWidth:e.layout.gridWidth||1}}_movePinch(t){const e=this.w,i=this._m().pinch;if(!i||!this._hasPlot())return;const s=t.touches[0],n=t.touches[1],r=Math.hypot(n.clientX-s.clientX,n.clientY-s.clientY)||1,o=this._screenXToPlotPx((s.clientX+n.clientX)/2),a=i.maxX0-i.minX0,l=a*(i.d0/r);let c=i.minX0+i.cx0/i.gridWidth*a-o/i.gridWidth*l,h=c+l;const d=this._clampBounds();if(d){const t=e.globals.minXDiff>0&&isFinite(e.globals.minXDiff)?e.globals.minXDiff:0,i=Math.max(2*t,1e-6*(d.max-d.min));if(h-c<i){const t=(c+h)/2;c=t-i/2,h=t+i/2}}this._applyXRange(c,h,!0)}_endPinch(){const t=this.w;this._m().pinch=null;const{min:e,max:i}=this._currentXWindow(),s={min:e,max:i},n=t.globals.initialConfig?g.clone(t.globals.initialConfig.yaxis):[],r=this.ctx.toolbar;r&&r.zoomCallback(s,n)}_movePan(t){const e=this._m(),i=e.panState,s=t.touches[0];if(!i.axis){const n=Math.abs(s.clientX-i.startX),r=Math.abs(s.clientY-i.startY);if(n<6&&r<6)return void this._pushSample(s.clientX,t.timeStamp);if(r>n)return e.busy=!1,void(e.panState=null);i.axis="x"}if("x"!==i.axis)return;t.preventDefault();const n=(s.clientX-i.startX)*i.ratio0;this._pushSample(s.clientX,t.timeStamp),this._applyXRange(i.minX0-n,i.maxX0-n,!1)}_endPan(){const t=this._m(),e=t.panState;t.panState=null;let i=0;const s=t.samples;if(s.length>=2){const t=s[0],e=s[s.length-1],n=e.t-t.t;n>0&&(i=(e.x-t.x)/n)}t.samples=[],e&&"x"===e.axis&&this._panInertiaEnabled()&&Math.abs(i)>.05?this._startInertia(i/e.zoom):(t.busy=!1,this._fireScrolled())}_startInertia(t){const e=this.w,i=this._m(),s=e.config.chart.pan&&e.config.chart.pan.friction,n="number"==typeof s?Math.min(Math.max(s,.5),.999):.92;let r=t,o=null;i.busy=!0;const a=t=>{if(e.globals.isDestroyed)return i.inertiaRAF=null,void(i.busy=!1);if(null==o)return o=t,void(i.inertiaRAF=requestAnimationFrame(a));const s=t-o;if(o=t,r*=Math.pow(n,s/16.6667),Math.abs(r)<.02)return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();const l=this._currentXWindow(),c=e.layout.gridWidth||1,h=(l.max-l.min)/c,d=r*s*h,u=this._applyXRange(l.min-d,l.max-d,!1),g=this._clampBounds();if(!u||g&&(d>0&&u.minX<=g.min+1e-6*(g.max-g.min)||d<0&&u.maxX>=g.max-1e-6*(g.max-g.min)))return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();i.inertiaRAF=requestAnimationFrame(a)};i.inertiaRAF=requestAnimationFrame(a)}}});const $=h.__apex_Animations_prefersReducedMotion,z=h.__apex_Animations_applyProgressiveReveal;class B{constructor(t){this.w=t.w,this.annoCtx=t}setOrientations(t,e=null){var i,s;const n=this.w;if("vertical"===t.label.orientation){const r=null!==e?e:0,o=n.dom.baseEl.querySelector(`.apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='${r}']`);if(null!==o){const e=o.getBBox();o.setAttribute("x",String(parseFloat(null!=(i=o.getAttribute("x"))?i:"0")-e.height+4));const n="top"===t.label.position?e.width:-e.width;o.setAttribute("y",String(parseFloat(null!=(s=o.getAttribute("y"))?s:"0")+n));const{x:r,y:a}=this.annoCtx.graphics.rotateAroundCenter(o);o.setAttribute("transform",`rotate(-90 ${r} ${a})`)}}}addBackgroundToAnno(t,e){const i=this.w;if(!t||!e.label.text||!String(e.label.text).trim())return null;const s=i.dom.baseEl.querySelector(".apexcharts-grid");if(!s)return null;const n=s.getBoundingClientRect(),r=s.getBBox(),o=n.width/r.width||1,a=t.getBoundingClientRect();let{left:l,right:c,top:h,bottom:d}=e.label.style.padding;"vertical"===e.label.orientation&&([h,d,l,c]=[l,c,h,d]);const u=n.left-r.x*o,g=n.top-r.y*o,p=(a.left-u)/o-l,f=(a.top-g)/o-h,m=this.annoCtx.graphics.drawRect(p,f,a.width/o+l+c,a.height/o+h+d,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&m.node.classList.add(e.id),m}annotationsBackground(){const t=this.w,e=(e,i,s)=>{const n=t.dom.baseEl.querySelector(`.apexcharts-${s}-annotations .apexcharts-${s}-annotation-label[rel='${i}']`);if(n){const i=n.parentNode,s=this.addBackgroundToAnno(n,e);if(s){null==i||i.insertBefore(s.node,n);const r=n.getAttribute("x");null!==r&&z(s,parseFloat(r),t),e.label.mouseEnter&&s.node.addEventListener("mouseenter",e.label.mouseEnter.bind(this,e)),e.label.mouseLeave&&s.node.addEventListener("mouseleave",e.label.mouseLeave.bind(this,e)),e.label.click&&s.node.addEventListener("click",e.label.click.bind(this,e))}}};t.config.annotations.xaxis.forEach((t,i)=>e(t,i,"xaxis")),t.config.annotations.yaxis.forEach((t,i)=>e(t,i,"yaxis")),t.config.annotations.points.forEach((t,i)=>e(t,i,"point"))}usesCategoryX(){const t=this.w;return("category"===t.config.xaxis.type||t.config.xaxis.convertedCatToNumeric)&&!this.annoCtx.invertAxis&&!t.axisFlags.dataFormatXNumeric&&!t.config.chart.sparkline.enabled}hasXDomain(){const t=this.w;return this.annoCtx.invertAxis?g.isNumber(t.globals.minY)&&g.isNumber(t.globals.yRange[0]):this.usesCategoryX()?t.labelData.labels.length>0||t.labelData.categoryLabels.length>0:g.isNumber(t.globals.minX)&&g.isNumber(t.globals.xRange)}getY1Y2(t,e){var i,s,n;const r=this.w,o="y1"===t?e.y:e.y2,a="string"==typeof o&&o.includes("px");let l,c=!1;if(this.annoCtx.invertAxis){const t=r.config.xaxis.convertedCatToNumeric?r.labelData.categoryLabels:r.labelData.labels,s=t.indexOf(o);if(!a&&-1===s)return{yP:0,clipped:!0};const n=r.dom.baseEl.querySelector(`.apexcharts-yaxis-texts-g text:nth-child(${s+1})`);l=n?parseFloat(null!=(i=n.getAttribute("y"))?i:"0"):(r.layout.gridHeight/t.length-1)*(s+1)-r.globals.barHeight,void 0!==e.seriesIndex&&r.globals.barHeight&&(l+=this.barSlotOffset(e.seriesIndex,r.globals.barHeight))}else{if(!r.config.yaxis[e.yAxisIndex])return{yP:0,clipped:!0};const t=r.globals.seriesYAxisMap[e.yAxisIndex],i=null!=(s=null==t?void 0:t[0])?s:null;if(null===i&&r.seriesData.series.length)return{yP:0,clipped:!0};const a=null===i?r.globals.minY:r.globals.minYArr[i],h=null===i?r.globals.maxY-r.globals.minY:r.globals.yRange[i],d=r.config.yaxis[e.yAxisIndex].logarithmic&&null!==i?new y(this.w).getLogVal(r.config.yaxis[e.yAxisIndex].logBase,o,i)/r.globals.yLogRatio[i]:(o-a)/(h/r.layout.gridHeight);l=r.layout.gridHeight-Math.min(Math.max(d,0),r.layout.gridHeight),c=d>r.layout.gridHeight||d<0,!e.marker||void 0!==e.y&&null!==e.y||(l=0),(null==(n=r.config.yaxis[e.yAxisIndex])?void 0:n.reversed)&&(l=d)}return a&&(l=parseFloat(o)),{yP:l,clipped:c}}getX1X2(t,e){const i=this.w,s="x1"===t?e.x:e.x2,n=this.annoCtx.invertAxis?i.globals.minY:i.globals.minX,r=this.annoCtx.invertAxis?i.globals.maxY:i.globals.maxX,o=this.annoCtx.invertAxis?i.globals.yRange[0]:i.globals.xRange;let a=!1;const l="string"==typeof s&&s.includes("px"),c=null==s&&e.marker;if(!l&&!c&&!this.hasXDomain())return{x:0,clipped:!0};let h=this.annoCtx.inversedReversedAxis?(r-s)/(o/i.layout.gridWidth):(s-n)/(o/i.layout.gridWidth);return this.usesCategoryX()&&(h=this.getStringX(s)),"string"==typeof s&&s.includes("px")&&(h=parseFloat(s)),null==s&&e.marker&&(h=i.layout.gridWidth),void 0!==e.seriesIndex&&i.globals.barWidth&&!this.annoCtx.invertAxis&&(h+=this.barSlotOffset(e.seriesIndex,i.globals.barWidth)),"number"!=typeof h&&(h=0,a=!0),parseFloat(h.toFixed(10))>parseFloat(i.layout.gridWidth.toFixed(10))?(h=i.layout.gridWidth,a=!0):h<0&&(h=0,a=!0),{x:h,clipped:a}}barSlotOffset(t,e){const i=this.w;if(i.config.chart.stacked)return 0;let s=0,n=0;return i.seriesData.series.forEach((e,r)=>{var o;const a=null==(o=i.config.series[r])?void 0:o.type;!e.length||i.globals.comboCharts&&"bar"!==a&&"column"!==a||(r<t&&n++,s++)}),e*(n-(s-1)/2)}getStringX(t){var e;const i=this.w;let s=t;if(i.config.xaxis.convertedCatToNumeric&&i.labelData.categoryLabels.length){const e=String(t);t=i.labelData.categoryLabels.findIndex(t=>String(t)===e)+1}const n=i.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(t),r=i.dom.baseEl.querySelector(`.apexcharts-xaxis-texts-g text:nth-child(${n+1})`);return r?s=parseFloat(null!=(e=r.getAttribute("x"))?e:"0"):n>-1&&(s=i.axisFlags.isXNumeric?(t-i.globals.minX)/(i.globals.xRange/i.layout.gridWidth):i.globals.padHorizontal+(n+.5)*i.layout.gridWidth/i.globals.dataPoints),s}}class N{constructor(t){this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new B(this.annoCtx)}addXaxisAnnotation(t,e,i){const s=this.w,n=this.helpers.getX1X2("x1",t);let r=n.x;const o=n.clipped;let a,l=!0;const c=t.label.text,h=t.strokeDashArray;if(g.isNumber(r)){if(null===t.x2||void 0===t.x2){if(!o){const i=this.annoCtx.graphics.drawLine(r+t.offsetX,0+t.offsetY,r+t.offsetX,s.layout.gridHeight+t.offsetY,t.borderColor,h,t.borderWidth);e.appendChild(i.node),t.id&&i.node.classList.add(t.id),z(i,r+t.offsetX,s)}}else{const i=this.helpers.getX1X2("x2",t);if(a=i.x,l=i.clipped,a<r){const t=r;r=a,a=t}const n=this.annoCtx.graphics.drawRect(r+t.offsetX,0+t.offsetY,a-r,s.layout.gridHeight+t.offsetY,0,t.fillColor,t.opacity,1,t.borderColor,h);n.node.classList.add("apexcharts-annotation-rect"),n.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`),e.appendChild(n.node),t.id&&n.node.classList.add(t.id),z(n,r+t.offsetX,s)}if(!o||!l){const n=this.annoCtx.graphics.getTextRects(c,t.label.style.fontSize),o="top"===t.label.position?4:"center"===t.label.position?s.layout.gridHeight/2+("vertical"===t.label.orientation?n.width/2:0):s.layout.gridHeight,a=this.annoCtx.graphics.drawText({x:r+t.label.offsetX,y:o+t.label.offsetY-("vertical"===t.label.orientation?"top"===t.label.position?n.width/2-12:-n.width/2:0),text:c,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-xaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});a.attr({rel:i}),e.appendChild(a.node),z(a,r+t.label.offsetX,s),this.annoCtx.helpers.setOrientations(t,i)}}}drawXAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return t.config.annotations.xaxis.map((t,i)=>{this.addXaxisAnnotation(t,e.node,i)}),e}}class W{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new B(this.annoCtx),this.axesUtils=new d(this.annoCtx.w,{theme:this.annoCtx.theme,timeScale:this.annoCtx.timeScale})}addYaxisAnnotation(t,e,i){const s=this.w,n=t.strokeDashArray;let r=this.helpers.getY1Y2("y1",t),o=r.yP;const a=r.clipped;let l,c=!0,h=!1;const d=t.label.text;if(null===t.y2||void 0===t.y2){if(!a){h=!0;const i=this.annoCtx.graphics.drawLine(0+t.offsetX,o+t.offsetY,this._getYAxisAnnotationWidth(t),o+t.offsetY,t.borderColor,n,t.borderWidth);e.appendChild(i.node),t.id&&i.node.classList.add(t.id)}}else{if(r=this.helpers.getY1Y2("y2",t),l=r.yP,c=r.clipped,l>o){const t=o;o=l,l=t}if(!a||!c){h=!0;const i=this.annoCtx.graphics.drawRect(0+t.offsetX,l+t.offsetY,this._getYAxisAnnotationWidth(t),o-l,0,t.fillColor,t.opacity,1,t.borderColor,n);i.node.classList.add("apexcharts-annotation-rect"),i.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`),e.appendChild(i.node),t.id&&i.node.classList.add(t.id)}}if(h){const n="right"===t.label.position?s.layout.gridWidth:"center"===t.label.position?s.layout.gridWidth/2:0,r=this.annoCtx.graphics.drawText({x:n+t.label.offsetX,y:(null!=l?l:o)+t.label.offsetY-3,text:d,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-yaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});r.attr({rel:i}),e.appendChild(r.node)}}_getYAxisAnnotationWidth(t){const e=this.w;let i=e.layout.gridWidth;return i=t.width.indexOf("%")>-1?e.layout.gridWidth*parseInt(t.width,10)/100:parseInt(t.width,10),i+t.offsetX}drawYAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.forEach((t,i)=>{t.yAxisIndex=this.axesUtils.translateYAxisIndex(t.yAxisIndex),this.axesUtils.isYAxisHidden(t.yAxisIndex)&&this.axesUtils.yAxisAllSeriesCollapsed(t.yAxisIndex)||this.addYaxisAnnotation(t,e.node,i)}),e}}class O{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new B(this.annoCtx)}addPointAnnotation(t,e,i){const s=this.w;if(s.globals.collapsedSeriesIndices.indexOf(t.seriesIndex)>-1)return;const n=this.helpers.getX1X2("x1",t),r=n.x,o=n.clipped,a=this.helpers.getY1Y2("y1",t),l=a.yP,c=a.clipped;if(g.isNumber(r)&&!c&&!o){const n={pSize:t.marker.size,pointStrokeWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,pRadius:t.marker.radius,class:`apexcharts-point-annotation-marker ${t.marker.cssClass} ${t.id?t.id:""}`};let o=this.annoCtx.graphics.drawMarker(r+t.marker.offsetX,l+t.marker.offsetY,n);e.appendChild(o.node);const a=[o.node];z(o,r,s);const c=t.label.text?t.label.text:"",h=this.getConstrainedLabelX(c,r+t.label.offsetX,t.label),d=this.annoCtx.graphics.drawText({x:h,y:l+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:c,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-point-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});if(d.attr({rel:i}),e.appendChild(d.node),z(d,r,s),t.customSVG.SVG){const i=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});i.attr({transform:`translate(${r+t.customSVG.offsetX}, ${l+t.customSVG.offsetY})`}),i.node.innerHTML=t.customSVG.SVG,e.appendChild(i.node),a.push(i.node)}if(t.image.path){const e=t.image.width?t.image.width:20,i=t.image.height?t.image.height:20;o=this.annoCtx.addImage({x:r+t.image.offsetX-e/2,y:l+t.image.offsetY-i/2,width:e,height:i,path:t.image.path,appendTo:".apexcharts-point-annotations"}),a.push(o.node)}t.tooltip&&t.tooltip.enabled&&a.forEach(e=>{e.addEventListener("mouseenter",()=>{this.showPointTooltip(t,e)}),e.addEventListener("mouseleave",()=>{this.hidePointTooltip()})}),t.mouseEnter&&o.node.addEventListener("mouseenter",t.mouseEnter.bind(this,t)),t.mouseLeave&&o.node.addEventListener("mouseleave",t.mouseLeave.bind(this,t)),t.click&&o.node.addEventListener("click",t.click.bind(this,t))}}getConstrainedLabelX(t,e,i){const s=this.w;if(!t)return e;const{width:n}=this.annoCtx.graphics.getTextRects(t,i.style.fontSize,i.style.fontFamily,void 0,!0,i.style.fontWeight);let r,o;switch(i.textAnchor){case"start":r=e,o=e+n;break;case"end":r=e-n,o=e;break;default:r=e-n/2,o=e+n/2}const a=i.style.padding||{};return r-=a.left||0,o+=a.right||0,r<0?e-r:o>s.layout.gridWidth?e-(o-s.layout.gridWidth):e}getPointTooltipEl(){const t=this.w;let e=t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");return e||(e=f.createElementNS("http://www.w3.org/1999/xhtml","div"),e.classList.add("apexcharts-tooltip","apexcharts-annotation-tooltip"),t.dom.elWrap.appendChild(e)),e}getPointTooltipContent(t){const e=this.w,i=t.tooltip||{};if("function"==typeof i.formatter)return i.formatter({annotation:t,seriesIndex:t.seriesIndex,id:t.id,w:e});let s=null!=i.text?i.text:t.label&&t.label.text;return Array.isArray(s)&&(s=s.join("<br/>")),null==s?"":String(s)}showPointTooltip(t,e){const i=this.w,s=this.getPointTooltipContent(t);if(!s)return;const n=this.getPointTooltipEl();n.innerHTML=s;const r=t.tooltip.theme||i.config.tooltip.theme||"light";n.classList.remove("apexcharts-theme-light","apexcharts-theme-dark"),n.classList.add(`apexcharts-theme-${r}`),n.classList.add("apexcharts-active");const o=i.dom.elWrap.getBoundingClientRect(),a=e.getBoundingClientRect(),l=n.getBoundingClientRect(),c=t.tooltip.offsetX||0,h=t.tooltip.offsetY||0;let d=a.left-o.left+a.width/2-l.width/2,u=a.top-o.top-l.height-10;d=Math.max(0,Math.min(d,o.width-l.width)),u<0&&(u=a.top-o.top+a.height+10),n.style.left=d+c+"px",n.style.top=u+h+"px"}hidePointTooltip(){const t=this.w.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");t&&t.classList.remove("apexcharts-active")}drawPointAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map((t,i)=>{this.addPointAnnotation(t,e.node,i)}),e}}const H=h.__apex_Options;h.default.registerFeatures({annotations:class{constructor(t,{theme:e=null,timeScale:i=null}={}){this.w=t,this.theme=e,this.timeScale=i,this.invertAxis=void 0,this.inversedReversedAxis=void 0,this.graphics=new v(this.w),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new B(this),this.xAxisAnnotations=new N(this),this.yAxisAnnotations=new W(this),this.pointsAnnotations=new O(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0)}drawAxesAnnotations(){const t=this.w;if(t.globals.axisCharts){const e=this.yAxisAnnotations.drawYAxisAnnotations(),i=this.xAxisAnnotations.drawXAxisAnnotations(),s=this.pointsAnnotations.drawPointAnnotations(),n=t.config.chart.animations.enabled,r=[e,i,s],o=[i.node,e.node,s.node],a="line"===t.config.chart.type||"area"===t.config.chart.type||"rangeArea"===t.config.chart.type,l=[a,!1,a];for(let e=0;e<3;e++)t.dom.elGraphical.add(r[e]),!n||t.globals.resized||t.globals.dataChanged||t.globals.animationEnded||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&t.globals.dataPoints>1&&!l[e]&&o[e].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:o[e],index:0});this.helpers.annotationsBackground()}}drawImageAnnos(){this.w.config.annotations.images.map(t=>{this.addImage(t)})}drawTextAnnos(){this.w.config.annotations.texts.map(t=>{this.addText(t)})}addXaxisAnnotation(t,e,i){this.xAxisAnnotations.addXaxisAnnotation(t,e,i)}addYaxisAnnotation(t,e,i){this.yAxisAnnotations.addYaxisAnnotation(t,e,i)}addPointAnnotation(t,e,i){this.pointsAnnotations.addPointAnnotation(t,e,i)}addText(t){const{x:e,y:i,text:s,textAnchor:n,foreColor:r,fontSize:o,fontFamily:a,fontWeight:l,cssClass:c,backgroundColor:h,borderWidth:d,strokeDashArray:u,borderRadius:g,borderColor:p,appendTo:f=".apexcharts-svg",paddingLeft:m=4,paddingRight:x=4,paddingBottom:y=2,paddingTop:b=2}=t,v=this.w,w=v.dom.baseEl.querySelector(f);if(!w)return;const _=this.graphics.drawText({x:e,y:i,text:s,textAnchor:n||"start",fontSize:o||"12px",fontWeight:l||"regular",fontFamily:a||v.config.chart.fontFamily,foreColor:r||v.config.chart.foreColor,cssClass:c||""});w.appendChild(_.node);const A=_.bbox();if(s){const t=this.graphics.drawRect(A.x-m,A.y-b,A.width+m+x,A.height+y+b,g,h||"transparent",1,d,p,u);w.insertBefore(t.node,_.node)}}addImage(t){const e=this.w,{path:i,x:s=0,y:n=0,width:r=20,height:o=20,appendTo:a=".apexcharts-svg"}=t,l=e.dom.Paper.image(i);l.size(r,o).move(s,n);const c=e.dom.baseEl.querySelector(a);return c&&c.appendChild(l.node),l}addXaxisAnnotationExternal(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"xaxis",contextMethod:i.addXaxisAnnotation}),i}addYaxisAnnotationExternal(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"yaxis",contextMethod:i.addYaxisAnnotation}),i}addPointAnnotationExternal(t,e,i){return void 0===this.invertAxis&&(this.invertAxis=i.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"point",contextMethod:i.addPointAnnotation}),i}addAnnotationExternal({params:t,pushToMemory:e,context:i,type:s,contextMethod:n}){var r;const o=i,a=o.w,l=a.dom.baseEl.querySelector(`.apexcharts-${s}-annotations`),c=((null==(r=a.config.annotations["point"===s?"points":s])?void 0:r.length)||0)+l.childNodes.length,h=new H,d=Object.assign({},"xaxis"===s?h.xAxisAnnotation:"yaxis"===s?h.yAxisAnnotation:h.pointAnnotation),u=g.extend(d,t);switch(s){case"xaxis":this.addXaxisAnnotation(u,l,c);break;case"yaxis":this.addYaxisAnnotation(u,l,c);break;case"point":this.addPointAnnotation(u,l,c)}const p=a.dom.baseEl.querySelector(`.apexcharts-${s}-annotations .apexcharts-${s}-annotation-label[rel='${c}']`),f=this.helpers.addBackgroundToAnno(p,u);return f&&l.insertBefore(f.node,p),e&&a.globals.memory.methodsToExec.push({context:o,id:u.id?u.id:g.randomId(),method:n,label:"addAnnotation",params:t}),i}_removeAnnotationTooltip(t){const e=t.dom.elWrap&&t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");e&&e.parentNode&&e.parentNode.removeChild(e)}clearAnnotations(t){const e=t.w;this._removeAnnotationTooltip(e);const i=e.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations");for(let t=e.globals.memory.methodsToExec.length-1;t>=0;t--)"addText"!==e.globals.memory.methodsToExec[t].label&&"addAnnotation"!==e.globals.memory.methodsToExec[t].label||e.globals.memory.methodsToExec.splice(t,1);Array.prototype.forEach.call(i,t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})}removeAnnotation(t,e){const i=t.w;this._removeAnnotationTooltip(i);const s=i.dom.baseEl.querySelectorAll(`.${e}`);s&&(i.globals.memory.methodsToExec=i.globals.memory.methodsToExec.filter(t=>t.id!==e),Object.keys(i.config.annotations).forEach(t=>{const s=i.config.annotations[t];Array.isArray(s)&&(i.config.annotations[t]=s.filter(t=>t.id!==e))}),Array.prototype.forEach.call(s,t=>{t.parentElement.removeChild(t)}))}}});h.default.registerFeatures({keyboardNavigation:class{constructor(t,e){this.w=t,this.ctx=e,this.seriesIndex=0,this.dataPointIndex=0,this.active=!1,this._tooltipDismissed=!1,this._announceTimer=void 0,this._focusedEl=null,this._hoveredBarEl=null,this._enlargedScatterMarker=null,this._onKeyDown=this._onKeyDown.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onLegendClick=this._onLegendClick.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._lastPointerDownAt=0}init(){const t=this.w.dom.Paper.node;t&&(t.setAttribute("tabindex","0"),t.addEventListener("focus",this._onFocus),t.addEventListener("blur",this._onBlur),t.addEventListener("mousedown",this._onPointerDown,{capture:!0}),t.addEventListener("pointerdown",this._onPointerDown,{capture:!0}),t.addEventListener("touchstart",this._onPointerDown,{capture:!0,passive:!0}),t.addEventListener("keydown",this._onKeyDown,{passive:!1}),this.ctx.events.addEventListener("legendClick",this._onLegendClick))}destroy(){const t=this.w,e=t.dom.Paper&&t.dom.Paper.node;this.ctx.events.removeEventListener("legendClick",this._onLegendClick),clearTimeout(this._announceTimer),e&&(e.removeEventListener("focus",this._onFocus),e.removeEventListener("blur",this._onBlur),e.removeEventListener("keydown",this._onKeyDown),e.removeEventListener("mousedown",this._onPointerDown,{capture:!0}),e.removeEventListener("pointerdown",this._onPointerDown,{capture:!0}),e.removeEventListener("touchstart",this._onPointerDown,{capture:!0}))}_onPointerDown(){this._lastPointerDownAt=Date.now()}notePointerFocus(){this._lastPointerDownAt=Date.now()}_onFocus(){this._isNavEnabled()&&(Date.now()-this._lastPointerDownAt<100||(this.active=!0,this._clampCursor(),this._snapToVisibleRange(),this._showCurrentPoint()))}_onBlur(){this.active=!1,this._tooltipDismissed=!1,this._hideFocus()}_onLegendClick(){this.active&&(this.active=!1,this._hideFocus())}_onKeyDown(t){var e,i,s;if(this._isNavEnabled()&&this.active){if(t.shiftKey&&("ArrowRight"===t.key||"ArrowLeft"===t.key)&&this._canPan())return t.preventDefault(),void this._panBy("ArrowRight"===t.key?1:-1);switch(t.key){case"ArrowRight":t.preventDefault(),this._move(0,1);break;case"ArrowLeft":t.preventDefault(),this._move(0,-1);break;case"ArrowUp":t.preventDefault(),this._move(-1,0);break;case"ArrowDown":t.preventDefault(),this._move(1,0);break;case"Home":t.preventDefault(),this.dataPointIndex=0,this._skipNullForward(),this._showCurrentPoint();break;case"End":t.preventDefault(),this.dataPointIndex=this._getDataPointCount(this.seriesIndex)-1,this._skipNullBackward(),this._showCurrentPoint();break;case"Enter":case" ":t.preventDefault(),this._fireClick();break;case"+":case"=":this._canZoom()&&(t.preventDefault(),null==(e=this.ctx.toolbar)||e.handleZoomIn(),this._announce("Zoomed in"));break;case"-":case"_":this._canZoom()&&(t.preventDefault(),null==(i=this.ctx.toolbar)||i.handleZoomOut(),this._announce("Zoomed out"));break;case"0":this._canZoom()&&this.w.interact.zoomed&&(t.preventDefault(),null==(s=this.ctx.toolbar)||s.handleZoomReset(),this._announce("Zoom reset"));break;case"Escape":t.preventDefault(),this._tooltipDismissed?(this.active=!1,this._tooltipDismissed=!1,this._hideFocus()):(this._tooltipDismissed=!0,this._hideFocus())}}}_canZoom(){var t,e;const i=this.w,s=null==(t=this.ctx.toolbar)?void 0:t._currentXRange();return Boolean(i.globals.axisCharts&&(null==(e=i.config.chart.zoom)?void 0:e.enabled)&&(i.axisFlags.isXNumeric||i.config.xaxis.convertedCatToNumeric||i.axisFlags.isRangeBar)&&(null==s?void 0:s.minX)<(null==s?void 0:s.maxX))}_canPan(){return this._canZoom()}_panBy(t){const e=this.ctx.toolbar;if(!e)return;const i=e._currentXRange(),s=Number(i.minX),n=Number(i.maxX);if(!isFinite(s)||!isFinite(n)||s===n)return;const r=.1*(n-s)*t;e.zoomUpdateOptions(s+r,n+r),this._announce(t>0?"Panned right":"Panned left")}_move(t,e){var i;const s=this.w,n=s.config.chart.accessibility.keyboard.navigation.wrapAround;if(0!==t){const e=this.w.globals.tooltip,r=s.config.chart.type;if(!("heatmap"===r||"treemap"===r)&&e&&e.tConfig&&e.tConfig.shared){const t=this.dataPointIndex;if(e.tooltipUtil&&e.tooltipUtil.isXoverlap(t)&&e.tooltipUtil.isInitialSeriesSameLen())return}"heatmap"!==r||(null==(i=s.config.yaxis[0])?void 0:i.reversed)||(t=-t);const o=this._getSeriesCount();let a=this.seriesIndex;for(let e=1;e<o;e++){let i=a+t*e;if(n)i=(i+o)%o;else if(i<0||i>=o)break;if(!s.globals.collapsedSeriesIndices.includes(i)){a=i;break}}this.seriesIndex=a;const l=this._getDataPointCount(a);this.dataPointIndex>=l&&(this.dataPointIndex=l-1)}if(0!==e){const t=this._getDataPointCount(this.seriesIndex);let i=this.dataPointIndex+e;i<0&&(i=n?t-1:0),i>=t&&(i=n?0:t-1),this.dataPointIndex=i,e>0?this._skipNullForward():this._skipNullBackward(),this._isDataPointVisible(this.seriesIndex,this.dataPointIndex)||this._snapToVisibleRangeInDirection(e)}this._showCurrentPoint()}_skipNullForward(){const t=this.w,e=this.seriesIndex,i=this._getDataPointCount(e);let s=this.dataPointIndex,n=0;if(Array.isArray(t.seriesData.series[e])){for(;n<i&&null===t.seriesData.series[e][s];)s=(s+1)%i,n++;this.dataPointIndex=s}}_skipNullBackward(){const t=this.w,e=this.seriesIndex,i=this._getDataPointCount(e);let s=this.dataPointIndex,n=0;if(Array.isArray(t.seriesData.series[e])){for(;n<i&&null===t.seriesData.series[e][s];)s=(s-1+i)%i,n++;this.dataPointIndex=s}}_showCurrentPoint(){const{seriesIndex:t,dataPointIndex:e}=this,i=this.w,s=i.globals.tooltip;s&&s.ttItems&&(i.interact.capturedSeriesIndex=t,i.interact.capturedDataPointIndex=e,this._applyFocusClass(t,e),this._showTooltip(t,e,s))}_hideFocus(){var t;const e=this.w,i=e.globals.tooltip;if(this._removeFocusClass(),this._leaveHoveredBar(),!i)return;null==(t=i.tooltipPosition)||t.resetPlacementCache(),i.marker&&i.marker.resetPointsSize(),this._enlargedScatterMarker=null;const s=i.getElTooltip();s&&(s.classList.remove("apexcharts-active"),e.config.chart.accessibility.enabled&&e.config.chart.accessibility.announcements.enabled&&s.setAttribute("aria-hidden","true")),e.dom.baseEl.classList.remove("apexcharts-tooltip-active");const n=i.getElXCrosshairs();n&&n.classList.remove("apexcharts-active")}_showTooltip(t,e,i){const s=this.w,n=s.config.chart.type,r=i.getElTooltip();if(!r)return;const o=i.getCachedDimensions();i.tooltipRect={x:0,y:0,ttWidth:o.ttWidth||0,ttHeight:o.ttHeight||0},this._setSyntheticEvent(t,e,i),s.dom.baseEl.classList.add("apexcharts-tooltip-active"),r.classList.add("apexcharts-active"),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.announcements.enabled&&r.removeAttribute("aria-hidden"),"pie"===n||"donut"===n||"polarArea"===n?this._showTooltipNonAxis(t,e,i,r):"radialBar"===n?this._showTooltipRadialBar(t,e,i,r):"heatmap"===n||"treemap"===n?this._showTooltipHeatTree(t,e,i,r,n):this._isBarLikeSeries(t)?this._showTooltipBar(t,e,i):this._showTooltipAxisLine(t,e,i),i.fixedTooltip&&i.drawFixedTooltipRect()}_isBarLikeSeries(t){var e;const i=this.w,s=i.config.series[t],n=i.globals.comboCharts&&null!=(e=null==s?void 0:s.type)?e:i.config.chart.type;return P.isBarLikeType(n)}_setSyntheticEvent(t,e,i){const s=this.w,n=s.config.chart.type;let r=0,o=0;const a=this._getFocusableElement(t,e),l=a?null:this._canvasCell(t,e)||this._canvasMark(t,e);if(a){const t=a.getBoundingClientRect();r=t.left+t.width/2,o=t.top+t.height/2}else if(l){const t=P.plotRect(s);r=t.left+(l.x+l.width/2)*t.zoom,o=t.top+(l.y+l.height/2)*t.zoom}else if(s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const n=s.globals.pointsArray[t][e];if(i.getElGrid&&i.getElGrid()){const t=P.plotRect(s);r=t.left+(n[0]||0)*t.zoom,o=t.top+(n[1]||0)*t.zoom}}else{const t=s.dom.Paper&&s.dom.Paper.node;if(t){const e=t.getBoundingClientRect();r=e.left+e.width/2,o=e.top+e.height/2}}if(!this._isBarLikeSeries(t)&&("line"===n||"area"===n||"rangeArea"===n||"scatter"===n||"bubble"===n||"radar"===n)&&s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const n=s.globals.pointsArray[t][e];if(i.getElGrid&&i.getElGrid()){const t=P.plotRect(s);r=t.left+(n[0]||0)*t.zoom,o=t.top+(n[1]||0)*t.zoom}}i.e={type:"mousemove",clientX:r,clientY:o},i.clientX=r,i.clientY=o}_showTooltipBar(t,e,i){var s,n,r,o;const c=this.w;c.globals.comboCharts&&(i.marker.resetPointsSize(),this._enlargedScatterMarker=null);const h=i.tConfig.shared&&(i.tooltipUtil.isXoverlap(e)||c.globals.isBarHorizontal)&&i.tooltipUtil.isInitialSeriesSameLen(),d=null==(o=null==(r=null==(n=null==(s=c.rangeData.seriesRange)?void 0:s[t])?void 0:n[e])?void 0:r.y)?void 0:o[0];i.tooltipLabels.drawSeriesTexts(l(a(a({ttItems:i.ttItems,i:t,j:e},void 0!==(null==d?void 0:d.y1)&&{y1:d.y1}),void 0!==(null==d?void 0:d.y2)&&{y2:d.y2}),{shared:h}));const u=`.apexcharts-series[data\\:realIndex='${t}']`,g=this._canvasMark(t,e)?null:c.dom.Paper.findOne(`${u} path[j='${e}'], ${u} circle[j='${e}'], ${u} rect[j='${e}']`);if(g){this._leaveHoveredBar();new v(this.w,this.ctx).pathMouseEnter(g,null),this._hoveredBarEl=g}if(c.globals.isBarHorizontal){const s=i.fixedTooltip;if(!s&&!i.showOnIntersect&&!P.isFollowCursor(c)&&i.tooltipPosition.placeHorizontalSharedTooltip(e))return;const n=this._focusedBarInWrap(t,e,g,i),r=i.getElTooltip();if(n&&r&&!s){const s=i.tooltipRect.ttWidth||0,o=i.tooltipRect.ttHeight||0,a=P.plotInWrap(c),l={top:a.top,bottom:a.top+c.layout.gridHeight,left:a.left,right:a.left+c.layout.gridWidth},h=i.tooltipPosition.placeOnShortPlot((n.left+n.right)/2,n.top,n.bottom);if(h)i.tooltipPosition.applyTooltipPosition(r,h);else if(c.config.tooltip.arrow)i.tooltipPosition.applyTooltipPosition(r,i.tooltipPosition.placeAroundBar(n,l,e,t));else{const t=i.xyRatios&&null!=i.xyRatios.baseLineInvertedY?l.left+i.xyRatios.baseLineInvertedY:(l.left+l.right)/2;let e=(n.left+n.right)/2<t?n.left-s:n.right;if(P.isFollowCursor(c)){const t=(n.left+n.right)/2-l.left+15;e=l.left+(t+s>c.layout.gridWidth?t-s:t)}const a=(n.top+n.bottom)/2-o/2;r.style.left=Math.max(Math.min(e,l.right-s),l.left)+"px",r.style.top=Math.max(Math.min(a,l.bottom-o),l.top)+"px",delete r.dataset.placement}}}else this._pointerHoversOneMark(i)?this._hoverFocusedMark(t,e,g,i):i.tooltipPosition.moveStickyTooltipOverBars(e,t)}_pointerHoversOneMark(t){if(!t.showOnIntersect)return!1;return!(this.w.config.chart.group&&"function"==typeof this.ctx.getSyncedCharts&&this.ctx.getSyncedCharts().length>1)}_hoverFocusedMark(t,e,i,s){const n=this.w,r=this._canvasMark(t,e),o=!r&&(null==i?void 0:i.node)&&["apexcharts-bar-area","apexcharts-candlestick-area","apexcharts-boxPlot-area","apexcharts-rangebar-area","apexcharts-violin-area"].some(t=>i.node.classList.contains(t))?i.node:null;if(!r&&!o)return void s.tooltipPosition.moveStickyTooltipOverBars(e,t);const c=n.dom.Paper.node;s.intersect.handleBarTooltip({e:l(a({},s.e),{type:"mousemove",target:o||c,apexHoverTarget:o||c,apexPaintedHit:r}),opt:{paths:o||c,hoverArea:c,elGrid:s.getElGrid(),tooltipEl:s.getElTooltip(),ttItems:s.ttItems}})}_focusedBarInWrap(t,e,i,s){var n,r,o;const a=this.w,l=("violin"===a.config.chart.type||"violin"===(null==(n=a.config.series[t])?void 0:n.type))&&(null==(r=s.intersect)?void 0:r.violinGlyphRect(t,e))||(null==(o=null==i?void 0:i.node)?void 0:o.getBoundingClientRect())||this._canvasMarkRect(t,e);if(!l)return null;const c=a.dom.elWrap.getBoundingClientRect();return{top:l.top-c.top,bottom:l.bottom-c.top,left:l.left-c.left,right:l.right-c.left}}_showTooltipAxisLine(t,e,i){var s;const n=this.w,r=n.config.chart.type,o=i.tConfig.shared&&i.tooltipUtil.isXoverlap(e)&&i.tooltipUtil.isInitialSeriesSameLen();i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:o});const a="scatter"===r||"bubble"===r||"radar"===r,l=n.globals.markers.largestSize>0&&!n.globals.markers.batched&&"canvas"!==(null==(s=this.ctx.renderer)?void 0:s.kind),c=this._pointerHoversOneMark(i)?this._canvasMarker(t,e):null;c?this._hoverPaintedMarker(c,i):a||l&&!o?this._showScatterBubblePoint(t,e,i)||i.tooltipPosition.moveDynamicPointOnHover(e,t):l?i.marker.enlargePoints(e):o?i.tooltipPosition.moveDynamicPointsOnHover(e):i.tooltipPosition.moveDynamicPointOnHover(e,t)}_canvasMarker(t,e){const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findMarker?i.findMarker(t,e):null}_hoverPaintedMarker(t,e){e.intersect.handlePaintedMarkerTooltip({e:l(a({},e.e),{type:"mousemove"}),opt:{tooltipEl:e.getElTooltip(),ttItems:e.ttItems},marker:{i:t.seriesIndex,j:t.dataPointIndex,cx:t.x,cy:t.y,size:t.size}})}_showScatterBubblePoint(t,e,i){const s=this.w.dom.baseEl;this._enlargedScatterMarker&&(i.marker.oldPointSize(this._enlargedScatterMarker),this._enlargedScatterMarker=null);const n=s.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`);if(!n)return!1;const r=n.querySelector(`.apexcharts-marker[rel='${e}']`);return!!r&&(i.marker.enlargeCurrentPoint(e,r),this._enlargedScatterMarker=r,!0)}_showTooltipNonAxis(t,e,i,s){const n=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:e,shared:!1});const r=s.getBoundingClientRect(),o=r.width||i.tooltipRect.ttWidth||0,a=r.height||i.tooltipRect.ttHeight||0,l=n.dom.baseEl.querySelector(`.apexcharts-pie-area[j='${e}']`),c=i.getSliceAnchor(l);if(c){const t=i.tooltipPosition.placeOverAnchor(c.x,c.y,o,a,10);s.style.left=t.x+"px",s.style.top=t.y+"px"}}_showTooltipRadialBar(t,e,i,s){var n;const r=this.w;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,shared:!1});const{ttWidth:o=0,ttHeight:a=0}=i.getCachedDimensions(),l=r.dom.baseEl.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if(l){const e=parseFloat(null!=(n=l.getAttribute("data:angle"))?n:"")||0,c=(r.config.plotOptions.radialBar.startAngle||0)+e/2,h=r.layout.gridWidth/2,d=r.layout.gridHeight/2,u=r.globals.radialSize||Math.min(r.layout.gridWidth,r.layout.gridHeight)/2,p=r.seriesData.series.length,f=u/Math.max(p,1),m=u-t*f,x=(m+(m-f))/2,y=g.polarToCartesian(h,d,x,c),b=y.x+(r.layout.translateX||0),v=y.y+(r.layout.translateY||0),w=i.tooltipPosition.placeOverAnchor(b,v,o,a,10);s.style.left=w.x+"px",s.style.top=w.y+"px"}}_showTooltipHeatTree(t,e,i,s,n){var r,o;const a=this.w;if(P.isFollowCursor(a)&&this._hoverFocusedCell(t,e,i))return;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:!1});const l=s.getBoundingClientRect(),c=l.width||i.tooltipRect.ttWidth||0,h=l.height||i.tooltipRect.ttHeight||0,d="heatmap"===n?"apexcharts-heatmap-rect":"apexcharts-treemap-rect",u=a.dom.baseEl.querySelector(`.${d}[i='${t}'][j='${e}']`),g=u?null:this._canvasCell(t,e);if(u||g){const t=a.dom.elWrap.getBoundingClientRect();let e=0,l=0,d=0,p=0;if(u){const s=u.getBoundingClientRect();e=s.left-t.left,l=s.top-t.top,d=s.width,p=s.height;const n=parseFloat(null!=(r=u.getAttribute("cx"))?r:""),a=parseFloat(null!=(o=u.getAttribute("width"))?o:"");i.tooltipPosition.moveXCrosshairs(n+a/2)}else if(g){const t=P.plotInWrap(a);e=t.left+g.x,l=t.top+g.y,d=g.width,p=g.height,i.tooltipPosition.moveXCrosshairs(g.x+g.width/2)}let f=e+d+c/2;const m=l+p/2-h/2;e+d>a.layout.gridWidth/2&&(f=e-c/2);const x=i.tooltipPosition.shortPlotPlacement,y=i.tooltipPosition.placeOnShortPlot(e+d/2,l,l+p);if(y)return void i.tooltipPosition.applyTooltipPosition(s,y);if("heatmap"===n&&a.config.tooltip.arrow&&!P.isFollowCursor(a)){const{left:t,top:n}=P.plotInWrap(a);return void i.tooltipPosition.applyTooltipPosition(s,i.tooltipPosition.placeAroundCell({top:l,bottom:l+p,left:e,right:e+d},{top:n,bottom:n+a.layout.gridHeight,left:t,right:t+a.layout.gridWidth},{el:u,ttWidth:c,ttHeight:h}))}s.style.left=f+"px",s.style.top=m+"px",x&&delete s.dataset.placement}}_hoverFocusedCell(t,e,i){const s=this.w,n=s.config.chart.type,r=i.getElTooltip(),o=s.dom.baseEl.querySelector(`.apexcharts-${n}-rect[i='${t}'][j='${e}']`);if(!r||!o&&!this._canvasCell(t,e))return!1;const c=o||s.dom.Paper.node;s.interact.capturedSeriesIndex=-1,s.interact.capturedDataPointIndex=-1;const h=i.intersect.handleHeatTreeTooltip({e:l(a({},i.e),{type:"mousemove",target:c,apexHoverTarget:c}),opt:{ttItems:i.ttItems},x:0,y:0,type:n}),d=!h.noHit&&s.interact.capturedSeriesIndex===t&&s.interact.capturedDataPointIndex===e;return s.interact.capturedSeriesIndex=t,s.interact.capturedDataPointIndex=e,!!d&&(i.placeCellTooltip(r,h),!0)}_canvasCell(t,e){if("heatmap"!==this.w.config.chart.type)return null;const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findCell?i.findCell(t,e):null}_canvasMark(t,e){if(!this._isBarLikeSeries(t))return null;const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findMark?i.findMark(t,e):null}_canvasMarkRect(t,e){const i=this._canvasMark(t,e);if(!i)return null;const s=P.plotRect(this.w),n=s.left+i.x*s.zoom,r=s.top+i.y*s.zoom;return{left:n,top:r,right:n+i.width*s.zoom,bottom:r+i.height*s.zoom}}_applyFocusClass(t,e){this._removeFocusClass();const i=this._getFocusableElement(t,e)||this._getBatchedFocusEl(t)||this._drawCanvasFocusRing(t,e);if(i){i.classList.add("apexcharts-keyboard-focused"),i.setAttribute("role","img");const s=this._buildPointLabel(t,e);s&&i.setAttribute("aria-label",s),this._focusedEl=i}}_getBatchedFocusEl(t){return this.w.globals.markers.batched?this.w.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-series-markers path`):null}_drawCanvasFocusRing(t,e){const i=this._canvasCell(t,e);if(!i)return this._drawCanvasMarkFocusRing(t,e);const s=this.w.dom.baseEl.querySelector(`.apexcharts-heatmap .apexcharts-series[rel='${t+1}']`);if(!s)return null;const n=new v(this.w,this.ctx).drawRect(i.x,i.y,i.width,i.height,i.radius,"none");return n.node.classList.add("apexcharts-keyboard-focus-ring"),n.attr({i:t,j:e}),s.insertBefore(n.node,s.firstChild),n.node}_drawCanvasMarkFocusRing(t,e){const i=this._canvasMark(t,e);if(!i)return this._drawCanvasMarkerFocusRing(t,e);const s=this.w,n=Array.from(s.dom.baseEl.querySelectorAll(".apexcharts-series")).find(e=>e.getAttribute("data:realIndex")===String(t));if(!n)return null;const r=new v(s,this.ctx).drawPath({d:i.d,fill:"none",classes:"apexcharts-keyboard-focus-ring"});return r.attr("clip-path",`url(#gridRectBarMask${s.globals.cuid})`),n.insertBefore(r.node,n.firstChild),r.node}_drawCanvasMarkerFocusRing(t,e){const i=this._canvasMarker(t,e);if(!i)return null;const s=this.w,n=Array.from(s.dom.baseEl.querySelectorAll(".apexcharts-series")).find(e=>e.getAttribute("data:realIndex")===String(t));if(!n)return null;const r=new v(s,this.ctx).drawPath({d:i.d,fill:"none",classes:"apexcharts-keyboard-focus-ring"});return r.attr("clip-path",`url(#gridRectMarkerMask${s.globals.cuid})`),n.appendChild(r.node),r.node}_removeFocusClass(){this._focusedEl&&(this._focusedEl.classList.remove("apexcharts-keyboard-focused"),this._focusedEl.removeAttribute("role"),this._focusedEl.removeAttribute("aria-label"),this._focusedEl.classList.contains("apexcharts-keyboard-focus-ring")&&this._focusedEl.remove(),this._focusedEl=null)}_buildPointLabel(t,e){var i,s,n,r,o,a,l,c;const h=this.w,d=h.config.chart.type,u=h.seriesData.seriesNames||[],g=h.seriesData.series||[];if("pie"===d||"donut"===d||"polarArea"===d){const t=null!=(s=(null==(i=h.labelData)?void 0:i.labels)&&h.labelData.labels[e])?s:"",n=Array.isArray(g)?g[e]:"";return t?`${t}: ${n}`:`${n}`}if("radialBar"===d){return`${u[t]||`Series ${t+1}`}: ${Array.isArray(g)?g[t]:""}`}const p=u[t]||`Series ${t+1}`,f=(Array.isArray(g[t])?g[t]:[])[e];let m=null==f?"":String(f);const x=null==(r=null==(n=h.formatters)?void 0:n.yLabelFormatters)?void 0:r[t];if("function"==typeof x)try{m=x(f,{seriesIndex:t,dataPointIndex:e,w:h})}catch(t){}let y="";const b=null==(o=h.labelData)?void 0:o.categoryLabels,v=null==(l=null==(a=h.seriesData)?void 0:a.seriesX)?void 0:l[t];if(Array.isArray(b)&&null!=b[e])y=String(b[e]);else if(Array.isArray(v)&&null!=v[e]){const i=null==(c=h.formatters)?void 0:c.xLabelFormatter;if("function"==typeof i)try{y=String(i(v[e],{seriesIndex:t,dataPointIndex:e,w:h}))}catch(t){y=String(v[e])}else y=String(v[e])}return y?`${p}: ${m}, ${y}`:`${p}: ${m}`}_leaveHoveredBar(){if(this._hoveredBarEl){new v(this.w,this.ctx).pathMouseLeave(this._hoveredBarEl,null),this._hoveredBarEl=null}}_getFocusableElement(t,e){const i=this.w,s=i.config.chart.type,n=i.dom.baseEl;if("pie"===s||"donut"===s||"polarArea"===s)return n.querySelector(`.apexcharts-pie-area[j='${e}']`);if("heatmap"===s)return n.querySelector(`.apexcharts-heatmap-rect[i='${t}'][j='${e}']`);if("treemap"===s)return n.querySelector(`.apexcharts-treemap-rect[i='${t}'][j='${e}']`);if("radialBar"===s)return n.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if(this._isBarLikeSeries(t))return this._canvasMark(t,e)?null:n.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] path[j='${e}']`);return n.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-marker[rel='${e}']`)||null}_fireClick(){const t=this.w.globals.tooltip;if(!t)return;t.markerClick({type:"mouseup",clientX:0,clientY:0},this.seriesIndex,this.dataPointIndex)}_isNavEnabled(){const t=this.w.config.chart.accessibility;return t.enabled&&t.keyboard.enabled&&t.keyboard.navigation.enabled}_getSeriesCount(){const t=this.w,e=t.config.chart.type;return"pie"===e||"donut"===e||"polarArea"===e?1:t.seriesData.series.length}_getDataPointCount(t){const e=this.w,i=e.config.chart.type;if("pie"===i||"donut"===i||"polarArea"===i)return e.seriesData.series.length;const s=e.seriesData.series;return s[t]&&Array.isArray(s[t])?s[t].length:0}_clampCursor(){const t=this._getSeriesCount();this.seriesIndex>=t&&(this.seriesIndex=t-1),this.seriesIndex<0&&(this.seriesIndex=0);const e=this._getDataPointCount(this.seriesIndex);this.dataPointIndex>=e&&(this.dataPointIndex=e-1),this.dataPointIndex<0&&(this.dataPointIndex=0)}_snapToVisibleRange(){const t=this.w,e=t.globals,i=this.seriesIndex;if(!t.interact.zoomed)return;const s=t.seriesData.seriesX&&t.seriesData.seriesX[i];if(!s||!s.length)return;const n=e.minX,r=e.maxX;if(void 0===n||void 0===r)return;const o=s[this.dataPointIndex];if(o>=n&&o<=r)return;const a=s.length;for(let t=0;t<a;t++)if(s[t]>=n&&s[t]<=r)return void(this.dataPointIndex=t)}_snapToVisibleRangeInDirection(t){const e=this.w,i=e.globals,s=this.seriesIndex,n=e.seriesData.seriesX&&e.seriesData.seriesX[s];if(!n||!n.length)return;const r=i.minX,o=i.maxX;if(void 0===r||void 0===o)return;const a=n.length;if(t>=0){for(let t=0;t<a;t++)if(n[t]>=r&&n[t]<=o)return void(this.dataPointIndex=t)}else for(let t=a-1;t>=0;t--)if(n[t]>=r&&n[t]<=o)return void(this.dataPointIndex=t)}_isDataPointVisible(t,e){const i=this.w,s=i.globals;if(!i.interact.zoomed)return!0;const n=i.seriesData.seriesX&&i.seriesData.seriesX[t];if(!n)return!0;const r=n[e];return void 0===r||r>=s.minX&&r<=s.maxX}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const i=e.dom.baseEl;if(!i)return;const s=i.querySelector(".apexcharts-sr-status");s&&(s.textContent="",clearTimeout(this._announceTimer),this._announceTimer=setTimeout(()=>{s.textContent=t},0))}}});const Y=h.__apex_PathMorphing_parsePath;function j(t,e){if(!(e>0))return[];if(1===e)return[a({},t)];const i=t.width>=t.height,s=i?t.width:t.height,n=i?t.height:t.width,r=n>0?s/n:e;let o=Math.max(1,Math.ceil(Math.sqrt(r*e)));o>e&&(o=e);const l=Math.floor(e/o);let c=e-l*o;const h=[],d=s/o;let u=0;for(let e=0;e<o;e++){const e=l+(c>0?1:0);c>0&&c--;const s=e>0?n/e:0;for(let n=0;n<e;n++)h.push(i?{x:t.x+u,y:t.y+n*s,width:d,height:s}:{x:t.x+n*s,y:t.y+u,width:s,height:d});u+=d}return h}function q(t,e,i){if(!(e>0))return[];const s=t.width>=t.height,n=s?t.width:t.height,r=s?t.height:t.width,o=s?t.y:t.x,a=o+r,l=r>0?n/r:e;let c=Math.max(Math.ceil(Math.sqrt(l*e)),Math.ceil(n/16));c>=1||(c=1),c>e&&(c=e);const h=Math.floor(e/c);let d=e-h*c;const u=[],g=n/c;let p=s?t.x:t.y;for(let t=0;t<c;t++){const t=h+(d>0?1:0);d>0&&d--;const e=[],n=i(p,p+g,s);if(Array.isArray(n))for(let t=0;t<n.length;t++){const i=n[t];if(!i)continue;const s=Math.max(o,Math.min(i[0],i[1])),r=Math.min(a,Math.max(i[0],i[1]));r>s&&e.push([s,r])}e.length||e.push([o,a]);const r=e.reduce((t,e)=>t+(e[1]-e[0]),0),l=e.map(i=>r>0?(i[1]-i[0])/r*t:t/e.length),c=l.map(t=>Math.floor(t));let f=c.reduce((t,e)=>t+e,0);const m=l.map((t,e)=>({i:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac);for(let e=0;f<t;e++,f++)c[m[e%m.length].i]++;for(let t=0;t<e.length;t++){const i=c[t];if(i<=0)continue;const n=e[t][0],r=(e[t][1]-n)/i;for(let t=0;t<i;t++)u.push(s?{x:p,y:n+t*r,width:g,height:r}:{x:n+t*r,y:p,width:r,height:g})}p+=g}return u}function Z(t,e,i,s,n,r){let o=n===i?0:Math.round((t-i)/(n-i)*32767),a=r===s?0:Math.round((e-s)/(r-s)*32767),l=0;for(let t=32768;t>=1;t/=2){const e=(o&t)>0?1:0,i=(a&t)>0?1:0;if(l+=t*t*(3*e^i),0===i){1===e&&(o=t-1-o,a=t-1-a);const i=o;o=a,a=i}}return l}function V(t,e){let i=1/0,s=1/0,n=-1/0,r=-1/0;const o=t.map(t=>{const[o,a]=e(t);return o<i&&(i=o),o>n&&(n=o),a<s&&(s=a),a>r&&(r=a),[o,a]});return t.map((t,e)=>({item:t,d:Z(o[e][0],o[e][1],i,s,n,r)})).sort((t,e)=>t.d-e.d).map(t=>t.item)}function U(t){if(!t||"string"!=typeof t)return null;const e=t.trim();if("#"===e[0]){const t=e.slice(1);return 3===t.length?[parseInt(t[0]+t[0],16),parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),1]:6===t.length||8===t.length?[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),8===t.length?parseInt(t.slice(6,8),16)/255:1]:null}const i=e.match(/^rgba?\(([^)]+)\)$/i);if(i){const t=i[1].split(",").map(t=>parseFloat(t));return t.length<3||t.some(t=>!isFinite(t))?null:[t[0],t[1],t[2],t.length>3?t[3]:1]}return null}function G(t,e){const i=U(t),s=U(e);return i&&s?t=>{const e=Math.round(i[0]+(s[0]-i[0])*t),n=Math.round(i[1]+(s[1]-i[1])*t),r=Math.round(i[2]+(s[2]-i[2])*t),o=i[3]+(s[3]-i[3])*t;return o>=1?`rgb(${e},${n},${r})`:`rgba(${e},${n},${r},${o})`}:null}function K(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}const Q=new Set(["bar","funnel","pyramid","histogram"]),J=new Set(["pie","donut","polarArea","radialBar","gauge"]),tt=new Set(["unit","waffle"]),et=new Set(["treemap","sunburst"]),it=new Set(["boxPlot","violin"]);let st=0;const nt=1500,rt=t=>{t.removeAttribute("opacity"),t.removeAttribute("data-piece-hidden")};function ot(t){return Q.has(t)?"bar":J.has(t)?"radial":tt.has(t)?"unit":et.has(t)?"partition":it.has(t)?"summary":null}h.default.registerFeatures({morphTypeChange:class{constructor(t,e){this.w=t,this.ctx=e,this._snapshot=null,this._shown=!1,this._ghost=null,this._pieceLayer=null,this._pieceCancel=null,this._ghostTimer=void 0}canMorphTypes(t,e){if(t===e)return!1;const i=ot(t),s=ot(e);return!(!i||!s)&&("partition"===i==("partition"===s)||"unit"!==i&&"unit"!==s)}isCompatibleSeriesShape(t,e,i){if(!Array.isArray(i)||0===i.length)return!1;const s=ot(t),n=ot(e);return"unit"===n?!!i.every(t=>"number"==typeof t)||i.every(t=>t&&"object"==typeof t&&Array.isArray(t.data)):"partition"===n||("radial"===n?!!i.every(t=>"number"==typeof t)||1===i.length&&i[0]&&"object"==typeof i[0]&&Array.isArray(i[0].data):"bar"===n||"summary"===n?i.every(t=>t&&"object"==typeof t&&Array.isArray(t.data)):null!==s&&null!==n)}captureBeforeDestroy({fromType:t,toType:e,newSeries:i}){var s;if(this._snapshot=null,this._shown=!1,this._removeGhost(),this._cancelPieces(),!p.isBrowser())return!1;const n=this.w.config.chart.animations;if(!n||!1===n.enabled)return!1;if(n.chartTypeMorph&&!1===n.chartTypeMorph.enabled)return!1;if(n.respectReducedMotion&&$())return!1;if(!this.canMorphTypes(t,e))return!1;if(!this.isCompatibleSeriesShape(t,e,i))return!1;const{marks:r,branches:o,unitDots:a}=this._captureFromDOM(t);if(!r.length)return!1;const l=this._buildMapping(r,t,e,i,o);if(0===l.size)return!1;const c=this.w.globals,h=null==(s=this.w.dom.elGraphical)?void 0:s.node,d=c.layoutTween&&!c.layoutTween.done&&c.layoutTween.graphical===h?c.layoutTween.rect:null,u=c.circleTween,g=u&&!u.done&&(null==h?void 0:h.contains(u.node))?u:null,f=g?g.circle.r/g.target.r:1;this._snapshot={fromType:t,toType:e,mapping:l,oldLayout:{translateX:d?d.x:this.w.layout.translateX||0,translateY:d?d.y:this.w.layout.translateY||0,scale:f,shiftX:g?g.circle.cx-f*g.target.cx:0,shiftY:g?g.circle.cy-f*g.target.cy:0}};const m=ot(t),x=ot(e),y=this._canProbePaths();if("unit"===x&&("bar"===m||"summary"===m||"radial"===m&&y)){const t=this._countUnitSeries(i);this._snapshot.pieceOut=t>0&&t<=nt}else if("unit"===m&&("bar"===x||"summary"===x||"radial"===x&&y&&!/^(radialBar|gauge)$/.test(e))){let t=0;a.forEach(e=>{t+=e.length}),t>0&&t<=nt&&(this._snapshot.pieceIn=!0,this._snapshot.sourceDots=a,this._snapshot.keyOrder=this._targetKeys(x,i))}return!this._needsGhost(t,e)||this._snapshot.pieceOut||this._snapshot.pieceIn||this._captureGhost(),this.w.globals.previousPaths=[],!0}_needsGhost(t,e){return"unit"===ot(t)||"unit"===ot(e)}_captureGhost(){var t,e;const i=null==(t=this.w.dom)?void 0:t.Paper,s=i&&i.node;if(!s||"function"!=typeof s.cloneNode)return;const n=s.cloneNode(!0),r=[".apexcharts-xaxis",".apexcharts-yaxis",".apexcharts-grid",".apexcharts-legend",".apexcharts-title-text",".apexcharts-subtitle-text",".apexcharts-annotations",".apexcharts-zoom-rect",".apexcharts-selection-rect",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs"];if("function"==typeof n.querySelectorAll&&r.forEach(t=>{n.querySelectorAll(t).forEach(t=>{t.remove()})}),"function"==typeof n.querySelectorAll){const t="-ghost"+ ++st,e=new Set;n.querySelectorAll("[id]").forEach(i=>{e.add(i.id),i.id+=t}),n.querySelectorAll("*").forEach(i=>{for(const s of i.attributes){const i=s.value.replace(/(url\(['"]?#|^#)([^'")\s]+)/g,(i,s,n)=>e.has(n)?s+n+t:i);i!==s.value&&(s.value=i)}})}null==(e=n.removeAttribute)||e.call(n,"id"),this._ghost=n}_mountGhost(){var t,e,i;const s=this._ghost;if(!s||!p.isBrowser())return;const n=null==(t=this.w.dom)?void 0:t.elWrap;if(!n||"function"!=typeof n.appendChild)return void(this._ghost=null);const r=s.style;r&&(r.position="absolute",r.left="0",r.top="0",r.background="transparent",r.pointerEvents="none",r.opacity="1"),null==(e=s.setAttribute)||e.call(s,"aria-hidden","true"),null==(i=s.setAttribute)||i.call(s,"class","apexcharts-morph-ghost"),n.appendChild(s);const o=this.getSpeed(),a=Math.max(120,Math.round(.55*o));f.requestAnimationFrame(()=>{r&&(r.transition=`opacity ${a}ms ease-in`,r.opacity="0")}),this._ghostTimer=setTimeout(()=>this._removeGhost(),a+60)}_removeGhost(){clearTimeout(this._ghostTimer);const t=this._ghost;this._ghost=null,null==t||t.remove()}_countUnitSeries(t){if(!Array.isArray(t))return 0;let e=0;for(const i of t){if(!i||"object"!=typeof i||!Array.isArray(i.data))return 0;e+=i.data.length}return e}usesPieceTakeover(){return!(!this._snapshot||!this._snapshot.pieceOut)}claimsTargetMark(t,e){return!!(this._snapshot&&this._snapshot.pieceIn&&this._snapshot.mapping.has(`${t}:${e}`))}_makePieceLayer(){var t,e;const i=null==(t=this.w.dom)?void 0:t.elGraphical,s=i&&i.node;if(!s||"function"!=typeof s.appendChild)return null;const n=f.createElementNS("http://www.w3.org/2000/svg","g");if(!n)return null;n.setAttribute("class","apexcharts-morph-pieces"),n.setAttribute("pointer-events","none");const r=null==(e=this.w.globals)?void 0:e.cuid;return r&&n.setAttribute("clip-path",`url(#gridRectBarMask${r})`),s.appendChild(n),this._pieceLayer=n,n}_revealPieceHidden(){var t;const e=null==(t=this.w.globals.dom)?void 0:t.baseEl;e&&"function"==typeof e.querySelectorAll&&e.querySelectorAll("[data-piece-hidden]").forEach(rt)}_cancelPieces(){this._pieceCancel&&(this._pieceCancel(),this._pieceCancel=null);const t=this._pieceLayer;this._pieceLayer=null,null==t||t.remove(),this._revealPieceHidden()}_canProbePaths(){if(!p.isBrowser())return!1;const t=f.createElementNS("http://www.w3.org/2000/svg","path");return!!t&&"function"==typeof t.isPointInFill}_makeExtentProber(t,e,i){const s=i.ownerDocument.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("d",t),s.setAttribute("fill","#000"),s.setAttribute("stroke","#000"),s.setAttribute("stroke-width","3"),s.setAttribute("visibility","hidden"),i.appendChild(s);const n=s.ownerSVGElement;if("function"!=typeof s.isPointInFill||!n||"function"!=typeof n.createSVGPoint)return i.removeChild(s),null;const r=n.createSVGPoint(),o=(t,e)=>{r.x=t,r.y=e;const i=s;return i.isPointInFill(r)||"function"==typeof i.isPointInStroke&&i.isPointInStroke(r)},a=48;return{intervalsAt:(t,i,s)=>{const n=s?e.y:e.x,r=n+(s?e.height:e.width);if(!(r>n))return null;const l=(t,e)=>s?o(e,t):o(t,e),c=[t+.1*(i-t),(t+i)/2,i-.1*(i-t)],h=(t,e,i)=>{let s=e,n=t;for(let t=0;t<6;t++){const t=(s+n)/2;l(t,i)?n=t:s=t}return(s+n)/2},d=(r-n)/a,u=new Array(49).fill(null);let g=!1;for(const t of c)for(let e=0;e<=a;e++)null===u[e]&&l(n+e*d,t)&&(u[e]=t,g=!0);if(!g)return null;const p=[];let f=-1;for(let t=0;t<=49;t++){const e=t<=a&&null!==u[t];if(e&&f<0&&(f=t),!e&&f>=0){const e=t-1,i=u[f],s=0===f?n:h(n+f*d,n+(f-1)*d,i),o=e===a?r:h(n+e*d,n+(e+1)*d,u[e]);o>s&&p.push([s,o]),f=-1}}return p.length?p:null},dispose:()=>{s.remove()}}}_separatePieces(){var t;const e=this._snapshot,i=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!e||!i)return this._revealPieceHidden();const s=this._readUnitDots(i,new Map);let n=0;if(s.forEach(t=>{n+=t.length}),0===n||n>nt)return this._revealPieceHidden();const r=this._makePieceLayer();if(!r)return this._revealPieceHidden();const o=[],a=r.ownerDocument,l=ot(e.fromType),c="summary"===l||"radial"===l;if(Array.from(s.keys()).sort((t,e)=>t-e).forEach(t=>{var i;const n=s.get(t),l=this.getInitialBBoxFor(t),h=e.mapping.get(`${t}:0`);if(!l||!h)return void n.forEach(t=>rt(t.el));const d=h.fill&&0!==h.fill.indexOf("url(")?h.fill:(null==(i=this.w.globals.colors)?void 0:i[t])||n[0].fill;let u=null;if(c){const e=this.getInitialPathFor(t,0);e&&(u=this._makeExtentProber(e,l,r))}const g=u?q(l,n.length,u.intervalsAt):j(l,n.length);u&&u.dispose();const p=V(g,t=>[t.x+t.width/2,t.y+t.height/2]),f=V(n,t=>[t.x,t.y]);for(let e=0;e<f.length;e++){const i=p[e],s=f[e],n=a.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttribute("data-i",String(t)),n.setAttribute("data-key",s.el.getAttribute("data-key")),n.setAttribute("x",String(i.x)),n.setAttribute("y",String(i.y)),n.setAttribute("width",String(i.width)),n.setAttribute("height",String(i.height)),n.setAttribute("rx","0"),n.setAttribute("fill",String(d)),r.appendChild(n),o.push({el:n,from:{x:i.x,y:i.y,width:i.width,height:i.height,rx:0},to:{x:s.x-s.r,y:s.y-s.r,width:2*s.r,height:2*s.r,rx:s.r},fill:G(d,s.fill),fillEnd:s.fill,delay:0,meta:{dotEl:s.el}})}}),!o.length)return this._cancelPieces();this._runPieces(o,t=>{rt(t.meta.dotEl),t.el.remove()})}_readUnitDots(t,e){return t.querySelectorAll(".apexcharts-unit-area").forEach(t=>{var i;const s=parseInt(null!=(i=t.getAttribute("i"))?i:"",10);if(isNaN(s))return;const n=e=>parseFloat(t.getAttribute(e)),r=t.getAttribute("cx"),o=n("width")||0,a=n("height")||0,l=null!=r?parseFloat(r):n("x")+o/2,c=null!=r?n("cy"):n("y")+a/2,h=(null!=r?n("r"):Math.max(o,a)/2)||3;if(!isFinite(l)||!isFinite(c))return;let d=e.get(s);d||e.set(s,d=[]),d.push({el:t,x:l,y:c,r:h,fill:t.getAttribute("fill")})}),e}_combinePieces(){var t,e;const i=this._snapshot,s=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!(i&&i.sourceDots&&i.keyOrder&&s))return this._revealPieceHidden();const n=this._collectTargetMarks(i.toType);if(!n.size)return this._revealPieceHidden();const{dx:r,dy:o}=this._oldToNew(),a=Array.from(i.sourceDots.keys()).sort((t,e)=>t-e),l=this._makePieceLayer();if(!l)return this._revealPieceHidden();const c=l.ownerDocument,h=[],d=ot(i.toType),u="summary"===d||"radial"===d;for(let t=0;t<a.length;t++){const s=i.sourceDots.get(a[t]),d=i.keyOrder[a[t]],g=d?n.get(d):null,p=g&&this._markD(g),f=p&&this._pathBBox(p);if(!f||!s||!s.length){g&&g.els.forEach(rt);continue}const m={x:f.minX,y:f.minY,width:f.maxX-f.minX,height:f.maxY-f.minY},x=g.fill&&0!==g.fill.indexOf("url(")?g.fill:(null==(e=this.w.globals.colors)?void 0:e[g.realIndex])||s[0].fill,y=u?this._makeExtentProber(p,m,l):null,b=y?q(m,s.length,y.intervalsAt):j(m,s.length);y&&y.dispose();const v=V(b,t=>[t.x+t.width/2,t.y+t.height/2]),w=V(s,t=>[t.x,t.y]),_={remaining:w.length,els:g.els,g:l.appendChild(c.createElementNS("http://www.w3.org/2000/svg","g"))};for(let t=0;t<w.length;t++){const e=w[t],i=v[t],s=c.createElementNS("http://www.w3.org/2000/svg","rect"),n=e.x+r-e.r,a=e.y+o-e.r;s.setAttribute("data-key",d),s.setAttribute("x",String(n)),s.setAttribute("y",String(a)),s.setAttribute("width",String(2*e.r)),s.setAttribute("height",String(2*e.r)),s.setAttribute("rx",String(e.r)),s.setAttribute("fill",String(e.fill||x)),_.g.appendChild(s),h.push({el:s,from:{x:n,y:a,width:2*e.r,height:2*e.r,rx:e.r},to:{x:i.x,y:i.y,width:i.width,height:i.height,rx:0},fill:G(e.fill,x),fillEnd:String(x),delay:0,meta:{markState:_}})}}if(!h.length)return this._cancelPieces();this._runPieces(h,t=>{const e=t.meta.markState;e.remaining--,0===e.remaining&&(e.els.forEach(rt),e.g.remove())})}_markD(t){return t.d||t.els.map(t=>t.getAttribute("pathTo")||t.getAttribute("d")).filter(Boolean).join(" ")}_runPieces(t,e){const i=this.getSpeed(),s=Math.min(300,.35*i),n=Math.max(180,i-s);for(let e=0;e<t.length;e++)t[e].delay=t.length>1?e/(t.length-1)*s:0;this._pieceCancel=function({pieces:t,duration:e,onPieceDone:i,onAllDone:s,alive:n}){let r=!1;const o=Date.now(),a=Math.max(1,e),l=(t,e)=>{const i=t.from,s=t.to,n=t.el;n.setAttribute("x",String(i.x+(s.x-i.x)*e)),n.setAttribute("y",String(i.y+(s.y-i.y)*e)),n.setAttribute("width",String(Math.max(0,i.width+(s.width-i.width)*e))),n.setAttribute("height",String(Math.max(0,i.height+(s.height-i.height)*e))),n.setAttribute("rx",String(Math.max(0,i.rx+(s.rx-i.rx)*e))),t.fill?n.setAttribute("fill",t.fill(e)):e>=1&&t.fillEnd&&n.setAttribute("fill",t.fillEnd)},c=()=>{if(r||n&&!n())return;const e=Date.now()-o;let h=!1;for(let s=0;s<t.length;s++){const n=t[s];if(n._done)continue;const r=(e-n.delay)/a;if(r<1&&(h=!0),r<=0)continue;const o=Math.min(1,r);l(n,K(o)),o>=1&&(n._done=!0,i&&i(n))}h?f.requestAnimationFrame(c):s&&s()};return f.requestAnimationFrame(c),()=>{r=!0}}({pieces:t,duration:n,onPieceDone:e,alive:()=>!this.w.globals.isDestroyed,onAllDone:()=>{this._pieceCancel=null,this._cancelPieces()}})}_collectTargetMarks(t){var e;const i=null==(e=this.w.globals.dom)?void 0:e.baseEl,s=new Map;if(!i)return s;const n=ot(t);if("radial"===n)return i.querySelectorAll(".apexcharts-pie-series .apexcharts-pie-area").forEach((t,e)=>{const i=t.getAttribute("data:pathFinal")||t.getAttribute("d");i&&i.trim()&&s.set(`${e}:0`,{realIndex:e,d:i,fill:t.getAttribute("fill"),els:[t]})}),s;const r="summary"===n?`.apexcharts-${t}-series`:".apexcharts-bar-series";return i.querySelectorAll(`${r} .apexcharts-series`).forEach(t=>{var e;const i=parseInt(null!=(e=t.getAttribute("data:realIndex"))?e:"0",10)||0;let n=0;t.querySelectorAll("path[pathTo]:not(.apexcharts-highlight-part)").forEach(t=>{var e;const r=t.getAttribute("pathTo")||t.getAttribute("d");if(!r||!r.trim())return;const o=parseInt(null!=(e=t.getAttribute("j"))?e:"",10),a=isNaN(o)?n++:o,l=`${i}:${a}`,c=s.get(l);c?c.els.push(t):s.set(l,{realIndex:i,fill:t.getAttribute("fill"),els:[t]})})}),s}_captureFromDOM(t){var e;const i=null==(e=this.w.globals.dom)?void 0:e.baseEl;if(!i)return{marks:[],branches:[],unitDots:new Map};const s=[],n=[],r=new Map,o=ot(t);if("bar"===o){i.querySelectorAll(".apexcharts-bar-series .apexcharts-series").forEach(t=>{var e;const i=parseInt(null!=(e=t.getAttribute("data:realIndex"))?e:"0",10);t.querySelectorAll("path[pathTo]:not(.apexcharts-highlight-part)").forEach((t,e)=>{const n=t.getAttribute("d")||t.getAttribute("pathTo");n&&s.push({realIndex:i,j:e,d:n,fill:t.getAttribute("fill")})})})}else if("summary"===o){const e=new Map;i.querySelectorAll(`.apexcharts-${t}-area`).forEach(t=>{var i,s;const n=parseInt(null!=(i=t.getAttribute("j"))?i:"",10);if(isNaN(n))return;const r=t.getAttribute("d")||t.getAttribute("pathTo");if(!r||!r.trim())return;const o="function"==typeof t.closest?t.closest(".apexcharts-series"):null,a=parseInt(null!=(s=null==o?void 0:o.getAttribute("data:realIndex"))?s:"0",10)||0,l=`${a}:${n}`,c=e.get(l);c?c.d+=` ${r}`:e.set(l,{realIndex:a,j:n,d:r,fill:t.getAttribute("fill")})}),Array.from(e.values()).sort((t,e)=>t.realIndex-e.realIndex||t.j-e.j).forEach(t=>s.push(t))}else if("partition"===o)if("treemap"===t){const t=t=>{var e,i,s,n;const r=parseFloat(null!=(e=t.getAttribute("x"))?e:""),o=parseFloat(null!=(i=t.getAttribute("y"))?i:""),a=parseFloat(null!=(s=t.getAttribute("width"))?s:""),l=parseFloat(null!=(n=t.getAttribute("height"))?n:"");return[r,o,a,l].every(t=>isFinite(t))?`M ${r} ${o} L ${r+a} ${o} L ${r+a} ${o+l} L ${r} ${o+l} Z`:null};i.querySelectorAll(".apexcharts-treemap-rect").forEach(e=>{var i,n;const r=t(e);r&&s.push({realIndex:parseInt(null!=(i=e.getAttribute("i"))?i:"0",10)||0,j:parseInt(null!=(n=e.getAttribute("j"))?n:"0",10)||0,d:r,fill:e.getAttribute("fill"),key:e.getAttribute("data:key")||null})});i.querySelectorAll(".apexcharts-treemap-parent-rect").forEach(e=>{const i=t(e),s=e.getAttribute("data:key");i&&s&&n.push({key:s,d:i,fill:e.getAttribute("fill")})})}else{const t=i.querySelectorAll(".apexcharts-sunburst-arc"),e=[];t.forEach(t=>{"true"===t.getAttribute("data:leaf")&&e.push(t)});(e.length?e:Array.from(t)).forEach((t,e)=>{const i=t.getAttribute("d");i&&i.trim()&&s.push({realIndex:e,j:0,d:i,fill:t.getAttribute("fill"),key:t.getAttribute("data:key")||null})}),t.forEach(t=>{if("true"===t.getAttribute("data:leaf"))return;const e=t.getAttribute("d"),i=t.getAttribute("data:key");e&&e.trim()&&i&&n.push({key:i,d:e,fill:t.getAttribute("fill")})})}else if("unit"===o)this._readUnitDots(i,r),Array.from(r.keys()).sort((t,e)=>t-e).forEach(t=>{const e=r.get(t),i=e.map(t=>t.x),n=e.map(t=>t.y),o=Math.min(...i)-2,a=Math.min(...n)-2,l=Math.max(...i)+2,c=Math.max(...n)+2;s.push({realIndex:t,j:0,d:`M ${o} ${a} L ${l} ${a} L ${l} ${c} L ${o} ${c} Z`,fill:e[0].fill})});else if("radial"===o)if("radialBar"===t||"gauge"===t){const t=this.w.globals.circleGeometry,e=t?t.cx:this.w.layout.gridWidth/2,n=t?t.cy:this.w.layout.gridHeight/2;i.querySelectorAll(".apexcharts-radial-series .apexcharts-radialbar-area").forEach(t=>{var i;const r=t.parentElement,o=parseInt(null!=(i=null==r?void 0:r.getAttribute("data:realIndex"))?i:"0",10),a=t.getAttribute("d");if(!a)return;const l=parseFloat(t.getAttribute("stroke-width")||"0"),c=l>1&&this._radialArcToFilledSegment(a,l,e,n)||a;s.push({realIndex:o,j:0,d:c,fill:t.getAttribute("stroke")})})}else{i.querySelectorAll(".apexcharts-pie-series .apexcharts-pie-area").forEach((t,e)=>{const i=t.getAttribute("d");i&&s.push({realIndex:e,j:0,d:i,fill:t.getAttribute("fill")})})}return{marks:s,branches:n,unitDots:r}}_radialArcToFilledSegment(t,e,i,s){const n=t.match(/M\s*(-?[\d.]+)\s+(-?[\d.]+)\s+A\s*(-?[\d.]+)\s+(?:-?[\d.]+)\s+(?:-?[\d.]+)\s+(\d)\s+(\d)\s+(-?[\d.]+)\s+(-?[\d.]+)/);if(!n)return null;const r=parseFloat(n[1]),o=parseFloat(n[2]),a=parseFloat(n[3]),l=parseInt(n[4],10),c=parseInt(n[5],10),h=parseFloat(n[6]),d=parseFloat(n[7]);if(!isFinite(a)||a<=0)return null;const u=e/2,g=a+u,p=Math.max(0,a-u),f=(t,e,n)=>{const r=t-i,o=e-s,a=Math.sqrt(r*r+o*o);if(0===a)return{x:i,y:s};const l=n/a;return{x:i+r*l,y:s+o*l}},m=f(r,o,g),x=f(h,d,g),y=f(r,o,p),b=f(h,d,p),v=c?0:1;return`M ${m.x} ${m.y} A ${g} ${g} 0 ${l} ${c} ${x.x} ${x.y} L ${b.x} ${b.y} A ${p} ${p} 0 ${l} ${v} ${y.x} ${y.y} Z`}buildRingSegmentPath(t,e,i,s,n,r){const o=s/2,a=i+o,l=Math.max(0,i-o),c=(n-90)*Math.PI/180,h=(r-90)*Math.PI/180,d=t+a*Math.cos(c),u=e+a*Math.sin(c),g=t+a*Math.cos(h),p=e+a*Math.sin(h),f=t+l*Math.cos(c),m=e+l*Math.sin(c),x=t+l*Math.cos(h),y=e+l*Math.sin(h),b=r>n?1:0,v=Math.abs(r-n)>180?1:0;return`M ${d} ${u} A ${a} ${a} 0 ${v} ${b} ${g} ${p} L ${x} ${y} A ${l} ${l} 0 ${v} ${1-b} ${f} ${m} Z`}getFromType(){return this._snapshot?this._snapshot.fromType:null}_buildMapping(t,e,i,s,n){const r=new Map,o=ot(i),a=t.slice().sort((t,e)=>t.realIndex-e.realIndex||t.j-e.j);if("partition"===o&&n&&n.length){const t=a.filter(t=>t.key);t.length===a.length&&(t.forEach(t=>{r.set(`key:${t.key}`,{d:t.d,fill:t.fill})}),n.forEach(t=>{r.set(`key:${t.key}`,{d:t.d,fill:t.fill})}))}const l="unit"===ot(e);if("radial"===o||"unit"===o||"partition"===o)return a.forEach((t,e)=>{r.set(`${l?t.realIndex:e}:0`,{d:t.d,fill:t.fill})}),r;if("bar"===o||"summary"===o){const t=this._targetKeys(o,s);a.forEach((e,i)=>{const s=t[l?e.realIndex:i];s&&r.set(s,{d:e.d,fill:e.fill})})}return r}_targetKeys(t,e){var i;const s=[],n=Array.isArray(e)?e:[];if("radial"===t){const t=1===n.length&&Array.isArray(null==(i=n[0])?void 0:i.data)?n[0].data.length:n.length;for(let e=0;e<t;e++)s.push(`${e}:0`)}else n.forEach((t,e)=>{const i=t&&Array.isArray(t.data)?t.data:[];for(let t=0;t<i.length;t++)s.push(`${e}:${t}`)});return s}isActive(){return null!==this._snapshot}getInitialPathFor(t,e){if(!this._snapshot)return null;const i=this._snapshot.mapping.get(`${t}:${e}`);if(!i)return null;const{k:s,dx:n,dy:r}=this._oldToNew();return 1===s&&0===n&&0===r?i.d:this._translatePathD(i.d,n,r,s)}_oldToNew(){var t,e,i;const s=this._snapshot.oldLayout;return{k:null!=(t=s.scale)?t:1,dx:s.translateX+(null!=(e=s.shiftX)?e:0)-(this.w.layout.translateX||0),dy:s.translateY+(null!=(i=s.shiftY)?i:0)-(this.w.layout.translateY||0)}}_translatePathD(t,e,i,s=1){if(0===e&&0===i&&1===s)return t;const n=Y(t),r=t=>t*s+e,o=t=>t*s+i;return n.map(t=>{const e=t[0];return"Z"===e?"Z":"M"===e||"L"===e||"T"===e?`${e} ${r(t[1])} ${o(t[2])}`:"H"===e?`${e} ${r(t[1])}`:"V"===e?`${e} ${o(t[1])}`:"C"===e?`${e} ${r(t[1])} ${o(t[2])} ${r(t[3])} ${o(t[4])} ${r(t[5])} ${o(t[6])}`:"S"===e||"Q"===e?`${e} ${r(t[1])} ${o(t[2])} ${r(t[3])} ${o(t[4])}`:"A"===e?`${e} ${t[1]*s} ${t[2]*s} ${t[3]} ${t[4]} ${t[5]} ${r(t[6])} ${o(t[7])}`:t.join(" ")}).join(" ")}getInitialCenterFor(t){const e=this.getInitialBBoxFor(t);return e?{x:e.x+e.width/2,y:e.y+e.height/2}:null}getInitialPathAt(t){return this.getInitialPathFor(t,0)}getInitialPathForKey(t){return this._snapshot&&t?this.getInitialPathFor("key",t):null}hasKeyedMarks(){if(!this._snapshot)return!1;for(const t of this._snapshot.mapping.keys())if("string"==typeof t&&t.startsWith("key:"))return!0;return!1}getInitialSlotFor(t,e,i){const s=this.getInitialBBoxFor(t);if(!s)return null;const n=s.x+s.width/2,r=s.y+s.height/2;if(!(i>1&&e>=0))return{x:n,y:r};const o=(Math.min(e,i-1)+.5)/i;return s.height>=s.width?{x:n,y:s.y+s.height*(1-o)}:{x:s.x+s.width*o,y:r}}getInitialBBoxFor(t){if(!this._snapshot)return null;const e=this._snapshot.mapping.get(`${t}:0`);if(!e)return null;const i=this._pathBBox(e.d);if(!i)return null;const{k:s,dx:n,dy:r}=this._oldToNew();return{x:i.minX*s+n,y:i.minY*s+r,width:(i.maxX-i.minX)*s,height:(i.maxY-i.minY)*s}}_pathBBox(t){let e=1/0,i=1/0,s=-1/0,n=-1/0,r=0,o=0,a=0,l=0;const c=(t,r)=>{isFinite(t)&&isFinite(r)&&(t<e&&(e=t),t>s&&(s=t),r<i&&(i=r),r>n&&(n=r))};return Y(t).forEach(t=>{const e=t[0];if("Z"===e)return r=a,void(o=l);const i=t.length,s="H"===e?t[1]:"V"===e?r:t[i-2],n="H"===e?o:"V"===e?t[1]:t[i-1];if("A"===e){if(t[1]){const e=(r-s)/2,i=(o-n)/2,a=(t[4]===t[5]?-1:1)*Math.sqrt(Math.max(0,t[1]*t[1]/(e*e+i*i)-1)),l=r-e+a*i,h=o-i-a*e,d=Math.hypot(r-l,o-h),u=Math.atan2(o-h,r-l),g=2*Math.PI;let p=Math.atan2(n-h,s-l)-u;t[5]&&p<0?p+=g:!t[5]&&p>0&&(p-=g);for(let t=0;t<g;t+=Math.PI/2){((p>0?t-u:u-t)%g+g)%g<=Math.abs(p)&&c(l+d*Math.cos(t),h+d*Math.sin(t))}}}else if("H"!==e&&"V"!==e)for(let e=1;e+1<i;e+=2)c(t[e],t[e+1]);c(s,n),r=s,o=n,"M"===e&&(a=s,l=n)}),e>s?null:{minX:e,minY:i,maxX:s,maxY:n}}getSpeed(){const t=this.w.config.chart.animations;return t.chartTypeMorph&&t.chartTypeMorph.speed||t.speed||600}applyChromeFade(){var t;if(!this._snapshot||!p.isBrowser())return;this._shown=!0;const e=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!e||this._snapshot.resume)return;this._snapshot.pieceOut?this._separatePieces():this._snapshot.pieceIn?this._combinePieces():this._mountGhost();const i=this.getSpeed(),s=Array.from(e.querySelectorAll(".apexcharts-xaxis,.apexcharts-yaxis,.apexcharts-grid,.apexcharts-legend,.apexcharts-title-text,.apexcharts-subtitle-text")).filter(t=>t.style),n=(t,e)=>s.forEach(i=>{i.style.opacity=t,null!=e&&(i.style.transition=e)});n("0",`opacity ${i}ms ease-out`);const r=()=>this.w.globals.isDestroyed;f.requestAnimationFrame(()=>r()||n("1")),setTimeout(()=>r()||n("",""),i+80);const o=this._snapshot;setTimeout(()=>{r()||this._snapshot&&this._snapshot!==o||this.cleanup()},i+100)}retire(){const t=this._snapshot;if(!t||!this._shown)return;const e=this._pieceLayer;this.ctx._unitPieces=t.pieceOut&&e;const i=new Map;null==e||e.querySelectorAll("g").forEach(t=>{const e=t.firstChild&&t.getBBox();e&&i.set(t.firstChild.getAttribute("data-key"),{d:`M${e.x} ${e.y}H${e.x+e.width}V${e.y+e.height}H${e.x}Z`})}),this.cleanup(!0),i.size&&(this._collectTargetMarks(t.toType).forEach((t,e)=>{i.has(e)||i.set(e,{d:this._markD(t)})}),this.w.globals.previousPaths=[],this._snapshot=Object.assign(t,{mapping:i,pieceIn:!1,resume:!0,oldLayout:a({},this.w.layout)}),f.requestAnimationFrame(()=>{this._snapshot===t&&(this._shown=!0)}))}cleanup(t){this._snapshot=null,this._shown=!1,t||this._removeGhost(),this._cancelPieces()}}});const at="__apexcharts_plugins__";function lt(t){return function(){const t=globalThis;return t[at]||(t[at]={}),t[at]}()[t]||null}const ct=Object.freeze({"stroke.dashArray":Object.freeze({type:"number"}),"dataLabels.enabledOnSeries":Object.freeze({type:"boolean"})});function ht(t,e){const i=function(t){return t.weaveClaims||(t.weaveClaims={byOption:new Map}),t.weaveClaims}(t);return i.byOption.has(e)||i.byOption.set(e,[]),i.byOption.get(e)}function dt(t,e){const i=ct[t],s=[];for(const n of Array.isArray(e)?e:[])!n||"string"!=typeof n.series&&"number"!=typeof n.series?console.warn(`[apexcharts] claim on "${t}": each entry needs a series name or index.`):typeof n.value===i.type?s.push({series:n.series,value:n.value}):console.warn(`[apexcharts] claim on "${t}": expected a ${i.type} for series ${String(n.series)}, got ${typeof n.value}.`);return s}const ut=["xaxis","yaxis","points","texts","images"];function gt(t,e){const i=t.globals;return(i.collapsedSeriesIndices||[]).indexOf(e)<0&&(i.ancillaryCollapsedSeriesIndices||[]).indexOf(e)<0}function pt(t,e){const i=e&&e._derived,s=t=>{if(!i)return"core";for(const[e,s]of i)if(s.indexOf(t)>-1)return e;return"core"};return(t.config.series||[]).map((e,i)=>{const n=e&&e.name?String(e.name):`Series ${i+1}`;return{id:`series:${i}`,kind:"series",label:n,owner:s(n),visible:gt(t,i)}})}function ft(t){const e=t.config.annotations||{},i=[];for(const t of ut){(Array.isArray(e[t])?e[t]:[]).forEach((e,s)=>{e&&i.push({id:e.id?String(e.id):`annotation:${t}:${s}`,kind:"annotation",label:mt(e,t,s),owner:e.owner?String(e.owner):"core",visible:!0})})}return i}function mt(t,e,i){const s=t.label&&t.label.text;return s?String(s):t.text?String(t.text):t.id?String(t.id):`${e} annotation ${i+1}`}const xt=Object.freeze(["layer","derived","reserve","pointer","stroke-info","claim","drawn","observations","scale-orientation","highlight"]),yt=["updateOptions","updateSeries","appendData","appendSeries","toggleSeries","showSeries","hideSeries","highlightSeries","isSeriesHidden","zoomX","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","dataURI","exportToCSV"];function bt(t){const e={};return yt.forEach(i=>{"function"==typeof t[i]&&(e[i]=t[i].bind(t))}),Object.freeze(e)}function vt(t,e){const i=t.ctx,s=t.w,n={name:e.def.name,version:7,get options(){return e.options},on(t,i){const s=e.handlers;return s.has(t)||s.set(t,[]),s.get(t).push(i),n},off(t,i){const s=e.handlers.get(t);if(s){const t=s.indexOf(i);t>-1&&s.splice(t,1)}return n},store:{},layer:i=>t._layer(e.def.name,i||{}),get scales(){return t._currentScales},get data(){return t._lastData||(t._lastData=t._dataSnapshot())},theme:Object.freeze({get mode(){return s.config.theme.mode},get foreColor(){return s.config.chart.foreColor},seriesColor:t=>s.globals.colors[t],token:e=>t._token(e)}),chart:bt(i),get info(){return Object.freeze({type:String(s.config.chart&&(s.config.chart.requestedType||s.config.chart.type)||"line"),axisChart:!0===s.globals.axisCharts,datetimeX:!(!s.config.xaxis||"datetime"!==s.config.xaxis.type),horizontalBars:!!(s.config.plotOptions&&s.config.plotOptions.bar&&s.config.plotOptions.bar.horizontal),dataLabels:Object.freeze({enabled:!(!s.config.dataLabels||!s.config.dataLabels.enabled),enabledOnSeries:Array.isArray(s.config.dataLabels&&s.config.dataLabels.enabledOnSeries)?s.config.dataLabels.enabledOnSeries.slice():null}),stroke:Object.freeze({dashArray:Array.isArray(s.config.stroke&&s.config.stroke.dashArray)?s.config.stroke.dashArray.slice():s.config.stroke&&s.config.stroke.dashArray||0}),title:String(s.config.title&&s.config.title.text||"")})},get categories(){return t._categories()},markDerived:i=>(t._markDerived(e.def.name,i),n),reserve:i=>(t._reserve(e.def.name,i),n),claim(t,i){const n=function(t,e,i,s){if(!Object.prototype.hasOwnProperty.call(ct,i))return console.warn(`[apexcharts] "${i}" is not a claimable option. Claimable: ${Object.keys(ct).join(", ")}.`),null;const n={owner:e,option:i,entries:dt(i,s)};return ht(t,i).push(n),n}(s,e.def.name,t,i);return n?Object.freeze({release(){!function(t,e){if(!t.weaveClaims||!e)return;const i=t.weaveClaims.byOption.get(e.option);if(!i)return;const s=i.indexOf(e);s>-1&&i.splice(s,1)}(s,n)},update(e){n.entries=dt(t,e)}}):null},highlight:i=>t._highlight(e.def.name,i),drawn:()=>Object.freeze(function(t,e){const i=[];if(e&&e._declared)for(const[t,s]of e._declared)for(const e of s)i.push({id:`overlay:${t}:${e.id}`,kind:"overlay",label:e.label,owner:t,visible:!1!==e.visible});return[...pt(t,e),...ft(t),...i]}(s,t).map(t=>Object.freeze(t))),declare:i=>(t._declare(e.def.name,i),n),pointer:i=>t._onPointer(e.def.name,i),emit(t,s){i.events.fireEvent(`plugin:${e.def.name}:${t}`,[i,s])},get el(){return s.dom.baseEl}},r=wt,o=xt.filter(t=>r[t](n)),a=new Set(o),l=n;return l.capabilities=Object.freeze(o),l.can=t=>a.has(t),Object.freeze(n)}const wt={layer:t=>"function"==typeof t.layer,derived:t=>"function"==typeof t.markDerived,reserve:t=>"function"==typeof t.reserve,pointer:t=>"function"==typeof t.pointer,"stroke-info":t=>!(!t.info||!t.info.stroke),claim:t=>"function"==typeof t.claim,drawn:t=>"function"==typeof t.drawn&&"function"==typeof t.declare,observations:()=>!0,"scale-orientation":()=>!0,highlight:t=>"function"==typeof t.highlight};function _t(t){const e=[];for(const i of Array.isArray(t)?t:[])!i||"string"!=typeof i.series&&"number"!=typeof i.series?console.warn("[apexcharts] highlight: each entry needs a series name or index."):Array.isArray(i.values)?e.push({series:i.series,values:i.values.map(t=>"number"==typeof t&&Number.isFinite(t)?t:null)}):console.warn(`[apexcharts] highlight: expected an array of values for series ${String(i.series)}, got ${typeof i.values}.`);return e}const At=class t{constructor(t,e){this.w=t,this.ctx=e,this.active=[],this._layers=new Map,this._currentScales=null,this._lastPluginsRef=null,this._lastData=null,this._updatedWired=!1,this._derived=null,this._reserved=null,this._reserveTimer=null,this._highlightTimer=null,this._pointerSubs=null,this._declared=null,this._pointerWired=null,this._onUpdated=this._onUpdated.bind(this),this._init()}_init(){(this.w.config.plugins||[]).map((t,e)=>({entry:t,order:null!=t.order?t.order:e})).sort((t,e)=>t.order-e.order).forEach(t=>this._activate(t.entry)),this._lastPluginsRef=this.w.config.plugins,this._wireUpdated()}_wireUpdated(){this._updatedWired||(this.ctx.addEventListener("updated",this._onUpdated),this._updatedWired=!0)}_onUpdated(){this._repairInitialSeries(),this.dispatch("afterUpdate",{pass:"update"})}_activate(t){const e=lt(t.name);if(!e)return void console.error(`[apexcharts] plugin "${t.name}" is not registered.`);const i=null!=e.apiVersion?Math.trunc(e.apiVersion):1;if(!(i>=1)||i>7)return void console.error(`[apexcharts] plugin "${e.name}" targets Weave API v${e.apiVersion}, host is v7; skipped.`);const s={def:e,options:Object.freeze(a({},t.options||{})),handlers:new Map,disabled:!1,failures:0,api:null};s.api=vt(this,s),this.active.push(s),this._guard(s,"setup",()=>e.setup(s.api))}dispatch(t,e){if("draw"===t&&(this._reconcile(),this._resetLayers()),this._lastData=null,!this.active.length)return;"afterParse"===t?this._currentScales=null:e&&"xyRatios"in e&&this._setScales(e.xyRatios);const i=e&&e.pass||"full";let s=null;for(const e of this.active){if(e.disabled)continue;const n=e.handlers.get(t);if(!n||!n.length)continue;null===s&&(s=this._dataSnapshot(),this._lastData=s);const r={api:e.api,scales:this._currentScales,data:s,pass:i,hook:t};for(const i of n.slice())this._guard(e,t,()=>i(r))}}_guard(t,e,i){if(!t.disabled)try{i()}catch(i){console.error(`[apexcharts] plugin "${t.def.name}" threw in "${e}":`,i),t.failures=(t.failures||0)+1,t.failures>=3&&(t.disabled=!0,this._forget(t.def.name),console.error(`[apexcharts] plugin "${t.def.name}" disabled after repeated errors.`))}}_setScales(t){const e=this.w,i=e.globals,s=e.layout;if(!t||!i.axisCharts)return void(this._currentScales=null);const n=t.xRatio,r=t.yRatio||[],o=t=>null!=r[t]?r[t]:r[0],a=t=>null!=i.maxYArr[t]?i.maxYArr[t]:i.maxY,l=t=>null!=i.minYArr[t]?i.minYArr[t]:i.minY,c=!!i.isBarHorizontal,h=!!e.axisFlags.isRangeBar,d=i.dataPoints>0&&(!e.axisFlags.isXNumeric||c),u=c&&h?e.labelData.labels.length:i.dataPoints,g=c?s.gridHeight:s.gridWidth,p=d&&u>0?g/u:0,f=new Map;if(d){(h?e.labelData.labels:e.axisFlags.isXNumeric&&e.seriesData.seriesX[i.maxValsInArrayIndex]||[]).forEach((t,e)=>{f.has(t)||f.set(t,e)})}const m=d?t=>p*((f.has(t)?f.get(t):t)+.5):t=>(t-i.minX)/n,x=t=>{const s=i.seriesYAxisReverseMap&&i.seriesYAxisReverseMap[t];return e.config.yaxis[null!=s?s:t]||e.config.yaxis[0]},b=t=>{const e=x(t);return!(!e||!e.reversed)};let v=null;const w=c?(t,e=0)=>{const i=Math.abs(a(e)-l(e)),n=i?(t-l(e))/i*s.gridWidth:0;return b(e)?s.gridWidth-n:n}:(t,n=0)=>{const r=((t,s)=>{const n=x(s);return n&&n.logarithmic&&!i.invalidLogScale?(v||(v=new y(e)),v.getLogVal(n.logBase,t,s)):null})(t,n);return null!==r?b(n)?r*s.gridHeight:(1-r)*s.gridHeight:b(n)?(t-l(n))/o(n):(a(n)-t)/o(n)};this._currentScales={x:m,y:w,domainX:d?[-.5,u-.5]:[i.minX,i.maxX],domainY:(t=0)=>[l(t),a(t)],transposed:c,point:(t,e,i=0)=>c?{x:w(e,i),y:m(t)}:{x:m(t),y:w(e,i)},gridWidth:s.gridWidth,gridHeight:s.gridHeight,ratios:t}}_dataSnapshot(){const t=this.w,e=t.globals,i=t.seriesData.series||[],s=t.seriesData.seriesX||[],n=Array.isArray(t.config.series)?t.config.series:[];return i.map((i,r)=>{const o=Array.isArray(i)?i:[i],a=s[r]||[],l=o.map((t,e)=>({x:null!=a[e]?a[e]:e,y:t})),c=n[r],h=c&&"object"==typeof c&&Array.isArray(c.data)?c.data:[],d=t.seriesObservations?t.seriesObservations[r]:null,u=d?{values:d.values.slice(),byPoint:d.byPoint.map(t=>t?t.slice():null)}:null;return{name:e.seriesNames?e.seriesNames[r]:void 0,hidden:(e.collapsedSeriesIndices||[]).includes(r),color:e.colors?e.colors[r]:void 0,points:l,raw:h,observations:u}})}_categories(){const t=this.w,e=t.globals,i=t.config.xaxis&&Array.isArray(t.config.xaxis.categories)?t.config.xaxis.categories:[],s=Array.isArray(e.categoryLabels)?e.categoryLabels:[],n=Array.isArray(e.labels)?e.labels:[],r=i.length?i:s.length?s:n,o=t.seriesData.series||[];let a=0;for(let t=0;t<o.length;t++){const e=o[t];Array.isArray(e)&&e.length>a&&(a=e.length)}a||(a=r.length);const l=[];for(let t=0;t<a;t++){const e=r[t];l.push(String(null==e?t+1:e))}return l}_markDerived(t,e){this._derived||(this._derived=new Map);const i=Array.isArray(e)?e.map(t=>String(t)):[];i.length?this._derived.set(t,i):this._derived.delete(t),this._repairInitialSeries()}_onPointer(t,e){if("function"!=typeof e)return()=>{};this._pointerSubs||(this._pointerSubs=new Map);const i=this._pointerSubs.get(t)||[];return i.push(e),this._pointerSubs.set(t,i),this._wirePointer(),()=>{const i=this._pointerSubs&&this._pointerSubs.get(t);if(!i)return;const s=i.indexOf(e);s>-1&&i.splice(s,1)}}_wirePointer(){if(this._pointerWired)return;if(!this.ctx||"function"!=typeof this.ctx.addEventListener)return;const t=[["enter","dataPointMouseEnter"],["leave","dataPointMouseLeave"],["select","dataPointSelection"]];this._pointerWired=[];for(const[e,i]of t){const t=(t,i,s)=>{this._emitPointer(e,s,t)};this.ctx.addEventListener(i,t),this._pointerWired.push([i,t])}}_emitPointer(e,i,s){if(!this._pointerSubs||!this._pointerSubs.size)return;const n=i&&"number"==typeof i.seriesIndex?i.seriesIndex:-1,r=i&&"number"==typeof i.dataPointIndex?i.dataPointIndex:-1,o=this._categories()||[],a=this.w,l=a&&a.config&&a.config.series||[],c={type:e,seriesIndex:n,dataPointIndex:r,category:r>-1?o[r]:void 0,seriesName:t._seriesName(l,n),selected:"select"===e?t._isSelected(i,n,r):void 0,modifiers:t._modifiers(s)};for(const[t,e]of this._pointerSubs){const i=this.active.find(e=>e.def.name===t);if(i)for(const t of e.slice())this._guard(i,"pointer",()=>t(c))}}static _seriesName(t,e){if(e<0)return;const i=t[e];return i&&"object"==typeof i&&"string"==typeof i.name?i.name:void 0}static _isSelected(t,e,i){const s=t&&t.selectedDataPoints;if(!Array.isArray(s)||e<0)return;const n=s[e];return!!Array.isArray(n)&&n.indexOf(i)>-1}static _modifiers(t){return Object.freeze({shift:!(!t||!t.shiftKey),ctrl:!(!t||!t.ctrlKey),alt:!(!t||!t.altKey),meta:!(!t||!t.metaKey)})}_reserve(e,i){const s=t._normaliseBox(i),n=this._reserved?this._reserved.get(e):void 0;if(s){if(n&&n.left===s.left&&n.right===s.right&&n.top===s.top&&n.bottom===s.bottom)return;this._reserved||(this._reserved=new Map),this._reserved.set(e,s)}else{if(!n||!this._reserved)return;this._reserved.delete(e)}this._resizeForReservation()}static _normaliseBox(t){if(!t||"object"!=typeof t)return null;const e=t=>Number.isFinite(t)&&t>0?Math.round(t):0,i={left:e(t.left),right:e(t.right),top:e(t.top),bottom:e(t.bottom)};return i.left||i.right||i.top||i.bottom?i:null}reservedBox(){if(!this._reserved||0===this._reserved.size)return t.NO_RESERVATION;const e={left:0,right:0,top:0,bottom:0};for(const t of this._reserved.values())e.left+=t.left,e.right+=t.right,e.top+=t.top,e.bottom+=t.bottom;return e}_resizeForReservation(){null==this._reserveTimer&&(this._reserveTimer=setTimeout(()=>{this._reserveTimer=null;const t=this.w.globals;t.isDestroyed||(t.resized=!0,t.dataChanged=!1,this._update("a plugin reservation"))},0))}_update(t){try{Promise.resolve(this.ctx.update()).catch(e=>console.error(`[apexcharts] re-render for ${t} failed:`,e))}catch(t){}}_highlight(t,e){const i=this.w,s=this.ctx.highlightFilter;if(!s)return null;if(!i.globals.axisCharts)return null;if(!s.canDrawParts())return null;if(s.callerCarriesParts())return null;const n=function(t,e,i){const s=_t(i);if(!s.length)return null;const n={owner:e,entries:s};return function(t){return t.weaveHighlights||(t.weaveHighlights={records:[]}),t.weaveHighlights}(t).records.push(n),n}(i,t,e);return n?(this._redrawForHighlight(),Object.freeze({release:()=>{!function(t,e){if(!t||!t.weaveHighlights||!e)return;const i=t.weaveHighlights.records,s=i.indexOf(e);s>-1&&i.splice(s,1)}(i,n),this._redrawForHighlight()},update:t=>{n.entries=_t(t),this._redrawForHighlight()}})):null}_redrawForHighlight(){null==this._highlightTimer&&(this._highlightTimer=setTimeout(()=>{this._highlightTimer=null;const t=this.w.globals;t.isDestroyed||(t.dataChanged=!0,this._update("plugin highlight parts"))},0))}_derivedNames(){const t=new Set;if(!this._derived)return t;for(const e of this._derived.values())for(const i of e)t.add(i);return t}_repairInitialSeries(){const t=this._derivedNames();if(!t.size)return;const e=this.w.globals,i=e=>!t.has(String(e&&e.name)),s=t=>{if(!Array.isArray(t))return null;const e=t.filter(i);return e.length&&e.length!==t.length?e:null};try{const t=s(e._initialSeriesPeek);t&&(e.initialSeries=t);const i=e.initialConfig,n=i&&s(i.series);n&&(i.series=n)}catch(t){}}_token(t){const e=this.w,i=e.globals;switch(t){case"foreColor":return e.config.chart.foreColor;case"background":return e.config.chart.background;case"accent":case"primary":return i.colors?i.colors[0]:void 0;default:return/^series-\d+$/.test(t)&&i.colors?i.colors[Number(t.split("-")[1])]:void 0}}_layer(t,{z:e="front",className:i=""}={}){let s=this._layers.get(t);if(!s){s=this.ctx.graphics.group({class:`apexcharts-plugin-${t} ${i}`.trim()});const n=this.w.dom.elGraphical.node;"behind"===e?n.insertBefore(s.node,n.firstChild):n.appendChild(s.node),s.node.setAttribute("aria-hidden","true"),this._layers.set(t,s)}return function(t,e,i){const s=e=>(e&&t.add(e),e),n={get node(){return t.node},path(t={}){const{d:i="",stroke:n="#000",width:r=1,fill:o="none",opacity:a=1,dash:l=0,className:c=""}=t;return s(e.drawPath({d:i,stroke:n,strokeWidth:r,fill:o,fillOpacity:"none"===o?0:a,strokeOpacity:a,strokeDashArray:l,classes:c}))},line(t={}){const{x1:i,y1:n,x2:r,y2:o,stroke:a="#000",width:l=1,dash:c=0}=t;return s(e.drawLine(i,n,r,o,a,c,l))},rect(t={}){const{x:i=0,y:n=0,w:r=0,h:o=0,r:a=0,fill:l="#000",stroke:c=null,opacity:h=1}=t;return s(e.drawRect(i,n,r,o,a,l,h,null!=c?1:null,c))},circle(t={}){const{cx:i=0,cy:n=0,r:r=0,fill:o="#000",stroke:a=null}=t;return s(e.drawCircle(r,{cx:i,cy:n,fill:o,stroke:a||"none"}))},text(t={}){const{x:i=0,y:n=0,text:r="",color:o,size:a,anchor:l="start",weight:c}=t;return s(e.drawText({x:i,y:n,text:r,textAnchor:l,fontSize:a,foreColor:o,fontWeight:c}))},clear(){const e=t.node;for(;e.firstChild;)e.removeChild(e.firstChild);return i&&i(),n}};return n}(s,this.ctx.graphics,()=>this._undeclare(t))}_undeclare(t){this._declared&&this._declared.delete(t)}_resetLayers(){const t=this.w.dom.elGraphical,e=t&&t.node;if(e){const t=e.querySelectorAll('g[class*="apexcharts-plugin-"]');Array.prototype.forEach.call(t,t=>t.remove())}this._layers.clear(),this._declared=null}_declare(t,e){if(!e||"string"!=typeof e.id||!e.id)return void console.warn(`[apexcharts] plugin "${t}" declared something with no id; ignored.`);this._declared||(this._declared=new Map);const i=this._declared.get(t)||[],s={id:e.id,label:e.label?String(e.label):e.id,visible:!1!==e.visible},n=i.findIndex(t=>t.id===s.id);n>-1?i[n]=s:i.push(s),this._declared.set(t,i)}_reconcile(){const t=this.w.config.plugins||[];if(t===this._lastPluginsRef)return;this._lastPluginsRef=t;const e=new Map(t.map((t,e)=>[t.name,{entry:t,order:null!=t.order?t.order:e}]));for(let t=this.active.length-1;t>=0;t--){const i=this.active[t],s=e.get(i.def.name);s?i.options=Object.freeze(a({},s.entry.options||{})):(this._guard(i,"destroy",()=>i.def.destroy&&i.def.destroy(i.api)),this.active.splice(t,1),this._forget(i.def.name))}const i=new Set(this.active.map(t=>t.def.name)),s=[];e.forEach((t,e)=>{i.has(e)||s.push(t)}),s.sort((t,e)=>t.order-e.order).forEach(t=>this._activate(t.entry))}_forget(t){const e=this.w,i=function(t,e){if(!t.weaveClaims)return!1;let i=!1;for(const[s,n]of t.weaveClaims.byOption){const r=n.filter(t=>t.owner!==e);r.length!==n.length&&(t.weaveClaims.byOption.set(s,r),i=!0)}return i}(e,t),s=function(t,e){if(!t||!t.weaveHighlights)return!1;const i=t.weaveHighlights.records,s=i.filter(t=>t.owner!==e);return s.length!==i.length&&(t.weaveHighlights.records=s,!0)}(e,t);this._pointerSubs&&this._pointerSubs.delete(t),this._derived&&this._derived.delete(t),this._declared&&this._declared.delete(t);const n=!(!this._reserved||!this._reserved.has(t));this._reserve(t,null),!i&&!s||n||this._redrawForHighlight()}teardown(t){if(!t){this.dispatch("destroy");for(const t of this.active)this._guard(t,"destroy",()=>t.def.destroy&&t.def.destroy(t.api));for(const t of this.active)this._forget(t.def.name);if(this.active=[],this._derived=null,this._reserved=null,this._pointerSubs=null,this._declared=null,this._pointerWired){for(const[t,e]of this._pointerWired)this.ctx.removeEventListener&&this.ctx.removeEventListener(t,e);this._pointerWired=null}null!=this._reserveTimer&&(clearTimeout(this._reserveTimer),this._reserveTimer=null),null!=this._highlightTimer&&(clearTimeout(this._highlightTimer),this._highlightTimer=null),this._updatedWired&&(this.ctx.removeEventListener&&this.ctx.removeEventListener("updated",this._onUpdated),this._updatedWired=!1)}this._layers.clear()}};var St,Ct,Et;St=At,Ct="NO_RESERVATION",Et=Object.freeze({left:0,right:0,top:0,bottom:0}),o(St,"symbol"!=typeof Ct?Ct+"":Ct,Et);let kt=At;h.default.registerFeatures({weave:kt}),h.default._customSeriesFactory=function(t,e){const i=class{constructor(t,e,i){this.w=t,this.ctx=e,this.xyRatios=i,this._warned=!1}draw(i,s,n){var r,o;const a=this.w,l=new v(a,this.ctx),c=function(t,e){const i=t&&t.renderer;return i&&i.kind&&"svg"!==i.kind?i:e}(this.ctx,l),h=l.group({class:"apexcharts-marks-series"});return i.forEach((i,s)=>{var r;const o=Array.isArray(n)?n[s]:s,d=l.group({class:"apexcharts-series",rel:o+1,seriesName:g.escapeString(a.seriesData.seriesNames[o]),"data:realIndex":o}),u=this._scales(o,(a.seriesData.series[o]||[]).length),p=a.globals.colors[o],f=(null==(r=a.config.series[o])?void 0:r.data)||[],m=a.seriesData.seriesX[o]||[],x=a.seriesData.series[o]||[];a.globals.seriesXvalues[o]=[],a.globals.seriesYvalues[o]=[],void 0===a.globals.pointsArray[o]&&(a.globals.pointsArray[o]=[]);for(let i=0;i<x.length;i++){const s=x[i];if(null==s)continue;const n=m[i],r=u.xAt(i,n),l=u.y(s),h=this._api(c,d,o,i);try{e.renderItem({datum:f[i],x:r,y:l,scales:u,api:h,seriesIndex:o,dataPointIndex:i,color:p})}catch(e){this._warned||(console.warn(`[apexcharts] renderItem for series type "${t}" threw; skipping datum:`,e),this._warned=!0)}a.globals.seriesXvalues[o][i]=r,a.globals.seriesYvalues[o][i]=l,a.globals.pointsArray[o][i]=[r,l]}l.setupEventDelegation(d,".apexcharts-marks-mark"),h.add(d)}),null==(o=null==(r=this.ctx.animations)?void 0:r.animationCompleted)||o.call(r,h),h}_scales(t,e){var i,s,n,r;const o=this.w.globals,a=this.w.config,l=this.xyRatios.xRatio,c=this.xyRatios.yRatio,h=null!=(s=null==(i=o.seriesYAxisReverseMap)?void 0:i[t])?s:0,d=Array.isArray(c)?null!=(n=c[h])?n:c[0]:c,u=o.maxYArr,g=Array.isArray(u)&&u.length&&null!=(r=u[h])?r:o.maxY,p=o.gridWidth,f=o.gridHeight,m=!o.isXNumeric,x=e||o.dataPoints||1,y=x>0?p/x:p,b="on"===a.xaxis.tickPlacement,v=t=>l?(t-o.minX)/l:p/2,w=o.minXDiff||1;return{x:v,xAt:(t,e)=>m?b&&x>1?t/(x-1)*p:(t+.5)*y:v(e),y:t=>(g-t)/d,gridWidth:p,gridHeight:f,band:m?y:l?w/l:p}}_api(t,e,i,s){const n=t=>{if(t){try{t.node.setAttribute("index",String(i)),t.node.setAttribute("j",String(s)),t.node.classList.add("apexcharts-marks-mark")}catch(t){}e.add(t)}return t};return{path:(e={})=>{var i,s,r,o,a,l,c,h,d;return n(t.drawPath({d:e.d||"",stroke:null!=(i=e.stroke)?i:"#000",strokeWidth:null!=(r=null!=(s=e.width)?s:e.strokeWidth)?r:1,fill:null!=(o=e.fill)?o:"none",fillOpacity:null!=(l=e.fillOpacity)?l:e.fill&&"none"!==e.fill?null!=(a=e.opacity)?a:1:0,strokeOpacity:null!=(h=null!=(c=e.strokeOpacity)?c:e.opacity)?h:1,strokeDashArray:null!=(d=e.dash)?d:0,strokeLinecap:e.lineCap}))},line:(e={})=>{var i,s,r,o;return n(t.drawLine(e.x1,e.y1,e.x2,e.y2,null!=(i=e.stroke)?i:"#000",null!=(s=e.dash)?s:0,null!=(o=null!=(r=e.width)?r:e.strokeWidth)?o:1))},rect:(e={})=>{var i,s,r,o,a,l,c,h;return n(t.drawRect(null!=(i=e.x)?i:0,null!=(s=e.y)?s:0,null!=(r=e.w)?r:0,null!=(o=e.h)?o:0,null!=(a=e.r)?a:0,null!=(l=e.fill)?l:"#000",null!=(c=e.opacity)?c:1,null!=e.stroke?null!=(h=e.strokeWidth)?h:1:null,e.stroke))},circle:(e={})=>{var i,s,r,o,a;return n(t.drawCircle(null!=(i=e.r)?i:0,{cx:null!=(s=e.cx)?s:0,cy:null!=(r=e.cy)?r:0,fill:null!=(o=e.fill)?o:"#000",stroke:e.stroke||"none","stroke-width":null!=(a=e.strokeWidth)?a:e.stroke?1:0}))},text:(e={})=>{var i,s,r,o;return n(t.drawText({x:null!=(i=e.x)?i:0,y:null!=(s=e.y)?s:0,text:null!=(r=e.text)?r:"",textAnchor:null!=(o=e.anchor)?o:"start",fontSize:e.size,foreColor:e.color,fontWeight:e.weight}))}}}};return i.dataType=e.dataType||"xy",i.yExtent="function"==typeof e.yExtent?e.yExtent:null,i};class Mt{constructor(t,e){if(this.w=t,this.ctx=e,"os"!==t.config.theme.follow||!p.isBrowser())return;const i=this._ensureMedia();i&&(this._applyToConfig(i),this._ensureListeners(i))}_ensureMedia(){if(!this.ctx._osThemeMedia){const t=f.matchMedia("(prefers-color-scheme: dark)"),e=f.matchMedia("(prefers-contrast: more)");if(!t&&!e)return null;this.ctx._osThemeMedia={dark:t,contrast:e,handler:null}}return this.ctx._osThemeMedia}_applyToConfig(t){const e=this.w.config.theme;t.dark&&(e.mode=t.dark.matches?"dark":"light"),t.contrast&&t.contrast.matches&&(e.accessibility=e.accessibility||{},e.accessibility.colorBlindMode="highContrast")}_ensureListeners(t){if(t.handler)return;const e=this.ctx,i=()=>{const t=e._osThemeMedia;if(!t)return;const i={mode:t.dark&&t.dark.matches?"dark":"light"};t.contrast&&t.contrast.matches?i.accessibility={colorBlindMode:"highContrast"}:i.accessibility={colorBlindMode:""},e.updateOptions({theme:i},!1,!0,!1)};Mt._add(t.dark,i),Mt._add(t.contrast,i),t.handler=i}teardown(){const t=this.ctx._osThemeMedia;t&&(t.handler&&(Mt._remove(t.dark,t.handler),Mt._remove(t.contrast,t.handler)),this.ctx._osThemeMedia=null)}static _add(t,e){t&&("function"==typeof t.addEventListener?t.addEventListener("change",e):"function"==typeof t.addListener&&t.addListener(e))}static _remove(t,e){t&&("function"==typeof t.removeEventListener?t.removeEventListener("change",e):"function"==typeof t.removeListener&&t.removeListener(e))}}h.default.registerFeatures({osThemeWatcher:Mt});const Pt="__apexcharts_series_transforms__";function It(t,e){t&&"string"==typeof t?"function"==typeof e?globalThis[Pt][t]=e:console.warn(`ApexCharts: registerSeriesTransform("${t}") expects a function (series, w) => series.`):console.warn("ApexCharts: registerSeriesTransform requires a non-empty name.")}globalThis[Pt]||(globalThis[Pt]={});const Lt="__apexcharts_row_sources__";function Tt(t,e){t&&"string"==typeof t?"function"==typeof e?globalThis[Lt][t]=e:console.warn(`ApexCharts: registerRowSource("${t}") expects a function (w, opts) => series.`):console.warn("ApexCharts: registerRowSource requires a non-empty name.")}function Rt(t){return(t.collapsedSeriesIndices||[]).concat(t.ancillaryCollapsedSeriesIndices||[])}function Dt(t,e){const i=(e.collapsedSeries||[]).concat(e.ancillaryCollapsedSeries||[]);return t.map((t,e)=>{const o=t||{},{hidden:c}=o,h=((t,e)=>{var i={};for(var o in t)n.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&s)for(var o of s(t))e.indexOf(o)<0&&r.call(t,o)&&(i[o]=t[o]);return i})(o,["hidden"]);let d=h.data;if(Array.isArray(d)&&!d.length){const t=i.find(t=>t.index===e);t&&Array.isArray(t.data)&&(d=t.data)}return l(a({},h),{data:Array.isArray(d)?d.slice():d})})}globalThis[Lt]||(globalThis[Lt]={});function Ft(t,e){const i=t.length;if(0===i)return NaN;if(1===i)return t[0];const s=(i-1)*e,n=Math.floor(s),r=Math.ceil(s);return n===r?t[n]:t[n]+(t[r]-t[n])*(s-n)}function Xt(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e);let s=i[0],n=i[i.length-1];const r=e.range;if(Array.isArray(r)&&2===r.length){const t=Number(r[0]),e=Number(r[1]);Number.isFinite(t)&&Number.isFinite(e)&&e>t&&(s=t,n=e)}if(!(n>s)){const t=Math.abs(s)>0?.05*Math.abs(s):.5;return{edges:[s-t,s+t],binWidth:2*t,rule:"single",capped:!1}}const o=n-s;let a,l;if("number"==typeof e.binWidth&&e.binWidth>0)a=e.binWidth,l="binWidth";else if("number"==typeof e.bins&&e.bins>=1)a=o/Math.floor(e.bins),l="count";else{const t=function(t,e,i){const s=t.length,n=t=>e/Math.max(1,Math.ceil(t)),r=()=>n(Math.log2(s)+1);switch(i){case"sqrt":return{width:n(Math.sqrt(s)),rule:"sqrt"};case"rice":return{width:n(2*Math.cbrt(s)),rule:"rice"};case"scott":{const e=function(t){const e=t.length;if(e<2)return 0;let i=0;for(let s=0;s<e;s++)i+=t[s];const s=i/e;let n=0;for(let i=0;i<e;i++){const e=t[i]-s;n+=e*e}return Math.sqrt(n/e)}(t);return e>0?{width:3.49*e*Math.pow(s,-1/3),rule:"scott"}:{width:r(),rule:"sturges"}}case"fd":{const e=Ft(t,.75)-Ft(t,.25);return e>0?{width:2*e*Math.pow(s,-1/3),rule:"fd"}:{width:r(),rule:"sturges"}}case"auto":{const e=r(),i=Ft(t,.75)-Ft(t,.25);if(i<=0)return{width:e,rule:"sturges"};const n=2*i*Math.pow(s,-1/3);return n<e?{width:n,rule:"fd"}:{width:e,rule:"sturges"}}default:return{width:r(),rule:"sturges"}}}(i,o,"string"==typeof e.bins?e.bins:"auto");a=t.width,l=t.rule}(!Number.isFinite(a)||a<=0)&&(a=o);let c=Math.ceil(o/a);(!Number.isFinite(c)||c<1)&&(c=1);let h=!1;c>1e3&&(c=1e3,h=!0),a=o/c;const d=new Array(c+1);for(let t=0;t<=c;t++)d[t]=s+t*a;return d[c]=Math.max(d[c],n),{edges:d,binWidth:a,rule:l,capped:h}}function $t(t,e){const i=e.length-1;if(!(t>=e[0])||t>e[i])return-1;if(t===e[i])return i-1;const s=(e[i]-e[0])/i;if(s>0){let n=Math.floor((t-e[0])/s);return n<0&&(n=0),n>i-1&&(n=i-1),t<e[n]?n--:t>=e[n+1]&&n++,n<0||n>i-1?-1:n}let n=0,r=i-1;for(;n<=r;){const i=n+r>>1;if(t<e[i])r=i-1;else{if(!(t>=e[i+1]))return i;n=i+1}}return-1}function zt(t,e){const i=Math.max(0,e.length-1),s=new Array(i);for(let t=0;t<i;t++)s[t]=[];for(let i=0;i<t.length;i++){const n=$t(t[i],e);n>=0&&s[n].push(t[i])}return s}function Bt(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e),s=i.length;let n=e.bandwidth;if(!("number"==typeof n&&n>0)){const t=function(t){const e=t.length;if(e<2)return 0;let i=0;for(let s=0;s<e;s++)i+=t[s];const s=i/e;let n=0;for(let i=0;i<e;i++){const e=t[i]-s;n+=e*e}return Math.sqrt(n/e)}(i),e=Ft(i,.75)-Ft(i,.25);n=.9*(e>0?Math.min(t,e/1.349):t)*Math.pow(s,-.2)}if(!isFinite(n)||n<=0){const t=i[0],e=Math.abs(t)>0?.001*Math.abs(t):.001;return{density:[[t-e,0],[t,1],[t+e,0]],bandwidth:e}}const r=Math.max(8,Math.floor(e.resolution||64)),o=i[0]-2*n,a=(i[s-1]+2*n-o)/(r-1),l=1/(s*n*Math.sqrt(2*Math.PI)),c=[];for(let t=0;t<r;t++){const e=o+t*a;let r=0;for(let t=0;t<s;t++){const s=(e-i[t])/n;r+=Math.exp(-.5*s*s)}c.push([e,r*l])}return{density:c,bandwidth:n}}function Nt(t,e){var i;if(!t||"object"!=typeof t||Array.isArray(t))return null;let s=null;if(Array.isArray(t.points)?s=t.points:Array.isArray(null==(i=t.y)?void 0:i.points)?s=t.y.points:e&&Array.isArray(t.y)&&"number"==typeof t.y[0]&&(s=t.y),!s)return null;const n=[];for(let t=0;t<s.length;t++){const e=g.parseNumber(s[t]);null!==e&&isFinite(e)&&n.push(e)}return n.length?n:null}function Wt(t,e){var i,s;const n=null!=(i=t.statsDerived)?i:t.statsDerived={};return null!=(s=n[e])?s:n[e]=new Map}function Ot(t,e,i){const s=t.get(e);if(!s||!Array.isArray(i)||s.length!==i.length)return!1;for(let t=0;t<i.length;t++){const e=s[t],n=i[t];if(e!==n&&(!Array.isArray(e)||!Array.isArray(n)||e[0]!==n[0]||e[1]!==n[1]))return!1}return!0}function Ht(t){const e=[];if(!Array.isArray(t))return e;for(let i=0;i<t.length;i++){const s=t[i];let n=s;Array.isArray(s)?n=1===s.length?s[0]:s[1]:s&&"object"==typeof s&&(n=void 0!==s.y?s.y:s.x);const r=g.parseNumber(n);null!==r&&isFinite(r)&&e.push(r)}return e}function Yt(t,e,i){if(!e.length)return;const s=[];for(let t=0;t<i;t++){const i=e[t];if(!i){s.push(null);continue}const n=[];for(const t of i)if(t)for(let e=0;e<t.length;e++)n.push(t[e]);s.push({values:n,byPoint:i})}t.seriesObservations=s}function jt(t,e,i){const s=i&&null!=i.maxRows?i.maxRows:3e3,n=function(t,e){let i=0,s=0;for(const e of t)i+=e.length,e.length>s&&(s=e.length);if(i<=e)return{clusters:t,stride:1,total:i,kept:i};const n=e=>{let i=0;for(const s of t)i+=Math.ceil(s.length/e);return i};let r=Math.max(2,Math.ceil(i/e));for(;r<s&&n(r)>e;)r++;let o=0;return{clusters:t.map(t=>{const e=[];for(let i=0;i<t.length;i+=r)e.push(t[i]);return o+=e.length,e}),stride:r,total:i,kept:o}}(e.map(t=>t.rows),s);n.stride>1&&console.warn(`ApexCharts: rowSeries() thinned ${n.total} rows to ${n.kept} (every ${n.stride}${2===n.stride?"nd":3===n.stride?"rd":"th"} row) to stay under maxRows=${s}. Raise maxRows to draw more.`);const r=t.globals&&t.globals.colors||[];return e.map((t,e)=>{const i=r[t.realIndex]||r[0];return{name:t.name,data:n.clusters[e].map((s,n)=>a({id:`${t.realIndex}:${e}:${n}`,x:t.name,y:s},i?{fillColor:i}:{}))}})}function qt(t){if(!isFinite(t))return String(t);const e=Math.round(t);return Math.abs(t-e)<1e-6?String(e):String(Number(t.toFixed(2)))}function Zt(t){return(e,i)=>{var s;const n=t(e);if(!Array.isArray(n)||!n.length)return null;const r=e.globals?Rt(e.globals):[],o=e.globals&&((null==(s=e.globals.categoryLabels)?void 0:s.length)?e.globals.categoryLabels:e.globals.labels)||[],a=[];return n.forEach((t,i)=>{var s;if(-1!==r.indexOf(i))return;if(!Array.isArray(t))return;const l=e.seriesData&&(null==(s=e.seriesData.seriesNames)?void 0:s[i]);t.forEach((t,e)=>{const s=null!=o[e]?String(o[e]):`#${e+1}`;a.push({name:n.length>1&&l?`${l} ${s}`:s,realIndex:i,rows:Array.isArray(t)?t.slice():[]})})}),a.length?jt(e,a,i):null}}const Vt=Zt(t=>{var e;return null==(e=t.candleData)?void 0:e.seriesBoxPoints}),Ut=Zt(t=>{var e;return null==(e=t.violinData)?void 0:e.seriesViolinPoints});It("histogram",function(t,e){var i;const s=e.config,n=e.globals;if(!Array.isArray(t))return t;n.histogramRawSeries||(n.histogramRawSeries=Dt(t,n));const r=n.histogramRawSeries,o=(null==(i=s.plotOptions)?void 0:i.histogram)||{},c=r.map(t=>Ht(null==t?void 0:t.data));let h=[];if(1===c.length)h=c[0];else for(const t of c)h=h.concat(t);const d=Xt(h,{bins:o.bins,binWidth:o.binWidth,range:o.range});if(!d)return e.histogramData={edges:[],binWidth:0,counts:[],rule:"",capped:!1},r;const{edges:u,binWidth:g}=d,p=c.map(t=>function(t,e){const i=new Array(Math.max(0,e.length-1)).fill(0);for(let s=0;s<t.length;s++){const n=$t(t[s],e);n>=0&&i[n]++}return i}(t,u));e.histogramData={edges:u,binWidth:g,counts:p,rule:d.rule,capped:d.capped};const f=Rt(n);return e.seriesObservations=c.map((t,e)=>({values:t,byPoint:-1!==f.indexOf(e)?[]:zt(t,u)})),r.map((t,e)=>{if(-1!==f.indexOf(e))return l(a({},t),{data:[]});const i=function(t,e={}){let i=t.slice();if(e.cumulative){let t=0;i=i.map(e=>t+=e)}const s=t.reduce((t,e)=>t+e,0);if(s<=0)return i;if("relative"===e.normalize)return i.map(t=>t/s*100);if("density"===e.normalize){const t=e.binWidth;if("number"==typeof t&&t>0)return i.map(e=>e/(s*t))}return i}(p[e],{normalize:o.normalize,cumulative:o.cumulative,binWidth:g}),s=[];for(let t=0;t<i.length;t++)s.push({x:(u[t]+u[t+1])/2,y:i[t]});return l(a({},t),{data:s})})}),It("boxPlot",function(t,e){var i,s;if(!Array.isArray(t))return t;const n=(null==(s=null==(i=e.config.plotOptions)?void 0:i.boxPlot)?void 0:s.whiskers)||"minmax",r=Wt(e,"boxPlot"),o=[],c=t.map((t,e)=>{if(!Array.isArray(null==t?void 0:t.data)||t.type&&"boxPlot"!==t.type)return t;let i=!1;const s=new Array(t.data.length).fill(null),c=t.data.map((t,o)=>{const c=e+":"+o;if(Array.isArray(null==t?void 0:t.y)&&5===t.y.length&&!Ot(r,c,t.y))return t;const h=Nt(t,!1);if(!h)return t;const d=function(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e),s=Ft(i,.25),n=Ft(i,.5),r=Ft(i,.75),o=r-s;let a=i[0],l=i[i.length-1],c=[];if("tukey"===e.whiskers&&o>0){const t=s-1.5*o,e=r+1.5*o;let n=0;for(;n<i.length&&i[n]<t;)n++;let h=i.length-1;for(;h>=0&&i[h]>e;)h--;n<=h&&(a=i[n],l=i[h],c=i.slice(0,n).concat(i.slice(h+1)))}return{summary:[a,s,n,r,l],outliers:c,iqr:o}}(h,{whiskers:n});return d?(i=!0,s[o]=h,r.set(c,d.summary),l(a({},t),{y:d.summary,points:h})):t});return i&&(o[e]=s),i?l(a({},t),{data:c}):t});return Yt(e,o,t.length),c}),It("violin",function(t,e){var i,s;if(!Array.isArray(t))return t;const n=(null==(s=null==(i=e.config.plotOptions)?void 0:i.violin)?void 0:s.kde)||{},r=Wt(e,"violin"),o=[],c=t.map((t,e)=>{if(!Array.isArray(null==t?void 0:t.data)||t.type&&"violin"!==t.type)return t;let i=!1;const s=new Array(t.data.length).fill(null),c=t.data.map((t,o)=>{var c;const h=e+":"+o;if(Array.isArray(null==(c=null==t?void 0:t.y)?void 0:c.density)&&t.y.density.length&&!Ot(r,h,t.y.density))return t;const d=Nt(t,!0);if(!d)return t;const u=Bt(d,{bandwidth:n.bandwidth,resolution:n.resolution});if(!u)return t;i=!0,s[o]=d;const g=t.y&&"object"==typeof t.y&&!Array.isArray(t.y)?t.y:{};return r.set(h,u.density),l(a({},t),{y:l(a({},g),{density:u.density,points:d})})});return i&&(o[e]=s),i?l(a({},t),{data:c}):t});return Yt(e,o,t.length),c}),Tt("histogram",function(t,e){const i=t.globals,s=t.histogramData,n=i&&i.histogramRawSeries;if(!s||!Array.isArray(s.edges)||s.edges.length<2)return null;if(!Array.isArray(n)||!n.length)return null;const r=Rt(i),o=s.edges,a=[];return n.forEach((e,i)=>{var s;if(-1!==r.indexOf(i))return;const l=zt(Ht(e&&e.data),o),c=t.seriesData&&(null==(s=t.seriesData.seriesNames)?void 0:s[i])||(null==e?void 0:e.name);l.forEach((t,e)=>{const s=`${qt(o[e])}-${qt(o[e+1])}`;a.push({name:n.length>1&&c?`${c} ${s}`:s,realIndex:i,rows:t})})}),a.length?jt(t,a,e):null}),Tt("boxPlot",Vt),Tt("violin",Ut);
5
+ "use strict";var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,o=(e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,a=(t,e)=>{for(var i in e||(e={}))n.call(e,i)&&o(t,i,e[i]);if(s)for(var i of s(e))r.call(e,i)&&o(t,i,e[i]);return t},l=(t,s)=>e(t,i(s));function c(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const i in t)if("default"!==i){const s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const h=c(require("apexcharts/core")),d=h.__apex_axes_AxesUtils,u=h.__apex_Series,g=h.__apex_Utils,p=h.__apex_Environment_Environment,f=h.__apex_BrowserAPIs_BrowserAPIs,m=h.__apex_math_SVGNS;class x{constructor(t,e){this.w=t,this.ctx=e}svgStringToNode(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}scaleSvgNode(t,e){const i=parseFloat(t.getAttributeNS(null,"width")),s=parseFloat(t.getAttributeNS(null,"height"));t.setAttributeNS(null,"width",i*e),t.setAttributeNS(null,"height",s*e),t.setAttributeNS(null,"viewBox","0 0 "+i+" "+s)}inlineCanvasLayers(t){const e=this.w.dom.elWrap.querySelectorAll(".apexcharts-series-canvas");if(!e.length)return;const i=t.querySelectorAll(".apexcharts-canvas-series");for(let t=0;t<e.length&&t<i.length;t++){let s;try{s=e[t].toDataURL()}catch(t){continue}const n=i[t],r=document.createElementNS(m,"image");r.setAttribute("x",n.getAttribute("x")||"0"),r.setAttribute("y",n.getAttribute("y")||"0"),r.setAttribute("width",n.getAttribute("width")||"0"),r.setAttribute("height",n.getAttribute("height")||"0"),r.setAttribute("href",s),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s),n.parentNode&&n.parentNode.replaceChild(r,n)}}queryStyleable(t,e){return Array.prototype.slice.call(t.querySelectorAll(e))}setStyleDefaults(t,e){Object.keys(e).forEach(i=>{""===t.style.getPropertyValue(i)&&t.style.setProperty(i,e[i])})}applyExportStyles(t){const e=this.w;this.queryStyleable(t,"style").forEach(t=>t.remove()),this.queryStyleable(t,[".apexcharts-tooltip",".apexcharts-toolbar",".apexcharts-xaxistooltip",".apexcharts-yaxistooltip",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs",".apexcharts-zoom-rect",".apexcharts-selection-rect"].join(", ")).forEach(t=>{t.style.setProperty("display","none","important")}),this.queryStyleable(t,".apexcharts-flip-y").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleY(-1) translateY(-100%)","transform-origin":"top","transform-box":"fill-box"})}),this.queryStyleable(t,".apexcharts-flip-x").forEach(t=>{this.setStyleDefaults(t,{transform:"scaleX(-1)","transform-origin":"center","transform-box":"fill-box"})}),e.config.legend.show&&e.dom.elLegendWrap&&e.dom.elLegendWrap.children.length&&(this.queryStyleable(t,".apexcharts-legend").forEach(t=>{this.setStyleDefaults(t,{display:"flex",overflow:"auto",padding:"0 10px"});const e=t.classList,i=e.contains("apx-legend-position-left")||e.contains("apx-legend-position-right"),s=e.contains("apx-legend-position-top")||e.contains("apx-legend-position-bottom");e.contains("apexcharts-legend-group-horizontal")&&this.setStyleDefaults(t,{"flex-direction":"column"}),i&&this.setStyleDefaults(t,{"flex-direction":"column",bottom:"0"}),s&&this.setStyleDefaults(t,{"flex-wrap":"wrap"}),i||s&&e.contains("apexcharts-align-left")?this.setStyleDefaults(t,{"justify-content":"flex-start","align-items":"flex-start"}):s&&e.contains("apexcharts-align-center")?this.setStyleDefaults(t,{"justify-content":"center","align-items":"center"}):s&&e.contains("apexcharts-align-right")&&this.setStyleDefaults(t,{"justify-content":"flex-end","align-items":"flex-end"})}),this.queryStyleable(t,".apexcharts-legend-group").forEach(t=>{this.setStyleDefaults(t,{display:"flex"})}),this.queryStyleable(t,".apexcharts-legend-group-vertical").forEach(t=>{this.setStyleDefaults(t,{"flex-direction":"column-reverse"})}),this.queryStyleable(t,".apexcharts-legend-series").forEach(t=>{this.setStyleDefaults(t,{cursor:t.classList.contains("apexcharts-no-click")?"auto":"pointer","line-height":"normal",display:"flex","align-items":"center"})}),this.queryStyleable(t,".apexcharts-legend-text").forEach(t=>{this.setStyleDefaults(t,{position:"relative","font-size":"14px"})}),this.queryStyleable(t,".apexcharts-legend-marker").forEach(t=>{this.setStyleDefaults(t,{position:"relative",display:"flex","align-items":"center","justify-content":"center",cursor:"pointer","margin-right":"1px"})}),this.queryStyleable(t,".apexcharts-inactive-legend").forEach(t=>{this.setStyleDefaults(t,{opacity:"0.45"})}),this.queryStyleable(t,".apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series").forEach(t=>{t.style.setProperty("display","none","important")}))}resolveExportBackground(){const t=this.w,e=t.config.chart.background;return e&&"transparent"!==e?e:"dark"===t.config.theme.mode?"#343A3F":"#fff"}collectFontFamilies(){const t=new Set,e=this.w;if(!p.isBrowser()||!e.dom.elWrap)return t;const i=this.queryStyleable(e.dom.elWrap,"text, tspan, .apexcharts-legend-text, .apexcharts-title-text, .apexcharts-subtitle-text");return[e.dom.elWrap,...i].forEach(e=>{const i=f.getComputedStyle(e),s=i&&i.fontFamily;s&&s.split(",").forEach(e=>{const i=e.trim().replace(/^['"]|['"]$/g,"");i&&t.add(i.toLowerCase())})}),t}collectFontFaceRules(){if(!p.isBrowser())return Promise.resolve([]);const t=[],e=[],i=(e,i)=>{(e.match(/@font-face\s*\{[^}]*\}/gi)||[]).forEach(e=>{const s=e.match(/font-family\s*:\s*([^;}]+)/i);if(!s)return;const n=s[1].trim().replace(/^['"]|['"]$/g,"");t.push({family:n.toLowerCase(),css:e,base:i})})},s=(t,e)=>{Array.from(t).forEach(t=>{5===t.type?t.cssText&&i(t.cssText,e):t.styleSheet?n(t.styleSheet):t.cssRules&&s(t.cssRules,e)})},n=t=>{let n=null;try{n=t.cssRules}catch(t){}n?s(n,t.href||document.baseURI):t.href&&e.push(fetch(t.href).then(t=>t.ok?t.text():"").then(e=>i(e,t.href)).catch(()=>{}))};return Array.from(document.styleSheets||[]).forEach(n),Promise.all(e).then(()=>t)}embedFonts(t){const e=this.w;if(!p.isBrowser()||!e.config.chart.toolbar.export.embedFonts||"function"!=typeof fetch)return Promise.resolve();const i=this.collectFontFamilies();return i.size?this.collectFontFaceRules().then(t=>{const e=t.filter(t=>i.has(t.family));return e.length?Promise.all(e.map(t=>this.inlineFontFaceUrls(t.css,t.base).catch(()=>null))):Promise.resolve([])}).then(e=>{const i=(e||[]).filter(Boolean).join("\n");if(!i)return;const s=document.createElementNS(m,"style");s.textContent=i,t.insertBefore(s,t.firstChild)}).catch(()=>{}):Promise.resolve()}inlineFontFaceUrls(t,e){const i=[],s=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi;let n;for(;null!==(n=s.exec(t));)n[2].startsWith("data:")||i.push(n[2]);return i.length?Promise.all(i.map(t=>this.fetchAsDataUri(e?new URL(t,e).href:t).then(e=>({url:t,dataUri:e})).catch(()=>({url:t,dataUri:null})))).then(e=>{let i=t,s=0;return e.forEach(({url:t,dataUri:e})=>{e&&(i=i.split(t).join(e),s++)}),s?i:null}):Promise.resolve(t.includes("data:")?t:null)}fetchAsDataUri(t){return"function"!=typeof fetch||"function"!=typeof btoa?Promise.reject(new Error("fetch unavailable")):fetch(t).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status} for ${t}`);const i=e.headers.get("content-type")||"application/octet-stream";return e.arrayBuffer().then(t=>{const e=new Uint8Array(t);let s="";for(let t=0;t<e.length;t+=32768)s+=String.fromCharCode.apply(null,e.subarray(t,t+32768));return`data:${i};base64,${btoa(s)}`})})}getSvgString(t){return new Promise(e=>{var i,s,n;const r=this.w;let o=t||r.config.chart.toolbar.export.scale||r.config.chart.toolbar.export.width/r.globals.svgWidth;o||(o=1);const a=r.globals.svgWidth*o,l=r.globals.svgHeight*o;null==(i=r.globals.layoutTween)||i.finish(),null==(s=r.globals.circleTween)||s.finish(),null==(n=r.globals.highlightTween)||n.finish(),[...r.globals.chromeTweens||[]].forEach(t=>t());const c=r.dom.elWrap.cloneNode(!0);c.style.width=a+"px",c.style.height=l+"px",this.inlineCanvasLayers(c),this.applyExportStyles(c);const h=(new XMLSerializer).serializeToString(c);let d=`\n <svg xmlns="http://www.w3.org/2000/svg"\n version="1.1"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n class="apexcharts-svg"\n xmlns:data="ApexChartsNS"\n transform="translate(0, 0)"\n width="${r.globals.svgWidth}px" height="${r.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${a}px; height:${l}px;">\n ${h}\n </div>\n </foreignObject>\n </svg>\n `;const u=this.svgStringToNode(d);1!==o&&this.scaleSvgNode(u,o),Promise.all([this.convertImagesToBase64(u),this.embedFonts(u)]).then(()=>{d=(new XMLSerializer).serializeToString(u),e(d.replace(/&nbsp;/g,"&#160;"))})})}convertImagesToBase64(t){const e="http://www.w3.org/1999/xlink",i=t.getElementsByTagName("image"),s=Array.from(i).map(t=>{const i=t.getAttributeNS(e,"href"),s=t.getAttribute("href"),n=i||s;if(!n||n.startsWith("data:"))return Promise.resolve();const r=n=>{i&&t.setAttributeNS(e,"href",n),!s&&i||t.setAttribute("href",n)};return this.fetchAsDataUri(n).then(r).catch(()=>this.getBase64FromUrl(n).then(r).catch(t=>{console.error("Error converting image to base64:",t)}))});return Promise.all(s)}getBase64FromUrl(t){return p.isSSR()?Promise.resolve(t):new Promise((e,i)=>{const s=new Image;s.crossOrigin="Anonymous",s.onload=()=>{const t=document.createElement("canvas");t.width=s.width,t.height=s.height;const i=t.getContext("2d");i&&i.drawImage(s,0,0),e(t.toDataURL())},s.onerror=i,s.src=t})}svgUrl(){return new Promise(t=>{this.getSvgString().then(e=>{const i=new Blob([e],{type:"image/svg+xml;charset=utf-8"});t(URL.createObjectURL(i))})})}dataURI(t){return p.isSSR()?Promise.resolve({imgURI:""}):new Promise(e=>{const i=this.w,s=()=>{console.warn("ApexCharts: the PNG export could not be rendered"),e({imgURI:""})},n=t?t.scale||t.width/i.globals.svgWidth:1,r=document.createElement("canvas");r.width=i.globals.svgWidth*n,r.height=parseInt(i.dom.elWrap.style.height,10)*n;const o=this.resolveExportBackground(),a=r.getContext("2d");if(!a)return s();a.fillStyle=o,a.fillRect(0,0,r.width,r.height),this.getSvgString(n).then(t=>{const i="data:image/svg+xml,"+encodeURIComponent(t),n=new Image;n.crossOrigin="anonymous",n.onload=()=>{try{a.drawImage(n,0,0);const t=r;if(t.msToBlob){const i=t.msToBlob();e({blob:i})}else{const t=r.toDataURL("image/png");e({imgURI:t})}}catch(t){s()}},n.onerror=s,n.src=i}).catch(s)})}exportToSVG(){this.svgUrl().then(t=>{this.triggerDownload(t,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const t=this.w.config.chart.toolbar.export.scale,e=this.w.config.chart.toolbar.export.width,i=t?{scale:t}:e?{width:e}:void 0;this.dataURI(i).then(({imgURI:t,blob:e})=>{e?navigator.msSaveOrOpenBlob(e,this.w.globals.chartID+".png"):t&&this.triggerDownload(t,this.w.config.chart.toolbar.export.png.filename,".png")})}exportToCSV({series:t,fileName:e,columnDelimiter:i=",",lineDelimiter:s="\n"}){const n=this.w,r=n.globals,o=n.config.chart.toolbar.export.csv,a=!t&&(r.streamgraphRawSeries||r.waterfallRawSeries||r.dumbbellRawSeries);t||(t=a||n.config.series);const l=new Set(a&&a===r.dumbbellRawSeries?n.dumbbellData.hidden:r.collapsedSeriesIndices),c=[],h=[],p="datetime"===n.config.xaxis.type,f=n.config.xaxis.labels.datetimeUTC,m=t=>{if(null==t||g.isNumber(t))return t;const e=String(t);return/^[=+\-@\t\r]/.test(e)&&isNaN(+e)?`'${e}`:e},x=t=>p&&String(t).length>=10&&!isNaN(new Date(t).getTime()),y=(t,e)=>{const i=new Date(t);if(f||i.setTime(i.getTime()-6e4*i.getTimezoneOffset()),e)return i.toISOString().slice(0,23).replace("T"," ").replace(".000","");const[s,n,r,o]=i.toUTCString().split(" ");return`${s.slice(0,3)} ${r} ${n} ${o}`},b=(t,e)=>"function"==typeof o.categoryFormatter?o.categoryFormatter(t):null==t?"":x(t)?y(t,e):g.isNumber(t)?t:m(String(t).split(i).join("")),v=t=>"function"==typeof o.valueFormatter?o.valueFormatter(t):m(t),w=new d(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),_=t=>{let e="";if(r.axisCharts){if("category"===n.config.xaxis.type||n.config.xaxis.convertedCatToNumeric)if(r.isBarHorizontal){const i=n.formatters.yLabelFormatters[0],s=new u(this.ctx.w).getActiveConfigSeriesIndex();e=i(n.labelData.labels[t],{seriesIndex:s,dataPointIndex:t,w:n})}else e=w.getLabel(n.labelData.labels,n.labelData.timescaleLabels,0,t).text;p&&(n.config.xaxis.categories.length?e=n.config.xaxis.categories[t]:n.config.labels.length&&(e=n.config.labels[t]))}else e=n.config.labels[t];return Array.isArray(e)?e.join(" "):e},A=n.candleData,S=n.rangeData,C=n.violinData,E=t.length>1,k=t.map((t,e)=>{const s=a?"":t.type||n.config.chart.type,r="candlestick"===s?{open:A.seriesCandleO,high:A.seriesCandleH,low:A.seriesCandleL,close:A.seriesCandleC}:"boxPlot"===s?{minimum:A.seriesCandleO,q1:A.seriesCandleH,median:A.seriesCandleM,q3:A.seriesCandleL,maximum:A.seriesCandleC}:"rangeBar"===s||"rangeArea"===s?{minimum:S.seriesRangeStart,maximum:S.seriesRangeEnd}:"violin"===s?{minimum:C.seriesViolinMin,maximum:C.seriesViolinMax,observations:C.seriesViolinPoints}:null,o=String(t.name||`series-${e}`).split(i).join("")||`series-${e}`,c=r?Object.keys(r):[o];return{head:r&&E?c.map(t=>`${o} ${t}`):c,cells:i=>{var s;const n=l.has(e);if(!r){const e=n||null==(s=t.data)?void 0:s[i];return[v(e&&"object"==typeof e?Array.isArray(e)?e[1]:e.y:e)]}return Object.values(r).map(t=>{var s;const r=n||null==(s=null==t?void 0:t[e])?void 0:s[i];return v(Array.isArray(r)?r.length:r)})}}});if(r.axisCharts)if(c.push([o.headerCategory,...k.flatMap(t=>t.head)].join(i)),r.allSeriesHasEqualX||n.config.xaxis.categories.length||n.config.labels.length){const e=Math.max(0,...t.map(t=>{var e;return(null==(e=t.data)?void 0:e.length)||0}));for(let i=0;i<e;i++){let e=_(i);if(null!==e){if(!e){const s=t.map(t=>{var e;return null==(e=t.data)?void 0:e[i]}).find(t=>null!=t);e=null==s?"":Array.isArray(s)?s[0]:s.x}h.push([e,...k.flatMap(t=>t.cells(i))])}}}else{const e=new Map;t.forEach((t,i)=>{var s;const n=new Map;null==(s=null==t?void 0:t.data)||s.forEach((t,s)=>{if(!t||"object"!=typeof t)return;const r=Array.isArray(t)?t[0]:t.x,o=String(r),a=n.get(o)||0;n.set(o,a+1);const l=`${a}:${o}`;let c=e.get(l);c||(c={cat:r,values:k.map(t=>t.head.map(()=>""))},e.set(l,c)),c.values[i]=k[i].cells(s)})}),Array.from(e.values()).sort((t,e)=>{const i="string"==typeof t.cat;return i!==("string"==typeof e.cat)?i?1:-1:i?n.axisFlags.isXNumeric?t.cat<e.cat?-1:t.cat>e.cat?1:0:0:t.cat-e.cat}).forEach(({cat:t,values:e})=>h.push([t,...e.flat()]))}else c.push([o.headerCategory,o.headerValue].join(i)),t.forEach((t,e)=>{c.push([b(n.labelData.labels[e]),v(l.has(e)?"":n.seriesData.series[e])].join(i))});const M=h.map(t=>t[0]).filter(x),P=new Set(M.map(t=>+new Date(t))),I=new Set([...P].map(t=>y(t))).size<P.size;h.forEach(t=>c.push([b(t[0],I),...t.slice(1)].join(i))),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+c.join(s)),e||o.filename,".csv")}triggerDownload(t,e,i){if(p.isSSR())return;const s=document.createElement("a");s.href=t,s.download=(e||this.w.globals.chartID)+i,document.body.appendChild(s),s.click(),document.body.removeChild(s)}}h.default.registerFeatures({exports:x});const y=h.__apex_CoreUtils,b=h.__apex_dimensions_Dimensions,v=h.__apex_Graphics;let w=class{constructor(t){this.w=t.w,this.lgCtx=t}getLegendStyles(){if(p.isSSR())return null;const t=document.createElement("style");t.setAttribute("type","text/css");const e=this.w.config.chart.nonce;e&&t.setAttribute("nonce",e);const i=document.createTextNode(".apexcharts-flip-y{transform:scaleY(-1) translateY(-100%);transform-origin:top;transform-box:fill-box}.apexcharts-flip-x{transform:scaleX(-1);transform-origin:center;transform-box:fill-box}.apexcharts-legend{display:flex;overflow:auto;padding:0 10px}.apexcharts-legend.apexcharts-legend-group-horizontal{flex-direction:column}.apexcharts-legend-group{display:flex}.apexcharts-legend-group-vertical{flex-direction:column-reverse}.apexcharts-legend.apx-legend-position-bottom,.apexcharts-legend.apx-legend-position-top{flex-wrap:wrap}.apexcharts-legend.apx-legend-position-right,.apexcharts-legend.apx-legend-position-left{flex-direction:column;bottom:0}.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-left,.apexcharts-legend.apx-legend-position-top.apexcharts-align-left,.apexcharts-legend.apx-legend-position-right,.apexcharts-legend.apx-legend-position-left{justify-content:flex-start;align-items:flex-start}.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center,.apexcharts-legend.apx-legend-position-top.apexcharts-align-center{justify-content:center;align-items:center}.apexcharts-legend.apx-legend-position-bottom.apexcharts-align-right,.apexcharts-legend.apx-legend-position-top.apexcharts-align-right{justify-content:flex-end;align-items:flex-end}.apexcharts-legend-series{cursor:pointer;line-height:normal;display:flex;align-items:center}.apexcharts-legend-text{position:relative;font-size:14px}.apexcharts-legend-text *,.apexcharts-legend-marker *{pointer-events:none}.apexcharts-legend-marker{position:relative;display:flex;align-items:center;justify-content:center;cursor:pointer;margin-right:1px}.apexcharts-legend-series.apexcharts-no-click{cursor:auto}.apexcharts-legend .apexcharts-hidden-zero-series,.apexcharts-legend .apexcharts-hidden-null-series{display:none!important}.apexcharts-inactive-legend{opacity:.45}");return t.appendChild(i),t}getLegendDimensions(){const t=this.w.dom.baseEl.querySelector(".apexcharts-legend");if(!t)return{clwh:0,clww:0};const{width:e,height:i}=t.getBoundingClientRect();return{clwh:i,clww:e}}appendToForeignObject(){var t;const e=this.getLegendStyles();!1!==this.w.config.chart.injectStyleSheet&&e&&(null==(t=this.w.dom.elLegendForeign)||t.appendChild(e))}toggleDataSeries(t,e){var i,s,n;const r=this.w;if(r.dom.baseEl)if(r.globals.axisCharts||"radialBar"===r.config.chart.type){r.globals.resized=!0;let o=null,a=null;if(r.globals.risingSeries=[],r.globals.axisCharts){if(o=null!=(i=Array.prototype.find.call(r.dom.baseEl.querySelectorAll(".apexcharts-series"),e=>e.getAttribute("data:realIndex")===String(t)))?i:null,!o)return;a=parseInt(null!=(s=o.getAttribute("data:realIndex"))?s:"",10)}else{if(o=r.dom.baseEl.querySelector(`.apexcharts-series[rel='${t+1}']`),!o)return;a=parseInt(null!=(n=o.getAttribute("rel"))?n:"",10)-1}if(e){[{cs:r.globals.collapsedSeries,csi:r.globals.collapsedSeriesIndices},{cs:r.globals.ancillaryCollapsedSeries,csi:r.globals.ancillaryCollapsedSeriesIndices}].forEach(t=>{const e=t.cs,i=t.csi;this.riseCollapsedSeries(e,i,a)})}else this.hideSeries({seriesEl:o,realIndex:a});if(r.config.chart.accessibility.enabled){const e=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const i=r.globals.collapsedSeriesIndices.includes(a)||r.globals.ancillaryCollapsedSeriesIndices.includes(a);e.setAttribute("aria-pressed",i?"true":"false");const s=e.querySelector(".apexcharts-legend-text"),n=s?s.textContent:r.seriesData.seriesNames[t],o=i?"hidden":"visible";e.setAttribute("aria-label",`${n}, ${o}. Press Enter or Space to toggle.`)}}}else{if(r.globals.resized=!0,r.globals.risingSeries=[],e)this.riseCollapsedSeries(r.globals.collapsedSeries,r.globals.collapsedSeriesIndices,t);else{const e=this.getSeriesAfterCollapsing({realIndex:t});this.lgCtx.updateSeries(e,r.config.chart.animations.dynamicAnimation.enabled)}if(r.config.chart.accessibility.enabled){const e=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const i=r.globals.collapsedSeriesIndices.includes(t);e.setAttribute("aria-pressed",i?"true":"false");const s=e.querySelector(".apexcharts-legend-text"),n=s?s.textContent:r.seriesData.seriesNames[t],o=i?"hidden":"visible";e.setAttribute("aria-label",`${n}, ${o}. Press Enter or Space to toggle.`)}}}}_nonAxisSliceContainer(t){const e=this.w.config.chart.type;return("pie"===e||"donut"===e||"polarArea"===e||"sunburst"===e||"icicle"===e)&&1===t.length&&t[0]&&"object"==typeof t[0]&&Array.isArray(t[0].data)?t[0].data:t}_readSliceValue(t){return"unit"===this.w.config.chart.type&&t&&Array.isArray(t.data)?t.data:t&&"object"==typeof t?t.y:t}_writeSliceValue(t,e,i){const s=t[e];"unit"===this.w.config.chart.type&&s&&Array.isArray(s.data)?s.data=Array.isArray(i)?i:[]:s&&"object"==typeof s?s.y=i:t[e]=i}getSeriesAfterCollapsing({realIndex:t}){var e,i;const s=this.w,n=s.globals,r=n.axisCharts?g.copySeriesShallow(s.config.series):g.clone(s.config.series);if(n.axisCharts){const e=s.config.yaxis[n.seriesYAxisReverseMap[t]],i={index:t,data:r[t].data.slice(),type:r[t].type||s.config.chart.type,name:(n.seriesNames||[])[t]};if(e&&e.show&&e.showAlways)n.ancillaryCollapsedSeriesIndices.indexOf(t)<0&&(n.ancillaryCollapsedSeries.push(i),n.ancillaryCollapsedSeriesIndices.push(t));else if(n.collapsedSeriesIndices.indexOf(t)<0){n.collapsedSeries.push(i),n.collapsedSeriesIndices.push(t);const e=n.risingSeries.indexOf(t);n.risingSeries.splice(e,1)}}else if(n.collapsedSeriesIndices.indexOf(t)<0){const o=this._nonAxisSliceContainer(r);n.collapsedSeries.push({index:t,data:this._readSliceValue(o[t]),type:null!=(i=null==(e=s.config.series[t])?void 0:e.type)?i:"line",name:(n.seriesNames||[])[t]}),n.collapsedSeriesIndices.push(t)}const o=n.axisCharts?s.config.series.length:this._nonAxisSliceContainer(r).length;return n.allSeriesCollapsed=n.collapsedSeries.length+n.ancillaryCollapsedSeries.length===o,this._getSeriesBasedOnCollapsedState(r)}hideSeries({seriesEl:t,realIndex:e}){const i=this.w,s=this.getSeriesAfterCollapsing({realIndex:e}),n=t.childNodes;for(let t=0;t<n.length;t++)n[t].classList.contains("apexcharts-series-markers-wrap")&&(n[t].classList.contains("apexcharts-hide")?n[t].classList.remove("apexcharts-hide"):n[t].classList.add("apexcharts-hide"));const r=i.config.chart.animations.dynamicAnimation.enabled;r&&(i.globals.collapsingSeriesIndices=[e]);const o=()=>{i.globals.collapsingSeriesIndices=[]},a=this.lgCtx.updateSeries(s,r);o(),a&&"function"==typeof a.then&&a.then(o,o)}riseCollapsedSeries(t,e,i){const s=this.w;let n=g.clone(s.config.series);if(t.length>0){for(let r=0;r<t.length;r++)if(t[r].index===i){if(s.globals.axisCharts)n[i].data=t[r].data.slice(),n[i].hidden=!1;else{const e=this._nonAxisSliceContainer(n);this._writeSliceValue(e,i,t[r].data)}t.splice(r,1),e.splice(r,1),s.globals.risingSeries.push(i),r--}n=this._getSeriesBasedOnCollapsedState(n);const r=this.lgCtx.updateSeries(n,s.config.chart.animations.dynamicAnimation.enabled),o=()=>{s.globals.risingSeries=[]};r&&"function"==typeof r.then?r.then(o,o):o()}}_getSeriesBasedOnCollapsedState(t){const e=this.w;let i=0;if(e.globals.axisCharts)t.forEach((s,n)=>{e.globals.collapsedSeriesIndices.indexOf(n)<0&&e.globals.ancillaryCollapsedSeriesIndices.indexOf(n)<0||(t[n].data=[],i++)});else{const s=this._nonAxisSliceContainer(t);s.forEach((t,n)=>{e.globals.collapsedSeriesIndices.indexOf(n)<0||(this._writeSliceValue(s,n,0),i++)})}const s=e.globals.axisCharts?t.length:this._nonAxisSliceContainer(t).length;return e.globals.allSeriesCollapsed=i===s,t}};const _=["#cf4d3f","#8f9499","#26a75b"],A=(t,e,i)=>t+(e-t)*i;function S(t){return Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")}function C(t,e,i){const s=g.parseHex(E(t)),n=g.parseHex(E(e));return s&&n?"#"+S(A(s[0],n[0],i))+S(A(s[1],n[1],i))+S(A(s[2],n[2],i)):t}function E(t){if("string"!=typeof t)return"#000000";if(g.isColorHex(t))return t;return g.rgb2hex(t)||"#000000"}function k(t,e,i,s){var n,r,o;if(!e||"object"!=typeof e)return null;const a=null==(o=null==(r=null==(n=t.config.plotOptions)?void 0:n.treemap)?void 0:r.colorScale)?void 0:o.colorValue;let l;if(l="function"==typeof a?a(e,{seriesIndex:i,dataPointIndex:s,w:t}):"string"==typeof a?e[a]:e.colorValue,null==l)return null;const c=Number(l);return Number.isFinite(c)?c:null}function M(t){var e,i,s;const n=null==(s=null==(i=null==(e=t.config)?void 0:e.plotOptions)?void 0:i.treemap)?void 0:s.colorScale,r=n&&n.gradient;if(!r)return null;if(!1===r.enabled)return null;const o=t.config.series||[];let a=1/0,l=-1/0,c=!1;for(let e=0;e<o.length;e++){const i=o[e]&&o[e].data;if(Array.isArray(i))for(let s=0;s<i.length;s++){const n=k(t,i[s],e,s);null!=n&&(c=!0,n<a&&(a=n),n>l&&(l=n))}}if(!c&&!0!==r.enabled)return null;Number.isFinite(a)||(a=0,l=0);let h=Number.isFinite(Number(r.min))?Number(r.min):a,d=Number.isFinite(Number(r.max))?Number(r.max):l,u=null;if(null===r.midpoint?u=null:Number.isFinite(Number(r.midpoint))?u=Number(r.midpoint):h<0&&d>0&&(u=0),null!=u&&!1!==r.symmetric&&!Number.isFinite(Number(r.min))&&!Number.isFinite(Number(r.max))){const t=Math.max(Math.abs(h-u),Math.abs(d-u));h=u-t,d=u+t}d===h&&(h-=.5,d+=.5);const g=function(t,e,i,s){if(Array.isArray(t.stops)&&t.stops.length>=2)return t.stops.filter(t=>t&&Number.isFinite(Number(t.value))).map(t=>({value:Number(t.value),color:E(t.color)})).sort((t,e)=>t.value-e.value);const n=(Array.isArray(t.colors)&&t.colors.length>=2?t.colors:_).map(E),r=n.length;if(null!=s&&r>=3){const t=Math.floor((r-1)/2),o=[];for(let i=0;i<=t;i++)o.push({value:A(e,s,i/t),color:n[i]});for(let e=t+1;e<r;e++)o.push({value:A(s,i,(e-t)/(r-1-t)),color:n[e]});return o}return n.map((t,s)=>({value:A(e,i,s/(r-1)),color:t}))}(r,h,d,u);if(g.length<2)return null;const p=d-h,f=g.map(t=>({percent:0===p?0:(t.value-h)/p,color:t.color}));return{min:h,max:d,midpoint:u,stops:g,at:t=>{if(!Number.isFinite(t))return g[Math.floor(g.length/2)].color;if(t<=g[0].value)return g[0].color;const e=g[g.length-1];if(t>=e.value)return e.color;for(let e=1;e<g.length;e++){const i=g[e];if(t<=i.value){const s=g[e-1],n=i.value-s.value,r=0===n?0:(t-s.value)/n;return C(s.color,i.color,r)}}return e.color},legendStops:f}}const P=h.__apex_tooltip_Utils,I="http://www.w3.org/2000/svg";class L{constructor(t,e){this.w=t,this.ctx=e,this.svgEl=null,this.arrowEl=null,this.hoverValueEl=null,this._min=0,this._max=0,this._geom=null,this._grad=null,this._bandHitEls=[],this._activeBandIndex=-1,this._targetEl=null,this.panelsW=null,this._onCellEnter=this._onCellEnter.bind(this),this._onCellLeave=this._onCellLeave.bind(this),this._onBandEnter=this._onBandEnter.bind(this),this._onBandLeave=this._onBandLeave.bind(this)}_getFormatter(){const t=this._cfg();return"function"==typeof t.formatter?t.formatter:t=>{if(!Number.isFinite(t))return String(t);const e=Math.abs(t);return e>=1e3?t.toFixed(0):e>=10?t.toFixed(1):t.toFixed(2)}}static colorScaleOf(t){var e,i,s,n,r;const o=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.type;return o&&(null==(r=null==(n=null==(s=null==t?void 0:t.config)?void 0:s.plotOptions)?void 0:n[o])?void 0:r.colorScale)||null}static configFor(t){const e=L.colorScaleOf(t);return e&&e.gradientLegend||null}_cfg(){return L.configFor(this.w)||{}}static isEnabled(t){if(!L.supports(t))return!1;const e=L.configFor(t);return!(!e||!e.enabled)}static supports(t){var e,i;const s=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.type;return"heatmap"===s||"treemap"===s}draw(t=null){var e,i,s,n,r,o,a,l;const c=this.w;this._targetEl=t;const h=t||c.dom.elLegendWrap;if(!h)return;const d=this._cfg(),u=c.config.legend.position,g="left"===u||"right"===u,p=null!=(i=null==(e=d.arrow)?void 0:e.size)?i:8,m=p+4,x=d.showLabels?28:4,y=d.showLabels?20:4,b=d.showLabels?44:0,v=this._resolveStripLength(g?d.height:d.width,g),w=d.thickness,_=g?Math.max(w+m+4,b):v+2*x,A=g?v+2*y:w+m+4,S=(_-(w+m))/2,C=g?"left"===u?S:S+m:x,E=g?y:"top"===u?m:4,k=f.createElementNS(I,"svg");k.setAttribute("class","apexcharts-heatmap-gradient-legend apexcharts-gradient-legend"),k.setAttribute("width",String(_)),k.setAttribute("height",String(A)),k.setAttribute("overflow","visible");const M=f.createElementNS(I,"defs"),P=`apexcharts-heatmap-gradient-${c.globals.cuid}`,L=f.createElementNS(I,"linearGradient");L.setAttribute("id",P),g?(L.setAttribute("x1","0"),L.setAttribute("y1","1"),L.setAttribute("x2","0"),L.setAttribute("y2","0")):(L.setAttribute("x1","0"),L.setAttribute("y1","0"),L.setAttribute("x2","1"),L.setAttribute("y2","0")),this._grad=L;const{min:T,max:R,bands:D}=this._paintStops();M.appendChild(L),k.appendChild(M);const F=f.createElementNS(I,"rect");if(F.setAttribute("x",String(C)),F.setAttribute("y",String(E)),F.setAttribute("width",String(g?w:v)),F.setAttribute("height",String(g?v:w)),F.setAttribute("rx","2"),F.setAttribute("fill",`url(#${P})`),k.appendChild(F),d.showLabels){const t=(null==(s=d.labelStyle)?void 0:s.colors)||(Array.isArray(c.config.legend.labels.colors)?c.config.legend.labels.colors[0]:c.config.legend.labels.colors)||c.config.chart.foreColor,e=(null==(n=d.labelStyle)?void 0:n.fontSize)||"11px",i=(null==(r=d.labelStyle)?void 0:r.fontFamily)||c.config.chart.fontFamily,o=this._getFormatter(),a=(s,n,r,o)=>{const a=f.createElementNS(I,"text");return a.setAttribute("x",String(n)),a.setAttribute("y",String(r)),a.setAttribute("text-anchor",o),a.setAttribute("dominant-baseline","middle"),a.setAttribute("fill",t),a.setAttribute("font-size",e),i&&a.setAttribute("font-family",i),a.textContent=String(s),a};if(g){const t=C+w/2;k.appendChild(a(o(T),t,E+v+10,"middle")),k.appendChild(a(o(R),t,E-10,"middle"))}else{const t=E+w/2;k.appendChild(a(o(T),C-6,t,"end")),k.appendChild(a(o(R),C+v+6,t,"start"))}}const X=(null==(o=d.arrow)?void 0:o.color)||c.config.chart.foreColor,$=this._buildArrow(p,X,u);if(k.appendChild($),this.arrowEl=$,this._bandHitEls=[],c.config.legend.onItemHover.highlightDataSeries&&D.length>0&&D.forEach(t=>{const e=f.createElementNS(I,"rect");if(g){const i=E+v-t.p2*v,s=E+v-t.p1*v;e.setAttribute("x",String(C)),e.setAttribute("y",String(i)),e.setAttribute("width",String(w)),e.setAttribute("height",String(Math.max(0,s-i)))}else e.setAttribute("x",String(C+t.p1*v)),e.setAttribute("y",String(E)),e.setAttribute("width",String(Math.max(0,(t.p2-t.p1)*v))),e.setAttribute("height",String(w));e.setAttribute("fill","transparent"),e.setAttribute("class","apexcharts-heatmap-gradient-band"),e.setAttribute("data:range-index",String(t.index)),e.style.cursor="pointer",k.appendChild(e),this._bandHitEls.push(e)}),this._geom={isVertical:g,position:u,stripX:C,stripY:E,stripLength:v,stripThickness:w,arrowSize:p,svgWidth:_,svgHeight:A},d.showHoverValue){const t=f.createElement("div");t.classList.add("apexcharts-heatmap-gradient-legend-value"),t.style.position="absolute",t.style.fontSize=(null==(a=d.labelStyle)?void 0:a.fontSize)||"11px",t.style.fontFamily=(null==(l=d.labelStyle)?void 0:l.fontFamily)||c.config.chart.fontFamily||"",t.style.color=c.config.chart.foreColor,t.style.background="rgba(0,0,0,0.65)",t.style.color="#fff",t.style.padding="2px 6px",t.style.borderRadius="3px",t.style.pointerEvents="none",t.style.whiteSpace="nowrap",t.style.opacity="0",t.style.transition="opacity 120ms ease",this.hoverValueEl=t}h.classList.add("apexcharts-heatmap-gradient-legend-wrap"),h.classList.add("apx-legend-position-"+u),h.appendChild(k),this.hoverValueEl&&h.appendChild(this.hoverValueEl),this.svgEl=k,t?(h.style.width=_+"px",h.style.height=A+"px",h.style.position="relative",h.style.overflow="visible"):this._applyWrapAlignment(h,u,g,_,A),this._attachHoverListeners(),this._attachBandHoverListeners()}_resolveStripLength(t,e){const i=this.w,s=e?i.globals.svgHeight||i.config.chart.height||300:i.globals.svgWidth||i.config.chart.width||600;if("string"==typeof t){const e=t.trim();if(e.endsWith("%")){const t=parseFloat(e)||0;return Math.max(20,s*t/100)}const i=parseFloat(e);return Number.isFinite(i)?i:200}return"number"==typeof t&&Number.isFinite(t)?t:200}_applyWrapAlignment(t,e,i,s,n){const r=this.w,o=this._cfg().align||"center",a=12,l=r.globals.svgWidth||r.config.chart.width||600,c=r.globals.svgHeight||r.config.chart.height||300,h=r.config.legend.offsetX||0,d=r.config.legend.offsetY||0;if(t.style.position="absolute",t.style.display="block",t.style.overflow="visible",t.style.padding="0",t.style.width=s+"px",t.style.height=n+"px",t.style.right="auto",t.style.bottom="auto",i){const i=c-n-24;let r;r="start"===o?a:"end"===o?a+Math.max(0,i):a+Math.max(0,i)/2,t.style.top=r+d+"px",t.style.left="left"===e?a+h+"px":l-s-a+h+"px"}else{const i=l-s-24;let r;r="start"===o?a:"end"===o?a+Math.max(0,i):a+Math.max(0,i)/2,t.style.left=r+h+"px",t.style.top="top"===e?a+d+"px":c-n-a+d+"px"}}repositionToPlot(){var t,e;if(this._grad&&this._paintStops(),!p.isBrowser())return;if(this._targetEl)return;const i=this.w,s=i.globals,n=i.dom.elLegendWrap;if(!n||!this._geom)return;if(!Number.isFinite(s.gridWidth)||!Number.isFinite(s.gridHeight))return;const{isVertical:r,position:o,svgWidth:a,svgHeight:l,stripX:c,stripY:h,stripThickness:d}=this._geom,u=this._cfg().align||"center",g=i.config.legend.offsetX||0,m=i.config.legend.offsetY||0,x=null==(e=null==(t=this.ctx)?void 0:t.dimensions)?void 0:e.dimHelpers,y=x?x.getTitleSubtitleCoords("title").height+x.getTitleSubtitleCoords("subtitle").height:0,b=i.layout.xAxisHeight||0,v=(t,e)=>{const i=Math.max(0,t-e);return"start"===u?0:"end"===u?i:i/2};if(r){n.style.top=s.translateY+v(s.gridHeight,l)+m+"px";const t=(("left"===o?0:s.translateX+s.gridWidth)+("left"===o?s.translateX:s.svgWidth))/2;n.style.left=t-c-d/2+g+"px"}else{n.style.left=s.translateX+v(s.gridWidth,a)+g+"px";const t=(("top"===o?y:s.translateY+s.gridHeight+b)+("top"===o?s.translateY:s.svgHeight))/2;n.style.top=t-h-d/2+m+"px"}f.requestAnimationFrame(()=>this._enforceMinPlotGap())}_enforceMinPlotGap(){const t=this.w,e=t.dom.elLegendWrap,i=this.svgEl&&this.svgEl.querySelector("rect");if(!e||!i||!this._geom)return;if(!t.dom.baseEl||!t.dom.baseEl.querySelector(".apexcharts-svg"))return;const s=i.getBoundingClientRect(),n=P.plotRect(t);if(!(s.width&&s.height&&n.width&&n.height))return;const r=n.left,o=n.left+n.width,a=n.top,l=n.top+n.height,c=n.zoom,{isVertical:h,position:d}=this._geom;if(h){const t=("left"===d?r-s.right:s.left-o)/c;if(t<16){const i=parseFloat(e.style.left)||0,s=16-t;e.style.left=i+("left"===d?-s:s)+"px"}}else{const t=("top"===d?a-s.bottom:s.top-l)/c;if(t<16){const i=parseFloat(e.style.top)||0,s=16-t;e.style.top=i+("top"===d?-s:s)+"px"}}}destroy(){var t,e,i,s,n,r,o;for(let i=0;i<this._bandHitEls.length;i++){const s=this._bandHitEls[i];null==(t=s.removeEventListener)||t.call(s,"mousemove",this._onBandEnter),null==(e=s.removeEventListener)||e.call(s,"mouseout",this._onBandLeave)}if(this._bandHitEls=[],this._activeBandIndex=-1,null==(i=this.ctx)?void 0:i.events)try{null==(n=(s=this.ctx.events).removeEventListener)||n.call(s,"dataPointMouseEnter",this._onCellEnter),null==(o=(r=this.ctx.events).removeEventListener)||o.call(r,"dataPointMouseLeave",this._onCellLeave)}catch(t){}}_attachBandHoverListeners(){if(p.isBrowser())for(let t=0;t<this._bandHitEls.length;t++){const e=this._bandHitEls[t];e.addEventListener("mousemove",this._onBandEnter),e.addEventListener("mouseout",this._onBandLeave)}}_onBandEnter(t){var e,i,s,n;const r=this.w,o=t.currentTarget,a=parseInt(null!=(e=o.getAttribute("data:range-index"))?e:"-1",10);a<0||a===this._activeBandIndex||(this._activeBandIndex=a,null==(n=null==(s=null==(i=this.ctx)?void 0:i.events)?void 0:s.fireEvent)||n.call(s,"legendHover",[this.ctx,a,r]),this._highlightRange(a,"highlight"))}_onBandLeave(){if(this._activeBandIndex<0)return;const t=this._activeBandIndex;this._activeBandIndex=-1,this._highlightRange(t,"reset")}_highlightRange(t,e){var i;((null==(i=this.panelsW)?void 0:i.call(this))||[this.w]).forEach(i=>new u(i).highlightRangeInSeries(t,e))}_attachHoverListeners(){var t,e;p.isBrowser()&&(null==(e=null==(t=this.ctx)?void 0:t.events)?void 0:e.addEventListener)&&(this.ctx.events.addEventListener("dataPointMouseEnter",this._onCellEnter),this.ctx.events.addEventListener("dataPointMouseLeave",this._onCellLeave))}_onCellEnter(...t){var e,i,s;if(!this.arrowEl)return;const n=t[t.length-1];if(!n||"object"!=typeof n)return;const r=n.w||this.w,o=n.seriesIndex,a=n.dataPointIndex;if("number"!=typeof o||"number"!=typeof a)return;if(!L.supports(r))return;let l;l=this._continuous?function(t,e,i){const s=t.config.series[e];return k(t,s&&Array.isArray(s.data)?s.data[i]:null,e,i)}(r,o,a):null==(s=null==(i=null==(e=r.seriesData)?void 0:e.series)?void 0:i[o])?void 0:s[a],null==l||Number.isNaN(l)||this._positionArrow(l)}_onCellLeave(){this.arrowEl&&(this.arrowEl.setAttribute("opacity","0"),this.hoverValueEl&&(this.hoverValueEl.style.opacity="0"))}_positionArrow(t){if(!this.arrowEl||!this._geom)return;const{isVertical:e,position:i,stripX:s,stripY:n,stripLength:r,stripThickness:o,arrowSize:a}=this._geom,l=this._min,c=this._max-l;let h;if(h=0===c?.5:(t-l)/c,h<0&&(h=0),h>1&&(h=1),e){const t=n+r-h*r;let e,l;"left"===i?(e=s+o,l=e+a):(e=s,l=e-a);const c=[`${e},${t}`,`${l},${t-a/2}`,`${l},${t+a/2}`].join(" ");this.arrowEl.setAttribute("points",c)}else{const t=s+h*r;let e,l;"top"===i?(e=n+o,l=e+a):(e=n,l=e-a);const c=[`${t},${e}`,`${t-a/2},${l}`,`${t+a/2},${l}`].join(" ");this.arrowEl.setAttribute("points",c)}if(this.arrowEl.setAttribute("opacity","1"),this.hoverValueEl){const l=this._getFormatter();if(this.hoverValueEl.textContent=l(t),e){const t=n+r-h*r;"left"===i?this.hoverValueEl.style.left=`${s+o+a+8}px`:(this.hoverValueEl.style.left=s-a-8+"px",this.hoverValueEl.style.transform="translateX(-100%)"),this.hoverValueEl.style.top=t-9+"px"}else{const t=s+h*r;this.hoverValueEl.style.left=`${t}px`,this.hoverValueEl.style.transform="translateX(-50%)",this.hoverValueEl.style.top="top"===i?`${n+o+a+8}px`:n-a-18+"px"}this.hoverValueEl.style.opacity="1"}}_buildArrow(t,e,i){const s=f.createElementNS(I,"polygon");return s.setAttribute("fill",e),s.setAttribute("opacity","0"),s.setAttribute("class","apexcharts-heatmap-gradient-arrow"),s.setAttribute("points","0,0 0,0 0,0"),s.setAttribute("pointer-events","none"),s}_paintStops(){const t=this._computeStops(),e=this._grad;return this._min=t.min,this._max=t.max,e.innerHTML="",t.stops.forEach(t=>{const i=f.createElementNS(I,"stop");i.setAttribute("offset",`${(100*t.percent).toFixed(2)}%`),i.setAttribute("stop-color",t.color),e.appendChild(i)}),t}_computeStops(){var t,e;const i=this.w,s=L.colorScaleOf(i)||{},n=this._cfg(),r=M(i);if(r)return this._continuous=!0,{min:r.min,max:r.max,stops:r.legendStops,bands:[]};this._continuous=!1;let o=1/0,c=-1/0;const h=(null==(t=i.seriesData)?void 0:t.series)||[];for(let t=0;t<h.length;t++){const e=h[t];if(e)for(let t=0;t<e.length;t++){const i=e[t];null==i||Number.isNaN(i)||(i<o&&(o=i),i>c&&(c=i))}}Number.isFinite(o)||(o=0),Number.isFinite(c)||(c=0);let d=o,u=c;const p=void 0!==s.min&&void 0!==s.max&&s.max>s.min;p?(d=s.min,u=s.max):(void 0!==s.min&&(d=s.min<o?s.min:o),void 0!==s.max&&(u=s.max>c?s.max:c));const f=[],m=[];if(s.ranges&&s.ranges.length>0){const t=s.ranges.map((t,e)=>l(a({},t),{_originalIndex:e})).sort((t,e)=>t.from-e.from),e=t[0].from,i=t[t.length-1].to;d=e,u=i;const n=i-e||1;t.forEach(t=>{const i=(t.from-e)/n,s=(t.to-e)/n;f.push({percent:(i+s)/2,color:t.color}),m.push({index:t._originalIndex,p1:i,p2:s})})}else{const t=i.globals.colors[0]||"#008FFB",r=new g,o=i.config.chart.type,a=i.config.plotOptions[o]||{},l=null!=(e=a.shadeIntensity)?e:.5,c=i.globals,h=c.hasNegs,m="heatmap"===o&&!a.distributed&&!p&&c.maxY>=c.minY,x=m?c.maxY:u,y=Math.abs(x)+Math.abs(m?s.min<c.minY?s.min:c.minY:d),b=1.25*l,v=Math.max(2,n.stops||16);for(let e=0;e<v;e++){const s=e/(v-1),n=0===y?0:Math.min(d+s*(u-d),x)/y,c=Math.max(-1,Math.min(1,h?a.reverseNegativeShade?(n<0?n:1-n)*b:n<=0?1-(1+n)*l:(1-n)*l:(1-n)*("treemap"===o?b:1))),g=a.enableShades?r.shadeColor("dark"===i.config.theme.mode?-c:c,t):t;f.push({percent:s,color:g})}}return{min:d,max:u,stops:f,bands:m}}}const T=h.__apex_Markers;function R(t){return t.classList.contains("apexcharts-legend-series")||t.classList.contains("apexcharts-legend-text")||t.classList.contains("apexcharts-legend-marker")}h.default.registerFeatures({legend:class{constructor(t,e){this.w=t,this.ctx=e,this.updateSeries=(...t)=>e.updateHelpers._updateSeries(...t),this.onLegendClick=this.onLegendClick.bind(this),this.onLegendHovered=this.onLegendHovered.bind(this),this.onLegendClickEvent=this.onLegendClickEvent.bind(this),this.onLegendPointerDown=this.onLegendPointerDown.bind(this),this.onLegendPointerUp=this.onLegendPointerUp.bind(this),this.legendPress=null,this.recoveredRel=null,this.isBarsDistributed="bar"===this.w.config.chart.type&&this.w.config.plotOptions.bar.distributed&&1===this.w.config.series.length,this.legendHelpers=new w(this)}init(){var t;const e=this.w,i=e.globals,s=e.config;null==(t=this.heatmapGradientLegend)||t.destroy(),this.heatmapGradientLegend=null,this.isBarsDistributed="bar"===s.chart.type&&s.plotOptions.bar.distributed&&1===s.series.length;const n=s.legend.showForSingleSeries&&1===this.w.seriesData.series.length||this.isBarsDistributed||"heatmap"===s.chart.type||L.isEnabled(e)||this.w.seriesData.series.length>1;if(this.legendHelpers.appendToForeignObject(),(n||!i.axisCharts)&&s.legend.show){const t=e.dom.elLegendWrap;for(;t.firstChild;)t.removeChild(t.firstChild);L.isEnabled(e)?(this.heatmapGradientLegend=new L(e,this.ctx),this.heatmapGradientLegend.draw()):(this.drawLegends(),"bottom"===s.legend.position||"top"===s.legend.position?this.legendAlignHorizontal():"right"!==s.legend.position&&"left"!==s.legend.position||this.legendAlignVertical())}}createLegendMarker({i:t,fillcolor:e}){const i=this.w,s=f.createElement("span");s.classList.add("apexcharts-legend-marker");const n=i.config.legend.markers.shape||i.config.markers.shape;let r=n;Array.isArray(n)&&(r=n[t]);const o=Array.isArray(i.config.legend.markers.size)?parseFloat(i.config.legend.markers.size[t]):parseFloat(i.config.legend.markers.size),c=Array.isArray(i.config.legend.markers.offsetX)?parseFloat(i.config.legend.markers.offsetX[t]):parseFloat(i.config.legend.markers.offsetX),h=Array.isArray(i.config.legend.markers.offsetY)?parseFloat(i.config.legend.markers.offsetY[t]):parseFloat(i.config.legend.markers.offsetY),d=Array.isArray(i.config.legend.markers.strokeWidth)?parseFloat(i.config.legend.markers.strokeWidth[t]):parseFloat(i.config.legend.markers.strokeWidth),u=s.style;if(u.height=2*(o+d)+"px",u.width=2*(o+d)+"px",u.left=c+"px",u.top=h+"px",i.config.legend.markers.customHTML)u.background="transparent",u.color=e[t],Array.isArray(i.config.legend.markers.customHTML)?i.config.legend.markers.customHTML[t]&&(s.innerHTML=i.config.legend.markers.customHTML[t]()):s.innerHTML=i.config.legend.markers.customHTML();else{const i=new T(this.ctx.w,this.ctx).getMarkerConfig({cssClass:`apexcharts-legend-marker apexcharts-marker apexcharts-marker-${r}`,seriesIndex:t,strokeWidth:d,size:o}),n=(p.isBrowser()?window.SVG:global.SVG)().addTo(s).size("100%","100%"),c=new v(this.w).drawMarker(0,0,l(a({},i),{pointFillColor:Array.isArray(e)?e[t]:i.pointFillColor,shape:r}));c.node.style.transform="triangle"===r?"translate(50%, 45%)":"translate(50%, 50%)",n.add(c)}return s}drawLegends(){var t;const e=this,i=this.w,s=i.dom.elLegendWrap,n=i.config.legend.fontFamily;let r=i.seriesData.seriesNames,o=i.config.legend.markers.fillColors?i.config.legend.markers.fillColors.slice():i.globals.colors.slice();if("heatmap"===i.config.chart.type){const t=i.config.plotOptions.heatmap.colorScale.ranges;r=t.map(t=>t.name?t.name:t.from+" - "+t.to),o=t.map(t=>t.color)}else this.isBarsDistributed&&(r=i.labelData.labels.slice());i.config.legend.customLegendItems.length&&(r=i.config.legend.customLegendItems);const a=i.formatters.legendFormatter,l=i.config.legend.inverseOrder,c=[];i.labelData.seriesGroups.length>1&&i.config.legend.clusterGroupedSeries&&i.labelData.seriesGroups.forEach((t,e)=>{c[e]=f.createElement("div"),c[e].classList.add("apexcharts-legend-group",`apexcharts-legend-group-${e}`),"horizontal"===i.config.legend.clusterGroupedSeriesOrientation?s.classList.add("apexcharts-legend-group-horizontal"):c[e].classList.add("apexcharts-legend-group-vertical")});for(let e=l?r.length-1:0;l?e>=0:e<=r.length-1;l?e--:e++){const l=a(r[e],{seriesIndex:e,w:i});let h=!1,d=!1;if(i.globals.collapsedSeries.length>0)for(let t=0;t<i.globals.collapsedSeries.length;t++)i.globals.collapsedSeries[t].index===e&&(h=!0);if(i.globals.ancillaryCollapsedSeriesIndices.length>0)for(let t=0;t<i.globals.ancillaryCollapsedSeriesIndices.length;t++)i.globals.ancillaryCollapsedSeriesIndices[t]===e&&(d=!0);const u=this.createLegendMarker({i:e,fillcolor:o});v.setAttrs(u,{rel:e+1,"data:collapsed":h||d}),(h||d)&&u.classList.add("apexcharts-inactive-legend");const p=f.createElement("div");if(i.config.chart.accessibility.enabled&&i.config.chart.accessibility.keyboard.enabled){p.setAttribute("role","button"),p.setAttribute("tabindex","0");const t=Array.isArray(l)?l.join(" "):l,e=h||d,i=e?"hidden":"visible";p.setAttribute("aria-label",`${t}, ${i}. Press Enter or Space to toggle.`),p.setAttribute("aria-pressed",e?"true":"false")}const m=f.createElement("span");m.classList.add("apexcharts-legend-text"),m.innerHTML=Array.isArray(l)?l.join(" "):l;let x=i.config.legend.labels.useSeriesColors?i.globals.colors[e]:Array.isArray(i.config.legend.labels.colors)?null==(t=i.config.legend.labels.colors)?void 0:t[e]:i.config.legend.labels.colors;x||(x=i.config.chart.foreColor),m.style.color=x,m.style.fontSize=i.config.legend.fontSize,m.style.fontWeight=i.config.legend.fontWeight,m.style.fontFamily=n||i.config.chart.fontFamily,v.setAttrs(m,{rel:e+1,i:e,"data:default-text":encodeURIComponent(l),"data:collapsed":h||d}),p.appendChild(u),p.appendChild(m);const b=new y(this.w);if(!i.config.legend.showForZeroSeries){0===b.getSeriesTotalByIndex(e)&&b.seriesHaveSameValues(e)&&!b.isSeriesNull(e)&&-1===i.globals.collapsedSeriesIndices.indexOf(e)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&p.classList.add("apexcharts-hidden-zero-series")}i.config.legend.showForNullSeries||b.isSeriesNull(e)&&-1===i.globals.collapsedSeriesIndices.indexOf(e)&&-1===i.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&p.classList.add("apexcharts-hidden-null-series");const w=c[i.labelData.seriesGroupIndex[e]];w&&!w.parentNode&&s.appendChild(w),(w||s).appendChild(p),s.classList.add(`apexcharts-align-${i.config.legend.horizontalAlign}`),s.classList.add("apx-legend-position-"+i.config.legend.position),p.classList.add("apexcharts-legend-series"),p.style.margin=`${i.config.legend.itemMargin.vertical}px ${i.config.legend.itemMargin.horizontal}px`,s.style.width=i.config.legend.width?i.config.legend.width+"px":"",s.style.height=i.config.legend.height?i.config.legend.height+"px":"",v.setAttrs(p,{rel:e+1,seriesName:g.escapeString(r[e]),"data:collapsed":h||d}),(h||d)&&p.classList.add("apexcharts-inactive-legend"),i.config.legend.onItemClick.toggleDataSeries||p.classList.add("apexcharts-no-click")}i.dom.elWrap.addEventListener("click",e.onLegendClickEvent,!0),i.dom.elWrap.addEventListener("pointerdown",e.onLegendPointerDown,!0),i.dom.elWrap.addEventListener("pointerup",e.onLegendPointerUp,!0),i.config.legend.onItemHover.highlightDataSeries&&0===i.config.legend.customLegendItems.length&&(i.dom.elWrap.addEventListener("mousemove",e.onLegendHovered,!0),i.dom.elWrap.addEventListener("mouseout",e.onLegendHovered,!0)),i.config.chart.accessibility.enabled&&i.config.chart.accessibility.keyboard.enabled&&i.dom.elWrap.addEventListener("keydown",e.onLegendKeyDown.bind(e),!0)}setLegendWrapXY(t,e){const i=this.w,s=i.dom.elLegendWrap,n=s.clientHeight;let r=0,o=0;if("bottom"===i.config.legend.position)o=i.globals.svgHeight-Math.min(n,i.globals.svgHeight/2)-5;else if("top"===i.config.legend.position){const t=new b(this.w,this.ctx),e=t.dimHelpers.getTitleSubtitleCoords("title").height,i=t.dimHelpers.getTitleSubtitleCoords("subtitle").height;o=(e>0?e-10:0)+(i>0?i-10:0)}s.style.position="absolute",r=r+t+i.config.legend.offsetX,o=o+e+i.config.legend.offsetY,s.style.left=r+"px",s.style.top=o+"px","right"===i.config.legend.position&&(s.style.left="auto",s.style.right=25+i.config.legend.offsetX+"px");["width","height"].forEach(t=>{s&&s.style[t]&&(s.style[t]=parseInt(String(i.config.legend[t]),10)+"px")})}legendAlignHorizontal(){const t=this.w;t.dom.elLegendWrap.style.right="0";const e=new b(this.w,this.ctx),i=e.dimHelpers.getTitleSubtitleCoords("title"),s=e.dimHelpers.getTitleSubtitleCoords("subtitle");let n=0;"top"===t.config.legend.position&&(n=i.height+s.height+t.config.title.margin+t.config.subtitle.margin-10),this.setLegendWrapXY(20,n)}legendAlignVertical(){this.setLegendWrapXY("left"===this.w.config.legend.position?20:0,20)}onLegendHovered(t){var e;const i=this.w,s=t.target,n=R(s);if("heatmap"===i.config.chart.type||this.isBarsDistributed){if(n){const i=parseInt(null!=(e=s.getAttribute("rel"))?e:"0",10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,i,this.w]);const n=new u(this.ctx.w);"mousemove"===t.type?n.highlightRangeInSeries(i,"highlight"):"mouseout"===t.type&&n.highlightRangeInSeries(i,"reset")}}else if(n&&!s.closest(".apexcharts-inactive-legend")){new u(this.ctx.w).toggleSeriesOnHover(t,s)}}onLegendKeyDown(t){const e=this,i=this.w,s=t.target;if(R(s)&&("Enter"===t.key||" "===t.key)){t.preventDefault();const n=s.getAttribute("rel");e.onLegendClick(t),null!==n&&i.config.legend.onItemClick.toggleDataSeries&&requestAnimationFrame(()=>{var t;const e=null==(t=i.dom.baseEl)?void 0:t.querySelector(`.apexcharts-legend-series[rel="${n}"]`);e&&e.focus()})}}onLegendPointerDown(t){const e=t.target;this.recoveredRel=null,this.legendPress=0===t.button&&R(e)?{el:e,rel:e.getAttribute("rel")}:null}onLegendPointerUp(t){const e=this.legendPress;this.legendPress=null;const i=t.target;e&&!e.el.isConnected&&R(i)&&i.getAttribute("rel")===e.rel&&(this.recoveredRel=e.rel,this.onLegendClick(t))}onLegendClickEvent(t){const e=this.recoveredRel;this.recoveredRel=null;const i=t.target;null!==e&&t.isTrusted&&i.getAttribute("rel")===e||this.onLegendClick(t)}onLegendClick(t){var e;const i=this.w,s=t.target;if(!i.config.legend.customLegendItems.length&&R(s)){const t=parseInt(null!=(e=s.getAttribute("rel"))?e:"0",10)-1,n="true"===s.getAttribute("data:collapsed"),r=this.w.config.chart.events.legendClick;"function"==typeof r&&r(this.ctx,t,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,t,this.w]);const o=this.w.config.legend.markers.onClick;"function"==typeof o&&s.classList.contains("apexcharts-legend-marker")&&(o(this.ctx,t,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,t,this.w]));"treemap"!==i.config.chart.type&&"heatmap"!==i.config.chart.type&&!this.isBarsDistributed&&i.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(t,n)}}}});class D{constructor(t,e){this.w=t,this.ctx=e,this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar,this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null,this.elMenu=null,this.elMenuItems=[],this.t=null,this._drawnForZoom=null}resetControlAllowed(){const t=this.w.config.chart;if(!t.zoom||!t.zoom.enabled)return!1;const e=void 0===t.zoom.resetControl?"auto":t.zoom.resetControl;if("auto"!==e)return!!e;return!(t.toolbar&&t.toolbar.show&&t.toolbar.tools&&t.toolbar.tools.reset)}resetControlDue(){return!!this.w.interact.zoomed&&this.resetControlAllowed()}createToolbar(t={}){var e,i,s;const n=this.w,r=!!t.resetOnly,o=()=>f.createElementNS("http://www.w3.org/1999/xhtml","div"),c=()=>{const t=f.createElementNS("http://www.w3.org/1999/xhtml","button");return t.setAttribute("type","button"),t},h=o();if(h.setAttribute("class","apexcharts-toolbar"),h.style.top=n.config.chart.toolbar.offsetY+"px",h.style.right=3-n.config.chart.toolbar.offsetX+"px",n.dom.elWrap.appendChild(h),this.elZoom=c(),this.elZoomIn=c(),this.elZoomOut=c(),this.elPan=c(),this.elSelection=c(),this.elMeasure=c(),this.elZoomReset=c(),this.elMenuIcon=c(),this.elMenu=o(),this.elCustomIcons=[],this.t=n.config.chart.toolbar.tools,this._drawnForZoom=null,r?(this.t={zoom:!1,zoomin:!1,zoomout:!1,selection:!1,pan:!1,measure:!1,download:!1,customIcons:[],reset:!0},this._drawnForZoom="wrap"):!this.t.reset&&this.resetControlDue()&&(this.t=l(a({},this.t),{reset:!0}),this._drawnForZoom="control"),Array.isArray(this.t.customIcons))for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons.push(c());const d=[],u=(t,e,i)=>{const s=t.toLowerCase();this.t[s]&&n.config.chart.zoom.enabled&&d.push({el:e,icon:"string"==typeof this.t[s]?this.t[s]:i,title:this.localeValues[t],class:`apexcharts-${s}-icon`})};u("zoomIn",this.elZoomIn,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M12 5v14M5 12h14"/>\n</svg>\n'),u("zoomOut",this.elZoomOut,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 12h14"/>\n</svg>\n');const p=t=>{this.t[t]&&n.config.chart[t].enabled&&d.push({el:"zoom"===t?this.elZoom:this.elSelection,icon:"string"==typeof this.t[t]?this.t[t]:"zoom"===t?'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="11" cy="11" r="7"/>\n <path d="m21 21-4.3-4.3M8 11h6M11 8v6"/>\n</svg>\n':'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 3a2 2 0 0 0-2 2"/>\n <path d="M19 3a2 2 0 0 1 2 2"/>\n <path d="M21 19a2 2 0 0 1-2 2"/>\n <path d="M5 21a2 2 0 0 1-2-2"/>\n <path d="M9 3h1M14 3h1M9 21h1M14 21h1M3 9v1M3 14v1M21 9v1M21 14v1"/>\n</svg>\n',title:this.localeValues["zoom"===t?"selectionZoom":"selection"],class:`apexcharts-${t}-icon`})};p("zoom"),p("selection"),this.t.pan&&n.config.chart.zoom.enabled&&d.push({el:this.elPan,icon:"string"==typeof this.t.pan?this.t.pan:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 9 2 12l3 3"/>\n <path d="M9 5l3-3 3 3"/>\n <path d="M15 19l-3 3-3-3"/>\n <path d="M19 9l3 3-3 3"/>\n <path d="M2 12h20"/>\n <path d="M12 2v20"/>\n</svg>\n',title:this.localeValues.pan,class:"apexcharts-pan-icon"}),this.t.measure&&n.config.chart.measure&&n.config.chart.measure.enabled&&d.push({el:this.elMeasure,icon:"string"==typeof this.t.measure?this.t.measure:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.4 2.4 0 0 1 0-3.4l2.6-2.6a2.4 2.4 0 0 1 3.4 0Z"/>\n <path d="m14.5 12.5 2-2"/>\n <path d="m11.5 9.5 2-2"/>\n <path d="m8.5 6.5 2-2"/>\n <path d="m17.5 15.5 2-2"/>\n</svg>\n',title:this.localeValues.measure||"Measure",class:"apexcharts-measure-icon"}),u("reset",this.elZoomReset,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/>\n <path d="M3 3v5h5"/>\n</svg>\n'),this.t.download&&d.push({el:this.elMenuIcon,icon:"string"==typeof this.t.download?this.t.download:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 6h16M4 12h16M4 18h16"/>\n</svg>\n',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(let t=0;t<this.elCustomIcons.length;t++)d.push({el:this.elCustomIcons[t],icon:this.t.customIcons[t].icon,title:this.t.customIcons[t].title,index:this.t.customIcons[t].index,class:"apexcharts-toolbar-custom-icon "+this.t.customIcons[t].class});d.forEach((t,e)=>{t.index&&g.moveIndexInArray(d,e,t.index)});for(let t=0;t<d.length;t++)v.setAttrs(d[t].el,{class:d[t].class,title:d[t].title,"aria-label":d[t].title}),d[t].el.innerHTML=d[t].icon,h.appendChild(d[t].el);this.elZoom.parentNode&&this.elZoom.setAttribute("aria-pressed",String(!!n.interact.zoomEnabled)),this.elSelection.parentNode&&this.elSelection.setAttribute("aria-pressed",String(!!n.interact.selectionEnabled)),this.elPan.parentNode&&this.elPan.setAttribute("aria-pressed",String(!!n.interact.panEnabled)),this.elMeasure.parentNode&&this.elMeasure.setAttribute("aria-pressed",String(!!n.interact.measureEnabled)),this.elMenuIcon.parentNode&&(this.elMenuIcon.setAttribute("aria-haspopup","true"),this.elMenuIcon.setAttribute("aria-expanded","false")),r||this._createHamburgerMenu(h),r?null==(e=this.elZoomReset)||e.addEventListener("click",this.handleZoomReset.bind(this)):(n.interact.zoomEnabled?this.elZoom.classList.add(this.selectedClass):n.interact.panEnabled?this.elPan.classList.add(this.selectedClass):n.interact.selectionEnabled?this.elSelection.classList.add(this.selectedClass):n.interact.measureEnabled&&this.elMeasure&&(this.elMeasure.classList.add(this.selectedClass),null==(s=null==(i=this.ctx.measure)?void 0:i.startMeasure)||s.call(i)),this.addToolbarEventListeners())}_createHamburgerMenu(t){this.elMenuItems=[],t.appendChild(this.elMenu),v.setAttrs(this.elMenu,{class:"apexcharts-menu",role:"menu"});const e=[{name:"exportSVG",title:this.localeValues.exportToSVG},{name:"exportPNG",title:this.localeValues.exportToPNG},{name:"exportCSV",title:this.localeValues.exportToCSV}];for(let t=0;t<e.length;t++)this.elMenuItems.push(f.createElementNS("http://www.w3.org/1999/xhtml","div")),this.elMenuItems[t].innerHTML=e[t].title,v.setAttrs(this.elMenuItems[t],{class:`apexcharts-menu-item ${e[t].name}`,title:e[t].title,role:"menuitem",tabindex:"-1"}),this.elMenu.appendChild(this.elMenuItems[t])}addToolbarEventListeners(){var t,e,i,s,n,r,o,a,l;null==(t=this.elZoomReset)||t.addEventListener("click",this.handleZoomReset.bind(this)),null==(e=this.elSelection)||e.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),null==(i=this.elZoom)||i.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),null==(s=this.elZoomIn)||s.addEventListener("click",this.handleZoomIn.bind(this)),null==(n=this.elZoomOut)||n.addEventListener("click",this.handleZoomOut.bind(this)),null==(r=this.elPan)||r.addEventListener("click",this.togglePanning.bind(this)),null==(o=this.elMeasure)||o.addEventListener("click",this.toggleMeasure.bind(this)),null==(a=this.elMenuIcon)||a.addEventListener("click",this.toggleMenu.bind(this)),this.elMenuItems.forEach(t=>{t.classList.contains("exportSVG")?t.addEventListener("click",this.handleDownload.bind(this,"svg")):t.classList.contains("exportPNG")?t.addEventListener("click",this.handleDownload.bind(this,"png")):t.classList.contains("exportCSV")&&t.addEventListener("click",this.handleDownload.bind(this,"csv"))});for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons[t].addEventListener("click",this.t.customIcons[t].click.bind(this,this.ctx,this.ctx.w));[this.elZoomReset,this.elSelection,this.elZoom,this.elZoomIn,this.elZoomOut,this.elPan,this.elMeasure,this.elMenuIcon,...this.elCustomIcons].forEach(t=>{t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const i=t.className;t.click(),requestAnimationFrame(()=>{const t=this.w.dom.baseEl;if(!t)return;const e=i.split(" ").find(t=>t.startsWith("apexcharts-"));if(!e)return;const s=t.querySelector(`.${e}`);s&&s.focus()})}})}),null==(l=this.elMenuIcon)||l.addEventListener("keydown",t=>{var e;"ArrowDown"!==t.key&&"ArrowUp"!==t.key||(t.preventDefault(),(null==(e=this.elMenu)?void 0:e.classList.contains("apexcharts-menu-open"))||this.toggleMenu(),window.setTimeout(()=>{const e="ArrowDown"===t.key?0:this.elMenuItems.length-1;this.elMenuItems[e]&&this.elMenuItems[e].focus()},20))}),this.elMenuItems.forEach((t,e)=>{t.addEventListener("keydown",i=>{var s;if("ArrowDown"===i.key){i.preventDefault();(this.elMenuItems[e+1]||this.elMenuItems[0]).focus()}else if("ArrowUp"===i.key){i.preventDefault();(this.elMenuItems[e-1]||this.elMenuItems[this.elMenuItems.length-1]).focus()}else"Escape"===i.key||"Tab"===i.key?(this._closeMenu(),null==(s=this.elMenuIcon)||s.focus(),"Tab"===i.key||i.preventDefault()):"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),t.click())})})}toggleZoomSelection(t){this.ctx.getSyncedCharts().forEach(e=>{const i=e.ctx.toolbar,s="selection"===t?"selectionEnabled":"zoomEnabled",n=!!e.w.interact[s];i.toggleOtherControls();const r="selection"===t?i.elSelection:i.elZoom;n||(e.w.interact[s]=!0,null==r||r.classList.add(i.selectedClass)),null==r||r.setAttribute("aria-pressed",String(!!e.w.interact[s]))})}toggleMeasure(){var t,e,i,s;const n=this.w,r=!n.interact.measureEnabled;this.toggleOtherControls(),r&&(n.interact.measureEnabled=!0,null==(t=this.elMeasure)||t.classList.add(this.selectedClass),null==(i=null==(e=this.ctx.measure)?void 0:e.startMeasure)||i.call(e)),null==(s=this.elMeasure)||s.setAttribute("aria-pressed",String(n.interact.measureEnabled))}getToolbarIconsReference(){const t=this.w;this.elZoom||(this.elZoom=t.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=t.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=t.dom.baseEl.querySelector(".apexcharts-selection-icon")),this.elMeasure||(this.elMeasure=t.dom.baseEl.querySelector(".apexcharts-measure-icon"))}enableZoomPanFromToolbar(t){this.toggleOtherControls(),"pan"===t?this.w.interact.panEnabled=!0:this.w.interact.zoomEnabled=!0;const e="pan"===t?this.elPan:this.elZoom,i="pan"===t?this.elZoom:this.elPan;e&&e.classList.add(this.selectedClass),i&&i.classList.remove(this.selectedClass)}togglePanning(){this.ctx.getSyncedCharts().forEach(t=>{var e,i;const s=t.ctx.toolbar,n=!!t.w.interact.panEnabled;s.toggleOtherControls(),n||(t.w.interact.panEnabled=!0,null==(e=s.elPan)||e.classList.add(s.selectedClass)),null==(i=s.elPan)||i.setAttribute("aria-pressed",String(!!t.w.interact.panEnabled))})}toggleOtherControls(){var t,e,i;const s=this.w;s.interact.panEnabled=!1,s.interact.zoomEnabled=!1,s.interact.selectionEnabled=!1,s.interact.measureEnabled&&(s.interact.measureEnabled=!1,null==(e=null==(t=this.ctx.measure)?void 0:t.stopMeasure)||e.call(t),null==(i=this.elMeasure)||i.setAttribute("aria-pressed","false")),this.getToolbarIconsReference();[this.elPan,this.elSelection,this.elZoom,this.elMeasure].forEach(t=>{t&&t.classList.remove(this.selectedClass)})}_currentXRange(){const t=this.w;return t.axisFlags.isRangeBar?{minX:t.globals.minY,maxX:t.globals.maxY}:{minX:t.globals.minX,maxX:t.globals.maxX}}handleZoomIn(){const t=this.w,{minX:e,maxX:i}=this._currentXRange(),s=(e+i)/2,n=(e+s)/2,r=(i+s)/2,o=this._getNewMinXMaxX(n,r);t.interact.disableZoomIn||this.zoomUpdateOptions(o.minX,o.maxX)}handleZoomOut(){const t=this.w,{minX:e,maxX:i}=this._currentXRange();if("datetime"===t.config.xaxis.type&&new Date(e).getUTCFullYear()<1e3)return;const s=(e+i)/2,n=e-(s-e),r=i-(s-i),o=this._getNewMinXMaxX(n,r);t.interact.disableZoomOut||this.zoomUpdateOptions(o.minX,o.maxX)}_getNewMinXMaxX(t,e){const i=this.w.config.xaxis.convertedCatToNumeric;return{minX:i?Math.floor(t):t,maxX:i?Math.floor(e):e}}zoomUpdateOptions(t,e){const i=this.w;if(void 0===t&&void 0===e)return void this.handleZoomReset();if(i.config.xaxis.convertedCatToNumeric&&(t<1&&(t=1,e=i.globals.dataPoints),e-t<2))return;let s={min:t,max:e};const n=this.getBeforeZoomRange(s,void 0);n&&(s=n.xaxis);const r={xaxis:s};if(!i.globals.initialConfig)return;const o=g.clone(i.globals.initialConfig.yaxis);i.config.chart.group||(r.yaxis=o),this.w.interact.zoomed=!0,this.ctx.updateHelpers._updateOptions(r,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(s,o)}zoomCallback(t,e){"function"==typeof this.ev.zoomed&&(this.ev.zoomed(this.ctx,{xaxis:t,yaxis:e}),this.ctx.events.fireEvent("zoomed",{xaxis:t,yaxis:e}))}getBeforeZoomRange(t,e){let i=null;return"function"==typeof this.ev.beforeZoom&&(i=this.ev.beforeZoom(this,{xaxis:t,yaxis:e})),i}toggleMenu(){window.setTimeout(()=>{var t,e,i;(null==(t=this.elMenu)?void 0:t.classList.contains("apexcharts-menu-open"))?this._closeMenu():(null==(e=this.elMenu)||e.classList.add("apexcharts-menu-open"),null==(i=this.elMenuIcon)||i.setAttribute("aria-expanded","true"))},0)}_closeMenu(){var t,e;null==(t=this.elMenu)||t.classList.remove("apexcharts-menu-open"),null==(e=this.elMenuIcon)||e.setAttribute("aria-expanded","false")}handleDownload(t){const e=this.w,i=new x(this.w,this.ctx);switch(t){case"svg":i.exportToSVG();break;case"png":i.exportToPng();break;case"csv":i.exportToCSV({series:e.config.series,columnDelimiter:e.config.chart.toolbar.export.csv.columnDelimiter})}}clearZoomAffordance(){const t=this._drawnForZoom;if(this._drawnForZoom=null,!t||!this.elZoomReset)return;const e=this.elZoomReset.parentNode,i="wrap"===t?e:this.elZoomReset;i&&i.parentNode&&i.parentNode.removeChild(i)}handleZoomReset(){this.ctx.getSyncedCharts().forEach(t=>{var e;const i=t.w;if(!i.interact.zoomed)return;if(i.globals.lastXAxis.min=i.globals.initialConfig.xaxis.min,i.globals.lastXAxis.max=i.globals.initialConfig.xaxis.max,t.updateHelpers.revertDefaultAxisMinMax(),"function"==typeof i.config.chart.events.beforeResetZoom){const e=i.config.chart.events.beforeResetZoom(t,i);e&&t.updateHelpers.revertDefaultAxisMinMax(e)}"function"==typeof i.config.chart.events.zoomed&&t.ctx.toolbar.zoomCallback({min:i.config.xaxis.min,max:i.config.xaxis.max});const s=t.ctx.series.emptyCollapsedSeries(g.clone(i.globals._initialSeriesPeek));t.updateHelpers._updateSeries(s,i.config.chart.animations.dynamicAnimation.enabled),i.interact.zoomed=!1,null==(e=t.ctx.toolbar)||e.clearZoomAffordance()})}destroy(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elMeasure=null,this.elZoomReset=null,this.elMenuIcon=null}}class F{static xRatio(t){const e=t.layout.gridWidth||1;return(t.globals.maxX-t.globals.minX)/e}static dataXToPx(t,e){return(e-t.globals.minX)/F.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*F.xRatio(t)}static plotRect(t){var e,i,s;const n=(null==(e=t.dom.Paper)?void 0:e.node)||(null==(i=t.dom.baseEl)?void 0:i.querySelector(".apexcharts-svg")),r=(null==(s=n||t.dom.elWrap)?void 0:s.getBoundingClientRect())||{left:0,top:0,width:0},o=(n&&t.globals.svgWidth?r.width/t.globals.svgWidth:1)||1;return{left:r.left+t.layout.translateX*o,top:r.top+t.layout.translateY*o,width:t.layout.gridWidth*o,height:t.layout.gridHeight*o,zoom:o}}static screenXToPlotPx(t,e,i=F.plotRect(t)){return(e-i.left)/i.zoom}}const X=h.__apex_index_Box;h.default.registerFeatures({toolbar:D,zoomPanSelection:class extends D{constructor(t,e){super(t,e),this.w=t,this.ctx=e,this.dragged=!1,this.graphics=new v(this.w),this.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend"],this.clientX=0,this.clientY=0,this.startX=0,this.endX=0,this.dragX=0,this.startY=0,this.endY=0,this.dragY=0,this.moveDirection="none"}init({xyRatios:t}){const e=this.w,i=this;this.xyRatios=t,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.constraints=new X(0,0,e.layout.gridWidth,e.layout.gridHeight),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),e.dom.Paper.add(this.zoomRect),e.dom.Paper.add(this.selectionRect),"x"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:e.layout.gridWidth,maxY:e.layout.gridHeight}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):"y"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:e.layout.gridWidth}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):this.slDraggableRect=this.selectionRect.draggable().on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")),this.preselectedSelection(),this.hoverArea=e.dom.baseEl.querySelector(`${e.globals.chartClass} .apexcharts-svg`),this.hoverArea&&(this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach(e=>{var s;null==(s=this.hoverArea)||s.addEventListener(e,i.svgMouseEvents.bind(i,t),{capture:!1,passive:!0})}),this._wheelZoomEnabled()&&this.hoverArea.addEventListener("wheel",i.mouseWheelEvent.bind(i),{capture:!1,passive:!1}),this.hoverArea.addEventListener("keydown",i.escapeResetEvent.bind(i),{capture:!1,passive:!0}),this._momentumEnabled()&&["touchstart","touchmove","touchend","touchcancel"].forEach(t=>{var e;null==(e=this.hoverArea)||e.addEventListener(t,i.momentumTouch.bind(i),{capture:!1,passive:!1})}))}destroy(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null}svgMouseEvents(t,e){const i=this.w,s=this.ctx.toolbar;if(i.interact.momentum&&i.interact.momentum.busy)return;if(this._momentumEnabled()&&e.touches&&e.touches.length>1)return;const n=i.interact.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type,r=i.config.chart.toolbar.autoSelected;if("measure"!==r&&(e.shiftKey?(i.interact.shiftWasPressed=!0,s.enableZoomPanFromToolbar("pan"===r?"zoom":"pan")):i.interact.shiftWasPressed&&(s.enableZoomPanFromToolbar(r),i.interact.shiftWasPressed=!1)),!e.target)return;const o=e.target.classList;let a;e.target.parentNode&&null!==e.target.parentNode&&(a=e.target.parentNode.classList);if(!(o.contains("apexcharts-legend-marker")||o.contains("apexcharts-legend-text")||a&&a.contains("apexcharts-toolbar"))){if(this.clientX="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientX:"touchend"===e.type?e.changedTouches[0].clientX:e.clientX,this.clientY="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientY:"touchend"===e.type?e.changedTouches[0].clientY:e.clientY,"mousedown"===e.type&&1===e.which||"touchstart"===e.type){if(!this._hasPlot())return;this.startX=this._screenXToPlotPx(this.clientX),this.startY=this._screenYToPlotPx(this.clientY),this.dragged=!1,this.w.interact.mousedown=!0}("mousemove"===e.type&&1===e.which||"touchmove"===e.type)&&(this.dragged=!0,i.interact.panEnabled?(i.interact.selection=null,this.w.interact.mousedown&&this.panDragging({context:this,zoomtype:n,xyRatios:this.xyRatios})):(this.w.interact.mousedown&&i.interact.zoomEnabled||this.w.interact.mousedown&&i.interact.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:n}))),"mouseup"!==e.type&&"touchend"!==e.type&&"mouseleave"!==e.type||this.handleMouseUp({zoomtype:n}),this.makeSelectionRectDraggable()}}handleMouseUp({zoomtype:t,isResized:e}){const i=this.w;this._hasPlot()&&(this.w.interact.mousedown||e)&&(this.endX=this._screenXToPlotPx(this.clientX),this.endY=this._screenYToPlotPx(this.clientY),this.dragX=Math.abs(this.endX-this.startX),this.dragY=Math.abs(this.endY-this.startY),(i.interact.zoomEnabled||i.interact.selectionEnabled)&&this.selectionDrawn({context:this,zoomtype:t})),i.interact.zoomEnabled&&this.hideSelectionRect(this.selectionRect),this.dragged=!1,this.w.interact.mousedown=!1}_incidentalZoomEnabled(t){var e,i,s;const n=this.w.config.chart;return!(!n.zoom||!n.zoom.enabled)&&("auto"!==t?!!t:!(!(null==(e=n.toolbar)?void 0:e.show)||!(null==(s=null==(i=n.toolbar)?void 0:i.tools)?void 0:s.reset)))}_wheelZoomEnabled(){const{zoom:t}=this.w.config.chart;return this._incidentalZoomEnabled(t&&t.allowMouseWheelZoom)}_wheelZoomGreedy(){return!0===this.w.config.chart.zoom.allowMouseWheelZoom}_showWheelHint(t){const e=this.w;if(!1===e.config.chart.zoom.wheelHint)return;if(Math.abs(t.deltaY)<=Math.abs(t.deltaX))return;const i=e.dom.elWrap;if(!i)return;let s=i.querySelector(".apexcharts-wheel-hint");if(!s){const t=f.getWindow(),n=t&&t.navigator,r=!!n&&/Mac|iPhone|iPad/.test(n.platform||n.userAgent),o=(e.globals.locale.toolbar.wheelZoomHint||"").replace("{key}",r?"\u2318":"Ctrl");s=f.createElement("div"),s.className="apexcharts-wheel-hint",s.setAttribute("aria-hidden","true");const a=f.createElement("span");a.textContent=o,a.style.fontFamily=e.config.chart.fontFamily,s.appendChild(a),i.appendChild(s),s.offsetWidth}s.classList.add("apexcharts-wheel-hint-visible");const n=e.interact;n.wheelHintTimer&&clearTimeout(n.wheelHintTimer),n.wheelHintTimer=setTimeout(()=>this._hideWheelHint(),1200)}_hideWheelHint(){var t;const e=this.w,i=e.interact;i.wheelHintTimer&&(clearTimeout(i.wheelHintTimer),i.wheelHintTimer=null);const s=null==(t=e.dom.elWrap)?void 0:t.querySelector(".apexcharts-wheel-hint");s&&s.classList.remove("apexcharts-wheel-hint-visible")}_focusForKeyboard(){var t,e;const i=this.w.dom.Paper&&this.w.dom.Paper.node;if(i&&"function"==typeof i.focus&&null!==i.getAttribute("tabindex")){null==(e=null==(t=this.ctx.keyboardNavigation)?void 0:t.notePointerFocus)||e.call(t);try{i.focus({preventScroll:!0})}catch(t){i.focus()}}}escapeResetEvent(t){if("Escape"!==t.key&&"Esc"!==t.key)return;if(!this.w.interact.zoomed)return;const e=this.ctx.keyboardNavigation;e&&e.active||this.resetControlAllowed()&&this.handleZoomReset()}_wheel(){const t=this.w.interact;return t.wheel||(t.wheel={factor:1,clientX:0,rafId:null,endTimer:null}),t.wheel}mouseWheelEvent(t){const e=this._wheel();if(!this._wheelZoomGreedy()&&!t.ctrlKey&&!t.metaKey&&null==e.endTimer)return void this._showWheelHint(t);t.preventDefault(),this._hideWheelHint();let i=t.deltaY;1===t.deltaMode?i*=33:2===t.deltaMode&&(i*=330),e.factor*=Math.pow(2,i/240),e.clientX=t.clientX,null==e.rafId&&(e.rafId=requestAnimationFrame(()=>this._applyWheelZoom())),e.endTimer&&clearTimeout(e.endTimer),e.endTimer=setTimeout(()=>this._endWheelZoom(),150)}_applyWheelZoom(){const t=this.w,e=this._wheel();e.rafId=null;const i=e.factor;if(e.factor=1,1===i||t.globals.isDestroyed)return;const s=t.layout.gridWidth;if(!this._hasPlot()||!s)return;const{min:n,max:r}=this._currentXWindow(),o=r-n,a=Math.min(Math.max(this._screenXToPlotPx(e.clientX)/s,0),1);let l=o*i;const c=this._clampBounds();if(c){const e=t.globals.minXDiff>0&&isFinite(t.globals.minXDiff)?t.globals.minXDiff:0,i=Math.max(2*e,1e-6*(c.max-c.min));l<i&&(l=i),l>c.max-c.min&&(l=c.max-c.min)}let h=n+a*o-a*l,d=h+l;const u=1e-9*o;if(Math.abs(h-n)<u&&Math.abs(d-r)<u)return;if(isNaN(h)||isNaN(d))return;const g=this.getBeforeZoomRange({min:h,max:d},void 0);g&&g.xaxis&&(h=g.xaxis.min,d=g.xaxis.max),this._applyXRange(h,d,!0)}_endWheelZoom(){const t=this.w;if(this._wheel().endTimer=null,t.globals.isDestroyed||!t.interact.zoomed)return;const{min:e,max:i}=this._currentXWindow(),s=t.globals.initialConfig?g.clone(t.globals.initialConfig.yaxis):[],n=this.ctx.toolbar;n&&n.zoomCallback({min:e,max:i},s)}makeSelectionRectDraggable(){const t=this.w;if(!this.selectionRect)return;const e=this.selectionRect.node.getBoundingClientRect();e.width>0&&e.height>0&&(this.selectionRect.select(!1).resize(!1),this.selectionRect.select({createRot:()=>{},updateRot:()=>{},createHandle:(t,e,i,s,n)=>"l"===n||"r"===n?t.circle(8).css({"stroke-width":1,stroke:"#333",fill:"#fff"}):t.circle(0),updateHandle:(t,e)=>t.center(e[0],e[1])}).resize().on("resize",()=>{var e;if(this._clampSelectionRectToPlot(),t.interact.selectionEnabled)t.interact.selection={x:parseFloat(this.selectionRect.node.getAttribute("x")),y:parseFloat(this.selectionRect.node.getAttribute("y")),width:parseFloat(this.selectionRect.node.getAttribute("width")),height:parseFloat(this.selectionRect.node.getAttribute("height"))},clearTimeout(null!=(e=this.w.globals.selectionResizeTimer)?e:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},30);else{const e=t.interact.zoomEnabled?t.config.chart.zoom.type:t.config.chart.selection.type;this.handleMouseUp({zoomtype:e,isResized:!0})}}))}preselectedSelection(){const t=this.w,e=this.xyRatios;if(!t.interact.zoomEnabled)if(void 0!==t.interact.selection&&null!==t.interact.selection)this.drawSelectionRect(l(a({},t.interact.selection),{translateX:t.layout.translateX,translateY:t.layout.translateY}));else if(void 0!==t.config.chart.selection.xaxis.min&&void 0!==t.config.chart.selection.xaxis.max){let i=F.dataXToPx(t,t.config.chart.selection.xaxis.min),s=F.dataXToPx(t,t.config.chart.selection.xaxis.max)-i;t.axisFlags.isRangeBar&&(i=(t.config.chart.selection.xaxis.min-t.globals.yAxisScale[0].niceMin)/e.invertedYRatio,s=(t.config.chart.selection.xaxis.max-t.config.chart.selection.xaxis.min)/e.invertedYRatio);const n={x:i,y:0,width:s,height:t.layout.gridHeight,translateX:t.layout.translateX,translateY:t.layout.translateY,selectionEnabled:!0};this.drawSelectionRect(n),this.makeSelectionRectDraggable(),"function"==typeof t.config.chart.events.selection&&t.config.chart.events.selection(this.ctx,{xaxis:{min:t.config.chart.selection.xaxis.min,max:t.config.chart.selection.xaxis.max},yaxis:{}})}}drawSelectionRect({x:t,y:e,width:i,height:s,translateX:n=0,translateY:r=0}){const o=this.w,a=this.zoomRect,l=this.selectionRect;if(this.dragged||null!==o.interact.selection){const c={transform:"translate("+n+", "+r+")"};o.interact.zoomEnabled&&this.dragged&&(i<0&&(i=1),a.attr({x:t,y:e,width:i,height:s,fill:o.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":o.config.chart.zoom.zoomedArea.fill.opacity,stroke:o.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":o.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":o.config.chart.zoom.zoomedArea.stroke.opacity}),v.setAttrs(a.node,c)),o.interact.selectionEnabled&&(l.attr({x:t,y:e,width:i>0?i:0,height:s>0?s:0,fill:o.config.chart.selection.fill.color,"fill-opacity":o.config.chart.selection.fill.opacity,stroke:o.config.chart.selection.stroke.color,"stroke-width":o.config.chart.selection.stroke.width,"stroke-dasharray":o.config.chart.selection.stroke.dashArray,"stroke-opacity":o.config.chart.selection.stroke.opacity}),v.setAttrs(l.node,c))}}_clampSelectionRectToPlot(){const t=this.selectionRect;if(!t||!t.node)return;const e=this.w.layout.gridWidth;if(!(e>0))return;const i=parseFloat(t.node.getAttribute("x"))||0,s=parseFloat(t.node.getAttribute("width"))||0,n=t=>Math.min(Math.max(t,0),e),r=n(i),o=n(i+s);r===i&&o===i+s||(t.attr({x:r,width:o-r}),t._updateSelectPositions&&t._updateSelectPositions())}hideSelectionRect(t){t&&t.attr({x:0,y:0,width:0,height:0})}selectionDrawing({context:t,zoomtype:e}){const i=this.w,s=t;if(!this._hasPlot())return;const n=s.startX,r=s.startY;let o=!1,c=!1;const h=this._screenXToPlotPx(s.clientX),d=this._screenYToPlotPx(s.clientY);let u=h-n,g=d-r,p={translateX:i.layout.translateX,translateY:i.layout.translateY};return Math.abs(u+n)>i.layout.gridWidth?u=i.layout.gridWidth-n:h<0&&(u=n),n>h&&(o=!0,u=Math.abs(u)),r>d&&(c=!0,g=Math.abs(g)),p="x"===e?{x:o?n-u:n,y:0,width:u,height:i.layout.gridHeight}:"y"===e?{x:0,y:c?r-g:r,width:i.layout.gridWidth,height:g}:{x:o?n-u:n,y:c?r-g:r,width:u,height:g},p=l(a({},p),{translateX:i.layout.translateX,translateY:i.layout.translateY}),s.drawSelectionRect(p),s.selectionDragging("resizing"),p}selectionDragging(t,e){var i;const s=this.w;if(!e)return;e.preventDefault();const{handler:n,box:r}=e.detail,o=this.constraints;let{x:a,y:l}=r;a<o.x&&(a=o.x),l<o.y&&(l=o.y),r.x2>o.x2&&(a=o.x2-r.w),r.y2>o.y2&&(l=o.y2-r.h),n.move(a,l);const c=this.selectionRect;let h=0;"resizing"===t&&(h=30);const d=t=>parseFloat(c.node.getAttribute(t)),u={x:d("x"),y:d("y"),width:d("width"),height:d("height")};s.interact.selection=u;const g=s.config.chart.link,p=!(!g||!g.enabled&&"function"!=typeof g.dimension);("function"==typeof s.config.chart.events.selection||p)&&s.interact.selectionEnabled&&(clearTimeout(null!=(i=this.w.globals.selectionResizeTimer)?i:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{this._emitSelectionFromRect()},h))}_emitSelectionFromRect(){var t;const e=this.w;if(!e.interact.selectionEnabled)return;const i=e.config.chart.link,s=!(!i||!i.enabled&&"function"!=typeof i.dimension);if("function"!=typeof e.config.chart.events.selection&&!s)return;if(!this._hasPlot())return;const n=this.selectionRect.node.getBoundingClientRect(),r=this.xyRatios;let o,a,l,c;const h=this._screenXToPlotPx(n.left),d=this._screenXToPlotPx(n.right);if(e.axisFlags.isRangeBar)o=e.globals.yAxisScale[0].niceMin+h*r.invertedYRatio,a=e.globals.yAxisScale[0].niceMin+d*r.invertedYRatio,l=0,c=1;else{if(!e.globals.xAxisScale)return;o=F.pxToDataX(e,h),a=F.pxToDataX(e,d),l=e.globals.yAxisScale[0].niceMin+(e.layout.gridHeight-this._screenYToPlotPx(n.bottom))*r.yRatio[0],c=e.globals.yAxisScale[0].niceMax-this._screenYToPlotPx(n.top)*r.yRatio[0]}const u={xaxis:{min:o,max:a},yaxis:{min:l,max:c}};"function"==typeof e.config.chart.events.selection&&e.config.chart.events.selection(this.ctx,u),e.config.chart.brush.enabled&&void 0!==e.config.chart.events.brushScrolled&&e.config.chart.events.brushScrolled(this.ctx,u),null==(t=this.ctx.linkedViews)||t.onSourceSelection(u.xaxis)}selectionDrawn({context:t,zoomtype:e}){var i;const s=this.w,n=t,r=this.xyRatios,o=this.ctx.toolbar,a=s.interact.zoomEnabled?n.zoomRect.node.getBoundingClientRect():n.selectionRect.node.getBoundingClientRect();if(!n._hasPlot())return;const l=this._screenXToPlotPx(a.left),c=this._screenXToPlotPx(a.right),h=this._screenYToPlotPx(a.top),d=this._screenYToPlotPx(a.bottom);let u,p;s.axisFlags.isRangeBar?(u=s.globals.yAxisScale[0].niceMin+l*r.invertedYRatio,p=s.globals.yAxisScale[0].niceMin+c*r.invertedYRatio):(u=F.pxToDataX(s,l),p=F.pxToDataX(s,c));const f=[],m=[];if(s.config.yaxis.forEach((t,e)=>{const i=s.globals.seriesYAxisMap[e][0],n=s.globals.yAxisScale[e].niceMax-r.yRatio[i]*h,o=s.globals.yAxisScale[e].niceMax-r.yRatio[i]*d;f.push(n),m.push(o)}),n.dragged&&(n.dragX>10||n.dragY>10)&&u!==p)if(s.interact.zoomEnabled){if(!s.globals.initialConfig)return;let t=g.clone(s.globals.initialConfig.yaxis),i=g.clone(s.globals.initialConfig.xaxis);if(s.interact.zoomed=!0,s.config.xaxis.convertedCatToNumeric&&(u=Math.floor(u),p=Math.floor(p),u<1&&(u=1,p=s.globals.dataPoints),p-u<2&&(p=u+1)),"xy"!==e&&"x"!==e||(i={min:u,max:p}),"xy"!==e&&"y"!==e||t.forEach((e,i)=>{t[i].min=m[i],t[i].max=f[i]}),o){const e=o.getBeforeZoomRange(i,t);e&&(i=e.xaxis?e.xaxis:i,t=e.yaxis?e.yaxis:t)}const r={xaxis:i};s.config.chart.group||(r.yaxis=t);const a=n.ctx.updateHelpers._updateOptions(r,!1,n.w.config.chart.animations.dynamicAnimation.enabled);a&&"function"==typeof a.then?a.then(()=>n._focusForKeyboard()):n._focusForKeyboard(),"function"==typeof s.config.chart.events.zoomed&&o.zoomCallback(i,t)}else if(s.interact.selectionEnabled){let t=null,r=null;if(r={min:u,max:p},"xy"===e||"y"===e){const e=g.clone(s.config.yaxis);t=e,e.forEach((t,i)=>{e[i].min=m[i],e[i].max=f[i]})}s.interact.selection=n.selection,"function"==typeof s.config.chart.events.selection&&s.config.chart.events.selection(n.ctx,{xaxis:r,yaxis:t}),null==(i=n.ctx.linkedViews)||i.onSourceSelection(r)}}panDragging({context:t}){var e;const i=this.w,s=t;if(void 0!==i.interact.lastClientPosition.x){const t=i.interact.lastClientPosition.x-s.clientX,n=(null!=(e=i.interact.lastClientPosition.y)?e:0)-s.clientY;Math.abs(t)>Math.abs(n)&&t>0?this.moveDirection="left":Math.abs(t)>Math.abs(n)&&t<0?this.moveDirection="right":Math.abs(n)>Math.abs(t)&&n>0?this.moveDirection="up":Math.abs(n)>Math.abs(t)&&n<0&&(this.moveDirection="down")}i.interact.lastClientPosition={x:s.clientX,y:s.clientY};const n=i.axisFlags.isRangeBar?i.globals.minY:i.globals.minX,r=i.axisFlags.isRangeBar?i.globals.maxY:i.globals.maxX;s.panScrolled(n,r)}panScrolled(t,e){var i,s;const n=this.w,r=this.xyRatios;if(!n.globals.initialConfig)return;const o=g.clone(n.globals.initialConfig.yaxis);let a=r.xRatio,l=n.globals.minX,c=n.globals.maxX;if(n.axisFlags.isRangeBar&&(a=r.invertedYRatio,l=n.globals.minY,c=n.globals.maxY),"left"===this.moveDirection?(t=l+n.layout.gridWidth/15*a,e=c+n.layout.gridWidth/15*a):"right"===this.moveDirection&&(t=l-n.layout.gridWidth/15*a,e=c-n.layout.gridWidth/15*a),!n.axisFlags.isRangeBar){const r=null!=(i=n.globals.dataReducerRawMinX)?i:n.globals.initialMinX,o=null!=(s=n.globals.dataReducerRawMaxX)?s:n.globals.initialMaxX;(t<r||e>o)&&(t=l,e=c)}if(t===l&&e===c)return;const h={xaxis:{min:t,max:e}};n.config.chart.group||(h.yaxis=o),this.updateScrolledChart(h,t,e)}updateScrolledChart(t,e,i){const s=this.w;if(this.ctx.updateHelpers._updateOptions(t,!1,!1),"function"==typeof s.config.chart.events.scrolled){const t={xaxis:{min:e,max:i}};s.config.chart.events.scrolled(this.ctx,t),this.ctx.events.fireEvent("scrolled",t)}}_momentumEnabled(){return this._pinchEnabled()||this._panInertiaEnabled()}_pinchEnabled(){return this._incidentalZoomEnabled(this.w.config.chart.zoom.pinch)}_panInertiaEnabled(){const t=this.w.config.chart;return!(!t.pan||!t.pan.inertia)}_m(){const t=this.w.interact;return t.momentum||(t.momentum={busy:!1,pinch:null,panState:null,samples:[],inertiaRAF:null}),t.momentum}_currentXWindow(){const t=this.w;return t.axisFlags.isRangeBar?{min:t.globals.minY,max:t.globals.maxY}:{min:t.globals.minX,max:t.globals.maxX}}_hasPlot(){const t=this.w.dom.baseEl;return!(!t||!t.querySelector(".apexcharts-svg"))}_screenYToPlotPx(t){const e=P.plotRect(this.w);return(t-e.top)/e.zoom}_screenXToPlotPx(t){return F.screenXToPlotPx(this.w,t)}_clampBounds(){var t,e;const i=this.w;return i.axisFlags.isRangeBar?null:{min:null!=(t=i.globals.dataReducerRawMinX)?t:i.globals.initialMinX,max:null!=(e=i.globals.dataReducerRawMaxX)?e:i.globals.initialMaxX}}_applyXRange(t,e,i){const s=this.w;if(!s.globals.initialConfig)return!1;const n=this._currentXWindow(),r=i&&e-t>n.max-n.min,o=this._clampBounds();if(o){const i=e-t;t<o.min&&(e=(t=o.min)+i),e>o.max&&(t=(e=o.max)-i),t<o.min&&(t=o.min)}if(s.config.xaxis.convertedCatToNumeric&&(t=Math.floor(t),e=r?Math.ceil(e):Math.floor(e),t<1&&(t=1),o&&e>o.max&&(e=Math.floor(o.max)),e-t<2))return!1;if(!(e>t))return!1;const a={xaxis:{min:t,max:e}};return s.config.chart.group||(a.yaxis=g.clone(s.globals.initialConfig.yaxis)),i&&(s.interact.zoomed=!0),this.ctx.updateHelpers._updateOptions(a,!1,!1),{minX:t,maxX:e}}_cancelInertia(){const t=this._m();null!=t.inertiaRAF&&(cancelAnimationFrame(t.inertiaRAF),t.inertiaRAF=null)}_fireScrolled(){const t=this.w;if("function"!=typeof t.config.chart.events.scrolled)return;const{min:e,max:i}=this._currentXWindow(),s={xaxis:{min:e,max:i}};t.config.chart.events.scrolled(this.ctx,s),this.ctx.events.fireEvent("scrolled",s)}panBy(t){const e=this.w;if(!e.interact.zoomed)return;const{min:i,max:s}=this._currentXWindow();let n=(s-i)*t;if(e.config.xaxis.convertedCatToNumeric&&(n=n>0?Math.ceil(n):Math.floor(n)),e.axisFlags.isRangeBar){const t=e.rangeData;let r=1/0,o=-1/0;if(t.seriesRangeStart.concat(t.seriesRangeEnd).flat().forEach(t=>{null!=t&&(r=Math.min(r,t),o=Math.max(o,t))}),n=n>0?Math.min(n,Math.max(0,o-s)):Math.max(n,Math.min(0,r-i)),!n)return}this._applyXRange(i+n,s+n,!1)&&this._fireScrolled()}_pushSample(t,e){const i=this._m().samples;for(i.push({x:t,t:e});i.length>6;)i.shift()}momentumTouch(t){const e=this.w,i=this._m(),s=t.type;if("touchstart"!==s)"touchmove"!==s?(i.pinch?t.touches.length<2&&this._endPinch():i.panState&&0===t.touches.length&&this._endPan(),0===t.touches.length&&(e.interact.mousedown=!1,this.dragged=!1,null!=i.inertiaRAF||i.pinch||i.panState||(i.busy=!1))):i.pinch&&t.touches.length>=2?(t.preventDefault(),this._movePinch(t)):i.panState&&1===t.touches.length&&this._movePan(t);else{if(this._cancelInertia(),!this._hasPlot())return;if(t.touches.length>=2&&this._pinchEnabled())t.preventDefault(),i.busy=!0,i.panState=null,this._beginPinch(t);else if(1===t.touches.length&&this._panInertiaEnabled()&&e.interact.panEnabled){i.busy=!0,i.pinch=null;const s=t.touches[0],n=this._currentXWindow(),r=e.layout.gridWidth||1,o=P.plotRect(e).zoom;i.panState={startX:s.clientX,startY:s.clientY,axis:null,minX0:n.min,maxX0:n.max,zoom:o,ratio0:(n.max-n.min)/r/o},i.samples=[{x:s.clientX,t:t.timeStamp}]}}}_beginPinch(t){const e=this.w,i=t.touches[0],s=t.touches[1],n=Math.hypot(s.clientX-i.clientX,s.clientY-i.clientY)||1,r=this._screenXToPlotPx((i.clientX+s.clientX)/2),{min:o,max:a}=this._currentXWindow();this._m().pinch={d0:n,cx0:r,minX0:o,maxX0:a,gridWidth:e.layout.gridWidth||1}}_movePinch(t){const e=this.w,i=this._m().pinch;if(!i||!this._hasPlot())return;const s=t.touches[0],n=t.touches[1],r=Math.hypot(n.clientX-s.clientX,n.clientY-s.clientY)||1,o=this._screenXToPlotPx((s.clientX+n.clientX)/2),a=i.maxX0-i.minX0,l=a*(i.d0/r);let c=i.minX0+i.cx0/i.gridWidth*a-o/i.gridWidth*l,h=c+l;const d=this._clampBounds();if(d){const t=e.globals.minXDiff>0&&isFinite(e.globals.minXDiff)?e.globals.minXDiff:0,i=Math.max(2*t,1e-6*(d.max-d.min));if(h-c<i){const t=(c+h)/2;c=t-i/2,h=t+i/2}}this._applyXRange(c,h,!0)}_endPinch(){const t=this.w;this._m().pinch=null;const{min:e,max:i}=this._currentXWindow(),s={min:e,max:i},n=t.globals.initialConfig?g.clone(t.globals.initialConfig.yaxis):[],r=this.ctx.toolbar;r&&r.zoomCallback(s,n)}_movePan(t){const e=this._m(),i=e.panState,s=t.touches[0];if(!i.axis){const n=Math.abs(s.clientX-i.startX),r=Math.abs(s.clientY-i.startY);if(n<6&&r<6)return void this._pushSample(s.clientX,t.timeStamp);if(r>n)return e.busy=!1,void(e.panState=null);i.axis="x"}if("x"!==i.axis)return;t.preventDefault();const n=(s.clientX-i.startX)*i.ratio0;this._pushSample(s.clientX,t.timeStamp),this._applyXRange(i.minX0-n,i.maxX0-n,!1)}_endPan(){const t=this._m(),e=t.panState;t.panState=null;let i=0;const s=t.samples;if(s.length>=2){const t=s[0],e=s[s.length-1],n=e.t-t.t;n>0&&(i=(e.x-t.x)/n)}t.samples=[],e&&"x"===e.axis&&this._panInertiaEnabled()&&Math.abs(i)>.05?this._startInertia(i/e.zoom):(t.busy=!1,this._fireScrolled())}_startInertia(t){const e=this.w,i=this._m(),s=e.config.chart.pan&&e.config.chart.pan.friction,n="number"==typeof s?Math.min(Math.max(s,.5),.999):.92;let r=t,o=null;i.busy=!0;const a=t=>{if(e.globals.isDestroyed)return i.inertiaRAF=null,void(i.busy=!1);if(null==o)return o=t,void(i.inertiaRAF=requestAnimationFrame(a));const s=t-o;if(o=t,r*=Math.pow(n,s/16.6667),Math.abs(r)<.02)return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();const l=this._currentXWindow(),c=e.layout.gridWidth||1,h=(l.max-l.min)/c,d=r*s*h,u=this._applyXRange(l.min-d,l.max-d,!1),g=this._clampBounds();if(!u||g&&(d>0&&u.minX<=g.min+1e-6*(g.max-g.min)||d<0&&u.maxX>=g.max-1e-6*(g.max-g.min)))return i.inertiaRAF=null,i.busy=!1,void this._fireScrolled();i.inertiaRAF=requestAnimationFrame(a)};i.inertiaRAF=requestAnimationFrame(a)}}});const $=h.__apex_Animations_prefersReducedMotion,z=h.__apex_Animations_applyProgressiveReveal;class B{constructor(t){this.w=t.w,this.annoCtx=t}setOrientations(t,e=null){var i,s;const n=this.w;if("vertical"===t.label.orientation){const r=null!==e?e:0,o=n.dom.baseEl.querySelector(`.apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='${r}']`);if(null!==o){const e=o.getBBox();o.setAttribute("x",String(parseFloat(null!=(i=o.getAttribute("x"))?i:"0")-e.height+4));const n="top"===t.label.position?e.width:-e.width;o.setAttribute("y",String(parseFloat(null!=(s=o.getAttribute("y"))?s:"0")+n));const{x:r,y:a}=this.annoCtx.graphics.rotateAroundCenter(o);o.setAttribute("transform",`rotate(-90 ${r} ${a})`)}}}addBackgroundToAnno(t,e,i){const s=this.w;if(!t||!e.label.text||!String(e.label.text).trim())return null;const n=s.dom.baseEl.querySelector(".apexcharts-grid");if(!n)return null;const r=n.getBoundingClientRect(),o=n.getBBox(),a=r.width/o.width||1,l=t.getBoundingClientRect();let{left:c,right:h,top:d,bottom:u}=e.label.style.padding;"vertical"===e.label.orientation&&([d,u,c,h]=[c,h,d,u]);const g=r.left-o.x*a,p=r.top-o.y*a,f=(l.left-g)/a-c,m=(l.top-p)/a-d,x=()=>{const t=this.annoCtx.graphics.drawRect(f,m,l.width/a+c+h,l.height/a+d+u,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&t.node.classList.add(e.id),t};return i?x:x()}annotationsBackground(){const t=this.w,e=[],i=(i,s,n)=>{const r=t.dom.baseEl.querySelector(`.apexcharts-${n}-annotations .apexcharts-${n}-annotation-label[rel='${s}']`),o=this.addBackgroundToAnno(r,i,!0);o&&e.push(()=>{const e=o(),s=r.parentNode;null==s||s.insertBefore(e.node,r);const n=r.getAttribute("x");null!==n&&z(e,parseFloat(n),t),i.label.mouseEnter&&e.node.addEventListener("mouseenter",i.label.mouseEnter.bind(this,i)),i.label.mouseLeave&&e.node.addEventListener("mouseleave",i.label.mouseLeave.bind(this,i)),i.label.click&&e.node.addEventListener("click",i.label.click.bind(this,i))})};t.config.annotations.xaxis.forEach((t,e)=>i(t,e,"xaxis")),t.config.annotations.yaxis.forEach((t,e)=>i(t,e,"yaxis")),t.config.annotations.points.forEach((t,e)=>i(t,e,"point")),e.forEach(t=>t())}usesCategoryX(){const t=this.w;return("category"===t.config.xaxis.type||t.config.xaxis.convertedCatToNumeric)&&!this.annoCtx.invertAxis&&!t.axisFlags.dataFormatXNumeric&&!t.config.chart.sparkline.enabled}hasXDomain(){const t=this.w;return this.annoCtx.invertAxis?g.isNumber(t.globals.minY)&&g.isNumber(t.globals.yRange[0]):this.usesCategoryX()?t.labelData.labels.length>0||t.labelData.categoryLabels.length>0:g.isNumber(t.globals.minX)&&g.isNumber(t.globals.xRange)}getY1Y2(t,e){var i,s,n;const r=this.w,o="y1"===t?e.y:e.y2,a="string"==typeof o&&o.includes("px");let l,c=!1;if(this.annoCtx.invertAxis){const t=r.config.xaxis.convertedCatToNumeric?r.labelData.categoryLabels:r.labelData.labels,s=t.indexOf(o);if(!a&&-1===s)return{yP:0,clipped:!0};const n=r.dom.baseEl.querySelector(`.apexcharts-yaxis-texts-g text:nth-child(${s+1})`);l=n?parseFloat(null!=(i=n.getAttribute("y"))?i:"0"):(r.layout.gridHeight/t.length-1)*(s+1)-r.globals.barHeight,void 0!==e.seriesIndex&&r.globals.barHeight&&(l+=this.barSlotOffset(e.seriesIndex,r.globals.barHeight))}else{if(!r.config.yaxis[e.yAxisIndex])return{yP:0,clipped:!0};const t=r.globals.seriesYAxisMap[e.yAxisIndex],i=null!=(s=null==t?void 0:t[0])?s:null;if(null===i&&r.seriesData.series.length)return{yP:0,clipped:!0};const a=null===i?r.globals.minY:r.globals.minYArr[i],h=null===i?r.globals.maxY-r.globals.minY:r.globals.yRange[i],d=r.config.yaxis[e.yAxisIndex].logarithmic&&null!==i?new y(this.w).getLogVal(r.config.yaxis[e.yAxisIndex].logBase,o,i)/r.globals.yLogRatio[i]:(o-a)/(h/r.layout.gridHeight);l=r.layout.gridHeight-Math.min(Math.max(d,0),r.layout.gridHeight),c=d>r.layout.gridHeight||d<0,!e.marker||void 0!==e.y&&null!==e.y||(l=0),(null==(n=r.config.yaxis[e.yAxisIndex])?void 0:n.reversed)&&(l=d)}return a&&(l=parseFloat(o)),{yP:l,clipped:c}}getX1X2(t,e){const i=this.w,s="x1"===t?e.x:e.x2,n=this.annoCtx.invertAxis?i.globals.minY:i.globals.minX,r=this.annoCtx.invertAxis?i.globals.maxY:i.globals.maxX,o=this.annoCtx.invertAxis?i.globals.yRange[0]:i.globals.xRange;let a=!1;const l="string"==typeof s&&s.includes("px"),c=null==s&&e.marker;if(!l&&!c&&!this.hasXDomain())return{x:0,clipped:!0};let h=this.annoCtx.inversedReversedAxis?(r-s)/(o/i.layout.gridWidth):(s-n)/(o/i.layout.gridWidth);return this.usesCategoryX()&&(h=this.getStringX(s)),"string"==typeof s&&s.includes("px")&&(h=parseFloat(s)),null==s&&e.marker&&(h=i.layout.gridWidth),void 0!==e.seriesIndex&&i.globals.barWidth&&!this.annoCtx.invertAxis&&(h+=this.barSlotOffset(e.seriesIndex,i.globals.barWidth)),"number"!=typeof h&&(h=0,a=!0),parseFloat(h.toFixed(10))>parseFloat(i.layout.gridWidth.toFixed(10))?(h=i.layout.gridWidth,a=!0):h<0&&(h=0,a=!0),{x:h,clipped:a}}barSlotOffset(t,e){const i=this.w;if(i.config.chart.stacked)return 0;let s=0,n=0;return i.seriesData.series.forEach((e,r)=>{var o;const a=null==(o=i.config.series[r])?void 0:o.type;!e.length||i.globals.comboCharts&&"bar"!==a&&"column"!==a||(r<t&&n++,s++)}),e*(n-(s-1)/2)}getStringX(t){var e;const i=this.w;let s=t;if(i.config.xaxis.convertedCatToNumeric&&i.labelData.categoryLabels.length){const e=String(t);t=i.labelData.categoryLabels.findIndex(t=>String(t)===e)+1}const n=i.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(t),r=i.dom.baseEl.querySelector(`.apexcharts-xaxis-texts-g text:nth-child(${n+1})`);return r?s=parseFloat(null!=(e=r.getAttribute("x"))?e:"0"):n>-1&&(s=i.axisFlags.isXNumeric?(t-i.globals.minX)/(i.globals.xRange/i.layout.gridWidth):i.globals.padHorizontal+(n+.5)*i.layout.gridWidth/i.globals.dataPoints),s}}class W{constructor(t){this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new B(this.annoCtx)}addXaxisAnnotation(t,e,i){const s=this.w,n=this.helpers.getX1X2("x1",t);let r=n.x;const o=n.clipped;let a,l=!0;const c=t.label.text,h=t.strokeDashArray;if(g.isNumber(r)){if(null===t.x2||void 0===t.x2){if(!o){const i=this.annoCtx.graphics.drawLine(r+t.offsetX,0+t.offsetY,r+t.offsetX,s.layout.gridHeight+t.offsetY,t.borderColor,h,t.borderWidth);e.appendChild(i.node),t.id&&i.node.classList.add(t.id),z(i,r+t.offsetX,s)}}else{const i=this.helpers.getX1X2("x2",t);if(a=i.x,l=i.clipped,a<r){const t=r;r=a,a=t}const n=this.annoCtx.graphics.drawRect(r+t.offsetX,0+t.offsetY,a-r,s.layout.gridHeight+t.offsetY,0,t.fillColor,t.opacity,1,t.borderColor,h);n.node.classList.add("apexcharts-annotation-rect"),n.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`),e.appendChild(n.node),t.id&&n.node.classList.add(t.id),z(n,r+t.offsetX,s)}if(!o||!l){const n=this.annoCtx.graphics.getTextRects(c,t.label.style.fontSize),o="top"===t.label.position?4:"center"===t.label.position?s.layout.gridHeight/2+("vertical"===t.label.orientation?n.width/2:0):s.layout.gridHeight,a=this.annoCtx.graphics.drawText({x:r+t.label.offsetX,y:o+t.label.offsetY-("vertical"===t.label.orientation?"top"===t.label.position?n.width/2-12:-n.width/2:0),text:c,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-xaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});a.attr({rel:i}),e.appendChild(a.node),z(a,r+t.label.offsetX,s),this.annoCtx.helpers.setOrientations(t,i)}}}drawXAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return t.config.annotations.xaxis.map((t,i)=>{this.addXaxisAnnotation(t,e.node,i)}),e}}class N{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new B(this.annoCtx),this.axesUtils=new d(this.annoCtx.w,{theme:this.annoCtx.theme,timeScale:this.annoCtx.timeScale})}addYaxisAnnotation(t,e,i){const s=this.w,n=t.strokeDashArray;let r=this.helpers.getY1Y2("y1",t),o=r.yP;const a=r.clipped;let l,c=!0,h=!1;const d=t.label.text;if(null===t.y2||void 0===t.y2){if(!a){h=!0;const i=this.annoCtx.graphics.drawLine(0+t.offsetX,o+t.offsetY,this._getYAxisAnnotationWidth(t),o+t.offsetY,t.borderColor,n,t.borderWidth);e.appendChild(i.node),t.id&&i.node.classList.add(t.id)}}else{if(r=this.helpers.getY1Y2("y2",t),l=r.yP,c=r.clipped,l>o){const t=o;o=l,l=t}if(!a||!c){h=!0;const i=this.annoCtx.graphics.drawRect(0+t.offsetX,l+t.offsetY,this._getYAxisAnnotationWidth(t),o-l,0,t.fillColor,t.opacity,1,t.borderColor,n);i.node.classList.add("apexcharts-annotation-rect"),i.attr("clip-path",`url(#gridRectMask${s.globals.cuid})`),e.appendChild(i.node),t.id&&i.node.classList.add(t.id)}}if(h){const n="right"===t.label.position?s.layout.gridWidth:"center"===t.label.position?s.layout.gridWidth/2:0,r=this.annoCtx.graphics.drawText({x:n+t.label.offsetX,y:(null!=l?l:o)+t.label.offsetY-3,text:d,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-yaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});r.attr({rel:i}),e.appendChild(r.node)}}_getYAxisAnnotationWidth(t){const e=this.w;let i=e.layout.gridWidth;return i=t.width.indexOf("%")>-1?e.layout.gridWidth*parseInt(t.width,10)/100:parseInt(t.width,10),i+t.offsetX}drawYAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.forEach((t,i)=>{t.yAxisIndex=this.axesUtils.translateYAxisIndex(t.yAxisIndex),this.axesUtils.isYAxisHidden(t.yAxisIndex)&&this.axesUtils.yAxisAllSeriesCollapsed(t.yAxisIndex)||this.addYaxisAnnotation(t,e.node,i)}),e}}class O{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new B(this.annoCtx)}addPointAnnotation(t,e,i){const s=this.w;if(s.globals.collapsedSeriesIndices.indexOf(t.seriesIndex)>-1)return;const n=this.helpers.getX1X2("x1",t),r=n.x,o=n.clipped,a=this.helpers.getY1Y2("y1",t),l=a.yP,c=a.clipped;if(g.isNumber(r)&&!c&&!o){const n={pSize:t.marker.size,pointStrokeWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,pRadius:t.marker.radius,class:`apexcharts-point-annotation-marker ${t.marker.cssClass} ${t.id?t.id:""}`};let o=this.annoCtx.graphics.drawMarker(r+t.marker.offsetX,l+t.marker.offsetY,n);e.appendChild(o.node);const a=[o.node];z(o,r,s);const c=t.label.text?t.label.text:"",h=this.getConstrainedLabelX(c,r+t.label.offsetX,t.label),d=this.annoCtx.graphics.drawText({x:h,y:l+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:c,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-point-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});if(d.attr({rel:i}),e.appendChild(d.node),z(d,r,s),t.customSVG.SVG){const i=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});i.attr({transform:`translate(${r+t.customSVG.offsetX}, ${l+t.customSVG.offsetY})`}),i.node.innerHTML=t.customSVG.SVG,e.appendChild(i.node),a.push(i.node)}if(t.image.path){const e=t.image.width?t.image.width:20,i=t.image.height?t.image.height:20;o=this.annoCtx.addImage({x:r+t.image.offsetX-e/2,y:l+t.image.offsetY-i/2,width:e,height:i,path:t.image.path,appendTo:".apexcharts-point-annotations"}),a.push(o.node)}t.tooltip&&t.tooltip.enabled&&a.forEach(e=>{e.addEventListener("mouseenter",()=>{this.showPointTooltip(t,e)}),e.addEventListener("mouseleave",()=>{this.hidePointTooltip()})}),t.mouseEnter&&o.node.addEventListener("mouseenter",t.mouseEnter.bind(this,t)),t.mouseLeave&&o.node.addEventListener("mouseleave",t.mouseLeave.bind(this,t)),t.click&&o.node.addEventListener("click",t.click.bind(this,t))}}getConstrainedLabelX(t,e,i){const s=this.w;if(!t)return e;const{width:n}=this.annoCtx.graphics.getTextRects(t,i.style.fontSize,i.style.fontFamily,void 0,!0,i.style.fontWeight);let r,o;switch(i.textAnchor){case"start":r=e,o=e+n;break;case"end":r=e-n,o=e;break;default:r=e-n/2,o=e+n/2}const a=i.style.padding||{};return r-=a.left||0,o+=a.right||0,r<0?e-r:o>s.layout.gridWidth?e-(o-s.layout.gridWidth):e}getPointTooltipEl(){const t=this.w;let e=t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");return e||(e=f.createElementNS("http://www.w3.org/1999/xhtml","div"),e.classList.add("apexcharts-tooltip","apexcharts-annotation-tooltip"),t.dom.elWrap.appendChild(e)),e}getPointTooltipContent(t){const e=this.w,i=t.tooltip||{};if("function"==typeof i.formatter)return i.formatter({annotation:t,seriesIndex:t.seriesIndex,id:t.id,w:e});let s=null!=i.text?i.text:t.label&&t.label.text;return Array.isArray(s)&&(s=s.join("<br/>")),null==s?"":String(s)}showPointTooltip(t,e){const i=this.w,s=this.getPointTooltipContent(t);if(!s)return;const n=this.getPointTooltipEl();n.innerHTML=s;const r=t.tooltip.theme||i.config.tooltip.theme||"light";n.classList.remove("apexcharts-theme-light","apexcharts-theme-dark"),n.classList.add(`apexcharts-theme-${r}`),n.classList.add("apexcharts-active");const o=i.dom.elWrap.getBoundingClientRect(),a=e.getBoundingClientRect(),l=n.getBoundingClientRect(),c=t.tooltip.offsetX||0,h=t.tooltip.offsetY||0;let d=a.left-o.left+a.width/2-l.width/2,u=a.top-o.top-l.height-10;d=Math.max(0,Math.min(d,o.width-l.width)),u<0&&(u=a.top-o.top+a.height+10),n.style.left=d+c+"px",n.style.top=u+h+"px"}hidePointTooltip(){const t=this.w.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");t&&t.classList.remove("apexcharts-active")}drawPointAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map((t,i)=>{this.addPointAnnotation(t,e.node,i)}),e}}const H=h.__apex_Options;h.default.registerFeatures({annotations:class{constructor(t,{theme:e=null,timeScale:i=null}={}){this.w=t,this.theme=e,this.timeScale=i,this.invertAxis=void 0,this.inversedReversedAxis=void 0,this.graphics=new v(this.w),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new B(this),this.xAxisAnnotations=new W(this),this.yAxisAnnotations=new N(this),this.pointsAnnotations=new O(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0)}drawAxesAnnotations(){const t=this.w;if(t.globals.axisCharts){const e=this.yAxisAnnotations.drawYAxisAnnotations(),i=this.xAxisAnnotations.drawXAxisAnnotations(),s=this.pointsAnnotations.drawPointAnnotations(),n=t.config.chart.animations.enabled,r=[e,i,s],o=[i.node,e.node,s.node],a="line"===t.config.chart.type||"area"===t.config.chart.type||"rangeArea"===t.config.chart.type,l=[a,!1,a];for(let e=0;e<3;e++)t.dom.elGraphical.add(r[e]),!n||t.globals.resized||t.globals.dataChanged||t.globals.animationEnded||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&t.globals.dataPoints>1&&!l[e]&&o[e].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:o[e],index:0});this.helpers.annotationsBackground()}}drawImageAnnos(){this.w.config.annotations.images.map(t=>{this.addImage(t)})}drawTextAnnos(){this.w.config.annotations.texts.map(t=>{this.addText(t)})}addXaxisAnnotation(t,e,i){this.xAxisAnnotations.addXaxisAnnotation(t,e,i)}addYaxisAnnotation(t,e,i){this.yAxisAnnotations.addYaxisAnnotation(t,e,i)}addPointAnnotation(t,e,i){this.pointsAnnotations.addPointAnnotation(t,e,i)}addText(t){const{x:e,y:i,text:s,textAnchor:n,foreColor:r,fontSize:o,fontFamily:a,fontWeight:l,cssClass:c,backgroundColor:h,borderWidth:d,strokeDashArray:u,borderRadius:g,borderColor:p,appendTo:f=".apexcharts-svg",paddingLeft:m=4,paddingRight:x=4,paddingBottom:y=2,paddingTop:b=2}=t,v=this.w,w=v.dom.baseEl.querySelector(f);if(!w)return;const _=this.graphics.drawText({x:e,y:i,text:s,textAnchor:n||"start",fontSize:o||"12px",fontWeight:l||"regular",fontFamily:a||v.config.chart.fontFamily,foreColor:r||v.config.chart.foreColor,cssClass:c||""});w.appendChild(_.node);const A=_.bbox();if(s){const t=this.graphics.drawRect(A.x-m,A.y-b,A.width+m+x,A.height+y+b,g,h||"transparent",1,d,p,u);w.insertBefore(t.node,_.node)}}addImage(t){const e=this.w,{path:i,x:s=0,y:n=0,width:r=20,height:o=20,appendTo:a=".apexcharts-svg"}=t,l=e.dom.Paper.image(i);l.size(r,o).move(s,n);const c=e.dom.baseEl.querySelector(a);return c&&c.appendChild(l.node),l}addXaxisAnnotationExternal(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"xaxis",contextMethod:i.addXaxisAnnotation}),i}addYaxisAnnotationExternal(t,e,i){return this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"yaxis",contextMethod:i.addYaxisAnnotation}),i}addPointAnnotationExternal(t,e,i){return void 0===this.invertAxis&&(this.invertAxis=i.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:i,type:"point",contextMethod:i.addPointAnnotation}),i}addAnnotationExternal({params:t,pushToMemory:e,context:i,type:s,contextMethod:n}){var r;const o=i,a=o.w,l=a.dom.baseEl.querySelector(`.apexcharts-${s}-annotations`),c=((null==(r=a.config.annotations["point"===s?"points":s])?void 0:r.length)||0)+l.childNodes.length,h=new H,d=Object.assign({},"xaxis"===s?h.xAxisAnnotation:"yaxis"===s?h.yAxisAnnotation:h.pointAnnotation),u=g.extend(d,t);switch(s){case"xaxis":this.addXaxisAnnotation(u,l,c);break;case"yaxis":this.addYaxisAnnotation(u,l,c);break;case"point":this.addPointAnnotation(u,l,c)}const p=a.dom.baseEl.querySelector(`.apexcharts-${s}-annotations .apexcharts-${s}-annotation-label[rel='${c}']`),f=this.helpers.addBackgroundToAnno(p,u);return f&&l.insertBefore(f.node,p),e&&a.globals.memory.methodsToExec.push({context:o,id:u.id?u.id:g.randomId(),method:n,label:"addAnnotation",params:t}),i}_removeAnnotationTooltip(t){const e=t.dom.elWrap&&t.dom.elWrap.querySelector(".apexcharts-annotation-tooltip");e&&e.parentNode&&e.parentNode.removeChild(e)}clearAnnotations(t){const e=t.w;this._removeAnnotationTooltip(e);const i=e.dom.baseEl.querySelectorAll(".apexcharts-yaxis-annotations, .apexcharts-xaxis-annotations, .apexcharts-point-annotations");for(let t=e.globals.memory.methodsToExec.length-1;t>=0;t--)"addText"!==e.globals.memory.methodsToExec[t].label&&"addAnnotation"!==e.globals.memory.methodsToExec[t].label||e.globals.memory.methodsToExec.splice(t,1);Array.prototype.forEach.call(i,t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})}removeAnnotation(t,e){const i=t.w;this._removeAnnotationTooltip(i);const s=i.dom.baseEl.querySelectorAll(`.${e}`);s&&(i.globals.memory.methodsToExec=i.globals.memory.methodsToExec.filter(t=>t.id!==e),Object.keys(i.config.annotations).forEach(t=>{const s=i.config.annotations[t];Array.isArray(s)&&(i.config.annotations[t]=s.filter(t=>t.id!==e))}),Array.prototype.forEach.call(s,t=>{t.parentElement.removeChild(t)}))}}});h.default.registerFeatures({keyboardNavigation:class{constructor(t,e){this.w=t,this.ctx=e,this.seriesIndex=0,this.dataPointIndex=0,this.active=!1,this._tooltipDismissed=!1,this._announceTimer=void 0,this._focusedEl=null,this._hoveredBarEl=null,this._enlargedScatterMarker=null,this._onKeyDown=this._onKeyDown.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onLegendClick=this._onLegendClick.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._lastPointerDownAt=0}init(){const t=this.w,e=t.dom.Paper.node;if(!e)return;e.setAttribute("tabindex","0"),e.addEventListener("focus",this._onFocus),e.addEventListener("blur",this._onBlur),e.addEventListener("mousedown",this._onPointerDown,{capture:!0}),e.addEventListener("pointerdown",this._onPointerDown,{capture:!0}),e.addEventListener("touchstart",this._onPointerDown,{capture:!0,passive:!0}),e.addEventListener("keydown",this._onKeyDown,{passive:!1}),this.ctx.events.addEventListener("legendClick",this._onLegendClick);const i=t.interact.keyNav,s=e.ownerDocument;t.interact.keyNav=null,!i||s.activeElement&&s.activeElement!==s.body||([this.seriesIndex,this.dataPointIndex,,this._tooltipDismissed]=i,i[2]||this.notePointerFocus(),e.focus({preventScroll:!0}))}destroy(t){var e;const i=this.w,s=i.dom.Paper&&i.dom.Paper.node;this.ctx.events.removeEventListener("legendClick",this._onLegendClick),clearTimeout(this._announceTimer),s&&(t&&(null==(e=s.getRootNode)?void 0:e.call(s).activeElement)===s&&(i.interact.keyNav=[this.seriesIndex,this.dataPointIndex,this.active,this._tooltipDismissed]),s.removeEventListener("focus",this._onFocus),s.removeEventListener("blur",this._onBlur),s.removeEventListener("keydown",this._onKeyDown),s.removeEventListener("mousedown",this._onPointerDown,{capture:!0}),s.removeEventListener("pointerdown",this._onPointerDown,{capture:!0}),s.removeEventListener("touchstart",this._onPointerDown,{capture:!0}))}_onPointerDown(){this._lastPointerDownAt=Date.now()}notePointerFocus(){this._lastPointerDownAt=Date.now()}_onFocus(){this._isNavEnabled()&&(Date.now()-this._lastPointerDownAt<100||(this.active=!0,this._clampCursor(),this._snapToVisibleRange(),this._tooltipDismissed||this._showCurrentPoint()))}_onBlur(){this.active=!1,this._tooltipDismissed=!1,this._hideFocus()}_onLegendClick(){this.active&&(this.active=!1,this._hideFocus())}_onKeyDown(t){var e,i,s;if(this._isNavEnabled()&&this.active){if(t.shiftKey&&("ArrowRight"===t.key||"ArrowLeft"===t.key)&&this._canPan())return t.preventDefault(),void this._panBy("ArrowRight"===t.key?1:-1);switch(t.key){case"ArrowRight":t.preventDefault(),this._move(0,1);break;case"ArrowLeft":t.preventDefault(),this._move(0,-1);break;case"ArrowUp":t.preventDefault(),this._move(-1,0);break;case"ArrowDown":t.preventDefault(),this._move(1,0);break;case"Home":t.preventDefault(),this._seek(0,1),this._showCurrentPoint();break;case"End":t.preventDefault(),this._seek(this._getDataPointCount(this.seriesIndex)-1,-1),this._showCurrentPoint();break;case"Enter":case" ":t.preventDefault(),this._fireClick(t);break;case"+":case"=":this._canZoom()&&(t.preventDefault(),null==(e=this.ctx.toolbar)||e.handleZoomIn(),this._announce("Zoomed in"));break;case"-":case"_":this._canZoom()&&(t.preventDefault(),null==(i=this.ctx.toolbar)||i.handleZoomOut(),this._announce("Zoomed out"));break;case"0":this._canZoom()&&this.w.interact.zoomed&&(t.preventDefault(),null==(s=this.ctx.toolbar)||s.handleZoomReset(),this._announce("Zoom reset"));break;case"Escape":t.preventDefault(),this._tooltipDismissed?(this.active=!1,this._tooltipDismissed=!1,this._hideFocus()):(this._tooltipDismissed=!0,this._hideFocus())}}}_canZoom(){var t,e;const i=this.w,s=null==(t=this.ctx.toolbar)?void 0:t._currentXRange();return Boolean(i.globals.axisCharts&&(null==(e=i.config.chart.zoom)?void 0:e.enabled)&&(i.axisFlags.isXNumeric||i.config.xaxis.convertedCatToNumeric||i.axisFlags.isRangeBar)&&(null==s?void 0:s.minX)<(null==s?void 0:s.maxX))}_canPan(){return this._canZoom()&&this.w.interact.zoomed}_panBy(t){var e;null==(e=this.ctx.zoomPanSelection)||e.panBy(t/10),this._announce(t>0?"Panned right":"Panned left")}_move(t,e){var i;const s=this.w,n=s.config.chart.accessibility.keyboard.navigation.wrapAround;if(0!==t){const e=this.w.globals.tooltip,r=s.config.chart.type;if(!("heatmap"===r||"treemap"===r||"radialBar"===r)&&(null==e?void 0:e.ttItems)&&e.tConfig.shared){const t=this.dataPointIndex;if(e.tooltipUtil&&e.tooltipUtil.isXoverlap(t)&&e.tooltipUtil.isInitialSeriesSameLen())return}"heatmap"!==r||(null==(i=s.config.yaxis[0])?void 0:i.reversed)||(t=-t);const o=this._getSeriesCount();let a=this.seriesIndex;for(let e=1;e<o;e++){let i=a+t*e;if(n)i=(i+o)%o;else if(i<0||i>=o)break;if(!s.globals.collapsedSeriesIndices.includes(i)){a=i;break}}this.seriesIndex=a;const l=this._getDataPointCount(a);this.dataPointIndex>=l&&(this.dataPointIndex=l-1)}0!==e&&(this._seek(this.dataPointIndex+e,e),this._isDataPointVisible(this.seriesIndex,this.dataPointIndex)||this._snapToVisibleRangeInDirection(e)),this._showCurrentPoint()}_seek(t,e){const i=this.w,s=i.seriesData.series[this.seriesIndex],n=this._getDataPointCount(this.seriesIndex);for(let r=0;r<n;r++,t+=e){if(i.config.chart.accessibility.keyboard.navigation.wrapAround)t=(t+n)%n;else if(t<0||t>=n)return;if(!Array.isArray(s)||null!==s[t])return void(this.dataPointIndex=t)}}_showCurrentPoint(){const{seriesIndex:t,dataPointIndex:e}=this,i=this.w,s=i.globals.tooltip;if(this._tooltipDismissed=!1,i.interact.capturedSeriesIndex=t,i.interact.capturedDataPointIndex=e,this._applyFocusClass(t,e),!(null==s?void 0:s.ttItems))return this._announce(this._buildPointLabel(t,e));this._showTooltip(t,e,s)}_hideFocus(){var t;const e=this.w,i=e.globals.tooltip;if(this._removeFocusClass(),this._leaveHoveredBar(),!i)return;null==(t=i.tooltipPosition)||t.resetPlacementCache(),i.marker&&i.marker.resetPointsSize(),this._enlargedScatterMarker=null;const s=i.getElTooltip();s&&(s.classList.remove("apexcharts-active"),e.config.chart.accessibility.enabled&&e.config.chart.accessibility.announcements.enabled&&s.setAttribute("aria-hidden","true")),e.dom.baseEl.classList.remove("apexcharts-tooltip-active");const n=i.getElXCrosshairs();n&&n.classList.remove("apexcharts-active")}_showTooltip(t,e,i){const s=this.w,n=s.config.chart.type,r=i.getElTooltip();if(!r)return;const o=i.getCachedDimensions();i.tooltipRect={x:0,y:0,ttWidth:o.ttWidth||0,ttHeight:o.ttHeight||0},this._setSyntheticEvent(t,e,i),s.dom.baseEl.classList.add("apexcharts-tooltip-active"),r.classList.add("apexcharts-active"),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.announcements.enabled&&r.removeAttribute("aria-hidden"),"pie"===n||"donut"===n||"polarArea"===n||"radialBar"===n?this._showTooltipNonAxis(t,e,i,r):"heatmap"===n||"treemap"===n?this._showTooltipHeatTree(t,e,i,r,n):this._isBarLikeSeries(t)?this._showTooltipBar(t,e,i):this._showTooltipAxisLine(t,e,i),i.fixedTooltip&&i.drawFixedTooltipRect()}_isBarLikeSeries(t){var e;const i=this.w,s=i.config.series[t],n=i.globals.comboCharts&&null!=(e=null==s?void 0:s.type)?e:i.config.chart.type;return P.isBarLikeType(n)}_setSyntheticEvent(t,e,i){const s=this.w,n=s.config.chart.type;let r=0,o=0;const a=this._getFocusableElement(t,e),l=a?null:this._canvasCell(t,e)||this._canvasMark(t,e);if(a){const t=a.getBoundingClientRect();r=t.left+t.width/2,o=t.top+t.height/2}else if(l){const t=P.plotRect(s);r=t.left+(l.x+l.width/2)*t.zoom,o=t.top+(l.y+l.height/2)*t.zoom}else if(s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const n=s.globals.pointsArray[t][e];if(i.getElGrid&&i.getElGrid()){const t=P.plotRect(s);r=t.left+(n[0]||0)*t.zoom,o=t.top+(n[1]||0)*t.zoom}}else{const t=s.dom.Paper&&s.dom.Paper.node;if(t){const e=t.getBoundingClientRect();r=e.left+e.width/2,o=e.top+e.height/2}}if(!this._isBarLikeSeries(t)&&("line"===n||"area"===n||"rangeArea"===n||"scatter"===n||"bubble"===n||"radar"===n)&&s.globals.pointsArray&&s.globals.pointsArray[t]&&s.globals.pointsArray[t][e]){const n=s.globals.pointsArray[t][e];if(i.getElGrid&&i.getElGrid()){const t=P.plotRect(s);r=t.left+(n[0]||0)*t.zoom,o=t.top+(n[1]||0)*t.zoom}}i.e={type:"mousemove",clientX:r,clientY:o},i.clientX=r,i.clientY=o}_showTooltipBar(t,e,i){var s,n,r,o;const c=this.w;c.globals.comboCharts&&(i.marker.resetPointsSize(),this._enlargedScatterMarker=null);const h=i.tConfig.shared&&(i.tooltipUtil.isXoverlap(e)||c.globals.isBarHorizontal)&&i.tooltipUtil.isInitialSeriesSameLen(),d=null==(o=null==(r=null==(n=null==(s=c.rangeData.seriesRange)?void 0:s[t])?void 0:n[e])?void 0:r.y)?void 0:o[0];i.tooltipLabels.drawSeriesTexts(l(a(a({ttItems:i.ttItems,i:t,j:e},void 0!==(null==d?void 0:d.y1)&&{y1:d.y1}),void 0!==(null==d?void 0:d.y2)&&{y2:d.y2}),{shared:h}));const u=`.apexcharts-series[data\\:realIndex='${t}']`,g=this._canvasMark(t,e)?null:c.dom.Paper.findOne(`${u} path[j='${e}'], ${u} circle[j='${e}'], ${u} rect[j='${e}']`);if(g){this._leaveHoveredBar();new v(this.w,this.ctx).pathMouseEnter(g,null),this._hoveredBarEl=g}if(c.globals.isBarHorizontal){const s=i.fixedTooltip;if(!s&&!i.showOnIntersect&&!P.isFollowCursor(c)&&i.tooltipPosition.placeHorizontalSharedTooltip(e))return;const n=this._focusedBarInWrap(t,e,g,i),r=i.getElTooltip();if(n&&r&&!s){const s=i.tooltipRect.ttWidth||0,o=i.tooltipRect.ttHeight||0,a=P.plotInWrap(c),l={top:a.top,bottom:a.top+c.layout.gridHeight,left:a.left,right:a.left+c.layout.gridWidth},h=i.tooltipPosition.placeOnShortPlot((n.left+n.right)/2,n.top,n.bottom);if(h)i.tooltipPosition.applyTooltipPosition(r,h);else if(c.config.tooltip.arrow)i.tooltipPosition.applyTooltipPosition(r,i.tooltipPosition.placeAroundBar(n,l,e,t));else{const t=i.xyRatios&&null!=i.xyRatios.baseLineInvertedY?l.left+i.xyRatios.baseLineInvertedY:(l.left+l.right)/2;let e=(n.left+n.right)/2<t?n.left-s:n.right;if(P.isFollowCursor(c)){const t=(n.left+n.right)/2-l.left+15;e=l.left+(t+s>c.layout.gridWidth?t-s:t)}const a=(n.top+n.bottom)/2-o/2;r.style.left=Math.max(Math.min(e,l.right-s),l.left)+"px",r.style.top=Math.max(Math.min(a,l.bottom-o),l.top)+"px",delete r.dataset.placement}}}else this._pointerHoversOneMark(i)?this._hoverFocusedMark(t,e,g,i):i.tooltipPosition.moveStickyTooltipOverBars(e,t)}_pointerHoversOneMark(t){if(!t.showOnIntersect)return!1;return!(this.w.config.chart.group&&"function"==typeof this.ctx.getSyncedCharts&&this.ctx.getSyncedCharts().length>1)}_hoverFocusedMark(t,e,i,s){const n=this.w,r=this._canvasMark(t,e),o=!r&&(null==i?void 0:i.node)&&["apexcharts-bar-area","apexcharts-candlestick-area","apexcharts-boxPlot-area","apexcharts-rangebar-area","apexcharts-violin-area"].some(t=>i.node.classList.contains(t))?i.node:null;if(!r&&!o)return void s.tooltipPosition.moveStickyTooltipOverBars(e,t);const c=n.dom.Paper.node;s.intersect.handleBarTooltip({e:l(a({},s.e),{type:"mousemove",target:o||c,apexHoverTarget:o||c,apexPaintedHit:r}),opt:{paths:o||c,hoverArea:c,elGrid:s.getElGrid(),tooltipEl:s.getElTooltip(),ttItems:s.ttItems}})}_focusedBarInWrap(t,e,i,s){var n,r,o;const a=this.w,l=("violin"===a.config.chart.type||"violin"===(null==(n=a.config.series[t])?void 0:n.type))&&(null==(r=s.intersect)?void 0:r.violinGlyphRect(t,e))||(null==(o=null==i?void 0:i.node)?void 0:o.getBoundingClientRect())||this._canvasMarkRect(t,e);if(!l)return null;const c=a.dom.elWrap.getBoundingClientRect();return{top:l.top-c.top,bottom:l.bottom-c.top,left:l.left-c.left,right:l.right-c.left}}_showTooltipAxisLine(t,e,i){var s;const n=this.w,r=n.config.chart.type,o=i.tConfig.shared&&i.tooltipUtil.isXoverlap(e)&&i.tooltipUtil.isInitialSeriesSameLen();i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:o});const a="scatter"===r||"bubble"===r||"radar"===r,l=n.globals.markers.largestSize>0&&!n.globals.markers.batched&&"canvas"!==(null==(s=this.ctx.renderer)?void 0:s.kind),c=this._pointerHoversOneMark(i)?this._canvasMarker(t,e):null;c?this._hoverPaintedMarker(c,i):a||l&&!o?this._showScatterBubblePoint(t,e,i)||i.tooltipPosition.moveDynamicPointOnHover(e,t):l?i.marker.enlargePoints(e):o?i.tooltipPosition.moveDynamicPointsOnHover(e):i.tooltipPosition.moveDynamicPointOnHover(e,t)}_canvasMarker(t,e){const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findMarker?i.findMarker(t,e):null}_hoverPaintedMarker(t,e){e.intersect.handlePaintedMarkerTooltip({e:l(a({},e.e),{type:"mousemove"}),opt:{tooltipEl:e.getElTooltip(),ttItems:e.ttItems},marker:{i:t.seriesIndex,j:t.dataPointIndex,cx:t.x,cy:t.y,size:t.size}})}_showScatterBubblePoint(t,e,i){const s=this.w.dom.baseEl;this._enlargedScatterMarker&&(i.marker.oldPointSize(this._enlargedScatterMarker),this._enlargedScatterMarker=null);const n=s.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`);if(!n)return!1;const r=n.querySelector(`.apexcharts-marker[rel='${e}']`);return!!r&&(i.marker.enlargeCurrentPoint(e,r),this._enlargedScatterMarker=r,!0)}_showTooltipNonAxis(t,e,i,s){i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t+e,shared:!1});const n=s.getBoundingClientRect(),r=n.width||i.tooltipRect.ttWidth||0,o=n.height||i.tooltipRect.ttHeight||0,a=i.getSliceAnchor(this._getFocusableElement(t,e));if(a){const t=i.tooltipPosition.placeOverAnchor(a.x,a.y,r,o,10);s.style.left=t.x+"px",s.style.top=t.y+"px"}}_showTooltipHeatTree(t,e,i,s,n){var r,o;const a=this.w;if(P.isFollowCursor(a)&&this._hoverFocusedCell(t,e,i))return;i.tooltipLabels.drawSeriesTexts({ttItems:i.ttItems,i:t,j:e,shared:!1});const l=s.getBoundingClientRect(),c=l.width||i.tooltipRect.ttWidth||0,h=l.height||i.tooltipRect.ttHeight||0,d="heatmap"===n?"apexcharts-heatmap-rect":"apexcharts-treemap-rect",u=a.dom.baseEl.querySelector(`.${d}[i='${t}'][j='${e}']`),g=u?null:this._canvasCell(t,e);if(u||g){const t=a.dom.elWrap.getBoundingClientRect();let e=0,l=0,d=0,p=0;if(u){const s=u.getBoundingClientRect();e=s.left-t.left,l=s.top-t.top,d=s.width,p=s.height;const n=parseFloat(null!=(r=u.getAttribute("cx"))?r:""),a=parseFloat(null!=(o=u.getAttribute("width"))?o:"");i.tooltipPosition.moveXCrosshairs(n+a/2)}else if(g){const t=P.plotInWrap(a);e=t.left+g.x,l=t.top+g.y,d=g.width,p=g.height,i.tooltipPosition.moveXCrosshairs(g.x+g.width/2)}let f=e+d+c/2;const m=l+p/2-h/2;e+d>a.layout.gridWidth/2&&(f=e-c/2);const x=i.tooltipPosition.shortPlotPlacement,y=i.tooltipPosition.placeOnShortPlot(e+d/2,l,l+p);if(y)return void i.tooltipPosition.applyTooltipPosition(s,y);if("heatmap"===n&&a.config.tooltip.arrow&&!P.isFollowCursor(a)){const{left:t,top:n}=P.plotInWrap(a);return void i.tooltipPosition.applyTooltipPosition(s,i.tooltipPosition.placeAroundCell({top:l,bottom:l+p,left:e,right:e+d},{top:n,bottom:n+a.layout.gridHeight,left:t,right:t+a.layout.gridWidth},{el:u,ttWidth:c,ttHeight:h}))}s.style.left=f+"px",s.style.top=m+"px",x&&delete s.dataset.placement}}_hoverFocusedCell(t,e,i){const s=this.w,n=s.config.chart.type,r=i.getElTooltip(),o=s.dom.baseEl.querySelector(`.apexcharts-${n}-rect[i='${t}'][j='${e}']`);if(!r||!o&&!this._canvasCell(t,e))return!1;const c=o||s.dom.Paper.node;s.interact.capturedSeriesIndex=-1,s.interact.capturedDataPointIndex=-1;const h=i.intersect.handleHeatTreeTooltip({e:l(a({},i.e),{type:"mousemove",target:c,apexHoverTarget:c}),opt:{ttItems:i.ttItems},x:0,y:0,type:n}),d=!h.noHit&&s.interact.capturedSeriesIndex===t&&s.interact.capturedDataPointIndex===e;return s.interact.capturedSeriesIndex=t,s.interact.capturedDataPointIndex=e,!!d&&(i.placeCellTooltip(r,h),!0)}_canvasCell(t,e){if("heatmap"!==this.w.config.chart.type)return null;const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findCell?i.findCell(t,e):null}_canvasMark(t,e){if(!this._isBarLikeSeries(t))return null;const i=this.ctx.renderer;return i&&"canvas"===i.kind&&"function"==typeof i.findMark?i.findMark(t,e):null}_canvasMarkRect(t,e){const i=this._canvasMark(t,e);if(!i)return null;const s=P.plotRect(this.w),n=s.left+i.x*s.zoom,r=s.top+i.y*s.zoom;return{left:n,top:r,right:n+i.width*s.zoom,bottom:r+i.height*s.zoom}}_applyFocusClass(t,e){this._removeFocusClass();const i=this._getFocusableElement(t,e)||this._getBatchedFocusEl(t)||this._drawCanvasFocusRing(t,e);if(i){i.classList.add("apexcharts-keyboard-focused"),i.setAttribute("role","img");const s=this._buildPointLabel(t,e);s&&i.setAttribute("aria-label",s),this._focusedEl=i}}_getBatchedFocusEl(t){return this.w.globals.markers.batched?this.w.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-series-markers path`):null}_drawCanvasFocusRing(t,e){const i=this._canvasCell(t,e);if(!i)return this._drawCanvasMarkFocusRing(t,e);const s=this.w.dom.baseEl.querySelector(`.apexcharts-heatmap .apexcharts-series[rel='${t+1}']`);if(!s)return null;const n=new v(this.w,this.ctx).drawRect(i.x,i.y,i.width,i.height,i.radius,"none");return n.node.classList.add("apexcharts-keyboard-focus-ring"),n.attr({i:t,j:e}),s.insertBefore(n.node,s.firstChild),n.node}_drawCanvasMarkFocusRing(t,e){const i=this._canvasMark(t,e);if(!i)return this._drawCanvasMarkerFocusRing(t,e);const s=this.w,n=this._seriesGroup(t);if(!n)return null;const r=new v(s,this.ctx).drawPath({d:i.d,fill:"none",classes:"apexcharts-keyboard-focus-ring"});return r.attr("clip-path",`url(#gridRectBarMask${s.globals.cuid})`),n.insertBefore(r.node,n.firstChild),r.node}_drawCanvasMarkerFocusRing(t,e){const i=this._canvasMarker(t,e);if(!i)return null;const s=this.w,n=this._seriesGroup(t);if(!n)return null;const r=new v(s,this.ctx).drawPath({d:i.d,fill:"none",classes:"apexcharts-keyboard-focus-ring"});return r.attr("clip-path",`url(#gridRectMarkerMask${s.globals.cuid})`),n.appendChild(r.node),r.node}_removeFocusClass(){this._focusedEl&&(this._focusedEl.classList.remove("apexcharts-keyboard-focused"),this._focusedEl.removeAttribute("role"),this._focusedEl.removeAttribute("aria-label"),this._focusedEl.classList.contains("apexcharts-keyboard-focus-ring")&&this._focusedEl.remove(),this._focusedEl=null)}_buildPointLabel(t,e){var i,s,n,r,o,a,l,c;const h=this.w,d=h.config.chart.type,u=h.seriesData.seriesNames||[],g=h.seriesData.series||[];if("pie"===d||"donut"===d||"polarArea"===d){const t=null!=(s=(null==(i=h.labelData)?void 0:i.labels)&&h.labelData.labels[e])?s:"",n=Array.isArray(g)?g[e]:"";return t?`${t}: ${n}`:`${n}`}if("radialBar"===d){return`${u[t]||`Series ${t+1}`}: ${Array.isArray(g)?g[t]:""}`}const p=u[t]||`Series ${t+1}`,f=(Array.isArray(g[t])?g[t]:[])[e];let m=null==f?"":String(f);const x=null==(r=null==(n=h.formatters)?void 0:n.yLabelFormatters)?void 0:r[t];if("function"==typeof x)try{m=x(f,{seriesIndex:t,dataPointIndex:e,w:h})}catch(t){}let y="";const b=null==(o=h.labelData)?void 0:o.categoryLabels,v=null==(l=null==(a=h.seriesData)?void 0:a.seriesX)?void 0:l[t];if(Array.isArray(b)&&null!=b[e])y=String(b[e]);else if(Array.isArray(v)&&null!=v[e]){const i=null==(c=h.formatters)?void 0:c.xLabelFormatter;if("function"==typeof i)try{y=String(i(v[e],{seriesIndex:t,dataPointIndex:e,w:h}))}catch(t){y=String(v[e])}else y=String(v[e])}return y?`${p}: ${m}, ${y}`:`${p}: ${m}`}_leaveHoveredBar(){if(this._hoveredBarEl){new v(this.w,this.ctx).pathMouseLeave(this._hoveredBarEl,null),this._hoveredBarEl=null}}_getFocusableElement(t,e){var i,s;const n=this.w,r=n.config.chart.type,o=n.dom.baseEl;return"pie"===r||"donut"===r||"polarArea"===r?o.querySelector(`.apexcharts-pie-area[j='${e}']`):"heatmap"===r?o.querySelector(`.apexcharts-heatmap-rect[i='${t}'][j='${e}']`):"treemap"===r?o.querySelector(`.apexcharts-treemap-rect[i='${t}'][j='${e}']`):"radialBar"===r?o.querySelector(`.apexcharts-radialbar-slice-${t}`):this._isBarLikeSeries(t)?this._canvasMark(t,e)?null:null==(i=this._seriesGroup(t))?void 0:i.querySelector(`path[j='${e}']`):null==(s=this._seriesGroup(t))?void 0:s.querySelector(`.apexcharts-marker[rel='${e}']`)}_seriesGroup(t){return Array.from(this.w.dom.baseEl.querySelectorAll(".apexcharts-series")).find(e=>e.getAttribute("data:realIndex")===String(t))}_fireClick(t){var e,i;const s=null==(e=this._focusedEl)?void 0:e.instance,n=this.ctx.pie;s&&new v(this.w,this.ctx).pathMouseDown(s,t),n&&n.getExpandOffset()>0&&n.pieClicked(this.dataPointIndex),null==(i=this.w.globals.tooltip)||i.markerClick(t,this.seriesIndex,this.dataPointIndex)}_isNavEnabled(){const t=this.w.config.chart.accessibility;return t.enabled&&t.keyboard.enabled&&t.keyboard.navigation.enabled}_getSeriesCount(){const t=this.w,e=t.config.chart.type;return"pie"===e||"donut"===e||"polarArea"===e?1:t.seriesData.series.length}_getDataPointCount(t){const e=this.w,i=e.config.chart.type;if("pie"===i||"donut"===i||"polarArea"===i)return e.seriesData.series.length;const s=e.seriesData.series[t];return Array.isArray(s)?s.length:1}_clampCursor(){const t=this._getSeriesCount();this.seriesIndex>=t&&(this.seriesIndex=t-1),this.seriesIndex<0&&(this.seriesIndex=0);const e=this._getDataPointCount(this.seriesIndex);this.dataPointIndex>=e&&(this.dataPointIndex=e-1),this.dataPointIndex<0&&(this.dataPointIndex=0)}_snapToVisibleRange(){const t=this.w,e=t.globals,i=this.seriesIndex;if(!t.interact.zoomed)return;const s=t.seriesData.seriesX&&t.seriesData.seriesX[i];if(!s||!s.length)return;const n=e.minX,r=e.maxX;if(void 0===n||void 0===r)return;const o=s[this.dataPointIndex];if(o>=n&&o<=r)return;const a=s.length;for(let t=0;t<a;t++)if(s[t]>=n&&s[t]<=r)return void(this.dataPointIndex=t)}_snapToVisibleRangeInDirection(t){const e=this.w,i=e.globals,s=this.seriesIndex,n=e.seriesData.seriesX&&e.seriesData.seriesX[s];if(!n||!n.length)return;const r=i.minX,o=i.maxX;if(void 0===r||void 0===o)return;const a=n.length;if(t>=0){for(let t=0;t<a;t++)if(n[t]>=r&&n[t]<=o)return void(this.dataPointIndex=t)}else for(let t=a-1;t>=0;t--)if(n[t]>=r&&n[t]<=o)return void(this.dataPointIndex=t)}_isDataPointVisible(t,e){const i=this.w,s=i.globals;if(!i.interact.zoomed)return!0;const n=i.seriesData.seriesX&&i.seriesData.seriesX[t];if(!n)return!0;const r=n[e];return void 0===r||r>=s.minX&&r<=s.maxX}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const i=e.dom.baseEl;if(!i)return;const s=i.querySelector(".apexcharts-sr-status");s&&(s.textContent="",clearTimeout(this._announceTimer),this._announceTimer=setTimeout(()=>{s.textContent=t},0))}}});const Y=h.__apex_PathMorphing_parsePath;function j(t,e){if(!(e>0))return[];if(1===e)return[a({},t)];const i=t.width>=t.height,s=i?t.width:t.height,n=i?t.height:t.width,r=n>0?s/n:e;let o=Math.max(1,Math.ceil(Math.sqrt(r*e)));o>e&&(o=e);const l=Math.floor(e/o);let c=e-l*o;const h=[],d=s/o;let u=0;for(let e=0;e<o;e++){const e=l+(c>0?1:0);c>0&&c--;const s=e>0?n/e:0;for(let n=0;n<e;n++)h.push(i?{x:t.x+u,y:t.y+n*s,width:d,height:s}:{x:t.x+n*s,y:t.y+u,width:s,height:d});u+=d}return h}function q(t,e,i){if(!(e>0))return[];const s=t.width>=t.height,n=s?t.width:t.height,r=s?t.height:t.width,o=s?t.y:t.x,a=o+r,l=r>0?n/r:e;let c=Math.max(Math.ceil(Math.sqrt(l*e)),Math.ceil(n/16));c>=1||(c=1),c>e&&(c=e);const h=Math.floor(e/c);let d=e-h*c;const u=[],g=n/c;let p=s?t.x:t.y;for(let t=0;t<c;t++){const t=h+(d>0?1:0);d>0&&d--;const e=[],n=i(p,p+g,s);if(Array.isArray(n))for(let t=0;t<n.length;t++){const i=n[t];if(!i)continue;const s=Math.max(o,Math.min(i[0],i[1])),r=Math.min(a,Math.max(i[0],i[1]));r>s&&e.push([s,r])}e.length||e.push([o,a]);const r=e.reduce((t,e)=>t+(e[1]-e[0]),0),l=e.map(i=>r>0?(i[1]-i[0])/r*t:t/e.length),c=l.map(t=>Math.floor(t));let f=c.reduce((t,e)=>t+e,0);const m=l.map((t,e)=>({i:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac);for(let e=0;f<t;e++,f++)c[m[e%m.length].i]++;for(let t=0;t<e.length;t++){const i=c[t];if(i<=0)continue;const n=e[t][0],r=(e[t][1]-n)/i;for(let t=0;t<i;t++)u.push(s?{x:p,y:n+t*r,width:g,height:r}:{x:n+t*r,y:p,width:r,height:g})}p+=g}return u}function Z(t,e,i,s,n,r){let o=n===i?0:Math.round((t-i)/(n-i)*32767),a=r===s?0:Math.round((e-s)/(r-s)*32767),l=0;for(let t=32768;t>=1;t/=2){const e=(o&t)>0?1:0,i=(a&t)>0?1:0;if(l+=t*t*(3*e^i),0===i){1===e&&(o=t-1-o,a=t-1-a);const i=o;o=a,a=i}}return l}function V(t,e){let i=1/0,s=1/0,n=-1/0,r=-1/0;const o=t.map(t=>{const[o,a]=e(t);return o<i&&(i=o),o>n&&(n=o),a<s&&(s=a),a>r&&(r=a),[o,a]});return t.map((t,e)=>({item:t,d:Z(o[e][0],o[e][1],i,s,n,r)})).sort((t,e)=>t.d-e.d).map(t=>t.item)}function U(t){if(!t||"string"!=typeof t)return null;const e=t.trim();if("#"===e[0]){const t=e.slice(1);return 3===t.length?[parseInt(t[0]+t[0],16),parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),1]:6===t.length||8===t.length?[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),8===t.length?parseInt(t.slice(6,8),16)/255:1]:null}const i=e.match(/^rgba?\(([^)]+)\)$/i);if(i){const t=i[1].split(",").map(t=>parseFloat(t));return t.length<3||t.some(t=>!isFinite(t))?null:[t[0],t[1],t[2],t.length>3?t[3]:1]}return null}function G(t,e){const i=U(t),s=U(e);return i&&s?t=>{const e=Math.round(i[0]+(s[0]-i[0])*t),n=Math.round(i[1]+(s[1]-i[1])*t),r=Math.round(i[2]+(s[2]-i[2])*t),o=i[3]+(s[3]-i[3])*t;return o>=1?`rgb(${e},${n},${r})`:`rgba(${e},${n},${r},${o})`}:null}function K(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}const J=new Set(["bar","funnel","pyramid","histogram"]),Q=new Set(["pie","donut","polarArea","radialBar","gauge"]),tt=new Set(["unit","waffle"]),et=new Set(["treemap","sunburst"]),it=new Set(["boxPlot","violin"]);let st=0;const nt=1500,rt=t=>{t.removeAttribute("opacity"),t.removeAttribute("data-piece-hidden")};function ot(t){return J.has(t)?"bar":Q.has(t)?"radial":tt.has(t)?"unit":et.has(t)?"partition":it.has(t)?"summary":null}h.default.registerFeatures({morphTypeChange:class{constructor(t,e){this.w=t,this.ctx=e,this._snapshot=null,this._shown=!1,this._ghost=null,this._pieceLayer=null,this._pieceCancel=null,this._ghostTimer=void 0}canMorphTypes(t,e){if(t===e)return!1;const i=ot(t),s=ot(e);return!(!i||!s)&&("partition"===i==("partition"===s)||"unit"!==i&&"unit"!==s)}isCompatibleSeriesShape(t,e,i){if(!Array.isArray(i)||0===i.length)return!1;const s=ot(t),n=ot(e);return"unit"===n?!!i.every(t=>"number"==typeof t)||i.every(t=>t&&"object"==typeof t&&Array.isArray(t.data)):"partition"===n||("radial"===n?!!i.every(t=>"number"==typeof t)||1===i.length&&i[0]&&"object"==typeof i[0]&&Array.isArray(i[0].data):"bar"===n||"summary"===n?i.every(t=>t&&"object"==typeof t&&Array.isArray(t.data)):null!==s&&null!==n)}captureBeforeDestroy({fromType:t,toType:e,newSeries:i}){var s;if(this._snapshot=null,this._shown=!1,this._removeGhost(),this._cancelPieces(),!p.isBrowser())return!1;const n=this.w.config.chart.animations;if(!n||!1===n.enabled)return!1;if(n.chartTypeMorph&&!1===n.chartTypeMorph.enabled)return!1;if(n.respectReducedMotion&&$())return!1;if(!this.canMorphTypes(t,e))return!1;if(!this.isCompatibleSeriesShape(t,e,i))return!1;const{marks:r,branches:o,unitDots:a}=this._captureFromDOM(t);if(!r.length)return!1;const l=this._buildMapping(r,t,e,i,o);if(0===l.size)return!1;const c=this.w.globals,h=null==(s=this.w.dom.elGraphical)?void 0:s.node,d=c.layoutTween&&!c.layoutTween.done&&c.layoutTween.graphical===h?c.layoutTween.rect:null,u=c.circleTween,g=u&&!u.done&&(null==h?void 0:h.contains(u.node))?u:null,f=g?g.circle.r/g.target.r:1;this._snapshot={fromType:t,toType:e,mapping:l,oldLayout:{translateX:d?d.x:this.w.layout.translateX||0,translateY:d?d.y:this.w.layout.translateY||0,scale:f,shiftX:g?g.circle.cx-f*g.target.cx:0,shiftY:g?g.circle.cy-f*g.target.cy:0}};const m=ot(t),x=ot(e),y=this._canProbePaths();if("unit"===x&&("bar"===m||"summary"===m||"radial"===m&&y)){const t=this._countUnitSeries(i);this._snapshot.pieceOut=t>0&&t<=nt}else if("unit"===m&&("bar"===x||"summary"===x||"radial"===x&&y&&!/^(radialBar|gauge)$/.test(e))){let t=0;a.forEach(e=>{t+=e.length}),t>0&&t<=nt&&(this._snapshot.pieceIn=!0,this._snapshot.sourceDots=a,this._snapshot.keyOrder=this._targetKeys(x,i))}return!this._needsGhost(t,e)||this._snapshot.pieceOut||this._snapshot.pieceIn||this._captureGhost(),this.w.globals.previousPaths=[],!0}_needsGhost(t,e){return"unit"===ot(t)||"unit"===ot(e)}_captureGhost(){var t,e;const i=null==(t=this.w.dom)?void 0:t.Paper,s=i&&i.node;if(!s||"function"!=typeof s.cloneNode)return;const n=s.cloneNode(!0),r=[".apexcharts-xaxis",".apexcharts-yaxis",".apexcharts-grid",".apexcharts-legend",".apexcharts-title-text",".apexcharts-subtitle-text",".apexcharts-annotations",".apexcharts-zoom-rect",".apexcharts-selection-rect",".apexcharts-xcrosshairs",".apexcharts-ycrosshairs"];if("function"==typeof n.querySelectorAll&&r.forEach(t=>{n.querySelectorAll(t).forEach(t=>{t.remove()})}),"function"==typeof n.querySelectorAll){const t="-ghost"+ ++st,e=new Set;n.querySelectorAll("[id]").forEach(i=>{e.add(i.id),i.id+=t}),n.querySelectorAll("*").forEach(i=>{for(const s of i.attributes){const i=s.value.replace(/(url\(['"]?#|^#)([^'")\s]+)/g,(i,s,n)=>e.has(n)?s+n+t:i);i!==s.value&&(s.value=i)}})}null==(e=n.removeAttribute)||e.call(n,"id"),this._ghost=n}_mountGhost(){var t,e,i;const s=this._ghost;if(!s||!p.isBrowser())return;const n=null==(t=this.w.dom)?void 0:t.elWrap;if(!n||"function"!=typeof n.appendChild)return void(this._ghost=null);const r=s.style;r&&(r.position="absolute",r.left="0",r.top="0",r.background="transparent",r.pointerEvents="none",r.opacity="1"),null==(e=s.setAttribute)||e.call(s,"aria-hidden","true"),null==(i=s.setAttribute)||i.call(s,"class","apexcharts-morph-ghost"),n.appendChild(s);const o=this.getSpeed(),a=Math.max(120,Math.round(.55*o));f.requestAnimationFrame(()=>{r&&(r.transition=`opacity ${a}ms ease-in`,r.opacity="0")}),this._ghostTimer=setTimeout(()=>this._removeGhost(),a+60)}_removeGhost(){clearTimeout(this._ghostTimer);const t=this._ghost;this._ghost=null,null==t||t.remove()}_countUnitSeries(t){if(!Array.isArray(t))return 0;let e=0;for(const i of t){if(!i||"object"!=typeof i||!Array.isArray(i.data))return 0;e+=i.data.length}return e}usesPieceTakeover(){return!(!this._snapshot||!this._snapshot.pieceOut)}claimsTargetMark(t,e){return!!(this._snapshot&&this._snapshot.pieceIn&&this._snapshot.mapping.has(`${t}:${e}`))}_makePieceLayer(){var t,e;const i=null==(t=this.w.dom)?void 0:t.elGraphical,s=i&&i.node;if(!s||"function"!=typeof s.appendChild)return null;const n=f.createElementNS("http://www.w3.org/2000/svg","g");if(!n)return null;n.setAttribute("class","apexcharts-morph-pieces"),n.setAttribute("pointer-events","none");const r=null==(e=this.w.globals)?void 0:e.cuid;return r&&n.setAttribute("clip-path",`url(#gridRectBarMask${r})`),s.appendChild(n),this._pieceLayer=n,n}_revealPieceHidden(){var t;const e=null==(t=this.w.globals.dom)?void 0:t.baseEl;e&&"function"==typeof e.querySelectorAll&&e.querySelectorAll("[data-piece-hidden]").forEach(rt)}_cancelPieces(){this._pieceCancel&&(this._pieceCancel(),this._pieceCancel=null);const t=this._pieceLayer;this._pieceLayer=null,null==t||t.remove(),this._revealPieceHidden()}_canProbePaths(){if(!p.isBrowser())return!1;const t=f.createElementNS("http://www.w3.org/2000/svg","path");return!!t&&"function"==typeof t.isPointInFill}_makeExtentProber(t,e,i){const s=i.ownerDocument.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("d",t),s.setAttribute("fill","#000"),s.setAttribute("stroke","#000"),s.setAttribute("stroke-width","3"),s.setAttribute("visibility","hidden"),i.appendChild(s);const n=s.ownerSVGElement;if("function"!=typeof s.isPointInFill||!n||"function"!=typeof n.createSVGPoint)return s.remove(),null;const r=n.createSVGPoint(),o=(t,e)=>{r.x=t,r.y=e;const i=s;return i.isPointInFill(r)||i.isPointInStroke(r)},a=48;return{intervalsAt:(t,i,s)=>{const n=s?e.y:e.x,r=n+(s?e.height:e.width);if(!(r>n))return null;const l=(t,e)=>s?o(e,t):o(t,e),c=[t+.1*(i-t),(t+i)/2,i-.1*(i-t)],h=(t,e,i)=>{let s=e,n=t;for(let t=0;t<6;t++){const t=(s+n)/2;l(t,i)?n=t:s=t}return(s+n)/2},d=(r-n)/a,u=new Array(49).fill(null);let g=!1;for(const t of c)for(let e=0;e<=a;e++)null===u[e]&&l(n+e*d,t)&&(u[e]=t,g=!0);if(!g)return null;const p=[];let f=-1;for(let t=0;t<=49;t++){const e=t<=a&&null!==u[t];if(e&&f<0&&(f=t),!e&&f>=0){const e=t-1,i=u[f],s=0===f?n:h(n+f*d,n+(f-1)*d,i),o=e===a?r:h(n+e*d,n+(e+1)*d,u[e]);o>s&&p.push([s,o]),f=-1}}return p.length?p:null},dispose:()=>{s.remove()}}}_separatePieces(){var t;const e=this._snapshot,i=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!e||!i)return this._revealPieceHidden();const s=this._readUnitDots(i,new Map);let n=0;if(s.forEach(t=>{n+=t.length}),0===n||n>nt)return this._revealPieceHidden();const r=this._makePieceLayer();if(!r)return this._revealPieceHidden();const o=[],a=r.ownerDocument,l=a.createDocumentFragment(),c=ot(e.fromType),h="summary"===c||"radial"===c;if(Array.from(s.keys()).sort((t,e)=>t-e).forEach(t=>{var i;const n=s.get(t),c=this.getInitialBBoxFor(t),d=e.mapping.get(`${t}:0`);if(!c||!d)return void n.forEach(t=>rt(t.el));const u=d.fill&&0!==d.fill.indexOf("url(")?d.fill:(null==(i=this.w.globals.colors)?void 0:i[t])||n[0].fill;let g=null;if(h){const e=this.getInitialPathFor(t,0);e&&(g=this._makeExtentProber(e,c,r))}const p=g?q(c,n.length,g.intervalsAt):j(c,n.length);g&&g.dispose();const f=V(p,t=>[t.x+t.width/2,t.y+t.height/2]),m=V(n,t=>[t.x,t.y]);for(let e=0;e<m.length;e++){const i=f[e],s=m[e],n=a.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttribute("data-i",String(t)),n.setAttribute("data-key",s.el.getAttribute("data-key")),n.setAttribute("x",String(i.x)),n.setAttribute("y",String(i.y)),n.setAttribute("width",String(i.width)),n.setAttribute("height",String(i.height)),n.setAttribute("rx","0"),n.setAttribute("fill",String(u)),l.appendChild(n),o.push({el:n,from:{x:i.x,y:i.y,width:i.width,height:i.height,rx:0},to:{x:s.x-s.r,y:s.y-s.r,width:2*s.r,height:2*s.r,rx:s.r},fill:G(u,s.fill),fillEnd:s.fill,delay:0,meta:{dotEl:s.el}})}}),r.appendChild(l),!o.length)return this._cancelPieces();this._runPieces(o,t=>{rt(t.meta.dotEl),t.el.remove()})}_readUnitDots(t,e){return t.querySelectorAll(".apexcharts-unit-area").forEach(t=>{var i;const s=parseInt(null!=(i=t.getAttribute("i"))?i:"",10);if(isNaN(s))return;const n=e=>parseFloat(t.getAttribute(e)),r=t.getAttribute("cx"),o=n("width")||0,a=n("height")||0,l=null!=r?parseFloat(r):n("x")+o/2,c=null!=r?n("cy"):n("y")+a/2,h=(null!=r?n("r"):Math.max(o,a)/2)||3;if(!isFinite(l)||!isFinite(c))return;let d=e.get(s);d||e.set(s,d=[]),d.push({el:t,x:l,y:c,r:h,fill:t.getAttribute("fill")})}),e}_combinePieces(){var t,e;const i=this._snapshot,s=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!(i&&i.sourceDots&&i.keyOrder&&s))return this._revealPieceHidden();const n=this._collectTargetMarks(i.toType);if(!n.size)return this._revealPieceHidden();const{dx:r,dy:o}=this._oldToNew(),a=Array.from(i.sourceDots.keys()).sort((t,e)=>t-e),l=this._makePieceLayer();if(!l)return this._revealPieceHidden();const c=l.ownerDocument,h=c.createDocumentFragment(),d=[],u=ot(i.toType),g="summary"===u||"radial"===u;for(let t=0;t<a.length;t++){const s=i.sourceDots.get(a[t]),u=i.keyOrder[a[t]],p=u?n.get(u):null,f=p&&this._markD(p),m=f&&this._pathBBox(f);if(!m||!s||!s.length){p&&p.els.forEach(rt);continue}const x={x:m.minX,y:m.minY,width:m.maxX-m.minX,height:m.maxY-m.minY},y=p.fill&&0!==p.fill.indexOf("url(")?p.fill:(null==(e=this.w.globals.colors)?void 0:e[p.realIndex])||s[0].fill,b=g?this._makeExtentProber(f,x,l):null,v=b?q(x,s.length,b.intervalsAt):j(x,s.length);b&&b.dispose();const w=V(v,t=>[t.x+t.width/2,t.y+t.height/2]),_=V(s,t=>[t.x,t.y]),A={remaining:_.length,els:p.els,g:h.appendChild(c.createElementNS("http://www.w3.org/2000/svg","g"))};for(let t=0;t<_.length;t++){const e=_[t],i=w[t],s=c.createElementNS("http://www.w3.org/2000/svg","rect"),n=e.x+r-e.r,a=e.y+o-e.r;s.setAttribute("data-key",u),s.setAttribute("x",String(n)),s.setAttribute("y",String(a)),s.setAttribute("width",String(2*e.r)),s.setAttribute("height",String(2*e.r)),s.setAttribute("rx",String(e.r)),s.setAttribute("fill",String(e.fill||y)),A.g.appendChild(s),d.push({el:s,from:{x:n,y:a,width:2*e.r,height:2*e.r,rx:e.r},to:{x:i.x,y:i.y,width:i.width,height:i.height,rx:0},fill:G(e.fill,y),fillEnd:String(y),delay:0,meta:{markState:A}})}}if(l.appendChild(h),!d.length)return this._cancelPieces();this._runPieces(d,t=>{const e=t.meta.markState;e.remaining--,0===e.remaining&&(e.els.forEach(rt),e.g.remove())})}_markD(t){return t.d||t.els.map(t=>t.getAttribute("pathTo")||t.getAttribute("d")).filter(Boolean).join(" ")}_runPieces(t,e){const i=this.getSpeed(),s=Math.min(300,.35*i),n=Math.max(180,i-s);for(let e=0;e<t.length;e++)t[e].delay=t.length>1?e/(t.length-1)*s:0;this._pieceCancel=function({pieces:t,duration:e,onPieceDone:i,onAllDone:s,alive:n}){let r=!1;const o=Date.now(),a=Math.max(1,e),l=(t,e)=>{const i=t.from,s=t.to,n=t.el;n.setAttribute("x",String(i.x+(s.x-i.x)*e)),n.setAttribute("y",String(i.y+(s.y-i.y)*e)),n.setAttribute("width",String(Math.max(0,i.width+(s.width-i.width)*e))),n.setAttribute("height",String(Math.max(0,i.height+(s.height-i.height)*e))),n.setAttribute("rx",String(Math.max(0,i.rx+(s.rx-i.rx)*e))),t.fill?n.setAttribute("fill",t.fill(e)):e>=1&&t.fillEnd&&n.setAttribute("fill",t.fillEnd)},c=()=>{if(r||n&&!n())return;const e=Date.now()-o;let h=!1;for(let s=0;s<t.length;s++){const n=t[s];if(n._done)continue;const r=(e-n.delay)/a;if(r<1&&(h=!0),r<=0)continue;const o=Math.min(1,r);l(n,K(o)),o>=1&&(n._done=!0,i&&i(n))}h?f.requestAnimationFrame(c):s&&s()};return f.requestAnimationFrame(c),()=>{r=!0}}({pieces:t,duration:n,onPieceDone:e,alive:()=>!this.w.globals.isDestroyed,onAllDone:()=>{this._pieceCancel=null,this._cancelPieces()}})}_collectTargetMarks(t){var e;const i=null==(e=this.w.globals.dom)?void 0:e.baseEl,s=new Map;if(!i)return s;const n=ot(t);if("radial"===n)return i.querySelectorAll(".apexcharts-pie-series .apexcharts-pie-area").forEach((t,e)=>{const i=t.getAttribute("data:pathFinal")||t.getAttribute("d");i&&i.trim()&&s.set(`${e}:0`,{realIndex:e,d:i,fill:t.getAttribute("fill"),els:[t]})}),s;const r="summary"===n?`.apexcharts-${t}-series`:".apexcharts-bar-series";return i.querySelectorAll(`${r} .apexcharts-series`).forEach(t=>{var e;const i=parseInt(null!=(e=t.getAttribute("data:realIndex"))?e:"0",10)||0;let n=0;t.querySelectorAll("path[pathTo]:not(.apexcharts-highlight-part)").forEach(t=>{var e;const r=t.getAttribute("pathTo")||t.getAttribute("d");if(!r||!r.trim())return;const o=parseInt(null!=(e=t.getAttribute("j"))?e:"",10),a=isNaN(o)?n++:o,l=`${i}:${a}`,c=s.get(l);c?c.els.push(t):s.set(l,{realIndex:i,fill:t.getAttribute("fill"),els:[t]})})}),s}_captureFromDOM(t){var e;const i=null==(e=this.w.globals.dom)?void 0:e.baseEl;if(!i)return{marks:[],branches:[],unitDots:new Map};const s=[],n=[],r=new Map,o=ot(t);if("bar"===o){i.querySelectorAll(".apexcharts-bar-series .apexcharts-series").forEach(t=>{var e;const i=parseInt(null!=(e=t.getAttribute("data:realIndex"))?e:"0",10);t.querySelectorAll("path[pathTo]:not(.apexcharts-highlight-part)").forEach((t,e)=>{const n=t.getAttribute("d")||t.getAttribute("pathTo");n&&s.push({realIndex:i,j:e,d:n,fill:t.getAttribute("fill")})})})}else if("summary"===o){const e=new Map;i.querySelectorAll(`.apexcharts-${t}-area`).forEach(t=>{var i,s;const n=parseInt(null!=(i=t.getAttribute("j"))?i:"",10);if(isNaN(n))return;const r=t.getAttribute("d")||t.getAttribute("pathTo");if(!r||!r.trim())return;const o="function"==typeof t.closest?t.closest(".apexcharts-series"):null,a=parseInt(null!=(s=null==o?void 0:o.getAttribute("data:realIndex"))?s:"0",10)||0,l=`${a}:${n}`,c=e.get(l);c?c.d+=` ${r}`:e.set(l,{realIndex:a,j:n,d:r,fill:t.getAttribute("fill")})}),Array.from(e.values()).sort((t,e)=>t.realIndex-e.realIndex||t.j-e.j).forEach(t=>s.push(t))}else if("partition"===o)if("treemap"===t){const t=t=>{var e,i,s,n;const r=parseFloat(null!=(e=t.getAttribute("x"))?e:""),o=parseFloat(null!=(i=t.getAttribute("y"))?i:""),a=parseFloat(null!=(s=t.getAttribute("width"))?s:""),l=parseFloat(null!=(n=t.getAttribute("height"))?n:"");return[r,o,a,l].every(t=>isFinite(t))?`M ${r} ${o} L ${r+a} ${o} L ${r+a} ${o+l} L ${r} ${o+l} Z`:null};i.querySelectorAll(".apexcharts-treemap-rect").forEach(e=>{var i,n;const r=t(e);r&&s.push({realIndex:parseInt(null!=(i=e.getAttribute("i"))?i:"0",10)||0,j:parseInt(null!=(n=e.getAttribute("j"))?n:"0",10)||0,d:r,fill:e.getAttribute("fill"),key:e.getAttribute("data:key")||null})});i.querySelectorAll(".apexcharts-treemap-parent-rect").forEach(e=>{const i=t(e),s=e.getAttribute("data:key");i&&s&&n.push({key:s,d:i,fill:e.getAttribute("fill")})})}else{const t=i.querySelectorAll(".apexcharts-sunburst-arc"),e=[];t.forEach(t=>{"true"===t.getAttribute("data:leaf")&&e.push(t)});(e.length?e:Array.from(t)).forEach((t,e)=>{const i=t.getAttribute("d");i&&i.trim()&&s.push({realIndex:e,j:0,d:i,fill:t.getAttribute("fill"),key:t.getAttribute("data:key")||null})}),t.forEach(t=>{if("true"===t.getAttribute("data:leaf"))return;const e=t.getAttribute("d"),i=t.getAttribute("data:key");e&&e.trim()&&i&&n.push({key:i,d:e,fill:t.getAttribute("fill")})})}else if("unit"===o)this._readUnitDots(i,r),Array.from(r.keys()).sort((t,e)=>t-e).forEach(t=>{const e=r.get(t),i=e.map(t=>t.x),n=e.map(t=>t.y),o=Math.min(...i)-2,a=Math.min(...n)-2,l=Math.max(...i)+2,c=Math.max(...n)+2;s.push({realIndex:t,j:0,d:`M ${o} ${a} L ${l} ${a} L ${l} ${c} L ${o} ${c} Z`,fill:e[0].fill})});else if("radial"===o)if("radialBar"===t||"gauge"===t){const t=this.w.globals.circleGeometry,e=t?t.cx:this.w.layout.gridWidth/2,n=t?t.cy:this.w.layout.gridHeight/2;i.querySelectorAll(".apexcharts-radial-series .apexcharts-radialbar-area").forEach(t=>{var i;const r=t.parentElement,o=parseInt(null!=(i=null==r?void 0:r.getAttribute("data:realIndex"))?i:"0",10),a=t.getAttribute("d");if(!a)return;const l=parseFloat(t.getAttribute("stroke-width")||"0"),c=l>1&&this._radialArcToFilledSegment(a,l,e,n)||a;s.push({realIndex:o,j:0,d:c,fill:t.getAttribute("stroke")})})}else{i.querySelectorAll(".apexcharts-pie-series .apexcharts-pie-area").forEach((t,e)=>{const i=t.getAttribute("d");i&&s.push({realIndex:e,j:0,d:i,fill:t.getAttribute("fill")})})}return{marks:s,branches:n,unitDots:r}}_radialArcToFilledSegment(t,e,i,s){const n=t.match(/M\s*(-?[\d.]+)\s+(-?[\d.]+)\s+A\s*(-?[\d.]+)\s+(?:-?[\d.]+)\s+(?:-?[\d.]+)\s+(\d)\s+(\d)\s+(-?[\d.]+)\s+(-?[\d.]+)/);if(!n)return null;const r=parseFloat(n[1]),o=parseFloat(n[2]),a=parseFloat(n[3]),l=parseInt(n[4],10),c=parseInt(n[5],10),h=parseFloat(n[6]),d=parseFloat(n[7]);if(!isFinite(a)||a<=0)return null;const u=e/2,g=a+u,p=Math.max(0,a-u),f=(t,e,n)=>{const r=t-i,o=e-s,a=Math.sqrt(r*r+o*o);if(0===a)return{x:i,y:s};const l=n/a;return{x:i+r*l,y:s+o*l}},m=f(r,o,g),x=f(h,d,g),y=f(r,o,p),b=f(h,d,p),v=c?0:1;return`M ${m.x} ${m.y} A ${g} ${g} 0 ${l} ${c} ${x.x} ${x.y} L ${b.x} ${b.y} A ${p} ${p} 0 ${l} ${v} ${y.x} ${y.y} Z`}buildRingSegmentPath(t,e,i,s,n,r){const o=s/2,a=i+o,l=Math.max(0,i-o),c=(n-90)*Math.PI/180,h=(r-90)*Math.PI/180,d=t+a*Math.cos(c),u=e+a*Math.sin(c),g=t+a*Math.cos(h),p=e+a*Math.sin(h),f=t+l*Math.cos(c),m=e+l*Math.sin(c),x=t+l*Math.cos(h),y=e+l*Math.sin(h),b=r>n?1:0,v=Math.abs(r-n)>180?1:0;return`M ${d} ${u} A ${a} ${a} 0 ${v} ${b} ${g} ${p} L ${x} ${y} A ${l} ${l} 0 ${v} ${1-b} ${f} ${m} Z`}getFromType(){return this._snapshot?this._snapshot.fromType:null}_buildMapping(t,e,i,s,n){const r=new Map,o=ot(i),a=t.slice().sort((t,e)=>t.realIndex-e.realIndex||t.j-e.j);if("partition"===o&&n&&n.length){const t=a.filter(t=>t.key);t.length===a.length&&(t.forEach(t=>{r.set(`key:${t.key}`,{d:t.d,fill:t.fill})}),n.forEach(t=>{r.set(`key:${t.key}`,{d:t.d,fill:t.fill})}))}const l="unit"===ot(e);if("radial"===o||"unit"===o||"partition"===o)return a.forEach((t,e)=>{r.set(`${l?t.realIndex:e}:0`,{d:t.d,fill:t.fill})}),r;if("bar"===o||"summary"===o){const t=this._targetKeys(o,s);a.forEach((e,i)=>{const s=t[l?e.realIndex:i];s&&r.set(s,{d:e.d,fill:e.fill})})}return r}_targetKeys(t,e){var i;const s=[],n=Array.isArray(e)?e:[];if("radial"===t){const t=1===n.length&&Array.isArray(null==(i=n[0])?void 0:i.data)?n[0].data.length:n.length;for(let e=0;e<t;e++)s.push(`${e}:0`)}else n.forEach((t,e)=>{const i=t&&Array.isArray(t.data)?t.data:[];for(let t=0;t<i.length;t++)s.push(`${e}:${t}`)});return s}isActive(){return null!==this._snapshot}getInitialPathFor(t,e){if(!this._snapshot)return null;const i=this._snapshot.mapping.get(`${t}:${e}`);if(!i)return null;const{k:s,dx:n,dy:r}=this._oldToNew();return 1===s&&0===n&&0===r?i.d:this._translatePathD(i.d,n,r,s)}_oldToNew(){var t,e,i;const s=this._snapshot.oldLayout;return{k:null!=(t=s.scale)?t:1,dx:s.translateX+(null!=(e=s.shiftX)?e:0)-(this.w.layout.translateX||0),dy:s.translateY+(null!=(i=s.shiftY)?i:0)-(this.w.layout.translateY||0)}}_translatePathD(t,e,i,s=1){if(0===e&&0===i&&1===s)return t;const n=Y(t),r=t=>t*s+e,o=t=>t*s+i;return n.map(t=>{const e=t[0];return"Z"===e?"Z":"M"===e||"L"===e||"T"===e?`${e} ${r(t[1])} ${o(t[2])}`:"H"===e?`${e} ${r(t[1])}`:"V"===e?`${e} ${o(t[1])}`:"C"===e?`${e} ${r(t[1])} ${o(t[2])} ${r(t[3])} ${o(t[4])} ${r(t[5])} ${o(t[6])}`:"S"===e||"Q"===e?`${e} ${r(t[1])} ${o(t[2])} ${r(t[3])} ${o(t[4])}`:"A"===e?`${e} ${t[1]*s} ${t[2]*s} ${t[3]} ${t[4]} ${t[5]} ${r(t[6])} ${o(t[7])}`:t.join(" ")}).join(" ")}getInitialCenterFor(t){const e=this.getInitialBBoxFor(t);return e?{x:e.x+e.width/2,y:e.y+e.height/2}:null}getInitialPathAt(t){return this.getInitialPathFor(t,0)}getInitialPathForKey(t){return this._snapshot&&t?this.getInitialPathFor("key",t):null}hasKeyedMarks(){if(!this._snapshot)return!1;for(const t of this._snapshot.mapping.keys())if("string"==typeof t&&t.startsWith("key:"))return!0;return!1}getInitialSlotFor(t,e,i){const s=this.getInitialBBoxFor(t);if(!s)return null;const n=s.x+s.width/2,r=s.y+s.height/2;if(!(i>1&&e>=0))return{x:n,y:r};const o=(Math.min(e,i-1)+.5)/i;return s.height>=s.width?{x:n,y:s.y+s.height*(1-o)}:{x:s.x+s.width*o,y:r}}getInitialBBoxFor(t){if(!this._snapshot)return null;const e=this._snapshot.mapping.get(`${t}:0`);if(!e)return null;const i=this._pathBBox(e.d);if(!i)return null;const{k:s,dx:n,dy:r}=this._oldToNew();return{x:i.minX*s+n,y:i.minY*s+r,width:(i.maxX-i.minX)*s,height:(i.maxY-i.minY)*s}}_pathBBox(t){let e=1/0,i=1/0,s=-1/0,n=-1/0,r=0,o=0,a=0,l=0;const c=(t,r)=>{isFinite(t)&&isFinite(r)&&(t<e&&(e=t),t>s&&(s=t),r<i&&(i=r),r>n&&(n=r))};return Y(t).forEach(t=>{const e=t[0];if("Z"===e)return r=a,void(o=l);const i=t.length,s="H"===e?t[1]:"V"===e?r:t[i-2],n="H"===e?o:"V"===e?t[1]:t[i-1];if("A"===e){if(t[1]){const e=(r-s)/2,i=(o-n)/2,a=(t[4]===t[5]?-1:1)*Math.sqrt(Math.max(0,t[1]*t[1]/(e*e+i*i)-1)),l=r-e+a*i,h=o-i-a*e,d=Math.hypot(r-l,o-h),u=Math.atan2(o-h,r-l),g=2*Math.PI;let p=Math.atan2(n-h,s-l)-u;t[5]&&p<0?p+=g:!t[5]&&p>0&&(p-=g);for(let t=0;t<g;t+=Math.PI/2){((p>0?t-u:u-t)%g+g)%g<=Math.abs(p)&&c(l+d*Math.cos(t),h+d*Math.sin(t))}}}else if("H"!==e&&"V"!==e)for(let e=1;e+1<i;e+=2)c(t[e],t[e+1]);c(s,n),r=s,o=n,"M"===e&&(a=s,l=n)}),e>s?null:{minX:e,minY:i,maxX:s,maxY:n}}getSpeed(){const t=this.w.config.chart.animations;return t.chartTypeMorph&&t.chartTypeMorph.speed||t.speed||600}applyChromeFade(){var t;if(!this._snapshot||!p.isBrowser())return;this._shown=!0;const e=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!e||this._snapshot.resume)return;this._snapshot.pieceOut?this._separatePieces():this._snapshot.pieceIn?this._combinePieces():this._mountGhost();const i=this.getSpeed(),s=Array.from(e.querySelectorAll(".apexcharts-xaxis,.apexcharts-yaxis,.apexcharts-grid,.apexcharts-legend,.apexcharts-title-text,.apexcharts-subtitle-text")).filter(t=>t.style),n=(t,e)=>s.forEach(i=>{i.style.opacity=t,null!=e&&(i.style.transition=e)});n("0",`opacity ${i}ms ease-out`);const r=()=>this.w.globals.isDestroyed;f.requestAnimationFrame(()=>r()||n("1")),setTimeout(()=>r()||n("",""),i+80);const o=this._snapshot;setTimeout(()=>{r()||this._snapshot&&this._snapshot!==o||this.cleanup()},i+100)}retire(){const t=this._snapshot;if(!t||!this._shown)return;const e=this._pieceLayer;this.ctx._unitPieces=t.pieceOut&&e;const i=new Map;null==e||e.querySelectorAll("g").forEach(t=>{const e=t.firstChild&&t.getBBox();e&&i.set(t.firstChild.getAttribute("data-key"),{d:`M${e.x} ${e.y}H${e.x+e.width}V${e.y+e.height}H${e.x}Z`})}),this.cleanup(!0),i.size&&(this._collectTargetMarks(t.toType).forEach((t,e)=>{i.has(e)||i.set(e,{d:this._markD(t)})}),this.w.globals.previousPaths=[],this._snapshot=Object.assign(t,{mapping:i,pieceIn:!1,resume:!0,oldLayout:a({},this.w.layout)}),f.requestAnimationFrame(()=>{this._snapshot===t&&(this._shown=!0)}))}cleanup(t){this._snapshot=null,this._shown=!1,t||this._removeGhost(),this._cancelPieces()}}});const at="__apexcharts_plugins__";function lt(t){return function(){const t=globalThis;return t[at]||(t[at]={}),t[at]}()[t]||null}const ct=Object.freeze({"stroke.dashArray":Object.freeze({type:"number"}),"dataLabels.enabledOnSeries":Object.freeze({type:"boolean"})});function ht(t,e){const i=function(t){return t.weaveClaims||(t.weaveClaims={byOption:new Map}),t.weaveClaims}(t);return i.byOption.has(e)||i.byOption.set(e,[]),i.byOption.get(e)}function dt(t,e){const i=ct[t],s=[];for(const n of Array.isArray(e)?e:[])!n||"string"!=typeof n.series&&"number"!=typeof n.series?console.warn(`[apexcharts] claim on "${t}": each entry needs a series name or index.`):typeof n.value===i.type?s.push({series:n.series,value:n.value}):console.warn(`[apexcharts] claim on "${t}": expected a ${i.type} for series ${String(n.series)}, got ${typeof n.value}.`);return s}const ut=["xaxis","yaxis","points","texts","images"];function gt(t,e){const i=t.globals;return(i.collapsedSeriesIndices||[]).indexOf(e)<0&&(i.ancillaryCollapsedSeriesIndices||[]).indexOf(e)<0}function pt(t,e){const i=e&&e._derived,s=t=>{if(!i)return"core";for(const[e,s]of i)if(s.indexOf(t)>-1)return e;return"core"};return(t.config.series||[]).map((e,i)=>{const n=e&&e.name?String(e.name):`Series ${i+1}`;return{id:`series:${i}`,kind:"series",label:n,owner:s(n),visible:gt(t,i)}})}function ft(t){const e=t.config.annotations||{},i=[];for(const t of ut){(Array.isArray(e[t])?e[t]:[]).forEach((e,s)=>{e&&i.push({id:e.id?String(e.id):`annotation:${t}:${s}`,kind:"annotation",label:mt(e,t,s),owner:e.owner?String(e.owner):"core",visible:!0})})}return i}function mt(t,e,i){const s=t.label&&t.label.text;return s?String(s):t.text?String(t.text):t.id?String(t.id):`${e} annotation ${i+1}`}const xt=Object.freeze(["layer","derived","reserve","pointer","stroke-info","claim","drawn","observations","scale-orientation","highlight"]),yt=["updateOptions","updateSeries","appendData","appendSeries","toggleSeries","showSeries","hideSeries","highlightSeries","isSeriesHidden","zoomX","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","dataURI","exportToCSV"];function bt(t){const e={};return yt.forEach(i=>{"function"==typeof t[i]&&(e[i]=t[i].bind(t))}),Object.freeze(e)}function vt(t,e){const i=t.ctx,s=t.w,n={name:e.def.name,version:7,get options(){return e.options},on(t,i){const s=e.handlers;return s.has(t)||s.set(t,[]),s.get(t).push(i),n},off(t,i){const s=e.handlers.get(t);if(s){const t=s.indexOf(i);t>-1&&s.splice(t,1)}return n},store:{},layer:i=>t._layer(e.def.name,i||{}),get scales(){return t._currentScales},get data(){return t._lastData||(t._lastData=t._dataSnapshot())},theme:Object.freeze({get mode(){return s.config.theme.mode},get foreColor(){return s.config.chart.foreColor},seriesColor:t=>s.globals.colors[t],token:e=>t._token(e)}),chart:bt(i),get info(){return Object.freeze({type:String(s.config.chart&&(s.config.chart.requestedType||s.config.chart.type)||"line"),axisChart:!0===s.globals.axisCharts,datetimeX:!(!s.config.xaxis||"datetime"!==s.config.xaxis.type),horizontalBars:!!(s.config.plotOptions&&s.config.plotOptions.bar&&s.config.plotOptions.bar.horizontal),dataLabels:Object.freeze({enabled:!(!s.config.dataLabels||!s.config.dataLabels.enabled),enabledOnSeries:Array.isArray(s.config.dataLabels&&s.config.dataLabels.enabledOnSeries)?s.config.dataLabels.enabledOnSeries.slice():null}),stroke:Object.freeze({dashArray:Array.isArray(s.config.stroke&&s.config.stroke.dashArray)?s.config.stroke.dashArray.slice():s.config.stroke&&s.config.stroke.dashArray||0}),title:String(s.config.title&&s.config.title.text||"")})},get categories(){return t._categories()},markDerived:i=>(t._markDerived(e.def.name,i),n),reserve:i=>(t._reserve(e.def.name,i),n),claim(t,i){const n=function(t,e,i,s){if(!Object.prototype.hasOwnProperty.call(ct,i))return console.warn(`[apexcharts] "${i}" is not a claimable option. Claimable: ${Object.keys(ct).join(", ")}.`),null;const n={owner:e,option:i,entries:dt(i,s)};return ht(t,i).push(n),n}(s,e.def.name,t,i);return n?Object.freeze({release(){!function(t,e){if(!t.weaveClaims||!e)return;const i=t.weaveClaims.byOption.get(e.option);if(!i)return;const s=i.indexOf(e);s>-1&&i.splice(s,1)}(s,n)},update(e){n.entries=dt(t,e)}}):null},highlight:i=>t._highlight(e.def.name,i),drawn:()=>Object.freeze(function(t,e){const i=[];if(e&&e._declared)for(const[t,s]of e._declared)for(const e of s)i.push({id:`overlay:${t}:${e.id}`,kind:"overlay",label:e.label,owner:t,visible:!1!==e.visible});return[...pt(t,e),...ft(t),...i]}(s,t).map(t=>Object.freeze(t))),declare:i=>(t._declare(e.def.name,i),n),pointer:i=>t._onPointer(e.def.name,i),emit(t,s){i.events.fireEvent(`plugin:${e.def.name}:${t}`,[i,s])},get el(){return s.dom.baseEl}},r=wt,o=xt.filter(t=>r[t](n)),a=new Set(o),l=n;return l.capabilities=Object.freeze(o),l.can=t=>a.has(t),Object.freeze(n)}const wt={layer:t=>"function"==typeof t.layer,derived:t=>"function"==typeof t.markDerived,reserve:t=>"function"==typeof t.reserve,pointer:t=>"function"==typeof t.pointer,"stroke-info":t=>!(!t.info||!t.info.stroke),claim:t=>"function"==typeof t.claim,drawn:t=>"function"==typeof t.drawn&&"function"==typeof t.declare,observations:()=>!0,"scale-orientation":()=>!0,highlight:t=>"function"==typeof t.highlight};function _t(t){const e=[];for(const i of Array.isArray(t)?t:[])!i||"string"!=typeof i.series&&"number"!=typeof i.series?console.warn("[apexcharts] highlight: each entry needs a series name or index."):Array.isArray(i.values)?e.push({series:i.series,values:i.values.map(t=>"number"==typeof t&&Number.isFinite(t)?t:null)}):console.warn(`[apexcharts] highlight: expected an array of values for series ${String(i.series)}, got ${typeof i.values}.`);return e}const At=class t{constructor(t,e){this.w=t,this.ctx=e,this.active=[],this._layers=new Map,this._currentScales=null,this._lastPluginsRef=null,this._lastData=null,this._updatedWired=!1,this._derived=null,this._reserved=null,this._reserveTimer=null,this._highlightTimer=null,this._pointerSubs=null,this._declared=null,this._pointerWired=null,this._onUpdated=this._onUpdated.bind(this),this._init()}_init(){(this.w.config.plugins||[]).map((t,e)=>({entry:t,order:null!=t.order?t.order:e})).sort((t,e)=>t.order-e.order).forEach(t=>this._activate(t.entry)),this._lastPluginsRef=this.w.config.plugins,this._wireUpdated()}_wireUpdated(){this._updatedWired||(this.ctx.addEventListener("updated",this._onUpdated),this._updatedWired=!0)}_onUpdated(){this._repairInitialSeries(),this.dispatch("afterUpdate",{pass:"update"})}_activate(t){const e=lt(t.name);if(!e)return void console.error(`[apexcharts] plugin "${t.name}" is not registered.`);const i=null!=e.apiVersion?Math.trunc(e.apiVersion):1;if(!(i>=1)||i>7)return void console.error(`[apexcharts] plugin "${e.name}" targets Weave API v${e.apiVersion}, host is v7; skipped.`);const s={def:e,options:Object.freeze(a({},t.options||{})),handlers:new Map,disabled:!1,failures:0,api:null};s.api=vt(this,s),this.active.push(s),this._guard(s,"setup",()=>e.setup(s.api))}dispatch(t,e){if("draw"===t&&(this._reconcile(),this._resetLayers()),this._lastData=null,!this.active.length)return;"afterParse"===t?this._currentScales=null:e&&"xyRatios"in e&&this._setScales(e.xyRatios);const i=e&&e.pass||"full",s=this;let n=null;for(const e of this.active){if(e.disabled)continue;const r=e.handlers.get(t);if(!r||!r.length)continue;const o={api:e.api,scales:this._currentScales,get data(){return n||(n=s._lastData||(s._lastData=s._dataSnapshot()))},set data(t){Object.defineProperty(this,"data",{value:t,writable:!0})},pass:i,hook:t};for(const i of r.slice())this._guard(e,t,()=>i(o))}}_guard(t,e,i){if(!t.disabled)try{i()}catch(i){console.error(`[apexcharts] plugin "${t.def.name}" threw in "${e}":`,i),t.failures=(t.failures||0)+1,t.failures>=3&&(t.disabled=!0,this._forget(t.def.name),console.error(`[apexcharts] plugin "${t.def.name}" disabled after repeated errors.`))}}_setScales(t){const e=this.w,i=e.globals,s=e.layout;if(!t||!i.axisCharts)return void(this._currentScales=null);const n=t.xRatio,r=t.yRatio||[],o=t=>null!=r[t]?r[t]:r[0],a=t=>null!=i.maxYArr[t]?i.maxYArr[t]:i.maxY,l=t=>null!=i.minYArr[t]?i.minYArr[t]:i.minY,c=!!i.isBarHorizontal,h=!!e.axisFlags.isRangeBar,d=i.dataPoints>0&&(!e.axisFlags.isXNumeric||c),u=c&&h?e.labelData.labels.length:i.dataPoints,g=c?s.gridHeight:s.gridWidth,p=d&&u>0?g/u:0,f=new Map;if(d){(h?e.labelData.labels:e.axisFlags.isXNumeric&&e.seriesData.seriesX[i.maxValsInArrayIndex]||[]).forEach((t,e)=>{f.has(t)||f.set(t,e)})}const m=d?t=>p*((f.has(t)?f.get(t):t)+.5):t=>(t-i.minX)/n,x=t=>{const s=i.seriesYAxisReverseMap&&i.seriesYAxisReverseMap[t];return e.config.yaxis[null!=s?s:t]||e.config.yaxis[0]},b=t=>{const e=x(t);return!(!e||!e.reversed)};let v=null;const w=c?(t,e=0)=>{const i=Math.abs(a(e)-l(e)),n=i?(t-l(e))/i*s.gridWidth:0;return b(e)?s.gridWidth-n:n}:(t,n=0)=>{const r=((t,s)=>{const n=x(s);return n&&n.logarithmic&&!i.invalidLogScale?(v||(v=new y(e)),v.getLogVal(n.logBase,t,s)):null})(t,n);return null!==r?b(n)?r*s.gridHeight:(1-r)*s.gridHeight:b(n)?(t-l(n))/o(n):(a(n)-t)/o(n)};this._currentScales={x:m,y:w,domainX:d?[-.5,u-.5]:[i.minX,i.maxX],domainY:(t=0)=>[l(t),a(t)],transposed:c,point:(t,e,i=0)=>c?{x:w(e,i),y:m(t)}:{x:m(t),y:w(e,i)},gridWidth:s.gridWidth,gridHeight:s.gridHeight,ratios:t}}_dataSnapshot(){const t=this.w,e=t.globals,i=t.seriesData.series||[],s=t.seriesData.seriesX||[],n=Array.isArray(t.config.series)?t.config.series:[];return i.map((i,r)=>{const o=Array.isArray(i)?i:[i],a=s[r]||[],l=o.map((t,e)=>({x:null!=a[e]?a[e]:e,y:t})),c=n[r],h=c&&"object"==typeof c&&Array.isArray(c.data)?c.data:[],d=t.seriesObservations?t.seriesObservations[r]:null,u=d?{values:d.values.slice(),byPoint:d.byPoint.map(t=>t?t.slice():null)}:null;return{name:e.seriesNames?e.seriesNames[r]:void 0,hidden:(e.collapsedSeriesIndices||[]).includes(r),color:e.colors?e.colors[r]:void 0,points:l,raw:h,observations:u}})}_categories(){const t=this.w,e=t.globals,i=t.config.xaxis&&Array.isArray(t.config.xaxis.categories)?t.config.xaxis.categories:[],s=Array.isArray(e.categoryLabels)?e.categoryLabels:[],n=Array.isArray(e.labels)?e.labels:[],r=i.length?i:s.length?s:n,o=t.seriesData.series||[];let a=0;for(let t=0;t<o.length;t++){const e=o[t];Array.isArray(e)&&e.length>a&&(a=e.length)}a||(a=r.length);const l=[];for(let t=0;t<a;t++){const e=r[t];l.push(String(null==e?t+1:e))}return l}_markDerived(t,e){this._derived||(this._derived=new Map);const i=Array.isArray(e)?e.map(t=>String(t)):[];i.length?this._derived.set(t,i):this._derived.delete(t),this._repairInitialSeries()}_onPointer(t,e){if("function"!=typeof e)return()=>{};this._pointerSubs||(this._pointerSubs=new Map);const i=this._pointerSubs.get(t)||[];return i.push(e),this._pointerSubs.set(t,i),this._wirePointer(),()=>{const i=this._pointerSubs&&this._pointerSubs.get(t);if(!i)return;const s=i.indexOf(e);s>-1&&i.splice(s,1)}}_wirePointer(){if(this._pointerWired)return;if(!this.ctx||"function"!=typeof this.ctx.addEventListener)return;const t=[["enter","dataPointMouseEnter"],["leave","dataPointMouseLeave"],["select","dataPointSelection"]];this._pointerWired=[];for(const[e,i]of t){const t=(t,i,s)=>{this._emitPointer(e,s,t)};this.ctx.addEventListener(i,t),this._pointerWired.push([i,t])}}_emitPointer(e,i,s){if(!this._pointerSubs||!this._pointerSubs.size)return;const n=i&&"number"==typeof i.seriesIndex?i.seriesIndex:-1,r=i&&"number"==typeof i.dataPointIndex?i.dataPointIndex:-1,o=this._categories()||[],a=this.w,l=a&&a.config&&a.config.series||[],c={type:e,seriesIndex:n,dataPointIndex:r,category:r>-1?o[r]:void 0,seriesName:t._seriesName(l,n),selected:"select"===e?t._isSelected(i,n,r):void 0,modifiers:t._modifiers(s)};for(const[t,e]of this._pointerSubs){const i=this.active.find(e=>e.def.name===t);if(i)for(const t of e.slice())this._guard(i,"pointer",()=>t(c))}}static _seriesName(t,e){if(e<0)return;const i=t[e];return i&&"object"==typeof i&&"string"==typeof i.name?i.name:void 0}static _isSelected(t,e,i){const s=t&&t.selectedDataPoints;if(!Array.isArray(s)||e<0)return;const n=s[e];return!!Array.isArray(n)&&n.indexOf(i)>-1}static _modifiers(t){return Object.freeze({shift:!(!t||!t.shiftKey),ctrl:!(!t||!t.ctrlKey),alt:!(!t||!t.altKey),meta:!(!t||!t.metaKey)})}_reserve(e,i){const s=t._normaliseBox(i),n=this._reserved?this._reserved.get(e):void 0;if(s){if(n&&n.left===s.left&&n.right===s.right&&n.top===s.top&&n.bottom===s.bottom)return;this._reserved||(this._reserved=new Map),this._reserved.set(e,s)}else{if(!n||!this._reserved)return;this._reserved.delete(e)}this._resizeForReservation()}static _normaliseBox(t){if(!t||"object"!=typeof t)return null;const e=t=>Number.isFinite(t)&&t>0?Math.round(t):0,i={left:e(t.left),right:e(t.right),top:e(t.top),bottom:e(t.bottom)};return i.left||i.right||i.top||i.bottom?i:null}reservedBox(){if(!this._reserved||0===this._reserved.size)return t.NO_RESERVATION;const e={left:0,right:0,top:0,bottom:0};for(const t of this._reserved.values())e.left+=t.left,e.right+=t.right,e.top+=t.top,e.bottom+=t.bottom;return e}_resizeForReservation(){null==this._reserveTimer&&(this._reserveTimer=setTimeout(()=>{this._reserveTimer=null;const t=this.w.globals;t.isDestroyed||(t.resized=!0,t.dataChanged=!1,this._update("a plugin reservation"))},0))}_update(t){try{Promise.resolve(this.ctx.update()).catch(e=>console.error(`[apexcharts] re-render for ${t} failed:`,e))}catch(t){}}_highlight(t,e){const i=this.w,s=this.ctx.highlightFilter;if(!s)return null;if(!i.globals.axisCharts)return null;if(!s.canDrawParts())return null;if(s.callerCarriesParts())return null;const n=function(t,e,i){const s=_t(i);if(!s.length)return null;const n={owner:e,entries:s};return function(t){return t.weaveHighlights||(t.weaveHighlights={records:[]}),t.weaveHighlights}(t).records.push(n),n}(i,t,e);return n?(this._redrawForHighlight(),Object.freeze({release:()=>{!function(t,e){if(!t||!t.weaveHighlights||!e)return;const i=t.weaveHighlights.records,s=i.indexOf(e);s>-1&&i.splice(s,1)}(i,n),this._redrawForHighlight()},update:t=>{n.entries=_t(t),this._redrawForHighlight()}})):null}_redrawForHighlight(){null==this._highlightTimer&&(this._highlightTimer=setTimeout(()=>{this._highlightTimer=null;const t=this.w.globals;t.isDestroyed||(t.dataChanged=!0,this._update("plugin highlight parts"))},0))}_derivedNames(){const t=new Set;if(!this._derived)return t;for(const e of this._derived.values())for(const i of e)t.add(i);return t}_repairInitialSeries(){const t=this._derivedNames();if(!t.size)return;const e=this.w.globals,i=e=>!t.has(String(e&&e.name)),s=t=>{if(!Array.isArray(t))return null;const e=t.filter(i);return e.length&&e.length!==t.length?e:null};try{const t=s(e._initialSeriesPeek);t&&(e.initialSeries=t);const i=e.initialConfig,n=i&&s(i.series);n&&(i.series=n)}catch(t){}}_token(t){const e=this.w,i=e.globals;switch(t){case"foreColor":return e.config.chart.foreColor;case"background":return e.config.chart.background;case"accent":case"primary":return i.colors?i.colors[0]:void 0;default:return/^series-\d+$/.test(t)&&i.colors?i.colors[Number(t.split("-")[1])]:void 0}}_layer(t,{z:e="front",className:i=""}={}){let s=this._layers.get(t);if(!s){s=this.ctx.graphics.group({class:`apexcharts-plugin-${t} ${i}`.trim()});const n=this.w.dom.elGraphical.node;"behind"===e?n.insertBefore(s.node,n.firstChild):n.appendChild(s.node),s.node.setAttribute("aria-hidden","true"),this._layers.set(t,s)}return function(t,e,i){const s=e=>(e&&t.add(e),e),n={get node(){return t.node},path(t={}){const{d:i="",stroke:n="#000",width:r=1,fill:o="none",opacity:a=1,dash:l=0,className:c=""}=t;return s(e.drawPath({d:i,stroke:n,strokeWidth:r,fill:o,fillOpacity:"none"===o?0:a,strokeOpacity:a,strokeDashArray:l,classes:c}))},line(t={}){const{x1:i,y1:n,x2:r,y2:o,stroke:a="#000",width:l=1,dash:c=0}=t;return s(e.drawLine(i,n,r,o,a,c,l))},rect(t={}){const{x:i=0,y:n=0,w:r=0,h:o=0,r:a=0,fill:l="#000",stroke:c=null,opacity:h=1}=t;return s(e.drawRect(i,n,r,o,a,l,h,null!=c?1:null,c))},circle(t={}){const{cx:i=0,cy:n=0,r:r=0,fill:o="#000",stroke:a=null}=t;return s(e.drawCircle(r,{cx:i,cy:n,fill:o,stroke:a||"none"}))},text(t={}){const{x:i=0,y:n=0,text:r="",color:o,size:a,anchor:l="start",weight:c}=t;return s(e.drawText({x:i,y:n,text:r,textAnchor:l,fontSize:a,foreColor:o,fontWeight:c}))},clear(){const e=t.node;for(;e.firstChild;)e.removeChild(e.firstChild);return i&&i(),n}};return n}(s,this.ctx.graphics,()=>this._undeclare(t))}_undeclare(t){this._declared&&this._declared.delete(t)}_resetLayers(){this._layers.forEach(t=>t.node.remove()),this._layers.clear(),this._declared=null}_declare(t,e){if(!e||"string"!=typeof e.id||!e.id)return void console.warn(`[apexcharts] plugin "${t}" declared something with no id; ignored.`);this._declared||(this._declared=new Map);const i=this._declared.get(t)||[],s={id:e.id,label:e.label?String(e.label):e.id,visible:!1!==e.visible},n=i.findIndex(t=>t.id===s.id);n>-1?i[n]=s:i.push(s),this._declared.set(t,i)}_reconcile(){const t=this.w.config.plugins||[];if(t===this._lastPluginsRef)return;this._lastPluginsRef=t;const e=new Map(t.map((t,e)=>[t.name,{entry:t,order:null!=t.order?t.order:e}]));for(let t=this.active.length-1;t>=0;t--){const i=this.active[t],s=e.get(i.def.name);s?i.options=Object.freeze(a({},s.entry.options||{})):(this._guard(i,"destroy",()=>i.def.destroy&&i.def.destroy(i.api)),this.active.splice(t,1),this._forget(i.def.name))}const i=new Set(this.active.map(t=>t.def.name)),s=[];e.forEach((t,e)=>{i.has(e)||s.push(t)}),s.sort((t,e)=>t.order-e.order).forEach(t=>this._activate(t.entry))}_forget(t){const e=this.w,i=function(t,e){if(!t.weaveClaims)return!1;let i=!1;for(const[s,n]of t.weaveClaims.byOption){const r=n.filter(t=>t.owner!==e);r.length!==n.length&&(t.weaveClaims.byOption.set(s,r),i=!0)}return i}(e,t),s=function(t,e){if(!t||!t.weaveHighlights)return!1;const i=t.weaveHighlights.records,s=i.filter(t=>t.owner!==e);return s.length!==i.length&&(t.weaveHighlights.records=s,!0)}(e,t);this._pointerSubs&&this._pointerSubs.delete(t),this._derived&&this._derived.delete(t),this._declared&&this._declared.delete(t);const n=!(!this._reserved||!this._reserved.has(t));this._reserve(t,null),!i&&!s||n||this._redrawForHighlight()}teardown(t){if(!t){this.dispatch("destroy");for(const t of this.active)this._guard(t,"destroy",()=>t.def.destroy&&t.def.destroy(t.api));for(const t of this.active)this._forget(t.def.name);if(this.active=[],this._derived=null,this._reserved=null,this._pointerSubs=null,this._declared=null,this._pointerWired){for(const[t,e]of this._pointerWired)this.ctx.removeEventListener&&this.ctx.removeEventListener(t,e);this._pointerWired=null}null!=this._reserveTimer&&(clearTimeout(this._reserveTimer),this._reserveTimer=null),null!=this._highlightTimer&&(clearTimeout(this._highlightTimer),this._highlightTimer=null),this._updatedWired&&(this.ctx.removeEventListener&&this.ctx.removeEventListener("updated",this._onUpdated),this._updatedWired=!1)}this._layers.clear()}};var St,Ct,Et;St=At,Ct="NO_RESERVATION",Et=Object.freeze({left:0,right:0,top:0,bottom:0}),o(St,"symbol"!=typeof Ct?Ct+"":Ct,Et);let kt=At;h.default.registerFeatures({weave:kt}),h.default._customSeriesFactory=function(t,e){const i=class{constructor(t,e,i){this.w=t,this.ctx=e,this.xyRatios=i,this._warned=!1}draw(i,s,n){var r,o;const a=this.w,l=new v(a,this.ctx),c=function(t,e){const i=t&&t.renderer;return i&&i.kind&&"svg"!==i.kind?i:e}(this.ctx,l),h=l.group({class:"apexcharts-marks-series"});return i.forEach((i,s)=>{var r;const o=Array.isArray(n)?n[s]:s,d=l.group({class:"apexcharts-series",rel:o+1,seriesName:g.escapeString(a.seriesData.seriesNames[o]),"data:realIndex":o}),u=this._scales(o,(a.seriesData.series[o]||[]).length),p=a.globals.colors[o],f=(null==(r=a.config.series[o])?void 0:r.data)||[],m=a.seriesData.seriesX[o]||[],x=a.seriesData.series[o]||[];a.globals.seriesXvalues[o]=[],a.globals.seriesYvalues[o]=[],void 0===a.globals.pointsArray[o]&&(a.globals.pointsArray[o]=[]);for(let i=0;i<x.length;i++){const s=x[i];if(null==s)continue;const n=m[i],r=u.xAt(i,n),l=u.y(s),h=this._api(c,d,o,i);try{e.renderItem({datum:f[i],x:r,y:l,scales:u,api:h,seriesIndex:o,dataPointIndex:i,color:p})}catch(e){this._warned||(console.warn(`[apexcharts] renderItem for series type "${t}" threw; skipping datum:`,e),this._warned=!0)}a.globals.seriesXvalues[o][i]=r,a.globals.seriesYvalues[o][i]=l,a.globals.pointsArray[o][i]=[r,l]}l.setupEventDelegation(d,".apexcharts-marks-mark"),h.add(d)}),null==(o=null==(r=this.ctx.animations)?void 0:r.animationCompleted)||o.call(r,h),h}_scales(t,e){var i,s,n,r;const o=this.w.globals,a=this.w.config,l=this.xyRatios.xRatio,c=this.xyRatios.yRatio,h=null!=(s=null==(i=o.seriesYAxisReverseMap)?void 0:i[t])?s:0,d=Array.isArray(c)?null!=(n=c[h])?n:c[0]:c,u=o.maxYArr,g=Array.isArray(u)&&u.length&&null!=(r=u[h])?r:o.maxY,p=o.gridWidth,f=o.gridHeight,m=!o.isXNumeric,x=e||o.dataPoints||1,y=x>0?p/x:p,b="on"===a.xaxis.tickPlacement,v=t=>l?(t-o.minX)/l:p/2,w=o.minXDiff||1;return{x:v,xAt:(t,e)=>m?b&&x>1?t/(x-1)*p:(t+.5)*y:v(e),y:t=>(g-t)/d,gridWidth:p,gridHeight:f,band:m?y:l?w/l:p}}_api(t,e,i,s){const n=t=>{if(t){try{t.node.setAttribute("index",String(i)),t.node.setAttribute("j",String(s)),t.node.classList.add("apexcharts-marks-mark")}catch(t){}e.add(t)}return t};return{path:(e={})=>{var i,s,r,o,a,l,c,h,d;return n(t.drawPath({d:e.d||"",stroke:null!=(i=e.stroke)?i:"#000",strokeWidth:null!=(r=null!=(s=e.width)?s:e.strokeWidth)?r:1,fill:null!=(o=e.fill)?o:"none",fillOpacity:null!=(l=e.fillOpacity)?l:e.fill&&"none"!==e.fill?null!=(a=e.opacity)?a:1:0,strokeOpacity:null!=(h=null!=(c=e.strokeOpacity)?c:e.opacity)?h:1,strokeDashArray:null!=(d=e.dash)?d:0,strokeLinecap:e.lineCap}))},line:(e={})=>{var i,s,r,o;return n(t.drawLine(e.x1,e.y1,e.x2,e.y2,null!=(i=e.stroke)?i:"#000",null!=(s=e.dash)?s:0,null!=(o=null!=(r=e.width)?r:e.strokeWidth)?o:1))},rect:(e={})=>{var i,s,r,o,a,l,c,h;return n(t.drawRect(null!=(i=e.x)?i:0,null!=(s=e.y)?s:0,null!=(r=e.w)?r:0,null!=(o=e.h)?o:0,null!=(a=e.r)?a:0,null!=(l=e.fill)?l:"#000",null!=(c=e.opacity)?c:1,null!=e.stroke?null!=(h=e.strokeWidth)?h:1:null,e.stroke))},circle:(e={})=>{var i,s,r,o,a;return n(t.drawCircle(null!=(i=e.r)?i:0,{cx:null!=(s=e.cx)?s:0,cy:null!=(r=e.cy)?r:0,fill:null!=(o=e.fill)?o:"#000",stroke:e.stroke||"none","stroke-width":null!=(a=e.strokeWidth)?a:e.stroke?1:0}))},text:(e={})=>{var i,s,r,o;return n(t.drawText({x:null!=(i=e.x)?i:0,y:null!=(s=e.y)?s:0,text:null!=(r=e.text)?r:"",textAnchor:null!=(o=e.anchor)?o:"start",fontSize:e.size,foreColor:e.color,fontWeight:e.weight}))}}}};return i.dataType=e.dataType||"xy",i.yExtent="function"==typeof e.yExtent?e.yExtent:null,i};class Mt{constructor(t,e){if(this.w=t,this.ctx=e,"os"!==t.config.theme.follow||!p.isBrowser())return;const i=this._ensureMedia();i&&(this._applyToConfig(i),this._ensureListeners(i))}_ensureMedia(){if(!this.ctx._osThemeMedia){const t=f.matchMedia("(prefers-color-scheme: dark)"),e=f.matchMedia("(prefers-contrast: more)");if(!t&&!e)return null;this.ctx._osThemeMedia={dark:t,contrast:e,handler:null}}return this.ctx._osThemeMedia}_applyToConfig(t){const e=this.w.config.theme;t.dark&&(e.mode=t.dark.matches?"dark":"light"),t.contrast&&t.contrast.matches&&(e.accessibility=e.accessibility||{},e.accessibility.colorBlindMode="highContrast")}_ensureListeners(t){if(t.handler)return;const e=this.ctx,i=()=>{const t=e._osThemeMedia;if(!t)return;const i={mode:t.dark&&t.dark.matches?"dark":"light"};t.contrast&&t.contrast.matches?i.accessibility={colorBlindMode:"highContrast"}:i.accessibility={colorBlindMode:""},e.updateOptions({theme:i},!1,!0,!1)};Mt._add(t.dark,i),Mt._add(t.contrast,i),t.handler=i}teardown(){const t=this.ctx._osThemeMedia;t&&(t.handler&&(Mt._remove(t.dark,t.handler),Mt._remove(t.contrast,t.handler)),this.ctx._osThemeMedia=null)}static _add(t,e){t&&("function"==typeof t.addEventListener?t.addEventListener("change",e):"function"==typeof t.addListener&&t.addListener(e))}static _remove(t,e){t&&("function"==typeof t.removeEventListener?t.removeEventListener("change",e):"function"==typeof t.removeListener&&t.removeListener(e))}}h.default.registerFeatures({osThemeWatcher:Mt});const Pt="__apexcharts_series_transforms__";function It(t,e){t&&"string"==typeof t?"function"==typeof e?globalThis[Pt][t]=e:console.warn(`ApexCharts: registerSeriesTransform("${t}") expects a function (series, w) => series.`):console.warn("ApexCharts: registerSeriesTransform requires a non-empty name.")}globalThis[Pt]||(globalThis[Pt]={});const Lt="__apexcharts_row_sources__";function Tt(t,e){t&&"string"==typeof t?"function"==typeof e?globalThis[Lt][t]=e:console.warn(`ApexCharts: registerRowSource("${t}") expects a function (w, opts) => series.`):console.warn("ApexCharts: registerRowSource requires a non-empty name.")}function Rt(t){return(t.collapsedSeriesIndices||[]).concat(t.ancillaryCollapsedSeriesIndices||[])}function Dt(t,e){const i=(e.collapsedSeries||[]).concat(e.ancillaryCollapsedSeries||[]);return t.map((t,e)=>{const o=t||{},{hidden:c}=o,h=((t,e)=>{var i={};for(var o in t)n.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&s)for(var o of s(t))e.indexOf(o)<0&&r.call(t,o)&&(i[o]=t[o]);return i})(o,["hidden"]);let d=h.data;if(Array.isArray(d)&&!d.length){const t=i.find(t=>t.index===e);t&&Array.isArray(t.data)&&(d=t.data)}return l(a({},h),{data:Array.isArray(d)?d.slice():d})})}globalThis[Lt]||(globalThis[Lt]={});function Ft(t,e){const i=t.length;if(0===i)return NaN;if(1===i)return t[0];const s=(i-1)*e,n=Math.floor(s),r=Math.ceil(s);return n===r?t[n]:t[n]+(t[r]-t[n])*(s-n)}function Xt(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e);let s=i[0],n=i[i.length-1];const r=e.range;if(Array.isArray(r)&&2===r.length){const t=Number(r[0]),e=Number(r[1]);Number.isFinite(t)&&Number.isFinite(e)&&e>t&&(s=t,n=e)}if(!(n>s)){const t=Math.abs(s)>0?.05*Math.abs(s):.5;return{edges:[s-t,s+t],binWidth:2*t,rule:"single",capped:!1}}const o=n-s;let a,l;if("number"==typeof e.binWidth&&e.binWidth>0)a=e.binWidth,l="binWidth";else if("number"==typeof e.bins&&e.bins>=1)a=o/Math.floor(e.bins),l="count";else{const t=function(t,e,i){const s=t.length,n=t=>e/Math.max(1,Math.ceil(t)),r=()=>n(Math.log2(s)+1);switch(i){case"sqrt":return{width:n(Math.sqrt(s)),rule:"sqrt"};case"rice":return{width:n(2*Math.cbrt(s)),rule:"rice"};case"scott":{const e=function(t){const e=t.length;if(e<2)return 0;let i=0;for(let s=0;s<e;s++)i+=t[s];const s=i/e;let n=0;for(let i=0;i<e;i++){const e=t[i]-s;n+=e*e}return Math.sqrt(n/e)}(t);return e>0?{width:3.49*e*Math.pow(s,-1/3),rule:"scott"}:{width:r(),rule:"sturges"}}case"fd":{const e=Ft(t,.75)-Ft(t,.25);return e>0?{width:2*e*Math.pow(s,-1/3),rule:"fd"}:{width:r(),rule:"sturges"}}case"auto":{const e=r(),i=Ft(t,.75)-Ft(t,.25);if(i<=0)return{width:e,rule:"sturges"};const n=2*i*Math.pow(s,-1/3);return n<e?{width:n,rule:"fd"}:{width:e,rule:"sturges"}}default:return{width:r(),rule:"sturges"}}}(i,o,"string"==typeof e.bins?e.bins:"auto");a=t.width,l=t.rule}(!Number.isFinite(a)||a<=0)&&(a=o);let c=Math.ceil(o/a);(!Number.isFinite(c)||c<1)&&(c=1);let h=!1;c>1e3&&(c=1e3,h=!0),a=o/c;const d=new Array(c+1);for(let t=0;t<=c;t++)d[t]=s+t*a;return d[c]=Math.max(d[c],n),{edges:d,binWidth:a,rule:l,capped:h}}function $t(t,e){const i=e.length-1;if(!(t>=e[0])||t>e[i])return-1;if(t===e[i])return i-1;const s=(e[i]-e[0])/i;if(s>0){let n=Math.floor((t-e[0])/s);return n<0&&(n=0),n>i-1&&(n=i-1),t<e[n]?n--:t>=e[n+1]&&n++,n<0||n>i-1?-1:n}let n=0,r=i-1;for(;n<=r;){const i=n+r>>1;if(t<e[i])r=i-1;else{if(!(t>=e[i+1]))return i;n=i+1}}return-1}function zt(t,e){const i=Math.max(0,e.length-1),s=new Array(i);for(let t=0;t<i;t++)s[t]=[];for(let i=0;i<t.length;i++){const n=$t(t[i],e);n>=0&&s[n].push(t[i])}return s}function Bt(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e),s=Ft(i,.25),n=Ft(i,.5),r=Ft(i,.75),o=r-s;let a=i[0],l=i[i.length-1],c=[];if("tukey"===e.whiskers&&o>0){const t=s-1.5*o,e=r+1.5*o;let n=0;for(;n<i.length&&i[n]<t;)n++;let h=i.length-1;for(;h>=0&&i[h]>e;)h--;n<=h&&(a=i[n],l=i[h],c=i.slice(0,n).concat(i.slice(h+1)))}return{summary:[a,s,n,r,l],outliers:c,iqr:o}}function Wt(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const i=t.slice().sort((t,e)=>t-e),s=i.length;let n=e.bandwidth;if(!("number"==typeof n&&n>0)){const t=function(t){const e=t.length;if(e<2)return 0;let i=0;for(let s=0;s<e;s++)i+=t[s];const s=i/e;let n=0;for(let i=0;i<e;i++){const e=t[i]-s;n+=e*e}return Math.sqrt(n/e)}(i),e=Ft(i,.75)-Ft(i,.25);n=.9*(e>0?Math.min(t,e/1.349):t)*Math.pow(s,-.2)}if(!isFinite(n)||n<=0){const t=i[0],e=Math.abs(t)>0?.001*Math.abs(t):.001;return{density:[[t-e,0],[t,1],[t+e,0]],bandwidth:e}}const r=Math.max(8,Math.floor(e.resolution||64)),o=i[0]-2*n,a=(i[s-1]+2*n-o)/(r-1),l=1/(s*n*Math.sqrt(2*Math.PI)),c=[];for(let t=0;t<r;t++){const e=o+t*a;let r=0;for(let t=0;t<s;t++){const s=(e-i[t])/n;r+=Math.exp(-.5*s*s)}c.push([e,r*l])}return{density:c,bandwidth:n}}function Nt(t){const e=[];if(!Array.isArray(t))return e;for(let i=0;i<t.length;i++){const s=t[i];let n=s;Array.isArray(s)?n=1===s.length?s[0]:s[1]:s&&"object"==typeof s&&(n=void 0!==s.y?s.y:s.x);const r=g.parseNumber(n);null!==r&&isFinite(r)&&e.push(r)}return e}function Ot(t,e,i,s,n,r,o){if(!Array.isArray(t))return t;const c=function(t,e){const i=t.statsDerived||(t.statsDerived={});return i[e]||(i[e]=new Map)}(e,i),h=[],d=t.map((t,e)=>{if(!Array.isArray(null==t?void 0:t.data)||t.type&&t.type!==i)return t;let d=!1;const u=new Array(t.data.length).fill(null),p=t.data.map((t,a)=>{const l=e+":"+a,h=r(t);if(h&&!function(t,e,i){const s=(t.get(e)||{}).e;return!!s&&JSON.stringify(s.density||s.summary)===JSON.stringify(i)}(c,l,h))return t;const p=function(t,e){var i;if(!t||"object"!=typeof t||Array.isArray(t))return null;let s=null;if(Array.isArray(t.points)?s=t.points:Array.isArray(null==(i=t.y)?void 0:i.points)?s=t.y.points:e&&Array.isArray(t.y)&&"number"==typeof t.y[0]&&(s=t.y),!s)return null;const n=[];for(let t=0;t<s.length;t++){const e=g.parseNumber(s[t]);null!==e&&isFinite(e)&&n.push(e)}return n.length?n:null}(t,"violin"===i);if(!p)return t;const f=function(t,e,i,s,n){const r=JSON.stringify(s)+i;let o=t.get(e);return o&&o.s===r||t.set(e,o={s:r,e:n(i,s)}),o.e}(c,l,p,s,n);return f?(d=!0,u[a]=p,o(t,f,p)):t});return d&&(h[e]=u),d?l(a({},t),{data:p}):t});return function(t,e,i){if(!e.length)return;const s=[];for(let t=0;t<i;t++){const i=e[t];if(!i){s.push(null);continue}const n=[];for(const t of i)if(t)for(let e=0;e<t.length;e++)n.push(t[e]);s.push({values:n,byPoint:i})}t.seriesObservations=s}(e,h,t.length),d}function Ht(t,e,i){const s=i&&null!=i.maxRows?i.maxRows:3e3,n=function(t,e){let i=0,s=0;for(const e of t)i+=e.length,e.length>s&&(s=e.length);if(i<=e)return{clusters:t,stride:1,total:i,kept:i};const n=e=>{let i=0;for(const s of t)i+=Math.ceil(s.length/e);return i};let r=Math.max(2,Math.ceil(i/e));for(;r<s&&n(r)>e;)r++;let o=0;return{clusters:t.map(t=>{const e=[];for(let i=0;i<t.length;i+=r)e.push(t[i]);return o+=e.length,e}),stride:r,total:i,kept:o}}(e.map(t=>t.rows),s);n.stride>1&&console.warn(`ApexCharts: rowSeries() thinned ${n.total} rows to ${n.kept} (every ${n.stride}${2===n.stride?"nd":3===n.stride?"rd":"th"} row) to stay under maxRows=${s}. Raise maxRows to draw more.`);const r=t.globals&&t.globals.colors||[];return e.map((t,e)=>{const i=r[t.realIndex]||r[0];return{name:t.name,data:n.clusters[e].map((s,n)=>a({id:`${t.realIndex}:${e}:${n}`,x:t.name,y:s},i?{fillColor:i}:{}))}})}function Yt(t){if(!isFinite(t))return String(t);const e=Math.round(t);return Math.abs(t-e)<1e-6?String(e):String(Number(t.toFixed(2)))}function jt(t){return(e,i)=>{var s;const n=t(e);if(!Array.isArray(n)||!n.length)return null;const r=e.globals?Rt(e.globals):[],o=e.globals&&((null==(s=e.globals.categoryLabels)?void 0:s.length)?e.globals.categoryLabels:e.globals.labels)||[],a=[];return n.forEach((t,i)=>{var s;if(-1!==r.indexOf(i))return;if(!Array.isArray(t))return;const l=e.seriesData&&(null==(s=e.seriesData.seriesNames)?void 0:s[i]);t.forEach((t,e)=>{const s=null!=o[e]?String(o[e]):`#${e+1}`;a.push({name:n.length>1&&l?`${l} ${s}`:s,realIndex:i,rows:Array.isArray(t)?t.slice():[]})})}),a.length?Ht(e,a,i):null}}const qt=jt(t=>{var e;return null==(e=t.candleData)?void 0:e.seriesBoxPoints}),Zt=jt(t=>{var e;return null==(e=t.violinData)?void 0:e.seriesViolinPoints});It("histogram",function(t,e){var i;const s=e.config,n=e.globals;if(!Array.isArray(t))return t;n.histogramRawSeries||(n.histogramRawSeries=Dt(t,n));const r=n.histogramRawSeries,o=(null==(i=s.plotOptions)?void 0:i.histogram)||{},c=r.map(t=>Nt(null==t?void 0:t.data));let h=[];if(1===c.length)h=c[0];else for(const t of c)h=h.concat(t);const d=Xt(h,{bins:o.bins,binWidth:o.binWidth,range:o.range});if(!d)return e.histogramData={edges:[],binWidth:0,counts:[],rule:"",capped:!1},r;const{edges:u,binWidth:g}=d,p=c.map(t=>function(t,e){const i=new Array(Math.max(0,e.length-1)).fill(0);for(let s=0;s<t.length;s++){const n=$t(t[s],e);n>=0&&i[n]++}return i}(t,u));e.histogramData={edges:u,binWidth:g,counts:p,rule:d.rule,capped:d.capped};const f=Rt(n);return e.seriesObservations=c.map((t,e)=>({values:t,byPoint:-1!==f.indexOf(e)?[]:zt(t,u)})),r.map((t,e)=>{if(-1!==f.indexOf(e))return l(a({},t),{data:[]});const i=function(t,e={}){let i=t.slice();if(e.cumulative){let t=0;i=i.map(e=>t+=e)}const s=t.reduce((t,e)=>t+e,0);if(s<=0)return i;if("relative"===e.normalize)return i.map(t=>t/s*100);if("density"===e.normalize){const t=e.binWidth;if("number"==typeof t&&t>0)return i.map(e=>e/(s*t))}return i}(p[e],{normalize:o.normalize,cumulative:o.cumulative,binWidth:g}),s=[];for(let t=0;t<i.length;t++)s.push({x:(u[t]+u[t+1])/2,y:i[t]});return l(a({},t),{data:s})})}),It("boxPlot",function(t,e){var i,s;return Ot(t,e,"boxPlot",{whiskers:(null==(s=null==(i=e.config.plotOptions)?void 0:i.boxPlot)?void 0:s.whiskers)||"minmax"},Bt,t=>Array.isArray(null==t?void 0:t.y)&&5===t.y.length&&t.y,(t,e,i)=>l(a({},t),{y:e.summary,points:i}))}),It("violin",function(t,e){var i,s;const n=(null==(s=null==(i=e.config.plotOptions)?void 0:i.violin)?void 0:s.kde)||{};return Ot(t,e,"violin",{bandwidth:n.bandwidth,resolution:n.resolution},Wt,t=>{var e;return Array.isArray(null==(e=null==t?void 0:t.y)?void 0:e.density)&&t.y.density.length&&t.y.density},(t,e,i)=>l(a({},t),{y:l(a({},t.y&&"object"==typeof t.y&&!Array.isArray(t.y)?t.y:{}),{density:e.density,points:i})}))}),Tt("histogram",function(t,e){const i=t.globals,s=t.histogramData,n=i&&i.histogramRawSeries;if(!s||!Array.isArray(s.edges)||s.edges.length<2)return null;if(!Array.isArray(n)||!n.length)return null;const r=Rt(i),o=s.edges,a=[];return n.forEach((e,i)=>{var s;if(-1!==r.indexOf(i))return;const l=zt(Nt(e&&e.data),o),c=t.seriesData&&(null==(s=t.seriesData.seriesNames)?void 0:s[i])||(null==e?void 0:e.name);l.forEach((t,e)=>{const s=`${Yt(o[e])}-${Yt(o[e+1])}`;a.push({name:n.length>1&&c?`${c} ${s}`:s,realIndex:i,rows:t})})}),a.length?Ht(t,a,e):null}),Tt("boxPlot",qt),Tt("violin",Zt);