apexcharts 8.2.0 → 8.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/README.md +7 -7
  2. package/dist/apexcharts.common.js +2 -2
  3. package/dist/apexcharts.core.js +19793 -19713
  4. package/dist/apexcharts.core.min.js +2 -2
  5. package/dist/apexcharts.css +38 -8
  6. package/dist/apexcharts.esm.js +1882 -1625
  7. package/dist/apexcharts.full.js +22044 -21634
  8. package/dist/apexcharts.full.min.js +2 -2
  9. package/dist/apexcharts.js +21414 -21124
  10. package/dist/apexcharts.min.js +2 -2
  11. package/dist/apexcharts.ssr.common.js +2 -2
  12. package/dist/apexcharts.ssr.esm.js +21413 -21123
  13. package/dist/area.common.js +2 -2
  14. package/dist/area.esm.js +91 -40
  15. package/dist/bar.common.js +2 -2
  16. package/dist/bar.esm.js +478 -406
  17. package/dist/bar.js +2 -2
  18. package/dist/boxPlot.common.js +2 -2
  19. package/dist/boxPlot.esm.js +409 -334
  20. package/dist/bubble.common.js +2 -2
  21. package/dist/bubble.esm.js +91 -40
  22. package/dist/candlestick.common.js +2 -2
  23. package/dist/candlestick.esm.js +409 -334
  24. package/dist/candlestick.js +2 -2
  25. package/dist/column.common.js +2 -2
  26. package/dist/column.esm.js +478 -406
  27. package/dist/core.common.js +2 -2
  28. package/dist/core.esm.js +19793 -19713
  29. package/dist/donut.common.js +2 -2
  30. package/dist/donut.esm.js +3 -9
  31. package/dist/dumbbell.common.js +2 -2
  32. package/dist/dumbbell.esm.js +478 -406
  33. package/dist/features/all.common.js +2 -2
  34. package/dist/features/all.esm.js +442 -324
  35. package/dist/features/annotations.common.js +2 -2
  36. package/dist/features/annotations.esm.js +65 -48
  37. package/dist/features/annotations.js +2 -2
  38. package/dist/features/context-menu.common.js +1 -1
  39. package/dist/features/context-menu.esm.js +1 -1
  40. package/dist/features/context-menu.js +1 -1
  41. package/dist/features/drilldown.common.js +2 -2
  42. package/dist/features/drilldown.esm.js +4 -2
  43. package/dist/features/drilldown.js +2 -2
  44. package/dist/features/dumbbell.common.js +1 -1
  45. package/dist/features/dumbbell.esm.js +1 -1
  46. package/dist/features/dumbbell.js +1 -1
  47. package/dist/features/exports.common.js +2 -2
  48. package/dist/features/exports.esm.js +10 -4
  49. package/dist/features/exports.js +2 -2
  50. package/dist/features/facet.common.js +1 -1
  51. package/dist/features/facet.esm.js +1 -1
  52. package/dist/features/facet.js +1 -1
  53. package/dist/features/highlight-filter.common.js +2 -2
  54. package/dist/features/highlight-filter.esm.js +14 -9
  55. package/dist/features/highlight-filter.js +2 -2
  56. package/dist/features/history.common.js +1 -1
  57. package/dist/features/history.esm.js +1 -1
  58. package/dist/features/history.js +1 -1
  59. package/dist/features/ink.common.js +1 -1
  60. package/dist/features/ink.esm.js +1 -1
  61. package/dist/features/ink.js +1 -1
  62. package/dist/features/keyboard.common.js +2 -2
  63. package/dist/features/keyboard.esm.js +97 -145
  64. package/dist/features/keyboard.js +2 -2
  65. package/dist/features/legend.common.js +2 -2
  66. package/dist/features/legend.esm.js +64 -44
  67. package/dist/features/legend.js +2 -2
  68. package/dist/features/link.common.js +1 -1
  69. package/dist/features/link.esm.js +1 -1
  70. package/dist/features/link.js +1 -1
  71. package/dist/features/marks.common.js +1 -1
  72. package/dist/features/marks.esm.js +1 -1
  73. package/dist/features/marks.js +1 -1
  74. package/dist/features/measure.common.js +1 -1
  75. package/dist/features/measure.esm.js +1 -1
  76. package/dist/features/measure.js +1 -1
  77. package/dist/features/morph.common.js +2 -2
  78. package/dist/features/morph.esm.js +9 -5
  79. package/dist/features/morph.js +2 -2
  80. package/dist/features/perspectives.common.js +2 -2
  81. package/dist/features/perspectives.esm.js +4 -1
  82. package/dist/features/perspectives.js +2 -2
  83. package/dist/features/raincloud.common.js +2 -2
  84. package/dist/features/raincloud.esm.js +26 -27
  85. package/dist/features/raincloud.js +2 -2
  86. package/dist/features/renderer-canvas.common.js +2 -2
  87. package/dist/features/renderer-canvas.esm.js +2 -1
  88. package/dist/features/renderer-canvas.js +2 -2
  89. package/dist/features/stats.common.js +2 -2
  90. package/dist/features/stats.esm.js +52 -59
  91. package/dist/features/stats.js +2 -2
  92. package/dist/features/storyboard.common.js +2 -2
  93. package/dist/features/storyboard.esm.js +4 -1
  94. package/dist/features/storyboard.js +2 -2
  95. package/dist/features/streamgraph.common.js +2 -2
  96. package/dist/features/streamgraph.esm.js +48 -14
  97. package/dist/features/streamgraph.js +2 -2
  98. package/dist/features/toolbar.common.js +2 -2
  99. package/dist/features/toolbar.esm.js +148 -18
  100. package/dist/features/toolbar.js +2 -2
  101. package/dist/features/trellis.common.js +2 -2
  102. package/dist/features/trellis.esm.js +150 -63
  103. package/dist/features/trellis.js +2 -2
  104. package/dist/features/waterfall.common.js +1 -1
  105. package/dist/features/waterfall.esm.js +1 -1
  106. package/dist/features/waterfall.js +1 -1
  107. package/dist/features/weave.common.js +2 -2
  108. package/dist/features/weave.esm.js +13 -12
  109. package/dist/features/weave.js +2 -2
  110. package/dist/full.common.js +2 -2
  111. package/dist/full.esm.js +1068 -842
  112. package/dist/heatmap.common.js +2 -2
  113. package/dist/heatmap.esm.js +3 -17
  114. package/dist/heatmap.js +2 -2
  115. package/dist/histogram.common.js +2 -2
  116. package/dist/histogram.esm.js +529 -464
  117. package/dist/icicle.common.js +2 -2
  118. package/dist/icicle.esm.js +80 -46
  119. package/dist/icicle.js +2 -2
  120. package/dist/line.common.js +2 -2
  121. package/dist/line.esm.js +91 -40
  122. package/dist/line.js +2 -2
  123. package/dist/locales/en.json +2 -1
  124. package/dist/locales/ro.json +3 -2
  125. package/dist/pictograms.common.js +1 -1
  126. package/dist/pictograms.esm.js +1 -1
  127. package/dist/pictograms.js +1 -1
  128. package/dist/pie.common.js +2 -2
  129. package/dist/pie.esm.js +3 -9
  130. package/dist/pie.js +2 -2
  131. package/dist/polarArea.common.js +2 -2
  132. package/dist/polarArea.esm.js +3 -9
  133. package/dist/radar.common.js +2 -2
  134. package/dist/radar.esm.js +5 -4
  135. package/dist/radar.js +2 -2
  136. package/dist/radialBar.common.js +2 -2
  137. package/dist/radialBar.esm.js +5 -12
  138. package/dist/radialBar.js +2 -2
  139. package/dist/raincloud.common.js +2 -2
  140. package/dist/raincloud.esm.js +97 -52
  141. package/dist/rangeArea.common.js +2 -2
  142. package/dist/rangeArea.esm.js +91 -40
  143. package/dist/rangeBar.common.js +2 -2
  144. package/dist/rangeBar.esm.js +478 -406
  145. package/dist/scatter.common.js +2 -2
  146. package/dist/scatter.esm.js +91 -40
  147. package/dist/streamgraph.common.js +2 -2
  148. package/dist/streamgraph.esm.js +138 -53
  149. package/dist/sunburst.common.js +2 -2
  150. package/dist/sunburst.esm.js +116 -94
  151. package/dist/sunburst.js +2 -2
  152. package/dist/treemap.common.js +2 -2
  153. package/dist/treemap.esm.js +138 -104
  154. package/dist/treemap.js +2 -2
  155. package/dist/unit-shapes.common.js +1 -1
  156. package/dist/unit-shapes.esm.js +1 -1
  157. package/dist/unit-shapes.js +1 -1
  158. package/dist/unit.common.js +2 -2
  159. package/dist/unit.esm.js +280 -202
  160. package/dist/unit.js +2 -2
  161. package/dist/violin.common.js +2 -2
  162. package/dist/violin.esm.js +72 -26
  163. package/dist/violin.js +2 -2
  164. package/dist/waterfall.common.js +2 -2
  165. package/dist/waterfall.esm.js +477 -405
  166. package/package.json +1 -1
  167. package/src/apexcharts.js +40 -59
  168. package/src/assets/apexcharts.css +38 -8
  169. package/src/charts/Bar.js +62 -55
  170. package/src/charts/BarStacked.js +80 -88
  171. package/src/charts/BoxCandleStick.js +28 -31
  172. package/src/charts/Icicle.js +68 -47
  173. package/src/charts/Line.js +118 -42
  174. package/src/charts/Pie.js +2 -8
  175. package/src/charts/Radar.js +5 -7
  176. package/src/charts/Radial.js +2 -6
  177. package/src/charts/RangeBar.js +47 -43
  178. package/src/charts/Sunburst.js +101 -98
  179. package/src/charts/Treemap.js +150 -88
  180. package/src/charts/Unit.js +368 -250
  181. package/src/charts/Violin.js +48 -30
  182. package/src/charts/common/Breadcrumb.js +2 -2
  183. package/src/charts/common/Hierarchy.js +32 -11
  184. package/src/charts/common/Jitter.js +32 -7
  185. package/src/charts/common/Stats.js +30 -23
  186. package/src/charts/common/bar/DataLabels.js +76 -81
  187. package/src/charts/common/bar/Helpers.js +43 -7
  188. package/src/charts/common/line/Helpers.js +12 -15
  189. package/src/charts/common/partition/NodeTooltip.js +29 -7
  190. package/src/charts/common/partition/Partition.js +33 -1
  191. package/src/charts/common/treemap/Helpers.js +3 -11
  192. package/src/charts/common/treemap/Nested.js +2 -3
  193. package/src/features/raincloud.js +16 -10
  194. package/src/features/stats.js +67 -62
  195. package/src/locales/en.json +2 -1
  196. package/src/locales/ro.json +3 -2
  197. package/src/modules/Animations.js +102 -95
  198. package/src/modules/AxisMapping.js +47 -12
  199. package/src/modules/Core.js +4 -0
  200. package/src/modules/CoreUtils.js +18 -42
  201. package/src/modules/Data.js +23 -24
  202. package/src/modules/DataLabels.js +6 -6
  203. package/src/modules/Exports.js +12 -5
  204. package/src/modules/Fill.js +17 -8
  205. package/src/modules/Filters.js +50 -50
  206. package/src/modules/Graphics.js +69 -51
  207. package/src/modules/Markers.js +3 -1
  208. package/src/modules/MorphTypeChange.js +13 -7
  209. package/src/modules/Range.js +44 -29
  210. package/src/modules/RendererController.js +17 -3
  211. package/src/modules/Scales.js +32 -9
  212. package/src/modules/Series.js +41 -19
  213. package/src/modules/Theme.js +1 -1
  214. package/src/modules/Toolbar.js +3 -2
  215. package/src/modules/UnitMarkRegistry.js +0 -5
  216. package/src/modules/ZoomPanSelection.js +123 -2
  217. package/src/modules/accessibility/KeyboardNavigation.js +114 -186
  218. package/src/modules/animations/Easing.js +2 -1
  219. package/src/modules/animations/LengthTransition.js +22 -2
  220. package/src/modules/annotations/Helpers.js +68 -52
  221. package/src/modules/axes/Grid.js +21 -7
  222. package/src/modules/axes/YAxis.js +8 -9
  223. package/src/modules/dimensions/Dimensions.js +9 -3
  224. package/src/modules/dimensions/Grid.js +2 -2
  225. package/src/modules/dimensions/XAxis.js +2 -5
  226. package/src/modules/drilldown/Breadcrumb.js +5 -2
  227. package/src/modules/helpers/Destroy.js +1 -1
  228. package/src/modules/helpers/UpdateHelpers.js +33 -15
  229. package/src/modules/highlightFilter/HighlightFilter.js +8 -9
  230. package/src/modules/highlightFilter/TreemapPart.js +2 -2
  231. package/src/modules/legend/HeatmapGradientLegend.js +76 -45
  232. package/src/modules/legend/Helpers.js +8 -1
  233. package/src/modules/legend/Legend.js +11 -12
  234. package/src/modules/license/LicenseEnforcer.js +5 -0
  235. package/src/modules/settings/Defaults.js +28 -56
  236. package/src/modules/settings/Globals.js +5 -0
  237. package/src/modules/settings/Options.js +7 -7
  238. package/src/modules/settings/TypeAliases.js +33 -16
  239. package/src/modules/streamgraph/StreamLabels.js +1 -0
  240. package/src/modules/tooltip/Labels.js +73 -76
  241. package/src/modules/tooltip/Marker.js +25 -21
  242. package/src/modules/tooltip/Position.js +88 -51
  243. package/src/modules/tooltip/Tooltip.js +242 -255
  244. package/src/modules/tooltip/Utils.js +71 -130
  245. package/src/modules/tooltip/constants.js +5 -5
  246. package/src/modules/trellis/Trellis.js +6 -0
  247. package/src/modules/trellis/TrellisChrome.js +18 -7
  248. package/src/modules/trellis/TrellisSync.js +2 -0
  249. package/src/modules/trellis/TrellisTooltip.js +2 -11
  250. package/src/modules/weave/WeaveHost.js +18 -12
  251. package/src/renderers/canvas/CanvasGraphics.js +1 -0
  252. package/src/ssr/DOMShim.js +10 -0
  253. package/src/svg/SVGFilter.js +26 -17
  254. package/src/types/internal.d.ts +9 -3
  255. package/src/utils/Utils.js +0 -14
  256. package/types/apexcharts.d.ts +33 -12
package/dist/unit.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.2.0
2
+ * ApexCharts v8.3.1
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- !function(t){var e="undefined"!=typeof globalThis?globalThis:self,a=e.ApexCharts;if(a&&a.__internals)return t.call(e);if(a)throw new Error("ApexCharts: dist/unit.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");if("function"==typeof define&&define.amd)return t.call(e);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/unit.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/unit.js",run:t,done:!1},s=e.__apexcharts_pending_addons__||(e.__apexcharts_pending_addons__=[]);s.push(i),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!i.done){var a=e.ApexCharts;if(a)if(a.__internals){i.done=!0;var r=s.indexOf(i);-1!==r&&s.splice(r,1);try{t.call(e),a.__drainsAddons||e.console.warn("ApexCharts: dist/unit.js loaded before the ApexCharts script, which is older than 8.0 and does not pick up add-ons loaded first, so it registered only when the page finished loading. Put its tag after the ApexCharts script.")}catch(t){e.console.error("ApexCharts: dist/unit.js could not register with the ApexCharts script on this page: "+(t&&t.message))}}else e.console.error("ApexCharts: dist/unit.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");else e.console.warn("ApexCharts: dist/unit.js is waiting for the ApexCharts script, which had not loaded when the page finished loading. It registers when an ApexCharts 8.0 or later script loads; if the page has none, add apexcharts.min.js (or apexcharts.core.min.js, or apexcharts.full.min.js).")}})}(function(){var t,e;t=this,e=function(t){"use strict";var e=Object.defineProperty,a=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,o=(t,a,i)=>a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[a]=i,l=(t,e)=>{for(var a in e||(e={}))r.call(e,a)&&o(t,a,e[a]);if(s)for(var a of s(e))n.call(e,a)&&o(t,a,e[a]);return t},c=(t,e)=>a(t,i(e));const h=globalThis.ApexCharts,u=1/45;function d(t,e,a,i){return{value:t,velocity:0,target:t,stiffness:e,damping:a}}function p(t,e){if(e<=0)return m(t);let a=e;for(;a>0;){const e=Math.min(a,u),i=-t.stiffness*(t.value-t.target)-t.damping*t.velocity;t.velocity+=i*e,t.value+=t.velocity*e,a-=e}return!!m(t)&&(t.value=t.target,t.velocity=0,!0)}function f(t,e){t.target=e}function m(t){var e,a;const i=null!=(e=t.restVelocity)?e:.05,s=null!=(a=t.restDisplacement)?a:.05;return Math.abs(t.velocity)<i&&Math.abs(t.value-t.target)<s}const x={crisp:[210,26],gentle:[120,20],snappy:[320,30]},g=globalThis.ApexCharts.__internals.__apex_Graphics,y="__apexcharts_unit_layouts__";function b(t){return t&&globalThis[y][t]||null}globalThis[y]||(globalThis[y]={});const _="__apexcharts_unit_marks__";function M(t,e){if("string"==typeof t){const e=t.trim();return e?Object.freeze({name:"anonymous",path:e,viewBox:[0,0,100,100]}):null}if(!t||"object"!=typeof t)return null;if("string"!=typeof t.path||!t.path.trim())return null;const a=Array.isArray(t.viewBox)&&4===t.viewBox.length?t.viewBox.map(Number):[0,0,100,100];return!a.every(t=>isFinite(t))||a[2]<=0||a[3]<=0?null:Object.freeze(c(l({},t),{name:t.name||"anonymous",path:t.path.trim(),viewBox:a,fillRule:"evenodd"===t.fillRule?"evenodd":void 0}))}function A(t){return t&&globalThis[_][t]||null}globalThis[_]||(globalThis[_]={});const w=globalThis.ApexCharts.__internals.__apex_Utils,S=globalThis.ApexCharts.__internals.__apex_Environment_Environment,R=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs,k=globalThis.ApexCharts.__internals;k.__apex_Animations,k.__apex_Animations_computeStagger,k.__apex_Animations_applyAnimationPolicy;const v=k.__apex_Animations_prefersReducedMotion;k.__apex_Animations_applyProgressiveReveal;const F=Math.PI*(3-Math.sqrt(5));function E(t){return 1-Math.pow(1-t,3)}function C(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}function T(t,e){const[a,i]=null!=(r=x[null!=(s=t)?s:"crisp"])?r:x.crisp;var s,r;const n=800/Math.max(1,e);return[a*n*n,i*n]}h.use({unit:class{constructor(t,e){this.ctx=e,this.w=t,this._lastDotR=1,this._gridTrack=null,this._gridDenom=1,this._scatterAxis=null,this._specCache=new Map,this._markWarned=null}draw(t){const e=this.w,a=new g(e,this.ctx),i=a.group({class:"apexcharts-unit"});if(e.globals.noData||!Array.isArray(t)||0===t.length)return i;const s=e.config.plotOptions.unit,r="packed"===s.layout?"packed":"columns"===s.layout?"columns":"grid"===s.layout?"grid":"scatter"===s.layout?"scatter":"arc"===s.layout?"arc":"custom"===s.layout?"custom":"grouped",n=s.transition,o="flow"===n,h="identity"===n,u=s.unitValue>0?s.unitValue:1;let d=t.map(t=>{const e=Math.abs(w.parseNumber(t))/u;return e>0?Math.max(1,Math.round(e)):0});d=this._applyMaxUnits(d,s.maxUnits);const p=d.reduce((t,e)=>t+e,0),f="packed"===r?this._layoutPacked(d,s):"columns"===r?this._layoutColumns(d,s):"grid"===r?this._layoutGrid(d,s):"scatter"===r?this._layoutScatter(s):"arc"===r?this._layoutArc(d,s):"custom"===r?this._layoutCustom(d,s):this._layoutGrouped(d,s),m="grid"===r&&!(!s.grid||!s.grid.split);m&&this._drawGridTrack(i,a,s),"scatter"===r&&this._drawScatterAxes(i,a);const x=this._lastDotR,y=this._shouldAnimate(),b=this.ctx&&this.ctx.morphTypeChange,_=y&&!!b&&"function"==typeof b.isActive&&b.isActive()&&"function"==typeof b.getInitialSlotFor,M=_&&"function"==typeof b.usesPieceTakeover&&b.usesPieceTakeover(),A=y&&!_&&this.ctx?this.ctx._unitPrevDots:null,S=this.ctx&&this.ctx._unitPieces;S&&(this.ctx._unitPieces=null,A&&S.querySelectorAll("rect").forEach(t=>{const e=t.getAttribute("data-key"),a=A.get(e),i=e=>+t.getAttribute(e);a&&A.set(e,c(l({},a),{x:i("x")+i("width")/2,y:i("y")+i("height")/2,r:Math.min(i("width"),i("height"))/2,fill:t.getAttribute("fill")}))}));const R=new Map,k=[],v=e.seriesData.unitData||[],F=this._bubbleStats(v,s,x);let E=0;if(f.forEach(t=>{const n=e.globals.colors[t.i]||e.globals.colors[0]||"#008FFB",l=a.group({class:"apexcharts-series",seriesName:w.escapeString(e.seriesData.seriesNames[t.i]||`series-${t.i+1}`),rel:t.i+1,"data:realIndex":t.i}),c=t.dots.length,u=v[t.i];if(t.dots.forEach((e,i)=>{const r=null!=e.j?e.j:i,d=u?u[r]:void 0,p=d&&"object"==typeof d&&d.fillColor?d.fillColor:n,f=null!=e.r?e.r:F?this._radiusForValue(this._unitValueOf(d),F):x,g=this._markSpecFor(s,d,t.i,f),w=this._drawDot(a,s,f,p,t.i,r,g);let S;if(l.add(w),h){const t=d&&"object"==typeof d?null!=d.id?d.id:d.name:void 0;S=null!=t?`id:${t}`:`g:${E}`}else S=o?String(E):null!=e.slot?`slot:${e.slot}`:`${t.i}:${r}`;if(E++,R.set(S,{x:e.x,y:e.y,fill:p,r:f,spec:g}),M)this._place(w.node,g,e.x,e.y),w.node.setAttribute("opacity","0"),w.node.setAttribute("data-piece-hidden","1"),w.node.setAttribute("data-key",S);else if(y){const a=A&&A.get(S),i=a||(_?b.getInitialSlotFor(t.i,r,c):null),n=s.gather&&s.gather.enter||"burst",o=m||"fade"===n||"rise"===n,l=i?i.x:o?e.x:t.cx,h=i?i.y:"rise"!==n||m?o?e.y:t.cy:e.y+14;w.node.style.opacity=i?"1":"0",this._place(w.node,g,l,h),k.push({node:w.node,spec:g,x:e.x,y:e.y,cx0:l,cy0:h,key:S,r0:a&&null!=a.r?a.r:f,r1:f,fill0:a?a.fill:p,fill1:p,delay:0,isEnter:!i})}else this._place(w.node,g,e.x,e.y)}),("grouped"===r||"columns"===r||m)&&s.clusterLabels&&s.clusterLabels.show&&d[t.i]>0){const e=m?this._gridDenom:p;this._drawClusterLabel(l,t,d[t.i],e,s,n)}i.add(l)}),this._outerLabelsOn(s)&&this._drawOuterLabels(i,f,d,p,s,y&&!A),A){const t=this._collectExits(A,R,s);if(t.length){const e=a.group({class:"apexcharts-unit-exits"});i.add(e),this._runExits(e,t,s)}}return this.ctx&&(this.ctx._unitPrevDots=R),!this.ctx||y&&!_||(this.ctx._unitSprings=null),y&&k.length?this._runGather(k):e.globals.animationEnded=!0,i}_applyMaxUnits(t,e){const a=t.reduce((t,e)=>t+e,0);if(!e||e<=0||a<=e)return t;const i=e/a;return console.warn(`[ApexCharts] unit chart: ${a} dots exceeds maxUnits (${e}); counts were scaled down proportionally. Raise plotOptions.unit.maxUnits or use plotOptions.unit.unitValue to represent more units per dot.`),t.map(t=>t>0?Math.max(1,Math.round(t*i)):0)}_layoutCustom(t,e){const a=this.w,i=a.layout.gridWidth,s=a.layout.gridHeight,r=t.reduce((t,e)=>t+e,0),n=this._resolveLayoutProvider(e);if(!n)return console.warn("[ApexCharts] unit chart: layout 'custom' needs plotOptions.unit.positions (a function, or the name of a layout registered with ApexCharts.registerUnitLayout). Falling back to 'grouped'."),this._layoutGrouped(t,e);const o=this._outerLabelsOn(e)?this._outerLabelGutter(t,e):0;this._lastOuterGutter=o;const l={x:o,y:0,width:Math.max(1,i-2*o),height:s},c=Math.sqrt(l.width*l.height/Math.PI),h=this._resolveStep(e,c,r);this._lastDotR=this._dotRadiusFromStep(h,e);const u=this._lastDotR,d=this._layoutObjects(t,u);let p;try{p=n(d,l)}catch(a){return console.warn("[ApexCharts] unit chart: the layout provider threw; falling back to 'grouped'.",a),this._layoutGrouped(t,e)}if(!Array.isArray(p))return console.warn("[ApexCharts] unit chart: the layout provider must return an array of {id, x, y}; falling back to 'grouped'."),this._layoutGrouped(t,e);const f=new Map;p.forEach(t=>{t&&isFinite(t.x)&&isFinite(t.y)&&f.set(String(t.id),{x:t.x,y:t.y,r:"number"==typeof t.r&&t.r>0?t.r:void 0})});const m=t.map((t,e)=>({i:e,cx:i/2,cy:s/2,outerR:u,dots:[]}));return d.forEach(t=>{const e=f.get(t.id);e&&m[t.seriesIndex].dots.push({x:e.x,y:e.y,r:e.r,j:t.dataPointIndex})}),m.forEach(t=>{if(!t.dots.length)return;let e=0,a=0;t.dots.forEach(t=>{e+=t.x,a+=t.y}),t.cx=e/t.dots.length,t.cy=a/t.dots.length;let i=0;t.dots.forEach(e=>{i=Math.max(i,Math.hypot(e.x-t.cx,e.y-t.cy))}),t.outerR=i+u}),m}_layoutObjects(t,e){const a=this.w,i=a.seriesData.unitData||[],s=a.seriesData.seriesNames||[],r=[];let n=0;return t.forEach((t,a)=>{var o;const l=i[a];for(let i=0;i<t;i++){const t=l?l[i]:void 0,c=!t||"object"!=typeof t||null==t.id&&null==t.name?`${a}:${i}`:String(null!=t.id?t.id:t.name);r.push({id:c,index:n,seriesIndex:a,dataPointIndex:i,label:s[a],value:null!=(o=this._unitValueOf(t))?o:void 0,datum:t,r:e}),n++}}),r}_resolveLayoutProvider(t){const e=t.positions;if("function"==typeof e)return e;if("string"==typeof e&&e){const t=b(e);if(t)return t;console.warn(`[ApexCharts] unit chart: no layout named "${e}" is registered. Register one with ApexCharts.registerUnitLayout("${e}", fn).`)}return null}_layoutGrouped(t,e){const a=this.w,i=a.layout.gridWidth,s=a.layout.gridHeight,r=e.clusterLabels&&e.clusterLabels.show?30:6,n=t.map((t,e)=>e).filter(e=>t[e]>0),o=Math.max(1,n.length),l=new Array(t.length).fill(-1);n.forEach((t,e)=>l[t]=e);const c=i/o,h=s-r,u=Math.max(1,...t),d=.08*Math.min(c,h),p=Math.max(4,Math.min(c,h)/2-d),f=this._resolveStep(e,p,u);this._lastDotR=this._dotRadiusFromStep(f,e);const m=this._lastDotR,x=r+h/2,g=t.map(t=>f*Math.sqrt(Math.max(1,t))+m);let y=t.map((t,e)=>(t=>l[t]>=0?c*(l[t]+.5):i/2)(e));const b=n.map(t=>g[t]);let _=!1;for(let t=1;t<o;t++)if(y[n[t]]-y[n[t-1]]<b[t]+b[t-1]){_=!0;break}if(_){const e=Math.max(2*m,8),a=b.reduce((t,e)=>t+2*e,0)+e*(o-1);let s;if(a<=i){let t=(i-a)/2;s=b.map(a=>{const i=t+a;return t+=2*a+e,i})}else if(1===o)s=[i/2];else{const t=b[0],e=i-b[o-1];s=b.map((a,i)=>t+(e-t)*i/(o-1))}y=t.map((t,e)=>l[e]>=0?s[l[e]]:i/2)}return t.map((t,e)=>({i:e,cx:y[e],cy:x,outerR:g[e],dots:this._spiral(y[e],x,t,f,0)}))}_layoutPacked(t,e){const a=this.w,i=a.layout.gridWidth,s=a.layout.gridHeight,r=Math.max(1,t.reduce((t,e)=>t+e,0)),n=Math.max(4,Math.min(i,s-6)/2-.06*Math.min(i,s)),o=this._resolveStep(e,n,r);this._lastDotR=this._dotRadiusFromStep(o,e);const l=i/2,c=6+(s-6)/2,h=t.map((t,e)=>e);!1!==e.sortByGroup&&h.sort((e,a)=>t[e]-t[a]);const u=t.map((t,e)=>({i:e,cx:l,cy:c,outerR:o*Math.sqrt(r)+this._lastDotR,dots:[]}));let d=0;return h.forEach(e=>{for(let a=0;a<t[e];a++){const t=o*Math.sqrt(d+.5),a=d*F;u[e].dots.push({x:l+t*Math.cos(a),y:c+t*Math.sin(a),slot:d}),d++}}),u}_layoutArc(t,e){const a=this.w,i=a.layout.gridWidth,s=a.layout.gridHeight,r=Math.max(1,t.reduce((t,e)=>t+e,0)),n=e.arc||{},o="number"==typeof n.startAngle?n.startAngle:-90,l="number"==typeof n.endAngle?n.endAngle:90,c=o*Math.PI/180,h=l*Math.PI/180,u=h-c||Math.PI,d=Math.max(0,Math.min(.95,"number"==typeof n.innerRadiusRatio?n.innerRadiusRatio:.4)),p=t=>Math.sin(t),f=t=>-Math.cos(t),m=this._arcBounds(c,h),x=.04*Math.min(i,s),g=Math.max(1e-6,m.maxX-m.minX),y=Math.max(1e-6,m.maxY-m.minY),b=Math.max(4,Math.min((i-2*x)/g,(s-2*x)/y)),_=b*d,M=i/2-(m.minX+m.maxX)/2*b,A=s/2-(m.minY+m.maxY)/2*b,w=this._arcAllocate(r,_,b,u,e);this._lastDotR=w.dotR;const S=[];for(let t=0;t<w.R;t++){const e=w.radii[t],a=w.seatsPerRow[t];for(let t=0;t<a;t++){const i=1===a?(c+h)/2:c+u*(t+.5)/a;S.push({a:i,x:M+e*p(i),y:A+e*f(i)})}}S.sort((t,e)=>t.a-e.a);const R=t.map((t,e)=>({i:e,cx:M,cy:A,outerR:b,dots:[]}));let k=0,v=0;return S.forEach((e,a)=>{for(;k<t.length&&v>=t[k];)k++,v=0;k>=t.length||(R[k].dots.push({x:e.x,y:e.y,slot:a}),v++)}),R}_arcBounds(t,e){const a=t=>Math.sin(t),i=t=>-Math.cos(t),s=Math.min(t,e),r=Math.max(t,e),n=[0,a(t),a(e)],o=[0,i(t),i(e)],l=Math.PI/2;for(let t=Math.ceil(s/l);t*l<=r;t++)n.push(a(t*l)),o.push(i(t*l));return{minX:Math.min(...n),maxX:Math.max(...n),minY:Math.min(...o),maxY:Math.max(...o)}}_arcAllocate(t,e,a,i,s){const r=s.spacing>0?s.spacing:1.05,n=Math.abs(i)||Math.PI,o=this._fixedRadius(s),l=i=>{i=Math.max(1,Math.round(i));const s=[];for(let t=0;t<i;t++)s.push(1===i?(e+a)/2:e+t/(i-1)*(a-e));const o=s.reduce((t,e)=>t+e,0)||1,l=s.map(e=>t*e/o),c=l.map(t=>Math.floor(t));let h=t-c.reduce((t,e)=>t+e,0);for(l.map((t,e)=>({idx:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac).forEach(t=>{h>0&&(c[t.idx]++,h--)});h>0;)c[i-1]++,h--;const u=1===i?a-e||a:(a-e)/(i-1);let d=1/0;for(let t=0;t<i;t++){const e=c[t];if(e<=0)continue;const a=s[t]*n/e;a<d&&(d=a)}const p=Math.min(u,d);return{R:i,radii:s,seatsPerRow:c,dotR:Math.max(1,p/(2*r))}},c=s.arc&&s.arc.rows;let h;if("number"==typeof c&&c>=1)h=l(c);else if(o)h=l((a-e)/(2*o*r)+1);else{const e=Math.max(1,Math.min(40,Math.ceil(Math.sqrt(t))+6));h=l(1);for(let t=2;t<=e;t++){const e=l(t);e.dotR>h.dotR&&(h=e)}}return o&&(h.dotR=o),h}_layoutColumns(t,e){const a=this.w,i=a.layout.gridWidth,s=a.layout.gridHeight,r=!(!e.clusterLabels||!e.clusterLabels.show),n=r&&"bottom"===e.clusterLabels.position,o=r&&!n?30:6,l=t.map((t,e)=>e).filter(e=>t[e]>0),c=Math.max(1,l.length),h=new Array(t.length).fill(-1);l.forEach((t,e)=>h[t]=e);const u=i/c,d=.62*u,p=Math.max(8,.04*s)+(n?30:0),f=Math.max(4,s-o-p),m=Math.max(1,...t),x=e.spacing>0?e.spacing:1,g=e.columns?e.columns.size:void 0;let y;y="image"!==e.shape&&"auto"===g?null:"image"!==e.shape&&"number"==typeof g&&g>0?g:this._fixedRadius(e);let b=1,_=0;if(y){_=2*y*x,this._lastDotR=y;const t=Math.max(1,Math.floor(f/_)),e=Math.max(1,Math.floor(d/_));b=Math.max(1,Math.min(e,Math.ceil(m/t)))}else{let t=0;const e=Math.max(1,Math.min(40,Math.round(d/4)));for(let a=1;a<=e;a++){const e=Math.ceil(m/a),i=Math.min(d/a,f/e);i>t&&(t=i,b=a)}_=t,this._lastDotR=Math.max(1,_/(2*x))}const M=this._lastDotR,A=Math.ceil(m/b),w=o+(f+Math.min(f,A*_))/2;return t.map((t,e)=>{const a=h[e]>=0?u*(h[e]+.5):i/2,s=Math.ceil(Math.max(1,t)/b)*_,r=a-b*_/2+_/2,n=[];for(let e=0;e<t;e++){const t=Math.floor(e/b),a=e%b;n.push({x:r+a*_,y:w-M-t*_})}return{i:e,cx:a,cy:w-s/2,outerR:s/2,flat:!0,dots:n}})}_layoutGrid(t,e){if(e.grid&&e.grid.split)return this._layoutGridSplit(t,e);this._gridTrack=null;const a=this.w,i=a.layout.gridWidth,s=a.layout.gridHeight,r=e.grid||{},n=Math.max(1,Math.round(r.columns>0?r.columns:10)),o="top"===r.fillFrom?"top":"bottom",l=r.total>0?this._largestRemainder(t,Math.round(r.total)):t.slice(),c=l.reduce((t,e)=>t+e,0),h=Math.max(1,Math.ceil(Math.max(1,c)/n)),u=e.spacing>0?e.spacing:1,d=Math.max(4,i),p=Math.max(4,s-6),f=this._fixedRadius(e);let m=0;f?(m=2*f*u,this._lastDotR=f):(m=Math.min(d/n,p/h),this._lastDotR=Math.max(1,m/(2*u)));const x=n*m,g=h*m,y=(i-x)/2+m/2,b=6+(p-g)/2,_=t=>"bottom"===o?b+g-m/2-t*m:b+m/2+t*m,M=t.map((t,e)=>({i:e,cx:i/2,cy:6+p/2,outerR:Math.max(x,g)/2,dots:[]}));let A=0;for(let t=0;t<l.length;t++)for(let e=0;e<l[t];e++){const e=A%n,a=Math.floor(A/n);M[t].dots.push({x:y+e*m,y:_(a),slot:A}),A++}return M}_layoutGridSplit(t,e){const a=this.w,i=a.layout.gridWidth,s=a.layout.gridHeight,r=e.grid||{},n=Math.max(1,Math.round(r.columns>0?r.columns:10)),o="top"===r.fillFrom?"top":"bottom",l=Math.max(1,Math.round(r.total>0?r.total:100)),c=Math.max(1,Math.ceil(l/n)),h=t.map((t,e)=>e).filter(e=>t[e]>0),u=Math.max(1,h.length),d=r.max>0?r.max:Math.max(1,...t),p=Math.max(1,Math.round(r.tileColumns>0?r.tileColumns:Math.ceil(Math.sqrt(u)))),f=Math.max(1,Math.ceil(u/p)),m=!(e.clusterLabels&&!1===e.clusterLabels.show),x=m&&e.clusterLabels&&"bottom"===e.clusterLabels.position,g=m&&!x?22:4,y=m&&x?22:4,b=i/p,_=s/f,M=Math.max(4,.86*b),A=Math.max(4,_-g-y),w=e.spacing>0?e.spacing:1,S=this._fixedRadius(e);let R=0;S?(R=2*S*w,this._lastDotR=S):(R=Math.min(M/n,A/c),this._lastDotR=Math.max(1,R/(2*w)));const k=n*R,v=c*R,F=(t,e)=>"bottom"===o?t+v-R/2-e*R:t+R/2+e*R,E=[],C=[];return h.forEach((e,a)=>{const i=a%p,s=Math.floor(a/p),r=i*b,o=r+(b-k)/2+R/2,c=s*_+g+(A-v)/2,h=t=>({x:o+t%n*R,y:F(c,Math.floor(t/n))});for(let t=0;t<l;t++)E.push(h(t));const u=Math.max(0,Math.min(l,Math.round(t[e]/d*l))),f=[];for(let t=0;t<u;t++){const e=h(t);f.push({x:e.x,y:e.y,slot:a*l+t})}C.push({i:e,cx:r+b/2,cy:c+v/2,outerR:v/2,flat:!0,split:!0,dots:f})}),this._gridDenom=d,this._gridTrack={cells:E},C}_drawGridTrack(t,e,a){const i=this._gridTrack;if(!i||!i.cells||!i.cells.length)return;const s=this._lastDotR,r=(a.grid||{}).trackColor||"rgba(128,128,128,0.14)",n=e.group({class:"apexcharts-unit-track"});i.cells.forEach(t=>{let i;if("square"===a.shape){const n=2*s;i=e.drawRect(0,0,n,n,a.borderRadius||0,r,1,0,"none"),i.node.setAttribute("fill",r),i.node.setAttribute("x",String(t.x-s)),i.node.setAttribute("y",String(t.y-s))}else i=e.drawCircle(s,{fill:r,"stroke-width":0,stroke:"none"}),i.node.setAttribute("fill",r),i.node.setAttribute("cx",String(t.x)),i.node.setAttribute("cy",String(t.y));i.node.classList.add("apexcharts-unit-track-cell"),n.add(i)}),t.add(n)}_layoutScatter(t){const e=this.w,a=t.scatter||{};if("value"===a.y)return this._layoutScatter2D(t);if("vertical"===a.orientation)return this._layoutScatterVertical(t);const i=e.layout.gridWidth,s=e.layout.gridHeight,r=e.seriesData.unitData||[],n=e.seriesData.seriesNames||[],o=t=>this._unitValueOf(t),l=this._scatterSizeStats(a,r),c=r.map(t=>Array.isArray(t)?t.map(o):[]),h=t=>null!=t&&isFinite(t),u=c.map((t,e)=>e).filter(t=>c[t].some(h)),d=Math.max(1,u.length);let p=1/0,f=-1/0;c.forEach(t=>t.forEach(t=>{null!=t&&isFinite(t)&&(t<p&&(p=t),t>f&&(f=t))})),p===1/0&&(p=0,f=1);const m=Math.max(2,Math.round(a.tickAmount>0?a.tickAmount:5)),x=this._scatterValueDomain(a,p,f,m),g=x.min,y=x.max,b=y-g||1,_=null!=a.laneLabelWidth?Math.max(0,a.laneLabelWidth):d>1?92:8,M=30+(a.xTitle?20:0),A=_,w=i-8,S=s-M,R=Math.max(4,w-A),k=Math.max(4,S-10),v=t=>A+(t-g)/b*R,F=k/d;let E=0;const C=this._fixedRadius(t);if(C)E=C;else{const t=Math.max(1,...u.map(t=>c[t].filter(h).length));E=Math.max(2,Math.min(6,.12*F,R/(2.5*Math.sqrt(t))))}this._lastDotR=E;const T=t.spacing>0?t.spacing:1,L=Math.max(.5,E*T),D="jitter"===a.spread,$=[],j=[],B=l?l.rMax:E;u.forEach((t,e)=>{const a=(t=>10+F*(t+.5))(e);j.push({i:t,cy:a,name:n[t]||`series-${t+1}`});const i=(r[t]||[]).map((t,e)=>{const i=o(t),s={j:e,px:v(h(i)?i:g),y:a};return l&&(s.r=this._scatterRadius(t,l,E)),s});if(D){const t=Math.max(B,F/2-B);i.forEach((e,i)=>{const s=(9301*i+49297)%233280/233280;e.y=a+(2*s-1)*t})}else this._beeswarm(i,a,E,L,B);$.push({i:t,cx:(A+w)/2,cy:a,outerR:F/2,dots:i.map(t=>({x:t.px,y:t.y,r:t.r}))})});const z=x.ticks;return this._scatterAxis={mode:"1d",plotL:A,plotR:w,plotT:10,plotB:S,xMin:g,xMax:y,plotX:v,ticks:z,lanes:j,xTitle:a.xTitle,formatter:"function"==typeof a.xFormatter?a.xFormatter:null,gridlines:!1!==a.gridlines},$}_layoutScatterVertical(t){const e=this.w,a=t.scatter||{},i=e.layout.gridWidth,s=e.layout.gridHeight,r=e.seriesData.unitData||[],n=e.seriesData.seriesNames||[],o=t=>this._unitValueOf(t),l=this._scatterSizeStats(a,r),c=r.map(t=>Array.isArray(t)?t.map(o):[]),h=t=>null!=t&&isFinite(t),u=c.map((t,e)=>e).filter(t=>c[t].some(h)),d=Math.max(1,u.length);let p=1/0,f=-1/0;c.forEach(t=>t.forEach(t=>{null!=t&&isFinite(t)&&(t<p&&(p=t),t>f&&(f=t))})),p===1/0&&(p=0,f=1);const m=Math.max(2,Math.round(a.tickAmount>0?a.tickAmount:5)),x=this._scatterValueDomain(a,p,f,m),g=x.min,y=x.max,b=y-g||1,_=46+(a.xTitle?18:0),M=i-10,A=s-(d>1?26:10),w=Math.max(4,M-_),S=Math.max(4,A-10),R=t=>A-(t-g)/b*S,k=w/d;let v=0;const F=this._fixedRadius(t);if(F)v=F;else{const t=Math.max(1,...u.map(t=>c[t].filter(h).length));v=Math.max(2,Math.min(6,.12*k,S/(2.5*Math.sqrt(t))))}this._lastDotR=v;const E=t.spacing>0?t.spacing:1,C=Math.max(.5,v*E),T="jitter"===a.spread,L=[],D=[],$=l?l.rMax:v;u.forEach((t,e)=>{const a=(t=>_+k*(t+.5))(e);D.push({i:t,cx:a,name:n[t]||`series-${t+1}`});const i=(r[t]||[]).map((t,e)=>{const i=o(t),s={j:e,py:R(h(i)?i:g),x:a};return l&&(s.r=this._scatterRadius(t,l,v)),s});if(T){const t=Math.max($,k/2-$);i.forEach((e,i)=>{const s=(9301*i+49297)%233280/233280;e.x=a+(2*s-1)*t})}else this._beeswarm(i,a,v,C,$,!0);L.push({i:t,cx:a,cy:(10+A)/2,outerR:k/2,dots:i.map(t=>({x:t.x,y:t.py,r:t.r}))})});const j=x.ticks;return this._scatterAxis={mode:"1d",orientation:"vertical",plotL:_,plotR:M,plotT:10,plotB:A,vMin:g,vMax:y,plotY:R,ticks:j,lanes:D,valueTitle:a.xTitle,formatter:"function"==typeof a.xFormatter?a.xFormatter:null,gridlines:!1!==a.gridlines},L}_layoutScatter2D(t){const e=this.w,a=e.layout.gridWidth,i=e.layout.gridHeight,s=t.scatter||{},r=e.seriesData.unitData||[],n=t=>"number"==typeof t&&isFinite(t),o=t=>t&&"object"==typeof t?t.x:null,l=t=>t&&"object"==typeof t?null!=t.y?t.y:t.value:null,c=r.map((t,e)=>e).filter(t=>(r[t]||[]).some(t=>n(o(t))&&n(l(t))));let h=1/0,u=-1/0,d=1/0,p=-1/0;r.forEach(t=>(t||[]).forEach(t=>{const e=o(t),a=l(t);n(e)&&n(a)&&(e<h&&(h=e),e>u&&(u=e),a<d&&(d=a),a>p&&(p=a))})),h===1/0&&(h=0,u=1,d=0,p=1);const f=Math.max(2,Math.round(s.tickAmount>0?s.tickAmount:5)),m=Math.max(2,Math.round(s.yTickAmount>0?s.yTickAmount:5)),x=this._niceScale(null!=s.xMin?s.xMin:h,null!=s.xMax?s.xMax:u,f),g=this._niceScale(null!=s.yMin?s.yMin:d,null!=s.yMax?s.yMax:p,m),y=null!=s.xMin?s.xMin:x.min,b=null!=s.xMax?s.xMax:x.max,_=null!=s.yMin?s.yMin:g.min,M=null!=s.yMax?s.yMax:g.max,A=b-y||1,w=M-_||1,S=46+(s.yTitle?18:0),R=30+(s.xTitle?20:0),k=S,v=a-12,F=i-R,E=Math.max(4,v-k),C=Math.max(4,F-10),T=t=>k+(t-y)/A*E,L=t=>F-(t-_)/w*C,D=this._scatterSizeStats(s,r),$=this._fixedRadius(t)||5;this._lastDotR=$;const j=[];c.forEach(t=>{const e=(r[t]||[]).map(t=>{const e=o(t),a=l(t);return{x:T(n(e)?e:y),y:L(n(a)?a:_),r:D?this._scatterRadius(t,D,$):void 0}});j.push({i:t,cx:(k+v)/2,cy:(10+F)/2,outerR:C/2,dots:e})});const B=(t,e,a,i,s,r)=>{const n=[];if(s)for(let e=0;e<r;e++)n.push(t+a*e/(r-1));else{const s=i||a/Math.max(1,r-1);for(let a=t;a<=e+.5*s;a+=s)n.push(Math.abs(a)<1e-9*s?0:a)}return n};return this._scatterAxis={mode:"2d",plotL:k,plotR:v,plotT:10,plotB:F,plotX:T,plotY:L,xTicks:B(y,b,A,x.spacing,null!=s.xMin||null!=s.xMax,f),yTicks:B(_,M,w,g.spacing,null!=s.yMin||null!=s.yMax,m),xTitle:s.xTitle,yTitle:s.yTitle,xFormatter:"function"==typeof s.xFormatter?s.xFormatter:null,yFormatter:"function"==typeof s.yFormatter?s.yFormatter:null,gridlines:!1!==s.gridlines},j}_scatterSizeStats(t,e){const a=t&&t.sizeRange;if(!Array.isArray(a)||a.length<2)return null;const i=Math.max(.5,+a[0]),s=Math.max(i,+a[1]),r=t.sizeField||"z";let n=1/0,o=-1/0;return e.forEach(t=>(t||[]).forEach(t=>{const e=t&&"object"==typeof t?t[r]:null;"number"==typeof e&&isFinite(e)&&(e<n&&(n=e),e>o&&(o=e))})),n===1/0?null:{zmin:n,zmax:o,rMin:i,rMax:s,field:r}}_scatterRadius(t,e,a){if(!e)return a;const i=t&&"object"==typeof t?t[e.field]:null;if("number"!=typeof i||!isFinite(i))return e.rMin;const s=e.zmax>e.zmin?(i-e.zmin)/(e.zmax-e.zmin):1,r=Math.max(0,Math.min(1,s)),n=e.rMin*e.rMin,o=e.rMax*e.rMax;return Math.sqrt(n+r*(o-n))}_beeswarm(t,e,a,i,s,r=!1){const n=r?"py":"px",o=r?"x":"y",l=t.slice().sort((t,e)=>t[n]-e[n]),c=[],h=null!=s?s:a;l.forEach(t=>{const s=null!=t.r?t.r:a;let r=0;for(let a=0;a<2e3;a++){const o=0===a?0:Math.ceil(a/2)*i*(a%2?1:-1),l=e+o;let u=!0;for(let e=c.length-1;e>=0;e--){const a=c[e],i=t[n]-a.f;if(i>s+h)break;const r=s+a.r,o=l-a.s;if(i*i+o*o<r*r){u=!1;break}}if(u){r=o;break}}t[o]=e+r,c.push({f:t[n],s:t[o],r:s})})}_scatterValueDomain(t,e,a,i){const s=(t,e,a)=>{const i=[];for(let s=t;s<=e+.5*a;s+=a)i.push(Math.abs(s)<1e-9*a?0:s);return i};if(null!=t.xMin||null!=t.xMax){let r=null!=t.xMin?t.xMin:e,n=null!=t.xMax?t.xMax:a;n>r||(n=r+1);const o=(n-r)/Math.max(1,i-1);return e<r&&(r-=Math.ceil((r-e)/o)*o),a>n&&(n+=Math.ceil((a-n)/o)*o),{min:r,max:n,ticks:s(r,n,o)}}const r=this._niceScale(e,a,i),n=r.spacing||(r.max-r.min)/Math.max(1,i-1);return{min:r.min,max:r.max,ticks:s(r.min,r.max,n)}}_niceScale(t,e,a){const i=t;let s=e;s>i||(s=i+1);const r=this._niceNum(s-i,!1),n=this._niceNum(r/Math.max(1,a-1),!0);return{min:Math.floor(i/n)*n,max:Math.ceil(s/n)*n,spacing:n}}_niceNum(t,e){const a=t>0?t:1,i=Math.floor(Math.log(a)/Math.LN10),s=a/Math.pow(10,i);let r;return r=e?s<1.5?1:s<3?2:s<7?5:10:s<=1?1:s<=2?2:s<=5?5:10,r*Math.pow(10,i)}_drawScatterAxes(t,e){const a=this.w;if(!S.isBrowser())return;const i=this._scatterAxis;if(!i)return;const s="http://www.w3.org/2000/svg",r=e.group({class:"apexcharts-unit-axis"}),n=a.config.grid&&a.config.grid.borderColor||"rgba(128,128,128,0.18)",o="rgba(128,128,128,0.5)",l=a.config.xaxis&&a.config.xaxis.labels&&a.config.xaxis.labels.style&&a.config.xaxis.labels.style.colors,c=Array.isArray(l)?l[0]:l,h=c||"rgba(120,130,140,0.9)",u=(t,e,a,i,n)=>{const o=R.createElementNS(s,"line");o.setAttribute("x1",String(t)),o.setAttribute("y1",String(e)),o.setAttribute("x2",String(a)),o.setAttribute("y2",String(i)),o.setAttribute("stroke",n),o.setAttribute("shape-rendering","crispEdges"),r.node.appendChild(o)},d=(t,e,i,n,o,l,c,h)=>{const u=R.createElementNS(s,"text");u.setAttribute("class",h),u.setAttribute("x",String(e)),u.setAttribute("y",String(i)),u.setAttribute("text-anchor",n),u.setAttribute("dominant-baseline","middle"),u.setAttribute("font-size",`${l}px`),u.setAttribute("font-family",a.config.chart.fontFamily||"inherit"),u.setAttribute("font-weight",String(c)),u.setAttribute("fill",o),u.textContent=t,r.node.appendChild(u)};if("2d"!==i.mode){if("vertical"===i.orientation){if(i.ticks.forEach(t=>{const e=i.plotY(t);i.gridlines&&u(i.plotL,e,i.plotR,e,n);const a=i.formatter?String(i.formatter(t)):this._formatTick(t);d(a,i.plotL-8,e,"end",h,11,400,"apexcharts-unit-tick")}),u(i.plotL,i.plotT,i.plotL,i.plotB,o),i.valueTitle){const t=R.createElementNS(s,"text");t.setAttribute("class","apexcharts-unit-axis-title");const e=14,n=(i.plotT+i.plotB)/2;t.setAttribute("x",String(e)),t.setAttribute("y",String(n)),t.setAttribute("text-anchor","middle"),t.setAttribute("font-size","12px"),t.setAttribute("font-family",a.config.chart.fontFamily||"inherit"),t.setAttribute("font-weight","600"),t.setAttribute("fill",h),t.setAttribute("transform",`rotate(-90 ${e} ${n})`),t.textContent=String(i.valueTitle),r.node.appendChild(t)}return i.lanes.forEach(t=>{const e=c||a.globals.colors[t.i]||a.globals.colors[0]||"#008FFB";d(t.name,t.cx,i.plotB+16,"middle",e,12,600,"apexcharts-unit-lane-label")}),void t.add(r)}i.ticks.forEach((t,e)=>{const a=i.plotX(t);i.gridlines&&u(a,i.plotT,a,i.plotB,n);const s=i.formatter?String(i.formatter(t)):this._formatTick(t),r=0===e?"start":e===i.ticks.length-1?"end":"middle";d(s,a,i.plotB+14,r,h,11,400,"apexcharts-unit-tick")}),u(i.plotL,i.plotB,i.plotR,i.plotB,o),i.xTitle&&d(String(i.xTitle),(i.plotL+i.plotR)/2,i.plotB+32,"middle",h,12,600,"apexcharts-unit-axis-title"),i.plotL>12&&i.lanes.forEach(t=>{const e=c||a.globals.colors[t.i]||a.globals.colors[0]||"#008FFB";d(t.name,i.plotL-8,t.cy,"end",e,12,600,"apexcharts-unit-lane-label")}),t.add(r)}else{if(i.yTicks.forEach(t=>{const e=i.plotY(t);i.gridlines&&u(i.plotL,e,i.plotR,e,n);const a=i.yFormatter?String(i.yFormatter(t)):this._formatTick(t);d(a,i.plotL-8,e,"end",h,11,400,"apexcharts-unit-tick")}),i.xTicks.forEach(t=>{const e=i.plotX(t);i.gridlines&&u(e,i.plotT,e,i.plotB,n);const a=i.xFormatter?String(i.xFormatter(t)):this._formatTick(t);d(a,e,i.plotB+14,"middle",h,11,400,"apexcharts-unit-tick")}),u(i.plotL,i.plotB,i.plotR,i.plotB,o),u(i.plotL,i.plotT,i.plotL,i.plotB,o),i.xTitle&&d(String(i.xTitle),(i.plotL+i.plotR)/2,i.plotB+32,"middle",h,12,600,"apexcharts-unit-axis-title"),i.yTitle){const t=R.createElementNS(s,"text");t.setAttribute("class","apexcharts-unit-axis-title");const e=14,n=(i.plotT+i.plotB)/2;t.setAttribute("x",String(e)),t.setAttribute("y",String(n)),t.setAttribute("text-anchor","middle"),t.setAttribute("font-size","12px"),t.setAttribute("font-family",a.config.chart.fontFamily||"inherit"),t.setAttribute("font-weight","600"),t.setAttribute("fill",h),t.setAttribute("transform",`rotate(-90 ${e} ${n})`),t.textContent=String(i.yTitle),r.node.appendChild(t)}t.add(r)}}_formatTick(t){if(!isFinite(t))return"";const e=Math.abs(t);return e>=1e6?+(t/1e6).toFixed(1)+"M":e>=1e4?+(t/1e3).toFixed(1)+"k":Number.isInteger(t)?String(t):String(+t.toFixed(2))}_largestRemainder(t,e){const a=t.reduce((t,e)=>t+e,0);if(a<=0||e<=0)return t.map(()=>0);const i=t.map(t=>t/a*e),s=i.map(t=>Math.floor(t)),r=s.reduce((t,e)=>t+e,0),n=Math.max(0,e-r),o=i.map((t,e)=>({i:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac),l=s.slice();for(let t=0;t<n&&t<o.length;t++)l[o[t].i]++;return l}_spiral(t,e,a,i,s){const r=[];for(let n=0;n<a;n++){const a=s+n,o=i*Math.sqrt(a+.5),l=a*F;r.push({x:t+o*Math.cos(l),y:e+o*Math.sin(l)})}return r}_fixedRadius(t){return"image"===t.shape&&t.image?Math.max(t.image.width||20,t.image.height||20)/2:this._bubbleActive(t)&&"number"==typeof t.sizeByValue.maxRadius?t.sizeByValue.maxRadius>0?t.sizeByValue.maxRadius:null:"number"==typeof t.size&&t.size>0?t.size:null}_bubbleActive(t){const e=t.sizeByValue;return!(!e||!e.enabled||"image"===t.shape||"square"===t.shape)}_unitValueOf(t){if("number"==typeof t)return t;if(t&&"object"==typeof t){const e=null!=t.value?t.value:t.y;return"number"==typeof e?e:null}return null}_radiusForValue(t,e){if(null==t||!isFinite(t))return e.minR;const a=e.max>e.min?(t-e.min)/(e.max-e.min):1,i=Math.max(0,Math.min(1,a));if("linear"===e.scale)return e.minR+i*(e.maxR-e.minR);const s=e.minR*e.minR,r=e.maxR*e.maxR;return Math.sqrt(s+i*(r-s))}_bubbleStats(t,e,a){if(!this._bubbleActive(e))return null;let i=1/0,s=-1/0;if(t.forEach(t=>{t&&t.forEach(t=>{const e=this._unitValueOf(t);null!=e&&isFinite(e)&&(e<i&&(i=e),e>s&&(s=e))})}),i===1/0||s<i)return null;const r=e.sizeByValue,n=a,o=Math.max(1,Math.min(n,"number"==typeof r.minRadius?r.minRadius:.35*n));return{min:i,max:s,minR:o,maxR:n,scale:"linear"===r.scale?"linear":"area"}}_resolveStep(t,e,a){const i=t.spacing>0?t.spacing:1,s=this._fixedRadius(t);return s?2*s*i:e/(Math.sqrt(Math.max(1,a))+.5)}_dotRadiusFromStep(t,e){const a=e.spacing>0?e.spacing:1,i=this._fixedRadius(e);return i||Math.max(1,t/(2*a))}_isCorner(t){return"square"===t.shape||"image"===t.shape}_halfExtent(t,e){if("image"===t.shape&&t.image)return{hx:(t.image.width||20)/2,hy:(t.image.height||20)/2};const a=null!=e?e:this._lastDotR;return{hx:a,hy:a}}_place(t,e,a,i){const s=e;2===s.pk?t.setAttribute("transform","translate("+(a-s.ox)+","+(i-s.oy)+s.tail):1===s.pk?(t.setAttribute("x",String(a-s.hx)),t.setAttribute("y",String(i-s.hy))):(t.setAttribute("cx",String(a)),t.setAttribute("cy",String(i)))}_baseSpec(t,e){const a=null!=e?e:this._lastDotR;if(!this._isCorner(t))return{pk:0,r:a};const{hx:i,hy:s}=this._halfExtent(t,a);return{pk:1,hx:i,hy:s,r:a}}_resolveMark(t){if(null==t)return null;if("object"==typeof t)return M(t);if("string"!=typeof t||!t)return null;const e=t.trim();if("M"===e[0]||"m"===e[0])return M(e);const a=A(e);return a||(this._markWarned||(this._markWarned=new Set),this._markWarned.has(e)||(this._markWarned.add(e),console.warn(`[ApexCharts] unit chart: no mark named "${e}" is registered. Register one with ApexCharts.registerUnitMark("${e}", pathData), or import a catalog from 'apexcharts/pictograms'.`)),null)}_glyphSpec(t,e,a){const i=Math.round(10*e)/10,s=t.name+"|"+t.path.length+"|"+i,r=this._specCache.get(s);if(r)return r;const n=t.viewBox||[0,0,100,100],o=2*i*(1-Math.max(0,Math.min(.9,a.padding||0)))*("number"==typeof a.scale&&a.scale>0?a.scale:1),l="width"===a.fit?o/n[2]:"height"===a.fit?o/n[3]:o/Math.max(n[2],n[3]),c=Object.freeze({pk:2,mark:t,d:t.path,fillRule:t.fillRule,s:l,ox:(n[0]+n[2]/2)*l,oy:(n[1]+n[3]/2)*l,tail:") scale("+l+")",r:i});return this._specCache.set(s,c),c}_markSpecFor(t,e,a,i){if("pictogram"!==t.shape)return this._baseSpec(t,i);const s=t.pictogram||{},r=e&&"object"==typeof e?e.mark:void 0,n=Array.isArray(s.mark)?s.mark[a%s.mark.length]:s.mark,o=this._resolveMark(null!=r?r:n);return o?this._glyphSpec(o,i,s):this._baseSpec(c(l({},t),{shape:"square"===s.fallback?"square":"circle"}),i)}_drawDot(t,e,a,i,s,r,n){const o=this.w,l=o.config.stroke.show?o.config.stroke.width:0,c=Array.isArray(o.globals.stroke.colors)&&o.globals.stroke.colors[s]||"none",h="number"==typeof o.config.fill.opacity?o.config.fill.opacity:1;let u;if(n&&2===n.pk)u=o.dom.Paper.path(n.d),u.node.setAttribute("fill",i),"evenodd"===n.fillRule&&u.node.setAttribute("fill-rule","evenodd"),h<1&&u.node.setAttribute("fill-opacity",String(h)),u.node.setAttribute("data:r",String(n.r));else if("image"===e.shape&&e.image&&e.image.src){const t=e.image.width||20,a=e.image.height||20;u=o.dom.Paper.image(e.image.src),u.node.setAttribute("width",String(t)),u.node.setAttribute("height",String(a)),u.node.setAttribute("preserveAspectRatio","xMidYMid meet"),e.image.tint&&u.node.setAttribute("filter",`url(#${this._tintFilter(i)})`)}else if("square"===e.shape){const s=2*a;u=t.drawRect(0,0,s,s,e.borderRadius||0,i,1,l,c),u.node.setAttribute("fill",i),h<1&&u.node.setAttribute("fill-opacity",String(h))}else u=t.drawCircle(a,{fill:i,"stroke-width":l,stroke:c}),u.node.setAttribute("fill",i),h<1&&u.node.setAttribute("fill-opacity",String(h));return u.node.classList.add("apexcharts-unit-area"),u.node.setAttribute("i",String(s)),u.node.setAttribute("j",String(r)),u}_tintFilter(t){const e=this.w,a="http://www.w3.org/2000/svg",i=String(t).replace(/[^a-zA-Z0-9]/g,""),s=`apexcharts-unit-tint-${e.globals.chartID}-${i}`,r=e.dom.Paper.node;if(r.querySelector(`#${s}`))return s;let n=r.querySelector("defs");n||(n=R.createElementNS(a,"defs"),r.insertBefore(n,r.firstChild));const o=R.createElementNS(a,"filter");o.setAttribute("id",s),o.setAttribute("x","0%"),o.setAttribute("y","0%"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const l=R.createElementNS(a,"feFlood");l.setAttribute("flood-color",t),l.setAttribute("result","flood");const c=R.createElementNS(a,"feComposite");return c.setAttribute("in","flood"),c.setAttribute("in2","SourceAlpha"),c.setAttribute("operator","in"),o.appendChild(l),o.appendChild(c),n.appendChild(o),s}_placeDot(t,e,a,i,s){this._place(t,s||this._baseSpec(e),a,i)}_rgb(t){if("string"!=typeof t)return null;let e=t.trim();if("#"===e[0]){4===e.length&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const t=parseInt(e.slice(1,7),16);return isNaN(t)?null:[t>>16&255,t>>8&255,255&t]}const a=e.match(/rgba?\(([^)]+)\)/);if(a){const t=a[1].split(",").map(t=>parseFloat(t));if(t.length>=3&&t.every(t=>!isNaN(t)))return[t[0],t[1],t[2]]}return null}_shouldAnimate(){const t=this.w,e=t.config.chart.animations;return!(!S.isBrowser()||!e||!1===e.enabled||!1===t.globals.shouldAnimate||t.globals.resized&&!t.globals.dataChanged||e.respectReducedMotion&&v())}_seedSprings(t,e,a){const[i,s]=T(e.spring,a),r=this.ctx?this.ctx._unitSprings:null,n=new Map;for(let e=0;e<t.length;e++){const a=t[e],o=r&&!a.isEnter&&null!=a.key?r.get(a.key):null,l=o?o.x:d(a.cx0,i,s),c=o?o.y:d(a.cy0,i,s);o&&(l.stiffness=i,c.stiffness=i,l.damping=s,c.damping=s,a.cx0=l.value,a.cy0=c.value,this._place(a.node,a.spec,a.cx0,a.cy0),0===l.velocity&&0===c.velocity||(a.delay=0)),a.sx=l,a.sy=c,null!=a.key&&n.set(a.key,{x:l,y:c})}this.ctx&&(this.ctx._unitSprings=n)}_runGather(t){const e=this.w,a=e.config.plotOptions.unit,i=Math.max(1,e.config.chart.animations.speed||800),s=Math.min(.6*i,450),r=t.length;for(let e=0;e<r;e++)t[e].delay=r>1?e/(r-1)*s:0;const n=a.gather||{},o=n.motion||"auto";"spring"!==o&&("auto"!==o||n.easing&&"outCubic"!==n.easing)?this.ctx&&(this.ctx._unitSprings=null):this._seedSprings(t,n,i);for(let e=0;e<r;e++){const a=t[e];0===a.spec.pk&&null!=a.r0&&null!=a.r1&&a.r0!==a.r1&&a.node.setAttribute("r",String(a.r0))}for(let e=0;e<r;e++){const a=t[e];a.fill0&&a.fill1&&a.fill0!==a.fill1&&(a._c0=this._rgb(a.fill0),a._c1=this._rgb(a.fill1))}const l="outBack"===n.easing?(c="number"==typeof n.overshoot?n.overshoot:1.70158,t=>1+(c+1)*Math.pow(t-1,3)+c*Math.pow(t-1,2)):"inOutCubic"===n.easing?C:E;var c;null!=this.w.globals.unitGatherRAF&&(R.cancelAnimationFrame(this.w.globals.unitGatherRAF),this.w.globals.unitGatherRAF=null);const h=performance.now();let u=h;const d=e=>{if(this.w.globals.isDestroyed)return this.w.globals.unitGatherRAF=null,void(this.w.globals.animationEnded=!0);const a=Math.min(.25,Math.max(0,(e-u)/1e3));u=e;let s=!0;for(let n=0;n<r;n++){const r=t[n],o=e-h-r.delay,c=Math.max(0,Math.min(1,o/i)),u=E(c);let d,m;if(r.sx&&r.sy){o>=0&&!r.released&&(f(r.sx,r.x),f(r.sy,r.y),r.released=!0);const t=p(r.sx,a),e=p(r.sy,a);r.released&&t&&e||(s=!1),d=r.sx.value,m=r.sy.value}else{const t=l(c);d=r.cx0+(r.x-r.cx0)*t,m=r.cy0+(r.y-r.cy0)*t}if(this._place(r.node,r.spec,d,m),r.isEnter&&(r.node.style.opacity=String(Math.min(1,2.5*c))),r._c0&&r._c1){const t=Math.round(r._c0[0]+(r._c1[0]-r._c0[0])*u),e=Math.round(r._c0[1]+(r._c1[1]-r._c0[1])*u),a=Math.round(r._c0[2]+(r._c1[2]-r._c0[2])*u);r.node.setAttribute("fill",`rgb(${t},${e},${a})`)}0===r.spec.pk&&null!=r.r0&&null!=r.r1&&r.r0!==r.r1&&r.node.setAttribute("r",String(r.r0+(r.r1-r.r0)*u)),c<1&&(s=!1)}if(s){for(let e=0;e<r;e++){const a=t[e];a.node.style.opacity="",a._c1&&a.fill1&&a.node.setAttribute("fill",a.fill1),0===a.spec.pk&&null!=a.r0&&null!=a.r1&&a.r0!==a.r1&&a.node.setAttribute("r",String(a.r1))}this.w.globals.unitGatherRAF=null,this.w.globals.animationEnded=!0}else this.w.globals.unitGatherRAF=R.requestAnimationFrame(d)};this.w.globals.unitGatherRAF=R.requestAnimationFrame(d)}_collectExits(t,e,a){const i=Math.max(0,a.maxUnits||5e3),s=[];for(const[a,r]of t)if(!e.has(a)&&(s.push(r),s.length>=i))break;return s}_runExits(t,e,a){const i=this.w,s=new g(i,this.ctx),r=this._lastDotR,n=i.layout.gridWidth/2,o=i.layout.gridHeight/2,l="grid"===a.layout||"scatter"===a.layout||"arc"===a.layout||"custom"===a.layout?0:.35,c=[];if(e.forEach(e=>{const i=null!=e.r?e.r:r,n=e.spec||this._baseSpec(a,i),o=this._drawDot(s,a,i,e.fill,0,0,n);o.node.classList.add("apexcharts-unit-exit"),this._place(o.node,n,e.x,e.y),t.add(o),c.push({node:o.node,x0:e.x,y0:e.y,spec:n})}),!this._shouldAnimate())return void c.forEach(t=>t.node.remove());const h=Math.max(1,i.config.chart.animations.speed||800);null!=this.w.globals.unitExitRAF&&(R.cancelAnimationFrame(this.w.globals.unitExitRAF),this.w.globals.unitExitRAF=null);const u=performance.now(),d=e=>{if(this.w.globals.isDestroyed)return void(this.w.globals.unitExitRAF=null);const a=Math.max(0,Math.min(1,(e-u)/h)),i=E(a);for(let t=0;t<c.length;t++){const e=c[t];if(l){const t=e.x0+(n-e.x0)*i*l,a=e.y0+(o-e.y0)*i*l;this._place(e.node,e.spec,t,a)}e.node.style.opacity=String(1-i)}a<1?this.w.globals.unitExitRAF=R.requestAnimationFrame(d):(this.w.globals.unitExitRAF=null,t.node&&t.node.remove())};this.w.globals.unitExitRAF=R.requestAnimationFrame(d)}_outerLabelsOn(t){const e=t.clusterLabels;return!!("custom"===t.layout&&e&&!1!==e.show&&e.external&&e.external.show)}_outerLabelLines(t,e,a,i){const s=this.w,r=s.seriesData.seriesNames[t]||`series-${t+1}`,n=a>0?e/a*100:0,o=i.clusterLabels,l="function"==typeof o.formatter?o.formatter(r,{seriesIndex:t,value:e,percent:n,w:s}):`${r}\n${n.toFixed(1)}%`;return String(l).split("\n")}_outerLabelGutter(t,e){const a=this.w,i=e.clusterLabels,s=i.external.connector||{},r=t.reduce((t,e)=>t+e,0),n=[];if(t.forEach((t,a)=>{t>0&&n.push(...this._outerLabelLines(a,t,r,e))}),!n.length)return 0;const o=function(t,e,a={}){const i=new g(t),s=a.fontSize||"12px",r=parseFloat(s)||12;let n=0;return e.forEach(t=>{if(null==t||""===t)return;const e=`${t}`,o=i.getTextRects(e,s,a.fontFamily,"",!0,a.fontWeight).width;n=Math.max(n,o>0?o:e.length*r*.58)}),n}(a,n,{fontSize:i.fontSize,fontFamily:i.fontFamily||a.config.chart.fontFamily}),l=o+(null!=s.gap?s.gap:8)+(null!=s.length?s.length:22)+8+Math.abs(parseFloat(i.external.offsetX)||0);return Math.min(l,.25*a.layout.gridWidth)}_drawOuterLabels(t,e,a,i,s,r){const n=this.w;if(!S.isBrowser())return;const o=s.clusterLabels,l=o.external,c=l.connector||{},h=null!=c.gap?c.gap:8,u=null!=c.length?c.length:22,d=parseFloat(l.offsetX)||0,p=parseFloat(l.offsetY)||0,f=n.layout.gridWidth,m=n.layout.gridHeight,x=this._lastDotR,y=e.filter(t=>t.dots.length>0);if(!y.length)return;let b=0,_=0;if(y.length>1){const t=y.map(t=>t.cx),e=y.map(t=>t.cy);b=Math.max(...t)-Math.min(...t),_=Math.max(...e)-Math.min(...e)}const M=b>_,A=parseFloat(o.fontSize)||13,w=Math.round(1.35*A),R=[];if(y.slice().sort((t,e)=>t.cy-e.cy).forEach((t,e)=>{const r=this._outerLabelLines(t.i,a[t.i],i,s);if(!r.some(t=>""!==t))return;const n=M?t.cx>=f/2?"right":"left":e%2==0?"right":"left",o="right"===n?1:-1;let l=t.dots[0],c=-1/0;t.dots.forEach(e=>{const a=o*e.x-.75*Math.abs(e.y-t.cy);a>c&&(c=a,l=e)});const m={x:l.x+o*(l.r||x),y:l.y},g={x:m.x+o*h,y:m.y};R.push({i:t.i,lines:r,anchor:m,elbow:g,labelX:g.x+o*u+d,idealY:m.y+p,labelY:m.y+p,side:n})}),!R.length)return;const k=R.reduce((t,e)=>Math.max(t,e.lines.length),1)*w,v=k/2;["left","right"].forEach(t=>{!function(t,e,a,i){const s=t.slice().sort((t,e)=>t.idealY-e.idealY);s.forEach(t=>{t.labelY=t.idealY});for(let t=1;t<s.length;t++)s[t].labelY-s[t-1].labelY<e&&(s[t].labelY=s[t-1].labelY+e);const r=s[s.length-1],n=r?r.labelY-a:0;if(n>0)for(let t=s.length-1;t>=0;t--)s[t].labelY-=n,t<s.length-1&&s[t+1].labelY-s[t].labelY<e&&(s[t].labelY=s[t+1].labelY-e);if(null!=i&&s.length&&s[0].labelY<i){const t=i-s[0].labelY;for(let e=0;e<s.length;e++)s[e].labelY+=t}}(R.filter(e=>e.side===t),k+2,m-v,v)});const F=new g(n,this.ctx).group({class:"apexcharts-unit-outer-labels"});if(r){const t=Math.max(1,n.config.chart.animations.speed||800);F.node.classList.add("apexcharts-unit-label-delay"),F.node.style.animationDelay=Math.min(.45*t,600)/1e3+"s"}R.forEach(t=>{const e=n.globals.colors[t.i]||n.globals.colors[0]||"#008FFB";F.add(function(t,e){const{lines:a,lineHeight:i,anchor:s,elbow:r,labelX:n,labelY:o,side:l,connector:c,style:h,foreColor:u}=e,d=new g(t),p=d.group({class:e.groupClass||"apexcharts-outer-label-group"});if(c.show){const t=`M ${s.x} ${s.y} L ${r.x} ${r.y} L ${n} ${o}`,a=d.drawPath({d:t,stroke:c.color,strokeWidth:c.width,fill:"none",strokeLinecap:"round"});a.node.classList.add(e.connectorClass||"apexcharts-outer-label-connector"),p.add(a)}const f="right"===l?n+4:n-4,m=a.length,x=o-(m-1)*i/2,y=d.drawText({x:f,y:x,text:1===m?a[0]:a,textAnchor:"right"===l?"start":"end",fontSize:h.fontSize,fontFamily:h.fontFamily,fontWeight:h.fontWeight,foreColor:u,dominantBaseline:"central",cssClass:e.textClass||"apexcharts-outer-label"});if(m>1){const t=y.node.getElementsByTagName("tspan");for(let e=0;e<t.length;e++)t[e].setAttribute("x",`${f}`),t[e].setAttribute("dy",0===e?"0":`${i}`)}return p.add(y),p}(n,{lines:t.lines,lineHeight:w,anchor:t.anchor,elbow:t.elbow,labelX:t.labelX,labelY:t.labelY,side:t.side,connector:{show:!1!==c.show,width:null!=c.width?c.width:1.5,color:c.color||e},style:{fontSize:o.fontSize,fontFamily:o.fontFamily||n.config.chart.fontFamily,fontWeight:o.fontWeight},foreColor:o.color||n.config.chart.foreColor,groupClass:"apexcharts-unit-outer-label-group",textClass:"apexcharts-unit-outer-label",connectorClass:"apexcharts-unit-label-connector"}))}),t.add(F)}_drawClusterLabel(t,e,a,i,s,r){const n=this.w;if(!S.isBrowser())return;const o="http://www.w3.org/2000/svg",l=n.seriesData.seriesNames[e.i]||`series-${e.i+1}`,c=i>0?a/i*100:0,h=s.clusterLabels,u=parseFloat(h.fontSize)||13;let d;d="function"==typeof h.formatter?h.formatter(l,{seriesIndex:e.i,value:a,percent:c,w:n}):`${l} (${c.toFixed(1)}%)`;const p="string"==typeof d?d:String(d),f=R.createElementNS(o,"text");f.setAttribute("class","apexcharts-unit-label"),f.setAttribute("text-anchor","middle"),f.setAttribute("font-size",`${u}px`),f.setAttribute("font-family",h.fontFamily||n.config.chart.fontFamily||"inherit"),f.setAttribute("font-weight",String(h.fontWeight||600)),f.setAttribute("fill",h.color||r);const m="bottom"===h.position,x=e.outerR+.6*u+3+(h.offsetY||0),g=p.length*u*.55;if(!m&&!e.flat&&!1!==h.curved&&g<=Math.PI*x*.95){const a=e.cy,i=`M ${e.cx-x} ${a} A ${x} ${x} 0 0 1 ${e.cx+x} ${a}`,s=`apexcharts-unit-label-${n.globals.chartID}-${e.i}`,r=R.createElementNS(o,"path");r.setAttribute("id",s),r.setAttribute("d",i),r.setAttribute("fill","none"),r.setAttribute("stroke","none");const l=R.createElementNS(o,"textPath");l.setAttribute("href",`#${s}`),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",`#${s}`),l.setAttribute("startOffset","50%"),l.textContent=p,f.appendChild(l),t.node.appendChild(r)}else{f.setAttribute("x",String(e.cx));const t=m?e.cy+e.outerR+u+6+(h.offsetY||0):e.cy-e.outerR-6-(h.offsetY||0);f.setAttribute("y",String(t)),f.textContent=p}t.node.appendChild(f)}}}),t.default=h,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexUnit={})});
5
+ !function(t){var e="undefined"!=typeof globalThis?globalThis:self,a=e.ApexCharts;if(a&&a.__internals)return t.call(e);if(a)throw new Error("ApexCharts: dist/unit.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");if("function"==typeof define&&define.amd)return t.call(e);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/unit.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/unit.js",run:t,done:!1},s=e.__apexcharts_pending_addons__||(e.__apexcharts_pending_addons__=[]);s.push(i),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!i.done){var a=e.ApexCharts;if(a)if(a.__internals){i.done=!0;var r=s.indexOf(i);-1!==r&&s.splice(r,1);try{t.call(e),a.__drainsAddons||e.console.warn("ApexCharts: dist/unit.js loaded before the ApexCharts script, which is older than 8.0 and does not pick up add-ons loaded first, so it registered only when the page finished loading. Put its tag after the ApexCharts script.")}catch(t){e.console.error("ApexCharts: dist/unit.js could not register with the ApexCharts script on this page: "+(t&&t.message))}}else e.console.error("ApexCharts: dist/unit.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");else e.console.warn("ApexCharts: dist/unit.js is waiting for the ApexCharts script, which had not loaded when the page finished loading. It registers when an ApexCharts 8.0 or later script loads; if the page has none, add apexcharts.min.js (or apexcharts.core.min.js, or apexcharts.full.min.js).")}})}(function(){var t,e;t=this,e=function(t){"use strict";var e=Object.defineProperty,a=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,o=(t,a,i)=>a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[a]=i,l=(t,e)=>{for(var a in e||(e={}))r.call(e,a)&&o(t,a,e[a]);if(s)for(var a of s(e))n.call(e,a)&&o(t,a,e[a]);return t},c=(t,e)=>a(t,i(e));const h=globalThis.ApexCharts,u=1/45;function d(t,e,a,i){return{value:t,velocity:0,target:t,stiffness:e,damping:a}}function p(t,e){if(e<=0)return m(t);let a=e;for(;a>0;){const e=Math.min(a,u),i=-t.stiffness*(t.value-t.target)-t.damping*t.velocity;t.velocity+=i*e,t.value+=t.velocity*e,a-=e}return!!m(t)&&(t.value=t.target,t.velocity=0,!0)}function f(t,e){t.target=e}function m(t){var e,a;const i=null!=(e=t.restVelocity)?e:.05,s=null!=(a=t.restDisplacement)?a:.05;return Math.abs(t.velocity)<i&&Math.abs(t.value-t.target)<s}const x={crisp:[210,26],gentle:[120,20],snappy:[320,30]},g=globalThis.ApexCharts.__internals.__apex_Graphics,y="__apexcharts_unit_layouts__";function b(t){return t&&globalThis[y][t]||null}globalThis[y]||(globalThis[y]={});const _="__apexcharts_unit_marks__";function M(t,e){if("string"==typeof t){const e=t.trim();return e?Object.freeze({name:"anonymous",path:e,viewBox:[0,0,100,100]}):null}if(!t||"object"!=typeof t)return null;if("string"!=typeof t.path||!t.path.trim())return null;const a=Array.isArray(t.viewBox)&&4===t.viewBox.length?t.viewBox.map(Number):[0,0,100,100];return!a.every(t=>isFinite(t))||a[2]<=0||a[3]<=0?null:Object.freeze(c(l({},t),{name:t.name||"anonymous",path:t.path.trim(),viewBox:a,fillRule:"evenodd"===t.fillRule?"evenodd":void 0}))}function A(t){return t&&globalThis[_][t]||null}globalThis[_]||(globalThis[_]={});const w=globalThis.ApexCharts.__internals.__apex_Utils,S=globalThis.ApexCharts.__internals.__apex_Environment_Environment,R=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs,k=globalThis.ApexCharts.__internals;k.__apex_Animations,k.__apex_Animations_computeStagger,k.__apex_Animations_applyAnimationPolicy;const v=k.__apex_Animations_prefersReducedMotion;function F(t,e,a={}){const i=new g(t),s=a.fontSize||"12px",r=parseFloat(s)||12;let n=0;return e.forEach(t=>{if(null==t||""===t)return;const e=`${t}`,o=i.getTextRects(e,s,a.fontFamily,"",!0,a.fontWeight).width;n=Math.max(n,o>0?o:e.length*r*.58)}),n}function E(t){let e=(2654435769^t)>>>0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),((e^e>>>16)>>>0)/4294967296}k.__apex_Animations_applyProgressiveReveal;const C=Math.PI*(3-Math.sqrt(5)),T=(t,e)=>{const a=(t.get(e)||0)+1;return t.set(e,a),a>1?e+"#"+a:e},L=t=>("string"==typeof t&&(t=parseFloat(t)),"number"==typeof t&&isFinite(t)?t:null);function D(t){return 1-Math.pow(1-t,3)}function j(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}function $(t,e){const[a,i]=null!=(r=x[null!=(s=t)?s:"crisp"])?r:x.crisp;var s,r;const n=800/Math.max(1,e);return[a*n*n,i*n]}h.use({unit:class{constructor(t,e){this.ctx=e,this.w=t,this._lastDotR=1,this._gridTrack=null,this._gridDenom=1,this._scatterAxis=null,this._specCache=new Map,this._markWarned=null}draw(t){const e=this.w,a=new g(e,this.ctx),i=a.group({class:"apexcharts-unit"});if(R.cancelAnimationFrame(e.globals.unitGatherRAF||0),R.cancelAnimationFrame(e.globals.unitExitRAF||0),e.globals.unitGatherRAF=e.globals.unitExitRAF=null,e.globals.noData||!Array.isArray(t)||0===t.length)return i;const s=e.config.plotOptions.unit,r="packed"===s.layout?"packed":"columns"===s.layout?"columns":"grid"===s.layout?"grid":"scatter"===s.layout?"scatter":"arc"===s.layout?"arc":"custom"===s.layout?"custom":"grouped",n=s.transition,o="flow"===n,h="identity"===n,u=s.unitValue>0?s.unitValue:1,d="grid"===r&&!(!s.grid||!s.grid.split);let p=t.map(t=>{const e=Math.abs(w.parseNumber(t))/u;return d?e:e>0?Math.max(1,Math.round(e)):0});d||"scatter"===r||(p=this._applyMaxUnits(p,s.maxUnits));const f=p.reduce((t,e)=>t+e,0),m="packed"===r?this._layoutPacked(p,s):"columns"===r?this._layoutColumns(p,s):"grid"===r?this._layoutGrid(p,s):"scatter"===r?this._layoutScatter(s):"arc"===r?this._layoutArc(p,s):"custom"===r?this._layoutCustom(p,s):this._layoutGrouped(p,s);"scatter"===r&&this._drawScatterAxes(i,a);const x=this._lastDotR,y=this._shouldAnimate(),b=this.ctx&&this.ctx.morphTypeChange,_=y&&!!b&&"function"==typeof b.isActive&&b.isActive()&&"function"==typeof b.getInitialSlotFor,M=_&&"function"==typeof b.usesPieceTakeover&&b.usesPieceTakeover(),A=y&&!_&&this.ctx?this.ctx._unitPrevDots:null,S=this.ctx&&this.ctx._unitPieces;S&&(this.ctx._unitPieces=null,A&&S.querySelectorAll("rect").forEach(t=>{const e=t.getAttribute("data-key"),a=A.get(e),i=e=>+t.getAttribute(e);a&&A.set(e,c(l({},a),{x:i("x")+i("width")/2,y:i("y")+i("height")/2,r:Math.min(i("width"),i("height"))/2,fill:t.getAttribute("fill")}))}));const k=new Map,v=[],F=e.seriesData.unitData||[],E=this._bubbleStats(F,s,x);let C=0;const L=new Map,D=d&&this._gridTrack&&this._gridTrack.cells||[],j=a.group({class:"apexcharts-unit-track"});D.length&&i.add(j);const $=s.grid&&s.grid.trackColor||"rgba(128,128,128,0.14)",B=this._baseSpec({shape:"square"===s.shape&&"square"},x),z=D.length/Math.max(1,m.length),P=this.ctx&&this.ctx._unitSprings,Y=(t,e,a,i,s,r,n,o)=>{const l=A&&A.get(s),c=P&&P.get(s),h=l&&l.x===a&&l.y===i&&l.r===r&&(!c||c.x.value===a&&c.y.value===i);if(k.set(s,{x:a,y:i,fill:$,r:r,spec:e}),A&&y&&!M&&!h){const c=l?l.x:a,h=l?l.y:i;t.style.opacity=l?"1":"0",this._place(t,e,c,h),v.splice(n,0,{node:t,spec:e,x:a,y:i,cx0:c,cy0:h,key:s,r0:l&&null!=l.r?l.r:r,r1:r,delay:0,isEnter:!l,pair:o})}else this._place(t,e,a,i)},O=(t,e)=>{const i=this._drawDot(a,s,x,$,-1,0,B);i.node.classList.add("apexcharts-unit-track-cell"),j.add(i),Y(i.node,B,D[t].x,D[t].y,"trk:"+t,x,v.length,e)};if(m.forEach((t,n)=>{const l=e.globals.colors[t.i]||e.globals.colors[0]||"#008FFB",c=a.group({class:"apexcharts-series",seriesName:w.escapeString(e.seriesData.seriesNames[t.i]||`series-${t.i+1}`),rel:t.i+1,"data:realIndex":t.i}),u=t.dots.length,m=F[t.i],g=v.length;t.dots.forEach((e,i)=>{D.length&&O(n*z+i,!0);const r=null!=e.j?e.j:i,p=m?m[r]:void 0,f=p&&"object"==typeof p&&p.fillColor?p.fillColor:l,g=null!=e.r?e.r:E?this._radiusForValue(this._unitValueOf(p),E):x,w=this._markSpecFor(s,p,t.i,g),S=this._drawDot(a,s,g,f,t.i,r,w);let R;if(c.add(S),h){const t=p&&"object"==typeof p?null!=p.id?p.id:p.name:void 0;R=null!=t?`id:${T(L,String(t))}`:`g:${C}`}else R=o?String(C):null!=e.slot?`slot:${e.slot}`:`${t.i}:${r}`;if(C++,k.set(R,{x:e.x,y:e.y,fill:f,r:g,spec:w}),M)this._place(S.node,w,e.x,e.y),S.node.setAttribute("opacity","0"),S.node.setAttribute("data-piece-hidden","1"),S.node.setAttribute("data-key",R);else if(y){const a=A&&A.get(R),i=a||(_?b.getInitialSlotFor(t.i,r,u):null),n=s.gather&&s.gather.enter||"burst",o=d||"fade"===n||"rise"===n,l=i||d&&A&&A.get("trk:"+e.slot),c=l?l.x:o?e.x:t.cx,h=l?l.y:"rise"!==n||d?o?e.y:t.cy:e.y+14;S.node.style.opacity=i?"1":"0",this._place(S.node,w,c,h),v.push({node:S.node,spec:w,x:e.x,y:e.y,cx0:c,cy0:h,key:R,r0:a&&null!=a.r?a.r:g,r1:g,fill0:a?a.fill:f,fill1:f,delay:0,isEnter:!i})}else this._place(S.node,w,e.x,e.y)});for(let e=t.dots.length;e<z;e++)O(n*z+e,!1);if(("grouped"===r||"columns"===r||d)&&s.clusterLabels&&s.clusterLabels.show&&p[t.i]>0){const e=d?this._gridDenom:f,a=this._drawClusterLabel(c,t,p[t.i],e,s,l);if(a&&d){const e={pk:1,hx:0,hy:0,r:0},i=+(a.getAttribute("x")||0),s=+(a.getAttribute("y")||0);Y(a,e,i,s,"lbl:"+t.i,0,g,v.length>g)}}i.add(c)}),this._outerLabelsOn(s)&&this._drawOuterLabels(i,m,p,f,s,y&&!A),A){const t=this._collectExits(A,k,s);if(t.length){const e=a.group({class:"apexcharts-unit-exits"});i.add(e),this._runExits(e,t,s)}}return this.ctx&&(this.ctx._unitPrevDots=k),!this.ctx||y&&!_||(this.ctx._unitSprings=null),y&&v.length?this._runGather(v):e.globals.animationEnded=!0,i}_applyMaxUnits(t,e){const a=t.reduce((t,e)=>t+e,0);if(!e||e<=0||a<=e)return t;const i=e/a,s=this.ctx||{};return s._unitCapWarned||(s._unitCapWarned=!0,console.warn(`[ApexCharts] unit chart: ${a} dots exceeds maxUnits (${e}); counts were scaled down proportionally. Raise plotOptions.unit.maxUnits or use plotOptions.unit.unitValue to represent more units per dot.`)),t.map(t=>t>0?Math.max(1,Math.round(t*i)):0)}_layoutCustom(t,e){const a=this.w,i=a.layout.gridWidth,s=a.layout.gridHeight,r=t.reduce((t,e)=>t+e,0),n=this._resolveLayoutProvider(e);if(!n)return console.warn("[ApexCharts] unit chart: layout 'custom' needs plotOptions.unit.positions (a function, or the name of a layout registered with ApexCharts.registerUnitLayout). Falling back to 'grouped'."),this._layoutGrouped(t,e);const o=this._outerLabelsOn(e)?this._outerLabelGutter(t,e):0;this._lastOuterGutter=o;const l={x:o,y:0,width:Math.max(1,i-2*o),height:s},c=Math.sqrt(l.width*l.height/Math.PI),h=this._resolveStep(e,c,r);this._lastDotR=this._dotRadiusFromStep(h,e);const u=this._lastDotR,d=this._layoutObjects(t,u);let p;try{p=n(d,l)}catch(a){return console.warn("[ApexCharts] unit chart: the layout provider threw; falling back to 'grouped'.",a),this._layoutGrouped(t,e)}if(!Array.isArray(p))return console.warn("[ApexCharts] unit chart: the layout provider must return an array of {id, x, y}; falling back to 'grouped'."),this._layoutGrouped(t,e);const f=new Map;p.forEach(t=>{t&&isFinite(t.x)&&isFinite(t.y)&&f.set(String(t.id),{x:t.x,y:t.y,r:"number"==typeof t.r&&t.r>0?t.r:void 0})});const m=t.map((t,e)=>({i:e,cx:i/2,cy:s/2,outerR:u,dots:[]}));return d.forEach(t=>{const e=f.get(t.id);e&&m[t.seriesIndex].dots.push({x:e.x,y:e.y,r:e.r,j:t.dataPointIndex})}),m.forEach(t=>{if(!t.dots.length)return;let e=0,a=0;t.dots.forEach(t=>{e+=t.x,a+=t.y}),t.cx=e/t.dots.length,t.cy=a/t.dots.length;let i=0;t.dots.forEach(e=>{i=Math.max(i,Math.hypot(e.x-t.cx,e.y-t.cy))}),t.outerR=i+u}),m}_layoutObjects(t,e){const a=this.w,i=a.seriesData.unitData||[],s=a.seriesData.seriesNames||[],r=[],n=new Map;let o=0;return t.forEach((t,a)=>{var l;const c=i[a];for(let i=0;i<t;i++){const t=c?c[i]:void 0,h=T(n,!t||"object"!=typeof t||null==t.id&&null==t.name?`${a}:${i}`:String(null!=t.id?t.id:t.name));r.push({id:h,index:o,seriesIndex:a,dataPointIndex:i,label:s[a],value:null!=(l=this._unitValueOf(t))?l:void 0,datum:t,r:e}),o++}}),r}_resolveLayoutProvider(t){const e=t.positions;if("function"==typeof e)return e;if("string"==typeof e&&e){const t=b(e);if(t)return t;console.warn(`[ApexCharts] unit chart: no layout named "${e}" is registered. Register one with ApexCharts.registerUnitLayout("${e}", fn).`)}return null}_layoutGrouped(t,e){const a=this.w,i=a.layout.gridWidth,s=a.layout.gridHeight,r=e.clusterLabels&&e.clusterLabels.show?30:6,n=t.map((t,e)=>e).filter(e=>t[e]>0),o=Math.max(1,n.length),l=new Array(t.length).fill(-1);n.forEach((t,e)=>l[t]=e);const c=i/o,h=s-r,u=Math.max(1,...t),d=.08*Math.min(c,h),p=Math.max(4,Math.min(c,h)/2-d),f=this._resolveStep(e,p,u);this._lastDotR=this._dotRadiusFromStep(f,e);const m=this._lastDotR,x=r+h/2,g=t.map(t=>f*Math.sqrt(Math.max(1,t))+m);let y=t.map((t,e)=>(t=>l[t]>=0?c*(l[t]+.5):i/2)(e));const b=n.map(t=>g[t]);let _=!1;for(let t=1;t<o;t++)if(y[n[t]]-y[n[t-1]]<b[t]+b[t-1]){_=!0;break}if(_){const e=Math.max(2*m,8),a=b.reduce((t,e)=>t+2*e,0)+e*(o-1);let s;if(a<=i){let t=(i-a)/2;s=b.map(a=>{const i=t+a;return t+=2*a+e,i})}else if(1===o)s=[i/2];else{const t=b[0],e=i-b[o-1];s=b.map((a,i)=>t+(e-t)*i/(o-1))}y=t.map((t,e)=>l[e]>=0?s[l[e]]:i/2)}return t.map((t,e)=>({i:e,cx:y[e],cy:x,outerR:g[e],dots:this._spiral(y[e],x,t,f,0)}))}_layoutPacked(t,e){const a=this.w,i=a.layout.gridWidth,s=a.layout.gridHeight,r=Math.max(1,t.reduce((t,e)=>t+e,0)),n=Math.max(4,Math.min(i,s-6)/2-.06*Math.min(i,s)),o=this._resolveStep(e,n,r);this._lastDotR=this._dotRadiusFromStep(o,e);const l=i/2,c=6+(s-6)/2,h=t.map((t,e)=>e);!1!==e.sortByGroup&&h.sort((e,a)=>t[e]-t[a]);const u=t.map((t,e)=>({i:e,cx:l,cy:c,outerR:o*Math.sqrt(r)+this._lastDotR,dots:[]}));let d=0;return h.forEach(e=>{for(let a=0;a<t[e];a++){const t=o*Math.sqrt(d+.5),a=d*C;u[e].dots.push({x:l+t*Math.cos(a),y:c+t*Math.sin(a),slot:d}),d++}}),u}_layoutArc(t,e){const a=this.w,i=a.layout.gridWidth,s=a.layout.gridHeight,r=Math.max(1,t.reduce((t,e)=>t+e,0)),n=e.arc||{},o="number"==typeof n.startAngle?n.startAngle:-90,l="number"==typeof n.endAngle?n.endAngle:90,c=o*Math.PI/180,h=l*Math.PI/180,u=h-c||Math.PI,d=Math.max(0,Math.min(.95,"number"==typeof n.innerRadiusRatio?n.innerRadiusRatio:.4)),p=t=>Math.sin(t),f=t=>-Math.cos(t),m=this._arcBounds(c,h),x=.04*Math.min(i,s),g=Math.max(1e-6,m.maxX-m.minX),y=Math.max(1e-6,m.maxY-m.minY),b=t=>Math.max(4,Math.min((i-2*x-t)/g,(s-2*x-t)/y)),_=t=>b(2*this._arcAllocate(r,t*d,t,u,e).dotR);let M=b(0),A=_(M);for(let t=0;t<6;t++){const t=(A+M)/2;t<=_(t)?A=t:M=t}const w=i/2-(m.minX+m.maxX)/2*A,S=s/2-(m.minY+m.maxY)/2*A,R=this._arcAllocate(r,A*d,A,u,e);this._lastDotR=R.dotR;const k=[];for(let t=0;t<R.R;t++){const e=R.radii[t],a=R.seatsPerRow[t];for(let t=0;t<a;t++){const i=1===a?(c+h)/2:c+u*(t+.5)/a;k.push({a:i,x:w+e*p(i),y:S+e*f(i)})}}k.sort((t,e)=>t.a-e.a);const v=t.map((t,e)=>({i:e,cx:w,cy:S,outerR:A,dots:[]}));let F=0,E=0;return k.forEach((e,a)=>{for(;F<t.length&&E>=t[F];)F++,E=0;F>=t.length||(v[F].dots.push({x:e.x,y:e.y,slot:a}),E++)}),v}_arcBounds(t,e){const a=t=>Math.sin(t),i=t=>-Math.cos(t),s=Math.min(t,e),r=Math.max(t,e),n=[0,a(t),a(e)],o=[0,i(t),i(e)],l=Math.PI/2;for(let t=Math.ceil(s/l);t*l<=r;t++)n.push(a(t*l)),o.push(i(t*l));return{minX:Math.min(...n),maxX:Math.max(...n),minY:Math.min(...o),maxY:Math.max(...o)}}_arcAllocate(t,e,a,i,s){const r=s.spacing>0?s.spacing:1.05,n=Math.abs(i)||Math.PI,o=this._fixedRadius(s),l=i=>{i=Math.max(1,Math.round(i));const s=[];for(let t=0;t<i;t++)s.push(1===i?(e+a)/2:e+t/(i-1)*(a-e));const o=s.reduce((t,e)=>t+e,0)||1,l=s.map(e=>t*e/o),c=l.map(t=>Math.floor(t));let h=t-c.reduce((t,e)=>t+e,0);for(l.map((t,e)=>({idx:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac).forEach(t=>{h>0&&(c[t.idx]++,h--)});h>0;)c[i-1]++,h--;const u=1===i?a-e||a:(a-e)/(i-1);let d=1/0;for(let t=0;t<i;t++){const e=c[t];if(e<=0)continue;const a=s[t]*n/e;a<d&&(d=a)}const p=Math.min(u,d);return{R:i,radii:s,seatsPerRow:c,dotR:Math.max(1,p/(2*r))}},c=s.arc&&s.arc.rows;let h;if("number"==typeof c&&c>=1)h=l(c);else if(o)h=l((a-e)/(2*o*r)+1);else{const e=Math.max(1,Math.min(40,Math.ceil(Math.sqrt(t))+6));h=l(1);for(let t=2;t<=e;t++){const e=l(t);e.dotR>h.dotR&&(h=e)}}return o&&(h.dotR=o),h}_layoutColumns(t,e){const a=this.w,i=a.layout.gridWidth,s=a.layout.gridHeight,r=!(!e.clusterLabels||!e.clusterLabels.show),n=r&&"bottom"===e.clusterLabels.position,o=r&&!n?30:6,l=t.map((t,e)=>e).filter(e=>t[e]>0),c=Math.max(1,l.length),h=new Array(t.length).fill(-1);l.forEach((t,e)=>h[t]=e);const u=i/c,d=.62*u,p=Math.max(8,.04*s)+(n?30:0),f=Math.max(4,s-o-p),m=Math.max(1,...t),x=e.spacing>0?e.spacing:1,g=e.columns?e.columns.size:void 0;let y;y="image"!==e.shape&&"auto"===g?null:"image"!==e.shape&&"number"==typeof g&&g>0?g:this._fixedRadius(e);let b=1,_=0;if(y){_=2*y*x,this._lastDotR=y;const t=Math.max(1,Math.floor(f/_)),e=Math.max(1,Math.floor(d/_));b=Math.max(1,Math.min(e,Math.ceil(m/t)))}else{let t=0;const e=Math.max(1,Math.min(40,Math.round(d/4)));for(let a=1;a<=e;a++){const e=Math.ceil(m/a),i=Math.min(d/a,f/e);i>t&&(t=i,b=a)}_=t,this._lastDotR=Math.max(1,_/(2*x))}const M=this._lastDotR,A=Math.ceil(m/b),w=o+(f+Math.min(f,A*_))/2;return t.map((t,e)=>{const a=h[e]>=0?u*(h[e]+.5):i/2,s=Math.ceil(Math.max(1,t)/b)*_,r=a-b*_/2+_/2,n=[];for(let e=0;e<t;e++){const t=Math.floor(e/b),a=e%b;n.push({x:r+a*_,y:w-M-t*_})}return{i:e,cx:a,cy:w-s/2,outerR:s/2,flat:!0,dots:n}})}_layoutGrid(t,e){if(e.grid&&e.grid.split)return this._layoutGridSplit(t,e);this._gridTrack=null;const a=this.w,i=a.layout.gridWidth,s=a.layout.gridHeight,r=e.grid||{},n=Math.max(1,Math.round(r.columns>0?r.columns:10)),o="top"===r.fillFrom?"top":"bottom",l=r.total>0?this._largestRemainder(t,Math.round(r.total)):t.slice(),c=l.reduce((t,e)=>t+e,0),h=Math.max(1,Math.ceil(Math.max(1,c)/n)),u=e.spacing>0?e.spacing:1,d=Math.max(4,i),p=Math.max(4,s-6),f=this._fixedRadius(e);let m=0;f?(m=2*f*u,this._lastDotR=f):(m=Math.min(d/n,p/h),this._lastDotR=Math.max(1,m/(2*u)));const x=n*m,g=h*m,y=(i-x)/2+m/2,b=6+(p-g)/2,_=t=>"bottom"===o?b+g-m/2-t*m:b+m/2+t*m,M=t.map((t,e)=>({i:e,cx:i/2,cy:6+p/2,outerR:Math.max(x,g)/2,dots:[]}));let A=0;for(let t=0;t<l.length;t++)for(let e=0;e<l[t];e++){const e=A%n,a=Math.floor(A/n);M[t].dots.push({x:y+e*m,y:_(a),slot:A}),A++}return M}_layoutGridSplit(t,e){const a=this.w,i=a.layout.gridWidth,s=a.layout.gridHeight,r=e.grid||{},n=Math.max(1,Math.round(r.columns>0?r.columns:10)),o="top"===r.fillFrom?"top":"bottom",l=Math.max(1,Math.round(r.total>0?r.total:100)),c=Math.max(1,Math.ceil(l/n)),h=t.map((t,e)=>e).filter(e=>t[e]>0),u=Math.max(1,h.length),d=r.max>0?r.max:Math.max(...t)||1,p=Math.max(1,Math.round(r.tileColumns>0?r.tileColumns:Math.ceil(Math.sqrt(u)))),f=Math.max(1,Math.ceil(u/p)),m=!(e.clusterLabels&&!1===e.clusterLabels.show),x=m&&e.clusterLabels&&"bottom"===e.clusterLabels.position,g=m&&!x?22:4,y=m&&x?22:4,b=i/p,_=s/f,M=Math.max(4,.86*b),A=Math.max(4,_-g-y),w=e.spacing>0?e.spacing:1,S=this._fixedRadius(e);let R=0;S?(R=2*S*w,this._lastDotR=S):(R=Math.min(M/n,A/c),this._lastDotR=Math.max(1,R/(2*w)));const k=n*R,v=c*R,F=(t,e)=>"bottom"===o?t+v-R/2-e*R:t+R/2+e*R,E=[],C=[];return h.forEach((e,a)=>{const i=a%p,s=Math.floor(a/p),r=i*b,o=r+(b-k)/2+R/2,c=s*_+g+(A-v)/2,h=t=>({x:o+t%n*R,y:F(c,Math.floor(t/n))});for(let t=0;t<l;t++)E.push(h(t));const u=Math.max(0,Math.min(l,Math.round(t[e]/d*l))),f=[];for(let t=0;t<u;t++){const e=h(t);f.push({x:e.x,y:e.y,slot:a*l+t})}C.push({i:e,cx:r+b/2,cy:c+v/2,outerR:v/2,flat:!0,split:!0,dots:f})}),this._gridDenom=d,this._gridTrack={cells:E},C}_layoutScatter(t){const e=this.w,a=t.scatter||{},i=e.seriesData.unitData||[],s=i.map(t=>t?t.length:0),r=this._applyMaxUnits(s,t.maxUnits),n=(t,e)=>Math.floor((e+1)*r[t]/s[t])>Math.floor(e*r[t]/s[t]);if("value"===a.y)return this._layoutScatter2D(t,n);if("vertical"===a.orientation)return this._layoutScatterVertical(t,n);const o=e.layout.gridWidth,l=e.layout.gridHeight,c=e.seriesData.seriesNames||[],h=t=>this._unitValueOf(t),u=this._scatterSizeStats(a,i),d=i.map(t=>Array.isArray(t)?t.map(h):[]),p=t=>null!=t&&isFinite(t),f=d.map((t,e)=>e).filter(t=>d[t].some(p)),m=Math.max(1,f.length);let x=1/0,g=-1/0;d.forEach(t=>t.forEach(t=>{null!=t&&isFinite(t)&&(t<x&&(x=t),t>g&&(g=t))})),x===1/0&&(x=0,g=1);const y=Math.max(2,Math.round(a.tickAmount>0?a.tickAmount:5)),b=this._scatterValueDomain(a.xMin,a.xMax,x,g,y),_=b.min,M=b.max,A=M-_||1,w={fontFamily:e.config.chart.fontFamily,fontWeight:600},S=t=>c[t]||`series-${t+1}`,R=null!=a.laneLabelWidth?Math.max(0,a.laneLabelWidth):m>1?Math.min(o/3,F(e,f.map(S),w)+14):8,k=30+(a.xTitle?20:0),v=R,C=o-8,T=l-k,L=Math.max(4,C-v),D=Math.max(4,T-10),j=t=>v+(t-_)/A*L,$=D/m;let B=0;const z=this._fixedRadius(t);if(z)B=z;else{const t=Math.max(1,...f.map(t=>d[t].filter(p).length));B=Math.max(2,Math.min(6,.12*$,L/(2.5*Math.sqrt(t))))}this._lastDotR=B;const P=t.spacing>0?t.spacing:1,Y=Math.max(.5,B*P),O="jitter"===a.spread,W=[],N=[],q=u?u.rMax:B;f.forEach((t,a)=>{const s=(t=>10+$*(t+.5))(a);let r=S(t);const o=R>12?F(e,[r],w):0;o>R-14&&o&&(r=r.slice(0,Math.max(1,Math.floor(r.length*(R-14)/o)-1))+"\u2026"),N.push({i:t,cy:s,name:r});const l=[];if((i[t]||[]).forEach((e,a)=>{const i=h(e);if(!p(i)||!n(t,a))return;const r={j:a,px:j(i),y:s};u&&(r.r=this._scatterRadius(e,u,B)),l.push(r)}),O){const e=Math.max(q,$/2-q);l.forEach(a=>{a.y=s+(2*E(7919*t+a.j)-1)*e})}else this._beeswarm(l,s,B,Y,q);W.push({i:t,cx:(v+C)/2,cy:s,outerR:$/2,dots:l.map(t=>({x:t.px,y:t.y,r:t.r,j:t.j}))})});const I=b.ticks;return this._scatterAxis={mode:"1d",plotL:v,plotR:C,plotT:10,plotB:T,xMin:_,xMax:M,plotX:j,ticks:I,lanes:N,xTitle:a.xTitle,formatter:"function"==typeof a.xFormatter?a.xFormatter:null,gridlines:!1!==a.gridlines},W}_layoutScatterVertical(t,e){const a=this.w,i=t.scatter||{},s=a.layout.gridWidth,r=a.layout.gridHeight,n=a.seriesData.unitData||[],o=a.seriesData.seriesNames||[],l=t=>this._unitValueOf(t),c=this._scatterSizeStats(i,n),h=n.map(t=>Array.isArray(t)?t.map(l):[]),u=t=>null!=t&&isFinite(t),d=h.map((t,e)=>e).filter(t=>h[t].some(u)),p=Math.max(1,d.length);let f=1/0,m=-1/0;h.forEach(t=>t.forEach(t=>{null!=t&&isFinite(t)&&(t<f&&(f=t),t>m&&(m=t))})),f===1/0&&(f=0,m=1);const x=Math.max(2,Math.round(i.tickAmount>0?i.tickAmount:5)),g=this._scatterValueDomain(i.xMin,i.xMax,f,m,x),y=g.min,b=g.max,_=b-y||1,M=46+(i.xTitle?18:0),A=s-10,w=r-(p>1?26:10),S=Math.max(4,A-M),R=Math.max(4,w-10),k=t=>w-(t-y)/_*R,v=S/p;let F=0;const C=this._fixedRadius(t);if(C)F=C;else{const t=Math.max(1,...d.map(t=>h[t].filter(u).length));F=Math.max(2,Math.min(6,.12*v,R/(2.5*Math.sqrt(t))))}this._lastDotR=F;const T=t.spacing>0?t.spacing:1,L=Math.max(.5,F*T),D="jitter"===i.spread,j=[],$=[],B=c?c.rMax:F;d.forEach((t,a)=>{const i=(t=>M+v*(t+.5))(a);$.push({i:t,cx:i,name:o[t]||`series-${t+1}`});const s=[];if((n[t]||[]).forEach((a,r)=>{const n=l(a);if(!u(n)||!e(t,r))return;const o={j:r,py:k(n),x:i};c&&(o.r=this._scatterRadius(a,c,F)),s.push(o)}),D){const e=Math.max(B,v/2-B);s.forEach(a=>{a.x=i+(2*E(7919*t+a.j)-1)*e})}else this._beeswarm(s,i,F,L,B,!0);j.push({i:t,cx:i,cy:(10+w)/2,outerR:v/2,dots:s.map(t=>({x:t.x,y:t.py,r:t.r,j:t.j}))})});const z=g.ticks;return this._scatterAxis={mode:"1d",orientation:"vertical",plotL:M,plotR:A,plotT:10,plotB:w,vMin:y,vMax:b,plotY:k,ticks:z,lanes:$,valueTitle:i.xTitle,formatter:"function"==typeof i.xFormatter?i.xFormatter:null,gridlines:!1!==i.gridlines},j}_layoutScatter2D(t,e){const a=this.w,i=a.layout.gridWidth,s=a.layout.gridHeight,r=t.scatter||{},n=a.seriesData.unitData||[],o=t=>null!=t,l=t=>t&&"object"==typeof t?L(t.x):null,c=t=>t&&"object"==typeof t?L(null!=t.y?t.y:t.value):null,h=n.map((t,e)=>e).filter(t=>(n[t]||[]).some(t=>o(l(t))&&o(c(t))));let u=1/0,d=-1/0,p=1/0,f=-1/0;n.forEach(t=>(t||[]).forEach(t=>{const e=l(t),a=c(t);o(e)&&o(a)&&(e<u&&(u=e),e>d&&(d=e),a<p&&(p=a),a>f&&(f=a))})),u===1/0&&(u=0,d=1,p=0,f=1);const m=this._scatterValueDomain(r.xMin,r.xMax,u,d,Math.max(2,Math.round(r.tickAmount>0?r.tickAmount:5))),x=this._scatterValueDomain(r.yMin,r.yMax,p,f,Math.max(2,Math.round(r.yTickAmount>0?r.yTickAmount:5))),g=m.min,y=m.max,b=x.min,_=x.max,M=y-g||1,A=_-b||1,w=46+(r.yTitle?18:0),S=30+(r.xTitle?20:0),R=w,k=i-12,v=s-S,F=Math.max(4,k-R),E=Math.max(4,v-10),C=t=>R+(t-g)/M*F,T=t=>v-(t-b)/A*E,D=this._scatterSizeStats(r,n),j=this._fixedRadius(t)||5;this._lastDotR=j;const $=[];return h.forEach(t=>{const a=[];(n[t]||[]).forEach((i,s)=>{const r=l(i),n=c(i);null!=r&&null!=n&&e(t,s)&&a.push({x:C(r),y:T(n),r:D?this._scatterRadius(i,D,j):void 0,j:s})}),$.push({i:t,cx:(R+k)/2,cy:(10+v)/2,outerR:E/2,dots:a})}),this._scatterAxis={mode:"2d",plotL:R,plotR:k,plotT:10,plotB:v,plotX:C,plotY:T,xTicks:m.ticks,yTicks:x.ticks,xTitle:r.xTitle,yTitle:r.yTitle,xFormatter:"function"==typeof r.xFormatter?r.xFormatter:null,yFormatter:"function"==typeof r.yFormatter?r.yFormatter:null,gridlines:!1!==r.gridlines},$}_scatterSizeStats(t,e){const a=t&&t.sizeRange;if(!Array.isArray(a)||a.length<2)return null;const i=Math.max(.5,+a[0]),s=Math.max(i,+a[1]),r=t.sizeField||"z";let n=1/0,o=-1/0;return e.forEach(t=>(t||[]).forEach(t=>{const e=t&&"object"==typeof t?t[r]:null;"number"==typeof e&&isFinite(e)&&(e<n&&(n=e),e>o&&(o=e))})),n===1/0?null:{zmin:n,zmax:o,rMin:i,rMax:s,field:r}}_scatterRadius(t,e,a){if(!e)return a;const i=t&&"object"==typeof t?t[e.field]:null;if("number"!=typeof i||!isFinite(i))return e.rMin;const s=e.zmax>e.zmin?(i-e.zmin)/(e.zmax-e.zmin):1,r=Math.max(0,Math.min(1,s)),n=e.rMin*e.rMin,o=e.rMax*e.rMax;return Math.sqrt(n+r*(o-n))}_beeswarm(t,e,a,i,s,r=!1){const n=r?"py":"px",o=r?"x":"y",l=t.slice().sort((t,e)=>t[n]-e[n]),c=[],h=null!=s?s:a;l.forEach(t=>{const s=null!=t.r?t.r:a;let r=0;for(let a=0;a<2e3;a++){const o=0===a?0:Math.ceil(a/2)*i*(a%2?1:-1),l=e+o;let u=!0;for(let e=c.length-1;e>=0;e--){const a=c[e],i=t[n]-a.f;if(i>s+h)break;const r=s+a.r,o=l-a.s;if(i*i+o*o<r*r){u=!1;break}}if(u){r=o;break}}t[o]=e+r,c.push({f:t[n],s:t[o],r:s})})}_scatterValueDomain(t,e,a,i,s){const r=(t,e,a)=>{const i=[];for(let s=0,r=t;r<=e+.5*a;r=t+ ++s*a)i.push(Math.abs(r)<1e-9*a?0:r);return i};if(null!=t||null!=e){let n=null!=t?t:e,o=null!=e?e:t;const l=o>n?(o-n)/Math.max(1,s-1):this._niceScale(Math.min(n,a),Math.max(o,i),s).spacing;if(a<n&&(n-=Math.ceil((n-a)/l)*l),i>o&&(o+=Math.ceil((i-o)/l)*l),o>n||(o=n+l),(o-n)/l<=2*s)return{min:n,max:o,ticks:r(n,o,l)};a=n,i=o}const n=this._niceScale(a,i,s),o=n.spacing||(n.max-n.min)/Math.max(1,s-1);return{min:n.min,max:n.max,ticks:r(n.min,n.max,o)}}_niceScale(t,e,a){const i=t;let s=e;s>i||(s=i+1);const r=this._niceNum(s-i,!1),n=this._niceNum(r/Math.max(1,a-1),!0);return{min:Math.floor(i/n)*n,max:Math.ceil(s/n)*n,spacing:n}}_niceNum(t,e){const a=t>0?t:1,i=Math.floor(Math.log(a)/Math.LN10),s=a/Math.pow(10,i);let r;return r=e?s<1.5?1:s<3?2:s<7?5:10:s<=1?1:s<=2?2:s<=5?5:10,r*Math.pow(10,i)}_drawScatterAxes(t,e){const a=this.w;if(!S.isBrowser())return;const i=this._scatterAxis;if(!i)return;const s="http://www.w3.org/2000/svg",r=e.group({class:"apexcharts-unit-axis"}),n=a.config.grid&&a.config.grid.borderColor||"rgba(128,128,128,0.18)",o="rgba(128,128,128,0.5)",l=a.config.xaxis&&a.config.xaxis.labels&&a.config.xaxis.labels.style&&a.config.xaxis.labels.style.colors,c=Array.isArray(l)?l[0]:l,h=c||"rgba(120,130,140,0.9)",u=(t,e,a,i,n)=>{const o=R.createElementNS(s,"line");o.setAttribute("x1",String(t)),o.setAttribute("y1",String(e)),o.setAttribute("x2",String(a)),o.setAttribute("y2",String(i)),o.setAttribute("stroke",n),o.setAttribute("shape-rendering","crispEdges"),r.node.appendChild(o)},d=(t,e,i,n,o,l,c,h)=>{const u=R.createElementNS(s,"text");u.setAttribute("class",h),u.setAttribute("x",String(e)),u.setAttribute("y",String(i)),u.setAttribute("text-anchor",n),u.setAttribute("dominant-baseline","middle"),u.setAttribute("font-size",`${l}px`),u.setAttribute("font-family",a.config.chart.fontFamily||"inherit"),u.setAttribute("font-weight",String(c)),u.setAttribute("fill",o),u.textContent=t,r.node.appendChild(u)};if("2d"!==i.mode){if("vertical"===i.orientation){if(i.ticks.forEach(t=>{const e=i.plotY(t);i.gridlines&&u(i.plotL,e,i.plotR,e,n);const a=i.formatter?String(i.formatter(t)):this._formatTick(t,i.ticks);d(a,i.plotL-8,e,"end",h,11,400,"apexcharts-unit-tick")}),u(i.plotL,i.plotT,i.plotL,i.plotB,o),i.valueTitle){const t=R.createElementNS(s,"text");t.setAttribute("class","apexcharts-unit-axis-title");const e=14,n=(i.plotT+i.plotB)/2;t.setAttribute("x",String(e)),t.setAttribute("y",String(n)),t.setAttribute("text-anchor","middle"),t.setAttribute("font-size","12px"),t.setAttribute("font-family",a.config.chart.fontFamily||"inherit"),t.setAttribute("font-weight","600"),t.setAttribute("fill",h),t.setAttribute("transform",`rotate(-90 ${e} ${n})`),t.textContent=String(i.valueTitle),r.node.appendChild(t)}return i.lanes.forEach(t=>{const e=c||a.globals.colors[t.i]||a.globals.colors[0]||"#008FFB";d(t.name,t.cx,i.plotB+16,"middle",e,12,600,"apexcharts-unit-lane-label")}),void t.add(r)}i.ticks.forEach((t,e)=>{const a=i.plotX(t);i.gridlines&&u(a,i.plotT,a,i.plotB,n);const s=i.formatter?String(i.formatter(t)):this._formatTick(t,i.ticks),r=0===e?"start":e===i.ticks.length-1?"end":"middle";d(s,a,i.plotB+14,r,h,11,400,"apexcharts-unit-tick")}),u(i.plotL,i.plotB,i.plotR,i.plotB,o),i.xTitle&&d(String(i.xTitle),(i.plotL+i.plotR)/2,i.plotB+32,"middle",h,12,600,"apexcharts-unit-axis-title"),i.plotL>12&&i.lanes.forEach(t=>{const e=c||a.globals.colors[t.i]||a.globals.colors[0]||"#008FFB";d(t.name,i.plotL-8,t.cy,"end",e,12,600,"apexcharts-unit-lane-label")}),t.add(r)}else{if(i.yTicks.forEach(t=>{const e=i.plotY(t);i.gridlines&&u(i.plotL,e,i.plotR,e,n);const a=i.yFormatter?String(i.yFormatter(t)):this._formatTick(t,i.yTicks);d(a,i.plotL-8,e,"end",h,11,400,"apexcharts-unit-tick")}),i.xTicks.forEach(t=>{const e=i.plotX(t);i.gridlines&&u(e,i.plotT,e,i.plotB,n);const a=i.xFormatter?String(i.xFormatter(t)):this._formatTick(t,i.xTicks);d(a,e,i.plotB+14,"middle",h,11,400,"apexcharts-unit-tick")}),u(i.plotL,i.plotB,i.plotR,i.plotB,o),u(i.plotL,i.plotT,i.plotL,i.plotB,o),i.xTitle&&d(String(i.xTitle),(i.plotL+i.plotR)/2,i.plotB+32,"middle",h,12,600,"apexcharts-unit-axis-title"),i.yTitle){const t=R.createElementNS(s,"text");t.setAttribute("class","apexcharts-unit-axis-title");const e=14,n=(i.plotT+i.plotB)/2;t.setAttribute("x",String(e)),t.setAttribute("y",String(n)),t.setAttribute("text-anchor","middle"),t.setAttribute("font-size","12px"),t.setAttribute("font-family",a.config.chart.fontFamily||"inherit"),t.setAttribute("font-weight","600"),t.setAttribute("fill",h),t.setAttribute("transform",`rotate(-90 ${e} ${n})`),t.textContent=String(i.yTitle),r.node.appendChild(t)}t.add(r)}}_formatTick(t,e){if(!isFinite(t))return"";const a=Math.abs(t);if(a>=1e6)return+(t/1e6).toFixed(1)+"M";if(a>=1e4)return+(t/1e3).toFixed(1)+"k";if(Number.isInteger(t))return String(t);const i=Math.abs(e[1]-e[0])||1;return String(+t.toFixed(Math.min(20,Math.max(2,1-Math.floor(Math.log10(i))))))}_largestRemainder(t,e){const a=t.reduce((t,e)=>t+e,0);if(a<=0||e<=0)return t.map(()=>0);const i=t.map(t=>t/a*e),s=i.map(t=>Math.floor(t)),r=s.reduce((t,e)=>t+e,0),n=Math.max(0,e-r),o=i.map((t,e)=>({i:e,frac:t-Math.floor(t)})).sort((t,e)=>e.frac-t.frac),l=s.slice();for(let t=0;t<n&&t<o.length;t++)l[o[t].i]++;return l}_spiral(t,e,a,i,s){const r=[];for(let n=0;n<a;n++){const a=s+n,o=i*Math.sqrt(a+.5),l=a*C;r.push({x:t+o*Math.cos(l),y:e+o*Math.sin(l)})}return r}_fixedRadius(t){return"image"===t.shape&&t.image?Math.max(t.image.width||20,t.image.height||20)/2:this._bubbleActive(t)&&"number"==typeof t.sizeByValue.maxRadius?t.sizeByValue.maxRadius>0?t.sizeByValue.maxRadius:null:"number"==typeof t.size&&t.size>0?t.size:null}_bubbleActive(t){const e=t.sizeByValue;return!(!e||!e.enabled||"image"===t.shape||"square"===t.shape)}_unitValueOf(t){return L(t&&"object"==typeof t?null!=t.value?t.value:t.y:t)}_radiusForValue(t,e){if(null==t||!isFinite(t))return e.minR;const a=e.max>e.min?(t-e.min)/(e.max-e.min):1,i=Math.max(0,Math.min(1,a));if("linear"===e.scale)return e.minR+i*(e.maxR-e.minR);const s=e.minR*e.minR,r=e.maxR*e.maxR;return Math.sqrt(s+i*(r-s))}_bubbleStats(t,e,a){if(!this._bubbleActive(e))return null;let i=1/0,s=-1/0;if(t.forEach(t=>{t&&t.forEach(t=>{const e=this._unitValueOf(t);null!=e&&isFinite(e)&&(e<i&&(i=e),e>s&&(s=e))})}),i===1/0||s<i)return null;const r=e.sizeByValue,n=a,o=Math.max(1,Math.min(n,"number"==typeof r.minRadius?r.minRadius:.35*n));return{min:i,max:s,minR:o,maxR:n,scale:"linear"===r.scale?"linear":"area"}}_resolveStep(t,e,a){const i=t.spacing>0?t.spacing:1,s=this._fixedRadius(t);return s?2*s*i:e/(Math.sqrt(Math.max(1,a))+.5)}_dotRadiusFromStep(t,e){const a=e.spacing>0?e.spacing:1,i=this._fixedRadius(e);return i||Math.max(1,t/(2*a))}_isCorner(t){return"square"===t.shape||"image"===t.shape}_halfExtent(t,e){if("image"===t.shape&&t.image)return{hx:(t.image.width||20)/2,hy:(t.image.height||20)/2};const a=null!=e?e:this._lastDotR;return{hx:a,hy:a}}_place(t,e,a,i,s=1){const r=e;2===r.pk?t.setAttribute("transform","translate("+(a-r.ox*s)+","+(i-r.oy*s)+(1===s?r.tail:") scale("+r.s*s+")")):1===r.pk?(t.setAttribute("x",String(a-r.hx*s)),t.setAttribute("y",String(i-r.hy*s))):(t.setAttribute("cx",String(a)),t.setAttribute("cy",String(i)))}_size(t,e,a){const i=e;0===i.pk?t.setAttribute("r",String(i.r*a)):1===i.pk&&(t.setAttribute("width",String(2*i.hx*a)),t.setAttribute("height",String(2*i.hy*a)))}_baseSpec(t,e){const a=null!=e?e:this._lastDotR;if(!this._isCorner(t))return{pk:0,r:a};const{hx:i,hy:s}=this._halfExtent(t,a);return{pk:1,hx:i,hy:s,r:a}}_resolveMark(t){if(null==t)return null;if("object"==typeof t)return M(t);if("string"!=typeof t||!t)return null;const e=t.trim();if("M"===e[0]||"m"===e[0])return M(e);const a=A(e);return a||(this._markWarned||(this._markWarned=new Set),this._markWarned.has(e)||(this._markWarned.add(e),console.warn(`[ApexCharts] unit chart: no mark named "${e}" is registered. Register one with ApexCharts.registerUnitMark("${e}", pathData), or import a catalog from 'apexcharts/pictograms'.`)),null)}_glyphSpec(t,e,a){const i=Math.round(10*e)/10,s=t.name+t.path+t.viewBox+t.fillRule+i,r=this._specCache.get(s);if(r)return r;const n=t.viewBox||[0,0,100,100],o=2*i*(1-Math.max(0,Math.min(.9,a.padding||0)))*("number"==typeof a.scale&&a.scale>0?a.scale:1),l="width"===a.fit?o/n[2]:"height"===a.fit?o/n[3]:o/Math.max(n[2],n[3]),c=Object.freeze({pk:2,mark:t,d:t.path,fillRule:t.fillRule,s:l,ox:(n[0]+n[2]/2)*l,oy:(n[1]+n[3]/2)*l,tail:") scale("+l+")",r:i});return this._specCache.set(s,c),c}_markSpecFor(t,e,a,i){if("pictogram"!==t.shape)return this._baseSpec(t,i);const s=t.pictogram||{},r=e&&"object"==typeof e?e.mark:void 0,n=Array.isArray(s.mark)?s.mark[a%s.mark.length]:s.mark,o=this._resolveMark(null!=r?r:n);return o?this._glyphSpec(o,i,s):this._baseSpec(c(l({},t),{shape:"square"===s.fallback?"square":"circle"}),i)}_drawDot(t,e,a,i,s,r,n){const o=this.w,l=o.config.stroke.show?o.config.stroke.width:0,c=Array.isArray(o.globals.stroke.colors)&&o.globals.stroke.colors[s]||"none",h="number"==typeof o.config.fill.opacity?o.config.fill.opacity:1;let u;if(2===n.pk)u=o.dom.Paper.path(n.d),u.node.setAttribute("fill",i),"evenodd"===n.fillRule&&u.node.setAttribute("fill-rule","evenodd"),h<1&&u.node.setAttribute("fill-opacity",String(h)),u.node.setAttribute("data:r",String(n.r));else if(1===n.pk&&"image"===e.shape&&e.image&&e.image.src){const t=e.image.width||20,a=e.image.height||20;u=o.dom.Paper.image(e.image.src),u.node.setAttribute("width",String(t)),u.node.setAttribute("height",String(a)),u.node.setAttribute("preserveAspectRatio","xMidYMid meet"),e.image.tint&&u.node.setAttribute("filter",`url(#${this._tintFilter(i)})`)}else if(1===n.pk){const s=2*a;u=t.drawRect(0,0,s,s,e.borderRadius||0,i,1,l,c),u.node.setAttribute("fill",i),h<1&&u.node.setAttribute("fill-opacity",String(h))}else u=t.drawCircle(a,{fill:i,"stroke-width":l,stroke:c}),u.node.setAttribute("fill",i),h<1&&u.node.setAttribute("fill-opacity",String(h));return s>=0&&(u.node.classList.add("apexcharts-unit-area"),u.node.setAttribute("i",String(s)),u.node.setAttribute("j",String(r))),u}_tintFilter(t){const e=this.w,a="http://www.w3.org/2000/svg",i=this._tints||(this._tints=new Map);let s=i.get(t);if(s)return s;s=`apexcharts-unit-tint-${e.globals.chartID}-${i.size}`,i.set(t,s);const r=e.dom.Paper.node;let n=r.querySelector("defs");n||(n=R.createElementNS(a,"defs"),r.insertBefore(n,r.firstChild));const o=R.createElementNS(a,"filter");o.setAttribute("id",s),o.setAttribute("x","0%"),o.setAttribute("y","0%"),o.setAttribute("width","100%"),o.setAttribute("height","100%");const l=R.createElementNS(a,"feFlood");l.setAttribute("flood-color",t),l.setAttribute("result","flood");const c=R.createElementNS(a,"feComposite");return c.setAttribute("in","flood"),c.setAttribute("in2","SourceAlpha"),c.setAttribute("operator","in"),o.appendChild(l),o.appendChild(c),n.appendChild(o),s}_placeDot(t,e,a,i,s){this._place(t,s||this._baseSpec(e),a,i)}_rgb(t){if("string"!=typeof t)return null;let e=t.trim();if("#"===e[0]){4===e.length&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const t=parseInt(e.slice(1,7),16);return isNaN(t)?null:[t>>16&255,t>>8&255,255&t]}const a=e.match(/rgba?\(([^)]+)\)/);if(a){const t=a[1].split(",").map(t=>parseFloat(t));if(t.length>=3&&t.every(t=>!isNaN(t)))return[t[0],t[1],t[2]]}return null}_shouldAnimate(){const t=this.w,e=t.config.chart.animations;return!(!S.isBrowser()||!e||!1===e.enabled||!1===t.globals.shouldAnimate||t.globals.resized&&!t.globals.dataChanged||e.respectReducedMotion&&v())}_seedSprings(t,e,a){const[i,s]=$(e.spring,a),r=this.ctx?this.ctx._unitSprings:null,n=new Map;for(let e=0;e<t.length;e++){const a=t[e],o=r&&!a.isEnter&&null!=a.key?r.get(a.key):null,l=o?o.x:d(a.cx0,i,s),c=o?o.y:d(a.cy0,i,s);o&&(l.stiffness=i,c.stiffness=i,l.damping=s,c.damping=s,a.cx0=l.value,a.cy0=c.value,this._place(a.node,a.spec,a.cx0,a.cy0),0===l.velocity&&0===c.velocity||(a.delay=0)),a.sx=l,a.sy=c,null!=a.key&&n.set(a.key,{x:l,y:c})}this.ctx&&(this.ctx._unitSprings=n)}_stale(t){const e=this.w.dom.Paper;return!!this.w.globals.isDestroyed||!e||!e.node.contains(t)}_runGather(t){const e=this.w,a=e.config.plotOptions.unit,i=Math.max(1,e.config.chart.animations.speed||800),s=Math.min(.6*i,450),r=t.length;for(let e=r;e--;)t[e].delay=t[e].pair?t[e+1].delay:r>1?e/(r-1)*s:0;const n=a.gather||{},o=n.motion||"auto";"spring"!==o&&("auto"!==o||n.easing&&"outCubic"!==n.easing)?this.ctx&&(this.ctx._unitSprings=null):this._seedSprings(t,n,i);for(let e=0;e<r;e++){const a=t[e];a.r0!==a.r1&&(this._size(a.node,a.spec,a.r0/a.r1),this._place(a.node,a.spec,a.cx0,a.cy0,a.r0/a.r1))}for(let e=0;e<r;e++){const a=t[e];a.fill0&&a.fill1&&a.fill0!==a.fill1&&(a._c0=this._rgb(a.fill0),a._c1=this._rgb(a.fill1))}const l="outBack"===n.easing?(c="number"==typeof n.overshoot?n.overshoot:1.70158,t=>1+(c+1)*Math.pow(t-1,3)+c*Math.pow(t-1,2)):"inOutCubic"===n.easing?j:D;var c;const h=performance.now();let u=h;const d=e=>{if(this._stale(t[0].node))return void(this.w.globals.unitGatherRAF=null);const a=Math.min(.25,Math.max(0,(e-u)/1e3));u=e;let s=!0;for(let n=0;n<r;n++){const r=t[n],o=e-h-r.delay,c=Math.max(0,Math.min(1,o/i)),u=D(c);let d,m;if(r.sx&&r.sy){o>=0&&!r.released&&(f(r.sx,r.x),f(r.sy,r.y),r.released=!0);const t=p(r.sx,a),e=p(r.sy,a);r.released&&t&&e||(s=!1),d=r.sx.value,m=r.sy.value}else{const t=l(c);d=r.cx0+(r.x-r.cx0)*t,m=r.cy0+(r.y-r.cy0)*t}let x=1;if(r.r0!==r.r1&&(x=(r.r0+(r.r1-r.r0)*u)/r.r1,this._size(r.node,r.spec,x)),this._place(r.node,r.spec,d,m,x),r.isEnter&&(r.node.style.opacity=String(Math.min(1,2.5*c))),r._c0&&r._c1){const t=Math.round(r._c0[0]+(r._c1[0]-r._c0[0])*u),e=Math.round(r._c0[1]+(r._c1[1]-r._c0[1])*u),a=Math.round(r._c0[2]+(r._c1[2]-r._c0[2])*u);r.node.setAttribute("fill",`rgb(${t},${e},${a})`)}c<1&&(s=!1)}if(s){for(let e=0;e<r;e++){const a=t[e];a.node.style.opacity="",a._c1&&a.fill1&&a.node.setAttribute("fill",a.fill1),a.r0!==a.r1&&(this._size(a.node,a.spec,1),this._place(a.node,a.spec,a.x,a.y))}this.w.globals.unitGatherRAF=null,this.w.globals.animationEnded=!0}else this.w.globals.unitGatherRAF=R.requestAnimationFrame(d)};this.w.globals.unitGatherRAF=R.requestAnimationFrame(d)}_collectExits(t,e,a){const i=Math.max(0,a.maxUnits||5e3),s=[];for(const[a,r]of t)if(!e.has(a)&&"l"!==a[0]&&(s.push(r),s.length>=i))break;return s}_runExits(t,e,a){const i=this.w,s=new g(i,this.ctx),r=this._lastDotR,n=i.layout.gridWidth/2,o=i.layout.gridHeight/2,l="grid"===a.layout||"scatter"===a.layout||"arc"===a.layout||"custom"===a.layout?0:.35,c=[];if(e.forEach(e=>{const i=null!=e.r?e.r:r,n=e.spec||this._baseSpec(a,i),o=this._drawDot(s,a,i,e.fill,-1,0,n);o.node.classList.add("apexcharts-unit-exit"),this._place(o.node,n,e.x,e.y),t.add(o),c.push({node:o.node,x0:e.x,y0:e.y,spec:n})}),!this._shouldAnimate())return void c.forEach(t=>t.node.remove());const h=Math.max(1,i.config.chart.animations.speed||800),u=performance.now(),d=e=>{if(this._stale(t.node))return void(this.w.globals.unitExitRAF=null);const a=Math.max(0,Math.min(1,(e-u)/h)),i=D(a);for(let t=0;t<c.length;t++){const e=c[t];if(l){const t=e.x0+(n-e.x0)*i*l,a=e.y0+(o-e.y0)*i*l;this._place(e.node,e.spec,t,a)}e.node.style.opacity=String(1-i)}a<1?this.w.globals.unitExitRAF=R.requestAnimationFrame(d):(this.w.globals.unitExitRAF=null,t.node&&t.node.remove())};this.w.globals.unitExitRAF=R.requestAnimationFrame(d)}_outerLabelsOn(t){const e=t.clusterLabels;return!!("custom"===t.layout&&e&&!1!==e.show&&e.external&&e.external.show)}_outerLabelLines(t,e,a,i){const s=this.w,r=s.seriesData.seriesNames[t]||`series-${t+1}`,n=a>0?e/a*100:0,o=i.clusterLabels,l="function"==typeof o.formatter?o.formatter(r,{seriesIndex:t,value:e,percent:n,w:s}):`${r}\n${n.toFixed(1)}%`;return String(l).split("\n")}_outerLabelGutter(t,e){const a=this.w,i=e.clusterLabels,s=i.external.connector||{},r=t.reduce((t,e)=>t+e,0),n=[];if(t.forEach((t,a)=>{t>0&&n.push(...this._outerLabelLines(a,t,r,e))}),!n.length)return 0;const o=F(a,n,{fontSize:i.fontSize,fontFamily:i.fontFamily||a.config.chart.fontFamily,fontWeight:i.fontWeight})+(null!=s.gap?s.gap:8)+(null!=s.length?s.length:22)+8+Math.abs(parseFloat(i.external.offsetX)||0);return Math.min(o,.25*a.layout.gridWidth)}_drawOuterLabels(t,e,a,i,s,r){const n=this.w;if(!S.isBrowser())return;const o=s.clusterLabels,l=o.external,c=l.connector||{},h=null!=c.gap?c.gap:8,u=null!=c.length?c.length:22,d=parseFloat(l.offsetX)||0,p=parseFloat(l.offsetY)||0,f=n.layout.gridWidth,m=n.layout.gridHeight,x=this._lastDotR,y=e.filter(t=>t.dots.length>0);if(!y.length)return;let b=0,_=0;if(y.length>1){const t=y.map(t=>t.cx),e=y.map(t=>t.cy);b=Math.max(...t)-Math.min(...t),_=Math.max(...e)-Math.min(...e)}const M=b>_,A=parseFloat(o.fontSize)||13,w=Math.round(1.35*A),R=[];if(y.slice().sort((t,e)=>t.cy-e.cy).forEach((t,e)=>{const r=this._outerLabelLines(t.i,a[t.i],i,s);if(!r.some(t=>""!==t))return;const n=M?t.cx>=f/2?"right":"left":e%2==0?"right":"left",o="right"===n?1:-1;let l=t.dots[0],c=-1/0;t.dots.forEach(e=>{const a=o*e.x-.75*Math.abs(e.y-t.cy);a>c&&(c=a,l=e)});const m={x:l.x+o*(l.r||x),y:l.y},g={x:m.x+o*h,y:m.y};R.push({i:t.i,lines:r,anchor:m,elbow:g,labelX:g.x+o*u+d,idealY:m.y+p,labelY:m.y+p,side:n})}),!R.length)return;const k=R.reduce((t,e)=>Math.max(t,e.lines.length),1)*w,v=k/2;["left","right"].forEach(t=>{!function(t,e,a,i){const s=t.slice().sort((t,e)=>t.idealY-e.idealY);s.forEach(t=>{t.labelY=t.idealY});for(let t=1;t<s.length;t++)s[t].labelY-s[t-1].labelY<e&&(s[t].labelY=s[t-1].labelY+e);const r=s[s.length-1],n=r?r.labelY-a:0;if(n>0)for(let t=s.length-1;t>=0;t--)s[t].labelY-=n,t<s.length-1&&s[t+1].labelY-s[t].labelY<e&&(s[t].labelY=s[t+1].labelY-e);if(null!=i&&s.length&&s[0].labelY<i){const t=i-s[0].labelY;for(let e=0;e<s.length;e++)s[e].labelY+=t}}(R.filter(e=>e.side===t),k+2,m-v,v)});const F=new g(n,this.ctx).group({class:"apexcharts-unit-outer-labels"});if(r){const t=Math.max(1,n.config.chart.animations.speed||800);F.node.classList.add("apexcharts-unit-label-delay"),F.node.style.animationDelay=Math.min(.45*t,600)/1e3+"s"}R.forEach(t=>{const e=n.globals.colors[t.i]||n.globals.colors[0]||"#008FFB";F.add(function(t,e){const{lines:a,lineHeight:i,anchor:s,elbow:r,labelX:n,labelY:o,side:l,connector:c,style:h,foreColor:u}=e,d=new g(t),p=d.group({class:e.groupClass||"apexcharts-outer-label-group"});if(c.show){const t=`M ${s.x} ${s.y} L ${r.x} ${r.y} L ${n} ${o}`,a=d.drawPath({d:t,stroke:c.color,strokeWidth:c.width,fill:"none",strokeLinecap:"round"});a.node.classList.add(e.connectorClass||"apexcharts-outer-label-connector"),p.add(a)}const f="right"===l?n+4:n-4,m=a.length,x=o-(m-1)*i/2,y=d.drawText({x:f,y:x,text:1===m?a[0]:a,textAnchor:"right"===l?"start":"end",fontSize:h.fontSize,fontFamily:h.fontFamily,fontWeight:h.fontWeight,foreColor:u,dominantBaseline:"central",cssClass:e.textClass||"apexcharts-outer-label"});if(m>1){const t=y.node.getElementsByTagName("tspan");for(let e=0;e<t.length;e++)t[e].setAttribute("x",`${f}`),t[e].setAttribute("dy",0===e?"0":`${i}`)}return p.add(y),p}(n,{lines:t.lines,lineHeight:w,anchor:t.anchor,elbow:t.elbow,labelX:t.labelX,labelY:t.labelY,side:t.side,connector:{show:!1!==c.show,width:null!=c.width?c.width:1.5,color:c.color||e},style:{fontSize:o.fontSize,fontFamily:o.fontFamily||n.config.chart.fontFamily,fontWeight:o.fontWeight},foreColor:o.color||n.config.chart.foreColor,groupClass:"apexcharts-unit-outer-label-group",textClass:"apexcharts-unit-outer-label",connectorClass:"apexcharts-unit-label-connector"}))}),t.add(F)}_drawClusterLabel(t,e,a,i,s,r){const n=this.w;if(!S.isBrowser())return;const o="http://www.w3.org/2000/svg",l=n.seriesData.seriesNames[e.i]||`series-${e.i+1}`,c=i>0?a/i*100:0,h=s.clusterLabels,u=parseFloat(h.fontSize)||13;let d;d="function"==typeof h.formatter?h.formatter(l,{seriesIndex:e.i,value:a,percent:c,w:n}):`${l} (${c.toFixed(1)}%)`;const p="string"==typeof d?d:String(d),f=R.createElementNS(o,"text");f.setAttribute("class","apexcharts-unit-label"),f.setAttribute("text-anchor","middle"),f.setAttribute("font-size",`${u}px`),f.setAttribute("font-family",h.fontFamily||n.config.chart.fontFamily||"inherit"),f.setAttribute("font-weight",String(h.fontWeight||600)),f.setAttribute("fill",h.color||r);const m="bottom"===h.position,x=e.outerR+.6*u+3+(h.offsetY||0),g=p.length*u*.55;if(!m&&!e.flat&&!1!==h.curved&&g<=Math.PI*x*.95){const a=e.cy,i=`M ${e.cx-x} ${a} A ${x} ${x} 0 0 1 ${e.cx+x} ${a}`,s=`apexcharts-unit-label-${n.globals.chartID}-${e.i}`,r=R.createElementNS(o,"path");r.setAttribute("id",s),r.setAttribute("d",i),r.setAttribute("fill","none"),r.setAttribute("stroke","none");const l=R.createElementNS(o,"textPath");l.setAttribute("href",`#${s}`),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",`#${s}`),l.setAttribute("startOffset","50%"),l.textContent=p,f.appendChild(l),t.node.appendChild(r)}else{f.setAttribute("x",String(e.cx));const t=m?e.cy+e.outerR+u+6+(h.offsetY||0):e.cy-e.outerR-6-(h.offsetY||0);f.setAttribute("y",String(t)),f.textContent=p}return t.node.appendChild(f),f}}}),t.default=h,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexUnit={})});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.2.0
2
+ * ApexCharts v8.3.1
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function t(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const i in t)if("default"!==i){const n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const e=t(require("apexcharts/core")),i=e.__apex_CoreUtils,n=e.__apex_ChartFactory_getChartClass,s=e.__apex_Fill,o=e.__apex_Graphics,l=e.__apex_Series,a=e.__apex_Utils,r=t=>{const e=function(t){const e=[];let i=t[0],n=t[1],s=e[0]=c(i,n),o=1;for(let l=t.length-1;o<l;o++)i=n,n=t[o+1],e[o]=.5*(s+(s=c(i,n)));return e[o]=s,e}(t),i=t.length-1,n=[];let s,o,l,a;for(let n=0;n<i;n++)l=c(t[n],t[n+1]),Math.abs(l)<1e-6?e[n]=e[n+1]=0:(s=e[n]/l,o=e[n+1]/l,a=s*s+o*o,a>9&&(a=3*l/Math.sqrt(a),e[n]=a*s,e[n+1]=a*o));for(let s=0;s<=i;s++)a=(t[Math.min(i,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+e[s]*e[s])),n.push([a||0,e[s]*a||0]);return n},h={points(t){const e=r(t),i=t[1],n=t[0],s=[],o=e[1],l=e[0];s.push(n,[n[0]+l[0],n[1]+l[1],i[0]-o[0],i[1]-o[1],i[0],i[1]]);for(let i=2,n=e.length;i<n;i++){const n=t[i],o=e[i];s.push([n[0]-o[0],n[1]-o[1],n[0],n[1]])}return s},slice(t,e,i){const n=t.slice(e,i);if(e){if(i-e>1&&n[1].length<6){const t=n[0].length;n[1]=[2*n[0][t-2]-n[0][t-4],2*n[0][t-1]-n[0][t-3]].concat(n[1])}n[0]=n[0].slice(-2)}return n}};function c(t,e){return(e[1]-t[1])/(e[0]-t[0])}function u({graphics:t,w:e,elSeries:i,pointsByCat:n,options:s,distributed:o,realIndex:l,wrapClass:a,pointClass:r}){if(!s||!1===s.show||!n.length)return;const h=null!=s.opacity?s.opacity:.9,c=null!=s.strokeColor?s.strokeColor:"#fff",u=null!=s.strokeWidth?s.strokeWidth:1,x=e.config.chart.animations.enabled&&!e.globals.resized&&!e.globals.dataChanged,g=t.group({class:x?`${a} apexcharts-element-hidden`:a});x&&e.globals.delayedElements.push({el:g.node}),n.forEach(({groups:i,j:n})=>{const a=o?e.globals.colors[n]:e.globals.colors[l],x=s.fillColor,p="series"===x?a:"series-dark"===x?d(a,.45):x||d(a,.45);i.forEach(i=>{const s=t.drawPath({d:i.d,fill:null!=i.fill?i.fill:p,stroke:u>0?c:"none",strokeWidth:u,fillOpacity:h,classes:r});s.attr("data:realIndex",l),s.attr("j",n),s.attr("clip-path",`url(#gridRectBarMask${e.globals.cuid})`),s.node.style.pointerEvents="none",g.add(s)})}),i.add(g)}function d(t,e){const i=a.parseHex(t);if(!i)return t;const n=Math.max(0,1-e);return`rgb(${Math.round(i[0]*n)},${Math.round(i[1]*n)},${Math.round(i[2]*n)})`}function x(t,e){if(!t.length)return"#000";if(1===t.length)return t[0];const i=Math.max(0,Math.min(1,e))*(t.length-1),n=Math.floor(i),s=i-n,o=a.parseHex(t[n])||[0,0,0],l=a.parseHex(t[Math.min(n+1,t.length-1)])||o,r=(t,e)=>Math.round(t+(e-t)*s);return`rgb(${r(o[0],l[0])},${r(o[1],l[1])},${r(o[2],l[2])})`}function g(t){let e=(2654435769^t)>>>0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),((e^e>>>16)>>>0)/4294967296}function p(t,e,i){return`M ${t-i} ${e} a ${i} ${i} 0 1 0 ${2*i} 0 a ${i} ${i} 0 1 0 ${-2*i} 0 `}function f(t,e,i){return`M ${t-i} ${e-i} h ${2*i} v ${2*i} h ${-2*i} z `}const b=class{};class v extends b{constructor(t,e,i){!function(){const t=n("bar");if(Object.getPrototypeOf(v)===t)return;Object.setPrototypeOf(v,t),Object.setPrototypeOf(v.prototype,t.prototype)}(),super(t,e,i)}draw(t,e,n){var r,h,c;const d=this.w,x=new o(this.w),g=new s(this.w);this.violinOptions=d.config.plotOptions.violin,this.pointsOptions=this.violinOptions.points,this.boxOptions=this.violinOptions.box||{},this.cloudSign=P(this.violinOptions.side),this.rainSign=!1===this.pointsOptions.show?0:P(this.pointsOptions.position),this.boxShown=!0===this.boxOptions.show,this.boxFrac=this.boxShown?S(this.boxOptions.width,.15):0,this.rainFrac=S(this.pointsOptions.laneWidth,.4),this.bandwidthScale=this.violinOptions.bandwidthScale||1,this.normalize=this.violinOptions.normalize||"individual",this.distributed=d.config.plotOptions.bar.distributed,this.isHorizontal=d.config.plotOptions.bar.horizontal,this.coreUtils=new i(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const p=x.group({class:"apexcharts-violin-series apexcharts-plot-series"});for(let e=0;e<t.length;e++){let i,s;const o=[],f=[],b=d.globals.comboCharts?n[e]:e,{columnGroupIndex:v}=this.barHelpers.getGroupIndex(b),m=x.group({class:"apexcharts-series",seriesName:a.escapeString(d.seriesData.seriesNames[b]),rel:e+1,"data:realIndex":b});l.addCollapsedClassToSeries(this.w,m,b),t[e].length>0&&(this.visibleI=this.visibleI+1);const P=this.setSeriesAxis(b),S=this.barHelpers.initialPositions(b),{y:y,barHeight:w,yDivision:M,zeroW:F,x:O,barWidth:W,xDivision:C,zeroH:H}=S;s=y,i=O,f.push(i+(null!=W?W:0)/2);const $=x.group({class:"apexcharts-datalabels","data:realIndex":b});if(this.seriesMaxWeight=0,"group"===this.normalize){(d.violinData.seriesViolinDensity[b]||[]).forEach(t=>{t&&t.maxWeight>this.seriesMaxWeight&&(this.seriesMaxWeight=t.maxWeight)})}const I=[];for(let n=0;n<d.globals.dataPoints;n++){const l=this.barHelpers.getStrokeWidth(e,n,b),a=this.isHorizontal?this.drawHorizontalViolin({indexes:{i:e,j:n,realIndex:b,translationsIndex:P},y:s,yDivision:M,barHeight:w,zeroW:F}):this.drawVerticalViolin({indexes:{i:e,j:n,realIndex:b,translationsIndex:P},x:i,xDivision:C,barWidth:W,zeroH:H});i=a.x,s=a.y,n>0&&f.push(a.center),o.push(a.alongRepresentative);const u=this.buildPointsSubPath({realIndex:b,j:n,center:a.center,halfExtent:a.halfExtent,alongFn:a.alongFn,density:a.density,maxWeight:a.maxWeight,cloudBase:a.cloudBase,cloudMaxPx:a.cloudMaxPx,rainCenter:a.rainCenter,rainHalfPx:a.rainHalfPx});u.length&&I.push({groups:u,j:n});const x=g.fillPath({seriesNumber:this.distributed?n:b,dataPointIndex:n,color:this.distributed?d.globals.colors[n]:void 0,value:t[e][n]});this.renderSeries({realIndex:b,pathFill:x,lineFill:d.globals.stroke.colors[b],j:n,i:e,pathFrom:a.pathFrom,pathTo:a.pathTo,strokeWidth:l,elSeries:m,x:i,y:s,series:t,columnGroupIndex:v,barHeight:w,barWidth:W,elDataLabelsWrap:$,visibleSeries:this.visibleI,type:"violin"});const p=m.node.querySelector(`path.apexcharts-violin-area[j='${n}']`);if(p&&isFinite(a.alongRepresentative)&&p.setAttribute(this.isHorizontal?"cx":"cy",`${a.alongRepresentative}`),p&&p.setAttribute("data:center",`${a.center}`),a.boxPaths){const o=null!=(r=this.boxOptions.strokeWidth)?r:1;a.boxPaths.forEach(l=>{this.renderSeries({realIndex:b,pathFill:l.filled?this.boxOptions.fillColor||x:"none",lineFill:d.globals.stroke.colors[b],j:n,i:e,pathFrom:l.pathFrom,pathTo:l.pathTo,strokeWidth:o,elSeries:m,x:i,y:s,series:t,columnGroupIndex:v,barHeight:w,barWidth:W,elDataLabelsWrap:$,visibleSeries:this.visibleI,type:"violin",classes:"apexcharts-raincloud-box"})})}const S=!p&&(null==(c=null==(h=d.globals.barCanvasCoords)?void 0:h[b])?void 0:c[n]);S&&isFinite(a.alongRepresentative)&&(this.isHorizontal?S.cx=a.alongRepresentative:(S.bodyCx=S.cx,S.cx=a.center,S.cy=a.alongRepresentative))}u({graphics:x,w:d,elSeries:m,pointsByCat:I,options:this.pointsOptions,distributed:this.distributed,realIndex:b,wrapClass:"apexcharts-violin-points-wrap",pointClass:"apexcharts-violin-points"}),d.globals.seriesXvalues[b]=f,d.globals.seriesYvalues[b]=o,p.add(m)}return p}drawVerticalViolin({indexes:t,x:e,xDivision:i,barWidth:n,zeroH:s}){var o,l,a,r,h,c,u;const d=this.w,{realIndex:x,j:g,translationsIndex:p}=t,f=this.yRatio[p];d.axisFlags.isXNumeric&&(e=(d.seriesData.seriesX[x][g]-d.globals.minX)/this.xRatio-n/2);const b=e+n*this.visibleI+n/2,v=n/2,m=this.getDensity(x,g),P=this.effectiveMaxWeight(m),S=t=>s-this.logVal(t,x)/f,w=y({halfExtent:v,cloudSign:null!=(o=this.cloudSign)?o:0,rainSign:null!=(l=this.rainSign)?l:0,boxFrac:null!=(a=this.boxFrac)?a:0,rainFrac:null!=(r=this.rainFrac)?r:0}),M=b+w.cloudBaseOff,F=this.buildBodyPath({nodes:m.nodes,center:M,halfExtent:w.cloudMaxPx,maxWeight:P,vertical:!0,alongFn:S,collapsed:!1,sideSign:this.cloudSign});let O=null;const W=null==(c=null==(h=this.ctx)?void 0:h.morphTypeChange)?void 0:c.getInitialPathFor(x,g);return W?O=W:d.globals.previousPaths.length>0&&(O=this.getPreviousPath(x,g,F)),null==O&&(O=this.buildBodyPath({nodes:m.nodes,center:M,halfExtent:w.cloudMaxPx,maxWeight:P,vertical:!0,alongFn:S,collapsed:!0,sideSign:this.cloudSign})),d.axisFlags.isXNumeric||(e+=i),{pathTo:F,pathFrom:O,x:e,y:s,center:b,halfExtent:v,alongFn:S,density:m,maxWeight:P,cloudBase:M,cloudMaxPx:w.cloudMaxPx,rainCenter:b+w.rainCenterOff,rainHalfPx:w.rainHalfPx,boxPaths:this.buildBoxSubPaths({realIndex:x,j:g,boxCenter:b+w.boxCenterOff,boxHalfPx:w.boxHalfPx,alongFn:S,vertical:!0}),alongRepresentative:S(null!=(u=this.series[t.i][g])?u:0)}}drawHorizontalViolin({indexes:t,y:e,yDivision:i,barHeight:n,zeroW:s}){var o,l,a,r,h,c,u;const d=this.w,{realIndex:x,j:g}=t,p=this.invertedYRatio,f=e+n*this.visibleI+n/2,b=n/2,v=this.getDensity(x,g),m=this.effectiveMaxWeight(v),P=t=>s+this.logVal(t,x)/p,S=y({halfExtent:b,cloudSign:null!=(o=this.cloudSign)?o:0,rainSign:null!=(l=this.rainSign)?l:0,boxFrac:null!=(a=this.boxFrac)?a:0,rainFrac:null!=(r=this.rainFrac)?r:0}),w=f+S.cloudBaseOff,M=this.buildBodyPath({nodes:v.nodes,center:w,halfExtent:S.cloudMaxPx,maxWeight:m,vertical:!1,alongFn:P,collapsed:!1,sideSign:this.cloudSign});let F=null;const O=null==(c=null==(h=this.ctx)?void 0:h.morphTypeChange)?void 0:c.getInitialPathFor(x,g);return O?F=O:d.globals.previousPaths.length>0&&(F=this.getPreviousPath(x,g,M)),null==F&&(F=this.buildBodyPath({nodes:v.nodes,center:w,halfExtent:S.cloudMaxPx,maxWeight:m,vertical:!1,alongFn:P,collapsed:!0,sideSign:this.cloudSign})),{pathTo:M,pathFrom:F,x:s,y:e+=i,center:f,halfExtent:b,alongFn:P,maxWeight:m,density:v,cloudBase:w,cloudMaxPx:S.cloudMaxPx,rainCenter:f+S.rainCenterOff,rainHalfPx:S.rainHalfPx,boxPaths:this.buildBoxSubPaths({realIndex:x,j:g,boxCenter:f+S.boxCenterOff,boxHalfPx:S.boxHalfPx,alongFn:P,vertical:!1}),alongRepresentative:P(null!=(u=this.series[t.i][g])?u:0)}}getDensity(t,e){var i;const n=null==(i=this.w.violinData.seriesViolinDensity[t])?void 0:i[e];if(!n||!n.values.length)return{nodes:[],maxWeight:0};const s=n.values.map((t,e)=>e);s.sort((t,e)=>n.values[t]-n.values[e]);const o=[];let l=null;for(const t of s){const e=n.values[t];null!==l&&e===l||(o.push({v:e,w:n.weights[t]}),l=e)}return{nodes:o,maxWeight:n.maxWeight}}effectiveMaxWeight(t){return"group"===this.normalize&&this.seriesMaxWeight>0?this.seriesMaxWeight:t.maxWeight}buildBodyPath({nodes:t,center:e,halfExtent:i,maxWeight:n,vertical:s,alongFn:l,collapsed:a,sideSign:r=0}){const h=new o(this.w);if(0===t.length){const t=l(0);return s?h.move(e,t)+h.line(e,t):h.move(t,e)+h.line(t,e)}const c=t=>{if(a||n<=0)return 0;const e=t/n*i*this.bandwidthScale;return Math.min(i,Math.max(0,e))},u=[],d=[];for(let i=0;i<t.length;i++){const n=l(t[i].v),o=c(t[i].w),a=0===r?e+o:e+r*o,h=0===r?e-o:e;s?(u.push([a,n]),d.push([h,n])):(u.push([n,a]),d.push([n,h]))}return d.reverse(),this.smoothSegment(u,s,!1)+this.smoothSegment(d,s,!0)+"z"}buildBoxSubPaths({realIndex:t,j:e,boxCenter:i,boxHalfPx:n,alongFn:s,vertical:l}){var a,r;const h=this.w;if(!this.boxShown||n<=0)return null;const c=null==(a=h.violinData.seriesViolinSummary[t])?void 0:a[e];if(!c)return null;const u=n*Math.min(1,Math.max(0,null!=(r=this.boxOptions.capWidth)?r:.5)),[d,x,g,p,f]=c.map(t=>s(t)),b=(t,e)=>{const n=new o(this.w),s=(t,e)=>l?[t,e]:[e,t],a=t=>t.map(([t,e],i)=>0===i?n.move(t,e):n.line(t,e)).join(""),r=i;return{whiskers:a([s(r,d),s(r,x)])+a([s(r,p),s(r,f)])+a([s(r-t,d),s(r+t,d)])+a([s(r-t,f),s(r+t,f)]),box:a([s(r-e,x),s(r+e,x),s(r+e,p),s(r-e,p)])+"z"+a([s(r-e,g),s(r+e,g)])}},v=b(u,n),m=b(0,0),P=(i,n)=>{let s=null;return h.globals.previousPaths.length>0&&(s=this.getPreviousPath(t,e,i)),null==s?n:s};return[{pathTo:v.whiskers,pathFrom:P(v.whiskers,m.whiskers),filled:!1},{pathTo:v.box,pathFrom:P(v.box,m.box),filled:!0}]}smoothSegment(t,e,i){const n=new o(this.w),s=t[0];let l=i?n.line(s[0],s[1]):n.move(s[0],s[1]);if(t.length<3||!this.strictlyMonotonic(t,e)){for(let e=1;e<t.length;e++)l+=n.line(t[e][0],t[e][1]);return l}const a=t.map(([t,i])=>e?[i,t]:[t,i]),r=h.points(a);return l+=(t=>{let e="";for(let i=0;i<t.length;i++){const n=t[i],s=n.length;s>4?(e+=`C${n[0]}, ${n[1]}`,e+=`, ${n[2]}, ${n[3]}`,e+=`, ${n[4]}, ${n[5]}`):s>2&&(e+=`S${n[0]}, ${n[1]}`,e+=`, ${n[2]}, ${n[3]}`)}return e})(e?r.map(m):r),l}strictlyMonotonic(t,e){const i=e?1:0;for(let e=1;e<t.length;e++)if(t[e][i]===t[e-1][i])return!1;return!0}buildPointsSubPath({realIndex:t,j:e,center:i,halfExtent:n,alongFn:s,density:o,maxWeight:l,cloudBase:a,cloudMaxPx:r,rainCenter:h,rainHalfPx:c}){var u;const d=0!==this.rainSign,b=d?h:0!==this.cloudSign?a:i,v=d?c:0!==this.cloudSign?r:n;return function({w:t,points:e,seedA:i,seedB:n,center:s,halfExtent:o,alongFn:l,isHorizontal:a,options:r,clampAt:h,sideSign:c}){const u=r;if(!u||!1===u.show)return[];if(!e||!e.length)return[];const d=u.maxPoints||3e3,b=e.length>d?Math.ceil(e.length/d):1,v=null!=u.size?u.size:2.5,m=o*(null!=u.jitter?u.jitter:.5),P=!1!==u.constrainToViolin&&"function"==typeof h,S="square"===u.shape,y=u.colorScale,w=y&&Array.isArray(y.colors)&&y.colors.length>0,M=w?Math.max(2,y.steps||24):1,F=w&&null!=y.min?y.min:t.globals.minY,O=(w&&null!=y.max?y.max:t.globals.maxY)-F||1,W=w?new Array(M).fill(""):[""];for(let t=0;t<e.length;t+=b){const o=e[t],r=l(o);let u=2*(g(7919*i+100003*n+t)-.5)*m;if(P){const t=h(o);u>t&&(u=t),u<-t&&(u=-t)}c&&(u=Math.abs(u)*c);const d=a?r:s+u,x=a?s+u:r,b=S?f(d,x,v):p(d,x,v);if(w){let t=(o-F)/O;t<0&&(t=0),t>1&&(t=1),W[Math.round(t*(M-1))]+=b}else W[0]+=b}if(!w)return W[0]?[{fill:null,d:W[0]}]:[];const C=[];for(let t=0;t<M;t++)W[t]&&C.push({fill:x(y.colors,t/(M-1)),d:W[t]});return C}({w:this.w,points:null==(u=this.w.violinData.seriesViolinPoints[t])?void 0:u[e],seedA:t,seedB:e,center:b,halfExtent:v,alongFn:s,isHorizontal:this.isHorizontal,options:this.pointsOptions,clampAt:d?null:t=>this.halfWidthAtValue(t,o,v,l),sideSign:d?0:this.cloudSign})}halfWidthAtValue(t,e,i,n){const{nodes:s}=e,o=null!=n?n:e.maxWeight;if(!s.length||o<=0)return 0;const l=t=>Math.min(i,t/o*i*this.bandwidthScale);if(t<=s[0].v)return l(s[0].w);if(t>=s[s.length-1].v)return l(s[s.length-1].w);for(let e=1;e<s.length;e++)if(t<=s[e].v){const i=s[e-1],n=s[e],o=n.v===i.v?0:(t-i.v)/(n.v-i.v);return l(i.w+(n.w-i.w)*o)}return 0}logVal(t,e){return this.coreUtils.getLogValAtSeriesIndex(t,e)}}function m(t){const e=[];for(let i=0;i<t.length;i+=2)e.push(t[i+1],t[i]);return e}function P(t){return"right"===t||"bottom"===t?1:"left"===t||"top"===t?-1:0}function S(t,e){let i=e;if("string"==typeof t&&t.trim().endsWith("%")){const e=parseFloat(t);isFinite(e)&&(i=e/100)}else"number"==typeof t&&isFinite(t)&&(i=t);return Math.min(.5,Math.max(0,i))}function y({halfExtent:t,cloudSign:e,rainSign:i,boxFrac:n,rainFrac:s}){const o=n*t,l=0===i?t:s*t,a=0===i?0:i*(t-l);if(0===e)return{cloudBaseOff:0,cloudMaxPx:t,boxCenterOff:0,boxHalfPx:o,rainCenterOff:a,rainHalfPx:l};const r=0===i?0:s,h=2*Math.max(0,1-r-n)*t,c=e*(t-h);return{cloudBaseOff:c,cloudMaxPx:h,boxCenterOff:c-e*o,boxHalfPx:o,rainCenterOff:a,rainHalfPx:l}}e.default.use({violin:v}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>e.default});
5
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function t(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const i in t)if("default"!==i){const n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const e=t(require("apexcharts/core")),i=e.__apex_CoreUtils,n=e.__apex_ChartFactory_getChartClass,s=e.__apex_Fill,o=e.__apex_Graphics,l=e.__apex_Series;function a(t,e,i){var n,s,o,l;if(null==(n=t.axisFlags)?void 0:n.isXNumeric){const n=null==(o=null==(s=t.seriesData)?void 0:s.seriesX)?void 0:o[e];if(n&&n.length&&null!=n[i])return"x:"+n[i]}const a=null==(l=t.globals.labels)?void 0:l[i];return null!=a&&""!==String(a)?"c:"+(Array.isArray(a)?a.join(" "):String(a)):"j:"+i}const r=e.__apex_Utils,h=t=>{const e=function(t){const e=[];let i=t[0],n=t[1],s=e[0]=u(i,n),o=1;for(let l=t.length-1;o<l;o++)i=n,n=t[o+1],e[o]=.5*(s+(s=u(i,n)));return e[o]=s,e}(t),i=t.length-1,n=[];let s,o,l,a;for(let n=0;n<i;n++)l=u(t[n],t[n+1]),Math.abs(l)<1e-6?e[n]=e[n+1]=0:(s=e[n]/l,o=e[n+1]/l,a=s*s+o*o,a>9&&(a=3*l/Math.sqrt(a),e[n]=a*s,e[n+1]=a*o));for(let s=0;s<=i;s++)a=(t[Math.min(i,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+e[s]*e[s])),n.push([a||0,e[s]*a||0]);return n},c={points(t){const e=h(t),i=t[1],n=t[0],s=[],o=e[1],l=e[0];s.push(n,[n[0]+l[0],n[1]+l[1],i[0]-o[0],i[1]-o[1],i[0],i[1]]);for(let i=2,n=e.length;i<n;i++){const n=t[i],o=e[i];s.push([n[0]-o[0],n[1]-o[1],n[0],n[1]])}return s},slice(t,e,i){const n=t.slice(e,i);if(e){if(i-e>1&&n[1].length<6){const t=n[0].length;n[1]=[2*n[0][t-2]-n[0][t-4],2*n[0][t-1]-n[0][t-3]].concat(n[1])}n[0]=n[0].slice(-2)}return n}};function u(t,e){return(e[1]-t[1])/(e[0]-t[0])}function d({graphics:t,w:e,elSeries:i,pointsByCat:n,options:s,distributed:o,realIndex:l,wrapClass:a,pointClass:r}){if(!s||!1===s.show||!n.length)return;const h=null!=s.opacity?s.opacity:.9,c=null!=s.strokeColor?s.strokeColor:"#fff",u=null!=s.strokeWidth?s.strokeWidth:1,d=e.config.chart.animations.enabled&&!e.globals.resized&&!e.globals.dataChanged,g=t.group({class:d?`${a} apexcharts-element-hidden`:a});d&&e.globals.delayedElements.push({el:g.node}),n.forEach(({groups:i,j:n})=>{const a=o?e.globals.colors[n]:e.globals.colors[l],d=s.fillColor,p="series"===d?a:"series-dark"===d?x(a,.45):d||x(a,.45);i.forEach(i=>{const s=t.drawPath({d:i.d,fill:null!=i.fill?i.fill:p,stroke:u>0?c:"none",strokeWidth:u,fillOpacity:h,classes:r});s.attr("data:realIndex",l),s.attr("j",n),s.attr("clip-path",`url(#gridRectBarMask${e.globals.cuid})`),s.node.style.pointerEvents="none",g.add(s)})}),i.add(g)}function x(t,e){const i=r.parseColor(t)||r.parseColor(r.resolveColor(t));if(!i)return t;const n=Math.max(0,1-e);return`rgb(${Math.round(i[0]*n)},${Math.round(i[1]*n)},${Math.round(i[2]*n)})`}function g(t,e){if(!t.length)return"#000";if(1===t.length)return t[0];const i=Math.max(0,Math.min(1,e))*(t.length-1),n=Math.floor(i),s=i-n,o=r.parseHex(t[n])||[0,0,0],l=r.parseHex(t[Math.min(n+1,t.length-1)])||o,a=(t,e)=>Math.round(t+(e-t)*s);return`rgb(${a(o[0],l[0])},${a(o[1],l[1])},${a(o[2],l[2])})`}function p(t){let e=(2654435769^t)>>>0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),((e^e>>>16)>>>0)/4294967296}function f(t,e,i){return`M ${t-i} ${e} a ${i} ${i} 0 1 0 ${2*i} 0 a ${i} ${i} 0 1 0 ${-2*i} 0 `}function b(t,e,i){return`M ${t-i} ${e-i} h ${2*i} v ${2*i} h ${-2*i} z `}const v=class{};class m extends v{constructor(t,e,i){!function(){const t=n("bar");if(Object.getPrototypeOf(m)===t)return;Object.setPrototypeOf(m,t),Object.setPrototypeOf(m.prototype,t.prototype)}(),super(t,e,i)}draw(t,e,n){var a,h,c;const u=this.w,x=new o(this.w),g=new s(this.w);this.violinOptions=u.config.plotOptions.violin,this.pointsOptions=this.violinOptions.points,this.jx=function(t,e){let i=1/0,n=-1/0;return t.slice(0,e.seriesData.series.length).flat(2).forEach(t=>{t===+t&&(t<i&&(i=t),t>n&&(n=t))}),[i,n]}(u.violinData.seriesViolinPoints,u),this.boxOptions=this.violinOptions.box||{},this.cloudSign=P(this.violinOptions.side),this.rainSign=!1===this.pointsOptions.show?0:P(this.pointsOptions.position),this.boxShown=!0===this.boxOptions.show,this.boxFrac=this.boxShown?S(this.boxOptions.width,.15):0,this.rainFrac=S(this.pointsOptions.laneWidth,.4),this.bandwidthScale=this.violinOptions.bandwidthScale||1,this.normalize=this.violinOptions.normalize||"individual",this.distributed=u.config.plotOptions.bar.distributed,this.isHorizontal=u.config.plotOptions.bar.horizontal,this.coreUtils=new i(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t,n);const p=x.group({class:"apexcharts-violin-series apexcharts-plot-series"});for(let e=0;e<t.length;e++){let i,s;const o=[],f=[],b=u.globals.comboCharts?n[e]:e,{columnGroupIndex:v}=this.barHelpers.getGroupIndex(b),m=x.group({class:"apexcharts-series",seriesName:r.escapeString(u.seriesData.seriesNames[b]),rel:e+1,"data:realIndex":b});l.addCollapsedClassToSeries(this.w,m,b),t[e].length>0&&(this.visibleI=this.visibleI+1);const y=this.setSeriesAxis(b),P=this.barHelpers.initialPositions(b),{y:S,barHeight:M,yDivision:w,zeroW:F,x:W,barWidth:C,xDivision:O,zeroH:H}=P;s=S,i=W,f.push(i+(null!=C?C:0)/2);const I=x.group({class:"apexcharts-datalabels","data:realIndex":b});if(this.seriesMaxWeight=0,"group"===this.normalize){(u.violinData.seriesViolinDensity[b]||[]).forEach(t=>{t&&t.maxWeight>this.seriesMaxWeight&&(this.seriesMaxWeight=t.maxWeight)})}const $=[];for(let n=0;n<u.globals.dataPoints;n++){const l=this.barHelpers.getStrokeWidth(e,n,b),r=this.isHorizontal?this.drawHorizontalViolin({indexes:{i:e,j:n,realIndex:b,translationsIndex:y},y:s,yDivision:w,barHeight:M,zeroW:F}):this.drawVerticalViolin({indexes:{i:e,j:n,realIndex:b,translationsIndex:y},x:i,xDivision:O,barWidth:C,zeroH:H});i=r.x,s=r.y,n>0&&f.push(r.center),o.push(r.alongRepresentative);const d=this.buildPointsSubPath({realIndex:b,j:n,center:r.center,halfExtent:r.halfExtent,alongFn:r.alongFn,density:r.density,maxWeight:r.maxWeight,cloudBase:r.cloudBase,cloudMaxPx:r.cloudMaxPx,rainCenter:r.rainCenter,rainHalfPx:r.rainHalfPx});d.length&&$.push({groups:d,j:n});const x=g.fillPath({seriesNumber:this.distributed?n:b,dataPointIndex:n,color:this.distributed?u.globals.colors[n]:void 0,value:t[e][n]});this.renderSeries({realIndex:b,pathFill:x,lineFill:u.globals.stroke.colors[b],j:n,i:e,pathFrom:r.pathFrom,pathTo:r.pathTo,strokeWidth:l,elSeries:m,x:i,y:s,series:t,columnGroupIndex:v,barHeight:M,barWidth:C,elDataLabelsWrap:I,visibleSeries:this.visibleI,type:"violin"});const p=m.node.querySelector(`path.apexcharts-violin-area[j='${n}']`);if(p&&isFinite(r.alongRepresentative)&&p.setAttribute(this.isHorizontal?"cx":"cy",`${r.alongRepresentative}`),p&&p.setAttribute("data:center",`${r.center}`),r.boxPaths){const o=null!=(a=this.boxOptions.strokeWidth)?a:1;r.boxPaths.forEach(l=>{this.renderSeries({realIndex:b,pathFill:l.filled?this.boxOptions.fillColor||x:"none",lineFill:u.globals.stroke.colors[b],j:n,i:e,pathFrom:l.pathFrom,pathTo:l.pathTo,strokeWidth:o,elSeries:m,x:i,y:s,series:t,columnGroupIndex:v,barHeight:M,barWidth:C,elDataLabelsWrap:I,visibleSeries:this.visibleI,type:"violin",classes:"apexcharts-raincloud-box",noLabel:!0})})}const P=!p&&(null==(c=null==(h=u.globals.barCanvasCoords)?void 0:h[b])?void 0:c[n]);P&&isFinite(r.alongRepresentative)&&(this.isHorizontal?P.cx=r.alongRepresentative:(P.bodyCx=P.cx,P.cx=r.center,P.cy=r.alongRepresentative))}d({graphics:x,w:u,elSeries:m,pointsByCat:$,options:this.pointsOptions,distributed:this.distributed,realIndex:b,wrapClass:"apexcharts-violin-points-wrap",pointClass:"apexcharts-violin-points"}),u.globals.seriesXvalues[b]=f,u.globals.seriesYvalues[b]=o,p.add(m)}return p}drawVerticalViolin({indexes:t,x:e,xDivision:i,barWidth:n,zeroH:s}){var o,l,a,r,h,c,u;const d=this.w,{realIndex:x,j:g,translationsIndex:p}=t,f=this.yRatio[p]*(this.isReversed?-1:1);let b=e+n*this.visibleI;d.axisFlags.isXNumeric&&({x:e,barXPosition:b}=this.getBarXForNumericXAxis({x:e,barWidth:n,realIndex:x,j:g}));const v=b+n/2,m=n/2,y=this.getDensity(x,g),P=this.effectiveMaxWeight(y),S=t=>s-this.logVal(t,x)/f,w=M({halfExtent:m,cloudSign:null!=(o=this.cloudSign)?o:0,rainSign:null!=(l=this.rainSign)?l:0,boxFrac:null!=(a=this.boxFrac)?a:0,rainFrac:null!=(r=this.rainFrac)?r:0}),F=v+w.cloudBaseOff,W=this.buildBodyPath({nodes:y.nodes,center:F,halfExtent:w.cloudMaxPx,maxWeight:P,vertical:!0,alongFn:S,collapsed:!1,sideSign:this.cloudSign});let C=null;const O=null==(c=null==(h=this.ctx)?void 0:h.morphTypeChange)?void 0:c.getInitialPathFor(x,g);return O?C=O:d.globals.previousPaths.length>0&&(C=this._prevBody(x,g,W)),null==C&&(C=this.buildBodyPath({nodes:y.nodes,center:F,halfExtent:w.cloudMaxPx,maxWeight:P,vertical:!0,alongFn:S,collapsed:!0,sideSign:this.cloudSign})),d.axisFlags.isXNumeric||(e+=i),{pathTo:W,pathFrom:C,x:e,y:s,center:v,halfExtent:m,alongFn:S,density:y,maxWeight:P,cloudBase:F,cloudMaxPx:w.cloudMaxPx,rainCenter:v+w.rainCenterOff,rainHalfPx:w.rainHalfPx,boxPaths:this.buildBoxSubPaths({realIndex:x,j:g,boxCenter:v+w.boxCenterOff,boxHalfPx:w.boxHalfPx,alongFn:S,vertical:!0}),alongRepresentative:S(null!=(u=d.seriesData.series[x][g])?u:0)}}drawHorizontalViolin({indexes:t,y:e,yDivision:i,barHeight:n,zeroW:s}){var o,l,a,r,h,c,u;const d=this.w,{realIndex:x,j:g}=t,p=this.invertedYRatio*(this.isReversed?-1:1),f=e+n*this.visibleI+n/2,b=n/2,v=this.getDensity(x,g),m=this.effectiveMaxWeight(v),y=t=>s+this.logVal(t,x)/p,P=M({halfExtent:b,cloudSign:null!=(o=this.cloudSign)?o:0,rainSign:null!=(l=this.rainSign)?l:0,boxFrac:null!=(a=this.boxFrac)?a:0,rainFrac:null!=(r=this.rainFrac)?r:0}),S=f+P.cloudBaseOff,w=this.buildBodyPath({nodes:v.nodes,center:S,halfExtent:P.cloudMaxPx,maxWeight:m,vertical:!1,alongFn:y,collapsed:!1,sideSign:this.cloudSign});let F=null;const W=null==(c=null==(h=this.ctx)?void 0:h.morphTypeChange)?void 0:c.getInitialPathFor(x,g);return W?F=W:d.globals.previousPaths.length>0&&(F=this._prevBody(x,g,w)),null==F&&(F=this.buildBodyPath({nodes:v.nodes,center:S,halfExtent:P.cloudMaxPx,maxWeight:m,vertical:!1,alongFn:y,collapsed:!0,sideSign:this.cloudSign})),{pathTo:w,pathFrom:F,x:s,y:e+=i,center:f,halfExtent:b,alongFn:y,maxWeight:m,density:v,cloudBase:S,cloudMaxPx:P.cloudMaxPx,rainCenter:f+P.rainCenterOff,rainHalfPx:P.rainHalfPx,boxPaths:this.buildBoxSubPaths({realIndex:x,j:g,boxCenter:f+P.boxCenterOff,boxHalfPx:P.boxHalfPx,alongFn:y,vertical:!1}),alongRepresentative:y(null!=(u=d.seriesData.series[x][g])?u:0)}}getDensity(t,e){var i;const n=null==(i=this.w.violinData.seriesViolinDensity[t])?void 0:i[e];if(!n||!n.values.length)return{nodes:[],maxWeight:0};const s=n.values.map((t,e)=>e);s.sort((t,e)=>n.values[t]-n.values[e]);const o=[];let l=null;for(const t of s){const e=n.values[t];null!==l&&e===l||(o.push({v:e,w:n.weights[t]}),l=e)}return{nodes:o,maxWeight:n.maxWeight}}effectiveMaxWeight(t){return"group"===this.normalize&&this.seriesMaxWeight>0?this.seriesMaxWeight:t.maxWeight}buildBodyPath({nodes:t,center:e,halfExtent:i,maxWeight:n,vertical:s,alongFn:l,collapsed:a,sideSign:r=0}){const h=new o(this.w);if(0===t.length){const t=l(0);return s?h.move(e,t)+h.line(e,t):h.move(t,e)+h.line(t,e)}const c=t=>{if(a||n<=0)return 0;const e=t/n*i*this.bandwidthScale;return Math.min(i,Math.max(0,e))},u=[],d=[];for(let i=0;i<t.length;i++){const n=l(t[i].v),o=c(t[i].w),a=0===r?e+o:e+r*o,h=0===r?e-o:e;s?(u.push([a,n]),d.push([h,n])):(u.push([n,a]),d.push([n,h]))}return d.reverse(),this.smoothSegment(u,s,!1)+this.smoothSegment(d,s,!0)+"z"}_prevBody(t,e,i){var n,s;const o=null==(s=null==(n=this._prevKeyedPaths(t))?void 0:n.get(a(this.w,t,e)))?void 0:s.d;return o&&m.pathCommandCount(o)===m.pathCommandCount(i)?o:null}buildBoxSubPaths({realIndex:t,j:e,boxCenter:i,boxHalfPx:n,alongFn:s,vertical:l}){var r,h,c;const u=this.w;if(!this.boxShown||n<=0)return null;const d=null==(r=u.violinData.seriesViolinSummary[t])?void 0:r[e];if(!d)return null;const x=n*Math.min(1,Math.max(0,null!=(h=this.boxOptions.capWidth)?h:.5)),[g,p,f,b,v]=d.map(t=>s(t)),m=(t,e)=>{const n=new o(this.w),s=(t,e)=>l?[t,e]:[e,t],a=t=>t.map(([t,e],i)=>0===i?n.move(t,e):n.line(t,e)).join(""),r=i;return{whiskers:a([s(r,g),s(r,p)])+a([s(r,b),s(r,v)])+a([s(r-t,g),s(r+t,g)])+a([s(r-t,v),s(r+t,v)]),box:a([s(r-e,p),s(r+e,p),s(r+e,b),s(r-e,b)])+"z"+a([s(r-e,f),s(r+e,f)])}},y=m(x,n),P=m(0,0),S=u.globals.previousPaths.length?this._prevKeyedPaths(t):null,M=(null==(c=null==S?void 0:S.get(a(u,t,e)))?void 0:c.box)||[];return[{pathTo:y.whiskers,pathFrom:M[0]||P.whiskers,filled:!1},{pathTo:y.box,pathFrom:M[1]||P.box,filled:!0}]}smoothSegment(t,e,i){const n=new o(this.w),s=t[0];let l=i?n.line(s[0],s[1]):n.move(s[0],s[1]);if(t.length<3||!this.strictlyMonotonic(t,e)){for(let e=1;e<t.length;e++)l+=n.line(t[e][0],t[e][1]);return l}const a=t.map(([t,i])=>e?[i,t]:[t,i]),r=c.points(a);return l+=(t=>{let e="";for(let i=0;i<t.length;i++){const n=t[i],s=n.length;s>4?(e+=`C${n[0]}, ${n[1]}`,e+=`, ${n[2]}, ${n[3]}`,e+=`, ${n[4]}, ${n[5]}`):s>2&&(e+=`S${n[0]}, ${n[1]}`,e+=`, ${n[2]}, ${n[3]}`)}return e})(e?r.map(y):r),l}strictlyMonotonic(t,e){const i=e?1:0;for(let e=1;e<t.length;e++)if(t[e][i]===t[e-1][i])return!1;return!0}buildPointsSubPath({realIndex:t,j:e,center:i,halfExtent:n,alongFn:s,density:o,maxWeight:l,cloudBase:a,cloudMaxPx:r,rainCenter:h,rainHalfPx:c}){var u;const d=0!==this.rainSign,x=d?h:0!==this.cloudSign?a:i,v=d?c:0!==this.cloudSign?r:n;return function({points:t,extent:e,seedA:i,seedB:n,center:s,halfExtent:o,alongFn:l,isHorizontal:a,options:r,clampAt:h,sideSign:c}){var u,d;const x=r;if(!x||!1===x.show)return[];if(!t||!t.length)return[];const v=x.maxPoints||3e3,m=t.length>v?Math.ceil(t.length/v):1,y=null!=x.size?x.size:2.5,P=o*(null!=x.jitter?x.jitter:.5),S=!1!==x.constrainToViolin&&"function"==typeof h,M="square"===x.shape,w=x.colorScale,F=w&&Array.isArray(w.colors)&&w.colors.length>0,W=F?Math.max(2,w.steps||24):1,C=null!=(u=null==w?void 0:w.min)?u:e[0],O=(null!=(d=null==w?void 0:w.max)?d:e[1])-C||1,H=F?new Array(W).fill(""):[""];for(let e=0;e<t.length;e+=m){const o=t[e],r=l(o);let u=2*(p(7919*i+100003*n+e)-.5)*P;if(S){const t=h(o);u>t&&(u=t),u<-t&&(u=-t)}c&&(u=Math.abs(u)*c);const d=a?r:s+u,x=a?s+u:r,g=M?b(d,x,y):f(d,x,y);if(F){let t=(o-C)/O;t<0&&(t=0),t>1&&(t=1),H[Math.round(t*(W-1))]+=g}else H[0]+=g}if(!F)return H[0]?[{fill:null,d:H[0]}]:[];const I=[];for(let t=0;t<W;t++)H[t]&&I.push({fill:g(w.colors,t/(W-1)),d:H[t]});return I}({points:null==(u=this.w.violinData.seriesViolinPoints[t])?void 0:u[e],extent:this.jx,seedA:t,seedB:e,center:x,halfExtent:v,alongFn:s,isHorizontal:this.isHorizontal,options:this.pointsOptions,clampAt:d?null:t=>this.halfWidthAtValue(t,o,v,l),sideSign:d?0:this.cloudSign})}halfWidthAtValue(t,e,i,n){const{nodes:s}=e,o=null!=n?n:e.maxWeight;if(!s.length||o<=0)return 0;const l=t=>Math.min(i,t/o*i*this.bandwidthScale);if(t<=s[0].v)return l(s[0].w);if(t>=s[s.length-1].v)return l(s[s.length-1].w);for(let e=1;e<s.length;e++)if(t<=s[e].v){const i=s[e-1],n=s[e],o=n.v===i.v?0:(t-i.v)/(n.v-i.v);return l(i.w+(n.w-i.w)*o)}return 0}logVal(t,e){return this.coreUtils.getLogValAtSeriesIndex(t,e)}}function y(t){const e=[];for(let i=0;i<t.length;i+=2)e.push(t[i+1],t[i]);return e}function P(t){return"right"===t||"bottom"===t?1:"left"===t||"top"===t?-1:0}function S(t,e){let i=e;if("string"==typeof t&&t.trim().endsWith("%")){const e=parseFloat(t);isFinite(e)&&(i=e/100)}else"number"==typeof t&&isFinite(t)&&(i=t);return Math.min(.5,Math.max(0,i))}function M({halfExtent:t,cloudSign:e,rainSign:i,boxFrac:n,rainFrac:s}){const o=n*t,l=0===i?t:s*t,a=0===i?0:i*(t-l);if(0===e)return{cloudBaseOff:0,cloudMaxPx:t,boxCenterOff:0,boxHalfPx:o,rainCenterOff:a,rainHalfPx:l};const r=0===i?0:s,h=2*Math.max(0,1-r-n)*t,c=e*(t-h);return{cloudBaseOff:c,cloudMaxPx:h,boxCenterOff:c-e*o,boxHalfPx:o,rainCenterOff:a,rainHalfPx:l}}e.default.use({violin:m}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>e.default});
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * ApexCharts v8.2.0
2
+ * ApexCharts v8.3.1
3
3
  * (c) 2018-2026 ApexCharts
4
4
  */
5
5
  import * as _core from "apexcharts/core";
@@ -10,6 +10,18 @@ const getChartClass = _core.__apex_ChartFactory_getChartClass;
10
10
  const Fill = _core.__apex_Fill;
11
11
  const Graphics = _core.__apex_Graphics;
12
12
  const Series = _core.__apex_Series;
13
+ function datumKey(w, realIndex, j) {
14
+ var _a, _b, _c, _d;
15
+ if ((_a = w.axisFlags) == null ? void 0 : _a.isXNumeric) {
16
+ const sx = (_c = (_b = w.seriesData) == null ? void 0 : _b.seriesX) == null ? void 0 : _c[realIndex];
17
+ if (sx && sx.length && sx[j] != null) return "x:" + sx[j];
18
+ }
19
+ const lbl = (_d = w.globals.labels) == null ? void 0 : _d[j];
20
+ if (lbl != null && String(lbl) !== "") {
21
+ return "c:" + (Array.isArray(lbl) ? lbl.join(" ") : String(lbl));
22
+ }
23
+ return "j:" + j;
24
+ }
13
25
  const Utils = _core.__apex_Utils;
14
26
  const tangents = (points) => {
15
27
  const m = finiteDifferences(points);
@@ -121,9 +133,20 @@ function finiteDifferences(points) {
121
133
  m[i] = d;
122
134
  return m;
123
135
  }
136
+ function jitterExtent(pool, w) {
137
+ let lo = Infinity;
138
+ let hi = -Infinity;
139
+ pool.slice(0, w.seriesData.series.length).flat(2).forEach((v) => {
140
+ if (v === +v) {
141
+ if (v < lo) lo = v;
142
+ if (v > hi) hi = v;
143
+ }
144
+ });
145
+ return [lo, hi];
146
+ }
124
147
  function buildJitterGroups({
125
- w,
126
148
  points,
149
+ extent,
127
150
  seedA,
128
151
  seedB,
129
152
  center,
@@ -134,6 +157,7 @@ function buildJitterGroups({
134
157
  clampAt,
135
158
  sideSign
136
159
  }) {
160
+ var _a, _b;
137
161
  const opts = options;
138
162
  if (!opts || opts.show === false) return [];
139
163
  if (!points || !points.length) return [];
@@ -147,8 +171,8 @@ function buildJitterGroups({
147
171
  const scale = opts.colorScale;
148
172
  const useScale = scale && Array.isArray(scale.colors) && scale.colors.length > 0;
149
173
  const steps = useScale ? Math.max(2, scale.steps || 24) : 1;
150
- const sMin = useScale && scale.min != null ? scale.min : w.globals.minY;
151
- const sMax = useScale && scale.max != null ? scale.max : w.globals.maxY;
174
+ const sMin = (_a = scale == null ? void 0 : scale.min) != null ? _a : extent[0];
175
+ const sMax = (_b = scale == null ? void 0 : scale.max) != null ? _b : extent[1];
152
176
  const span = sMax - sMin || 1;
153
177
  const buckets = useScale ? new Array(steps).fill("") : [""];
154
178
  for (let k = 0; k < points.length; k += stride) {
@@ -234,7 +258,7 @@ function renderJitter({
234
258
  elSeries.add(elPointsWrap);
235
259
  }
236
260
  function darkenColor(color, amount) {
237
- const rgb = Utils.parseHex(color);
261
+ const rgb = Utils.parseColor(color) || Utils.parseColor(Utils.resolveColor(color));
238
262
  if (!rgb) return color;
239
263
  const f = Math.max(0, 1 - amount);
240
264
  return `rgb(${Math.round(rgb[0] * f)},${Math.round(rgb[1] * f)},${Math.round(rgb[2] * f)})`;
@@ -291,6 +315,7 @@ class Violin extends BarBase {
291
315
  const fill = new Fill(this.w);
292
316
  this.violinOptions = w.config.plotOptions.violin;
293
317
  this.pointsOptions = this.violinOptions.points;
318
+ this.jx = jitterExtent(w.violinData.seriesViolinPoints, w);
294
319
  this.boxOptions = this.violinOptions.box || {};
295
320
  this.cloudSign = crossSign(this.violinOptions.side);
296
321
  this.rainSign = this.pointsOptions.show === false ? 0 : crossSign(this.pointsOptions.position);
@@ -305,7 +330,7 @@ class Violin extends BarBase {
305
330
  series = this.coreUtils.getLogSeries(series);
306
331
  this.series = series;
307
332
  this.yRatio = this.coreUtils.getLogYRatios(this.yRatio);
308
- this.barHelpers.initVariables(series);
333
+ this.barHelpers.initVariables(series, seriesIndex);
309
334
  const ret = graphics.group({
310
335
  class: "apexcharts-violin-series apexcharts-plot-series"
311
336
  });
@@ -452,7 +477,8 @@ class Violin extends BarBase {
452
477
  elDataLabelsWrap,
453
478
  visibleSeries: this.visibleI,
454
479
  type: "violin",
455
- classes: "apexcharts-raincloud-box"
480
+ classes: "apexcharts-raincloud-box",
481
+ noLabel: true
456
482
  });
457
483
  });
458
484
  }
@@ -489,11 +515,16 @@ class Violin extends BarBase {
489
515
  var _a, _b, _c, _d, _e, _f, _g;
490
516
  const w = this.w;
491
517
  const { realIndex, j, translationsIndex } = indexes;
492
- const yRatio = this.yRatio[translationsIndex];
518
+ const yRatio = this.yRatio[translationsIndex] * (this.isReversed ? -1 : 1);
519
+ let barXPosition = x + barWidth * this.visibleI;
493
520
  if (w.axisFlags.isXNumeric) {
494
- x = (w.seriesData.seriesX[realIndex][j] - w.globals.minX) / this.xRatio - barWidth / 2;
521
+ ({ x, barXPosition } = this.getBarXForNumericXAxis({
522
+ x,
523
+ barWidth,
524
+ realIndex,
525
+ j
526
+ }));
495
527
  }
496
- const barXPosition = x + barWidth * this.visibleI;
497
528
  const center = barXPosition + barWidth / 2;
498
529
  const halfExtent = barWidth / 2;
499
530
  const density = this.getDensity(realIndex, j);
@@ -522,7 +553,7 @@ class Violin extends BarBase {
522
553
  if (morphFrom) {
523
554
  pathFrom = morphFrom;
524
555
  } else if (w.globals.previousPaths.length > 0) {
525
- pathFrom = this.getPreviousPath(realIndex, j, pathTo);
556
+ pathFrom = this._prevBody(realIndex, j, pathTo);
526
557
  }
527
558
  if (pathFrom == null) {
528
559
  pathFrom = this.buildBodyPath({
@@ -561,7 +592,7 @@ class Violin extends BarBase {
561
592
  alongFn,
562
593
  vertical: true
563
594
  }),
564
- alongRepresentative: alongFn((_g = this.series[indexes.i][j]) != null ? _g : 0)
595
+ alongRepresentative: alongFn((_g = w.seriesData.series[realIndex][j]) != null ? _g : 0)
565
596
  };
566
597
  }
567
598
  /** @param {{indexes: any, y: any, yDivision: any, barHeight: any, zeroW: any}} opts */
@@ -569,7 +600,7 @@ class Violin extends BarBase {
569
600
  var _a, _b, _c, _d, _e, _f, _g;
570
601
  const w = this.w;
571
602
  const { realIndex, j } = indexes;
572
- const yRatio = this.invertedYRatio;
603
+ const yRatio = this.invertedYRatio * (this.isReversed ? -1 : 1);
573
604
  const barYPosition = y + barHeight * this.visibleI;
574
605
  const center = barYPosition + barHeight / 2;
575
606
  const halfExtent = barHeight / 2;
@@ -599,7 +630,7 @@ class Violin extends BarBase {
599
630
  if (morphFrom) {
600
631
  pathFrom = morphFrom;
601
632
  } else if (w.globals.previousPaths.length > 0) {
602
- pathFrom = this.getPreviousPath(realIndex, j, pathTo);
633
+ pathFrom = this._prevBody(realIndex, j, pathTo);
603
634
  }
604
635
  if (pathFrom == null) {
605
636
  pathFrom = this.buildBodyPath({
@@ -636,7 +667,7 @@ class Violin extends BarBase {
636
667
  alongFn,
637
668
  vertical: false
638
669
  }),
639
- alongRepresentative: alongFn((_g = this.series[indexes.i][j]) != null ? _g : 0)
670
+ alongRepresentative: alongFn((_g = w.seriesData.series[realIndex][j]) != null ? _g : 0)
640
671
  };
641
672
  }
642
673
  /**
@@ -727,6 +758,23 @@ class Violin extends BarBase {
727
758
  leftPts.reverse();
728
759
  return this.smoothSegment(rightPts, vertical, false) + this.smoothSegment(leftPts, vertical, true) + "z";
729
760
  }
761
+ /**
762
+ * The survivor's previous body when it can morph to `pathTo`, else null so
763
+ * the violin regrows from its centreline (a changed density node count
764
+ * cannot tween, and bar corner reconciliation does not apply here).
765
+ *
766
+ * @param {number} realIndex
767
+ * @param {number} j
768
+ * @param {string} pathTo
769
+ * @returns {string | null}
770
+ */
771
+ _prevBody(realIndex, j, pathTo) {
772
+ var _a, _b;
773
+ const d = (_b = (_a = this._prevKeyedPaths(realIndex)) == null ? void 0 : _a.get(
774
+ datumKey(this.w, realIndex, j)
775
+ )) == null ? void 0 : _b.d;
776
+ return d && Violin.pathCommandCount(d) === Violin.pathCommandCount(pathTo) ? d : null;
777
+ }
730
778
  /**
731
779
  * Build the five-number box sub-paths for one category — the raincloud
732
780
  * "umbrella", or a violin box overlay. Two sub-paths so each can carry its
@@ -744,7 +792,7 @@ class Violin extends BarBase {
744
792
  * @returns {{pathTo:string, pathFrom:string, filled:boolean}[] | null}
745
793
  */
746
794
  buildBoxSubPaths({ realIndex, j, boxCenter, boxHalfPx, alongFn, vertical }) {
747
- var _a, _b;
795
+ var _a, _b, _c;
748
796
  const w = this.w;
749
797
  if (!this.boxShown || boxHalfPx <= 0) return null;
750
798
  const summary = (_a = w.violinData.seriesViolinSummary[realIndex]) == null ? void 0 : _a[j];
@@ -769,22 +817,17 @@ class Violin extends BarBase {
769
817
  };
770
818
  const full = build(capHalf, boxHalfPx);
771
819
  const collapsed = build(0, 0);
772
- const fromFor = (pathTo, collapsedFrom) => {
773
- let pathFrom = null;
774
- if (w.globals.previousPaths.length > 0) {
775
- pathFrom = this.getPreviousPath(realIndex, j, pathTo);
776
- }
777
- return pathFrom == null ? collapsedFrom : pathFrom;
778
- };
820
+ const keyed = w.globals.previousPaths.length ? this._prevKeyedPaths(realIndex) : null;
821
+ const prevBox = ((_c = keyed == null ? void 0 : keyed.get(datumKey(w, realIndex, j))) == null ? void 0 : _c.box) || [];
779
822
  return [
780
823
  {
781
824
  pathTo: full.whiskers,
782
- pathFrom: fromFor(full.whiskers, collapsed.whiskers),
825
+ pathFrom: prevBox[0] || collapsed.whiskers,
783
826
  filled: false
784
827
  },
785
828
  {
786
829
  pathTo: full.box,
787
- pathFrom: fromFor(full.box, collapsed.box),
830
+ pathFrom: prevBox[1] || collapsed.box,
788
831
  filled: true
789
832
  }
790
833
  ];
@@ -860,8 +903,11 @@ class Violin extends BarBase {
860
903
  const scatterCenter = offsetLane ? rainCenter : this.cloudSign !== 0 ? cloudBase : center;
861
904
  const scatterHalf = offsetLane ? rainHalfPx : this.cloudSign !== 0 ? cloudMaxPx : halfExtent;
862
905
  return buildJitterGroups({
863
- w: this.w,
864
906
  points: (_a = this.w.violinData.seriesViolinPoints[realIndex]) == null ? void 0 : _a[j],
907
+ extent: (
908
+ /** @type {number[]} */
909
+ this.jx
910
+ ),
865
911
  seedA: realIndex,
866
912
  seedB: j,
867
913
  center: scatterCenter,