vue-data-ui 3.28.6 → 3.28.8

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 (229) hide show
  1. package/dist/BaseDraggableDialog-BK7dj9O6.js +1 -0
  2. package/dist/BaseIcon-CoY0vuL3.js +1 -0
  3. package/dist/{BaseLegendToggle-aT9fOoGO.js → BaseLegendToggle-BIzyyI1h.js} +1 -1
  4. package/dist/{BaseZoomControls-1OdFWrHW.js → BaseZoomControls-JSk9zW3D.js} +1 -1
  5. package/dist/ColorPicker-CwYfNvwH.js +1 -0
  6. package/dist/{DataTable-5Ug6gMAX.js → DataTable-Dof6yhO7.js} +1 -1
  7. package/dist/{HillActions-C8am4I5c.js → HillActions-BMH9pSmQ.js} +1 -1
  8. package/dist/{NonSvgPenAndPaper-CawVDtNj.js → NonSvgPenAndPaper-DXdAh1Sz.js} +1 -1
  9. package/dist/{PackageVersion-u-p5bCcj.js → PackageVersion-Bczw6rsP.js} +1 -1
  10. package/dist/PenAndPaper-DoNTA-SV.js +1 -0
  11. package/dist/SlicerPreview-ChKbdZSU.js +1 -0
  12. package/dist/UserOptions-DW84OKKr.js +1 -0
  13. package/dist/XyAnalysisOptions-U4UJx51x.js +1 -0
  14. package/dist/annotationSlots-OLiW25XN.js +1 -0
  15. package/dist/components/vue-ui-3d-bar.js +1 -1
  16. package/dist/components/vue-ui-accordion.js +1 -1
  17. package/dist/components/vue-ui-age-pyramid.js +1 -1
  18. package/dist/components/vue-ui-annotator.js +1 -1
  19. package/dist/components/vue-ui-bullet.js +1 -1
  20. package/dist/components/vue-ui-bump.js +1 -1
  21. package/dist/components/vue-ui-candlestick.js +1 -1
  22. package/dist/components/vue-ui-carousel-table.js +1 -1
  23. package/dist/components/vue-ui-chestnut.js +1 -1
  24. package/dist/components/vue-ui-chord.js +1 -1
  25. package/dist/components/vue-ui-circle-pack.js +1 -1
  26. package/dist/components/vue-ui-cursor.js +1 -1
  27. package/dist/components/vue-ui-dag.js +1 -1
  28. package/dist/components/vue-ui-dashboard.js +1 -1
  29. package/dist/components/vue-ui-digits.js +1 -1
  30. package/dist/components/vue-ui-donut-evolution.js +1 -1
  31. package/dist/components/vue-ui-donut.js +1 -1
  32. package/dist/components/vue-ui-dumbbell.js +1 -1
  33. package/dist/components/vue-ui-flow.js +1 -1
  34. package/dist/components/vue-ui-funnel.js +1 -1
  35. package/dist/components/vue-ui-galaxy.js +1 -1
  36. package/dist/components/vue-ui-gauge.js +1 -1
  37. package/dist/components/vue-ui-geo.js +1 -1
  38. package/dist/components/vue-ui-gizmo.js +1 -1
  39. package/dist/components/vue-ui-graph.js +1 -1
  40. package/dist/components/vue-ui-heatmap.js +1 -1
  41. package/dist/components/vue-ui-hill.js +1 -1
  42. package/dist/components/vue-ui-history-plot.js +1 -1
  43. package/dist/components/vue-ui-horizontal-bar.js +1 -1
  44. package/dist/components/vue-ui-icon.js +1 -1
  45. package/dist/components/vue-ui-kpi.js +1 -1
  46. package/dist/components/vue-ui-label.js +1 -1
  47. package/dist/components/vue-ui-mini-loader.js +1 -1
  48. package/dist/components/vue-ui-molecule.js +1 -1
  49. package/dist/components/vue-ui-mood-radar.js +1 -1
  50. package/dist/components/vue-ui-nested-donuts.js +1 -1
  51. package/dist/components/vue-ui-onion.js +1 -1
  52. package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
  53. package/dist/components/vue-ui-quadrant.js +1 -1
  54. package/dist/components/vue-ui-quick-chart.js +1 -1
  55. package/dist/components/vue-ui-radar.js +1 -1
  56. package/dist/components/vue-ui-rating.js +1 -1
  57. package/dist/components/vue-ui-relation-circle.js +1 -1
  58. package/dist/components/vue-ui-ridgeline.js +1 -1
  59. package/dist/components/vue-ui-rings.js +1 -1
  60. package/dist/components/vue-ui-scatter.js +1 -1
  61. package/dist/components/vue-ui-skeleton.js +1 -1
  62. package/dist/components/vue-ui-smiley.js +1 -1
  63. package/dist/components/vue-ui-spark-trend.js +1 -1
  64. package/dist/components/vue-ui-sparkbar.js +1 -1
  65. package/dist/components/vue-ui-sparkgauge.js +1 -1
  66. package/dist/components/vue-ui-sparkhistogram.js +1 -1
  67. package/dist/components/vue-ui-sparkline.js +1 -1
  68. package/dist/components/vue-ui-sparkstackbar.js +1 -1
  69. package/dist/components/vue-ui-stackbar.js +1 -1
  70. package/dist/components/vue-ui-stackline.js +1 -1
  71. package/dist/components/vue-ui-strip-plot.js +1 -1
  72. package/dist/components/vue-ui-table-heatmap.js +1 -1
  73. package/dist/components/vue-ui-table-sparkline.js +1 -1
  74. package/dist/components/vue-ui-table.js +1 -1
  75. package/dist/components/vue-ui-thermometer.js +1 -1
  76. package/dist/components/vue-ui-timer.js +1 -1
  77. package/dist/components/vue-ui-tiremarks.js +1 -1
  78. package/dist/components/vue-ui-treemap.js +1 -1
  79. package/dist/components/vue-ui-vertical-bar.js +1 -1
  80. package/dist/components/vue-ui-waffle.js +1 -1
  81. package/dist/components/vue-ui-wheel.js +1 -1
  82. package/dist/components/vue-ui-word-cloud.js +1 -1
  83. package/dist/components/vue-ui-world.js +1 -1
  84. package/dist/components/vue-ui-xy-canvas.js +1 -1
  85. package/dist/components/vue-ui-xy.js +1 -1
  86. package/dist/package-CNWVs68D.js +1 -0
  87. package/dist/{render-common-CTaC-_Nw.js → render-common-DY4sNXDz.js} +1 -1
  88. package/dist/ssr/vue-ui-donut.js +1 -1
  89. package/dist/ssr/vue-ui-xy.js +1 -1
  90. package/dist/ssr.js +1 -1
  91. package/dist/style.css +1 -1
  92. package/dist/types/vue-data-ui.d.ts +96 -0
  93. package/dist/types/vue-ui-xy.d.ts +4 -0
  94. package/dist/useConfig-By3Vb5kz.js +1 -0
  95. package/dist/{useObjectBindings-BCi3Az41.js → useObjectBindings-0vvvimYP.js} +1 -1
  96. package/dist/usePanZoom-CE6Ofyy8.js +1 -0
  97. package/dist/utils.js +1 -1
  98. package/dist/vue-data-ui-BWqplouA.js +1 -0
  99. package/dist/vue-data-ui.js +1 -1
  100. package/dist/vue-ui-3d-bar-DmRrbXjK.js +19 -0
  101. package/dist/{vue-ui-accordion-D4FHxzsL.js → vue-ui-accordion-DFxSW8ET.js} +1 -1
  102. package/dist/vue-ui-age-pyramid-CJJIp5gY.js +1 -0
  103. package/dist/{vue-ui-annotator-DuAQovkf.js → vue-ui-annotator-BnR2XnsL.js} +1 -1
  104. package/dist/vue-ui-bullet-Br7H7FSM.js +34 -0
  105. package/dist/vue-ui-bump-DCDHNvWE.js +8 -0
  106. package/dist/vue-ui-candlestick-C_swW8gM.js +22 -0
  107. package/dist/{vue-ui-carousel-table-CDgmtbuI.js → vue-ui-carousel-table-BP_yVdDm.js} +1 -1
  108. package/dist/vue-ui-chestnut-CIGNqBsT.js +1 -0
  109. package/dist/vue-ui-chord-DZRFBkRJ.js +21 -0
  110. package/dist/vue-ui-circle-pack-CtdPeMsY.js +13 -0
  111. package/dist/{vue-ui-cursor-9khzj4l-.js → vue-ui-cursor-DRQc_V2R.js} +1 -1
  112. package/dist/vue-ui-dag-Cj0CcntI.js +9 -0
  113. package/dist/vue-ui-dashboard-HyzHqAtX.js +1 -0
  114. package/dist/{vue-ui-digits-DdrPl8eP.js → vue-ui-digits-CfdB0vaP.js} +1 -1
  115. package/dist/vue-ui-donut-Cv-bYyBN.js +47 -0
  116. package/dist/{vue-ui-donut-BbJFmKZh.js → vue-ui-donut-Dy4j7B9b.js} +1 -1
  117. package/dist/vue-ui-donut-evolution-DL112anx.js +2 -0
  118. package/dist/vue-ui-dumbbell-owG24VsQ.js +9 -0
  119. package/dist/vue-ui-flow-BMNIydqI.js +3 -0
  120. package/dist/vue-ui-funnel-BsVS3vuI.js +1 -0
  121. package/dist/vue-ui-galaxy-B8HgdBjc.js +1 -0
  122. package/dist/vue-ui-gauge-B1A_NFY6.js +1 -0
  123. package/dist/vue-ui-geo-_TG4jaV9.js +1 -0
  124. package/dist/{vue-ui-gizmo-kebiFGRl.js → vue-ui-gizmo-D0QjzIGt.js} +1 -1
  125. package/dist/vue-ui-graph-DScVnTzu.js +7 -0
  126. package/dist/vue-ui-heatmap-BbQseEbM.js +1 -0
  127. package/dist/vue-ui-hill-D3V84h_t.js +1 -0
  128. package/dist/vue-ui-history-plot-Bx4WYG6U.js +2 -0
  129. package/dist/vue-ui-horizontal-bar-Do0HJy4f.js +4 -0
  130. package/dist/{vue-ui-kpi-D4q8R7Uq.js → vue-ui-kpi-CF7pAl08.js} +1 -1
  131. package/dist/{vue-ui-label-0lSeoxvv.js → vue-ui-label-W0oz08pp.js} +1 -1
  132. package/dist/{vue-ui-mini-loader-C6vhrfx3.js → vue-ui-mini-loader-OLYDdN3T.js} +1 -1
  133. package/dist/vue-ui-molecule-bAMGCA2Y.js +1 -0
  134. package/dist/vue-ui-mood-radar-CFpgxjuR.js +1 -0
  135. package/dist/vue-ui-nested-donuts-CWY26iKX.js +19 -0
  136. package/dist/vue-ui-onion-DsBUqL_c.js +5 -0
  137. package/dist/vue-ui-parallel-coordinate-plot-BF3gO85b.js +9 -0
  138. package/dist/vue-ui-quadrant-BkNG2LGm.js +2 -0
  139. package/dist/vue-ui-quick-chart-CYxvgVpD.js +17 -0
  140. package/dist/vue-ui-radar-0H8CiLmc.js +1 -0
  141. package/dist/{vue-ui-rating-7RAJA7I4.js → vue-ui-rating-B9HeTCLa.js} +1 -1
  142. package/dist/vue-ui-relation-circle-B0BM4xf8.js +1 -0
  143. package/dist/vue-ui-ridgeline-D-fDuE3y.js +2 -0
  144. package/dist/vue-ui-rings-UtlBiaZZ.js +1 -0
  145. package/dist/vue-ui-scatter-CduaARRt.js +9 -0
  146. package/dist/{vue-ui-skeleton-C0oElPXz.js → vue-ui-skeleton-an0peDis.js} +1 -1
  147. package/dist/{vue-ui-smiley-BdhxsPGW.js → vue-ui-smiley-Cht1imV-.js} +1 -1
  148. package/dist/{vue-ui-spark-trend-CRQ5JfVc.js → vue-ui-spark-trend-DCP7blHB.js} +1 -1
  149. package/dist/{vue-ui-sparkbar-BTclK0-F.js → vue-ui-sparkbar-DT3sDgda.js} +1 -1
  150. package/dist/{vue-ui-sparkgauge-zNl9Xmt3.js → vue-ui-sparkgauge-AQt2L5dI.js} +1 -1
  151. package/dist/{vue-ui-sparkhistogram-ynyE3DOc.js → vue-ui-sparkhistogram-a_jc2Dv2.js} +1 -1
  152. package/dist/{vue-ui-sparkline-CtsijvdW.js → vue-ui-sparkline-D2-KcHAU.js} +1 -1
  153. package/dist/{vue-ui-sparkstackbar-RHlqUD-0.js → vue-ui-sparkstackbar-CBI4S5cu.js} +1 -1
  154. package/dist/vue-ui-stackbar-DS_31-a3.js +29 -0
  155. package/dist/vue-ui-stackline-CuxohB0U.js +39 -0
  156. package/dist/vue-ui-strip-plot-bYGhsPA5.js +2 -0
  157. package/dist/{vue-ui-table-heatmap-IYPQ7LMg.js → vue-ui-table-heatmap-D6gpmHg8.js} +1 -1
  158. package/dist/{vue-ui-table-BetuN-ZS.js → vue-ui-table-lzolsJ_n.js} +1 -1
  159. package/dist/{vue-ui-table-sparkline-Fdjb-U1P.js → vue-ui-table-sparkline-By319cB8.js} +1 -1
  160. package/dist/vue-ui-thermometer-B3Uv3aWc.js +1 -0
  161. package/dist/{vue-ui-timer-BKqG5HxS.js → vue-ui-timer-C6Pevf4N.js} +2 -2
  162. package/dist/vue-ui-tiremarks-DeNdCFVD.js +1 -0
  163. package/dist/vue-ui-treemap-Ck9_llHA.js +1 -0
  164. package/dist/vue-ui-waffle-BW2SacnV.js +1 -0
  165. package/dist/vue-ui-wheel-BXDhx5bf.js +1 -0
  166. package/dist/vue-ui-word-cloud-DKPtoruY.js +4 -0
  167. package/dist/vue-ui-world-D9vpDbN7.js +19 -0
  168. package/dist/vue-ui-xy-CMckdUft.js +27 -0
  169. package/dist/{vue-ui-xy-Y_rIBQj0.js → vue-ui-xy-Df5gIADT.js} +1 -1
  170. package/dist/vue-ui-xy-canvas-CBrKi3nN.js +9 -0
  171. package/package.json +1 -1
  172. package/dist/BaseDraggableDialog-9d30Yx8c.js +0 -1
  173. package/dist/BaseIcon-fYK0iID8.js +0 -1
  174. package/dist/ColorPicker-DEJOjcmD.js +0 -1
  175. package/dist/PenAndPaper-r50tK3S4.js +0 -1
  176. package/dist/SlicerPreview-DYuyE9u9.js +0 -1
  177. package/dist/UserOptions-Em_JgDXM.js +0 -1
  178. package/dist/annotationSlots-RvQBEO9-.js +0 -1
  179. package/dist/package-BdTnZDoM.js +0 -1
  180. package/dist/useConfig-D3ZfFSE5.js +0 -1
  181. package/dist/usePanZoom-BdjP5Suc.js +0 -1
  182. package/dist/vue-data-ui-DRkivgOZ.js +0 -1
  183. package/dist/vue-ui-3d-bar-BeM22sZn.js +0 -19
  184. package/dist/vue-ui-age-pyramid-BpkEVmpT.js +0 -1
  185. package/dist/vue-ui-bullet-Cx9Noxp_.js +0 -34
  186. package/dist/vue-ui-bump-DIjSKk8F.js +0 -8
  187. package/dist/vue-ui-candlestick-Cfd63wqQ.js +0 -22
  188. package/dist/vue-ui-chestnut-24bmc5Rq.js +0 -1
  189. package/dist/vue-ui-chord-fQZQ9hjU.js +0 -21
  190. package/dist/vue-ui-circle-pack-C1CbpBNe.js +0 -13
  191. package/dist/vue-ui-dag-B6QkUUCe.js +0 -9
  192. package/dist/vue-ui-dashboard-BBaAZBSj.js +0 -1
  193. package/dist/vue-ui-donut-H65cwWN-.js +0 -47
  194. package/dist/vue-ui-donut-evolution-DeHbG9Rx.js +0 -2
  195. package/dist/vue-ui-dumbbell-ClCVHsrR.js +0 -9
  196. package/dist/vue-ui-flow-DyrpRWOP.js +0 -3
  197. package/dist/vue-ui-funnel-bjH_hFeX.js +0 -1
  198. package/dist/vue-ui-galaxy-BTgZs4Le.js +0 -1
  199. package/dist/vue-ui-gauge-CXZklQPg.js +0 -1
  200. package/dist/vue-ui-geo-0_HimFX5.js +0 -1
  201. package/dist/vue-ui-graph-NTeJASbv.js +0 -7
  202. package/dist/vue-ui-heatmap-aiEMlbZm.js +0 -1
  203. package/dist/vue-ui-hill-ZpLv0IMP.js +0 -1
  204. package/dist/vue-ui-history-plot-4xG3oQtO.js +0 -2
  205. package/dist/vue-ui-horizontal-bar-DMyL8GM6.js +0 -4
  206. package/dist/vue-ui-molecule-4t84pqvx.js +0 -1
  207. package/dist/vue-ui-mood-radar-BGuw0U8y.js +0 -1
  208. package/dist/vue-ui-nested-donuts-BTTJ6KAx.js +0 -19
  209. package/dist/vue-ui-onion-BUbI3uaY.js +0 -5
  210. package/dist/vue-ui-parallel-coordinate-plot-Bn3Y28ZQ.js +0 -9
  211. package/dist/vue-ui-quadrant-CVKEUWqI.js +0 -2
  212. package/dist/vue-ui-quick-chart-BgH0Arb4.js +0 -17
  213. package/dist/vue-ui-radar-Bb0u6tqk.js +0 -1
  214. package/dist/vue-ui-relation-circle-Csx30ROI.js +0 -1
  215. package/dist/vue-ui-ridgeline-Ce1ZrE0B.js +0 -2
  216. package/dist/vue-ui-rings-DgILqhz8.js +0 -1
  217. package/dist/vue-ui-scatter-CX_rE0cU.js +0 -9
  218. package/dist/vue-ui-stackbar-Zhl3to0r.js +0 -29
  219. package/dist/vue-ui-stackline-8JRhuHTg.js +0 -39
  220. package/dist/vue-ui-strip-plot-DL7Ulgpz.js +0 -2
  221. package/dist/vue-ui-thermometer-6kfYImU-.js +0 -1
  222. package/dist/vue-ui-tiremarks-D_ps9th8.js +0 -1
  223. package/dist/vue-ui-treemap-BfOdhGl7.js +0 -1
  224. package/dist/vue-ui-waffle-BL0zzw6B.js +0 -1
  225. package/dist/vue-ui-wheel-v1o2eN3I.js +0 -1
  226. package/dist/vue-ui-word-cloud-HUnuPCyQ.js +0 -4
  227. package/dist/vue-ui-world-BagJihbJ.js +0 -19
  228. package/dist/vue-ui-xy-D948j7de.js +0 -24
  229. package/dist/vue-ui-xy-canvas-CjrbWdJJ.js +0 -9
@@ -1,8 +0,0 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{$ as n,At as r,D as i,Ht as a,J as o,P as s,S as ee,U as c,X as l,at as te,c as ne,i as re,in as ie,nn as ae,nt as oe,r as se,t as ce,w as le,yt as ue,zt as de}from"./lib-rPeBMZrn.js";import{n as fe,t as pe}from"./BaseScanner-8NdoBs7B.js";import{n as me,t as he}from"./useHints-C-TwxM0Y.js";import{t as ge}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as _e}from"./useNestedProp-DnGoh-XS.js";import{t as ve}from"./useThemeCheck-BKNRbGeC.js";import{t as ye}from"./chartImage-DPGnEuYM.js";import{n as be}from"./Title-BliHuXfT.js";import{t as xe}from"./useChartExport-BZts4KFb.js";import{n as Se,t as Ce}from"./tableIntegration-CNoJ1CIY.js";import{n as we,t as Te}from"./annotationSlots-RvQBEO9-.js";import{n as Ee,t as De}from"./userOptionsSlots-DYuo-E5m.js";import{t as Oe}from"./useTimeLabels-Das5O74F.js";import{t as ke}from"./usePrinter-DVf3YcG5.js";import{t as Ae}from"./useSvgLabelLayout-42Kats14.js";import{t as je}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Me}from"./useResponsive-CENUxfEL.js";import{t as Ne}from"./A11yDataTable-DWNlWXzs.js";import{t as Pe}from"./useUserOptionState-CXlFnwPv.js";import{t as Fe}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ie}from"./vue_ui_bump-KJL9GYr4.js";import{t as Le}from"./BaseDraggableDialog-9d30Yx8c.js";import{Fragment as u,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as Re,createTextVNode as ze,createVNode as Be,defineAsyncComponent as g,guardReactiveProps as Ve,mergeProps as He,normalizeClass as Ue,normalizeProps as We,normalizeStyle as _,onBeforeUnmount as Ge,onMounted as Ke,openBlock as v,ref as y,renderList as b,renderSlot as x,resolveDynamicComponent as qe,shallowRef as Je,toDisplayString as S,toRefs as Ye,unref as C,watch as w,watchEffect as Xe,withCtx as T}from"vue";var Ze=/* @__PURE__ */ e({default:()=>_t}),Qe=[`id`],$e=[`id`],et={style:{position:`relative`}},tt=[`xmlns`,`aria-describedby`,`viewBox`],nt=[`x`,`y`,`width`,`height`],rt=[`d`,`stroke`,`stroke-width`,`onMouseenter`],it=[`d`,`stroke`,`stroke-width`,`onMouseenter`,`onMouseleave`,`onClick`],at=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`,`onMouseenter`,`onMouseleave`,`onClick`],ot=[`x`,`y`,`fill`,`font-size`],st=[`onMouseenter`,`onMouseleave`,`onClick`],ct=[`x`,`y`,`fill`,`font-size`],lt=[`x`,`y`,`fill`,`font-size`,`font--weight`,`innerHTML`,`onMouseenter`,`onMouseleave`,`onClick`],ut=[`x`,`y`,`fill`,`font-size`,`font--weight`,`innerHTML`,`onMouseenter`,`onMouseleave`,`onClick`],dt={key:0},ft={key:1},pt=[`text-anchor`,`font-size`,`font-weight`,`fill`,`stroke`,`transform`],mt=[`text-anchor`,`font-size`,`fill`,`transform`,`innerHTML`],ht={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},gt={key:5,class:`vue-data-ui-watermark`},_t=/*#__PURE__*/ ge({__name:`vue-ui-bump`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`copyAlt`],setup(e,{expose:ge,emit:Ze}){let _t=g(()=>import(`./BaseIcon-fYK0iID8.js`).then(e=>e.n)),vt=g(()=>import(`./vue-ui-accordion-D4FHxzsL.js`).then(e=>e.n)),yt=g(()=>import(`./DataTable-5Ug6gMAX.js`)),bt=g(()=>import(`./PenAndPaper-r50tK3S4.js`).then(e=>e.t)),xt=g(()=>import(`./UserOptions-Em_JgDXM.js`).then(e=>e.n)),St=g(()=>import(`./PackageVersion-u-p5bCcj.js`).then(e=>e.t)),{vue_ui_bump:Ct}=t(),{isThemeValid:wt,warnInvalidTheme:Tt}=ve(),E=e,Et=Ze,Dt=d({get(){return!!E.dataset&&E.dataset.length},set(e){return e}}),D=y(null),O=y(l()),Ot=y(0),kt=y(null),At=y(null),jt=y(null),Mt=y(!1),Nt=y(!1),Pt=y(0),Ft=y(0),It=y(null),Lt=y(null),Rt=y(!1),k=y(null),zt=y(null),Bt=y(null),Vt=y(null),A=y(null),Ht=y(!1),j=y(Yt()),M=d(()=>j.value.style.chart.layout.plots),N=d(()=>j.value.style.chart.layout),P=d(()=>j.value.style.chart),F=d(()=>j.value.userOptions);me({config:()=>j.value,dataset:()=>E.dataset,component:`VueUiBump`,rules:[he.emptyArray,{test:e=>e.length>31,message:[`👀 The number of series > 31. Consider:`,``,`▶️ Using filters to let users choose a maximum number of series to display`,``,`▶️ Use several instances of the component to show related series`]},{test:e=>e.length===1,message:[`👀 There is only 1 series in your dataset. Consider:`,``,`▶️ Using a line chart, with VueUiXy.`]},{test:e=>e.some(e=>e.values.length>31),message:[`👀 Some series contain > 31 data points, which can make the chart hard to read. Consider:`,``,`▶️ Use filters to show less data points at a time.`,``,`▶️ Use larger time scales, or aggregated values.`]}]});let I=d(()=>j.value.userOptions.useCursorPointer),Ut=d(()=>ie({defaultConfig:{userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{timeLabels:{show:!1},lines:{coatingColor:`#4A4A4A`},plots:{stroke:`#4A4A4A`,labels:{show:!1,displayedValue:`rank`}},nameLabels:{useSerieColor:!0}}}}},userConfig:j.value.skeletonConfig??{}})),{loading:Wt,FINAL_DATASET:Gt,manualLoading:Kt}=fe({...Ye(E),FINAL_CONFIG:j,prepareConfig:Yt,skeletonDataset:E.config?.skeletonDataset??[{name:`————`,values:[1,1,1,2,2,2,3,3,2,2],color:`#4A4A4A`},{name:`————`,values:[2,2,2,1,3,3,2,2,3,3],color:`#6A6A6A`},{name:`————`,values:[3,3,3,3,1,1,1,1,1,1],color:`#8A8A8A`}],skeletonConfig:ie({defaultConfig:j.value,userConfig:Ut.value})}),qt=y(!1),Jt=0;Ke(un);function Yt(){let e=_e({userConfig:E.config,defaultConfig:Ct}),t={},n=e.theme;if(n){if(!wt.value(e))Tt(e),t=e;else{let r=_e({userConfig:Ie[n]||E.config,defaultConfig:e});t={..._e({userConfig:E.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:ae[n]||a}}}else t=e;return t}let{userOptionsVisible:Xt,setUserOptionsVisibility:Zt,keepUserOptionState:Qt}=Pe({config:j.value}),{svgRef:L}=Fe({config:P.value.title});function $t(){Rt.value=!0,Zt(!0)}function en(){Zt(!1),Rt.value=!1}let R=y({showTable:j.value.table.show});w(j,()=>{R.value={showTable:j.value.table.show}},{immediate:!0}),w(()=>E.config,e=>{Wt.value||(j.value=Yt()),Xt.value=!j.value.userOptions.showOnChartHover,un(),Pt.value+=1,Ft.value+=1,R.value.showTable=j.value.table.show,j.value.responsive||(z.value.width=P.value.width,z.value.height=P.value.height),z.value.paddingRatio={top:P.value.padding.top/P.value.height,right:P.value.padding.right/P.value.width,bottom:P.value.padding.bottom/P.value.height,left:P.value.padding.left/P.value.width}}),w(()=>E.dataset,e=>{Array.isArray(e)&&e.length>0&&(Kt.value=!1)},{deep:!0});let{isPrinting:tn,isImaging:nn,generatePdf:rn,generateImage:an}=ke({elementId:`bump_${O.value}`,fileName:P.value.title.text||`vue-ui-bump`,options:j.value.userOptions.print}),on=d(()=>j.value.userOptions.show&&!P.value.title.text),z=y({width:P.value.width,height:P.value.height,paddingRatio:{top:P.value.padding.top/P.value.height,right:P.value.padding.right/P.value.width,bottom:P.value.padding.bottom/P.value.height,left:P.value.padding.left/P.value.width}}),sn=d(()=>le(j.value.customPalette)),B=Je(null),V=Je(null),cn=y(null),ln=d(()=>j.value.debug);function un(){de(E.dataset)?(te({componentName:`VueUiBump`,type:`dataset`,debug:ln.value}),Kt.value=!0):E.dataset.forEach((e,t)=>{ue({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{Dt.value=!1,te({componentName:`VueUiBump`,type:`datasetSerieAttribute`,property:e,index:t,debug:ln.value}),Kt.value=!0})}),de(E.dataset)||(Kt.value=j.value.loading),setTimeout(()=>{Nt.value=!0},10),j.value.responsive&&(B.value&&(V.value&&B.value.unobserve(V.value),B.value.disconnect()),B.value=new ResizeObserver(()=>{Nt.value=!1;let{width:e,height:t}=Me({chart:D.value,noTitle:At.value,title:P.value.title.text?kt.value:null,legend:null,slicer:null,source:jt.value});cancelAnimationFrame(Jt),Jt=requestAnimationFrame(()=>{z.value.width=e,z.value.height=t-12,qt.value=!0,clearTimeout(cn.value),cn.value=setTimeout(()=>{Nt.value=!0},10)})}),V.value=D.value.parentNode,B.value.observe(V.value))}Ge(()=>{cancelAnimationFrame(Jt),B.value&&(V.value&&B.value.unobserve(V.value),B.value.disconnect())});let dn=d(()=>Gt.value.map((e,t)=>{let n=ee(e.color)||sn.value[t]||a[t]||a[t%a.length];return{...e,absoluteIndex:t,id:l(),color:n}})),H=d(()=>Math.max(...dn.value.map(e=>e.values.length)));function fn(e){let t=e.map(()=>Array(H.value).fill(null));for(let n=0;n<H.value;n+=1){let r=e.map((e,r)=>({seriesIndex:r,value:e.values?.[n],previousPosition:n>0?t[r][n-1]:r})).filter(e=>Number.isFinite(e.value));r.sort((e,t)=>t.value===e.value?e.previousPosition-t.previousPosition:t.value-e.value);for(let e=0;e<r.length;e+=1){let i=r[e];t[i.seriesIndex][n]=e}}return t}let{metrics:pn,ready:mn,settling:hn,update:gn}=Ae({svgRef:L,canMeasure:()=>(!j.value.responsive||qt.value)&&(!N.value.timeLabels.show||Cn.value),initialMetrics:{left:0,right:0,bottom:0},measure:e=>N.value.timeLabels.autoRotate.enable&&Nn()?null:{left:e(zt.value).width,right:e(Bt.value).width,bottom:e(Vt.value).height}});function _n(){return pn.value.left}function vn(){return pn.value.right}let yn=d(()=>N.value.timeLabels.show&&K.value.length?pn.value.bottom+Math.abs(N.value.timeLabels.offsetY)+N.value.timeLabels.fontSize*.3:0),U=d(()=>{let{height:e,width:t}=z.value,{right:n,left:r}=z.value.paddingRatio,i=_n(),a=vn(),o=P.value.padding.top,s=t-t*n-a,ee=t*r+i,c=t-t*n-t*r-i-a,l=e-o-P.value.padding.bottom-yn.value,te=o+l,ne=o+l,re=Math.max(0,e);return{chartHeight:ne,chartWidth:Math.max(0,t),top:o,right:Math.max(0,s),bottom:Math.max(0,te),left:Math.max(0,ee),width:Math.max(0,c),height:Math.max(0,l),unitH:Math.max(0,l)/dn.value.length,unitW:Math.max(0,c)/H.value,svgHeight:re}}),W=d(()=>{if(!Dt.value&&!Wt.value)return[];let e=fn(dn.value);return dn.value.map((t,n)=>({...t,positions:e[n]})).map(e=>{let t=e.positions.map((t,r)=>{let i=re(M.value.labels.formatter,e.values[r],n({p:M.value.labels.prefix,v:e.values[r],s:M.value.labels.suffix,r:M.value.labels.rounding}));return{name:e.name,id:e.id,x:U.value.left+r*U.value.unitW+U.value.unitW/2,y:U.value.top+t*U.value.unitH+U.value.unitH/2,value:e.values[r],displayValue:i,rank:e.positions[r]+1,color:e.color,labelColor:M.value.labels.color===`auto`?se(e.color):ee(M.value.labels.color)??se(e.color)}}),i=t.filter(e=>r(e.value)),a=N.value.lines.smooth?s(i):c(i);return{...e,coordinates:t,path:a}})});d(()=>W.value.flatMap((e,t)=>e.coordinates.map((n,r)=>({...n,pointIndex:r,seriesIndex:t,seriesId:e.id,seriesName:e.name,pointId:`${e.id}_${r}`})).filter(e=>r(e.value))));function bn(e,t,n,r){let i=e.toSorted((e,t)=>e.y-t.y);for(let e=1;e<i.length;e+=1){let n=i[e-1],r=i[e];r.y<n.y+t&&(r.y=n.y+t)}let a=i.length-1;if(a>=0&&i[a].y>r){i[a].y=r;for(let e=a-1;e>=0;--e){let n=i[e+1],r=i[e];r.y>n.y-t&&(r.y=n.y-t)}}if(i.length&&i[0].y<n){let e=n-i[0].y;for(let t=0;t<i.length;t+=1)i[t].y+=e}return i}let xn=d(()=>{let e=[],t=[];W.value.forEach(n=>{let r=n.coordinates.filter(e=>Number.isFinite(e.rank));if(!r.length)return;e.push({...r[0]});let i=r[r.length-1];t.push({...i})});let n=N.value.nameLabels.fontSize,r=n*1.4,i=U.value.top+n,a=U.value.bottom-n,o=bn(t,r,i,a);return{left:bn(e,r,i,a),right:o}});function Sn(e){let t=M.value.labels.fontSize*.4,n=e.displayValue,r=n.length*(M.value.labels.fontSize*(n.length===1?1:.6)),i=M.value.labels.fontSize,a=r+t*2,o=i+t*2,s=e.x-a/2,ee=e.y-o/2,c=M.value.strokeWidth;return{x:s-c/2,y:ee-c/2,width:a+c,height:o+c,fill:e.color,stroke:M.value.stroke,"stroke-width":c,rx:o/2}}let G=y([]),Cn=y(!1),wn=0;Xe(()=>{let e=++wn,t=N.value.timeLabels,n=t.values,r=t.datetimeFormatter,i=H.value;!i||!Array.isArray(n)||n.length===0?(G.value=[],Cn.value=!0):(async()=>{let t=await Oe({values:n,maxDatapoints:i,formatter:r,start:0,end:i});e===wn&&(G.value=t,Cn.value=!0)})()});let K=d(()=>{let e=N.value.timeLabels,t=G.value||[],n=G.value||[],r=H.value,i=t.map(e=>e?.text??``),a=n.map(e=>e?.text??``);return ne(!!e.showOnlyFirstAndLast,!!e.showOnlyAtModulo,Math.max(1,Number(e.modulo)||1),i,a,0,null,r)}),Tn=d(()=>z.value.width),En=d(()=>z.value.height),Dn=d(()=>({start:0,end:H.value})),q=d(()=>[...W.value].map(e=>{let t=[...e.coordinates].filter(e=>r(e.value)).at(-1);return{...e,navigationRank:t?.rank??1/0}}).sort((e,t)=>e.navigationRank-t.navigationRank));function On(){A.value=null,Ht.value=!0}function kn(){jn(),Ht.value=!1}function An(e,t){let n=q.value.length;return n?e===null||e<0||e>=n?0:t===`previous`?(e-1+n)%n:(e+1)%n:null}function jn(){if(A.value!==null){let e=q.value[A.value];e&&$(e,e)}A.value=null,k.value=null}function Mn(e){if(!L.value||Y.value||document.activeElement!==L.value||!q.value.length)return;let t=[`ArrowLeft`,`ArrowUp`].includes(e.key),n=[`ArrowRight`,`ArrowDown`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){jn();return}if(r){if(A.value===null)return;let e=q.value[A.value];if(!e)return;qn(e,e);return}let a=A.value;a===null?a=0:t?a=An(a,`previous`):n&&(a=An(a,`next`));let o=q.value[a];o&&(A.value=a,Q(o,o))}let J=d(()=>({head:Z.value.head,body:W.value.map(e=>[e.name,...e.coordinates.map(e=>r(e.value)?`${e.displayValue} (${e.rank})`:`-`)]),caption:j.value.a11y.translations.tableCaption,notice:j.value.a11y.translations.tableAvailable})),{detectTimeLabelCollisionNow:Nn}=je({timeLabelsEls:Vt,timeLabels:G,slicer:Dn,configRef:j,rotationPath:[`style`,`chart`,`layout`,`timeLabels`,`rotation`],autoRotatePath:[`style`,`chart`,`layout`,`timeLabels`,`autoRotate`,`enable`],isAutoSize:!1,width:Tn,height:En,rotation:N.value.timeLabels.autoRotate.angle,resizeDebounceMs:0}),Y=y(!1);function Pn(){Y.value=!Y.value}function Fn(e){Mt.value=e,Ot.value+=1}function In(){R.value.showTable=!R.value.showTable}w(()=>R.value.showTable,e=>Se(e,j,It));function Ln(){R.value.showTable=!1,Lt.value&&Lt.value.setTableIconState(!1)}function Rn(){return W.value}function zn(e=null){let t=[[P.value.title.text],[P.value.title.subtitle.text],[``]],n=[``,...K.value.map(e=>e?.text??``)],r=W.value.map(e=>[e.name,...e.coordinates.map(e=>`${e.displayValue}`)]),a=W.value.map(e=>[e.name,...e.coordinates.map(e=>`${e.rank}`)]),o=t.concat([[j.value.table.columnNames.values]]).concat([n]).concat(r).concat([[``],[j.value.table.columnNames.ranking],[n]]).concat(a),s=i(o);e?e(s):oe({csvContent:s,title:P.value.title.text||`vue-ui-bump`})}let X=d(()=>Ce({config:j,style:P,mutableConfig:R,dialog:Le,accordion:vt,isFullscreen:Mt,parent:D,maxWidth:800,isCursorPointer:I})),Z=d(()=>({head:[``].concat(K.value.map(e=>e.text)),body:W.value.map((e,t)=>[e.name,...e.coordinates.map(e=>`${e.displayValue} (${e.rank})`)]),config:{th:{backgroundColor:j.value.table.th.backgroundColor,color:j.value.table.th.color,outline:j.value.table.th.outline},td:{backgroundColor:j.value.table.td.backgroundColor,color:j.value.table.td.color,outline:j.value.table.td.outline},breakpoint:j.value.table.responsiveBreakpoint},colNames:[j.value.table.columnNames.series]})),Bn=d(()=>P.value.backgroundColor),Vn=d(()=>P.value.title),{isCallbackImaging:Hn,isCallbackSvg:Un,generateSvg:Wn,onGenerateImage:Gn}=xe({svg:L,title:Vn,legend:null,legendItems:null,backgroundColor:Bn,getSvgCallback:()=>j.value.userOptions.callbacks.svg,generateImage:an}),Kn=ye(D,()=>P.value.title.text);function Q(e,t){k.value=t.id,j.value.events.datapointEnter&&j.value.events.datapointEnter({datapoint:e,seriesIndex:e?.pointIndex??null})}function $(e,t){k.value=null,j.value.events.datapointLeave&&j.value.events.datapointLeave({datapoint:e,seriesIndex:e?.pointIndex??null})}function qn(e,t){j.value.events.datapointClick&&j.value.events.datapointClick({datapoint:e,seriesIndex:e?.pointIndex??null})}async function Jn(){Et(`copyAlt`,{config:j.value,dataset:W.value}),j.value.userOptions.callbacks.altCopy?await Promise.resolve(j.value.userOptions.callbacks.altCopy({config:j.value,dataset:W.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}return ge({getData:Rn,getImage:Kn,generatePdf:rn,generateCsv:zn,generateImage:an,generateSvg:Wn,toggleTable:In,toggleAnnotator:Pn,toggleFullscreen:Fn,copyAlt:Jn}),w(()=>[z.value.width,z.value.height,N.value,G.value,Cn.value,zt.value,Bt.value,Vt.value,E.dataset,qt.value,j.value.style.fontFamily],gn,{flush:`post`,deep:!0}),(e,t)=>(v(),m(`div`,{id:`bump_${O.value}`,ref_key:`bumpChart`,ref:D,class:Ue({"vue-data-ui-component":!0,"vue-ui-bump":!0,"vue-data-ui-wrapper-fullscreen":Mt.value}),style:_(`background:${P.value.backgroundColor};color:${P.value.color};font-family:${j.value.style.fontFamily}; position: relative; ${j.value.responsive?`height: 100%`:``}`),onMouseenter:$t,onMouseleave:en},[h(`p`,{id:`chart-instructions-${O.value}`,class:`sr-only`},S(j.value.a11y.translations.keyboardNavigation),9,$e),J.value.body.length?(v(),f(Ne,{key:0,uid:O.value,head:J.value.head,body:J.value.body,caption:J.value.caption,notice:J.value.notice},null,8,[`uid`,`head`,`body`,`caption`,`notice`])):p(``,!0),F.value.buttons.annotator?(v(),f(C(bt),{key:1,showGroupActions:F.value.annotator?.showGroupActions??!0,svgRef:C(L),backgroundColor:P.value.backgroundColor,color:P.value.color,active:Y.value,isCursorPointer:I.value,palette:F.value.annotatorPalette,onClose:Pn},Re({_:2},[b(C(Te),t=>({name:t,fn:T(n=>[x(e.$slots,t,We(Ve(C(we)(t,n))),void 0,!0)])}))]),1032,[`showGroupActions`,`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):p(``,!0),x(e.$slots,`userConfig`,{},void 0,!0),on.value?(v(),m(`div`,{key:2,ref_key:`noTitle`,ref:At,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):p(``,!0),P.value.title.text?(v(),m(`div`,{key:3,ref_key:`chartTitle`,ref:kt,style:`width:100%;background:transparent;`},[(v(),f(be,{key:`title_${Pt.value}`,config:{title:{cy:`bump-title`,...P.value.title},subtitle:{cy:`bump-subtitle`,...P.value.title.subtitle}}},null,8,[`config`]))],512)):p(``,!0),F.value.show&&Dt.value&&(C(Qt)||C(Xt))?(v(),f(C(xt),{ref_key:`userOptionsRef`,ref:Lt,key:`user_option_${Ot.value}`,backgroundColor:P.value.backgroundColor,color:P.value.color,isPrinting:C(tn),isImaging:C(nn),uid:O.value,hasTooltip:!1,hasPdf:F.value.buttons.pdf,hasImg:F.value.buttons.img,hasSvg:F.value.buttons.svg,hasXls:F.value.buttons.csv,hasTable:F.value.buttons.table,hasLabel:!1,hasAltCopy:F.value.buttons.altCopy,hasFullscreen:F.value.buttons.fullscreen,isFullcreen:Mt.value,chartElement:D.value,position:F.value.position,titles:{...F.value.buttonTitles},hasAnnotator:F.value.buttons.annotator,isAnnotation:Y.value,callbacks:F.value.callbacks,printScale:F.value.print.scale,tableDialog:j.value.table.useDialog,isCursorPointer:I.value,onToggleFullscreen:Fn,onGeneratePdf:C(rn),onGenerateCsv:zn,onGenerateImage:C(Gn),onGenerateSvg:C(Wn),onToggleTable:In,onToggleAnnotator:Pn,onCopyAlt:Jn,style:_({visibility:C(Qt)?C(Xt)?`visible`:`hidden`:`visible`})},Re({_:2},[b(C(Ee)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:T(n=>[x(e.$slots,t,We(Ve(C(De)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasAltCopy.hasFullscreen.isFullcreen.chartElement.position.titles.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):p(``,!0),h(`div`,et,[(v(),m(`svg`,{ref_key:`svgRef`,ref:L,xmlns:C(ce),"aria-describedby":`chart-instructions-${O.value}`,viewBox:`0 0 ${U.value.chartWidth<=0?10:U.value.chartWidth} ${U.value.svgHeight<=0?10:U.value.svgHeight}`,class:Ue({"vue-data-ui-loading":C(Wt),"no-transition":!j.value.useCssAnimation}),style:_(`max-width:100%;overflow:visible;background:transparent;color:${P.value.color};visibility:${C(mn)?`visible`:`hidden`}`),role:`img`,"aria-live":`polite`,preserveAspectRatio:`xMidYMid`,tabindex:`0`,onFocus:On,onBlur:kn,onKeydown:Mn},[Be(C(St)),x(e.$slots,`svg-underlayer`,{svg:{drawingArea:U.value,data:W.value,isPrintingImg:C(tn)||C(nn)||C(Hn),isPrintingSvg:C(Un)}},void 0,!0),e.$slots[`chart-background`]?(v(),m(`foreignObject`,{key:0,x:U.value.left,y:U.value.top,width:U.value.width<=0?10:U.value.width,height:U.value.height<=0?10:U.value.height,style:{pointerEvents:`none`}},[x(e.$slots,`chart-background`,{},void 0,!0)],8,nt)):p(``,!0),(v(!0),m(u,null,b(W.value,e=>(v(),m(u,null,[h(`path`,{class:`transition-opacity`,d:`M${e.path}`,stroke:N.value.lines.coatingColor,"stroke-width":N.value.lines.strokeWidth+2,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`,style:_({opacity:k.value==null||k.value===e.id?1:.1}),onMouseenter:t=>k.value=e.id,onMouseleave:t[0]||=e=>k.value=null},null,44,rt),h(`path`,{class:`transition-opacity`,d:`M${e.path}`,stroke:e.color,"stroke-width":N.value.lines.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`,style:_({opacity:k.value==null||k.value===e.id?1:.1}),onMouseenter:t=>Q(e,e),onMouseleave:t=>$(e,e),onClick:t=>qn(e,e)},null,44,it)],64))),256)),(v(!0),m(u,null,b(W.value,t=>(v(),m(u,null,[M.value.labels.displayedValue===`rank`?(v(!0),m(u,{key:0},b(t.coordinates,(e,n)=>(v(),m(`circle`,{class:`transition-opacity`,cx:e.x,cy:e.y,r:M.value.radius,fill:t.color,stroke:M.value.stroke,"stroke-width":M.value.strokeWidth,style:_({opacity:k.value==null||k.value===t.id?1:.1}),onMouseenter:r=>Q({...e,pointIndex:n},t),onMouseleave:r=>$({...e,pointIndex:n},t),onClick:r=>Q({...e,pointIndex:n},t)},null,44,at))),256)):p(``,!0),M.value.labels.show&&M.value.labels.displayedValue===`rank`?(v(!0),m(u,{key:1},b(t.coordinates,e=>(v(),m(`text`,{class:`transition-opacity`,x:e.x,y:e.y+M.value.labels.fontSize/3,fill:e.labelColor,"font-size":M.value.labels.fontSize,"text-anchor":`middle`,style:_({userSelect:`none`,pointerEvents:`none`,opacity:k.value==null||k.value===t.id?1:.1})},S(e.rank),13,ot))),256)):p(``,!0),M.value.labels.displayedValue===`value`?(v(!0),m(u,{key:2},b(t.coordinates,n=>(v(),m(u,null,[C(r)(n.value)?(v(),m(`rect`,He({key:0,class:`transition-opacity`},{ref_for:!0},Sn(n),{style:{opacity:k.value==null||k.value===t.id?1:.1},onMouseenter:n=>Q({...e.point,pointIndex:e.i},t),onMouseleave:n=>$({...e.point,pointIndex:e.i},t),onClick:n=>Q({...e.point,pointIndex:e.i},t)}),null,16,st)):p(``,!0),C(r)(n.value)&&M.value.labels.show?(v(),m(`text`,{key:1,class:`transition-opacity`,x:n.x,y:n.y+M.value.labels.fontSize/3,fill:n.labelColor,"font-size":M.value.labels.fontSize,"text-anchor":`middle`,style:_({userSelect:`none`,pointerEvents:`none`,opacity:k.value==null||k.value===t.id?1:.1})},S(n.displayValue),13,ct)):p(``,!0)],64))),256)):p(``,!0)],64))),256)),N.value.nameLabels.leftLabels.show?(v(),m(`g`,{key:1,ref_key:`labelsLeft`,ref:zt},[(v(!0),m(u,null,b(xn.value.left.filter(e=>C(r)(e.value)),(e,t)=>(v(),m(`text`,{class:`transition-opacity`,x:U.value.left,y:e.y+N.value.nameLabels.fontSize/3,fill:N.value.nameLabels.useSerieColor?e.color:N.value.nameLabels.color,"font-size":N.value.nameLabels.fontSize,"font--weight":N.value.nameLabels.bold?`bold`:`normal`,"text-anchor":`end`,innerHTML:C(o)({content:e.name,fontSize:N.value.nameLabels.fontSize,fill:N.value.nameLabels.useSerieColor?e.color:N.value.nameLabels.color,x:U.value.left-N.value.nameLabels.offsetX,y:e.y+N.value.nameLabels.fontSize/3,translateY:!0}),style:_({opacity:k.value==null||k.value===e.id?1:.1}),onMouseenter:t=>Q(e,e),onMouseleave:t=>$(e,e),onClick:t=>qn(e,e)},null,44,lt))),256))],512)):p(``,!0),N.value.nameLabels.rightLabels.show?(v(),m(`g`,{key:2,ref_key:`labelsRight`,ref:Bt},[(v(!0),m(u,null,b(xn.value.right.filter(e=>C(r)(e.value)),(e,t)=>(v(),m(`text`,{class:`transition-opacity`,x:U.value.right,y:e.y+N.value.nameLabels.fontSize/3,fill:N.value.nameLabels.useSerieColor?e.color:N.value.nameLabels.color,"font-size":N.value.nameLabels.fontSize,"font--weight":N.value.nameLabels.bold?`bold`:`normal`,"text-anchor":`start`,innerHTML:C(o)({content:e.name,fontSize:N.value.nameLabels.fontSize,fill:N.value.nameLabels.useSerieColor?e.color:N.value.nameLabels.color,x:U.value.right+N.value.nameLabels.offsetX,y:e.y+N.value.nameLabels.fontSize/3,translateY:!0}),style:_({opacity:k.value==null||k.value===e.id?1:.1}),onMouseenter:t=>Q(e,e),onMouseleave:t=>$(e,e),onClick:t=>qn(e,e)},null,44,ut))),256))],512)):p(``,!0),N.value.timeLabels.show?(v(),m(`g`,{key:3,ref_key:`timeLabelsEls`,ref:Vt},[e.$slots[`time-label`]?(v(),m(`g`,dt,[(v(!0),m(u,null,b(K.value,(t,n)=>(v(),m(`g`,null,[x(e.$slots,`time-label`,He({ref_for:!0},{x:U.value.unitW*n+U.value.unitW/2+U.value.left,y:U.value.chartHeight+N.value.timeLabels.offsetY,fontSize:N.value.timeLabels.fontSize,fill:N.value.timeLabels.color,transform:`translate(${U.value.unitW*n+U.value.unitW/2+U.value.left}, ${U.value.chartHeight+N.value.timeLabels.offsetY}), rotate(${N.value.timeLabels.rotation})`,absoluteIndex:t.absoluteIndex,content:t.text,textAnchor:N.value.timeLabels.rotation>0?`start`:P.value.layout.timeLabels.rotation<0?`end`:`middle`,show:!0}),void 0,!0)]))),256))])):(v(),m(`g`,ft,[(v(!0),m(u,null,b(K.value,(e,t)=>(v(),m(`g`,null,[String(e.text).includes(`
2
- `)?(v(),m(`text`,{key:t+`-multi`,"text-anchor":N.value.timeLabels.rotation>0?`start`:N.value.timeLabels.rotation<0?`end`:`middle`,"font-size":N.value.timeLabels.fontSize,fill:N.value.timeLabels.color,transform:`
3
- translate(
4
- ${U.value.unitW*t+U.value.unitW/2+U.value.left},
5
- ${U.value.chartHeight+N.value.timeLabels.fontSize*1.3+N.value.timeLabels.offsetY}
6
- ),
7
- rotate(${N.value.timeLabels.rotation})
8
- `,innerHTML:C(o)({content:String(e.text),fontSize:N.value.timeLabels.fontSize,fill:P.value.layout.timeLabels.color,stroke:P.value.backgroundColor,x:0,y:0})},null,8,mt)):(v(),m(`text`,{class:`vue-data-ui-time-label`,key:t,"text-anchor":N.value.timeLabels.rotation>0?`start`:N.value.timeLabels.rotation<0?`end`:`middle`,"font-size":N.value.timeLabels.fontSize,"font-weight":N.value.timeLabels.bold?`bold`:`normal`,fill:N.value.timeLabels.color,stroke:P.value.backgroundColor,"stroke-width":`3`,"stroke-linejoin":`round`,"stroke-linecap":`round`,"paint-order":`stroke fill`,transform:`translate(${U.value.unitW*t+U.value.unitW/2+U.value.left}, ${U.value.chartHeight+N.value.timeLabels.offsetY}), rotate(${N.value.timeLabels.rotation})`},S(e.text),9,pt))]))),256))]))],512)):p(``,!0),x(e.$slots,`svg`,{svg:{drawingArea:U.value,data:W.value,isPrintingImg:C(tn)||C(nn)||C(Hn),isPrintingSvg:C(Un)}},void 0,!0)],46,tt)),e.$slots.hint?(v(),m(`div`,ht,[x(e.$slots,`hint`,We(Ve({hint:j.value.a11y.translations.keyboardNavigation,isVisible:Ht.value})),void 0,!0)])):p(``,!0)]),e.$slots.watermark?(v(),m(`div`,gt,[x(e.$slots,`watermark`,We(Ve({isPrinting:C(tn)||C(nn)||C(Hn)||C(Un)})),void 0,!0)])):p(``,!0),Dt.value&&F.value.buttons.table?(v(),f(qe(X.value.component),He({key:6},X.value.props,{ref_key:`tableUnit`,ref:It,onClose:Ln}),Re({content:T(()=>[Be(C(yt),{colNames:Z.value.colNames,head:Z.value.head,body:Z.value.body,config:Z.value.config,title:j.value.table.useDialog?``:X.value.title,withCloseButton:!j.value.table.useDialog,isCursorPointer:I.value,onClose:Ln},{th:T(({th:e})=>[h(`div`,null,S(e),1)]),td:T(({td:e})=>[ze(S(e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`])]),_:2},[j.value.table.useDialog?{name:`title`,fn:T(()=>[ze(S(X.value.title),1)]),key:`0`}:void 0,j.value.table.useDialog?{name:`actions`,fn:T(()=>[h(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[1]||=e=>zn(F.value.callbacks.csv),style:_({cursor:I.value?`pointer`:`default`})},[Be(C(_t),{name:`fileCsv`,stroke:X.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):p(``,!0),e.$slots.source?(v(),m(`div`,{key:7,ref_key:`source`,ref:jt,dir:`auto`},[x(e.$slots,`source`,{},void 0,!0)],512)):p(``,!0),x(e.$slots,`skeleton`,{},()=>[C(Wt)?(v(),f(pe,{key:0})):p(``,!0)],!0)],46,Qe))}},[[`__scopeId`,`data-v-6d53f22b`]]);export{Ze as n,_t as t};
@@ -1,22 +0,0 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{$ as n,D as r,Dt as i,Jt as a,Qt as o,X as s,Yt as c,_ as l,_t as ee,at as te,b as u,c as ne,gt as re,in as ie,nt as ae,pt as oe,rn as se,t as ce,wt as le,zt as ue}from"./lib-rPeBMZrn.js";import{n as de,t as fe}from"./BaseScanner-8NdoBs7B.js";import{n as pe,t as me}from"./useHints-C-TwxM0Y.js";import{t as he}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as ge}from"./useNestedProp-DnGoh-XS.js";import{t as _e}from"./useThemeCheck-BKNRbGeC.js";import{t as ve}from"./img-D4RQwASc.js";import{n as ye}from"./Title-BliHuXfT.js";import{t as be}from"./useChartExport-BZts4KFb.js";import{n as xe,t as Se}from"./tableIntegration-CNoJ1CIY.js";import{n as Ce,t as we}from"./annotationSlots-RvQBEO9-.js";import{n as Te,t as Ee}from"./userOptionsSlots-DYuo-E5m.js";import{n as De,r as Oe,t as ke}from"./useTimeLabels-Das5O74F.js";import{t as Ae}from"./usePrinter-DVf3YcG5.js";import{t as je}from"./useTransitions-ChGGrtrv.js";import{t as Me}from"./useSvgLabelLayout-42Kats14.js";import{t as Ne}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Pe}from"./useResponsive-CENUxfEL.js";import{t as Fe}from"./DefGrad-DKMq1REY.js";import{t as Ie}from"./SlicerPreview-DYuyE9u9.js";import{t as Le}from"./A11yDataTable-DWNlWXzs.js";import{t as Re}from"./useUserOptionState-CXlFnwPv.js";import{t as ze}from"./useChartAccessibility-DOMuYJfm.js";import{t as Be}from"./annotationViewport-X8fvs7pz.js";import{t as Ve}from"./vue_ui_candlestick-DKvha_Ab.js";import{Fragment as d,computed as f,createBlock as He,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as Ue,createTextVNode as We,createVNode as Ge,defineAsyncComponent as Ke,guardReactiveProps as qe,mergeProps as Je,nextTick as Ye,normalizeClass as g,normalizeProps as Xe,normalizeStyle as Ze,onBeforeUnmount as Qe,onMounted as $e,openBlock as _,ref as v,renderList as y,renderSlot as b,resolveDynamicComponent as et,shallowRef as tt,toDisplayString as nt,toRefs as rt,unref as x,watch as it,watchEffect as at,withCtx as S}from"vue";var ot=/* @__PURE__ */ e({default:()=>Vt}),st=[`id`],ct=[`id`],lt={style:{position:`relative`}},ut=[`xmlns`,`aria-describedby`,`viewBox`],dt=[`x`,`y`,`width`,`height`],ft={key:1},pt={key:0},mt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ht=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],gt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],_t=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],vt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],yt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],bt=[`transform`,`text-anchor`,`font-size`,`fill`,`font-weight`],xt=[`transform`,`text-anchor`,`font-size`,`fill`,`font-weight`],St=[`transform`,`text-anchor`,`font-size`,`fill`,`stroke`,`font-weight`],Ct=[`x`,`y`,`width`,`height`,`fill`,`rx`],wt={key:0},Tt=[`cx`,`cy`,`r`,`fill`],Et=[`cx`,`cy`,`r`,`fill`],Dt={key:1},Ot=[`x`,`y`,`width`,`height`,`rx`,`fill`],kt=[`x`,`y`,`width`,`height`,`fill`,`rx`],At=[`x`,`y`,`height`,`width`,`fill`,`rx`],jt=[`x`,`y`,`height`,`width`,`fill`,`rx`,`stroke`,`stroke-width`],Mt=[`d`,`stroke`],Nt=[`x`,`y`,`height`,`width`,`fill`,`onMouseover`,`onMouseleave`,`onClick`],Pt=[`x`,`y`,`width`,`height`,`fill`,`fill-opacity`,`stroke`,`stroke-opacity`,`stroke-width`,`stroke-dasharray`],Ft=[`data-start`,`data-end`],It={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Lt={key:5,class:`vue-data-ui-watermark`},Rt=[`d`,`stroke`],zt=[`d`,`stroke`,`stroke-width`],Bt=[`innerHTML`],Vt=/*#__PURE__*/ he({__name:`vue-ui-candlestick`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},selectedXIndex:{type:Number,default:void 0},zoomState:{type:Object,default:null}},emits:[`selectX`,`zoomStart`,`zoomEnd`,`zoomReset`,`update:zoomState`,`copyAlt`],setup(e,{expose:he,emit:ot}){let Vt=Ke(()=>import(`./BaseIcon-fYK0iID8.js`).then(e=>e.n)),Ht=Ke(()=>import(`./Tooltip-C1q0Qoh7.js`)),Ut=Ke(()=>import(`./vue-ui-accordion-D4FHxzsL.js`).then(e=>e.n)),Wt=Ke(()=>import(`./DataTable-5Ug6gMAX.js`)),Gt=Ke(()=>import(`./PenAndPaper-r50tK3S4.js`).then(e=>e.t)),Kt=Ke(()=>import(`./UserOptions-Em_JgDXM.js`).then(e=>e.n)),qt=Ke(()=>import(`./PackageVersion-u-p5bCcj.js`).then(e=>e.t)),Jt=Ke(()=>import(`./BaseDraggableDialog-9d30Yx8c.js`).then(e=>e.n)),{vue_ui_candlestick:Yt}=t(),{isThemeValid:Xt,warnInvalidTheme:Zt}=_e(),C=e,w=ot,Qt=f(()=>!!C.dataset&&C.dataset.length),T=v(!1),$t=v(!1),en=0,tn=v(null),E=v(s()),nn=v(!1),rn=v(``),D=v(void 0),an=v(0),O=v(null),on=v(null),sn=v(null),cn=v(null),ln=v(null),un=v(null),dn=v(0),fn=v(0),pn=v(0),mn=v(null),hn=v(null),gn=v(null),_n=v(null),vn=v(null),k=v(null),yn=v({x:0,y:0}),bn=v(`pointer`),xn=v(!1),A=v(jn()),j=f(()=>A.value.style.layout.candle),M=f(()=>A.value.style.layout.grid),N=f(()=>A.value.style.layout),P=f(()=>A.value.style),F=f(()=>A.value.userOptions);pe({config:()=>A.value,dataset:()=>C.dataset,component:`VueUiCandlestick`,rules:[me.emptyArray,{test:e=>e.length>200,message:[`👀 Dataset has > 200 points, which can cause performance issues. Consider:`,``,`▶️ Adding date inputs to constraint the dataset into a specific timeframe`,``,`▶️ Aggregate the data to larger time series to reduce the number of datapoints.`]}]});let{transitionEnabled:Sn}=je({config:()=>A.value.transitions,dataset:()=>C.dataset}),Cn=f(()=>A.value.userOptions.useCursorPointer),wn=f(()=>ie({defaultConfig:{useCssAnimation:!1,userOptions:{show:!1},table:{show:!1},style:{backgroundColor:`#99999930`,layout:{candle:{colors:{bearish:`#BABABA`,bullish:`#CACACA`}},grid:{stroke:`#6A6A6A`,verticalLines:{stroke:`#6A6A6A`},horizontalLines:{stroke:`#6A6A6A`},yAxis:{dataLabels:{show:!1},scale:{min:null,max:null}}},wick:{stroke:`#6A6A6A`,extremity:{color:`#6A6A6A`}}},tooltip:{show:!1},zoom:{show:!1,startIndex:null,endIndex:null}}},userConfig:A.value.skeletonConfig??{}})),{loading:I,FINAL_DATASET:L,manualLoading:Tn}=de({...rt(C),FINAL_CONFIG:A,prepareConfig:jn,callback:()=>{Promise.resolve().then(async()=>{await Wr()})},skeletonDataset:C.config?.skeletonDataset??[[17040672e5,10,20,2,10,30],[17067456e5,10,30,5,20,50],[17092512e5,20,50,10,30,80],[17119296e5,30,80,20,50,130],[17145216e5,50,130,30,100,210],[17172e8,80,210,50,150,340],[1719792e6,130,340,80,280,550],[17224704e5,210,550,130,450,890],[17251488e5,340,890,210,750,1440],[17277408e5,550,1440,340,1230,2330],[17304192e5,890,2330,550,1950,3770],[17330112e5,1440,3770,890,3200,5100]],skeletonConfig:ie({defaultConfig:A.value,userConfig:wn.value})}),{userOptionsVisible:En,setUserOptionsVisibility:Dn,keepUserOptionState:On}=Re({config:A.value}),{svgRef:R}=ze({config:P.value.title});function kn(){Dn(!0)}function An(){Dn(!1),w(`selectX`,{seriesIndex:null,datapoint:null}),D.value=null}function jn(){let e=ge({userConfig:C.config,defaultConfig:Yt}),t={};C.config&&le(C.config,`style.layout.grid.xAxis.dataLabels.showFirstAndLast`)&&(e.style.layout.grid.xAxis.dataLabels.showFirstAndLast=!!C.config.style.layout.grid.xAxis.dataLabels.showFirstAndLast);let n=e.theme;if(n){if(!Xt.value(e))Zt(e),t=e;else{let r=ge({userConfig:Ve[n]||C.config,defaultConfig:e});t={...ge({userConfig:C.config,defaultConfig:r})}}}else t=e;return t}let Mn=o(C.config);it(()=>C.config,(e,t)=>{let n=o(e),r=n!==Mn;Mn=n;let i=jn();r?(I.value||(A.value=jn()),En.value=!A.value.userOptions.showOnChartHover,In(),dn.value+=1,pn.value+=1,fn.value+=1,B.value.showTable=A.value.table.show,B.value.showTooltip=P.value.tooltip.show,ur()):(A.value.style.tooltip=i.style.tooltip,B.value.showTooltip=A.value.style.tooltip.show)},{deep:!0}),it(()=>C.dataset,e=>{Array.isArray(e)&&e.length>0&&(Tn.value=!1),Br()},{deep:!0});let z=v({height:P.value.height,width:P.value.width,xAxisFontSize:M.value.xAxis.dataLabels.fontSize,yAxisFontSize:M.value.yAxis.dataLabels.fontSize}),Nn=tt(null),Pn=tt(null);$e(()=>{In()});let Fn=f(()=>A.value.debug);function In(){ue(C.dataset)&&(te({componentName:`VueUiCandlestick`,type:`dataset`,debug:Fn.value}),Tn.value=!0),ue(C.dataset)||(Tn.value=A.value.loading),setTimeout(()=>{T.value=!0},10),A.value.responsive&&(Nn.value&&(Pn.value&&Nn.value.unobserve(Pn.value),Nn.value.disconnect()),Nn.value=new ResizeObserver(()=>{T.value=!1;let{width:e,height:t}=Pe({chart:O.value,title:P.value.title.text?on.value:null,slicer:P.value.zoom.show&&U.value>6?cn.value.$el:null,legend:sn.value,source:ln.value,noTitle:un.value});cancelAnimationFrame(en),en=requestAnimationFrame(()=>{z.value.width=e,z.value.height=t-12,$t.value=!0,A.value.responsiveProportionalSizing?(z.value.xAxisFontSize=se({relator:Math.min(e,t),adjuster:P.value.width,source:M.value.xAxis.dataLabels.fontSize,threshold:6,fallback:6}),z.value.yAxisFontSize=se({relator:Math.min(e,t),adjuster:P.value.width,source:M.value.yAxis.dataLabels.fontSize,threshold:6,fallback:6})):(z.value.xAxisFontSize=M.value.xAxis.dataLabels.fontSize,z.value.yAxisFontSize=M.value.yAxis.dataLabels.fontSize),tn.value&&clearTimeout(tn.value),tn.value=setTimeout(()=>{T.value=!0},10)})}),Pn.value=O.value.parentNode,Nn.value.observe(Pn.value)),Wr()}Qe(()=>{cancelAnimationFrame(en),Nn.value&&(Pn.value&&Nn.value.unobserve(Pn.value),Nn.value.disconnect())});let{isPrinting:Ln,isImaging:Rn,generatePdf:zn,generateImage:Bn}=Ae({elementId:`vue-ui-candlestick_${E.value}`,fileName:P.value.title.text||`vue-ui-candlestick`,options:A.value.userOptions.print}),Vn=f(()=>A.value.userOptions.show&&!P.value.title.text),B=v({showTable:A.value.table.show,showTooltip:P.value.tooltip.show}),{metrics:Hn,ready:Un,settling:V,update:Wn}=Me({svgRef:R,canMeasure:()=>(!A.value.responsive||$t.value)&&(!M.value.xAxis.dataLabels.show||Sr.value),initialMetrics:{scaleLabelsWidth:0,timeLabelsHeight:0},measure:e=>({scaleLabelsWidth:mn.value?e(mn.value).textWidth:M.value.yAxis.dataLabels.offsetX,timeLabelsHeight:e(hn.value).height})}),Gn=f(()=>hn.value?Hn.value.timeLabelsHeight+z.value.xAxisFontSize:0),Kn=f(()=>M.value.yAxis.position===`right`);function qn(){let e=Hn.value.scaleLabelsWidth,t=M.value.yAxis.axisName?.show?M.value.yAxis.axisName.fontSize+M.value.yAxis.axisName.offsetX:0,n=e+13+t;return{left:Kn.value?0:n,right:Kn.value?n:0,scaleLabelsWidth:e,yAxisNameWidth:t,crosshair:13}}let H=f(()=>{let{top:e,right:t,bottom:n,left:r}=N.value.padding,i=qn();return{top:e+12,right:z.value.width-t-i.right,left:r+i.left,bottom:z.value.height-n-Gn.value,width:z.value.width-r-t-i.left-i.right,height:z.value.height-e-n-Gn.value-12,scaleLabelsWidth:i.scaleLabelsWidth,yAxisNameWidth:i.yAxisNameWidth,crosshair:i.crosshair}}),Jn=f(()=>{let{left:e,top:t,width:n,height:r}=H.value,i=W.value.start,a=W.value.end-i,o=n/a,s=G.value.start-i,c=G.value.end-i,l=Math.max(0,Math.min(a,s)),ee=Math.max(0,Math.min(a,c));return{x:e+l*o,y:t,width:(ee-l)*o,height:r,fill:P.value.zoom.preview.fill,stroke:P.value.zoom.preview.stroke,"stroke-width":P.value.zoom.preview.strokeWidth,"stroke-dasharray":P.value.zoom.preview.strokeDasharray,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{pointerEvents:`none`,transition:`none !important`,animation:`none !important`}}}),U=f(()=>L.value.length),W=v({start:0,end:U.value}),G=v({start:0,end:U.value}),Yn=v(!1),Xn=v(!1),Zn=v(null),K=v(null),q=v(null),Qn=v(!1),$n=v({time:0,x:0,y:0,pointerType:null}),er=f(()=>P.value.zoom?.dragToZoom),J=f(()=>er.value.show&&Qt.value&&Hr.value&&U.value>1&&!I.value),tr=null,nr={},rr=f(()=>P.value.zoom.preview.enable&&(G.value.start!==W.value.start||G.value.end!==W.value.end));function ir(e,t){G.value[e]=t}function ar(e,t=W.value){if(!e||typeof e!=`object`)return null;let n=e.start!==void 0&&e.start!==null,r=e.end!==void 0&&e.end!==null;if(!n&&!r)return null;let i=Number(n?e.start:t.start),a=Number(r?e.end:t.end);return!Number.isFinite(i)||!Number.isFinite(a)?null:{start:i,end:a}}function or(e){let t=ar(e);t&&w(`update:zoomState`,t)}function sr(){tr&&=(cancelAnimationFrame(tr),null),nr={}}function cr(e){let t=ar(e);if(!t)return null;let{start:n,end:r}=t;return(n!==Number(W.value.start)||r!==Number(W.value.end))&&(sr(),W.value={start:n,end:r},G.value={start:n,end:r},ur()),{start:Number(W.value.start),end:Number(W.value.end)}}function lr(e){let t=cr(e);return t?(w(`update:zoomState`,t),t):null}function ur(){let e=Math.max(0,Math.min(W.value.start??0,U.value-1)),t=Math.max(e+1,Math.min(W.value.end??U.value,U.value));(!Number.isFinite(e)||!Number.isFinite(t)||t<=e)&&(e=0,t=U.value),W.value.start=e,W.value.end=t,G.value.start=e,G.value.end=t,cn.value&&cn.value.setRangeValues(e,t)}let dr=f(()=>L.value.map((e,t)=>({...e,absoluteIndex:t}))),fr=f(()=>dr.value.slice(W.value.start,W.value.end)),Y=f(()=>(Fn.value&&L.value.forEach((e,t)=>{[null,void 0].includes(e[0])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`period (index 0)`,index:t}),[null,void 0].includes(e[1])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`open (index 1)`,index:t}),[null,void 0].includes(e[2])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`high (index 2)`,index:t}),[null,void 0].includes(e[3])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`low (index 3)`,index:t}),[null,void 0].includes(e[4])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`close (index 4)`,index:t}),[null,void 0].includes(e[5])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`volume (index 5)`,index:t})}),fr.value.map(e=>({absoluteIndex:e.absoluteIndex,period:e[0],open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5]})))),pr=f(()=>dr.value.map(e=>({absoluteIndex:e.absoluteIndex,period:e[0],open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5]}))),X=f(()=>H.value.width/fr.value.length),mr=f(()=>({max:M.value.yAxis.scale.max===null?Math.max(...Y.value.map(e=>e.high)):M.value.yAxis.scale.max,min:M.value.yAxis.scale.min===null?0:M.value.yAxis.scale.min})),Z=f(()=>l(mr.value.min,mr.value.max,M.value.yAxis.dataLabels.steps));function hr(e,t,n=null,r=null){return{...e,x:u(H.value.left+t*X.value+X.value/2),y:u(H.value.top+(1-(e-Z.value.min)/(Z.value.max-Z.value.min))*H.value.height),value:u(e),isMax:e===n,isMin:e===r}}let Q=f(()=>{let e={o:Math.max(...Y.value.map(e=>e.open)),h:Math.max(...Y.value.map(e=>e.high)),l:Math.max(...Y.value.map(e=>e.low)),c:Math.max(...Y.value.map(e=>e.low))},t={o:Math.min(...Y.value.map(e=>e.open)),h:Math.min(...Y.value.map(e=>e.high)),l:Math.min(...Y.value.map(e=>e.low)),c:Math.min(...Y.value.map(e=>e.low))},n=Math.max(...Y.value.map(e=>e.volume)),r=Math.min(...Y.value.map(e=>e.volume));return Y.value.map((i,a)=>{let o=hr(i.open,a,e.o,t.o),s=hr(i.high,a,e.h,t.h),c=hr(i.low,a,e.l,t.l),l=hr(i.close,a,e.c,t.c),ee=i.close>i.open,te=i.volume===n,u=i.volume===r;return{period:i.period,open:o,high:s,low:c,close:l,volume:i.volume,isBullish:ee,absoluteIndex:i.absoluteIndex,isMaxVolume:te,isMinVolume:u}})});function gr({item:e,index:t,minimapH:n,unitW:r}){let i=M.value.yAxis.scale.min??0,a=M.value.yAxis.scale.max??Math.max(...L.value.map(e=>e[2]));return{...e,x:u(t*r),y:u((1-(e-i)/(a-i))*n),value:u(e)}}let _r=f(()=>({minimapH:e,unitW:t})=>pr.value.map((n,r)=>{let i=gr({item:n.open,index:r,minimapH:e,unitW:t}),a=gr({item:n.high,index:r,minimapH:e,unitW:t}),o=gr({item:n.low,index:r,minimapH:e,unitW:t}),s=gr({item:n.close,index:r,minimapH:e,unitW:t}),c=n.close>n.open;return{period:n.period,open:i,high:a,low:o,close:s,volume:n.volume,isBullish:c,absoluteIndex:n.absoluteIndex}})),vr=f(()=>P.value.zoom.minimap.show?[{name:``,series:L.value.map(e=>e[2]),color:`#000000`,isVisible:!0}]:[]);function yr(e){return u((e-Z.value.min)/(Z.value.max-Z.value.min))}let br=f(()=>Z.value.ticks.map(e=>({y:H.value.bottom-H.value.height*yr(e),value:u(e)}))),xr=f(()=>Y.value.map(e=>e.period)),$=v([]),Sr=v(!1),Cr=v([]),wr=0;at(()=>{let e=++wr;(async()=>{let t=await ke({values:L.value.map(e=>e[0]),maxDatapoints:L.value.length,formatter:M.value.xAxis.dataLabels.datetimeFormatter,start:W.value.start,end:W.value.end});e===wr&&($.value=t,Sr.value=!0)})()});let Tr=0;at(()=>{let e=++Tr;(async()=>{let t=await ke({values:L.value.map(e=>e[0]),maxDatapoints:L.value.length,formatter:M.value.xAxis.dataLabels.datetimeFormatter,start:0,end:U.value});e===Tr&&(Cr.value=t)})()});let Er=v({months:[],shortMonths:[],days:[],shortDays:[]}),Dr=0;at(()=>{let e=++Dr,t=M.value.xAxis.dataLabels.datetimeFormatter;(async()=>{let n=await Oe(t.locale).catch(()=>Oe(`en`));e===Dr&&(Er.value=n.data)})()});let Or=f(()=>{let e=M.value.xAxis.dataLabels.datetimeFormatter,t=De({useUTC:e.useUTC,locale:Er.value,januaryAsYear:e.januaryAsYear});return(e,n)=>{let r=L.value.map(e=>e[0])?.[e];return r==null?``:t.formatDate(new Date(r),n)}}),kr=f(()=>(L.value.map(e=>e[0])||[]).map((e,t)=>({text:Or.value(t,P.value.tooltip.timeFormat),absoluteIndex:t}))),Ar=f(()=>(L.value.map(e=>e[0])||[]).map((e,t)=>({text:Or.value(t,P.value.zoom.timeFormat),absoluteIndex:t}))),jr=f(()=>{let e=Math.max(1,Math.floor(Number(M.value.xAxis.dataLabels.modulo)||1)),t=($.value||[]).map(e=>e?.text??``),n=(Cr.value||[]).map(e=>e?.text??``),r=W.value.start??0,i=r>0||t.length<n.length;return re({configuredModulo:e,visibleTexts:t,allTexts:n,startAbs:r,isZoomed:i})}),Mr=f(()=>{let e=M.value.xAxis.dataLabels,t=$.value||[],n=Cr.value||[],r=W.value.start??0,i=D.value,a=U.value,o=t.map(e=>e?.text??``),s=n.map(e=>e?.text??``),c=ne(!!e.showOnlyFirstAndLast,!!e.showOnlyAtModulo,jr.value,o,s,r,i,a);if(!e.showFirstAndLast||e.showOnlyFirstAndLast||!c.length)return c;let l=c.length-1;return c.map((e,t)=>t!==0&&t!==l?e:{...e,text:o[t]??``})}),Nr=f(()=>M.value.xAxis.dataLabels.datetimeFormatter.enable?{start:$.value.find(e=>e.absoluteIndex===W.value.start)?.text??``,end:$.value.find(e=>e.absoluteIndex===W.value.end-1)?.text??``}:{start:L.value[W.value.start]?L.value[W.value.start][0]:L.value[0][0],end:L.value[W.value.end-1]?L.value[W.value.end-1][0]:L.value.at(-1)[0]}),Pr=v(null);function Fr(e,t){A.value.events.datapointClick&&A.value.events.datapointClick({datapoint:t,seriesIndex:e+W.value.start})}function Ir(e,t){A.value.events.datapointLeave&&A.value.events.datapointLeave({datapoint:t,seriesIndex:e+W.value.start}),D.value=void 0,nn.value=!1,k.value=null,bn.value=`pointer`}it(()=>C.selectedXIndex,e=>{if([null,void 0].includes(C.selectedXIndex)){D.value=null;return}let t=e-W.value.start;t<0||e>=W.value.end?D.value=null:D.value=t??null},{immediate:!0});function Lr(e,t,r=`pointer`){A.value.events.datapointEnter&&A.value.events.datapointEnter({datapoint:t,seriesIndex:e+W.value.start}),D.value=e,k.value=e,bn.value=r,Pr.value={datapoint:t,seriesIndex:e,series:Q.value,config:A.value},Ai({seriesIndex:e,datapoint:t});let a=P.value.tooltip.customFormat;if(i(a)&&oe(()=>a({seriesIndex:e,datapoint:t,series:Q.value,config:A.value})))rn.value=a({seriesIndex:e,datapoint:t,series:Q.value,config:A.value});else if(P.value.tooltip.show){let r=``,{period:i,open:a,high:o,low:s,close:c,volume:l,isBullish:ee}=Q.value[e],{period:te,open:u,high:ne,low:re,close:ie,volume:ae}=A.value.translations,oe=M.value.xAxis.dataLabels.datetimeFormatter.enable?P.value.tooltip.useDefaultTimeFormat?$.value[e].text:kr.value[e].text:i;r+=`<div><svg style="margin-right:6px" viewBox="0 0 12 12" height="12" width="12"><rect x="0" y="0" height="12" width="12" rx="${j.value.borderRadius*3}" stroke="${j.value.stroke}" stroke-width="${j.value.strokeWidth}"
2
- fill="${j.value.gradient.show?ee?`url(#bullish_gradient_${E.value})`:`url(#bearish_gradient_${E.value})`:ee?j.value.colors.bullish:j.value.colors.bearish}"/></svg>${oe}</div>`,r+=`${ae} : <b>${isNaN(l)?`-`:Number(l.toFixed(P.value.tooltip.roundingValue)).toLocaleString()}</b>`,r+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${P.value.tooltip.borderColor}">`;let se=n({p:P.value.tooltip.prefix,v:a.value,s:P.value.tooltip.suffix,r:P.value.tooltip.roundingValue}),ce=n({p:P.value.tooltip.prefix,v:o.value,s:P.value.tooltip.suffix,r:P.value.tooltip.roundingValue}),le=n({p:P.value.tooltip.prefix,v:s.value,s:P.value.tooltip.suffix,r:P.value.tooltip.roundingValue}),ue=n({p:P.value.tooltip.prefix,v:c.value,s:P.value.tooltip.suffix,r:P.value.tooltip.roundingValue});P.value.tooltip.showChart?r+=`<div style="width:100%;display:flex;align-items:center;justify-content:center;">
3
- <svg viewBox="0 0 100 100" width="100px" style="background: transparent; overflow: visible">
4
- <g>
5
- <line x1="50" x2="50" y1="20" y2="80" stroke="${t.isBullish?j.value.colors.bullish:j.value.colors.bearish}" stroke-width="2" stroke-linecap="round" />
6
- ${t.isBullish?`
7
- <line x1="45" x2="50" y1="65" y2="65" stroke="${j.value.colors.bullish}" stroke-width="1.5" stroke-linecap="round" />
8
- <line x1="50" x2="55" y1="35" y2="35" stroke="${j.value.colors.bullish}" stroke-width="1.5" stroke-linecap="round" />
9
- <text x="38" y="70" text-anchor="end" fill="${P.value.tooltip.color}">${se}</text>
10
- <text x="62" y="40" text-anchor="start" fill="${P.value.tooltip.color}">${ue}</text>
11
- `:`
12
- <line x1="45" x2="50" y1="35" y2="35" stroke="${j.value.colors.bearish}" stroke-width="1.5" stroke-linecap="round" />
13
- <line x1="50" x2="55" y1="65" y2="65" stroke="${j.value.colors.bearish}" stroke-width="1.5" stroke-linecap="round" />
14
- <text x="40" y="40" text-anchor="end" fill="${P.value.tooltip.color}">${se}</text>
15
- <text x="60" y="70" text-anchor="start" fill="${P.value.tooltip.color}">${ue}</text>
16
- `}
17
- <text x="50" y="13" text-anchor="middle" fill="${P.value.tooltip.color}">${ce}</text>
18
- <text x="50" y="97" text-anchor="middle" fill="${P.value.tooltip.color}">${le}</text>
19
- <g>
20
- </svg>
21
- <div>
22
- `:(r+=`<div>${u}: <b>${se}</b></div>`,r+=`<div>${ne}: <b>${ce}</b></div>`,r+=`<div>${re}: <b>${le}</b></div>`,r+=`<div>${ie}: <b>${ue}</b></div>`),r+=`</div>`,rn.value=`<div style="text-align:right">${r}</div>`}nn.value=!0}let Rr=v(null);function zr(){return new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(()=>e())))}Qe(()=>{Rr.value&&cancelAnimationFrame(Rr.value),sr(),bi()});async function Br({force:e=!1,publish:t=!1}={}){let n=!e;Wr(n),await Ye(),Rr.value&&cancelAnimationFrame(Rr.value),Rr.value=requestAnimationFrame(async()=>{await zr(),Wr(n),Rr.value=null,t&&(or({start:Number(W.value.start),end:Number(W.value.end)}),w(`zoomReset`))})}let Vr=v(!1),Hr=v(!1),Ur=v(!1);it([()=>C.zoomState,Hr],([e,t])=>{t&&e&&cr(e)},{deep:!0,immediate:!0});function Wr(e=!0){if(!Vr.value){Vr.value=!0;try{let{startIndex:t,endIndex:n}=P.value.zoom,r=U.value,i=t??0,a=n==null?r:Math.min(Gr(n+1,i),r);Ur.value=!0,W.value.start=i,W.value.end=a,G.value.start=i,G.value.end=a,ur(),Hr.value=!0,e&&C.zoomState&&cr(C.zoomState)}finally{queueMicrotask(()=>{Ur.value=!1}),Vr.value=!1}}}function Gr(e,t=W.value.start){let n=U.value,r=Number(t);return e>n?n:e<0||e<=r?Math.min(r+1,n):e}function Kr(e=null){Ye(()=>{let t=[A.value.translations.period,A.value.translations.open,A.value.translations.high,A.value.translations.low,A.value.translations.close,A.value.translations.volume],n=Q.value.map((e,t)=>[M.value.xAxis.dataLabels.datetimeFormatter.enable?$.value[t].text:e.period,e.open.value,e.high.value,e.low.value,e.close.value,e.volume]),i=[[P.value.title.text],[P.value.title.subtitle.text],[[``],[``],[``]],t].concat(n),a=r(i);e?e(a):ae({csvContent:a,title:P.value.title.text||`vue-ui-candlestick`})})}let qr=f(()=>{let e=Q.value.map((e,t)=>{let r=M.value.xAxis.dataLabels.datetimeFormatter.enable?$.value?.[t]?.text??``:e.period,i=n({p:A.value.table.td.prefix,v:e.open.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),a=n({p:A.value.table.td.prefix,v:e.high.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),o=n({p:A.value.table.td.prefix,v:e.low.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),s=n({p:A.value.table.td.prefix,v:e.close.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue});return[`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" height="12" width="12" style="margin-right: 6px"><rect x="0" y="0" height="12" width="12" rx="${j.value.borderRadius*3}" fill="${j.value.gradient.show?e.isBullish?`url(#bullish_gradient_${E.value})`:`url(#bearish_gradient_${E.value})`:e.isBullish?j.value.colors.bullish:j.value.colors.bearish}"/></svg> ${r}`,i,a,o,s,`${isNaN(e.volume)?`-`:e.volume.toLocaleString()}`]}),t=Q.value.map((e,t)=>[M.value.xAxis.dataLabels.datetimeFormatter.enable?$.value?.[t]?.text??``:e.period,n({p:A.value.table.td.prefix,v:e.open.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),n({p:A.value.table.td.prefix,v:e.high.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),n({p:A.value.table.td.prefix,v:e.low.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),n({p:A.value.table.td.prefix,v:e.close.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),`${isNaN(e.volume)?`-`:e.volume}`]),r={th:{backgroundColor:A.value.table.th.backgroundColor,color:A.value.table.th.color,outline:A.value.table.th.outline},td:{backgroundColor:A.value.table.td.backgroundColor,color:A.value.table.td.color,outline:A.value.table.td.outline},breakpoint:A.value.table.responsiveBreakpoint},i=[A.value.translations.period,A.value.translations.open,A.value.translations.high,A.value.translations.low,A.value.translations.last,A.value.translations.volume];return{head:i,body:e,bodyA11y:t,config:r,colNames:i}}),Jr=v(!1);function Yr(e){Jr.value=e,an.value+=1}function Xr(){B.value.showTable=!B.value.showTable}function Zr(){B.value.showTooltip=!B.value.showTooltip}let Qr=v(!1);function $r(){Qr.value=!Qr.value}async function ei({scale:e=2}={}){if(!O.value)return;let{imageUri:t,base64:n}=await ve({domElement:O.value,base64:!0,img:!0,scale:e}),r=O.value.getBoundingClientRect(),i={width:r.width,height:r.height,aspectRatio:r.height?r.width/r.height:0},a=await ee(t,e)??i;return{imageUri:t,base64:n,title:P.value.title.text,...a}}let ti=f(()=>z.value.width),ni=f(()=>z.value.height);Ne({timeLabelsEls:hn,timeLabels:$,slicer:W,configRef:A,rotationPath:[`style`,`layout`,`grid`,`xAxis`,`dataLabels`,`rotation`],autoRotatePath:[`style`,`layout`,`grid`,`xAxis`,`dataLabels`,`autoRotate`,`enable`],isAutoSize:!1,rotation:M.value.xAxis.dataLabels.autoRotate.angle,width:ti,height:ni}),it(A,()=>{B.value={showTable:A.value.table.show,showTooltip:P.value.tooltip.show}},{immediate:!0});let ri=f(()=>Se({config:A,style:P,mutableConfig:B,dialog:Jt,accordion:Ut,isFullscreen:Jr,parent:O,maxWidth:800,isCursorPointer:Cn}));it(()=>B.value.showTable,e=>xe(e,A,gn));function ii(){B.value.showTable=!1,_n.value&&_n.value.setTableIconState(!1)}let ai=f(()=>P.value.backgroundColor),oi=f(()=>P.value.title),{isCallbackImaging:si,isCallbackSvg:ci,generateSvg:li,onGenerateImage:ui}=be({svg:R,title:oi,legend:null,legendItems:null,backgroundColor:ai,getSvgCallback:()=>A.value.userOptions.callbacks.svg,generateImage:Bn});function di(e){vn.value=e}function fi(e){nr={...nr,...e},tr&&cancelAnimationFrame(tr),tr=requestAnimationFrame(()=>{let e={...W.value,...nr};nr={},tr=null,W.value=e,G.value={...e},ur(),or({start:Number(W.value.start),end:Number(W.value.end)})})}function pi(e){if(Vr.value||Ur.value)return;let t=Number(e);Number.isFinite(t)&&(w(`zoomStart`,{index:t,isZoom:t!==0}),t!==W.value.start&&fi({start:t}))}function mi(e){if(Vr.value||Ur.value)return;let t=nr.start===void 0?W.value.start:nr.start,n=Gr(Number(e),t);Number.isFinite(n)&&(w(`zoomEnd`,{index:n,isZoom:n!==U.value}),(n!==W.value.end||nr.start!==void 0)&&fi({end:n}))}function hi(e){let t=R.value;if(!t)return null;if(t.createSVGPoint&&t.getScreenCTM){let n=t.createSVGPoint();n.x=e.clientX,n.y=e.clientY;let r=t.getScreenCTM();if(r){let e=n.matrixTransform(r.inverse());return{x:e.x,y:e.y}}}let n=t.getBoundingClientRect(),r=t.viewBox?.baseVal||{x:0,y:0,width:n.width,height:n.height},i=Math.min(n.width/r.width,n.height/r.height);if(!Number.isFinite(i)||i<=0)return null;let a=r.width*i,o=r.height*i,s=(n.width-a)/2,c=(n.height-o)/2;return{x:(e.clientX-n.left-s)/i+r.x,y:(e.clientY-n.top-c)/i+r.y}}let gi=f(()=>!Yn.value||Zn.value==null||K.value==null?null:{x:Math.min(Zn.value,K.value),y:H.value.top,width:Math.abs(K.value-Zn.value),height:H.value.height}),_i=f(()=>Hr.value?Number(W.value.start)!==0||Number(W.value.end)!==Number(U.value):!1);function vi(e){return Math.min(Math.max(e,H.value.left),H.value.right)}function yi(){D.value=void 0,k.value=null,bn.value=`pointer`,nn.value=!1,vn.value=null}function bi(e){let t=e?.pointerId==null?q.value:e.pointerId;t!=null&&R.value?.hasPointerCapture?.(t)&&R.value.releasePointerCapture(t),Yn.value=!1,Zn.value=null,K.value=null,q.value=null}function xi(){Qn.value=!0,setTimeout(()=>{Qn.value=!1},0)}function Si(e){Qn.value&&(Qn.value=!1,e.preventDefault(),e.stopPropagation())}function Ci(e){if(!J.value||!_i.value||!e)return!1;let t=Date.now(),n=e.pointerType||`mouse`,r=$n.value,i=n===`touch`?450:350,a=n===`touch`?28:10,o=Math.hypot(e.clientX-r.x,e.clientY-r.y);return r.time>0&&r.pointerType===n&&t-r.time<=i&&o<=a?($n.value={time:0,x:0,y:0,pointerType:null},xi(),bi(e),Br({force:!0,publish:!0}),!0):($n.value={time:t,x:e.clientX,y:e.clientY,pointerType:n},!1)}function wi(e){let t=Number(W.value.end)-Number(W.value.start);if(t<=0||!Number.isFinite(X.value)||X.value<=0)return null;let n=Math.floor((vi(e)-H.value.left)/X.value);return Math.max(0,Math.min(t-1,n))}function Ti(e,t){let n=wi(e),r=wi(t);if(n==null||r==null)return null;let i=Math.min(n,r),a=Math.max(n,r);return a<=i?null:{start:Number(W.value.start)+i,end:Number(W.value.start)+a+1}}function Ei(e){let t=lr(e);return t?(w(`zoomStart`,{index:t.start,isZoom:t.start!==0}),w(`zoomEnd`,{index:t.end,isZoom:t.end!==U.value}),t):null}function Di(e){if(!J.value||Qr.value||e.button!==void 0&&e.button!==0||q.value!=null&&e.pointerId!==q.value)return;let t=hi(e);if(!t)return;let{left:n,right:r,top:i,bottom:a}=H.value;if(t.x<n||t.x>r||t.y<i||t.y>a||Number(W.value.end)-Number(W.value.start)<=1)return;Xn.value=!0,R.value?.focus?.({preventScroll:!0}),yi();let o=vi(t.x);q.value=e.pointerId,Yn.value=!0,Zn.value=o,K.value=o}function Oi(e){if(!J.value||!Yn.value||q.value!=null&&e.pointerId!==q.value)return;let t=hi(e);t&&(K.value=vi(t.x),yi(),Zn.value!=null&&Math.abs(K.value-Zn.value)>=2&&!R.value?.hasPointerCapture?.(e.pointerId)&&R.value?.setPointerCapture?.(e.pointerId))}function ki(e){if(!J.value||!Yn.value||q.value!=null&&e.pointerId!==q.value)return;let t=hi(e);t&&(K.value=vi(t.x));let n=Zn.value,r=K.value;if((n==null||r==null?0:Math.abs(r-n))<Math.max(4,H.value.width*.01)){if(Ci(e))return;bi(e);return}let i=Ti(Math.min(n,r),Math.max(n,r));i?(bi(e),Ei(i)&&($n.value={time:0,x:0,y:0,pointerType:null},yi(),xi())):bi(e)}function Ai({seriesIndex:e,datapoint:t}){let n=W.value.start+e;w(`selectX`,{dataset:t,index:n,indexLabel:``})}async function ji(){w(`copyAlt`,{config:A.value,dataset:Q.value}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:Q.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function Mi(){k.value=null,xn.value=!0}function Ni(){Xn.value=!1,k.value=null,bn.value=`pointer`,nn.value=!1,D.value=void 0,xn.value=!1}function Pi(e){if(!R.value||Qr.value||document.activeElement!==R.value||(Xn.value=!1,!Q.value.length))return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){if(J.value&&(_i.value||Yn.value)){bi(),Br({force:!0,publish:!0});return}k.value=null,bn.value=`pointer`,nn.value=!1,D.value=void 0;return}if(r){if(k.value===null)return;let e=Q.value[k.value];if(!e)return;Fr(k.value,e);return}let a=k.value,o=D.value,s=a!==null&&a>=0&&a<Q.value.length,c=o!=null&&o>=0&&o<Q.value.length;s?n?(a+=1,a>=Q.value.length&&(a=0)):t&&(--a,a<0&&(a=Q.value.length-1)):c?(a=n?o+1:o-1,a>=Q.value.length&&(a=0),a<0&&(a=Q.value.length-1)):a=n?0:Q.value.length-1;let l=Q.value[a];l&&(Fi(a),Lr(a,l,`keyboard`))}function Fi(e){if(!Number.isFinite(e)||!R.value)return;let t=H.value.left+X.value*e+X.value/2,n=H.value.top+H.value.height/2,r=R.value.getBoundingClientRect();yn.value={x:r.left+t/z.value.width*r.width,y:r.top+n/z.value.height*r.height}}let Ii=f(()=>({headers:qr.value?.colNames??[],rows:qr.value?.bodyA11y??[]}));he({getImage:ei,generatePdf:zn,generateCsv:Kr,generateImage:Bn,generateSvg:li,toggleTable:Xr,toggleTooltip:Zr,toggleAnnotator:$r,toggleFullscreen:Yr,copyAlt:ji,resetZoom:()=>Br({force:!0,publish:!0}),setZoomState:lr}),it(()=>[z.value,M.value,A.value.style.fontFamily,C.dataset,W.value.start,W.value.end,$.value,Sr.value,$t.value,mn.value,hn.value],Wn,{flush:`post`,deep:!0});let Li=f(()=>Be({enabled:F.value?.annotator?.followZoom,area:H.value,range:W.value,ticks:br.value}));return(e,t)=>(_(),m(`div`,{ref_key:`candlestickChart`,ref:O,class:g(`vue-data-ui-component vue-ui-candlestick ${Jr.value?`vue-data-ui-wrapper-fullscreen`:``} ${A.value.useCssAnimation?``:`vue-ui-dna`}`),style:Ze(`position:relative;font-family:${P.value.fontFamily}; text-align:center;background:${P.value.backgroundColor}; ${A.value.responsive?`height: 100%`:``}`),id:`vue-ui-candlestick_${E.value}`,onMouseenter:kn,onMouseleave:An},[h(`div`,{id:`chart-instructions-${E.value}`,class:`sr-only`},[h(`p`,null,nt(A.value.a11y.translations.keyboardNavigation),1)],8,ct),Ii.value?.rows?.length?(_(),He(Le,{key:0,uid:E.value,head:Ii.value.headers,body:Ii.value.rows,notice:A.value.a11y.translations.tableAvailable,caption:A.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):p(``,!0),F.value.buttons.annotator?(_(),He(x(Gt),{key:1,showGroupActions:F.value.annotator?.showGroupActions??!0,svgRef:x(R),followZoom:F.value?.annotator?.followZoom,annotationViewport:Li.value,backgroundColor:P.value.backgroundColor,color:P.value.color,active:Qr.value,isCursorPointer:Cn.value,palette:F.value.annotatorPalette,onClose:$r},Ue({_:2},[y(x(we),t=>({name:t,fn:S(n=>[b(e.$slots,t,Xe(qe(x(Ce)(t,n))),void 0,!0)])}))]),1032,[`showGroupActions`,`svgRef`,`followZoom`,`annotationViewport`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):p(``,!0),Vn.value?(_(),m(`div`,{key:2,ref_key:`noTitle`,ref:un,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):p(``,!0),P.value.title.text?(_(),m(`div`,{key:3,ref_key:`chartTitle`,ref:on,style:`width:100%;background:transparent`},[(_(),He(ye,{key:`title_${pn.value}`,config:{title:{cy:`candlestick-div-title`,...P.value.title},subtitle:{cy:`candlestick-div-subtitle`,...P.value.title.subtitle}}},null,8,[`config`]))],512)):p(``,!0),F.value.show&&Qt.value&&(x(On)||x(En))?(_(),He(x(Kt),{ref_key:`userOptionsRef`,ref:_n,key:`user_options_${an.value}`,backgroundColor:P.value.backgroundColor,color:P.value.color,isImaging:x(Rn),isPrinting:x(Ln),uid:E.value,hasTooltip:F.value.buttons.tooltip&&P.value.tooltip.show,hasPdf:F.value.buttons.pdf,hasImg:F.value.buttons.img,hasSvg:F.value.buttons.svg,hasXls:F.value.buttons.csv,hasTable:F.value.buttons.table,hasFullscreen:F.value.buttons.fullscreen,hasAltCopy:F.value.buttons.altCopy,isFullscreen:Jr.value,isTooltip:B.value.showTooltip,titles:{...F.value.buttonTitles},chartElement:O.value,position:F.value.position,hasAnnotator:F.value.buttons.annotator,isAnnotation:Qr.value,callbacks:F.value.callbacks,printScale:F.value.print.scale,tableDialog:A.value.table.useDialog,isCursorPointer:Cn.value,onToggleFullscreen:Yr,onGeneratePdf:x(zn),onGenerateCsv:Kr,onGenerateImage:x(ui),onGenerateSvg:x(li),onToggleTable:Xr,onToggleTooltip:Zr,onToggleAnnotator:$r,onCopyAlt:ji,style:Ze({visibility:x(On)?x(En)?`visible`:`hidden`:`visible`})},Ue({_:2},[y(x(Te)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:S(n=>[b(e.$slots,t,Xe(qe(x(Ee)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isImaging.isPrinting.uid.hasTooltip.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasFullscreen.hasAltCopy.isFullscreen.isTooltip.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):p(``,!0),h(`div`,lt,[(_(),m(`svg`,{ref_key:`svgRef`,ref:R,xmlns:x(ce),"aria-describedby":`chart-instructions-${E.value}`,class:g({"vue-data-ui-fullscreen--on":Jr.value,"vue-data-ui-fulscreen--off":!Jr.value,"vue-data-ui-no-transition":!x(Sn)||x(V),"vue-ui-candlestick-chart-zoom-pointer-focus":J.value&&Xn.value}),viewBox:`0 0 ${z.value.width<=0?10:z.value.width} ${z.value.height<=0?10:z.value.height}`,style:Ze({maxWidth:`100%`,visibility:x(Un)?`visible`:`hidden`,overflow:`visible`,background:`transparent`,color:P.value.color,cursor:J.value?Yn.value?`col-resize`:`crosshair`:void 0,touchAction:J.value?`pan-y`:void 0,userSelect:J.value?`none`:void 0}),tabindex:`0`,onFocus:Mi,onBlur:Ni,onKeydown:Pi,onPointerdown:Di,onPointermove:Oi,onPointerup:ki,onPointercancel:bi,onClickCapture:Si},[Ge(x(qt)),b(e.$slots,`svg-underlayer`,{svg:{...z.value,data:Q.value,drawingArea:H.value,isPrintingImg:x(Ln)||x(Rn)||x(si),isPrintingSvg:x(ci)}},void 0,!0),e.$slots[`chart-background`]?(_(),m(`foreignObject`,{key:0,x:H.value.left,y:H.value.top,width:Math.max(.1,H.value.width),height:Math.max(.1,H.value.height),style:{pointerEvents:`none`}},[b(e.$slots,`chart-background`,{},void 0,!0)],8,dt)):p(``,!0),Q.value.length>0?(_(),m(`g`,ft,[h(`defs`,null,[Ge(Fe,{t:`linear`,id:`bearish_gradient_${E.value}`,x2:`0%`,y2:`100%`,stops:[[`0%`,j.value.colors.bearish,1],[`50%`,x(c)(j.value.colors.bearish,.02),.87],[`100%`,x(c)(j.value.colors.bearish,.05),.4]]},null,8,[`id`,`stops`]),Ge(Fe,{t:`linear`,id:`bullish_gradient_${E.value}`,x2:`0%`,y2:`100%`,stops:[[`0%`,j.value.colors.bullish,1],[`50%`,x(c)(j.value.colors.bullish,.02),.87],[`100%`,x(c)(j.value.colors.bullish,.05),.4]]},null,8,[`id`,`stops`])]),M.value.show?(_(),m(`g`,pt,[h(`line`,{x1:Kn.value?H.value.right:H.value.left,x2:Kn.value?H.value.right:H.value.left,y1:H.value.top,y2:H.value.bottom,stroke:M.value.stroke,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`},null,8,mt),h(`line`,{x1:H.value.left,x2:H.value.right,y1:H.value.bottom,y2:H.value.bottom,stroke:M.value.stroke,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`},null,8,ht),M.value.horizontalLines.show?(_(!0),m(d,{key:0},y(br.value,e=>(_(),m(`line`,{x1:H.value.left,x2:H.value.right,y1:e.y,y2:e.y,stroke:M.value.horizontalLines.stroke,"stroke-width":M.value.horizontalLines.strokeWidth,"stroke-dasharray":M.value.horizontalLines.strokeDasharray,"stroke-linecap":`round`},null,8,gt))),256)):p(``,!0),M.value.verticalLines.show?(_(!0),m(d,{key:1},y(Mr.value,(e,t)=>(_(),m(`g`,null,[e.text?(_(),m(`line`,{key:0,x1:H.value.left+X.value*t+X.value/2,x2:H.value.left+X.value*t+X.value/2,y1:H.value.top,y2:H.value.bottom,stroke:M.value.verticalLines.stroke,"stroke-width":M.value.verticalLines.strokeWidth,"stroke-dasharray":M.value.verticalLines.strokeDasharray,"stroke-linecap":`round`},null,8,_t)):p(``,!0)]))),256)):p(``,!0),M.value.xAxis.ticks.show?(_(!0),m(d,{key:2},y(Mr.value,(e,t)=>(_(),m(`g`,null,[e.text?(_(),m(`line`,{key:0,x1:H.value.left+X.value*t+X.value/2,x2:H.value.left+X.value*t+X.value/2,y1:H.value.bottom,y2:H.value.bottom+3,stroke:M.value.stroke,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`},null,8,vt)):p(``,!0)]))),256)):p(``,!0)])):p(``,!0),M.value.yAxis.dataLabels.show?(_(),m(`g`,{key:1,ref_key:`scaleLabels`,ref:mn},[(_(!0),m(d,null,y(br.value,(e,t)=>(_(),m(`g`,{key:`sl_${t}`},[e.value>=Z.value.min&&e.value<=Z.value.max?(_(),m(`line`,{key:0,x1:Kn.value?H.value.right:H.value.left,x2:Kn.value?H.value.right+5:H.value.left-5,y1:e.y,y2:e.y,stroke:M.value.stroke,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`},null,8,yt)):p(``,!0),e.value>=Z.value.min&&e.value<=Z.value.max?(_(),m(`text`,{key:1,class:g({"vue-data-ui-transition":x(Sn)&&!x(V)}),transform:`translate(${Kn.value?H.value.right+8+M.value.yAxis.dataLabels.offsetX:H.value.left-8+M.value.yAxis.dataLabels.offsetX}, ${e.y+z.value.yAxisFontSize/3})`,"text-anchor":Kn.value?`start`:`end`,"font-size":z.value.yAxisFontSize,fill:M.value.yAxis.dataLabels.color,"font-weight":M.value.yAxis.dataLabels.bold?`bold`:`normal`},nt(x(n)({p:M.value.yAxis.dataLabels.prefix,v:e.value,s:M.value.yAxis.dataLabels.suffix,r:M.value.yAxis.dataLabels.roundingValue})),11,bt)):p(``,!0)]))),128))],512)):p(``,!0),M.value.xAxis.dataLabels.show&&!M.value.xAxis.dataLabels.datetimeFormatter.enable?(_(),m(`g`,{key:2,ref_key:`timeLabelsEls`,ref:hn},[(_(!0),m(d,null,y(xr.value,(e,t)=>(_(),m(`g`,null,[h(`text`,{class:`vue-data-ui-time-label`,transform:`translate(${H.value.left+X.value*t+X.value/2}, ${H.value.bottom+z.value.xAxisFontSize*1.5}), rotate(${M.value.xAxis.dataLabels.rotation})`,"text-anchor":M.value.xAxis.dataLabels.rotation>0?`start`:M.value.xAxis.dataLabels.rotation<0?`end`:`middle`,"font-size":z.value.xAxisFontSize,fill:M.value.xAxis.dataLabels.color,"font-weight":M.value.xAxis.dataLabels.bold?`bold`:`normal`},nt(e),9,xt)]))),256))],512)):p(``,!0),M.value.xAxis.dataLabels.show&&M.value.xAxis.dataLabels.datetimeFormatter.enable?(_(),m(`g`,{key:3,ref_key:`timeLabelsEls`,ref:hn},[(_(!0),m(d,null,y(Mr.value,(e,t)=>(_(),m(`g`,null,[h(`text`,{class:`vue-data-ui-time-label`,transform:`translate(${H.value.left+X.value*t+X.value/2}, ${H.value.bottom+z.value.xAxisFontSize*1.5}), rotate(${M.value.xAxis.dataLabels.rotation})`,"text-anchor":M.value.xAxis.dataLabels.rotation>0?`start`:M.value.xAxis.dataLabels.rotation<0?`end`:`middle`,"font-size":z.value.xAxisFontSize,fill:M.value.xAxis.dataLabels.color,stroke:P.value.backgroundColor,"stroke-width":`3`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"paint-order":`stroke fill`,"font-weight":M.value.xAxis.dataLabels.bold?`bold`:`normal`},nt(e?.text??``),9,St)]))),256))],512)):p(``,!0),A.value.type===`candlestick`?(_(),m(d,{key:4},[h(`g`,null,[(_(!0),m(d,null,y(Q.value,(e,t)=>(_(),m(`g`,null,[h(`rect`,{x:e.open.x-N.value.wick.strokeWidth/2,y:e.high.y,width:N.value.wick.strokeWidth,height:Math.abs(e.high.y-e.low.y),fill:N.value.wick.stroke,stroke:`none`,rx:N.value.wick.strokeWidth/2,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(V)})},null,10,Ct),N.value.wick.extremity.shape===`circle`?(_(),m(`g`,wt,[h(`circle`,{cx:e.high.x,cy:e.high.y,r:N.value.wick.extremity.size===`auto`?X.value/20:N.value.wick.extremity.size,fill:N.value.wick.extremity.color,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(V)})},null,10,Tt),h(`circle`,{cx:e.low.x,cy:e.low.y,r:N.value.wick.extremity.size===`auto`?X.value/20:N.value.wick.extremity.size,fill:N.value.wick.extremity.color,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(V)})},null,10,Et)])):p(``,!0),N.value.wick.extremity.shape===`line`?(_(),m(`g`,Dt,[h(`rect`,{x:e.high.x-(N.value.wick.extremity.size===`auto`?X.value*N.value.candle.widthRatio:N.value.wick.extremity.size)/2,y:e.high.y-N.value.wick.strokeWidth/2,width:Math.abs(e.high.x-(N.value.wick.extremity.size===`auto`?X.value*P.value.layout.candle.widthRatio:P.value.layout.wick.extremity.size)/2-(e.high.x+(P.value.layout.wick.extremity.size===`auto`?X.value*P.value.layout.candle.widthRatio:P.value.layout.wick.extremity.size)/2)),height:N.value.wick.strokeWidth,rx:N.value.wick.strokeWidth/2,fill:N.value.wick.extremity.color,stroke:`none`,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(V)})},null,10,Ot),h(`rect`,{x:e.low.x-(N.value.wick.extremity.size===`auto`?X.value*N.value.candle.widthRatio:N.value.wick.extremity.size)/2,y:e.low.y-N.value.wick.strokeWidth/2,width:Math.abs(e.low.x-(N.value.wick.extremity.size===`auto`?X.value*P.value.layout.candle.widthRatio:P.value.layout.wick.extremity.size)/2-(e.low.x+(P.value.layout.wick.extremity.size===`auto`?X.value*P.value.layout.candle.widthRatio:P.value.layout.wick.extremity.size)/2)),height:N.value.wick.strokeWidth,fill:N.value.wick.extremity.color,stroke:`none`,rx:N.value.wick.strokeWidth/2,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(V)})},null,10,kt)])):p(``,!0)]))),256))]),h(`g`,null,[(_(!0),m(d,null,y(Q.value,(e,t)=>(_(),m(`rect`,{x:e.open.x-X.value/2+X.value*(1-j.value.widthRatio)/2,y:e.isBullish?e.close.y:e.open.y,height:Math.abs(e.close.y-e.open.y)<=0?1e-4:Math.abs(e.close.y-e.open.y),width:X.value*j.value.widthRatio<=0?1e-4:X.value*j.value.widthRatio,fill:j.value.gradient.underlayer,rx:j.value.borderRadius,stroke:`none`,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(V)})},null,10,At))),256)),(_(!0),m(d,null,y(Q.value,(e,t)=>(_(),m(`rect`,{x:e.open.x-X.value/2+X.value*(1-j.value.widthRatio)/2,y:e.isBullish?e.close.y:e.open.y,height:Math.abs(e.close.y-e.open.y)<=0?1e-4:Math.abs(e.close.y-e.open.y),width:X.value*j.value.widthRatio<=0?1e-4:X.value*j.value.widthRatio,fill:e.isBullish?j.value.gradient.show?`url(#bullish_gradient_${E.value})`:j.value.colors.bullish:j.value.gradient.show?`url(#bearish_gradient_${E.value})`:j.value.colors.bearish,rx:j.value.borderRadius,stroke:j.value.stroke,"stroke-width":j.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(V)})},null,10,jt))),256))])],64)):p(``,!0),A.value.type===`ohlc`?(_(!0),m(d,{key:5},y(Q.value,(e,t)=>(_(),m(`g`,{key:`ohlc_${e.absoluteIndex}`},[h(`path`,{d:`M ${e.high.x},${e.high.y} ${e.low.x},${e.low.y} M${e.open.x-Math.min(6,X.value/3)},${e.open.y} ${e.open.x},${e.open.y} M${e.close.x},${e.close.y} ${e.close.x+Math.min(6,X.value/3)},${e.close.y}`,stroke:e.isBullish?j.value.colors.bullish:j.value.colors.bearish,"stroke-width":1,class:g({"vue-data-ui-transition":x(Sn)&&!x(V)}),"stroke-linecap":`round`,"stroke-linejoin":`round`},null,10,Mt)]))),128)):p(``,!0),h(`g`,null,[(_(!0),m(d,null,y(Q.value,(e,t)=>(_(),m(`rect`,{x:H.value.left+t*X.value,y:H.value.top,height:H.value.height<=0?1e-4:H.value.height,width:X.value<=0?1e-4:X.value,fill:D.value===t||vn.value===t?x(a)(N.value.selector.color,N.value.selector.opacity):`transparent`,onMouseover:()=>Lr(t,e,`pointer`),onMouseleave:()=>Ir(t,e),onClick:()=>Fr(t,e)},null,40,Nt))),256))])])):p(``,!0),gi.value?(_(),m(`rect`,{key:2,x:gi.value.x,y:gi.value.y,width:gi.value.width,height:gi.value.height,fill:er.value.selection.fill,"fill-opacity":er.value.selection.fillOpacity,stroke:er.value.selection.stroke,"stroke-opacity":er.value.selection.strokeOpacity,"stroke-width":er.value.selection.strokeWidth,"stroke-dasharray":er.value.selection.strokeDasharray,"stroke-linecap":`round`,"stroke-linejoin":`round`,"pointer-events":`none`},null,8,Pt)):p(``,!0),rr.value?(_(),m(`rect`,Je({key:3},Jn.value,{"data-start":W.value.start,"data-end":W.value.end}),null,16,Ft)):p(``,!0),b(e.$slots,`svg`,{svg:{...z.value,data:Q.value,drawingArea:H.value,isPrintingImg:x(Ln)||x(Rn)||x(si),isPrintingSvg:x(ci)}},void 0,!0)],46,ut)),e.$slots.hint?(_(),m(`div`,It,[b(e.$slots,`hint`,Xe(qe({hint:A.value.a11y.translations.keyboardNavigation,isVisible:xn.value})),void 0,!0)])):p(``,!0)]),e.$slots.watermark?(_(),m(`div`,Lt,[b(e.$slots,`watermark`,Xe(qe({isPrinting:x(Ln)||x(Rn)||x(si)||x(ci)})),void 0,!0)])):p(``,!0),P.value.zoom.show&&U.value>6&&Qt.value&&Hr.value?(_(),He(Ie,{key:6,ref_key:`chartSlicer`,ref:cn,"data-dom-to-png-ignore-layout":``,allMinimaps:vr.value,background:P.value.zoom.color,borderColor:P.value.backgroundColor,customFormat:P.value.zoom.customFormat,cutNullValues:!1,enableRangeHandles:P.value.zoom.enableRangeHandles,enableSelectionDrag:P.value.zoom.enableSelectionDrag,end:W.value.end,focusOnDrag:P.value.zoom.focusOnDrag,focusRangeRatio:P.value.zoom.focusRangeRatio,fontSize:P.value.zoom.fontSize,immediate:!P.value.zoom.preview.enable,inputColor:P.value.zoom.color,isPreview:rr.value,labelLeft:Nr.value.start||``,labelRight:Nr.value.end||``,max:U.value,min:0,minimap:P.value.zoom.minimap.show?x(L).map(e=>e[2]):[],minimapCompact:P.value.zoom.minimap.compact,minimapFrameColor:P.value.zoom.minimap.frameColor,minimapIndicatorColor:P.value.zoom.minimap.indicatorColor,minimapMerged:!1,minimapSelectedColor:P.value.zoom.minimap.selectedColor,minimapSelectedColorOpacity:P.value.zoom.minimap.selectedColorOpacity,minimapSelectedIndex:D.value,minimapSelectionRadius:1,preciseLabels:Ar.value,refreshEndPoint:P.value.zoom.endIndex===null?U.value:P.value.zoom.endIndex+1,refreshStartPoint:P.value.zoom.startIndex===null?0:P.value.zoom.startIndex,selectColor:P.value.zoom.highlightColor,selectedSeries:x(L),smoothMinimap:!1,start:W.value.start,textColor:P.value.color,timeLabels:Cr.value,usePreciseLabels:M.value.xAxis.dataLabels.datetimeFormatter.enable&&!P.value.zoom.useDefaultFormat,useResetSlot:P.value.zoom.useResetSlot,valueEnd:W.value.end,valueStart:W.value.start,verticalHandles:P.value.zoom.minimap.verticalHandles,minScale:M.value.yAxis.scale.min,maxScale:M.value.yAxis.scale.max,maxWidth:P.value.zoom.maxWidth,minimapLeftInsetRatio:z.value.width>0&&P.value.zoom.autoFit?H.value.left/z.value.width:null,minimapRightInsetRatio:z.value.width>0&&P.value.zoom.autoFit?(z.value.width-H.value.right)/z.value.width:null,additionalMinimapHeight:P.value.zoom.minimap.additionalHeight,handleType:P.value.zoom.minimap.handleType,handleIconColor:P.value.zoom.minimap.handleIconColor,handleBorderWidth:P.value.zoom.minimap.handleBorderWidth,handleBorderColor:P.value.zoom.minimap.handleBorderColor,handleFill:P.value.zoom.minimap.handleFill,handleWidth:P.value.zoom.minimap.handleWidth,"onUpdate:end":mi,"onUpdate:start":pi,onTrapMouse:di,onReset:t[0]||=()=>Br({force:!0,publish:!0}),onFutureEnd:t[1]||=e=>ir(`end`,e),onFutureStart:t[2]||=e=>ir(`start`,e)},{"reset-action":S(({reset:t})=>[b(e.$slots,`reset-action`,Xe(qe({reset:t})),void 0,!0)]),slotMap:S(({height:e,unitW:t})=>[(_(!0),m(d,null,y(_r.value({minimapH:e,unitW:t}),(e,n)=>(_(),m(`g`,null,[h(`path`,{d:`M ${e.high.x},${e.high.y} ${e.low.x},${e.low.y}`,stroke:e.isBullish?j.value.colors.bullish:j.value.colors.bearish,"stroke-width":1,style:Ze({opacity:n>=G.value.start&&n<=G.value.end?1:.6})},null,12,Rt),h(`path`,{d:`M ${e.open.x},${e.open.y} ${e.close.x},${e.close.y}`,stroke:e.isBullish?j.value.colors.bullish:j.value.colors.bearish,"stroke-width":Math.min(6,t/1.5),style:Ze({opacity:n>=G.value.start&&n<=G.value.end?1:.6})},null,12,zt)]))),256))]),_:3},8,/* @__PURE__ */ `allMinimaps.background.borderColor.customFormat.enableRangeHandles.enableSelectionDrag.end.focusOnDrag.focusRangeRatio.fontSize.immediate.inputColor.isPreview.labelLeft.labelRight.max.minimap.minimapCompact.minimapFrameColor.minimapIndicatorColor.minimapSelectedColor.minimapSelectedColorOpacity.minimapSelectedIndex.preciseLabels.refreshEndPoint.refreshStartPoint.selectColor.selectedSeries.start.textColor.timeLabels.usePreciseLabels.useResetSlot.valueEnd.valueStart.verticalHandles.minScale.maxScale.maxWidth.minimapLeftInsetRatio.minimapRightInsetRatio.additionalMinimapHeight.handleType.handleIconColor.handleBorderWidth.handleBorderColor.handleFill.handleWidth`.split(`.`))):p(``,!0),h(`div`,{ref_key:`chartLegend`,ref:sn},[b(e.$slots,`legend`,{legend:Q.value},void 0,!0)],512),e.$slots.source?(_(),m(`div`,{key:7,ref_key:`source`,ref:ln,dir:`auto`},[b(e.$slots,`source`,{},void 0,!0)],512)):p(``,!0),Ge(x(Ht),{teleportTo:P.value.tooltip.teleportTo,show:B.value.showTooltip&&nn.value,backgroundColor:P.value.tooltip.backgroundColor,color:P.value.tooltip.color,borderRadius:P.value.tooltip.borderRadius,borderColor:P.value.tooltip.borderColor,borderWidth:P.value.tooltip.borderWidth,fontSize:P.value.tooltip.fontSize,backgroundOpacity:P.value.tooltip.backgroundOpacity,position:P.value.tooltip.position,offsetX:P.value.tooltip.offsetX,offsetY:P.value.tooltip.offsetY,parent:O.value,content:rn.value,isFullscreen:Jr.value,isCustom:P.value.tooltip.customFormat&&typeof P.value.tooltip.customFormat==`function`,smooth:P.value.tooltip.smooth,backdropFilter:P.value.tooltip.backdropFilter,smoothForce:P.value.tooltip.smoothForce,smoothSnapThreshold:P.value.tooltip.smoothSnapThreshold,isA11yMode:bn.value===`keyboard`,a11yPosition:yn.value},{"tooltip-before":S(()=>[b(e.$slots,`tooltip-before`,Xe(qe({...Pr.value})),void 0,!0)]),tooltip:S(()=>[b(e.$slots,`tooltip`,Xe(qe({...Pr.value})),void 0,!0)]),"tooltip-after":S(()=>[b(e.$slots,`tooltip-after`,Xe(qe({...Pr.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`borderRadius`,`borderColor`,`borderWidth`,`fontSize`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isFullscreen`,`isCustom`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),Qt.value&&F.value.buttons.table?(_(),He(et(ri.value.component),Je({key:8},ri.value.props,{ref_key:`tableUnit`,ref:gn,onClose:ii}),Ue({content:S(()=>[(_(),He(x(Wt),{key:`table_${fn.value}`,colNames:qr.value.colNames,head:qr.value.head,body:qr.value.body,config:qr.value.config,title:A.value.table.useDialog?``:ri.value.title,withCloseButton:!A.value.table.useDialog,isCursorPointer:Cn.value,onClose:ii},{th:S(({th:e})=>[We(nt(e),1)]),td:S(({td:e})=>[h(`div`,{innerHTML:e},null,8,Bt)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[A.value.table.useDialog?{name:`title`,fn:S(()=>[We(nt(ri.value.title),1)]),key:`0`}:void 0,A.value.table.useDialog?{name:`actions`,fn:S(()=>[h(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[3]||=e=>Kr(F.value.callbacks.csv),style:Ze({cursor:Cn.value?`pointer`:`default`})},[Ge(x(Vt),{name:`fileCsv`,stroke:ri.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):p(``,!0),b(e.$slots,`skeleton`,{},()=>[x(I)?(_(),He(fe,{key:0})):p(``,!0)],!0)],46,st))}},[[`__scopeId`,`data-v-65795db1`]]);export{ot as n,Vt as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{$ as n,D as r,Ht as i,It as a,Jt as o,S as ee,X as te,Yt as ne,at as re,f as s,h as ie,i as c,in as ae,nt as oe,p as se,r as ce,t as le,w as ue,yt as de,zt as fe}from"./lib-rPeBMZrn.js";import{n as pe,t as me}from"./BaseScanner-8NdoBs7B.js";import{n as he,t as ge}from"./useHints-C-TwxM0Y.js";import{t as _e}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as ve}from"./resolveChartConfig-CIhClE5R.js";import{t as ye}from"./img-D4RQwASc.js";import{t as be}from"./useChartExport-BZts4KFb.js";import{t as xe}from"./tableIntegration-CNoJ1CIY.js";import{n as Se,t as Ce}from"./annotationSlots-RvQBEO9-.js";import{n as we,t as Te}from"./userOptionsSlots-DYuo-E5m.js";import{t as Ee}from"./usePrinter-DVf3YcG5.js";import{t as De}from"./DefGrad-DKMq1REY.js";import{t as Oe}from"./A11yDataTable-DWNlWXzs.js";import{t as ke}from"./useUserOptionState-CXlFnwPv.js";import{t as Ae}from"./useChartAccessibility-DOMuYJfm.js";import{t as je}from"./useTableResponsive-uSz_qZOB.js";import{t as Me}from"./vue_ui_chestnut-BxxivKN7.js";import{Fragment as l,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createSlots as Ne,createTextVNode as Pe,createVNode as h,defineAsyncComponent as Fe,guardReactiveProps as Ie,mergeProps as Le,nextTick as Re,normalizeClass as g,normalizeProps as ze,normalizeStyle as _,onMounted as Be,openBlock as v,ref as y,renderList as b,renderSlot as x,resolveDynamicComponent as Ve,toDisplayString as S,toRefs as He,unref as C,useCssVars as Ue,watch as We,withCtx as Ge,withKeys as Ke}from"vue";var qe=/* @__PURE__ */ e({default:()=>zn}),Je=[`id`],Ye=[`id`],Xe={"aria-live":`polite`,class:`sr-only`},Ze={key:2,ref:`noTitle`,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},Qe={style:{position:`relative`}},$e=[`xmlns`,`aria-describedby`,`viewBox`],et=[`width`,`height`],tt={key:1},nt=[`fill`,`font-weight`,`font-size`,`x`,`y`],rt=[`fill`,`font-weight`,`font-size`,`x`,`y`],it={key:2},at=[`x`,`y`,`font-size`,`font-weight`,`fill`],ot=[`x`,`y`,`font-size`,`font-weight`,`fill`],st=[`d`,`stroke`,`fill`],ct=[`cx`,`cy`,`r`,`fill`],lt=[`aria-label`,`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`,`onClick`],ut={key:3},dt=[`x`,`y`,`font-size`,`fill`,`onClick`],ft={key:0},pt=[`x`,`y`,`fill`,`font-size`,`font-weight`],mt=[`x`,`y`,`height`,`width`,`fill`,`rx`,`onClick`],ht=[`aria-label`,`x`,`y`,`height`,`width`,`fill`,`rx`,`stroke`,`stroke-width`,`onClick`],gt={key:4},_t=[`x`,`y`,`fill`,`font-size`,`onClick`],vt=[`d`,`stroke`],yt=[`aria-label`,`fill`,`cx`,`cy`,`r`,`onClick`],bt={key:5},xt=[`x`,`y`,`font-size`,`font-weight`,`fill`],St=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Ct=[`y`,`height`,`width`],wt={style:{width:`100%`,height:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`,"flex-direction":`column`}},Tt={style:{display:`flex`,"align-items":`center`,"justify-content":`center`,gap:`12px`,"flex-wrap":`wrap`,"flex-direction":`row`}},Et={viewBox:`0 0 20 20`,height:`16`,width:`16`},Dt=[`fill`],Ot={key:7},kt=[`y`,`height`,`width`],At={style:{width:`100%`,height:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`,"flex-direction":`column`}},jt={style:{display:`flex`,"align-items":`center`,"justify-content":`center`,gap:`12px`,"flex-wrap":`wrap`,"flex-direction":`row`}},Mt={viewBox:`0 0 20 20`,height:`16`,width:`16`},Nt=[`fill`],Pt=[`cx`,`cy`,`fill`],Ft=[`d`,`stroke`],It=[`cx`,`cy`,`fill`],Lt=[`d`,`stroke`],Rt=[`cx`,`cy`,`fill`],zt=[`cx`,`cy`,`fill`],Bt=[`x`,`y`,`fill`,`font-size`,`font-weight`],Vt=[`x`,`y`,`fill`,`font-size`,`font-weight`],Ht=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Ut=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Wt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Gt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Kt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],qt=[`x`,`y`,`font-size`,`fill`],Jt=[`x`,`y`,`font-size`,`fill`],Yt=[`x`,`y`,`font-size`,`fill`],Xt={key:4,class:`vue-data-ui-watermark`},Zt={key:5,ref:`source`,dir:`auto`},Qt={class:`vue-ui-data-table`},$t={key:0},en=[`data-cell`],tn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},nn={key:0},rn={key:1},an=[`data-cell`],on={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},sn={key:0},cn={key:1},ln=[`data-cell`],un={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},dn={key:0},fn={key:1},pn=[`data-cell`],mn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},hn={key:0},gn={key:1},_n=[`data-cell`],vn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},yn={key:0},bn={key:1},xn=[`data-cell`],Sn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Cn={key:0},wn={key:1},Tn=[`data-cell`],En={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Dn={key:0},On={key:1},kn=[`data-cell`],An={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},jn=[`data-cell`],Mn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Nn=[`data-cell`],Pn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Fn=[`data-cell`],In={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Ln=[`data-cell`],Rn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},zn=/*#__PURE__*/ _e({__name:`vue-ui-chestnut`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectRoot`,`selectBranch`,`selectNut`,`copyAlt`],setup(e,{expose:_e,emit:qe}){Ue(e=>({b4b59ab0:e.tdo}));let zn=Fe(()=>import(`./BaseIcon-fYK0iID8.js`).then(e=>e.n)),Bn=Fe(()=>import(`./vue-ui-accordion-D4FHxzsL.js`).then(e=>e.n)),Vn=Fe(()=>import(`./PenAndPaper-r50tK3S4.js`).then(e=>e.t)),Hn=Fe(()=>import(`./UserOptions-Em_JgDXM.js`).then(e=>e.n)),Un=Fe(()=>import(`./PackageVersion-u-p5bCcj.js`).then(e=>e.t)),Wn=Fe(()=>import(`./BaseDraggableDialog-9d30Yx8c.js`).then(e=>e.n)),{vue_ui_chestnut:Gn}=t(),w=e,Kn=u(()=>!!w.dataset&&w.dataset.length),T=y(te()),qn=y(null),Jn=y(0),Yn=y(null),Xn=y(null),Zn=y(!1),E=y(!1),D=y(``),O=y({level:`root`,rootIndex:0,branchIndex:0,nutIndex:0,locked:!1}),k=y(ar()),A=u(()=>k.value.style.chart.layout.roots),j=u(()=>k.value.style.chart.layout.branches),M=u(()=>k.value.style.chart.layout.nuts),N=u(()=>k.value.style.chart.layout),P=u(()=>k.value.style.chart);he({config:()=>k.value,dataset:()=>w.dataset,component:`VueUiChestnut`,rules:[ge.emptyArray,{test:e=>e.some(e=>e?.branches&&e.branches.length>10),message:[`👀 Some root has > 10 branches, which can make the chart heavy. Consider:`,``,`▶️ Grouping some branches in broader categories.`]},{test:e=>e.some(e=>e?.branches&&e.branches.some(e=>e?.breakdown&&e?.breakdown.length>6)),message:[`👀 Some donuts have > 6 series. Consider:`,``,`▶️ Grouping small values into an "Other" category.`]}]});let F=u(()=>k.value.userOptions.useCursorPointer),Qn=u(()=>ae({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{grandTotal:{show:!1},roots:{stroke:`#6A6A6A`,labels:{show:!1}},verticalSeparator:{stroke:`transparent`},branches:{stroke:`#6A6A6A`,underlayerColor:`#6A6A6A90`,labels:{show:!1,dataLabels:{show:!1}}}}}}},userConfig:k.value.skeletonConfig??{}})),{loading:$n,FINAL_DATASET:er}=pe({...He(w),FINAL_CONFIG:k,prepareConfig:ar,skeletonDataset:w.config?.skeletonDataset??[{name:`_`,color:`#969696`,branches:[{name:`_`,value:32,breakdown:[{name:`_`,value:16,color:`#CACACA`},{name:`_`,value:16,color:`#6A6A6A`}]},{name:`_`,value:16,breakdown:[{name:`_`,value:8,color:`#CACACA`},{name:`_`,value:8,color:`#6A6A6A`}]},{name:`_`,value:8,breakdown:[{name:`_`,value:4,color:`#CACACA`},{name:`_`,value:4,color:`#6A6A6A`}]},{name:`_`,value:4,breakdown:[{name:`_`,value:2,color:`#CACACA`},{name:`_`,value:2,color:`#6A6A6A`}]}]},{name:`_`,color:`#C4C4C4`,branches:[{name:`_`,value:24,breakdown:[{name:`_`,value:12,color:`#CACACA`},{name:`_`,value:12,color:`#6A6A6A`}]},{name:`_`,value:12,breakdown:[{name:`_`,value:6,color:`#CACACA`},{name:`_`,value:6,color:`#6A6A6A`}]},{name:`_`,value:6,breakdown:[{name:`_`,value:3,color:`#CACACA`},{name:`_`,value:3,color:`#6A6A6A`}]},{name:`_`,value:2,breakdown:[{name:`_`,value:1,color:`#CACACA`},{name:`_`,value:1,color:`#6A6A6A`}]}]}],skeletonConfig:ae({defaultConfig:k.value,userConfig:Qn.value})}),{userOptionsVisible:tr,setUserOptionsVisibility:nr,keepUserOptionState:rr}=ke({config:k.value}),{svgRef:ir}=Ae({config:N.value.title});function ar(){return ve(w.config,Gn,Me)}We(()=>w.config,e=>{k.value=ar(),tr.value=!k.value.userOptions.showOnChartHover,fr.value.showTable=k.value.table.show,Nr()},{deep:!0});let{isPrinting:or,isImaging:sr,generatePdf:cr,generateImage:lr}=Ee({elementId:`vue-ui-chestnut_${T.value}`,fileName:N.value.title.text||`vue-ui-chestnut`,options:k.value.userOptions.print}),ur=u(()=>k.value.userOptions.show),dr=u(()=>ue(k.value.customPalette)),fr=y({showTable:k.value.table.show});We(k,()=>{fr.value={showTable:k.value.table.show}},{immediate:!0});let pr=y(null),mr=u(()=>k.value.table.responsiveBreakpoint),I=y({gap:6,padding:{top:102,left:12,right:12,bottom:96},width:1024,height:0,branchSize:32,branchStart:128}),L=u(()=>({left:I.value.padding.left,top:I.value.padding.top,right:I.value.width-I.value.padding.right,bottom:I.value.height-I.value.padding.bottom,width:I.value.width-(I.value.padding.left+I.value.padding.right),height:I.value.height-(I.value.padding.top+I.value.padding.bottom),seedX:I.value.padding.left+64})),R=u(()=>er.value.flatMap(e=>(e.branches||[]).map(e=>e.value||0)).reduce((e,t)=>e+t,0)),hr=u(()=>k.value.debug),z=u(()=>(hr.value&&er.value.forEach((e,t)=>{de({datasetObject:e,requiredAttributes:[`name`,`branches`]}).forEach(e=>{re({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:t})}),e.branches&&e.branches.forEach((e,n)=>{de({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{re({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:`${t} - ${n}`})}),e.breakdown&&e.breakdown.forEach((e,r)=>{de({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{re({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:`${t} - ${n} - ${r}`})})})})}),er.value.map((e,t)=>{let n=(e.branches||[]).map(e=>e.value||0).reduce((e,t)=>e+t,0);return{...e,color:ee(e.color)||dr.value[t]||i[t]||i[t%i.length],id:e.id||`root_${t}_${T.value}`,type:`root`,total:n,rootIndex:t,branches:(e.branches||[]).map((r,a)=>({...r,rootName:e.name,rootIndex:t,color:ee(e.color)||dr.value[t]||i[t]||i[t%i.length],value:r.value>=0?r.value:0,id:r.id||`branch_${t}_${a}_${T.value}`,proportionToRoot:r.value/n,type:`branch`,breakdown:(r.breakdown||[]).map((o,te)=>({table:{rootName:e.name,rootValue:n,rootToTotal:n/R.value,branchName:r.name,branchValue:r.value,branchToTotal:r.value/R.value,branchToRoot:r.value/n,nutName:o.name,nutValue:o.value,nutToTotal:o.value/R.value,nutToRoot:o.value/n,nutToBranch:o.value/r.value},...o,type:`nut`,branchName:r.name,rootName:e.name,branchTotal:r.value>=0?r.value:0,proportionToBranch:o.value/r.value,proportionToRoot:o.value/n,proportionToTree:o.value/R.value,rootIndex:t,id:o.id||`nut_${t}_${a}_${te}_${T.value}`,color:ee(o.color)||dr.value[te]||i[te]||i[te%i.length],value:o.value>=0?o.value:0}))}))}})));function gr(){return z.value}let _r=qe,vr=u(()=>z.value.flatMap(e=>e.branches).length),yr=u(()=>Math.max(...z.value.map(e=>e.branches.map(e=>e.value).reduce((e,t)=>e+t,0)))),br=u(()=>Math.max(...z.value.flatMap(e=>e.branches.map(e=>e.value)))),xr=u(()=>256+I.value.padding.left),B=u(()=>z.value.sort((e,t)=>t.total-e.total).map((e,t)=>{let n=L.value.height/z.value.length/2,r=e.total/yr.value*(n>64?64:n);return{...e,x:L.value.seedX,y:L.value.top+L.value.height/z.value.length*(t+1)-(L.value.height/z.value.length/2+I.value.gap/2),r:r<I.value.branchSize/2?I.value.branchSize/2:r}})),Sr=u(()=>j.value.widthRatio<=0?.1:j.value.widthRatio>1.8?1.8:j.value.widthRatio),Cr=u(()=>B.value.flatMap(e=>e.branches)),V=u(()=>Cr.value.sort((e,t)=>t.value-e.value).map((e,t)=>({...e,y1:t*I.value.branchSize+L.value.top+t*I.value.gap,y2:t*I.value.branchSize+I.value.branchSize,x1:xr.value,x2:384*e.value/br.value*Sr.value+xr.value}))),wr=u(()=>B.value),Tr=u(()=>wr.value.map(e=>V.value.filter(t=>t.rootIndex===e.rootIndex).sort((e,t)=>e.y1-t.y1))),Er=u(()=>wr.value.map((e,t)=>Tr.value[t].map(e=>(e.breakdown||[]).map((t,n)=>({...t,nutIndex:n,rootIndex:e.rootIndex,branchId:e.id,branchName:e.name,branchValue:e.value,rootName:e.rootName})))));function Dr(e){let t=B.value.find(t=>t.rootIndex===e.rootIndex);return{x:t.x,y:t.y,r:t.r}}let H=y(null),U=y(null),W=y(null),G=y(null);function K(){H.value=null,W.value=null,G.value=null}function q(e){if(H.value)return e.type===`root`?e.rootIndex===H.value.rootIndex:e.type===`branch`?e.id===H.value.id:e.type===`nut`&&e.branchName===H.value.name&&e.rootIndex===H.value.rootIndex;if(W.value)return e.type===`root`?e.rootIndex===W.value.rootIndex:e.type===`branch`?e.id===W.value.id:e.type===`nut`&&e.branchName===W.value.name&&e.rootIndex===W.value.rootIndex;if(G.value)return e.type===`root`?e.id===G.value.id:e.type===`branch`||e.type===`nut`?e.rootIndex===G.value.rootIndex:!1;if(ci.value&&E.value){if(O.value.level===`root`)return e.type===`root`?Z.value&&e.id===Z.value.id:e.type===`branch`||e.type===`nut`?Z.value&&e.rootIndex===Z.value.rootIndex:!1;if(O.value.level===`branch`)return e.type===`root`?Z.value&&e.rootIndex===Z.value.rootIndex:e.type===`branch`?oi.value&&e.id===oi.value.id:(e.type,!1);if(O.value.level===`nut`)return e.type===`root`?Z.value&&e.rootIndex===Z.value.rootIndex:e.type===`branch`?si.value&&e.id===si.value.id:e.type===`nut`&&si.value&&e.branchName===si.value.name&&e.rootIndex===si.value.rootIndex}return!0}function Or(e){K();let t=wr.value.findIndex(t=>t.rootIndex===e.rootIndex),n=(Tr.value[t]||[]).findIndex(t=>t.id===e.id);t!==-1&&(O.value.rootIndex=t),n!==-1&&(O.value.branchIndex=n),O.value.level=`nut`,O.value.nutIndex=0,Re(()=>{H.value=e,W.value=e,U.value=a({series:e.breakdown,base:1},e.x2+24+M.value.offsetX,e.y1+I.value.branchSize/2,80,80),_r(`selectNut`,e.breakdown),Q()})}function J(){H.value=null,U.value=null,_r(`selectNut`,null)}function kr(e){let t=wr.value.findIndex(t=>t.rootIndex===e.rootIndex),n=(Tr.value[t]||[]).findIndex(t=>t.id===e.id);t!==-1&&(O.value.rootIndex=t),n!==-1&&(O.value.branchIndex=n),O.value.level=`branch`,O.value.nutIndex=0,W.value&&W.value.id===e.id?(W.value=null,K(),_r(`selectBranch`,null),Q()):(K(),W.value=e,_r(`selectBranch`,e),Q())}function Ar(e){let t=wr.value.findIndex(t=>t.id===e.id);t!==-1&&(O.value.rootIndex=t),O.value.level=`root`,O.value.branchIndex=0,O.value.nutIndex=0,G.value&&G.value.id===e.id?(K(),_r(`selectRoot`,null),Q()):(K(),G.value=e,_r(`selectRoot`,e),Q())}function jr(){return L.value.bottom-(H.value.y1+180)<0?0:L.value.bottom}function Mr(e){return e.proportion*100>M.value.selected.labels.dataLabels.hideUnderValue}Be(()=>{Nr()});function Nr(){fe(w.dataset)&&re({componentName:`VueUiChestnut`,type:`dataset`,debug:hr.value});let e=vr.value*(I.value.branchSize+I.value.gap)+I.value.padding.top+I.value.padding.bottom;I.value.height=e}let Y=u(()=>({head:[k.value.table.th.translations.rootName,k.value.table.th.translations.rootValue,k.value.table.th.translations.rootToTotal,k.value.table.th.translations.branchName,k.value.table.th.translations.branchValue,k.value.table.th.translations.branchToRoot,k.value.table.th.translations.branchToTotal,k.value.table.th.translations.nutName,k.value.table.th.translations.nutValue,k.value.table.th.translations.nutToBranch,k.value.table.th.translations.nutToRoot,k.value.table.th.translations.nutToTotal],body:z.value.flatMap((e,t)=>e.branches.flatMap((e,t)=>e.breakdown.flatMap((e,t)=>e.table)))}));function Pr(e=null){Re(()=>{let t=[[N.value.title.text],[N.value.title.subtitle.text],[``],[`Grand total`,R.value],[``]],n=Y.value.head,i=Y.value.body.map((e,t)=>[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?``:e.rootName,Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?``:e.rootValue,Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?``:e.rootToTotal,Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?``:e.branchName,Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?``:e.branchValue,Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?``:e.branchToRoot,Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?``:e.branchToTotal,e.nutName,e.nutValue,e.nutToBranch,e.nutToRoot,e.nutToTotal]),a=t.concat([n]).concat(i),o=r(a);e?e(o):oe({csvContent:o,title:N.value.title.text||`vue-ui-chestnut`})})}let Fr=y(!1);function Ir(e){Fr.value=e,Jn.value+=1}function Lr(){fr.value.showTable=!fr.value.showTable}let Rr=y(!1);function zr(){Rr.value=!Rr.value}async function Br({scale:e=2}={}){if(!qn.value)return;let{width:t,height:n}=qn.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await ye({domElement:qn.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:N.value.title.text,width:t,height:n,aspectRatio:r}}function Vr(e){let t=Dr(e),n=e.x1,r=e.y1,i=I.value.branchSize,a=t.x+t.r/2,o=t.y;return[`M ${n},${r}`,`C ${n-20},${r} ${n-20},${r} ${a},${o}`,`C ${a},${o} ${n-20},${r+i} ${n},${r+i}`,`Z`].join(` `)}let Hr=u(()=>xe({config:k,style:P,mutableConfig:fr,dialog:Wn,accordion:Bn,isFullscreen:Fr,parent:qn,maxWidth:800,titleStyle:N,isCursorPointer:F}));We(()=>fr.value.showTable,async e=>{k.value.table.show||(e&&k.value.table.useDialog&&Yn.value?(await Re(),Yn.value.open()):`close`in Yn.value&&Yn.value.close())});let{isResponsive:Ur}=je(pr,mr);function Wr(){fr.value.showTable=!1,Xn.value&&Xn.value.setTableIconState(!1)}let Gr=u(()=>z.value.map((e,t)=>({...e,display:`${e.name}: ${c(A.value.labels.formatter,e.total,n({p:N.value.legend.prefix,v:e.total,s:N.value.legend.suffix,r:N.value.legend.roundingValue}),{datapoint:e})} (${n({v:e.total/R.value*100,s:`%`,r:N.value.legend.roundingPercentage})})`}))),Kr=u(()=>Gr.value.map(e=>({color:e.color,name:e.display,shape:`circle`}))),qr=u(()=>P.value.backgroundColor),Jr=u(()=>({...N.value.legend,textAlign:`center`,show:!0,position:`bottom`})),Yr=u(()=>N.value.title),{isCallbackImaging:Xr,isCallbackSvg:Zr,generateSvg:Qr,onGenerateImage:$r}=be({svg:ir,title:Yr,legend:Jr,legendItems:Kr,backgroundColor:qr,titleEmbedded:!0,getSvgCallback:()=>k.value.userOptions.callbacks.svg,generateImage:lr});async function ei(){_r(`copyAlt`,{config:k.value,dataset:z.value}),k.value.userOptions.callbacks.altCopy?await Promise.resolve(k.value.userOptions.callbacks.altCopy({config:k.value,dataset:z.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function ti(e){if(!e)return``;let t=n({p:N.value.legend.prefix,v:e.total,s:N.value.legend.suffix,r:N.value.legend.roundingValue}),r=n({v:e.total/R.value*100,s:`%`,r:N.value.legend.roundingPercentage});return`Root ${e.name}. Value ${t}. ${r} of total.`}function ni(e){if(!e)return``;let t=n({p:j.value.labels.dataLabels.prefix,v:e.value,s:j.value.labels.dataLabels.suffix,r:j.value.labels.dataLabels.roundingValue}),r=n({v:e.proportionToRoot*100,s:`%`,r:N.value.legend.roundingPercentage});return`Branch ${e.name}. Root ${e.rootName}. Value ${t}. ${r} of root ${e.rootName}.`}function ri(e){if(!e)return``;let t=n({p:N.value.legend.prefix,v:e.value,s:N.value.legend.suffix,r:M.value.selected.labels.roundingValue}),r=n({v:e.proportionToBranch*100,s:`%`,r:M.value.selected.labels.roundingPercentage});return`Nut ${e.name}. Branch ${e.branchName}. Root ${e.rootName}. Value ${t}. ${r} of branch ${e.branchName}.`}let ii=u(()=>wr.value[O.value.rootIndex]||null),X=u(()=>(Tr.value[O.value.rootIndex]||[])[O.value.branchIndex]||null),ai=u(()=>((Er.value[O.value.rootIndex]||[])[O.value.branchIndex]||[])[O.value.nutIndex]||null),Z=u(()=>ii.value),oi=u(()=>X.value),si=u(()=>O.value.level===`nut`?X.value:null),ci=u(()=>Zn.value);function Q(){O.value.level===`root`?D.value=ti(ii.value):O.value.level===`branch`?D.value=ni(X.value):O.value.level===`nut`&&(D.value=ri(ai.value))}function $(){O.value={level:`root`,rootIndex:0,branchIndex:0,nutIndex:0,locked:!1},D.value=``}function li(){let e=Tr.value[O.value.rootIndex]||[];e.length?(O.value.branchIndex>=e.length&&(O.value.branchIndex=0),O.value.branchIndex<0&&(O.value.branchIndex=e.length-1)):O.value.branchIndex=0}function ui(){let e=(Er.value[O.value.rootIndex]||[])[O.value.branchIndex]||[];e.length?(O.value.nutIndex>=e.length&&(O.value.nutIndex=0),O.value.nutIndex<0&&(O.value.nutIndex=e.length-1)):O.value.nutIndex=0}function di(e){if(O.value.level===`root`){let t=wr.value.length;if(!t)return;O.value.rootIndex+=e,O.value.rootIndex>=t&&(O.value.rootIndex=0),O.value.rootIndex<0&&(O.value.rootIndex=t-1),O.value.branchIndex=0,O.value.nutIndex=0,Q()}else O.value.level===`branch`?(O.value.branchIndex+=e,li(),O.value.nutIndex=0,Q()):O.value.level===`nut`&&(O.value.nutIndex+=e,ui(),Q())}function fi(e){if(e>0){if(O.value.level===`root`){if(!(Tr.value[O.value.rootIndex]||[]).length)return;O.value.level=`branch`,O.value.branchIndex=0,O.value.nutIndex=0,Q();return}if(O.value.level===`branch`){if(!((Er.value[O.value.rootIndex]||[])[O.value.branchIndex]||[]).length)return;O.value.level=`nut`,O.value.nutIndex=0,X.value?Or(X.value):Q();return}}else O.value.level===`nut`?(J(),W.value=null,O.value.level=`branch`,O.value.nutIndex=0,Q()):O.value.level===`branch`&&(W.value=null,G.value=null,O.value.level=`root`,O.value.nutIndex=0,Q())}function pi(){O.value.level===`root`&&ii.value?(Ar(ii.value),D.value=`${ti(ii.value)} selected.`):O.value.level===`branch`&&X.value?(kr(X.value),D.value=`${ni(X.value)} selected.`):O.value.level===`nut`&&X.value&&ai.value&&(Or(X.value),D.value=`${ri(ai.value)} details opened.`)}function mi(){Zn.value=!0,E.value=!1}function hi(){Zn.value=!1,E.value=!1,D.value=``,G.value||W.value||H.value||$()}function gi(e){let t=e.key===`ArrowUp`,n=e.key===`ArrowDown`,r=e.key===`ArrowLeft`,i=e.key===`ArrowRight`,a=e.key===`Enter`||e.key===` `,o=e.key===`Escape`;(t||n||r||i||a||o)&&(e.preventDefault(),e.stopPropagation(),Zn.value||=!0,o?(K(),$(),E.value=!1):((t||n||r||i)&&(E.value=!0),t?di(-1):n?di(1):r?fi(-1):i?fi(1):a&&pi()))}let _i=u(()=>({headers:Y.value.head,rows:Y.value.body.map(e=>[e.rootName,e.rootValue,n({v:e.rootToTotal*100,s:`%`,r:k.value.table.td.roundingPercentage}),e.branchName,e.branchValue,n({v:e.branchToRoot*100,s:`%`,r:k.value.table.td.roundingPercentage}),n({v:e.branchToTotal*100,s:`%`,r:k.value.table.td.roundingPercentage}),e.nutName,e.nutValue,n({v:e.nutToBranch*100,s:`%`,r:k.value.table.td.roundingPercentage}),n({v:e.nutToRoot*100,s:`%`,r:k.value.table.td.roundingPercentage}),n({v:e.nutToTotal*100,s:`%`,r:k.value.table.td.roundingPercentage})])}));return _e({getData:gr,getImage:Br,generatePdf:cr,generateCsv:Pr,generateImage:lr,generateSvg:Qr,toggleTable:Lr,toggleAnnotator:zr,toggleFullscreen:Ir,copyAlt:ei}),(e,t)=>(v(),p(`div`,{class:g(`vue-data-ui-component vue-ui-chestnut ${Fr.value?`vue-data-ui-wrapper-fullscreen`:``}`),ref_key:`chestnutChart`,ref:qn,id:`vue-ui-chestnut_${T.value}`,style:_(`font-family:${k.value.style.fontFamily};width:100%; text-align:center;background:${P.value.backgroundColor}`),onMouseenter:t[12]||=()=>C(nr)(!0),onMouseleave:t[13]||=()=>C(nr)(!1)},[m(`div`,{id:`chart-instructions-${T.value}`,class:`sr-only`},[m(`p`,null,S(k.value.a11y.translations.keyboardNavigation),1)],8,Ye),m(`div`,Xe,S(D.value),1),_i.value?.rows?.length?(v(),d(Oe,{key:0,uid:T.value,head:_i.value.headers,body:_i.value.rows,notice:k.value.a11y.translations.tableAvailable,caption:k.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):f(``,!0),k.value.userOptions.buttons.annotator?(v(),d(C(Vn),{key:1,showGroupActions:k.value.userOptions.annotator?.showGroupActions??!0,svgRef:C(ir),backgroundColor:P.value.backgroundColor,color:P.value.color,active:Rr.value,isCursorPointer:F.value,palette:k.value.userOptions.annotatorPalette,onClose:zr},Ne({_:2},[b(C(Ce),t=>({name:t,fn:Ge(n=>[x(e.$slots,t,ze(Ie(C(Se)(t,n))),void 0,!0)])}))]),1032,[`showGroupActions`,`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):f(``,!0),ur.value?(v(),p(`div`,Ze,null,512)):f(``,!0),k.value.userOptions.show&&Kn.value&&(C(rr)||C(tr))?(v(),d(C(Hn),{ref_key:`userOptionsRef`,ref:Xn,key:`user_options_${Jn.value}`,backgroundColor:P.value.backgroundColor,color:P.value.color,isImaging:C(sr),isPrinting:C(or),uid:T.value,hasPdf:k.value.userOptions.buttons.pdf,hasImg:k.value.userOptions.buttons.img,hasSvg:k.value.userOptions.buttons.svg,hasXls:k.value.userOptions.buttons.csv,hasTable:k.value.userOptions.buttons.table,hasFullscreen:k.value.userOptions.buttons.fullscreen,hasAltCopy:k.value.userOptions.buttons.altCopy,isFullscreen:Fr.value,titles:{...k.value.userOptions.buttonTitles},chartElement:qn.value,position:k.value.userOptions.position,hasAnnotator:k.value.userOptions.buttons.annotator,isAnnotation:Rr.value,callbacks:k.value.userOptions.callbacks,printScale:k.value.userOptions.print.scale,tableDialog:k.value.table.useDialog,isCursorPointer:F.value,onToggleFullscreen:Ir,onGeneratePdf:C(cr),onGenerateCsv:Pr,onGenerateImage:C($r),onGenerateSvg:C(Qr),onToggleTable:Lr,onToggleAnnotator:zr,onCopyAlt:ei,style:_({visibility:C(rr)?C(tr)?`visible`:`hidden`:`visible`})},Ne({_:2},[b(C(we)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:Ge(n=>[x(e.$slots,t,ze(Ie(C(Te)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isImaging.isPrinting.uid.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasFullscreen.hasAltCopy.isFullscreen.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):f(``,!0),m(`div`,Qe,[I.value.height>0?(v(),p(`svg`,{key:0,ref_key:`svgRef`,ref:ir,xmlns:C(le),"aria-describedby":`chart-instructions-${T.value}`,class:g({"vue-data-ui-fullscreen--on":Fr.value,"vue-data-ui-fulscreen--off":!Fr.value}),viewBox:`0 0 ${I.value.width<=0?10:I.value.width} ${I.value.height<=0?10:I.value.height}`,style:_(`overflow:visible;background:transparent;color:${P.value.color}`),tabindex:`0`,onFocus:mi,onBlur:hi,onKeydown:gi},[h(C(Un)),x(e.$slots,`svg-underlayer`,{svg:{...I.value,isPrintingImg:C(or)||C(sr)||C(Xr),isPrintingSvg:C(Zr)}},void 0,!0),e.$slots[`chart-background`]?(v(),p(`foreignObject`,{key:0,x:0,y:0,width:I.value.width<=0?10:I.value.width,height:I.value.height<=0?10:I.value.height,style:{pointerEvents:`none`}},[x(e.$slots,`chart-background`,{},void 0,!0)],8,et)):f(``,!0),H.value?f(``,!0):(v(),p(`g`,tt,[N.value.title.text?(v(),p(`text`,{key:0,"text-anchor":`middle`,fill:N.value.title.color,"font-weight":N.value.title.bold?`bold`:`normal`,"font-size":N.value.title.fontSize,x:I.value.width/2,y:12+N.value.title.fontSize+N.value.title.offsetY,onClick:t[0]||=()=>{K(),$(),E.value=!1}},S(N.value.title.text),9,nt)):f(``,!0),N.value.title.subtitle.text?(v(),p(`text`,{key:1,"text-anchor":`middle`,fill:N.value.title.subtitle.color,"font-weight":N.value.title.subtitle.bold?`bold`:`normal`,"font-size":N.value.title.subtitle.fontSize,x:I.value.width/2,y:48+N.value.title.subtitle.fontSize+N.value.title.subtitle.offsetY,onClick:t[1]||=()=>{K(),$(),E.value=!1}},S(N.value.title.subtitle.text),9,rt)):f(``,!0)])),m(`defs`,null,[(v(!0),p(l,null,b(z.value,(e,t)=>(v(),d(De,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`root_gradient_${T.value}_${e.rootIndex}`,key:`root_gradient_${T.value}_${e.rootIndex}`,stops:[[`0%`,C(o)(C(ne)(e.color,.05),100-A.value.gradientIntensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128)),(v(!0),p(l,null,b(z.value,e=>(v(),d(De,{t:`linear`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,id:`branch_gradient_${T.value}_${e.rootIndex}`,key:`branch_gradient_${T.value}_${e.rootIndex}`,stops:[[`0%`,e.color,1],[`100%`,C(o)(C(ne)(e.color,.02),100-j.value.gradientIntensity),1]]},null,8,[`id`,`stops`]))),128)),h(De,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nutpick_${T.value}`,stops:[[`0%`,C(o)(`#FFFFFF`,0),0],[`80%`,C(o)(`#FFFFFF`,M.value.selected.gradientIntensity),1],[`100%`,C(o)(`#FFFFFF`,0),0]]},null,8,[`id`,`stops`]),h(De,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nut_${T.value}`,stops:[[`0%`,C(o)(`#FFFFFF`,0),0],[`80%`,C(o)(`#FFFFFF`,M.value.gradientIntensity),1],[`100%`,C(o)(`#FFFFFF`,0),0]]},null,8,[`id`,`stops`]),h(De,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nut_underlayer_${T.value}`,stops:[[`0%`,C(o)(P.value.backgroundColor,100),1],[`80%`,C(o)(P.value.backgroundColor,60),1],[`100%`,C(o)(P.value.backgroundColor,0),1]]},null,8,[`id`,`stops`])]),N.value.grandTotal.show?(v(),p(`g`,it,[m(`text`,{x:L.value.seedX,y:32+N.value.grandTotal.offsetY,"font-size":N.value.grandTotal.fontSize,"font-weight":N.value.grandTotal.bold?`bold`:`normal`,fill:N.value.grandTotal.color,"text-anchor":`middle`,onClick:t[2]||=()=>{K(),$(),E.value=!1}},S(N.value.grandTotal.text),9,at),m(`text`,{x:L.value.seedX,y:38+N.value.grandTotal.fontSize+N.value.grandTotal.offsetY,"font-size":N.value.grandTotal.fontSize,"font-weight":N.value.grandTotal.bold?`bold`:`normal`,fill:N.value.grandTotal.color,"text-anchor":`middle`,onClick:t[3]||=()=>{K(),$(),E.value=!1}},S(C(c)(N.value.grandTotal.formatter,R.value,C(n)({p:N.value.grandTotal.prefix,v:R.value,s:N.value.grandTotal.suffix,r:N.value.grandTotal.roundingValue}))),9,ot)])):f(``,!0),(v(!0),p(l,null,b(V.value,e=>(v(),p(`g`,null,[m(`defs`,null,[h(De,{t:`linear`,id:`link_grad_${e.id}`,stops:[[`0%`,e.color,1],[`100%`,C(o)(e.color,N.value.links.opacity),1]]},null,8,[`id`,`stops`])]),m(`path`,{d:Vr(e),stroke:C(o)(e.color,N.value.links.opacity),fill:`url(#link_grad_${e.id})`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:_(`opacity:${+!!q(e)}`),onClick:t[4]||=()=>{K(),$(),E.value=!1}},null,12,st)]))),256)),(v(!0),p(l,null,b(B.value,e=>(v(),p(`circle`,{cx:e.x,cy:e.y,r:e.r,fill:A.value.underlayerColor,stroke:`none`,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`)},null,12,ct))),256)),(v(!0),p(l,null,b(B.value,(e,t)=>(v(),p(`circle`,{"aria-label":ti(e),cx:e.x,cy:e.y,r:e.r,fill:A.value.useGradient?`url(#root_gradient_${T.value}_${e.rootIndex})`:e.color,stroke:A.value.stroke,"stroke-width":A.value.strokeWidth,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>Ar(e)},null,12,lt))),256)),A.value.labels.show?(v(),p(`g`,ut,[(v(!0),p(l,null,b(B.value,(e,t)=>(v(),p(`text`,{x:e.x,y:e.y+A.value.labels.fontSize/2.6,"text-anchor":`middle`,"font-size":A.value.labels.fontSize,fill:A.value.labels.adaptColorToBackground?C(ce)(e.color):A.value.labels.color,"font-weight":`bold`,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>Ar(e)},S(C(c)(A.value.labels.formatter,e.total,C(n)({p:A.value.labels.prefix,v:e.total,s:A.value.labels.suffix,r:A.value.labels.roundingValue}),{datapoint:e})),13,dt))),256)),(v(!0),p(l,null,b(B.value,e=>(v(),p(`g`,null,[H.value&&e.rootIndex===H.value.rootIndex||W.value&&e.rootIndex===W.value.rootIndex||G.value&&e.rootIndex===G.value.rootIndex?(v(),p(`g`,ft,[m(`text`,{x:e.x,y:e.y+e.r+24,"text-anchor":`middle`,fill:A.value.labels.name.color,"font-size":A.value.labels.name.fontSize,"font-weight":A.value.labels.name.bold?`bold`:`normal`,onClick:t[5]||=()=>{K(),$(),E.value=!1}},S(e.name),9,pt)])):f(``,!0)]))),256))])):f(``,!0),(v(!0),p(l,null,b(V.value,e=>(v(),p(`rect`,{x:e.x1,y:e.y1,height:I.value.branchSize,width:e.x2-e.x1,fill:j.value.underlayerColor,rx:j.value.borderRadius,stroke:`none`,style:_(`opacity:${q(e)?1:.05}`),onClick:t=>kr(e)},null,12,mt))),256)),(v(!0),p(l,null,b(V.value,(e,t)=>(v(),p(`rect`,{"aria-label":ni(e),x:e.x1,y:e.y1,height:I.value.branchSize,width:e.x2-e.x1,fill:j.value.useGradient?`url(#branch_gradient_${T.value}_${e.rootIndex})`:e.color,rx:j.value.borderRadius,stroke:j.value.stroke,"stroke-width":j.value.strokeWidth,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>kr(e)},null,12,ht))),256)),j.value.labels.dataLabels.show?(v(),p(`g`,gt,[(v(!0),p(l,null,b(V.value,e=>(v(),p(`g`,null,[e.proportionToRoot*100>j.value.labels.dataLabels.hideUnderValue?(v(),p(`text`,{key:0,x:e.x1+6,y:e.y1+I.value.branchSize/1.5,"text-anchor":`start`,fill:C(ce)(e.color),"font-size":j.value.labels.dataLabels.fontSize,"font-weight":`bold`,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>kr(e)},S(C(c)(j.value.labels.dataLabels.formatter,e.value,C(n)({p:N.value.branches.labels.dataLabels.prefix,v:e.value,s:N.value.branches.labels.dataLabels.suffix,r:N.value.branches.labels.dataLabels.roundingValue}),{datapoint:e})),13,_t)):f(``,!0)]))),256))])):f(``,!0),(v(!0),p(l,null,b(V.value,(e,t)=>(v(),p(`g`,null,[(v(!0),p(l,null,b(C(a)({series:e.breakdown,base:1},e.x2+24+M.value.offsetX,e.y1+I.value.branchSize/2,I.value.branchSize/3,I.value.branchSize/3),(t,n)=>(v(),p(`path`,{d:t.path,stroke:t.color,"stroke-width":10,fill:`none`,style:_(`opacity:${q(e)?1:.1}`)},null,12,vt))),256)),m(`circle`,{"aria-label":`Open details for branch ${e.name} in root ${e.rootName}`,fill:M.value.useGradient?`url(#nut_${T.value})`:`transparent`,cx:e.x2+24+M.value.offsetX,cy:e.y1+I.value.branchSize/2,r:I.value.branchSize/2+2,onClick:t=>Or(e),style:_(`cursor:${F.value?`pointer`:`default`};opacity:${q(e)?1:.1}`)},null,12,yt)]))),256)),j.value.labels.show&&!W.value?(v(),p(`g`,bt,[(v(!0),p(l,null,b(V.value,e=>(v(),p(`text`,{x:e.x2+I.value.branchSize+24+M.value.offsetX,y:e.y1+I.value.branchSize/2+5,"font-size":j.value.labels.fontSize,"font-weight":j.value.labels.bold?`bold`:`normal`,fill:j.value.labels.color,"text-anchor":`start`,style:_(`opacity:${q(e)?1:.1}`)},S(e.name),13,xt))),256))])):f(``,!0),m(`line`,{x1:256+I.value.padding.left,x2:256+I.value.padding.left,y1:L.value.top,y2:L.value.bottom,stroke:N.value.verticalSeparator.stroke,"stroke-width":N.value.verticalSeparator.strokeWidth},null,8,St),!H.value&&!W.value?(v(),p(`foreignObject`,{key:6,x:0,y:L.value.bottom,height:I.value.height-L.value.bottom,width:I.value.width,style:{overflow:`visible`},"data-no-svg-export":``,onClick:t[6]||=()=>{K(),$(),E.value=!1}},[m(`div`,wt,[m(`div`,Tt,[(v(!0),p(l,null,b(B.value,e=>(v(),p(`div`,{style:_(`display:flex;align-items:center;gap:3px;flex-direction:row;font-size:${N.value.legend.fontSize}px;`)},[(v(),p(`svg`,Et,[m(`circle`,{cx:`10`,cy:`10`,r:`10`,fill:e.color,stroke:`none`},null,8,Dt)])),C($n)?f(``,!0):(v(),p(l,{key:0},[m(`span`,null,S(e.name)+`:`,1),m(`b`,null,S(C(c)(N.value.roots.labels.formatter,e.total,C(n)({p:P.value.layout.legend.prefix,v:e.total,s:P.value.layout.legend.suffix,r:P.value.layout.legend.roundingValue}),{datapoint:e})),1),Pe(` (`+S(C(n)({v:e.total/R.value*100,s:`%`,r:N.value.legend.roundingPercentage}))+`) `,1)],64))],4))),256))])])],8,Ct)):f(``,!0),H.value&&U.value?(v(),p(`g`,Ot,[(v(),p(`foreignObject`,{x:0,y:jr(),height:I.value.height-L.value.bottom,width:I.value.width,style:{overflow:`visible`},onClick:t[7]||=()=>{K(),$(),E.value=!1}},[m(`div`,At,[m(`b`,null,S(H.value.name),1),m(`div`,jt,[(v(!0),p(l,null,b(H.value.breakdown,(e,t)=>(v(),p(`div`,{style:_(`display:flex;align-items:center;gap:6px;flex-direction:row;font-size:${N.value.legend.fontSize}px;`)},[(v(),p(`svg`,Mt,[m(`circle`,{cx:`10`,cy:`10`,r:`10`,fill:e.color,stroke:`none`},null,8,Nt)])),m(`span`,null,[Pe(S(e.name)+`: `,1),m(`b`,null,S(N.value.legend.prefix)+` `+S(e.value.toFixed(P.value.layout.nuts.selected.labels.roundingValue))+` `+S(N.value.legend.suffix),1),Pe(` (`+S((e.proportionToBranch*100).toFixed(N.value.nuts.selected.labels.roundingPercentage))+`%)`,1)])],4))),256))])])],8,kt)),m(`circle`,{cx:H.value.x2+24+M.value.offsetX,cy:H.value.y1+I.value.branchSize/2,r:256,fill:`url(#nut_underlayer_${T.value})`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Pt),(v(!0),p(l,null,b(U.value,e=>(v(),p(`g`,null,[Mr(e)?(v(),p(`path`,{key:0,d:C(ie)(e,{x:H.value.x2+24+M.value.offsetX,y:H.value.y1+I.value.branchSize/2},16,16,!1,!1,64),stroke:e.color,"stroke-width":`1`,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Ft)):f(``,!0)]))),256)),m(`circle`,{cx:H.value.x2+24+M.value.offsetX,cy:H.value.y1+I.value.branchSize/2,r:118,fill:P.value.backgroundColor,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,It),(v(!0),p(l,null,b(U.value,e=>(v(),p(`path`,{d:e.path,stroke:e.color,"stroke-width":64,fill:`none`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Lt))),256)),m(`circle`,{cx:H.value.x2+24+M.value.offsetX,cy:H.value.y1+I.value.branchSize/2,r:110,fill:`url(#nutpick_${T.value})`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Rt),m(`circle`,{cx:H.value.x2+24+M.value.offsetX,cy:H.value.y1+I.value.branchSize/2,r:64,fill:P.value.backgroundColor,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,zt),m(`text`,{x:H.value.x2+24+M.value.offsetX,y:H.value.y1+8,fill:M.value.selected.labels.core.total.color,"font-size":M.value.selected.labels.core.total.fontSize,"font-weight":M.value.selected.labels.core.total.bold?`bold`:`normal`,"text-anchor":`middle`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(k.value.translations.total),11,Bt),m(`text`,{x:H.value.x2+24+M.value.offsetX,y:H.value.y1+36,fill:M.value.selected.labels.core.value.color,"font-size":M.value.selected.labels.core.value.fontSize,"font-weight":M.value.selected.labels.core.value.bold?`bold`:`normal`,"text-anchor":`middle`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(c)(M.value.selected.labels.dataLabels.formatter,H.value.value,C(n)({p:M.value.selected.labels.core.value.prefix,v:H.value.value,s:M.value.selected.labels.core.value.suffix,r:M.value.selected.roundingValue}),{datapoint:H.value})),11,Vt),(v(!0),p(l,null,b(U.value,(e,t)=>(v(),p(`g`,null,[Mr(e)?(v(),p(`text`,{key:0,x:C(s)(e).x,"text-anchor":C(s)(e).anchor,y:C(se)(e)-M.value.selected.labels.dataLabels.fontSize/6,fill:e.color,"font-size":M.value.selected.labels.dataLabels.fontSize/2,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},` ⬤ `,14,Ht)):f(``,!0),Mr(e)?(v(),p(`text`,{key:1,x:C(s)(e,!0).x,"text-anchor":C(s)(e,!0).anchor,y:C(se)(e),fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(H.value.breakdown[t].name),15,Ut)):f(``,!0)]))),256)),(v(!0),p(l,null,b(U.value,(e,t)=>(v(),p(`g`,null,[Mr(e)?(v(),p(`text`,{key:0,x:C(s)(e,!0).x,"text-anchor":C(s)(e).anchor,y:C(se)(e)+M.value.selected.labels.dataLabels.fontSize,fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(n)({v:H.value.breakdown[t].value/H.value.value*100,s:`%`,r:M.value.selected.labels.roundingPercentage}))+` `+S(k.value.translations.of)+` `+S(H.value.breakdown[t].branchName)+` `+S(C(c)(M.value.selected.labels.dataLabels.formatter,H.value.breakdown[t].value,C(n)({p:M.value.selected.labels.dataLabels.prefix,v:H.value.breakdown[t].value,s:M.value.selected.labels.dataLabels.suffix,r:M.value.selected.roundingValue}),{datapoint:U.value,seriesIndex:t})),15,Wt)):f(``,!0),Mr(e)?(v(),p(`text`,{key:1,x:C(s)(e,!0).x,"text-anchor":C(s)(e).anchor,y:C(se)(e)+M.value.selected.labels.dataLabels.fontSize*2,fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(n)({v:H.value.breakdown[t].proportionToRoot*100,s:`%`,r:M.value.selected.labels.roundingPercentage}))+` `+S(k.value.translations.of)+` `+S(H.value.breakdown[t].rootName),15,Gt)):f(``,!0),Mr(e)?(v(),p(`text`,{key:2,x:C(s)(e,!0).x,"text-anchor":C(s)(e).anchor,y:C(se)(e)+M.value.selected.labels.dataLabels.fontSize*3,fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(n)({v:H.value.breakdown[t].proportionToTree*100,s:`%`,r:M.value.selected.labels.roundingPercentage}))+` `+S(k.value.translations.proportionToTree),15,Kt)):f(``,!0)]))),256))])):f(``,!0),(v(!0),p(l,null,b(V.value,e=>(v(),p(`g`,null,[W.value&&W.value.id===e.id&&!H.value?(v(),p(`text`,{key:0,x:e.x1+6,y:e.y1+I.value.branchSize+24,"font-weight":`bold`,"text-anchor":`start`,"font-size":j.value.labels.dataLabels.fontSize,fill:j.value.labels.color,onClick:t[8]||=()=>{K(),$(),E.value=!1}},S(e.name)+`: `+S(C(c)(j.value.labels.dataLabels.formatter,e.value,C(n)({p:j.value.labels.dataLabels.prefix,v:e.value,s:j.value.labels.dataLabels.suffix,r:j.value.labels.dataLabels.roundingValue}),{datapoint:e})),9,qt)):f(``,!0),W.value&&W.value.id===e.id&&!H.value?(v(),p(`text`,{key:1,x:e.x1+6,y:e.y1+I.value.branchSize+48,"text-anchor":`start`,"font-size":j.value.labels.dataLabels.fontSize,fill:j.value.labels.color,onClick:t[9]||=()=>{K(),$(),E.value=!1}},S(C(n)({v:e.proportionToRoot*100,s:`%`,r:j.value.labels.dataLabels.roundingPercentage}))+` `+S(k.value.translations.of)+` `+S(e.rootName),9,Jt)):f(``,!0),W.value&&W.value.id===e.id&&!H.value?(v(),p(`text`,{key:2,x:e.x1+6,y:e.y1+I.value.branchSize+72,"text-anchor":`start`,"font-size":j.value.labels.dataLabels.fontSize,fill:j.value.labels.color,onClick:t[10]||=()=>{K(),$(),E.value=!1}},S(C(n)({v:e.value/R.value*100,s:`%`,r:j.value.labels.dataLabels.roundingPercentage}))+` `+S(k.value.translations.proportionToTree),9,Yt)):f(``,!0)]))),256)),x(e.$slots,`svg`,{svg:{...I.value,isPrintingImg:C(or)||C(sr)||C(Xr),isPrintingSvg:C(Zr)}},void 0,!0)],46,$e)):f(``,!0)]),e.$slots.watermark?(v(),p(`div`,Xt,[x(e.$slots,`watermark`,ze(Ie({isPrinting:C(or)||C(sr)||C(Xr)||C(Zr)})),void 0,!0)])):f(``,!0),x(e.$slots,`legend`,{legend:z.value},void 0,!0),e.$slots.source?(v(),p(`div`,Zt,[x(e.$slots,`source`,{},void 0,!0)],512)):f(``,!0),Kn.value&&k.value.userOptions.buttons.table?(v(),d(Ve(Hr.value.component),Le({key:6},Hr.value.props,{ref_key:`tableUnit`,ref:Yn,onClose:Wr}),Ne({content:Ge(()=>[m(`div`,{ref_key:`tableContainer`,ref:pr,class:`vue-ui-chestnut-table`,style:_(`${k.value.table.useDialog?``:`max-height: 300px;margin-top:24px`}`)},[m(`div`,{style:_(`${k.value.table.useDialog?``:`padding-top:36px;`}position: relative`)},[k.value.table.useDialog?f(``,!0):(v(),p(`div`,{key:0,role:`button`,tabindex:`0`,style:_(`width:32px; position: absolute; top: 0; left:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:${F.value?`pointer`:`default`}; background:${k.value.table.th.backgroundColor};`),onClick:Wr,onKeypress:Ke(Wr,[`enter`])},[h(C(zn),{name:`close`,stroke:k.value.table.th.color,"stroke-width":2},null,8,[`stroke`])],36)),m(`div`,{style:{width:`100%`},class:g({"vue-ui-responsive":C(Ur)})},[m(`table`,Qt,[k.value.table.useDialog?f(``,!0):(v(),p(`caption`,{key:0,style:_({backgroundColor:k.value.table.th.backgroundColor,color:k.value.table.th.color,outline:k.value.table.th.outline}),class:`vue-ui-data-table__caption`},[Pe(S(N.value.title.text)+` `,1),N.value.title.subtitle.text?(v(),p(`span`,$t,S(N.value.title.subtitle.text),1)):f(``,!0)],4)),m(`thead`,null,[m(`tr`,{role:`row`,style:_(`background:${k.value.table.th.backgroundColor};color:${k.value.table.th.color}`)},[(v(!0),p(l,null,b(Y.value.head,e=>(v(),p(`th`,{style:_(`outline:${k.value.table.th.outline}`)},S(e),5))),256))],4)]),m(`tbody`,null,[(v(!0),p(l,null,b(Y.value.body,(e,t)=>(v(),p(`tr`,{class:g({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":t%2==0,"vue-ui-data-table__tbody__row-odd":t%2!=0}),style:_(`background:${k.value.table.td.backgroundColor};color:${k.value.table.td.color}`)},[m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[0]},[m(`div`,tn,[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?(v(),p(`span`,nn)):(v(),p(`span`,rn,S(e.rootName),1))])],12,en),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[1]},[m(`div`,on,[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?(v(),p(`span`,sn)):(v(),p(`span`,cn,S(e.rootValue.toFixed(k.value.table.td.roundingValue)),1))])],12,an),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[2]},[m(`div`,un,[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?(v(),p(`span`,dn)):(v(),p(`span`,fn,S((e.rootToTotal*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1))])],12,ln),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[3]},[m(`div`,mn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(v(),p(`span`,hn)):(v(),p(`span`,gn,S(e.branchName),1))])],12,pn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[4]},[m(`div`,vn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(v(),p(`span`,yn)):(v(),p(`span`,bn,S(e.branchValue.toFixed(k.value.table.td.roundingValue)),1))])],12,_n),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[5]},[m(`div`,Sn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(v(),p(`span`,Cn)):(v(),p(`span`,wn,S((e.branchToRoot*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1))])],12,xn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[6]},[m(`div`,En,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(v(),p(`span`,Dn)):(v(),p(`span`,On,S((e.branchToTotal*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1))])],12,Tn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[7]},[m(`div`,An,S(e.nutName),1)],12,kn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[8]},[m(`div`,Mn,S(e.nutValue.toFixed(k.value.table.td.roundingValue)),1)],12,jn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[9]},[m(`div`,Pn,S((e.nutToBranch*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1)],12,Nn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[10]},[m(`div`,In,S((e.nutToRoot*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1)],12,Fn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[11]},[m(`div`,Rn,S((e.nutToTotal*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1)],12,Ln)],6))),256))])])],2)],4)],4)]),_:2},[k.value.table.useDialog?{name:`title`,fn:Ge(()=>[Pe(S(Hr.value.title),1)]),key:`0`}:void 0,k.value.table.useDialog?{name:`actions`,fn:Ge(()=>[m(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[11]||=e=>Pr(k.value.userOptions.callbacks.csv)},[h(C(zn),{name:`fileCsv`,stroke:Hr.value.props.color},null,8,[`stroke`])])]),key:`1`}:void 0]),1040)):f(``,!0),x(e.$slots,`skeleton`,{},()=>[C($n)?(v(),d(me,{key:0})):f(``,!0)],!0)],46,Je))}},[[`__scopeId`,`data-v-13f1d6df`]]);export{qe as n,zn as t};
@@ -1,21 +0,0 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{$ as n,D as r,Ht as i,S as a,X as o,Y as s,at as c,i as ee,in as l,nt as te,r as ne,sn as re,t as ie,w as ae,yt as oe,zt as se}from"./lib-rPeBMZrn.js";import{n as ce,t as le}from"./BaseScanner-8NdoBs7B.js";import{n as ue}from"./useHints-C-TwxM0Y.js";import{t as de}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as fe}from"./resolveChartConfig-CIhClE5R.js";import{t as pe}from"./chartImage-DPGnEuYM.js";import{n as me}from"./Title-BliHuXfT.js";import{t as he}from"./useChartExport-BZts4KFb.js";import{n as ge,t as _e}from"./tableIntegration-CNoJ1CIY.js";import{n as ve,t as ye}from"./annotationSlots-RvQBEO9-.js";import{n as be,t as xe}from"./userOptionsSlots-DYuo-E5m.js";import{t as Se}from"./usePrinter-DVf3YcG5.js";import{t as Ce}from"./Shape-CRe8woTu.js";import{c as we}from"./canvas-lib-22VpOI4_.js";import{t as Te}from"./useResponsive-CENUxfEL.js";import{t as Ee}from"./A11yDataTable-DWNlWXzs.js";import{t as De}from"./useUserOptionState-CXlFnwPv.js";import{t as Oe}from"./useChartAccessibility-DOMuYJfm.js";import{t as ke}from"./Legend-DM0ClX3D.js";import{t as Ae}from"./vue_ui_chord-Fq6VBRT1.js";import{Fragment as u,Teleport as je,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as Me,createTextVNode as Ne,createVNode as Pe,defineAsyncComponent as g,guardReactiveProps as Fe,mergeProps as Ie,nextTick as Le,normalizeClass as _,normalizeProps as Re,normalizeStyle as v,onBeforeUnmount as ze,onMounted as Be,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as Ve,shallowRef as He,toDisplayString as C,toRefs as Ue,unref as w,useCssVars as We,watch as Ge,withCtx as T,withModifiers as Ke}from"vue";var qe=/* @__PURE__ */ e({default:()=>Tt}),Je=[`id`],Ye=[`id`],Xe=[`id`],Ze=[`xmlns`,`viewBox`,`aria-describedby`],Qe=[`width`,`height`],$e={key:1},et=[`id`,`d`],tt={key:2},nt=[`transform`],rt=[`d`,`fill`,`stroke`,`stroke-width`,`onMouseenter`,`onMouseleave`,`onClick`],it=[`d`,`fill`,`stroke`,`stroke-width`],at=[`d`,`fill`],ot=[`d`,`fill`,`stroke`,`stroke-width`,`onMouseenter`,`onClick`,`onMouseleave`],st=[`d`,`fill`,`stroke`,`stroke-width`],ct=[`d`,`fill`,`stroke`,`stroke-width`],lt=[`d`,`fill`,`stroke`,`stroke-width`],ut={key:0},dt=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],ft=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],pt=[`cx`,`cy`,`r`,`stroke`,`stroke-width`,`fill`],mt=[`transform`,`fill`,`text-anchor`,`font-size`,`font-weight`],ht={key:1},gt=[`font-size`,`font-weight`,`fill`],_t=[`href`],vt=[`transform`,`text-anchor`,`font-size`,`font-weight`,`fill`,`innerHTML`],yt={key:5,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},bt={key:6,class:`vue-data-ui-watermark`},xt=[`id`],St=[`onClick`],Ct={key:9,"data-dom-to-png-ignore":``,class:`reset-wrapper`},wt={style:{"text-align":`right`,width:`100%`}},Tt=/*#__PURE__*/ de({__name:`vue-ui-chord`,props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},emits:[`selectLegend`,`selectGroup`,`selectRibbon`,`copyAlt`],setup(e,{expose:de,emit:qe}){We(e=>({bae8b2ea:e.slicerColor}));let Tt=g(()=>import(`./vue-ui-accordion-D4FHxzsL.js`).then(e=>e.n)),Et=g(()=>import(`./BaseIcon-fYK0iID8.js`).then(e=>e.n)),Dt=g(()=>import(`./DataTable-5Ug6gMAX.js`)),Ot=g(()=>import(`./PackageVersion-u-p5bCcj.js`).then(e=>e.t)),kt=g(()=>import(`./PenAndPaper-r50tK3S4.js`).then(e=>e.t)),At=g(()=>import(`./UserOptions-Em_JgDXM.js`).then(e=>e.n)),jt=g(()=>import(`./BaseDraggableDialog-9d30Yx8c.js`).then(e=>e.n)),{vue_ui_chord:Mt}=t(),E=e,Nt=qe,D=b(!!E.dataset&&Object.hasOwn(E.dataset,`matrix`)),O=b(o()),k=b(null),A=b(null),j=b(null),Pt=b(0),M=b(null),Ft=b(null),It=b(null),Lt=b(null),Rt=b(null),zt=b(0),Bt=b(0),Vt=b(0),Ht=b(!1),N=He(null),P=He(null),Ut=b(!1),Wt=b(null),Gt=b(null),F=b(`group`),I=b(null),Kt=b(!1),L=b(rn()),R=d(()=>L.value.style.chart.arcs),z=d(()=>L.value.style.chart.ribbons),B=d(()=>L.value.style.chart);ue({config:()=>L.value,dataset:()=>E.dataset,component:`VueUiChord`,rules:[{test:e=>e.matrix&&e.matrix.length>12,message:[`👀 The number of groups > 12, the chart might become hard to read. Consider:`,``,`▶️ Using broader groups to reduce their number.`]}]});let V=d(()=>L.value.userOptions.useCursorPointer),qt=d(()=>l({defaultConfig:{useCssAnimation:!1,userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,legend:{backgroundColor:`transparent`},arcs:{stroke:`#6A6A6A`,labels:{show:!1}},ribbons:{stroke:`#6A6A6A`,underlayerOpacity:0,labels:{show:!1}}}}},userConfig:L.value.skeletonConfig??{}})),{loading:Jt,FINAL_DATASET:H,manualLoading:Yt}=ce({...Ue(E),FINAL_CONFIG:L,prepareConfig:rn,callback:()=>{Promise.resolve().then(async()=>{await Le(),W.value.showTable=L.value.table.show})},skeletonDataset:E.config?.skeletonDataset??{matrix:[[12e3,6e3,9e3,3e3],[2e3,1e4,2e3,6001],[8e3,1600,8e3,8001],[1e3,1e3,1e3,7001]],labels:[],colors:[`#DBDBDB`,`#C4C4C4`,`#ADADAD`,`#969696`]},skeletonConfig:l({defaultConfig:L.value,userConfig:qt.value})}),{userOptionsVisible:Xt,setUserOptionsVisibility:Zt,keepUserOptionState:Qt}=De({config:L.value}),{svgRef:U}=Oe({config:B.value.title}),{isPrinting:$t,isImaging:en,generatePdf:tn,generateImage:nn}=Se({elementId:`chord_${O.value}`,fileName:B.value.title.text||`vue-ui-chord`,options:L.value.userOptions.print}),W=b({showTable:L.value.table.show});function rn(){return fe(E.config,Mt,Ae)}Ge(()=>E.config,e=>{Jt.value||(L.value=rn()),Xt.value=!L.value.userOptions.showOnChartHover,on(),zt.value+=1,Bt.value+=1,Vt.value+=1,X.value=L.value.initialRotation,W.value.showTable=L.value.table.show},{deep:!0});let G=d(()=>L.value.debug);Ge(()=>E.dataset,()=>{an(),on(),zt.value+=1,Bt.value+=1,Vt.value+=1});function an(){if(se(E.dataset)){c({componentName:`VueUiChord`,type:`dataset`,debug:G.value}),D.value=!1,Yt.value=!0;return}let e=oe({datasetObject:E.dataset,requiredAttributes:[`matrix`]});if(e.length){G.value&&e.forEach(e=>{c({componentName:`VueUiChord`,type:`datasetAttribute`,property:e})}),D.value=!1,Yt.value=!0;return}let t=E.dataset.matrix;if(!Array.isArray(t)||t.length<2){G.value&&console.warn(`VueUiChord: dataset.matrix requires a minimum of 2 datapoints, for example:
2
-
3
- matrix:[
4
- [1, 1],
5
- [1, 1]
6
- ]`),D.value=!1,Yt.value=!0;return}let n=t.length,r=t.findIndex(e=>!Array.isArray(e)||e.length!==n);r===-1?(D.value=!0,Yt.value=!1):(G.value&&console.warn(`VueUiChord - Invalid matrix: dataset.matrix at index ${r} has ${Array.isArray(t[r])?t[r].length:`NaN`} elements instead of the required ${n}
7
-
8
- dataset.matrix[${r}] = [${Array.isArray(t[r])?t[r].toString():`invalid`}]`),D.value=!1,Yt.value=!0)}function on(){if(an(),L.value.responsive){let e=we(()=>{let{width:e,height:t,heightNoTitle:n,heightSource:r,heightTitle:i,heightLegend:a}=Te({chart:M.value,title:B.value.title.text?Ft.value:null,legend:B.value.legend.show?It.value:null,source:Lt.value,noTitle:Rt.value}),o=i+a+r+n;e<t?M.value.style.width=`100%`:(M.value.style.height=`100%`,U.value.style.height=`calc(100% - ${o}px)`)},100);N.value&&(P.value&&N.value.unobserve(P.value),N.value.disconnect()),N.value=new ResizeObserver(e),P.value=M.value.parentNode,N.value.observe(P.value),e()}cn.value=setTimeout(()=>{Ht.value=!0},500)}function sn(){!H.value||!Object.hasOwn(H.value,`matrix`)||H.value.matrix.length<2?(G.value&&console.warn(`VueUiChord: dataset.matrix requires a minimum of 2 datapoints, for example:
9
-
10
- matrix:[
11
- [1, 1],
12
- [1, 1]
13
- ]`),D.value=!1):H.value.matrix.forEach((e,t)=>{e.length!==H.value.matrix.length&&(G.value&&console.warn(`VueUiChord - Invalid matrix: dataset.matrix at index ${t} has ${e.length} elements instead of the required ${H.value.matrix.length}\n\ndataset.matrix[${t}] = [${e.toString()}] has a length of ${e.length} but should have the same length as the matrix itself (${H.value.matrix.length})`),D.value=!1)})}let cn=b(null);Be(()=>{Ut.value=!0,on()});let K=b({height:600,width:600}),ln=d(()=>L.value.userOptions.show&&!B.value.title.text),un=d(()=>ae(L.value.customPalette)),q=d(()=>({inner:K.value.width*.3*R.value.innerRadiusRatio,outer:K.value.width*.34*R.value.outerRadiusRatio})),dn=d(()=>R.value.padAngle/100),J=d(()=>({matrix:H.value.matrix??[[0]],labels:H.value.labels??[``],colors:H.value.colors&&Array.isArray(H.value.colors)&&H.value.colors.length?H.value.colors.map(e=>a(e)):H.value.matrix.map((e,t)=>un.value[t]||i[t]||i[t%i.length])}));function fn(e,t){let n=e.length,r=q.value.inner,i=Array(n).fill(0),a=0;for(let t=0;t<n;t+=1)for(let r=0;r<n;r+=1)i[t]+=e[t][r],a+=e[t][r];let s=(2*Math.PI-t*n)/a,c=[],ee=0;for(let e=0;e<n;e+=1){let n=ee,r=n+i[e]*s;c.push({index:e,pattern:`pattern_${O.value}_${e}`,startAngle:n,endAngle:r,name:J.value.labels[e],id:o(),color:J.value.colors[e],proportion:i[e]/a}),ee=r+t}let l=[];for(let t=0;t<n;t+=1){let n=e[t].map((e,t)=>({j:t,v:e}));n.sort((e,t)=>t.v-e.v);let i=c[t].startAngle;for(let{j:e,v:a}of n){let n=i,o=n+a*s;l.push({index:t,subIndex:e,pattern:`pattern_${O.value}_${t}`,startAngle:n,endAngle:o,value:a,groupName:J.value.labels[t],groupId:c[t].id,groupColor:J.value.colors[t],midAngle:(n+o)/2,midBaseX:Math.cos((n+o)/2-Math.PI/2)*r,midBaseY:Math.sin((n+o)/2-Math.PI/2)*r}),i=o}}let te=[];for(let e of l){let t=l.find(t=>t.index===e.subIndex&&t.subIndex===e.index);te.push({source:e,target:t,id:o()})}return{groups:c,chords:te}}let Y=d(()=>{let e=fn(J.value.matrix,dn.value);return sn(),e.chords.sort((e,t)=>Math.max(t.source.value,t.target.value)-Math.max(e.source.value,e.target.value)),e}),pn=d(()=>{let e=q.value.outer+z.value.labels.offset+12,t=z.value.labels.fontSize*.6,n=[];if(A.value){let r=A.value;if(r.source.value){let i=String(r.source.value);n.push({id:r.id+`-src`,theta:r.source.midAngle,w:i.length*t/e,midBaseX:r.source.midBaseX,midBaseY:r.source.midBaseY,groupColor:r.source.groupColor,value:r.source.value})}if(r.target&&r.target.value&&r.target.value!==r.source.value){let i=String(r.target.value);n.push({id:r.id+`-tgt`,theta:r.target.midAngle,w:i.length*t/e,midBaseX:r.target.midBaseX,midBaseY:r.target.midBaseY,groupColor:r.target.groupColor,value:r.target.value})}return n}function r(r){Y.value.chords.filter(e=>e.source.groupId===r&&e.source.value).forEach(r=>{{let i=String(r.source.value);n.push({id:r.id+`-src`,theta:r.source.midAngle,w:i.length*t/e,midBaseX:r.source.midBaseX,midBaseY:r.source.midBaseY,groupColor:r.source.groupColor,value:r.source.value})}if(r.target&&r.target.value&&r.target.value!==r.source.value){let i=String(r.target.value);n.push({id:r.id+`-tgt`,theta:r.target.midAngle,w:i.length*t/e,midBaseX:r.target.midBaseX,midBaseY:r.target.midBaseY,groupColor:r.target.groupColor,value:r.target.value})}})}return j.value&&r(j.value),k.value&&r(k.value.id),n}),mn=d(()=>{let e=pn.value.map(e=>({...e})).sort((e,t)=>e.theta-t.theta),t=z.value.labels.minSeparationDeg*Math.PI/180,n=!0,r=0;for(;n&&r++<10;){n=!1;for(let r=1;r<e.length;r+=1){let i=e[r-1],a=e[r],o=i.theta+i.w+t;a.theta<o&&(a.theta=o,n=!0)}let r=e[0],i=e[e.length-1],a=i.theta+i.w+t-2*Math.PI;r.theta<a&&(r.theta=a,n=!0)}return e});function hn(e,t,n,r){let i=e-Math.PI/2,a=t-Math.PI/2,o=Math.cos(i)*n,s=Math.sin(i)*n,c=Math.cos(a)*n,ee=Math.sin(a)*n,l=Math.cos(a)*r,te=Math.sin(a)*r,ne=Math.cos(i)*r,re=Math.sin(i)*r,ie=+(t-e>Math.PI);return`M${o},${s} A${n},${n} 0 ${ie} 1 ${c},${ee} L${l},${te} A${r},${r} 0 ${ie} 0 ${ne},${re} Z`}function gn(e,t){let n=q.value.inner,r=e.startAngle-Math.PI/2,i=e.endAngle-Math.PI/2,a=t.startAngle-Math.PI/2,o=t.endAngle-Math.PI/2,s=Math.cos(r)*n,c=Math.sin(r)*n,ee=Math.cos(i)*n,l=Math.sin(i)*n,te=Math.cos(a)*n,ne=Math.sin(a)*n,re=Math.cos(o)*n,ie=Math.sin(o)*n;return`M${s},${c}A${n},${n} 0 ${+(e.endAngle-e.startAngle>Math.PI)} 1 ${ee},${l}Q0,0 ${te},${ne}A${n},${n} 0 ${+(t.endAngle-t.startAngle>Math.PI)} 1 ${re},${ie}Q0,0 ${s},${c}Z`}let _n=d(()=>X.value*Math.PI/180);function vn(e){return(e.startAngle+e.endAngle)/2}function yn(e){return((vn(e)+_n.value)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)}function bn(e){let t=e+_n.value;return t=(t%(2*Math.PI)+2*Math.PI)%(2*Math.PI),t>Math.PI?`end`:`start`}function xn(e){let t=e-Math.PI/2;return`translate(${Math.cos(t)*(q.value.outer+R.value.labels.offset+24)},${Math.sin(t)*(q.value.outer+R.value.labels.offset+24)})`}function Sn(e,t,n){let r=e-Math.PI/2,i=t-Math.PI/2,a=Math.cos(r)*n,o=Math.sin(r)*n,s=Math.cos(i)*n,c=Math.sin(i)*n;return`M${a},${o} A${n},${n} 0 ${+(t-e>Math.PI)} 1 ${s},${c}`}let X=b(L.value.initialRotation),Cn=b(!1),wn=0,Tn=0;function En(e){let t=U.value.getBoundingClientRect(),n=t.left+t.width/2,r=t.top+t.height/2,i=e.clientX??e.touches[0].clientX,a=e.clientY??e.touches[0].clientY;return Math.atan2(a-r,i-n)}function Dn(e){L.value.enableRotation&&!Vn.value&&(e.preventDefault(),Cn.value=!0,wn=X.value,Tn=En(e))}function On(e){if(!Cn.value)return;let t=En(e);X.value=wn+(t-Tn)*180/Math.PI}function kn(){Cn.value=!1}function An(e){return ee(z.value.labels.formatter,e,n({p:z.value.labels.prefix,v:e,s:z.value.labels.suffix,r:z.value.labels.rounding}))}Be(()=>{window.addEventListener(`mousemove`,On),window.addEventListener(`mouseup`,kn),window.addEventListener(`touchmove`,On,{passive:!1}),window.addEventListener(`touchend`,kn)}),ze(()=>{window.removeEventListener(`mousemove`,On),window.removeEventListener(`mouseup`,kn),window.removeEventListener(`touchmove`,On),window.removeEventListener(`touchend`,kn),clearTimeout(cn.value),N.value&&(P.value&&N.value.unobserve(P.value),N.value.disconnect())});let jn=b(!1);function Mn(e){jn.value=e,Pt.value+=1}function Nn(e,t){L.value.events.datapointEnter&&L.value.events.datapointEnter({datapoint:e,seriesIndex:t}),!j.value&&(k.value=e)}function Pn(e,t){k.value=null,L.value.events.datapointLeave&&L.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function Fn(e,t){Nt(`selectGroup`,e),L.value.events.datapointClick&&L.value.events.datapointClick({datapoint:e,seriesIndex:t})}function In(e,t){L.value.events.datapointEnter&&L.value.events.datapointEnter({datapoint:e,seriesIndex:t}),!j.value&&(A.value=e)}function Ln(e,t){A.value=null,L.value.events.datapointLeave&&L.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function Rn(e,t){Nt(`selectRibbon`,e),L.value.events.datapointClick&&L.value.events.datapointClick({datapoint:e,seriesIndex:t})}function zn(e){return!j.value&&!k.value&&!A.value?.8:(j.value?j.value===e.source.groupId:k.value?k.value.id===e.source.groupId:A.value?.id===e.id)?1:.1}function Bn(e){return!j.value&&!k.value&&!A.value||(j.value?j.value===e.id:k.value?k.value.id===e.id:[A.value?.source.groupId,A.value?.target.groupId].includes(e.id))?1:.3}let Vn=b(!1);function Hn(){Vn.value=!Vn.value}function Un(){W.value.showTable=!W.value.showTable}function Wn(){return Y.value}let Z=b(null);function Gn(){let e=L.value.initialRotation;Z.value!==null&&cancelAnimationFrame(Z.value);let t=()=>{X.value+=(e-X.value)*.05,Math.abs(X.value-e)<.1?(X.value=e,Z.value=null):Z.value=requestAnimationFrame(t)};Z.value=requestAnimationFrame(t)}ze(()=>{Z.value!==null&&cancelAnimationFrame(Z.value)});function Kn(e){e===j.value?(j.value=null,Nt(`selectLegend`,null)):(j.value=e,Nt(`selectLegend`,Y.value.groups.find(t=>t.id===e)))}let qn=d(()=>Y.value.groups.map((e,t)=>({name:e.name,color:e.color,shape:`circle`,patternIndex:t,pattern:`pattern_${O.value}_${t}`,id:e.id,select:()=>Kn(e.id),opacity:j.value?j.value===e.id?1:.3:1}))),Jn=d(()=>({cy:`chord-div-legend`,backgroundColor:B.value.legend.backgroundColor,color:B.value.legend.color,fontSize:B.value.legend.fontSize,paddingBottom:12,fontWeight:B.value.legend.bold?`bold`:``})),Q=d(()=>({head:Y.value.groups.map((e,t)=>({name:e.name||t,color:e.color})),body:J.value.matrix})),Yn=d(()=>{let e=[{name:``,color:null},...Q.value.head];return{colNames:e,head:e,body:Q.value.body.map((e,t)=>[Q.value.head[t],...Q.value.body[t]]),config:{th:{backgroundColor:L.value.table.th.backgroundColor,color:L.value.table.th.color,outline:L.value.table.th.outline},td:{backgroundColor:L.value.table.td.backgroundColor,color:L.value.table.td.color,outline:L.value.table.td.outline},breakpoint:L.value.table.responsiveBreakpoint}}});function Xn(e=null){Le(()=>{let t=J.value.matrix.map((e,t)=>[[J.value.labels[t]||t],e]),n=[[B.value.title.text],[B.value.title.subtitle.text],[[``],...J.value.labels.map((e,t)=>[e||t])]].concat(t),i=r(n);e?e(i):te({csvContent:i,title:B.value.title.text||`vue-ui-chord`})})}let Zn=pe(M,()=>B.value.title.text);function Qn(e,t){return`${J.value.labels[t]}${R.value.labels.showPercentage?n({p:` (`,v:isNaN(e.proportion)?0:e.proportion*100,s:`%)`,r:R.value.labels.roundingPercentage}):``}`}let $n=d(()=>_e({config:L,style:B,mutableConfig:W,dialog:jt,accordion:Tt,isFullscreen:jn,parent:M,maxWidth:800,isCursorPointer:V}));Ge(()=>W.value.showTable,e=>ge(e,L,Wt));function er(){W.value.showTable=!1,Gt.value&&Gt.value.setTableIconState(!1)}let tr=d(()=>B.value.backgroundColor),nr=d(()=>B.value.legend),rr=d(()=>B.value.title),{isCallbackImaging:ir,isCallbackSvg:ar,generateSvg:or,onGenerateImage:sr}=he({svg:U,title:rr,legend:nr,legendItems:qn,backgroundColor:tr,getSvgCallback:()=>L.value.userOptions.callbacks.svg,generateImage:nn});async function cr(){Nt(`copyAlt`,{config:L.value,dataset:J.value}),L.value.userOptions.callbacks.altCopy?await Promise.resolve(L.value.userOptions.callbacks.altCopy({config:L.value,dataset:J.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let lr=d(()=>(k.value?Y.value.chords.filter(e=>e.source.groupId===k.value.id):j.value?Y.value.chords.filter(e=>e.source.groupId===j.value):Y.value.chords).filter(e=>e.source.value)),$=d(()=>({groups:Y.value.groups.map((e,t)=>({type:`group`,index:t,item:e})),ribbons:lr.value.map((e,t)=>({type:`ribbon`,index:t,item:{...e,path:gn(e.source,e.target),color:J.value.colors[e.source.index]}}))})),ur=d(()=>({headers:[``,...Q.value.head.map(e=>e.name)],rows:Q.value.body.map((e,t)=>[Q.value.head[t]?.name??`${t}`,...e.map(e=>An(e))])}));function dr(e){let t=$.value.groups[e];t&&(F.value=`group`,I.value=e,A.value=null,k.value=t.item)}function fr(e){let t=$.value.ribbons[e];t&&(F.value=`ribbon`,I.value=e,k.value=null,A.value=t.item)}function pr(){I.value=null,F.value=`group`,k.value=null,A.value=null}function mr(){Kt.value=!0,F.value=`group`,I.value=null}function hr(){Kt.value=!1,pr()}function gr(e){if(!U.value||Vn.value||document.activeElement!==U.value)return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`ArrowUp`,i=e.key===`ArrowDown`,a=e.key===`Enter`||e.key===` `,o=e.key===`Escape`;if(!t&&!n&&!r&&!i&&!a&&!o)return;if(e.preventDefault(),e.stopPropagation(),o){pr();return}if(r){F.value=`group`,$.value.groups.length&&dr(I.value===null?0:Math.min(I.value,$.value.groups.length-1));return}if(i){if(!$.value.ribbons.length)return;F.value=`ribbon`,fr(I.value===null?0:Math.min(I.value,$.value.ribbons.length-1));return}if(a){if(F.value===`group`){let e=$.value.groups[I.value];e&&Fn(e.item,e.index)}else{let e=$.value.ribbons[I.value];e&&Rn(e.item,e.index)}return}let s=F.value===`group`?$.value.groups:$.value.ribbons;if(!s.length)return;let c=I.value;c===null||c<0||c>=s.length?c=n?0:s.length-1:n?(c+=1,c>=s.length&&(c=0)):t&&(--c,c<0&&(c=s.length-1)),F.value===`group`?dr(c):fr(c)}return de({getData:Wn,getImage:Zn,generateCsv:Xn,generateImage:nn,generateSvg:or,generatePdf:tn,toggleAnnotator:Hn,toggleTable:Un,toggleFullscreen:Mn,copyAlt:cr}),(e,t)=>(y(),m(`div`,{ref_key:`chordChart`,ref:M,class:_({"vue-data-ui-component":!0,"vue-ui-chord":!0,"vue-data-ui-wrapper-fullscreen":jn.value,"vue-data-ui-responsive":L.value.responsive}),style:v(`font-family:${L.value.style.fontFamily};width:100%; text-align:center;background:${B.value.backgroundColor}`),id:`chord_${O.value}`,onMouseenter:t[2]||=()=>w(Zt)(!0),onMouseleave:t[3]||=()=>w(Zt)(!1)},[h(`div`,{id:`chart-instructions-${O.value}`,class:`sr-only`},[h(`p`,null,C(L.value.a11y.translations.keyboardNavigation),1)],8,Ye),ur.value?.rows?.length?(y(),f(Ee,{key:0,uid:O.value,head:ur.value.headers,body:ur.value.rows,notice:L.value.a11y.translations.tableAvailable,caption:L.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):p(``,!0),L.value.userOptions.buttons.annotator&&w(U)?(y(),f(w(kt),{key:1,showGroupActions:L.value.userOptions.annotator?.showGroupActions??!0,color:B.value.color,backgroundColor:B.value.backgroundColor,active:Vn.value,svgRef:w(U),isCursorPointer:V.value,palette:L.value.userOptions.annotatorPalette,onClose:Hn},Me({_:2},[x(w(ye),t=>({name:t,fn:T(n=>[S(e.$slots,t,Re(Fe(w(ve)(t,n))),void 0,!0)])}))]),1032,[`showGroupActions`,`color`,`backgroundColor`,`active`,`svgRef`,`isCursorPointer`,`palette`])):p(``,!0),S(e.$slots,`userConfig`,{},void 0,!0),ln.value?(y(),m(`div`,{key:2,ref_key:`noTitle`,ref:Rt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):p(``,!0),B.value.title.text?(y(),m(`div`,{key:3,ref_key:`chartTitle`,ref:Ft,style:`width:100%;background:transparent;padding-bottom:24px`},[(y(),f(me,{key:`title_${zt.value}`,config:{title:{cy:`chord-div-title`,...B.value.title},subtitle:{cy:`chord-div-subtitle`,...B.value.title.subtitle}}},null,8,[`config`]))],512)):p(``,!0),h(`div`,{id:`legend-top-${O.value}`},null,8,Xe),L.value.userOptions.show&&D.value&&(w(Qt)||w(Xt))?(y(),f(w(At),{ref_key:`userOptionsRef`,ref:Gt,key:`user_option_${Pt.value}`,backgroundColor:B.value.backgroundColor,color:B.value.color,isPrinting:w($t),isImaging:w(en),uid:O.value,hasTooltip:!1,hasPdf:L.value.userOptions.buttons.pdf,hasImg:L.value.userOptions.buttons.img,hasSvg:L.value.userOptions.buttons.svg,hasXls:L.value.userOptions.buttons.csv,hasTable:L.value.userOptions.buttons.table,hasLabel:!1,hasFullscreen:L.value.userOptions.buttons.fullscreen,hasAltCopy:L.value.userOptions.buttons.altCopy,isFullscreen:jn.value,chartElement:M.value,position:L.value.userOptions.position,titles:{...L.value.userOptions.buttonTitles},hasAnnotator:L.value.userOptions.buttons.annotator,isAnnotation:Vn.value,callbacks:L.value.userOptions.callbacks,printScale:L.value.userOptions.print.scale,tableDialog:L.value.table.useDialog,isCursorPointer:V.value,onToggleFullscreen:Mn,onGeneratePdf:w(tn),onGenerateCsv:Xn,onGenerateImage:w(sr),onGenerateSvg:w(or),onToggleTable:Un,onToggleAnnotator:Hn,onCopyAlt:cr,style:v({visibility:w(Qt)?w(Xt)?`visible`:`hidden`:`visible`})},Me({_:2},[x(w(be)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:T(n=>[S(e.$slots,t,Re(Fe(w(xe)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasFullscreen.hasAltCopy.isFullscreen.chartElement.position.titles.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):p(``,!0),(y(),m(`svg`,{xmlns:w(ie),ref_key:`svgRef`,ref:U,viewBox:`0 0 ${K.value.width} ${K.value.height}`,"aria-describedby":`chart-instructions-${O.value}`,tabindex:`0`,preserveAspectRatio:`xMidYMid meet`,style:{overflow:`visible`},class:_({"vue-ui-chord-rotating":Cn.value,"vue-ui-chord-idle":!Cn.value}),onMousedown:Ke(Dn,[`prevent`]),onTouchstart:Ke(Dn,[`prevent`]),onFocus:mr,onBlur:hr,onKeydown:gr},[Pe(w(Ot)),S(e.$slots,`svg-underlayer`,{svg:{height:600,width:600,isPrintingImg:w($t)||w(en)||w(ir),isPrintingSvg:w(ar)}},void 0,!0),e.$slots[`chart-background`]?(y(),m(`foreignObject`,{key:0,x:0,y:0,width:K.value.width<=0?10:K.value.width,height:K.value.height<=0?10:K.value.height,style:{pointerEvents:`none`}},[S(e.$slots,`chart-background`,{},void 0,!0)],8,Qe)):p(``,!0),R.value.labels.curved?(y(),m(`defs`,$e,[(y(!0),m(u,null,x(Y.value.groups,(e,t)=>(y(),m(`path`,{key:`labelPath-${t}`,id:`labelPath-${t}_${O.value}`,d:Sn(e.startAngle,e.endAngle,(q.value.inner+q.value.outer)/2+R.value.labels.offset),fill:`none`},null,8,et))),128))])):p(``,!0),e.$slots.pattern?(y(),m(`g`,tt,[(y(!0),m(u,null,x(Y.value.groups,(t,n)=>(y(),m(`defs`,null,[S(e.$slots,`pattern`,Ie({ref_for:!0},{seriesIndex:t.index,patternId:`pattern_${O.value}_${n}`}),void 0,!0)]))),256))])):p(``,!0),h(`g`,{transform:`translate(${K.value.width/2}, ${K.value.height/2}) rotate(${X.value})`},[(y(!0),m(u,null,x(Y.value.groups,(t,n)=>(y(),m(`g`,null,[(y(),m(`path`,{class:_({"vue-ui-chord-arc":!0,"vue-ui-chord-arc-animated":L.value.useCssAnimation&&!Ht.value}),key:`arc-${n}`,d:hn(t.startAngle,t.endAngle,q.value.outer,q.value.inner),fill:J.value.colors[n],stroke:R.value.stroke,"stroke-width":R.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:v({opacity:Bn(t)}),onMouseenter:e=>Nn(t,n),onMouseleave:e=>Pn(t,n),onClick:e=>Fn(t,n)},null,46,rt)),e.$slots.pattern?(y(),m(`path`,{class:_({"vue-ui-chord-arc":!0,"vue-ui-chord-arc-animated":L.value.useCssAnimation&&!Ht.value}),key:`arc-${n}`,d:hn(t.startAngle,t.endAngle,q.value.outer,q.value.inner),fill:`url(#${t.pattern})`,stroke:R.value.stroke,"stroke-width":R.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:v({opacity:Bn(t),pointerEvents:`none`})},null,14,it)):p(``,!0)]))),256)),h(`g`,null,[(y(!0),m(u,null,x(k.value?Y.value.chords.filter(e=>e.source.groupId===k.value.id):j.value?Y.value.chords.filter(e=>e.source.groupId===j.value):Y.value.chords,(t,n)=>(y(),m(u,{key:`ribbon-${t.id}`},[t.source.value?(y(),m(`path`,{key:0,class:_({"vue-ui-chord-ribbon":!0}),d:gn(t.source,t.target),fill:B.value.backgroundColor,style:v({opacity:z.value.underlayerOpacity})},null,12,at)):p(``,!0),t.source.value?(y(),m(`path`,{key:1,class:_({"vue-ui-chord-ribbon":!0}),d:gn(t.source,t.target),fill:J.value.colors[t.source.index],stroke:z.value.stroke,"stroke-width":z.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:v({opacity:zn(t)}),onMouseenter:e=>In({...t,path:gn(t.source,t.target),color:J.value.colors[t.source.index]},n),onClick:e=>Rn({...t,color:J.value.colors[t.source.index]},n),onMouseleave:e=>Ln({...t,color:J.value.colors[t.source.index]},n)},null,44,ot)):p(``,!0),t.source.value&&e.$slots.pattern?(y(),m(`path`,{key:2,class:_({"vue-ui-chord-ribbon":!0}),d:gn(t.source,t.target),fill:`url(#pattern_${O.value}_${t.source.index})`,stroke:z.value.stroke,"stroke-width":z.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:v({opacity:zn(t),pointerEvents:`none`})},null,12,st)):p(``,!0)],64))),128)),A.value?(y(),m(`path`,{key:0,d:A.value.path,fill:A.value.color,stroke:z.value.stroke,"stroke-width":z.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:_({"vue-ui-chord-ribbon":!0}),style:{pointerEvents:`none`}},null,8,ct)):p(``,!0),A.value&&e.$slots.pattern?(y(),m(`path`,{key:1,d:A.value.path,fill:`url(#${A.value.source.pattern})`,stroke:z.value.stroke,"stroke-width":z.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:_({"vue-ui-chord-ribbon":!0}),style:{pointerEvents:`none`}},null,8,lt)):p(``,!0)]),(k.value||A.value||j.value)&&z.value.labels.show?(y(),m(`g`,ut,[(y(!0),m(u,null,x(mn.value,e=>(y(),m(u,{key:e.id},[h(`line`,{x1:e.midBaseX,y1:e.midBaseY,x2:Math.cos(e.theta-Math.PI/2)*(q.value.outer+z.value.labels.offset+12),y2:Math.sin(e.theta-Math.PI/2)*(q.value.outer+z.value.labels.offset+12),stroke:B.value.backgroundColor,"stroke-width":z.value.labels.connector.strokeWidth*3,"pointer-events":`none`},null,8,dt),h(`line`,{x1:e.midBaseX,y1:e.midBaseY,x2:Math.cos(e.theta-Math.PI/2)*(q.value.outer+z.value.labels.offset+12),y2:Math.sin(e.theta-Math.PI/2)*(q.value.outer+z.value.labels.offset+12),stroke:z.value.labels.connector.stroke,"stroke-width":z.value.labels.connector.strokeWidth,"pointer-events":`none`},null,8,ft),z.value.labels.marker.show?(y(),m(`circle`,{key:0,cx:Math.cos(e.theta-Math.PI/2)*(q.value.outer+z.value.labels.offset+12),cy:Math.sin(e.theta-Math.PI/2)*(q.value.outer+z.value.labels.offset+12),r:z.value.labels.marker.radius,stroke:z.value.labels.marker.stroke,"stroke-width":z.value.labels.marker.strokeWidth,fill:e.groupColor,"pointer-events":`none`},null,8,pt)):p(``,!0),h(`text`,{transform:`
14
- translate(
15
- ${Math.cos(e.theta-Math.PI/2)*(q.value.outer+z.value.labels.offset+24)},
16
- ${Math.sin(e.theta-Math.PI/2)*(q.value.outer+z.value.labels.offset+24)}
17
- ) rotate(${-X.value})
18
- `,fill:z.value.labels.useSerieColor?e.groupColor:z.value.labels.color,"text-anchor":bn(e.theta),"font-size":z.value.labels.fontSize,"font-weight":z.value.labels.bold?`bold`:`normal`,dy:`.35em`,"pointer-events":`none`},C(An(e.value)),9,mt)],64))),128))])):p(``,!0),R.value.labels.show?(y(),m(`g`,ht,[R.value.labels.curved?(y(!0),m(u,{key:0},x(Y.value.groups,(e,t)=>(y(),m(`text`,{class:`vue-ui-chord-label-curved`,key:`curved-label-${t}`,"font-size":R.value.labels.fontSize,"font-weight":R.value.labels.bold?`bold`:`normal`,fill:R.value.labels.adaptColorToBackground?w(ne)(J.value.colors[t]):R.value.labels.color},[h(`textPath`,{href:`#labelPath-${t}_${O.value}`,startOffset:`50%`,"text-anchor":`middle`},C(J.value.labels[t])+C(R.value.labels.showPercentage?w(n)({p:` (`,v:isNaN(e.proportion)?0:e.proportion*100,s:`%)`,r:R.value.labels.roundingPercentage}):``),9,_t)],8,gt))),128)):!k.value&&!A.value&&!j.value?(y(!0),m(u,{key:1},x(Y.value.groups,(e,t)=>(y(),m(`text`,{class:`vue-ui-chord-label-straight`,key:`label-${t}`,transform:`
19
- ${xn((e.startAngle+e.endAngle)/2)}
20
- rotate(${-X.value})
21
- `,dy:`.35em`,"text-anchor":yn(e)>Math.PI?`end`:`start`,"font-size":R.value.labels.fontSize,"font-weight":R.value.labels.bold?`bold`:`normal`,fill:R.value.labels.color,innerHTML:w(s)({content:w(re)(Qn(e,t)),fontSize:R.value.labels.fontSize,fill:R.value.labels.color,x:0,y:0})},null,8,vt))),128)):p(``,!0)])):p(``,!0)],8,nt),S(e.$slots,`svg`,{svg:{height:600,width:600,isPrintingImg:w($t)||w(en)||w(ir),isPrintingSvg:w(ar)}},void 0,!0)],42,Ze)),e.$slots.hint?(y(),m(`div`,yt,[S(e.$slots,`hint`,Re(Fe({hint:L.value.a11y.translations.keyboardNavigation,isVisible:Kt.value})),void 0,!0)])):p(``,!0),e.$slots.watermark?(y(),m(`div`,bt,[S(e.$slots,`watermark`,Re(Fe({isPrinting:w($t)||w(en)||w(ir)||w(ar)})),void 0,!0)])):p(``,!0),h(`div`,{id:`legend-bottom-${O.value}`},null,8,xt),Ut.value&&(B.value.legend.show||e.$slots.legend)?(y(),f(je,{key:7,to:B.value.legend.position===`top`?`#legend-top-${O.value}`:`#legend-bottom-${O.value}`},[h(`div`,{ref_key:`chartLegend`,ref:It},[S(e.$slots,`legend`,{legend:qn.value},()=>[B.value.legend.show?(y(),f(ke,{key:`legend_${Vt.value}`,legendSet:qn.value,config:Jn.value,isCursorPointer:V.value,onClickMarker:t[0]||=({legend:e})=>Kn(e.id)},Me({item:T(({legend:e})=>[h(`div`,{style:v({opacity:j.value?j.value===e.id?1:.3:1}),onClick:t=>e.select()},C(e.name),13,St)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:T(({legend:e,index:t})=>[Pe(Ce,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${O.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`])):p(``,!0)],!0)],512)],8,[`to`])):p(``,!0),e.$slots.source?(y(),m(`div`,{key:8,ref_key:`source`,ref:Lt,dir:`auto`},[S(e.$slots,`source`,{},void 0,!0)],512)):p(``,!0),X.value===L.value.initialRotation?p(``,!0):(y(),m(`div`,Ct,[S(e.$slots,`reset-action`,{reset:Gn},()=>[h(`button`,{"data-cy-reset":``,tabindex:`0`,role:`button`,class:`vue-data-ui-refresh-button`,style:v({background:B.value.backgroundColor,cursor:V.value?`pointer`:`default`}),onClick:Gn},[Pe(w(Et),{name:`refresh`,stroke:B.value.color},null,8,[`stroke`])],4)],!0)])),D.value&&L.value.userOptions.buttons.table?(y(),f(Ve($n.value.component),Ie({key:10},$n.value.props,{ref_key:`tableUnit`,ref:Wt,onClose:er}),Me({content:T(()=>[(y(),f(w(Dt),{key:`table_${Bt.value}`,colNames:Yn.value.colNames,head:Yn.value.head,body:Yn.value.body,config:Yn.value.config,title:L.value.table.useDialog?``:$n.value.title,withCloseButton:!L.value.table.useDialog,isCursorPointer:V.value,onClose:er},{th:T(({th:e})=>[Ne(C(e.name),1)]),td:T(({td:e})=>[h(`div`,wt,C(e.name?e.name:An(e)),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[L.value.table.useDialog?{name:`title`,fn:T(()=>[Ne(C($n.value.title),1)]),key:`0`}:void 0,L.value.table.useDialog?{name:`actions`,fn:T(()=>[h(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[1]||=e=>Xn(L.value.userOptions.callbacks.csv),style:v({cursor:V.value?`pointer`:`default`})},[Pe(w(Et),{name:`fileCsv`,stroke:$n.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):p(``,!0),S(e.$slots,`skeleton`,{},()=>[w(Jt)?(y(),f(le,{key:0})):p(``,!0)],!0)],46,Je))}},[[`__scopeId`,`data-v-82970769`]]);export{qe as n,Tt as t};
@@ -1,13 +0,0 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-D3ZfFSE5.js";import{$ as n,D as r,Dt as i,Ft as a,Ht as o,Q as s,S as c,X as l,Zt as u,at as d,i as f,in as p,nn as m,nt as ee,q as h,r as g,t as te,tn as ne,w as re,zt as ie}from"./lib-rPeBMZrn.js";import{n as ae,t as oe}from"./BaseScanner-8NdoBs7B.js";import{n as se,t as ce}from"./useHints-C-TwxM0Y.js";import{t as le}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as ue}from"./resolveChartConfig-CIhClE5R.js";import{t as de}from"./chartImage-DPGnEuYM.js";import{n as fe}from"./Title-BliHuXfT.js";import{t as pe}from"./useChartExport-BZts4KFb.js";import{t as me}from"./tableIntegration-CNoJ1CIY.js";import{n as he,t as ge}from"./annotationSlots-RvQBEO9-.js";import{n as _e,t as ve}from"./userOptionsSlots-DYuo-E5m.js";import{t as ye}from"./usePrinter-DVf3YcG5.js";import{t as be}from"./useTransitions-ChGGrtrv.js";import{c as xe}from"./canvas-lib-22VpOI4_.js";import{t as Se}from"./useResponsive-CENUxfEL.js";import{t as Ce}from"./DefGrad-DKMq1REY.js";import{t as we}from"./A11yDataTable-DWNlWXzs.js";import{t as Te}from"./useUserOptionState-CXlFnwPv.js";import{t as Ee}from"./useChartAccessibility-DOMuYJfm.js";import{n as De}from"./annotationViewport-X8fvs7pz.js";import{t as Oe}from"./usePanZoom-BdjP5Suc.js";import{t as ke}from"./vue_ui_circle_pack-CfXkXi7v.js";import{Fragment as _,computed as v,createBlock as y,createCommentVNode as b,createElementBlock as x,createElementVNode as S,createSlots as Ae,createTextVNode as je,createVNode as Me,defineAsyncComponent as C,guardReactiveProps as w,mergeProps as Ne,nextTick as Pe,normalizeClass as T,normalizeProps as E,normalizeStyle as Fe,onBeforeUnmount as Ie,onMounted as Le,openBlock as D,ref as O,renderList as k,renderSlot as A,resolveDynamicComponent as Re,toDisplayString as j,toRefs as ze,unref as M,useCssVars as Be,watch as Ve,withCtx as N}from"vue";function He(e,t=0){let n=e.reduce((e,{x:n,r})=>Math.min(e,n-r-t),1/0),r=e.reduce((e,{x:n,r})=>Math.max(e,n+r+t),-1/0),i=e.reduce((e,{y:n,r})=>Math.min(e,n-r-t),1/0),a=e.reduce((e,{y:n,r})=>Math.max(e,n+r+t),-1/0);return[n,i,r-n,a-i]}function Ue(e,t,n){let r=e._,i=e.next._,a=r.r+i.r,o=(r.x*i.r+i.x*r.r)/a,s=(r.y*i.r+i.y*r.r)/a;return Math.max(Math.abs(o*n),Math.abs(s*t))}function We(e,t,n){let r=Ue,i=e.length;if(!i)return e;e.sort((e,t)=>t.r-e.r);let a,o,s;if(a=e[0],a.x=0,a.y=0,!(i>1))return e;if(o=e[1],a.x=-o.r,o.x=a.r,o.y=0,!(i>2))return qe(e,n,t),e;Ge(o,a,s=e[2]),a=new et(a),o=new et(o),s=new et(s),a.next=s.previous=o,o.next=a.previous=s,s.next=o.previous=a;packLoop:for(let c=3;c<i;++c){Ge(a._,o._,s=e[c]),s=new et(s);let i=o.next,l=a.previous,u=o._.r,d=a._.r;do if(u<=d){if(Ke(i._,s._)){o=i,a.next=o,o.previous=a,--c;continue packLoop}u+=i._.r,i=i.next}else{if(Ke(l._,s._)){a=l,a.next=o,o.previous=a,--c;continue packLoop}d+=l._.r,l=l.previous}while(i!==l.next);s.previous=a,s.next=o,a.next=o.previous=o=s;let f=a,p=r(a,n,t),m=a.next;for(;m!==o;){let e=r(m,n,t);e<p&&(f=m,p=e),m=m.next}a=f,o=a.next}return qe(e,n,t),Xe(e,n,t),e}function Ge(e,t,n){let r=e.x-t.x,i=e.y-t.y,a=r*r+i*i;if(a){let o=(t.r+n.r)**2,s=(e.r+n.r)**2;if(o>s){let t=(a+s-o)/(2*a),c=Math.sqrt(Math.max(0,s/a-t*t));n.x=e.x-t*r-c*i,n.y=e.y-t*i+c*r}else{let e=(a+o-s)/(2*a),c=Math.sqrt(Math.max(0,o/a-e*e));n.x=t.x+e*r-c*i,n.y=t.y+e*i+c*r}}else n.x=t.x+n.r,n.y=t.y}function Ke(e,t){let n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function qe(e,t,n){if(e.length<4)return;let r=e[0].r,i=e.findIndex(e=>e.r<r*.6),a=i===-1?Math.min(e.length,12):i,o=e.slice(0,Math.max(3,a));for(let t=0;t<80;t+=1){let t=!1;for(let n=0;n<o.length;n+=1){let r=o[n],i=.06*(1-n/Math.max(1,o.length)),a=r.x*(1-i),s=r.y*(1-i);Je(r,a,s,e,n)&&(r.x=a,r.y=s,t=!0)}if(Ye(o),!t)break}let s=o.reduce((e,t)=>e+t.x,0)/o.length,c=o.reduce((e,t)=>e+t.y,0)/o.length;for(let t of e)t.x-=s,t.y-=c}function Je(e,t,n,r){let i=e.x,a=e.y;e.x=t,e.y=n;for(let t of r)if(t!==e&&Ke(e,t))return e.x=i,e.y=a,!1;return e.x=i,e.y=a,!0}function Ye(e){for(let t=0;t<6;t+=1){let t=!1;for(let n=0;n<e.length-1;n+=1)for(let r=n+1;r<e.length;r+=1){let i=e[n],a=e[r],o=a.x-i.x,s=a.y-i.y,c=Math.sqrt(o*o+s*s)||1e-6,l=i.r+a.r;if(c<l){let e=(l-c)/2,n=o/c,r=s/c;i.x-=n*e,i.y-=r*e,a.x+=n*e,a.y+=r*e,t=!0}}if(!t)break}}function Xe(e,t,n){if(e.length<6)return;let r=e[0].r,i=e.findIndex(e=>e.r<=r*.45);if(i!==-1)for(let r=i;r<e.length;r+=1){let i=e[r],a=Ze(i,e.slice(0,r),t,n);a&&(i.x=a.x,i.y=a.y)}}function Ze(e,t,n,r){if(t.length<2)return null;let i=null,a=1/0;for(let o=0;o<t.length-1;o+=1)for(let s=o+1;s<t.length;s+=1){let c=t[o],l=t[s],u=Qe(c,l,e.r);for(let o of u){if(!o)continue;let s={...e,x:o.x,y:o.y};if(!P(s,t))continue;let c=$e(s,t,n,r);c<a&&(a=c,i=o)}}return i}function Qe(e,t,n){let r=e.r+n,i=t.r+n,a=t.x-e.x,o=t.y-e.y,s=a*a+o*o,c=Math.sqrt(s);if(!c||c>r+i||c<Math.abs(r-i))return[];let l=(r*r-i*i+s)/(2*c),u=r*r-l*l;if(u<0)return[];let d=Math.sqrt(u),f=a/c,p=o/c,m=e.x+l*f,ee=e.y+l*p,h=-p*d,g=f*d;return[{x:m+h,y:ee+g},{x:m-h,y:ee-g}]}function P(e,t){for(let n of t)if(Ke(n,e))return!1;return!0}function $e(e,t,n,r){let i=e.x/Math.max(1,n),a=e.y/Math.max(1,r),o=i*i+a*a,s=[];for(let n of t){let t=e.x-n.x,r=e.y-n.y,i=Math.sqrt(t*t+r*r)-(e.r+n.r);s.push(i)}s.sort((e,t)=>e-t);let c=s[0]??0,l=s[1]??c,u=s[2]??l;return c*8+l*4+u*2+o*e.r*12}var et=class{constructor(e){this._=e,this.next=null,this.previous=null}},tt=/* @__PURE__ */ e({default:()=>F}),nt=[`id`],rt=[`id`],it=[`xmlns`,`aria-describedby`,`viewBox`],at=[`x`,`y`,`width`,`height`],ot={key:0},st=[`x`,`y`,`width`,`height`,`stroke`,`stroke-width`,`fill`,`rx`,`onMouseenter`,`onMouseout`,`onClick`],ct=[`x`,`y`,`width`,`height`,`stroke`,`stroke-width`,`fill`,`rx`],lt=[`x`,`y`,`width`,`height`,`fill`,`rx`],ut=[`transform`,`font-size`,`fill`,`font-weight`],dt=[`transform`,`font-size`,`fill`,`font-weight`],ft={key:1,style:{pointerEvents:`none`}},pt=[`stroke`,`stroke-width`,`stroke-dasharray`,`opacity`,`d`],mt=[`x`,`y`,`width`,`height`,`rx`,`ry`,`fill`,`stroke`,`stroke-width`,`filter`],ht=[`fill`,`x`,`y`,`rx`,`width`,`height`],gt=[`transform`,`font-size`,`fill`,`font-family`],_t=[`dy`],vt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},yt={key:5,class:`vue-data-ui-watermark`},bt={key:6,"data-dom-to-png-ignore":``,class:`reset-wrapper`},xt={style:{display:`flex`,"align-items":`center`}},F=/*#__PURE__*/ le({__name:`vue-ui-circle-pack`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectDatapoint`,`copyAlt`],setup(e,{expose:le,emit:Ue}){Be(e=>({v293d4b64:mr.value}));let Ge=C(()=>import(`./Tooltip-C1q0Qoh7.js`)),Ke=C(()=>import(`./BaseIcon-fYK0iID8.js`).then(e=>e.n)),qe=C(()=>import(`./vue-ui-accordion-D4FHxzsL.js`).then(e=>e.n)),Je=C(()=>import(`./DataTable-5Ug6gMAX.js`)),Ye=C(()=>import(`./UserOptions-Em_JgDXM.js`).then(e=>e.n)),Xe=C(()=>import(`./PenAndPaper-r50tK3S4.js`).then(e=>e.t)),Ze=C(()=>import(`./PackageVersion-u-p5bCcj.js`).then(e=>e.t)),Qe=C(()=>import(`./BaseDraggableDialog-9d30Yx8c.js`).then(e=>e.n)),P=e,$e=Ue,{vue_ui_circle_pack:et}=t(),tt=v(()=>!!P.dataset&&P.dataset.length),F=O(l()),I=O(null),St=O(null),Ct=O(null),wt=O(0),Tt=O(0),Et=O(0),Dt=O(null),L=O(null),Ot=O(null),kt=O(!1),At=O(``),R=O(null),z=O(null),jt=O({x:0,y:0}),Mt=O(`pointer`),Nt=O(!1),B=O(Vt()),V=v(()=>B.value.style.chart.circles.labels),H=v(()=>B.value.style.chart.circles),U=v(()=>B.value.style.chart);se({config:()=>B.value,dataset:()=>P.dataset,component:`VueUiCirclePack`,rules:[ce.emptyArray,{test:e=>e.length===1&&(!e[0].children||e[0]?.children.length===0),message:[`👀 The dataset only has a single series. Consider:`,``,`▶️ Using a value display instead of a chart component, or using VueUiKpi.`]},{test:e=>e.length===1&&e[0]?.children&&e[0]?.children.length<6,message:[`👀 The number of datapoints is probably too low for this type of chart. Consider:`,``,`▶️ Using VueUiDonut or VueUiWaffle instead.`]}]});let{transitionEnabled:W}=be({config:()=>B.value.transitions,dataset:()=>P.dataset}),Pt=v(()=>B.value.userOptions.useCursorPointer),Ft=v(()=>p({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,circles:{stroke:`#6A6A6A`,labels:{name:{show:!1},value:{show:!1}}}}}},userConfig:B.value.skeletonConfig??{}})),{loading:It,FINAL_DATASET:Lt}=ae({...ze(P),FINAL_CONFIG:B,prepareConfig:Vt,skeletonDataset:P.config?.skeletonDataset??[{name:`_`,value:13,color:`#F2F2F2`},{name:`_`,value:8,color:`#DBDBDB`},{name:`_`,value:5,color:`#ADADAD`},{name:`_`,value:3,color:`#969696`},{name:`_`,value:2,color:`#808080`},{name:`_`,value:1,color:`#696969`}],skeletonConfig:p({defaultConfig:B.value,userConfig:Ft.value})}),{svgRef:G}=Ee({config:U.value.title}),{userOptionsVisible:Rt,setUserOptionsVisibility:zt,keepUserOptionState:Bt}=Te({config:B.value});function Vt(){return ue(P.config,et,ke)}let Ht=u(P.config);Ve(()=>P.config,(e,t)=>{let n=u(e),r=n!==Ht;Ht=n;let i=Vt();r?(B.value=i,Rt.value=!B.value.userOptions.showOnChartHover,fn(),wt.value+=1,Tt.value+=1,K.value.showTable=B.value.table.show,K.value.showTooltip=U.value.tooltip.show,K.value.showZoom=U.value.zoom?.show??!1):(B.value.style.chart.tooltip=i.style.chart.tooltip,K.value.showTooltip=B.value.style.chart.tooltip.show)},{deep:!0});let{isPrinting:Ut,isImaging:Wt,generatePdf:Gt,generateImage:Kt}=ye({elementId:`vue-ui-circle-pack_${F.value}`,fileName:U.value.title.text||`vue-ui-circle-pack`,options:B.value.userOptions.print}),qt=v(()=>B.value.userOptions.show&&!U.value.title.text),K=O({showTable:B.value.table.show,showTooltip:U.value.tooltip.show,showZoom:U.value.zoom?.show??!1});Ve(B,()=>{K.value={showTable:B.value.table.show,showTooltip:U.value.tooltip.show,showZoom:U.value.zoom?.show??!1}},{immediate:!0});let q=O({h:10,w:10}),Jt=O([0,0,100,100]),Yt=O({x:0,y:0,width:100,height:100}),Xt=v(()=>B.value.debug),Zt=v(()=>{let e=B.value.style?.chart||{};return e.dimensions&&typeof e.dimensions.width==`number`?e.dimensions.width:typeof e.width==`number`?e.width:300}),Qt=v(()=>{let e=B.value.style?.chart||{};return e.dimensions&&typeof e.dimensions.height==`number`?e.dimensions.height:typeof e.height==`number`?e.height:300}),J=O([]),Y=O([]),X=O(null),Z=O(null);function $t(e,t){q.value={w:e,h:t};let n=mn.value.map(en);if(!n.length){let n={x:0,y:0,width:e,height:t};J.value=[],Y.value=[],Jt.value=[n.x,n.y,n.width,n.height],Yt.value={...n},An(n);return}let r=We(n,t,e),[i,a,o,s]=He(r,1),c=Math.min(o?e/o:1,s?t/s:1),l=(e-o*c)/2,u=(t-s*c)/2,d=r.map(e=>({...e,x:(e.x-i)*c+l,y:(e.y-a)*c+u,r:e.r*c}));J.value=sn(d),Y.value=J.value;let f=Vn({x:0,y:0,width:e,height:t});Jt.value=[f.x,f.y,f.width,f.height],Yt.value={...f},An(f)}function en(e){return{...e,children:Array.isArray(e.children)?e.children.map(en):[]}}function tn(e){let t=Number(e?.value);return Number.isFinite(t)&&t>0?t:Array.isArray(e?.children)?e.children.reduce((e,t)=>e+tn(t),0):0}function nn(e,t){let n=m[B.value.theme||`default`]||o,r=pn.value.length?pn.value:n.length?n:o;return c(e.color)||r[t%r.length]||o[t%o.length]}function rn(e){return!Array.isArray(e.children)||!e.children.length?1:e.children.reduce((e,t)=>e+rn(t),0)}function an(e,t=null,n=0,r=[]){return Array.isArray(e)?e.map((e,i)=>{let a=tn(e);if(!Number.isFinite(a)||a<=0)return null;let o=l(),s=[...r,i],u=s.reduce((e,t,n)=>e+t+n,0),d=e.color||t?.color?c(e.color||t?.color):nn(e,u),f=an(e.children,{id:o,name:e.name,color:d,rootId:t?.rootId??o},n+1,s);return{...e,value:a,r:a,id:o,color:d,depth:n,parentId:t?.id??null,parentName:t?.name??null,rootId:t?.rootId??o,hasChildren:f.length>0,childCount:f.length,leafCount:f.length?rn({children:f}):1,hierarchyPath:s,children:f}}).filter(Boolean):[]}function on(e){if(!Array.isArray(e.children)||!e.children.length)return[];let t=e.r*2;if(!t)return[];let n=We(e.children.map(en),t,t),[r,i,a,o]=He(n,1),s=Math.min(a?t/a:1,o?t/o:1)*.9,c=a*s,l=o*s,u=e.x-c/2,d=e.y-l/2;return n.map(e=>({...e,x:(e.x-r)*s+u,y:(e.y-i)*s+d,r:e.r*s}))}function sn(e){let t=[];return e.forEach(e=>{let n=on(e);t.push({...e,children:n}),t.push(...sn(n))}),t}function cn(e,t){return!e||!t||!Array.isArray(e.hierarchyPath)||!Array.isArray(t.hierarchyPath)||e.hierarchyPath.length<=t.hierarchyPath.length?!1:t.hierarchyPath.every((t,n)=>e.hierarchyPath[n]===t)}function ln(e){return e.hasChildren?V.value.parents.show:V.value.children.show}function un(){if(!B.value.responsive||!I.value)return;let e=xe(()=>{let{width:e,height:t}=Se({chart:I.value,title:U.value.title.text?St.value:null,legend:null,source:Dt.value,noTitle:Ct.value});requestAnimationFrame(()=>{e&&t&&(G.value&&(G.value.setAttribute(`width`,e),G.value.setAttribute(`height`,t)),$t(e,t))})});X.value&&(Z.value&&X.value.unobserve(Z.value),X.value.disconnect()),X.value=new ResizeObserver(e),Z.value=I.value.parentNode||I.value,Z.value&&X.value.observe(Z.value),e()}function dn(){X.value&&(Z.value&&X.value.unobserve(Z.value),X.value.disconnect(),X.value=null,Z.value=null)}async function fn(){ie(P.dataset)&&d({componentName:`VueUiCirclePack`,type:`dataset`,debug:Xt.value});let e=Zt.value,t=Qt.value;$t(e,t),B.value.responsive?un():dn()}Le(fn),Ie(()=>{dn()}),Ve(()=>Lt.value,async e=>{await fn()},{deep:!0});let pn=v(()=>re(B.value.customPalette)),mn=v(()=>an(Lt.value)),hn=v(()=>J.value.length?Math.max(...J.value.map(e=>e.r)):0);function gn(e,t){return hn.value?t/hn.value*e:0}function _n(e,t){B.value.events.datapointLeave&&B.value.events.datapointLeave({datapoint:e,seriesIndex:t}),(Mt.value!==`keyboard`||R.value?.id!==e?.id)&&(kt.value=!1,R.value=null,z.value=null,Mt.value=`pointer`)}function vn(e,t){$e(`selectDatapoint`,e),B.value.events.datapointClick&&B.value.events.datapointClick({datapoint:e,seriesIndex:t})}let yn=O(null),bn=O(!1);function xn(e,t,n=`pointer`){R.value=e,z.value=t,Mt.value=n,B.value.events.datapointEnter&&B.value.events.datapointEnter({datapoint:e,seriesIndex:t}),yn.value={datapoint:e,seriesIndex:t,config:B.value,series:Y.value},kt.value=!0;let r=U.value.tooltip.customFormat;if(bn.value=!1,i(r))try{let n=r({seriesIndex:t,datapoint:e,series:Y.value,config:B.value});typeof n==`string`&&(At.value=n,bn.value=!0)}catch{console.warn(`Custom format cannot be applied.`),bn.value=!1}if(!bn.value){let t=``;t+=`
2
- <div style="display:flex;align-items:center;gap:4px;">
3
- <svg viewBox="0 0 10 10" height="${U.value.tooltip.fontSize}" width="${U.value.tooltip.fontSize}">
4
- <circle
5
- cx="5"
6
- cy="5"
7
- r="5"
8
- fill="${H.value.gradient.show?`url(#${e.id})`:e.color}"
9
- />
10
- </svg>
11
- <span>${e.name}: <b>${Sn(e)}</b></span>
12
- </div>
13
- `,At.value=t}}function Sn(e){return f(V.value.value.formatter,e.value,n({p:V.value.value.prefix,v:e.value,s:V.value.value.suffix,r:V.value.value.rounding}))}function Cn(e){if(!e)return 0;let t=Sn(e),n=e.r/(t.length||1)*(t.length===1?1:2);return Math.min(e.r/2.5,n)}let Q=O(!1);function wn(e){Q.value=e,Et.value+=1}let Tn=O(!1);function En(){Tn.value=!Tn.value}let Dn=v(()=>!Tn.value&&K.value.showZoom),{viewBox:$,resetZoom:On,isZoom:kn,setInitialViewBox:An}=Oe(G,{x:0,y:0,width:Math.max(10,q.value.w),height:Math.max(10,q.value.h)},U.value.zoom?.speed??1,Dn);function jn(e,t,n=0){return!(e.x+e.width+n<t.x||t.x+t.width+n<e.x||e.y+e.height+n<t.y||t.y+t.height+n<e.y)}function Mn(e,t,n=0){let r=Math.min(Math.max(t.x,e.x-n),e.x+e.width+n),i=Math.min(Math.max(t.y,e.y-n),e.y+e.height+n),a=t.x-r,o=t.y-i;return a*a+o*o<=t.r*t.r}function Nn(e,t,n=1){let r=Math.max(4*n,Math.min(t.width,t.height)*.01);return{...e,x:Math.min(Math.max(e.x,t.x+r),t.x+t.width-e.width-r),y:Math.min(Math.max(e.y,t.y+r),t.y+t.height-e.height-r)}}function Pn(e){let t=[e.name];return V.value.value.show&&t.push(Sn(e)),t.filter(Boolean)}function Fn(e,t,n,r,i){let a=e.x,o=e.y;return{right:{x:a+e.r+i,y:o-n/2,anchorX:a+e.r,anchorY:o},left:{x:a-e.r-i-t,y:o-n/2,anchorX:a-e.r,anchorY:o},top:{x:a-t/2,y:o-e.r-i-n,anchorX:a,anchorY:o-e.r},bottom:{x:a-t/2,y:o+e.r+i,anchorX:a,anchorY:o+e.r},topRight:{x:a+e.r*.7+i,y:o-e.r*.7-i-n,anchorX:a+e.r*.7,anchorY:o-e.r*.7},topLeft:{x:a-e.r*.7-i-t,y:o-e.r*.7-i-n,anchorX:a-e.r*.7,anchorY:o-e.r*.7},bottomRight:{x:a+e.r*.7+i,y:o+e.r*.7+i,anchorX:a+e.r*.7,anchorY:o+e.r*.7},bottomLeft:{x:a-e.r*.7-i-t,y:o+e.r*.7+i,anchorX:a-e.r*.7,anchorY:o+e.r*.7}}[r]}function In(e,t){let n=[],r=t.get(e.parentId);for(;r;)n.push(r),r=t.get(r.parentId);return n}function Ln(e,t,n,r,i,a){let o=e.x,s=e.y,c=t||e,l=a*.6,u={right:{x:c.x+c.r+a,y:s-r/2},left:{x:c.x-c.r-a-n,y:s-r/2},top:{x:o-n/2,y:c.y-c.r-a-r},bottom:{x:o-n/2,y:c.y+c.r+a},topRight:{x:c.x+c.r+a,y:c.y-c.r-a-r-l},topLeft:{x:c.x-c.r-a-n,y:c.y-c.r-a-r-l},bottomRight:{x:c.x+c.r+a,y:c.y+c.r+a+l},bottomLeft:{x:c.x-c.r-a-n,y:c.y+c.r+a+l}}[i],d=u.x+n/2,f=u.y+r/2,p=Math.atan2(f-s,d-o);return{...u,anchorX:o+Math.cos(p)*e.r,anchorY:s+Math.sin(p)*e.r}}function Rn(e,t={}){let{clamp:n=!0,scale:r=1}=t;if(!J.value.length||!q.value.w||!q.value.h||!U.value.parentTooltips.show)return[];let i=Math.max(8,U.value.parentTooltips.fontSizeRatio*10)*r,a=i*1.25,o=i*.75,s=i*.55,c=Math.max(8*r,Math.min(e.width,e.height)*.025),l=Math.max(2*r,Math.min(e.width,e.height)*.006),u=[`right`,`left`,`top`,`bottom`,`topRight`,`topLeft`,`bottomRight`,`bottomLeft`],d=[],f=new Map(J.value.map(e=>[e.id,e]));return J.value.filter(e=>e.hasChildren&&e.name).sort((e,t)=>t.r-e.r).forEach(t=>{let p=In(t,f).at(-1),m=Pn(t),ee=m.reduce((e,t)=>Math.max(e,String(t).length),0),h=Math.max(i*5,ee*i*.62+o*2),g=m.length*a+s*2,te=p?u.map(e=>Ln(t,p,h,g,e,c)):[],ne=u.map(e=>Fn(t,h,g,e,c)),re=[...te,...ne].map(t=>{let i=n?Nn({x:t.x,y:t.y,width:h,height:g},e,r):{x:t.x,y:t.y,width:h,height:g};return{...i,anchorX:t.anchorX,anchorY:t.anchorY,lineX:i.x+i.width/2,lineY:i.y+i.height/2}}).find(e=>!d.some(t=>jn(e,t,l))&&!J.value.some(t=>Mn(e,t,l)));re&&d.push({...re,datapoint:t,id:`parent_tooltip_${t.id}`,color:t.color,lines:m,fontSize:i,lineHeight:a,paddingX:o,paddingY:s,scale:r})}),d}function zn(e){let t=Yt.value;if(!t.width||!t.height||!e.width||!e.height)return 1;let n=Math.min(e.width/t.width,e.height/t.height);return Number.isFinite(n)&&n>0?n:1}let Bn=v(()=>Rn($.value,{clamp:!0,scale:zn($.value)}));function Vn(e){let t=Rn(e,{clamp:!1});if(!t.length)return e;let n=Math.min(e.x,...t.map(e=>e.x)),r=Math.min(e.y,...t.map(e=>e.y)),i=Math.max(e.x+e.width,...t.map(e=>e.x+e.width)),a=Math.max(e.y+e.height,...t.map(e=>e.y+e.height)),o=Math.max(8,Math.min(e.width,e.height)*.025);return{x:n-o,y:r-o,width:i-n+o*2,height:a-r+o*2}}function Hn(e){let t=[];function n(e,r=0,i=``){e.forEach(e=>{t.push({name:e.name,value:e.value,color:e.color,parentName:i,depth:r}),Array.isArray(e.children)&&e.children.length&&n(e.children,r+1,e.name)})}return n(e),t}let Un=v(()=>{let e=Hn(mn.value);return{head:Y.value.map(e=>({name:e.name,value:e.value,color:e.color})).toSorted((e,t)=>t.value-e.value),body:e.map(e=>e.value),hierarchy:e}}),Wn=v(()=>Hn(mn.value).map(e=>({...e,name:`${`- `.repeat(e.depth)}${e.name}`})));function Gn(e=null){Pe(()=>{let t=Wn.value.map(e=>[[e.name],[e.parentName||``],[e.depth],[e.value]]),n=[[U.value.title.text],[U.value.title.subtitle.text],[[B.value.table.columnNames.datapoint],[`Parent`],[`Depth`],[B.value.table.columnNames.value]]].concat(t),i=r(n);e?e(i):ee({csvContent:i,title:U.value.title.text||`vue-ui-circle-pack`})})}let Kn=v(()=>{let e=[B.value.table.columnNames.datapoint,B.value.table.columnNames.parent,B.value.table.columnNames.depth,B.value.table.columnNames.value],t=Un.value.hierarchy.map(e=>{let t=n({p:V.value.value.prefix,v:e.value,s:V.value.value.suffix,r:V.value.value.rounding});return[{color:e.color,name:`${` `.repeat(e.depth)}${e.name}`},e.parentName??``,e.depth??0,t]}),r={th:{backgroundColor:B.value.table.th.backgroundColor,color:B.value.table.th.color,outline:B.value.table.th.outline},td:{backgroundColor:B.value.table.td.backgroundColor,color:B.value.table.td.color,outline:B.value.table.td.outline},breakpoint:B.value.table.responsiveBreakpoint};return{colNames:[B.value.table.columnNames.datapoint,B.value.table.columnNames.parent,B.value.table.columnNames.depth,B.value.table.columnNames.value],head:e,body:t,config:r}});function qn(){K.value.showTable=!K.value.showTable}function Jn(){K.value.showTooltip=!K.value.showTooltip}function Yn(){K.value.showZoom=!K.value.showZoom}function Xn(){return mn.value}let Zn=de(I,()=>U.value.title.text),Qn=v(()=>me({config:B,style:U,mutableConfig:K,dialog:Qe,accordion:qe,isFullscreen:Q,parent:I,maxWidth:500,isCursorPointer:Pt}));Ve(()=>K.value.showTable,e=>{B.value.table.show||(e&&B.value.table.useDialog&&L.value?L.value.open():L.value&&`close`in L.value&&L.value.close())});function $n(){K.value.showTable=!1,Ot.value&&Ot.value.setTableIconState(!1)}let er=v(()=>U.value.backgroundColor),tr=v(()=>U.value.title),{isCallbackImaging:nr,isCallbackSvg:rr,generateSvg:ir,onGenerateImage:ar}=pe({svg:G,title:tr,legend:null,legendItems:null,backgroundColor:er,getSvgCallback:()=>B.value.userOptions.callbacks.svg,generateImage:Kt});async function or(){$e(`copyAlt`,{config:B.value,dataset:mn.value,flattenedDataset:Y.value}),B.value.userOptions.callbacks.altCopy?await Promise.resolve(B.value.userOptions.callbacks.altCopy({config:B.value,dataset:mn.value,flattenedDataset:Y.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function sr(e){if(!Number.isFinite(e)||!G.value)return;let t=J.value[e];if(!t)return;let n=ne(t.x,t.y,G.value);n&&(jt.value=n)}function cr(){if(z.value!==null){let e=J.value[z.value];e&&_n(e,z.value)}z.value=null,Mt.value=`pointer`,kt.value=!1,R.value=null}function lr(){z.value=null,Nt.value=!0}function ur(){cr(),Nt.value=!1}function dr(e,t){let n=J.value.length;return n?e===null||e<0||e>=n?t===`next`?0:n-1:t===`previous`?(e-1+n)%n:(e+1)%n:null}function fr(e){if(!G.value||Tn.value||document.activeElement!==G.value||!J.value.length)return;let t=[`ArrowLeft`,`ArrowUp`].includes(e.key),n=[`ArrowRight`,`ArrowDown`].includes(e.key),r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){cr();return}if(r){if(z.value===null)return;let e=J.value[z.value];if(!e)return;vn(e,z.value);return}let a=z.value;a===null||a<0||a>=J.value.length?a=n?0:J.value.length-1:n?a=dr(a,`next`):t&&(a=dr(a,`previous`));let o=J.value[a];o&&(z.value=a,sr(a),xn(o,a,`keyboard`))}let pr=v(()=>({headers:Kn.value?.colNames??[],rows:Kn.value?.body?.map(e=>[e[0]?.name??``,e[1]])??[]})),mr=v(()=>U.value.color);le({getData:Xn,getImage:Zn,generateCsv:Gn,generatePdf:Gt,generateImage:Kt,generateSvg:ir,toggleTable:qn,toggleAnnotator:En,toggleFullscreen:wn,copyAlt:or,toggleZoom:Yn,resetZoom:On});let hr=v(()=>De(B.value.userOptions?.annotator?.followZoom,$.value));return(e,t)=>(D(),x(`div`,{id:`vue-ui-circle-pack_${F.value}`,class:T(`vue-data-ui-component vue-ui-circle-pack ${Q.value?`vue-data-ui-wrapper-fullscreen`:``} ${M(It)?`loading`:``}`),ref_key:`circlePackChart`,ref:I,style:Fe(`font-family:${B.value.style.fontFamily};text-align:center;background:${U.value.backgroundColor};`),onMouseenter:t[2]||=()=>M(zt)(!0),onMouseleave:t[3]||=()=>M(zt)(!1)},[S(`div`,{id:`chart-instructions-${F.value}`,class:`sr-only`},[S(`p`,null,j(B.value.a11y.translations.keyboardNavigation),1)],8,rt),pr.value?.rows?.length?(D(),y(we,{key:0,uid:F.value,head:pr.value.headers,body:pr.value.rows,notice:B.value.a11y.translations.tableAvailable,caption:B.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):b(``,!0),B.value.userOptions.buttons.annotator?(D(),y(M(Xe),{key:1,showGroupActions:B.value.userOptions.annotator?.showGroupActions??!0,svgRef:M(G),followZoom:B.value.userOptions?.annotator?.followZoom,annotationViewport:hr.value,backgroundColor:U.value.backgroundColor,color:U.value.color,active:Tn.value,isCursorPointer:Pt.value,palette:B.value.userOptions.annotatorPalette,onClose:En},Ae({_:2},[k(M(ge),t=>({name:t,fn:N(n=>[A(e.$slots,t,E(w(M(he)(t,n))),void 0,!0)])}))]),1032,[`showGroupActions`,`svgRef`,`followZoom`,`annotationViewport`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):b(``,!0),A(e.$slots,`userConfig`,{},void 0,!0),qt.value?(D(),x(`div`,{key:2,ref_key:`noTitle`,ref:Ct,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):b(``,!0),U.value.title.text?(D(),x(`div`,{key:3,ref_key:`chartTitle`,ref:St,style:`width:100%;background:transparent;padding-bottom:12px`},[(D(),y(fe,{key:`title_${wt.value}`,config:{title:{cy:`donut-div-title`,...U.value.title},subtitle:{cy:`donut-div-subtitle`,...U.value.title.subtitle}}},null,8,[`config`]))],512)):b(``,!0),B.value.userOptions.show&&tt.value&&(M(Bt)||M(Rt))?(D(),y(M(Ye),{ref_key:`userOptionsRef`,ref:Ot,key:`user_option_${Et.value}`,backgroundColor:U.value.backgroundColor,color:U.value.color,isPrinting:M(Ut),isImaging:M(Wt),uid:F.value,hasTooltip:B.value.userOptions.buttons.tooltip,isTooltip:K.value.showTooltip,hasLabel:!1,hasPdf:B.value.userOptions.buttons.pdf,hasImg:B.value.userOptions.buttons.img,hasSvg:B.value.userOptions.buttons.svg,hasXls:B.value.userOptions.buttons.csv,hasTable:B.value.userOptions.buttons.table,hasFullscreen:B.value.userOptions.buttons.fullscreen,hasAltCopy:B.value.userOptions.buttons.altCopy,isFullscreen:Q.value,chartElement:I.value,position:B.value.userOptions.position,callbacks:B.value.userOptions.callbacks,printScale:B.value.userOptions.print.scale,titles:{...B.value.userOptions.buttonTitles},hasAnnotator:B.value.userOptions.buttons.annotator,isAnnotation:Tn.value,tableDialog:B.value.table.useDialog,isCursorPointer:Pt.value,hasZoom:B.value.userOptions.buttons.zoom,isZoom:K.value.showZoom,onToggleFullscreen:wn,onGeneratePdf:M(Gt),onGenerateCsv:Gn,onGenerateImage:M(ar),onGenerateSvg:M(ir),onToggleTable:qn,onToggleTooltip:Jn,onToggleAnnotator:En,onToggleZoom:Yn,onCopyAlt:or,style:Fe({visibility:M(Bt)?M(Rt)?`visible`:`hidden`:`visible`})},Ae({_:2},[k(M(_e)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionZoom optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:N(n=>[A(e.$slots,t,E(w(M(ve)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isPrinting.isImaging.uid.hasTooltip.isTooltip.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasFullscreen.hasAltCopy.isFullscreen.chartElement.position.callbacks.printScale.titles.hasAnnotator.isAnnotation.tableDialog.isCursorPointer.hasZoom.isZoom.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):b(``,!0),S(`div`,{class:T({"vue-ui-circle-pack-svg-container":!0,"not-responsive":!B.value.responsive})},[(D(),x(`svg`,{ref_key:`svgRef`,ref:G,xmlns:M(te),"aria-describedby":`chart-instructions-${F.value}`,viewBox:`${M($).x} ${M($).y} ${M($).width} ${M($).height}`,preserveAspectRatio:`xMidYMid meet`,class:T({"vue-data-ui-fullscreen--on":Q.value,"vue-data-ui-fulscreen--off":!Q.value,"not-responsive":!B.value.responsive,"vue-data-ui-no-transition":!M(W)}),style:Fe(`display:block;${B.value.responsive?`width:100%;height:auto`:`height:100%;`};overflow:${K.value.showZoom?`hidden`:`visible`};background:transparent;color:${U.value.color};background:${U.value.backgroundColor};`),tabindex:`0`,onFocus:lr,onBlur:ur,onKeydown:fr},[Me(M(Ze)),A(e.$slots,`svg-underlayer`,{svg:{drawingArea:{...M($)},width:q.value.w,height:q.value.h,isPrintingImg:M(Ut)||M(Wt)||M(nr),isPrintingSvg:M(rr)}},void 0,!0),e.$slots[`chart-background`]?(D(),x(`foreignObject`,{key:0,x:M($).x,y:M($).y,width:q.value.w,height:q.value.h,style:{pointerEvents:`none`}},[A(e.$slots,`chart-background`,{},void 0,!0)],8,at)):b(``,!0),(D(!0),x(_,null,k(J.value,(t,n)=>(D(),x(_,{key:t.id},[S(`defs`,null,[Me(Ce,{t:`radial`,id:t.id,fy:`30%`,stops:[[`10%`,M(a)(t.color,H.value.gradient.intensity/100),1],[`90%`,M(s)(t.color,.1),1],[`100%`,t.color,1]]},null,8,[`id`,`stops`])]),e.$slots.pattern?(D(),x(`g`,ot,[S(`defs`,null,[A(e.$slots,`pattern`,Ne({ref_for:!0},{...t,patternId:`pattern_${F.value}_${t.id}`}),void 0,!0)])])):b(``,!0),S(`rect`,{class:T({"vue-data-ui-transition":M(W)}),x:t.x-t.r,y:t.y-t.r,width:t.r*2,height:t.r*2,stroke:H.value.stroke,"vector-effect":`non-scaling-stroke`,"stroke-width":H.value.strokeWidth*(hn.value||1)/100,fill:H.value.gradient.show?`url(#${t.id})`:t.color,rx:t.r,onMouseenter:e=>xn(t,n,`pointer`),onMouseout:e=>_n(t,n),onClick:e=>vn(t,n)},null,42,st),e.$slots.pattern?(D(),x(`rect`,{key:1,class:T({"vue-data-ui-transition":M(W)}),x:t.x-t.r,y:t.y-t.r,width:t.r*2,height:t.r*2,stroke:H.value.stroke,"vector-effect":`non-scaling-stroke`,"stroke-width":H.value.strokeWidth*(hn.value||1)/100,fill:`url(#pattern_${F.value}_${t.id})`,rx:t.r,style:{pointerEvents:`none`}},null,10,ct)):b(``,!0)],64))),128)),(D(!0),x(_,null,k(J.value,(e,t)=>(D(),x(_,{key:e.id},[e.hasChildren?b(``,!0):(D(),x(`rect`,{key:0,class:T({"vue-data-ui-transition":M(W)}),x:e.x-e.r,y:e.y-e.r,width:e.r*2,height:e.r*2,stroke:`none`,fill:R.value&&R.value.id===e.id?H.value.gradient.show?`url(#${e.id})`:e.color:`transparent`,rx:e.r,style:Fe({filter:R.value&&R.value.id===e.id?`drop-shadow(0px 0px 6px ${H.value.selectedShadowColor})`:`none`,opacity:+!!R.value,pointerEvents:`none`})},null,14,lt))],64))),128)),(D(!0),x(_,null,k(J.value,(t,n)=>(D(),x(_,{key:`cl_${t.id}`},[e.$slots[`data-label`]&&ln(t)?A(e.$slots,`data-label`,Ne({ref_for:!0},{...t,createTSpans:M(h),fontSize:{name:t.r/3*V.value.name.fontSizeRatio,value:Cn(t)*V.value.value.fontSizeRatio},color:V.value.name.color?V.value.name.color:M(g)(t.color)}),void 0,!0,0):(D(),x(_,{key:1},[V.value.name.show&&t.name&&ln(t)?(D(),x(`text`,{key:0,style:{pointerEvents:`none`},class:T({"vue-data-ui-transition":M(W)}),transform:`translate(${t.x}, ${t.y+gn(t.r,V.value.name.offsetY)-t.r/10})`,"font-size":t.r/3*V.value.name.fontSizeRatio,fill:V.value.name.color===`auto`?M(g)(t.color):V.value.name.color,"font-weight":V.value.name.bold?`bold`:`normal`,"text-anchor":`middle`},j(t.name),11,ut)):b(``,!0),V.value.value.show&&ln(t)?(D(),x(`text`,{key:1,class:T({"vue-data-ui-transition":M(W)}),style:{pointerEvents:`none`,transition:`opacity 0.2s ease-in-out`},transform:`translate(${t.x}, ${t.y+gn(t.r,V.value.value.offsetY)+t.r/2.5})`,"font-size":Cn(t)*V.value.value.fontSizeRatio,fill:V.value.value.color===`auto`?M(g)(t.color):V.value.value.color,"font-weight":V.value.value.bold?`bold`:`normal`,"text-anchor":`middle`},j(Sn(t)),11,dt)):b(``,!0)],64)),A(e.$slots,`circle`,Ne({ref_for:!0},{...t,showLabel:ln(t),isSelected:R.value?.id===t.id,isDescendantOfSelected:cn(t,R.value),uid:`${n}_${F.value}`}),void 0,!0)],64))),128)),Bn.value.length&&U.value.parentTooltips.show?(D(),x(`g`,ft,[(D(!0),x(_,null,k(Bn.value,t=>(D(),x(`g`,{key:`tltp_${t.id}`},[S(`path`,{class:T({"vue-data-ui-transition":M(W)}),stroke:U.value.parentTooltips.link.useSerieColor?t.color:U.value.parentTooltips.link.stroke,"vector-effect":`non-scaling-stroke`,"stroke-width":U.value.parentTooltips.link.strokeWidth,"stroke-linecap":`round`,"stroke-dasharray":U.value.parentTooltips.link.strokeDasharray,opacity:U.value.parentTooltips.link.opacity,d:`M${t.anchorX}, ${t.anchorY} ${t.lineX}, ${t.lineY}`},null,10,pt),S(`rect`,{class:T({"vue-data-ui-transition":M(W)}),x:t.x,y:t.y,width:t.width,height:t.height,rx:Math.max(3*t.scale,t.fontSize/2.5)*U.value.parentTooltips.borderRadiusRatio,ry:Math.max(3*t.scale,t.fontSize/2.5)*U.value.parentTooltips.borderRadiusRatio,fill:U.value.parentTooltips.backgroundColor,stroke:U.value.parentTooltips.useSerieColor?t.color:U.value.parentTooltips.stroke,"vector-effect":`non-scaling-stroke`,"stroke-width":U.value.parentTooltips.strokeWidth,filter:U.value.parentTooltips.filter},null,10,mt),A(e.$slots,`parent-tooltip`,Ne({ref_for:!0},{...t}),()=>[S(`rect`,{class:T({"vue-data-ui-transition":M(W)}),fill:t.color,x:t.x+t.paddingX*1.3-t.fontSize*.35,y:t.y+t.paddingY+t.lineHeight/2-t.fontSize*.35,rx:t.fontSize*.35,width:t.fontSize*.7,height:t.fontSize*.7},null,10,ht),S(`text`,{class:T({"vue-data-ui-transition":M(W)}),transform:`translate(${t.x+t.paddingX+t.fontSize}, ${t.y+t.paddingY+t.fontSize})`,"font-size":t.fontSize,fill:U.value.parentTooltips.color,"font-family":B.value.style.fontFamily,"text-anchor":`start`},[(D(!0),x(_,null,k(t.lines,(e,n)=>(D(),x(`tspan`,{key:`${t.id}_${n}`,x:0,dy:n===0?0:t.lineHeight},j(e),9,_t))),128))],10,gt)],!0)]))),128))])):b(``,!0),A(e.$slots,`svg`,{svg:{drawingArea:{...M($)},width:q.value.w,height:q.value.h,isPrintingImg:M(Ut)||M(Wt)||M(nr),isPrintingSvg:M(rr)}},void 0,!0)],46,it)),e.$slots.hint?(D(),x(`div`,vt,[A(e.$slots,`hint`,E(w({hint:B.value.a11y.translations.keyboardNavigation,isVisible:Nt.value})),void 0,!0)])):b(``,!0)],2),e.$slots.watermark?(D(),x(`div`,yt,[A(e.$slots,`watermark`,E(w({isPrinting:M(Ut)||M(Wt)||M(nr)||M(rr)})),void 0,!0)])):b(``,!0),M(kn)?(D(),x(`div`,bt,[A(e.$slots,`reset-action`,{reset:M(On)},()=>[S(`button`,{"data-cy-reset":``,tabindex:`0`,role:`button`,class:`vue-data-ui-refresh-button`,style:Fe({background:U.value.backgroundColor,cursor:Pt.value?`pointer`:`default`}),onClick:t[0]||=e=>M(On)(!0)},[Me(M(Ke),{name:`refresh`,stroke:U.value.color},null,8,[`stroke`])],4)],!0)])):b(``,!0),e.$slots.source?(D(),x(`div`,{key:7,ref_key:`source`,ref:Dt,dir:`auto`},[A(e.$slots,`source`,{},void 0,!0)],512)):b(``,!0),Me(M(Ge),{teleportTo:U.value.tooltip.teleportTo,show:K.value.showTooltip&&kt.value,backgroundColor:U.value.tooltip.backgroundColor,color:U.value.tooltip.color,fontSize:U.value.tooltip.fontSize,borderRadius:U.value.tooltip.borderRadius,borderColor:U.value.tooltip.borderColor,borderWidth:U.value.tooltip.borderWidth,backgroundOpacity:U.value.tooltip.backgroundOpacity,position:U.value.tooltip.position,offsetX:U.value.tooltip.offsetX,offsetY:U.value.tooltip.offsetY,parent:I.value,content:At.value,isCustom:bn.value,isFullscreen:Q.value,smooth:U.value.tooltip.smooth,backdropFilter:U.value.tooltip.backdropFilter,smoothForce:U.value.tooltip.smoothForce,smoothSnapThreshold:U.value.tooltip.smoothSnapThrehsold,isA11yMode:Mt.value===`keyboard`,a11yPosition:jt.value},{"tooltip-before":N(()=>[A(e.$slots,`tooltip-before`,E(w({...yn.value})),void 0,!0)]),tooltip:N(()=>[A(e.$slots,`tooltip`,E(w({...yn.value})),void 0,!0)]),"tooltip-after":N(()=>[A(e.$slots,`tooltip-after`,E(w({...yn.value})),void 0,!0)]),_:3},8,[`teleportTo`,`show`,`backgroundColor`,`color`,`fontSize`,`borderRadius`,`borderColor`,`borderWidth`,`backgroundOpacity`,`position`,`offsetX`,`offsetY`,`parent`,`content`,`isCustom`,`isFullscreen`,`smooth`,`backdropFilter`,`smoothForce`,`smoothSnapThreshold`,`isA11yMode`,`a11yPosition`]),tt.value&&B.value.userOptions.buttons.table?(D(),y(Re(Qn.value.component),Ne({key:8},Qn.value.props,{ref_key:`tableUnit`,ref:L,onClose:$n}),Ae({content:N(()=>[(D(),y(M(Je),{key:`table_${Tt.value}`,colNames:Kn.value.colNames,head:Kn.value.head,body:Kn.value.body,config:Kn.value.config,title:B.value.table.useDialog?``:Qn.value.title,withCloseButton:!B.value.table.useDialog,isCursorPointer:Pt.value,onClose:$n},{th:N(({th:e})=>[S(`div`,xt,j(e),1)]),td:N(({td:e})=>[je(j(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[B.value.table.useDialog?{name:`title`,fn:N(()=>[je(j(Qn.value.title),1)]),key:`0`}:void 0,B.value.table.useDialog?{name:`actions`,fn:N(()=>[S(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[1]||=e=>Gn(B.value.userOptions.callbacks.csv),style:Fe({cursor:Pt.value?`pointer`:`default`})},[Me(M(Ke),{name:`fileCsv`,stroke:Qn.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):b(``,!0),A(e.$slots,`skeleton`,{},()=>[M(It)?(D(),y(oe,{key:0})):b(``,!0)],!0)],46,nt))}},[[`__scopeId`,`data-v-53199560`]]);export{tt as n,F as t};