apexcharts 8.2.0 → 8.3.0

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 (222) hide show
  1. package/README.md +7 -7
  2. package/dist/apexcharts.common.js +2 -2
  3. package/dist/apexcharts.core.js +271 -173
  4. package/dist/apexcharts.core.min.js +2 -2
  5. package/dist/apexcharts.css +35 -0
  6. package/dist/apexcharts.esm.js +1722 -1527
  7. package/dist/apexcharts.full.js +1459 -1075
  8. package/dist/apexcharts.full.min.js +2 -2
  9. package/dist/apexcharts.js +994 -715
  10. package/dist/apexcharts.min.js +2 -2
  11. package/dist/apexcharts.ssr.common.js +2 -2
  12. package/dist/apexcharts.ssr.esm.js +994 -715
  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 +433 -394
  17. package/dist/bar.js +2 -2
  18. package/dist/boxPlot.common.js +2 -2
  19. package/dist/boxPlot.esm.js +364 -322
  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 +364 -322
  24. package/dist/candlestick.js +2 -2
  25. package/dist/column.common.js +2 -2
  26. package/dist/column.esm.js +433 -394
  27. package/dist/core.common.js +2 -2
  28. package/dist/core.esm.js +271 -173
  29. package/dist/donut.common.js +1 -1
  30. package/dist/donut.esm.js +1 -1
  31. package/dist/dumbbell.common.js +2 -2
  32. package/dist/dumbbell.esm.js +433 -394
  33. package/dist/features/all.common.js +2 -2
  34. package/dist/features/all.esm.js +250 -187
  35. package/dist/features/annotations.common.js +1 -1
  36. package/dist/features/annotations.esm.js +1 -1
  37. package/dist/features/annotations.js +1 -1
  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 +1 -1
  48. package/dist/features/exports.esm.js +1 -1
  49. package/dist/features/exports.js +1 -1
  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 +63 -43
  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 +1 -1
  78. package/dist/features/morph.esm.js +1 -1
  79. package/dist/features/morph.js +1 -1
  80. package/dist/features/perspectives.common.js +1 -1
  81. package/dist/features/perspectives.esm.js +1 -1
  82. package/dist/features/perspectives.js +1 -1
  83. package/dist/features/raincloud.common.js +1 -1
  84. package/dist/features/raincloud.esm.js +1 -1
  85. package/dist/features/raincloud.js +1 -1
  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 +1 -1
  90. package/dist/features/stats.esm.js +1 -1
  91. package/dist/features/stats.js +1 -1
  92. package/dist/features/storyboard.common.js +1 -1
  93. package/dist/features/storyboard.esm.js +1 -1
  94. package/dist/features/storyboard.js +1 -1
  95. package/dist/features/streamgraph.common.js +2 -2
  96. package/dist/features/streamgraph.esm.js +3 -2
  97. package/dist/features/streamgraph.js +2 -2
  98. package/dist/features/toolbar.common.js +2 -2
  99. package/dist/features/toolbar.esm.js +92 -2
  100. package/dist/features/toolbar.js +2 -2
  101. package/dist/features/trellis.common.js +2 -2
  102. package/dist/features/trellis.esm.js +83 -47
  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 +1 -1
  108. package/dist/features/weave.esm.js +1 -1
  109. package/dist/features/weave.js +1 -1
  110. package/dist/full.common.js +2 -2
  111. package/dist/full.esm.js +950 -795
  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 +433 -394
  117. package/dist/icicle.common.js +2 -2
  118. package/dist/icicle.esm.js +54 -38
  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 +1 -1
  129. package/dist/pie.esm.js +1 -1
  130. package/dist/pie.js +1 -1
  131. package/dist/polarArea.common.js +1 -1
  132. package/dist/polarArea.esm.js +1 -1
  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 +1 -1
  137. package/dist/radialBar.esm.js +1 -1
  138. package/dist/radialBar.js +1 -1
  139. package/dist/raincloud.common.js +2 -2
  140. package/dist/raincloud.esm.js +72 -26
  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 +433 -394
  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 +93 -41
  149. package/dist/sunburst.common.js +2 -2
  150. package/dist/sunburst.esm.js +103 -93
  151. package/dist/sunburst.js +2 -2
  152. package/dist/treemap.common.js +2 -2
  153. package/dist/treemap.esm.js +105 -86
  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 +432 -393
  166. package/package.json +1 -1
  167. package/src/apexcharts.js +13 -6
  168. package/src/assets/apexcharts.css +35 -0
  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 +37 -37
  173. package/src/charts/Line.js +118 -42
  174. package/src/charts/Radar.js +5 -7
  175. package/src/charts/RangeBar.js +47 -43
  176. package/src/charts/Sunburst.js +101 -98
  177. package/src/charts/Treemap.js +108 -66
  178. package/src/charts/Unit.js +368 -250
  179. package/src/charts/Violin.js +48 -30
  180. package/src/charts/common/Breadcrumb.js +2 -2
  181. package/src/charts/common/Hierarchy.js +32 -11
  182. package/src/charts/common/Jitter.js +32 -7
  183. package/src/charts/common/bar/DataLabels.js +76 -81
  184. package/src/charts/common/bar/Helpers.js +43 -7
  185. package/src/charts/common/line/Helpers.js +12 -15
  186. package/src/charts/common/partition/NodeTooltip.js +8 -1
  187. package/src/charts/common/partition/Partition.js +33 -1
  188. package/src/charts/common/treemap/Helpers.js +3 -11
  189. package/src/locales/en.json +2 -1
  190. package/src/locales/ro.json +3 -2
  191. package/src/modules/Core.js +4 -0
  192. package/src/modules/CoreUtils.js +18 -42
  193. package/src/modules/Data.js +23 -24
  194. package/src/modules/DataLabels.js +6 -6
  195. package/src/modules/Graphics.js +62 -49
  196. package/src/modules/Markers.js +3 -1
  197. package/src/modules/Range.js +44 -29
  198. package/src/modules/RendererController.js +17 -3
  199. package/src/modules/Scales.js +32 -9
  200. package/src/modules/Series.js +39 -18
  201. package/src/modules/Theme.js +1 -1
  202. package/src/modules/ZoomPanSelection.js +119 -2
  203. package/src/modules/accessibility/KeyboardNavigation.js +114 -186
  204. package/src/modules/animations/LengthTransition.js +22 -2
  205. package/src/modules/drilldown/Breadcrumb.js +5 -2
  206. package/src/modules/helpers/Destroy.js +1 -1
  207. package/src/modules/highlightFilter/HighlightFilter.js +8 -9
  208. package/src/modules/highlightFilter/TreemapPart.js +2 -2
  209. package/src/modules/legend/HeatmapGradientLegend.js +76 -45
  210. package/src/modules/legend/Helpers.js +2 -0
  211. package/src/modules/legend/Legend.js +11 -12
  212. package/src/modules/settings/Options.js +7 -0
  213. package/src/modules/streamgraph/StreamLabels.js +1 -0
  214. package/src/modules/tooltip/Tooltip.js +20 -4
  215. package/src/modules/tooltip/Utils.js +8 -0
  216. package/src/modules/trellis/Trellis.js +6 -0
  217. package/src/modules/trellis/TrellisChrome.js +18 -7
  218. package/src/modules/trellis/TrellisSync.js +2 -0
  219. package/src/renderers/canvas/CanvasGraphics.js +1 -0
  220. package/src/ssr/DOMShim.js +10 -0
  221. package/src/types/internal.d.ts +9 -3
  222. package/types/apexcharts.d.ts +31 -12
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.2.0
2
+ * ApexCharts v8.3.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- "use strict";var e=Object.defineProperty,t=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,o=(t,a,i)=>a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[a]=i,s=(e,s)=>{for(var n in s||(s={}))a.call(s,n)&&o(e,n,s[n]);if(t)for(var n of t(s))i.call(s,n)&&o(e,n,s[n]);return e};Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function n(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const a in e)if("default"!==a){const i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:()=>e[a]})}return t.default=e,Object.freeze(t)}const l=n(require("apexcharts/core")),r=l.__apex_Animations,c=l.__apex_Animations_computeStagger,h=l.__apex_Graphics,d=l.__apex_Fill,g=l.__apex_Series,p=l.__apex_Utils,f=l.__apex_DataLabels,m=(e,t,a,i)=>{if("function"!=typeof e)return e;const o=e({series:t.seriesData.series,seriesIndex:a,dataPointIndex:i,w:t});return Number.isFinite(o)?o:0};class u{constructor(e,t){this.ctx=t,this.w=e}checkColorRange(){const e=this.w;let t=!1;const a=e.config.plotOptions[e.config.chart.type];return a.colorScale.ranges.length>0&&a.colorScale.ranges.map(e=>{e.from<=0&&(t=!0)}),t}getShadeColor(e,t,a,i){const o=this.w;let s=1;const n=o.config.plotOptions[e].shadeIntensity,l=this.determineColor(e,t,a);o.globals.hasNegs||i?s=o.config.plotOptions[e].reverseNegativeShade?l.percent<0?l.percent/100*(1.25*n):(1-l.percent/100)*(1.25*n):l.percent<=0?1-(1+l.percent/100)*n:(1-l.percent/100)*n:(s=1-l.percent/100,"treemap"===e&&(s=(1-l.percent/100)*(1.25*n)));let r=l.color;const c=new p;if(o.config.plotOptions[e].enableShades)if("dark"===this.w.config.theme.mode){const e=c.shadeColor(-1*s,l.color);r=p.hexToRgba(p.isColorHex(e)?e:p.rgb2hex(e),o.config.fill.opacity)}else{const e=c.shadeColor(s,l.color);r=p.hexToRgba(p.isColorHex(e)?e:p.rgb2hex(e),o.config.fill.opacity)}return{color:r,colorProps:l}}determineColor(e,t,a){const i=this.w,o=i.seriesData.series[t][a],s=i.config.plotOptions[e];let n=s.colorScale.inverse?a:t;s.distributed&&"treemap"===i.config.chart.type&&(n=a);let l,r,c=i.globals.colors[n],h=null;if(s.distributed||"heatmap"!==e){const e=i.seriesData.series[t];l=e.length?e[0]:0,r=l;for(let t=1;t<e.length;t++)e[t]<l&&(l=e[t]),e[t]>r&&(r=e[t])}else l=i.globals.minY,r=i.globals.maxY;const d=s.colorScale.min,g=s.colorScale.max;void 0!==d&&void 0!==g&&g>d?(l=d,r=g):void 0!==d&&(l=d<i.globals.minY?d:i.globals.minY,r=g>i.globals.maxY?g:i.globals.maxY);const p=Math.abs(r)+Math.abs(l),f=Math.min(Math.max(o,l),r);let m=0===p?0:100*f/p;if(s.colorScale.ranges.length>0){s.colorScale.ranges.map(e=>{if(o>=e.from&&o<=e.to){c=e.color,h=e.foreColor?e.foreColor:null,l=e.from,r=e.to;const t=Math.abs(r)+Math.abs(l);m=0===t?0:100*o/t}})}return{color:c,foreColor:h,percent:m}}calculateDataLabels({text:e,x:t,y:a,i:i,j:o,colorProps:s,fontSize:n}){const l=this.w,r=l.config.dataLabels,c=new h(this.w),d=new f(this.w,this.ctx);let g=null;if(r.enabled){g=c.group({class:"apexcharts-data-labels"});const h=m(r.offsetX,l,i,o),p=m(r.offsetY,l,i,o),f=t+h,u=a+parseFloat(r.style.fontSize)/3+p;d.plotDataLabelsText({x:f,y:u,text:e,i:i,j:o,color:s.foreColor,parent:g,fontSize:n,dataLabelsConfig:r})}return g}}const x=l.__apex_Filters,b=l.__apex_BrowserAPIs_BrowserAPIs,y=l.__apex_Environment_Environment,w=l.__apex_Easing_resolveEasing;function _(e){var t;const a=e.config.chart.animations;if(!a||!1===a.enabled)return!1;if(!a.dynamicAnimation||!1===a.dynamicAnimation.enabled)return!1;const i=null!=(t=a.largeDatasetThreshold)?t:0;return!(i>0&&e.globals.dataPoints>i)&&!!(y.isBrowser()&&e.globals.dataChanged&&e.globals.shouldAnimate)}const S=l.__apex_math_SVGNS;function C(e){const t=e.globals;let a=t.minXDiff;if(!e.seriesData.series.some(e=>e.length>1)){const i=e.seriesData.seriesX.map(e=>e&&e[0]).filter(Number.isFinite).sort((e,t)=>e-t);a=1/0;for(let e=1;e<i.length;e++)i[e]>i[e-1]&&(a=Math.min(a,i[e]-i[e-1]));a===1/0&&(a=(t.maxX-t.minX)/4)}return Number.isFinite(a)&&a>0?a:0}l.default.use({heatmap:class{constructor(e,t,a){this.ctx=t,this.w=e,this.xRatio=a.xRatio,this.yRatio=a.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new u(e,t),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.shape=this.w.config.plotOptions.heatmap.shape||"rect",this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}padXRange(e){const{w:t}=e,a=t.globals,i=t.config.xaxis;if(("numeric"===i.type||"datetime"===i.type)&&a.initialMinX<a.initialMaxX){e._getMinXDiff();const o=C(t)/2;a.initialMinX-=o,a.initialMaxX+=o,null==i.min&&null==i.max&&null==i.range&&(a.minX-=o,a.maxX+=o,i.tickAmount||a.xTickAmount!==a.dataPoints-1||(a.xTickAmount=a.dataPoints))}}draw(e){var t,a;const i=this.w,o=new h(this.w,this.ctx),s=o.group({class:"apexcharts-heatmap"}),n=i.layout.gridWidth/i.globals.dataPoints,l=i.layout.gridHeight/i.seriesData.series.length,c=("numeric"===i.config.xaxis.type||"datetime"===i.config.xaxis.type)&&i.axisFlags.isXNumeric&&this.xRatio>0;let f=n;if(c){const e=C(i);e&&(f=e/this.xRatio)}let m=this.shape;c&&"hexagon"===m&&(m="rect");const u=function(e,t){const a=e&&e.renderer;return a&&a.kind&&"svg"!==a.kind?a:t}(this.ctx,o),b="rect"===m&&u!==o&&"function"==typeof u.drawRectCell;"hexagon"===m?this.applyHexagonClipPath(s,o,n,l):s.attr("clip-path",`url(#gridRectMask${i.globals.cuid})`);const y=Array.isArray(i.config.fill.opacity)?null!=(t=i.config.fill.opacity[0])?t:1:null!=(a=i.config.fill.opacity)?a:1;let w=0,S=!1;this.negRange=this.helpers.checkColorRange();const P=e.slice();i.config.yaxis[0].reversed&&(S=!0,P.reverse());for(let t=S?0:P.length-1;S?t<P.length:t>=0;S?t++:t--){const a=o.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:p.escapeString(i.seriesData.seriesNames[t]),rel:t+1,"data:realIndex":t});if(g.addCollapsedClassToSeries(this.w,a,t),b||o.setupEventDelegation(a,".apexcharts-heatmap-rect"),i.config.chart.dropShadow.enabled){const e=i.config.chart.dropShadow;new x(this.w).dropShadow(a,e,t)}let h=0;const S=i.config.plotOptions.heatmap.shadeIntensity,C=Math.round(w/l),P="hexagon"===m?(C%2==0?-1:1)*n/4:0;let v=0;for(let s=0;s<i.globals.dataPoints;s++){if(!c&&i.seriesData.seriesX.length&&!i.globals.allSeriesHasEqualX&&i.globals.minX+i.globals.minXDiff*s<i.seriesData.seriesX[t][v]){h+=n;continue}if(v>=e[t].length)break;const g=c?f:n;if(c){const e=i.seriesData.seriesX[t]?i.seriesData.seriesX[t][v]:null;if(null==e||e!=e){v++;continue}h=(e-i.globals.minX)/this.xRatio-f/2}const x=this.helpers.getShadeColor(i.config.chart.type,t,v,this.negRange);let C=x.color;const $=x.colorProps;if("image"===i.config.fill.type){C=new d(this.w).fillPath({seriesNumber:t,dataPointIndex:v,opacity:i.globals.hasNegs?$.percent<0?1-(1+$.percent/100):S+$.percent/100:$.percent/100,patternID:p.randomId(),width:i.config.fill.image.width?i.config.fill.image.width:g,height:i.config.fill.image.height?i.config.fill.image.height:l})}const M=this.rectRadius,D=i.config.plotOptions.heatmap.useFillColorAsStroke?C:i.globals.stroke.colors[0];if(b)u.drawRectCell(h,w,g,l,{fill:C,fillOpacity:y,stroke:D,strokeWidth:this.strokeWidth,radius:M,seriesIndex:t,dataPointIndex:v});else{const s="rect"===m,n=s?o.drawRect(h,w,g,l,M):o.drawPath({d:this.cellShapePath(m,h+P,w,g,l),stroke:D,strokeWidth:this.strokeWidth,fill:C,fillOpacity:1});if(n.attr({cx:h+P,cy:w}),n.node.classList.add("apexcharts-heatmap-rect"),a.add(n),n.attr({fill:C,i:t,index:t,j:v,val:e[t][v],"stroke-width":this.strokeWidth,stroke:D,color:C}),s||n.attr({width:g,height:l}),i.config.chart.animations.enabled&&!i.globals.dataChanged){const e=i.config.chart.animations.speed;if(i.globals.resized)i.globals.animationEnded=!0;else if(s)this.animateHeatMap(n,h,w,g,l,e,t,v);else{const a=new r(this.w);a.animatePop(n,{speed:e,delay:this.enterStaggerDelay(e,t,v),onComplete:()=>{a.animationCompleted(n)}})}}if(i.globals.dataChanged){let e=1;if(this.dynamicAnim.enabled&&i.globals.shouldAnimate){e=this.dynamicAnim.speed;const a=i.globals.previousPaths[t]&&i.globals.previousPaths[t][v],o=p.isColorHex(C)?C:p.rgb2hex(C);if(null==a?void 0:a.color){const t=a.rect,r=s&&t&&_(i)&&[t.x,t.y,t.width,t.height].every(Number.isFinite)&&(Math.abs(t.x-h)>.5||Math.abs(t.y-w)>.5||Math.abs(t.width-g)>.5||Math.abs(t.height-l)>.5)?t:null;this.animateHeatColor(n,p.isColorHex(a.color)?a.color:p.rgb2hex(a.color),o,e,r&&{from:r,to:{x:h,y:w,width:g,height:l}})}else if(s){const t=h+g/2,a=w+l/2;this.animateHeatColor(n,o,o,e,{from:{x:t,y:a,width:0,height:0},to:{x:h,y:w,width:g,height:l}})}else new r(this.w).animatePop(n,{speed:e})}}}if(i.config.dataLabels.enabled){const e=(0,i.config.dataLabels.formatter)(i.seriesData.series[t][v],{value:i.seriesData.series[t][v],seriesIndex:t,dataPointIndex:v,w:i}),o=this.helpers.calculateDataLabels({text:e,x:h+P+g/2,y:w+l/2,i:t,j:v,colorProps:$});null!==o&&a.add(o)}c||(h+=n),v++}w+=l,s.add(a)}return s}animateHeatMap(e,t,a,i,o,s,n=0,l=0){const c=new r(this.w),h=this.enterStaggerDelay(s,n,l);c.animateRect(e,{x:t+i/2,y:a+o/2,width:0,height:0},{x:t,y:a,width:i,height:o},s,()=>{c.animationCompleted(e)},h)}enterStaggerDelay(e,t,a){const i=this.w,o=i.config.chart.animations.animateGradually;if(!o||!1===o.enabled)return 0;const s=((i.seriesData.series||[]).length||1)+(i.globals.dataPoints||1)-2,n=Math.min(o.delay||0,.5*e/Math.max(1,s));return c({style:"diagonal",index:a,row:t,col:a,baseDelay:n})}cellShapePath(e,t,a,i,o){const s=t+i/2,n=a+o/2;if("circle"===e){const e=Math.min(i,o)/2;return`M ${s-e} ${n} a ${e} ${e} 0 1 0 ${2*e} 0 a ${e} ${e} 0 1 0 ${2*-e} 0 Z`}if("diamond"===e)return`M ${s} ${a} L ${t+i} ${n} L ${s} ${a+o} L ${t} ${n} Z`;const l=t+i;return`M ${s} ${a-o/6} L ${l} ${a+o/6} L ${l} ${a+5*o/6} L ${s} ${a+7*o/6} L ${t} ${a+5*o/6} L ${t} ${a+o/6} Z`}applyHexagonClipPath(e,t,a,i){const o=this.w,s=this.strokeWidth/2+2,n=`heatmapHexMask${o.globals.cuid}`,l=o.dom.elDefs.node,r=l.querySelector(`clipPath[id="${n}"]`);r&&r.parentNode&&r.parentNode.removeChild(r);const c=b.createElementNS(S,"clipPath");c.setAttribute("id",n),c.appendChild(t.drawRect(-a/4-s,-i/6-s,o.layout.gridWidth+a/2+2*s,o.layout.gridHeight+i/3+2*s,0,"#fff").node),l.appendChild(c),e.attr("clip-path",`url(#${n})`)}animateHeatColor(e,t,a,i,o=null){const n=e.attr(s({fill:t},null==o?void 0:o.from)).animate(i).attr(s({fill:a},null==o?void 0:o.to));o&&n.ease(function(e){var t,a;const i=e.config.chart.animations;return w(null!=(a=null==(t=i.dynamicAnimation)?void 0:t.easing)?a:i.easing)}(this.w))}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>l.default});
5
+ "use strict";var e=Object.defineProperty,t=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,o=(t,a,i)=>a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[a]=i,s=(e,s)=>{for(var n in s||(s={}))a.call(s,n)&&o(e,n,s[n]);if(t)for(var n of t(s))i.call(s,n)&&o(e,n,s[n]);return e};Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function n(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const a in e)if("default"!==a){const i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:()=>e[a]})}return t.default=e,Object.freeze(t)}const l=n(require("apexcharts/core")),r=l.__apex_Animations,c=l.__apex_Animations_computeStagger,h=l.__apex_Graphics,d=l.__apex_Fill,g=l.__apex_Series,p=l.__apex_Utils,f=l.__apex_DataLabels;class m{constructor(e,t){this.ctx=t,this.w=e}checkColorRange(){const e=this.w;let t=!1;const a=e.config.plotOptions[e.config.chart.type];return a.colorScale.ranges.length>0&&a.colorScale.ranges.map(e=>{e.from<=0&&(t=!0)}),t}getShadeColor(e,t,a,i){const o=this.w;let s=1;const n=o.config.plotOptions[e].shadeIntensity,l=this.determineColor(e,t,a);o.globals.hasNegs||i?s=o.config.plotOptions[e].reverseNegativeShade?l.percent<0?l.percent/100*(1.25*n):(1-l.percent/100)*(1.25*n):l.percent<=0?1-(1+l.percent/100)*n:(1-l.percent/100)*n:(s=1-l.percent/100,"treemap"===e&&(s=(1-l.percent/100)*(1.25*n)));let r=l.color;const c=new p;if(o.config.plotOptions[e].enableShades)if("dark"===this.w.config.theme.mode){const e=c.shadeColor(-1*s,l.color);r=p.hexToRgba(p.isColorHex(e)?e:p.rgb2hex(e),o.config.fill.opacity)}else{const e=c.shadeColor(s,l.color);r=p.hexToRgba(p.isColorHex(e)?e:p.rgb2hex(e),o.config.fill.opacity)}return{color:r,colorProps:l}}determineColor(e,t,a){const i=this.w,o=i.seriesData.series[t][a],s=i.config.plotOptions[e];let n=s.colorScale.inverse?a:t;s.distributed&&"treemap"===i.config.chart.type&&(n=a);let l,r,c=i.globals.colors[n],h=null;if(s.distributed||"heatmap"!==e){const e=i.seriesData.series[t];l=e.length?e[0]:0,r=l;for(let t=1;t<e.length;t++)e[t]<l&&(l=e[t]),e[t]>r&&(r=e[t])}else l=i.globals.minY,r=i.globals.maxY;const d=s.colorScale.min,g=s.colorScale.max;void 0!==d&&void 0!==g&&g>d?(l=d,r=g):void 0!==d&&(l=d<i.globals.minY?d:i.globals.minY,r=g>i.globals.maxY?g:i.globals.maxY);const p=Math.abs(r)+Math.abs(l),f=Math.min(Math.max(o,l),r);let m=0===p?0:100*f/p;if(s.colorScale.ranges.length>0){s.colorScale.ranges.map(e=>{if(o>=e.from&&o<=e.to){c=e.color,h=e.foreColor?e.foreColor:null,l=e.from,r=e.to;const t=Math.abs(r)+Math.abs(l);m=0===t?0:100*o/t}})}return{color:c,foreColor:h,percent:m}}calculateDataLabels({text:e,x:t,y:a,i:i,j:o,colorProps:s,fontSize:n}){const l=this.w.config.dataLabels,r=new h(this.w),c=new f(this.w,this.ctx);let d=null;return l.enabled&&(d=r.group({class:"apexcharts-data-labels"}),c.plotDataLabelsText({x:t,y:a+parseFloat(l.style.fontSize)/3,text:e,i:i,j:o,color:s.foreColor,parent:d,fontSize:n,dataLabelsConfig:l})),d}}const u=l.__apex_Filters,b=l.__apex_BrowserAPIs_BrowserAPIs,x=l.__apex_Environment_Environment,y=l.__apex_Easing_resolveEasing;function w(e){var t;const a=e.config.chart.animations;if(!a||!1===a.enabled)return!1;if(!a.dynamicAnimation||!1===a.dynamicAnimation.enabled)return!1;const i=null!=(t=a.largeDatasetThreshold)?t:0;return!(i>0&&e.globals.dataPoints>i)&&!!(x.isBrowser()&&e.globals.dataChanged&&e.globals.shouldAnimate)}const _=l.__apex_math_SVGNS;function S(e){const t=e.globals;let a=t.minXDiff;if(!e.seriesData.series.some(e=>e.length>1)){const i=e.seriesData.seriesX.map(e=>e&&e[0]).filter(Number.isFinite).sort((e,t)=>e-t);a=1/0;for(let e=1;e<i.length;e++)i[e]>i[e-1]&&(a=Math.min(a,i[e]-i[e-1]));a===1/0&&(a=(t.maxX-t.minX)/4)}return Number.isFinite(a)&&a>0?a:0}l.default.use({heatmap:class{constructor(e,t,a){this.ctx=t,this.w=e,this.xRatio=a.xRatio,this.yRatio=a.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new m(e,t),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.shape=this.w.config.plotOptions.heatmap.shape||"rect",this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}padXRange(e){const{w:t}=e,a=t.globals,i=t.config.xaxis;if(("numeric"===i.type||"datetime"===i.type)&&a.initialMinX<a.initialMaxX){e._getMinXDiff();const o=S(t)/2;a.initialMinX-=o,a.initialMaxX+=o,null==i.min&&null==i.max&&null==i.range&&(a.minX-=o,a.maxX+=o,i.tickAmount||a.xTickAmount!==a.dataPoints-1||(a.xTickAmount=a.dataPoints))}}draw(e){var t,a;const i=this.w,o=new h(this.w,this.ctx),s=o.group({class:"apexcharts-heatmap"}),n=i.layout.gridWidth/i.globals.dataPoints,l=i.layout.gridHeight/i.seriesData.series.length,c=("numeric"===i.config.xaxis.type||"datetime"===i.config.xaxis.type)&&i.axisFlags.isXNumeric&&this.xRatio>0;let f=n;if(c){const e=S(i);e&&(f=e/this.xRatio)}let m=this.shape;c&&"hexagon"===m&&(m="rect");const b=function(e,t){const a=e&&e.renderer;return a&&a.kind&&"svg"!==a.kind?a:t}(this.ctx,o),x="rect"===m&&b!==o&&"function"==typeof b.drawRectCell;"hexagon"===m?this.applyHexagonClipPath(s,o,n,l):s.attr("clip-path",`url(#gridRectMask${i.globals.cuid})`);const y=Array.isArray(i.config.fill.opacity)?null!=(t=i.config.fill.opacity[0])?t:1:null!=(a=i.config.fill.opacity)?a:1;let _=0,C=!1;this.negRange=this.helpers.checkColorRange();const P=e.slice();i.config.yaxis[0].reversed&&(C=!0,P.reverse());for(let t=C?0:P.length-1;C?t<P.length:t>=0;C?t++:t--){const a=o.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:p.escapeString(i.seriesData.seriesNames[t]),rel:t+1,"data:realIndex":t});if(g.addCollapsedClassToSeries(this.w,a,t),x||o.setupEventDelegation(a,".apexcharts-heatmap-rect"),i.config.chart.dropShadow.enabled){const e=i.config.chart.dropShadow;new u(this.w).dropShadow(a,e,t)}let h=0;const S=i.config.plotOptions.heatmap.shadeIntensity,C=Math.round(_/l),P="hexagon"===m?(C%2==0?-1:1)*n/4:0;let v=0;for(let s=0;s<i.globals.dataPoints;s++){if(!c&&i.seriesData.seriesX.length&&!i.globals.allSeriesHasEqualX&&i.globals.minX+i.globals.minXDiff*s<i.seriesData.seriesX[t][v]){h+=n;continue}if(v>=e[t].length)break;const g=c?f:n;if(c){const e=i.seriesData.seriesX[t]?i.seriesData.seriesX[t][v]:null;if(null==e||e!=e){v++;continue}h=(e-i.globals.minX)/this.xRatio-f/2}const u=this.helpers.getShadeColor(i.config.chart.type,t,v,this.negRange);let C=u.color;const $=u.colorProps;if("image"===i.config.fill.type){C=new d(this.w).fillPath({seriesNumber:t,dataPointIndex:v,opacity:i.globals.hasNegs?$.percent<0?1-(1+$.percent/100):S+$.percent/100:$.percent/100,patternID:p.randomId(),width:i.config.fill.image.width?i.config.fill.image.width:g,height:i.config.fill.image.height?i.config.fill.image.height:l})}const M=this.rectRadius,D=i.config.plotOptions.heatmap.useFillColorAsStroke?C:i.globals.stroke.colors[0];if(x)b.drawRectCell(h,_,g,l,{fill:C,fillOpacity:y,stroke:D,strokeWidth:this.strokeWidth,radius:M,seriesIndex:t,dataPointIndex:v});else{const s="rect"===m,n=s?o.drawRect(h,_,g,l,M):o.drawPath({d:this.cellShapePath(m,h+P,_,g,l),stroke:D,strokeWidth:this.strokeWidth,fill:C,fillOpacity:1});if(n.attr({cx:h+P,cy:_}),n.node.classList.add("apexcharts-heatmap-rect"),a.add(n),n.attr({fill:C,i:t,index:t,j:v,val:e[t][v],"stroke-width":this.strokeWidth,stroke:D,color:C}),s||n.attr({width:g,height:l}),i.config.chart.animations.enabled&&!i.globals.dataChanged){const e=i.config.chart.animations.speed;if(i.globals.resized)i.globals.animationEnded=!0;else if(s)this.animateHeatMap(n,h,_,g,l,e,t,v);else{const a=new r(this.w);a.animatePop(n,{speed:e,delay:this.enterStaggerDelay(e,t,v),onComplete:()=>{a.animationCompleted(n)}})}}if(i.globals.dataChanged){let e=1;if(this.dynamicAnim.enabled&&i.globals.shouldAnimate){e=this.dynamicAnim.speed;const a=i.globals.previousPaths[t]&&i.globals.previousPaths[t][v],o=p.isColorHex(C)?C:p.rgb2hex(C);if(null==a?void 0:a.color){const t=a.rect,r=s&&t&&w(i)&&[t.x,t.y,t.width,t.height].every(Number.isFinite)&&(Math.abs(t.x-h)>.5||Math.abs(t.y-_)>.5||Math.abs(t.width-g)>.5||Math.abs(t.height-l)>.5)?t:null;this.animateHeatColor(n,p.isColorHex(a.color)?a.color:p.rgb2hex(a.color),o,e,r&&{from:r,to:{x:h,y:_,width:g,height:l}})}else if(s){const t=h+g/2,a=_+l/2;this.animateHeatColor(n,o,o,e,{from:{x:t,y:a,width:0,height:0},to:{x:h,y:_,width:g,height:l}})}else new r(this.w).animatePop(n,{speed:e})}}}if(i.config.dataLabels.enabled){const e=(0,i.config.dataLabels.formatter)(i.seriesData.series[t][v],{value:i.seriesData.series[t][v],seriesIndex:t,dataPointIndex:v,w:i}),o=this.helpers.calculateDataLabels({text:e,x:h+P+g/2,y:_+l/2,i:t,j:v,colorProps:$});null!==o&&a.add(o)}c||(h+=n),v++}_+=l,s.add(a)}return s}animateHeatMap(e,t,a,i,o,s,n=0,l=0){const c=new r(this.w),h=this.enterStaggerDelay(s,n,l);c.animateRect(e,{x:t+i/2,y:a+o/2,width:0,height:0},{x:t,y:a,width:i,height:o},s,()=>{c.animationCompleted(e)},h)}enterStaggerDelay(e,t,a){const i=this.w,o=i.config.chart.animations.animateGradually;if(!o||!1===o.enabled)return 0;const s=((i.seriesData.series||[]).length||1)+(i.globals.dataPoints||1)-2,n=Math.min(o.delay||0,.5*e/Math.max(1,s));return c({style:"diagonal",index:a,row:t,col:a,baseDelay:n})}cellShapePath(e,t,a,i,o){const s=t+i/2,n=a+o/2;if("circle"===e){const e=Math.min(i,o)/2;return`M ${s-e} ${n} a ${e} ${e} 0 1 0 ${2*e} 0 a ${e} ${e} 0 1 0 ${2*-e} 0 Z`}if("diamond"===e)return`M ${s} ${a} L ${t+i} ${n} L ${s} ${a+o} L ${t} ${n} Z`;const l=t+i;return`M ${s} ${a-o/6} L ${l} ${a+o/6} L ${l} ${a+5*o/6} L ${s} ${a+7*o/6} L ${t} ${a+5*o/6} L ${t} ${a+o/6} Z`}applyHexagonClipPath(e,t,a,i){const o=this.w,s=this.strokeWidth/2+2,n=`heatmapHexMask${o.globals.cuid}`,l=o.dom.elDefs.node,r=l.querySelector(`clipPath[id="${n}"]`);r&&r.parentNode&&r.parentNode.removeChild(r);const c=b.createElementNS(_,"clipPath");c.setAttribute("id",n),c.appendChild(t.drawRect(-a/4-s,-i/6-s,o.layout.gridWidth+a/2+2*s,o.layout.gridHeight+i/3+2*s,0,"#fff").node),l.appendChild(c),e.attr("clip-path",`url(#${n})`)}animateHeatColor(e,t,a,i,o=null){const n=e.attr(s({fill:t},null==o?void 0:o.from)).animate(i).attr(s({fill:a},null==o?void 0:o.to));o&&n.ease(function(e){var t,a;const i=e.config.chart.animations;return y(null!=(a=null==(t=i.dynamicAnimation)?void 0:t.easing)?a:i.easing)}(this.w))}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>l.default});
@@ -15,7 +15,7 @@ var __spreadValues = (a, b) => {
15
15
  return a;
16
16
  };
17
17
  /*!
18
- * ApexCharts v8.2.0
18
+ * ApexCharts v8.3.0
19
19
  * (c) 2018-2026 ApexCharts
20
20
  */
21
21
  import * as _core from "apexcharts/core";
@@ -28,16 +28,6 @@ const Fill = _core.__apex_Fill;
28
28
  const Series = _core.__apex_Series;
29
29
  const Utils = _core.__apex_Utils;
30
30
  const DataLabels = _core.__apex_DataLabels;
31
- const resolveDataLabelOffset = (value, w, seriesIndex, dataPointIndex) => {
32
- if (typeof value !== "function") return value;
33
- const resolved = value({
34
- series: w.seriesData.series,
35
- seriesIndex,
36
- dataPointIndex,
37
- w
38
- });
39
- return Number.isFinite(resolved) ? resolved : 0;
40
- };
41
31
  class TreemapHelpers {
42
32
  /**
43
33
  * @param {import('../../../types/internal').ChartStateW} w
@@ -187,13 +177,9 @@ class TreemapHelpers {
187
177
  elDataLabelsWrap = graphics.group({
188
178
  class: "apexcharts-data-labels"
189
179
  });
190
- const offX = resolveDataLabelOffset(dataLabelsConfig.offsetX, w, i, j);
191
- const offY = resolveDataLabelOffset(dataLabelsConfig.offsetY, w, i, j);
192
- const dataLabelsX = x + offX;
193
- const dataLabelsY = y + parseFloat(dataLabelsConfig.style.fontSize) / 3 + offY;
194
180
  dataLabels.plotDataLabelsText({
195
- x: dataLabelsX,
196
- y: dataLabelsY,
181
+ x,
182
+ y: y + parseFloat(dataLabelsConfig.style.fontSize) / 3,
197
183
  text,
198
184
  i,
199
185
  j,
package/dist/heatmap.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.2.0
2
+ * ApexCharts v8.3.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- !function(e){var t="undefined"!=typeof globalThis?globalThis:self,a=t.ApexCharts;if(a&&a.__internals)return e.call(t);if(a)throw new Error("ApexCharts: dist/heatmap.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/heatmap.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 i={file:"dist/heatmap.js",run:e,done:!1},s=t.__apexcharts_pending_addons__||(t.__apexcharts_pending_addons__=[]);s.push(i),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!i.done){var a=t.ApexCharts;if(a)if(a.__internals){i.done=!0;var o=s.indexOf(i);-1!==o&&s.splice(o,1);try{e.call(t),a.__drainsAddons||t.console.warn("ApexCharts: dist/heatmap.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/heatmap.js could not register with the ApexCharts script on this page: "+(e&&e.message))}}else t.console.error("ApexCharts: dist/heatmap.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/heatmap.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,a=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,o=(e,a,i)=>a in e?t(e,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[a]=i,n=(e,t)=>{for(var n in t||(t={}))i.call(t,n)&&o(e,n,t[n]);if(a)for(var n of a(t))s.call(t,n)&&o(e,n,t[n]);return e};const r=globalThis.ApexCharts,l=globalThis.ApexCharts.__internals,h=l.__apex_Animations,c=l.__apex_Animations_computeStagger;l.__apex_Animations_applyAnimationPolicy,l.__apex_Animations_prefersReducedMotion,l.__apex_Animations_applyProgressiveReveal;const d=globalThis.ApexCharts.__internals.__apex_Graphics,p=globalThis.ApexCharts.__internals.__apex_Fill,g=globalThis.ApexCharts.__internals.__apex_Series,f=globalThis.ApexCharts.__internals.__apex_Utils,m=globalThis.ApexCharts.__internals.__apex_DataLabels,x=(e,t,a,i)=>{if("function"!=typeof e)return e;const s=e({series:t.seriesData.series,seriesIndex:a,dataPointIndex:i,w:t});return Number.isFinite(s)?s:0};class u{constructor(e,t){this.ctx=t,this.w=e}checkColorRange(){const e=this.w;let t=!1;const a=e.config.plotOptions[e.config.chart.type];return a.colorScale.ranges.length>0&&a.colorScale.ranges.map(e=>{e.from<=0&&(t=!0)}),t}getShadeColor(e,t,a,i){const s=this.w;let o=1;const n=s.config.plotOptions[e].shadeIntensity,r=this.determineColor(e,t,a);s.globals.hasNegs||i?o=s.config.plotOptions[e].reverseNegativeShade?r.percent<0?r.percent/100*(1.25*n):(1-r.percent/100)*(1.25*n):r.percent<=0?1-(1+r.percent/100)*n:(1-r.percent/100)*n:(o=1-r.percent/100,"treemap"===e&&(o=(1-r.percent/100)*(1.25*n)));let l=r.color;const h=new f;if(s.config.plotOptions[e].enableShades)if("dark"===this.w.config.theme.mode){const e=h.shadeColor(-1*o,r.color);l=f.hexToRgba(f.isColorHex(e)?e:f.rgb2hex(e),s.config.fill.opacity)}else{const e=h.shadeColor(o,r.color);l=f.hexToRgba(f.isColorHex(e)?e:f.rgb2hex(e),s.config.fill.opacity)}return{color:l,colorProps:r}}determineColor(e,t,a){const i=this.w,s=i.seriesData.series[t][a],o=i.config.plotOptions[e];let n=o.colorScale.inverse?a:t;o.distributed&&"treemap"===i.config.chart.type&&(n=a);let r,l,h=i.globals.colors[n],c=null;if(o.distributed||"heatmap"!==e){const e=i.seriesData.series[t];r=e.length?e[0]:0,l=r;for(let t=1;t<e.length;t++)e[t]<r&&(r=e[t]),e[t]>l&&(l=e[t])}else r=i.globals.minY,l=i.globals.maxY;const d=o.colorScale.min,p=o.colorScale.max;void 0!==d&&void 0!==p&&p>d?(r=d,l=p):void 0!==d&&(r=d<i.globals.minY?d:i.globals.minY,l=p>i.globals.maxY?p:i.globals.maxY);const g=Math.abs(l)+Math.abs(r),f=Math.min(Math.max(s,r),l);let m=0===g?0:100*f/g;return o.colorScale.ranges.length>0&&o.colorScale.ranges.map(e=>{if(s>=e.from&&s<=e.to){h=e.color,c=e.foreColor?e.foreColor:null,r=e.from,l=e.to;const t=Math.abs(l)+Math.abs(r);m=0===t?0:100*s/t}}),{color:h,foreColor:c,percent:m}}calculateDataLabels({text:e,x:t,y:a,i:i,j:s,colorProps:o,fontSize:n}){const r=this.w,l=r.config.dataLabels,h=new d(this.w),c=new m(this.w,this.ctx);let p=null;if(l.enabled){p=h.group({class:"apexcharts-data-labels"});const d=x(l.offsetX,r,i,s),g=x(l.offsetY,r,i,s),f=t+d,m=a+parseFloat(l.style.fontSize)/3+g;c.plotDataLabelsText({x:f,y:m,text:e,i:i,j:s,color:o.foreColor,parent:p,fontSize:n,dataLabelsConfig:l})}return p}}const _=globalThis.ApexCharts.__internals.__apex_Filters,b=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs,w=globalThis.ApexCharts.__internals.__apex_Environment_Environment,y=globalThis.ApexCharts.__internals;y.__apex_Easing_easeInOutSine,y.__apex_Easing_DEFAULT_EASING_NAME,y.__apex_Easing_cubicBezier,y.__apex_Easing_registerEasing;const C=y.__apex_Easing_resolveEasing;function A(e){var t;const a=e.config.chart.animations;if(!a||!1===a.enabled)return!1;if(!a.dynamicAnimation||!1===a.dynamicAnimation.enabled)return!1;const i=null!=(t=a.largeDatasetThreshold)?t:0;return!(i>0&&e.globals.dataPoints>i||!(w.isBrowser()&&e.globals.dataChanged&&e.globals.shouldAnimate))}const v=globalThis.ApexCharts.__internals,S=v.__apex_math_SVGNS;function P(e){const t=e.globals;let a=t.minXDiff;if(!e.seriesData.series.some(e=>e.length>1)){const i=e.seriesData.seriesX.map(e=>e&&e[0]).filter(Number.isFinite).sort((e,t)=>e-t);a=1/0;for(let e=1;e<i.length;e++)i[e]>i[e-1]&&(a=Math.min(a,i[e]-i[e-1]));a===1/0&&(a=(t.maxX-t.minX)/4)}return Number.isFinite(a)&&a>0?a:0}v.__apex_math_Point,v.__apex_math_Matrix,v.__apex_math_Box,r.use({heatmap:class{constructor(e,t,a){this.ctx=t,this.w=e,this.xRatio=a.xRatio,this.yRatio=a.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new u(e,t),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.shape=this.w.config.plotOptions.heatmap.shape||"rect",this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}padXRange(e){const{w:t}=e,a=t.globals,i=t.config.xaxis;if(("numeric"===i.type||"datetime"===i.type)&&a.initialMinX<a.initialMaxX){e._getMinXDiff();const s=P(t)/2;a.initialMinX-=s,a.initialMaxX+=s,null==i.min&&null==i.max&&null==i.range&&(a.minX-=s,a.maxX+=s,i.tickAmount||a.xTickAmount!==a.dataPoints-1||(a.xTickAmount=a.dataPoints))}}draw(e){var t,a;const i=this.w,s=new d(this.w,this.ctx),o=s.group({class:"apexcharts-heatmap"}),n=i.layout.gridWidth/i.globals.dataPoints,r=i.layout.gridHeight/i.seriesData.series.length,l=("numeric"===i.config.xaxis.type||"datetime"===i.config.xaxis.type)&&i.axisFlags.isXNumeric&&this.xRatio>0;let c=n;if(l){const e=P(i);e&&(c=e/this.xRatio)}let m=this.shape;l&&"hexagon"===m&&(m="rect");const x=function(e,t){const a=e&&e.renderer;return a&&a.kind&&"svg"!==a.kind?a:t}(this.ctx,s),u="rect"===m&&x!==s&&"function"==typeof x.drawRectCell;"hexagon"===m?this.applyHexagonClipPath(o,s,n,r):o.attr("clip-path",`url(#gridRectMask${i.globals.cuid})`);const b=Array.isArray(i.config.fill.opacity)?null!=(t=i.config.fill.opacity[0])?t:1:null!=(a=i.config.fill.opacity)?a:1;let w=0,y=!1;this.negRange=this.helpers.checkColorRange();const C=e.slice();i.config.yaxis[0].reversed&&(y=!0,C.reverse());for(let t=y?0:C.length-1;y?t<C.length:t>=0;y?t++:t--){const a=s.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:f.escapeString(i.seriesData.seriesNames[t]),rel:t+1,"data:realIndex":t});if(g.addCollapsedClassToSeries(this.w,a,t),u||s.setupEventDelegation(a,".apexcharts-heatmap-rect"),i.config.chart.dropShadow.enabled){const e=i.config.chart.dropShadow;new _(this.w).dropShadow(a,e,t)}let d=0;const y=i.config.plotOptions.heatmap.shadeIntensity,C=Math.round(w/r),v="hexagon"===m?(C%2==0?-1:1)*n/4:0;let S=0;for(let o=0;o<i.globals.dataPoints;o++){if(!l&&i.seriesData.seriesX.length&&!i.globals.allSeriesHasEqualX&&i.globals.minX+i.globals.minXDiff*o<i.seriesData.seriesX[t][S]){d+=n;continue}if(S>=e[t].length)break;const g=l?c:n;if(l){const e=i.seriesData.seriesX[t]?i.seriesData.seriesX[t][S]:null;if(null==e||e!=e){S++;continue}d=(e-i.globals.minX)/this.xRatio-c/2}const _=this.helpers.getShadeColor(i.config.chart.type,t,S,this.negRange);let C=_.color;const P=_.colorProps;"image"===i.config.fill.type&&(C=new p(this.w).fillPath({seriesNumber:t,dataPointIndex:S,opacity:i.globals.hasNegs?P.percent<0?1-(1+P.percent/100):y+P.percent/100:P.percent/100,patternID:f.randomId(),width:i.config.fill.image.width?i.config.fill.image.width:g,height:i.config.fill.image.height?i.config.fill.image.height:r}));const M=this.rectRadius,$=i.config.plotOptions.heatmap.useFillColorAsStroke?C:i.globals.stroke.colors[0];if(u)x.drawRectCell(d,w,g,r,{fill:C,fillOpacity:b,stroke:$,strokeWidth:this.strokeWidth,radius:M,seriesIndex:t,dataPointIndex:S});else{const o="rect"===m,n=o?s.drawRect(d,w,g,r,M):s.drawPath({d:this.cellShapePath(m,d+v,w,g,r),stroke:$,strokeWidth:this.strokeWidth,fill:C,fillOpacity:1});if(n.attr({cx:d+v,cy:w}),n.node.classList.add("apexcharts-heatmap-rect"),a.add(n),n.attr({fill:C,i:t,index:t,j:S,val:e[t][S],"stroke-width":this.strokeWidth,stroke:$,color:C}),o||n.attr({width:g,height:r}),i.config.chart.animations.enabled&&!i.globals.dataChanged){const e=i.config.chart.animations.speed;if(i.globals.resized)i.globals.animationEnded=!0;else if(o)this.animateHeatMap(n,d,w,g,r,e,t,S);else{const a=new h(this.w);a.animatePop(n,{speed:e,delay:this.enterStaggerDelay(e,t,S),onComplete:()=>{a.animationCompleted(n)}})}}if(i.globals.dataChanged){let e=1;if(this.dynamicAnim.enabled&&i.globals.shouldAnimate){e=this.dynamicAnim.speed;const a=i.globals.previousPaths[t]&&i.globals.previousPaths[t][S],s=f.isColorHex(C)?C:f.rgb2hex(C);if(null==a?void 0:a.color){const t=a.rect,l=o&&t&&A(i)&&[t.x,t.y,t.width,t.height].every(Number.isFinite)&&(Math.abs(t.x-d)>.5||Math.abs(t.y-w)>.5||Math.abs(t.width-g)>.5||Math.abs(t.height-r)>.5)?t:null;this.animateHeatColor(n,f.isColorHex(a.color)?a.color:f.rgb2hex(a.color),s,e,l&&{from:l,to:{x:d,y:w,width:g,height:r}})}else if(o){const t=d+g/2,a=w+r/2;this.animateHeatColor(n,s,s,e,{from:{x:t,y:a,width:0,height:0},to:{x:d,y:w,width:g,height:r}})}else new h(this.w).animatePop(n,{speed:e})}}}if(i.config.dataLabels.enabled){const e=(0,i.config.dataLabels.formatter)(i.seriesData.series[t][S],{value:i.seriesData.series[t][S],seriesIndex:t,dataPointIndex:S,w:i}),s=this.helpers.calculateDataLabels({text:e,x:d+v+g/2,y:w+r/2,i:t,j:S,colorProps:P});null!==s&&a.add(s)}l||(d+=n),S++}w+=r,o.add(a)}return o}animateHeatMap(e,t,a,i,s,o,n=0,r=0){const l=new h(this.w),c=this.enterStaggerDelay(o,n,r);l.animateRect(e,{x:t+i/2,y:a+s/2,width:0,height:0},{x:t,y:a,width:i,height:s},o,()=>{l.animationCompleted(e)},c)}enterStaggerDelay(e,t,a){const i=this.w,s=i.config.chart.animations.animateGradually;if(!s||!1===s.enabled)return 0;const o=((i.seriesData.series||[]).length||1)+(i.globals.dataPoints||1)-2,n=Math.min(s.delay||0,.5*e/Math.max(1,o));return c({style:"diagonal",index:a,row:t,col:a,baseDelay:n})}cellShapePath(e,t,a,i,s){const o=t+i/2,n=a+s/2;if("circle"===e){const e=Math.min(i,s)/2;return`M ${o-e} ${n} a ${e} ${e} 0 1 0 ${2*e} 0 a ${e} ${e} 0 1 0 ${2*-e} 0 Z`}if("diamond"===e)return`M ${o} ${a} L ${t+i} ${n} L ${o} ${a+s} L ${t} ${n} Z`;const r=t+i;return`M ${o} ${a-s/6} L ${r} ${a+s/6} L ${r} ${a+5*s/6} L ${o} ${a+7*s/6} L ${t} ${a+5*s/6} L ${t} ${a+s/6} Z`}applyHexagonClipPath(e,t,a,i){const s=this.w,o=this.strokeWidth/2+2,n=`heatmapHexMask${s.globals.cuid}`,r=s.dom.elDefs.node,l=r.querySelector(`clipPath[id="${n}"]`);l&&l.parentNode&&l.parentNode.removeChild(l);const h=b.createElementNS(S,"clipPath");h.setAttribute("id",n),h.appendChild(t.drawRect(-a/4-o,-i/6-o,s.layout.gridWidth+a/2+2*o,s.layout.gridHeight+i/3+2*o,0,"#fff").node),r.appendChild(h),e.attr("clip-path",`url(#${n})`)}animateHeatColor(e,t,a,i,s=null){const o=e.attr(n({fill:t},null==s?void 0:s.from)).animate(i).attr(n({fill:a},null==s?void 0:s.to));s&&o.ease(function(e){var t,a;const i=e.config.chart.animations;return C(null!=(a=null==(t=i.dynamicAnimation)?void 0:t.easing)?a:i.easing)}(this.w))}}}),e.default=r,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).ApexHeatmap={})});
5
+ !function(e){var t="undefined"!=typeof globalThis?globalThis:self,a=t.ApexCharts;if(a&&a.__internals)return e.call(t);if(a)throw new Error("ApexCharts: dist/heatmap.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/heatmap.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 i={file:"dist/heatmap.js",run:e,done:!1},s=t.__apexcharts_pending_addons__||(t.__apexcharts_pending_addons__=[]);s.push(i),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!i.done){var a=t.ApexCharts;if(a)if(a.__internals){i.done=!0;var o=s.indexOf(i);-1!==o&&s.splice(o,1);try{e.call(t),a.__drainsAddons||t.console.warn("ApexCharts: dist/heatmap.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/heatmap.js could not register with the ApexCharts script on this page: "+(e&&e.message))}}else t.console.error("ApexCharts: dist/heatmap.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/heatmap.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,a=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,o=(e,a,i)=>a in e?t(e,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[a]=i,n=(e,t)=>{for(var n in t||(t={}))i.call(t,n)&&o(e,n,t[n]);if(a)for(var n of a(t))s.call(t,n)&&o(e,n,t[n]);return e};const r=globalThis.ApexCharts,l=globalThis.ApexCharts.__internals,h=l.__apex_Animations,c=l.__apex_Animations_computeStagger;l.__apex_Animations_applyAnimationPolicy,l.__apex_Animations_prefersReducedMotion,l.__apex_Animations_applyProgressiveReveal;const d=globalThis.ApexCharts.__internals.__apex_Graphics,p=globalThis.ApexCharts.__internals.__apex_Fill,g=globalThis.ApexCharts.__internals.__apex_Series,f=globalThis.ApexCharts.__internals.__apex_Utils,m=globalThis.ApexCharts.__internals.__apex_DataLabels;class x{constructor(e,t){this.ctx=t,this.w=e}checkColorRange(){const e=this.w;let t=!1;const a=e.config.plotOptions[e.config.chart.type];return a.colorScale.ranges.length>0&&a.colorScale.ranges.map(e=>{e.from<=0&&(t=!0)}),t}getShadeColor(e,t,a,i){const s=this.w;let o=1;const n=s.config.plotOptions[e].shadeIntensity,r=this.determineColor(e,t,a);s.globals.hasNegs||i?o=s.config.plotOptions[e].reverseNegativeShade?r.percent<0?r.percent/100*(1.25*n):(1-r.percent/100)*(1.25*n):r.percent<=0?1-(1+r.percent/100)*n:(1-r.percent/100)*n:(o=1-r.percent/100,"treemap"===e&&(o=(1-r.percent/100)*(1.25*n)));let l=r.color;const h=new f;if(s.config.plotOptions[e].enableShades)if("dark"===this.w.config.theme.mode){const e=h.shadeColor(-1*o,r.color);l=f.hexToRgba(f.isColorHex(e)?e:f.rgb2hex(e),s.config.fill.opacity)}else{const e=h.shadeColor(o,r.color);l=f.hexToRgba(f.isColorHex(e)?e:f.rgb2hex(e),s.config.fill.opacity)}return{color:l,colorProps:r}}determineColor(e,t,a){const i=this.w,s=i.seriesData.series[t][a],o=i.config.plotOptions[e];let n=o.colorScale.inverse?a:t;o.distributed&&"treemap"===i.config.chart.type&&(n=a);let r,l,h=i.globals.colors[n],c=null;if(o.distributed||"heatmap"!==e){const e=i.seriesData.series[t];r=e.length?e[0]:0,l=r;for(let t=1;t<e.length;t++)e[t]<r&&(r=e[t]),e[t]>l&&(l=e[t])}else r=i.globals.minY,l=i.globals.maxY;const d=o.colorScale.min,p=o.colorScale.max;void 0!==d&&void 0!==p&&p>d?(r=d,l=p):void 0!==d&&(r=d<i.globals.minY?d:i.globals.minY,l=p>i.globals.maxY?p:i.globals.maxY);const g=Math.abs(l)+Math.abs(r),f=Math.min(Math.max(s,r),l);let m=0===g?0:100*f/g;return o.colorScale.ranges.length>0&&o.colorScale.ranges.map(e=>{if(s>=e.from&&s<=e.to){h=e.color,c=e.foreColor?e.foreColor:null,r=e.from,l=e.to;const t=Math.abs(l)+Math.abs(r);m=0===t?0:100*s/t}}),{color:h,foreColor:c,percent:m}}calculateDataLabels({text:e,x:t,y:a,i:i,j:s,colorProps:o,fontSize:n}){const r=this.w.config.dataLabels,l=new d(this.w),h=new m(this.w,this.ctx);let c=null;return r.enabled&&(c=l.group({class:"apexcharts-data-labels"}),h.plotDataLabelsText({x:t,y:a+parseFloat(r.style.fontSize)/3,text:e,i:i,j:s,color:o.foreColor,parent:c,fontSize:n,dataLabelsConfig:r})),c}}const u=globalThis.ApexCharts.__internals.__apex_Filters,_=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs,b=globalThis.ApexCharts.__internals.__apex_Environment_Environment,w=globalThis.ApexCharts.__internals;w.__apex_Easing_easeInOutSine,w.__apex_Easing_DEFAULT_EASING_NAME,w.__apex_Easing_cubicBezier,w.__apex_Easing_registerEasing;const y=w.__apex_Easing_resolveEasing;function C(e){var t;const a=e.config.chart.animations;if(!a||!1===a.enabled)return!1;if(!a.dynamicAnimation||!1===a.dynamicAnimation.enabled)return!1;const i=null!=(t=a.largeDatasetThreshold)?t:0;return!(i>0&&e.globals.dataPoints>i||!(b.isBrowser()&&e.globals.dataChanged&&e.globals.shouldAnimate))}const A=globalThis.ApexCharts.__internals,v=A.__apex_math_SVGNS;function S(e){const t=e.globals;let a=t.minXDiff;if(!e.seriesData.series.some(e=>e.length>1)){const i=e.seriesData.seriesX.map(e=>e&&e[0]).filter(Number.isFinite).sort((e,t)=>e-t);a=1/0;for(let e=1;e<i.length;e++)i[e]>i[e-1]&&(a=Math.min(a,i[e]-i[e-1]));a===1/0&&(a=(t.maxX-t.minX)/4)}return Number.isFinite(a)&&a>0?a:0}A.__apex_math_Point,A.__apex_math_Matrix,A.__apex_math_Box,r.use({heatmap:class{constructor(e,t,a){this.ctx=t,this.w=e,this.xRatio=a.xRatio,this.yRatio=a.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new x(e,t),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.shape=this.w.config.plotOptions.heatmap.shape||"rect",this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}padXRange(e){const{w:t}=e,a=t.globals,i=t.config.xaxis;if(("numeric"===i.type||"datetime"===i.type)&&a.initialMinX<a.initialMaxX){e._getMinXDiff();const s=S(t)/2;a.initialMinX-=s,a.initialMaxX+=s,null==i.min&&null==i.max&&null==i.range&&(a.minX-=s,a.maxX+=s,i.tickAmount||a.xTickAmount!==a.dataPoints-1||(a.xTickAmount=a.dataPoints))}}draw(e){var t,a;const i=this.w,s=new d(this.w,this.ctx),o=s.group({class:"apexcharts-heatmap"}),n=i.layout.gridWidth/i.globals.dataPoints,r=i.layout.gridHeight/i.seriesData.series.length,l=("numeric"===i.config.xaxis.type||"datetime"===i.config.xaxis.type)&&i.axisFlags.isXNumeric&&this.xRatio>0;let c=n;if(l){const e=S(i);e&&(c=e/this.xRatio)}let m=this.shape;l&&"hexagon"===m&&(m="rect");const x=function(e,t){const a=e&&e.renderer;return a&&a.kind&&"svg"!==a.kind?a:t}(this.ctx,s),_="rect"===m&&x!==s&&"function"==typeof x.drawRectCell;"hexagon"===m?this.applyHexagonClipPath(o,s,n,r):o.attr("clip-path",`url(#gridRectMask${i.globals.cuid})`);const b=Array.isArray(i.config.fill.opacity)?null!=(t=i.config.fill.opacity[0])?t:1:null!=(a=i.config.fill.opacity)?a:1;let w=0,y=!1;this.negRange=this.helpers.checkColorRange();const A=e.slice();i.config.yaxis[0].reversed&&(y=!0,A.reverse());for(let t=y?0:A.length-1;y?t<A.length:t>=0;y?t++:t--){const a=s.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:f.escapeString(i.seriesData.seriesNames[t]),rel:t+1,"data:realIndex":t});if(g.addCollapsedClassToSeries(this.w,a,t),_||s.setupEventDelegation(a,".apexcharts-heatmap-rect"),i.config.chart.dropShadow.enabled){const e=i.config.chart.dropShadow;new u(this.w).dropShadow(a,e,t)}let d=0;const y=i.config.plotOptions.heatmap.shadeIntensity,A=Math.round(w/r),v="hexagon"===m?(A%2==0?-1:1)*n/4:0;let S=0;for(let o=0;o<i.globals.dataPoints;o++){if(!l&&i.seriesData.seriesX.length&&!i.globals.allSeriesHasEqualX&&i.globals.minX+i.globals.minXDiff*o<i.seriesData.seriesX[t][S]){d+=n;continue}if(S>=e[t].length)break;const g=l?c:n;if(l){const e=i.seriesData.seriesX[t]?i.seriesData.seriesX[t][S]:null;if(null==e||e!=e){S++;continue}d=(e-i.globals.minX)/this.xRatio-c/2}const u=this.helpers.getShadeColor(i.config.chart.type,t,S,this.negRange);let A=u.color;const P=u.colorProps;"image"===i.config.fill.type&&(A=new p(this.w).fillPath({seriesNumber:t,dataPointIndex:S,opacity:i.globals.hasNegs?P.percent<0?1-(1+P.percent/100):y+P.percent/100:P.percent/100,patternID:f.randomId(),width:i.config.fill.image.width?i.config.fill.image.width:g,height:i.config.fill.image.height?i.config.fill.image.height:r}));const M=this.rectRadius,$=i.config.plotOptions.heatmap.useFillColorAsStroke?A:i.globals.stroke.colors[0];if(_)x.drawRectCell(d,w,g,r,{fill:A,fillOpacity:b,stroke:$,strokeWidth:this.strokeWidth,radius:M,seriesIndex:t,dataPointIndex:S});else{const o="rect"===m,n=o?s.drawRect(d,w,g,r,M):s.drawPath({d:this.cellShapePath(m,d+v,w,g,r),stroke:$,strokeWidth:this.strokeWidth,fill:A,fillOpacity:1});if(n.attr({cx:d+v,cy:w}),n.node.classList.add("apexcharts-heatmap-rect"),a.add(n),n.attr({fill:A,i:t,index:t,j:S,val:e[t][S],"stroke-width":this.strokeWidth,stroke:$,color:A}),o||n.attr({width:g,height:r}),i.config.chart.animations.enabled&&!i.globals.dataChanged){const e=i.config.chart.animations.speed;if(i.globals.resized)i.globals.animationEnded=!0;else if(o)this.animateHeatMap(n,d,w,g,r,e,t,S);else{const a=new h(this.w);a.animatePop(n,{speed:e,delay:this.enterStaggerDelay(e,t,S),onComplete:()=>{a.animationCompleted(n)}})}}if(i.globals.dataChanged){let e=1;if(this.dynamicAnim.enabled&&i.globals.shouldAnimate){e=this.dynamicAnim.speed;const a=i.globals.previousPaths[t]&&i.globals.previousPaths[t][S],s=f.isColorHex(A)?A:f.rgb2hex(A);if(null==a?void 0:a.color){const t=a.rect,l=o&&t&&C(i)&&[t.x,t.y,t.width,t.height].every(Number.isFinite)&&(Math.abs(t.x-d)>.5||Math.abs(t.y-w)>.5||Math.abs(t.width-g)>.5||Math.abs(t.height-r)>.5)?t:null;this.animateHeatColor(n,f.isColorHex(a.color)?a.color:f.rgb2hex(a.color),s,e,l&&{from:l,to:{x:d,y:w,width:g,height:r}})}else if(o){const t=d+g/2,a=w+r/2;this.animateHeatColor(n,s,s,e,{from:{x:t,y:a,width:0,height:0},to:{x:d,y:w,width:g,height:r}})}else new h(this.w).animatePop(n,{speed:e})}}}if(i.config.dataLabels.enabled){const e=(0,i.config.dataLabels.formatter)(i.seriesData.series[t][S],{value:i.seriesData.series[t][S],seriesIndex:t,dataPointIndex:S,w:i}),s=this.helpers.calculateDataLabels({text:e,x:d+v+g/2,y:w+r/2,i:t,j:S,colorProps:P});null!==s&&a.add(s)}l||(d+=n),S++}w+=r,o.add(a)}return o}animateHeatMap(e,t,a,i,s,o,n=0,r=0){const l=new h(this.w),c=this.enterStaggerDelay(o,n,r);l.animateRect(e,{x:t+i/2,y:a+s/2,width:0,height:0},{x:t,y:a,width:i,height:s},o,()=>{l.animationCompleted(e)},c)}enterStaggerDelay(e,t,a){const i=this.w,s=i.config.chart.animations.animateGradually;if(!s||!1===s.enabled)return 0;const o=((i.seriesData.series||[]).length||1)+(i.globals.dataPoints||1)-2,n=Math.min(s.delay||0,.5*e/Math.max(1,o));return c({style:"diagonal",index:a,row:t,col:a,baseDelay:n})}cellShapePath(e,t,a,i,s){const o=t+i/2,n=a+s/2;if("circle"===e){const e=Math.min(i,s)/2;return`M ${o-e} ${n} a ${e} ${e} 0 1 0 ${2*e} 0 a ${e} ${e} 0 1 0 ${2*-e} 0 Z`}if("diamond"===e)return`M ${o} ${a} L ${t+i} ${n} L ${o} ${a+s} L ${t} ${n} Z`;const r=t+i;return`M ${o} ${a-s/6} L ${r} ${a+s/6} L ${r} ${a+5*s/6} L ${o} ${a+7*s/6} L ${t} ${a+5*s/6} L ${t} ${a+s/6} Z`}applyHexagonClipPath(e,t,a,i){const s=this.w,o=this.strokeWidth/2+2,n=`heatmapHexMask${s.globals.cuid}`,r=s.dom.elDefs.node,l=r.querySelector(`clipPath[id="${n}"]`);l&&l.parentNode&&l.parentNode.removeChild(l);const h=_.createElementNS(v,"clipPath");h.setAttribute("id",n),h.appendChild(t.drawRect(-a/4-o,-i/6-o,s.layout.gridWidth+a/2+2*o,s.layout.gridHeight+i/3+2*o,0,"#fff").node),r.appendChild(h),e.attr("clip-path",`url(#${n})`)}animateHeatColor(e,t,a,i,s=null){const o=e.attr(n({fill:t},null==s?void 0:s.from)).animate(i).attr(n({fill:a},null==s?void 0:s.to));s&&o.ease(function(e){var t,a;const i=e.config.chart.animations;return y(null!=(a=null==(t=i.dynamicAnimation)?void 0:t.easing)?a:i.easing)}(this.w))}}}),e.default=r,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).ApexHeatmap={})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.2.0
2
+ * ApexCharts v8.3.0
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- "use strict";var t=Object.defineProperty,e=Object.defineProperties,s=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,o=(e,s,a)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a,n=(t,e)=>{for(var s in e||(e={}))r.call(e,s)&&o(t,s,e[s]);if(a)for(var s of a(e))i.call(e,s)&&o(t,s,e[s]);return t},l=(t,a)=>e(t,s(a));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function h(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const s in t)if("default"!==s){const a=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>t[s]})}return e.default=t,Object.freeze(e)}const d=h(require("apexcharts/core")),c=d.__apex_Utils,u="__apexcharts_series_transforms__";function b(t,e){t&&"string"==typeof t?"function"==typeof e?globalThis[u][t]=e:console.warn(`ApexCharts: registerSeriesTransform("${t}") expects a function (series, w) => series.`):console.warn("ApexCharts: registerSeriesTransform requires a non-empty name.")}globalThis[u]||(globalThis[u]={});const g="__apexcharts_row_sources__";function p(t,e){t&&"string"==typeof t?"function"==typeof e?globalThis[g][t]=e:console.warn(`ApexCharts: registerRowSource("${t}") expects a function (w, opts) => series.`):console.warn("ApexCharts: registerRowSource requires a non-empty name.")}function x(t){return(t.collapsedSeriesIndices||[]).concat(t.ancillaryCollapsedSeriesIndices||[])}function f(t,e){const s=(e.collapsedSeries||[]).concat(e.ancillaryCollapsedSeries||[]);return t.map((t,e)=>{const o=t||{},{hidden:h}=o,d=((t,e)=>{var s={};for(var o in t)r.call(t,o)&&e.indexOf(o)<0&&(s[o]=t[o]);if(null!=t&&a)for(var o of a(t))e.indexOf(o)<0&&i.call(t,o)&&(s[o]=t[o]);return s})(o,["hidden"]);let c=d.data;if(Array.isArray(c)&&!c.length){const t=s.find(t=>t.index===e);t&&Array.isArray(t.data)&&(c=t.data)}return l(n({},d),{data:Array.isArray(c)?c.slice():c})})}globalThis[g]||(globalThis[g]={});function y(t,e){const s=t.length;if(0===s)return NaN;if(1===s)return t[0];const a=(s-1)*e,r=Math.floor(a),i=Math.ceil(a);return r===i?t[r]:t[r]+(t[i]-t[r])*(a-r)}function m(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const s=t.slice().sort((t,e)=>t-e);let a=s[0],r=s[s.length-1];const i=e.range;if(Array.isArray(i)&&2===i.length){const t=Number(i[0]),e=Number(i[1]);Number.isFinite(t)&&Number.isFinite(e)&&e>t&&(a=t,r=e)}if(!(r>a)){const t=Math.abs(a)>0?.05*Math.abs(a):.5;return{edges:[a-t,a+t],binWidth:2*t,rule:"single",capped:!1}}const o=r-a;let n,l;if("number"==typeof e.binWidth&&e.binWidth>0)n=e.binWidth,l="binWidth";else if("number"==typeof e.bins&&e.bins>=1)n=o/Math.floor(e.bins),l="count";else{const t=function(t,e,s){const a=t.length,r=t=>e/Math.max(1,Math.ceil(t)),i=()=>r(Math.log2(a)+1);switch(s){case"sqrt":return{width:r(Math.sqrt(a)),rule:"sqrt"};case"rice":return{width:r(2*Math.cbrt(a)),rule:"rice"};case"scott":{const e=function(t){const e=t.length;if(e<2)return 0;let s=0;for(let a=0;a<e;a++)s+=t[a];const a=s/e;let r=0;for(let s=0;s<e;s++){const e=t[s]-a;r+=e*e}return Math.sqrt(r/e)}(t);return e>0?{width:3.49*e*Math.pow(a,-1/3),rule:"scott"}:{width:i(),rule:"sturges"}}case"fd":{const e=y(t,.75)-y(t,.25);return e>0?{width:2*e*Math.pow(a,-1/3),rule:"fd"}:{width:i(),rule:"sturges"}}case"auto":{const e=i(),s=y(t,.75)-y(t,.25);if(s<=0)return{width:e,rule:"sturges"};const r=2*s*Math.pow(a,-1/3);return r<e?{width:r,rule:"fd"}:{width:e,rule:"sturges"}}default:return{width:i(),rule:"sturges"}}}(s,o,"string"==typeof e.bins?e.bins:"auto");n=t.width,l=t.rule}(!Number.isFinite(n)||n<=0)&&(n=o);let h=Math.ceil(o/n);(!Number.isFinite(h)||h<1)&&(h=1);let d=!1;h>1e3&&(h=1e3,d=!0),n=o/h;const c=new Array(h+1);for(let t=0;t<=h;t++)c[t]=a+t*n;return c[h]=Math.max(c[h],r),{edges:c,binWidth:n,rule:l,capped:d}}function v(t,e){const s=e.length-1;if(!(t>=e[0])||t>e[s])return-1;if(t===e[s])return s-1;const a=(e[s]-e[0])/s;if(a>0){let r=Math.floor((t-e[0])/a);return r<0&&(r=0),r>s-1&&(r=s-1),t<e[r]?r--:t>=e[r+1]&&r++,r<0||r>s-1?-1:r}let r=0,i=s-1;for(;r<=i;){const s=r+i>>1;if(t<e[s])i=s-1;else{if(!(t>=e[s+1]))return s;r=s+1}}return-1}function C(t,e){const s=Math.max(0,e.length-1),a=new Array(s);for(let t=0;t<s;t++)a[t]=[];for(let s=0;s<t.length;s++){const r=v(t[s],e);r>=0&&a[r].push(t[s])}return a}function w(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const s=t.slice().sort((t,e)=>t-e),a=s.length;let r=e.bandwidth;if(!("number"==typeof r&&r>0)){const t=function(t){const e=t.length;if(e<2)return 0;let s=0;for(let a=0;a<e;a++)s+=t[a];const a=s/e;let r=0;for(let s=0;s<e;s++){const e=t[s]-a;r+=e*e}return Math.sqrt(r/e)}(s),e=y(s,.75)-y(s,.25);r=.9*(e>0?Math.min(t,e/1.349):t)*Math.pow(a,-.2)}if(!isFinite(r)||r<=0){const t=s[0],e=Math.abs(t)>0?.001*Math.abs(t):.001;return{density:[[t-e,0],[t,1],[t+e,0]],bandwidth:e}}const i=Math.max(8,Math.floor(e.resolution||64)),o=s[0]-2*r,n=(s[a-1]+2*r-o)/(i-1),l=1/(a*r*Math.sqrt(2*Math.PI)),h=[];for(let t=0;t<i;t++){const e=o+t*n;let i=0;for(let t=0;t<a;t++){const a=(e-s[t])/r;i+=Math.exp(-.5*a*a)}h.push([e,i*l])}return{density:h,bandwidth:r}}function I(t,e){var s;if(!t||"object"!=typeof t||Array.isArray(t))return null;let a=null;if(Array.isArray(t.points)?a=t.points:Array.isArray(null==(s=t.y)?void 0:s.points)?a=t.y.points:e&&Array.isArray(t.y)&&"number"==typeof t.y[0]&&(a=t.y),!a)return null;const r=[];for(let t=0;t<a.length;t++){const e=c.parseNumber(a[t]);null!==e&&isFinite(e)&&r.push(e)}return r.length?r:null}function A(t,e){var s,a;const r=null!=(s=t.statsDerived)?s:t.statsDerived={};return null!=(a=r[e])?a:r[e]=new Map}function P(t,e,s){const a=t.get(e);if(!a||!Array.isArray(s)||a.length!==s.length)return!1;for(let t=0;t<s.length;t++){const e=a[t],r=s[t];if(e!==r&&(!Array.isArray(e)||!Array.isArray(r)||e[0]!==r[0]||e[1]!==r[1]))return!1}return!0}function S(t){const e=[];if(!Array.isArray(t))return e;for(let s=0;s<t.length;s++){const a=t[s];let r=a;Array.isArray(a)?r=1===a.length?a[0]:a[1]:a&&"object"==typeof a&&(r=void 0!==a.y?a.y:a.x);const i=c.parseNumber(r);null!==i&&isFinite(i)&&e.push(i)}return e}function k(t,e,s){if(!e.length)return;const a=[];for(let t=0;t<s;t++){const s=e[t];if(!s){a.push(null);continue}const r=[];for(const t of s)if(t)for(let e=0;e<t.length;e++)r.push(t[e]);a.push({values:r,byPoint:s})}t.seriesObservations=a}function H(t,e,s){const a=s&&null!=s.maxRows?s.maxRows:3e3,r=function(t,e){let s=0,a=0;for(const e of t)s+=e.length,e.length>a&&(a=e.length);if(s<=e)return{clusters:t,stride:1,total:s,kept:s};const r=e=>{let s=0;for(const a of t)s+=Math.ceil(a.length/e);return s};let i=Math.max(2,Math.ceil(s/e));for(;i<a&&r(i)>e;)i++;let o=0;return{clusters:t.map(t=>{const e=[];for(let s=0;s<t.length;s+=i)e.push(t[s]);return o+=e.length,e}),stride:i,total:s,kept:o}}(e.map(t=>t.rows),a);r.stride>1&&console.warn(`ApexCharts: rowSeries() thinned ${r.total} rows to ${r.kept} (every ${r.stride}${2===r.stride?"nd":3===r.stride?"rd":"th"} row) to stay under maxRows=${a}. Raise maxRows to draw more.`);const i=t.globals&&t.globals.colors||[];return e.map((t,e)=>{const s=i[t.realIndex]||i[0];return{name:t.name,data:r.clusters[e].map((a,r)=>n({id:`${t.realIndex}:${e}:${r}`,x:t.name,y:a},s?{fillColor:s}:{}))}})}function L(t){if(!isFinite(t))return String(t);const e=Math.round(t);return Math.abs(t-e)<1e-6?String(e):String(Number(t.toFixed(2)))}function W(t){return(e,s)=>{var a;const r=t(e);if(!Array.isArray(r)||!r.length)return null;const i=e.globals?x(e.globals):[],o=e.globals&&((null==(a=e.globals.categoryLabels)?void 0:a.length)?e.globals.categoryLabels:e.globals.labels)||[],n=[];return r.forEach((t,s)=>{var a;if(-1!==i.indexOf(s))return;if(!Array.isArray(t))return;const l=e.seriesData&&(null==(a=e.seriesData.seriesNames)?void 0:a[s]);t.forEach((t,e)=>{const a=null!=o[e]?String(o[e]):`#${e+1}`;n.push({name:r.length>1&&l?`${l} ${a}`:a,realIndex:s,rows:Array.isArray(t)?t.slice():[]})})}),n.length?H(e,n,s):null}}const R=W(t=>{var e;return null==(e=t.candleData)?void 0:e.seriesBoxPoints}),D=W(t=>{var e;return null==(e=t.violinData)?void 0:e.seriesViolinPoints});b("histogram",function(t,e){var s;const a=e.config,r=e.globals;if(!Array.isArray(t))return t;r.histogramRawSeries||(r.histogramRawSeries=f(t,r));const i=r.histogramRawSeries,o=(null==(s=a.plotOptions)?void 0:s.histogram)||{},h=i.map(t=>S(null==t?void 0:t.data));let d=[];if(1===h.length)d=h[0];else for(const t of h)d=d.concat(t);const c=m(d,{bins:o.bins,binWidth:o.binWidth,range:o.range});if(!c)return e.histogramData={edges:[],binWidth:0,counts:[],rule:"",capped:!1},i;const{edges:u,binWidth:b}=c,g=h.map(t=>function(t,e){const s=new Array(Math.max(0,e.length-1)).fill(0);for(let a=0;a<t.length;a++){const r=v(t[a],e);r>=0&&s[r]++}return s}(t,u));e.histogramData={edges:u,binWidth:b,counts:g,rule:c.rule,capped:c.capped};const p=x(r);return e.seriesObservations=h.map((t,e)=>({values:t,byPoint:-1!==p.indexOf(e)?[]:C(t,u)})),i.map((t,e)=>{if(-1!==p.indexOf(e))return l(n({},t),{data:[]});const s=function(t,e={}){let s=t.slice();if(e.cumulative){let t=0;s=s.map(e=>t+=e)}const a=t.reduce((t,e)=>t+e,0);if(a<=0)return s;if("relative"===e.normalize)return s.map(t=>t/a*100);if("density"===e.normalize){const t=e.binWidth;if("number"==typeof t&&t>0)return s.map(e=>e/(a*t))}return s}(g[e],{normalize:o.normalize,cumulative:o.cumulative,binWidth:b}),a=[];for(let t=0;t<s.length;t++)a.push({x:(u[t]+u[t+1])/2,y:s[t]});return l(n({},t),{data:a})})}),b("boxPlot",function(t,e){var s,a;if(!Array.isArray(t))return t;const r=(null==(a=null==(s=e.config.plotOptions)?void 0:s.boxPlot)?void 0:a.whiskers)||"minmax",i=A(e,"boxPlot"),o=[],h=t.map((t,e)=>{if(!Array.isArray(null==t?void 0:t.data)||t.type&&"boxPlot"!==t.type)return t;let s=!1;const a=new Array(t.data.length).fill(null),h=t.data.map((t,o)=>{const h=e+":"+o;if(Array.isArray(null==t?void 0:t.y)&&5===t.y.length&&!P(i,h,t.y))return t;const d=I(t,!1);if(!d)return t;const c=function(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const s=t.slice().sort((t,e)=>t-e),a=y(s,.25),r=y(s,.5),i=y(s,.75),o=i-a;let n=s[0],l=s[s.length-1],h=[];if("tukey"===e.whiskers&&o>0){const t=a-1.5*o,e=i+1.5*o;let r=0;for(;r<s.length&&s[r]<t;)r++;let d=s.length-1;for(;d>=0&&s[d]>e;)d--;r<=d&&(n=s[r],l=s[d],h=s.slice(0,r).concat(s.slice(d+1)))}return{summary:[n,a,r,i,l],outliers:h,iqr:o}}(d,{whiskers:r});return c?(s=!0,a[o]=d,i.set(h,c.summary),l(n({},t),{y:c.summary,points:d})):t});return s&&(o[e]=a),s?l(n({},t),{data:h}):t});return k(e,o,t.length),h}),b("violin",function(t,e){var s,a;if(!Array.isArray(t))return t;const r=(null==(a=null==(s=e.config.plotOptions)?void 0:s.violin)?void 0:a.kde)||{},i=A(e,"violin"),o=[],h=t.map((t,e)=>{if(!Array.isArray(null==t?void 0:t.data)||t.type&&"violin"!==t.type)return t;let s=!1;const a=new Array(t.data.length).fill(null),h=t.data.map((t,o)=>{var h;const d=e+":"+o;if(Array.isArray(null==(h=null==t?void 0:t.y)?void 0:h.density)&&t.y.density.length&&!P(i,d,t.y.density))return t;const c=I(t,!0);if(!c)return t;const u=w(c,{bandwidth:r.bandwidth,resolution:r.resolution});if(!u)return t;s=!0,a[o]=c;const b=t.y&&"object"==typeof t.y&&!Array.isArray(t.y)?t.y:{};return i.set(d,u.density),l(n({},t),{y:l(n({},b),{density:u.density,points:c})})});return s&&(o[e]=a),s?l(n({},t),{data:h}):t});return k(e,o,t.length),h}),p("histogram",function(t,e){const s=t.globals,a=t.histogramData,r=s&&s.histogramRawSeries;if(!a||!Array.isArray(a.edges)||a.edges.length<2)return null;if(!Array.isArray(r)||!r.length)return null;const i=x(s),o=a.edges,n=[];return r.forEach((e,s)=>{var a;if(-1!==i.indexOf(s))return;const l=C(S(e&&e.data),o),h=t.seriesData&&(null==(a=t.seriesData.seriesNames)?void 0:a[s])||(null==e?void 0:e.name);l.forEach((t,e)=>{const a=`${L(o[e])}-${L(o[e+1])}`;n.push({name:r.length>1&&h?`${h} ${a}`:a,realIndex:s,rows:t})})}),n.length?H(t,n,e):null}),p("boxPlot",R),p("violin",D);const X=d.__apex_Graphics,F=d.__apex_DataLabels,O=(t,e,s,a)=>{if("function"!=typeof t)return t;const r=t({series:e.seriesData.series,seriesIndex:s,dataPointIndex:a,w:e});return Number.isFinite(r)?r:0},M=d.__apex_Animations,T=d.__apex_Animations_computeStagger,Y=d.__apex_BrowserAPIs_BrowserAPIs,j=d.__apex_Environment_Environment;function B(t){var e;const s=t.config.chart.animations;if(!s||!1===s.enabled)return!1;if(!s.dynamicAnimation||!1===s.dynamicAnimation.enabled)return!1;const a=null!=(e=s.largeDatasetThreshold)?e:0;return!(a>0&&t.globals.dataPoints>a)&&!!(j.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate)}function z(t,e,s){var a,r,i,o;if(null==(a=t.axisFlags)?void 0:a.isXNumeric){const a=null==(i=null==(r=t.seriesData)?void 0:r.seriesX)?void 0:i[e];if(a&&a.length&&null!=a[s])return"x:"+a[s]}const n=null==(o=t.globals.labels)?void 0:o[s];return null!=n&&""!==String(n)?"c:"+(Array.isArray(n)?n.join(" "):String(n)):"j:"+s}function _(t){const e=new Map;return t.map(t=>{const s=e.get(t)||0;return e.set(t,s+1),0===s?t:`${t}#${s}`})}function G(t,e,s=!1,a=!1){var r,i;if(!B(t))return null;const o=t.globals.prevStreamFrame;if(!o)return null;const n=null==(r=o.seriesY)?void 0:r[e],l=null==(i=t.seriesData.series)?void 0:i[e];if(!Array.isArray(n)||!Array.isArray(l))return null;if(!n.length||!l.length)return null;const h=_(n.map((t,s)=>function(t,e,s){var a,r;if(t.isXNumeric){const r=null==(a=t.seriesX)?void 0:a[e];if(r&&r.length&&null!=r[s])return"x:"+r[s]}const i=null==(r=t.labels)?void 0:r[s];return null!=i&&""!==String(i)?"c:"+(Array.isArray(i)?i.join(" "):String(i)):"j:"+s}(o,e,s))),d=_(l.map((s,a)=>z(t,e,a))),c=function(t,e){const s=new Map;t.forEach((t,e)=>{s.has(t)||s.set(t,e)});const a=new Array(e.length),r=new Set;let i=-1,o=!0,n=t.length===e.length;e.forEach((t,e)=>{const l=s.has(t)&&!r.has(s.get(t))?s.get(t):-1;a[e]=l,-1!==l&&(r.add(l),l<i&&(o=!1),i=l),l!==e&&(n=!1)});const l=[];for(let e=0;e<t.length;e++)r.has(e)||l.push(e);return{toOld:a,exits:l,ordered:o,changed:!n}}(h,d);return(c.ordered||a)&&(c.changed||s)?{join:c,oldKeys:h,newKeys:d}:null}function N({w:t,elSeries:e,record:s,newKeys:a,isHorizontal:r,speed:i}){var o;if(!B(t))return;if(!s||!Array.isArray(s.paths)||!(null==e?void 0:e.node))return;const n=new Set(a),l=s.paths.filter(t=>t&&t.d&&null!=t.key&&!n.has(t.key));if(!l.length)return;const h=new X(t),d=null==(o=t.globals.colors)?void 0:o[parseInt(String(s.realIndex),10)];l.forEach(a=>{let o=a.fill||d||"#c8c8c8";0===String(o).indexOf("url(")&&(o=d||"#c8c8c8");const n=h.drawPath({d:a.d,stroke:"none",strokeWidth:0,fill:o,fillOpacity:1,classes:"apexcharts-bar-ghost"}),l=n.node;l.setAttribute("pointer-events","none"),n.attr("clip-path",`url(#gridRectBarMask${t.globals.cuid})`),e.node.insertBefore(l,e.node.firstChild);const c=function(t){const e=/^M\s*([+-]?[\d.eE]+)[\s,]+([+-]?[\d.eE]+)/.exec(t||"");if(!e)return null;const s=parseFloat(e[1]),a=parseFloat(e[2]);return isFinite(s)&&isFinite(a)?{x:s,y:a}:null}(a.d);let u=r?"left center":"center bottom";try{const t=l.getBBox();c&&t&&(u=r?Math.abs(c.x-t.x)<=Math.abs(c.x-(t.x+t.width))?"left center":"right center":Math.abs(c.y-(t.y+t.height))<=Math.abs(c.y-t.y)?"center bottom":"center top")}catch(t){}const b=l.style;b.transformBox="fill-box",b.transformOrigin=u,l.setAttribute("data:ghostKey",`${s.realIndex}::${a.key}`);try{const t=l.getBBox(),e=r?u.startsWith("left")?t.x:t.x+t.width:u.endsWith("bottom")?t.y+t.height:t.y;isFinite(e)&&l.setAttribute("data:ghostEdge",String(e))}catch(t){}const g=Math.max(1,i||1),p=performance.now(),x=e=>{if(t.globals.isDestroyed||!l.parentNode)return;const s=Math.max(0,Math.min(1,(e-p)/g)),a=1-Math.pow(1-s,3),i=1-a;b.transform=r?`scaleX(${i})`:`scaleY(${i})`,b.opacity=String(1-a),s<1?Y.requestAnimationFrame(x):l.parentNode.removeChild(l)};Y.requestAnimationFrame(x)})}class V{constructor(t){this.w=t.w,this.barCtx=t,this.totalFormatter=this.w.config.plotOptions.bar.dataLabels.total.formatter,this.totalFormatter||(this.totalFormatter=this.w.config.dataLabels.formatter)}handleBarDataLabels(t){var e,s,a,r,i,o;const{x:h,y:d,y1:c,y2:u,i:b,j:g,realIndex:p,columnGroupIndex:x,barHeight:f,barWidth:y,barXPosition:m,barYPosition:v,visibleSeries:C,hl:w}=t,I=this.w,A=new X(this.barCtx.w);this.hlt=null==w?void 0:w.total;const P=I.waterfallData&&I.waterfallData.values,S=w&&null!=w.val?w.val:P&&P[p]&&null!=P[p][g]?P[p][g]:null,k=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[p]:this.barCtx.strokeWidth;let H,L;I.axisFlags.isXNumeric&&!I.globals.isBarHorizontal?(H=h+y*(C+1),L=d+f*(C+1)-k):(H=h+y*C,L=d+f*C);let W=null,R=null,D=h,F=d,M={};const T=I.config.dataLabels,Y=this.barCtx.barOptions.dataLabels,j=this.barCtx.barOptions.dataLabels.total;void 0!==v&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(L=v,F=v),void 0!==m&&this.barCtx.isVerticalGroupedRangeBar&&(H=m,D=m);const B=O(T.offsetX,I,p,g),z=O(T.offsetY,I,p,g),_=(null==w?void 0:w.hide)?void 0:null!==S?S:void 0!==u?[c,u]:"100%"===I.config.chart.stackType?I.globals.seriesPercent[p][g]:I.seriesData.series[p][g];let G,N={width:0,height:0};T.enabled&&(G=void 0===_?"":T.formatter(_,l(n({},I),{seriesIndex:p,dataPointIndex:g,w:I})),N=A.getTextRects(G,parseFloat(T.style.fontSize).toString(),T.style.fontFamily,void 0,!0,T.style.fontWeight));const V={x:null!=(e=null==w?void 0:w.x)?e:h,y:null!=(s=null==w?void 0:w.y)?s:d,neg:w&&null!=w.val?w.val<0:void 0,i:b,j:g,realIndex:p,columnGroupIndex:x,bcx:H,bcy:L,barHeight:null!=(a=null==w?void 0:w.barHeight)?a:f,barWidth:null!=(r=null==w?void 0:w.barWidth)?r:y,textRects:N,strokeWidth:k,dataLabelsX:D,dataLabelsY:F,dataLabelsConfig:T,barDataLabelsConfig:Y,barTotalDataLabelsConfig:j,offX:B,offY:z};if(M=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(V):this.calculateColumnsDataLabelsPosition(V),null!==S&&this.barCtx.isHorizontal&&"center"===Y.position){const t=null==(o=null==(i=I.waterfallData.geometry)?void 0:i[p])?void 0:o[g];t&&t.horizontal&&(M.dataLabelsX=(t.levelStart+t.levelEnd)/2+B)}return W=this.drawCalculatedDataLabels({x:M.dataLabelsX,y:M.dataLabelsY,neg:V.neg,val:_,text:G,i:p,j:g,barWidth:V.barWidth,barHeight:V.barHeight,textRects:N,dataLabelsConfig:T}),I.config.chart.stacked&&j.enabled&&!1!==this.hlt&&(R=this.drawTotalDataLabels({x:M.totalDataLabelsX,y:M.totalDataLabelsY,barWidth:y,barHeight:f,realIndex:p,j:g,textAnchor:M.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:p,j:g}),rawVal:this.getStackedTotalValue({realIndex:p,j:g}),dataLabelsConfig:T,barTotalDataLabelsConfig:j})),{dataLabelsPos:M,dataLabels:W,totalDataLabels:R}}hasMultipleSeriesGroups(){return this.w.labelData.seriesGroups.length>1}getTotalGroupContext(t){if(!this.hasMultipleSeriesGroups())return null;const e=this.barCtx.barHelpers.getSeriesGroupIndex(t);return e<0?null:{groupIndex:e}}drawsStackedTotal(t){const e=this.barCtx.lastActiveBarSerieIndexByGroup,s=this.getTotalGroupContext(t);return s&&e&&e.length>s.groupIndex?e[s.groupIndex]===t:this.barCtx.lastActiveBarSerieIndex===t}getStackedTotalValue({realIndex:t,j:e}){if(this.hlt)return this.hlt.val;const s=this.w,a=this.xStackTop(t,e);if(a)return a[3];const r=this.getTotalGroupContext(t),i=s.seriesData.stackedSeriesTotalsByGroups;return r&&i&&i[r.groupIndex]?i[r.groupIndex][e]:this.barCtx.stackedSeriesTotals[e]}xStackTop(t,e){var s,a;const r=this.w;return r.axisFlags.isXNumeric&&(null==(a=null==(s=this.barCtx.stacks)?void 0:s[r.labelData.seriesGroupIndex[t]])?void 0:a.tops.get(r.seriesData.seriesX[t][e]))}getStackedTotalDataLabel({realIndex:t,j:e}){const s=this.w;let a=this.getStackedTotalValue({realIndex:t,j:e});return this.totalFormatter&&(a=this.totalFormatter(a,l(n({},s),{seriesIndex:t,dataPointIndex:e,w:s}))),a}calculateColumnsDataLabelsPosition(t){var e;const s=this.w;let a,r,{i:i,j:o,realIndex:n,y:l,bcx:h,barWidth:d,barHeight:c,textRects:u,dataLabelsX:b,dataLabelsY:g,dataLabelsConfig:p,barDataLabelsConfig:x,barTotalDataLabelsConfig:f,strokeWidth:y,offX:m,offY:v}=t;const C=h;c=Math.abs(c);const w="vertical"===s.config.plotOptions.bar.dataLabels.orientation,{zeroEncounters:I}=this.barCtx.barHelpers.getZeroValueEncounters({i:i,j:o});h-=y/2;const A=s.layout.gridWidth/s.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?b+=d/2:(b=s.axisFlags.isXNumeric?h-d/2+m:h-A+d/2+m,!s.config.chart.stacked&&I>0&&s.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(b-=d*I)),w){const t=2;b=b+u.height/2-y/2-t}const P=null!=(e=t.neg)?e:s.seriesData.series[i][o]<0;let S=l;switch(this.barCtx.isReversed&&(S=l+(P?c:-c)),x.position){case"center":g=w?P?S-c/2+v:S+c/2-v:P?S-c/2+u.height/2+v:S+c/2+u.height/2-v;break;case"bottom":g=w?P?S-c+v:S+c-v:P?S-c+u.height+y+v:S+c-u.height/2+y-v;break;case"top":g=w?P?S+v:S-v:P?S-u.height/2-v:S+u.height+v}let k=S;const H=this.getTotalGroupContext(n),L=this.xStackTop(n,o),W=L?[]:this.barCtx.stacks||[];if(L&&(k=P?Math.max(S,L[5]):Math.min(S,L[4])),W.forEach((t,e)=>{H&&e!==H.groupIndex||t.prevY.forEach(t=>{k=P?Math.max(t[o],k):Math.min(t[o],k)})}),this.hlt&&(k=this.hlt.edge),this.drawsStackedTotal(n)&&f.enabled){const t=18,e=new X(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:n,j:o}),p.fontSize);a=P?k-e.height/2-v-f.offsetY+t:k+e.height+v+f.offsetY-t;const i=A;r=C+(s.axisFlags.isXNumeric?-d/2:d/2-i)+f.offsetX}return s.config.chart.stacked||(g<0?g=0+y:g+u.height/3>s.layout.gridHeight&&(g=s.layout.gridHeight-y)),{bcx:h,bcy:l,dataLabelsX:b,dataLabelsY:g,totalDataLabelsX:r,totalDataLabelsY:a,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){var e,s;const a=this.w;let{x:r,i:i,j:o,realIndex:n,bcy:l,barHeight:h,barWidth:d,textRects:c,dataLabelsX:u,strokeWidth:b,dataLabelsConfig:g,barDataLabelsConfig:p,barTotalDataLabelsConfig:x,offX:f,offY:y}=t;const m=a.layout.gridHeight/a.globals.dataPoints,{zeroEncounters:v}=this.barCtx.barHelpers.getZeroValueEncounters({i:i,j:o});let C,w,I;if(d=Math.abs(d),this.barCtx.isPyramid){C=l+h/2+y-(null!=(e=c.centerOffset)?e:0)}else C=l-(this.barCtx.isRangeBar?0:m)+h/2+c.height/2+y-3;!a.config.chart.stacked&&v>0&&a.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(C-=h*v);let A="start";const P=null!=(s=t.neg)?s:a.seriesData.series[i][o]<0;let S=r;if(this.barCtx.isReversed&&(S=r+(P?-d:d),A=P?"start":"end"),this.barCtx.isPyramid)u=a.layout.gridWidth/2+f;else switch(p.position){case"center":u=P?S+d/2-f:Math.max(c.width/2,S-d/2)+f;break;case"bottom":u=P?S+d-b-f:S-d+b+f;break;case"top":u=P?S-b-f:S-b+f}let k=S;const H=this.getTotalGroupContext(n);if((this.barCtx.stacks||[]).forEach((t,e)=>{H&&e!==H.groupIndex||t.prevX.forEach(t=>{k=P?Math.min(t[o],k):Math.max(t[o],k)})}),this.hlt&&(k=this.hlt.edge),this.drawsStackedTotal(n)&&x.enabled){const t=new X(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:n,j:o}),g.fontSize);P?(w=k-b-f-x.offsetX,A="end"):w=k+f+x.offsetX+(this.barCtx.isReversed?-(d+b):b),I=C-c.height/2+t.height/2+x.offsetY+b,a.globals.barGroups.length>1&&!H&&(I-=a.globals.barGroups.length/2*(h/2))}if(!a.config.chart.stacked){const t=P&&"middle"!==g.textAnchor?"start"===g.textAnchor?"end":"start":g.textAnchor;let e;e="vertical"===p.orientation?c.height/2:"end"===t?c.width:"middle"===t?c.width/2:0;const s=("vertical"===p.orientation?c.height:c.width)-e;u+s>a.layout.gridWidth-b&&(u=a.layout.gridWidth-s-b),u-e<b&&(u=e+b)}return{bcx:r,bcy:l,dataLabelsX:u,dataLabelsY:C,totalDataLabelsX:w,totalDataLabelsY:I,totalDataLabelsAnchor:A}}drawCalculatedDataLabels({x:t,y:e,val:s,text:a,neg:r,i:i,j:o,textRects:h,barHeight:d,barWidth:c,dataLabelsConfig:u}){var b,g,p;const x=this.w;let f="rotate(0)";"vertical"===x.config.plotOptions.bar.dataLabels.orientation&&(f=`rotate(-90, ${t}, ${e})`);const y=new F(this.barCtx.w,this.barCtx.ctx),m=new X(this.barCtx.w),v=u.formatter;let C=null;const w=x.globals.collapsedSeriesIndices.indexOf(i)>-1,I=(x.globals.collapsingSeriesIndices||[]).indexOf(i)>-1;if(I){const t=null==(b=x.globals.prevDataLabels)?void 0:b.get(`${i}::${z(x,i,o)}`);t&&isFinite(t.val)&&(s=t.val,a=void 0)}if(u.enabled&&(!w||I)){C=m.group({class:"apexcharts-data-labels",transform:f});const b=x.config.dataLabels;((null==(g=b.animate)?void 0:g.enabled)||(null==(p=b.countUp)?void 0:p.enabled))&&(C.node.setAttribute("data:dlKey",`${i}::${z(x,i,o)}`),C.node.setAttribute("data:dlJ",String(o)),"number"==typeof s&&isFinite(s)&&C.node.setAttribute("data:dlVal",String(s))),void 0===s?a="":void 0===a&&(a=v(s,l(n({},x),{seriesIndex:i,dataPointIndex:o,w:x}))),!s&&x.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(a="");const w=null!=r?r:x.seriesData.series[i][o]<0,A=x.config.plotOptions.bar.dataLabels.position;if("vertical"===x.config.plotOptions.bar.dataLabels.orientation&&("top"===A&&(u.textAnchor=w?"end":"start"),"center"===A&&(u.textAnchor="middle"),"bottom"===A&&(u.textAnchor=w?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){c<m.getTextRects(a,parseFloat(u.style.fontSize).toString()).width&&(a="")}x.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&!I&&(this.barCtx.isHorizontal?h.width/1.6>Math.abs(c)&&(a=""):h.height/1.6>Math.abs(d)&&(a=""));const P=n({},u);this.barCtx.isHorizontal&&s<0&&("start"===u.textAnchor?P.textAnchor="end":"end"===u.textAnchor&&(P.textAnchor="start")),y.plotDataLabelsText({x:t,y:e,text:a,i:i,j:o,parent:C,dataLabelsConfig:P,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return C}drawTotalDataLabels({x:t,y:e,val:s,rawVal:a,realIndex:r,j:i,textAnchor:o,barTotalDataLabelsConfig:n}){var l,h;const d=new X(this.barCtx.w);let c;if(n.enabled&&void 0!==t&&void 0!==e&&this.drawsStackedTotal(r)){c=d.drawText({x:t,y:e,foreColor:n.style.color,text:s,textAnchor:o,fontFamily:n.style.fontFamily,fontSize:n.style.fontSize,fontWeight:n.style.fontWeight}),c.attr({class:"apexcharts-datalabel-total",cx:t,cy:e});const u=this.w.config.dataLabels;if((null==(l=u.animate)?void 0:l.enabled)||(null==(h=u.countUp)?void 0:h.enabled)){const{groupIndex:t}=this.barCtx.barHelpers.getGroupIndex(r);c.node.setAttribute("data:dlTotalKey",`${t}::${z(this.w,r,i)}`),c.node.setAttribute("data:dlTotalSeries",String(r)),"number"==typeof a&&isFinite(a)&&c.node.setAttribute("data:dlTotalVal",String(a))}}return c}}const E=d.__apex_Series,$=d.__apex_Fill;function Z(t){var e,s,a,r,i,o,n;return"histogram"===(null==(s=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:s.requestedType)&&(!1!==(null==(r=null==(a=t.config.plotOptions)?void 0:a.histogram)?void 0:r.overlap)&&(null!=(n=null==(o=null==(i=t.seriesData)?void 0:i.series)?void 0:o.length)?n:0)>1)}class q{constructor(t){this.w=t.w,this.barCtx=t}initVariables(t){const e=this.w;this.barCtx.series=t,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(let s=0;s<t.length;s++)if(t[s].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[s].length),e.axisFlags.isXNumeric)for(let a=0;a<t[s].length;a++)e.seriesData.seriesX[s][a]>e.globals.minX&&e.seriesData.seriesX[s][a]<e.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=e.globals.dataPoints;this.arrBorderRadius=this.createBorderRadiusArr(e.seriesData.series),c.isSafari()&&(this.arrBorderRadius=this.arrBorderRadius.map(t=>t.map(t=>"none"))),0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1)}barSlotXSpan(){const t=this.w;if(void 0!==this._slotXSpan)return this._slotXSpan;let e=0;if(t.globals.dataPoints<=1){const s=t.globals.maxX-t.globals.minX;e=s>0?s/4:0}else if(e=this._unionMinXGap(),!(e>0&&isFinite(e))){const s=t.globals.minXDiff;e=s>0&&isFinite(s)&&.5!==s?s:0}return this._slotXSpan=e,e}_unionMinXGap(){const t=this.w.seriesData.seriesX||[],e=[];for(let s=0;s<t.length;s++){const a=t[s];Array.isArray(a)&&a.length>0&&e.push(a.some((t,e)=>t<a[e-1])?a.filter(t=>t===+t).sort((t,e)=>t-e):a)}if(!e.length)return 0;const s=new Array(e.length).fill(0);let a=NaN,r=1/0;for(;;){let t=1/0,i=-1;for(let a=0;a<e.length;a++){const r=e[a];for(;s[a]<r.length&&"number"!=typeof r[s[a]];)s[a]++;if(s[a]>=r.length)continue;const o=r[s[a]];o==o?o<t&&(t=o,i=a):(s[a]++,a--)}if(-1===i)break;if(s[i]++,a==a){const e=t-a;e>0&&e<r&&(r=e)}a=t}return isFinite(r)?r:0}initialPositions(t){const e=this.w;let s,a,r,i,o,n,l,h,d=e.globals.dataPoints;this.barCtx.isRangeBar&&(d=e.labelData.labels.length);let u=this.barCtx.seriesLen;if((e.config.plotOptions.bar.rangeBarGroupRows||Z(e))&&(u=1),this.barCtx.isHorizontal)r=e.layout.gridHeight/d,o=r/u,o=o*parseInt(this.barCtx.barOptions.barHeight,10)/100,-1===String(this.barCtx.barOptions.barHeight).indexOf("%")&&(o=parseInt(this.barCtx.barOptions.barHeight,10)),h=this.barCtx.baseLineInvertedY+e.globals.padHorizontal+(this.barCtx.isReversed?e.layout.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),this.barCtx.isFunnel&&(h=e.layout.gridWidth/2),a=(r-o*this.barCtx.seriesLen)/2;else{if(i=e.layout.gridWidth/this.barCtx.visibleItems,e.config.xaxis.convertedCatToNumeric&&(i=e.layout.gridWidth/e.globals.dataPoints),n=i/u*parseInt(this.barCtx.barOptions.columnWidth,10)/100,e.axisFlags.isXNumeric){const t=this.barCtx.xRatio,e=this.barSlotXSpan();e>0&&e/t>0&&(i=e/t),n=i/u*parseInt(this.barCtx.barOptions.columnWidth,10)/100,n<1&&(n=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(n=parseInt(this.barCtx.barOptions.columnWidth,10)),l=e.layout.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?e.layout.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),e.axisFlags.isXNumeric){s=this.barCtx.getBarXForNumericXAxis({x:s,j:0,realIndex:t,barWidth:n}).x}else s=e.globals.padHorizontal+c.noExponents(i-n*this.barCtx.seriesLen)/2}return e.globals.barHeight=o,e.globals.barWidth=n,{x:s,y:a,yDivision:r,xDivision:i,barHeight:o,barWidth:n,zeroH:l,zeroW:h}}initializeStackedPrevVars(t){t.stacks=t.w.labelData.seriesGroups.map(()=>({prevY:[],prevX:[],prevYF:[],prevXF:[],prevYVal:[],prevXVal:[],tops:new Map}))}initializeStackedXYVars(t){t.stacks.forEach(t=>{t.xArrj=[],t.xArrjF=[],t.xArrjVal=[],t.yArrj=[],t.yArrjF=[],t.yArrjVal=[]})}getPathFillColor(t,e,s,a){var r;const i=this.w,o=new $(this.barCtx.w);let n=null;const l=this.barCtx.barOptions.distributed?s:e;let h=!1;if(this.barCtx.barOptions.colors.ranges.length>0){this.barCtx.barOptions.colors.ranges.map(a=>{t[e][s]>=a.from&&t[e][s]<=a.to&&(n=a.color,h=!0)})}const d=this.getDumbbellConnectorFill(e,s)||(null==(r=i.config.series[e].data[s])?void 0:r.fill),c=this.barCtx.barOptions.isDumbbell?i.config.plotOptions.bar.dumbbell.connector:null;let u;c&&c.color&&(n=c.color,u=c.opacity);return{color:o.fillPath({seriesNumber:this.barCtx.barOptions.distributed?l:a,dataPointIndex:s,color:n,opacity:u,value:t[e][s],fillConfig:d,fillType:(null==d?void 0:d.type)?d.type:Array.isArray(i.config.fill.type)?i.config.fill.type[a]:i.config.fill.type}),useRangeColor:h}}getDumbbellConnectorFill(t,e){const s=this.w;if(!this.barCtx.barOptions.isDumbbell)return null;const a=s.dumbbellData;if(!a||"series"!==a.form)return null;const r=s.config.plotOptions.bar.dumbbell.connector;if(r.color)return null;const i=a.order[e];if(!i)return null;const o=s.globals.colors[i[0]],n=s.globals.colors[i[1]];return o&&n?{type:"gradient",gradient:{type:this.barCtx.isHorizontal?"horizontal":"vertical",gradientFrom:o,gradientTo:n,opacityFrom:r.opacity,opacityTo:r.opacity,stops:[0,100],inverseColors:!this.barCtx.isHorizontal}}:null}getStrokeWidth(t,e,s){let a=0;const r=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]||"bar"===r.config.chart.type&&!this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,r.config.stroke.show&&(this.barCtx.isNullValue||(a=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[s]:this.barCtx.strokeWidth)),a}getStackedSeriesIndices(t){const e=this.w,s=e.labelData.seriesGroups,a=e.globals.columnSeries?new Set(e.globals.columnSeries.i):null,r=t=>!a||a.has(t);if(!s||s.length<2){const e=Array.from({length:t},(t,e)=>e).filter(r);return e.length?[e]:[]}const i=Array.from({length:s.length},()=>[]),o=[];for(let e=0;e<t;e++){if(!r(e))continue;const t=this.getSeriesGroupIndex(e);t>-1?i[t].push(e):o.push(e)}return o.length&&i.push(o),i.filter(t=>t.length>0)}createBorderRadiusArr(t){var e;const s=this.w,a=!this.w.config.chart.stacked||s.config.plotOptions.bar.borderRadius<=0,r=t.length,i=0|(null==(e=t[0])?void 0:e.length),o=Array.from({length:r},()=>Array(i).fill(a?"top":"none"));if(a)return o;const n="last"===s.config.plotOptions.bar.borderRadiusWhenStacked,l=n?"top":"both",h=n?"bottom":"both",d=n?"none":"bottom",c=n?"none":"top";for(const e of this.getStackedSeriesIndices(r))for(let s=0;s<i;s++){const a=[],r=[];for(const i of e){const e=t[i][s];e>0?a.push(i):e<0&&r.push(i)}if(a.length>0&&0===r.length)if(1===a.length)o[a[0]][s]=l;else{const t=a[0],e=a[a.length-1];for(const r of a)o[r][s]=r===t?d:r===e?"top":"none"}else if(r.length>0&&0===a.length)if(1===r.length)o[r[0]][s]=h;else{const t=Math.min(...r),e=Math.max(...r);for(const a of r)o[a][s]=a===t?c:a===e?"bottom":"none"}else if(a.length>0&&r.length>0){const t=a[a.length-1];for(const e of a)o[e][s]=e===t?"top":"none";const e=Math.max(...r);for(const t of r)o[t][s]=t===e?"bottom":"none"}}return o}barBackground({j:t,i:e,x1:s,x2:a,y1:r,y2:i,elSeries:o}){const n=this.w,l=new X(this.barCtx.w),h=new E(this.barCtx.w).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&h===e){t>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(t%=this.barCtx.barOptions.colors.backgroundBarColors.length);const e=this.barCtx.barOptions.colors.backgroundBarColors[t],h=l.drawRect(void 0!==s?s:0,void 0!==r?r:0,void 0!==a?a:n.layout.gridWidth,void 0!==i?i:n.layout.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,e,this.barCtx.barOptions.colors.backgroundBarOpacity);o.add(h),h.node.classList.add("apexcharts-backgroundBar")}}barRect({a:t,len:e,v1:s,v2:a,strokeWidth:r,realIndex:i,j:o,dir:n,horizontal:l}){const h=this.w,d=new X(h);(r=Array.isArray(r)?r[i]:r)||(r=0);const c=h.config.series[i].data[o],u=l?null==c?void 0:c.barHeightOffset:null==c?void 0:c.columnWidthOffset;u&&(t-=u/2,e+=u);const b=r/2,g=n*(this.barCtx.isReversed?-1:1),p="around"===h.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[i][o]?" Z":" z";let x,f,y,m,v,C;l?(y=t+b,m=t+e-b,x=s+.001+b*g,f=a+.001-b*g,v=d.line(x,m),C=d.move(x,y)+d.line(f,y)+d.line(f,m)+v+p):(x=t+b,f=t+e-b,y=s+.001-b*g,m=a+.001+b*g,v=d.line(f,y),C=d.move(x,y)+d.line(x,m)+d.line(f,m)+v+p);return{x1:x,x2:f,y1:y,y2:m,sl:v,closing:p,squarePathTo:C,pathTo:"none"!==this.arrBorderRadius[i][o]?d.roundPathCorners(C,h.config.plotOptions.bar.borderRadius):C,base:d.move(x,y)+d.line(x,y)+v+v+v+v+v+d.line(x,y)+p,strokeWidth:r,strokeCenter:b,direction:g}}getColumnPaths({barWidth:t,barXPosition:e,y1:s,y2:a,strokeWidth:r,series:i,realIndex:o,i:n,j:l,w:h}){var d,c;const u=this.barRect({a:e,len:t,v1:s,v2:a,strokeWidth:r,realIndex:o,j:l,dir:i[n][l]>=0?1:-1}),{pathTo:b,squarePathTo:g,strokeCenter:p,direction:x}=u;s=u.y1,a=u.y2;let f=null;const y=null==(c=null==(d=this.barCtx.ctx)?void 0:d.morphTypeChange)?void 0:c.getInitialPathFor(o,l);if(y?f=y:h.globals.previousPaths.length>0&&(f=this.barCtx.getPreviousPath(o,l,b,g)),null==f&&(f=u.base),h.config.chart.stacked){const t=this.barCtx.groupCtx;t.yArrj.push(a-p*x),t.yArrjF.push(Math.abs(s-a+u.strokeWidth*x)),t.yArrjVal.push(this.barCtx.series[n][l])}return{pathTo:b,pathFrom:f,drawnBox:{x1:u.x1,x2:u.x2,y1:s,y2:a}}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:s,i:a,j:r,realIndex:i,strokeWidth:o,w:n}){var l,h;const d=new X(this.barCtx.w),c=n.layout.gridWidth/2,u=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,b=u(s[a][r]),g=r===s[a].length-1,p="taper"===n.config.plotOptions.funnel.lastShape?"taper":"flat";let x;x=g?"taper"===p?0:b:u(s[a][r+1]);const f=o/2,y=t+f,m=t+e-f,v=c-b,C=c+b,w=c-x,I=c+x,A=d.move(v,y)+d.line(C,y)+d.line(I,m)+d.line(w,m)+" Z";let P=null;const S=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(i,r);return S?P=S:n.globals.previousPaths.length>0&&(P=this.barCtx.getPreviousPath(i,r,A)),null==P&&(P=d.move(c,y)+d.line(c,y)+d.line(c,m)+d.line(c,m)+" Z"),{pathTo:A,pathFrom:P,x:C,x1:v,barXPosition:c}}computePyramidLayout(t){const e=this.w,s=e.layout.gridHeight,a=e.layout.gridWidth,r=t.map(t=>Math.abs(Number(t)||0)),i=r.reduce((t,e)=>t+e,0);if(0===i||s<=0)return r.map(()=>({y:0,height:0,topHalf:0,bottomHalf:0}));const o=a/2;let n=0;const l=[];for(let t=0;t<r.length;t++){const e=n/i;n+=r[t];const a=n/i,h=e*s,d=a*s;l.push({y:h,height:d-h,topHalf:e*o,bottomHalf:a*o})}return l}getPyramidPaths({barYPosition:t,barHeight:e,topHalf:s,bottomHalf:a,realIndex:r,j:i,strokeWidth:o,w:n}){var l,h;const d=new X(this.barCtx.w),c=n.layout.gridWidth/2,u=o/2,b=t+u,g=t+e-u,p=c-s,x=c+s,f=c-a,y=c+a,m=d.move(p,b)+d.line(x,b)+d.line(y,g)+d.line(f,g)+" Z";let v=null;const C=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(r,i);return C?v=C:n.globals.previousPaths.length>0&&(v=this.barCtx.getPreviousPath(r,i,m)),null==v&&(v=d.move(c,b)+d.line(c,b)+d.line(c,g)+d.line(c,g)+" Z"),{pathTo:m,pathFrom:v,x:x,x1:p,barXPosition:c}}getBarpaths({barYPosition:t,barHeight:e,x1:s,x2:a,strokeWidth:r,series:i,realIndex:o,i:n,j:l,w:h}){var d,c;const u=new X(this.barCtx.w),b=this.barRect({a:t,len:e,v1:s,v2:a,strokeWidth:r,realIndex:o,j:l,dir:i[n][l]>=0?1:-1,horizontal:!0}),{y1:g,y2:p,sl:x,closing:f,squarePathTo:y,pathTo:m,strokeCenter:v,direction:C}=b;s=b.x1,a=b.x2;const w=this.barCtx.isFunnel,I=w?(s+a)/2:s;let A=null;const P=null==(c=null==(d=this.barCtx.ctx)?void 0:d.morphTypeChange)?void 0:c.getInitialPathFor(o,l);if(P?A=P:h.globals.previousPaths.length>0&&(A=this.barCtx.getPreviousPath(o,l,m,y)),null==A){const t=w?u.line(I,p):x;A=u.move(I,g)+u.line(I,g)+t+t+t+t+t+u.line(I,g)+f}if(h.config.chart.stacked){const t=this.barCtx.groupCtx;t.xArrj.push(a+v*C),t.xArrjF.push(Math.abs(s-a-b.strokeWidth*C)),t.xArrjVal.push(this.barCtx.series[n][l])}return{pathTo:m,pathFrom:A,drawnBox:{x1:s,x2:a,y1:g,y2:p}}}getXForValue(t,e,s=!0){let a=s?e:null;return null!=t&&(a=e+t/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?t/this.barCtx.invertedYRatio:0)),a}getYForValue(t,e,s,a=!0){let r=a?e:null;return null!=t&&(r=e-t/this.barCtx.yRatio[s]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[s]:0)),r}getGoalValues(t,e,s,a,r,i){const o=this.w,h=[],d=(a,r)=>{h.push({[t]:"x"===t?this.getXForValue(a,e,!1):this.getYForValue(a,s,i,!1),attrs:r})};if(o.seriesData.seriesGoals[a]&&o.seriesData.seriesGoals[a][r]&&Array.isArray(o.seriesData.seriesGoals[a][r])&&o.seriesData.seriesGoals[a][r].forEach(t=>{d(t.value,t)}),this.barCtx.barOptions.isDumbbell){const e=this.getDumbbellEnds(a,r);if(e.length){const s={strokeHeight:"x"===t?0:o.globals.markers.size[a],strokeWidth:"x"===t?o.globals.markers.size[a]:0,strokeDashArray:0,strokeLineCap:"round"};let i=0,h=0;for(let t=1;t<e.length;t++)e[t].value<e[i].value&&(i=t),e[t].value>e[h].value&&(h=t);const c=o.config.plotOptions.bar.dumbbell.dataLabels;e.forEach((t,e)=>{const o=l(n({},s),{strokeColor:t.color});!c.enabled||e!==i&&e!==h||(o.label={text:this.getDumbbellLabelText(t.value,a,r,t.index),color:c.colorFromMarker?t.color:Array.isArray(c.style.colors)?c.style.colors[t.index]||c.style.colors[0]:c.style.colors,outward:e===i&&i!==h?-1:1}),d(t.value,o)})}}return h}getDumbbellEnds(t,e){const s=this.w,a=[],r=s.dumbbellData;if(r&&"series"===r.form){const t=r.values[e]||[];for(let e=0;e<t.length;e++){const i=t[e];null!==i&&-1===r.hidden.indexOf(e)&&a.push({value:i,color:s.globals.colors[e],index:e})}return a}if(!s.rangeData.seriesRange.length)return a;const i=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:s.globals.colors,o=e=>Array.isArray(i[t])?i[t][e]:i[t];return[{value:s.rangeData.seriesRangeStart[t][e],color:o(0),index:0},{value:s.rangeData.seriesRangeEnd[t][e],color:o(1),index:1}]}getDumbbellLabelText(t,e,s,a){const r=this.w,i=r.config.plotOptions.bar.dumbbell.dataLabels;if("function"==typeof i.formatter)return i.formatter(t,{seriesIndex:e,dataPointIndex:s,endpointIndex:a,w:r});const o=this.barCtx.isHorizontal?r.formatters.xLabelFormatter:r.formatters.yLabelFormatters[0];return"function"==typeof o?o(t,s,r):String(t)}drawGoalLine({barXPosition:t,barYPosition:e,goalX:s,goalY:a,barWidth:r,barHeight:i}){if(!(Array.isArray(s)&&s.length>0||Array.isArray(a)&&a.length>0))return null;const o=new X(this.barCtx.w),n=o.group({class:"apexcharts-bar-goals-groups"});n.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:n.node}),n.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let l=null;return this.barCtx.isHorizontal?Array.isArray(s)&&s.forEach(t=>{if(t.x>=-1&&t.x<=o.w.layout.gridWidth+1){const s=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:i/2,a=e+s+i/2;l=o.drawLine(t.x,a-2*s,t.x,a,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeWidth?t.attrs.strokeWidth:2,t.attrs.strokeLineCap),n.add(l),t.attrs.label&&n.add(this.drawDumbbellLabel(t.attrs,{x:t.x,y:a-s,horizontal:!0,markerSize:t.attrs.strokeWidth||0}))}}):Array.isArray(a)&&a.forEach(e=>{if(e.y>=-1&&e.y<=o.w.layout.gridHeight+1){const s=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:r/2,a=t+s+r/2;l=o.drawLine(a-2*s,e.y,a,e.y,e.attrs.strokeColor?e.attrs.strokeColor:void 0,e.attrs.strokeDashArray,e.attrs.strokeHeight?e.attrs.strokeHeight:2,e.attrs.strokeLineCap),n.add(l),e.attrs.label&&n.add(this.drawDumbbellLabel(e.attrs,{x:a-s,y:e.y,horizontal:!1,markerSize:e.attrs.strokeHeight||0}))}}),n}drawDumbbellLabel(t,e){const s=this.w,a=new X(s),r=s.config.plotOptions.bar.dumbbell.dataLabels,i=e.markerSize/2+r.offset,o=t.label.outward;return a.drawText({x:e.x+(e.horizontal?i*o:0),y:e.y-(e.horizontal?0:i*o),text:t.label.text,textAnchor:e.horizontal?o<0?"end":"start":"middle",dominantBaseline:e.horizontal?"central":o<0?"hanging":"auto",foreColor:t.label.color,fontSize:r.style.fontSize,fontFamily:r.style.fontFamily,fontWeight:r.style.fontWeight,cssClass:"apexcharts-dumbbell-label"})}drawBarShadow({prevPaths:t,currPaths:e,color:s,realIndex:a,j:r}){const i=this.w,{x:o,x1:n,barYPosition:l}=t,{x:h,x1:d,barYPosition:u}=e,b=l+e.barHeight,g=new X(this.barCtx.w),p=new c,x=g.move(n,b)+g.line(o,b)+g.line(h,u)+g.line(d,u)+g.line(n,b)+("around"===i.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[a][r]?" Z":" z");return g.drawPath({d:x,fill:p.shadeColor(.5,c.rgb2hex(s)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}getZeroValueEncounters({i:t,j:e}){var s;const a=this.w;let r=0,i=0;return(a.config.plotOptions.bar.horizontal?a.seriesData.series.map((t,e)=>e):(null==(s=a.globals.columnSeries)?void 0:s.i.map(t=>t))||[]).forEach(s=>{const o=a.globals.seriesPercent[s][e];o&&r++,s<t&&0===o&&i++}),{nonZeroColumns:r,zeroEncounters:i}}getSeriesGroupIndex(t){var e;return null!=(e=this.w.labelData.seriesGroupIndex[t])?e:-1}getGroupIndex(t){const e=this.getSeriesGroupIndex(t),s=this.barCtx.columnGroupIndices;let a=s.indexOf(e);return a<0&&(s.push(e),a=s.length-1),{groupIndex:e,columnGroupIndex:a}}}const K=d.__apex_CoreUtils,U=d.__apex_Filters;class J{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)/J.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*J.xRatio(t)}static screenXToPlotPx(t,e){const s=t.dom.baseEl,a=s&&s.querySelector(".apexcharts-svg");if(!a)return e-t.layout.translateX;const r=a.getBoundingClientRect(),i=t.globals.svgWidth?r.width/t.globals.svgWidth:1;return(e-r.left)/(i||1)-t.layout.translateX}}class Q{constructor(t,e,s){this.ctx=e,this.w=t,this.barOptions=t.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=t.config.stroke.width,this.isNullValue=!1,this.isRangeBar=t.rangeData.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!t.globals.isBarHorizontal&&t.rangeData.seriesRange.length&&t.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.isPyramid=this.barOptions.isPyramid,this.pyramidLayout=null,this.xyRatios=s,this.xRatio=0,this.yRatio=[],this.invertedXRatio=0,this.invertedYRatio=0,this.baseLineY=[],this.baseLineInvertedY=0,null!==this.xyRatios&&(this.xRatio=s.xRatio,this.yRatio=s.yRatio,this.invertedXRatio=s.invertedXRatio,this.invertedYRatio=s.invertedYRatio,this.baseLineY=s.baseLineY,this.baseLineInvertedY=s.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[],this._prevKeyed=null,this._ltCache=null,this._layoutShiftCache=null,this._pathToInterp=null,this.series=[],this.elSeries=null,this.visibleI=0,this.isReversed=!1;const a=new E(this.w);this.lastActiveBarSerieIndex=a.getActiveConfigSeriesIndex("desc",["bar","column"]),this.lastActiveBarSerieIndexByGroup=a.getActiveConfigSeriesIndexByGroup(["bar","column"]),this.columnGroupIndices=[];const r=a.getBarSeriesIndices(),i=new K(this.w);this.stackedSeriesTotals=i.getStackedSeriesTotals(this.w.config.series.map((t,e)=>-1===r.indexOf(e)?e:-1).filter(t=>-1!==t)),this.barHelpers=new q(this)}setSeriesAxis(t){return this.yRatio.length>1&&(this.yaxisIndex=this.w.globals.seriesYAxisReverseMap[t],this.translationsIndex=t),this.translationsIndex}draw(t,e){var s,a,r,i,o;const h=this.w,d=new X(this.w),u=new K(this.w);t=u.getLogSeries(t),this.series=t,this.yRatio=u.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const b=d.group({class:"apexcharts-bar-series apexcharts-plot-series"}),g=this.ctx.highlightFilter;h.config.dataLabels.enabled&&this.totalItems>this.barOptions.dataLabels.maxItems&&console.warn("WARNING: DataLabels are enabled but there are too many to display. This may cause performance issue when rendering - ApexCharts");for(let u=0,p=0;u<t.length;u++,p++){let x,f;const y=[],m=[],v=h.globals.comboCharts?e[u]:u,{columnGroupIndex:C}=this.barHelpers.getGroupIndex(v),w=d.group({class:"apexcharts-series",rel:u+1,seriesName:c.escapeString(h.seriesData.seriesNames[v]),"data:realIndex":v});E.addCollapsedClassToSeries(this.w,w,v),t[u].length>0&&(this.visibleI=this.visibleI+1);const I=this.setSeriesAxis(v);this.isReversed=h.config.yaxis[this.yaxisIndex]&&h.config.yaxis[this.yaxisIndex].reversed,this.isPyramid&&(this.pyramidLayout=this.barHelpers.computePyramidLayout(t[u]));const A=this.barHelpers.initialPositions(v),{y:P,yDivision:S,zeroW:k,x:H,xDivision:L,zeroH:W}=A;let R=A.barHeight,D=A.barWidth;f=P,x=H,this.isHorizontal||m.push(x+(null!=D?D:0)/2);const X=d.group({class:"apexcharts-datalabels","data:realIndex":v}),F=h.config.dataLabels,O=!(null==(s=F.animate)?void 0:s.enabled)&&this.isLengthTransition(v);h.globals.dataChanged&&!O&&!(!(null==(a=F.animate)?void 0:a.enabled)&&!(null==(r=F.countUp)?void 0:r.enabled))||(h.globals.delayedElements.push({el:X.node,holdUntilComplete:O}),X.node.classList.add("apexcharts-element-hidden"));const M=d.group({class:"apexcharts-bar-goals-markers"}),T=d.group({class:"apexcharts-bar-shadows"}),Y=this.ctx,j=Y._barShadows,B=Y._barShadows=[],_=h.globals.dataChanged&&h.globals.shouldAnimate&&h.config.chart.animations.dynamicAnimation.enabled&&(null==j?void 0:j.length)===t[u].length-1;_||(h.globals.delayedElements.push({el:T.node}),T.node.classList.add("apexcharts-element-hidden"));for(let e=0;e<t[u].length;e++){const s=this.barHelpers.getStrokeWidth(u,e,v);let a=null;const r={indexes:{i:u,j:e,realIndex:v,translationsIndex:I,bc:p},x:x,y:f,strokeWidth:s,elSeries:w};this.isHorizontal?(a=this.drawBarPaths(l(n({},r),{barHeight:R,zeroW:k,yDivision:S})),D=this.series[u][e]/this.invertedYRatio):(a=this.drawColumnPaths(l(n({},r),{xDivision:L,barWidth:D,zeroH:W})),R=this.series[u][e]/this.yRatio[I]);const d=this.barHelpers.getPathFillColor(t,u,e,v);if(this.isFunnel&&!this.isPyramid&&this.barOptions.isFunnel3d&&"trapezoid"!==(null==(i=h.config.plotOptions.funnel)?void 0:i.shape)&&this.pathArr.length&&e>0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof d.color&&-1===(null==(o=d.color)?void 0:o.indexOf("url"))?d.color:c.hexToRgba(h.globals.colors[u]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:a,realIndex:v,j:e});if(T.add(t),B.push(t),this._shadow=_&&[t,j[e-1].attr("d")],h.config.chart.dropShadow.enabled){new U(this.w).dropShadow(t,h.config.chart.dropShadow,v)}}this.pathArr.push(a);const b=this.barHelpers.drawGoalLine({barXPosition:a.barXPosition,barYPosition:a.barYPosition,goalX:a.goalX,goalY:a.goalY,barHeight:R,barWidth:D});b&&M.add(b),f=a.y,x=a.x,e>0&&m.push(x+(null!=D?D:0)/2),y.push(f),this.renderSeries(l(n({hl:null==g?void 0:g.bar(this,{i:u,j:e,realIndex:v,translationsIndex:I,paths:a,zeroH:W,zeroW:k}),realIndex:v,pathFill:d.color},d.useRangeColor?{lineFill:d.color}:{}),{j:e,i:u,columnGroupIndex:C,pathFrom:a.pathFrom,pathTo:a.pathTo,strokeWidth:s,elSeries:w,x:x,y:f,series:t,barHeight:Math.abs(a.barHeight?a.barHeight:R),barWidth:Math.abs(a.barWidth?a.barWidth:D),elDataLabelsWrap:X,elGoalsMarkers:M,elBarShadows:T,visibleSeries:this.visibleI,type:"bar"}))}if(h.globals.seriesXvalues[v]=m,h.globals.seriesYvalues[v]=y,h.globals.previousPaths.length>0){const e=[];for(let s=0;s<t[u].length;s++)e.push(z(h,v,s));N({w:h,elSeries:w,record:this._prevRecord(v),newKeys:e,isHorizontal:this.isHorizontal,speed:h.config.chart.animations.dynamicAnimation.speed})}b.add(w)}return b}renderSeries({hl:t,realIndex:e,pathFill:s,lineFill:a,j:r,i:i,columnGroupIndex:o,pathFrom:h,pathTo:d,strokeWidth:c,elSeries:u,x:b,y:g,y1:p,y2:x,series:f,barHeight:y,barWidth:m,barXPosition:v,barYPosition:C,elDataLabelsWrap:w,elGoalsMarkers:I,elBarShadows:A,visibleSeries:P,type:S,classes:k,fadeReveal:H=!1}){var L,W,R,D,F,O,Y;const j=this.w,B=new X(this.w,this.ctx),_=function(t,e){const s=t&&t.renderer;return s&&s.kind&&"svg"!==s.kind?s:e}(this.ctx,B);let G=!1;const N=this._pathToInterp;if(this._pathToInterp=null,u._bindingsDelegated||(u._bindingsDelegated=!0,B.setupEventDelegation(u,`.apexcharts-${S}-area`)),!a){let t=function(t){const e=j.config.stroke.colors;let s;return Array.isArray(e)&&e.length>0&&(s=e[t],s||(s=""),"function"==typeof s)?s({value:j.seriesData.series[t][r],dataPointIndex:r,w:j}):s};const s="function"==typeof j.globals.stroke.colors[e]?t(e):j.globals.stroke.colors[e];a=this.barOptions.distributed?j.globals.stroke.colors[r]:s}const E=j.config.chart.animations,$=E.animateGradually;let Z=0,q=0;if($&&!1!==$.enabled&&!(j.globals.dataChanged&&this.isLayoutShift(e))){const t=j.globals.dataPoints||1,e=$.delay||0,s=Math.min(e,.5*E.speed/Math.max(1,t));q=T({style:"sequential",index:r,baseDelay:s}),j.config.chart.stacked&&!j.globals.dataChanged&&(q+=i*s*.5);Z=q/(e||1)}const K=new V(this).handleBarDataLabels({x:b,y:g,y1:p,y2:x,i:i,j:r,series:f,realIndex:e,columnGroupIndex:o,barHeight:y,barWidth:m,barXPosition:v,barYPosition:C,visibleSeries:P,hl:null==t?void 0:t.label});if(q>0){const t=j.config.dataLabels;if((null==(L=t.animate)?void 0:L.enabled)||(null==(W=t.countUp)?void 0:W.enabled)){const t=String(Math.round(q));null==(D=null==(R=K.dataLabels)?void 0:R.node)||D.setAttribute("data:dlDelay",t),null==(O=null==(F=K.totalDataLabels)?void 0:F.node)||O.setAttribute("data:dlDelay",t)}}let J=!1;j.globals.isBarHorizontal||(K.dataLabelsPos.dataLabelsX+Math.max(m,j.globals.barPadForNumericAxis)<0||K.dataLabelsPos.dataLabelsX-Math.max(m,j.globals.barPadForNumericAxis)>j.layout.gridWidth)&&(this._wasOnScreen(e,r)?J=!0:G=!0),j.config.series[i].data[r]&&j.config.series[i].data[r].strokeColor&&(a=j.config.series[i].data[r].strokeColor);const Q=s;if(this.isNullValue&&-1===j.globals.collapsingSeriesIndices.indexOf(e)&&(s="none"),!G){const o=!0===(null==(Y=this.ctx.morphTypeChange)?void 0:Y.isActive()),b=o?this.ctx.morphTypeChange.getSpeed():j.config.chart.animations.dynamicAnimation.speed,g=o&&this.ctx.morphTypeChange.claimsTargetMark(e,r);g&&(h=d,Z=0);const f=_.renderPaths({i:i,j:r,realIndex:e,pathFrom:h,pathTo:d,stroke:a,strokeWidth:c,strokeLineCap:j.config.stroke.lineCap,fill:s,pathToInterp:N,animationDelay:Z,initialSpeed:j.config.chart.animations.speed,dataChangeSpeed:b,className:`apexcharts-${S}-area${k?` ${k}`:""}`,chartType:S,bindEventsOnPaths:!1,fadeReveal:H});f.attr("clip-path",`url(#gridRectBarMask${j.globals.cuid})`),J&&f.node.classList.add("apexcharts-leaving");const v=this._shadow;v&&(this._shadow=null,new M(j,this.ctx).animatePathsGradually({el:v[0],fill:"none",pathFrom:v[1],pathTo:v[0].attr("d"),speed:b,delay:Z})),g&&(f.node.setAttribute("opacity","0"),f.node.setAttribute("data-piece-hidden","1"));const C=j.config.forecastDataPoints;C.count>0&&r>=j.globals.dataPoints-C.count&&(f.node.setAttribute("stroke-dasharray",C.dashArray),f.node.setAttribute("stroke-width",C.strokeWidth),f.node.setAttribute("fill-opacity",C.fillOpacity)),void 0!==p&&void 0!==x&&(f.attr("data-range-y1",p),f.attr("data-range-y2",x));if(new U(this.w).setSelectionFilter(f,e,r),u.add(f),f.attr({cy:K.dataLabelsPos.bcy,cx:K.dataLabelsPos.bcx,j:r,val:j.seriesData.series[i][r],barHeight:y,barWidth:m,"data:pathKey":z(j,e,r)}),null==t||t.paint(f,{delay:Z,delayMs:q,speed:b,fill:Q,elSeries:u,elBarShadows:A,labels:K.dataLabels,pathFrom:h,pathTo:d}),"canvas"===_.kind){j.globals.barCanvasCoords||(j.globals.barCanvasCoords={}),j.globals.barCanvasCoords[e]||(j.globals.barCanvasCoords[e]={});const t=j.globals.barCanvasCoords[e][r];let s=(null==t?void 0:t.bounds)||null;const a=f.bbox();(a.width>0||a.height>0)&&(s={left:Math.min(s?s.left:1/0,a.x),top:Math.min(s?s.top:1/0,a.y),right:Math.max(s?s.right:-1/0,a.x+a.width),bottom:Math.max(s?s.bottom:-1/0,a.y+a.height)}),j.globals.barCanvasCoords[e][r]=l(n({cx:K.dataLabelsPos.bcx,cy:K.dataLabelsPos.bcy,barWidth:m,type:S},void 0!==p&&void 0!==x&&{rangeY1:p,rangeY2:x}),{bounds:s})}null!==K.dataLabels&&w.add(K.dataLabels),K.totalDataLabels&&w.add(K.totalDataLabels),u.add(w),I&&u.add(I),A&&u.add(A)}return u}drawBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:a,x:r,y:i,yDivision:o,elSeries:n}){const l=this.w,h=t.i,d=t.j;let c;if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:h,j:d});t>0&&(e=this.seriesLen*e/t),c=i+e*this.visibleI,c-=e*s}else c=i+e*this.visibleI;const u=this.isFunnel&&"trapezoid"===l.config.plotOptions.funnel.shape,b=this.isPyramid&&this.pyramidLayout?this.pyramidLayout[d]:null,g=!!b;if(b)c=b.y,e=b.height;else if(this.isFunnel&&!u){const t=null!=a?a:0;a=t-(this.barHelpers.getXForValue(this.series[h][d],t)-t)/2}let p;return r=this.barHelpers.getXForValue(this.series[h][d],null!=a?a:0),p=b?this.barHelpers.getPyramidPaths({barYPosition:c,barHeight:e,topHalf:b.topHalf,bottomHalf:b.bottomHalf,realIndex:t.realIndex,j:d,strokeWidth:s,w:l}):u?this.barHelpers.getFunnelTrapezoidPaths({barYPosition:c,barHeight:e,series:this.series,i:h,j:d,realIndex:t.realIndex,strokeWidth:s,w:l}):this.barHelpers.getBarpaths({barYPosition:c,barHeight:e,x1:a,x2:r,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:h,j:d,w:l}),(u||g)&&(a=p.x1,r=p.x),g||(i+=o),g&&(i=c),this.barHelpers.barBackground({j:d,i:h,y1:c-e*this.visibleI,y2:e*this.seriesLen,elSeries:n}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x1:a,x:r,y:i,goalX:this.barHelpers.getGoalValues("x",a,null,t.realIndex,d,0),barYPosition:c,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:s,xDivision:a,barWidth:r,zeroH:i,strokeWidth:o,elSeries:n}){const l=this.w,h=t.realIndex,d=t.translationsIndex,c=t.i,u=t.j,b=t.bc;let g;if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:u,realIndex:h,barWidth:r});e=t.x,g=t.barXPosition}else if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:c,j:u});t>0&&(r=this.seriesLen*r/t),g=e+r*this.visibleI,g-=r*s}else g=e+r*this.visibleI;s=this.barHelpers.getYForValue(this.series[c][u],i,d);const p=this.barHelpers.getColumnPaths({barXPosition:g,barWidth:r,y1:i,y2:s,strokeWidth:o,isReversed:this.isReversed,series:this.series,realIndex:h,i:c,j:u,w:l});return l.axisFlags.isXNumeric||(e+=a),this.barHelpers.barBackground({bc:b,j:u,i:c,x1:g-o/2-r*this.visibleI,x2:r*this.seriesLen+o/2,elSeries:n}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x:e,y:s,goalY:this.barHelpers.getGoalValues("y",null,i,h,u,d),barXPosition:g,barWidth:r}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:s,j:a}){const r=this.w;let i=s;return r.seriesData.seriesX[s].length||(i=r.globals.maxValsInArrayIndex),c.isNumber(r.seriesData.seriesX[i][a])&&(t=J.dataXToPx(r,r.seriesData.seriesX[i][a])-e*this.seriesLen/2),{barXPosition:t+(Z(r)?0:e*this.visibleI),x:t}}_wasOnScreen(t,e){if(!B(this.w))return!1;const s=this._prevKeyedPaths(t);return!!s&&s.has(z(this.w,t,e))}_prevRecord(t){const e=this.w;let s=null;for(let a=0;a<e.globals.previousPaths.length;a++){const r=e.globals.previousPaths[a];r.paths&&r.paths.length>0&&parseInt(r.realIndex,10)===parseInt(String(t),10)&&(s=r)}return s}_prevKeyedPaths(t){if(this._prevKeyed||(this._prevKeyed={}),void 0!==this._prevKeyed[t])return this._prevKeyed[t];const e=this._prevRecord(t);let s=null;if(e&&e.paths.every(t=>null!=t.key)){const t=new Map;e.paths.forEach(e=>{t.set(e.key,e)}),s=t}return this._prevKeyed[t]=s,s}isLengthTransition(t){var e,s;if(this._ltCache||(this._ltCache={}),void 0!==this._ltCache[t])return this._ltCache[t];const a=this.w;let r=!1;if(B(a)&&a.globals.previousPaths.length>0){const i=this._prevRecord(t),o=null!=(s=null==(e=a.seriesData.series[t])?void 0:e.length)?s:0;if(i)if(i.paths.length!==o)r=!0;else{const e=this._prevKeyedPaths(t);if(e)for(let s=0;s<o;s++)if(!e.has(z(a,t,s))){r=!0;break}}else r=o>0}return this._ltCache[t]=r,r}isLayoutShift(t){if(this.isLengthTransition(t))return!0;if(this._layoutShiftCache||(this._layoutShiftCache={}),void 0!==this._layoutShiftCache[t])return this._layoutShiftCache[t];const e=G(this.w,t,!0,!0),s=!(!e||!e.join.changed);return this._layoutShiftCache[t]=s,s}getPreviousPath(t,e,s,a){const r=this.w;this._pathToInterp=null;const i=this._prevRecord(t);if(!i)return B(r)?null:s;let o=null,n=!1;const l=this._prevKeyedPaths(t);if(l){const s=l.get(z(r,t,e));s?o=s.d:n=!0}else void 0!==i.paths[e]?o=i.paths[e].d:n=!0;return o?this.cornerMorph(o,s,a):n&&B(r)?null:s}cornerMorph(t,e,s){const a=Q.pathCommandCount(t),r=Q.pathCommandCount(e);if(a===r)return t;const i=new X(this.w),o=t=>{const e=Q.pathBox(t);return e?Math.min(e.maxX-e.minX,e.maxY-e.minY):0},n=a<r?o(t)>1:o(e)>1;if(a<r){const e=i.roundPathCorners(t,0);if(Q.pathCommandCount(e)===r){if(n&&s){const t=i.roundPathCorners(s,0);Q.pathCommandCount(t)===r&&(this._pathToInterp=t)}return e}}else{const s=i.roundPathCorners(e,0);if(Q.pathCommandCount(s)===a){if(this._pathToInterp=s,n){const e=Q.squareLike(t),s=e?i.roundPathCorners(e,0):null;if(s&&Q.pathCommandCount(s)===a)return s}return t}}return e}static pathBox(t){if(!t)return null;const e=[],s=/([MLC])([^MLCZz]*)/g;let a;for(;null!==(a=s.exec(t));){const t=a[2].trim().split(/[\s,]+/).map(Number);t.length<2||t.some(isNaN)||e.push([t[t.length-2],t[t.length-1]])}if(e.length<3)return null;const r=e.map(t=>t[0]),i=e.map(t=>t[1]);return{minX:Math.min(...r),maxX:Math.max(...r),minY:Math.min(...i),maxY:Math.max(...i),start:e[0],vertical:Math.abs(e[1][0]-e[0][0])<Math.abs(e[1][1]-e[0][1])}}static squareLike(t){const e=Q.pathBox(t);if(!e)return null;const{minX:s,maxX:a,minY:r,maxY:i,start:o,vertical:n}=e,l=(t,e,s)=>Math.abs(t-e)<=Math.abs(t-s)?[e,s]:[s,e];let h,d,c,u;n?(h=Math.abs(o[0]-s)<=Math.abs(o[0]-a)?s:a,d=h===s?a:s,[c,u]=l(o[1],r,i)):(c=Math.abs(o[1]-r)<=Math.abs(o[1]-i)?r:i,u=c===r?i:r,[h,d]=l(o[0],s,a));const b=t.trim().endsWith("Z")?" Z":" z";return n?`M ${h} ${c} L ${h} ${u} L ${d} ${u} L ${d} ${c}${b}`:`M ${h} ${c} L ${d} ${c} L ${d} ${u} L ${h} ${u}${b}`}getPreviousFlip(t,e){const s=this.w,a=this._prevRecord(t);if(!a)return null;const r=this._prevKeyedPaths(t),i=r?r.get(z(s,t,e)):a.paths[e];return i?!!i.flip:null}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[MmLlHhVvCcSsQqTtAaZz]/g);return e?e.length:0}}d.default.use({bar:Q,column:Q,barStacked:class extends Q{draw(t,e){const s=this.w;this.graphics=new X(this.w);const a=new K(this.w);t=a.getLogSeries(t),this.yRatio=a.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t),"100%"===s.config.chart.stackType&&(t=s.globals.comboCharts?e.map(t=>s.globals.seriesPercent[t]):s.globals.seriesPercent.slice()),this.series=t,this.barHelpers.initializeStackedPrevVars(this);const r=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"}),i=this.ctx.highlightFilter;let o=0,h=0;const d=s.config.chart.animations,u=d.enabled&&d.dynamicAnimation.enabled&&s.globals.previousPaths.length>0;let b=!1;for(let a=0,d=0;a<t.length;a++,d++){const g=s.globals.comboCharts?e[a]:a,{groupIndex:p,columnGroupIndex:x}=this.barHelpers.getGroupIndex(g);this.groupCtx=this.stacks[p];const f=[],y=[],m=this.setSeriesAxis(g);this.isReversed=s.config.yaxis[this.yaxisIndex]&&s.config.yaxis[this.yaxisIndex].reversed;let v=this.graphics.group({class:"apexcharts-series",seriesName:c.escapeString(s.seriesData.seriesNames[g]),rel:a+1,"data:realIndex":g});E.addCollapsedClassToSeries(this.w,v,g);const C=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":g});E.addCollapsedClassToSeries(this.w,C,g),(s.globals.collapsingSeriesIndices||[]).indexOf(g)>-1&&C.node.style.setProperty("--apexcharts-dl-exit",`${s.config.chart.animations.dynamicAnimation.speed}ms`);const w=this.graphics.group({class:"apexcharts-bar-goals-markers"}),I=this.initialPositions(o,h,void 0,void 0,void 0,void 0,m),{xDivision:A,yDivision:P,zeroH:S,zeroW:k}=I;let H=I.barHeight,L=I.barWidth;h=I.y,o=I.x,s.globals.barHeight=H,s.globals.barWidth=L,this.barHelpers.initializeStackedXYVars(this),1===this.groupCtx.prevY.length&&this.groupCtx.prevY[0].every(t=>isNaN(t))&&(this.groupCtx.prevY[0]=this.groupCtx.prevY[0].map(()=>S),this.groupCtx.prevYF[0]=this.groupCtx.prevYF[0].map(()=>0));for(let e=0;e<s.globals.dataPoints;e++){const r=this.barHelpers.getStrokeWidth(a,e,g),c={indexes:{i:a,j:e,realIndex:g,translationsIndex:m,bc:d},strokeWidth:r,x:o,y:h,elSeries:v,columnGroupIndex:x};let p=null;this.isHorizontal?(p=this.drawStackedBarPaths(l(n({},c),{zeroW:k,barHeight:H,yDivision:P})),L=this.series[a][e]/this.invertedYRatio):(p=this.drawStackedColumnPaths(l(n({},c),{xDivision:A,barWidth:L,zeroH:S})),H=this.series[a][e]/this.yRatio[m]);const I=this.barHelpers.drawGoalLine({barXPosition:p.barXPosition,barYPosition:p.barYPosition,goalX:p.goalX,goalY:p.goalY,barHeight:H,barWidth:L});I&&w.add(I),h=p.y,o=p.x,f.push(o),y.push(h);const W=this.barHelpers.getPathFillColor(t,a,e,g);let R="";const D=s.globals.isBarHorizontal?"apexcharts-flip-x":"apexcharts-flip-y",X=this.cornerFlip(this.barHelpers.arrBorderRadius[g][e],s.seriesData.series[g][e]),F=u&&!X&&this.getPreviousFlip(g,e);(X||F)&&(R=D),F&&(R+=" apexcharts-flip-held",b=!0),v=this.renderSeries(l(n({hl:null==i?void 0:i.bar(this,{i:a,j:e,realIndex:g,translationsIndex:m,paths:p,zeroH:S,zeroW:k}),realIndex:g,pathFill:W.color},W.useRangeColor?{lineFill:W.color}:{}),{j:e,i:a,columnGroupIndex:x,pathFrom:p.pathFrom,pathTo:p.pathTo,strokeWidth:r,elSeries:v,x:o,y:h,series:t,barHeight:H,barWidth:L,elDataLabelsWrap:C,elGoalsMarkers:w,type:"bar",visibleSeries:x,classes:R}))}s.globals.seriesXvalues[g]=f,s.globals.seriesYvalues[g]=y,this.groupCtx.prevY.push(this.groupCtx.yArrj),this.groupCtx.prevYF.push(this.groupCtx.yArrjF),this.groupCtx.prevYVal.push(this.groupCtx.yArrjVal),this.groupCtx.prevX.push(this.groupCtx.xArrj),this.groupCtx.prevXF.push(this.groupCtx.xArrjF),this.groupCtx.prevXVal.push(this.groupCtx.xArrjVal),r.add(v)}return b&&this.settleHeldMirrors(),r}cornerFlip(t,e){return"bottom"===t&&e>0||"top"===t&&e<0}settleHeldMirrors(){const t=this.w;if(!j.isBrowser())return;const e=t.config.chart.animations,s=(e.dynamicAnimation.speed||0)+(e.speed||0)+100;setTimeout(()=>{!t.globals.isDestroyed&&c.elementExists(t.dom.baseEl)&&t.dom.baseEl.querySelectorAll(".apexcharts-flip-held").forEach(t=>{t.classList.remove("apexcharts-flip-held","apexcharts-flip-y","apexcharts-flip-x")})},s)}initialPositions(t,e,s,a,r,i,o){const n=this.w;let l,h;if(this.isHorizontal){a=n.layout.gridHeight/n.globals.dataPoints;const t=n.config.plotOptions.bar.barHeight;l=-1===String(t).indexOf("%")?parseInt(t,10):a*parseInt(t,10)/100,i=n.globals.padHorizontal+(this.isReversed?n.layout.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),e=(a-l)/2}else{h=s=n.layout.gridWidth/n.globals.dataPoints;const e=n.config.plotOptions.bar.columnWidth,a=n.axisFlags.isXNumeric?this.barHelpers.barSlotXSpan():0;a>0?h=(s=a/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:h*=parseInt(e,10)/100,-1===String(e).indexOf("%")&&(h=parseInt(e,10)),r=this.isReversed?this.baseLineY[o]:n.layout.gridHeight-this.baseLineY[o],t=n.globals.padHorizontal+(s-h)/2}const d=n.globals.barGroups.length||1;return{x:t,y:e,yDivision:a,xDivision:s,barHeight:(null!=l?l:0)/d,barWidth:(null!=h?h:0)/d,zeroH:r,zeroW:i}}drawStackedBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:a,x:r,y:i,columnGroupIndex:o,yDivision:n,elSeries:l}){var h,d,c,u,b;const g=this.w,p=i+o*e;let x;const f=t.i,y=t.j,m=t.realIndex,v=t.translationsIndex;let C=0;for(let t=0;t<this.groupCtx.prevXF.length;t++)C+=this.groupCtx.prevXF[t][y];const w=this.groupCtx.prevX.length;if(w>0){let t=a;this.groupCtx.prevXVal[w-1][y]<0?t=(null==(h=this.series[f])?void 0:h[y])>=0?this.groupCtx.prevX[w-1][y]+C-2*(this.isReversed?C:0):this.groupCtx.prevX[w-1][y]:this.groupCtx.prevXVal[w-1][y]>=0&&(t=(null==(d=this.series[f])?void 0:d[y])>=0?this.groupCtx.prevX[w-1][y]:this.groupCtx.prevX[w-1][y]-C+2*(this.isReversed?C:0)),x=t}else x=a;r=null===(null==(c=this.series[f])?void 0:c[y])?x:x+(null==(u=this.series[f])?void 0:u[y])/this.invertedYRatio-2*(this.isReversed?(null==(b=this.series[f])?void 0:b[y])/this.invertedYRatio:0);const I=this.barHelpers.getBarpaths({barYPosition:p,barHeight:e,x1:x,x2:r,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:f,j:y,w:g});return this.barHelpers.barBackground({j:y,i:f,y1:p,y2:e,elSeries:l}),i+=n,{pathTo:I.pathTo,pathFrom:I.pathFrom,goalX:this.barHelpers.getGoalValues("x",a,null,m,y,v),barXPosition:x,barYPosition:p,x:r,y:i}}drawStackedColumnPaths({indexes:t,x:e,y:s,xDivision:a,barWidth:r,zeroH:i,columnGroupIndex:o,elSeries:n}){var l,h,d,c,u,b;const g=this.w,p=t.i,x=t.j,f=t.bc,y=t.realIndex,m=t.translationsIndex;if(g.axisFlags.isXNumeric){let t=g.seriesData.seriesX[y][x];t||(t=0),e=(t-g.globals.minX)/this.xRatio-r/2*g.globals.barGroups.length}const v=e+o*r;let C;const w=this.groupCtx,I=g.axisFlags.isXNumeric?g.seriesData.seriesX[y][x]:x,A=w.tops.get(I);if(A){const[t,e,s]=A;let a;e<0?a=(null==(l=this.series[p])?void 0:l[x])>=0?t-s+2*(this.isReversed?s:0):t:e>=0&&(a=(null==(h=this.series[p])?void 0:h[x])>=0?t:t+s-2*(this.isReversed?s:0)),void 0===a&&(a=g.layout.gridHeight),C=(null==(d=w.prevYF[0])?void 0:d.every(t=>0===t))&&w.prevYF.slice(1).every(t=>t.every(t=>isNaN(t)))?i:a}else C=i;s=(null==(c=this.series[p])?void 0:c[x])?C-(null==(u=this.series[p])?void 0:u[x])/this.yRatio[m]+2*(this.isReversed?(null==(b=this.series[p])?void 0:b[x])/this.yRatio[m]:0):C;const P=this.barHelpers.getColumnPaths({barXPosition:v,barWidth:r,y1:C,y2:s,yRatio:this.yRatio[m],strokeWidth:this.strokeWidth,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:p,j:x,w:g}),S=w.yArrj[x];return isNaN(S)||w.tops.set(I,[S,w.yArrjVal[x],(A?A[2]:0)+w.yArrjF[x],(A?A[3]:0)+(g.seriesData.series[y][x]||0),A?Math.min(A[0],A[4]):1/0,A?Math.max(A[0],A[5]):-1/0]),this.barHelpers.barBackground({bc:f,j:x,i:p,x1:v,x2:r,elSeries:n}),{pathTo:P.pathTo,pathFrom:P.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,i,y,x,0),barXPosition:v,x:g.axisFlags.isXNumeric?e:e+a,y:s}}},rangeBar:class extends Q{draw(t,e){var s,a,r,i,o,l,h,d,u;const b=this.w,g=new X(this.w);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=b.rangeData.seriesRangeStart,this.seriesRangeEnd=b.rangeData.seriesRangeEnd,this.barHelpers.initVariables(t);const p=g.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let x=0;x<t.length;x++){let f,y;const m=b.globals.comboCharts?e[x]:x,{columnGroupIndex:v}=this.barHelpers.getGroupIndex(m),C=g.group({class:"apexcharts-series",seriesName:c.escapeString(b.seriesData.seriesNames[m]),rel:x+1,"data:realIndex":m});E.addCollapsedClassToSeries(this.w,C,m),t[x].length>0&&(this.visibleI=this.visibleI+1);const w=this.setSeriesAxis(m),I=this.barHelpers.initialPositions(m),{y:A,zeroW:P,x:S,zeroH:k}=I;let H=null!=(s=I.barWidth)?s:0,L=null!=(a=I.barHeight)?a:0;const W=null!=(r=I.yDivision)?r:0,R=null!=(i=I.xDivision)?i:0;y=A,f=S;const D=g.group({class:"apexcharts-datalabels","data:realIndex":m}),X=g.group({class:"apexcharts-rangebar-goals-markers"});for(let e=0;e<b.globals.dataPoints;e++){const s=this.barHelpers.getStrokeWidth(x,e,m),a=this.seriesRangeStart[x][e],r=this.seriesRangeEnd[x][e];let i=null,c=null,g=null;const p={x:f,y:y,strokeWidth:s,elSeries:C};let A=this.seriesLen;if(b.config.plotOptions.bar.rangeBarGroupRows&&(A=1),void 0===(null==(o=b.config.series[x].data)?void 0:o[e]))break;if(this.isHorizontal){g=y+L*this.visibleI;const t=(W-L*A)/2;if(null==(h=null==(l=b.config.series[x].data)?void 0:l[e])?void 0:h.x){const s=this.detectOverlappingBars({i:x,j:e,barYPosition:g,srty:t,barHeight:L,yDivision:W,initPositions:I});L=s.barHeight,g=s.barYPosition}i=this.drawRangeBarPaths(n({indexes:{i:x,j:e,realIndex:m},barHeight:L,barYPosition:g,zeroW:P,yDivision:W,y1:a,y2:r},p)),H=i.barWidth}else{b.axisFlags.isXNumeric&&(f=(b.seriesData.seriesX[x][e]-b.globals.minX)/this.xRatio-H/2),c=f+H*this.visibleI;const t=(R-H*A)/2;if(null==(u=null==(d=b.config.series[x].data)?void 0:d[e])?void 0:u.x){const s=this.detectOverlappingBars({i:x,j:e,barXPosition:c,srtx:t,barWidth:H,xDivision:R,initPositions:I});H=s.barWidth,c=s.barXPosition}i=this.drawRangeColumnPaths(n({indexes:{i:x,j:e,realIndex:m,translationsIndex:w},barWidth:H,barXPosition:c,zeroH:k,xDivision:R},p)),L=i.barHeight}const S=this.barHelpers.drawGoalLine({barXPosition:i.barXPosition,barYPosition:g,goalX:i.goalX,goalY:i.goalY,barHeight:L,barWidth:H});S&&X.add(S),y=i.y,f=i.x;const F=this.barHelpers.getPathFillColor(t,x,e,m);this.renderSeries({realIndex:m,pathFill:F.color,lineFill:F.useRangeColor?F.color:b.globals.stroke.colors[m],j:e,i:x,x:f,y:y,y1:a,y2:r,pathFrom:i.pathFrom,pathTo:i.pathTo,strokeWidth:s,elSeries:C,series:t,barHeight:L,barWidth:H,barXPosition:c,barYPosition:g,columnGroupIndex:v,elDataLabelsWrap:D,elGoalsMarkers:X,visibleSeries:this.visibleI,type:"rangebar"})}if(b.globals.previousPaths.length>0){const t=b.config.series[x].data||[],e=[];for(let s=0;s<t.length;s++)e.push(z(b,m,s));N({w:b,elSeries:C,record:this._prevRecord(m),newKeys:e,isHorizontal:this.isHorizontal,speed:b.config.chart.animations.dynamicAnimation.speed})}p.add(C)}return p}detectOverlappingBars({i:t,j:e,barYPosition:s,barXPosition:a,srty:r,srtx:i,barHeight:o,barWidth:n,yDivision:l,xDivision:h,initPositions:d}){var c,u,b,g;const p=this.w;let x=[];const f=null==(u=null==(c=p.globals.seriesRangeName)?void 0:c[t])?void 0:u[e],y=null==(g=null==(b=p.config.series[t].data)?void 0:b[e])?void 0:g.x,m=Array.isArray(y)?y.join(" "):y,v=p.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(m),C=p.rangeData.seriesRange[t].findIndex(t=>{var e;return t.x===m&&(null==(e=t.overlaps)?void 0:e.size)>0});return this.isHorizontal?(s=p.config.plotOptions.bar.rangeBarGroupRows?r+l*v:r+o*this.visibleI+l*v,C>-1&&!p.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(p.rangeData.seriesRange[t][C].overlaps),x.indexOf(f)>-1&&(s=(o=d.barHeight/x.length)*this.visibleI+l*(100-parseInt(this.barOptions.barHeight,10))/100/2+o*(this.visibleI+x.indexOf(f))+l*v))):(v>-1&&!p.labelData.timescaleLabels.length&&(a=p.config.plotOptions.bar.rangeBarGroupRows?i+h*v:i+n*this.visibleI+h*v),C>-1&&!p.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(p.rangeData.seriesRange[t][C].overlaps),x.indexOf(f)>-1&&(a=(n=d.barWidth/x.length)*this.visibleI+h*(100-parseInt(this.barOptions.barWidth,10))/100/2+n*(this.visibleI+x.indexOf(f))+h*v))),{barYPosition:s,barXPosition:a,barHeight:o,barWidth:n}}drawRangeColumnPaths({indexes:t,x:e,xDivision:s,barWidth:a,barXPosition:r,zeroH:i}){var o,n;const l=this.w,{i:h,j:d,realIndex:c,translationsIndex:u}=t,b=this.yRatio[u],g=this.getRangeValue(c,d);let p=Math.min(g.start,g.end),x=Math.max(g.start,g.end);const f=!(void 0===(null==(o=this.series[h])?void 0:o[d])||null===(null==(n=this.series[h])?void 0:n[d]));f?(p=i-p/b,x=i-x/b):p=i;const y=Math.abs(x-p),m=this.barHelpers.getColumnPaths({barXPosition:r,barWidth:a,y1:p,y2:x,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:c,i:c,j:d,w:l});if(f){const t=m.drawnBox,e=g.end>=g.start;this.recordColumnGeometry(c,d,{slotStart:t.x1,slotEnd:t.x2,levelStart:e?t.y1:t.y2,levelEnd:e?t.y2:t.y1,horizontal:!1})}if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:d,realIndex:c,barWidth:a});e=t.x,r=t.barXPosition}else e+=s;return{pathTo:m.pathTo,pathFrom:m.pathFrom,barHeight:y,x:e,y:g.start<0&&g.end<0?p:x,goalY:this.barHelpers.getGoalValues("y",null,i,c,d,u),barXPosition:r}}preventBarOverflow(t){const e=this.w;return t<0&&(t=0),t>e.layout.gridWidth&&(t=e.layout.gridWidth),t}drawRangeBarPaths({indexes:t,y:e,y1:s,y2:a,yDivision:r,barHeight:i,barYPosition:o,zeroW:n}){const l=this.w,{realIndex:h,j:d}=t,c=this.preventBarOverflow(n+s/this.invertedYRatio),u=this.preventBarOverflow(n+a/this.invertedYRatio),b=this.getRangeValue(h,d),g=Math.abs(u-c),p=this.barHelpers.getBarpaths({barYPosition:o,barHeight:i,x1:c,x2:u,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,realIndex:h,j:d,w:l});if(null!=b.start&&null!=b.end){const t=p.drawnBox;this.recordColumnGeometry(h,d,{slotStart:t.y1,slotEnd:t.y2,levelStart:t.x1,levelEnd:t.x2,horizontal:!0})}return l.axisFlags.isXNumeric||(e+=r),{pathTo:p.pathTo,pathFrom:p.pathFrom,barWidth:g,x:b.start<0&&b.end<0?c:u,goalX:this.barHelpers.getGoalValues("x",n,null,h,d,0),y:e}}recordColumnGeometry(t,e,s){const a=this.w.waterfallData&&this.w.waterfallData.geometry;a&&isFinite(s.slotStart)&&isFinite(s.levelEnd)&&(a[t]||(a[t]=[]),a[t][e]=s)}getRangeValue(t,e){const s=this.w;return{start:s.rangeData.seriesRangeStart[t][e],end:s.rangeData.seriesRangeEnd[t][e]}}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>d.default});
5
+ "use strict";var t=Object.defineProperty,e=Object.defineProperties,s=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,o=(e,s,a)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a,n=(t,e)=>{for(var s in e||(e={}))r.call(e,s)&&o(t,s,e[s]);if(a)for(var s of a(e))i.call(e,s)&&o(t,s,e[s]);return t},l=(t,a)=>e(t,s(a));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function h(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const s in t)if("default"!==s){const a=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>t[s]})}return e.default=t,Object.freeze(e)}const d=h(require("apexcharts/core")),c=d.__apex_Utils,u="__apexcharts_series_transforms__";function b(t,e){t&&"string"==typeof t?"function"==typeof e?globalThis[u][t]=e:console.warn(`ApexCharts: registerSeriesTransform("${t}") expects a function (series, w) => series.`):console.warn("ApexCharts: registerSeriesTransform requires a non-empty name.")}globalThis[u]||(globalThis[u]={});const g="__apexcharts_row_sources__";function p(t,e){t&&"string"==typeof t?"function"==typeof e?globalThis[g][t]=e:console.warn(`ApexCharts: registerRowSource("${t}") expects a function (w, opts) => series.`):console.warn("ApexCharts: registerRowSource requires a non-empty name.")}function x(t){return(t.collapsedSeriesIndices||[]).concat(t.ancillaryCollapsedSeriesIndices||[])}function f(t,e){const s=(e.collapsedSeries||[]).concat(e.ancillaryCollapsedSeries||[]);return t.map((t,e)=>{const o=t||{},{hidden:h}=o,d=((t,e)=>{var s={};for(var o in t)r.call(t,o)&&e.indexOf(o)<0&&(s[o]=t[o]);if(null!=t&&a)for(var o of a(t))e.indexOf(o)<0&&i.call(t,o)&&(s[o]=t[o]);return s})(o,["hidden"]);let c=d.data;if(Array.isArray(c)&&!c.length){const t=s.find(t=>t.index===e);t&&Array.isArray(t.data)&&(c=t.data)}return l(n({},d),{data:Array.isArray(c)?c.slice():c})})}globalThis[g]||(globalThis[g]={});function y(t,e){const s=t.length;if(0===s)return NaN;if(1===s)return t[0];const a=(s-1)*e,r=Math.floor(a),i=Math.ceil(a);return r===i?t[r]:t[r]+(t[i]-t[r])*(a-r)}function m(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const s=t.slice().sort((t,e)=>t-e);let a=s[0],r=s[s.length-1];const i=e.range;if(Array.isArray(i)&&2===i.length){const t=Number(i[0]),e=Number(i[1]);Number.isFinite(t)&&Number.isFinite(e)&&e>t&&(a=t,r=e)}if(!(r>a)){const t=Math.abs(a)>0?.05*Math.abs(a):.5;return{edges:[a-t,a+t],binWidth:2*t,rule:"single",capped:!1}}const o=r-a;let n,l;if("number"==typeof e.binWidth&&e.binWidth>0)n=e.binWidth,l="binWidth";else if("number"==typeof e.bins&&e.bins>=1)n=o/Math.floor(e.bins),l="count";else{const t=function(t,e,s){const a=t.length,r=t=>e/Math.max(1,Math.ceil(t)),i=()=>r(Math.log2(a)+1);switch(s){case"sqrt":return{width:r(Math.sqrt(a)),rule:"sqrt"};case"rice":return{width:r(2*Math.cbrt(a)),rule:"rice"};case"scott":{const e=function(t){const e=t.length;if(e<2)return 0;let s=0;for(let a=0;a<e;a++)s+=t[a];const a=s/e;let r=0;for(let s=0;s<e;s++){const e=t[s]-a;r+=e*e}return Math.sqrt(r/e)}(t);return e>0?{width:3.49*e*Math.pow(a,-1/3),rule:"scott"}:{width:i(),rule:"sturges"}}case"fd":{const e=y(t,.75)-y(t,.25);return e>0?{width:2*e*Math.pow(a,-1/3),rule:"fd"}:{width:i(),rule:"sturges"}}case"auto":{const e=i(),s=y(t,.75)-y(t,.25);if(s<=0)return{width:e,rule:"sturges"};const r=2*s*Math.pow(a,-1/3);return r<e?{width:r,rule:"fd"}:{width:e,rule:"sturges"}}default:return{width:i(),rule:"sturges"}}}(s,o,"string"==typeof e.bins?e.bins:"auto");n=t.width,l=t.rule}(!Number.isFinite(n)||n<=0)&&(n=o);let h=Math.ceil(o/n);(!Number.isFinite(h)||h<1)&&(h=1);let d=!1;h>1e3&&(h=1e3,d=!0),n=o/h;const c=new Array(h+1);for(let t=0;t<=h;t++)c[t]=a+t*n;return c[h]=Math.max(c[h],r),{edges:c,binWidth:n,rule:l,capped:d}}function v(t,e){const s=e.length-1;if(!(t>=e[0])||t>e[s])return-1;if(t===e[s])return s-1;const a=(e[s]-e[0])/s;if(a>0){let r=Math.floor((t-e[0])/a);return r<0&&(r=0),r>s-1&&(r=s-1),t<e[r]?r--:t>=e[r+1]&&r++,r<0||r>s-1?-1:r}let r=0,i=s-1;for(;r<=i;){const s=r+i>>1;if(t<e[s])i=s-1;else{if(!(t>=e[s+1]))return s;r=s+1}}return-1}function w(t,e){const s=Math.max(0,e.length-1),a=new Array(s);for(let t=0;t<s;t++)a[t]=[];for(let s=0;s<t.length;s++){const r=v(t[s],e);r>=0&&a[r].push(t[s])}return a}function C(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const s=t.slice().sort((t,e)=>t-e),a=s.length;let r=e.bandwidth;if(!("number"==typeof r&&r>0)){const t=function(t){const e=t.length;if(e<2)return 0;let s=0;for(let a=0;a<e;a++)s+=t[a];const a=s/e;let r=0;for(let s=0;s<e;s++){const e=t[s]-a;r+=e*e}return Math.sqrt(r/e)}(s),e=y(s,.75)-y(s,.25);r=.9*(e>0?Math.min(t,e/1.349):t)*Math.pow(a,-.2)}if(!isFinite(r)||r<=0){const t=s[0],e=Math.abs(t)>0?.001*Math.abs(t):.001;return{density:[[t-e,0],[t,1],[t+e,0]],bandwidth:e}}const i=Math.max(8,Math.floor(e.resolution||64)),o=s[0]-2*r,n=(s[a-1]+2*r-o)/(i-1),l=1/(a*r*Math.sqrt(2*Math.PI)),h=[];for(let t=0;t<i;t++){const e=o+t*n;let i=0;for(let t=0;t<a;t++){const a=(e-s[t])/r;i+=Math.exp(-.5*a*a)}h.push([e,i*l])}return{density:h,bandwidth:r}}function A(t,e){var s;if(!t||"object"!=typeof t||Array.isArray(t))return null;let a=null;if(Array.isArray(t.points)?a=t.points:Array.isArray(null==(s=t.y)?void 0:s.points)?a=t.y.points:e&&Array.isArray(t.y)&&"number"==typeof t.y[0]&&(a=t.y),!a)return null;const r=[];for(let t=0;t<a.length;t++){const e=c.parseNumber(a[t]);null!==e&&isFinite(e)&&r.push(e)}return r.length?r:null}function I(t,e){var s,a;const r=null!=(s=t.statsDerived)?s:t.statsDerived={};return null!=(a=r[e])?a:r[e]=new Map}function P(t,e,s){const a=t.get(e);if(!a||!Array.isArray(s)||a.length!==s.length)return!1;for(let t=0;t<s.length;t++){const e=a[t],r=s[t];if(e!==r&&(!Array.isArray(e)||!Array.isArray(r)||e[0]!==r[0]||e[1]!==r[1]))return!1}return!0}function S(t){const e=[];if(!Array.isArray(t))return e;for(let s=0;s<t.length;s++){const a=t[s];let r=a;Array.isArray(a)?r=1===a.length?a[0]:a[1]:a&&"object"==typeof a&&(r=void 0!==a.y?a.y:a.x);const i=c.parseNumber(r);null!==i&&isFinite(i)&&e.push(i)}return e}function k(t,e,s){if(!e.length)return;const a=[];for(let t=0;t<s;t++){const s=e[t];if(!s){a.push(null);continue}const r=[];for(const t of s)if(t)for(let e=0;e<t.length;e++)r.push(t[e]);a.push({values:r,byPoint:s})}t.seriesObservations=a}function H(t,e,s){const a=s&&null!=s.maxRows?s.maxRows:3e3,r=function(t,e){let s=0,a=0;for(const e of t)s+=e.length,e.length>a&&(a=e.length);if(s<=e)return{clusters:t,stride:1,total:s,kept:s};const r=e=>{let s=0;for(const a of t)s+=Math.ceil(a.length/e);return s};let i=Math.max(2,Math.ceil(s/e));for(;i<a&&r(i)>e;)i++;let o=0;return{clusters:t.map(t=>{const e=[];for(let s=0;s<t.length;s+=i)e.push(t[s]);return o+=e.length,e}),stride:i,total:s,kept:o}}(e.map(t=>t.rows),a);r.stride>1&&console.warn(`ApexCharts: rowSeries() thinned ${r.total} rows to ${r.kept} (every ${r.stride}${2===r.stride?"nd":3===r.stride?"rd":"th"} row) to stay under maxRows=${a}. Raise maxRows to draw more.`);const i=t.globals&&t.globals.colors||[];return e.map((t,e)=>{const s=i[t.realIndex]||i[0];return{name:t.name,data:r.clusters[e].map((a,r)=>n({id:`${t.realIndex}:${e}:${r}`,x:t.name,y:a},s?{fillColor:s}:{}))}})}function L(t){if(!isFinite(t))return String(t);const e=Math.round(t);return Math.abs(t-e)<1e-6?String(e):String(Number(t.toFixed(2)))}function W(t){return(e,s)=>{var a;const r=t(e);if(!Array.isArray(r)||!r.length)return null;const i=e.globals?x(e.globals):[],o=e.globals&&((null==(a=e.globals.categoryLabels)?void 0:a.length)?e.globals.categoryLabels:e.globals.labels)||[],n=[];return r.forEach((t,s)=>{var a;if(-1!==i.indexOf(s))return;if(!Array.isArray(t))return;const l=e.seriesData&&(null==(a=e.seriesData.seriesNames)?void 0:a[s]);t.forEach((t,e)=>{const a=null!=o[e]?String(o[e]):`#${e+1}`;n.push({name:r.length>1&&l?`${l} ${a}`:a,realIndex:s,rows:Array.isArray(t)?t.slice():[]})})}),n.length?H(e,n,s):null}}const D=W(t=>{var e;return null==(e=t.candleData)?void 0:e.seriesBoxPoints}),R=W(t=>{var e;return null==(e=t.violinData)?void 0:e.seriesViolinPoints});b("histogram",function(t,e){var s;const a=e.config,r=e.globals;if(!Array.isArray(t))return t;r.histogramRawSeries||(r.histogramRawSeries=f(t,r));const i=r.histogramRawSeries,o=(null==(s=a.plotOptions)?void 0:s.histogram)||{},h=i.map(t=>S(null==t?void 0:t.data));let d=[];if(1===h.length)d=h[0];else for(const t of h)d=d.concat(t);const c=m(d,{bins:o.bins,binWidth:o.binWidth,range:o.range});if(!c)return e.histogramData={edges:[],binWidth:0,counts:[],rule:"",capped:!1},i;const{edges:u,binWidth:b}=c,g=h.map(t=>function(t,e){const s=new Array(Math.max(0,e.length-1)).fill(0);for(let a=0;a<t.length;a++){const r=v(t[a],e);r>=0&&s[r]++}return s}(t,u));e.histogramData={edges:u,binWidth:b,counts:g,rule:c.rule,capped:c.capped};const p=x(r);return e.seriesObservations=h.map((t,e)=>({values:t,byPoint:-1!==p.indexOf(e)?[]:w(t,u)})),i.map((t,e)=>{if(-1!==p.indexOf(e))return l(n({},t),{data:[]});const s=function(t,e={}){let s=t.slice();if(e.cumulative){let t=0;s=s.map(e=>t+=e)}const a=t.reduce((t,e)=>t+e,0);if(a<=0)return s;if("relative"===e.normalize)return s.map(t=>t/a*100);if("density"===e.normalize){const t=e.binWidth;if("number"==typeof t&&t>0)return s.map(e=>e/(a*t))}return s}(g[e],{normalize:o.normalize,cumulative:o.cumulative,binWidth:b}),a=[];for(let t=0;t<s.length;t++)a.push({x:(u[t]+u[t+1])/2,y:s[t]});return l(n({},t),{data:a})})}),b("boxPlot",function(t,e){var s,a;if(!Array.isArray(t))return t;const r=(null==(a=null==(s=e.config.plotOptions)?void 0:s.boxPlot)?void 0:a.whiskers)||"minmax",i=I(e,"boxPlot"),o=[],h=t.map((t,e)=>{if(!Array.isArray(null==t?void 0:t.data)||t.type&&"boxPlot"!==t.type)return t;let s=!1;const a=new Array(t.data.length).fill(null),h=t.data.map((t,o)=>{const h=e+":"+o;if(Array.isArray(null==t?void 0:t.y)&&5===t.y.length&&!P(i,h,t.y))return t;const d=A(t,!1);if(!d)return t;const c=function(t,e={}){if(!Array.isArray(t)||0===t.length)return null;const s=t.slice().sort((t,e)=>t-e),a=y(s,.25),r=y(s,.5),i=y(s,.75),o=i-a;let n=s[0],l=s[s.length-1],h=[];if("tukey"===e.whiskers&&o>0){const t=a-1.5*o,e=i+1.5*o;let r=0;for(;r<s.length&&s[r]<t;)r++;let d=s.length-1;for(;d>=0&&s[d]>e;)d--;r<=d&&(n=s[r],l=s[d],h=s.slice(0,r).concat(s.slice(d+1)))}return{summary:[n,a,r,i,l],outliers:h,iqr:o}}(d,{whiskers:r});return c?(s=!0,a[o]=d,i.set(h,c.summary),l(n({},t),{y:c.summary,points:d})):t});return s&&(o[e]=a),s?l(n({},t),{data:h}):t});return k(e,o,t.length),h}),b("violin",function(t,e){var s,a;if(!Array.isArray(t))return t;const r=(null==(a=null==(s=e.config.plotOptions)?void 0:s.violin)?void 0:a.kde)||{},i=I(e,"violin"),o=[],h=t.map((t,e)=>{if(!Array.isArray(null==t?void 0:t.data)||t.type&&"violin"!==t.type)return t;let s=!1;const a=new Array(t.data.length).fill(null),h=t.data.map((t,o)=>{var h;const d=e+":"+o;if(Array.isArray(null==(h=null==t?void 0:t.y)?void 0:h.density)&&t.y.density.length&&!P(i,d,t.y.density))return t;const c=A(t,!0);if(!c)return t;const u=C(c,{bandwidth:r.bandwidth,resolution:r.resolution});if(!u)return t;s=!0,a[o]=c;const b=t.y&&"object"==typeof t.y&&!Array.isArray(t.y)?t.y:{};return i.set(d,u.density),l(n({},t),{y:l(n({},b),{density:u.density,points:c})})});return s&&(o[e]=a),s?l(n({},t),{data:h}):t});return k(e,o,t.length),h}),p("histogram",function(t,e){const s=t.globals,a=t.histogramData,r=s&&s.histogramRawSeries;if(!a||!Array.isArray(a.edges)||a.edges.length<2)return null;if(!Array.isArray(r)||!r.length)return null;const i=x(s),o=a.edges,n=[];return r.forEach((e,s)=>{var a;if(-1!==i.indexOf(s))return;const l=w(S(e&&e.data),o),h=t.seriesData&&(null==(a=t.seriesData.seriesNames)?void 0:a[s])||(null==e?void 0:e.name);l.forEach((t,e)=>{const a=`${L(o[e])}-${L(o[e+1])}`;n.push({name:r.length>1&&h?`${h} ${a}`:a,realIndex:s,rows:t})})}),n.length?H(t,n,e):null}),p("boxPlot",D),p("violin",R);const X=d.__apex_Graphics,F=d.__apex_DataLabels,O=(t,e,s,a)=>{if("function"!=typeof t)return t;const r=t({series:e.seriesData.series,seriesIndex:s,dataPointIndex:a,w:e});return Number.isFinite(r)?r:0};class M{constructor(t){this.w=t.w,this.barCtx=t,this.totalFormatter=this.w.config.plotOptions.bar.dataLabels.total.formatter,this.totalFormatter||(this.totalFormatter=this.w.config.dataLabels.formatter)}handleBarDataLabels(t){var e,s,a,r,i,o;const{x:h,y:d,y1:c,y2:u,i:b,j:g,realIndex:p,columnGroupIndex:x,barHeight:f,barWidth:y,barXPosition:m,barYPosition:v,visibleSeries:w,hl:C,noLabel:A}=t,I=this.w,P=new X(this.barCtx.w);this.hlt=null==C?void 0:C.total;const S=I.waterfallData&&I.waterfallData.values,k=C&&null!=C.val?C.val:S&&S[p]&&null!=S[p][g]?S[p][g]:null,H=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[p]:this.barCtx.strokeWidth;let L,W;I.axisFlags.isXNumeric&&!I.globals.isBarHorizontal?(L=h+y*(w+1),W=d+f*(w+1)-H):(L=h+y*w,W=d+f*w);let D=null,R=null,F=h,M=d,T={};const _=I.config.dataLabels,j=this.barCtx.barOptions.dataLabels,Y=this.barCtx.barOptions.dataLabels.total;void 0!==v&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(W=v,M=v),void 0!==m&&this.barCtx.isVerticalGroupedRangeBar&&(L=m,F=m);const B=O(_.offsetX,I,p,g),z=O(_.offsetY,I,p,g),G=(null==C?void 0:C.hide)?void 0:null!==k?k:void 0!==u?[c,u]:"100%"===I.config.chart.stackType?I.globals.seriesPercent[p][g]:I.seriesData.series[p][g];let N,V={width:0,height:0};_.enabled&&(N=void 0===G?"":_.formatter(G,l(n({},I),{seriesIndex:p,dataPointIndex:g,w:I})),V=P.getTextRects(N,parseFloat(_.style.fontSize).toString(),_.style.fontFamily,void 0,!0,_.style.fontWeight));const E={x:null!=(e=null==C?void 0:C.x)?e:h,y:null!=(s=null==C?void 0:C.y)?s:d,neg:C&&null!=C.val?C.val<0:void 0,i:b,j:g,realIndex:p,columnGroupIndex:x,bcx:L,bcy:W,barHeight:null!=(a=null==C?void 0:C.barHeight)?a:f,barWidth:null!=(r=null==C?void 0:C.barWidth)?r:y,textRects:V,strokeWidth:H,dataLabelsX:F,dataLabelsY:M,dataLabelsConfig:_,barDataLabelsConfig:j,barTotalDataLabelsConfig:Y,offX:B,offY:z};if(T=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(E):this.calculateColumnsDataLabelsPosition(E),null!==k&&this.barCtx.isHorizontal&&"center"===j.position){const t=null==(o=null==(i=I.waterfallData.geometry)?void 0:i[p])?void 0:o[g];t&&t.horizontal&&(T.dataLabelsX=(t.levelStart+t.levelEnd)/2+B)}return D=A?null:this.drawCalculatedDataLabels({x:T.dataLabelsX,y:T.dataLabelsY,neg:E.neg,val:G,text:N,i:p,j:g,barWidth:E.barWidth,barHeight:E.barHeight,textRects:V,dataLabelsConfig:_}),I.config.chart.stacked&&Y.enabled&&!1!==this.hlt&&(R=this.drawTotalDataLabels({x:T.totalDataLabelsX,y:T.totalDataLabelsY,barWidth:y,barHeight:f,realIndex:p,j:g,textAnchor:T.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:p,j:g}),rawVal:this.getStackedTotalValue({realIndex:p,j:g}),dataLabelsConfig:_,barTotalDataLabelsConfig:Y})),{dataLabelsPos:T,dataLabels:D,totalDataLabels:R}}hasMultipleSeriesGroups(){return this.w.labelData.seriesGroups.length>1}getTotalGroupContext(t){if(!this.hasMultipleSeriesGroups())return null;const e=this.barCtx.barHelpers.getSeriesGroupIndex(t);return e<0?null:{groupIndex:e}}drawsStackedTotal(t){const e=this.barCtx.lastActiveBarSerieIndexByGroup,s=this.getTotalGroupContext(t);return s&&e&&e.length>s.groupIndex?e[s.groupIndex]===t:this.barCtx.lastActiveBarSerieIndex===t}getStackedTotalValue({realIndex:t,j:e}){if(this.hlt)return this.hlt.val;const s=this.w,a=this.xStackTop(t,e);if(a)return a[3];const r=this.getTotalGroupContext(t),i=s.seriesData.stackedSeriesTotalsByGroups;return r&&i&&i[r.groupIndex]?i[r.groupIndex][e]:this.barCtx.stackedSeriesTotals[e]}xStackTop(t,e){var s,a;const r=this.w;return r.axisFlags.isXNumeric&&(null==(a=null==(s=this.barCtx.stacks)?void 0:s[r.labelData.seriesGroupIndex[t]])?void 0:a.tops.get(r.seriesData.seriesX[t][e]))}totalRects(t,e){const s=this.barCtx.barOptions.dataLabels.total.style;return new X(this.w).getTextRects(this.getStackedTotalDataLabel({realIndex:t,j:e}),s.fontSize,s.fontFamily,void 0,!0,s.fontWeight)}getStackedTotalDataLabel({realIndex:t,j:e}){const s=this.w;let a=this.getStackedTotalValue({realIndex:t,j:e});return this.totalFormatter&&(a=this.totalFormatter(a,l(n({},s),{seriesIndex:t,dataPointIndex:e,w:s}))),a}calculateColumnsDataLabelsPosition(t){var e;const s=this.w;let a,r,{j:i,realIndex:o,y:n,bcx:l,barWidth:h,barHeight:d,textRects:c,dataLabelsX:u,dataLabelsY:b,barDataLabelsConfig:g,barTotalDataLabelsConfig:p,strokeWidth:x,offX:f,offY:y}=t;const m=l;d=Math.abs(d);const v="vertical"===s.config.plotOptions.bar.dataLabels.orientation,{zeroEncounters:w}=this.barCtx.barHelpers.getZeroValueEncounters({i:o,j:i});l-=x/2;const C=s.layout.gridWidth/s.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?u+=h/2:(u=s.axisFlags.isXNumeric?l-h/2+f:l-C+h/2+f,!s.config.chart.stacked&&w>0&&s.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(u-=h*w)),v){const t=2;u=u+c.height/2-x/2-t}const A=null!=(e=t.neg)?e:s.seriesData.series[o][i]<0;let I=n;switch(this.barCtx.isReversed&&(I=n+(A?d:-d)),g.position){case"center":b=v?A?I-d/2+y:I+d/2-y:A?I-d/2+c.height/2+y:I+d/2+c.height/2-y;break;case"bottom":b=v?A?I-d+y:I+d-y:A?I-d+c.height+x+y:I+d-c.height/2+x-y;break;case"top":b=v?A?I+y:I-y:A?I-c.height/2-y:I+c.height+y}let P=I;const S=this.getTotalGroupContext(o),k=this.xStackTop(o,i),H=k?[]:this.barCtx.stacks||[];if(k&&(P=A?Math.max(I,k[5]):Math.min(I,k[4])),H.forEach((t,e)=>{S&&e!==S.groupIndex||t.prevY.forEach(t=>{P=A?Math.max(t[i],P):Math.min(t[i],P)})}),this.hlt&&(P=this.hlt.edge),this.drawsStackedTotal(o)&&p.enabled){const t=this.totalRects(o,i).height;a=A?P+.77*t-y-p.offsetY:P-.3*t+y+p.offsetY;const e=C;r=m+(s.axisFlags.isXNumeric?-h/2:h/2-e)+p.offsetX}return s.config.chart.stacked||(b<0?b=0+x:b+c.height/3>s.layout.gridHeight&&(b=s.layout.gridHeight-x)),{bcx:l,bcy:n,dataLabelsX:u,dataLabelsY:b,totalDataLabelsX:r,totalDataLabelsY:a,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){var e,s;const a=this.w;let{x:r,j:i,realIndex:o,bcy:n,barHeight:l,barWidth:h,textRects:d,dataLabelsX:c,strokeWidth:u,dataLabelsConfig:b,barDataLabelsConfig:g,barTotalDataLabelsConfig:p,offX:x,offY:f}=t;const y=a.layout.gridHeight/a.globals.dataPoints,{zeroEncounters:m}=this.barCtx.barHelpers.getZeroValueEncounters({i:o,j:i});let v,w,C;if(h=Math.abs(h),this.barCtx.isPyramid){v=n+l/2+f-(null!=(e=d.centerOffset)?e:0)}else v=n-(this.barCtx.isRangeBar?0:y)+l/2+d.height/2+f-3;!a.config.chart.stacked&&m>0&&a.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(v-=l*m);let A="start";const I=null!=(s=t.neg)?s:a.seriesData.series[o][i]<0;let P=r;if(this.barCtx.isReversed&&(P=r+(I?-h:h),A=I?"start":"end"),this.barCtx.isPyramid)c=a.layout.gridWidth/2+x;else switch(g.position){case"center":c=I?P+h/2-x:Math.max(d.width/2,P-h/2)+x;break;case"bottom":c=I?P+h-u-x:P-h+u+x;break;case"top":c=I?P-u-x:P-u+x}let S=P;const k=this.getTotalGroupContext(o),H=this.xStackTop(o,i),L=H?[]:this.barCtx.stacks||[];if(H&&(S=I?Math.min(P,H[4]):Math.max(P,H[5])),L.forEach((t,e)=>{k&&e!==k.groupIndex||t.prevX.forEach(t=>{S=I?Math.min(t[i],S):Math.max(t[i],S)})}),this.hlt&&(S=this.hlt.edge),this.drawsStackedTotal(o)&&p.enabled){const t=this.totalRects(o,i);I?(w=S-u-x-p.offsetX,A="end"):w=S+x+p.offsetX+(this.barCtx.isReversed?-(h+u):u),C=v-d.height/2+t.height/2+p.offsetY+u,a.globals.barGroups.length>1&&!k&&(C-=a.globals.barGroups.length/2*(l/2))}if(!a.config.chart.stacked){const t=I&&"middle"!==b.textAnchor?"start"===b.textAnchor?"end":"start":b.textAnchor;let e;e="vertical"===g.orientation?d.height/2:"end"===t?d.width:"middle"===t?d.width/2:0;const s=("vertical"===g.orientation?d.height:d.width)-e;c+s>a.layout.gridWidth-u&&(c=a.layout.gridWidth-s-u),c-e<u&&(c=e+u)}return{bcx:r,bcy:n,dataLabelsX:c,dataLabelsY:v,totalDataLabelsX:w,totalDataLabelsY:C,totalDataLabelsAnchor:A}}drawCalculatedDataLabels({x:t,y:e,val:s,text:a,neg:r,i:i,j:o,textRects:h,barHeight:d,barWidth:c,dataLabelsConfig:u}){var b,g,p;const x=this.w;let f="rotate(0)";"vertical"===x.config.plotOptions.bar.dataLabels.orientation&&(f=`rotate(-90, ${t}, ${e})`);const y=new F(this.barCtx.w,this.barCtx.ctx),m=new X(this.barCtx.w),v=u.formatter;let w=null;const C=x.globals.collapsedSeriesIndices.indexOf(i)>-1,A=(x.globals.collapsingSeriesIndices||[]).indexOf(i)>-1,I=`${i}::${this.barCtx._keys(i)[o]}`;if(A){const t=null==(b=x.globals.prevDataLabels)?void 0:b.get(I);t&&isFinite(t.val)&&(s=t.val,a=void 0)}if(u.enabled&&(!C||A)){w=m.group({class:"apexcharts-data-labels",transform:f});const b=x.config.dataLabels;((null==(g=b.animate)?void 0:g.enabled)||(null==(p=b.countUp)?void 0:p.enabled))&&(w.node.setAttribute("data:dlKey",I),w.node.setAttribute("data:dlJ",String(o)),"number"==typeof s&&isFinite(s)&&w.node.setAttribute("data:dlVal",String(s))),void 0===s?a="":void 0===a&&(a=v(s,l(n({},x),{seriesIndex:i,dataPointIndex:o,w:x}))),!s&&x.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(a="");let C=u.textAnchor;"vertical"===x.config.plotOptions.bar.dataLabels.orientation&&(C="center"===x.config.plotOptions.bar.dataLabels.position?"middle":(null!=r?r:x.seriesData.series[i][o]<0)?"end":"start"),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&c<h.width&&(a=""),x.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&!A&&(this.barCtx.isHorizontal?h.width/1.6>Math.abs(c)&&(a=""):h.height/1.6>Math.abs(d)&&(a=""));const P=l(n({},u),{textAnchor:C});this.barCtx.isHorizontal&&s<0&&("start"===C?P.textAnchor="end":"end"===C&&(P.textAnchor="start")),y.plotDataLabelsText({x:t,y:e,text:a,i:i,j:o,parent:w,dataLabelsConfig:P,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return w}drawTotalDataLabels({x:t,y:e,val:s,rawVal:a,realIndex:r,j:i,textAnchor:o,barTotalDataLabelsConfig:n}){var l,h;const d=new X(this.barCtx.w);let c;if(n.enabled&&void 0!==t&&void 0!==e&&this.drawsStackedTotal(r)){c=d.drawText({x:t,y:e,foreColor:n.style.color,text:s,textAnchor:o,fontFamily:n.style.fontFamily,fontSize:n.style.fontSize,fontWeight:n.style.fontWeight}),c.attr({class:"apexcharts-datalabel-total",cx:t,cy:e});const u=this.w.config.dataLabels;if((null==(l=u.animate)?void 0:l.enabled)||(null==(h=u.countUp)?void 0:h.enabled)){const{groupIndex:t}=this.barCtx.barHelpers.getGroupIndex(r);c.node.setAttribute("data:dlTotalKey",`${t}::${this.barCtx._keys(r)[i]}`),c.node.setAttribute("data:dlTotalSeries",String(r)),"number"==typeof a&&isFinite(a)&&c.node.setAttribute("data:dlTotalVal",String(a))}}return c}}const T=d.__apex_Series,_=d.__apex_Fill,j=d.__apex_CoreUtils;function Y(t){var e,s,a,r,i,o,n;return"histogram"===(null==(s=null==(e=null==t?void 0:t.config)?void 0:e.chart)?void 0:s.requestedType)&&(!1!==(null==(r=null==(a=t.config.plotOptions)?void 0:a.histogram)?void 0:r.overlap)&&(null!=(n=null==(o=null==(i=t.seriesData)?void 0:i.series)?void 0:o.length)?n:0)>1)}class B{constructor(t){this.w=t.w,this.barCtx=t}initVariables(t,e){const s=this.w;this.seriesIndex=e,this.barCtx.series=t,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(let e=0;e<t.length;e++)if(t[e].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[e].length),s.axisFlags.isXNumeric)for(let a=0;a<t[e].length;a++)s.seriesData.seriesX[e][a]>s.globals.minX&&s.seriesData.seriesX[e][a]<s.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=s.globals.dataPoints;const a=s.labelData.labels;this.rows=s.globals.isBarHorizontal&&s.axisFlags.isXNumeric&&!this.barCtx.isRangeBar&&s.seriesData.seriesX.some(t=>null==t?void 0:t.some((t,e)=>t!==a[e]))?new Map(a.map((t,e)=>[t,e])):null,this.arrBorderRadius=this.createBorderRadiusArr(s.seriesData.series),c.isSafari()&&(this.arrBorderRadius=this.arrBorderRadius.map(t=>t.map(t=>"none"))),0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1)}barSlotXSpan(){const t=this.w;if(void 0!==this._slotXSpan)return this._slotXSpan;let e=0;if(t.globals.dataPoints<=1){const s=t.globals.maxX-t.globals.minX;e=s>0?s/4:0}else if(e=this._unionMinXGap(),!(e>0&&isFinite(e))){const s=t.globals.minXDiff;e=s>0&&isFinite(s)&&.5!==s?s:0}return this._slotXSpan=e,e}_unionMinXGap(){const t=this.w.seriesData.seriesX||[],e=this.seriesIndex,s=[];for(let a=0;a<t.length;a++){const r=t[a];e&&e.indexOf(a)<0||Array.isArray(r)&&r.length>0&&s.push(r.some((t,e)=>t<r[e-1])?r.filter(t=>t===+t).sort((t,e)=>t-e):r)}if(!s.length)return 0;const a=new Array(s.length).fill(0);let r=NaN,i=1/0;for(;;){let t=1/0,e=-1;for(let r=0;r<s.length;r++){const i=s[r];for(;a[r]<i.length&&"number"!=typeof i[a[r]];)a[r]++;if(a[r]>=i.length)continue;const o=i[a[r]];o==o?o<t&&(t=o,e=r):(a[r]++,r--)}if(-1===e)break;if(a[e]++,r==r){const e=t-r;e>0&&e<i&&(i=e)}r=t}return isFinite(i)?i:0}barRow(t,e){var s,a,r;return null!=(r=null==(a=this.rows)?void 0:a.get(null==(s=this.w.seriesData.seriesX[t])?void 0:s[e]))?r:e}initialPositions(t){const e=this.w;let s,a,r,i,o,n,l,h,d=e.globals.dataPoints;this.barCtx.isRangeBar&&(d=e.labelData.labels.length);let u=this.barCtx.seriesLen;if((e.config.plotOptions.bar.rangeBarGroupRows||Y(e))&&(u=1),this.barCtx.isHorizontal)r=e.layout.gridHeight/d,o=r/u,o=o*parseInt(this.barCtx.barOptions.barHeight,10)/100,-1===String(this.barCtx.barOptions.barHeight).indexOf("%")&&(o=parseInt(this.barCtx.barOptions.barHeight,10)),h=this.barCtx.baseLineInvertedY+e.globals.padHorizontal+(this.barCtx.isReversed?e.layout.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),this.barCtx.isFunnel&&(h=e.layout.gridWidth/2),a=(r-o*this.barCtx.seriesLen)/2;else{if(i=e.layout.gridWidth/this.barCtx.visibleItems,e.config.xaxis.convertedCatToNumeric&&(i=e.layout.gridWidth/e.globals.dataPoints),n=i/u*parseInt(this.barCtx.barOptions.columnWidth,10)/100,e.axisFlags.isXNumeric){const t=this.barCtx.xRatio,e=this.barSlotXSpan();e>0&&e/t>0&&(i=e/t),n=i/u*parseInt(this.barCtx.barOptions.columnWidth,10)/100,n<1&&(n=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(n=parseInt(this.barCtx.barOptions.columnWidth,10)),l=e.layout.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?e.layout.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),e.axisFlags.isXNumeric){s=this.barCtx.getBarXForNumericXAxis({x:s,j:0,realIndex:t,barWidth:n}).x}else s=e.globals.padHorizontal+c.noExponents(i-n*this.barCtx.seriesLen)/2}return e.globals.barHeight=o,e.globals.barWidth=n,{x:s,y:a,yDivision:r,xDivision:i,barHeight:o,barWidth:n,zeroH:l,zeroW:h}}initializeStackedPrevVars(t){t.stacks=t.w.labelData.seriesGroups.map(()=>({prevY:[],prevX:[],prevYF:[],prevXF:[],prevYVal:[],prevXVal:[],tops:new Map}))}initializeStackedXYVars(t){t.stacks.forEach(t=>{t.xArrj=[],t.xArrjF=[],t.xArrjVal=[],t.yArrj=[],t.yArrjF=[],t.yArrjVal=[]})}getPathFillColor(t,e,s,a){var r;const i=this.w,o=new _(this.barCtx.w);let n=null;const l=this.barCtx.barOptions.distributed?s:e;let h=!1;if(this.barCtx.barOptions.colors.ranges.length>0){this.barCtx.barOptions.colors.ranges.map(a=>{t[e][s]>=a.from&&t[e][s]<=a.to&&(n=a.color,h=!0)})}const d=this.getDumbbellConnectorFill(e,s)||(null==(r=i.config.series[a].data[s])?void 0:r.fill),c=this.barCtx.barOptions.isDumbbell?i.config.plotOptions.bar.dumbbell.connector:null;let u;c&&c.color&&(n=c.color,u=c.opacity);return{color:o.fillPath({seriesNumber:this.barCtx.barOptions.distributed?l:a,dataPointIndex:s,color:n,opacity:u,value:t[e][s],fillConfig:d,fillType:(null==d?void 0:d.type)?d.type:Array.isArray(i.config.fill.type)?i.config.fill.type[a]:i.config.fill.type}),useRangeColor:h}}getDumbbellConnectorFill(t,e){const s=this.w;if(!this.barCtx.barOptions.isDumbbell)return null;const a=s.dumbbellData;if(!a||"series"!==a.form)return null;const r=s.config.plotOptions.bar.dumbbell.connector;if(r.color)return null;const i=a.order[e];if(!i)return null;const o=s.globals.colors[i[0]],n=s.globals.colors[i[1]];return o&&n?{type:"gradient",gradient:{type:this.barCtx.isHorizontal?"horizontal":"vertical",gradientFrom:o,gradientTo:n,opacityFrom:r.opacity,opacityTo:r.opacity,stops:[0,100],inverseColors:!this.barCtx.isHorizontal}}:null}getStrokeWidth(t,e,s){let a=0;const r=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]||"bar"===r.config.chart.type&&!this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,r.config.stroke.show&&(this.barCtx.isNullValue||(a=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[s]:this.barCtx.strokeWidth)),a}getStackedSeriesIndices(t){const e=this.w,s=e.labelData.seriesGroups,a=e.globals.columnSeries?new Set(e.globals.columnSeries.i):null,r=t=>!a||a.has(t);if(!s||s.length<2){const e=Array.from({length:t},(t,e)=>e).filter(r);return e.length?[e]:[]}const i=Array.from({length:s.length},()=>[]),o=[];for(let e=0;e<t;e++){if(!r(e))continue;const t=this.getSeriesGroupIndex(e);t>-1?i[t].push(e):o.push(e)}return o.length&&i.push(o),i.filter(t=>t.length>0)}createBorderRadiusArr(t){const e=this.w,s=!this.w.config.chart.stacked||e.config.plotOptions.bar.borderRadius<=0,a=t.length,r=Math.max(0,...t.map(t=>0|(null==t?void 0:t.length))),i=Array.from({length:a},()=>Array(r).fill(s?"top":"none"));if(s)return i;const o="last"===e.config.plotOptions.bar.borderRadiusWhenStacked,n=o?"top":"both",l=o?"bottom":"both",h=o?"none":"bottom",d=o?"none":"top";for(const e of this.getStackedSeriesIndices(a))for(let s=0;s<r;s++){const a=[],r=[];for(const i of e){const e=t[i][s];e>0?a.push(i):e<0&&r.push(i)}if(a.length>0&&0===r.length)if(1===a.length)i[a[0]][s]=n;else{const t=a[0],e=a[a.length-1];for(const r of a)i[r][s]=r===t?h:r===e?"top":"none"}else if(r.length>0&&0===a.length)if(1===r.length)i[r[0]][s]=l;else{const t=Math.min(...r),e=Math.max(...r);for(const a of r)i[a][s]=a===t?d:a===e?"bottom":"none"}else if(a.length>0&&r.length>0){const t=a[a.length-1];for(const e of a)i[e][s]=e===t?"top":"none";const e=Math.max(...r);for(const t of r)i[t][s]=t===e?"bottom":"none"}}return i}barBackground({j:t,i:e,x1:s,x2:a,y1:r,y2:i,elSeries:o}){const n=this.w,l=new X(this.barCtx.w),h=new T(this.barCtx.w).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&h===e){t>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(t%=this.barCtx.barOptions.colors.backgroundBarColors.length);const e=this.barCtx.barOptions.colors.backgroundBarColors[t],h=l.drawRect(void 0!==s?s:0,void 0!==r?r:0,void 0!==a?a:n.layout.gridWidth,void 0!==i?i:n.layout.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,e,this.barCtx.barOptions.colors.backgroundBarOpacity);o.add(h),h.node.classList.add("apexcharts-backgroundBar")}}barRect({a:t,len:e,v1:s,v2:a,strokeWidth:r,realIndex:i,j:o,dir:n,horizontal:l}){const h=this.w,d=new X(h);(r=Array.isArray(r)?r[i]:r)||(r=0);const c=h.config.series[i].data[o],u=l?null==c?void 0:c.barHeightOffset:null==c?void 0:c.columnWidthOffset;u&&(t-=u/2,e+=u);const b=r/2,g=n*(this.barCtx.isReversed?-1:1),p="around"===h.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[i][o]?" Z":" z";let x,f,y,m,v,w;l?(y=t+b,m=t+e-b,x=s+.001+b*g,f=a+.001-b*g,v=d.line(x,m),w=d.move(x,y)+d.line(f,y)+d.line(f,m)+v+p):(x=t+b,f=t+e-b,y=s+.001-b*g,m=a+.001+b*g,v=d.line(f,y),w=d.move(x,y)+d.line(x,m)+d.line(f,m)+v+p);return{x1:x,x2:f,y1:y,y2:m,sl:v,closing:p,squarePathTo:w,pathTo:"none"!==this.arrBorderRadius[i][o]?d.roundPathCorners(w,h.config.plotOptions.bar.borderRadius):w,base:d.move(x,y)+d.line(x,y)+v+v+v+v+v+d.line(x,y)+p,strokeWidth:r,strokeCenter:b,direction:g}}getColumnPaths({barWidth:t,barXPosition:e,y1:s,y2:a,strokeWidth:r,series:i,realIndex:o,i:n,j:l,w:h}){var d,c,u;const b=this.barRect({a:e,len:t,v1:s,v2:a,strokeWidth:r,realIndex:o,j:l,dir:i[n][l]>=0?1:-1}),{pathTo:g,squarePathTo:p,strokeCenter:x,direction:f}=b;s=b.y1,a=b.y2;let y=null;const m=null==(c=null==(d=this.barCtx.ctx)?void 0:d.morphTypeChange)?void 0:c.getInitialPathFor(o,l);if(m?y=m:h.globals.previousPaths.length>0&&(y=this.barCtx.getPreviousPath(o,l,g,p)),null==y&&(y=b.base),h.config.chart.stacked){const t=this.barCtx.groupCtx;t.yArrj.push(a-x*f),t.yArrjF.push(Math.abs(s-a+b.strokeWidth*f)),t.yArrjVal.push(null!=(u=this.barCtx.series[n][l])?u:null)}return{pathTo:g,pathFrom:y,drawnBox:{x1:b.x1,x2:b.x2,y1:s,y2:a}}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:s,i:a,j:r,realIndex:i,strokeWidth:o,w:n}){var l,h;const d=new X(this.barCtx.w),c=n.layout.gridWidth/2,u=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,b=u(s[a][r]),g=r===s[a].length-1,p="taper"===n.config.plotOptions.funnel.lastShape?"taper":"flat";let x;x=g?"taper"===p?0:b:u(s[a][r+1]);const f=o/2,y=t+f,m=t+e-f,v=c-b,w=c+b,C=c-x,A=c+x,I=d.move(v,y)+d.line(w,y)+d.line(A,m)+d.line(C,m)+" Z";let P=null;const S=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(i,r);return S?P=S:n.globals.previousPaths.length>0&&(P=this.barCtx.getPreviousPath(i,r,I)),null==P&&(P=d.move(c,y)+d.line(c,y)+d.line(c,m)+d.line(c,m)+" Z"),{pathTo:I,pathFrom:P,x:w,x1:v,barXPosition:c}}computePyramidLayout(t){const e=this.w,s=e.layout.gridHeight,a=e.layout.gridWidth,r=t.map(t=>Math.abs(Number(t)||0)),i=r.reduce((t,e)=>t+e,0);if(0===i||s<=0)return r.map(()=>({y:0,height:0,topHalf:0,bottomHalf:0}));const o=a/2;let n=0;const l=[];for(let t=0;t<r.length;t++){const e=n/i;n+=r[t];const a=n/i,h=e*s,d=a*s;l.push({y:h,height:d-h,topHalf:e*o,bottomHalf:a*o})}return l}getPyramidPaths({barYPosition:t,barHeight:e,topHalf:s,bottomHalf:a,realIndex:r,j:i,strokeWidth:o,w:n}){var l,h;const d=new X(this.barCtx.w),c=n.layout.gridWidth/2,u=o/2,b=t+u,g=t+e-u,p=c-s,x=c+s,f=c-a,y=c+a,m=d.move(p,b)+d.line(x,b)+d.line(y,g)+d.line(f,g)+" Z";let v=null;const w=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(r,i);return w?v=w:n.globals.previousPaths.length>0&&(v=this.barCtx.getPreviousPath(r,i,m)),null==v&&(v=d.move(c,b)+d.line(c,b)+d.line(c,g)+d.line(c,g)+" Z"),{pathTo:m,pathFrom:v,x:x,x1:p,barXPosition:c}}getBarpaths({barYPosition:t,barHeight:e,x1:s,x2:a,strokeWidth:r,series:i,realIndex:o,i:n,j:l,w:h}){var d,c,u;const b=new X(this.barCtx.w),g=this.barRect({a:t,len:e,v1:s,v2:a,strokeWidth:r,realIndex:o,j:l,dir:i[n][l]>=0?1:-1,horizontal:!0}),{y1:p,y2:x,sl:f,closing:y,squarePathTo:m,pathTo:v,strokeCenter:w,direction:C}=g;s=g.x1,a=g.x2;const A=this.barCtx.isFunnel,I=A?(s+a)/2:s;let P=null;const S=null==(c=null==(d=this.barCtx.ctx)?void 0:d.morphTypeChange)?void 0:c.getInitialPathFor(o,l);if(S?P=S:h.globals.previousPaths.length>0&&(P=this.barCtx.getPreviousPath(o,l,v,m)),null==P){const t=A?b.line(I,x):f;P=b.move(I,p)+b.line(I,p)+t+t+t+t+t+b.line(I,p)+y}if(h.config.chart.stacked){const t=this.barCtx.groupCtx;t.xArrj.push(a+w*C),t.xArrjF.push(Math.abs(s-a-g.strokeWidth*C)),t.xArrjVal.push(null!=(u=this.barCtx.series[n][l])?u:null)}return{pathTo:v,pathFrom:P,drawnBox:{x1:s,x2:a,y1:p,y2:x}}}getXForValue(t,e,s=!0){let a=s?e:null;return null!=t&&(a=e+t/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?t/this.barCtx.invertedYRatio:0)),a}getYForValue(t,e,s,a=!0){let r=a?e:null;return null!=t&&(r=e-t/this.barCtx.yRatio[s]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[s]:0)),r}getGoalValues(t,e,s,a,r,i){const o=this.w,h=[],d=(r,n)=>{o.globals.invalidLogScale||(r=new j(o).getLogValAtSeriesIndex(r,a)),h.push({[t]:"x"===t?this.getXForValue(r,e,!1):this.getYForValue(r,s,i,!1),attrs:n})};if(o.seriesData.seriesGoals[a]&&o.seriesData.seriesGoals[a][r]&&Array.isArray(o.seriesData.seriesGoals[a][r])&&o.seriesData.seriesGoals[a][r].forEach(t=>{d(t.value,t)}),this.barCtx.barOptions.isDumbbell){const e=this.getDumbbellEnds(a,r);if(e.length){const s={strokeHeight:"x"===t?0:o.globals.markers.size[a],strokeWidth:"x"===t?o.globals.markers.size[a]:0,strokeDashArray:0,strokeLineCap:"round"};let i=0,h=0;for(let t=1;t<e.length;t++)e[t].value<e[i].value&&(i=t),e[t].value>e[h].value&&(h=t);const c=o.config.plotOptions.bar.dumbbell.dataLabels;e.forEach((t,e)=>{const o=l(n({},s),{strokeColor:t.color});!c.enabled||e!==i&&e!==h||(o.label={text:this.getDumbbellLabelText(t.value,a,r,t.index),color:c.colorFromMarker?t.color:Array.isArray(c.style.colors)?c.style.colors[t.index]||c.style.colors[0]:c.style.colors,outward:e===i&&i!==h?-1:1}),d(t.value,o)})}}return h}getDumbbellEnds(t,e){const s=this.w,a=[],r=s.dumbbellData;if(r&&"series"===r.form){const t=r.values[e]||[];for(let e=0;e<t.length;e++){const i=t[e];null!==i&&-1===r.hidden.indexOf(e)&&a.push({value:i,color:s.globals.colors[e],index:e})}return a}if(!s.rangeData.seriesRange.length)return a;const i=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:s.globals.colors,o=e=>Array.isArray(i[t])?i[t][e]:i[t];return[{value:s.rangeData.seriesRangeStart[t][e],color:o(0),index:0},{value:s.rangeData.seriesRangeEnd[t][e],color:o(1),index:1}]}getDumbbellLabelText(t,e,s,a){const r=this.w,i=r.config.plotOptions.bar.dumbbell.dataLabels;if("function"==typeof i.formatter)return i.formatter(t,{seriesIndex:e,dataPointIndex:s,endpointIndex:a,w:r});const o=this.barCtx.isHorizontal?r.formatters.xLabelFormatter:r.formatters.yLabelFormatters[0];return"function"==typeof o?o(t,s,r):String(t)}drawGoalLine({barXPosition:t,barYPosition:e,goalX:s,goalY:a,barWidth:r,barHeight:i}){if(!(Array.isArray(s)&&s.length>0||Array.isArray(a)&&a.length>0))return null;const o=new X(this.barCtx.w),n=o.group({class:"apexcharts-bar-goals-groups"});n.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:n.node}),n.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let l=null;return this.barCtx.isHorizontal?Array.isArray(s)&&s.forEach(t=>{if(t.x>=-1&&t.x<=o.w.layout.gridWidth+1){const s=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:i/2,a=e+s+i/2;l=o.drawLine(t.x,a-2*s,t.x,a,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeWidth?t.attrs.strokeWidth:2,t.attrs.strokeLineCap),n.add(l),t.attrs.label&&n.add(this.drawDumbbellLabel(t.attrs,{x:t.x,y:a-s,horizontal:!0,markerSize:t.attrs.strokeWidth||0}))}}):Array.isArray(a)&&a.forEach(e=>{if(e.y>=-1&&e.y<=o.w.layout.gridHeight+1){const s=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:r/2,a=t+s+r/2;l=o.drawLine(a-2*s,e.y,a,e.y,e.attrs.strokeColor?e.attrs.strokeColor:void 0,e.attrs.strokeDashArray,e.attrs.strokeHeight?e.attrs.strokeHeight:2,e.attrs.strokeLineCap),n.add(l),e.attrs.label&&n.add(this.drawDumbbellLabel(e.attrs,{x:a-s,y:e.y,horizontal:!1,markerSize:e.attrs.strokeHeight||0}))}}),n}drawDumbbellLabel(t,e){const s=this.w,a=new X(s),r=s.config.plotOptions.bar.dumbbell.dataLabels,i=e.markerSize/2+r.offset,o=t.label.outward;return a.drawText({x:e.x+(e.horizontal?i*o:0),y:e.y-(e.horizontal?0:i*o),text:t.label.text,textAnchor:e.horizontal?o<0?"end":"start":"middle",dominantBaseline:e.horizontal?"central":o<0?"hanging":"auto",foreColor:t.label.color,fontSize:r.style.fontSize,fontFamily:r.style.fontFamily,fontWeight:r.style.fontWeight,cssClass:"apexcharts-dumbbell-label"})}drawBarShadow({prevPaths:t,currPaths:e,color:s,realIndex:a,j:r}){const i=this.w,{x:o,x1:n,barYPosition:l}=t,{x:h,x1:d,barYPosition:u}=e,b=l+e.barHeight,g=new X(this.barCtx.w),p=new c,x=g.move(n,b)+g.line(o,b)+g.line(h,u)+g.line(d,u)+g.line(n,b)+("around"===i.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[a][r]?" Z":" z");return g.drawPath({d:x,fill:p.shadeColor(.5,c.rgb2hex(s)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}getZeroValueEncounters({i:t,j:e}){var s;const a=this.w;let r=0,i=0;return(a.config.plotOptions.bar.horizontal?a.seriesData.series.map((t,e)=>e):(null==(s=a.globals.columnSeries)?void 0:s.i.map(t=>t))||[]).forEach(s=>{const o=a.seriesData.series[s][e];o&&r++,s<t&&!o&&i++}),{nonZeroColumns:r,zeroEncounters:i}}getSeriesGroupIndex(t){var e;return null!=(e=this.w.labelData.seriesGroupIndex[t])?e:-1}getGroupIndex(t){const e=this.getSeriesGroupIndex(t),s=this.barCtx.columnGroupIndices;let a=s.indexOf(e);return a<0&&(s.push(e),a=s.length-1),{groupIndex:e,columnGroupIndex:a}}}const z=d.__apex_Filters,G=d.__apex_Animations,N=d.__apex_Animations_computeStagger,V=d.__apex_BrowserAPIs_BrowserAPIs,E=d.__apex_Environment_Environment;function $(t){var e;const s=t.config.chart.animations;if(!s||!1===s.enabled)return!1;if(!s.dynamicAnimation||!1===s.dynamicAnimation.enabled)return!1;const a=null!=(e=s.largeDatasetThreshold)?e:0;return!(a>0&&t.globals.dataPoints>a)&&!!(E.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate)}function Z(t){const e=new Map;return t.map(t=>{const s=e.get(t)||0;return e.set(t,s+1),0===s?t:`${t}#${s}`})}function q(t,e,s=0|(s=>null==(s=t.seriesData.series[e])?void 0:s.length)()){return Z(Array.from({length:s},(s,a)=>function(t,e,s){var a,r,i,o;if(null==(a=t.axisFlags)?void 0:a.isXNumeric){const a=null==(i=null==(r=t.seriesData)?void 0:r.seriesX)?void 0:i[e];if(a&&a.length&&null!=a[s])return"x:"+a[s]}const n=null==(o=t.globals.labels)?void 0:o[s];return null!=n&&""!==String(n)?"c:"+(Array.isArray(n)?n.join(" "):String(n)):"j:"+s}(t,e,a)))}function K(t,e,s=!1,a=!1){var r,i;if(!$(t))return null;const o=t.globals.prevStreamFrame;if(!o)return null;const n=null==(r=o.seriesY)?void 0:r[e],l=null==(i=t.seriesData.series)?void 0:i[e];if(!Array.isArray(n)||!Array.isArray(l))return null;if(!n.length||!l.length)return null;const h=Z(n.map((t,s)=>function(t,e,s){var a,r;if(t.isXNumeric){const r=null==(a=t.seriesX)?void 0:a[e];if(r&&r.length&&null!=r[s])return"x:"+r[s]}const i=null==(r=t.labels)?void 0:r[s];return null!=i&&""!==String(i)?"c:"+(Array.isArray(i)?i.join(" "):String(i)):"j:"+s}(o,e,s))),d=q(t,e),c=function(t,e){const s=new Map;t.forEach((t,e)=>{s.has(t)||s.set(t,e)});const a=new Array(e.length),r=new Set;let i=-1,o=!0,n=t.length===e.length;e.forEach((t,e)=>{const l=s.has(t)&&!r.has(s.get(t))?s.get(t):-1;a[e]=l,-1!==l&&(r.add(l),l<i&&(o=!1),i=l),l!==e&&(n=!1)});const l=[];for(let e=0;e<t.length;e++)r.has(e)||l.push(e);return{toOld:a,exits:l,ordered:o,changed:!n}}(h,d);return(c.ordered||a)&&(c.changed||s)?{join:c,oldKeys:h,newKeys:d}:null}function U({w:t,elSeries:e,record:s,newKeys:a,isHorizontal:r,speed:i}){var o;if(!$(t))return;if(!s||!Array.isArray(s.paths)||!(null==e?void 0:e.node))return;const n=new Set(a),l=s.paths.filter(t=>t&&t.d&&null!=t.key&&!n.has(t.key));if(!l.length)return;const h=new X(t),d=null==(o=t.globals.colors)?void 0:o[parseInt(String(s.realIndex),10)];l.forEach(a=>{let o=a.fill||d||"#c8c8c8";0===String(o).indexOf("url(")&&(o=d||"#c8c8c8");const n=h.drawPath({d:a.d,stroke:"none",strokeWidth:0,fill:o,fillOpacity:1,classes:"apexcharts-bar-ghost"}),l=n.node;l.setAttribute("pointer-events","none"),n.attr("clip-path",`url(#gridRectBarMask${t.globals.cuid})`),e.node.insertBefore(l,e.node.firstChild);const c=function(t){const e=/^M\s*([+-]?[\d.eE]+)[\s,]+([+-]?[\d.eE]+)/.exec(t||"");if(!e)return null;const s=parseFloat(e[1]),a=parseFloat(e[2]);return isFinite(s)&&isFinite(a)?{x:s,y:a}:null}(a.d);let u=r?"left center":"center bottom";try{const t=l.getBBox();c&&t&&(u=r?Math.abs(c.x-t.x)<=Math.abs(c.x-(t.x+t.width))?"left center":"right center":Math.abs(c.y-(t.y+t.height))<=Math.abs(c.y-t.y)?"center bottom":"center top")}catch(t){}const b=l.style;b.transformBox="fill-box",b.transformOrigin=u,l.setAttribute("data:ghostKey",`${s.realIndex}::${a.key}`);try{const t=l.getBBox(),e=r?u.startsWith("left")?t.x:t.x+t.width:u.endsWith("bottom")?t.y+t.height:t.y;isFinite(e)&&l.setAttribute("data:ghostEdge",String(e))}catch(t){}const g=Math.max(1,i||1),p=performance.now(),x=e=>{if(t.globals.isDestroyed||!l.parentNode)return;const s=Math.max(0,Math.min(1,(e-p)/g)),a=1-Math.pow(1-s,3),i=1-a;b.transform=r?`scaleX(${i})`:`scaleY(${i})`,b.opacity=String(1-a),s<1?V.requestAnimationFrame(x):l.parentNode.removeChild(l)};V.requestAnimationFrame(x)})}class J{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)/J.xRatio(t)}static pxToDataX(t,e){return t.globals.minX+e*J.xRatio(t)}static screenXToPlotPx(t,e){const s=t.dom.baseEl,a=s&&s.querySelector(".apexcharts-svg");if(!a)return e-t.layout.translateX;const r=a.getBoundingClientRect(),i=t.globals.svgWidth?r.width/t.globals.svgWidth:1;return(e-r.left)/(i||1)-t.layout.translateX}}class Q{constructor(t,e,s){this.ctx=e,this.w=t,this.barOptions=t.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=t.config.stroke.width,this.isNullValue=!1,this.isRangeBar=t.rangeData.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!t.globals.isBarHorizontal&&t.rangeData.seriesRange.length&&t.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.isPyramid=this.barOptions.isPyramid,this.pyramidLayout=null,this.xyRatios=s,this.xRatio=0,this.yRatio=[],this.invertedXRatio=0,this.invertedYRatio=0,this.baseLineY=[],this.baseLineInvertedY=0,null!==this.xyRatios&&(this.xRatio=s.xRatio,this.yRatio=s.yRatio,this.invertedXRatio=s.invertedXRatio,this.invertedYRatio=s.invertedYRatio,this.baseLineY=s.baseLineY,this.baseLineInvertedY=s.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[],this._prevKeyed=null,this._ltCache=null,this._layoutShiftCache=null,this._pathToInterp=null,this.series=[],this.elSeries=null,this.visibleI=0,this.isReversed=!1;const a=new T(this.w);this.lastActiveBarSerieIndex=a.getActiveConfigSeriesIndex("desc",["bar","column"]),this.lastActiveBarSerieIndexByGroup=a.getActiveConfigSeriesIndexByGroup(["bar","column"]),this.columnGroupIndices=[];const r=a.getBarSeriesIndices(),i=new j(this.w);this.stackedSeriesTotals=i.getStackedSeriesTotals(this.w.config.series.map((t,e)=>-1===r.indexOf(e)?e:-1).filter(t=>-1!==t)),this.barHelpers=new B(this)}setSeriesAxis(t){var e;return this.yRatio.length>1&&(this.yaxisIndex=this.w.globals.seriesYAxisReverseMap[t],this.translationsIndex=t),this.isReversed=null==(e=this.w.config.yaxis[this.yaxisIndex])?void 0:e.reversed,this.translationsIndex}draw(t,e){var s,a,r,i,o;const h=this.w,d=new X(this.w),u=new j(this.w);t=u.getLogSeries(t),this.series=t,this.yRatio=u.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t,e);const b=d.group({class:"apexcharts-bar-series apexcharts-plot-series"}),g=this.ctx.highlightFilter;h.config.dataLabels.enabled&&this.totalItems>this.barOptions.dataLabels.maxItems&&console.warn("WARNING: DataLabels are enabled but there are too many to display. This may cause performance issue when rendering - ApexCharts");for(let u=0,p=0;u<t.length;u++,p++){let x,f;const y=[],m=[],v=h.globals.comboCharts?e[u]:u,{columnGroupIndex:w}=this.barHelpers.getGroupIndex(v),C=d.group({class:"apexcharts-series",rel:u+1,seriesName:c.escapeString(h.seriesData.seriesNames[v]),"data:realIndex":v});T.addCollapsedClassToSeries(this.w,C,v),t[u].length>0&&(this.visibleI=this.visibleI+1);const A=this.setSeriesAxis(v);this.isPyramid&&(this.pyramidLayout=this.barHelpers.computePyramidLayout(t[u]));const I=this.barHelpers.initialPositions(v),{y:P,yDivision:S,zeroW:k,x:H,xDivision:L,zeroH:W}=I;let D=I.barHeight,R=I.barWidth;f=P,x=H,this.isHorizontal||m.push(x+(null!=R?R:0)/2);const X=d.group({class:"apexcharts-datalabels","data:realIndex":v}),F=h.config.dataLabels,O=!(null==(s=F.animate)?void 0:s.enabled)&&this.isLengthTransition(v);h.globals.dataChanged&&!O&&!(!(null==(a=F.animate)?void 0:a.enabled)&&!(null==(r=F.countUp)?void 0:r.enabled))||(h.globals.delayedElements.push({el:X.node,holdUntilComplete:O}),X.node.classList.add("apexcharts-element-hidden"));const M=d.group({class:"apexcharts-bar-goals-markers"}),_=d.group({class:"apexcharts-bar-shadows"}),j=this.ctx,Y=j._barShadows,B=j._barShadows=[],G=h.globals.dataChanged&&h.globals.shouldAnimate&&h.config.chart.animations.dynamicAnimation.enabled&&(null==Y?void 0:Y.length)===t[u].length-1;G||(h.globals.delayedElements.push({el:_.node}),_.node.classList.add("apexcharts-element-hidden"));for(let e=0;e<t[u].length;e++){const s=this.barHelpers.getStrokeWidth(u,e,v);let a=null;const r={indexes:{i:u,j:e,realIndex:v,translationsIndex:A,bc:p},x:x,y:f,strokeWidth:s,elSeries:C};this.isHorizontal?(a=this.drawBarPaths(l(n(n({},r),this.barHelpers.rows&&{y:P+this.barHelpers.barRow(v,e)*S}),{barHeight:D,zeroW:k,yDivision:S})),R=this.series[u][e]/this.invertedYRatio):(a=this.drawColumnPaths(l(n({},r),{xDivision:L,barWidth:R,zeroH:W})),D=this.series[u][e]/this.yRatio[A]);const d=this.barHelpers.getPathFillColor(t,u,e,v);if(this.isFunnel&&!this.isPyramid&&this.barOptions.isFunnel3d&&"trapezoid"!==(null==(i=h.config.plotOptions.funnel)?void 0:i.shape)&&this.pathArr.length&&e>0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof d.color&&-1===(null==(o=d.color)?void 0:o.indexOf("url"))?d.color:c.hexToRgba(h.globals.colors[u]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:a,realIndex:v,j:e});if(_.add(t),B.push(t),this._shadow=G&&[t,Y[e-1].attr("d")],h.config.chart.dropShadow.enabled){new z(this.w).dropShadow(t,h.config.chart.dropShadow,v)}}this.pathArr.push(a);const b=this.barHelpers.drawGoalLine({barXPosition:a.barXPosition,barYPosition:a.barYPosition,goalX:a.goalX,goalY:a.goalY,barHeight:D,barWidth:R});b&&M.add(b),f=a.y,x=a.x,e>0&&m.push(x+(null!=R?R:0)/2),y.push(f),this.renderSeries(l(n({hl:null==g?void 0:g.bar(this,{i:u,j:e,realIndex:v,translationsIndex:A,paths:a,zeroH:W,zeroW:k}),realIndex:v,pathFill:d.color},d.useRangeColor?{lineFill:d.color}:{}),{j:e,i:u,columnGroupIndex:w,pathFrom:a.pathFrom,pathTo:a.pathTo,strokeWidth:s,elSeries:C,x:x,y:f,series:t,barHeight:Math.abs(a.barHeight?a.barHeight:D),barWidth:Math.abs(a.barWidth?a.barWidth:R),barXPosition:a.barXPosition,elDataLabelsWrap:X,elGoalsMarkers:M,elBarShadows:_,visibleSeries:this.visibleI,type:"bar"}))}h.globals.seriesXvalues[v]=m,h.globals.seriesYvalues[v]=y,h.globals.previousPaths.length>0&&U({w:h,elSeries:C,record:this._prevRecord(v),newKeys:this._keys(v),isHorizontal:this.isHorizontal,speed:h.config.chart.animations.dynamicAnimation.speed}),b.add(C)}return b}renderSeries({hl:t,realIndex:e,pathFill:s,lineFill:a,j:r,i:i,columnGroupIndex:o,pathFrom:h,pathTo:d,strokeWidth:c,elSeries:u,x:b,y:g,y1:p,y2:x,series:f,barHeight:y,barWidth:m,barXPosition:v,barYPosition:w,elDataLabelsWrap:C,elGoalsMarkers:A,elBarShadows:I,visibleSeries:P,type:S,classes:k,fadeReveal:H=!1,noLabel:L}){var W,D,R,F,O,T,_;const j=this.w,Y=new X(this.w,this.ctx),B=function(t,e){const s=t&&t.renderer;return s&&s.kind&&"svg"!==s.kind?s:e}(this.ctx,Y);let V=!1;const E=this._pathToInterp;if(this._pathToInterp=null,u._bindingsDelegated||(u._bindingsDelegated=!0,Y.setupEventDelegation(u,`.apexcharts-${S}-area`)),!a){let t=function(t){const e=j.config.stroke.colors;let s;return Array.isArray(e)&&e.length>0&&(s=e[t],s||(s=""),"function"==typeof s)?s({value:j.seriesData.series[t][r],dataPointIndex:r,w:j}):s};const s="function"==typeof j.globals.stroke.colors[e]?t(e):j.globals.stroke.colors[e];a=this.barOptions.distributed?j.globals.stroke.colors[r]:s}const $=j.config.chart.animations,Z=$.animateGradually;let q=0,K=0;if(Z&&!1!==Z.enabled&&!(j.globals.dataChanged&&this.isLayoutShift(e))){const t=j.globals.dataPoints||1,e=Z.delay||0,s=Math.min(e,.5*$.speed/Math.max(1,t));K=N({style:"sequential",index:r,baseDelay:s}),j.config.chart.stacked&&!j.globals.dataChanged&&(K+=i*s*.5);q=K/(e||1)}const U=new M(this).handleBarDataLabels({x:b,y:g,y1:p,y2:x,i:i,j:r,series:f,realIndex:e,columnGroupIndex:o,barHeight:y,barWidth:m,barXPosition:v,barYPosition:w,visibleSeries:P,hl:null==t?void 0:t.label,noLabel:L});if(K>0){const t=j.config.dataLabels;if((null==(W=t.animate)?void 0:W.enabled)||(null==(D=t.countUp)?void 0:D.enabled)){const t=String(Math.round(K));null==(F=null==(R=U.dataLabels)?void 0:R.node)||F.setAttribute("data:dlDelay",t),null==(T=null==(O=U.totalDataLabels)?void 0:O.node)||T.setAttribute("data:dlDelay",t)}}let J=!1;if(!j.globals.isBarHorizontal){const t=void 0===v?U.dataLabelsPos.dataLabelsX:v+m/2,s=Math.max(m,j.globals.barPadForNumericAxis);(t+s<0||t-s>j.layout.gridWidth)&&(this._wasOnScreen(e,r)?J=!0:V=!0)}const Q=j.config.series[e].data[r];Q&&Q.strokeColor&&(a=Q.strokeColor);const tt=s;if(this.isNullValue&&-1===j.globals.collapsingSeriesIndices.indexOf(e)&&(s="none"),!V){const o=!0===(null==(_=this.ctx.morphTypeChange)?void 0:_.isActive()),b=o?this.ctx.morphTypeChange.getSpeed():j.config.chart.animations.dynamicAnimation.speed,g=o&&this.ctx.morphTypeChange.claimsTargetMark(e,r);g&&(h=d,q=0);const f=B.renderPaths({i:i,j:r,realIndex:e,pathFrom:h,pathTo:d,stroke:a,strokeWidth:c,strokeLinecap:j.config.stroke.lineCap,fill:s,pathToInterp:E,animationDelay:q,initialSpeed:j.config.chart.animations.speed,dataChangeSpeed:b,className:`apexcharts-${S}-area${k?` ${k}`:""}`,chartType:S,bindEventsOnPaths:!1,fadeReveal:H});f.attr("clip-path",`url(#gridRectBarMask${j.globals.cuid})`),J&&f.node.classList.add("apexcharts-leaving");const v=this._shadow;v&&(this._shadow=null,new G(j,this.ctx).animatePathsGradually({el:v[0],fill:"none",pathFrom:v[1],pathTo:v[0].attr("d"),speed:b,delay:q})),g&&(f.node.setAttribute("opacity","0"),f.node.setAttribute("data-piece-hidden","1"));const w=j.config.forecastDataPoints;w.count>0&&r>=j.globals.dataPoints-w.count&&(f.node.setAttribute("stroke-dasharray",w.dashArray),f.node.setAttribute("stroke-width",w.strokeWidth),f.node.setAttribute("fill-opacity",w.fillOpacity)),void 0!==p&&void 0!==x&&(f.attr("data-range-y1",p),f.attr("data-range-y2",x));if(new z(this.w).setSelectionFilter(f,e,r),u.add(f),f.attr({cy:U.dataLabelsPos.bcy,cx:U.dataLabelsPos.bcx,j:r,val:j.seriesData.series[e][r],barHeight:y,barWidth:m,"data:pathKey":this._keys(e)[r]}),null==t||t.paint(f,{delay:q,delayMs:K,speed:b,fill:tt,elSeries:u,elBarShadows:I,labels:U.dataLabels,pathFrom:h,pathTo:d}),"canvas"===B.kind){j.globals.barCanvasCoords||(j.globals.barCanvasCoords={}),j.globals.barCanvasCoords[e]||(j.globals.barCanvasCoords[e]={});const t=j.globals.barCanvasCoords[e][r];let s=(null==t?void 0:t.bounds)||null;const a=f.bbox();(a.width>0||a.height>0)&&(s={left:Math.min(s?s.left:1/0,a.x),top:Math.min(s?s.top:1/0,a.y),right:Math.max(s?s.right:-1/0,a.x+a.width),bottom:Math.max(s?s.bottom:-1/0,a.y+a.height)}),j.globals.barCanvasCoords[e][r]=l(n({cx:U.dataLabelsPos.bcx,cy:U.dataLabelsPos.bcy,barWidth:m,type:S},void 0!==p&&void 0!==x&&{rangeY1:p,rangeY2:x}),{bounds:s})}null!==U.dataLabels&&C.add(U.dataLabels),U.totalDataLabels&&C.add(U.totalDataLabels),u.add(C),A&&u.add(A),I&&u.add(I)}return u}drawBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:a,x:r,y:i,yDivision:o,elSeries:n}){const l=this.w,h=t.i,d=t.j;let c;if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:s,zeroEncounters:a}=this.barHelpers.getZeroValueEncounters({i:t.realIndex,j:d});s>0&&(e=this.seriesLen*e/s),c=i+e*this.visibleI,c-=e*a}else c=i+e*this.visibleI;const u=this.isFunnel&&"trapezoid"===l.config.plotOptions.funnel.shape,b=this.isPyramid&&this.pyramidLayout?this.pyramidLayout[d]:null,g=!!b;if(b)c=b.y,e=b.height;else if(this.isFunnel&&!u){const t=null!=a?a:0;a=t-(this.barHelpers.getXForValue(this.series[h][d],t)-t)/2}let p;return r=this.barHelpers.getXForValue(this.series[h][d],null!=a?a:0),p=b?this.barHelpers.getPyramidPaths({barYPosition:c,barHeight:e,topHalf:b.topHalf,bottomHalf:b.bottomHalf,realIndex:t.realIndex,j:d,strokeWidth:s,w:l}):u?this.barHelpers.getFunnelTrapezoidPaths({barYPosition:c,barHeight:e,series:this.series,i:h,j:d,realIndex:t.realIndex,strokeWidth:s,w:l}):this.barHelpers.getBarpaths({barYPosition:c,barHeight:e,x1:a,x2:r,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:h,j:d,w:l}),(u||g)&&(a=p.x1,r=p.x),g||(i+=o),g&&(i=c),this.barHelpers.barBackground({j:d,i:h,y1:c-e*this.visibleI,y2:e*this.seriesLen,elSeries:n}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x1:a,x:r,y:i,goalX:this.barHelpers.getGoalValues("x",a,null,t.realIndex,d,0),barYPosition:c,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:s,xDivision:a,barWidth:r,zeroH:i,strokeWidth:o,elSeries:n}){const l=this.w,h=t.realIndex,d=t.translationsIndex,c=t.i,u=t.j,b=t.bc;let g;if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:u,realIndex:h,barWidth:r});e=t.x,g=t.barXPosition}else if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:h,j:u});t>0&&(r=this.seriesLen*r/t),g=e+r*this.visibleI,g-=r*s}else g=e+r*this.visibleI;s=this.barHelpers.getYForValue(this.series[c][u],i,d);const p=this.barHelpers.getColumnPaths({barXPosition:g,barWidth:r,y1:i,y2:s,strokeWidth:o,isReversed:this.isReversed,series:this.series,realIndex:h,i:c,j:u,w:l});return l.axisFlags.isXNumeric||(e+=a),this.barHelpers.barBackground({bc:b,j:u,i:c,x1:g-o/2-r*this.visibleI,x2:r*this.seriesLen+o/2,elSeries:n}),{pathTo:p.pathTo,pathFrom:p.pathFrom,x:e,y:s,goalY:this.barHelpers.getGoalValues("y",null,i,h,u,d),barXPosition:g,barWidth:r}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:s,j:a}){const r=this.w,i=Y(r);let o=s;return r.seriesData.seriesX[s].length||(o=r.globals.maxValsInArrayIndex),c.isNumber(r.seriesData.seriesX[o][a])&&(t=J.dataXToPx(r,r.seriesData.seriesX[o][a])-e*(i?1:this.seriesLen)/2),{barXPosition:t+(i?0:e*this.visibleI),x:t}}_wasOnScreen(t,e){if(!$(this.w))return!1;const s=this._prevKeyedPaths(t);return!!s&&s.has(this._keys(t)[e])}_keys(t){const e=this._keyCache||(this._keyCache={});return e[t]||(e[t]=q(this.w,t))}_prevRecord(t){const e=this.w;let s=null;for(let a=0;a<e.globals.previousPaths.length;a++){const r=e.globals.previousPaths[a];r.paths&&r.paths.length>0&&parseInt(r.realIndex,10)===parseInt(String(t),10)&&(s=r)}return s}_prevKeyedPaths(t){if(this._prevKeyed||(this._prevKeyed={}),void 0!==this._prevKeyed[t])return this._prevKeyed[t];const e=this._prevRecord(t);let s=null;if(e&&e.paths.every(t=>null!=t.key)){const t=new Map;e.paths.forEach(e=>{t.set(e.key,e)}),s=t}return this._prevKeyed[t]=s,s}isLengthTransition(t){var e,s,a,r,i,o;if(this._ltCache||(this._ltCache={}),void 0!==this._ltCache[t])return this._ltCache[t];const n=this.w;let l=!1;if($(n)&&n.globals.previousPaths.length>0){const h=this._prevRecord(t),d=null!=(s=null==(e=n.seriesData.series[t])?void 0:e.length)?s:0,c=h&&this._prevKeyedPaths(t);if(h)if(c){const e=new Set(this._keys(t));l=(null!=(o=null==(i=null==(r=null==(a=n.globals.prevStreamFrame)?void 0:a.seriesY)?void 0:r[t])?void 0:i.length)?o:d)!==d||[...c.keys()].some(t=>!e.has(t))}else l=h.paths.length!==d;else l=d>0}return this._ltCache[t]=l,l}isLayoutShift(t){if(this.isLengthTransition(t))return!0;if(this._layoutShiftCache||(this._layoutShiftCache={}),void 0!==this._layoutShiftCache[t])return this._layoutShiftCache[t];const e=K(this.w,t,!0,!0),s=!(!e||!e.join.changed);return this._layoutShiftCache[t]=s,s}getPreviousPath(t,e,s,a){const r=this.w;this._pathToInterp=null;const i=this._prevRecord(t);if(!i)return $(r)?null:s;let o=null,n=!1;const l=this._prevKeyedPaths(t);if(l){const s=l.get(this._keys(t)[e]);s?o=s.d:n=!0}else void 0!==i.paths[e]?o=i.paths[e].d:n=!0;return o?this.cornerMorph(o,s,a):n&&$(r)?null:s}cornerMorph(t,e,s){const a=Q.pathCommandCount(t),r=Q.pathCommandCount(e);if(a===r)return t;const i=new X(this.w),o=t=>{const e=Q.pathBox(t);return e?Math.min(e.maxX-e.minX,e.maxY-e.minY):0},n=a<r?o(t)>1:o(e)>1;if(a<r){const e=i.roundPathCorners(t,0);if(Q.pathCommandCount(e)===r){if(n&&s){const t=i.roundPathCorners(s,0);Q.pathCommandCount(t)===r&&(this._pathToInterp=t)}return e}}else{const s=i.roundPathCorners(e,0);if(Q.pathCommandCount(s)===a){if(this._pathToInterp=s,n){const e=Q.squareLike(t),s=e?i.roundPathCorners(e,0):null;if(s&&Q.pathCommandCount(s)===a)return s}return t}}return e}static pathBox(t){if(!t)return null;const e=[],s=/([MLC])([^MLCZz]*)/g;let a;for(;null!==(a=s.exec(t));){const t=a[2].trim().split(/[\s,]+/).map(Number);t.length<2||t.some(isNaN)||e.push([t[t.length-2],t[t.length-1]])}if(e.length<3)return null;const r=e.map(t=>t[0]),i=e.map(t=>t[1]);return{minX:Math.min(...r),maxX:Math.max(...r),minY:Math.min(...i),maxY:Math.max(...i),start:e[0],vertical:Math.abs(e[1][0]-e[0][0])<Math.abs(e[1][1]-e[0][1])}}static squareLike(t){const e=Q.pathBox(t);if(!e)return null;const{minX:s,maxX:a,minY:r,maxY:i,start:o,vertical:n}=e,l=(t,e,s)=>Math.abs(t-e)<=Math.abs(t-s)?[e,s]:[s,e];let h,d,c,u;n?(h=Math.abs(o[0]-s)<=Math.abs(o[0]-a)?s:a,d=h===s?a:s,[c,u]=l(o[1],r,i)):(c=Math.abs(o[1]-r)<=Math.abs(o[1]-i)?r:i,u=c===r?i:r,[h,d]=l(o[0],s,a));const b=t.trim().endsWith("Z")?" Z":" z";return n?`M ${h} ${c} L ${h} ${u} L ${d} ${u} L ${d} ${c}${b}`:`M ${h} ${c} L ${d} ${c} L ${d} ${u} L ${h} ${u}${b}`}getPreviousFlip(t,e){const s=this._prevRecord(t);if(!s)return null;const a=this._prevKeyedPaths(t),r=a?a.get(this._keys(t)[e]):s.paths[e];return r?!!r.flip:null}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[MmLlHhVvCcSsQqTtAaZz]/g);return e?e.length:0}}d.default.use({bar:Q,column:Q,barStacked:class extends Q{draw(t,e){const s=this.w;this.graphics=new X(this.w);const a=new j(this.w);t=a.getLogSeries(t),this.yRatio=a.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t,e),"100%"===s.config.chart.stackType&&(t=s.globals.comboCharts?e.map(t=>s.globals.seriesPercent[t]):s.globals.seriesPercent.slice()),this.series=t,this.barHelpers.initializeStackedPrevVars(this);const r=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"}),i=this.ctx.highlightFilter;let o=0,h=0;const d=s.config.chart.animations,u=d.enabled&&d.dynamicAnimation.enabled&&s.globals.previousPaths.length>0;let b=!1;for(let a=0,d=0;a<t.length;a++,d++){const g=s.globals.comboCharts?e[a]:a,{groupIndex:p,columnGroupIndex:x}=this.barHelpers.getGroupIndex(g);this.groupCtx=this.stacks[p];const f=[],y=[],m=this.setSeriesAxis(g);let v=this.graphics.group({class:"apexcharts-series",seriesName:c.escapeString(s.seriesData.seriesNames[g]),rel:a+1,"data:realIndex":g});T.addCollapsedClassToSeries(this.w,v,g);const w=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":g});T.addCollapsedClassToSeries(this.w,w,g),(s.globals.collapsingSeriesIndices||[]).indexOf(g)>-1&&w.node.style.setProperty("--apexcharts-dl-exit",`${s.config.chart.animations.dynamicAnimation.speed}ms`);const C=this.graphics.group({class:"apexcharts-bar-goals-markers"}),A=this.initialPositions(o,h,void 0,void 0,void 0,void 0,m),{xDivision:I,yDivision:P,zeroH:S,zeroW:k}=A;let H=A.barHeight,L=A.barWidth;h=A.y,o=A.x,s.globals.barHeight=H,s.globals.barWidth=L,this.barHelpers.initializeStackedXYVars(this),1===this.groupCtx.prevY.length&&this.groupCtx.prevY[0].every(t=>isNaN(t))&&(this.groupCtx.prevY[0]=this.groupCtx.prevY[0].map(()=>S),this.groupCtx.prevYF[0]=this.groupCtx.prevYF[0].map(()=>0));for(let e=0;e<s.globals.dataPoints;e++){const r=this.barHelpers.getStrokeWidth(a,e,g),c={indexes:{i:a,j:e,realIndex:g,translationsIndex:m,bc:d},strokeWidth:r,x:o,y:h,elSeries:v,columnGroupIndex:x};let p=null;this.isHorizontal?(p=this.drawStackedBarPaths(l(n(n({},c),this.barHelpers.rows&&{y:A.y+this.barHelpers.barRow(g,e)*P}),{zeroW:k,barHeight:H,yDivision:P})),L=this.series[a][e]/this.invertedYRatio):(p=this.drawStackedColumnPaths(l(n({},c),{xDivision:I,barWidth:L,zeroH:S})),H=this.series[a][e]/this.yRatio[m]);const W=this.barHelpers.drawGoalLine({barXPosition:p.barXPosition,barYPosition:p.barYPosition,goalX:p.goalX,goalY:p.goalY,barHeight:H,barWidth:L});W&&C.add(W),h=p.y,o=p.x,f.push(o),y.push(h);const D=this.barHelpers.getPathFillColor(t,a,e,g);let R="";const X=s.globals.isBarHorizontal?"apexcharts-flip-x":"apexcharts-flip-y",F=this.cornerFlip(this.barHelpers.arrBorderRadius[g][e],s.seriesData.series[g][e]),O=u&&!F&&this.getPreviousFlip(g,e);(F||O)&&(R=X),O&&(R+=" apexcharts-flip-held",b=!0),v=this.renderSeries(l(n({hl:null==i?void 0:i.bar(this,{i:a,j:e,realIndex:g,translationsIndex:m,paths:p,zeroH:S,zeroW:k}),realIndex:g,pathFill:D.color},D.useRangeColor?{lineFill:D.color}:{}),{j:e,i:a,columnGroupIndex:x,pathFrom:p.pathFrom,pathTo:p.pathTo,strokeWidth:r,elSeries:v,x:o,y:h,series:t,barHeight:H,barWidth:L,barXPosition:p.barXPosition,elDataLabelsWrap:w,elGoalsMarkers:C,type:"bar",visibleSeries:x,classes:R}))}s.globals.seriesXvalues[g]=f,s.globals.seriesYvalues[g]=y,this.groupCtx.prevY.push(this.groupCtx.yArrj),this.groupCtx.prevYF.push(this.groupCtx.yArrjF),this.groupCtx.prevYVal.push(this.groupCtx.yArrjVal),this.groupCtx.prevX.push(this.groupCtx.xArrj),this.groupCtx.prevXF.push(this.groupCtx.xArrjF),this.groupCtx.prevXVal.push(this.groupCtx.xArrjVal),r.add(v)}return b&&this.settleHeldMirrors(r),r}cornerFlip(t,e){return"bottom"===t&&e>0||"top"===t&&e<0}settleHeldMirrors(t){const e=this.w;if(!E.isBrowser())return;const s=e.config.chart.animations,a=(s.dynamicAnimation.speed||0)+(s.speed||0)+100,r=(t?t.node:e.dom.baseEl).querySelectorAll(".apexcharts-flip-held");setTimeout(()=>{r.forEach(t=>{t.classList.remove("apexcharts-flip-held","apexcharts-flip-y","apexcharts-flip-x")})},a)}initialPositions(t,e,s,a,r,i,o){const n=this.w;let l,h;if(this.isHorizontal){a=n.layout.gridHeight/n.globals.dataPoints;const t=n.config.plotOptions.bar.barHeight;l=-1===String(t).indexOf("%")?parseInt(t,10):a*parseInt(t,10)/100,i=n.globals.padHorizontal+(this.isReversed?n.layout.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),e=(a-l)/2}else{h=s=n.layout.gridWidth/n.globals.dataPoints;const e=n.config.plotOptions.bar.columnWidth,a=n.axisFlags.isXNumeric?this.barHelpers.barSlotXSpan():0;a>0?h=(s=a/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:h*=parseInt(e,10)/100,-1===String(e).indexOf("%")&&(h=parseInt(e,10)),r=this.isReversed?this.baseLineY[o]:n.layout.gridHeight-this.baseLineY[o],t=n.globals.padHorizontal+(s-h)/2}const d=n.globals.barGroups.length||1;return{x:t,y:e,yDivision:a,xDivision:s,barHeight:(null!=l?l:0)/d,barWidth:(null!=h?h:0)/d,zeroH:r,zeroW:i}}drawStackedBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:a,x:r,y:i,columnGroupIndex:o,yDivision:n,elSeries:l}){var h,d;const c=this.w,u=i+o*e;let b;const g=t.i,p=t.j,x=t.realIndex,f=t.translationsIndex,y=null!=(d=null==(h=this.series[g])?void 0:h[p])?d:null,m=this.groupCtx,v=c.axisFlags.isXNumeric?c.seriesData.seriesX[x][p]:p,w=m.tops.get(v);if(w){const[t,e,s]=w,a=2*(this.isReversed?s:0);b=e<0?y>=0?t+s-a:t:y>=0?t:t-s+a}else b=a;r=b+y/this.invertedYRatio*(this.isReversed?-1:1);const C=this.barHelpers.getBarpaths({barYPosition:u,barHeight:e,x1:b,x2:r,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:g,j:p,w:c});return this._setTop(v,w,m.xArrj[p],m.xArrjVal[p],m.xArrjF[p],x,p),this.barHelpers.barBackground({j:p,i:g,y1:u,y2:e,elSeries:l}),i+=n,{pathTo:C.pathTo,pathFrom:C.pathFrom,goalX:this.barHelpers.getGoalValues("x",a,null,x,p,f),barXPosition:b,barYPosition:u,x:r,y:i}}drawStackedColumnPaths({indexes:t,x:e,y:s,xDivision:a,barWidth:r,zeroH:i,columnGroupIndex:o,elSeries:n}){var l,h,d;const c=this.w,u=t.i,b=t.j,g=t.bc,p=t.realIndex,x=t.translationsIndex,f=null!=(h=null==(l=this.series[u])?void 0:l[b])?h:null;if(c.axisFlags.isXNumeric){let t=c.seriesData.seriesX[p][b];t||(t=0),e=(t-c.globals.minX)/this.xRatio-r/2*c.globals.barGroups.length}const y=e+o*r;let m;const v=this.groupCtx,w=c.axisFlags.isXNumeric?c.seriesData.seriesX[p][b]:b,C=v.tops.get(w);if(C){const[t,e,s]=C;let a;e<0?a=f>=0?t-s+2*(this.isReversed?s:0):t:e>=0&&(a=f>=0?t:t+s-2*(this.isReversed?s:0)),void 0===a&&(a=c.layout.gridHeight),m=(null==(d=v.prevYF[0])?void 0:d.every(t=>0===t))&&v.prevYF.slice(1).every(t=>t.every(t=>isNaN(t)))?i:a}else m=i;s=m-f/this.yRatio[x]*(this.isReversed?-1:1);const A=this.barHelpers.getColumnPaths({barXPosition:y,barWidth:r,y1:m,y2:s,yRatio:this.yRatio[x],strokeWidth:c.config.stroke.show?this.strokeWidth:0,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:u,j:b,w:c});return this._setTop(w,C,v.yArrj[b],v.yArrjVal[b],v.yArrjF[b],p,b),this.barHelpers.barBackground({bc:g,j:b,i:u,x1:y,x2:r,elSeries:n}),{pathTo:A.pathTo,pathFrom:A.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,i,p,b,x),barXPosition:y,x:c.axisFlags.isXNumeric?e:e+a,y:s}}_setTop(t,e,s,a,r,i,o){isNaN(s)||this.groupCtx.tops.set(t,[s,a,(e?e[2]:0)+r,(e?e[3]:0)+(this.w.seriesData.series[i][o]||0),e?Math.min(e[0],e[4]):1/0,e?Math.max(e[0],e[5]):-1/0])}},rangeBar:class extends Q{draw(t,e){var s,a,r,i,o,l;const h=this.w,d=new X(this.w);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=h.rangeData.seriesRangeStart,this.seriesRangeEnd=h.rangeData.seriesRangeEnd,this.barHelpers.initVariables(t,e);const u=d.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let b=0;b<t.length;b++){let g,p;const x=h.globals.comboCharts?e[b]:b,{columnGroupIndex:f}=this.barHelpers.getGroupIndex(x),y=d.group({class:"apexcharts-series",seriesName:c.escapeString(h.seriesData.seriesNames[x]),rel:b+1,"data:realIndex":x});T.addCollapsedClassToSeries(this.w,y,x),t[b].length>0&&(this.visibleI=this.visibleI+1);const m=this.setSeriesAxis(x);this.isHorizontal&&h.labelData.timescaleLabels.length&&(this.isReversed=!1);const v=this.barHelpers.initialPositions(x),{y:w,zeroW:C,x:A,zeroH:I}=v,P=null!=(s=v.yDivision)?s:0,S=null!=(a=v.xDivision)?a:0;p=w,g=A;const k=d.group({class:"apexcharts-datalabels","data:realIndex":x}),H=d.group({class:"apexcharts-rangebar-goals-markers"}),L=h.config.series[x].data;for(let e=0;e<h.globals.dataPoints;e++){const s=this.barHelpers.getStrokeWidth(b,e,x);let a=null!=(r=v.barWidth)?r:0,d=null!=(i=v.barHeight)?i:0;const c=this.seriesRangeStart[x][e],u=this.seriesRangeEnd[x][e];let w=null,A=null,W=null;const D={x:g,y:p,strokeWidth:s,elSeries:y};let R=this.seriesLen;if(h.config.plotOptions.bar.rangeBarGroupRows&&(R=1),void 0===(null==L?void 0:L[e]))break;if(this.isHorizontal){W=p+d*this.visibleI;const t=(P-d*R)/2;if(null!=(null==(o=L[e])?void 0:o.x)){const s=this.detectOverlappingBars({i:x,j:e,barYPosition:W,srty:t,barHeight:d,yDivision:P,initPositions:v});d=s.barHeight,W=s.barYPosition}w=this.drawRangeBarPaths(n({indexes:{i:b,j:e,realIndex:x},barHeight:d,barYPosition:W,zeroW:C,yDivision:P,y1:c,y2:u},D)),a=w.barWidth}else{h.axisFlags.isXNumeric&&(g=(h.seriesData.seriesX[x][e]-h.globals.minX)/this.xRatio-a/2),A=g+a*this.visibleI;const t=(S-a*R)/2;if(null!=(null==(l=L[e])?void 0:l.x)){const s=this.detectOverlappingBars({i:x,j:e,barXPosition:A,srtx:t,barWidth:a,xDivision:S,initPositions:v});a=s.barWidth,A=s.barXPosition}w=this.drawRangeColumnPaths(n({indexes:{i:b,j:e,realIndex:x,translationsIndex:m},barWidth:a,barXPosition:A,zeroH:I,xDivision:S},D)),d=w.barHeight,A=w.barXPosition}const X=this.barHelpers.drawGoalLine({barXPosition:A,barYPosition:W,goalX:w.goalX,goalY:w.goalY,barHeight:d,barWidth:a});X&&H.add(X),p=w.y,g=w.x;const F=this.barHelpers.getPathFillColor(t,b,e,x);this.renderSeries({realIndex:x,pathFill:F.color,lineFill:F.useRangeColor?F.color:h.globals.stroke.colors[x],j:e,i:b,x:g,y:p,y1:c,y2:u,pathFrom:w.pathFrom,pathTo:w.pathTo,strokeWidth:s,elSeries:y,series:t,barHeight:d,barWidth:a,barXPosition:A,barYPosition:W,columnGroupIndex:f,elDataLabelsWrap:k,elGoalsMarkers:H,visibleSeries:this.visibleI,type:"rangebar"})}h.globals.previousPaths.length>0&&U({w:h,elSeries:y,record:this._prevRecord(x),newKeys:this._keys(x),isHorizontal:this.isHorizontal,speed:h.config.chart.animations.dynamicAnimation.speed}),u.add(y)}return u}detectOverlappingBars({i:t,j:e,barYPosition:s,barXPosition:a,srty:r,srtx:i,barHeight:o,barWidth:n,yDivision:l,xDivision:h,initPositions:d}){var c,u,b,g;const p=this.w;let x=[];const f=null==(u=null==(c=p.globals.seriesRangeName)?void 0:c[t])?void 0:u[e],y=null==(g=null==(b=p.config.series[t].data)?void 0:b[e])?void 0:g.x,m=Array.isArray(y)?y.join(" "):y,v=p.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(m),w=p.rangeData.seriesRange[t].findIndex(t=>{var e;return t.x===m&&(null==(e=t.overlaps)?void 0:e.size)>0});return this.isHorizontal?(s=p.config.plotOptions.bar.rangeBarGroupRows?r+l*v:r+o*this.visibleI+l*v,w>-1&&!p.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(p.rangeData.seriesRange[t][w].overlaps),x.indexOf(f)>-1&&(s+=(o=d.barHeight/x.length)*x.indexOf(f)))):(v>-1&&!p.axisFlags.isXNumeric&&(a=p.config.plotOptions.bar.rangeBarGroupRows?i+h*v:i+n*this.visibleI+h*v),w>-1&&!p.config.plotOptions.bar.rangeBarOverlap&&(x=Array.from(p.rangeData.seriesRange[t][w].overlaps),x.indexOf(f)>-1&&(a+=(n=d.barWidth/x.length)*x.indexOf(f)))),{barYPosition:s,barXPosition:a,barHeight:o,barWidth:n}}drawRangeColumnPaths({indexes:t,x:e,xDivision:s,barWidth:a,barXPosition:r,zeroH:i}){var o,n;const l=this.w,{i:h,j:d,realIndex:c,translationsIndex:u}=t,b=this.yRatio[u]*(this.isReversed?-1:1),g=this.getRangeValue(c,d);let p=Math.min(g.start,g.end),x=Math.max(g.start,g.end);const f=!(void 0===(null==(o=this.series[h])?void 0:o[d])||null===(null==(n=this.series[h])?void 0:n[d]));f?(p=i-p/b,x=i-x/b):p=x=i;const y=Math.abs(x-p),m=this.barHelpers.getColumnPaths({barXPosition:r,barWidth:a,y1:p,y2:x,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:c,i:c,j:d,w:l});if(f){const t=m.drawnBox,e=g.end>=g.start;this.recordColumnGeometry(c,d,{slotStart:t.x1,slotEnd:t.x2,levelStart:e?t.y1:t.y2,levelEnd:e?t.y2:t.y1,horizontal:!1})}if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:d,realIndex:c,barWidth:a});e=t.x,r=t.barXPosition}else e+=s;return{pathTo:m.pathTo,pathFrom:m.pathFrom,barHeight:y,x:e,y:g.start<0&&g.end<0?p:x,goalY:this.barHelpers.getGoalValues("y",null,i,c,d,u),barXPosition:r}}_keys(t){const e=this._keyCache||(this._keyCache={}),s=this.w.config.series[t].data;return e[t]||(e[t]=Z((s||[]).map((t,e)=>{var s;return"c:"+(null!=(s=null==t?void 0:t.x)?s:e)})))}preventBarOverflow(t){const e=this.w;return t<0&&(t=0),t>e.layout.gridWidth&&(t=e.layout.gridWidth),t}drawRangeBarPaths({indexes:t,y:e,y1:s,y2:a,yDivision:r,barHeight:i,barYPosition:o,zeroW:n}){const l=this.w,{realIndex:h,j:d}=t,c=this.invertedYRatio*(this.isReversed?-1:1),u=this.preventBarOverflow(n+s/c),b=this.preventBarOverflow(n+a/c),g=this.getRangeValue(h,d),p=Math.abs(b-u),x=this.barHelpers.getBarpaths({barYPosition:o,barHeight:i,x1:u,x2:b,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,realIndex:h,j:d,w:l});if(null!=g.start&&null!=g.end){const t=x.drawnBox;this.recordColumnGeometry(h,d,{slotStart:t.y1,slotEnd:t.y2,levelStart:t.x1,levelEnd:t.x2,horizontal:!0})}return l.axisFlags.isXNumeric||(e+=r),{pathTo:x.pathTo,pathFrom:x.pathFrom,barWidth:p,x:g.start<0&&g.end<0?u:b,goalX:this.barHelpers.getGoalValues("x",n,null,h,d,0),y:e}}recordColumnGeometry(t,e,s){const a=this.w.waterfallData&&this.w.waterfallData.geometry;a&&isFinite(s.slotStart)&&isFinite(s.levelEnd)&&(a[t]||(a[t]=[]),a[t][e]=s)}getRangeValue(t,e){const s=this.w;return{start:s.rangeData.seriesRangeStart[t][e],end:s.rangeData.seriesRangeEnd[t][e]}}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>d.default});