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
- !function(t){var e="undefined"!=typeof globalThis?globalThis:self,i=e.ApexCharts;if(i&&i.__internals)return t.call(e);if(i)throw new Error("ApexCharts: dist/features/trellis.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");if("function"==typeof define&&define.amd)return t.call(e);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/features/trellis.js is a script-tag add-on and needs the ApexCharts script on the page. A bundler imports the matching apexcharts/ sub-path instead.");var s={file:"dist/features/trellis.js",run:t,done:!1},n=e.__apexcharts_pending_addons__||(e.__apexcharts_pending_addons__=[]);n.push(s),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!s.done){var i=e.ApexCharts;if(i)if(i.__internals){s.done=!0;var r=n.indexOf(s);-1!==r&&n.splice(r,1);try{t.call(e),i.__drainsAddons||e.console.warn("ApexCharts: dist/features/trellis.js loaded before the ApexCharts script, which is older than 8.0 and does not pick up add-ons loaded first, so it registered only when the page finished loading. Put its tag after the ApexCharts script.")}catch(t){e.console.error("ApexCharts: dist/features/trellis.js could not register with the ApexCharts script on this page: "+(t&&t.message))}}else e.console.error("ApexCharts: dist/features/trellis.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");else e.console.warn("ApexCharts: dist/features/trellis.js is waiting for the ApexCharts script, which had not loaded when the page finished loading. It registers when an ApexCharts 8.0 or later script loads; if the page has none, add apexcharts.min.js (or apexcharts.core.min.js, or apexcharts.full.min.js).")}})}(function(){var t,e;t=this,e=function(t){"use strict";var e=Object.defineProperty,i=Object.defineProperties,s=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,l=(t,i,s)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[i]=s,o=(t,e)=>{for(var i in e||(e={}))r.call(e,i)&&l(t,i,e[i]);if(n)for(var i of n(e))a.call(e,i)&&l(t,i,e[i]);return t},c=(t,e)=>i(t,s(e)),h=(t,e,i)=>new Promise((s,n)=>{var r=t=>{try{l(i.next(t))}catch(t){n(t)}},a=t=>{try{l(i.throw(t))}catch(t){n(t)}},l=t=>t.done?s(t.value):Promise.resolve(t.value).then(r,a);l((i=i.apply(t,e)).next())});const d=globalThis.ApexCharts,u=globalThis.ApexCharts.__internals.__apex_Utils,p=globalThis.ApexCharts.__internals.__apex_Environment_Environment,f=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs,m=globalThis.ApexCharts.__internals,g=m.__apex_Resize_addResizeListener,y=m.__apex_Resize_removeResizeListener;class x{constructor(t,e){this.w=t,this.ctx=e,this.kind="svg"}beginSeries(){}present(){return null}clear(){}group(t){return this.ctx.graphics.group(t)}drawPath(t){return this.ctx.graphics.drawPath(t)}drawLine(...t){return this.ctx.graphics.drawLine(...t)}drawRect(...t){return this.ctx.graphics.drawRect(...t)}drawCircle(t,e){return this.ctx.graphics.drawCircle(t,e)}drawText(t){return this.ctx.graphics.drawText(t)}renderPaths(t){return this.ctx.graphics.renderPaths(t)}drawMarker(t,e,i={}){return this.ctx.graphics.drawMarker(t,e,i)}supports(t){return!0}hitTest(){return null}restyle(){}toBitmap(){return null}destroy(){}}const v=["none","lighten","darken"];function b(t){const e=t.config.series||[],i=t.config.chart.type,s="scatter"===i||"bubble"===i,n=t.config.markers&&t.config.markers.size,r=Array.isArray(n)?n.some(t=>t>0):(n||0)>0,a=!(!t.config.dataLabels||!t.config.dataLabels.enabled),l="heatmap"===i;let o=0,c=0;return e.forEach(t=>{const e=Array.isArray(t.data)?t.data.length:0;e>c&&(c=e),(s||r||l)&&(o+=e),a&&(o+=e)}),c>=5e4&&(o=Math.max(o,c)),o}function _(t){var e,i,s,n;const r=t.config.fill&&t.config.fill.type,a=t=>"pattern"===t||"image"===t||"gradient"===t;if(Array.isArray(r)?r.some(a):a(r))return!0;const l=null==(i=null==(e=t.config.plotOptions)?void 0:e.line)?void 0:i.colors;if(l&&l.colorAboveThreshold&&l.colorBelowThreshold)return!0;if("heatmap"===t.config.chart.type&&"rect"!==((null==(n=null==(s=t.config.plotOptions)?void 0:s.heatmap)?void 0:n.shape)||"rect"))return!0;const o=t.config.states||{},c=o.hover&&o.hover.filter&&o.hover.filter.type,h=o.active&&o.active.filter&&o.active.filter.type;return!(!c||v.includes(c))||!(!h||v.includes(h))}const w="__apexcharts_renderers__";function A(){const t=globalThis;return t[w]||(t[w]=new Map),t[w]}class E{static get _rendererRegistry(){return A()}static registerRenderer(t,e){A().set(t,e)}static unregisterRenderer(t){A().delete(t)}constructor(t,e){this.w=t,this.ctx=e,this.svg=new x(t,e),this.active=this.svg,this._activeKind="svg",this._instances={},this.w.globals.activeRenderer=this.active}_activate(t,e){this.active=e,this._activeKind=t,this.ctx.renderer=e,this.w.globals.activeRenderer=e}_desiredKind(){const t=this.w.config.chart,e=t.renderer||"svg";return p.isBrowser()?"svg"===e||_(this.w)?"svg":"canvas"===e||b(this.w)>=(t.rendererThreshold||8e3)?"canvas":"svg":"svg"}resolve(){const t=this.w.config.chart.renderer||"svg",e=this._desiredKind();if("svg"!==e){const i=A().get(e);if(i)return this._instances[e]||(this._instances[e]=i(this.w,this.ctx)),this._activate(e,this._instances[e]),this._activeKind;t===e&&function(t,e,i={}){const{module:s=`features/${e}`,entry:n,scripts:r=[`features/${e}.js`],tail:a}=i,l=r.map(t=>`<script src='.../dist/${t}'>`).join(" and ");globalThis.console.warn(`ApexCharts: ${t} requires the ${e} feature, which is not in this bundle. Bundler: import 'apexcharts/${s}'`+(n?` (or from 'apexcharts/${n}')`:"")+`. Script tag: add ${l} after the ApexCharts script, or load apexcharts.full.min.js instead.`+(a?` ${a}`:""))}(`\`chart.renderer: '${e}'\``,`renderer-${e}`,{tail:"Falling back to SVG."})}else"canvas"===t&&_(this.w)&&console.warn('[apexcharts] renderer:"canvas" requested but this chart uses a feature the canvas renderer does not render yet (gradient/pattern/image fill or a state color-matrix filter); falling back to SVG.');return this._activate("svg",this.svg),this._activeKind}pendingKind(){const t=this._desiredKind();return"svg"===t||A().has(t)?t:"svg"}getActiveKind(){return this._activeKind}teardown(){for(const t in this._instances){const e=this._instances[t];e&&"function"==typeof e.destroy&&e.destroy()}this._instances={},this.active=this.svg,this._activeKind="svg",this.w.globals.activeRenderer=null}}const M=globalThis.ApexCharts.__internals.__apex_helpers_InitCtxVariables;function S(t){if(!Array.isArray(t)||0===t.length)return"empty";for(let e=0;e<t.length;e++){const i=t[e];if(null!=i)return Array.isArray(i)?"paired":"object"==typeof i?"object":"plain"}return"empty"}function C(t,e){if(null!=t){if("paired"===e){const e=t[0];return e instanceof Date?e.getTime():e}if("object"===e){const e=t.x;return e instanceof Date?e.getTime():e}}}function k(t,e){return"paired"===e?[t,null]:"object"===e?{x:t,y:null}:null}function L(t,e,i){const s="function"==typeof i?i(t,e):t?t[i]:void 0;return null==s||""===s?null:String(s)}function F(t,e){if(!e||"first-seen"===e)return t.slice();if("asc"===e||"desc"===e){const i=t.slice().sort((t,e)=>{const i=Number(t),s=Number(e);return isFinite(i)&&isFinite(s)?i-s:t<e?-1:t>e?1:0});return"desc"===e?i.reverse():i}if(Array.isArray(e)){const i=e.map(String).filter(e=>-1!==t.indexOf(e)),s=t.filter(t=>-1===i.indexOf(t));return i.concat(s)}return"function"==typeof e?t.slice().sort(e):t.slice()}function N(t,e){const i=[],s=new Set;let n=!1,r=!1,a=0,l="plain";t.forEach(t=>{const e=S(t&&t.data);if("empty"!==e){if("plain"===e)return r=!0,void(a=Math.max(a,t.data.length));n=!0,l=e,t.data.forEach(t=>{const n=C(t,e);if(void 0===n)return;const r=typeof n+":"+String(n);s.has(r)||(s.add(r),i.push(n))})}}),n&&r&&e.push("trellis: mixing x-keyed data ([x,y] / {x,y}) with plain value arrays; plain series are padded by position, not by x");const o=n&&i.every(t=>"number"==typeof t&&isFinite(t));return o&&i.sort((t,e)=>Number(t)-Number(e)),{unionX:i,sawKeyed:n,plainMaxLen:a,xForm:l,xIsNumeric:o}}const H=["scatter","bubble"];function O(t,e,i=!0){const s=[],n=new Set;let r=0;return{align:a=>{const l=S(a&&a.data),h=a&&null!=a.name?String(a.name):`series-${r+1}`;r++,n.has(h)||(n.add(h),s.push(h));const d=c(o({},a),{name:h});if(!i)return d.data=Array.isArray(a.data)?a.data.slice():[],d;if("plain"===l||"empty"===l){const e=t.sawKeyed?t.unionX.length:t.plainMaxLen,i=Array.isArray(a.data)?a.data.slice(0,e):[];for(;i.length<e;)i.push(null);if(d.data=i,Array.isArray(a.highlightData)){const t=a.highlightData.slice(0,e);for(;t.length<e;)t.push(null);d.highlightData=t}return d}const u=new Map,p=new Map,f=Array.isArray(a.highlightData)?a.highlightData:null;return a.data.forEach((t,i)=>{const s=C(t,l);void 0===s||u.has(s)?void 0!==s&&u.has(s)&&e.push(`trellis: duplicate x "${String(s)}" in series "${h}"; keeping the first`):(u.set(s,t),f&&p.set(s,f[i]))}),d.data=t.unionX.map(t=>u.has(t)?u.get(t):k(t,l)),f&&(d.highlightData=t.unionX.map(t=>p.has(t)?p.get(t):null)),d},seriesNames:s}}function P(t,e={}){const i=t.xForm,s={bar:0,column:0,rangeBar:[0,0],candlestick:[0,0,0,0],boxPlot:[0,0,0,0,0]},n=e.chartType&&e.chartType in s?s[e.chartType]:null,r="plain"===i?t.unionX.map(()=>n):t.unionX.map(t=>{if(null===n)return k(t,i);const e=Array.isArray(n)?n.slice():n;return"object"===i?{x:t,y:e}:[t,e]});return{name:e.name||t.seriesNames[0]||"series-1",data:r}}function $(t,e={},i={}){const s=[],n=Array.isArray(t)?t:[],r=(a=i.chartType,!H.includes(a||""));var a;if(e.row||e.column)return e.by&&s.push("trellis: `by` is ignored when `row`/`column` are set (they are mutually exclusive)"),function(t,e,i,s=!0){const n=e.row,r=e.column,a=new Map,l=new Map,o=new Map,c=[],h=[],d=[],u=(t,e)=>{-1===t.indexOf(e)&&t.push(e)};if(t.forEach((t,e)=>{var i,s;const p=n?L(t,e,n):"",f=r?L(t,e,r):"";if(null===p&&null===f)return void c.push(t);if(null===p)return u(d,f),o.has(f)||o.set(f,[]),void(null==(i=o.get(f))||i.push(t));if(null===f)return u(h,p),l.has(p)||l.set(p,[]),void(null==(s=l.get(p))||s.push(t));u(h,p),u(d,f);let m=a.get(p);m||(m=new Map,a.set(p,m));let g=m.get(f);g||(g=[],m.set(f,g)),g.push(t)}),!h.length&&!d.length)return W(["trellis: no series carries the row/column facet keys; nothing to split"]);"number"==typeof e.limit&&e.limit>0&&i.push("trellis: `limit` is not applied to a 2-D grid; ignoring it");const p=F(h.length?h:[""],e.order),f=F(d.length?d:[""],e.order),m=N(t,i),{align:g,seriesNames:y}=O(m,i,s),x=[];return p.forEach(t=>{f.forEach(e=>{var i;const s=((null==(i=a.get(t))?void 0:i.get(e))||[]).concat(l.get(t)||[]).concat(o.get(e)||[]).concat(c).map(g);x.push({key:[t,e].filter(t=>""!==t).join(" / ")||"all",rowKey:t,colKey:e,series:s,seriesNames:s.map(t=>t.name),empty:0===s.length})})}),{mode:"2d",panels:x,rowKeys:p,colKeys:f,seriesNames:y,xForm:m.sawKeyed?m.xForm:"plain",unionX:m.sawKeyed?m.unionX:Array.from({length:m.plainMaxLen},(t,e)=>e),xIsNumeric:m.xIsNumeric,dropped:0,warnings:i}}(n,e,s,r);const l=e.by||"facet",o=new Map,c=[];if(n.forEach((t,e)=>{const i=L(t,e,l);if(null===i)c.push(t);else{o.has(i)||o.set(i,[]);const e=o.get(i);e&&e.push(t)}}),0===o.size)return W(["trellis: no series carries the facet key; nothing to split"]);let h=F(Array.from(o.keys()),e.order),d=0;"number"==typeof e.limit&&e.limit>0&&h.length>e.limit&&(d=h.length-e.limit,h=h.slice(0,e.limit));const u=N(h.reduce((t,e)=>t.concat(o.get(e)||[]),[]).concat(c),s),{align:p,seriesNames:f}=O(u,s,r);return{mode:"1d",panels:h.map(t=>{const e=(o.get(t)||[]).map(p),i=c.map(p),s=e.concat(i);return{key:t,rowKey:null,colKey:null,series:s,seriesNames:s.map(t=>t.name),empty:0===s.length}}),rowKeys:null,colKeys:null,seriesNames:f,xForm:u.sawKeyed?u.xForm:"plain",unionX:u.sawKeyed?u.unionX:Array.from({length:u.plainMaxLen},(t,e)=>e),xIsNumeric:u.xIsNumeric,dropped:d,warnings:s}}function W(t){return{mode:"1d",panels:[],rowKeys:null,colKeys:null,seriesNames:[],xForm:"plain",unionX:[],xIsNumeric:!1,dropped:0,warnings:t}}function T(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 B(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 a=n-s;let l,o;if("number"==typeof e.binWidth&&e.binWidth>0)l=e.binWidth,o="binWidth";else if("number"==typeof e.bins&&e.bins>=1)l=a/Math.floor(e.bins),o="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=T(t,.75)-T(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=T(t,.75)-T(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,a,"string"==typeof e.bins?e.bins:"auto");l=t.width,o=t.rule}(!Number.isFinite(l)||l<=0)&&(l=a);let c=Math.ceil(a/l);(!Number.isFinite(c)||c<1)&&(c=1);let h=!1;c>1e3&&(c=1e3,h=!0),l=a/c;const d=new Array(c+1);for(let t=0;t<=c;t++)d[t]=s+t*l;return d[c]=Math.max(d[c],n),{edges:d,binWidth:l,rule:o,capped:h}}function z(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 I(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=T(i,.75)-T(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)),a=i[0]-2*n,l=(i[s-1]+2*n-a)/(r-1),o=1/(s*n*Math.sqrt(2*Math.PI)),c=[];for(let t=0;t<r;t++){const e=a+t*l;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*o])}return{density:c,bandwidth:n}}const R=["heatmap","pie","donut","polarArea","radialBar"],j=["pie","donut","polarArea"];function K(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=Number(n);null!=n&&isFinite(r)&&e.push(r)}return e}function X(t,e,i,s){var n,r,a,l,o,c;const h={plotOptions:null,yExtentOverride:null,skipYaxisPush:R.includes(s),forceSharedY:!1,pieScaleOf:null,warnings:[]},d=t.panels,u=(null==i?void 0:i.plotOptions)||{};if("histogram"===s){const t=u.histogram||{};let i=[];const s=d.map(t=>t.series.map(t=>{const e=K(t.data);return i=i.concat(e),e})),r=B(i,{bins:t.bins,binWidth:t.binWidth,range:t.range});if(r&&r.edges.length>1){const i=r.edges;h.plotOptions={histogram:{range:[i[0],i[i.length-1]],binWidth:r.binWidth}};let a=0;s.forEach(e=>e.forEach(e=>{e.length&&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}(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=z(t[s],e);n>=0&&i[n]++}return i}(e,i),{normalize:t.normalize,cumulative:t.cumulative,binWidth:r.binWidth}).forEach(t=>{isFinite(t)&&t>a&&(a=t)})})),a>0&&(h.yExtentOverride={min:0,max:a});const l=(null==(n=e.scales)?void 0:n.y)||"shared";"independent-row"!==l&&"independent-column"!==l||(h.forceSharedY=!0,h.warnings.push("histogram trellis: group y scales would re-derive counts per group; using scales.y 'shared' (use 'independent' for per-panel count scales)."))}}if("violin"===s){const t=(null==(r=u.violin)?void 0:r.kde)||{};if(!("number"==typeof t.bandwidth&&t.bandwidth>0)){let t=[];d.forEach(e=>e.series.forEach(e=>{t=t.concat(function(t){const e=[];return Array.isArray(t)?(t.forEach(t=>{const i=t&&"object"==typeof t?t.y:null;Array.isArray(i)&&i.forEach(t=>{const i=Number(t);null!=t&&isFinite(i)&&e.push(i)})}),e):e}(e.data))}));const e=t.length?I(t,{resolution:8}):null;e&&isFinite(e.bandwidth)&&e.bandwidth>0&&(h.plotOptions={violin:{kde:{bandwidth:e.bandwidth}}})}}if("heatmap"===s){"independent"===(null==(a=e.scales)?void 0:a.color)&&h.warnings.push("a heatmap trellis must share its color scale (the same color meaning different values per panel is a silent lie); ignoring scales.color 'independent'.");const t=null==(o=null==(l=u.heatmap)?void 0:l.colorScale)?void 0:o.ranges;if(!(Array.isArray(t)&&t.length>0)){let t=1/0,e=-1/0;d.forEach(i=>i.series.forEach(i=>{K(i.data).forEach(i=>{i<t&&(t=i),i>e&&(e=i)})})),isFinite(t)&&isFinite(e)&&(h.plotOptions={heatmap:{colorScale:{min:t,max:e}}})}}if("bubble"===s){"independent"===(null==(c=e.scales)?void 0:c.size)&&h.warnings.push("a bubble trellis must share its size scale; ignoring scales.size 'independent'.");let t=1/0,i=-1/0;d.forEach(e=>e.series.forEach(e=>{(function(t){const e=[];return Array.isArray(t)?(t.forEach(t=>{let i=null;Array.isArray(t)&&t.length>2?i=t[2]:t&&"object"==typeof t&&(i=t.z);const s=Number(i);null!=i&&isFinite(s)&&e.push(s)}),e):e})(e.data).forEach(e=>{e<t&&(t=e),e>i&&(i=e)})})),isFinite(t)&&isFinite(i)&&(h.plotOptions={bubble:{minZ:t,maxZ:i}})}if(j.includes(s)&&e.radiusByTotal){const t=new Map;let e=0;d.forEach(i=>{let s=0;i.series.forEach(t=>{K(t.data).forEach(t=>{s+=Math.abs(t)})}),t.set(i.key,s),s>e&&(e=s)}),e>0&&(h.pieScaleOf=i=>{const s=t.get(i);return"number"!=typeof s||s<=0?null:Math.sqrt(s/e)})}return h}const D=globalThis.ApexCharts.__internals.__apex_ThemePalettes_getThemePalettes;function q(t,e,i=3){if(!isFinite(t)||!isFinite(e))return{min:0,max:1,tickAmount:1};if(t===e){const i=0===t?1:.1*Math.abs(t);t-=i,e+=i}const s=Math.max(1,i),n=(e-t)/s,r=Math.pow(10,Math.floor(Math.log10(n)));let a={dist:1/0,ticks:0,min:0,max:1};return(r>=10?[1,2,2.5,5,10]:[1,2,5,10]).forEach(i=>{const n=i*r,l=Math.floor(t/n)*n,o=Math.ceil(e/n)*n,c=Math.max(1,Math.round((o-l)/n)),h=Math.abs(c-s);(h<a.dist||h===a.dist&&c<a.ticks)&&(a={dist:h,ticks:c,min:l,max:o})}),{min:a.min,max:a.max,tickAmount:a.ticks}}function Y(t,e,i){if(null==t)return;let s=t;if("paired"===e?s=t[1]:"object"===e&&(s=t.y),null==s)return;if(Array.isArray(s)){for(let t=0;t<s.length;t++){const e=Number(s[t]);isFinite(e)&&(e<i.min&&(i.min=e),e>i.max&&(i.max=e))}return}const n=Number(s);isFinite(n)&&(n<i.min&&(i.min=n),n>i.max&&(i.max=n))}function G(t,e,i){const s=e&&"object"==typeof e&&!Array.isArray(e)&&"highlight"in e?e.highlight:Array.isArray(t.highlightData)?t.highlightData[i]:null;return"number"==typeof s&&isFinite(s)?s:null}function V(t){if("number"!=typeof t||!isFinite(t)||t%1==0)return 0;const e=String(t);return-1!==e.indexOf("e")||-1!==e.indexOf("E")?4:Math.min(4,(e.split(".")[1]||"").length)}function U(t,e,i={}){const s={min:1/0,max:-1/0},n=t=>{isFinite(t)&&(t<s.min&&(s.min=t),t>s.max&&(s.max=t))};return t.forEach(t=>{const r=new Map;t.series.forEach(t=>{var n;if(!Array.isArray(t.data))return;if(!function(t,e){if(!e.stackOnlyBar)return!0;const i=t&&t.type;return null==i||"bar"===i||"column"===i}(t,i))return void t.data.forEach(t=>Y(t,e,s));const a=String(null!=(n=t.group)?n:""),l=t=>{const e=r.get(t)||{pos:[],neg:[]};return r.set(t,e),e},o=l(a),c=i.parts?l("~"+a):null;t.data.forEach((i,s)=>{[o,c].forEach((n,r)=>{if(!n)return;void 0===n.pos[s]&&(n.pos[s]=0,n.neg[s]=0);const a=r?G(t,i,s):(t=>{if(null==t)return null;const i="paired"===e?t[1]:"object"===e?t.y:t;if(null==i||Array.isArray(i))return null;const s=Number(i);return isFinite(s)?s:null})(i);null!==a&&(a>0?n.pos[s]+=a:n.neg[s]+=a)})})}),r.forEach(t=>{t.pos.forEach(n),t.neg.forEach(n)})}),isFinite(s.min)&&isFinite(s.max)?s:null}function Z(t,e={},i={}){const s=e.scales||{},n=s.x||"shared",r=s.y||"shared";let a=null;if("shared"===n&&t.xIsNumeric&&t.unionX.length){const e=t.unionX;a={min:e[0],max:e[e.length-1]}}const l=["bar","column","histogram"].includes(i.chartType||""),o=t=>t?(l&&t.min>0&&(t.min=0),q(t.min,t.max,e.targetTicks||3)):null,c=!!i.stacked&&"100%"===i.stackType,h=!!i.stacked&&!c,d=e=>c?{min:0,max:100}:h?U(e,t.xForm,{stackOnlyBar:i.stackOnlyBar,parts:i.parts}):function(t,e,i=!1){const s={min:1/0,max:-1/0};return t.forEach(t=>t.series.forEach(t=>{Array.isArray(t.data)&&t.data.forEach((n,r)=>{Y(n,e,s);const a=i?G(t,n,r):null;null!==a&&Y(a,"plain",s)})})),isFinite(s.min)&&isFinite(s.max)?s:null}(e,t.xForm,i.parts);let u=null;"shared"===r&&(u=o(i.yExtentOverride||d(t.panels)));let p=null;if("independent-row"===r){p=new Map;const e=new Map;t.panels.forEach(t=>{var i;const s=null!=(i=t.rowKey)?i:"";e.has(s)||e.set(s,[]),e.get(s).push(t)}),e.forEach((t,e)=>{const i=o(d(t));i&&(null==p||p.set(e,i))})}let f=null;if("independent-column"===r){f=new Map;const e=new Map;t.panels.forEach(t=>{var i;const s=null!=(i=t.colKey)?i:"";e.has(s)||e.set(s,[]),e.get(s).push(t)}),e.forEach((t,e)=>{const i=o(d(t));i&&(null==f||f.set(e,i))})}const m=D().palette1,g=Array.isArray(i.userColors)?i.userColors.filter(t=>"string"==typeof t):[],y=g.length?g:m,x=t.seriesNames;return{x:a,y:u,rowY:p,colY:f,colorOf:t=>{const e=x.indexOf(t);return y[(-1===e?0:e)%y.length]},palette:y}}function J({panelCount:t,containerWidth:e,cfg:i,hostHeight:s,chromeHeight:n}){var r,a;const l=null!=(r=i.gap)?r:12,o=function(t,e,i={}){var s,n;const r=null!=(s=i.gap)?s:12;if("number"==typeof i.columns&&i.columns>0)return Math.max(1,Math.min(Math.floor(i.columns),e));const a=null!=(n=i.minPanelWidth)?n:220,l=Math.floor((t+r)/(a+r));return Math.max(1,Math.min(l,e))}(e,t,i),c=Math.max(1,Math.ceil(t/o)),h=i.header&&!1===i.header.show?0:22,d=Math.max(0,n||0),u=c*h+l*(c-1)+d,p="number"==typeof s&&s>0?s:0,f=Math.max(0,(e-l*(o-1))/o);let m;m="number"==typeof i.panelHeight&&i.panelHeight>0?i.panelHeight:p>0?(p-u)/c:f/(null!=(a=i.aspectRatio)?a:1.6);const g="number"==typeof i.minPanelHeight&&i.minPanelHeight>0?i.minPanelHeight:80;m=Math.max(g,Math.round(m));const y=c*(m+h)+l*(c-1),x=p>0?Math.max(0,y+d-p):0,v=i.axes&&i.axes.labels||"edges",b=i.scales||{},_=1===o,w=Array.from({length:t},(e,i)=>{const s=Math.floor(i/o),n=i%o;let r,a;return"none"===v?(r=!1,a=!1):"all"===v||_?(r=!0,a=!0):(r="independent"===b.x||s===function(t,e,i,s){return t<e-(s-1)*i?s-1:s-2}(n,t,o,c),a="independent"===b.y||"independent-column"===b.y||0===n),{i:i,r:s,c:n,showXLabels:r,showYLabels:a}});return{cols:o,rows:c,panelW:f,panelH:m,headerH:h,gap:l,cells:w,gridH:y,overflowH:x}}const Q=globalThis.ApexCharts.__internals.__apex_Series,tt=["#cf4d3f","#8f9499","#26a75b"],et=(t,e,i)=>t+(e-t)*i;function it(t){return Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")}function st(t,e,i){const s=u.parseHex(nt(t)),n=u.parseHex(nt(e));return s&&n?"#"+it(et(s[0],n[0],i))+it(et(s[1],n[1],i))+it(et(s[2],n[2],i)):t}function nt(t){return"string"!=typeof t?"#000000":u.isColorHex(t)?t:u.rgb2hex(t)||"#000000"}function rt(t,e,i,s){var n,r,a;if(!e||"object"!=typeof e)return null;const l=null==(a=null==(r=null==(n=t.config.plotOptions)?void 0:n.treemap)?void 0:r.colorScale)?void 0:a.colorValue;let o;if(o="function"==typeof l?l(e,{seriesIndex:i,dataPointIndex:s,w:t}):"string"==typeof l?e[l]:e.colorValue,null==o)return null;const c=Number(o);return Number.isFinite(c)?c:null}function at(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 a=t.config.series||[];let l=1/0,o=-1/0,c=!1;for(let e=0;e<a.length;e++){const i=a[e]&&a[e].data;if(Array.isArray(i))for(let s=0;s<i.length;s++){const n=rt(t,i[s],e,s);null!=n&&(c=!0,n<l&&(l=n),n>o&&(o=n))}}if(!c&&!0!==r.enabled)return null;Number.isFinite(l)||(l=0,o=0);let h=Number.isFinite(Number(r.min))?Number(r.min):l,d=Number.isFinite(Number(r.max))?Number(r.max):o,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 p=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:nt(t.color)})).sort((t,e)=>t.value-e.value);const n=(Array.isArray(t.colors)&&t.colors.length>=2?t.colors:tt).map(nt),r=n.length;if(null!=s&&r>=3){const t=Math.floor((r-1)/2),a=[];for(let i=0;i<=t;i++)a.push({value:et(e,s,i/t),color:n[i]});for(let e=t+1;e<r;e++)a.push({value:et(s,i,(e-t)/(r-1-t)),color:n[e]});return a}return n.map((t,s)=>({value:et(e,i,s/(r-1)),color:t}))}(r,h,d,u);if(p.length<2)return null;const f=d-h,m=p.map(t=>({percent:0===f?0:(t.value-h)/f,color:t.color}));return{min:h,max:d,midpoint:u,stops:p,at:t=>{if(!Number.isFinite(t))return p[Math.floor(p.length/2)].color;if(t<=p[0].value)return p[0].color;const e=p[p.length-1];if(t>=e.value)return e.color;for(let e=1;e<p.length;e++){const i=p[e];if(t<=i.value){const s=p[e-1],n=i.value-s.value,r=0===n?0:(t-s.value)/n;return st(s.color,i.color,r)}}return e.color},legendStops:m}}const lt=globalThis.ApexCharts.__internals.__apex_tooltip_Utils,ot="http://www.w3.org/2000/svg";class ct{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 a=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.type;return a&&(null==(r=null==(n=null==(s=null==t?void 0:t.config)?void 0:s.plotOptions)?void 0:n[a])?void 0:r.colorScale)||null}static configFor(t){const e=ct.colorScaleOf(t);return e&&e.gradientLegend||null}_cfg(){return ct.configFor(this.w)||{}}static isEnabled(t){if(!ct.supports(t))return!1;const e=ct.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,a,l,o;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,p="left"===u||"right"===u,m=null!=(i=null==(e=d.arrow)?void 0:e.size)?i:8,g=m+4,y=d.showLabels?28:4,x=d.showLabels?20:4,v=d.showLabels?44:0,b=this._resolveStripLength(p?d.height:d.width,p),_=d.thickness,w=p?Math.max(_+g+4,v):b+2*y,A=p?b+2*x:_+g+4,E=(w-(_+g))/2,M=p?"left"===u?E:E+g:y,S=p?x:"top"===u?g:4,C=f.createElementNS(ot,"svg");C.setAttribute("class","apexcharts-heatmap-gradient-legend apexcharts-gradient-legend"),C.setAttribute("width",String(w)),C.setAttribute("height",String(A)),C.setAttribute("overflow","visible");const k=f.createElementNS(ot,"defs"),L=`apexcharts-heatmap-gradient-${c.globals.cuid}`,F=f.createElementNS(ot,"linearGradient");F.setAttribute("id",L),p?(F.setAttribute("x1","0"),F.setAttribute("y1","1"),F.setAttribute("x2","0"),F.setAttribute("y2","0")):(F.setAttribute("x1","0"),F.setAttribute("y1","0"),F.setAttribute("x2","1"),F.setAttribute("y2","0"));const{min:N,max:H,stops:O,bands:P}=this._computeStops();this._min=N,this._max=H,O.forEach(t=>{const e=f.createElementNS(ot,"stop");e.setAttribute("offset",`${(100*t.percent).toFixed(2)}%`),e.setAttribute("stop-color",t.color),F.appendChild(e)}),k.appendChild(F),C.appendChild(k);const $=f.createElementNS(ot,"rect");if($.setAttribute("x",String(M)),$.setAttribute("y",String(S)),$.setAttribute("width",String(p?_:b)),$.setAttribute("height",String(p?b:_)),$.setAttribute("rx","2"),$.setAttribute("fill",`url(#${L})`),C.appendChild($),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,a=this._getFormatter(),l=(s,n,r,a)=>{const l=f.createElementNS(ot,"text");return l.setAttribute("x",String(n)),l.setAttribute("y",String(r)),l.setAttribute("text-anchor",a),l.setAttribute("dominant-baseline","middle"),l.setAttribute("fill",t),l.setAttribute("font-size",e),i&&l.setAttribute("font-family",i),l.textContent=String(s),l};if(p){const t=M+_/2;C.appendChild(l(a(N),t,S+b+10,"middle")),C.appendChild(l(a(H),t,S-10,"middle"))}else{const t=S+_/2;C.appendChild(l(a(N),M-6,t,"end")),C.appendChild(l(a(H),M+b+6,t,"start"))}}const W=(null==(a=d.arrow)?void 0:a.color)||c.config.chart.foreColor,T=this._buildArrow(m,W,u);if(C.appendChild(T),this.arrowEl=T,this._bandHitEls=[],c.config.legend.onItemHover.highlightDataSeries&&P.length>0&&P.forEach(t=>{const e=f.createElementNS(ot,"rect");if(p){const i=S+b-t.p2*b,s=S+b-t.p1*b;e.setAttribute("x",String(M)),e.setAttribute("y",String(i)),e.setAttribute("width",String(_)),e.setAttribute("height",String(Math.max(0,s-i)))}else e.setAttribute("x",String(M+t.p1*b)),e.setAttribute("y",String(S)),e.setAttribute("width",String(Math.max(0,(t.p2-t.p1)*b))),e.setAttribute("height",String(_));e.setAttribute("fill","transparent"),e.setAttribute("class","apexcharts-heatmap-gradient-band"),e.setAttribute("data:range-index",String(t.index)),e.style.cursor="pointer",C.appendChild(e),this._bandHitEls.push(e)}),this._geom={isVertical:p,position:u,stripX:M,stripY:S,stripLength:b,stripThickness:_,arrowSize:m,svgWidth:w,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==(l=d.labelStyle)?void 0:l.fontSize)||"11px",t.style.fontFamily=(null==(o=d.labelStyle)?void 0:o.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(C),this.hoverValueEl&&h.appendChild(this.hoverValueEl),this.svgEl=C,t?(h.style.width=w+"px",h.style.height=A+"px",h.style.position="relative",h.style.overflow="visible"):this._applyWrapAlignment(h,u,p,w,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,a=this._cfg().align||"center",l=12,o=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"===a?l:"end"===a?l+Math.max(0,i):l+Math.max(0,i)/2,t.style.top=r+d+"px",t.style.left="left"===e?l+h+"px":o-s-l+h+"px"}else{const i=o-s-24;let r;r="start"===a?l:"end"===a?l+Math.max(0,i):l+Math.max(0,i)/2,t.style.left=r+h+"px",t.style.top="top"===e?l+d+"px":c-n-l+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:a,svgWidth:l,svgHeight:o,stripX:c,stripY:h,stripThickness:d}=this._geom,u=this._cfg().align||"center",m=i.config.legend.offsetX||0,g=i.config.legend.offsetY||0,y=null==(e=null==(t=this.ctx)?void 0:t.dimensions)?void 0:e.dimHelpers,x=y?y.getTitleSubtitleCoords("title").height+y.getTitleSubtitleCoords("subtitle").height:0,v=i.layout.xAxisHeight||0,b=(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+b(s.gridHeight,o)+g+"px";const t=(("left"===a?0:s.translateX+s.gridWidth)+("left"===a?s.translateX:s.svgWidth))/2;n.style.left=t-c-d/2+m+"px"}else{n.style.left=s.translateX+b(s.gridWidth,l)+m+"px";const t=(("top"===a?x:s.translateY+s.gridHeight+v)+("top"===a?s.translateY:s.svgHeight))/2;n.style.top=t-h-d/2+g+"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=lt.plotRect(t);if(!(s.width&&s.height&&n.width&&n.height))return;const r=n.left,a=n.left+n.width,l=n.top,o=n.top+n.height,c=n.zoom,{isVertical:h,position:d}=this._geom;if(h){const t=("left"===d?r-s.right:s.left-a)/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?l-s.bottom:s.top-o)/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,a;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==(a=(r=this.ctx.events).removeEventListener)||a.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,a=t.currentTarget,l=parseInt(null!=(e=a.getAttribute("data:range-index"))?e:"-1",10);l<0||l===this._activeBandIndex||(this._activeBandIndex=l,null==(n=null==(s=null==(i=this.ctx)?void 0:i.events)?void 0:s.fireEvent)||n.call(s,"legendHover",[this.ctx,l,r]),new Q(r).highlightRangeInSeries(l,"highlight"))}_onBandLeave(){if(this._activeBandIndex<0)return;const t=this._activeBandIndex;this._activeBandIndex=-1,new Q(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 a=r.seriesIndex,l=r.dataPointIndex;if("number"!=typeof a||"number"!=typeof l)return;if(!ct.supports(n))return;let o;o=this._continuous?function(t,e,i){const s=t.config.series[e];return rt(t,s&&Array.isArray(s.data)?s.data[i]:null,e,i)}(n,a,l):null==(s=null==(i=null==(e=n.seriesData)?void 0:e.series)?void 0:i[a])?void 0:s[l],null==o||Number.isNaN(o)||this._positionArrow(o)}_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:a,arrowSize:l}=this._geom,o=this._min,c=this._max-o;let h;if(h=0===c?.5:(t-o)/c,h<0&&(h=0),h>1&&(h=1),e){const t=n+r-h*r;let e,o;"left"===i?(e=s+a,o=e+l):(e=s,o=e-l);const c=[`${e},${t}`,`${o},${t-l/2}`,`${o},${t+l/2}`].join(" ");this.arrowEl.setAttribute("points",c)}else{const t=s+h*r;let e,o;"top"===i?(e=n+a,o=e+l):(e=n,o=e-l);const c=[`${t},${e}`,`${t-l/2},${o}`,`${t+l/2},${o}`].join(" ");this.arrowEl.setAttribute("points",c)}if(this.arrowEl.setAttribute("opacity","1"),this.hoverValueEl){const o=this._getFormatter();if(this.hoverValueEl.textContent=o(t),e){const t=n+r-h*r;"left"===i?this.hoverValueEl.style.left=`${s+a+l+8}px`:(this.hoverValueEl.style.left=s-l-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+a+l+8}px`:n-l-18+"px"}this.hoverValueEl.style.opacity="1"}}_buildArrow(t,e,i){const s=f.createElementNS(ot,"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=ct.colorScaleOf(i)||{},n=this._cfg(),r=at(i);if(r)return this._continuous=!0,{min:r.min,max:r.max,stops:r.legendStops,bands:[]};this._continuous=!1;let a=1/0,l=-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<a&&(a=i),i>l&&(l=i))}}Number.isFinite(a)||(a=0),Number.isFinite(l)||(l=0);let d=a,p=l;void 0!==s.min&&void 0!==s.max&&s.max>s.min?(d=s.min,p=s.max):(void 0!==s.min&&(d=s.min<a?s.min:a),void 0!==s.max&&(p=s.max>l?s.max:l));const f=[],m=[];if(s.ranges&&s.ranges.length>0){const t=s.ranges.map((t,e)=>c(o({},t),{_originalIndex:e})).sort((t,e)=>t.from-e.from),e=t[0].from,i=t[t.length-1].to;d=e,p=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",s=new u,r=i.config.plotOptions[i.config.chart.type]||{},a=null!=(e=r.shadeIntensity)?e:.5,l=i.globals.hasNegs,o=Math.max(2,n.stops||16);for(let e=0;e<o;e++){const n=e/(o-1),c=d+n*(p-d),h=Math.abs(p)+Math.abs(d),u=0===h?0:100*c/h;let m;m=l?r.reverseNegativeShade?u<0?u/100*(1.25*a):1.25*a*(1-u/100):u<=0?1-(1+u/100)*a:(1-u/100)*a:1-u/100,m>1&&(m=1),m<-1&&(m=-1);const g=r.enableShades?s.shadeColor("dark"===i.config.theme.mode?-1*m:m,t):t;f.push({percent:n,color:g})}}return{min:d,max:p,stops:f,bands:m}}}const ht={zoom:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><circle cx="10.5" cy="10.5" r="6"/><path d="M15 15l5 5"/><path d="M8 10.5h5M10.5 8v5"/></svg>',pan:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M12 3v18M3 12h18"/><path d="M9 6l3-3 3 3M9 18l3 3 3-3M6 9l-3 3 3 3M18 9l3 3-3 3"/></svg>',reset:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M4 10a8 8 0 1 1 2 6"/><path d="M4 4v6h6"/></svg>',download:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M12 4v11"/><path d="M7 11l5 5 5-5"/><path d="M4 20h16"/></svg>'};class dt{constructor(t){this.trellis=t,this.elLegend=null,this.elToolbar=null,this.elTitle=null,this.elBreadcrumb=null,this.gradientLegend=null,this._gradPending=null}buildHeader(t,e,i){const s=this.trellis,n=s.cfg.header||{};if(!1===n.show)return;const r=f.createElement("div");r.className="apexcharts-trellis-header";let a=e;"function"==typeof n.formatter&&(a=n.formatter(e,{dimension:"string"==typeof s.cfg.by?s.cfg.by:void 0,index:i.index,count:i.count})),r.textContent=null==a?"":String(a);const l=n.style||{};if(l.fontSize&&(r.style.fontSize=l.fontSize),l.fontWeight&&(r.style.fontWeight=String(l.fontWeight)),l.color&&(r.style.color=l.color),!1!==s.cfg.promote){r.classList.add("apexcharts-trellis-header-clickable"),r.setAttribute("role","button"),r.setAttribute("tabindex","0"),r.setAttribute("title","Expand this panel");const t=()=>{s._promotedKey===e?s.restorePromotion():s.promote(e)};r.addEventListener("click",t),r.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t())})}t.appendChild(r)}stripEl(t,e,i){const s=this.trellis.cfg.header||{},n=f.createElement("div");n.className=`apexcharts-trellis-strip apexcharts-trellis-strip-${t}`;let r=e;"function"==typeof s.formatter&&(r=s.formatter(e,{dimension:t,index:i.index,count:i.count})),n.textContent=null==r?"":String(r);const a=s.style||{};return a.fontSize&&(n.style.fontSize=a.fontSize),a.fontWeight&&(n.style.fontWeight=String(a.fontWeight)),a.color&&(n.style.color=a.color),n}buildBreadcrumb(t,e,i){this.removeBreadcrumb();const s=f.createElement("div");s.className="apexcharts-trellis-breadcrumb";const n=f.createElement("button");n.setAttribute("type","button"),n.className="apexcharts-trellis-breadcrumb-back",n.textContent="All panels",n.addEventListener("click",i);const r=f.createElement("span");r.className="apexcharts-trellis-breadcrumb-sep",r.textContent="/";const a=f.createElement("span");a.className="apexcharts-trellis-breadcrumb-current",a.textContent=e,s.appendChild(n),s.appendChild(r),s.appendChild(a),t.appendChild(s),this.elBreadcrumb=s}removeBreadcrumb(){this.elBreadcrumb&&this.elBreadcrumb.parentNode&&this.elBreadcrumb.parentNode.removeChild(this.elBreadcrumb),this.elBreadcrumb=null}buildTitle(t){const e=this.trellis.w.config.title;if(!e||!e.text)return;const i=f.createElement("div");i.className="apexcharts-trellis-title",i.textContent=e.text;const s=e.style||{};s.fontSize&&(i.style.fontSize=s.fontSize),s.color&&(i.style.color=s.color),t.appendChild(i),this.elTitle=i}buildLegend(t){const e=this.trellis;if("shared"!==(e.cfg.legend||"shared"))return;if("heatmap"===e.w.config.chart.type)return void this.buildGradientLegend(t);const i=e.split?e.split.seriesNames:[];if(i.length<2)return;const s=f.createElement("div");s.className="apexcharts-trellis-legend apexcharts-legend",s.setAttribute("role","list"),i.forEach(t=>{const i=f.createElement("div");i.className="apexcharts-legend-series apexcharts-trellis-legend-item",i.setAttribute("role","listitem"),i.setAttribute("tabindex","0"),i.setAttribute("data:collapsed","false");const n=f.createElement("span");n.className="apexcharts-legend-marker",n.style.background=e.scales?e.scales.colorOf(t):"#008FFB";const r=f.createElement("span");r.className="apexcharts-legend-text",r.textContent=t,i.appendChild(n),i.appendChild(r);const a=()=>{const s=e.sync.toggleSeries(t);i.classList.toggle("apexcharts-inactive-legend",s),i.setAttribute("data:collapsed",String(s))};i.addEventListener("click",a),i.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),a())}),s.appendChild(i)}),t.appendChild(s),this.elLegend=s}refreshLegendColors(){const t=this.trellis,e=this.elLegend,i=t.scales;e&&i&&e.querySelectorAll(".apexcharts-trellis-legend-item").forEach(t=>{var e;const s=null==(e=t.querySelector(".apexcharts-legend-text"))?void 0:e.textContent,n=t.querySelector(".apexcharts-legend-marker");s&&n&&(n.style.background=i.colorOf(s))})}buildGradientLegend(t){const e=this.trellis,i=e.panels.find(t=>t.chart);if(!i){if(this._gradPending)return;const i=()=>{var s,n;this._gradPending=null,null==(n=(s=e.ctx.events).removeEventListener)||n.call(s,"panelMounted",i),this.buildGradientLegend(t)};return this._gradPending=i,void e.ctx.events.addEventListener("panelMounted",i)}const s=f.createElement("div");s.className="apexcharts-trellis-legend apexcharts-trellis-gradient-legend",t.appendChild(s),this.elLegend=s;const n=i.chart,r=new ct(n.w,n.ctx);r.draw(s),this.gradientLegend=r,e.panels.forEach(t=>{var e;if(!t.chart||t===i)return;const s=null==(e=t.chart.ctx)?void 0:e.events;(null==s?void 0:s.addEventListener)&&(s.addEventListener("dataPointMouseEnter",r._onCellEnter),s.addEventListener("dataPointMouseLeave",r._onCellLeave))})}destroyGradientLegend(){var t,e;const i=this.trellis;if(this._gradPending&&(null==(e=(t=i.ctx.events).removeEventListener)||e.call(t,"panelMounted",this._gradPending),this._gradPending=null),this.gradientLegend){try{this.gradientLegend.destroy()}catch(t){}this.gradientLegend=null}}buildToolbar(t){const e=this.trellis;if("shared"!==(e.cfg.toolbar||"shared"))return;const i=f.createElement("div");i.className="apexcharts-trellis-toolbar";const s={},n=t=>{e.panels.forEach(e=>{if(!e.chart)return;const i=e.chart.w.interact;i.zoomEnabled="zoom"===t,i.panEnabled="pan"===t,i.selectionEnabled=!1}),s.zoom.classList.toggle("apexcharts-selected","zoom"===t),s.pan.classList.toggle("apexcharts-selected","pan"===t),s.zoom.setAttribute("aria-pressed",String("zoom"===t)),s.pan.setAttribute("aria-pressed",String("pan"===t))},r=(t,e,n)=>{const r=f.createElement("button");return r.className=`apexcharts-trellis-tool apexcharts-trellis-tool-${t}`,r.setAttribute("type","button"),r.setAttribute("aria-label",e),r.setAttribute("title",e),r.innerHTML=ht[t],r.addEventListener("click",n),s[t]=r,i.appendChild(r),r};if(r("zoom","Selection zoom",()=>n("zoom")),r("pan","Pan",()=>n("pan")),r("reset","Reset zoom",()=>{e.sync.resetAll()}),e.ctx.exports){const t=f.createElement("div");t.className="apexcharts-trellis-menu",[["png","Download PNG"],["svg","Download SVG"],["csv","Download CSV"]].forEach(([i,s])=>{const n=f.createElement("button");n.setAttribute("type","button"),n.className="apexcharts-trellis-menu-item",n.textContent=s,n.addEventListener("click",()=>{t.classList.remove("apexcharts-trellis-menu-open"),e.exports.download(i)}),t.appendChild(n)}),r("download","Download",()=>{t.classList.toggle("apexcharts-trellis-menu-open")}),i.appendChild(t)}s.zoom.classList.add("apexcharts-selected"),s.zoom.setAttribute("aria-pressed","true"),s.pan.setAttribute("aria-pressed","false"),t.appendChild(i),this.elToolbar=i,t.classList.add("apexcharts-trellis-has-toolbar")}}function ut(t,e){const i=u.clone(t.w.config.yaxis);return(Array.isArray(i)?i:[i]).map(t=>u.extend(t,e))}class pt{constructor(t){this.trellis=t,this._syncing=!1,this._hidden=new Set,this.currentWindow=null}_noteWindow(t,e){const i=t&&t.xaxis;i&&null!=i.min&&null!=i.max?this.currentWindow={x:{min:i.min,max:i.max},y:this.currentWindow&&this.currentWindow.y||null,zoomed:e||!(!this.currentWindow||!this.currentWindow.zoomed)}:e&&(this.currentWindow=null)}makeZoomedHandler(t){return(e,i)=>{"function"==typeof t&&t(e,i),this._noteWindow(i,!0),this.onZoomed(i)}}makeScrolledHandler(t){return(e,i)=>{"function"==typeof t&&t(e,i),this._noteWindow(i,!1)}}onZoomed(t){const e=this.trellis;if(this._syncing)return;const i=e.cfg;if(!i||"shared"!==(i.scales.y||"shared"))return;if(!e.autoScaleYaxis)return;const s=t&&t.xaxis;if(!s||null==s.min||null==s.max)return;if(!e.split||!e.split.xIsNumeric)return;const n=function(t,e,i,s,n=!1){const r={min:1/0,max:-1/0};return t.forEach(t=>t.series.forEach(t=>{Array.isArray(t.data)&&t.data.forEach((a,l)=>{if(null==a)return;const o="paired"===e?a[0]:"object"===e?a.x:null,c=o instanceof Date?o.getTime():Number(o);if(!isFinite(c)||c<i||c>s)return;Y(a,e,r);const h=n?G(t,a,l):null;null!==h&&Y(h,"plain",r)})})),isFinite(r.min)&&isFinite(r.max)?r:null}(e.split.panels,e.split.xForm,s.min,s.max,e._stackingHost().parts);if(!n)return;const r=q(n.min,n.max,i.targetTicks||3);this.currentWindow&&(this.currentWindow.y={min:r.min,max:r.max,tickAmount:r.tickAmount}),this._syncing=!0;const a=e.panels.map(t=>t.chart?t.chart.updateOptions({yaxis:ut(t.chart,{min:r.min,max:r.max,tickAmount:r.tickAmount})},!1,!1,!1).catch(()=>{}):Promise.resolve());Promise.all(a).finally(()=>{this._syncing=!1})}resetAll(){const t=this.trellis;this.currentWindow=null;const e=t.scales&&t.scales.x?{min:t.scales.x.min,max:t.scales.x.max}:{min:void 0,max:void 0};this._syncing=!0;const i=t.panels.map(i=>{if(!i.chart)return Promise.resolve();i.chart.w.interact.zoomed=!1;const s={xaxis:e},n=t.split?t._yBoundsFor(t.split.panels[i.index]):null;return n&&(s.yaxis=ut(i.chart,{min:n.min,max:n.max,tickAmount:n.tickAmount})),i.chart.updateOptions(s,!1,!1,!1).catch(()=>{})});return Promise.all(i).finally(()=>{this._syncing=!1})}toggleSeries(t){const e=!this._hidden.has(t);return e?this._hidden.add(t):this._hidden.delete(t),this.trellis.panels.forEach(i=>{const s=i.chart;if(s&&-1!==(s.w.seriesData.seriesNames||[]).indexOf(t))try{e?s.hideSeries(t):s.showSeries(t)}catch(t){}}),e}isHidden(t){return this._hidden.has(t)}applyHiddenTo(t){if(!this._hidden.size||!t)return;const e=t.w.seriesData&&t.w.seriesData.seriesNames||[];this._hidden.forEach(i=>{if(-1!==e.indexOf(i))try{t.hideSeries(i)}catch(t){}})}wireCrosshairs(t){let e=0,i=null;const s=()=>{const t=i&&i.closest?i.closest(".apexcharts-trellis-cell"):null,e=t?t.querySelector(".apexcharts-xcrosshairs"):null,s=e&&e.classList.contains("apexcharts-active");this.trellis.panels.forEach(i=>{if(!i.cellEl||i.cellEl===t)return;const n=i.cellEl.querySelector(".apexcharts-xcrosshairs");n&&(s?(n.setAttribute("x",e.getAttribute("x")||"0"),n.setAttribute("x1",e.getAttribute("x1")||"0"),n.setAttribute("x2",e.getAttribute("x2")||"0"),n.classList.add("apexcharts-active")):n.classList.remove("apexcharts-active"))})},n=()=>{s(),e=i?requestAnimationFrame(n):0};t.addEventListener("mousemove",t=>{i=t.target,e||(e=requestAnimationFrame(n))},{passive:!0}),t.addEventListener("mouseleave",()=>{i=null,e&&(cancelAnimationFrame(e),e=0),this.trellis.panels.forEach(t=>{const e=t.cellEl&&t.cellEl.querySelector(".apexcharts-xcrosshairs");e&&e.classList.remove("apexcharts-active")})},{passive:!0})}}function ft(t,e){const i=null!=t,s=null!=e;return i||s?{min:i?t:null,max:s?e:null}:null}function mt(t,e){return"function"==typeof t&&e?t===e.addXaxisAnnotation?"xaxis":t===e.addYaxisAnnotation?"yaxis":t===e.addPointAnnotation?"point":null:null}function gt(t,e){const i=t.config.annotations?u.clone(t.config.annotations):null,s=[],n=t.globals.memory&&t.globals.memory.methodsToExec||[];for(const t of n){if(!t||"addAnnotation"!==t.label)continue;const i=mt(t.method,e);i&&s.push({kind:i,params:u.clone(t.params)})}return{static:i,dynamic:s}}function yt(t){const e=t&&t.measure;if(!e||"function"!=typeof e.getPins)return null;const i=e.getPins();return Array.isArray(i)&&i.length?{pins:i}:null}class xt{constructor(t){this.trellis=t,this.active=!1,this._io=null,this._byCell=new Map,this._dirty=new Set,this._raf=null,this._draining=!1,this._gutterFloor=0}static supported(){return"undefined"!=typeof IntersectionObserver}_rootMargin(){const t=this.trellis.layout,e=t?Math.max(0,Math.round(t.panelH+t.headerH+t.gap)):300;return`${e}px 0px ${e}px 0px`}start(){xt.supported()&&(this.active=!0,this._io=new IntersectionObserver(t=>this._onEntries(t),{root:null,rootMargin:this._rootMargin(),threshold:0}),this.trellis.panels.forEach(t=>{var e;t.wantMounted=!1,t.cellEl&&(this._byCell.set(t.cellEl,t),null==(e=this._io)||e.observe(t.cellEl))}))}refresh(){this.active&&this._io&&(this._io.disconnect(),this._io=new IntersectionObserver(t=>this._onEntries(t),{root:null,rootMargin:this._rootMargin(),threshold:0}),this._byCell.forEach((t,e)=>{var i;return null==(i=this._io)?void 0:i.observe(e)}))}_onEntries(t){if(this.active){for(const e of t){const t=this._byCell.get(e.target);t&&(t.wantMounted=e.isIntersecting,this._dirty.add(t))}this._schedule()}}_schedule(){var t;this._raf||this._draining||!this.active||(this._raf=(t=()=>{this._raf=null,this._drain()},"function"==typeof requestAnimationFrame?{kind:"raf",id:requestAnimationFrame(t)}:{kind:"timeout",id:setTimeout(()=>t(0),16)}))}_drain(){return h(this,null,function*(){if(!this._draining&&this.active){this._draining=!0;try{let t=0,e=0;for(;this.active&&this._dirty.size&&t<2&&e<6;){const i=this._dirty.values().next().value;this._dirty.delete(i);const s=!!i.wantMounted;s!==!!i.chart&&(e++,s?(t++,yield this._mount(i)):this._unmount(i))}}finally{this._draining=!1,this.active&&this._dirty.size?this._schedule():this.active&&(this.trellis.w.globals.animationEnded=!0)}}})}_liveWindow(t){const e=this.trellis.panels.find(e=>e!==t&&e.chart);if(!e||!e.chart)return null;const i=e.chart.w,s=i.config.xaxis||{},n=Array.isArray(i.config.yaxis)?i.config.yaxis[0]:i.config.yaxis;return{zoomed:!!i.interact.zoomed,x:null!=s.min||null!=s.max?{min:s.min,max:s.max}:null,y:!n||null==n.min&&null==n.max?null:{min:n.min,max:n.max,tickAmount:n.tickAmount}}}_patchYaxis(t,e){const i=Array.isArray(t.yaxis)?t.yaxis:t.yaxis?[t.yaxis]:[{}];i.forEach(t=>{Object.keys(e).forEach(i=>{"labels"===i?t.labels=o(o({},t.labels||{}),e.labels):t[i]=e[i]})}),t.yaxis=i}_mount(t){return h(this,null,function*(){var e,i,s,n,r,a,l,h;const d=this.trellis;if(!t.el||t.chart||t.noMount)return;const u=t.viewStash,p="shared"===d._yMode(),f=!p,m=d._assemblePanelOptions(t.index,{noAnimation:!!u}),g=u&&u.window;g&&g.xaxis&&(m.xaxis=c(o({},m.xaxis||{}),{min:null!=(e=g.xaxis.min)?e:void 0,max:null!=(i=g.xaxis.max)?i:void 0})),f&&g&&Array.isArray(g.yaxis)&&g.yaxis[0]&&this._patchYaxis(m,{min:null!=(s=g.yaxis[0].min)?s:void 0,max:null!=(n=g.yaxis[0].max)?n:void 0});const y=this._liveWindow(t);y&&y.x&&(m.xaxis=c(o({},m.xaxis||{}),{min:y.x.min,max:y.x.max})),y&&y.y&&p&&this._patchYaxis(m,o({min:y.y.min,max:y.y.max},null!=y.y.tickAmount?{tickAmount:y.y.tickAmount}:{}));const x=d.sync.currentWindow;x&&x.x&&(m.xaxis=c(o({},m.xaxis||{}),{min:x.x.min,max:x.x.max})),x&&x.y&&p&&this._patchYaxis(m,o({min:x.y.min,max:x.y.max},null!=x.y.tickAmount?{tickAmount:x.y.tickAmount}:{})),f&&this._gutterFloor>0&&this._patchYaxis(m,{labels:{minWidth:this._gutterFloor}}),t.el.classList.remove("apexcharts-trellis-skeleton");const v=new d._ApexCharts(t.el,m);t.chart=v;try{yield v.render()}catch(e){return t.chart=null,void t.el.classList.add("apexcharts-trellis-skeleton")}if(this.active){if(v.w.interact.zoomed=x?!!x.zoomed:y?y.zoomed:!(!u||!u.zoomed),d.sync.applyHiddenTo(v),u&&u.annotations&&Array.isArray(u.annotations.dynamic)){const t={xaxis:"addXaxisAnnotation",yaxis:"addYaxisAnnotation",point:"addPointAnnotation"},e=v;u.annotations.dynamic.forEach(i=>{const s=t[i.kind];s&&"function"==typeof e[s]&&e[s](i.params,!0)})}if(t.viewStash=null,f){const t=null==(h=null==(l=null==(a=null==(r=v.w)?void 0:r.globals)?void 0:a.yLabelsCoords)?void 0:l[0])?void 0:h.width;if("number"==typeof t&&isFinite(t)){const e=v.w.globals.isBarHorizontal?0:d._yLabelPad(),i=Math.max(0,t-e);i>this._gutterFloor+.5&&(this._gutterFloor=i,yield d._pushGutterFloor(this._gutterFloor))}}d._fire("panelMounted",{key:t.key,index:t.index,chart:v,remounted:!!u})}})}_unmount(t){if(t.chart){try{t.viewStash=function(t,e){var i,s;const n=t.config.xaxis||{},r=(Array.isArray(t.config.yaxis)?t.config.yaxis:t.config.yaxis?[t.config.yaxis]:[]).map(t=>ft(t&&t.min,t&&t.max)),a=r.some(t=>null!==t),l=t.config.theme,o=e&&e.drilldown;return{v:1,window:{xaxis:ft(n.min,n.max),yaxis:a?r:null},zoomed:!!t.interact.zoomed,collapsed:(t.globals.collapsedSeriesIndices||[]).slice(),ancillaryCollapsed:(t.globals.ancillaryCollapsedSeriesIndices||[]).slice(),selectedDataPoints:(c=t.interact.selectedDataPoints,Array.isArray(c)?c.map(t=>Array.isArray(t)?t.slice():t):[]),theme:l?{mode:null!=(i=l.mode)?i:null,palette:null!=(s=l.palette)?s:null}:null,locale:t.config.chart&&t.config.chart.defaultLocale||null,annotations:gt(t,e),drill:o&&o.depth>0?{path:o.path.slice()}:null,measure:yt(e)};var c}(t.chart.w,t.chart)}catch(e){t.viewStash=null}try{t.chart.destroy()}catch(t){}if(t.chart=null,t.el){t.el.classList.add("apexcharts-trellis-skeleton");const e=this.trellis.layout;e&&(t.el.style.minHeight=`${e.panelH}px`)}}}stop(){var t;this.active=!1,this._io&&(this._io.disconnect(),this._io=null),this._byCell.clear(),this._dirty.clear(),(t=this._raf)&&("raf"===t.kind?cancelAnimationFrame(t.id):clearTimeout(t.id)),this._raf=null,this._gutterFloor=0}}class vt{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)/vt.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*vt.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 bt=["bar","column","rangeBar","candlestick","boxPlot","violin"];class _t{constructor(t){this.trellis=t,this.el=null,this._raf=0,this._lastEvent=null}wire(t,e){const i=f.createElement("div");i.className="apexcharts-trellis-tooltip apexcharts-theme-light",i.setAttribute("role","status"),e.appendChild(i),this.el=i;const s=()=>{this._update(e),this._raf=this._lastEvent?requestAnimationFrame(s):0};t.addEventListener("mousemove",t=>{this._lastEvent=t,this._raf||(this._raf=requestAnimationFrame(s))},{passive:!0}),t.addEventListener("mouseleave",()=>{this._lastEvent=null,this._raf&&(cancelAnimationFrame(this._raf),this._raf=0),i.classList.remove("apexcharts-trellis-tooltip-active")},{passive:!0})}_hoverIndex(t,e,i){const s=t.w,n=s.globals.dataPoints;if(!n||n<1)return-1;const r=s.layout.gridWidth;if(!r)return-1;const a=vt.screenXToPlotPx(s,e),l=s.globals.barPadForNumericAxis||0;if(a<-l||a>r+l)return-1;const o=s.dom&&s.dom.baseEl;if(o&&o.querySelector(".apexcharts-svg")){const t=lt.plotRect(s);if(t.height&&(i<t.top||i>t.top+t.height))return-1}const c=-1===bt.indexOf(s.config.chart.type)&&"between"!==s.config.xaxis.tickPlacement||s.config.xaxis.convertedCatToNumeric?Math.round(a/(r/Math.max(1,n-1))):Math.ceil(a/(r/n))-1;return Math.max(0,Math.min(n-1,c))}_valueAt(t,e,i,s){var n,r;const a=t.series.find(t=>t.name===e);if(!a||!Array.isArray(a.data))return null;const l=a.data[s];if(null==l)return null;let o=l;if(Array.isArray(l)?o=l[1]:"object"==typeof l&&(o=l.y),null==o)return null;const c=this.trellis.w.config,h=Array.isArray(null==(n=c.tooltip)?void 0:n.y)?c.tooltip.y[i]:null==(r=c.tooltip)?void 0:r.y,d=Array.isArray(c.yaxis)?c.yaxis[0]:c.yaxis,u=h&&"function"==typeof h.formatter&&h.formatter||d&&d.labels&&"function"==typeof d.labels.formatter&&d.labels.formatter||null,p=t=>{if(u)try{return String(u(t,{seriesIndex:i,dataPointIndex:s,w:null}))}catch(e){return String(t)}return String(t)};return Array.isArray(o)?o.map(p).join(" / "):p(o)}_update(t){const e=this.trellis,i=this.el,s=this._lastEvent;if(!i||!s||!e.split)return;const n=s.target&&s.target.closest?s.target.closest(".apexcharts-trellis-cell"):null,r=n?e.panels.find(t=>t.cellEl===n):void 0,a=r&&r.chart?this._hoverIndex(r.chart,s.clientX,s.clientY):-1;if(!r||-1===a)return void i.classList.remove("apexcharts-trellis-tooltip-active");const l=n?n.querySelector(".apexcharts-tooltip-title"):null,o=l&&l.textContent?l.textContent:"",c=e.split.seriesNames,h=e.scales,d=[];e.split.panels.forEach(t=>{const e=[];c.forEach((i,s)=>{const n=this._valueAt(t,i,s,a);if(null===n)return;const r=h?h.colorOf(i):"#008FFB";e.push(`<span class="apexcharts-trellis-tooltip-val"><span class="apexcharts-trellis-tooltip-marker" style="background:${At(r)}"></span>${wt(n)}</span>`)});const i=t.key===r.key;d.push(`<div class="apexcharts-trellis-tooltip-row${i?" apexcharts-trellis-tooltip-row-active":""}" data-key="${At(t.key)}"><span class="apexcharts-trellis-tooltip-key">${wt(t.key)}</span><span class="apexcharts-trellis-tooltip-vals">${e.join("")}</span></div>`)});let u="";o&&(u+=`<div class="apexcharts-tooltip-title">${wt(o)}</div>`),u+=d.join(""),i.innerHTML=u,i.classList.add("apexcharts-trellis-tooltip-active");const p=t.getBoundingClientRect(),f=lt.plotRect(r.chart.w).zoom;let m=(s.clientX-p.left)/f+14,g=(s.clientY-p.top)/f+14;const y=i.offsetWidth,x=i.offsetHeight,v=p.width/f,b=p.height/f;m+y>v-4&&(m=Math.max(4,m-y-28)),g+x>b-4&&(g=Math.max(4,g-x-28)),i.style.left=`${Math.round(m)}px`,i.style.top=`${Math.round(g)}px`}destroy(){this._raf&&(cancelAnimationFrame(this._raf),this._raf=0),this._lastEvent=null,this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=null}}function wt(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function At(t){return String(t).replace(/"/g,"&quot;")}class Et{constructor(t){this.trellis=t}supported(){return!!this.trellis.ctx.exports}_rectIn(t){const e=this.trellis.elWrap.getBoundingClientRect(),i=t.getBoundingClientRect();return{x:i.left-e.left,y:i.top-e.top,w:i.width,h:i.height}}_size(){const t=this.trellis.elWrap.getBoundingClientRect();return{w:Math.ceil(t.width),h:Math.ceil(t.height)}}_background(){const t=this.trellis.panels.find(t=>t.chart),e=t&&t.chart.exports;if(e&&"function"==typeof e.resolveExportBackground){const t=e.resolveExportBackground();if(t&&"transparent"!==t)return t}return"#fff"}_chromeTexts(){const t=this.trellis,e=[],i=(t,i)=>{if(!t||!t.textContent)return;const s=this._rectIn(t),n=getComputedStyle(t);e.push({text:t.textContent,x:"center"===i?s.x+s.w/2:s.x,y:s.y+s.h/2,font:`${n.fontWeight} ${n.fontSize} ${n.fontFamily}`,fontSize:parseFloat(n.fontSize)||12,color:n.color||"#373d3f",align:i})};return i(t.chrome.elTitle,"left"),t.panels.forEach(t=>{t.cellEl&&i(t.cellEl.querySelector(".apexcharts-trellis-header"),"center")}),t.chrome.elLegend&&t.chrome.elLegend.querySelectorAll(".apexcharts-legend-text").forEach(t=>i(t,"left")),e}_legendMarkers(){const t=this.trellis.chrome.elLegend;return t?Array.from(t.querySelectorAll(".apexcharts-legend-marker"),t=>({rect:this._rectIn(t),color:t.style.background||t.style.backgroundColor||"#008FFB"})):[]}dataURI(){return h(this,arguments,function*(t={}){const e=this.trellis,i=t.scale||1,s=this._size(),n=document.createElement("canvas");n.width=s.w*i,n.height=s.h*i;const r=n.getContext("2d");if(!r)return{imgURI:""};const a=r;a.scale(i,i),a.fillStyle=this._background(),a.fillRect(0,0,s.w,s.h);for(const t of e.panels){if(!t.el)continue;const e=this._rectIn(t.el);if(!t.chart){a.fillStyle="rgba(120, 120, 120, 0.06)",a.fillRect(e.x,e.y,e.w,e.h);continue}const{imgURI:s}=yield t.chart.dataURI({scale:i});if(!s)continue;const n=yield Mt(s);a.drawImage(n,e.x,e.y,e.w,e.h)}for(const t of this._chromeTexts())a.font=t.font,a.fillStyle=t.color,a.textAlign=t.align,a.textBaseline="middle",a.fillText(t.text,t.x,t.y);for(const t of this._legendMarkers())a.fillStyle=t.color,a.beginPath(),a.arc(t.rect.x+t.rect.w/2,t.rect.y+t.rect.h/2,Math.max(2,t.rect.w/2),0,2*Math.PI),a.fill();return{imgURI:n.toDataURL("image/png")}})}svgString(t=1){return h(this,null,function*(){const e=this.trellis,i=this._size(),s=[];s.push(`<svg xmlns="http://www.w3.org/2000/svg" width="${i.w*t}" height="${i.h*t}" viewBox="0 0 ${i.w} ${i.h}">`),s.push(`<rect width="${i.w}" height="${i.h}" fill="${this._background()}"/>`);for(const t of e.panels){if(!t.el)continue;const e=this._rectIn(t.el);if(!t.chart){s.push(`<rect x="${e.x}" y="${e.y}" width="${e.w}" height="${e.h}" fill="rgba(120,120,120,0.06)" rx="4"/>`);continue}const i=yield t.chart.getSvgString();s.push(`<g transform="translate(${e.x}, ${e.y})">${i}</g>`)}for(const t of this._chromeTexts()){const e="center"===t.align?"middle":"start";s.push(`<text x="${t.x}" y="${t.y}" text-anchor="${e}" dominant-baseline="central" style="font:${kt(t.font)};fill:${kt(t.color)}">${Ct(t.text)}</text>`)}for(const t of this._legendMarkers())s.push(`<circle cx="${t.rect.x+t.rect.w/2}" cy="${t.rect.y+t.rect.h/2}" r="${Math.max(2,t.rect.w/2)}" fill="${kt(t.color)}"/>`);return s.push("</svg>"),s.join("")})}csv(t={}){var e,i,s;const n=this.trellis,r=n.split;if(!r)return"";const a=n.w,l=t.columnDelimiter||(null==(s=null==(i=null==(e=a.config.chart.toolbar)?void 0:e.export)?void 0:i.csv)?void 0:s.columnDelimiter)||",",o=a.config.xaxis&&"datetime"===a.config.xaxis.type,c=t=>{if(null==t)return"";const e=String(t);return/[",\n]/.test(e)||-1!==e.indexOf(l)?`"${e.replace(/"/g,'""')}"`:e},h=t=>o&&"number"==typeof t?new Date(t).toISOString():t,d=r.seriesNames,u=[["x","facet",...d].map(c).join(l)];return r.panels.forEach(t=>{r.unionX.forEach((e,i)=>{const s=[h(e),t.key];d.forEach(e=>{const n=t.series.find(t=>t.name===e);if(!n||!Array.isArray(n.data))return void s.push("");const r=n.data[i];let a=r;Array.isArray(r)?a=r[1]:r&&"object"==typeof r&&(a=r.y),s.push(Array.isArray(a)?a.join("|"):a)}),u.push(s.map(c).join(l))})}),u.join(t.lineDelimiter||"\n")}download(t){return h(this,arguments,function*(t,e={}){var i;const s=this.trellis,n=(null==(i=s.w.config.chart.toolbar)?void 0:i.export)||{},r=String(s.w.globals.chartID||"trellis");if("png"===t){const{imgURI:t}=yield this.dataURI();St(t,n.png&&n.png.filename||r,".png")}else if("svg"===t){const t=yield this.svgString();St("data:image/svg+xml;charset=utf-8,"+encodeURIComponent(t),n.svg&&n.svg.filename||r,".svg")}else St("data:text/csv;charset=utf-8,"+encodeURIComponent("\ufeff"+this.csv(e)),e.fileName||n.csv&&n.csv.filename||r,".csv")})}}function Mt(t){return new Promise((e,i)=>{const s=new Image;s.onload=()=>e(s),s.onerror=i,s.src=t})}function St(t,e,i){const s=document.createElement("a");s.href=t,s.download=e+i,document.body.appendChild(s),s.click(),document.body.removeChild(s)}function Ct(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function kt(t){return String(t).replace(/"/g,"&quot;")}const Lt=["annotations","colors","dataLabels","fill","forecastDataPoints","grid","markers","noData","states","stroke","tooltip"],Ft={treemap:"trellis does not support treemap: area encoding needs room a panel cannot give. Rendering a single chart.",sunburst:"trellis does not support sunburst: its labels are illegible at panel size. Rendering a single chart.",unit:"the unit type has its own small-multiples mode (plotOptions.unit.grid.split), which beats a trellis of unit charts. Rendering a single chart."};d.registerFeatures({trellis:class{constructor(t,e){this.w=t,this.ctx=e,this.panels=[],this._stripEls=[],this.split=null,this.scales=null,this.layout=null,this.cfg={},this.sync=new pt(this),this.chrome=new dt(this),this.virtual=new xt(this),this.exports=new Et(this),this.gridTooltip=null,this._promotedKey=null,this._ApexCharts=d,this._virtualActive=!1,this._panelRenderer=null,this._yLabelDecimals=0,this.elWrap=null,this.elGrid=null,this._mounted=!1,this._rendering=!1,this._renderPromise=null,this._raf=0,this._lastWidth=0,this._lastHeight=0,this._chromeH=0,this._overflowWarned=!1,this._resizeHandler=this._onContainerResize.bind(this),this.autoScaleYaxis=!1,this._elChromeTop=null,this._vetoWarned=!1,this._noKeyWarned=!1,this._frames=null}isActive(){var t;const e=this.w.config.trellis;if(!e||!(e.by||e.row||e.column))return!1;const i=null==(t=this.w.config.chart)?void 0:t.type;if(i&&Ft[i])return this._vetoWarned||(this._vetoWarned=!0,console.warn(`ApexCharts: ${Ft[i]}`)),!1;if(e.by&&!e.row&&!e.column&&!Array.isArray(e.data)&&!(this.w.config.series||[]).some((t,i)=>null!==L(t,i,e.by))){if(!this._noKeyWarned){this._noKeyWarned=!0;const t="function"==typeof e.by?"the `trellis.by` function returned no key for any series":`no series carries the \`trellis.by\` key '${e.by}'`;console.warn(`ApexCharts: ${t}; there is nothing to split. Rendering as a single chart.`)}return!1}return!0}_layoutCfg(){return this.split&&"2d"===this.split.mode&&this.split.colKeys?c(o({},this.cfg),{columns:this.split.colKeys.length}):this.cfg}_stackingHost(){var t,e;const i=this.w.config,s=i.chart||{},n=i.highlightFilter||{};return{stacked:!!s.stacked,stackType:s.stackType,stackOnlyBar:!!s.stackOnlyBar,parts:!!M._featureRegistry.get("highlightFilter")&&!1!==n.enabled&&"clamp"!==n.axis&&["bar","line","area"].includes(s.type)&&!(null==(e=null==(t=i.plotOptions)?void 0:t.bar)?void 0:e.isFunnel)}}_yMode(){var t;return this._frames&&this._frames.forceSharedY?"shared":(null==(t=this.cfg.scales)?void 0:t.y)||"shared"}_yBoundsFor(t){var e,i;const s=this.scales;if(!s)return null;if(this._frames&&this._frames.skipYaxisPush)return null;const n=this._yMode();return"shared"===n?s.y:"independent-row"===n&&s.rowY?s.rowY.get(null!=(e=t.rowKey)?e:"")||null:"independent-column"===n&&s.colY&&s.colY.get(null!=(i=t.colKey)?i:"")||null}_valueAxisIsX(){var t,e;const i=this.w.config;return["bar","boxPlot","violin"].includes(i.chart.type)&&!!(null==(e=null==(t=i.plotOptions)?void 0:t.bar)?void 0:e.horizontal)}_valueAxisXPatch(t){var e,i;const s={min:t.min,max:t.max};return"number"!=typeof(null==(i=null==(e=this.ctx.opts)?void 0:e.xaxis)?void 0:i.tickAmount)&&(s.tickAmount=t.tickAmount),s}_groupId(){return`${this.w.globals.chartID}-tg`}_fire(t,e){var i,s;const n=null==(s=null==(i=this.w.config.chart)?void 0:i.events)?void 0:s[t];"function"==typeof n&&n(this.ctx,e),this.ctx.events.fireEvent(t,[this.ctx,e])}render(){const t=this._render();return this._renderPromise=t,t}whenSettled(){return this._rendering&&this._renderPromise?this._renderPromise.catch(()=>{}):Promise.resolve()}_render(){return h(this,null,function*(){var t,e,i,s;const n=this.w;if(!this._mounted&&!this._rendering)if(p.isBrowser()){this._rendering=!0;try{this.cfg=n.config.trellis||{},this.autoScaleYaxis=!!(null==(e=null==(t=n.config.chart)?void 0:t.zoom)?void 0:e.autoScaleYaxis);let r=n.config.series||[];if(Array.isArray(this.cfg.data)){const t=function(t,e={}){const i=[],s=e.by;if("string"!=typeof s||!s)return{series:[],warnings:["trellis: tidy-row input (trellis.data) needs a string `by` column name"]};const n=e.x,r=e.y;if(!n||!r)return{series:[],warnings:["trellis: tidy-row input (trellis.data) needs `x` and `y` column names"]};const a=Array.isArray(t)?t:[];if(!a.length)return{series:[],warnings:["trellis: trellis.data is empty"]};const l=e.seriesBy;let o=0,c=0;const h=new Map;a.forEach(t=>{if(!t||"object"!=typeof t)return void o++;const e=t[s],i=t[n];if(null==e||null==i)return void o++;const a=l&&void 0!==t[l]&&null!==t[l]?String(t[l]):String(r);let d=h.get(String(e));d||(d=new Map,h.set(String(e),d));let u=d.get(a);u||(u=new Map,d.set(a,u));const p=i instanceof Date?i.getTime():i;u.has(p)&&c++;const f=t[r];u.set(p,void 0===f?null:f)}),o&&i.push(`trellis: ${o} row(s) missing "${s}" or "${n}" were skipped`),c&&i.push(`trellis: ${c} duplicate (panel, series, x) row(s); kept the last. Aggregate the rows first if you want sums or means.`);const d=[];return h.forEach((t,e)=>{t.forEach((t,i)=>{d.push({name:i,[s]:e,data:Array.from(t,([t,e])=>({x:t,y:e}))})})}),{series:d,warnings:i}}(this.cfg.data,this.cfg);t.warnings.forEach(t=>console.warn(`ApexCharts: ${t}`)),t.series.length&&(r.length&&console.warn("ApexCharts: trellis received both `series` and `trellis.data`; using trellis.data."),r=t.series)}const a=$(r,this.cfg,{chartType:n.config.chart.type});if(this.split=a,a.warnings.forEach(t=>console.warn(`ApexCharts: ${t}`)),!a.panels.length)return;a.dropped>0&&console.warn(`ApexCharts: trellis rendered ${a.panels.length} panels; ${a.dropped} more hidden by trellis.limit.`);const l=null!=(i=this.cfg.virtualize)?i:"auto";let h=!0===l||"auto"===l&&a.panels.length>64;h&&!xt.supported()&&(console.warn("ApexCharts: trellis virtualization needs IntersectionObserver; rendering eagerly."),h=!1),this._virtualActive=h,!h&&a.panels.length>64&&console.warn(`ApexCharts: trellis with ${a.panels.length} panels renders eagerly; set trellis.virtualize (or trellis.limit).`),a.panels.length>256&&console.warn(`ApexCharts: ${a.panels.length} trellis panels is a lot to read at once; consider trellis.limit.`);const u="histogram"===n.config.chart.requestedType?"histogram":n.config.chart.type;this._frames=X(a,this.cfg,n.config,u),this._frames.warnings.forEach(t=>console.warn(`ApexCharts: ${t}`)),this._yLabelDecimals=this._frames.yExtentOverride?0:function(t){let e=0;const i=t=>{const i=V(t);i>e&&(e=i)};return t.forEach(t=>t.series.forEach(t=>{Array.isArray(t.data)&&t.data.forEach(t=>{if(null==t)return;let e=t;Array.isArray(t)?e=t[1]:"object"==typeof t&&(e=t.y),Array.isArray(e)?e.forEach(i):i(e)})})),e}(a.panels);const p=this._yMode()!==((null==(s=this.cfg.scales)?void 0:s.y)||"shared")?c(o({},this.cfg),{scales:c(o({},this.cfg.scales||{}),{y:this._yMode()})}):this.cfg;this.scales=Z(a,p,o({chartType:n.config.chart.type,userColors:this.ctx.opts&&this.ctx.opts.colors,yExtentOverride:this._frames.yExtentOverride},this._stackingHost())),this._panelRenderer=function(t,e,i,s){if(i&&i.chart&&i.chart.renderer)return null;if(!s)return null;const n={config:{series:t.panels.reduce((t,e)=>t.concat(e.series),[]),chart:{type:e.chart.type},markers:e.markers,dataLabels:e.dataLabels,fill:e.fill,plotOptions:e.plotOptions,states:e.states}};if(_(n))return null;const r=e.chart.rendererThreshold||8e3;return b(n)>=r?"canvas":null}(a,n.config,this.ctx.opts,E._rendererRegistry.has("canvas")),this._buildSkeleton();const f=this._containerWidth();this._lastWidth=f,this._lastHeight=this._hostHeight()||0,this._chromeH=0,this.layout=J({panelCount:a.panels.length,containerWidth:f,cfg:this._layoutCfg(),hostHeight:this._hostHeight(),chromeHeight:this._chromeH}),this._applyGridStyle(),this._buildCells();const m="shared"!==this._yMode(),y=this.elWrap;if(h)this.virtual.start();else{m&&(y.style.visibility="hidden");for(let t=0;t<this.panels.length;t++){const e=this.panels[t];if(e.noMount)continue;const i=this._assemblePanelOptions(e.index),s=new d(e.el,i);e.chart=s,yield s.render(),this._fire("panelMounted",{key:e.key,index:e.index,chart:s})}m&&(yield this._alignGutters(),y.style.visibility="")}this.chrome.buildTitle(this._elChromeTop),this.chrome.buildToolbar(y),this.chrome.buildLegend(y),this.sync.wireCrosshairs(this.elGrid),"grid"===(this.cfg.tooltip||"panel")&&(this.gridTooltip=new _t(this),this.gridTooltip.wire(this.elGrid,y)),this._mounted=!0,this._refitForChrome(),g(this.ctx.el,this._resizeHandler),h||(n.globals.animationEnded=!0),this._fire("trellisMounted",{panels:this.getPanels()})}finally{this._rendering=!1}}else console.warn("ApexCharts: trellis rendering is browser-only in this version; SSR hosts render nothing.")})}_containerWidth(){const t=this.ctx.el;return t.getBoundingClientRect().width||t.clientWidth||800}_hostHeight(){var t;const e=this.w.config.chart&&this.w.config.chart.height;if(null==e||""===e||"auto"===e)return;const i=String(e).trim();if(i.endsWith("%")){const e=parseFloat(i);if(!isFinite(e)||e<=0)return;const s=null==(t=this.ctx.el)?void 0:t.parentNode;if(!s||"function"!=typeof s.getBoundingClientRect)return;const n=(s.getBoundingClientRect().height||s.clientHeight||0)*e/100;return n>0?n:void 0}const s=parseFloat(i);return isFinite(s)&&s>0?s:void 0}_chromeHeight(){const t=this.elWrap,e=this.elGrid;if(!t||!e||"function"!=typeof t.getBoundingClientRect)return 0;const i=t.getBoundingClientRect().height-e.getBoundingClientRect().height;return isFinite(i)&&i>0?i:0}_buildSkeleton(){var t;const e=this.ctx.el,i=f.createElementNS("http://www.w3.org/1999/xhtml","div");i.className="apexcharts-trellis",this.split&&"2d"===this.split.mode&&i.classList.add("apexcharts-trellis-2d"),i.id=`apexcharts-trellis${this.w.globals.chartID}`,i.setAttribute("data-tooltip-mode",this.cfg.tooltip||"panel");const s=null==(t=this.w.config.chart)?void 0:t.foreColor;s&&i.style.setProperty("--apx-trellis-fore",s);const n=f.createElement("div");n.className="apexcharts-trellis-chrome",i.appendChild(n),this._elChromeTop=n;const r=f.createElement("div");r.className="apexcharts-trellis-grid",i.appendChild(r),e.appendChild(i),this.elWrap=i,this.elGrid=r,this.w.dom.baseEl=e,this.w.dom.elWrap=i}_applyGridStyle(){var t;const e=this.elGrid,i=this.layout;e.style.display="grid";const s=this.split&&"2d"===this.split.mode&&!1!==(null==(t=this.cfg.header)?void 0:t.show);e.style.gridTemplateColumns=s?`auto repeat(${i.cols}, minmax(0, 1fr))`:`repeat(${i.cols}, minmax(0, 1fr))`,e.style.gap=`${i.gap}px`}_buildCells(){var t;const e=this.elGrid,i=this.split,s=this.layout,n="2d"===i.mode,r=n&&!1!==(null==(t=this.cfg.header)?void 0:t.show);this._stripEls=[];const a=this.cfg.emptyPanels||"placeholder";if(r){const t=f.createElement("div");t.className="apexcharts-trellis-corner",e.appendChild(t),this._stripEls.push(t),(i.colKeys||[]).forEach((t,s)=>{const n=this.chrome.stripEl("column",t,{index:s,count:(i.colKeys||[]).length});e.appendChild(n),this._stripEls.push(n)})}this.panels=[],i.panels.forEach((t,l)=>{var o;if(r&&l%s.cols===0){const t=Math.floor(l/s.cols),n=this.chrome.stripEl("row",null!=(o=(i.rowKeys||[])[t])?o:"",{index:t,count:(i.rowKeys||[]).length});e.appendChild(n),this._stripEls.push(n)}const c=f.createElement("div");c.className="apexcharts-trellis-cell",c.setAttribute("data-key",t.key),this._applyCellMutes(c,s.cells[l]),n||this.chrome.buildHeader(c,t.key,{index:l,count:i.panels.length});const h=f.createElement("div");h.className="apexcharts-trellis-panel",this._virtualActive&&(h.classList.add("apexcharts-trellis-skeleton"),h.style.minHeight=`${s.panelH}px`),c.appendChild(h);const d=t.empty&&"placeholder"!==a;if(t.empty)if(c.classList.add("apexcharts-trellis-cell-empty"),"hide"===a)c.classList.add("apexcharts-trellis-cell-hidden");else if("skip"===a)h.classList.add("apexcharts-trellis-skeleton"),h.style.minHeight=`${s.panelH}px`;else{const t=f.createElement("div");t.className="apexcharts-trellis-empty-label",t.textContent=this.w.config.noData&&this.w.config.noData.text||"no data",c.appendChild(t)}e.appendChild(c),this.panels.push({key:t.key,index:l,el:h,cellEl:c,chart:null,empty:t.empty,noMount:d})})}_applyCellMutes(t,e){t.classList.toggle("apexcharts-trellis-mute-x",!e.showXLabels),t.classList.toggle("apexcharts-trellis-mute-y",!e.showYLabels)}_assemblePanelOptions(t,{noAnimation:e=!1}={}){var i,s,n,r,a,l,h,d,p,f,m,g,y,x;const v=this.w,b=this.split,_=this.scales,w=this.layout,A=b.panels[t],E=u.clone(this.ctx.opts||{});delete E.trellis,delete E.series,delete E.responsive,E.annotations&&(E.annotations=function(t,e){if(!t||"object"!=typeof t)return t;const i=o({},t);for(const t of["yaxis","xaxis","points","texts","images"]){const s=i[t];Array.isArray(s)&&(i[t]=s.filter(t=>!t||void 0===t.scope||null===t.scope||"trellis"===t.scope||(Array.isArray(t.scope)?-1!==t.scope.map(String).indexOf(e):String(t.scope)===e)).map(t=>{if(!t||void 0===t.scope)return t;const e=o({},t);return delete e.scope,e}))}return i}(E.annotations,A.key));const M=E.chart||{},S=M.events||{},C=v.globals.chartID,k=null==(n=null==(s=null==(i=this.ctx.opts)?void 0:i.chart)?void 0:s.animations)?void 0:n.enabled,L=e||b.panels.length>16&&void 0===k,F=A.empty&&"placeholder"===(this.cfg.emptyPanels||"placeholder");let N=F?[P(b,{chartType:v.config.chart.type})]:A.series;const H=["pie","donut","polarArea","radialBar"].includes(v.config.chart.type);H&&(N=N.flatMap(t=>Array.isArray(t.data)?t.data:[]).map(t=>"number"==typeof t&&isFinite(t)?t:0));const O=o(o(c(o({chart:c(o(o({id:`${C}-tp${t}`,group:this._groupId(),height:w.panelH,width:"100%",redrawOnParentResize:!1,redrawOnWindowResize:!1,print:{enabled:!1},parentHeightOffset:0,toolbar:{show:!1},zoom:{enabled:"none"!==this.cfg.zoom}},L?{animations:{enabled:!1}}:{}),this._panelRenderer?{renderer:this._panelRenderer}:{}),{events:c(o({},S),{zoomed:this.sync.makeZoomedHandler(S.zoomed),scrolled:this.sync.makeScrolledHandler(S.scrolled)})}),series:N},H?{}:{colors:N.map(t=>_.colorOf(t.name))}),{title:{text:"",margin:0,floating:!0},subtitle:{text:"",margin:0,floating:!0},legend:{show:!1}}),F?{tooltip:{enabled:!1}}:{}),w.panelH<120&&"grid"!==this.cfg.tooltip&&"boolean"!=typeof(null==(a=null==(r=this.ctx.opts)?void 0:r.tooltip)?void 0:a.compact)?{tooltip:{compact:!0}}:{});if(!(null==(l=M.sparkline)?void 0:l.enabled)&&!["pie","donut","polarArea","radialBar","radar","treemap"].includes(v.config.chart.type)){const t=E.grid&&E.grid.padding||{},e="datetime"===(null==(d=null==(h=this.ctx.opts)?void 0:h.xaxis)?void 0:d.type)?2:7;O.grid={padding:{top:("number"==typeof t.top?t.top:0)-12,bottom:("number"==typeof t.bottom?t.bottom:0)-e}}}const $=this._valueAxisIsX();_.x&&!$&&(O.xaxis={min:_.x.min,max:_.x.max});const W=this._yBoundsFor(A);if(W){const t=Array.isArray(null==(p=this.ctx.opts)?void 0:p.yaxis)?this.ctx.opts.yaxis[0]:null==(f=this.ctx.opts)?void 0:f.yaxis,e=Array.isArray(E.yaxis)?E.yaxis[0]:E.yaxis;let i={};if("function"!=typeof(null==(m=null==t?void 0:t.labels)?void 0:m.formatter)){const t=(W.max-W.min)/Math.max(1,W.tickAmount),e=Math.max(this._yLabelDecimals,V(t));i={labels:{formatter:t=>"number"==typeof t&&isFinite(t)?t.toFixed(e):t}}}O.yaxis=u.extend(e||{},o({min:W.min,max:W.max,tickAmount:W.tickAmount},i)),delete E.yaxis,$&&(O.xaxis=u.extend(O.xaxis||{},this._valueAxisXPatch(W)))}const T=this._frames;if(T&&T.plotOptions&&(O.plotOptions=u.clone(T.plotOptions)),T&&T.pieScaleOf){const t=T.pieScaleOf(A.key);if(null!==t){const e=null==(x=null==(y=null==(g=this.ctx.opts)?void 0:g.plotOptions)?void 0:y.pie)?void 0:x.customScale;O.plotOptions=u.extend(O.plotOptions||{},{pie:{customScale:t*("number"==typeof e?e:1)}})}}let B=u.extend(E,O);if("function"==typeof this.cfg.panel){const e=this.cfg.panel(A.key,{index:t,seriesNames:A.seriesNames});e&&"object"==typeof e&&(B=u.extend(B,e))}return B}_alignGutters(){return h(this,null,function*(){var t,e,i,s;const n=this.panels.map(t=>{var e,i,s,n,r;return null==(r=null==(n=null==(s=null==(i=null==(e=t.chart)?void 0:e.w)?void 0:i.globals)?void 0:s.yLabelsCoords)?void 0:n[0])?void 0:r.width}).filter(t=>"number"==typeof t&&isFinite(t));if(!n.length)return;const r=(null==(s=null==(i=null==(e=null==(t=this.panels[0])?void 0:t.chart)?void 0:e.w)?void 0:i.globals)?void 0:s.isBarHorizontal)?0:10,a=Math.max(0,Math.max(...n)-r);yield this._pushGutterFloor(a)})}_yLabelPad(){return 10}_pushGutterFloor(t){return h(this,null,function*(){for(const e of this.panels)e.chart&&(yield e.chart.updateOptions({yaxis:ut(e.chart,{labels:{minWidth:t}})},!1,!1,!1).catch(()=>{}))})}_refitForChrome(){if(!this._hostHeight())return;const t=this._chromeHeight();t<=0||Math.round(t)===Math.round(this._chromeH)?this._warnIfOverflowing():(this._chromeH=t,this._relayout(this._containerWidth()))}_warnIfOverflowing(){const t=this.layout;t&&t.overflowH&&!this._overflowWarned&&(this._overflowWarned=!0,console.warn(`ApexCharts: trellis needs ${Math.round(t.gridH+this._chromeH)}px but its container gives ${Math.round(this._hostHeight()||0)}px; ${t.rows} rows cannot go below the ${t.panelH}px panel floor. Raise the container, use fewer panels (trellis.limit) or more columns (trellis.columns), or lower trellis.minPanelHeight.`))}_onContainerResize(){this._mounted&&(this._raf||(this._raf=requestAnimationFrame(()=>{this._raf=0;const t=this._containerWidth(),e=this._hostHeight()||0;if(Math.round(t)!==Math.round(this._lastWidth)||Math.round(e)!==Math.round(this._lastHeight)){if(this._lastWidth=t,this._lastHeight=e,this._promotedKey){const t=this.panels.find(t=>t.key===this._promotedKey);return void(t&&t.chart&&t.chart.updateOptions({},!1,!1,!1).catch(()=>{}))}this._relayout(t)}})))}promote(t){return h(this,null,function*(){var e;const i=this.panels.find(e=>e.key===String(t));if(!i||i.noMount||!this._mounted)return;if(this._promotedKey===i.key)return;this._promotedKey&&(yield this.restorePromotion()),this._promotedKey=i.key;const s=this.layout,n=this.elGrid?this.elGrid.getBoundingClientRect().height:0,r=Math.round(Math.max(280,Math.min(560,n||(s?2.4*s.panelH:420))));null==(e=this.elWrap)||e.classList.add("apexcharts-trellis-promoting"),this.panels.forEach(t=>{if(!t.cellEl)return;const e=t===i;t.cellEl.classList.toggle("apexcharts-trellis-cell-promoted",e),t.cellEl.classList.toggle("apexcharts-trellis-cell-parked",!e)}),this._stripEls.forEach(t=>t.classList.add("apexcharts-trellis-cell-parked")),this.chrome.buildBreadcrumb(this._elChromeTop,i.key,()=>this.restorePromotion()),!i.chart&&this._virtualActive&&(i.wantMounted=!0,this.virtual._dirty.add(i),this.virtual._schedule()),i.el&&(i.el.style.minHeight=`${r}px`),i.chart&&(yield i.chart.updateOptions({chart:{height:r}},!1,!1,!1).catch(()=>{})),this._fire("panelPromoted",{key:i.key,chart:i.chart})})}restorePromotion(){return h(this,null,function*(){var t;if(!this._promotedKey)return;const e=this.panels.find(t=>t.key===this._promotedKey);this._promotedKey=null,null==(t=this.elWrap)||t.classList.remove("apexcharts-trellis-promoting"),this.panels.forEach(t=>{t.cellEl&&(t.cellEl.classList.remove("apexcharts-trellis-cell-promoted"),t.cellEl.classList.remove("apexcharts-trellis-cell-parked"))}),this._stripEls.forEach(t=>t.classList.remove("apexcharts-trellis-cell-parked")),this.chrome.removeBreadcrumb();const i=this.layout;e&&e.el&&i&&(e.el.style.minHeight=`${i.panelH}px`),e&&e.chart&&i&&(yield e.chart.updateOptions({chart:{height:i.panelH}},!1,!1,!1).catch(()=>{})),this._lastWidth=0,this._relayout(this._containerWidth()),this._lastWidth=this._containerWidth(),this._fire("panelRestored",{key:e?e.key:null})})}_relayout(t){const e=this.split;if(!e)return;const i=this.layout?this.layout.panelH:0;this.layout=J({panelCount:e.panels.length,containerWidth:t,cfg:this._layoutCfg(),hostHeight:this._hostHeight(),chromeHeight:this._chromeH}),this._applyGridStyle(),this._warnIfOverflowing();const s=this.layout;this.panels.forEach((t,e)=>{if(t.cellEl&&this._applyCellMutes(t.cellEl,s.cells[e]),t.el&&this._virtualActive&&(t.el.style.minHeight=`${s.panelH}px`),!t.chart)return;const n=s.panelH!==i?{chart:{height:s.panelH}}:{};t.chart.updateOptions(n,!1,!1,!1).catch(()=>{})}),this._virtualActive&&this.virtual.refresh()}canApplyInPlace(t){if(!this._mounted||this._promotedKey)return!1;if(!t||"object"!=typeof t)return!1;const e=Object.keys(t);return!!e.length&&e.every(t=>Lt.includes(t))}applyPanelOptions(t=!0){return h(this,null,function*(){var e,i,s;const n=this.split;if(!n)return;const r=this._yMode()!==((null==(e=this.cfg.scales)?void 0:e.y)||"shared")?c(o({},this.cfg),{scales:c(o({},this.cfg.scales||{}),{y:this._yMode()})}):this.cfg;this.scales=Z(n,r,o({chartType:this.w.config.chart.type,userColors:this.ctx.opts&&this.ctx.opts.colors,yExtentOverride:this._frames?this._frames.yExtentOverride:null},this._stackingHost())),yield Promise.all(this.panels.map(e=>{if(!e.chart)return Promise.resolve();const i=this._assemblePanelOptions(e.index);return delete i.series,i.chart&&delete i.chart.height,e.chart.updateOptions(i,!1,t,!1,!1).catch(()=>{})})),null==(s=(i=this.chrome).refreshLegendColors)||s.call(i)})}updateSeries(t,e=!0){return h(this,null,function*(){var i;const s=this.w;if(Array.isArray(this.cfg.data)&&this.cfg.data.length)return console.warn("ApexCharts: this trellis renders from trellis.data; update it via updateOptions({ trellis: { data } })."),Promise.resolve();if(s.config.series=t,this.ctx.opts&&(this.ctx.opts.series=t),!this._mounted)return this.ctx.render();const n=$(t||[],this.cfg,{chartType:s.config.chart.type});if(n.panels.length!==this.panels.length||!n.panels.every((t,e)=>t.key===this.panels[e].key))return this.teardown(),this.ctx.render();this.split=n,this._frames=X(n,this.cfg,s.config,"histogram"===s.config.chart.requestedType?"histogram":s.config.chart.type);const r=this._yMode()!==((null==(i=this.cfg.scales)?void 0:i.y)||"shared")?c(o({},this.cfg),{scales:c(o({},this.cfg.scales||{}),{y:this._yMode()})}):this.cfg;this.scales=Z(n,r,o({chartType:s.config.chart.type,userColors:this.ctx.opts&&this.ctx.opts.colors,yExtentOverride:this._frames.yExtentOverride},this._stackingHost()));const a=this.scales,l=this._frames,h=["pie","donut","polarArea","radialBar"].includes(s.config.chart.type),d=this.panels.map((t,i)=>{var s,r,o;if(!t.chart)return Promise.resolve();const c={series:h?n.panels[i].series.flatMap(t=>Array.isArray(t.data)?t.data:[]).map(t=>"number"==typeof t&&isFinite(t)?t:0):n.panels[i].series},d=this._valueAxisIsX();a.x&&!d&&(c.xaxis={min:a.x.min,max:a.x.max});const p=this._yBoundsFor(n.panels[i]);if(p&&(c.yaxis=ut(t.chart,{min:p.min,max:p.max,tickAmount:p.tickAmount}),d&&(c.xaxis=u.extend(c.xaxis||{},this._valueAxisXPatch(p)))),l.plotOptions&&(c.plotOptions=u.clone(l.plotOptions)),l.pieScaleOf){const t=l.pieScaleOf(n.panels[i].key);if(null!==t){const e=null==(o=null==(r=null==(s=this.ctx.opts)?void 0:s.plotOptions)?void 0:r.pie)?void 0:o.customScale;c.plotOptions=u.extend(c.plotOptions||{},{pie:{customScale:t*("number"==typeof e?e:1)}})}}return t.chart.updateOptions(c,!1,e,!1).catch(()=>{})});return Promise.all(d)})}getPanels(){return this.panels.map(t=>({key:t.key,index:t.index,chart:t.chart,el:t.cellEl}))}getPanel(t){const e=this.panels.find(e=>e.key===String(t));return e?e.chart:null}teardown(){this.virtual.stop(),this._virtualActive=!1,this._panelRenderer=null,this._promotedKey=null,this._frames=null,this.chrome.destroyGradientLegend(),this.gridTooltip&&(this.gridTooltip.destroy(),this.gridTooltip=null),this._raf&&(cancelAnimationFrame(this._raf),this._raf=0),p.isBrowser()&&this.ctx.el&&y(this.ctx.el,this._resizeHandler),this.panels.forEach(t=>{if(t.chart)try{t.chart.destroy()}catch(t){}t.chart=null}),this.panels=[],this._stripEls=[],this.elWrap&&this.elWrap.parentNode&&this.elWrap.parentNode.removeChild(this.elWrap),this.elWrap=null,this.elGrid=null,this._mounted=!1,this.ctx._renderPromise=null}}}),t.default=d,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexTrellis={})});
5
+ !function(t){var e="undefined"!=typeof globalThis?globalThis:self,i=e.ApexCharts;if(i&&i.__internals)return t.call(e);if(i)throw new Error("ApexCharts: dist/features/trellis.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");if("function"==typeof define&&define.amd)return t.call(e);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/features/trellis.js is a script-tag add-on and needs the ApexCharts script on the page. A bundler imports the matching apexcharts/ sub-path instead.");var s={file:"dist/features/trellis.js",run:t,done:!1},n=e.__apexcharts_pending_addons__||(e.__apexcharts_pending_addons__=[]);n.push(s),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!s.done){var i=e.ApexCharts;if(i)if(i.__internals){s.done=!0;var r=n.indexOf(s);-1!==r&&n.splice(r,1);try{t.call(e),i.__drainsAddons||e.console.warn("ApexCharts: dist/features/trellis.js loaded before the ApexCharts script, which is older than 8.0 and does not pick up add-ons loaded first, so it registered only when the page finished loading. Put its tag after the ApexCharts script.")}catch(t){e.console.error("ApexCharts: dist/features/trellis.js could not register with the ApexCharts script on this page: "+(t&&t.message))}}else e.console.error("ApexCharts: dist/features/trellis.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");else e.console.warn("ApexCharts: dist/features/trellis.js is waiting for the ApexCharts script, which had not loaded when the page finished loading. It registers when an ApexCharts 8.0 or later script loads; if the page has none, add apexcharts.min.js (or apexcharts.core.min.js, or apexcharts.full.min.js).")}})}(function(){var t,e;t=this,e=function(t){"use strict";var e=Object.defineProperty,i=Object.defineProperties,s=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,l=(t,i,s)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[i]=s,o=(t,e)=>{for(var i in e||(e={}))r.call(e,i)&&l(t,i,e[i]);if(n)for(var i of n(e))a.call(e,i)&&l(t,i,e[i]);return t},c=(t,e)=>i(t,s(e)),h=(t,e,i)=>new Promise((s,n)=>{var r=t=>{try{l(i.next(t))}catch(t){n(t)}},a=t=>{try{l(i.throw(t))}catch(t){n(t)}},l=t=>t.done?s(t.value):Promise.resolve(t.value).then(r,a);l((i=i.apply(t,e)).next())});const d=globalThis.ApexCharts,u=globalThis.ApexCharts.__internals.__apex_Utils,p=globalThis.ApexCharts.__internals.__apex_Environment_Environment,f=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs,m=globalThis.ApexCharts.__internals,g=m.__apex_Resize_addResizeListener,y=m.__apex_Resize_removeResizeListener;class x{constructor(t,e){this.w=t,this.ctx=e,this.kind="svg"}beginSeries(){}present(){return null}clear(){}group(t){return this.ctx.graphics.group(t)}drawPath(t){return this.ctx.graphics.drawPath(t)}drawLine(...t){return this.ctx.graphics.drawLine(...t)}drawRect(...t){return this.ctx.graphics.drawRect(...t)}drawCircle(t,e){return this.ctx.graphics.drawCircle(t,e)}drawText(t){return this.ctx.graphics.drawText(t)}renderPaths(t){return this.ctx.graphics.renderPaths(t)}drawMarker(t,e,i={}){return this.ctx.graphics.drawMarker(t,e,i)}supports(t){return!0}hitTest(){return null}restyle(){}toBitmap(){return null}destroy(){}}const v=["none","lighten","darken"];function b(t){const e=t.config.series||[],i=t.config.chart.type,s="scatter"===i||"bubble"===i,n=t.config.markers&&t.config.markers.size,r=Array.isArray(n)?n.some(t=>t>0):(n||0)>0,a=!(!t.config.dataLabels||!t.config.dataLabels.enabled),l="heatmap"===i;let o=0,c=0;return e.forEach(t=>{const e=Array.isArray(t.data)?t.data.length:0;e>c&&(c=e),(s||r||l)&&(o+=e),a&&(o+=e)}),c>=5e4&&(o=Math.max(o,c)),o}function _(t){var e,i,s,n;const r=t.config.fill&&t.config.fill.type,a=t=>"pattern"===t||"image"===t||"gradient"===t;if(Array.isArray(r)?r.some(a):a(r))return!0;const l=null==(i=null==(e=t.config.plotOptions)?void 0:e.line)?void 0:i.colors;if(l&&l.colorAboveThreshold&&l.colorBelowThreshold)return!0;if("heatmap"===t.config.chart.type&&"rect"!==((null==(n=null==(s=t.config.plotOptions)?void 0:s.heatmap)?void 0:n.shape)||"rect"))return!0;const o=t.config.states||{},c=o.hover&&o.hover.filter&&o.hover.filter.type,h=o.active&&o.active.filter&&o.active.filter.type;return!(!c||v.includes(c))||!(!h||v.includes(h))}const w="__apexcharts_renderers__";function A(){const t=globalThis;return t[w]||(t[w]=new Map),t[w]}class E{static get _rendererRegistry(){return A()}static registerRenderer(t,e){A().set(t,e)}static unregisterRenderer(t){A().delete(t)}constructor(t,e){this.w=t,this.ctx=e,this.svg=new x(t,e),this.active=this.svg,this._activeKind="svg",this._instances={},this.w.globals.activeRenderer=this.active}_activate(t,e){this.active=e,this._activeKind=t,this.ctx.renderer=e,this.w.globals.activeRenderer=e}_desiredKind(){const t=this.w.config.chart,e=t.renderer||"svg";return p.isBrowser()?"svg"===e||_(this.w)?"svg":"canvas"===e||b(this.w)>=(t.rendererThreshold||8e3)?"canvas":"svg":"svg"}resolve(){const t=this.w.config.chart.renderer||"svg",e=this._desiredKind();if("svg"!==e){const i=A().get(e);if(i)return this._instances[e]||(this._instances[e]=i(this.w,this.ctx)),this._activate(e,this._instances[e]),this._activeKind;t!==e||this._warned||(this._warned=1,function(t,e,i={}){const{module:s=`features/${e}`,entry:n,scripts:r=[`features/${e}.js`],tail:a}=i,l=r.map(t=>`<script src='.../dist/${t}'>`).join(" and ");globalThis.console.warn(`ApexCharts: ${t} requires the ${e} feature, which is not in this bundle. Bundler: import 'apexcharts/${s}'`+(n?` (or from 'apexcharts/${n}')`:"")+`. Script tag: add ${l} after the ApexCharts script, or load apexcharts.full.min.js instead.`+(a?` ${a}`:""))}(`\`chart.renderer: '${e}'\``,`renderer-${e}`,{tail:"Falling back to SVG."}))}else"canvas"===t&&!this._warned&&_(this.w)&&(this._warned=1,console.warn('[apexcharts] renderer:"canvas" requested but this chart uses a feature the canvas renderer does not render yet (gradient/pattern/image fill or a state color-matrix filter); falling back to SVG.'));const i=this._instances[this._activeKind];return i&&(i.destroy(),delete this._instances[this._activeKind]),this._activate("svg",this.svg),this._activeKind}pendingKind(){const t=this._desiredKind();return"svg"===t||A().has(t)?t:"svg"}getActiveKind(){return this._activeKind}teardown(){for(const t in this._instances){const e=this._instances[t];e&&"function"==typeof e.destroy&&e.destroy()}this._instances={},this.active=this.svg,this._activeKind="svg",this.w.globals.activeRenderer=null}}const M=globalThis.ApexCharts.__internals.__apex_helpers_InitCtxVariables;function S(t){if(!Array.isArray(t)||0===t.length)return"empty";for(let e=0;e<t.length;e++){const i=t[e];if(null!=i)return Array.isArray(i)?"paired":"object"==typeof i?"object":"plain"}return"empty"}function C(t,e){if(null!=t){if("paired"===e){const e=t[0];return e instanceof Date?e.getTime():e}if("object"===e){const e=t.x;return e instanceof Date?e.getTime():e}}}function k(t,e){return"paired"===e?[t,null]:"object"===e?{x:t,y:null}:null}function L(t,e,i){const s="function"==typeof i?i(t,e):t?t[i]:void 0;return null==s||""===s?null:String(s)}function F(t,e){if(!e||"first-seen"===e)return t.slice();if("asc"===e||"desc"===e){const i=t.slice().sort((t,e)=>{const i=Number(t),s=Number(e);return isFinite(i)&&isFinite(s)?i-s:t<e?-1:t>e?1:0});return"desc"===e?i.reverse():i}if(Array.isArray(e)){const i=e.map(String).filter(e=>-1!==t.indexOf(e)),s=t.filter(t=>-1===i.indexOf(t));return i.concat(s)}return"function"==typeof e?t.slice().sort(e):t.slice()}function N(t,e){const i=[],s=new Set;let n=!1,r=!1,a=0,l="plain";t.forEach(t=>{const e=S(t&&t.data);if("empty"!==e){if("plain"===e)return r=!0,void(a=Math.max(a,t.data.length));n=!0,l=e,t.data.forEach(t=>{const n=C(t,e);if(void 0===n)return;const r=typeof n+":"+String(n);s.has(r)||(s.add(r),i.push(n))})}}),n&&r&&e.push("trellis: mixing x-keyed data ([x,y] / {x,y}) with plain value arrays; plain series are padded by position, not by x");const o=n&&i.every(t=>"number"==typeof t&&isFinite(t));return o&&i.sort((t,e)=>Number(t)-Number(e)),{unionX:i,sawKeyed:n,plainMaxLen:a,xForm:l,xIsNumeric:o}}const H=["scatter","bubble"];function O(t,e,i=!0){const s=[],n=new Set;let r=0;return{align:a=>{const l=S(a&&a.data),h=a&&null!=a.name?String(a.name):`series-${r+1}`;r++,n.has(h)||(n.add(h),s.push(h));const d=c(o({},a),{name:h});if(!i)return d.data=Array.isArray(a.data)?a.data.slice():[],d;if("plain"===l||"empty"===l){const e=t.sawKeyed?t.unionX.length:t.plainMaxLen,i=Array.isArray(a.data)?a.data.slice(0,e):[];for(;i.length<e;)i.push(null);if(d.data=i,Array.isArray(a.highlightData)){const t=a.highlightData.slice(0,e);for(;t.length<e;)t.push(null);d.highlightData=t}return d}const u=new Map,p=new Map,f=Array.isArray(a.highlightData)?a.highlightData:null;return a.data.forEach((t,i)=>{const s=C(t,l);void 0===s||u.has(s)?void 0!==s&&u.has(s)&&e.push(`trellis: duplicate x "${String(s)}" in series "${h}"; keeping the first`):(u.set(s,t),f&&p.set(s,f[i]))}),d.data=t.unionX.map(t=>u.has(t)?u.get(t):k(t,l)),f&&(d.highlightData=t.unionX.map(t=>p.has(t)?p.get(t):null)),d},seriesNames:s}}function W(t,e={}){const i=t.xForm,s={bar:0,column:0,rangeBar:[0,0],candlestick:[0,0,0,0],boxPlot:[0,0,0,0,0]},n=e.chartType&&e.chartType in s?s[e.chartType]:null,r="plain"===i?t.unionX.map(()=>n):t.unionX.map(t=>{if(null===n)return k(t,i);const e=Array.isArray(n)?n.slice():n;return"object"===i?{x:t,y:e}:[t,e]});return{name:e.name||t.seriesNames[0]||"series-1",data:r}}function P(t,e={},i={}){const s=[],n=Array.isArray(t)?t:[],r=(a=i.chartType,!H.includes(a||""));var a;if(e.row||e.column)return e.by&&s.push("trellis: `by` is ignored when `row`/`column` are set (they are mutually exclusive)"),function(t,e,i,s=!0){const n=e.row,r=e.column,a=new Map,l=new Map,o=new Map,c=[],h=[],d=[],u=(t,e)=>{-1===t.indexOf(e)&&t.push(e)};if(t.forEach((t,e)=>{var i,s;const p=n?L(t,e,n):"",f=r?L(t,e,r):"";if(null===p&&null===f)return void c.push(t);if(null===p)return u(d,f),o.has(f)||o.set(f,[]),void(null==(i=o.get(f))||i.push(t));if(null===f)return u(h,p),l.has(p)||l.set(p,[]),void(null==(s=l.get(p))||s.push(t));u(h,p),u(d,f);let m=a.get(p);m||(m=new Map,a.set(p,m));let g=m.get(f);g||(g=[],m.set(f,g)),g.push(t)}),!h.length&&!d.length)return $(["trellis: no series carries the row/column facet keys; nothing to split"]);"number"==typeof e.limit&&e.limit>0&&i.push("trellis: `limit` is not applied to a 2-D grid; ignoring it");const p=F(h.length?h:[""],e.order),f=F(d.length?d:[""],e.order),m=N(t,i),{align:g,seriesNames:y}=O(m,i,s),x=[];return p.forEach(t=>{f.forEach(e=>{var i;const s=((null==(i=a.get(t))?void 0:i.get(e))||[]).concat(l.get(t)||[]).concat(o.get(e)||[]).concat(c).map(g);x.push({key:[t,e].filter(t=>""!==t).join(" / ")||"all",rowKey:t,colKey:e,series:s,seriesNames:s.map(t=>t.name),empty:0===s.length})})}),{mode:"2d",panels:x,rowKeys:p,colKeys:f,seriesNames:y,xForm:m.sawKeyed?m.xForm:"plain",unionX:m.sawKeyed?m.unionX:Array.from({length:m.plainMaxLen},(t,e)=>e),xIsNumeric:m.xIsNumeric,dropped:0,warnings:i}}(n,e,s,r);const l=e.by||"facet",o=new Map,c=[];if(n.forEach((t,e)=>{const i=L(t,e,l);if(null===i)c.push(t);else{o.has(i)||o.set(i,[]);const e=o.get(i);e&&e.push(t)}}),0===o.size)return $(["trellis: no series carries the facet key; nothing to split"]);let h=F(Array.from(o.keys()),e.order),d=0;"number"==typeof e.limit&&e.limit>0&&h.length>e.limit&&(d=h.length-e.limit,h=h.slice(0,e.limit));const u=N(h.reduce((t,e)=>t.concat(o.get(e)||[]),[]).concat(c),s),{align:p,seriesNames:f}=O(u,s,r);return{mode:"1d",panels:h.map(t=>{const e=(o.get(t)||[]).map(p),i=c.map(p),s=e.concat(i);return{key:t,rowKey:null,colKey:null,series:s,seriesNames:s.map(t=>t.name),empty:0===s.length}}),rowKeys:null,colKeys:null,seriesNames:f,xForm:u.sawKeyed?u.xForm:"plain",unionX:u.sawKeyed?u.unionX:Array.from({length:u.plainMaxLen},(t,e)=>e),xIsNumeric:u.xIsNumeric,dropped:d,warnings:s}}function $(t){return{mode:"1d",panels:[],rowKeys:null,colKeys:null,seriesNames:[],xForm:"plain",unionX:[],xIsNumeric:!1,dropped:0,warnings:t}}function T(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 B(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 a=n-s;let l,o;if("number"==typeof e.binWidth&&e.binWidth>0)l=e.binWidth,o="binWidth";else if("number"==typeof e.bins&&e.bins>=1)l=a/Math.floor(e.bins),o="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=T(t,.75)-T(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=T(t,.75)-T(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,a,"string"==typeof e.bins?e.bins:"auto");l=t.width,o=t.rule}(!Number.isFinite(l)||l<=0)&&(l=a);let c=Math.ceil(a/l);(!Number.isFinite(c)||c<1)&&(c=1);let h=!1;c>1e3&&(c=1e3,h=!0),l=a/c;const d=new Array(c+1);for(let t=0;t<=c;t++)d[t]=s+t*l;return d[c]=Math.max(d[c],n),{edges:d,binWidth:l,rule:o,capped:h}}function z(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 I(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=T(i,.75)-T(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)),a=i[0]-2*n,l=(i[s-1]+2*n-a)/(r-1),o=1/(s*n*Math.sqrt(2*Math.PI)),c=[];for(let t=0;t<r;t++){const e=a+t*l;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*o])}return{density:c,bandwidth:n}}const R=["heatmap","pie","donut","polarArea","radialBar"],j=["pie","donut","polarArea"];function K(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=Number(n);null!=n&&isFinite(r)&&e.push(r)}return e}function D(t,e,i,s){var n,r,a,l,o,c;const h={plotOptions:null,yExtentOverride:null,skipYaxisPush:R.includes(s),forceSharedY:!1,pieScaleOf:null,warnings:[]},d=t.panels,u=(null==i?void 0:i.plotOptions)||{};if("histogram"===s){const t=u.histogram||{};let i=[];const s=d.map(t=>t.series.map(t=>{const e=K(t.data);return i=i.concat(e),e})),r=B(i,{bins:t.bins,binWidth:t.binWidth,range:t.range});if(r&&r.edges.length>1){const i=r.edges;h.plotOptions={histogram:{range:[i[0],i[i.length-1]],binWidth:r.binWidth}};let a=0;s.forEach(e=>e.forEach(e=>{e.length&&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}(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=z(t[s],e);n>=0&&i[n]++}return i}(e,i),{normalize:t.normalize,cumulative:t.cumulative,binWidth:r.binWidth}).forEach(t=>{isFinite(t)&&t>a&&(a=t)})})),a>0&&(h.yExtentOverride={min:0,max:a});const l=(null==(n=e.scales)?void 0:n.y)||"shared";"independent-row"!==l&&"independent-column"!==l||(h.forceSharedY=!0,h.warnings.push("histogram trellis: group y scales would re-derive counts per group; using scales.y 'shared' (use 'independent' for per-panel count scales)."))}}if("violin"===s){const t=(null==(r=u.violin)?void 0:r.kde)||{};if(!("number"==typeof t.bandwidth&&t.bandwidth>0)){let t=[];d.forEach(e=>e.series.forEach(e=>{t=t.concat(function(t){const e=[];return Array.isArray(t)?(t.forEach(t=>{const i=t&&"object"==typeof t?t.y:null;Array.isArray(i)&&i.forEach(t=>{const i=Number(t);null!=t&&isFinite(i)&&e.push(i)})}),e):e}(e.data))}));const e=t.length?I(t,{resolution:8}):null;e&&isFinite(e.bandwidth)&&e.bandwidth>0&&(h.plotOptions={violin:{kde:{bandwidth:e.bandwidth}}})}}if("heatmap"===s){"independent"===(null==(a=e.scales)?void 0:a.color)&&h.warnings.push("a heatmap trellis must share its color scale (the same color meaning different values per panel is a silent lie); ignoring scales.color 'independent'.");const t=null==(o=null==(l=u.heatmap)?void 0:l.colorScale)?void 0:o.ranges;if(!(Array.isArray(t)&&t.length>0)){let t=1/0,e=-1/0;d.forEach(i=>i.series.forEach(i=>{K(i.data).forEach(i=>{i<t&&(t=i),i>e&&(e=i)})})),isFinite(t)&&isFinite(e)&&(h.plotOptions={heatmap:{colorScale:{min:t,max:e}}})}}if("bubble"===s){"independent"===(null==(c=e.scales)?void 0:c.size)&&h.warnings.push("a bubble trellis must share its size scale; ignoring scales.size 'independent'.");let t=1/0,i=-1/0;d.forEach(e=>e.series.forEach(e=>{(function(t){const e=[];return Array.isArray(t)?(t.forEach(t=>{let i=null;Array.isArray(t)&&t.length>2?i=t[2]:t&&"object"==typeof t&&(i=t.z);const s=Number(i);null!=i&&isFinite(s)&&e.push(s)}),e):e})(e.data).forEach(e=>{e<t&&(t=e),e>i&&(i=e)})})),isFinite(t)&&isFinite(i)&&(h.plotOptions={bubble:{minZ:t,maxZ:i}})}if(j.includes(s)&&e.radiusByTotal){const t=new Map;let e=0;d.forEach(i=>{let s=0;i.series.forEach(t=>{K(t.data).forEach(t=>{s+=Math.abs(t)})}),t.set(i.key,s),s>e&&(e=s)}),e>0&&(h.pieScaleOf=i=>{const s=t.get(i);return"number"!=typeof s||s<=0?null:Math.sqrt(s/e)})}return h}const X=globalThis.ApexCharts.__internals.__apex_ThemePalettes_getThemePalettes;function Y(t,e,i=3){if(!isFinite(t)||!isFinite(e))return{min:0,max:1,tickAmount:1};if(t===e){const i=0===t?1:.1*Math.abs(t);t-=i,e+=i}const s=Math.max(1,i),n=(e-t)/s,r=Math.pow(10,Math.floor(Math.log10(n)));let a={dist:1/0,ticks:0,min:0,max:1};return(r>=10?[1,2,2.5,5,10]:[1,2,5,10]).forEach(i=>{const n=i*r,l=Math.floor(t/n)*n,o=Math.ceil(e/n)*n,c=Math.max(1,Math.round((o-l)/n)),h=Math.abs(c-s);(h<a.dist||h===a.dist&&c<a.ticks)&&(a={dist:h,ticks:c,min:l,max:o})}),{min:a.min,max:a.max,tickAmount:a.ticks}}function q(t,e,i){if(null==t)return;let s=t;if("paired"===e?s=t[1]:"object"===e&&(s=t.y),null==s)return;if(Array.isArray(s)){for(let t=0;t<s.length;t++){const e=Number(s[t]);isFinite(e)&&(e<i.min&&(i.min=e),e>i.max&&(i.max=e))}return}const n=Number(s);isFinite(n)&&(n<i.min&&(i.min=n),n>i.max&&(i.max=n))}function G(t,e,i){const s=e&&"object"==typeof e&&!Array.isArray(e)&&"highlight"in e?e.highlight:Array.isArray(t.highlightData)?t.highlightData[i]:null;return"number"==typeof s&&isFinite(s)?s:null}function V(t){if("number"!=typeof t||!isFinite(t)||t%1==0)return 0;const e=String(t);return-1!==e.indexOf("e")||-1!==e.indexOf("E")?4:Math.min(4,(e.split(".")[1]||"").length)}function U(t,e,i={}){const s={min:1/0,max:-1/0},n=t=>{isFinite(t)&&(t<s.min&&(s.min=t),t>s.max&&(s.max=t))};return t.forEach(t=>{const r=new Map;t.series.forEach(t=>{var n;if(!Array.isArray(t.data))return;if(!function(t,e){if(!e.stackOnlyBar)return!0;const i=t&&t.type;return null==i||"bar"===i||"column"===i}(t,i))return void t.data.forEach(t=>q(t,e,s));const a=String(null!=(n=t.group)?n:""),l=t=>{const e=r.get(t)||{pos:[],neg:[]};return r.set(t,e),e},o=l(a),c=i.parts?l("~"+a):null;t.data.forEach((i,s)=>{[o,c].forEach((n,r)=>{if(!n)return;void 0===n.pos[s]&&(n.pos[s]=0,n.neg[s]=0);const a=r?G(t,i,s):(t=>{if(null==t)return null;const i="paired"===e?t[1]:"object"===e?t.y:t;if(null==i||Array.isArray(i))return null;const s=Number(i);return isFinite(s)?s:null})(i);null!==a&&(a>0?n.pos[s]+=a:n.neg[s]+=a)})})}),r.forEach(t=>{t.pos.forEach(n),t.neg.forEach(n)})}),isFinite(s.min)&&isFinite(s.max)?s:null}function Z(t,e={},i={}){const s=e.scales||{},n=s.x||"shared",r=s.y||"shared";let a=null;if("shared"===n&&t.xIsNumeric&&t.unionX.length){const e=t.unionX;a={min:e[0],max:e[e.length-1]}}const l=["bar","column","histogram"].includes(i.chartType||""),o=t=>t?(l&&t.min>0&&(t.min=0),Y(t.min,t.max,e.targetTicks||3)):null,c=!!i.stacked&&"100%"===i.stackType,h=!!i.stacked&&!c,d=e=>c?{min:0,max:100}:h?U(e,t.xForm,{stackOnlyBar:i.stackOnlyBar,parts:i.parts}):function(t,e,i=!1){const s={min:1/0,max:-1/0};return t.forEach(t=>t.series.forEach(t=>{Array.isArray(t.data)&&t.data.forEach((n,r)=>{q(n,e,s);const a=i?G(t,n,r):null;null!==a&&q(a,"plain",s)})})),isFinite(s.min)&&isFinite(s.max)?s:null}(e,t.xForm,i.parts);let u=null;"shared"===r&&(u=o(i.yExtentOverride||d(t.panels)));let p=null;if("independent-row"===r){p=new Map;const e=new Map;t.panels.forEach(t=>{var i;const s=null!=(i=t.rowKey)?i:"";e.has(s)||e.set(s,[]),e.get(s).push(t)}),e.forEach((t,e)=>{const i=o(d(t));i&&(null==p||p.set(e,i))})}let f=null;if("independent-column"===r){f=new Map;const e=new Map;t.panels.forEach(t=>{var i;const s=null!=(i=t.colKey)?i:"";e.has(s)||e.set(s,[]),e.get(s).push(t)}),e.forEach((t,e)=>{const i=o(d(t));i&&(null==f||f.set(e,i))})}const m=X().palette1,g=Array.isArray(i.userColors)?i.userColors.filter(t=>"string"==typeof t):[],y=g.length?g:m,x=t.seriesNames;return{x:a,y:u,rowY:p,colY:f,colorOf:t=>{const e=x.indexOf(t);return y[(-1===e?0:e)%y.length]},palette:y}}function J({panelCount:t,containerWidth:e,cfg:i,hostHeight:s,chromeHeight:n}){var r,a;const l=null!=(r=i.gap)?r:12,o=function(t,e,i={}){var s,n;const r=null!=(s=i.gap)?s:12;if("number"==typeof i.columns&&i.columns>0)return Math.max(1,Math.min(Math.floor(i.columns),e));const a=null!=(n=i.minPanelWidth)?n:220,l=Math.floor((t+r)/(a+r));return Math.max(1,Math.min(l,e))}(e,t,i),c=Math.max(1,Math.ceil(t/o)),h=i.header&&!1===i.header.show?0:22,d=Math.max(0,n||0),u=c*h+l*(c-1)+d,p="number"==typeof s&&s>0?s:0,f=Math.max(0,(e-l*(o-1))/o);let m;m="number"==typeof i.panelHeight&&i.panelHeight>0?i.panelHeight:p>0?(p-u)/c:f/(null!=(a=i.aspectRatio)?a:1.6);const g="number"==typeof i.minPanelHeight&&i.minPanelHeight>0?i.minPanelHeight:80;m=Math.max(g,Math.round(m));const y=c*(m+h)+l*(c-1),x=p>0?Math.max(0,y+d-p):0,v=i.axes&&i.axes.labels||"edges",b=i.scales||{},_=1===o,w=Array.from({length:t},(e,i)=>{const s=Math.floor(i/o),n=i%o;let r,a;return"none"===v?(r=!1,a=!1):"all"===v||_?(r=!0,a=!0):(r="independent"===b.x||s===function(t,e,i,s){return t<e-(s-1)*i?s-1:s-2}(n,t,o,c),a="independent"===b.y||"independent-column"===b.y||0===n),{i:i,r:s,c:n,showXLabels:r,showYLabels:a}});return{cols:o,rows:c,panelW:f,panelH:m,headerH:h,gap:l,cells:w,gridH:y,overflowH:x}}const Q=globalThis.ApexCharts.__internals.__apex_Series,tt=["#cf4d3f","#8f9499","#26a75b"],et=(t,e,i)=>t+(e-t)*i;function it(t){return Math.max(0,Math.min(255,Math.round(t))).toString(16).padStart(2,"0")}function st(t,e,i){const s=u.parseHex(nt(t)),n=u.parseHex(nt(e));return s&&n?"#"+it(et(s[0],n[0],i))+it(et(s[1],n[1],i))+it(et(s[2],n[2],i)):t}function nt(t){return"string"!=typeof t?"#000000":u.isColorHex(t)?t:u.rgb2hex(t)||"#000000"}function rt(t,e,i,s){var n,r,a;if(!e||"object"!=typeof e)return null;const l=null==(a=null==(r=null==(n=t.config.plotOptions)?void 0:n.treemap)?void 0:r.colorScale)?void 0:a.colorValue;let o;if(o="function"==typeof l?l(e,{seriesIndex:i,dataPointIndex:s,w:t}):"string"==typeof l?e[l]:e.colorValue,null==o)return null;const c=Number(o);return Number.isFinite(c)?c:null}function at(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 a=t.config.series||[];let l=1/0,o=-1/0,c=!1;for(let e=0;e<a.length;e++){const i=a[e]&&a[e].data;if(Array.isArray(i))for(let s=0;s<i.length;s++){const n=rt(t,i[s],e,s);null!=n&&(c=!0,n<l&&(l=n),n>o&&(o=n))}}if(!c&&!0!==r.enabled)return null;Number.isFinite(l)||(l=0,o=0);let h=Number.isFinite(Number(r.min))?Number(r.min):l,d=Number.isFinite(Number(r.max))?Number(r.max):o,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 p=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:nt(t.color)})).sort((t,e)=>t.value-e.value);const n=(Array.isArray(t.colors)&&t.colors.length>=2?t.colors:tt).map(nt),r=n.length;if(null!=s&&r>=3){const t=Math.floor((r-1)/2),a=[];for(let i=0;i<=t;i++)a.push({value:et(e,s,i/t),color:n[i]});for(let e=t+1;e<r;e++)a.push({value:et(s,i,(e-t)/(r-1-t)),color:n[e]});return a}return n.map((t,s)=>({value:et(e,i,s/(r-1)),color:t}))}(r,h,d,u);if(p.length<2)return null;const f=d-h,m=p.map(t=>({percent:0===f?0:(t.value-h)/f,color:t.color}));return{min:h,max:d,midpoint:u,stops:p,at:t=>{if(!Number.isFinite(t))return p[Math.floor(p.length/2)].color;if(t<=p[0].value)return p[0].color;const e=p[p.length-1];if(t>=e.value)return e.color;for(let e=1;e<p.length;e++){const i=p[e];if(t<=i.value){const s=p[e-1],n=i.value-s.value,r=0===n?0:(t-s.value)/n;return st(s.color,i.color,r)}}return e.color},legendStops:m}}const lt=globalThis.ApexCharts.__internals.__apex_tooltip_Utils,ot="http://www.w3.org/2000/svg";class ct{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 a=null==(i=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:i.type;return a&&(null==(r=null==(n=null==(s=null==t?void 0:t.config)?void 0:s.plotOptions)?void 0:n[a])?void 0:r.colorScale)||null}static configFor(t){const e=ct.colorScaleOf(t);return e&&e.gradientLegend||null}_cfg(){return ct.configFor(this.w)||{}}static isEnabled(t){if(!ct.supports(t))return!1;const e=ct.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,a,l,o;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,p="left"===u||"right"===u,m=null!=(i=null==(e=d.arrow)?void 0:e.size)?i:8,g=m+4,y=d.showLabels?28:4,x=d.showLabels?20:4,v=d.showLabels?44:0,b=this._resolveStripLength(p?d.height:d.width,p),_=d.thickness,w=p?Math.max(_+g+4,v):b+2*y,A=p?b+2*x:_+g+4,E=(w-(_+g))/2,M=p?"left"===u?E:E+g:y,S=p?x:"top"===u?g:4,C=f.createElementNS(ot,"svg");C.setAttribute("class","apexcharts-heatmap-gradient-legend apexcharts-gradient-legend"),C.setAttribute("width",String(w)),C.setAttribute("height",String(A)),C.setAttribute("overflow","visible");const k=f.createElementNS(ot,"defs"),L=`apexcharts-heatmap-gradient-${c.globals.cuid}`,F=f.createElementNS(ot,"linearGradient");F.setAttribute("id",L),p?(F.setAttribute("x1","0"),F.setAttribute("y1","1"),F.setAttribute("x2","0"),F.setAttribute("y2","0")):(F.setAttribute("x1","0"),F.setAttribute("y1","0"),F.setAttribute("x2","1"),F.setAttribute("y2","0")),this._grad=F;const{min:N,max:H,bands:O}=this._paintStops();k.appendChild(F),C.appendChild(k);const W=f.createElementNS(ot,"rect");if(W.setAttribute("x",String(M)),W.setAttribute("y",String(S)),W.setAttribute("width",String(p?_:b)),W.setAttribute("height",String(p?b:_)),W.setAttribute("rx","2"),W.setAttribute("fill",`url(#${L})`),C.appendChild(W),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,a=this._getFormatter(),l=(s,n,r,a)=>{const l=f.createElementNS(ot,"text");return l.setAttribute("x",String(n)),l.setAttribute("y",String(r)),l.setAttribute("text-anchor",a),l.setAttribute("dominant-baseline","middle"),l.setAttribute("fill",t),l.setAttribute("font-size",e),i&&l.setAttribute("font-family",i),l.textContent=String(s),l};if(p){const t=M+_/2;C.appendChild(l(a(N),t,S+b+10,"middle")),C.appendChild(l(a(H),t,S-10,"middle"))}else{const t=S+_/2;C.appendChild(l(a(N),M-6,t,"end")),C.appendChild(l(a(H),M+b+6,t,"start"))}}const P=(null==(a=d.arrow)?void 0:a.color)||c.config.chart.foreColor,$=this._buildArrow(m,P,u);if(C.appendChild($),this.arrowEl=$,this._bandHitEls=[],c.config.legend.onItemHover.highlightDataSeries&&O.length>0&&O.forEach(t=>{const e=f.createElementNS(ot,"rect");if(p){const i=S+b-t.p2*b,s=S+b-t.p1*b;e.setAttribute("x",String(M)),e.setAttribute("y",String(i)),e.setAttribute("width",String(_)),e.setAttribute("height",String(Math.max(0,s-i)))}else e.setAttribute("x",String(M+t.p1*b)),e.setAttribute("y",String(S)),e.setAttribute("width",String(Math.max(0,(t.p2-t.p1)*b))),e.setAttribute("height",String(_));e.setAttribute("fill","transparent"),e.setAttribute("class","apexcharts-heatmap-gradient-band"),e.setAttribute("data:range-index",String(t.index)),e.style.cursor="pointer",C.appendChild(e),this._bandHitEls.push(e)}),this._geom={isVertical:p,position:u,stripX:M,stripY:S,stripLength:b,stripThickness:_,arrowSize:m,svgWidth:w,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==(l=d.labelStyle)?void 0:l.fontSize)||"11px",t.style.fontFamily=(null==(o=d.labelStyle)?void 0:o.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(C),this.hoverValueEl&&h.appendChild(this.hoverValueEl),this.svgEl=C,t?(h.style.width=w+"px",h.style.height=A+"px",h.style.position="relative",h.style.overflow="visible"):this._applyWrapAlignment(h,u,p,w,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,a=this._cfg().align||"center",l=12,o=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"===a?l:"end"===a?l+Math.max(0,i):l+Math.max(0,i)/2,t.style.top=r+d+"px",t.style.left="left"===e?l+h+"px":o-s-l+h+"px"}else{const i=o-s-24;let r;r="start"===a?l:"end"===a?l+Math.max(0,i):l+Math.max(0,i)/2,t.style.left=r+h+"px",t.style.top="top"===e?l+d+"px":c-n-l+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:a,svgWidth:l,svgHeight:o,stripX:c,stripY:h,stripThickness:d}=this._geom,u=this._cfg().align||"center",m=i.config.legend.offsetX||0,g=i.config.legend.offsetY||0,y=null==(e=null==(t=this.ctx)?void 0:t.dimensions)?void 0:e.dimHelpers,x=y?y.getTitleSubtitleCoords("title").height+y.getTitleSubtitleCoords("subtitle").height:0,v=i.layout.xAxisHeight||0,b=(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+b(s.gridHeight,o)+g+"px";const t=(("left"===a?0:s.translateX+s.gridWidth)+("left"===a?s.translateX:s.svgWidth))/2;n.style.left=t-c-d/2+m+"px"}else{n.style.left=s.translateX+b(s.gridWidth,l)+m+"px";const t=(("top"===a?x:s.translateY+s.gridHeight+v)+("top"===a?s.translateY:s.svgHeight))/2;n.style.top=t-h-d/2+g+"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=lt.plotRect(t);if(!(s.width&&s.height&&n.width&&n.height))return;const r=n.left,a=n.left+n.width,l=n.top,o=n.top+n.height,c=n.zoom,{isVertical:h,position:d}=this._geom;if(h){const t=("left"===d?r-s.right:s.left-a)/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?l-s.bottom:s.top-o)/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,a;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==(a=(r=this.ctx.events).removeEventListener)||a.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,a=t.currentTarget,l=parseInt(null!=(e=a.getAttribute("data:range-index"))?e:"-1",10);l<0||l===this._activeBandIndex||(this._activeBandIndex=l,null==(n=null==(s=null==(i=this.ctx)?void 0:i.events)?void 0:s.fireEvent)||n.call(s,"legendHover",[this.ctx,l,r]),this._highlightRange(l,"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 Q(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,a=n.seriesIndex,l=n.dataPointIndex;if("number"!=typeof a||"number"!=typeof l)return;if(!ct.supports(r))return;let o;o=this._continuous?function(t,e,i){const s=t.config.series[e];return rt(t,s&&Array.isArray(s.data)?s.data[i]:null,e,i)}(r,a,l):null==(s=null==(i=null==(e=r.seriesData)?void 0:e.series)?void 0:i[a])?void 0:s[l],null==o||Number.isNaN(o)||this._positionArrow(o)}_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:a,arrowSize:l}=this._geom,o=this._min,c=this._max-o;let h;if(h=0===c?.5:(t-o)/c,h<0&&(h=0),h>1&&(h=1),e){const t=n+r-h*r;let e,o;"left"===i?(e=s+a,o=e+l):(e=s,o=e-l);const c=[`${e},${t}`,`${o},${t-l/2}`,`${o},${t+l/2}`].join(" ");this.arrowEl.setAttribute("points",c)}else{const t=s+h*r;let e,o;"top"===i?(e=n+a,o=e+l):(e=n,o=e-l);const c=[`${t},${e}`,`${t-l/2},${o}`,`${t+l/2},${o}`].join(" ");this.arrowEl.setAttribute("points",c)}if(this.arrowEl.setAttribute("opacity","1"),this.hoverValueEl){const o=this._getFormatter();if(this.hoverValueEl.textContent=o(t),e){const t=n+r-h*r;"left"===i?this.hoverValueEl.style.left=`${s+a+l+8}px`:(this.hoverValueEl.style.left=s-l-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+a+l+8}px`:n-l-18+"px"}this.hoverValueEl.style.opacity="1"}}_buildArrow(t,e,i){const s=f.createElementNS(ot,"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(ot,"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=ct.colorScaleOf(i)||{},n=this._cfg(),r=at(i);if(r)return this._continuous=!0,{min:r.min,max:r.max,stops:r.legendStops,bands:[]};this._continuous=!1;let a=1/0,l=-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<a&&(a=i),i>l&&(l=i))}}Number.isFinite(a)||(a=0),Number.isFinite(l)||(l=0);let d=a,p=l;const f=void 0!==s.min&&void 0!==s.max&&s.max>s.min;f?(d=s.min,p=s.max):(void 0!==s.min&&(d=s.min<a?s.min:a),void 0!==s.max&&(p=s.max>l?s.max:l));const m=[],g=[];if(s.ranges&&s.ranges.length>0){const t=s.ranges.map((t,e)=>c(o({},t),{_originalIndex:e})).sort((t,e)=>t.from-e.from),e=t[0].from,i=t[t.length-1].to;d=e,p=i;const n=i-e||1;t.forEach(t=>{const i=(t.from-e)/n,s=(t.to-e)/n;m.push({percent:(i+s)/2,color:t.color}),g.push({index:t._originalIndex,p1:i,p2:s})})}else{const t=i.globals.colors[0]||"#008FFB",r=new u,a=i.config.chart.type,l=i.config.plotOptions[a]||{},o=null!=(e=l.shadeIntensity)?e:.5,c=i.globals,h=c.hasNegs,g="heatmap"===a&&!l.distributed&&!f&&c.maxY>=c.minY,y=g?c.maxY:p,x=Math.abs(y)+Math.abs(g?s.min<c.minY?s.min:c.minY:d),v=1.25*o,b=Math.max(2,n.stops||16);for(let e=0;e<b;e++){const s=e/(b-1),n=0===x?0:Math.min(d+s*(p-d),y)/x,c=Math.max(-1,Math.min(1,h?l.reverseNegativeShade?(n<0?n:1-n)*v:n<=0?1-(1+n)*o:(1-n)*o:(1-n)*("treemap"===a?v:1))),u=l.enableShades?r.shadeColor("dark"===i.config.theme.mode?-c:c,t):t;m.push({percent:s,color:u})}}return{min:d,max:p,stops:m,bands:g}}}const ht={zoom:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><circle cx="10.5" cy="10.5" r="6"/><path d="M15 15l5 5"/><path d="M8 10.5h5M10.5 8v5"/></svg>',pan:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M12 3v18M3 12h18"/><path d="M9 6l3-3 3 3M9 18l3 3 3-3M6 9l-3 3 3 3M18 9l3 3-3 3"/></svg>',reset:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M4 10a8 8 0 1 1 2 6"/><path d="M4 4v6h6"/></svg>',download:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M12 4v11"/><path d="M7 11l5 5 5-5"/><path d="M4 20h16"/></svg>'};class dt{constructor(t){this.trellis=t,this.elLegend=null,this.elToolbar=null,this.elTitle=null,this.elBreadcrumb=null,this.gradientLegend=null,this._gradPending=null,this._gradWire=null}buildHeader(t,e,i){const s=this.trellis,n=s.cfg.header||{};if(!1===n.show)return;const r=f.createElement("div");r.className="apexcharts-trellis-header";let a=e;"function"==typeof n.formatter&&(a=n.formatter(e,{dimension:"string"==typeof s.cfg.by?s.cfg.by:void 0,index:i.index,count:i.count})),r.textContent=null==a?"":String(a);const l=n.style||{};if(l.fontSize&&(r.style.fontSize=l.fontSize),l.fontWeight&&(r.style.fontWeight=String(l.fontWeight)),l.color&&(r.style.color=l.color),!1!==s.cfg.promote){r.classList.add("apexcharts-trellis-header-clickable"),r.setAttribute("role","button"),r.setAttribute("tabindex","0"),r.setAttribute("title","Expand this panel");const t=()=>{s._promotedKey===e?s.restorePromotion():s.promote(e)};r.addEventListener("click",t),r.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t())})}t.appendChild(r)}stripEl(t,e,i){const s=this.trellis.cfg.header||{},n=f.createElement("div");n.className=`apexcharts-trellis-strip apexcharts-trellis-strip-${t}`;let r=e;"function"==typeof s.formatter&&(r=s.formatter(e,{dimension:t,index:i.index,count:i.count})),n.textContent=null==r?"":String(r);const a=s.style||{};return a.fontSize&&(n.style.fontSize=a.fontSize),a.fontWeight&&(n.style.fontWeight=String(a.fontWeight)),a.color&&(n.style.color=a.color),n}buildBreadcrumb(t,e,i){this.removeBreadcrumb();const s=f.createElement("div");s.className="apexcharts-trellis-breadcrumb";const n=f.createElement("button");n.setAttribute("type","button"),n.className="apexcharts-trellis-breadcrumb-back",n.textContent="All panels",n.addEventListener("click",i);const r=f.createElement("span");r.className="apexcharts-trellis-breadcrumb-sep",r.textContent="/";const a=f.createElement("span");a.className="apexcharts-trellis-breadcrumb-current",a.textContent=e,s.appendChild(n),s.appendChild(r),s.appendChild(a),t.appendChild(s),this.elBreadcrumb=s}removeBreadcrumb(){this.elBreadcrumb&&this.elBreadcrumb.parentNode&&this.elBreadcrumb.parentNode.removeChild(this.elBreadcrumb),this.elBreadcrumb=null}buildTitle(t){const e=this.trellis.w.config.title;if(!e||!e.text)return;const i=f.createElement("div");i.className="apexcharts-trellis-title",i.textContent=e.text;const s=e.style||{};s.fontSize&&(i.style.fontSize=s.fontSize),s.color&&(i.style.color=s.color),t.appendChild(i),this.elTitle=i}buildLegend(t){const e=this.trellis;if("shared"!==(e.cfg.legend||"shared"))return;if("heatmap"===e.w.config.chart.type)return void this.buildGradientLegend(t);const i=e.split?e.split.seriesNames:[];if(i.length<2)return;const s=f.createElement("div");s.className="apexcharts-trellis-legend apexcharts-legend",s.setAttribute("role","list"),i.forEach(t=>{const i=f.createElement("div");i.className="apexcharts-legend-series apexcharts-trellis-legend-item",i.setAttribute("role","listitem"),i.setAttribute("tabindex","0"),i.setAttribute("data:collapsed","false");const n=f.createElement("span");n.className="apexcharts-legend-marker",n.style.background=e.scales?e.scales.colorOf(t):"#008FFB";const r=f.createElement("span");r.className="apexcharts-legend-text",r.textContent=t,i.appendChild(n),i.appendChild(r);const a=()=>{const s=e.sync.toggleSeries(t);i.classList.toggle("apexcharts-inactive-legend",s),i.setAttribute("data:collapsed",String(s))};i.addEventListener("click",a),i.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),a())}),s.appendChild(i)}),t.appendChild(s),this.elLegend=s}refreshLegendColors(){const t=this.trellis,e=this.elLegend,i=t.scales;e&&i&&e.querySelectorAll(".apexcharts-trellis-legend-item").forEach(t=>{var e;const s=null==(e=t.querySelector(".apexcharts-legend-text"))?void 0:e.textContent,n=t.querySelector(".apexcharts-legend-marker");s&&n&&(n.style.background=i.colorOf(s))})}buildGradientLegend(t){const e=this.trellis,i=e.panels.find(t=>t.chart);if(!i){if(this._gradPending)return;const i=()=>{var s,n;this._gradPending=null,null==(n=(s=e.ctx.events).removeEventListener)||n.call(s,"panelMounted",i),this.buildGradientLegend(t)};return this._gradPending=i,void e.ctx.events.addEventListener("panelMounted",i)}const s=f.createElement("div");s.className="apexcharts-trellis-legend apexcharts-trellis-gradient-legend",t.appendChild(s),this.elLegend=s;const n=i.chart,r=new ct(n.w,n.ctx);r.draw(s),this.gradientLegend=r,r.panelsW=()=>e.panels.filter(t=>t.chart).map(t=>t.chart.w);const a=(t,e)=>{var i;const s=e.chart!==n&&(null==(i=e.chart)?void 0:i.ctx.events);s&&(s.addEventListener("dataPointMouseEnter",r._onCellEnter),s.addEventListener("dataPointMouseLeave",r._onCellLeave))};e.panels.forEach(t=>a(0,t)),e.ctx.events.addEventListener("panelMounted",a),this._gradWire=a}destroyGradientLegend(){var t,e;const i=this.trellis;if(this._gradPending&&(null==(e=(t=i.ctx.events).removeEventListener)||e.call(t,"panelMounted",this._gradPending),this._gradPending=null),i.ctx.events.removeEventListener("panelMounted",this._gradWire),this.gradientLegend){try{this.gradientLegend.destroy()}catch(t){}this.gradientLegend=null}}buildToolbar(t){const e=this.trellis;if("shared"!==(e.cfg.toolbar||"shared"))return;const i=f.createElement("div");i.className="apexcharts-trellis-toolbar";const s={},n=t=>{e.panels.forEach(e=>{if(!e.chart)return;const i=e.chart.w.interact;i.zoomEnabled="zoom"===t,i.panEnabled="pan"===t,i.selectionEnabled=!1}),s.zoom.classList.toggle("apexcharts-selected","zoom"===t),s.pan.classList.toggle("apexcharts-selected","pan"===t),s.zoom.setAttribute("aria-pressed",String("zoom"===t)),s.pan.setAttribute("aria-pressed",String("pan"===t))},r=(t,e,n)=>{const r=f.createElement("button");return r.className=`apexcharts-trellis-tool apexcharts-trellis-tool-${t}`,r.setAttribute("type","button"),r.setAttribute("aria-label",e),r.setAttribute("title",e),r.innerHTML=ht[t],r.addEventListener("click",n),s[t]=r,i.appendChild(r),r};if(r("zoom","Selection zoom",()=>n("zoom")),r("pan","Pan",()=>n("pan")),r("reset","Reset zoom",()=>{e.sync.resetAll()}),e.ctx.exports){const t=f.createElement("div");t.className="apexcharts-trellis-menu",[["png","Download PNG"],["svg","Download SVG"],["csv","Download CSV"]].forEach(([i,s])=>{const n=f.createElement("button");n.setAttribute("type","button"),n.className="apexcharts-trellis-menu-item",n.textContent=s,n.addEventListener("click",()=>{t.classList.remove("apexcharts-trellis-menu-open"),e.exports.download(i)}),t.appendChild(n)}),r("download","Download",()=>{t.classList.toggle("apexcharts-trellis-menu-open")}),i.appendChild(t)}s.zoom.classList.add("apexcharts-selected"),s.zoom.setAttribute("aria-pressed","true"),s.pan.setAttribute("aria-pressed","false"),t.appendChild(i),this.elToolbar=i,t.classList.add("apexcharts-trellis-has-toolbar")}}function ut(t,e){const i=u.clone(t.w.config.yaxis);return(Array.isArray(i)?i:[i]).map(t=>u.extend(t,e))}class pt{constructor(t){this.trellis=t,this._syncing=!1,this._hidden=new Set,this.currentWindow=null}_noteWindow(t,e){const i=t&&t.xaxis;i&&null!=i.min&&null!=i.max?this.currentWindow={x:{min:i.min,max:i.max},y:this.currentWindow&&this.currentWindow.y||null,zoomed:e||!(!this.currentWindow||!this.currentWindow.zoomed)}:e&&(this.currentWindow=null)}makeZoomedHandler(t){return(e,i)=>{"function"==typeof t&&t(e,i),this._noteWindow(i,!0),this.onZoomed(i)}}makeScrolledHandler(t){return(e,i)=>{"function"==typeof t&&t(e,i),this._noteWindow(i,!1)}}onZoomed(t){const e=this.trellis;if(this._syncing)return;const i=e.cfg;if(!i||"shared"!==(i.scales.y||"shared"))return;if(!e.autoScaleYaxis)return;const s=t&&t.xaxis;if(!s||null==s.min||null==s.max)return;if(!e.split||!e.split.xIsNumeric)return;const n=function(t,e,i,s,n=!1){const r={min:1/0,max:-1/0};return t.forEach(t=>t.series.forEach(t=>{Array.isArray(t.data)&&t.data.forEach((a,l)=>{if(null==a)return;const o="paired"===e?a[0]:"object"===e?a.x:null,c=o instanceof Date?o.getTime():Number(o);if(!isFinite(c)||c<i||c>s)return;q(a,e,r);const h=n?G(t,a,l):null;null!==h&&q(h,"plain",r)})})),isFinite(r.min)&&isFinite(r.max)?r:null}(e.split.panels,e.split.xForm,s.min,s.max,e._stackingHost().parts);if(!n)return;const r=Y(n.min,n.max,i.targetTicks||3);this.currentWindow&&(this.currentWindow.y={min:r.min,max:r.max,tickAmount:r.tickAmount}),this._syncing=!0;const a=e.panels.map(t=>t.chart?t.chart.updateOptions({yaxis:ut(t.chart,{min:r.min,max:r.max,tickAmount:r.tickAmount})},!1,!1,!1).catch(()=>{}):Promise.resolve());Promise.all(a).finally(()=>{this._syncing=!1})}resetAll(){const t=this.trellis;this.currentWindow=null;const e=t.scales&&t.scales.x?{min:t.scales.x.min,max:t.scales.x.max}:{min:void 0,max:void 0};this._syncing=!0;const i=t.panels.map(i=>{if(!i.chart)return Promise.resolve();i.chart.w.interact.zoomed=!1;const s={xaxis:e},n=t.split?t._yBoundsFor(t.split.panels[i.index]):null;return n&&(s.yaxis=ut(i.chart,{min:n.min,max:n.max,tickAmount:n.tickAmount})),i.chart.updateOptions(s,!1,!1,!1).catch(()=>{})});return Promise.all(i).finally(()=>{this._syncing=!1})}toggleSeries(t){const e=!this._hidden.has(t);return e?this._hidden.add(t):this._hidden.delete(t),this.trellis.panels.forEach(i=>{const s=i.chart;if(s&&-1!==(s.w.seriesData.seriesNames||[]).indexOf(t))try{e?s.hideSeries(t):s.showSeries(t)}catch(t){}}),e}isHidden(t){return this._hidden.has(t)}applyHiddenTo(t){if(!this._hidden.size||!t)return;const e=t.w.seriesData&&t.w.seriesData.seriesNames||[];this._hidden.forEach(i=>{if(-1!==e.indexOf(i))try{t.hideSeries(i)}catch(t){}})}wireCrosshairs(t){let e=0,i=null;const s=()=>{const t=i&&i.closest?i.closest(".apexcharts-trellis-cell"):null,e=t?t.querySelector(".apexcharts-xcrosshairs"):null,s=e&&e.classList.contains("apexcharts-active");this.trellis.panels.forEach(i=>{if(!i.cellEl||i.cellEl===t)return;const n=i.cellEl.querySelector(".apexcharts-xcrosshairs");n&&(s?(n.setAttribute("x",e.getAttribute("x")||"0"),n.setAttribute("x1",e.getAttribute("x1")||"0"),n.setAttribute("x2",e.getAttribute("x2")||"0"),n.classList.add("apexcharts-active")):n.classList.remove("apexcharts-active"))})},n=()=>{if(t!==this.trellis.elGrid)return e=0;s(),e=i?requestAnimationFrame(n):0};t.addEventListener("mousemove",t=>{i=t.target,e||(e=requestAnimationFrame(n))},{passive:!0}),t.addEventListener("mouseleave",()=>{i=null,e&&(cancelAnimationFrame(e),e=0),this.trellis.panels.forEach(t=>{const e=t.cellEl&&t.cellEl.querySelector(".apexcharts-xcrosshairs");e&&e.classList.remove("apexcharts-active")})},{passive:!0})}}function ft(t,e){const i=null!=t,s=null!=e;return i||s?{min:i?t:null,max:s?e:null}:null}function mt(t,e){return"function"==typeof t&&e?t===e.addXaxisAnnotation?"xaxis":t===e.addYaxisAnnotation?"yaxis":t===e.addPointAnnotation?"point":null:null}function gt(t,e){const i=t.config.annotations?u.clone(t.config.annotations):null,s=[],n=t.globals.memory&&t.globals.memory.methodsToExec||[];for(const t of n){if(!t||"addAnnotation"!==t.label)continue;const i=mt(t.method,e);i&&s.push({kind:i,params:u.clone(t.params)})}return{static:i,dynamic:s}}function yt(t){const e=t&&t.measure;if(!e||"function"!=typeof e.getPins)return null;const i=e.getPins();return Array.isArray(i)&&i.length?{pins:i}:null}class xt{constructor(t){this.trellis=t,this.active=!1,this._io=null,this._byCell=new Map,this._dirty=new Set,this._raf=null,this._draining=!1,this._gutterFloor=0}static supported(){return"undefined"!=typeof IntersectionObserver}_rootMargin(){const t=this.trellis.layout,e=t?Math.max(0,Math.round(t.panelH+t.headerH+t.gap)):300;return`${e}px 0px ${e}px 0px`}start(){xt.supported()&&(this.active=!0,this._io=new IntersectionObserver(t=>this._onEntries(t),{root:null,rootMargin:this._rootMargin(),threshold:0}),this.trellis.panels.forEach(t=>{var e;t.wantMounted=!1,t.cellEl&&(this._byCell.set(t.cellEl,t),null==(e=this._io)||e.observe(t.cellEl))}))}refresh(){this.active&&this._io&&(this._io.disconnect(),this._io=new IntersectionObserver(t=>this._onEntries(t),{root:null,rootMargin:this._rootMargin(),threshold:0}),this._byCell.forEach((t,e)=>{var i;return null==(i=this._io)?void 0:i.observe(e)}))}_onEntries(t){if(this.active){for(const e of t){const t=this._byCell.get(e.target);t&&(t.wantMounted=e.isIntersecting,this._dirty.add(t))}this._schedule()}}_schedule(){var t;this._raf||this._draining||!this.active||(this._raf=(t=()=>{this._raf=null,this._drain()},"function"==typeof requestAnimationFrame?{kind:"raf",id:requestAnimationFrame(t)}:{kind:"timeout",id:setTimeout(()=>t(0),16)}))}_drain(){return h(this,null,function*(){if(!this._draining&&this.active){this._draining=!0;try{let t=0,e=0;for(;this.active&&this._dirty.size&&t<2&&e<6;){const i=this._dirty.values().next().value;this._dirty.delete(i);const s=!!i.wantMounted;s!==!!i.chart&&(e++,s?(t++,yield this._mount(i)):this._unmount(i))}}finally{this._draining=!1,this.active&&this._dirty.size?this._schedule():this.active&&(this.trellis.w.globals.animationEnded=!0)}}})}_liveWindow(t){const e=this.trellis.panels.find(e=>e!==t&&e.chart);if(!e||!e.chart)return null;const i=e.chart.w,s=i.config.xaxis||{},n=Array.isArray(i.config.yaxis)?i.config.yaxis[0]:i.config.yaxis;return{zoomed:!!i.interact.zoomed,x:null!=s.min||null!=s.max?{min:s.min,max:s.max}:null,y:!n||null==n.min&&null==n.max?null:{min:n.min,max:n.max,tickAmount:n.tickAmount}}}_patchYaxis(t,e){const i=Array.isArray(t.yaxis)?t.yaxis:t.yaxis?[t.yaxis]:[{}];i.forEach(t=>{Object.keys(e).forEach(i=>{"labels"===i?t.labels=o(o({},t.labels||{}),e.labels):t[i]=e[i]})}),t.yaxis=i}_mount(t){return h(this,null,function*(){var e,i,s,n,r,a,l,h;const d=this.trellis;if(!t.el||t.chart||t.noMount)return;const u=t.viewStash,p="shared"===d._yMode(),f=!p,m=d._assemblePanelOptions(t.index,{noAnimation:!!u}),g=u&&u.window;g&&g.xaxis&&(m.xaxis=c(o({},m.xaxis||{}),{min:null!=(e=g.xaxis.min)?e:void 0,max:null!=(i=g.xaxis.max)?i:void 0})),f&&g&&Array.isArray(g.yaxis)&&g.yaxis[0]&&this._patchYaxis(m,{min:null!=(s=g.yaxis[0].min)?s:void 0,max:null!=(n=g.yaxis[0].max)?n:void 0});const y=this._liveWindow(t);y&&y.x&&(m.xaxis=c(o({},m.xaxis||{}),{min:y.x.min,max:y.x.max})),y&&y.y&&p&&this._patchYaxis(m,o({min:y.y.min,max:y.y.max},null!=y.y.tickAmount?{tickAmount:y.y.tickAmount}:{}));const x=d.sync.currentWindow;x&&x.x&&(m.xaxis=c(o({},m.xaxis||{}),{min:x.x.min,max:x.x.max})),x&&x.y&&p&&this._patchYaxis(m,o({min:x.y.min,max:x.y.max},null!=x.y.tickAmount?{tickAmount:x.y.tickAmount}:{})),f&&this._gutterFloor>0&&this._patchYaxis(m,{labels:{minWidth:this._gutterFloor}}),t.el.classList.remove("apexcharts-trellis-skeleton");const v=new d._ApexCharts(t.el,m);t.chart=v;try{yield v.render()}catch(e){return t.chart=null,void t.el.classList.add("apexcharts-trellis-skeleton")}if(this.active){if(v.w.interact.zoomed=x?!!x.zoomed:y?y.zoomed:!(!u||!u.zoomed),d.sync.applyHiddenTo(v),u&&u.annotations&&Array.isArray(u.annotations.dynamic)){const t={xaxis:"addXaxisAnnotation",yaxis:"addYaxisAnnotation",point:"addPointAnnotation"},e=v;u.annotations.dynamic.forEach(i=>{const s=t[i.kind];s&&"function"==typeof e[s]&&e[s](i.params,!0)})}if(t.viewStash=null,f){const t=null==(h=null==(l=null==(a=null==(r=v.w)?void 0:r.globals)?void 0:a.yLabelsCoords)?void 0:l[0])?void 0:h.width;if("number"==typeof t&&isFinite(t)){const e=v.w.globals.isBarHorizontal?0:d._yLabelPad(),i=Math.max(0,t-e);i>this._gutterFloor+.5&&(this._gutterFloor=i,yield d._pushGutterFloor(this._gutterFloor))}}d._fire("panelMounted",{key:t.key,index:t.index,chart:v,remounted:!!u})}})}_unmount(t){if(t.chart){try{t.viewStash=function(t,e){var i,s;const n=t.config.xaxis||{},r=(Array.isArray(t.config.yaxis)?t.config.yaxis:t.config.yaxis?[t.config.yaxis]:[]).map(t=>ft(t&&t.min,t&&t.max)),a=r.some(t=>null!==t),l=t.config.theme,o=e&&e.drilldown;return{v:1,window:{xaxis:ft(n.min,n.max),yaxis:a?r:null},zoomed:!!t.interact.zoomed,collapsed:(t.globals.collapsedSeriesIndices||[]).slice(),ancillaryCollapsed:(t.globals.ancillaryCollapsedSeriesIndices||[]).slice(),selectedDataPoints:(c=t.interact.selectedDataPoints,Array.isArray(c)?c.map(t=>Array.isArray(t)?t.slice():t):[]),theme:l?{mode:null!=(i=l.mode)?i:null,palette:null!=(s=l.palette)?s:null}:null,locale:t.config.chart&&t.config.chart.defaultLocale||null,annotations:gt(t,e),drill:o&&o.depth>0?{path:o.path.slice()}:null,measure:yt(e)};var c}(t.chart.w,t.chart)}catch(e){t.viewStash=null}try{t.chart.destroy()}catch(t){}if(t.chart=null,t.el){t.el.classList.add("apexcharts-trellis-skeleton");const e=this.trellis.layout;e&&(t.el.style.minHeight=`${e.panelH}px`)}}}stop(){var t;this.active=!1,this._io&&(this._io.disconnect(),this._io=null),this._byCell.clear(),this._dirty.clear(),(t=this._raf)&&("raf"===t.kind?cancelAnimationFrame(t.id):clearTimeout(t.id)),this._raf=null,this._gutterFloor=0}}class vt{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)/vt.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*vt.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},a=(n&&t.globals.svgWidth?r.width/t.globals.svgWidth:1)||1;return{left:r.left+t.layout.translateX*a,top:r.top+t.layout.translateY*a,width:t.layout.gridWidth*a,height:t.layout.gridHeight*a,zoom:a}}static screenXToPlotPx(t,e,i=vt.plotRect(t)){return(e-i.left)/i.zoom}}Object.setPrototypeOf({funnel:"bar",pyramid:"bar",gauge:"radialBar",waffle:"unit",histogram:"bar",waterfall:"rangeBar",dumbbell:"rangeBar",streamgraph:"rangeArea",raincloud:"violin",column:"bar"},null);const bt=["bar","rangeBar","candlestick","boxPlot","violin"];class _t{constructor(t){this.trellis=t,this.el=null,this._raf=0,this._lastEvent=null}wire(t,e){const i=f.createElement("div");i.className="apexcharts-trellis-tooltip apexcharts-theme-light",i.setAttribute("role","status"),e.appendChild(i),this.el=i;const s=()=>{this._update(e),this._raf=this._lastEvent?requestAnimationFrame(s):0};t.addEventListener("mousemove",t=>{this._lastEvent=t,this._raf||(this._raf=requestAnimationFrame(s))},{passive:!0}),t.addEventListener("mouseleave",()=>{this._lastEvent=null,this._raf&&(cancelAnimationFrame(this._raf),this._raf=0),i.classList.remove("apexcharts-trellis-tooltip-active")},{passive:!0})}_hoverIndex(t,e,i){const s=t.w,n=s.globals.dataPoints;if(!n||n<1)return-1;const r=s.layout.gridWidth;if(!r)return-1;const a=vt.screenXToPlotPx(s,e),l=s.globals.barPadForNumericAxis||0;if(a<-l||a>r+l)return-1;const o=s.dom&&s.dom.baseEl;if(o&&o.querySelector(".apexcharts-svg")){const t=lt.plotRect(s);if(t.height&&(i<t.top||i>t.top+t.height))return-1}const c=!bt.includes(s.config.chart.type)&&"between"!==s.config.xaxis.tickPlacement||s.config.xaxis.convertedCatToNumeric?Math.round(a/(r/Math.max(1,n-1))):Math.ceil(a/(r/n))-1;return Math.max(0,Math.min(n-1,c))}_valueAt(t,e,i,s){var n,r;const a=t.series.find(t=>t.name===e);if(!a||!Array.isArray(a.data))return null;const l=a.data[s];if(null==l)return null;let o=l;if(Array.isArray(l)?o=l[1]:"object"==typeof l&&(o=l.y),null==o)return null;const c=this.trellis.w.config,h=Array.isArray(null==(n=c.tooltip)?void 0:n.y)?c.tooltip.y[i]:null==(r=c.tooltip)?void 0:r.y,d=Array.isArray(c.yaxis)?c.yaxis[0]:c.yaxis,u=h&&"function"==typeof h.formatter&&h.formatter||d&&d.labels&&"function"==typeof d.labels.formatter&&d.labels.formatter||null,p=t=>{if(u)try{return String(u(t,{seriesIndex:i,dataPointIndex:s,w:null}))}catch(e){return String(t)}return String(t)};return Array.isArray(o)?o.map(p).join(" / "):p(o)}_update(t){const e=this.trellis,i=this.el,s=this._lastEvent;if(!i||!s||!e.split)return;const n=s.target&&s.target.closest?s.target.closest(".apexcharts-trellis-cell"):null,r=n?e.panels.find(t=>t.cellEl===n):void 0,a=r&&r.chart?this._hoverIndex(r.chart,s.clientX,s.clientY):-1;if(!r||-1===a)return void i.classList.remove("apexcharts-trellis-tooltip-active");const l=n?n.querySelector(".apexcharts-tooltip-title"):null,o=l&&l.textContent?l.textContent:"",c=e.split.seriesNames,h=e.scales,d=[];e.split.panels.forEach(t=>{const e=[];c.forEach((i,s)=>{const n=this._valueAt(t,i,s,a);if(null===n)return;const r=h?h.colorOf(i):"#008FFB";e.push(`<span class="apexcharts-trellis-tooltip-val"><span class="apexcharts-trellis-tooltip-marker" style="background:${At(r)}"></span>${wt(n)}</span>`)});const i=t.key===r.key;d.push(`<div class="apexcharts-trellis-tooltip-row${i?" apexcharts-trellis-tooltip-row-active":""}" data-key="${At(t.key)}"><span class="apexcharts-trellis-tooltip-key">${wt(t.key)}</span><span class="apexcharts-trellis-tooltip-vals">${e.join("")}</span></div>`)});let u="";o&&(u+=`<div class="apexcharts-tooltip-title">${wt(o)}</div>`),u+=d.join(""),i.innerHTML=u,i.classList.add("apexcharts-trellis-tooltip-active");const p=t.getBoundingClientRect(),f=lt.plotRect(r.chart.w).zoom;let m=(s.clientX-p.left)/f+14,g=(s.clientY-p.top)/f+14;const y=i.offsetWidth,x=i.offsetHeight,v=p.width/f,b=p.height/f;m+y>v-4&&(m=Math.max(4,m-y-28)),g+x>b-4&&(g=Math.max(4,g-x-28)),i.style.left=`${Math.round(m)}px`,i.style.top=`${Math.round(g)}px`}destroy(){this._raf&&(cancelAnimationFrame(this._raf),this._raf=0),this._lastEvent=null,this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=null}}function wt(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function At(t){return String(t).replace(/"/g,"&quot;")}class Et{constructor(t){this.trellis=t}supported(){return!!this.trellis.ctx.exports}_rectIn(t){const e=this.trellis.elWrap.getBoundingClientRect(),i=t.getBoundingClientRect();return{x:i.left-e.left,y:i.top-e.top,w:i.width,h:i.height}}_size(){const t=this.trellis.elWrap.getBoundingClientRect();return{w:Math.ceil(t.width),h:Math.ceil(t.height)}}_background(){const t=this.trellis.panels.find(t=>t.chart),e=t&&t.chart.exports;if(e&&"function"==typeof e.resolveExportBackground){const t=e.resolveExportBackground();if(t&&"transparent"!==t)return t}return"#fff"}_chromeTexts(){const t=this.trellis,e=[],i=(t,i)=>{if(!t||!t.textContent)return;const s=this._rectIn(t),n=getComputedStyle(t);e.push({text:t.textContent,x:"center"===i?s.x+s.w/2:s.x,y:s.y+s.h/2,font:`${n.fontWeight} ${n.fontSize} ${n.fontFamily}`,fontSize:parseFloat(n.fontSize)||12,color:n.color||"#373d3f",align:i})};return i(t.chrome.elTitle,"left"),t.panels.forEach(t=>{t.cellEl&&i(t.cellEl.querySelector(".apexcharts-trellis-header"),"center")}),t.chrome.elLegend&&t.chrome.elLegend.querySelectorAll(".apexcharts-legend-text").forEach(t=>i(t,"left")),e}_legendMarkers(){const t=this.trellis.chrome.elLegend;return t?Array.from(t.querySelectorAll(".apexcharts-legend-marker"),t=>({rect:this._rectIn(t),color:t.style.background||t.style.backgroundColor||"#008FFB"})):[]}dataURI(){return h(this,arguments,function*(t={}){const e=this.trellis,i=t.scale||1,s=this._size(),n=document.createElement("canvas");n.width=s.w*i,n.height=s.h*i;const r=n.getContext("2d");if(!r)return{imgURI:""};const a=r;a.scale(i,i),a.fillStyle=this._background(),a.fillRect(0,0,s.w,s.h);for(const t of e.panels){if(!t.el)continue;const e=this._rectIn(t.el);if(!t.chart){a.fillStyle="rgba(120, 120, 120, 0.06)",a.fillRect(e.x,e.y,e.w,e.h);continue}const{imgURI:s}=yield t.chart.dataURI({scale:i});if(!s)continue;const n=yield Mt(s);a.drawImage(n,e.x,e.y,e.w,e.h)}for(const t of this._chromeTexts())a.font=t.font,a.fillStyle=t.color,a.textAlign=t.align,a.textBaseline="middle",a.fillText(t.text,t.x,t.y);for(const t of this._legendMarkers())a.fillStyle=t.color,a.beginPath(),a.arc(t.rect.x+t.rect.w/2,t.rect.y+t.rect.h/2,Math.max(2,t.rect.w/2),0,2*Math.PI),a.fill();return{imgURI:n.toDataURL("image/png")}})}svgString(t=1){return h(this,null,function*(){const e=this.trellis,i=this._size(),s=[];s.push(`<svg xmlns="http://www.w3.org/2000/svg" width="${i.w*t}" height="${i.h*t}" viewBox="0 0 ${i.w} ${i.h}">`),s.push(`<rect width="${i.w}" height="${i.h}" fill="${this._background()}"/>`);for(const t of e.panels){if(!t.el)continue;const e=this._rectIn(t.el);if(!t.chart){s.push(`<rect x="${e.x}" y="${e.y}" width="${e.w}" height="${e.h}" fill="rgba(120,120,120,0.06)" rx="4"/>`);continue}const i=yield t.chart.getSvgString();s.push(`<g transform="translate(${e.x}, ${e.y})">${i}</g>`)}for(const t of this._chromeTexts()){const e="center"===t.align?"middle":"start";s.push(`<text x="${t.x}" y="${t.y}" text-anchor="${e}" dominant-baseline="central" style="font:${kt(t.font)};fill:${kt(t.color)}">${Ct(t.text)}</text>`)}for(const t of this._legendMarkers())s.push(`<circle cx="${t.rect.x+t.rect.w/2}" cy="${t.rect.y+t.rect.h/2}" r="${Math.max(2,t.rect.w/2)}" fill="${kt(t.color)}"/>`);return s.push("</svg>"),s.join("")})}csv(t={}){var e,i,s;const n=this.trellis,r=n.split;if(!r)return"";const a=n.w,l=t.columnDelimiter||(null==(s=null==(i=null==(e=a.config.chart.toolbar)?void 0:e.export)?void 0:i.csv)?void 0:s.columnDelimiter)||",",o=a.config.xaxis&&"datetime"===a.config.xaxis.type,c=t=>{if(null==t)return"";const e=String(t);return/[",\n]/.test(e)||-1!==e.indexOf(l)?`"${e.replace(/"/g,'""')}"`:e},h=t=>o&&"number"==typeof t?new Date(t).toISOString():t,d=r.seriesNames,u=[["x","facet",...d].map(c).join(l)];return r.panels.forEach(t=>{r.unionX.forEach((e,i)=>{const s=[h(e),t.key];d.forEach(e=>{const n=t.series.find(t=>t.name===e);if(!n||!Array.isArray(n.data))return void s.push("");const r=n.data[i];let a=r;Array.isArray(r)?a=r[1]:r&&"object"==typeof r&&(a=r.y),s.push(Array.isArray(a)?a.join("|"):a)}),u.push(s.map(c).join(l))})}),u.join(t.lineDelimiter||"\n")}download(t){return h(this,arguments,function*(t,e={}){var i;const s=this.trellis,n=(null==(i=s.w.config.chart.toolbar)?void 0:i.export)||{},r=String(s.w.globals.chartID||"trellis");if("png"===t){const{imgURI:t}=yield this.dataURI();St(t,n.png&&n.png.filename||r,".png")}else if("svg"===t){const t=yield this.svgString();St("data:image/svg+xml;charset=utf-8,"+encodeURIComponent(t),n.svg&&n.svg.filename||r,".svg")}else St("data:text/csv;charset=utf-8,"+encodeURIComponent("\ufeff"+this.csv(e)),e.fileName||n.csv&&n.csv.filename||r,".csv")})}}function Mt(t){return new Promise((e,i)=>{const s=new Image;s.onload=()=>e(s),s.onerror=i,s.src=t})}function St(t,e,i){const s=document.createElement("a");s.href=t,s.download=e+i,document.body.appendChild(s),s.click(),document.body.removeChild(s)}function Ct(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function kt(t){return String(t).replace(/"/g,"&quot;")}const Lt=["annotations","colors","dataLabels","fill","forecastDataPoints","grid","markers","noData","states","stroke","tooltip"],Ft={treemap:"trellis does not support treemap: area encoding needs room a panel cannot give. Rendering a single chart.",sunburst:"trellis does not support sunburst: its labels are illegible at panel size. Rendering a single chart.",unit:"the unit type has its own small-multiples mode (plotOptions.unit.grid.split), which beats a trellis of unit charts. Rendering a single chart."};d.registerFeatures({trellis:class{constructor(t,e){this.w=t,this.ctx=e,this.panels=[],this._stripEls=[],this.split=null,this.scales=null,this.layout=null,this.cfg={},this.sync=new pt(this),this.chrome=new dt(this),this.virtual=new xt(this),this.exports=new Et(this),this.gridTooltip=null,this._promotedKey=null,this._ApexCharts=d,this._virtualActive=!1,this._panelRenderer=null,this._yLabelDecimals=0,this.elWrap=null,this.elGrid=null,this._mounted=!1,this._rendering=!1,this._renderPromise=null,this._raf=0,this._lastWidth=0,this._lastHeight=0,this._chromeH=0,this._overflowWarned=!1,this._resizeHandler=this._onContainerResize.bind(this),this.autoScaleYaxis=!1,this._elChromeTop=null,this._vetoWarned=!1,this._noKeyWarned=!1,this._frames=null}isActive(){var t;const e=this.w.config.trellis;if(!e||!(e.by||e.row||e.column))return!1;const i=null==(t=this.w.config.chart)?void 0:t.type;if(i&&Ft[i])return this._vetoWarned||(this._vetoWarned=!0,console.warn(`ApexCharts: ${Ft[i]}`)),!1;if(e.by&&!e.row&&!e.column&&!Array.isArray(e.data)&&!(this.w.config.series||[]).some((t,i)=>null!==L(t,i,e.by))){if(!this._noKeyWarned){this._noKeyWarned=!0;const t="function"==typeof e.by?"the `trellis.by` function returned no key for any series":`no series carries the \`trellis.by\` key '${e.by}'`;console.warn(`ApexCharts: ${t}; there is nothing to split. Rendering as a single chart.`)}return!1}return!0}_layoutCfg(){return this.split&&"2d"===this.split.mode&&this.split.colKeys?c(o({},this.cfg),{columns:this.split.colKeys.length}):this.cfg}_stackingHost(){var t,e;const i=this.w.config,s=i.chart||{},n=i.highlightFilter||{};return{stacked:!!s.stacked,stackType:s.stackType,stackOnlyBar:!!s.stackOnlyBar,parts:!!M._featureRegistry.get("highlightFilter")&&!1!==n.enabled&&"clamp"!==n.axis&&["bar","line","area"].includes(s.type)&&!(null==(e=null==(t=i.plotOptions)?void 0:t.bar)?void 0:e.isFunnel)}}_yMode(){var t;return this._frames&&this._frames.forceSharedY?"shared":(null==(t=this.cfg.scales)?void 0:t.y)||"shared"}_yBoundsFor(t){var e,i;const s=this.scales;if(!s)return null;if(this._frames&&this._frames.skipYaxisPush)return null;const n=this._yMode();return"shared"===n?s.y:"independent-row"===n&&s.rowY?s.rowY.get(null!=(e=t.rowKey)?e:"")||null:"independent-column"===n&&s.colY&&s.colY.get(null!=(i=t.colKey)?i:"")||null}_valueAxisIsX(){var t,e;const i=this.w.config;return["bar","boxPlot","violin"].includes(i.chart.type)&&!!(null==(e=null==(t=i.plotOptions)?void 0:t.bar)?void 0:e.horizontal)}_valueAxisXPatch(t){var e,i;const s={min:t.min,max:t.max};return"number"!=typeof(null==(i=null==(e=this.ctx.opts)?void 0:e.xaxis)?void 0:i.tickAmount)&&(s.tickAmount=t.tickAmount),s}_groupId(){return`${this.w.globals.chartID}-tg`}_fire(t,e){var i,s;const n=null==(s=null==(i=this.w.config.chart)?void 0:i.events)?void 0:s[t];"function"==typeof n&&n(this.ctx,e),this.ctx.events.fireEvent(t,[this.ctx,e])}render(){const t=this._render();return this._renderPromise=t,t}whenSettled(){return this._rendering&&this._renderPromise?this._renderPromise.catch(()=>{}):Promise.resolve()}_render(){return h(this,null,function*(){var t,e,i,s;const n=this.w;if(!this._mounted&&!this._rendering)if(p.isBrowser()){this._rendering=!0;try{this.cfg=n.config.trellis||{},this.autoScaleYaxis=!!(null==(e=null==(t=n.config.chart)?void 0:t.zoom)?void 0:e.autoScaleYaxis);let r=n.config.series||[];if(Array.isArray(this.cfg.data)){const t=function(t,e={}){const i=[],s=e.by;if("string"!=typeof s||!s)return{series:[],warnings:["trellis: tidy-row input (trellis.data) needs a string `by` column name"]};const n=e.x,r=e.y;if(!n||!r)return{series:[],warnings:["trellis: tidy-row input (trellis.data) needs `x` and `y` column names"]};const a=Array.isArray(t)?t:[];if(!a.length)return{series:[],warnings:["trellis: trellis.data is empty"]};const l=e.seriesBy;let o=0,c=0;const h=new Map;a.forEach(t=>{if(!t||"object"!=typeof t)return void o++;const e=t[s],i=t[n];if(null==e||null==i)return void o++;const a=l&&void 0!==t[l]&&null!==t[l]?String(t[l]):String(r);let d=h.get(String(e));d||(d=new Map,h.set(String(e),d));let u=d.get(a);u||(u=new Map,d.set(a,u));const p=i instanceof Date?i.getTime():i;u.has(p)&&c++;const f=t[r];u.set(p,void 0===f?null:f)}),o&&i.push(`trellis: ${o} row(s) missing "${s}" or "${n}" were skipped`),c&&i.push(`trellis: ${c} duplicate (panel, series, x) row(s); kept the last. Aggregate the rows first if you want sums or means.`);const d=[];return h.forEach((t,e)=>{t.forEach((t,i)=>{d.push({name:i,[s]:e,data:Array.from(t,([t,e])=>({x:t,y:e}))})})}),{series:d,warnings:i}}(this.cfg.data,this.cfg);t.warnings.forEach(t=>console.warn(`ApexCharts: ${t}`)),t.series.length&&(r.length&&console.warn("ApexCharts: trellis received both `series` and `trellis.data`; using trellis.data."),r=t.series)}const a=P(r,this.cfg,{chartType:n.config.chart.type});if(this.split=a,a.warnings.forEach(t=>console.warn(`ApexCharts: ${t}`)),!a.panels.length)return;a.dropped>0&&console.warn(`ApexCharts: trellis rendered ${a.panels.length} panels; ${a.dropped} more hidden by trellis.limit.`);const l=null!=(i=this.cfg.virtualize)?i:"auto";let h=!0===l||"auto"===l&&a.panels.length>64;h&&!xt.supported()&&(console.warn("ApexCharts: trellis virtualization needs IntersectionObserver; rendering eagerly."),h=!1),this._virtualActive=h,!h&&a.panels.length>64&&console.warn(`ApexCharts: trellis with ${a.panels.length} panels renders eagerly; set trellis.virtualize (or trellis.limit).`),a.panels.length>256&&console.warn(`ApexCharts: ${a.panels.length} trellis panels is a lot to read at once; consider trellis.limit.`);const u="histogram"===n.config.chart.requestedType?"histogram":n.config.chart.type;this._frames=D(a,this.cfg,n.config,u),this._frames.warnings.forEach(t=>console.warn(`ApexCharts: ${t}`)),this._yLabelDecimals=this._frames.yExtentOverride?0:function(t){let e=0;const i=t=>{const i=V(t);i>e&&(e=i)};return t.forEach(t=>t.series.forEach(t=>{Array.isArray(t.data)&&t.data.forEach(t=>{if(null==t)return;let e=t;Array.isArray(t)?e=t[1]:"object"==typeof t&&(e=t.y),Array.isArray(e)?e.forEach(i):i(e)})})),e}(a.panels);const p=this._yMode()!==((null==(s=this.cfg.scales)?void 0:s.y)||"shared")?c(o({},this.cfg),{scales:c(o({},this.cfg.scales||{}),{y:this._yMode()})}):this.cfg;this.scales=Z(a,p,o({chartType:n.config.chart.type,userColors:this.ctx.opts&&this.ctx.opts.colors,yExtentOverride:this._frames.yExtentOverride},this._stackingHost())),this._panelRenderer=function(t,e,i,s){if(i&&i.chart&&i.chart.renderer)return null;if(!s)return null;const n={config:{series:t.panels.reduce((t,e)=>t.concat(e.series),[]),chart:{type:e.chart.type},markers:e.markers,dataLabels:e.dataLabels,fill:e.fill,plotOptions:e.plotOptions,states:e.states}};if(_(n))return null;const r=e.chart.rendererThreshold||8e3;return b(n)>=r?"canvas":null}(a,n.config,this.ctx.opts,E._rendererRegistry.has("canvas")),this._buildSkeleton();const f=this._containerWidth();this._lastWidth=f,this._lastHeight=this._hostHeight()||0,this._chromeH=0,this.layout=J({panelCount:a.panels.length,containerWidth:f,cfg:this._layoutCfg(),hostHeight:this._hostHeight(),chromeHeight:this._chromeH}),this._applyGridStyle(),this._buildCells();const m="shared"!==this._yMode(),y=this.elWrap;if(h)this.virtual.start();else{m&&(y.style.visibility="hidden");for(let t=0;t<this.panels.length;t++){const e=this.panels[t];if(e.noMount)continue;const i=this._assemblePanelOptions(e.index),s=new d(e.el,i);e.chart=s,yield s.render(),this._fire("panelMounted",{key:e.key,index:e.index,chart:s})}m&&(yield this._alignGutters(),y.style.visibility="")}this.chrome.buildTitle(this._elChromeTop),this.chrome.buildToolbar(y),this.chrome.buildLegend(y),this.sync.wireCrosshairs(this.elGrid),"grid"===(this.cfg.tooltip||"panel")&&(this.gridTooltip=new _t(this),this.gridTooltip.wire(this.elGrid,y)),this._mounted=!0,this._refitForChrome(),g(this.ctx.el,this._resizeHandler),h||(n.globals.animationEnded=!0),this._fire("trellisMounted",{panels:this.getPanels()})}finally{this._rendering=!1}}else console.warn("ApexCharts: trellis rendering is browser-only in this version; SSR hosts render nothing.")})}_containerWidth(){const t=this.ctx.el;return t.getBoundingClientRect().width||t.clientWidth||800}_hostHeight(){var t;const e=this.w.config.chart&&this.w.config.chart.height;if(null==e||""===e||"auto"===e)return;const i=String(e).trim();if(i.endsWith("%")){const e=parseFloat(i);if(!isFinite(e)||e<=0)return;const s=null==(t=this.ctx.el)?void 0:t.parentNode;if(!s||"function"!=typeof s.getBoundingClientRect)return;const n=(s.getBoundingClientRect().height||s.clientHeight||0)*e/100;return n>0?n:void 0}const s=parseFloat(i);return isFinite(s)&&s>0?s:void 0}_chromeHeight(){const t=this.elWrap,e=this.elGrid;if(!t||!e||"function"!=typeof t.getBoundingClientRect)return 0;const i=t.getBoundingClientRect().height-e.getBoundingClientRect().height;return isFinite(i)&&i>0?i:0}_buildSkeleton(){var t;const e=this.ctx.el,i=f.createElementNS("http://www.w3.org/1999/xhtml","div");i.className="apexcharts-trellis",this.split&&"2d"===this.split.mode&&i.classList.add("apexcharts-trellis-2d"),i.id=`apexcharts-trellis${this.w.globals.chartID}`,i.setAttribute("data-tooltip-mode",this.cfg.tooltip||"panel");const s=null==(t=this.w.config.chart)?void 0:t.foreColor;s&&i.style.setProperty("--apx-trellis-fore",s);const n=f.createElement("div");n.className="apexcharts-trellis-chrome",i.appendChild(n),this._elChromeTop=n;const r=f.createElement("div");r.className="apexcharts-trellis-grid",i.appendChild(r),e.appendChild(i),this.elWrap=i,this.elGrid=r,this.w.dom.baseEl=e,this.w.dom.elWrap=i}_applyGridStyle(){var t;const e=this.elGrid,i=this.layout;e.style.display="grid";const s=this.split&&"2d"===this.split.mode&&!1!==(null==(t=this.cfg.header)?void 0:t.show);e.style.gridTemplateColumns=s?`auto repeat(${i.cols}, minmax(0, 1fr))`:`repeat(${i.cols}, minmax(0, 1fr))`,e.style.gap=`${i.gap}px`}_buildCells(){var t;const e=this.elGrid,i=this.split,s=this.layout,n="2d"===i.mode,r=n&&!1!==(null==(t=this.cfg.header)?void 0:t.show);this._stripEls=[];const a=this.cfg.emptyPanels||"placeholder";if(r){const t=f.createElement("div");t.className="apexcharts-trellis-corner",e.appendChild(t),this._stripEls.push(t),(i.colKeys||[]).forEach((t,s)=>{const n=this.chrome.stripEl("column",t,{index:s,count:(i.colKeys||[]).length});e.appendChild(n),this._stripEls.push(n)})}this.panels=[],i.panels.forEach((t,l)=>{var o;if(r&&l%s.cols===0){const t=Math.floor(l/s.cols),n=this.chrome.stripEl("row",null!=(o=(i.rowKeys||[])[t])?o:"",{index:t,count:(i.rowKeys||[]).length});e.appendChild(n),this._stripEls.push(n)}const c=f.createElement("div");c.className="apexcharts-trellis-cell",c.setAttribute("data-key",t.key),this._applyCellMutes(c,s.cells[l]),n||this.chrome.buildHeader(c,t.key,{index:l,count:i.panels.length});const h=f.createElement("div");h.className="apexcharts-trellis-panel",this._virtualActive&&(h.classList.add("apexcharts-trellis-skeleton"),h.style.minHeight=`${s.panelH}px`),c.appendChild(h);const d=t.empty&&"placeholder"!==a;if(t.empty)if(c.classList.add("apexcharts-trellis-cell-empty"),"hide"===a)c.classList.add("apexcharts-trellis-cell-hidden");else if("skip"===a)h.classList.add("apexcharts-trellis-skeleton"),h.style.minHeight=`${s.panelH}px`;else{const t=f.createElement("div");t.className="apexcharts-trellis-empty-label",t.textContent=this.w.config.noData&&this.w.config.noData.text||"no data",c.appendChild(t)}e.appendChild(c),this.panels.push({key:t.key,index:l,el:h,cellEl:c,chart:null,empty:t.empty,noMount:d})})}_applyCellMutes(t,e){t.classList.toggle("apexcharts-trellis-mute-x",!e.showXLabels),t.classList.toggle("apexcharts-trellis-mute-y",!e.showYLabels)}_assemblePanelOptions(t,{noAnimation:e=!1}={}){var i,s,n,r,a,l,h,d,p,f,m,g,y,x;const v=this.w,b=this.split,_=this.scales,w=this.layout,A=b.panels[t],E=u.clone(this.ctx.opts||{});delete E.trellis,delete E.series,delete E.responsive,E.annotations&&(E.annotations=function(t,e){if(!t||"object"!=typeof t)return t;const i=o({},t);for(const t of["yaxis","xaxis","points","texts","images"]){const s=i[t];Array.isArray(s)&&(i[t]=s.filter(t=>!t||void 0===t.scope||null===t.scope||"trellis"===t.scope||(Array.isArray(t.scope)?-1!==t.scope.map(String).indexOf(e):String(t.scope)===e)).map(t=>{if(!t||void 0===t.scope)return t;const e=o({},t);return delete e.scope,e}))}return i}(E.annotations,A.key));const M=E.chart||{},S=M.events||{},C=v.globals.chartID,k=null==(n=null==(s=null==(i=this.ctx.opts)?void 0:i.chart)?void 0:s.animations)?void 0:n.enabled,L=e||b.panels.length>16&&void 0===k,F=A.empty&&"placeholder"===(this.cfg.emptyPanels||"placeholder");let N=F?[W(b,{chartType:v.config.chart.type})]:A.series;const H=["pie","donut","polarArea","radialBar"].includes(v.config.chart.type);H&&(N=N.flatMap(t=>Array.isArray(t.data)?t.data:[]).map(t=>"number"==typeof t&&isFinite(t)?t:0));const O=o(o(c(o({chart:c(o(o({id:`${C}-tp${t}`,group:this._groupId(),height:w.panelH,width:"100%",redrawOnParentResize:!1,redrawOnWindowResize:!1,print:{enabled:!1},parentHeightOffset:0,toolbar:{show:!1},zoom:{enabled:"none"!==this.cfg.zoom,resetControl:"none"==this.cfg.toolbar&&!1!==v.config.chart.zoom.resetControl}},L?{animations:{enabled:!1}}:{}),this._panelRenderer?{renderer:this._panelRenderer}:{}),{events:c(o({},S),{zoomed:this.sync.makeZoomedHandler(S.zoomed),scrolled:this.sync.makeScrolledHandler(S.scrolled)})}),series:N},H?{}:{colors:N.map(t=>_.colorOf(t.name))}),{title:{text:"",margin:0,floating:!0},subtitle:{text:"",margin:0,floating:!0},legend:{show:!1}}),F?{tooltip:{enabled:!1}}:{}),w.panelH<120&&"grid"!==this.cfg.tooltip&&"boolean"!=typeof(null==(a=null==(r=this.ctx.opts)?void 0:r.tooltip)?void 0:a.compact)?{tooltip:{compact:!0}}:{});if(!(null==(l=M.sparkline)?void 0:l.enabled)&&!["pie","donut","polarArea","radialBar","radar","treemap"].includes(v.config.chart.type)){const t=E.grid&&E.grid.padding||{},e="datetime"===(null==(d=null==(h=this.ctx.opts)?void 0:h.xaxis)?void 0:d.type)?2:7;O.grid={padding:{top:("number"==typeof t.top?t.top:0)-12,bottom:("number"==typeof t.bottom?t.bottom:0)-e}}}const P=this._valueAxisIsX();_.x&&!P&&(O.xaxis={min:_.x.min,max:_.x.max});const $=this._yBoundsFor(A);if($){const t=Array.isArray(null==(p=this.ctx.opts)?void 0:p.yaxis)?this.ctx.opts.yaxis[0]:null==(f=this.ctx.opts)?void 0:f.yaxis,e=Array.isArray(E.yaxis)?E.yaxis[0]:E.yaxis;let i={};if("function"!=typeof(null==(m=null==t?void 0:t.labels)?void 0:m.formatter)){const t=($.max-$.min)/Math.max(1,$.tickAmount),e=Math.max(this._yLabelDecimals,V(t));i={labels:{formatter:t=>"number"==typeof t&&isFinite(t)?t.toFixed(e):t}}}O.yaxis=u.extend(e||{},o({min:$.min,max:$.max,tickAmount:$.tickAmount},i)),delete E.yaxis,P&&(O.xaxis=u.extend(O.xaxis||{},this._valueAxisXPatch($)))}const T=this._frames;if(T&&T.plotOptions&&(O.plotOptions=u.clone(T.plotOptions)),T&&T.pieScaleOf){const t=T.pieScaleOf(A.key);if(null!==t){const e=null==(x=null==(y=null==(g=this.ctx.opts)?void 0:g.plotOptions)?void 0:y.pie)?void 0:x.customScale;O.plotOptions=u.extend(O.plotOptions||{},{pie:{customScale:t*("number"==typeof e?e:1)}})}}let B=u.extend(E,O);if("function"==typeof this.cfg.panel){const e=this.cfg.panel(A.key,{index:t,seriesNames:A.seriesNames});e&&"object"==typeof e&&(B=u.extend(B,e))}return B}_alignGutters(){return h(this,null,function*(){var t,e,i,s;const n=this.panels.map(t=>{var e,i,s,n,r;return null==(r=null==(n=null==(s=null==(i=null==(e=t.chart)?void 0:e.w)?void 0:i.globals)?void 0:s.yLabelsCoords)?void 0:n[0])?void 0:r.width}).filter(t=>"number"==typeof t&&isFinite(t));if(!n.length)return;const r=(null==(s=null==(i=null==(e=null==(t=this.panels[0])?void 0:t.chart)?void 0:e.w)?void 0:i.globals)?void 0:s.isBarHorizontal)?0:10,a=Math.max(0,Math.max(...n)-r);yield this._pushGutterFloor(a)})}_yLabelPad(){return 10}_pushGutterFloor(t){return h(this,null,function*(){for(const e of this.panels)e.chart&&(yield e.chart.updateOptions({yaxis:ut(e.chart,{labels:{minWidth:t}})},!1,!1,!1).catch(()=>{}))})}_refitForChrome(){if(!this._hostHeight())return;const t=this._chromeHeight();t<=0||Math.round(t)===Math.round(this._chromeH)?this._warnIfOverflowing():(this._chromeH=t,this._relayout(this._containerWidth()))}_warnIfOverflowing(){const t=this.layout;t&&t.overflowH&&!this._overflowWarned&&(this._overflowWarned=!0,console.warn(`ApexCharts: trellis needs ${Math.round(t.gridH+this._chromeH)}px but its container gives ${Math.round(this._hostHeight()||0)}px; ${t.rows} rows cannot go below the ${t.panelH}px panel floor. Raise the container, use fewer panels (trellis.limit) or more columns (trellis.columns), or lower trellis.minPanelHeight.`))}_onContainerResize(){this._mounted&&(this._raf||(this._raf=requestAnimationFrame(()=>{this._raf=0;const t=this._containerWidth(),e=this._hostHeight()||0;if(Math.round(t)!==Math.round(this._lastWidth)||Math.round(e)!==Math.round(this._lastHeight)){if(this._lastWidth=t,this._lastHeight=e,this._promotedKey){const t=this.panels.find(t=>t.key===this._promotedKey);return void(t&&t.chart&&t.chart.updateOptions({},!1,!1,!1).catch(()=>{}))}this._relayout(t)}})))}promote(t){return h(this,null,function*(){var e;const i=this.panels.find(e=>e.key===String(t));if(!i||i.noMount||!this._mounted)return;if(this._promotedKey===i.key)return;this._promotedKey&&(yield this.restorePromotion()),this._promotedKey=i.key;const s=this.layout,n=this.elGrid?this.elGrid.getBoundingClientRect().height:0,r=Math.round(Math.max(280,Math.min(560,n||(s?2.4*s.panelH:420))));null==(e=this.elWrap)||e.classList.add("apexcharts-trellis-promoting"),this.panels.forEach(t=>{if(!t.cellEl)return;const e=t===i;t.cellEl.classList.toggle("apexcharts-trellis-cell-promoted",e),t.cellEl.classList.toggle("apexcharts-trellis-cell-parked",!e)}),this._stripEls.forEach(t=>t.classList.add("apexcharts-trellis-cell-parked")),this.chrome.buildBreadcrumb(this._elChromeTop,i.key,()=>this.restorePromotion()),!i.chart&&this._virtualActive&&(i.wantMounted=!0,this.virtual._dirty.add(i),this.virtual._schedule()),i.el&&(i.el.style.minHeight=`${r}px`),i.chart&&(yield i.chart.updateOptions({chart:{height:r}},!1,!1,!1).catch(()=>{})),this._fire("panelPromoted",{key:i.key,chart:i.chart})})}restorePromotion(){return h(this,null,function*(){var t;if(!this._promotedKey)return;const e=this.panels.find(t=>t.key===this._promotedKey);this._promotedKey=null,null==(t=this.elWrap)||t.classList.remove("apexcharts-trellis-promoting"),this.panels.forEach(t=>{t.cellEl&&(t.cellEl.classList.remove("apexcharts-trellis-cell-promoted"),t.cellEl.classList.remove("apexcharts-trellis-cell-parked"))}),this._stripEls.forEach(t=>t.classList.remove("apexcharts-trellis-cell-parked")),this.chrome.removeBreadcrumb();const i=this.layout;e&&e.el&&i&&(e.el.style.minHeight=`${i.panelH}px`),e&&e.chart&&i&&(yield e.chart.updateOptions({chart:{height:i.panelH}},!1,!1,!1).catch(()=>{})),this._lastWidth=0,this._relayout(this._containerWidth()),this._lastWidth=this._containerWidth(),this._fire("panelRestored",{key:e?e.key:null})})}_relayout(t){const e=this.split;if(!e)return;const i=this.layout?this.layout.panelH:0;this.layout=J({panelCount:e.panels.length,containerWidth:t,cfg:this._layoutCfg(),hostHeight:this._hostHeight(),chromeHeight:this._chromeH}),this._applyGridStyle(),this._warnIfOverflowing();const s=this.layout;this.panels.forEach((t,e)=>{if(t.cellEl&&this._applyCellMutes(t.cellEl,s.cells[e]),t.el&&this._virtualActive&&(t.el.style.minHeight=`${s.panelH}px`),!t.chart)return;const n=s.panelH!==i?{chart:{height:s.panelH}}:{};t.chart.updateOptions(n,!1,!1,!1).catch(()=>{})}),this._virtualActive&&this.virtual.refresh()}canApplyInPlace(t){if(!this._mounted||this._promotedKey)return!1;if(!t||"object"!=typeof t)return!1;const e=Object.keys(t);return!!e.length&&e.every(t=>Lt.includes(t))}applyPanelOptions(t=!0){return h(this,null,function*(){var e,i,s;const n=this.split;if(!n)return;const r=this._yMode()!==((null==(e=this.cfg.scales)?void 0:e.y)||"shared")?c(o({},this.cfg),{scales:c(o({},this.cfg.scales||{}),{y:this._yMode()})}):this.cfg;this.scales=Z(n,r,o({chartType:this.w.config.chart.type,userColors:this.ctx.opts&&this.ctx.opts.colors,yExtentOverride:this._frames?this._frames.yExtentOverride:null},this._stackingHost())),yield Promise.all(this.panels.map(e=>{if(!e.chart)return Promise.resolve();const i=this._assemblePanelOptions(e.index);return delete i.series,i.chart&&delete i.chart.height,e.chart.updateOptions(i,!1,t,!1,!1).catch(()=>{})})),null==(s=(i=this.chrome).refreshLegendColors)||s.call(i)})}updateSeries(t,e=!0){return h(this,null,function*(){var i;const s=this.w;if(Array.isArray(this.cfg.data)&&this.cfg.data.length)return console.warn("ApexCharts: this trellis renders from trellis.data; update it via updateOptions({ trellis: { data } })."),Promise.resolve();if(s.config.series=t,this.ctx.opts&&(this.ctx.opts.series=t),!this._mounted)return this.ctx.render();const n=P(t||[],this.cfg,{chartType:s.config.chart.type});if(n.panels.length!==this.panels.length||!n.panels.every((t,e)=>t.key===this.panels[e].key))return this.teardown(),this.ctx.render();this.split=n,this._frames=D(n,this.cfg,s.config,"histogram"===s.config.chart.requestedType?"histogram":s.config.chart.type);const r=this._yMode()!==((null==(i=this.cfg.scales)?void 0:i.y)||"shared")?c(o({},this.cfg),{scales:c(o({},this.cfg.scales||{}),{y:this._yMode()})}):this.cfg;this.scales=Z(n,r,o({chartType:s.config.chart.type,userColors:this.ctx.opts&&this.ctx.opts.colors,yExtentOverride:this._frames.yExtentOverride},this._stackingHost()));const a=this.scales,l=this._frames,h=["pie","donut","polarArea","radialBar"].includes(s.config.chart.type),d=this.panels.map((t,i)=>{var s,r,o;if(!t.chart)return Promise.resolve();const c={series:h?n.panels[i].series.flatMap(t=>Array.isArray(t.data)?t.data:[]).map(t=>"number"==typeof t&&isFinite(t)?t:0):n.panels[i].series},d=this._valueAxisIsX();a.x&&!d&&(c.xaxis={min:a.x.min,max:a.x.max});const p=this._yBoundsFor(n.panels[i]);if(p&&(c.yaxis=ut(t.chart,{min:p.min,max:p.max,tickAmount:p.tickAmount}),d&&(c.xaxis=u.extend(c.xaxis||{},this._valueAxisXPatch(p)))),l.plotOptions&&(c.plotOptions=u.clone(l.plotOptions)),l.pieScaleOf){const t=l.pieScaleOf(n.panels[i].key);if(null!==t){const e=null==(o=null==(r=null==(s=this.ctx.opts)?void 0:s.plotOptions)?void 0:r.pie)?void 0:o.customScale;c.plotOptions=u.extend(c.plotOptions||{},{pie:{customScale:t*("number"==typeof e?e:1)}})}}return t.chart.updateOptions(c,!1,e,!1).catch(()=>{})});return Promise.all(d)})}getPanels(){return this.panels.map(t=>({key:t.key,index:t.index,chart:t.chart,el:t.cellEl}))}getPanel(t){const e=this.panels.find(e=>e.key===String(t));return e?e.chart:null}teardown(){this.virtual.stop(),this._virtualActive=!1,this._panelRenderer=null,this._promotedKey=null,this._frames=null,this.chrome.destroyGradientLegend(),this.gridTooltip&&(this.gridTooltip.destroy(),this.gridTooltip=null),this._raf&&(cancelAnimationFrame(this._raf),this._raf=0),p.isBrowser()&&this.ctx.el&&y(this.ctx.el,this._resizeHandler),this.panels.forEach(t=>{if(t.chart)try{t.chart.destroy()}catch(t){}t.chart=null}),this.panels=[],this._stripEls=[],this.elWrap&&this.elWrap.parentNode&&this.elWrap.parentNode.removeChild(this.elWrap),this.elWrap=null,this.elGrid=null,this._mounted=!1,this.ctx._renderPromise=null}}}),t.default=d,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexTrellis={})});
@@ -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
5
  "use strict";var e=Object.defineProperty,t=Object.defineProperties,r=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,n=(t,r,a)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[r]=a,s=(e,t)=>{for(var r in t||(t={}))l.call(t,r)&&n(e,r,t[r]);if(a)for(var r of a(t))o.call(t,r)&&n(e,r,t[r]);return e},i=(e,a)=>t(e,r(a));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function c(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const u=c(require("apexcharts/core")),d=u.__apex_Graphics,f=u.__apex_Environment_Environment;const p=u.__apex_Utils;function y(e,t){const r=(t.collapsedSeries||[]).concat(t.ancillaryCollapsedSeries||[]);return e.map((e,t)=>{const n=e||{},{hidden:c}=n,u=((e,t)=>{var r={};for(var n in e)l.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&a)for(var n of a(e))t.indexOf(n)<0&&o.call(e,n)&&(r[n]=e[n]);return r})(n,["hidden"]);let d=u.data;if(Array.isArray(d)&&!d.length){const e=r.find(e=>e.index===t);e&&Array.isArray(e.data)&&(d=e.data)}return i(s({},u),{data:Array.isArray(d)?d.slice():d})})}function h(e,t,r){const a=r&&void 0!==r[t]?r[t]:t+1;return null==e?{x:a,y:null,isSubtotal:!1,isTotal:!1,rest:{}}:Array.isArray(e)?{x:void 0!==e[0]?e[0]:a,y:e[1],isSubtotal:!1,isTotal:!1,rest:{}}:"object"==typeof e?{x:void 0!==e.x?e.x:a,y:e.y,isSubtotal:!0===e.isSubtotal,isTotal:!0===e.isTotal,rest:e}:{x:a,y:e,isSubtotal:!1,isTotal:!1,rest:{}}}function b(e,t,r){if(e&&e.fillColor)return e.fillColor;const a=r[t];return"string"==typeof a&&a?a:void 0}function v(e,t){var r,a,l;const o=t.config,n=t.globals;if(!Array.isArray(e))return e;n.waterfallRawSeries||(n.waterfallRawSeries=y(e,n));const c=n.waterfallRawSeries,u=(null==(a=null==(r=o.plotOptions)?void 0:r.waterfall)?void 0:a.colors)||{},d=null==(l=o.xaxis)?void 0:l.categories,f=function(e){return(e.collapsedSeriesIndices||[]).concat(e.ancillaryCollapsedSeriesIndices||[])}(n),v=[],g=[],m=[],w=c.map((e,t)=>{const r=Array.isArray(null==e?void 0:e.data)?e.data:[];if(-1!==f.indexOf(t))return v[t]=[],g[t]=[],m[t]=[],i(s({},e),{data:[]});if(function(e){for(let t=0;t<e.length;t++){const r=e[t],a=Array.isArray(r)?r[1]:r&&"object"==typeof r?r.y:r;if(Array.isArray(a)&&2===a.length)return!0}return!1}(r))return v[t]=r.map(e=>{const t=Array.isArray(e)?e[1]:e&&"object"==typeof e?e.y:e;if(!Array.isArray(t))return null;const r=p.parseNumber(t[0]),a=p.parseNumber(t[1]);return null===r||null===a?null:a-r}),g[t]=r.map(e=>{const t=Array.isArray(e)?e[1]:e&&"object"==typeof e?e.y:e,r=Array.isArray(t)?p.parseNumber(t[1]):null;return null===r?0:r}),m[t]=r.map(()=>null),e;const a=function(e,t,r){const a=[],l=[],o=[],n=[];let c=0,u=0;for(let d=0;d<e.length;d++){const{x:f,y:y,isSubtotal:v,isTotal:g,rest:m}=h(e[d],d,t);let w,x,A;if(g||v)w=g?0:u,x=c,A=g?"total":"subtotal",u=c;else{const e=p.parseNumber(y);if(null===e||!isFinite(e)){a.push(i(s({},m),{x:f,y:null})),l.push(null),o.push(c),n.push(null);continue}w=c,x=c+e,c=x,A=e<0?"negative":"positive"}const S=b(m,A,r);a.push(s(i(s({},m),{x:f,y:[w,x]}),S?{fillColor:S}:{})),l.push(x-w),o.push(c),n.push(A)}return{data:a,values:l,cumulative:o,kinds:n}}(r,d,u);return v[t]=a.values,g[t]=a.cumulative,m[t]=a.kinds,i(s({},e),{data:a.data})});return t.waterfallData={values:v,cumulative:g,kinds:m,geometry:[]},w}const g="__apexcharts_series_transforms__";var m,w;globalThis[g]||(globalThis[g]={}),m="waterfall","function"==typeof(w=v)?globalThis[g][m]=w:console.warn(`ApexCharts: registerSeriesTransform("${m}") expects a function (series, w) => series.`),u.default.registerFeatures({waterfall:class{constructor(e,t){this.w=e,this.ctx=t}isActive(){return"waterfall"===this.w.config.chart.requestedType}drawConnectors(){var e,t;const r=this.w;if(!this.isActive())return;const a=null==(t=null==(e=r.config.plotOptions)?void 0:e.waterfall)?void 0:t.connectors;if(!a||!1===a.show)return;const l=r.dom.elGraphical,o=r.waterfallData&&r.waterfallData.geometry;if(!l||!o)return;this.removeConnectors();const n=new d(r,this.ctx),s=n.group({class:"apexcharts-waterfall-connectors"}),i=a.color||r.config.grid.borderColor,c=null==a.strokeWidth?1:a.strokeWidth,u=null==a.strokeDashArray?3:a.strokeDashArray;let f=0;for(let e=0;e<o.length;e++){const t=o[e];if(Array.isArray(t))for(let e=0;e<t.length-1;e++){const r=t[e],a=t[e+1];if(!r||!a)continue;if(!(a.slotStart-r.slotEnd>.5))continue;const l=r.horizontal?n.drawLine(r.levelEnd,r.slotEnd,r.levelEnd,a.slotStart,i,u,c):n.drawLine(r.slotEnd,r.levelEnd,a.slotStart,r.levelEnd,i,u,c);l.node.classList.add("apexcharts-waterfall-connector"),s.add(l),f++}}if(!f)return;s.attr("clip-path",`url(#gridRectBarMask${r.globals.cuid})`);const p=l.node.querySelector(".apexcharts-xaxis");p?l.node.insertBefore(s.node,p):l.add(s),this.holdUntilBarsLand(s)}removeConnectors(){const e=this.w.dom.elGraphical,t=e&&e.node.querySelector(".apexcharts-waterfall-connectors");t&&t.parentNode&&t.parentNode.removeChild(t)}holdUntilBarsLand(e){const t=this.w;f.isBrowser()&&t.globals.shouldAnimate&&!t.globals.animationEnded&&(e.node.classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:e.node,holdUntilComplete:!0}))}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>u.default}),exports.waterfallTransform=v;
@@ -30,7 +30,7 @@ var __objRest = (source, exclude) => {
30
30
  return target;
31
31
  };
32
32
  /*!
33
- * ApexCharts v8.2.0
33
+ * ApexCharts v8.3.1
34
34
  * (c) 2018-2026 ApexCharts
35
35
  */
36
36
  import * as _core from "apexcharts/core";
@@ -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
5
  !function(e){var t="undefined"!=typeof globalThis?globalThis:self,r=t.ApexCharts;if(r&&r.__internals)return e.call(t);if(r)throw new Error("ApexCharts: dist/features/waterfall.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");if("function"==typeof define&&define.amd)return e.call(t);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/features/waterfall.js is a script-tag add-on and needs the ApexCharts script on the page. A bundler imports the matching apexcharts/ sub-path instead.");var a={file:"dist/features/waterfall.js",run:e,done:!1},s=t.__apexcharts_pending_addons__||(t.__apexcharts_pending_addons__=[]);s.push(a),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!a.done){var r=t.ApexCharts;if(r)if(r.__internals){a.done=!0;var n=s.indexOf(a);-1!==n&&s.splice(n,1);try{e.call(t),r.__drainsAddons||t.console.warn("ApexCharts: dist/features/waterfall.js loaded before the ApexCharts script, which is older than 8.0 and does not pick up add-ons loaded first, so it registered only when the page finished loading. Put its tag after the ApexCharts script.")}catch(e){t.console.error("ApexCharts: dist/features/waterfall.js could not register with the ApexCharts script on this page: "+(e&&e.message))}}else t.console.error("ApexCharts: dist/features/waterfall.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");else t.console.warn("ApexCharts: dist/features/waterfall.js is waiting for the ApexCharts script, which had not loaded when the page finished loading. It registers when an ApexCharts 8.0 or later script loads; if the page has none, add apexcharts.min.js (or apexcharts.core.min.js, or apexcharts.full.min.js).")}})}(function(){var e,t;e=this,t=function(e){"use strict";var t=Object.defineProperty,r=Object.defineProperties,a=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,l=(e,r,a)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,i=(e,t)=>{for(var r in t||(t={}))n.call(t,r)&&l(e,r,t[r]);if(s)for(var r of s(t))o.call(t,r)&&l(e,r,t[r]);return e},d=(e,t)=>r(e,a(t));const c=globalThis.ApexCharts,f=globalThis.ApexCharts.__internals.__apex_Graphics,u=globalThis.ApexCharts.__internals.__apex_Environment_Environment,p=globalThis.ApexCharts.__internals.__apex_Utils;function h(e,t){const r=(t.collapsedSeries||[]).concat(t.ancillaryCollapsedSeries||[]);return e.map((e,t)=>{const a=e||{},{hidden:l}=a,c=((e,t)=>{var r={};for(var a in e)n.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&s)for(var a of s(e))t.indexOf(a)<0&&o.call(e,a)&&(r[a]=e[a]);return r})(a,["hidden"]);let f=c.data;if(Array.isArray(f)&&!f.length){const e=r.find(e=>e.index===t);e&&Array.isArray(e.data)&&(f=e.data)}return d(i({},c),{data:Array.isArray(f)?f.slice():f})})}function y(e,t,r){const a=r&&void 0!==r[t]?r[t]:t+1;return null==e?{x:a,y:null,isSubtotal:!1,isTotal:!1,rest:{}}:Array.isArray(e)?{x:void 0!==e[0]?e[0]:a,y:e[1],isSubtotal:!1,isTotal:!1,rest:{}}:"object"==typeof e?{x:void 0!==e.x?e.x:a,y:e.y,isSubtotal:!0===e.isSubtotal,isTotal:!0===e.isTotal,rest:e}:{x:a,y:e,isSubtotal:!1,isTotal:!1,rest:{}}}function x(e,t,r){if(e&&e.fillColor)return e.fillColor;const a=r[t];return"string"==typeof a&&a?a:void 0}function g(e,t){var r,a,s;const n=t.config,o=t.globals;if(!Array.isArray(e))return e;o.waterfallRawSeries||(o.waterfallRawSeries=h(e,o));const l=o.waterfallRawSeries,c=(null==(a=null==(r=n.plotOptions)?void 0:r.waterfall)?void 0:a.colors)||{},f=null==(s=n.xaxis)?void 0:s.categories,u=function(e){return(e.collapsedSeriesIndices||[]).concat(e.ancillaryCollapsedSeriesIndices||[])}(o),g=[],w=[],A=[],b=l.map((e,t)=>{const r=Array.isArray(null==e?void 0:e.data)?e.data:[];if(-1!==u.indexOf(t))return g[t]=[],w[t]=[],A[t]=[],d(i({},e),{data:[]});if(function(e){for(let t=0;t<e.length;t++){const r=e[t],a=Array.isArray(r)?r[1]:r&&"object"==typeof r?r.y:r;if(Array.isArray(a)&&2===a.length)return!0}return!1}(r))return g[t]=r.map(e=>{const t=Array.isArray(e)?e[1]:e&&"object"==typeof e?e.y:e;if(!Array.isArray(t))return null;const r=p.parseNumber(t[0]),a=p.parseNumber(t[1]);return null===r||null===a?null:a-r}),w[t]=r.map(e=>{const t=Array.isArray(e)?e[1]:e&&"object"==typeof e?e.y:e,r=Array.isArray(t)?p.parseNumber(t[1]):null;return null===r?0:r}),A[t]=r.map(()=>null),e;const a=function(e,t,r){const a=[],s=[],n=[],o=[];let l=0,c=0;for(let f=0;f<e.length;f++){const{x:u,y:h,isSubtotal:g,isTotal:w,rest:A}=y(e[f],f,t);let b,m,v;if(w||g)b=w?0:c,m=l,v=w?"total":"subtotal",c=l;else{const e=p.parseNumber(h);if(null===e||!isFinite(e)){a.push(d(i({},A),{x:u,y:null})),s.push(null),n.push(l),o.push(null);continue}b=l,m=l+e,l=m,v=e<0?"negative":"positive"}const _=x(A,v,r);a.push(i(d(i({},A),{x:u,y:[b,m]}),_?{fillColor:_}:{})),s.push(m-b),n.push(l),o.push(v)}return{data:a,values:s,cumulative:n,kinds:o}}(r,f,c);return g[t]=a.values,w[t]=a.cumulative,A[t]=a.kinds,d(i({},e),{data:a.data})});return t.waterfallData={values:g,cumulative:w,kinds:A,geometry:[]},b}const w="__apexcharts_series_transforms__";var A,b;globalThis[w]||(globalThis[w]={}),A="waterfall","function"==typeof(b=g)?globalThis[w][A]=b:console.warn(`ApexCharts: registerSeriesTransform("${A}") expects a function (series, w) => series.`),c.registerFeatures({waterfall:class{constructor(e,t){this.w=e,this.ctx=t}isActive(){return"waterfall"===this.w.config.chart.requestedType}drawConnectors(){var e,t;const r=this.w;if(!this.isActive())return;const a=null==(t=null==(e=r.config.plotOptions)?void 0:e.waterfall)?void 0:t.connectors;if(!a||!1===a.show)return;const s=r.dom.elGraphical,n=r.waterfallData&&r.waterfallData.geometry;if(!s||!n)return;this.removeConnectors();const o=new f(r,this.ctx),l=o.group({class:"apexcharts-waterfall-connectors"}),i=a.color||r.config.grid.borderColor,d=null==a.strokeWidth?1:a.strokeWidth,c=null==a.strokeDashArray?3:a.strokeDashArray;let u=0;for(let e=0;e<n.length;e++){const t=n[e];if(Array.isArray(t))for(let e=0;e<t.length-1;e++){const r=t[e],a=t[e+1];if(!r||!a)continue;if(!(a.slotStart-r.slotEnd>.5))continue;const s=r.horizontal?o.drawLine(r.levelEnd,r.slotEnd,r.levelEnd,a.slotStart,i,c,d):o.drawLine(r.slotEnd,r.levelEnd,a.slotStart,r.levelEnd,i,c,d);s.node.classList.add("apexcharts-waterfall-connector"),l.add(s),u++}}if(!u)return;l.attr("clip-path",`url(#gridRectBarMask${r.globals.cuid})`);const p=s.node.querySelector(".apexcharts-xaxis");p?s.node.insertBefore(l.node,p):s.add(l),this.holdUntilBarsLand(l)}removeConnectors(){const e=this.w.dom.elGraphical,t=e&&e.node.querySelector(".apexcharts-waterfall-connectors");t&&t.parentNode&&t.parentNode.removeChild(t)}holdUntilBarsLand(e){const t=this.w;u.isBrowser()&&t.globals.shouldAnimate&&!t.globals.animationEnded&&(e.node.classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:e.node,holdUntilComplete:!0}))}}}),e.default=c,e.waterfallTransform=g,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ApexWaterfall={})});