vue-data-ui 3.28.11 → 3.28.12

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 (139) hide show
  1. package/dist/{PackageVersion-ksOit8fp.js → PackageVersion-PdpqwkYX.js} +1 -1
  2. package/dist/{XyAnalysisOptions-CUtj1x2f.js → XyAnalysisOptions-DmKfwSu6.js} +1 -1
  3. package/dist/components/vue-ui-3d-bar.js +1 -1
  4. package/dist/components/vue-ui-age-pyramid.js +1 -1
  5. package/dist/components/vue-ui-bullet.js +1 -1
  6. package/dist/components/vue-ui-bump.js +1 -1
  7. package/dist/components/vue-ui-candlestick.js +1 -1
  8. package/dist/components/vue-ui-carousel-table.js +1 -1
  9. package/dist/components/vue-ui-chestnut.js +1 -1
  10. package/dist/components/vue-ui-chord.js +1 -1
  11. package/dist/components/vue-ui-circle-pack.js +1 -1
  12. package/dist/components/vue-ui-cursor.js +1 -1
  13. package/dist/components/vue-ui-dag.js +1 -1
  14. package/dist/components/vue-ui-dashboard.js +1 -1
  15. package/dist/components/vue-ui-digits.js +1 -1
  16. package/dist/components/vue-ui-donut-evolution.js +1 -1
  17. package/dist/components/vue-ui-donut.js +1 -1
  18. package/dist/components/vue-ui-dumbbell.js +1 -1
  19. package/dist/components/vue-ui-flow.js +1 -1
  20. package/dist/components/vue-ui-funnel.js +1 -1
  21. package/dist/components/vue-ui-galaxy.js +1 -1
  22. package/dist/components/vue-ui-gauge.js +1 -1
  23. package/dist/components/vue-ui-geo.js +1 -1
  24. package/dist/components/vue-ui-gizmo.js +1 -1
  25. package/dist/components/vue-ui-graph.js +1 -1
  26. package/dist/components/vue-ui-heatmap.js +1 -1
  27. package/dist/components/vue-ui-hill.js +1 -1
  28. package/dist/components/vue-ui-history-plot.js +1 -1
  29. package/dist/components/vue-ui-horizontal-bar.js +1 -1
  30. package/dist/components/vue-ui-kpi.js +1 -1
  31. package/dist/components/vue-ui-molecule.js +1 -1
  32. package/dist/components/vue-ui-mood-radar.js +1 -1
  33. package/dist/components/vue-ui-nested-donuts.js +1 -1
  34. package/dist/components/vue-ui-onion.js +1 -1
  35. package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
  36. package/dist/components/vue-ui-quadrant.js +1 -1
  37. package/dist/components/vue-ui-quick-chart.js +1 -1
  38. package/dist/components/vue-ui-radar.js +1 -1
  39. package/dist/components/vue-ui-relation-circle.js +1 -1
  40. package/dist/components/vue-ui-ridgeline.js +1 -1
  41. package/dist/components/vue-ui-rings.js +1 -1
  42. package/dist/components/vue-ui-scatter.js +1 -1
  43. package/dist/components/vue-ui-skeleton.js +1 -1
  44. package/dist/components/vue-ui-spark-trend.js +1 -1
  45. package/dist/components/vue-ui-sparkbar.js +1 -1
  46. package/dist/components/vue-ui-sparkgauge.js +1 -1
  47. package/dist/components/vue-ui-sparkhistogram.js +1 -1
  48. package/dist/components/vue-ui-sparkline.js +1 -1
  49. package/dist/components/vue-ui-sparkstackbar.js +1 -1
  50. package/dist/components/vue-ui-stackbar.js +1 -1
  51. package/dist/components/vue-ui-stackline.js +1 -1
  52. package/dist/components/vue-ui-strip-plot.js +1 -1
  53. package/dist/components/vue-ui-table-sparkline.js +1 -1
  54. package/dist/components/vue-ui-table.js +1 -1
  55. package/dist/components/vue-ui-thermometer.js +1 -1
  56. package/dist/components/vue-ui-timer.js +1 -1
  57. package/dist/components/vue-ui-tiremarks.js +1 -1
  58. package/dist/components/vue-ui-treemap.js +1 -1
  59. package/dist/components/vue-ui-vertical-bar.js +1 -1
  60. package/dist/components/vue-ui-waffle.js +1 -1
  61. package/dist/components/vue-ui-wheel.js +1 -1
  62. package/dist/components/vue-ui-word-cloud.js +1 -1
  63. package/dist/components/vue-ui-world.js +1 -1
  64. package/dist/components/vue-ui-xy.js +1 -1
  65. package/dist/package-DWjs4THo.js +1 -0
  66. package/dist/{render-common-CPA2hfDW.js → render-common-C9aE_Va1.js} +1 -1
  67. package/dist/ssr/vue-ui-donut.js +1 -1
  68. package/dist/ssr/vue-ui-xy.js +1 -1
  69. package/dist/ssr.js +1 -1
  70. package/dist/style.css +1 -1
  71. package/dist/vue-data-ui-Da3HK_wb.js +1 -0
  72. package/dist/vue-data-ui.js +1 -1
  73. package/dist/{vue-ui-3d-bar-Cs-_W1Av.js → vue-ui-3d-bar-D1XfKXhp.js} +1 -1
  74. package/dist/{vue-ui-age-pyramid-cWWVFoCj.js → vue-ui-age-pyramid-CJqqtEIh.js} +1 -1
  75. package/dist/{vue-ui-bullet-CMQzoLKs.js → vue-ui-bullet-CxyL5Bdm.js} +1 -1
  76. package/dist/{vue-ui-bump-SSu5eVbF.js → vue-ui-bump-BWWMzAN_.js} +1 -1
  77. package/dist/{vue-ui-candlestick-Cm9jS3n7.js → vue-ui-candlestick-CQXdyPEt.js} +1 -1
  78. package/dist/{vue-ui-carousel-table-D-F54W90.js → vue-ui-carousel-table-DwsfnL_l.js} +1 -1
  79. package/dist/{vue-ui-chestnut-DNe1s8TT.js → vue-ui-chestnut-DV7XKL7g.js} +1 -1
  80. package/dist/{vue-ui-chord-DGzpBpuI.js → vue-ui-chord-DRNn_E6i.js} +1 -1
  81. package/dist/{vue-ui-circle-pack--iJQtXys.js → vue-ui-circle-pack-BcA9ZxZS.js} +1 -1
  82. package/dist/{vue-ui-cursor-B7DJRSGD.js → vue-ui-cursor-DSgVvP1L.js} +1 -1
  83. package/dist/{vue-ui-dag-tsM65e_V.js → vue-ui-dag-CWpyU7AJ.js} +1 -1
  84. package/dist/{vue-ui-dashboard-CC7IhQZu.js → vue-ui-dashboard-Dh_Zi8oG.js} +1 -1
  85. package/dist/{vue-ui-digits-hv2QeC-H.js → vue-ui-digits-Cy3Y6qro.js} +1 -1
  86. package/dist/{vue-ui-donut-iyVVIGoJ.js → vue-ui-donut-BqnLIKwZ.js} +1 -1
  87. package/dist/vue-ui-donut-DasGeYdl.js +47 -0
  88. package/dist/{vue-ui-donut-evolution-Wz_-FYab.js → vue-ui-donut-evolution-Bw7ilDYR.js} +1 -1
  89. package/dist/{vue-ui-dumbbell-p3Q2LkBV.js → vue-ui-dumbbell-BPvvKhag.js} +1 -1
  90. package/dist/{vue-ui-flow-BCH8YU8H.js → vue-ui-flow-XI5Y3qdk.js} +1 -1
  91. package/dist/{vue-ui-funnel-DdrBD9oX.js → vue-ui-funnel-DqoQogQE.js} +1 -1
  92. package/dist/{vue-ui-galaxy-DYKEOEL-.js → vue-ui-galaxy-NRaBIHpn.js} +1 -1
  93. package/dist/{vue-ui-gauge-CPgvR_YB.js → vue-ui-gauge-DX4SBIKS.js} +1 -1
  94. package/dist/{vue-ui-geo-DhJ3Wr_5.js → vue-ui-geo-C3e4J_kw.js} +1 -1
  95. package/dist/{vue-ui-gizmo-BTy4Vr1e.js → vue-ui-gizmo-C9ls2b4h.js} +1 -1
  96. package/dist/{vue-ui-graph-C4kfE4G8.js → vue-ui-graph-CBkbFJIA.js} +1 -1
  97. package/dist/{vue-ui-heatmap-lti43RhW.js → vue-ui-heatmap-D6KP1N8f.js} +1 -1
  98. package/dist/{vue-ui-hill-3GVfKQmi.js → vue-ui-hill-8c-9u8eg.js} +1 -1
  99. package/dist/{vue-ui-history-plot-DMTPygZA.js → vue-ui-history-plot-CowxWkEd.js} +1 -1
  100. package/dist/{vue-ui-horizontal-bar-DwWo0CvX.js → vue-ui-horizontal-bar-CVP5jBNJ.js} +1 -1
  101. package/dist/{vue-ui-kpi-BTMK37Ix.js → vue-ui-kpi-D1MUlURM.js} +1 -1
  102. package/dist/{vue-ui-molecule-rbDnRA7c.js → vue-ui-molecule-BRB54XBD.js} +1 -1
  103. package/dist/{vue-ui-mood-radar-8s1jnO3P.js → vue-ui-mood-radar-CkHJdUyF.js} +1 -1
  104. package/dist/{vue-ui-nested-donuts-8bY4HvC-.js → vue-ui-nested-donuts-C-7VZO11.js} +1 -1
  105. package/dist/{vue-ui-onion-CgLNDFrZ.js → vue-ui-onion-erpKpDKg.js} +1 -1
  106. package/dist/{vue-ui-parallel-coordinate-plot-ms14eLus.js → vue-ui-parallel-coordinate-plot-BDg0pRkN.js} +1 -1
  107. package/dist/{vue-ui-quadrant-6GgQZ8fW.js → vue-ui-quadrant-CUdNxC6W.js} +1 -1
  108. package/dist/{vue-ui-quick-chart-CzRbFXIS.js → vue-ui-quick-chart-DE5Zwioe.js} +1 -1
  109. package/dist/{vue-ui-radar-BxsD2JBj.js → vue-ui-radar-6y6er9ND.js} +1 -1
  110. package/dist/{vue-ui-relation-circle-BFPAlaWQ.js → vue-ui-relation-circle-CjnG9G7s.js} +1 -1
  111. package/dist/{vue-ui-ridgeline-G2m7eFWe.js → vue-ui-ridgeline-B4qi2Ajl.js} +1 -1
  112. package/dist/{vue-ui-rings-l_BLWL48.js → vue-ui-rings-EYfCkNB6.js} +1 -1
  113. package/dist/{vue-ui-scatter-C4hXe3DM.js → vue-ui-scatter-Tw-5uRac.js} +1 -1
  114. package/dist/{vue-ui-skeleton-BLyh-ESb.js → vue-ui-skeleton-CZMyXM-1.js} +1 -1
  115. package/dist/{vue-ui-spark-trend-D0hz9kNt.js → vue-ui-spark-trend-Cmj4aWcQ.js} +1 -1
  116. package/dist/{vue-ui-sparkbar-Dweyr8h-.js → vue-ui-sparkbar-Crq1Vui3.js} +1 -1
  117. package/dist/{vue-ui-sparkgauge-DQfCXKFj.js → vue-ui-sparkgauge-CN_9yenn.js} +1 -1
  118. package/dist/{vue-ui-sparkhistogram-DOfAu86W.js → vue-ui-sparkhistogram-CK7JmyCw.js} +1 -1
  119. package/dist/{vue-ui-sparkline-DuX09S8A.js → vue-ui-sparkline-2_RlGrAT.js} +1 -1
  120. package/dist/{vue-ui-sparkstackbar-vXOpiyrI.js → vue-ui-sparkstackbar-Dwdn2_9q.js} +1 -1
  121. package/dist/{vue-ui-stackbar-DsrwNY0p.js → vue-ui-stackbar-BVmQJn2b.js} +1 -1
  122. package/dist/{vue-ui-stackline-e7EYZet7.js → vue-ui-stackline-nvhui30B.js} +1 -1
  123. package/dist/{vue-ui-strip-plot-2DxzeUXU.js → vue-ui-strip-plot-Dig2RljR.js} +1 -1
  124. package/dist/{vue-ui-table-B344jLaG.js → vue-ui-table-_qSw3iGd.js} +1 -1
  125. package/dist/{vue-ui-table-sparkline-itq8yRCe.js → vue-ui-table-sparkline-39sKOqcp.js} +1 -1
  126. package/dist/{vue-ui-thermometer-BSRjS7l3.js → vue-ui-thermometer-CoVrrzHW.js} +1 -1
  127. package/dist/{vue-ui-timer-DM-urc2D.js → vue-ui-timer-DoR5PqOa.js} +1 -1
  128. package/dist/{vue-ui-tiremarks-CbIOAO3F.js → vue-ui-tiremarks-9tPPNGiq.js} +1 -1
  129. package/dist/{vue-ui-treemap-Cgal4H5O.js → vue-ui-treemap-D3mZkT4P.js} +1 -1
  130. package/dist/{vue-ui-waffle-BZFI7JLd.js → vue-ui-waffle-D2GfM_Se.js} +1 -1
  131. package/dist/{vue-ui-wheel-DdKm_Vd8.js → vue-ui-wheel-CYBaqHm6.js} +1 -1
  132. package/dist/{vue-ui-word-cloud-D40vUb5e.js → vue-ui-word-cloud-ClGL6iKL.js} +1 -1
  133. package/dist/{vue-ui-world-BseI3A0C.js → vue-ui-world-Dm7LSNB2.js} +1 -1
  134. package/dist/{vue-ui-xy-Bl-DUFcf.js → vue-ui-xy-2VCMSzeE.js} +2 -2
  135. package/dist/{vue-ui-xy-DNVd3FPA.js → vue-ui-xy-DUlJcC9R.js} +1 -1
  136. package/package.json +1 -1
  137. package/dist/package-vXTjpYqq.js +0 -1
  138. package/dist/vue-data-ui-0NKIVNqt.js +0 -1
  139. package/dist/vue-ui-donut-B9WXaiPn.js +0 -47
@@ -1,2 +1,2 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as ee,r as i,t as a}from"./annotationSlots-OLiW25XN.js";import{n as o,t as s}from"./tableIntegration-CNoJ1CIY.js";import{t as te}from"./chartImage-DPGnEuYM.js";import{n as ne}from"./resolveChartConfig-0IvbmIE_.js";import{$ as c,D as re,Ht as ie,J as ae,N as oe,P as se,S as ce,U as le,X as ue,Xt as de,at as fe,i as pe,in as me,nt as he,r as ge,t as _e,tt as ve,w as ye,xt as be,yt as xe,zt as Se}from"./lib-rPeBMZrn.js";import{c as Ce}from"./canvas-lib-22VpOI4_.js";import{n as we,t as Te}from"./useHints-C-TwxM0Y.js";import{t as Ee}from"./useConfig-_JwRfIqE.js";import{n as De,t as Oe}from"./BaseScanner-8NdoBs7B.js";import{t as ke}from"./usePrinter-DVf3YcG5.js";import{t as Ae}from"./useResponsive-CENUxfEL.js";import{t as je}from"./useTimeLabels-Das5O74F.js";import{t as Me}from"./useChartExport-BZts4KFb.js";import{t as Ne}from"./useUserOptionState-CXlFnwPv.js";import{t as Pe}from"./useChartAccessibility-DOMuYJfm.js";import{t as Fe}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Ie}from"./vue_ui_ridgeline-BIaWjw_v.js";import{t as Le}from"./Legend-W9YVYVX-.js";import{n as Re}from"./Title-BliHuXfT.js";import{t as ze}from"./Shape-CRe8woTu.js";import{t as Be}from"./A11yDataTable-DWNlWXzs.js";import{t as Ve}from"./BaseLegendToggle-VzX69MCo.js";import{t as He}from"./DefGrad-DKMq1REY.js";import{t as Ue}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as l,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createSlots as We,createTextVNode as Ge,createVNode as Ke,defineAsyncComponent as h,guardReactiveProps as qe,mergeProps as Je,nextTick as Ye,normalizeClass as Xe,normalizeProps as Ze,normalizeStyle as g,onBeforeUnmount as Qe,openBlock as _,ref as v,renderList as y,renderSlot as b,resolveDynamicComponent as $e,shallowRef as et,toDisplayString as x,toRefs as tt,unref as S,watch as nt,watchEffect as rt,withCtx as C}from"vue";var it=/* @__PURE__ */ e({default:()=>Dt}),at=[`id`],ot=[`id`],st={style:{position:`relative`}},ct=[`xmlns`,`aria-describedby`,`viewBox`],lt={key:0},ut=[`fill`,`d`],dt=[`stroke`,`stroke-width`,`d`],ft=[`fill`,`d`],pt=[`stroke`,`stroke-dasharray`,`stroke-width`,`d`],mt=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],ht=[`cx`,`cy`,`stroke`,`stroke-width`,`r`,`fill`],gt=[`x`,`y`,`font-size`,`font-weight`,`fill`,`text-decoration`,`onMouseenter`,`onClick`],_t={key:0},vt=[`font-size`,`fill`,`stroke`,`font-weight`,`transform`,`text-anchor`],yt=[`font-size`,`fill`,`font-weight`,`transform`,`text-anchor`,`innerHTML`],bt=[`x`,`y`,`width`,`height`,`onMouseenter`,`onMouseleave`,`onClick`],xt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],St=[`cx`,`cy`,`stroke`,`stroke-width`,`r`,`fill`],Ct=[`x`,`y`,`stroke`,`text-anchor`,`font-size`,`fill`],wt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Tt={key:5,class:`vue-data-ui-watermark`},Et=[`onClick`],Dt=/*#__PURE__*/ Ue({__name:`vue-ui-ridgeline`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`selectX`,`copyAlt`],setup(e,{expose:Ue,emit:it}){let Dt=h(()=>import(`./vue-ui-xy-Bl-DUFcf.js`).then(e=>e.n)),Ot=h(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),kt=h(()=>import(`./vue-ui-accordion-DxGxf-Rm.js`).then(e=>e.n)),At=h(()=>import(`./DataTable-KeuZB1JM.js`)),jt=h(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Mt=h(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Nt=h(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),Pt=h(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_ridgeline:Ft}=Ee(),w=e,It=u({get(){return Array.isArray(B.value)&&B.value.length>0},set(e){return e}}),Lt=it,T=v(null),Rt=v(null),zt=v(null),E=et(null),D=et(null),Bt=v(null),Vt=v(null),Ht=v(0),Ut=v(0),Wt=v(0),O=v(ue()),Gt=v(0),Kt=v(0),qt=v(512),k=v(null),A=v(null),Jt=v(null),Yt=v(0),Xt=v(null),Zt=v(null),Qt=v(null),j=v(null),$t=v(!1);function en(){return ne(w.config,Ft,Ie)}let M=v(en()),N=u(()=>M.value.userOptions),P=u(()=>M.value.style.chart.areas),F=u(()=>M.value.style.chart.selector),I=u(()=>M.value.style.chart.xAxis.labels),L=u(()=>M.value.style.chart.yAxis.labels),R=u(()=>M.value.style.chart);we({config:()=>M.value,dataset:()=>w.dataset,component:`VueUiRidgeline`,rules:[Te.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.some(e=>e.datapoints.some(e=>e.values.length>200)),message:[`👀 Some series contain > 200 data points, which can affect performance. Consider if you really need this level of detail.`,``,`▶️ Use larger time scales, or aggregated values.`,``,`▶️ Filter the time range by adding date inputs in your UI.`]},{test:e=>e.length<6&&e.length>0,message:[`👀 The number of series < 6. Consider:`,``,`▶️ Using VueUiXy instead`]}]});let z=u(()=>M.value.userOptions.useCursorPointer),tn=u(()=>me({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,areas:{maxPoint:{show:!1},opacity:.9,stroke:{useSerieColor:!0}},legend:{backgroundColor:`transparent`},padding:{right:-24,left:0},xAxis:{labels:{values:[]}},yAxis:{labels:{fontSize:0}},zeroLine:{show:!1}}}},userConfig:M.value.skeletonConfig??{}})),{loading:nn,FINAL_DATASET:B,manualLoading:rn}=De({...tt(w),FINAL_CONFIG:M,prepareConfig:en,skeletonDataset:w.config?.skeletonDataset??[{name:`_`,datapoints:[{name:`__`,color:`#999999`,values:[28.639,32.04,41.134,44.525,21.151,2.436,.218,.024,.002,0,0,0]},{name:`_`,color:`#CACACA`,values:[13.253,15.621,23.36,33.698,29.935,10.874,2.364,.561,.107,.02,.006,.004]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[10.851,13.195,21.617,36.556,42.292,21.006,3.398,.223,.013,.001,0,0]},{name:`_`,color:`#CACACA`,values:[3.171,4.115,8.108,18.248,31.641,29.063,12.031,2.742,.504,.102,.032,.021]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[1.731,2.334,5.125,13.626,29.911,38.524,24.168,7.646,1.575,.317,.097,.063]},{name:`_`,color:`#CACACA`,values:[.25,.367,1.026,3.944,13.635,28.891,30.149,15.419,4.714,1.246,.442,.299]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[.034,.054,.194,1.065,5.747,20.735,38.306,32.899,15.318,5.566,2.422,1.76]},{name:`_`,color:`#CACACA`,values:[.001,.002,.009,.095,1.124,8.342,27.115,35.08,21.449,9.093,4.243,3.143]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[0,.001,.004,.051,.567,3.322,14.215,44.783,40.351,20.377,9.866,7.378]},{name:`_`,color:`#CACACA`,values:[0,0,0,0,.001,.11,4.136,27.498,43.24,29.807,17.345,13.678]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[0,0,0,0,.025,.598,3.886,10.645,54.479,45.953,30.814,24.55]},{name:`_`,color:`#CACACA`,values:[0,0,0,0,0,0,.007,1.655,26.63,52.017,45.192,39.651]}]}],skeletonConfig:me({defaultConfig:M.value,userConfig:tn.value})}),V=v(Math.min(P.value.height,P.value.rowHeight)),{userOptionsVisible:an,setUserOptionsVisibility:on,keepUserOptionState:sn}=Ne({config:M.value}),{svgRef:H}=Pe({config:R.value.title}),cn=u(()=>M.value.debug);function ln(){let e=B.value||[];if(!Array.isArray(e)||e.length===0)fe({componentName:`VueUiRidgeline`,type:`dataset`,debug:cn.value}),rn.value=!0;else if(e.forEach((e,t)=>{xe({datasetObject:e,requiredAttributes:[`name`,`datapoints`]}).forEach(e=>{It.value=!1,fe({componentName:`VueUiRidgeline`,type:`datasetSerieAttribute`,property:e,index:t,debug:cn.value})}),Array.isArray(e.datapoints)&&e.datapoints.length&&e.datapoints.forEach((e,n)=>{xe({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{It.value=!1,fe({componentName:`VueUiRidgeline`,type:`datasetSerieAttribute`,property:`datapoint.${e}`,index:`${t}-${n}`,debug:cn.value})})})}),Kt.value=e.length,V.value=Math.min(P.value.height,P.value.rowHeight),Se(w.dataset)||(rn.value=M.value.loading),M.value.responsive){let t=Ce(()=>{let{width:t,height:n}=Ae({chart:T.value,title:R.value.title.text?Rt.value:null,legend:R.value.legend.show?zt.value:null,source:Bt.value,noTitle:Vt.value,padding:R.value.padding});requestAnimationFrame(()=>{qt.value=t,V.value=e.length?n/e.length:0,Yt.value=n-12})});E.value&&(D.value&&E.value.unobserve(D.value),E.value.disconnect()),E.value=new ResizeObserver(t),D.value=T.value?.parentNode||null,D.value&&E.value.observe(D.value)}}Qe(()=>{E.value&&(D.value&&E.value.unobserve(D.value),E.value.disconnect())});let{isPrinting:un,isImaging:dn,generatePdf:fn,generateImage:pn}=ke({elementId:`vue-ui-ridgeline_${O.value}`,fileName:R.value.title.text||`vue-ui-ridgeline`,options:M.value.userOptions.print}),mn=u(()=>M.value.userOptions.show&&!R.value.title.text),hn=u(()=>ye(M.value.customPalette)),U=v({showTable:M.value.table.show});nt(()=>B.value,async e=>{Array.isArray(e)&&e.length&&(an.value=!M.value.userOptions.showOnChartHover,await Ye(),ln(),Ht.value+=1,Wt.value+=1,U.value.showTable=M.value.table.show)},{deep:!0,immediate:!0}),nt(()=>w.dataset,e=>{Array.isArray(e)&&e.length>0&&(rn.value=!1)},{deep:!0}),nt(()=>nn.value,async e=>{e||(await Ye(),ln())},{immediate:!0}),nt(()=>w.config,()=>{M.value=en(B.value||null),an.value=!M.value.userOptions.showOnChartHover,V.value=Math.min(P.value.height,P.value.rowHeight),U.value.showTable=M.value.table.show,Ht.value+=1,Wt.value+=1},{deep:!0});let gn=u(()=>P.value.height/P.value.rowHeight);function _n(){X.value.length?X.value=[]:Z.value.forEach(e=>{X.value.push(e.id)}),Lt(`selectLegend`,Y.value)}function vn(e){X.value.includes(e)?X.value=X.value.filter(t=>t!==e):X.value.push(e),Lt(`selectLegend`,Y.value)}function yn(e){return Z.value.length?Z.value.find(t=>t.name===e)||(cn.value&&console.warn(`VueUiRidgeline - Series name not found "${e}"`),null):(cn.value&&console.warn(`VueUiRidgeline - There are no series to show.`),null)}function bn(e){let t=yn(e);t!==null&&X.value.includes(t.id)&&vn(t.id)}function xn(e){let t=yn(e);t!==null&&(X.value.includes(t.id)||vn(t.id))}let W=u(()=>It.value?(B.value||[]).map(e=>({...e,labelLen:Fn(e.name,L.value.fontSize),uid:ue(),datapoints:e.datapoints.map((e,t)=>{let n=e.color?ce(e.color):hn.value[t]||ie[t]||ie[t%ie.length],r=de(e.name);return{...e,color:n,id:r}})})):[]),Sn=u(()=>R.value.padding.top+V.value*(B.value||[]).length+V.value*gn.value+R.value.padding.bottom),G=u(()=>{let e=R.value.padding;return{width:qt.value,height:Sn.value,padding:e}}),Cn=u(()=>G.value.width),wn=u(()=>G.value.height),Tn=v(0),En=Ce(e=>{Tn.value=e},100);rt(e=>{let t=Xt.value;if(!t)return;let n=new ResizeObserver(e=>{En(e[0].contentRect.height)});n.observe(t),e(()=>n.disconnect())}),Qe(()=>{Tn.value=0});let K=u(()=>({fullHeight:G.value.height+Tn.value,top:G.value.padding.top,left:G.value.padding.left,right:G.value.width-G.value.padding.right,bottom:G.value.height-R.value.padding.bottom,width:G.value.width-(G.value.padding.left+G.value.padding.right)})),Dn=u(()=>Math.max(...W.value.flatMap(e=>e.datapoints.map(e=>e.values.length)))),q=v([]),On=0;rt(()=>{let e=++On;(async()=>{let t=await je({values:I.value.values,maxDatapoints:Dn.value,formatter:I.value.datetimeFormatter,start:0,end:I.value.values.length});e===On&&(q.value=t)})()});let J=u(()=>{let e=Math.max(...W.value.map(e=>e.labelLen)),t=G.value.padding.left+e+16+L.value.offsetX,n=(K.value.width-t)/Dn.value,r=[];for(let e=0;e<Dn.value;e+=1)r.push({selectorX:t+n*e,x:t+n*e-n/2,y:K.value.top,label:I.value.values[e]?q.value[e]?.text??``:``,index:e,width:n,height:Sn.value});return r});function kn(e){return W.value.map(t=>t.datapoints.map(t=>({dp:t,selected:t.values[e.index]})))}function An(e){k.value=e;let t=kn(e);M.value.events.datapointEnter&&M.value.events.datapointEnter({datapoint:t,seriesIndex:e.index})}function jn(e){k.value=null;let t=kn(e);M.value.events.datapointLeave&&M.value.events.datapointLeave({datapoint:t,seriesIndex:e.index})}function Mn(e){let t=kn(e);M.value.events.datapointClick&&M.value.events.datapointClick({datapoint:t,seriesIndex:e.index}),Lt(`selectX`,t)}function Nn(e,t){return e.length*t/2+t}function Pn(e,t,n){return e+Nn(t,n)>K.value.right}function Fn(e,t,n=`sans-serif`){let r=document.createElement(`canvas`).getContext(`2d`);return r.font=`${typeof t==`number`?`${t}px`:t} ${n}`,r.measureText(e).width}let Y=u(()=>{V.value;let e=Math.max(...W.value.map(e=>e.labelLen)),t=Math.max(...W.value.flatMap(e=>e.datapoints.flatMap(e=>e.values))),n=Math.min(...W.value.flatMap(e=>e.datapoints.flatMap(e=>e.values))),r=G.value.padding.left+e+16+L.value.offsetX,ee=(K.value.width-r)/Dn.value,i=Math.abs(Math.min(n,0)),a=t+i;function o(e){return isNaN(e/a)?0:e/a}return W.value.map((e,t)=>{let n=V.value*gn.value*(1-o(i)),a=K.value.top+V.value*t,s=K.value.top+a+n;return{...e,label:{x:r-L.value.fontSize,y:(L.value.centered?s-n/2:s)+L.value.offsetY},datapoints:e.datapoints.map(e=>{let t=e.values.map((t,n)=>{let te=isNaN(t)||[void 0,null,`NaN`,NaN,1/0,-1/0].includes(t)?0:t||0;return{x:r+ee*n,y:K.value.top+a+V.value*gn.value*(1-o(te+i)),value:t,isMaxPoint:t===Math.max(...e.values),zero:s}}),n=`${oe(t,s,!1,!1)}`,te=`M ${r},${s} ${le(t)} ${t.at(-1).x},${s}`,ne=`M ${r},${s} ${t.at(-1).x},${s}`,c=`M ${se(t)}`,re=`M ${le(t)}`,ie=be(P.value.smooth?c:re);return{...e,uid:ue(),plots:t,smoothPath:n,straightPath:te,zeroPath:ne,pathLength:ie,smoothPathRidge:c,straightPathRidge:re}}).filter(e=>!X.value.includes(e.id))}})}),X=v([]);function In(e){let t=/* @__PURE__ */ new Map;return e.forEach(e=>{e.datapoints.forEach((e,n)=>{let r=de(e.name);t.has(r)||t.set(r,{id:r,name:e.name,color:e.color,shape:`circle`,segregate:()=>vn(r),isSegregated:X.value.includes(r),opacity:X.value.includes(r)?.5:1})})}),Array.from(t.values())}let Z=u(()=>In(W.value)),Ln=u(()=>({cy:`donut-div-legend`,backgroundColor:R.value.legend.backgroundColor,color:R.value.legend.color,fontSize:R.value.legend.fontSize,paddingBottom:12,fontWeight:R.value.legend.bold?`bold`:``})),Q=v(!1);function Rn(e){Q.value=e,Gt.value+=1}let zn=v({}),Bn=v([]);function Vn(e){Lt(`selectDatapoint`,e),R.value.dialog.show&&(Bn.value=e.datapoints.map(e=>({name:e.name,color:e.color,type:`line`,useArea:!0,smooth:P.value.smooth,series:e.values})),A.value=e,zn.value=ve({...R.value.dialog.xyChart,responsive:!0,chart:{...R.value.dialog.xyChart.chart,grid:{...R.value.dialog.xyChart.chart.grid,labels:{...R.value.dialog.xyChart.chart.grid.labels,xAxisLabels:{...R.value.dialog.xyChart.chart.grid.labels.xAxisLabels,values:I.value.values,autoRotate:{enable:!0,angle:R.value.dialog.xyChart.chart.grid.labels.xAxisLabels.autoRotate.angle},datetimeFormatter:I.value.datetimeFormatter}}},tooltip:{...R.value.dialog.xyChart.chart.tooltip,showTimeLabel:I.value.values.length>0},userOptions:{...R.value.dialog.xyChart.chart.userOptions,buttons:{...R.value.dialog.xyChart.chart.userOptions.buttons,altCopy:M.value.userOptions.buttons.altCopy},callbacks:{...R.value.dialog.xyChart.chart.userOptions.callbacks,altCopy:()=>{}},useCursorPointer:M.value.userOptions.useCursorPointer}}}),Jt.value&&Jt.value.open())}let Hn=v(null);function Un(e){Hn.value=e}function Wn(){Hn.value=null}let Gn=v(!1);function Kn(){Gn.value=!Gn.value}function qn(){U.value.showTable=!U.value.showTable}let Jn=u(()=>({body:Y.value.flatMap(e=>e.datapoints.flatMap(t=>({...t,rowName:`${e.name}: ${t.name}`}))).map(e=>[{name:e.rowName,color:e.color},...e.values])})),$=u(()=>{let e=[M.value.table.columnNames.series,...q.value.map(e=>e.text)],t={th:{backgroundColor:M.value.table.th.backgroundColor,color:M.value.table.th.color,outline:M.value.table.th.outline},td:{backgroundColor:M.value.table.td.backgroundColor,color:M.value.table.td.color,outline:M.value.table.td.outline},breakpoint:M.value.table.responsiveBreakpoint};return{colNames:[M.value.table.columnNames.series,...q.value.map(e=>e.text)],head:e,body:Jn.value.body,config:t}});function Yn(e=null){Ye(()=>{let t=[[M.value.table.columnNames.series,...q.map(e=>[e.text])],...Jn.value.body.map((e,t)=>[e[0].name,...e.slice(1)])],n=[[R.value.title.text],[R.value.title.subtitle.text]].concat(t),r=re(n);e?e(r):he({csvContent:r,title:R.value.title.text||`vue-ui-ridgeline`})})}function Xn(){return Y.value}let Zn=te(T,()=>R.value.title.text),Qn=u(()=>({min:0,max:Dn.value}));Fe({timeLabelsEls:Xt,timeLabels:q,slicer:Qn,configRef:M,rotationPath:[`style`,`chart`,`xAxis`,`labels`,`rotation`],autoRotatePath:[`style`,`chart`,`xAxis`,`labels`,`autoRotate`,`enable`],isAutoSize:!1,width:Cn,height:wn,targetClass:`.vue-ui-ridgeline-x-axis-label`,angle:I.value.autoRotate.angle});let $n=u(()=>s({config:M,style:R,mutableConfig:U,dialog:Pt,accordion:kt,isFullscreen:Q,parent:T,maxWidth:800,isCursorPointer:z}));nt(()=>U.value.showTable,e=>o(e,M,Zt));function er(){U.value.showTable=!1,Qt.value&&Qt.value.setTableIconState(!1)}let tr=u(()=>R.value.backgroundColor),nr=u(()=>({...R.value.legend,position:`bottom`})),rr=u(()=>R.value.title),{isCallbackImaging:ir,isCallbackSvg:ar,generateSvg:or,onGenerateImage:sr}=Me({svg:H,title:rr,legend:nr,legendItems:Z,backgroundColor:tr,getSvgCallback:()=>M.value.userOptions.callbacks.svg,generateImage:pn});function cr(e){lr(`xy-zoom`,e.dataset,e.config)}async function lr(e=`main-chart`,t=null,n=null){Lt(`copyAlt`,{source:e,config:e===`main-chart`?M.value:zn.value,dataset:e===`main-chart`?Y.value:Bn.value}),M.value.userOptions.callbacks.altCopy?await Promise.resolve(M.value.userOptions.callbacks.altCopy({source:e,config:e===`main-chart`?M.value:zn.value,dataset:e===`main-chart`?Y.value:Bn.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function ur(){j.value=null,$t.value=!0}function dr(){hr(),$t.value=!1}function fr(e){if(!H.value||Gn.value||document.activeElement!==H.value||!Y.value.length)return;let t=e.key===`ArrowUp`,n=e.key===`ArrowDown`,r=e.key===`ArrowLeft`,ee=e.key===`ArrowRight`,i=e.key===`Enter`||e.key===` `,a=e.key===`Escape`;if(!t&&!n&&!r&&!ee&&!i&&!a)return;if(e.preventDefault(),e.stopPropagation(),a){hr();return}if(i){if(j.value!==null){let e=Y.value[j.value];e&&Vn(e);return}k.value&&Mn(k.value);return}if(t||n){let e=j.value;e=e===null?n?0:Y.value.length-1:pr(e+(n?1:-1)),j.value=e,Hn.value=e;return}if(!J.value.length)return;let o=k.value?.index??null;o=o===null?ee?0:J.value.length-1:mr(o+(ee?1:-1));let s=J.value[o];s&&An(s)}function pr(e){let t=Y.value.length;return t?(e%t+t)%t:null}function mr(e){let t=J.value.length;return t?(e%t+t)%t:null}function hr(){j.value=null,Hn.value=null,k.value?jn(k.value):k.value=null}let gr=u(()=>({head:$.value.head,body:$.value.body.map(e=>[e[0]?.name??``,...e.slice(1)]),caption:M.value.a11y.translations.tableCaption,notice:M.value.a11y.translations.tableAvailable}));return Ue({getData:Xn,getImage:Zn,generateImage:pn,generateSvg:or,generatePdf:fn,generateCsv:Yn,hideSeries:xn,showSeries:bn,toggleAnnotator:Kn,toggleTable:qn,toggleFullscreen:Rn,copyAlt:lr}),(e,o)=>(_(),p(`div`,{ref_key:`ridgelineChart`,ref:T,class:Xe(`vue-data-ui-component vue-ui-ridgeline ${Q.value?`vue-data-ui-wrapper-fullscreen`:``}`),id:`vue-ui-ridgeline_${O.value}`,style:g({fontFamily:M.value.style.fontFamily,width:`100%`,textAlign:`center`,background:R.value.backgroundColor,height:M.value.responsive?`100%`:void 0}),onMouseenter:o[3]||=()=>S(on)(!0),onMouseleave:o[4]||=()=>S(on)(!1)},[m(`div`,{id:`chart-instructions-${O.value}`,class:`sr-only`},[m(`p`,null,x(M.value.a11y.translations.keyboardNavigation),1)],8,ot),gr.value.body.length?(_(),d(Be,{key:0,uid:O.value,head:gr.value.head,body:gr.value.body,caption:gr.value.caption,notice:gr.value.notice},null,8,[`uid`,`head`,`body`,`caption`,`notice`])):f(``,!0),N.value.buttons.annotator&&S(H)?(_(),d(S(jt),Je({key:1},S(i)(N.value.annotator),{color:R.value.color,backgroundColor:R.value.backgroundColor,active:Gn.value,svgRef:S(H),isCursorPointer:z.value,onClose:Kn}),We({_:2},[y(S(a),t=>({name:t,fn:C(n=>[b(e.$slots,t,Ze(qe(S(ee)(t,n))),void 0,!0)])}))]),1040,[`color`,`backgroundColor`,`active`,`svgRef`,`isCursorPointer`])):f(``,!0),b(e.$slots,`userConfig`,{},void 0,!0),mn.value?(_(),p(`div`,{key:2,ref_key:`noTitle`,ref:Vt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):f(``,!0),R.value.title.text?(_(),p(`div`,{key:3,ref_key:`chartTitle`,ref:Rt,style:`width:100%;background:transparent;padding-bottom:24px`},[(_(),d(Re,{key:`title_${Ht.value}`,config:{title:{cy:`ridgeline-div-title`,...R.value.title},subtitle:{cy:`ridgeline-div-subtitle`,...R.value.title.subtitle}}},null,8,[`config`]))],512)):f(``,!0),N.value.show&&It.value&&(S(sn)||S(an))?(_(),d(S(Mt),Je({ref_key:`userOptionsRef`,ref:Qt,key:`user_option_${Gt.value}`,backgroundColor:R.value.backgroundColor,color:R.value.color,isPrinting:S(un),isImaging:S(dn),uid:O.value,hasTooltip:!1,hasLabel:!1,isFullscreen:Q.value,chartElement:T.value},S(n)(N.value,`pdf csv img svg table fullscreen altCopy annotator`),{isTooltip:!1,isAnnotation:Gn.value,tableDialog:M.value.table.useDialog,style:{visibility:S(sn)?S(an)?`visible`:`hidden`:`visible`},isCursorPointer:z.value,onToggleFullscreen:Rn,onGeneratePdf:S(fn),onGenerateCsv:Yn,onGenerateImage:S(sr),onGenerateSvg:S(or),onToggleTable:qn,onToggleAnnotator:Kn,onCopyAlt:lr}),We({_:2},[y(S(t)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:C(n=>[b(e.$slots,t,Ze(qe(S(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`isFullscreen`,`chartElement`,`isAnnotation`,`tableDialog`,`style`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`])):f(``,!0),m(`div`,st,[(_(),p(`svg`,{ref_key:`svgRef`,ref:H,xmlns:S(_e),"aria-describedby":`chart-instructions-${O.value}`,class:Xe({"vue-data-ui-fullscreen--on":Q.value,"vue-data-ui-fulscreen--off":!Q.value}),viewBox:`0 0 ${G.value.width<=0?10:G.value.width} ${K.value.fullHeight<=0?10:K.value.fullHeight}`,style:g(`max-width:100%;overflow:visible;background:transparent;color:${R.value.color};${M.value.responsive?`height: ${Yt.value}px; width: 100%;`:``}`),tabindex:`0`,onFocus:ur,onBlur:dr,onKeydown:fr},[Ke(S(Nt)),b(e.$slots,`svg-underlayer`,{svg:{...G.value,drawingArea:K.value,isPrintingImg:S(un)||S(dn)||S(ir),isPrintingSvg:S(ar),data:Y.value}},void 0,!0),m(`defs`,null,[(_(!0),p(l,null,y(Z.value,(e,t)=>(_(),d(He,{t:`linear`,id:`gradient-${e.id}-${O.value}`,key:`gradient-${e.id}-${O.value}`,x1:`50%`,y1:`0%`,x2:`50%`,y2:`100%`,stops:[[`0%`,e.color,1],[`30%`,e.color,.7],[`70%`,e.color,.3],[`100%`,e.color,.1]]},null,8,[`id`,`stops`]))),128)),(_(!0),p(l,null,y(Y.value,(e,t)=>(_(),p(l,null,[(_(!0),p(l,null,y(e.datapoints,(e,t)=>(_(),d(He,{t:`linear`,key:`grad${e.id}`,id:`gradient-single-${O.value}-${e.uid}`,x1:`50%`,y1:`0%`,x2:`50%`,y2:`100%`,stops:[[`0%`,e.color,1],[`30%`,e.color,.7],[`70%`,e.color,.3],[`100%`,e.color,.1]]},null,8,[`id`,`stops`]))),128))],64))),256))]),(_(!0),p(l,null,y(Y.value,(t,n)=>(_(),p(`g`,{key:`ds-${n}`},[(_(!0),p(l,null,y(t.datapoints,(t,r)=>(_(),p(`g`,{key:t.id},[e.$slots.pattern?(_(),p(`g`,lt,[m(`defs`,null,[b(e.$slots,`pattern`,Je({ref_for:!0},{datapointIndex:n,seriesIndex:r,patternId:`pattern_${O.value}_${t.uid}`}),void 0,!0)])])):f(``,!0),m(`path`,{fill:e.$slots.pattern?`url(#pattern_${O.value}_${t.uid})`:R.value.backgroundColor,stroke:`none`,"stroke-linecap":`round`,d:P.value.smooth?t.smoothPath:t.straightPath,style:g({opacity:P.value.opacity})},null,12,ut),m(`path`,{fill:`none`,stroke:P.value.stroke.useSerieColor?t.color:P.value.stroke.color,"stroke-width":P.value.strokeWidth,d:P.value.smooth?t.smoothPathRidge:t.straightPathRidge,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:g({strokeDasharray:t.pathLength,strokeDashoffset:M.value.useCssAnimation?t.pathLength:0})},null,12,dt),m(`path`,{fill:P.value.useGradient?P.value.useCommonColor?`url(#gradient-${t.id}-${O.value})`:`url(#gradient-single-${O.value}-${t.uid})`:t.color,stroke:`none`,d:P.value.smooth?t.smoothPath:t.straightPath,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:g({strokeDasharray:t.pathLength,strokeDashoffset:M.value.useCssAnimation?t.pathLength:0})},null,12,ft),R.value.zeroLine.show?(_(),p(`path`,{key:1,stroke:R.value.zeroLine.useSerieColor?t.color:R.value.zeroLine.stroke,"stroke-dasharray":R.value.zeroLine.strokeDasharray,"stroke-width":R.value.zeroLine.strokeWidth,d:t.zeroPath,"stroke-linecap":`round`},null,8,pt)):f(``,!0),P.value.maxPoint.show&&t.plots.length>1?(_(!0),p(l,{key:2},y(t.plots,e=>(_(),p(l,null,[e.isMaxPoint?(_(),p(`line`,{key:0,x1:e.x,y1:e.y,x2:e.x,y2:e.zero,stroke:P.value.maxPoint.adaptStrokeToBackground?S(ge)(t.color):P.value.maxPoint.stroke,"stroke-width":P.value.maxPoint.strokeWidth,"stroke-linecap":`round`,"stroke-dasharray":P.value.maxPoint.strokeDasharray},null,8,mt)):f(``,!0)],64))),256)):f(``,!0),t.plots.length===1?(_(),p(`circle`,{key:3,cx:t.plots[0].x,cy:t.plots[0].y,stroke:F.value.dot.stroke,"stroke-width":F.value.dot.strokeWidth,r:F.value.dot.radius,fill:F.value.dot.useDatapointColor?t.color:F.value.dot.fill,style:{pointerEvents:`none`}},null,8,ht)):f(``,!0)]))),128)),m(`text`,{x:t.label.x,y:t.label.y,"text-anchor":`end`,"font-size":L.value.fontSize,"font-weight":L.value.bold?`bold`:`normal`,fill:L.value.color,style:g({cursor:R.value.dialog.show&&z.value?`pointer`:`default`}),"text-decoration":R.value.dialog.show&&(Hn.value===n||A.value&&t.uid===A.value.uid||j.value===n)?`underline`:``,"dominant-baseline":`middle`,onMouseenter:e=>Un(n),onMouseleave:Wn,onClick:e=>Vn(t)},x(t.name),45,gt)]))),128)),I.value.values.length?(_(),p(`g`,{key:0,ref_key:`timeLabelsEls`,ref:Xt},[(_(!0),p(l,null,y(J.value,(t,n)=>b(e.$slots,`time-label`,Je({ref_for:!0},{show:t&&!I.value.showOnlyFirstAndLast&&!I.value.showOnlyAtModulo||t&&I.value.showOnlyFirstAndLast&&(n===0||n===J.value.length-1)||t&&k.value&&k.value.index===n||t&&!I.value.showOnlyFirstAndLast&&I.value.showOnlyAtModulo&&n%Math.max(1,Math.floor(Number(R.value.xAxis.labels.modulo)||1))===0,fontSize:I.value.fontSize,content:t.label,textAnchor:I.value.rotation>0?`start`:I.value.rotation<0?`end`:`middle`,fill:I.value.color,transform:`translate(${t.selectorX}, ${K.value.top+t.height+I.value.offsetY}), rotate(${I.value.rotation})`,x:t.selectorX,y:K.value.bottom+I.value.offsetY}),()=>[t&&!I.value.showOnlyFirstAndLast&&!I.value.showOnlyAtModulo||t&&I.value.showOnlyFirstAndLast&&(n===0||n===J.value.length-1)||t&&k.value&&k.value.index===n||t&&!I.value.showOnlyFirstAndLast&&I.value.showOnlyAtModulo&&n%Math.max(1,Math.floor(Number(R.value.xAxis.labels.modulo)||1))===0?(_(),p(`g`,_t,[String(t.label).includes(`
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as ee,r as i,t as a}from"./annotationSlots-OLiW25XN.js";import{n as o,t as s}from"./tableIntegration-CNoJ1CIY.js";import{t as te}from"./chartImage-DPGnEuYM.js";import{n as ne}from"./resolveChartConfig-0IvbmIE_.js";import{$ as c,D as re,Ht as ie,J as ae,N as oe,P as se,S as ce,U as le,X as ue,Xt as de,at as fe,i as pe,in as me,nt as he,r as ge,t as _e,tt as ve,w as ye,xt as be,yt as xe,zt as Se}from"./lib-rPeBMZrn.js";import{c as Ce}from"./canvas-lib-22VpOI4_.js";import{n as we,t as Te}from"./useHints-C-TwxM0Y.js";import{t as Ee}from"./useConfig-_JwRfIqE.js";import{n as De,t as Oe}from"./BaseScanner-8NdoBs7B.js";import{t as ke}from"./usePrinter-DVf3YcG5.js";import{t as Ae}from"./useResponsive-CENUxfEL.js";import{t as je}from"./useTimeLabels-Das5O74F.js";import{t as Me}from"./useChartExport-BZts4KFb.js";import{t as Ne}from"./useUserOptionState-CXlFnwPv.js";import{t as Pe}from"./useChartAccessibility-DOMuYJfm.js";import{t as Fe}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Ie}from"./vue_ui_ridgeline-BIaWjw_v.js";import{t as Le}from"./Legend-W9YVYVX-.js";import{n as Re}from"./Title-BliHuXfT.js";import{t as ze}from"./Shape-CRe8woTu.js";import{t as Be}from"./A11yDataTable-DWNlWXzs.js";import{t as Ve}from"./BaseLegendToggle-VzX69MCo.js";import{t as He}from"./DefGrad-DKMq1REY.js";import{t as Ue}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as l,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createSlots as We,createTextVNode as Ge,createVNode as Ke,defineAsyncComponent as h,guardReactiveProps as qe,mergeProps as Je,nextTick as Ye,normalizeClass as Xe,normalizeProps as Ze,normalizeStyle as g,onBeforeUnmount as Qe,openBlock as _,ref as v,renderList as y,renderSlot as b,resolveDynamicComponent as $e,shallowRef as et,toDisplayString as x,toRefs as tt,unref as S,watch as nt,watchEffect as rt,withCtx as C}from"vue";var it=/* @__PURE__ */ e({default:()=>Dt}),at=[`id`],ot=[`id`],st={style:{position:`relative`}},ct=[`xmlns`,`aria-describedby`,`viewBox`],lt={key:0},ut=[`fill`,`d`],dt=[`stroke`,`stroke-width`,`d`],ft=[`fill`,`d`],pt=[`stroke`,`stroke-dasharray`,`stroke-width`,`d`],mt=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],ht=[`cx`,`cy`,`stroke`,`stroke-width`,`r`,`fill`],gt=[`x`,`y`,`font-size`,`font-weight`,`fill`,`text-decoration`,`onMouseenter`,`onClick`],_t={key:0},vt=[`font-size`,`fill`,`stroke`,`font-weight`,`transform`,`text-anchor`],yt=[`font-size`,`fill`,`font-weight`,`transform`,`text-anchor`,`innerHTML`],bt=[`x`,`y`,`width`,`height`,`onMouseenter`,`onMouseleave`,`onClick`],xt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],St=[`cx`,`cy`,`stroke`,`stroke-width`,`r`,`fill`],Ct=[`x`,`y`,`stroke`,`text-anchor`,`font-size`,`fill`],wt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Tt={key:5,class:`vue-data-ui-watermark`},Et=[`onClick`],Dt=/*#__PURE__*/ Ue({__name:`vue-ui-ridgeline`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`selectX`,`copyAlt`],setup(e,{expose:Ue,emit:it}){let Dt=h(()=>import(`./vue-ui-xy-2VCMSzeE.js`).then(e=>e.n)),Ot=h(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),kt=h(()=>import(`./vue-ui-accordion-DxGxf-Rm.js`).then(e=>e.n)),At=h(()=>import(`./DataTable-KeuZB1JM.js`)),jt=h(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Mt=h(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Nt=h(()=>import(`./PackageVersion-PdpqwkYX.js`).then(e=>e.t)),Pt=h(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_ridgeline:Ft}=Ee(),w=e,It=u({get(){return Array.isArray(B.value)&&B.value.length>0},set(e){return e}}),Lt=it,T=v(null),Rt=v(null),zt=v(null),E=et(null),D=et(null),Bt=v(null),Vt=v(null),Ht=v(0),Ut=v(0),Wt=v(0),O=v(ue()),Gt=v(0),Kt=v(0),qt=v(512),k=v(null),A=v(null),Jt=v(null),Yt=v(0),Xt=v(null),Zt=v(null),Qt=v(null),j=v(null),$t=v(!1);function en(){return ne(w.config,Ft,Ie)}let M=v(en()),N=u(()=>M.value.userOptions),P=u(()=>M.value.style.chart.areas),F=u(()=>M.value.style.chart.selector),I=u(()=>M.value.style.chart.xAxis.labels),L=u(()=>M.value.style.chart.yAxis.labels),R=u(()=>M.value.style.chart);we({config:()=>M.value,dataset:()=>w.dataset,component:`VueUiRidgeline`,rules:[Te.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.some(e=>e.datapoints.some(e=>e.values.length>200)),message:[`👀 Some series contain > 200 data points, which can affect performance. Consider if you really need this level of detail.`,``,`▶️ Use larger time scales, or aggregated values.`,``,`▶️ Filter the time range by adding date inputs in your UI.`]},{test:e=>e.length<6&&e.length>0,message:[`👀 The number of series < 6. Consider:`,``,`▶️ Using VueUiXy instead`]}]});let z=u(()=>M.value.userOptions.useCursorPointer),tn=u(()=>me({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,areas:{maxPoint:{show:!1},opacity:.9,stroke:{useSerieColor:!0}},legend:{backgroundColor:`transparent`},padding:{right:-24,left:0},xAxis:{labels:{values:[]}},yAxis:{labels:{fontSize:0}},zeroLine:{show:!1}}}},userConfig:M.value.skeletonConfig??{}})),{loading:nn,FINAL_DATASET:B,manualLoading:rn}=De({...tt(w),FINAL_CONFIG:M,prepareConfig:en,skeletonDataset:w.config?.skeletonDataset??[{name:`_`,datapoints:[{name:`__`,color:`#999999`,values:[28.639,32.04,41.134,44.525,21.151,2.436,.218,.024,.002,0,0,0]},{name:`_`,color:`#CACACA`,values:[13.253,15.621,23.36,33.698,29.935,10.874,2.364,.561,.107,.02,.006,.004]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[10.851,13.195,21.617,36.556,42.292,21.006,3.398,.223,.013,.001,0,0]},{name:`_`,color:`#CACACA`,values:[3.171,4.115,8.108,18.248,31.641,29.063,12.031,2.742,.504,.102,.032,.021]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[1.731,2.334,5.125,13.626,29.911,38.524,24.168,7.646,1.575,.317,.097,.063]},{name:`_`,color:`#CACACA`,values:[.25,.367,1.026,3.944,13.635,28.891,30.149,15.419,4.714,1.246,.442,.299]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[.034,.054,.194,1.065,5.747,20.735,38.306,32.899,15.318,5.566,2.422,1.76]},{name:`_`,color:`#CACACA`,values:[.001,.002,.009,.095,1.124,8.342,27.115,35.08,21.449,9.093,4.243,3.143]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[0,.001,.004,.051,.567,3.322,14.215,44.783,40.351,20.377,9.866,7.378]},{name:`_`,color:`#CACACA`,values:[0,0,0,0,.001,.11,4.136,27.498,43.24,29.807,17.345,13.678]}]},{name:`_`,datapoints:[{name:`_`,color:`#999999`,values:[0,0,0,0,.025,.598,3.886,10.645,54.479,45.953,30.814,24.55]},{name:`_`,color:`#CACACA`,values:[0,0,0,0,0,0,.007,1.655,26.63,52.017,45.192,39.651]}]}],skeletonConfig:me({defaultConfig:M.value,userConfig:tn.value})}),V=v(Math.min(P.value.height,P.value.rowHeight)),{userOptionsVisible:an,setUserOptionsVisibility:on,keepUserOptionState:sn}=Ne({config:M.value}),{svgRef:H}=Pe({config:R.value.title}),cn=u(()=>M.value.debug);function ln(){let e=B.value||[];if(!Array.isArray(e)||e.length===0)fe({componentName:`VueUiRidgeline`,type:`dataset`,debug:cn.value}),rn.value=!0;else if(e.forEach((e,t)=>{xe({datasetObject:e,requiredAttributes:[`name`,`datapoints`]}).forEach(e=>{It.value=!1,fe({componentName:`VueUiRidgeline`,type:`datasetSerieAttribute`,property:e,index:t,debug:cn.value})}),Array.isArray(e.datapoints)&&e.datapoints.length&&e.datapoints.forEach((e,n)=>{xe({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{It.value=!1,fe({componentName:`VueUiRidgeline`,type:`datasetSerieAttribute`,property:`datapoint.${e}`,index:`${t}-${n}`,debug:cn.value})})})}),Kt.value=e.length,V.value=Math.min(P.value.height,P.value.rowHeight),Se(w.dataset)||(rn.value=M.value.loading),M.value.responsive){let t=Ce(()=>{let{width:t,height:n}=Ae({chart:T.value,title:R.value.title.text?Rt.value:null,legend:R.value.legend.show?zt.value:null,source:Bt.value,noTitle:Vt.value,padding:R.value.padding});requestAnimationFrame(()=>{qt.value=t,V.value=e.length?n/e.length:0,Yt.value=n-12})});E.value&&(D.value&&E.value.unobserve(D.value),E.value.disconnect()),E.value=new ResizeObserver(t),D.value=T.value?.parentNode||null,D.value&&E.value.observe(D.value)}}Qe(()=>{E.value&&(D.value&&E.value.unobserve(D.value),E.value.disconnect())});let{isPrinting:un,isImaging:dn,generatePdf:fn,generateImage:pn}=ke({elementId:`vue-ui-ridgeline_${O.value}`,fileName:R.value.title.text||`vue-ui-ridgeline`,options:M.value.userOptions.print}),mn=u(()=>M.value.userOptions.show&&!R.value.title.text),hn=u(()=>ye(M.value.customPalette)),U=v({showTable:M.value.table.show});nt(()=>B.value,async e=>{Array.isArray(e)&&e.length&&(an.value=!M.value.userOptions.showOnChartHover,await Ye(),ln(),Ht.value+=1,Wt.value+=1,U.value.showTable=M.value.table.show)},{deep:!0,immediate:!0}),nt(()=>w.dataset,e=>{Array.isArray(e)&&e.length>0&&(rn.value=!1)},{deep:!0}),nt(()=>nn.value,async e=>{e||(await Ye(),ln())},{immediate:!0}),nt(()=>w.config,()=>{M.value=en(B.value||null),an.value=!M.value.userOptions.showOnChartHover,V.value=Math.min(P.value.height,P.value.rowHeight),U.value.showTable=M.value.table.show,Ht.value+=1,Wt.value+=1},{deep:!0});let gn=u(()=>P.value.height/P.value.rowHeight);function _n(){X.value.length?X.value=[]:Z.value.forEach(e=>{X.value.push(e.id)}),Lt(`selectLegend`,Y.value)}function vn(e){X.value.includes(e)?X.value=X.value.filter(t=>t!==e):X.value.push(e),Lt(`selectLegend`,Y.value)}function yn(e){return Z.value.length?Z.value.find(t=>t.name===e)||(cn.value&&console.warn(`VueUiRidgeline - Series name not found "${e}"`),null):(cn.value&&console.warn(`VueUiRidgeline - There are no series to show.`),null)}function bn(e){let t=yn(e);t!==null&&X.value.includes(t.id)&&vn(t.id)}function xn(e){let t=yn(e);t!==null&&(X.value.includes(t.id)||vn(t.id))}let W=u(()=>It.value?(B.value||[]).map(e=>({...e,labelLen:Fn(e.name,L.value.fontSize),uid:ue(),datapoints:e.datapoints.map((e,t)=>{let n=e.color?ce(e.color):hn.value[t]||ie[t]||ie[t%ie.length],r=de(e.name);return{...e,color:n,id:r}})})):[]),Sn=u(()=>R.value.padding.top+V.value*(B.value||[]).length+V.value*gn.value+R.value.padding.bottom),G=u(()=>{let e=R.value.padding;return{width:qt.value,height:Sn.value,padding:e}}),Cn=u(()=>G.value.width),wn=u(()=>G.value.height),Tn=v(0),En=Ce(e=>{Tn.value=e},100);rt(e=>{let t=Xt.value;if(!t)return;let n=new ResizeObserver(e=>{En(e[0].contentRect.height)});n.observe(t),e(()=>n.disconnect())}),Qe(()=>{Tn.value=0});let K=u(()=>({fullHeight:G.value.height+Tn.value,top:G.value.padding.top,left:G.value.padding.left,right:G.value.width-G.value.padding.right,bottom:G.value.height-R.value.padding.bottom,width:G.value.width-(G.value.padding.left+G.value.padding.right)})),Dn=u(()=>Math.max(...W.value.flatMap(e=>e.datapoints.map(e=>e.values.length)))),q=v([]),On=0;rt(()=>{let e=++On;(async()=>{let t=await je({values:I.value.values,maxDatapoints:Dn.value,formatter:I.value.datetimeFormatter,start:0,end:I.value.values.length});e===On&&(q.value=t)})()});let J=u(()=>{let e=Math.max(...W.value.map(e=>e.labelLen)),t=G.value.padding.left+e+16+L.value.offsetX,n=(K.value.width-t)/Dn.value,r=[];for(let e=0;e<Dn.value;e+=1)r.push({selectorX:t+n*e,x:t+n*e-n/2,y:K.value.top,label:I.value.values[e]?q.value[e]?.text??``:``,index:e,width:n,height:Sn.value});return r});function kn(e){return W.value.map(t=>t.datapoints.map(t=>({dp:t,selected:t.values[e.index]})))}function An(e){k.value=e;let t=kn(e);M.value.events.datapointEnter&&M.value.events.datapointEnter({datapoint:t,seriesIndex:e.index})}function jn(e){k.value=null;let t=kn(e);M.value.events.datapointLeave&&M.value.events.datapointLeave({datapoint:t,seriesIndex:e.index})}function Mn(e){let t=kn(e);M.value.events.datapointClick&&M.value.events.datapointClick({datapoint:t,seriesIndex:e.index}),Lt(`selectX`,t)}function Nn(e,t){return e.length*t/2+t}function Pn(e,t,n){return e+Nn(t,n)>K.value.right}function Fn(e,t,n=`sans-serif`){let r=document.createElement(`canvas`).getContext(`2d`);return r.font=`${typeof t==`number`?`${t}px`:t} ${n}`,r.measureText(e).width}let Y=u(()=>{V.value;let e=Math.max(...W.value.map(e=>e.labelLen)),t=Math.max(...W.value.flatMap(e=>e.datapoints.flatMap(e=>e.values))),n=Math.min(...W.value.flatMap(e=>e.datapoints.flatMap(e=>e.values))),r=G.value.padding.left+e+16+L.value.offsetX,ee=(K.value.width-r)/Dn.value,i=Math.abs(Math.min(n,0)),a=t+i;function o(e){return isNaN(e/a)?0:e/a}return W.value.map((e,t)=>{let n=V.value*gn.value*(1-o(i)),a=K.value.top+V.value*t,s=K.value.top+a+n;return{...e,label:{x:r-L.value.fontSize,y:(L.value.centered?s-n/2:s)+L.value.offsetY},datapoints:e.datapoints.map(e=>{let t=e.values.map((t,n)=>{let te=isNaN(t)||[void 0,null,`NaN`,NaN,1/0,-1/0].includes(t)?0:t||0;return{x:r+ee*n,y:K.value.top+a+V.value*gn.value*(1-o(te+i)),value:t,isMaxPoint:t===Math.max(...e.values),zero:s}}),n=`${oe(t,s,!1,!1)}`,te=`M ${r},${s} ${le(t)} ${t.at(-1).x},${s}`,ne=`M ${r},${s} ${t.at(-1).x},${s}`,c=`M ${se(t)}`,re=`M ${le(t)}`,ie=be(P.value.smooth?c:re);return{...e,uid:ue(),plots:t,smoothPath:n,straightPath:te,zeroPath:ne,pathLength:ie,smoothPathRidge:c,straightPathRidge:re}}).filter(e=>!X.value.includes(e.id))}})}),X=v([]);function In(e){let t=/* @__PURE__ */ new Map;return e.forEach(e=>{e.datapoints.forEach((e,n)=>{let r=de(e.name);t.has(r)||t.set(r,{id:r,name:e.name,color:e.color,shape:`circle`,segregate:()=>vn(r),isSegregated:X.value.includes(r),opacity:X.value.includes(r)?.5:1})})}),Array.from(t.values())}let Z=u(()=>In(W.value)),Ln=u(()=>({cy:`donut-div-legend`,backgroundColor:R.value.legend.backgroundColor,color:R.value.legend.color,fontSize:R.value.legend.fontSize,paddingBottom:12,fontWeight:R.value.legend.bold?`bold`:``})),Q=v(!1);function Rn(e){Q.value=e,Gt.value+=1}let zn=v({}),Bn=v([]);function Vn(e){Lt(`selectDatapoint`,e),R.value.dialog.show&&(Bn.value=e.datapoints.map(e=>({name:e.name,color:e.color,type:`line`,useArea:!0,smooth:P.value.smooth,series:e.values})),A.value=e,zn.value=ve({...R.value.dialog.xyChart,responsive:!0,chart:{...R.value.dialog.xyChart.chart,grid:{...R.value.dialog.xyChart.chart.grid,labels:{...R.value.dialog.xyChart.chart.grid.labels,xAxisLabels:{...R.value.dialog.xyChart.chart.grid.labels.xAxisLabels,values:I.value.values,autoRotate:{enable:!0,angle:R.value.dialog.xyChart.chart.grid.labels.xAxisLabels.autoRotate.angle},datetimeFormatter:I.value.datetimeFormatter}}},tooltip:{...R.value.dialog.xyChart.chart.tooltip,showTimeLabel:I.value.values.length>0},userOptions:{...R.value.dialog.xyChart.chart.userOptions,buttons:{...R.value.dialog.xyChart.chart.userOptions.buttons,altCopy:M.value.userOptions.buttons.altCopy},callbacks:{...R.value.dialog.xyChart.chart.userOptions.callbacks,altCopy:()=>{}},useCursorPointer:M.value.userOptions.useCursorPointer}}}),Jt.value&&Jt.value.open())}let Hn=v(null);function Un(e){Hn.value=e}function Wn(){Hn.value=null}let Gn=v(!1);function Kn(){Gn.value=!Gn.value}function qn(){U.value.showTable=!U.value.showTable}let Jn=u(()=>({body:Y.value.flatMap(e=>e.datapoints.flatMap(t=>({...t,rowName:`${e.name}: ${t.name}`}))).map(e=>[{name:e.rowName,color:e.color},...e.values])})),$=u(()=>{let e=[M.value.table.columnNames.series,...q.value.map(e=>e.text)],t={th:{backgroundColor:M.value.table.th.backgroundColor,color:M.value.table.th.color,outline:M.value.table.th.outline},td:{backgroundColor:M.value.table.td.backgroundColor,color:M.value.table.td.color,outline:M.value.table.td.outline},breakpoint:M.value.table.responsiveBreakpoint};return{colNames:[M.value.table.columnNames.series,...q.value.map(e=>e.text)],head:e,body:Jn.value.body,config:t}});function Yn(e=null){Ye(()=>{let t=[[M.value.table.columnNames.series,...q.map(e=>[e.text])],...Jn.value.body.map((e,t)=>[e[0].name,...e.slice(1)])],n=[[R.value.title.text],[R.value.title.subtitle.text]].concat(t),r=re(n);e?e(r):he({csvContent:r,title:R.value.title.text||`vue-ui-ridgeline`})})}function Xn(){return Y.value}let Zn=te(T,()=>R.value.title.text),Qn=u(()=>({min:0,max:Dn.value}));Fe({timeLabelsEls:Xt,timeLabels:q,slicer:Qn,configRef:M,rotationPath:[`style`,`chart`,`xAxis`,`labels`,`rotation`],autoRotatePath:[`style`,`chart`,`xAxis`,`labels`,`autoRotate`,`enable`],isAutoSize:!1,width:Cn,height:wn,targetClass:`.vue-ui-ridgeline-x-axis-label`,angle:I.value.autoRotate.angle});let $n=u(()=>s({config:M,style:R,mutableConfig:U,dialog:Pt,accordion:kt,isFullscreen:Q,parent:T,maxWidth:800,isCursorPointer:z}));nt(()=>U.value.showTable,e=>o(e,M,Zt));function er(){U.value.showTable=!1,Qt.value&&Qt.value.setTableIconState(!1)}let tr=u(()=>R.value.backgroundColor),nr=u(()=>({...R.value.legend,position:`bottom`})),rr=u(()=>R.value.title),{isCallbackImaging:ir,isCallbackSvg:ar,generateSvg:or,onGenerateImage:sr}=Me({svg:H,title:rr,legend:nr,legendItems:Z,backgroundColor:tr,getSvgCallback:()=>M.value.userOptions.callbacks.svg,generateImage:pn});function cr(e){lr(`xy-zoom`,e.dataset,e.config)}async function lr(e=`main-chart`,t=null,n=null){Lt(`copyAlt`,{source:e,config:e===`main-chart`?M.value:zn.value,dataset:e===`main-chart`?Y.value:Bn.value}),M.value.userOptions.callbacks.altCopy?await Promise.resolve(M.value.userOptions.callbacks.altCopy({source:e,config:e===`main-chart`?M.value:zn.value,dataset:e===`main-chart`?Y.value:Bn.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function ur(){j.value=null,$t.value=!0}function dr(){hr(),$t.value=!1}function fr(e){if(!H.value||Gn.value||document.activeElement!==H.value||!Y.value.length)return;let t=e.key===`ArrowUp`,n=e.key===`ArrowDown`,r=e.key===`ArrowLeft`,ee=e.key===`ArrowRight`,i=e.key===`Enter`||e.key===` `,a=e.key===`Escape`;if(!t&&!n&&!r&&!ee&&!i&&!a)return;if(e.preventDefault(),e.stopPropagation(),a){hr();return}if(i){if(j.value!==null){let e=Y.value[j.value];e&&Vn(e);return}k.value&&Mn(k.value);return}if(t||n){let e=j.value;e=e===null?n?0:Y.value.length-1:pr(e+(n?1:-1)),j.value=e,Hn.value=e;return}if(!J.value.length)return;let o=k.value?.index??null;o=o===null?ee?0:J.value.length-1:mr(o+(ee?1:-1));let s=J.value[o];s&&An(s)}function pr(e){let t=Y.value.length;return t?(e%t+t)%t:null}function mr(e){let t=J.value.length;return t?(e%t+t)%t:null}function hr(){j.value=null,Hn.value=null,k.value?jn(k.value):k.value=null}let gr=u(()=>({head:$.value.head,body:$.value.body.map(e=>[e[0]?.name??``,...e.slice(1)]),caption:M.value.a11y.translations.tableCaption,notice:M.value.a11y.translations.tableAvailable}));return Ue({getData:Xn,getImage:Zn,generateImage:pn,generateSvg:or,generatePdf:fn,generateCsv:Yn,hideSeries:xn,showSeries:bn,toggleAnnotator:Kn,toggleTable:qn,toggleFullscreen:Rn,copyAlt:lr}),(e,o)=>(_(),p(`div`,{ref_key:`ridgelineChart`,ref:T,class:Xe(`vue-data-ui-component vue-ui-ridgeline ${Q.value?`vue-data-ui-wrapper-fullscreen`:``}`),id:`vue-ui-ridgeline_${O.value}`,style:g({fontFamily:M.value.style.fontFamily,width:`100%`,textAlign:`center`,background:R.value.backgroundColor,height:M.value.responsive?`100%`:void 0}),onMouseenter:o[3]||=()=>S(on)(!0),onMouseleave:o[4]||=()=>S(on)(!1)},[m(`div`,{id:`chart-instructions-${O.value}`,class:`sr-only`},[m(`p`,null,x(M.value.a11y.translations.keyboardNavigation),1)],8,ot),gr.value.body.length?(_(),d(Be,{key:0,uid:O.value,head:gr.value.head,body:gr.value.body,caption:gr.value.caption,notice:gr.value.notice},null,8,[`uid`,`head`,`body`,`caption`,`notice`])):f(``,!0),N.value.buttons.annotator&&S(H)?(_(),d(S(jt),Je({key:1},S(i)(N.value.annotator),{color:R.value.color,backgroundColor:R.value.backgroundColor,active:Gn.value,svgRef:S(H),isCursorPointer:z.value,onClose:Kn}),We({_:2},[y(S(a),t=>({name:t,fn:C(n=>[b(e.$slots,t,Ze(qe(S(ee)(t,n))),void 0,!0)])}))]),1040,[`color`,`backgroundColor`,`active`,`svgRef`,`isCursorPointer`])):f(``,!0),b(e.$slots,`userConfig`,{},void 0,!0),mn.value?(_(),p(`div`,{key:2,ref_key:`noTitle`,ref:Vt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):f(``,!0),R.value.title.text?(_(),p(`div`,{key:3,ref_key:`chartTitle`,ref:Rt,style:`width:100%;background:transparent;padding-bottom:24px`},[(_(),d(Re,{key:`title_${Ht.value}`,config:{title:{cy:`ridgeline-div-title`,...R.value.title},subtitle:{cy:`ridgeline-div-subtitle`,...R.value.title.subtitle}}},null,8,[`config`]))],512)):f(``,!0),N.value.show&&It.value&&(S(sn)||S(an))?(_(),d(S(Mt),Je({ref_key:`userOptionsRef`,ref:Qt,key:`user_option_${Gt.value}`,backgroundColor:R.value.backgroundColor,color:R.value.color,isPrinting:S(un),isImaging:S(dn),uid:O.value,hasTooltip:!1,hasLabel:!1,isFullscreen:Q.value,chartElement:T.value},S(n)(N.value,`pdf csv img svg table fullscreen altCopy annotator`),{isTooltip:!1,isAnnotation:Gn.value,tableDialog:M.value.table.useDialog,style:{visibility:S(sn)?S(an)?`visible`:`hidden`:`visible`},isCursorPointer:z.value,onToggleFullscreen:Rn,onGeneratePdf:S(fn),onGenerateCsv:Yn,onGenerateImage:S(sr),onGenerateSvg:S(or),onToggleTable:qn,onToggleAnnotator:Kn,onCopyAlt:lr}),We({_:2},[y(S(t)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:C(n=>[b(e.$slots,t,Ze(qe(S(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`isFullscreen`,`chartElement`,`isAnnotation`,`tableDialog`,`style`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`])):f(``,!0),m(`div`,st,[(_(),p(`svg`,{ref_key:`svgRef`,ref:H,xmlns:S(_e),"aria-describedby":`chart-instructions-${O.value}`,class:Xe({"vue-data-ui-fullscreen--on":Q.value,"vue-data-ui-fulscreen--off":!Q.value}),viewBox:`0 0 ${G.value.width<=0?10:G.value.width} ${K.value.fullHeight<=0?10:K.value.fullHeight}`,style:g(`max-width:100%;overflow:visible;background:transparent;color:${R.value.color};${M.value.responsive?`height: ${Yt.value}px; width: 100%;`:``}`),tabindex:`0`,onFocus:ur,onBlur:dr,onKeydown:fr},[Ke(S(Nt)),b(e.$slots,`svg-underlayer`,{svg:{...G.value,drawingArea:K.value,isPrintingImg:S(un)||S(dn)||S(ir),isPrintingSvg:S(ar),data:Y.value}},void 0,!0),m(`defs`,null,[(_(!0),p(l,null,y(Z.value,(e,t)=>(_(),d(He,{t:`linear`,id:`gradient-${e.id}-${O.value}`,key:`gradient-${e.id}-${O.value}`,x1:`50%`,y1:`0%`,x2:`50%`,y2:`100%`,stops:[[`0%`,e.color,1],[`30%`,e.color,.7],[`70%`,e.color,.3],[`100%`,e.color,.1]]},null,8,[`id`,`stops`]))),128)),(_(!0),p(l,null,y(Y.value,(e,t)=>(_(),p(l,null,[(_(!0),p(l,null,y(e.datapoints,(e,t)=>(_(),d(He,{t:`linear`,key:`grad${e.id}`,id:`gradient-single-${O.value}-${e.uid}`,x1:`50%`,y1:`0%`,x2:`50%`,y2:`100%`,stops:[[`0%`,e.color,1],[`30%`,e.color,.7],[`70%`,e.color,.3],[`100%`,e.color,.1]]},null,8,[`id`,`stops`]))),128))],64))),256))]),(_(!0),p(l,null,y(Y.value,(t,n)=>(_(),p(`g`,{key:`ds-${n}`},[(_(!0),p(l,null,y(t.datapoints,(t,r)=>(_(),p(`g`,{key:t.id},[e.$slots.pattern?(_(),p(`g`,lt,[m(`defs`,null,[b(e.$slots,`pattern`,Je({ref_for:!0},{datapointIndex:n,seriesIndex:r,patternId:`pattern_${O.value}_${t.uid}`}),void 0,!0)])])):f(``,!0),m(`path`,{fill:e.$slots.pattern?`url(#pattern_${O.value}_${t.uid})`:R.value.backgroundColor,stroke:`none`,"stroke-linecap":`round`,d:P.value.smooth?t.smoothPath:t.straightPath,style:g({opacity:P.value.opacity})},null,12,ut),m(`path`,{fill:`none`,stroke:P.value.stroke.useSerieColor?t.color:P.value.stroke.color,"stroke-width":P.value.strokeWidth,d:P.value.smooth?t.smoothPathRidge:t.straightPathRidge,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:g({strokeDasharray:t.pathLength,strokeDashoffset:M.value.useCssAnimation?t.pathLength:0})},null,12,dt),m(`path`,{fill:P.value.useGradient?P.value.useCommonColor?`url(#gradient-${t.id}-${O.value})`:`url(#gradient-single-${O.value}-${t.uid})`:t.color,stroke:`none`,d:P.value.smooth?t.smoothPath:t.straightPath,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:g({strokeDasharray:t.pathLength,strokeDashoffset:M.value.useCssAnimation?t.pathLength:0})},null,12,ft),R.value.zeroLine.show?(_(),p(`path`,{key:1,stroke:R.value.zeroLine.useSerieColor?t.color:R.value.zeroLine.stroke,"stroke-dasharray":R.value.zeroLine.strokeDasharray,"stroke-width":R.value.zeroLine.strokeWidth,d:t.zeroPath,"stroke-linecap":`round`},null,8,pt)):f(``,!0),P.value.maxPoint.show&&t.plots.length>1?(_(!0),p(l,{key:2},y(t.plots,e=>(_(),p(l,null,[e.isMaxPoint?(_(),p(`line`,{key:0,x1:e.x,y1:e.y,x2:e.x,y2:e.zero,stroke:P.value.maxPoint.adaptStrokeToBackground?S(ge)(t.color):P.value.maxPoint.stroke,"stroke-width":P.value.maxPoint.strokeWidth,"stroke-linecap":`round`,"stroke-dasharray":P.value.maxPoint.strokeDasharray},null,8,mt)):f(``,!0)],64))),256)):f(``,!0),t.plots.length===1?(_(),p(`circle`,{key:3,cx:t.plots[0].x,cy:t.plots[0].y,stroke:F.value.dot.stroke,"stroke-width":F.value.dot.strokeWidth,r:F.value.dot.radius,fill:F.value.dot.useDatapointColor?t.color:F.value.dot.fill,style:{pointerEvents:`none`}},null,8,ht)):f(``,!0)]))),128)),m(`text`,{x:t.label.x,y:t.label.y,"text-anchor":`end`,"font-size":L.value.fontSize,"font-weight":L.value.bold?`bold`:`normal`,fill:L.value.color,style:g({cursor:R.value.dialog.show&&z.value?`pointer`:`default`}),"text-decoration":R.value.dialog.show&&(Hn.value===n||A.value&&t.uid===A.value.uid||j.value===n)?`underline`:``,"dominant-baseline":`middle`,onMouseenter:e=>Un(n),onMouseleave:Wn,onClick:e=>Vn(t)},x(t.name),45,gt)]))),128)),I.value.values.length?(_(),p(`g`,{key:0,ref_key:`timeLabelsEls`,ref:Xt},[(_(!0),p(l,null,y(J.value,(t,n)=>b(e.$slots,`time-label`,Je({ref_for:!0},{show:t&&!I.value.showOnlyFirstAndLast&&!I.value.showOnlyAtModulo||t&&I.value.showOnlyFirstAndLast&&(n===0||n===J.value.length-1)||t&&k.value&&k.value.index===n||t&&!I.value.showOnlyFirstAndLast&&I.value.showOnlyAtModulo&&n%Math.max(1,Math.floor(Number(R.value.xAxis.labels.modulo)||1))===0,fontSize:I.value.fontSize,content:t.label,textAnchor:I.value.rotation>0?`start`:I.value.rotation<0?`end`:`middle`,fill:I.value.color,transform:`translate(${t.selectorX}, ${K.value.top+t.height+I.value.offsetY}), rotate(${I.value.rotation})`,x:t.selectorX,y:K.value.bottom+I.value.offsetY}),()=>[t&&!I.value.showOnlyFirstAndLast&&!I.value.showOnlyAtModulo||t&&I.value.showOnlyFirstAndLast&&(n===0||n===J.value.length-1)||t&&k.value&&k.value.index===n||t&&!I.value.showOnlyFirstAndLast&&I.value.showOnlyAtModulo&&n%Math.max(1,Math.floor(Number(R.value.xAxis.labels.modulo)||1))===0?(_(),p(`g`,_t,[String(t.label).includes(`
2
2
  `)?(_(),p(`text`,{key:1,class:`vue-ui-ridgeline-x-axis-label`,"font-size":I.value.fontSize,fill:I.value.color,"font-weight":I.value.bold?`bold`:`normal`,transform:`translate(${t.selectorX}, ${K.value.bottom+I.value.offsetY}), rotate(${I.value.rotation})`,"text-anchor":I.value.rotation>0?`start`:R.value.xAxis.labels.rotation<0?`end`:`middle`,style:g({opacity:k.value?k.value.index===n?1:.2:1}),innerHTML:S(ae)({content:String(t.label),fontSize:R.value.xAxis.labels.fontSize,fill:R.value.xAxis.labels.color,stroke:R.value.backgroundColor,x:0,y:0})},null,12,yt)):(_(),p(`text`,{key:0,class:`vue-ui-ridgeline-x-axis-label`,"font-size":I.value.fontSize,fill:I.value.color,stroke:R.value.backgroundColor,"stroke-width":`3`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"paint-order":`stroke fill`,"font-weight":I.value.bold?`bold`:`normal`,transform:`translate(${t.selectorX}, ${K.value.bottom+I.value.offsetY}), rotate(${I.value.rotation})`,"text-anchor":I.value.rotation>0?`start`:R.value.xAxis.labels.rotation<0?`end`:`middle`,style:g({opacity:k.value?k.value.index===n?1:.2:1})},x(t.label),13,vt))])):f(``,!0)],!0)),256))],512)):f(``,!0),m(`g`,null,[(_(!0),p(l,null,y(J.value,(e,t)=>(_(),p(`rect`,{x:e.x,y:e.y,width:e.width<0?.1:e.width,height:e.height<0?.1:e.height,fill:`transparent`,onMouseenter:t=>An(e),onMouseleave:t=>jn(e),onClick:()=>Mn(e)},null,40,bt))),256)),F.value.show&&k.value?(_(),p(`line`,{key:0,x1:k.value.selectorX,x2:k.value.selectorX,y1:k.value.y,y2:k.value.y+k.value.height-V.value/2,stroke:F.value.stroke,"stroke-width":F.value.strokeWidth,"stroke-dasharray":F.value.strokeDasharray,"stroke-linecap":`round`,style:{pointerEvents:`none`}},null,8,xt)):f(``,!0),k.value||F.value.labels.showLast?(_(!0),p(l,{key:1},y(Y.value,e=>(_(),p(l,null,[(_(!0),p(l,null,y(e.datapoints,e=>(_(),p(l,null,[(_(!0),p(l,null,y(e.plots,(t,n)=>(_(),p(l,null,[k.value&&k.value.index===n||!k.value&&n===e.plots.length-1&&R.value.selector.labels.showLast?(_(),p(`circle`,{key:0,cx:t.x,cy:t.y,stroke:F.value.dot.stroke,"stroke-width":F.value.dot.strokeWidth,r:F.value.dot.radius,fill:F.value.dot.useDatapointColor?e.color:R.value.selector.dot.fill,style:{pointerEvents:`none`}},null,8,St)):f(``,!0),k.value&&k.value.index===n||!k.value&&n===e.plots.length-1&&R.value.selector.labels.showLast?(_(),p(`text`,{key:1,x:Pn(t.x,S(pe)(R.value.selector.labels.formatter,t.value,S(c)({p:M.value.style.chart.xAxis.labels.prefix,v:t.value,s:M.value.style.chart.xAxis.labels.suffix,r:M.value.style.chart.selector.labels.rounding})),R.value.selector.labels.fontSize)?t.x-R.value.selector.labels.fontSize/2:t.x+R.value.selector.labels.fontSize/2,y:t.y,"dominant-baseline":`middle`,stroke:R.value.backgroundColor,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`3`,"paint-order":`stroke fill`,"text-anchor":Pn(t.x,S(pe)(R.value.selector.labels.formatter,t.value,S(c)({p:M.value.style.chart.xAxis.labels.prefix,v:t.value,s:M.value.style.chart.xAxis.labels.suffix,r:M.value.style.chart.selector.labels.rounding})),R.value.selector.labels.fontSize)?`end`:`start`,"font-size":F.value.labels.fontSize,fill:F.value.labels.color,style:{pointerEvents:`none`}},x(S(pe)(R.value.selector.labels.formatter,t.value,S(c)({p:R.value.xAxis.labels.prefix,v:t.value,s:R.value.xAxis.labels.suffix,r:R.value.selector.labels.rounding}))),9,Ct)):f(``,!0)],64))),256))],64))),256))],64))),256)):f(``,!0)]),b(e.$slots,`svg`,{svg:{...G.value,drawingArea:K.value,isPrintingImg:S(un)||S(dn)||S(ir),isPrintingSvg:S(ar),data:Y.value}},void 0,!0)],46,ct)),e.$slots.hint?(_(),p(`div`,wt,[b(e.$slots,`hint`,Ze(qe({hint:M.value.a11y.translations.keyboardNavigation,isVisible:$t.value})),void 0,!0)])):f(``,!0)]),e.$slots.watermark?(_(),p(`div`,Tt,[b(e.$slots,`watermark`,Ze(qe({isPrinting:S(un)||S(dn)||S(ir)||S(ar)})),void 0,!0)])):f(``,!0),m(`div`,{ref_key:`chartLegend`,ref:zt},[b(e.$slots,`legend`,{legend:Z.value},()=>[R.value.legend.show?(_(),d(Le,{key:`legend_${Wt.value}`,legendSet:Z.value,config:Ln.value,isCursorPointer:z.value,onClickMarker:o[0]||=({legend:e})=>vn(e.id)},We({item:C(({legend:e})=>[S(nn)?f(``,!0):(_(),p(`div`,{key:0,style:g(`opacity:${X.value.includes(e.id)?.5:1}`),onClick:t=>e.segregate()},x(e.name),13,Et))]),legendToggle:C(()=>[Z.value.length>2&&R.value.legend.selectAllToggle.show&&!S(nn)?(_(),d(Ve,{key:0,backgroundColor:R.value.legend.selectAllToggle.backgroundColor,color:R.value.legend.selectAllToggle.color,fontSize:R.value.legend.fontSize,checked:X.value.length>0,isCursorPointer:z.value,onToggle:_n},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):f(``,!0)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:C(({legend:e,index:t})=>[Ke(ze,{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`])):f(``,!0)],!0)],512),e.$slots.source?(_(),p(`div`,{key:6,ref_key:`source`,ref:Bt,dir:`auto`},[b(e.$slots,`source`,{},void 0,!0)],512)):f(``,!0),It.value&&N.value.buttons.table?(_(),d($e($n.value.component),Je({key:7},$n.value.props,{ref_key:`tableUnit`,ref:Zt,onClose:er}),We({content:C(()=>[(_(),d(S(At),{key:`table_${Ut.value}`,colNames:$.value.colNames,head:$.value.head,body:$.value.body,config:$.value.config,title:M.value.table.useDialog?``:$n.value.title,withCloseButton:!M.value.table.useDialog,isCursorPointer:z.value,onClose:er},{th:C(({th:e})=>[m(`div`,null,x(e),1)]),td:C(({td:e})=>[Ge(x(e.name?e.name:S(pe)(F.value.labels.formatter,e,S(c)({p:R.value.xAxis.labels.prefix,v:e,s:R.value.xAxis.labels.suffix,r:M.value.table.td.roundingValue}))),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[M.value.table.useDialog?{name:`title`,fn:C(()=>[Ge(x($n.value.title),1)]),key:`0`}:void 0,M.value.table.useDialog?{name:`actions`,fn:C(()=>[m(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:o[1]||=e=>Yn(N.value.callbacks.csv),style:g({cursor:z.value?`pointer`:`default`})},[Ke(S(Ot),{name:`fileCsv`,stroke:$n.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):f(``,!0),R.value.dialog.show?(_(),d(S(Pt),{key:8,ref_key:`dialog`,ref:Jt,onClose:o[2]||=e=>A.value=null,backgroundColor:R.value.dialog.backgroundColor,color:R.value.dialog.color,headerBg:R.value.dialog.header.backgroundColor,headerColor:R.value.dialog.header.color,isFullscreen:Q.value,fullscreenParent:T.value,isCursorPointer:z.value,withPadding:``},{title:C(()=>[Ge(x(A.value.name),1)]),content:C(()=>[A.value?(_(),d(S(Dt),{key:0,config:zn.value,dataset:Bn.value,onCopyAlt:cr},null,8,[`config`,`dataset`])):f(``,!0)]),_:1},8,[`backgroundColor`,`color`,`headerBg`,`headerColor`,`isFullscreen`,`fullscreenParent`,`isCursorPointer`])):f(``,!0),b(e.$slots,`skeleton`,{},()=>[S(nn)?(_(),d(Oe,{key:0})):f(``,!0)],!0)],46,at))}},[[`__scopeId`,`data-v-5d9a45a7`]]);export{it as n,Dt as t};
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as ee}from"./annotationSlots-OLiW25XN.js";import{n as te,t as ne}from"./tableIntegration-CNoJ1CIY.js";import{t as re}from"./chartImage-DPGnEuYM.js";import{$ as o,D as ie,Dt as ae,Ht as s,J as oe,Jt as se,Kt as ce,S as le,X as ue,Yt as de,Zt as fe,at as pe,b as me,i as he,in as ge,nn as _e,nt as ve,pt as ye,t as be,w as xe,yt as Se,zt as Ce}from"./lib-rPeBMZrn.js";import{t as we}from"./labelUtils-CdtU-yB_.js";import{c as Te}from"./canvas-lib-22VpOI4_.js";import{n as Ee,t as De}from"./useHints-C-TwxM0Y.js";import{t as Oe}from"./useConfig-_JwRfIqE.js";import{t as ke}from"./usePrinter-DVf3YcG5.js";import{n as Ae,t as je}from"./BaseScanner-8NdoBs7B.js";import{t as Me}from"./useNestedProp-DnGoh-XS.js";import{t as Ne}from"./useResponsive-CENUxfEL.js";import{t as Pe}from"./useThemeCheck-BKNRbGeC.js";import{t as Fe}from"./useChartExport-BZts4KFb.js";import{t as Ie}from"./useTransitions-ChGGrtrv.js";import{t as Le}from"./useUserOptionState-CXlFnwPv.js";import{t as Re}from"./useChartAccessibility-DOMuYJfm.js";import{t as ze}from"./Shape-CRe8woTu.js";import{n as Be}from"./Title-BliHuXfT.js";import{t as Ve}from"./vue_ui_rings-C0puwNW1.js";import{t as He}from"./Legend-W9YVYVX-.js";import{t as Ue}from"./A11yDataTable-DWNlWXzs.js";import{t as We}from"./BaseLegendToggle-VzX69MCo.js";import{t as Ge}from"./DefGrad-DKMq1REY.js";import{t as Ke}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as qe,Teleport as Je,computed as c,createBlock as l,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createSlots as Ye,createTextVNode as Xe,createVNode as Ze,defineAsyncComponent as p,guardReactiveProps as m,mergeProps as Qe,nextTick as $e,normalizeClass as h,normalizeProps as g,normalizeStyle as _,onBeforeUnmount as et,onMounted as tt,openBlock as v,ref as y,renderList as nt,renderSlot as b,resolveDynamicComponent as rt,shallowRef as it,toDisplayString as at,toRefs as ot,unref as x,useSlots as st,watch as ct,withCtx as S}from"vue";var lt=/* @__PURE__ */ e({default:()=>At}),ut=[`id`],dt=[`id`],ft=[`id`],pt={style:{position:`relative`}},mt=[`xmlns`,`viewBox`,`aria-describedby`],ht=[`width`,`height`],gt={key:1},_t=[`stroke`,`cx`,`cy`,`r`,`fill`],vt=[`stroke`,`stroke-width`,`cx`,`cy`,`r`,`fill`],yt=[`stroke`,`stroke-width`,`cx`,`cy`,`r`,`fill`],bt=[`cx`,`cy`,`r`,`onMouseenter`,`onMouseleave`,`onClick`],xt=[`x`,`y`,`width`,`height`,`fill`,`rx`],St=[`cx`,`cy`,`r`,`fill`,`stroke`],Ct=[`text-anchor`,`font-size`,`fill`,`font-weight`,`transform`,`onMouseenter`,`onMouseleave`,`onClick`,`innerHTML`],wt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Tt={key:5,class:`vue-data-ui-watermark`},Et=[`id`],Dt=[`onClick`],Ot={key:0},kt={key:1},At=/*#__PURE__*/ Ke({__name:`vue-ui-rings`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`copyAlt`],setup(e,{expose:Ke,emit:lt}){let At=p(()=>import(`./Tooltip-C1q0Qoh7.js`)),jt=p(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Mt=p(()=>import(`./vue-ui-accordion-DxGxf-Rm.js`).then(e=>e.n)),Nt=p(()=>import(`./DataTable-KeuZB1JM.js`)),Pt=p(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Ft=p(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),It=p(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),Lt=p(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_rings:Rt}=Oe(),{isThemeValid:zt,warnInvalidTheme:Bt}=Pe(),Vt=st(),C=e,w=y(!1),Ht=c(()=>!!C.dataset&&C.dataset.length),T=y(ue()),E=y(!1),Ut=y(``),D=y(null),Wt=y(0),O=y(null),Gt=y(null),Kt=y(null),qt=y(null),Jt=y(null),Yt=y(0),Xt=y(0),Zt=y(0),Qt=y(!1),$t=y(!1),en=y(null),tn=y(null),k=y(null),nn=y({x:0,y:0}),rn=y(`pointer`),an=y(!1),A=y(fn()),j=c(()=>A.value.userOptions),M=c(()=>A.value.style.chart.layout.rings),N=c(()=>A.value.style.chart.layout.labels),P=c(()=>A.value.style.chart.tooltip),F=c(()=>A.value.style.chart);Ee({config:()=>A.value,dataset:()=>C.dataset,component:`VueUiRings`,rules:[De.singleSeries,De.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series is > 6. Consider:`,``,`▶️ Grouping small values dynamically into a single "Other" series.`,``,`▶️ Using filters to let users choose a maximum number of series to display.`,``,`▶️ Using VueUiHorizontalBar instead to make the dataset breakdown easier to read.`]}]});let{transitionEnabled:I}=Ie({config:()=>A.value.transitions,dataset:()=>C.dataset}),L=c(()=>A.value.userOptions.useCursorPointer),on=c(()=>ge({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{rings:{stroke:`#6A6A6A`,gradient:{underlayerColor:`#FFFFFF`}},labels:{dataLabels:{show:!1}}},legend:{backgroundColor:`transparent`}}}},userConfig:A.value.skeletonConfig??{}})),{loading:R,FINAL_DATASET:sn,manualLoading:cn}=Ae({...ot(C),FINAL_CONFIG:A,prepareConfig:fn,skeletonDataset:C.config?.skeletonDataset??[{name:`_`,values:[13],color:`#808080`},{name:`_`,values:[8],color:`#969696`},{name:`_`,values:[5],color:`#ADADAD`},{name:`_`,values:[3],color:`#C4C4C4`},{name:`_`,values:[2],color:`#DBDBDB`}],skeletonConfig:ge({defaultConfig:A.value,userConfig:on.value})}),{userOptionsVisible:ln,setUserOptionsVisibility:un,keepUserOptionState:dn}=Le({config:A.value}),{svgRef:z}=Re({config:F.value.title});function fn(){let e=Me({userConfig:C.config,defaultConfig:Rt}),t=e.theme;if(!t)return e;if(!zt.value(e))return Bt(e),e;let n=Me({userConfig:Ve[t]||C.config,defaultConfig:e});return{...Me({userConfig:C.config,defaultConfig:n}),customPalette:e.customPalette.length?e.customPalette:_e[e.theme]||s}}let pn=fe(C.config);ct(()=>C.config,(e,t)=>{let n=fe(e),r=n!==pn;pn=n;let i=fn();r?(R.value||(A.value=i),ln.value=!A.value.userOptions.showOnChartHover,gn(),Yt.value+=1,Xt.value+=1,Zt.value+=1,U.value.showTable=A.value.table.show,U.value.showTooltip=P.value.show,U.value.showLabels=N.value.dataLabels.show,W.value.width=F.value.size,W.value.height=F.value.size):(A.value.style.chart.tooltip=i.style.chart.tooltip,U.value.showTooltip=A.value.style.chart.tooltip.show)},{deep:!0});let mn=c(()=>{let{markers:e}=N.value.dataLabels,t=Y.value/2,n=U.value.showLabels?e.position===`left`?t:-t:0,r=U.value.showLabels?W.value.width/2-t:0,i=e.position===`left`?r:-r;return{x:A.value.responsive?i:n/F.value.size*W.value.width,y:0/F.value.size*W.value.height}}),B=c(()=>({x:W.value.width/2+mn.value.x,y:W.value.height/2+mn.value.y}));ct(()=>C.dataset,e=>{Array.isArray(e)&&e.length>0&&(cn.value=!1)},{deep:!0});let V=it(null),H=it(null);tt(()=>{$t.value=!0,gn()});let hn=c(()=>A.value.debug);function gn(){if(Ce(C.dataset)?(pe({componentName:`VueUiRings`,type:`dataset`,debug:hn.value}),cn.value=!0):C.dataset.forEach((e,t)=>{e.values.length||(pe({componentName:`VueUiRings`,type:`dataset`,debug:hn.value}),cn.value=!0),Se({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{pe({componentName:`VueUiRings`,type:`datasetSerieAttribute`,property:e,index:t,debug:hn.value})})}),Ce(C.dataset)||(cn.value=A.value.loading),A.value.responsive){let e=Te(()=>{Qt.value=!0;let{width:e,height:t}=Ne({chart:O.value,title:F.value.title.text?Gt.value:null,legend:F.value.legend.show?Kt.value:null,source:qt.value,noTitle:Jt.value});requestAnimationFrame(()=>{W.value.width=e,W.value.height=t-12,Qt.value=!1})});V.value&&(H.value&&V.value.unobserve(H.value),V.value.disconnect()),V.value=new ResizeObserver(e),H.value=O.value.parentNode,V.value.observe(H.value)}setTimeout(()=>{w.value=!0},600)}et(()=>{V.value&&(H.value&&V.value.unobserve(H.value),V.value.disconnect())});let{isPrinting:_n,isImaging:vn,generatePdf:yn,generateImage:bn}=ke({elementId:`rings_${T.value}`,fileName:F.value.title.text||`vue-ui-rings`,options:A.value.userOptions.print}),xn=c(()=>A.value.userOptions.show&&!F.value.title.text),Sn=c(()=>xe(A.value.customPalette)),U=y({showTable:A.value.table.show,showTooltip:P.value.show,showLabels:N.value.dataLabels.show});ct(A,()=>{U.value={showTable:A.value.table.show,showTooltip:P.value.show,showLabels:N.value.dataLabels.show}},{immediate:!0});let W=y({height:F.value.size,width:F.value.size}),Cn=c(()=>Math.min(W.value.height,W.value.width)),wn=lt,G=y([]);function Tn(){G.value.length?G.value=[]:Nn.value.forEach(e=>{G.value.push(e.uid)}),En()}function En(){wn(`selectLegend`,J.value.map(e=>({name:e.name,color:e.color,value:e.value})))}function Dn(e){if(G.value.includes(e))G.value=G.value.filter(t=>t!==e);else{if(G.value.length===K.value.length-1)return;G.value.push(e)}En()}function On(e){return K.value.length?K.value.find(t=>t.name===e)||(hn.value&&console.warn(`VueUiRings - Series name not found "${e}"`),null):(hn.value&&console.warn(`VueUiRings - There are no series to show.`),null)}function kn(e){let t=On(e);t!==null&&G.value.includes(t.uid)&&Dn(t.uid)}function An(e){let t=On(e);t!==null&&(G.value.includes(t.uid)||Dn(t.uid))}let jn=c(()=>Math.max(...K.value.filter(e=>!G.value.includes(e.uid)).map(({value:e})=>e)));function Mn(e){return e/jn.value}let K=c(()=>sn.value.map(({values:e,name:t,color:n=null},r)=>{let i=ce(e).reduce((e,t)=>e+t,0);return{name:t,color:n||le(n)||Sn.value[r]||s[r]||s[r%s.length],value:i,proportion:i/sn.value.map(e=>(e.values||[]).reduce((e,t)=>e+t,0)).reduce((e,t)=>e+t,0),uid:ue(),absoluteIndex:r}})),Nn=c(()=>K.value.map((e,t)=>{let n=he(N.value.dataLabels.formatter,e.value,o({p:N.value.dataLabels.prefix,v:e.value,s:N.value.dataLabels.suffix,r:F.value.legend.roundingValue}),{datapoint:e,index:t}),r=isNaN(e.value/q.value)?`-`:o({v:e.value/q.value*100,s:`%`,r:F.value.legend.roundingPercentage}),i=Rn({showVal:F.value.legend.showValue,showPercentage:F.value.legend.showPercentage,val:n,percentage:G.value.includes(e.uid)?`-%`:r});return{...e,shape:`circle`,opacity:G.value.includes(e.uid)?.5:1,segregate:()=>Dn(e.uid),isSegregated:G.value.includes(e.uid),display:`${e.name}${F.value.legend.showPercentage||F.value.legend.showValue?`: `:``}${i}`}}).toSorted((e,t)=>t.value-e.value)),Pn=c(()=>({cy:`rings-div-legend`,backgroundColor:F.value.legend.backgroundColor,color:F.value.legend.color,fontSize:F.value.legend.fontSize,paddingBottom:12,fontWeight:F.value.legend.bold?`bold`:``})),q=c(()=>K.value.filter(e=>!G.value.includes(e.uid)).map(({value:e})=>e).reduce((e,t)=>e+t,0)),J=c(()=>K.value.filter(e=>!G.value.includes(e.uid)).map(({name:e,value:t,color:n=null,uid:r,absoluteIndex:i},a)=>({absoluteIndex:i,uid:r,name:e,color:n||le(n)||Sn.value[a]||s[a]||s[a%s.length],value:t,proportion:Mn(t),percentage:t/q.value*100,strokeWidth:M.value.strokeWidth*Mn(t)})).toSorted((e,t)=>t.value-e.value));function Fn(){return J.value.map(({name:e,color:t,value:n,absoluteValues:r,percentage:i})=>({name:e,color:t,value:n,absoluteValues:r,percentage:i}))}let Y=c(()=>Cn.value-M.value.strokeWidth*2);function In(e,t){A.value.events.datapointClick&&A.value.events.datapointClick({datapoint:e,seriesIndex:t})}function Ln(e,t){D.value=null,E.value=!1,k.value=null,rn.value=`pointer`,A.value.events.datapointLeave&&A.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function Rn({val:e,percentage:t,showVal:n,showPercentage:r}){let i=N.value.dataLabels;return we({config:i,val:e,percentage:t,showVal:n,showPercentage:r})}function zn(e){let t=N.value.dataLabels,n=he(t.formatter,e.value,o({p:t.prefix,v:e.value,s:t.suffix,r:t.roundingValue})),r=o({v:e.percentage,s:`%`,r:t.roundingPercentage});return`${e.name}\n${Rn({val:n,percentage:r,showVal:t.showValue,showPercentage:t.showPercentage})}`}function Bn(e){return me(Y.value*e.proportion/2*.9<=0?1e-4:Y.value*e.proportion/2*.9)}function Vn(e,t){return t===0?B.value.y:B.value.y+Y.value*J.value[0].proportion/2-Y.value*e.proportion/2-2*(t+1)}function X(e,t){let n=N.value.dataLabels.markers.position===`left`?-(Y.value/2):Y.value/2;return{x:B.value.x+n,y:Vn(e,t)-Bn(e)}}let Hn=y(null);function Un(e,t,n=`pointer`){if(A.value.events.datapointEnter&&A.value.events.datapointEnter({datapoint:e,seriesIndex:t}),G.value.length===C.dataset.length)return;Hn.value={datapoint:e,seriesIndex:t,series:J.value,config:A.value},D.value=t,k.value=t,rn.value=n;let r=J.value[t],i=P.value.customFormat;if(ae(i)&&ye(()=>i({seriesIndex:t,datapoint:e,series:J.value,config:A.value})))Ut.value=i({seriesIndex:t,datapoint:e,series:J.value,config:A.value});else{let n=``;n+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${P.value.borderColor};padding-bottom:6px;margin-bottom:3px;">${r.name}</div>`,n+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 60 60" height="14" width="14"><circle cx="30" cy="30" r="30" stroke="none" fill="${r.color}" />${Vt.pattern?`<circle cx="30" cy="30" r="30" stroke="none" fill="url(#pattern_${T.value}_${e.absoluteIndex})" />`:``}</svg>`,n+=`<b>${Rn({showVal:P.value.showValue,showPercentage:P.value.showPercentage,val:`<span>${he(N.value.dataLabels.formatter,r.value,o({p:N.value.dataLabels.prefix,v:r.value,s:N.value.dataLabels.suffix,r:P.value.roundingValue}),{datapoint:e,seriesIndex:t})}</span>`,percentage:o({v:r.value/q.value*100,s:`%`,r:P.value.roundingPercentage})})}</b></div>`,Ut.value=n}E.value=!0}let Z=c(()=>({head:J.value.map(e=>({name:e.name,color:e.color})),body:J.value.map(e=>e.value)})),Q=c(()=>{let e=[`__SUM__`,o({p:N.value.dataLabels.prefix,v:q.value,s:N.value.dataLabels.suffix,r:A.value.table.td.roundingValue}),`100%`],t=Z.value.head.map((e,t)=>[{color:e.color,name:e.name},o({p:N.value.dataLabels.prefix,v:Z.value.body[t],s:N.value.dataLabels.suffix,r:A.value.table.td.roundingValue}),isNaN(Z.value.body[t]/q.value)?`-`:(Z.value.body[t]/q.value*100).toFixed(A.value.table.td.roundingPercentage)+`%`]);return{head:e,body:t,a11yBody:t.map(e=>e.map((e,t)=>t===0?e.name:e)),config:{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},colNames:[A.value.table.columnNames.series,A.value.table.columnNames.value,A.value.table.columnNames.percentage]}});function Wn(e=null){$e(()=>{let t=Z.value.head.map((e,t)=>[[e.name],[Z.value.body[t]],[isNaN(Z.value.body[t]/q.value)?`-`:Z.value.body[t]/q.value*100]]),n=[[F.value.title.text],[F.value.title.subtitle.text],[[``],[`val`],[`%`]]].concat(t),r=ie(n);e?e(r):ve({csvContent:r,title:F.value.title.text||`vue-ui-rings`})})}let $=y(!1);function Gn(e){$.value=e,Wt.value+=1}function Kn(){U.value.showTable=!U.value.showTable}function qn(){U.value.showTooltip=!U.value.showTooltip}function Jn(){U.value.showLabels=!U.value.showLabels}let Yn=y(!1);function Xn(){Yn.value=!Yn.value}let Zn=re(O,()=>F.value.title.text),Qn=c(()=>ne({config:A,style:F,mutableConfig:U,dialog:Lt,accordion:Mt,isFullscreen:$,parent:O,maxWidth:800,isCursorPointer:L}));ct(()=>U.value.showTable,e=>te(e,A,en));function $n(){U.value.showTable=!1,tn.value&&tn.value.setTableIconState(!1)}let er=c(()=>Nn.value.map(e=>({...e,name:e.display}))),tr=c(()=>F.value.backgroundColor),nr=c(()=>F.value.legend),rr=c(()=>F.value.title),{isCallbackImaging:ir,isCallbackSvg:ar,generateSvg:or,onGenerateImage:sr}=Fe({svg:z,title:rr,legend:nr,legendItems:er,backgroundColor:tr,getSvgCallback:()=>A.value.userOptions.callbacks.svg,generateImage:bn});async function cr(){wn(`copyAlt`,{config:A.value,dataset:J.value}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:J.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function lr(){k.value=null,an.value=!0}function ur(){k.value=null,rn.value=`pointer`,E.value=!1,D.value=null,an.value=!1}function dr(e){if(!z.value||Yn.value||document.activeElement!==z.value||!J.value.length||G.value.length===C.dataset.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){k.value=null,rn.value=`pointer`,E.value=!1,D.value=null;return}if(r){if(k.value===null)return;let e=J.value[k.value];if(!e)return;In(e,k.value);return}let a=k.value;a===null||a<0||a>=J.value.length?a=n?0:J.value.length-1:n?(a+=1,a>=J.value.length&&(a=0)):t&&(--a,a<0&&(a=J.value.length-1));let ee=J.value[a];ee&&(fr(a),Un(ee,a,`keyboard`))}function fr(e){if(!Number.isFinite(e)||!z.value)return;let t=J.value[e];if(!t)return;let n=X(t,e),r=z.value.getBoundingClientRect();nn.value={x:r.left+n.x/W.value.width*r.width,y:r.top+n.y/W.value.height*r.height}}let pr=c(()=>({headers:Q.value?.colNames??[],rows:Q.value?.a11yBody??[]}));return Ke({getData:Fn,getImage:Zn,generatePdf:yn,generateCsv:Wn,generateImage:bn,generateSvg:or,hideSeries:An,showSeries:kn,toggleTable:Kn,toggleTooltip:qn,toggleAnnotator:Xn,toggleFullscreen:Gn,toggleLabels:Jn,copyAlt:cr}),(e,te)=>(v(),d(`div`,{ref_key:`ringsChart`,ref:O,class:h(`vue-data-ui-component vue-ui-rings ${$.value?`vue-data-ui-wrapper-fullscreen`:``} ${A.value.useCssAnimation?``:`vue-ui-dna`}`),style:_(`font-family:${A.value.style.fontFamily};text-align:center;width:100%;background:${F.value.backgroundColor};${A.value.responsive?`height: 100%`:``}`),id:`rings_${T.value}`,onMouseleave:te[2]||=e=>{D.value=null,E.value=!1,x(un)(!1)},onMouseenter:te[3]||=()=>x(un)(!0)},[f(`div`,{id:`chart-instructions-${T.value}`,class:`sr-only`},[f(`p`,null,at(A.value.a11y.translations.keyboardNavigation),1)],8,dt),pr.value?.rows?.length?(v(),l(Ue,{key:0,uid:T.value,head:pr.value.headers,body:pr.value.rows,notice:A.value.a11y.translations.tableAvailable,caption:A.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):u(``,!0),j.value.buttons.annotator?(v(),l(x(Pt),Qe({key:1},x(a)(j.value.annotator),{svgRef:x(z),backgroundColor:F.value.backgroundColor,color:F.value.color,active:Yn.value,isCursorPointer:L.value,palette:j.value.annotatorPalette,onClose:Xn}),Ye({_:2},[nt(x(ee),t=>({name:t,fn:S(n=>[b(e.$slots,t,g(m(x(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):u(``,!0),xn.value?(v(),d(`div`,{key:2,ref_key:`noTitle`,ref:Jt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):u(``,!0),F.value.title.text?(v(),d(`div`,{key:3,ref_key:`chartTitle`,ref:Gt,style:`width:100%;background:transparent`},[(v(),l(Be,{key:`title_${Yt.value}`,config:{title:{cy:`rings-div-title`,...F.value.title},subtitle:{cy:`rings-div-subtitle`,...F.value.title.subtitle}}},null,8,[`config`]))],512)):u(``,!0),f(`div`,{id:`legend-top-${T.value}`},null,8,ft),j.value.show&&Ht.value&&(x(dn)||x(ln))?(v(),l(x(Ft),Qe({ref_key:`userOptionsRef`,ref:tn,key:`user_options_${Wt.value}`,backgroundColor:F.value.backgroundColor,color:F.value.color,isPrinting:x(_n),isImaging:x(vn),uid:T.value,hasTooltip:j.value.buttons.tooltip&&P.value.show,isTooltip:U.value.showTooltip,isFullscreen:$.value,chartElement:O.value},x(n)(j.value,`pdf csv img svg labels table fullscreen altCopy annotator`),{isAnnotation:Yn.value,tableDialog:A.value.table.useDialog,isCursorPointer:L.value,onToggleFullscreen:Gn,onGeneratePdf:x(yn),onGenerateCsv:Wn,onGenerateImage:x(sr),onGenerateSvg:x(or),onToggleTable:Kn,onToggleTooltip:qn,onToggleAnnotator:Xn,onToggleLabels:Jn,onCopyAlt:cr,style:{visibility:x(dn)?x(ln)?`visible`:`hidden`:`visible`}}),Ye({_:2},[nt(x(t)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionLabels optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:S(n=>[b(e.$slots,t,g(m(x(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasTooltip`,`isTooltip`,`isFullscreen`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):u(``,!0),f(`div`,pt,[(v(),d(`svg`,{ref_key:`svgRef`,ref:z,xmlns:x(be),class:h({"vue-data-ui-fullscreen--on":$.value,"vue-data-ui-fulscreen--off":!$.value,resizing:Qt.value||x(R),"vue-data-ui-no-transition":!x(I)}),viewBox:`0 0 ${W.value.width<=0?10:W.value.width} ${W.value.height<=0?10:W.value.height}`,style:_(`max-width:100%;overflow:hidden;background:transparent;color:${F.value.color}`),"aria-describedby":`chart-instructions-${T.value}`,tabindex:`0`,onFocus:lr,onBlur:ur,onKeydown:dr},[Ze(x(It)),b(e.$slots,`svg-underlayer`,{svg:{...W.value,isPrintingImg:x(_n)||x(vn)||x(ir),isPrintingSvg:x(ar)}},void 0,!0),e.$slots[`chart-background`]?(v(),d(`foreignObject`,{key:0,x:0,y:0,width:W.value.width<=0?10:W.value.width,height:W.value.height<=0?10:W.value.height,style:{pointerEvents:`none`}},[b(e.$slots,`chart-background`,{},void 0,!0)],8,ht)):u(``,!0),f(`defs`,null,[(v(!0),d(qe,null,nt(J.value,(e,t)=>(v(),l(Ge,{t:`radial`,cx:`50%`,cy:`30%`,r:`50%`,fx:`50%`,fy:`50%`,id:`gradient_${T.value}_${t}`,key:`gradient_${T.value}_${t}`,stops:[[`0%`,x(se)(x(de)(e.color,.05),100-M.value.gradient.intensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128))]),e.$slots.pattern?(v(),d(`g`,gt,[(v(!0),d(qe,null,nt(J.value,t=>(v(),d(`defs`,null,[b(e.$slots,`pattern`,Qe({ref_for:!0},{seriesIndex:t.absoluteIndex,patternId:`pattern_${T.value}_${t.absoluteIndex}`}),void 0,!0)]))),256))])):u(``,!0),(v(!0),d(qe,null,nt(J.value,(t,n)=>(v(),d(`g`,{key:`r_${t.uid}`},[f(`circle`,{class:h({"vue-data-ui-transition":w.value&&x(I),"vue-rings-item-onload":!w.value&&A.value.useCssAnimation&&!x(R),"vue-ui-rings-opacity":D.value!==null&&D.value!==n}),style:_(`animation-delay:${n*100}ms`),stroke:M.value.stroke,cx:B.value.x,cy:Vn(t,n),r:Bn(t),fill:M.value.gradient.underlayerColor},null,14,_t),f(`circle`,{class:h({"vue-data-ui-transition":w.value&&x(I),"vue-rings-item-onload":!w.value&&A.value.useCssAnimation&&!x(R),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":D.value!==null&&D.value!==n}),style:_(`animation-delay:${n*100}ms`),stroke:M.value.stroke,"stroke-width":t.strokeWidth<.5?.5:t.strokeWidth,cx:B.value.x,cy:Vn(t,n),r:Bn(t),fill:M.value.gradient.show?`url(#gradient_${T.value}_${n})`:t.color},null,14,vt),e.$slots.pattern?(v(),d(`circle`,{key:0,class:h({"vue-data-ui-transition":w.value&&x(I),"vue-rings-item-onload":!w.value&&A.value.useCssAnimation&&!x(R),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":D.value!==null&&D.value!==n}),style:_(`animation-delay:${n*100}ms`),stroke:M.value.stroke,"stroke-width":t.strokeWidth<.5?.5:t.strokeWidth,cx:B.value.x,cy:Vn(t,n),r:Bn(t),fill:`url(#pattern_${T.value}_${t.absoluteIndex})`},null,14,yt)):u(``,!0),f(`circle`,{stroke:`none`,cx:B.value.x,cy:Vn(t,n),r:Bn(t),fill:`transparent`,onMouseenter:e=>Un(t,n,`pointer`),onMouseleave:e=>Ln(t,n),onClick:e=>In(t,n)},null,40,bt),U.value.showLabels?(v(),d(qe,{key:1},[f(`rect`,{x:N.value.dataLabels.markers.position===`left`?X(t,n).x:B.value.x,y:X(t,n).y-N.value.dataLabels.markers.strokeWidth/2,width:Math.abs(B.value.x-X(t,n).x),height:N.value.dataLabels.markers.strokeWidth,fill:N.value.dataLabels.markers.stroke,rx:N.value.dataLabels.markers.strokeWidth,class:h({"vue-data-ui-transition":w.value&&x(I),"vue-rings-item-onload":!w.value&&A.value.useCssAnimation&&!x(R),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":D.value!==null&&D.value!==n})},null,10,xt),f(`circle`,{cx:X(t,n).x,cy:X(t,n).y,r:N.value.dataLabels.markers.radius,fill:t.color,stroke:F.value.backgroundColor,class:h({"vue-data-ui-transition":w.value&&x(I),"vue-rings-item-onload":!w.value&&A.value.useCssAnimation&&!x(R),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":D.value!==null&&D.value!==n})},null,10,St),f(`text`,{"text-anchor":N.value.dataLabels.markers.position===`left`?`end`:`start`,"font-size":N.value.dataLabels.fontSize,fill:N.value.dataLabels.color,"font-weight":N.value.dataLabels.bold?`bold`:`normal`,class:h({"vue-data-ui-transition":w.value&&x(I),"vue-rings-item-onload":!w.value&&A.value.useCssAnimation&&!x(R),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":D.value!==null&&D.value!==n}),transform:`translate(${X(t,n).x+(N.value.dataLabels.markers.position===`left`?-N.value.dataLabels.offsetX-14:N.value.dataLabels.offsetX)+6}, ${X(t,n).y+N.value.dataLabels.fontSize/3})`,onMouseenter:e=>Un(t,n,`pointer`),onMouseleave:e=>Ln(t,n),onClick:e=>In(t,n),innerHTML:x(oe)({content:zn(t),fontSize:N.value.dataLabels.fontSize,fill:N.value.dataLabels.color,x:0,y:0,translateY:!0})},null,42,Ct)],64)):u(``,!0)]))),128)),b(e.$slots,`svg`,{svg:{...W.value,isPrintingImg:x(_n)||x(vn)||x(ir),isPrintingSvg:x(ar)}},void 0,!0)],46,mt)),e.$slots.hint?(v(),d(`div`,wt,[b(e.$slots,`hint`,g(m({hint:A.value.a11y.translations.keyboardNavigation,isVisible:an.value})),void 0,!0)])):u(``,!0)]),e.$slots.watermark?(v(),d(`div`,Tt,[b(e.$slots,`watermark`,g(m({isPrinting:x(_n)||x(vn)||x(ir)||x(ar)})),void 0,!0)])):u(``,!0),f(`div`,{id:`legend-bottom-${T.value}`},null,8,Et),$t.value&&(F.value.legend.show||e.$slots.legend)?(v(),l(Je,{key:6,to:F.value.legend.position===`top`?`#legend-top-${T.value}`:`#legend-bottom-${T.value}`},[f(`div`,{ref_key:`chartLegend`,ref:Kt},[b(e.$slots,`legend`,{legend:Nn.value},()=>[F.value.legend.show?(v(),l(He,{key:`legend_${Zt.value}`,legendSet:Nn.value,config:Pn.value,isCursorPointer:L.value,onClickMarker:te[0]||=({legend:e})=>Dn(e.uid)},Ye({item:S(({legend:e,index:t})=>[x(R)?u(``,!0):(v(),d(`div`,{key:0,onClick:t=>Dn(e.uid),style:_(`opacity:${G.value.includes(e.uid)?.5:1}`)},at(e.display),13,Dt))]),legendToggle:S(()=>[Nn.value.length>2&&F.value.legend.selectAllToggle.show&&!x(R)?(v(),l(We,{key:0,backgroundColor:F.value.legend.selectAllToggle.backgroundColor,color:F.value.legend.selectAllToggle.color,fontSize:F.value.legend.fontSize,checked:G.value.length>0,isCursorPointer:L.value,onToggle:Tn},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):u(``,!0)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:S(({legend:e,index:t})=>[Ze(ze,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${T.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`])):u(``,!0)],!0)],512)],8,[`to`])):u(``,!0),e.$slots.source?(v(),d(`div`,{key:7,ref_key:`source`,ref:qt,dir:`auto`},[b(e.$slots,`source`,{},void 0,!0)],512)):u(``,!0),Ze(x(At),{teleportTo:P.value.teleportTo,show:U.value.showTooltip&&E.value&&G.value.length<C.dataset.length,backgroundColor:P.value.backgroundColor,color:P.value.color,borderRadius:P.value.borderRadius,borderColor:P.value.borderColor,borderWidth:P.value.borderWidth,fontSize:P.value.fontSize,backgroundOpacity:P.value.backgroundOpacity,position:P.value.position,offsetX:P.value.offsetX,offsetY:P.value.offsetY,parent:O.value,content:Ut.value,isFullscreen:$.value,isCustom:P.value.customFormat&&typeof P.value.customFormat==`function`,smooth:P.value.smooth,backdropFilter:P.value.backdropFilter,smoothForce:P.value.smoothForce,smoothSnapThreshold:P.value.smoothSnapThreshold,isA11yMode:rn.value===`keyboard`,a11yPosition:nn.value},{"tooltip-before":S(()=>[b(e.$slots,`tooltip-before`,g(m({...Hn.value})),void 0,!0)]),tooltip:S(()=>[b(e.$slots,`tooltip`,g(m({...Hn.value})),void 0,!0)]),"tooltip-after":S(()=>[b(e.$slots,`tooltip-after`,g(m({...Hn.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`]),Ht.value&&j.value.buttons.table?(v(),l(rt(Qn.value.component),Qe({key:8},Qn.value.props,{ref_key:`tableUnit`,ref:en,onClose:$n}),Ye({content:S(()=>[(v(),l(x(Nt),{key:`table_${Xt.value}`,colNames:Q.value.colNames,head:Q.value.head,body:Q.value.body,config:Q.value.config,title:A.value.table.useDialog?``:Qn.value.title,withCloseButton:!A.value.table.useDialog,isCursorPointer:L.value,onClose:$n},{th:S(({th:e})=>[e===`__SUM__`?(v(),d(`div`,Ot,[Ze(x(jt),{name:`sigma`,stroke:Q.value.config.th.color,size:16},null,8,[`stroke`])])):(v(),d(`div`,kt,at(e),1))]),td:S(({td:e})=>[Xe(at(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[A.value.table.useDialog?{name:`title`,fn:S(()=>[Xe(at(Qn.value.title),1)]),key:`0`}:void 0,A.value.table.useDialog?{name:`actions`,fn:S(()=>[f(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:te[1]||=e=>Wn(j.value.callbacks.csv),style:_({cursor:L.value?`pointer`:`default`})},[Ze(x(jt),{name:`fileCsv`,stroke:Qn.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):u(``,!0),b(e.$slots,`skeleton`,{},()=>[x(R)?(v(),l(je,{key:0})):u(``,!0)],!0)],46,ut))}},[[`__scopeId`,`data-v-08170d9a`]]);export{lt as n,At as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as ee}from"./annotationSlots-OLiW25XN.js";import{n as te,t as ne}from"./tableIntegration-CNoJ1CIY.js";import{t as re}from"./chartImage-DPGnEuYM.js";import{$ as o,D as ie,Dt as ae,Ht as s,J as oe,Jt as se,Kt as ce,S as le,X as ue,Yt as de,Zt as fe,at as pe,b as me,i as he,in as ge,nn as _e,nt as ve,pt as ye,t as be,w as xe,yt as Se,zt as Ce}from"./lib-rPeBMZrn.js";import{t as we}from"./labelUtils-CdtU-yB_.js";import{c as Te}from"./canvas-lib-22VpOI4_.js";import{n as Ee,t as De}from"./useHints-C-TwxM0Y.js";import{t as Oe}from"./useConfig-_JwRfIqE.js";import{t as ke}from"./usePrinter-DVf3YcG5.js";import{n as Ae,t as je}from"./BaseScanner-8NdoBs7B.js";import{t as Me}from"./useNestedProp-DnGoh-XS.js";import{t as Ne}from"./useResponsive-CENUxfEL.js";import{t as Pe}from"./useThemeCheck-BKNRbGeC.js";import{t as Fe}from"./useChartExport-BZts4KFb.js";import{t as Ie}from"./useTransitions-ChGGrtrv.js";import{t as Le}from"./useUserOptionState-CXlFnwPv.js";import{t as Re}from"./useChartAccessibility-DOMuYJfm.js";import{t as ze}from"./Shape-CRe8woTu.js";import{n as Be}from"./Title-BliHuXfT.js";import{t as Ve}from"./vue_ui_rings-C0puwNW1.js";import{t as He}from"./Legend-W9YVYVX-.js";import{t as Ue}from"./A11yDataTable-DWNlWXzs.js";import{t as We}from"./BaseLegendToggle-VzX69MCo.js";import{t as Ge}from"./DefGrad-DKMq1REY.js";import{t as Ke}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as qe,Teleport as Je,computed as c,createBlock as l,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createSlots as Ye,createTextVNode as Xe,createVNode as Ze,defineAsyncComponent as p,guardReactiveProps as m,mergeProps as Qe,nextTick as $e,normalizeClass as h,normalizeProps as g,normalizeStyle as _,onBeforeUnmount as et,onMounted as tt,openBlock as v,ref as y,renderList as nt,renderSlot as b,resolveDynamicComponent as rt,shallowRef as it,toDisplayString as at,toRefs as ot,unref as x,useSlots as st,watch as ct,withCtx as S}from"vue";var lt=/* @__PURE__ */ e({default:()=>At}),ut=[`id`],dt=[`id`],ft=[`id`],pt={style:{position:`relative`}},mt=[`xmlns`,`viewBox`,`aria-describedby`],ht=[`width`,`height`],gt={key:1},_t=[`stroke`,`cx`,`cy`,`r`,`fill`],vt=[`stroke`,`stroke-width`,`cx`,`cy`,`r`,`fill`],yt=[`stroke`,`stroke-width`,`cx`,`cy`,`r`,`fill`],bt=[`cx`,`cy`,`r`,`onMouseenter`,`onMouseleave`,`onClick`],xt=[`x`,`y`,`width`,`height`,`fill`,`rx`],St=[`cx`,`cy`,`r`,`fill`,`stroke`],Ct=[`text-anchor`,`font-size`,`fill`,`font-weight`,`transform`,`onMouseenter`,`onMouseleave`,`onClick`,`innerHTML`],wt={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Tt={key:5,class:`vue-data-ui-watermark`},Et=[`id`],Dt=[`onClick`],Ot={key:0},kt={key:1},At=/*#__PURE__*/ Ke({__name:`vue-ui-rings`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`copyAlt`],setup(e,{expose:Ke,emit:lt}){let At=p(()=>import(`./Tooltip-C1q0Qoh7.js`)),jt=p(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),Mt=p(()=>import(`./vue-ui-accordion-DxGxf-Rm.js`).then(e=>e.n)),Nt=p(()=>import(`./DataTable-KeuZB1JM.js`)),Pt=p(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),Ft=p(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),It=p(()=>import(`./PackageVersion-PdpqwkYX.js`).then(e=>e.t)),Lt=p(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_rings:Rt}=Oe(),{isThemeValid:zt,warnInvalidTheme:Bt}=Pe(),Vt=st(),C=e,w=y(!1),Ht=c(()=>!!C.dataset&&C.dataset.length),T=y(ue()),E=y(!1),Ut=y(``),D=y(null),Wt=y(0),O=y(null),Gt=y(null),Kt=y(null),qt=y(null),Jt=y(null),Yt=y(0),Xt=y(0),Zt=y(0),Qt=y(!1),$t=y(!1),en=y(null),tn=y(null),k=y(null),nn=y({x:0,y:0}),rn=y(`pointer`),an=y(!1),A=y(fn()),j=c(()=>A.value.userOptions),M=c(()=>A.value.style.chart.layout.rings),N=c(()=>A.value.style.chart.layout.labels),P=c(()=>A.value.style.chart.tooltip),F=c(()=>A.value.style.chart);Ee({config:()=>A.value,dataset:()=>C.dataset,component:`VueUiRings`,rules:[De.singleSeries,De.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series is > 6. Consider:`,``,`▶️ Grouping small values dynamically into a single "Other" series.`,``,`▶️ Using filters to let users choose a maximum number of series to display.`,``,`▶️ Using VueUiHorizontalBar instead to make the dataset breakdown easier to read.`]}]});let{transitionEnabled:I}=Ie({config:()=>A.value.transitions,dataset:()=>C.dataset}),L=c(()=>A.value.userOptions.useCursorPointer),on=c(()=>ge({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{rings:{stroke:`#6A6A6A`,gradient:{underlayerColor:`#FFFFFF`}},labels:{dataLabels:{show:!1}}},legend:{backgroundColor:`transparent`}}}},userConfig:A.value.skeletonConfig??{}})),{loading:R,FINAL_DATASET:sn,manualLoading:cn}=Ae({...ot(C),FINAL_CONFIG:A,prepareConfig:fn,skeletonDataset:C.config?.skeletonDataset??[{name:`_`,values:[13],color:`#808080`},{name:`_`,values:[8],color:`#969696`},{name:`_`,values:[5],color:`#ADADAD`},{name:`_`,values:[3],color:`#C4C4C4`},{name:`_`,values:[2],color:`#DBDBDB`}],skeletonConfig:ge({defaultConfig:A.value,userConfig:on.value})}),{userOptionsVisible:ln,setUserOptionsVisibility:un,keepUserOptionState:dn}=Le({config:A.value}),{svgRef:z}=Re({config:F.value.title});function fn(){let e=Me({userConfig:C.config,defaultConfig:Rt}),t=e.theme;if(!t)return e;if(!zt.value(e))return Bt(e),e;let n=Me({userConfig:Ve[t]||C.config,defaultConfig:e});return{...Me({userConfig:C.config,defaultConfig:n}),customPalette:e.customPalette.length?e.customPalette:_e[e.theme]||s}}let pn=fe(C.config);ct(()=>C.config,(e,t)=>{let n=fe(e),r=n!==pn;pn=n;let i=fn();r?(R.value||(A.value=i),ln.value=!A.value.userOptions.showOnChartHover,gn(),Yt.value+=1,Xt.value+=1,Zt.value+=1,U.value.showTable=A.value.table.show,U.value.showTooltip=P.value.show,U.value.showLabels=N.value.dataLabels.show,W.value.width=F.value.size,W.value.height=F.value.size):(A.value.style.chart.tooltip=i.style.chart.tooltip,U.value.showTooltip=A.value.style.chart.tooltip.show)},{deep:!0});let mn=c(()=>{let{markers:e}=N.value.dataLabels,t=Y.value/2,n=U.value.showLabels?e.position===`left`?t:-t:0,r=U.value.showLabels?W.value.width/2-t:0,i=e.position===`left`?r:-r;return{x:A.value.responsive?i:n/F.value.size*W.value.width,y:0/F.value.size*W.value.height}}),B=c(()=>({x:W.value.width/2+mn.value.x,y:W.value.height/2+mn.value.y}));ct(()=>C.dataset,e=>{Array.isArray(e)&&e.length>0&&(cn.value=!1)},{deep:!0});let V=it(null),H=it(null);tt(()=>{$t.value=!0,gn()});let hn=c(()=>A.value.debug);function gn(){if(Ce(C.dataset)?(pe({componentName:`VueUiRings`,type:`dataset`,debug:hn.value}),cn.value=!0):C.dataset.forEach((e,t)=>{e.values.length||(pe({componentName:`VueUiRings`,type:`dataset`,debug:hn.value}),cn.value=!0),Se({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{pe({componentName:`VueUiRings`,type:`datasetSerieAttribute`,property:e,index:t,debug:hn.value})})}),Ce(C.dataset)||(cn.value=A.value.loading),A.value.responsive){let e=Te(()=>{Qt.value=!0;let{width:e,height:t}=Ne({chart:O.value,title:F.value.title.text?Gt.value:null,legend:F.value.legend.show?Kt.value:null,source:qt.value,noTitle:Jt.value});requestAnimationFrame(()=>{W.value.width=e,W.value.height=t-12,Qt.value=!1})});V.value&&(H.value&&V.value.unobserve(H.value),V.value.disconnect()),V.value=new ResizeObserver(e),H.value=O.value.parentNode,V.value.observe(H.value)}setTimeout(()=>{w.value=!0},600)}et(()=>{V.value&&(H.value&&V.value.unobserve(H.value),V.value.disconnect())});let{isPrinting:_n,isImaging:vn,generatePdf:yn,generateImage:bn}=ke({elementId:`rings_${T.value}`,fileName:F.value.title.text||`vue-ui-rings`,options:A.value.userOptions.print}),xn=c(()=>A.value.userOptions.show&&!F.value.title.text),Sn=c(()=>xe(A.value.customPalette)),U=y({showTable:A.value.table.show,showTooltip:P.value.show,showLabels:N.value.dataLabels.show});ct(A,()=>{U.value={showTable:A.value.table.show,showTooltip:P.value.show,showLabels:N.value.dataLabels.show}},{immediate:!0});let W=y({height:F.value.size,width:F.value.size}),Cn=c(()=>Math.min(W.value.height,W.value.width)),wn=lt,G=y([]);function Tn(){G.value.length?G.value=[]:Nn.value.forEach(e=>{G.value.push(e.uid)}),En()}function En(){wn(`selectLegend`,J.value.map(e=>({name:e.name,color:e.color,value:e.value})))}function Dn(e){if(G.value.includes(e))G.value=G.value.filter(t=>t!==e);else{if(G.value.length===K.value.length-1)return;G.value.push(e)}En()}function On(e){return K.value.length?K.value.find(t=>t.name===e)||(hn.value&&console.warn(`VueUiRings - Series name not found "${e}"`),null):(hn.value&&console.warn(`VueUiRings - There are no series to show.`),null)}function kn(e){let t=On(e);t!==null&&G.value.includes(t.uid)&&Dn(t.uid)}function An(e){let t=On(e);t!==null&&(G.value.includes(t.uid)||Dn(t.uid))}let jn=c(()=>Math.max(...K.value.filter(e=>!G.value.includes(e.uid)).map(({value:e})=>e)));function Mn(e){return e/jn.value}let K=c(()=>sn.value.map(({values:e,name:t,color:n=null},r)=>{let i=ce(e).reduce((e,t)=>e+t,0);return{name:t,color:n||le(n)||Sn.value[r]||s[r]||s[r%s.length],value:i,proportion:i/sn.value.map(e=>(e.values||[]).reduce((e,t)=>e+t,0)).reduce((e,t)=>e+t,0),uid:ue(),absoluteIndex:r}})),Nn=c(()=>K.value.map((e,t)=>{let n=he(N.value.dataLabels.formatter,e.value,o({p:N.value.dataLabels.prefix,v:e.value,s:N.value.dataLabels.suffix,r:F.value.legend.roundingValue}),{datapoint:e,index:t}),r=isNaN(e.value/q.value)?`-`:o({v:e.value/q.value*100,s:`%`,r:F.value.legend.roundingPercentage}),i=Rn({showVal:F.value.legend.showValue,showPercentage:F.value.legend.showPercentage,val:n,percentage:G.value.includes(e.uid)?`-%`:r});return{...e,shape:`circle`,opacity:G.value.includes(e.uid)?.5:1,segregate:()=>Dn(e.uid),isSegregated:G.value.includes(e.uid),display:`${e.name}${F.value.legend.showPercentage||F.value.legend.showValue?`: `:``}${i}`}}).toSorted((e,t)=>t.value-e.value)),Pn=c(()=>({cy:`rings-div-legend`,backgroundColor:F.value.legend.backgroundColor,color:F.value.legend.color,fontSize:F.value.legend.fontSize,paddingBottom:12,fontWeight:F.value.legend.bold?`bold`:``})),q=c(()=>K.value.filter(e=>!G.value.includes(e.uid)).map(({value:e})=>e).reduce((e,t)=>e+t,0)),J=c(()=>K.value.filter(e=>!G.value.includes(e.uid)).map(({name:e,value:t,color:n=null,uid:r,absoluteIndex:i},a)=>({absoluteIndex:i,uid:r,name:e,color:n||le(n)||Sn.value[a]||s[a]||s[a%s.length],value:t,proportion:Mn(t),percentage:t/q.value*100,strokeWidth:M.value.strokeWidth*Mn(t)})).toSorted((e,t)=>t.value-e.value));function Fn(){return J.value.map(({name:e,color:t,value:n,absoluteValues:r,percentage:i})=>({name:e,color:t,value:n,absoluteValues:r,percentage:i}))}let Y=c(()=>Cn.value-M.value.strokeWidth*2);function In(e,t){A.value.events.datapointClick&&A.value.events.datapointClick({datapoint:e,seriesIndex:t})}function Ln(e,t){D.value=null,E.value=!1,k.value=null,rn.value=`pointer`,A.value.events.datapointLeave&&A.value.events.datapointLeave({datapoint:e,seriesIndex:t})}function Rn({val:e,percentage:t,showVal:n,showPercentage:r}){let i=N.value.dataLabels;return we({config:i,val:e,percentage:t,showVal:n,showPercentage:r})}function zn(e){let t=N.value.dataLabels,n=he(t.formatter,e.value,o({p:t.prefix,v:e.value,s:t.suffix,r:t.roundingValue})),r=o({v:e.percentage,s:`%`,r:t.roundingPercentage});return`${e.name}\n${Rn({val:n,percentage:r,showVal:t.showValue,showPercentage:t.showPercentage})}`}function Bn(e){return me(Y.value*e.proportion/2*.9<=0?1e-4:Y.value*e.proportion/2*.9)}function Vn(e,t){return t===0?B.value.y:B.value.y+Y.value*J.value[0].proportion/2-Y.value*e.proportion/2-2*(t+1)}function X(e,t){let n=N.value.dataLabels.markers.position===`left`?-(Y.value/2):Y.value/2;return{x:B.value.x+n,y:Vn(e,t)-Bn(e)}}let Hn=y(null);function Un(e,t,n=`pointer`){if(A.value.events.datapointEnter&&A.value.events.datapointEnter({datapoint:e,seriesIndex:t}),G.value.length===C.dataset.length)return;Hn.value={datapoint:e,seriesIndex:t,series:J.value,config:A.value},D.value=t,k.value=t,rn.value=n;let r=J.value[t],i=P.value.customFormat;if(ae(i)&&ye(()=>i({seriesIndex:t,datapoint:e,series:J.value,config:A.value})))Ut.value=i({seriesIndex:t,datapoint:e,series:J.value,config:A.value});else{let n=``;n+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${P.value.borderColor};padding-bottom:6px;margin-bottom:3px;">${r.name}</div>`,n+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 60 60" height="14" width="14"><circle cx="30" cy="30" r="30" stroke="none" fill="${r.color}" />${Vt.pattern?`<circle cx="30" cy="30" r="30" stroke="none" fill="url(#pattern_${T.value}_${e.absoluteIndex})" />`:``}</svg>`,n+=`<b>${Rn({showVal:P.value.showValue,showPercentage:P.value.showPercentage,val:`<span>${he(N.value.dataLabels.formatter,r.value,o({p:N.value.dataLabels.prefix,v:r.value,s:N.value.dataLabels.suffix,r:P.value.roundingValue}),{datapoint:e,seriesIndex:t})}</span>`,percentage:o({v:r.value/q.value*100,s:`%`,r:P.value.roundingPercentage})})}</b></div>`,Ut.value=n}E.value=!0}let Z=c(()=>({head:J.value.map(e=>({name:e.name,color:e.color})),body:J.value.map(e=>e.value)})),Q=c(()=>{let e=[`__SUM__`,o({p:N.value.dataLabels.prefix,v:q.value,s:N.value.dataLabels.suffix,r:A.value.table.td.roundingValue}),`100%`],t=Z.value.head.map((e,t)=>[{color:e.color,name:e.name},o({p:N.value.dataLabels.prefix,v:Z.value.body[t],s:N.value.dataLabels.suffix,r:A.value.table.td.roundingValue}),isNaN(Z.value.body[t]/q.value)?`-`:(Z.value.body[t]/q.value*100).toFixed(A.value.table.td.roundingPercentage)+`%`]);return{head:e,body:t,a11yBody:t.map(e=>e.map((e,t)=>t===0?e.name:e)),config:{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},colNames:[A.value.table.columnNames.series,A.value.table.columnNames.value,A.value.table.columnNames.percentage]}});function Wn(e=null){$e(()=>{let t=Z.value.head.map((e,t)=>[[e.name],[Z.value.body[t]],[isNaN(Z.value.body[t]/q.value)?`-`:Z.value.body[t]/q.value*100]]),n=[[F.value.title.text],[F.value.title.subtitle.text],[[``],[`val`],[`%`]]].concat(t),r=ie(n);e?e(r):ve({csvContent:r,title:F.value.title.text||`vue-ui-rings`})})}let $=y(!1);function Gn(e){$.value=e,Wt.value+=1}function Kn(){U.value.showTable=!U.value.showTable}function qn(){U.value.showTooltip=!U.value.showTooltip}function Jn(){U.value.showLabels=!U.value.showLabels}let Yn=y(!1);function Xn(){Yn.value=!Yn.value}let Zn=re(O,()=>F.value.title.text),Qn=c(()=>ne({config:A,style:F,mutableConfig:U,dialog:Lt,accordion:Mt,isFullscreen:$,parent:O,maxWidth:800,isCursorPointer:L}));ct(()=>U.value.showTable,e=>te(e,A,en));function $n(){U.value.showTable=!1,tn.value&&tn.value.setTableIconState(!1)}let er=c(()=>Nn.value.map(e=>({...e,name:e.display}))),tr=c(()=>F.value.backgroundColor),nr=c(()=>F.value.legend),rr=c(()=>F.value.title),{isCallbackImaging:ir,isCallbackSvg:ar,generateSvg:or,onGenerateImage:sr}=Fe({svg:z,title:rr,legend:nr,legendItems:er,backgroundColor:tr,getSvgCallback:()=>A.value.userOptions.callbacks.svg,generateImage:bn});async function cr(){wn(`copyAlt`,{config:A.value,dataset:J.value}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:J.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function lr(){k.value=null,an.value=!0}function ur(){k.value=null,rn.value=`pointer`,E.value=!1,D.value=null,an.value=!1}function dr(e){if(!z.value||Yn.value||document.activeElement!==z.value||!J.value.length||G.value.length===C.dataset.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){k.value=null,rn.value=`pointer`,E.value=!1,D.value=null;return}if(r){if(k.value===null)return;let e=J.value[k.value];if(!e)return;In(e,k.value);return}let a=k.value;a===null||a<0||a>=J.value.length?a=n?0:J.value.length-1:n?(a+=1,a>=J.value.length&&(a=0)):t&&(--a,a<0&&(a=J.value.length-1));let ee=J.value[a];ee&&(fr(a),Un(ee,a,`keyboard`))}function fr(e){if(!Number.isFinite(e)||!z.value)return;let t=J.value[e];if(!t)return;let n=X(t,e),r=z.value.getBoundingClientRect();nn.value={x:r.left+n.x/W.value.width*r.width,y:r.top+n.y/W.value.height*r.height}}let pr=c(()=>({headers:Q.value?.colNames??[],rows:Q.value?.a11yBody??[]}));return Ke({getData:Fn,getImage:Zn,generatePdf:yn,generateCsv:Wn,generateImage:bn,generateSvg:or,hideSeries:An,showSeries:kn,toggleTable:Kn,toggleTooltip:qn,toggleAnnotator:Xn,toggleFullscreen:Gn,toggleLabels:Jn,copyAlt:cr}),(e,te)=>(v(),d(`div`,{ref_key:`ringsChart`,ref:O,class:h(`vue-data-ui-component vue-ui-rings ${$.value?`vue-data-ui-wrapper-fullscreen`:``} ${A.value.useCssAnimation?``:`vue-ui-dna`}`),style:_(`font-family:${A.value.style.fontFamily};text-align:center;width:100%;background:${F.value.backgroundColor};${A.value.responsive?`height: 100%`:``}`),id:`rings_${T.value}`,onMouseleave:te[2]||=e=>{D.value=null,E.value=!1,x(un)(!1)},onMouseenter:te[3]||=()=>x(un)(!0)},[f(`div`,{id:`chart-instructions-${T.value}`,class:`sr-only`},[f(`p`,null,at(A.value.a11y.translations.keyboardNavigation),1)],8,dt),pr.value?.rows?.length?(v(),l(Ue,{key:0,uid:T.value,head:pr.value.headers,body:pr.value.rows,notice:A.value.a11y.translations.tableAvailable,caption:A.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):u(``,!0),j.value.buttons.annotator?(v(),l(x(Pt),Qe({key:1},x(a)(j.value.annotator),{svgRef:x(z),backgroundColor:F.value.backgroundColor,color:F.value.color,active:Yn.value,isCursorPointer:L.value,palette:j.value.annotatorPalette,onClose:Xn}),Ye({_:2},[nt(x(ee),t=>({name:t,fn:S(n=>[b(e.$slots,t,g(m(x(i)(t,n))),void 0,!0)])}))]),1040,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):u(``,!0),xn.value?(v(),d(`div`,{key:2,ref_key:`noTitle`,ref:Jt,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):u(``,!0),F.value.title.text?(v(),d(`div`,{key:3,ref_key:`chartTitle`,ref:Gt,style:`width:100%;background:transparent`},[(v(),l(Be,{key:`title_${Yt.value}`,config:{title:{cy:`rings-div-title`,...F.value.title},subtitle:{cy:`rings-div-subtitle`,...F.value.title.subtitle}}},null,8,[`config`]))],512)):u(``,!0),f(`div`,{id:`legend-top-${T.value}`},null,8,ft),j.value.show&&Ht.value&&(x(dn)||x(ln))?(v(),l(x(Ft),Qe({ref_key:`userOptionsRef`,ref:tn,key:`user_options_${Wt.value}`,backgroundColor:F.value.backgroundColor,color:F.value.color,isPrinting:x(_n),isImaging:x(vn),uid:T.value,hasTooltip:j.value.buttons.tooltip&&P.value.show,isTooltip:U.value.showTooltip,isFullscreen:$.value,chartElement:O.value},x(n)(j.value,`pdf csv img svg labels table fullscreen altCopy annotator`),{isAnnotation:Yn.value,tableDialog:A.value.table.useDialog,isCursorPointer:L.value,onToggleFullscreen:Gn,onGeneratePdf:x(yn),onGenerateCsv:Wn,onGenerateImage:x(sr),onGenerateSvg:x(or),onToggleTable:Kn,onToggleTooltip:qn,onToggleAnnotator:Xn,onToggleLabels:Jn,onCopyAlt:cr,style:{visibility:x(dn)?x(ln)?`visible`:`hidden`:`visible`}}),Ye({_:2},[nt(x(t)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionLabels optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:S(n=>[b(e.$slots,t,g(m(x(r)(t,n))),void 0,!0)])}))]),1040,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasTooltip`,`isTooltip`,`isFullscreen`,`chartElement`,`isAnnotation`,`tableDialog`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):u(``,!0),f(`div`,pt,[(v(),d(`svg`,{ref_key:`svgRef`,ref:z,xmlns:x(be),class:h({"vue-data-ui-fullscreen--on":$.value,"vue-data-ui-fulscreen--off":!$.value,resizing:Qt.value||x(R),"vue-data-ui-no-transition":!x(I)}),viewBox:`0 0 ${W.value.width<=0?10:W.value.width} ${W.value.height<=0?10:W.value.height}`,style:_(`max-width:100%;overflow:hidden;background:transparent;color:${F.value.color}`),"aria-describedby":`chart-instructions-${T.value}`,tabindex:`0`,onFocus:lr,onBlur:ur,onKeydown:dr},[Ze(x(It)),b(e.$slots,`svg-underlayer`,{svg:{...W.value,isPrintingImg:x(_n)||x(vn)||x(ir),isPrintingSvg:x(ar)}},void 0,!0),e.$slots[`chart-background`]?(v(),d(`foreignObject`,{key:0,x:0,y:0,width:W.value.width<=0?10:W.value.width,height:W.value.height<=0?10:W.value.height,style:{pointerEvents:`none`}},[b(e.$slots,`chart-background`,{},void 0,!0)],8,ht)):u(``,!0),f(`defs`,null,[(v(!0),d(qe,null,nt(J.value,(e,t)=>(v(),l(Ge,{t:`radial`,cx:`50%`,cy:`30%`,r:`50%`,fx:`50%`,fy:`50%`,id:`gradient_${T.value}_${t}`,key:`gradient_${T.value}_${t}`,stops:[[`0%`,x(se)(x(de)(e.color,.05),100-M.value.gradient.intensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128))]),e.$slots.pattern?(v(),d(`g`,gt,[(v(!0),d(qe,null,nt(J.value,t=>(v(),d(`defs`,null,[b(e.$slots,`pattern`,Qe({ref_for:!0},{seriesIndex:t.absoluteIndex,patternId:`pattern_${T.value}_${t.absoluteIndex}`}),void 0,!0)]))),256))])):u(``,!0),(v(!0),d(qe,null,nt(J.value,(t,n)=>(v(),d(`g`,{key:`r_${t.uid}`},[f(`circle`,{class:h({"vue-data-ui-transition":w.value&&x(I),"vue-rings-item-onload":!w.value&&A.value.useCssAnimation&&!x(R),"vue-ui-rings-opacity":D.value!==null&&D.value!==n}),style:_(`animation-delay:${n*100}ms`),stroke:M.value.stroke,cx:B.value.x,cy:Vn(t,n),r:Bn(t),fill:M.value.gradient.underlayerColor},null,14,_t),f(`circle`,{class:h({"vue-data-ui-transition":w.value&&x(I),"vue-rings-item-onload":!w.value&&A.value.useCssAnimation&&!x(R),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":D.value!==null&&D.value!==n}),style:_(`animation-delay:${n*100}ms`),stroke:M.value.stroke,"stroke-width":t.strokeWidth<.5?.5:t.strokeWidth,cx:B.value.x,cy:Vn(t,n),r:Bn(t),fill:M.value.gradient.show?`url(#gradient_${T.value}_${n})`:t.color},null,14,vt),e.$slots.pattern?(v(),d(`circle`,{key:0,class:h({"vue-data-ui-transition":w.value&&x(I),"vue-rings-item-onload":!w.value&&A.value.useCssAnimation&&!x(R),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":D.value!==null&&D.value!==n}),style:_(`animation-delay:${n*100}ms`),stroke:M.value.stroke,"stroke-width":t.strokeWidth<.5?.5:t.strokeWidth,cx:B.value.x,cy:Vn(t,n),r:Bn(t),fill:`url(#pattern_${T.value}_${t.absoluteIndex})`},null,14,yt)):u(``,!0),f(`circle`,{stroke:`none`,cx:B.value.x,cy:Vn(t,n),r:Bn(t),fill:`transparent`,onMouseenter:e=>Un(t,n,`pointer`),onMouseleave:e=>Ln(t,n),onClick:e=>In(t,n)},null,40,bt),U.value.showLabels?(v(),d(qe,{key:1},[f(`rect`,{x:N.value.dataLabels.markers.position===`left`?X(t,n).x:B.value.x,y:X(t,n).y-N.value.dataLabels.markers.strokeWidth/2,width:Math.abs(B.value.x-X(t,n).x),height:N.value.dataLabels.markers.strokeWidth,fill:N.value.dataLabels.markers.stroke,rx:N.value.dataLabels.markers.strokeWidth,class:h({"vue-data-ui-transition":w.value&&x(I),"vue-rings-item-onload":!w.value&&A.value.useCssAnimation&&!x(R),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":D.value!==null&&D.value!==n})},null,10,xt),f(`circle`,{cx:X(t,n).x,cy:X(t,n).y,r:N.value.dataLabels.markers.radius,fill:t.color,stroke:F.value.backgroundColor,class:h({"vue-data-ui-transition":w.value&&x(I),"vue-rings-item-onload":!w.value&&A.value.useCssAnimation&&!x(R),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":D.value!==null&&D.value!==n})},null,10,St),f(`text`,{"text-anchor":N.value.dataLabels.markers.position===`left`?`end`:`start`,"font-size":N.value.dataLabels.fontSize,fill:N.value.dataLabels.color,"font-weight":N.value.dataLabels.bold?`bold`:`normal`,class:h({"vue-data-ui-transition":w.value&&x(I),"vue-rings-item-onload":!w.value&&A.value.useCssAnimation&&!x(R),"vue-ui-rings-shadow":M.value.useShadow,"vue-ui-rings-blur":D.value!==null&&D.value!==n}),transform:`translate(${X(t,n).x+(N.value.dataLabels.markers.position===`left`?-N.value.dataLabels.offsetX-14:N.value.dataLabels.offsetX)+6}, ${X(t,n).y+N.value.dataLabels.fontSize/3})`,onMouseenter:e=>Un(t,n,`pointer`),onMouseleave:e=>Ln(t,n),onClick:e=>In(t,n),innerHTML:x(oe)({content:zn(t),fontSize:N.value.dataLabels.fontSize,fill:N.value.dataLabels.color,x:0,y:0,translateY:!0})},null,42,Ct)],64)):u(``,!0)]))),128)),b(e.$slots,`svg`,{svg:{...W.value,isPrintingImg:x(_n)||x(vn)||x(ir),isPrintingSvg:x(ar)}},void 0,!0)],46,mt)),e.$slots.hint?(v(),d(`div`,wt,[b(e.$slots,`hint`,g(m({hint:A.value.a11y.translations.keyboardNavigation,isVisible:an.value})),void 0,!0)])):u(``,!0)]),e.$slots.watermark?(v(),d(`div`,Tt,[b(e.$slots,`watermark`,g(m({isPrinting:x(_n)||x(vn)||x(ir)||x(ar)})),void 0,!0)])):u(``,!0),f(`div`,{id:`legend-bottom-${T.value}`},null,8,Et),$t.value&&(F.value.legend.show||e.$slots.legend)?(v(),l(Je,{key:6,to:F.value.legend.position===`top`?`#legend-top-${T.value}`:`#legend-bottom-${T.value}`},[f(`div`,{ref_key:`chartLegend`,ref:Kt},[b(e.$slots,`legend`,{legend:Nn.value},()=>[F.value.legend.show?(v(),l(He,{key:`legend_${Zt.value}`,legendSet:Nn.value,config:Pn.value,isCursorPointer:L.value,onClickMarker:te[0]||=({legend:e})=>Dn(e.uid)},Ye({item:S(({legend:e,index:t})=>[x(R)?u(``,!0):(v(),d(`div`,{key:0,onClick:t=>Dn(e.uid),style:_(`opacity:${G.value.includes(e.uid)?.5:1}`)},at(e.display),13,Dt))]),legendToggle:S(()=>[Nn.value.length>2&&F.value.legend.selectAllToggle.show&&!x(R)?(v(),l(We,{key:0,backgroundColor:F.value.legend.selectAllToggle.backgroundColor,color:F.value.legend.selectAllToggle.color,fontSize:F.value.legend.fontSize,checked:G.value.length>0,isCursorPointer:L.value,onToggle:Tn},null,8,[`backgroundColor`,`color`,`fontSize`,`checked`,`isCursorPointer`])):u(``,!0)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:S(({legend:e,index:t})=>[Ze(ze,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${T.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`])):u(``,!0)],!0)],512)],8,[`to`])):u(``,!0),e.$slots.source?(v(),d(`div`,{key:7,ref_key:`source`,ref:qt,dir:`auto`},[b(e.$slots,`source`,{},void 0,!0)],512)):u(``,!0),Ze(x(At),{teleportTo:P.value.teleportTo,show:U.value.showTooltip&&E.value&&G.value.length<C.dataset.length,backgroundColor:P.value.backgroundColor,color:P.value.color,borderRadius:P.value.borderRadius,borderColor:P.value.borderColor,borderWidth:P.value.borderWidth,fontSize:P.value.fontSize,backgroundOpacity:P.value.backgroundOpacity,position:P.value.position,offsetX:P.value.offsetX,offsetY:P.value.offsetY,parent:O.value,content:Ut.value,isFullscreen:$.value,isCustom:P.value.customFormat&&typeof P.value.customFormat==`function`,smooth:P.value.smooth,backdropFilter:P.value.backdropFilter,smoothForce:P.value.smoothForce,smoothSnapThreshold:P.value.smoothSnapThreshold,isA11yMode:rn.value===`keyboard`,a11yPosition:nn.value},{"tooltip-before":S(()=>[b(e.$slots,`tooltip-before`,g(m({...Hn.value})),void 0,!0)]),tooltip:S(()=>[b(e.$slots,`tooltip`,g(m({...Hn.value})),void 0,!0)]),"tooltip-after":S(()=>[b(e.$slots,`tooltip-after`,g(m({...Hn.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`]),Ht.value&&j.value.buttons.table?(v(),l(rt(Qn.value.component),Qe({key:8},Qn.value.props,{ref_key:`tableUnit`,ref:en,onClose:$n}),Ye({content:S(()=>[(v(),l(x(Nt),{key:`table_${Xt.value}`,colNames:Q.value.colNames,head:Q.value.head,body:Q.value.body,config:Q.value.config,title:A.value.table.useDialog?``:Qn.value.title,withCloseButton:!A.value.table.useDialog,isCursorPointer:L.value,onClose:$n},{th:S(({th:e})=>[e===`__SUM__`?(v(),d(`div`,Ot,[Ze(x(jt),{name:`sigma`,stroke:Q.value.config.th.color,size:16},null,8,[`stroke`])])):(v(),d(`div`,kt,at(e),1))]),td:S(({td:e})=>[Xe(at(e.name||e),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[A.value.table.useDialog?{name:`title`,fn:S(()=>[Xe(at(Qn.value.title),1)]),key:`0`}:void 0,A.value.table.useDialog?{name:`actions`,fn:S(()=>[f(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:te[1]||=e=>Wn(j.value.callbacks.csv),style:_({cursor:L.value?`pointer`:`default`})},[Ze(x(jt),{name:`fileCsv`,stroke:Qn.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):u(``,!0),b(e.$slots,`skeleton`,{},()=>[x(R)?(v(),l(je,{key:0})):u(``,!0)],!0)],46,ut))}},[[`__scopeId`,`data-v-08170d9a`]]);export{lt as n,At as t};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{n as s,t as c}from"./tableIntegration-CNoJ1CIY.js";import{n as l}from"./resolveChartConfig-0IvbmIE_.js";import{$ as u,Ct as d,D as f,Dt as p,F as m,Ht as h,Jt as g,P as ee,Qt as te,S as ne,X as re,_ as ie,at as ae,b as oe,i as se,in as ce,jt as le,nt as ue,pt as de,t as fe,tn as pe,v as me,w as he,yt as ge,zt as _e}from"./lib-rPeBMZrn.js";import{n as ve,t as ye}from"./useHints-C-TwxM0Y.js";import{t as be}from"./useSvgLabelLayout-42Kats14.js";import{t as xe}from"./useConfig-_JwRfIqE.js";import{n as Se,t as Ce}from"./BaseScanner-8NdoBs7B.js";import{t as we}from"./usePrinter-DVf3YcG5.js";import{t as Te}from"./useResponsive-CENUxfEL.js";import{t as Ee}from"./useChartExport-BZts4KFb.js";import{t as De}from"./useTransitions-ChGGrtrv.js";import{t as Oe}from"./useUserOptionState-CXlFnwPv.js";import{t as ke}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ae}from"./img-D4RQwASc.js";import{t as je}from"./Shape-CRe8woTu.js";import{n as Me}from"./Title-BliHuXfT.js";import{t as Ne}from"./vue_ui_scatter-4as114Wa.js";import{t as Pe}from"./Legend-W9YVYVX-.js";import{t as Fe}from"./A11yDataTable-DWNlWXzs.js";import{t as Ie}from"./BaseLegendToggle-VzX69MCo.js";import{t as Le}from"./DefGrad-DKMq1REY.js";import{t as Re}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as _,Teleport as ze,computed as v,createBlock as y,createCommentVNode as b,createElementBlock as x,createElementVNode as S,createSlots as Be,createTextVNode as Ve,createVNode as He,defineAsyncComponent as Ue,guardReactiveProps as We,mergeProps as Ge,nextTick as Ke,normalizeClass as qe,normalizeProps as Je,normalizeStyle as Ye,onBeforeUnmount as Xe,onMounted as Ze,openBlock as C,ref as w,renderList as T,renderSlot as E,resolveDynamicComponent as Qe,shallowRef as $e,toDisplayString as D,toRefs as et,unref as O,watch as tt,withCtx as k}from"vue";var nt=/* @__PURE__ */ e({default:()=>yn}),rt=[`id`],it=[`id`],at={key:0,class:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`},ot=[`id`],st={style:{position:`relative`}},ct=[`xmlns`,`aria-describedby`,`viewBox`],lt=[`width`,`height`],ut={key:1},dt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ft=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],pt={key:2},mt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ht=[`opacity`],gt=[`stroke`,`stroke-width`,`d`],_t=[`transform`,`font-size`,`fill`,`stroke`],vt={key:4},yt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],bt=[`opacity`],xt=[`d`,`stroke`,`stroke-width`],St=[`transform`,`font-size`,`fill`,`stroke`],Ct={key:6},wt=[`data-cy`,`fill`,`stroke`,`stroke-width`,`rx`],Tt=[`onMouseenter`],Et={key:2,style:{"pointer-events":`none`}},Dt=[`fill`,`fill-opacity`],Ot=[`stroke`,`stroke-dasharray`,`stroke-width`],kt={key:0,style:{"pointer-events":`none`}},At=[`d`,`stroke`,`stroke-width`],jt=[`d`,`stroke`,`stroke-width`],Mt=[`d`,`stroke`,`stroke-width`],Nt=[`d`,`stroke`,`stroke-width`],Pt={key:7},Ft=[`points`,`fill`,`stroke-width`,`stroke-dasharray`,`stroke`],It={key:0,class:`vue-ui-scatter-datapoint`},Lt=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`,`onMouseover`,`onMouseleave`,`onClick`],Rt={key:1},zt=[`transform`,`font-size`,`fill`,`onMouseover`,`onMouseleave`,`onClick`],Bt=[`d`,`fill`,`stroke`,`stroke-width`,`stroke-opacity`],Vt={key:0,style:{"pointer-events":`none`}},Ht=[`x`,`y`,`width`,`height`],Ut={key:0,style:{"pointer-events":`none !important`}},Wt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],Gt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],Kt=[`x`,`y`,`font-size`,`fill`,`font-weight`,`text-anchor`],qt=[`x`,`y`,`font-size`,`fill`,`font-weight`],Jt=[`x`,`y`,`font-size`,`fill`],Yt=[`x`,`y`,`font-size`,`fill`],Xt=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Zt=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Qt=[`x`,`y`,`font-size`,`fill`,`font-weight`,`text-anchor`],$t=[`id`,`transform`,`font-size`,`font-weight`,`fill`],en=[`font-size`,`fill`,`transform`],tn=[`transform`,`font-size`,`fill`],nn=[`x`,`y`,`font-size`,`fill`],rn=[`x`,`y`,`font-size`,`fill`],an=[`font-size`,`font-weight`,`fill`,`x`,`y`],on=[`id`],sn=[`x`,`y`,`width`,`height`],cn={key:14,style:{pointerEvents:`none`}},ln=[`x1`,`x2`,`y1`,`y2`,`stroke-dasharray`,`stroke`,`stroke-width`,`clip-path`],un=[`x`,`y`,`fill`,`font-size`,`font-weight`],dn={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},fn={key:6,class:`vue-data-ui-watermark`},pn=[`id`],mn=[`onClick`],hn={key:0,style:{width:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`}},gn={viewBox:`0 0 20 20`,height:`20`,width:`20`,style:{overflow:`hidden`,background:`transparent`}},_n={key:0},vn=[`innerHTML`],yn=/*#__PURE__*/ Re({__name:`vue-ui-scatter`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`copyAlt`,`selectLegend`],setup(e,{expose:Re,emit:nt}){let yn=Ue(()=>import(`./Tooltip-C1q0Qoh7.js`)),bn=Ue(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),xn=Ue(()=>import(`./vue-ui-accordion-DxGxf-Rm.js`).then(e=>e.n)),Sn=Ue(()=>import(`./DataTable-KeuZB1JM.js`)),Cn=Ue(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),wn=Ue(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Tn=Ue(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),En=Ue(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_scatter:Dn}=xe(),A=e,On=nt,kn=v(()=>!!A.dataset&&A.dataset.length),j=w(re()),An=w(!1),jn=w(``),Mn=w(0),Nn=w(null),Pn=w(null),Fn=w(null),In=w(null),Ln=w(null),Rn=w(0),zn=w(0),Bn=w(0),M=w([]),Vn=w(!1),Hn=w(null),Un=w(null),Wn=w(null),Gn=w(null),Kn=w(null),qn=w(null),Jn=w(null),Yn=w(null),Xn=w(null),Zn=w(null),Qn=w(null),$n=w({x:0,y:0}),er=w(`pointer`),tr=w(!1),nr=w(null),N=w(hr()),rr=v(()=>N.value.userOptions),P=v(()=>N.value.style.layout.dataLabels.xAxis),F=v(()=>N.value.style.layout.dataLabels.yAxis),I=v(()=>N.value.style.layout.marginalBars),L=v(()=>N.value.style.layout.plots),R=v(()=>N.value.style.tooltip),z=v(()=>N.value.style);ve({config:()=>N.value,dataset:()=>A.dataset,component:`VueUiScatter`,rules:[ye.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series (clusters) is > 6. Consider:`,``,``,`▶️ Using filters to let users choose a maximum number of series (clusters) to display.`]}]});let{transitionEnabled:ir}=De({config:()=>N.value.transitions,dataset:()=>A.dataset}),ar=v(()=>N.value.userOptions.useCursorPointer),or=v(()=>p(N.value.events?.datapointClick));function sr(e=100,t=.8,n={}){let{meanX:r=0,sdX:i=1,meanY:a=0,sdY:o=1,seed:s}=n,c=(s??Math.floor(Math.random()*2**31))>>>0,l=()=>(c=c*1664525+1013904223>>>0,c/2**32),u=()=>{let e=0,t=0;for(;e===0;)e=l();for(;t===0;)t=l();return Math.sqrt(-2*Math.log(e))*Math.cos(2*Math.PI*t)},d=e/2,f=Array.from({length:d},u),p=Array.from({length:d},u),m=e=>e.reduce((e,t)=>e+t,0)/e.length,h=m(f),g=m(p);for(let e=0;e<d;e+=1)f[e]-=h,p[e]-=g;let ee=(e,t)=>e.reduce((e,n,r)=>e+n*t[r],0),te=e=>ee(e,e),ne=ee(p,f)/te(f),re=p.map((e,t)=>e-ne*f[t]),ie=te(f)/d,ae=te(re)/d,oe=Math.sqrt((1-t*t)*ie/ae),se=f.map((e,n)=>t*e+oe*re[n]),ce=f.concat(f.map(e=>-e)),le=se.concat(se.map(e=>-e)),ue=e=>Math.sqrt(te(e)/e.length),de=(e,t,n)=>{let r=ue(e);return e.map(e=>n+(r?e/r*t:0))},fe=de(ce,i,r),pe=de(le,o,a);for(let e=fe.length-1;e>0;--e){let t=Math.floor(l()*(e+1));[fe[e],fe[t]]=[fe[t],fe[e]],[pe[e],pe[t]]=[pe[t],pe[e]]}return fe.map((e,t)=>({x:e,y:pe[t]}))}let cr=v(()=>ce({defaultConfig:{userOptions:{show:!1},table:{show:!1},useCssAnimation:!1,style:{backgroundColor:`#99999930`,layout:{axis:{stroke:`#6A6A6A`},correlation:{label:{show:!1}},dataLabels:{xAxis:{show:!1},yAxis:{show:!1}},marginalBars:{fill:`#99999960`},padding:{top:12,right:12,bottom:12,left:12},plots:{stroke:`#6A6A6A`}},legend:{backgroundColor:`transparent`}}},userConfig:N.value.skeletonConfig??{}})),{loading:lr,FINAL_DATASET:ur,manualLoading:dr}=Se({...et(A),FINAL_CONFIG:N,prepareConfig:hr,skeletonDataset:A.config?.skeletonDataset??[{name:``,color:`#999999`,values:sr(100,.5,{seed:42})}],skeletonConfig:ce({defaultConfig:N.value,userConfig:cr.value})}),{userOptionsVisible:fr,setUserOptionsVisibility:pr,keepUserOptionState:mr}=Oe({config:N.value}),{svgRef:B}=ke({config:z.value.title});function hr(){return l(A.config,Dn,Ne)}let gr=te(A.config);tt(()=>A.config,(e,t)=>{let n=te(e),r=n!==gr;gr=n;let i=hr();r?(lr.value||(N.value=i),fr.value=!N.value.userOptions.showOnChartHover,Sr(),Rn.value+=1,zn.value+=1,Bn.value+=1,V.value.showTable=N.value.table.show,V.value.showTooltip=R.value.show,xr.value&&N.value.usePerformanceMode&&console.warn(`VueUiScatter : You are using performance mode
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./userOptionsSlots-CWtXN5Q6.js";import{n as i,r as a,t as o}from"./annotationSlots-OLiW25XN.js";import{n as s,t as c}from"./tableIntegration-CNoJ1CIY.js";import{n as l}from"./resolveChartConfig-0IvbmIE_.js";import{$ as u,Ct as d,D as f,Dt as p,F as m,Ht as h,Jt as g,P as ee,Qt as te,S as ne,X as re,_ as ie,at as ae,b as oe,i as se,in as ce,jt as le,nt as ue,pt as de,t as fe,tn as pe,v as me,w as he,yt as ge,zt as _e}from"./lib-rPeBMZrn.js";import{n as ve,t as ye}from"./useHints-C-TwxM0Y.js";import{t as be}from"./useSvgLabelLayout-42Kats14.js";import{t as xe}from"./useConfig-_JwRfIqE.js";import{n as Se,t as Ce}from"./BaseScanner-8NdoBs7B.js";import{t as we}from"./usePrinter-DVf3YcG5.js";import{t as Te}from"./useResponsive-CENUxfEL.js";import{t as Ee}from"./useChartExport-BZts4KFb.js";import{t as De}from"./useTransitions-ChGGrtrv.js";import{t as Oe}from"./useUserOptionState-CXlFnwPv.js";import{t as ke}from"./useChartAccessibility-DOMuYJfm.js";import{t as Ae}from"./img-D4RQwASc.js";import{t as je}from"./Shape-CRe8woTu.js";import{n as Me}from"./Title-BliHuXfT.js";import{t as Ne}from"./vue_ui_scatter-4as114Wa.js";import{t as Pe}from"./Legend-W9YVYVX-.js";import{t as Fe}from"./A11yDataTable-DWNlWXzs.js";import{t as Ie}from"./BaseLegendToggle-VzX69MCo.js";import{t as Le}from"./DefGrad-DKMq1REY.js";import{t as Re}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as _,Teleport as ze,computed as v,createBlock as y,createCommentVNode as b,createElementBlock as x,createElementVNode as S,createSlots as Be,createTextVNode as Ve,createVNode as He,defineAsyncComponent as Ue,guardReactiveProps as We,mergeProps as Ge,nextTick as Ke,normalizeClass as qe,normalizeProps as Je,normalizeStyle as Ye,onBeforeUnmount as Xe,onMounted as Ze,openBlock as C,ref as w,renderList as T,renderSlot as E,resolveDynamicComponent as Qe,shallowRef as $e,toDisplayString as D,toRefs as et,unref as O,watch as tt,withCtx as k}from"vue";var nt=/* @__PURE__ */ e({default:()=>yn}),rt=[`id`],it=[`id`],at={key:0,class:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`},ot=[`id`],st={style:{position:`relative`}},ct=[`xmlns`,`aria-describedby`,`viewBox`],lt=[`width`,`height`],ut={key:1},dt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ft=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],pt={key:2},mt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ht=[`opacity`],gt=[`stroke`,`stroke-width`,`d`],_t=[`transform`,`font-size`,`fill`,`stroke`],vt={key:4},yt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],bt=[`opacity`],xt=[`d`,`stroke`,`stroke-width`],St=[`transform`,`font-size`,`fill`,`stroke`],Ct={key:6},wt=[`data-cy`,`fill`,`stroke`,`stroke-width`,`rx`],Tt=[`onMouseenter`],Et={key:2,style:{"pointer-events":`none`}},Dt=[`fill`,`fill-opacity`],Ot=[`stroke`,`stroke-dasharray`,`stroke-width`],kt={key:0,style:{"pointer-events":`none`}},At=[`d`,`stroke`,`stroke-width`],jt=[`d`,`stroke`,`stroke-width`],Mt=[`d`,`stroke`,`stroke-width`],Nt=[`d`,`stroke`,`stroke-width`],Pt={key:7},Ft=[`points`,`fill`,`stroke-width`,`stroke-dasharray`,`stroke`],It={key:0,class:`vue-ui-scatter-datapoint`},Lt=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`,`onMouseover`,`onMouseleave`,`onClick`],Rt={key:1},zt=[`transform`,`font-size`,`fill`,`onMouseover`,`onMouseleave`,`onClick`],Bt=[`d`,`fill`,`stroke`,`stroke-width`,`stroke-opacity`],Vt={key:0,style:{"pointer-events":`none`}},Ht=[`x`,`y`,`width`,`height`],Ut={key:0,style:{"pointer-events":`none !important`}},Wt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],Gt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],Kt=[`x`,`y`,`font-size`,`fill`,`font-weight`,`text-anchor`],qt=[`x`,`y`,`font-size`,`fill`,`font-weight`],Jt=[`x`,`y`,`font-size`,`fill`],Yt=[`x`,`y`,`font-size`,`fill`],Xt=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Zt=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Qt=[`x`,`y`,`font-size`,`fill`,`font-weight`,`text-anchor`],$t=[`id`,`transform`,`font-size`,`font-weight`,`fill`],en=[`font-size`,`fill`,`transform`],tn=[`transform`,`font-size`,`fill`],nn=[`x`,`y`,`font-size`,`fill`],rn=[`x`,`y`,`font-size`,`fill`],an=[`font-size`,`font-weight`,`fill`,`x`,`y`],on=[`id`],sn=[`x`,`y`,`width`,`height`],cn={key:14,style:{pointerEvents:`none`}},ln=[`x1`,`x2`,`y1`,`y2`,`stroke-dasharray`,`stroke`,`stroke-width`,`clip-path`],un=[`x`,`y`,`fill`,`font-size`,`font-weight`],dn={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},fn={key:6,class:`vue-data-ui-watermark`},pn=[`id`],mn=[`onClick`],hn={key:0,style:{width:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`}},gn={viewBox:`0 0 20 20`,height:`20`,width:`20`,style:{overflow:`hidden`,background:`transparent`}},_n={key:0},vn=[`innerHTML`],yn=/*#__PURE__*/ Re({__name:`vue-ui-scatter`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`copyAlt`,`selectLegend`],setup(e,{expose:Re,emit:nt}){let yn=Ue(()=>import(`./Tooltip-C1q0Qoh7.js`)),bn=Ue(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),xn=Ue(()=>import(`./vue-ui-accordion-DxGxf-Rm.js`).then(e=>e.n)),Sn=Ue(()=>import(`./DataTable-KeuZB1JM.js`)),Cn=Ue(()=>import(`./PenAndPaper-BV5ODysA.js`).then(e=>e.t)),wn=Ue(()=>import(`./UserOptions-K1N7zQRx.js`).then(e=>e.n)),Tn=Ue(()=>import(`./PackageVersion-PdpqwkYX.js`).then(e=>e.t)),En=Ue(()=>import(`./BaseDraggableDialog-DVstuNhT.js`).then(e=>e.n)),{vue_ui_scatter:Dn}=xe(),A=e,On=nt,kn=v(()=>!!A.dataset&&A.dataset.length),j=w(re()),An=w(!1),jn=w(``),Mn=w(0),Nn=w(null),Pn=w(null),Fn=w(null),In=w(null),Ln=w(null),Rn=w(0),zn=w(0),Bn=w(0),M=w([]),Vn=w(!1),Hn=w(null),Un=w(null),Wn=w(null),Gn=w(null),Kn=w(null),qn=w(null),Jn=w(null),Yn=w(null),Xn=w(null),Zn=w(null),Qn=w(null),$n=w({x:0,y:0}),er=w(`pointer`),tr=w(!1),nr=w(null),N=w(hr()),rr=v(()=>N.value.userOptions),P=v(()=>N.value.style.layout.dataLabels.xAxis),F=v(()=>N.value.style.layout.dataLabels.yAxis),I=v(()=>N.value.style.layout.marginalBars),L=v(()=>N.value.style.layout.plots),R=v(()=>N.value.style.tooltip),z=v(()=>N.value.style);ve({config:()=>N.value,dataset:()=>A.dataset,component:`VueUiScatter`,rules:[ye.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series (clusters) is > 6. Consider:`,``,``,`▶️ Using filters to let users choose a maximum number of series (clusters) to display.`]}]});let{transitionEnabled:ir}=De({config:()=>N.value.transitions,dataset:()=>A.dataset}),ar=v(()=>N.value.userOptions.useCursorPointer),or=v(()=>p(N.value.events?.datapointClick));function sr(e=100,t=.8,n={}){let{meanX:r=0,sdX:i=1,meanY:a=0,sdY:o=1,seed:s}=n,c=(s??Math.floor(Math.random()*2**31))>>>0,l=()=>(c=c*1664525+1013904223>>>0,c/2**32),u=()=>{let e=0,t=0;for(;e===0;)e=l();for(;t===0;)t=l();return Math.sqrt(-2*Math.log(e))*Math.cos(2*Math.PI*t)},d=e/2,f=Array.from({length:d},u),p=Array.from({length:d},u),m=e=>e.reduce((e,t)=>e+t,0)/e.length,h=m(f),g=m(p);for(let e=0;e<d;e+=1)f[e]-=h,p[e]-=g;let ee=(e,t)=>e.reduce((e,n,r)=>e+n*t[r],0),te=e=>ee(e,e),ne=ee(p,f)/te(f),re=p.map((e,t)=>e-ne*f[t]),ie=te(f)/d,ae=te(re)/d,oe=Math.sqrt((1-t*t)*ie/ae),se=f.map((e,n)=>t*e+oe*re[n]),ce=f.concat(f.map(e=>-e)),le=se.concat(se.map(e=>-e)),ue=e=>Math.sqrt(te(e)/e.length),de=(e,t,n)=>{let r=ue(e);return e.map(e=>n+(r?e/r*t:0))},fe=de(ce,i,r),pe=de(le,o,a);for(let e=fe.length-1;e>0;--e){let t=Math.floor(l()*(e+1));[fe[e],fe[t]]=[fe[t],fe[e]],[pe[e],pe[t]]=[pe[t],pe[e]]}return fe.map((e,t)=>({x:e,y:pe[t]}))}let cr=v(()=>ce({defaultConfig:{userOptions:{show:!1},table:{show:!1},useCssAnimation:!1,style:{backgroundColor:`#99999930`,layout:{axis:{stroke:`#6A6A6A`},correlation:{label:{show:!1}},dataLabels:{xAxis:{show:!1},yAxis:{show:!1}},marginalBars:{fill:`#99999960`},padding:{top:12,right:12,bottom:12,left:12},plots:{stroke:`#6A6A6A`}},legend:{backgroundColor:`transparent`}}},userConfig:N.value.skeletonConfig??{}})),{loading:lr,FINAL_DATASET:ur,manualLoading:dr}=Se({...et(A),FINAL_CONFIG:N,prepareConfig:hr,skeletonDataset:A.config?.skeletonDataset??[{name:``,color:`#999999`,values:sr(100,.5,{seed:42})}],skeletonConfig:ce({defaultConfig:N.value,userConfig:cr.value})}),{userOptionsVisible:fr,setUserOptionsVisibility:pr,keepUserOptionState:mr}=Oe({config:N.value}),{svgRef:B}=ke({config:z.value.title});function hr(){return l(A.config,Dn,Ne)}let gr=te(A.config);tt(()=>A.config,(e,t)=>{let n=te(e),r=n!==gr;gr=n;let i=hr();r?(lr.value||(N.value=i),fr.value=!N.value.userOptions.showOnChartHover,Sr(),Rn.value+=1,zn.value+=1,Bn.value+=1,V.value.showTable=N.value.table.show,V.value.showTooltip=R.value.show,xr.value&&N.value.usePerformanceMode&&console.warn(`VueUiScatter : You are using performance mode
2
2
 
3
3
  - downsampling is disabled in this mode, all plots are rendered
4
4
 
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{B as t,Jt as n,M as r,X as i,t as a}from"./lib-rPeBMZrn.js";import{t as ee}from"./useNestedProp-DnGoh-XS.js";import{n as te,t as ne}from"./useHints-C-TwxM0Y.js";import{t as re}from"./useConfig-_JwRfIqE.js";import{n as o}from"./PackageVersion-ksOit8fp.js";import{t as ie}from"./DefGrad-DKMq1REY.js";import{t as s}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as c,computed as l,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createStaticVNode as p,createVNode as m,normalizeClass as ae,normalizeStyle as h,openBlock as g,ref as _,renderList as v,unref as y}from"vue";var b=/* @__PURE__ */ e({default:()=>G}),oe=[`id`],se=[`xmlns`],ce={transform:`translate(300, 300)`},le=[`d`,`fill`,`stroke`],ue=[`xmlns`],x=[`fill`,`stroke`],S=[`fill`,`stroke`],C=[`fill`,`stroke`],w=[`fill`,`stroke`],T=[`fill`,`stroke`],E=[`xmlns`],D=[`stroke`],O=[`stroke`],k=[`stroke`],A=[`fill`,`stroke`],j=[`fill`],M=[`fill`,`stroke`],N=[`fill`],P=[`fill`,`stroke`],F=[`fill`],I=[`fill`,`stroke`],L=[`fill`],R=[`fill`,`stroke`],z=[`fill`],B=[`fill`,`stroke`],V=[`fill`],H=[`xmlns`],U=[`stroke`],de=[`stroke`],fe=[`stroke`],pe=[`stroke`],me=[`stroke`],he=[`stroke`],ge=[`stroke`],_e=[`stroke`],ve=[`stroke`],ye=[`xmlns`],be=[`stroke`,`fill`],xe=[`xmlns`],Se=[`stroke`,`fill`],Ce=[`xmlns`],we=[`fill`],Te=[`fill`],Ee=[`fill`],De=[`fill`],Oe=[`xmlns`],ke=[`stroke`],Ae=[`fill`],je=[`stroke`,`fill`],Me=[`stroke`,`fill`],Ne=[`fill`],Pe=[`stroke`,`fill`],Fe=[`stroke`,`fill`],Ie=[`fill`],Le=[`stroke`,`fill`],Re=[`stroke`,`fill`],ze=[`fill`],Be=[`stroke`,`fill`],Ve=[`stroke`,`fill`],He=[`fill`],Ue=[`stroke`,`fill`],We=[`stroke`,`fill`],Ge=[`xmlns`],Ke=[`stroke`],qe=[`stroke`],Je=[`stroke`,`fill`],Ye=[`stroke`,`fill`],Xe=[`stroke`,`fill`],Ze=[`stroke`,`fill`],Qe=[`stroke`,`fill`],$e=[`stroke`,`fill`],et=[`stroke`,`fill`],tt=[`stroke`,`fill`],nt=[`stroke`,`fill`],rt=[`stroke`,`fill`],it=[`stroke`,`fill`],at=[`stroke`,`fill`],ot=[`stroke`,`fill`],st=[`stroke`,`fill`],ct=[`stroke`,`fill`],lt=[`stroke`,`fill`],ut=[`stroke`,`fill`],dt=[`stroke`,`fill`],ft=[`stroke`,`fill`],pt=[`stroke`,`fill`],mt=[`stroke`,`fill`],ht=[`stroke`,`fill`],gt=[`stroke`,`fill`],_t=[`xmlns`],vt=[`stroke`],yt=[`xmlns`],bt=[`stroke`],xt=[`xmlns`],St=[`stroke`],Ct=[`xmlns`],wt=[`fill`],Tt=[`fill`],Et=[`fill`],Dt=[`fill`],Ot=[`fill`],kt=[`fill`],At=[`fill`],jt=[`fill`],Mt=[`fill`],Nt=[`fill`],Pt=[`fill`],Ft=[`fill`],It=[`xmlns`],Lt=[`stroke`],Rt=[`stroke`],zt=[`stroke`],Bt=[`stroke`],Vt=[`stroke`],Ht=[`stroke`],Ut=[`xmlns`],Wt=[`stroke`],Gt=[`stroke`],Kt=[`stroke`],qt=[`stroke`],Jt=[`stroke`],Yt=[`stroke`],Xt=[`stroke`],Zt=[`stroke`],Qt=[`stroke`],$t=[`xmlns`],en=[`stroke`],tn=[`xmlns`],nn=[`stroke`],rn=[`stroke`],an=[`stroke`],on=[`stroke`],sn=[`stroke`],cn=[`stroke`],ln=[`stroke`],un=[`stroke`],dn=[`stroke`],fn=[`xmlns`],pn=[`x1`,`x2`,`stroke`],mn=[`xmlns`],hn=[`x`,`y`,`width`,`height`,`fill`],gn=[`y`,`width`,`height`,`fill`],_n=[`xmlns`],vn=[`fill`],yn=[`fill`],bn=[`fill`],xn=[`xmlns`],Sn=[`x1`,`x2`,`y1`,`y2`,`stroke`],Cn=[`stroke`],wn=[`fill`],Tn=[`xmlns`],En=[`fill`],Dn=[`fill`],On=[`x1`,`y1`,`x2`,`y2`,`stroke-width`,`stroke`],kn=[`xmlns`],An={key:0},jn=[`stroke`,`stroke-width`],Mn=[`stroke`,`stroke-width`],Nn=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Pn=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Fn=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],In=[`x`,`y`,`height`,`width`,`fill`],Ln=[`xmlns`,`viewBox`],Rn=[`x`,`y`,`stroke`,`fill`],zn=[`xmlns`],Bn=[`d`,`stroke`],Vn=[`cx`,`cy`,`r`,`fill`,`stroke`],Hn=[`cx`,`cy`,`r`,`fill`,`stroke`],Un=[`x`,`y`,`width`,`fill`],Wn=[`cx`,`cy`,`fill`],Gn=[`cx`,`cy`,`fill`],Kn=[`stroke`],qn=[`xmlns`],Jn=[`stroke`,`stroke-width`],Yn=[`stroke`,`stroke-width`],Xn=[`stroke`,`stroke-width`],Zn=[`fill`],Qn=[`fill`],$n=[`fill`],er=[`fill`],tr=[`fill`],nr=[`fill`],rr=[`xmlns`],ir={key:0},ar=[`stroke`,`stroke-width`],or=[`stroke`,`stroke-width`],sr=[`stroke`,`stroke-width`],cr={key:1},lr=[`r`,`fill`],ur=[`r`,`fill`],dr=[`xmlns`],fr={key:0},pr=[`stroke`,`stroke-width`],mr=[`stroke`,`stroke-width`],hr=[`fill`,`rx`,`x`,`y`,`width`,`height`],gr=[`xmlns`],_r=[`stroke-width`,`stroke`],vr=[`stroke-width`,`stroke`],yr=[`stroke-width`,`stroke`],br=[`xmlns`],xr=[`stroke`],Sr=[`stroke`],Cr=[`stroke`],wr=[`stroke`],Tr=[`fill`],Er=[`stroke`],Dr=[`xmlns`],Or=[`stroke`,`stroke-width`],kr=[`stroke`,`stroke-width`],Ar=[`fill`,`r`],jr=[`fill`,`r`],Mr=[`fill`,`r`],Nr=[`fill`,`r`],Pr=[`fill`,`r`],Fr=[`fill`,`r`],Ir=[`fill`,`r`],Lr=[`fill`,`r`],Rr=[`fill`,`r`],zr=[`xmlns`],Br=[`d`,`stroke`,`stroke-width`],Vr=[`d`,`stroke`,`stroke-width`],Hr=[`d`,`stroke`,`stroke-width`],Ur=[`d`,`stroke`,`stroke-width`],Wr=[`stroke`,`stroke-width`],Gr=[`stroke`,`stroke-width`],Kr=[`stroke`,`stroke-width`],qr=[`fill`],Jr=[`fill`],Yr=[`xmlns`],Xr=[`x`,`y`,`fill`],Zr=[`x`,`y`,`fill`],Qr=[`x`,`y`,`fill`],$r=[`xmlns`],ei=[`fill`],ti=[`fill`],ni=[`y1`,`y2`,`stroke`,`stroke-width`],ri=[`x1`,`x2`,`stroke`,`stroke-width`],ii=[`xmlns`,`stroke`],ai=[`fill`],oi=[`xmlns`,`stroke`],si=[`xmlns`,`stroke`],ci=[`fill`],li=[`xmlns`,`stroke`],ui=[`xmlns`,`stroke`],di=[`fill`],fi=[`xmlns`,`stroke`],pi=[`xmlns`,`stroke`],mi=[`fill`],hi=[`xmlns`,`stroke`],W=[`xmlns`,`stroke`],gi=[`fill`],_i=[`xmlns`,`stroke`],vi=[`xmlns`],yi=[`points`,`fill`,`stroke`,`stroke-width`],bi=[`xmlns`],xi={key:0},Si=[`stroke`,`stroke-width`],Ci=[`y`,`width`,`fill`,`rx`],G=/*#__PURE__*/ s({__name:`vue-ui-skeleton`,props:{config:{type:Object,default(){return{}}}},setup(e){let{vue_ui_skeleton:s}=re(),b=e,G=_(`vue-ui-skeleton-${i()}`),K=l(()=>ee({userConfig:b.config,defaultConfig:s})),q=l(()=>K.value.style);te({config:()=>K.value,dataset:()=>[],component:`VueUiSkeleton`,rules:[ne.noHint]});let wi=l(()=>K.value.style.animated),J=l(()=>K.value.type),Ti=_([60,50,55,36,40,25,26,12]),Ei=l(()=>r({plot:{x:50,y:50},radius:40,sides:6}).path),Di=l(()=>r({plot:{x:50,y:50},radius:30,sides:6}).path),Oi=l(()=>r({plot:{x:50,y:50},radius:20,sides:6}).path),ki=l(()=>r({plot:{x:50,y:50},radius:10,sides:6}).path),Y=_([{root:{x:70,y:77,r:44,opacity:100},bars:[{x:200,y:37,opacity:100,width:240},{x:200,y:118,opacity:100,width:180},{x:200,y:253,opacity:100,width:80}]},{root:{x:70,y:177,r:32,opacity:70},bars:[{x:200,y:145,opacity:70,width:160},{x:200,y:172,opacity:70,width:140},{x:200,y:199,opacity:70,width:120}]},{root:{x:70,y:257,r:24,opacity:40},bars:[{x:200,y:64,opacity:40,width:220},{x:200,y:91,opacity:40,width:200},{x:200,y:226,opacity:40,width:100}]}]),X=_([{y:200,height:100,bar:50},{y:180,height:100,bar:40},{y:150,height:100,bar:30},{y:120,height:80,bar:50},{y:110,height:60,bar:30},{y:80,height:80,bar:10},{y:50,height:80,bar:40},{y:24,height:40,bar:24},{y:44,height:20,bar:13},{y:32,height:45,bar:19}]),Z=_([[3,2.5],[4,3.1],[8,6],[9.5,6.5],[12,11],[16,15],[18,18.2],[25,24],[24,26],[32,32],[33,32],[32,31],[38,37],[37,38],[42,41],[40,41],[44,45],[38,35],[31,32]]),Q=_([{x:40,y:30},{x:45,y:28},{x:50,y:25},{x:55,y:20},{x:60,y:27},{x:65,y:14},{x:70,y:23},{x:75,y:16},{x:80,y:25},{x:85,y:10},{x:90,y:18},{x:95,y:7},{x:100,y:12},{x:105,y:10},{x:110,y:20},{x:115,y:7},{x:120,y:14},{x:125,y:10},{x:130,y:19},{x:135,y:3},{x:140,y:10},{x:145,y:2},{x:150,y:1}]);function $(e,t=1){let n=29.85;return{x:200+160*Math.cos(n+e*Math.PI/180)*t,y:200+160*Math.sin(n+e*Math.PI/180)*t}}let Ai=l(()=>{let e=[];for(let t=0;t<100;t+=1)e.push({x1:$(360/100*t).x,y1:$(360/100*t).y,x2:$(360/100*t,.9).x,y2:$(360/100*t,.9).y,color:K.value.style.wheel.color});return e}),ji=_([`M1.74 203.99A204 204 0 01-131.29-156.13l15.44 18.36A180 180 0 001.53 179.99Z`,`M-123.33-162.5A204 204 0 01-10.2-203.75L-9-179.78a180 180 0 00-99.82 36.4Z`,`M0-180A180 180 0 01175.19 41.33l23.36 5.51A204 204 0 000-204Z`,`M172.91 50.03A180 180 0 0110.53 179.69l1.4 23.96A204 204 0 00195.96 56.7Z`,`M-166.87-67.49a180 180 0 0151.02-70.28Q0 0 119.83-134.32a180 180 0 0152.13 81.13Q0 0-166.87-67.49Z`,`M-29.99-177.48a180 180 0 0110.73-1.49Q0 0 112.89 140.2A180 180 0 0153.63 171.83Q0 0-29.99-177.48Z`,`M179.71 10.29a180 180 0 01-4.52 31.04Q0 0-40.87-175.3a180 180 0 0110.88-2.18Q0 0 179.71 10.29Z`,`M-19.26-178.97Q0 0-166.87-67.49a180 180 0 00-12.14 86.36Q0 0-9-179.78a180 180 0 00-10.26.81Z`,`M-108.82-143.38Q0 0-40.87-175.3a180 180 0 00-67.95 31.92Q0 0-40.87-175.3a180 180 0 00-67.95 31.92Z`,`M0-180a180 180 0 01119.83 45.68Q0 0 0-180a180 180 0 01119.83 45.68Q0 0 0-180Z`,`M-148.85 101.22Q0 0-179.01 18.87a180 180 0 0030.16 82.35Q0 0-179.01 18.87a180 180 0 0030.16 82.35Z`,`M1.53 179.99Q0 0 31.73 177.18a180 180 0 0021.9-5.35Q0 0-148.85 101.22A180 180 0 001.53 179.99Z`,`M31.73 177.18a180 180 0 01-21.2 2.51Q0 0 171.96-53.19a180 180 0 017.75 63.48Q0 0 31.73 177.18Z`,`M172.91 50.03Q0 0 112.89 140.2a180 180 0 0060.02-90.17Q0 0 112.89 140.2a180 180 0 0060.02-90.17Z`]);return(e,r)=>(g(),d(`div`,{id:G.value,class:ae({"vue-data-ui-component":!0,"vue-ui-skeleton":!0,"vue-ui-skeleton-animated":wi.value}),style:h(`background:${q.value.backgroundColor};color:${q.value.color};display:flex;align-items:center;justify-content:center;`)},[J.value===`chord`?(g(),d(`svg`,{key:0,xmlns:y(a),width:`100%`,viewBox:`0 0 600 600`,style:h({background:q.value.backgroundColor})},[m(o),f(`g`,ce,[(g(!0),d(c,null,v(ji.value,(e,t)=>(g(),d(`path`,{key:e,d:e,fill:q.value.chord.color,stroke:q.value.backgroundColor,"stroke-width":`2`,style:h({opacity:t>3?.6:1})},null,12,le))),128))])],12,se)):u(``,!0),J.value===`ridgeline`?(g(),d(`svg`,{key:1,xmlns:y(a),width:`100%`,viewBox:`20 0 512 200`,style:h(`background:${q.value.backgroundColor}`)},[m(o),f(`defs`,null,[m(ie,{t:`linear`,id:`ridgeline-gradient-${G.value}`,x1:`50%`,y1:`0%`,x2:`50%`,y2:`100%`,stops:[[`0%`,q.value.ridgeline.color,1],[`30%`,q.value.ridgeline.color,.7],[`70%`,q.value.ridgeline.color,.3],[`100%`,q.value.ridgeline.color,.1]]},null,8,[`id`,`stops`])]),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 60c6.18-.6 12.36-1.11 18.55-1.79 6.18-.68 12.37-2.38 18.55-2.4 6.19-.01 12.37 0 18.56-.01 6.18-.02 12.37-5.3 18.55-5.3 6.19 0 12.37 4.95 18.56 4.95 6.18 0 12.37-2.78 18.55-2.78 6.19 0 12.37 1.02 18.56 1.92 6.18.9 12.37 4.58 18.55 4.58s12.37-6.71 18.55-6.71c6.19 0 12.37.89 18.56.89 6.18 0 12.37-4.48 18.55-4.48 6.19 0 12.37 4.79 18.56 4.79 6.18 0 12.37-26.07 18.55-26.07 6.19 0 12.37 9.31 18.56 13.85 6.18 4.54 12.37 13.39 18.55 13.39 6.19 0 12.37-36.14 18.56-36.14 6.18 0 12.36 38.45 18.55 38.45 6.18 0 12.37-11.46 18.55-16.94 6.19-5.48 12.37-15.97 18.56-15.97 6.18 0 12.37 16.4 18.55 16.4 6.19 0 12.37-.12 18.56-.35 6.18-.22 12.37-38.08 18.55-38.08 6.19 0 12.37 24.07 18.56 36.1V60`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,x),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 90c6.18-.22 12.36-.35 18.55-.67 6.18-.32 12.37-1.65 18.55-1.65 6.19 0 12.37 1.66 18.56 1.66 6.18 0 12.37-8.76 18.55-8.76 6.19 0 12.37 4.15 18.56 4.15 6.18 0 12.37-8.44 18.55-8.44 6.19 0 12.37 10.87 18.56 10.87 6.18 0 12.37-9.21 18.55-12.16 6.18-2.96 12.37-6.97 18.55-6.97 6.19 0 12.37 9.59 18.56 12.77 6.18 3.18 12.37 7.6 18.55 7.6 6.19 0 12.37-24.44 18.56-24.44 6.18 0 12.37 16.97 18.55 16.97 6.19 0 12.37-20.62 18.56-20.62 6.18 0 12.37 20.37 18.55 20.37 6.19 0 12.37-13.13 18.56-13.13 6.18 0 12.36 13.51 18.55 13.51 6.18 0 12.37-26.41 18.55-26.41 6.19 0 12.37.49 18.56 1.26 6.18.78 12.37 13.82 18.55 13.82 6.19 0 12.37-5.3 18.56-8.3 6.18-3 12.37-9.81 18.55-9.81 6.19 0 12.37 19.82 18.56 29.72V90`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,S),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 120c6.18-.34 12.36-.55 18.55-1.01 6.18-.46 12.37-1.17 18.55-2.15 6.19-.99 12.37-3.7 18.56-4.69 6.18-.98 12.37-2.15 18.55-2.15 6.19 0 12.37.52 18.56 1.2 6.18.68 12.37 6.67 18.55 6.67 6.19 0 12.37-12.15 18.56-12.15 6.18 0 12.37 4.6 18.55 4.6S227.5 99.7 233.68 98.99c6.19-.71 12.37-1.18 18.56-1.18 6.18 0 12.37 17.75 18.55 18.22 6.19.48 12.37.74 18.56.74 6.18 0 12.37-17.09 18.55-17.09 6.19 0 12.37 12.68 18.56 12.68 6.18 0 12.37-.33 18.55-.67 6.19-.34 12.37-.79 18.56-2.06 6.18-1.26 12.36-25.45 18.55-25.45 6.18 0 12.37 10.35 18.55 10.35 6.19 0 12.37-21.07 18.56-21.07 6.18 0 12.37 33.27 18.55 33.27 6.19 0 12.37-26.97 18.56-26.97 6.18 0 12.37 26.97 18.55 27.36 6.19.4 12.37.41 18.56.61V120`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,C),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 150c6.18-.52 12.36-1.57 18.55-1.57 6.18 0 12.37 1.36 18.55 1.36 6.19 0 12.37-1.75 18.56-3.18 6.18-1.43 12.37-6.62 18.55-6.62 6.19 0 12.37 9.98 18.56 9.98 6.18 0 12.37-4.94 18.55-5.64 6.19-.71 12.37-.52 18.56-1.31 6.18-.78 12.37-12.43 18.55-12.43s12.37 18.52 18.55 18.52c6.19 0 12.37-2.49 18.56-2.49 6.18 0 12.37 3.02 18.55 3.02 6.19 0 12.37-29.39 18.56-29.39 6.18 0 12.37 5.56 18.55 8.36 6.19 2.81 12.37 5.14 18.56 8.47 6.18 3.34 12.37 12.25 18.55 12.25 6.19 0 12.37-4.3 18.56-8.78 6.18-4.48 12.36-28.77 18.55-28.77 6.18 0 12.37 1.29 18.55 3.02 6.19 1.72 12.37 18.36 18.56 18.36 6.18 0 12.37-7.68 18.55-12.92 6.19-5.24 12.37-18.51 18.56-20.1 6.18-1.58 12.37-2.7 18.55-2.7 6.19 0 12.37 34.69 18.56 52.04V150`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,w),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 180c6.18-.6 12.36-1.07 18.55-1.81 6.18-.74 12.37-2.86 18.55-2.86 6.19 0 12.37 2.14 18.56 2.14 6.18 0 12.37-7.08 18.55-7.08 6.19 0 12.37 1.08 18.56 2.03 6.18.95 12.37 4.75 18.55 4.75 6.19 0 12.37-2.45 18.56-4.62 6.18-2.17 12.37-10.99 18.55-10.99s12.37 9.58 18.55 9.58c6.19 0 12.37-.25 18.56-.69 6.18-.43 12.37-13.6 18.55-13.6 6.19 0 12.37 17.23 18.56 17.23 6.18 0 12.37-2.5 18.55-5.19 6.19-2.68 12.37-15.45 18.56-18 6.18-2.55 12.37-4.86 18.55-4.86 6.19 0 12.37 18.61 18.56 18.61 6.18 0 12.36-24.22 18.55-26.66 6.18-2.45 12.37-4.25 18.55-4.25 6.19 0 12.37 7.92 18.56 7.92 6.18 0 12.37-1.95 18.55-1.95 6.19 0 12.37 29.69 18.56 29.69 6.18 0 12.37-2.55 18.55-6.14 6.19-3.58 12.37-28.83 18.56-43.25v60`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,T)],12,ue)):u(``,!0),J.value===`historyPlot`?(g(),d(`svg`,{key:2,xmlns:y(a),width:`100%`,viewBox:`0 0 612 512`,style:h(`background:${q.value.backgroundColor}`)},[m(o),f(`line`,{x1:`12`,x2:`12`,y1:`12`,y2:`500`,stroke:q.value.historyPlot.color,"stroke-width":`3`,"stroke-linecap":`round`},null,8,D),f(`line`,{x1:`12`,x2:`600`,y1:`500`,y2:`500`,stroke:q.value.historyPlot.color,"stroke-width":`3`,"stroke-linecap":`round`},null,8,O),f(`path`,{d:`M 80,100 300,200 400,150 560,230 360,420 230,320`,fill:`none`,stroke:q.value.historyPlot.color,"stroke-width":`3`},null,8,k),f(`circle`,{cx:`80`,cy:`100`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,A),f(`text`,{x:`80`,y:`108`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 1 `,8,j),f(`circle`,{cx:`300`,cy:`200`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,M),f(`text`,{x:`300`,y:`208`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 2 `,8,N),f(`circle`,{cx:`400`,cy:`150`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,P),f(`text`,{x:`400`,y:`158`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 3 `,8,F),f(`circle`,{cx:`560`,cy:`230`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,I),f(`text`,{x:`560`,y:`238`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 4 `,8,L),f(`circle`,{cx:`360`,cy:`420`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,R),f(`text`,{x:`360`,y:`428`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 5 `,8,z),f(`circle`,{cx:`230`,cy:`320`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,B),f(`text`,{x:`230`,y:`328`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 6 `,8,V)],12,E)):u(``,!0),J.value===`circlePack`?(g(),d(`svg`,{key:3,xmlns:y(a),width:`100%`,viewBox:`0 0 100 100`,style:h(`background:${q.value.backgroundColor}`)},[f(`circle`,{cx:50,cy:50,r:20,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,U),f(`circle`,{cx:80,cy:50,r:10,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,de),f(`circle`,{cx:28,cy:30,r:10,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,fe),f(`circle`,{cx:25,cy:76,r:16,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,pe),f(`circle`,{cx:60,cy:78.5,r:10,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,me),f(`circle`,{cx:64,cy:20,r:13,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,he),f(`circle`,{cx:72,cy:37,r:5,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,ge),f(`circle`,{cx:25,cy:45,r:5,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,_e),f(`circle`,{cx:70,cy:66,r:5,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,ve)],12,H)):u(``,!0),J.value===`flow`?(g(),d(`svg`,{key:4,xmlns:y(a),width:`100%`,viewBox:`0 0 80 60`,style:h(`background:${q.value.backgroundColor}`)},[m(o),f(`path`,{d:`M5 5V55M75 5V55M28 5V55M52 5V55M5 8l23 4L52 9 75 8v4H52L28 21 5 29ZM5 34l23 1L52 24l23-3v6L52 30 28 44l24-5 23 2v6L52 45 28 52H5Z`,stroke:q.value.flow.color,"stroke-width":.8,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:q.value.flow.color},null,8,be)],12,ye)):u(``,!0),J.value===`parallelCoordinatePlot`?(g(),d(`svg`,{key:5,xmlns:y(a),width:`100%`,viewBox:`0 0 80 60`,style:h(`background:${q.value.backgroundColor}`)},[m(o),f(`path`,{d:`M5 5V55M75 5V55M28 5V55M52 5V55M5 10a1 1 0 000 2 1 1 0 000-2m23 5a1 1 0 000 2 1 1 0 000-2M52 8a1 1 0 000 2 1 1 0 000-2m23 3a1 1 0 000 2 1 1 0 000-2M6 11l21 5m2 0L51 9m2 0 21 3M5 50a1 1 0 000-2 1 1 0 000 2M28 39a1 1 0 000 2 1 1 0 000-2m24 6a1 1 0 000 2 1 1 0 000-2m23 0a1 1 0 000 2 1 1 0 000-2M6 49l21-9m2 0 22 6m2 0H74M5 25a1 1 0 000 2 1 1 0 000-2m23 6a1 1 0 000 2 1 1 0 000-2m24-8a1 1 0 000 2 1 1 0 000-2m23-2a1 1 0 000 2 1 1 0 000-2M6 26l21 6m2 0 22-8m2 0 21-2`,stroke:q.value.parallelCoordinatePlot.color,"stroke-width":.8,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:q.value.parallelCoordinatePlot.color},null,8,Se)],12,xe)):u(``,!0),J.value===`bullet`?(g(),d(`svg`,{key:6,xmlns:y(a),width:`100%`,viewBox:`0 0 600 96`,style:h(`background:${q.value.backgroundColor}`)},[f(`rect`,{fill:q.value.bullet.color,x:24,y:12,width:300,height:72,style:{opacity:`0.8`}},null,8,we),f(`rect`,{fill:q.value.bullet.color,x:324,y:12,width:150,height:72,style:{opacity:`0.6`}},null,8,Te),f(`rect`,{fill:q.value.bullet.color,x:474,y:12,width:102,height:72,style:{opacity:`0.3`}},null,8,Ee),f(`rect`,{fill:q.value.bullet.color,x:24,y:36,width:490,height:24,style:{opacity:`1`}},null,8,De)],12,Ce)):u(``,!0),J.value===`dumbbell`?(g(),d(`svg`,{key:7,xmlns:y(a),width:`100%`,viewBox:`0 0 100 55`,style:h(`background:${q.value.backgroundColor}`)},[m(o),f(`line`,{x1:`3`,x2:`3`,y1:`3`,y2:`67`,stroke:q.value.dumbbell.color,"stroke-width":.5,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,ke),f(`path`,{d:`
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{B as t,Jt as n,M as r,X as i,t as a}from"./lib-rPeBMZrn.js";import{t as ee}from"./useNestedProp-DnGoh-XS.js";import{n as te,t as ne}from"./useHints-C-TwxM0Y.js";import{t as re}from"./useConfig-_JwRfIqE.js";import{n as o}from"./PackageVersion-PdpqwkYX.js";import{t as ie}from"./DefGrad-DKMq1REY.js";import{t as s}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{Fragment as c,computed as l,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createStaticVNode as p,createVNode as m,normalizeClass as ae,normalizeStyle as h,openBlock as g,ref as _,renderList as v,unref as y}from"vue";var b=/* @__PURE__ */ e({default:()=>G}),oe=[`id`],se=[`xmlns`],ce={transform:`translate(300, 300)`},le=[`d`,`fill`,`stroke`],ue=[`xmlns`],x=[`fill`,`stroke`],S=[`fill`,`stroke`],C=[`fill`,`stroke`],w=[`fill`,`stroke`],T=[`fill`,`stroke`],E=[`xmlns`],D=[`stroke`],O=[`stroke`],k=[`stroke`],A=[`fill`,`stroke`],j=[`fill`],M=[`fill`,`stroke`],N=[`fill`],P=[`fill`,`stroke`],F=[`fill`],I=[`fill`,`stroke`],L=[`fill`],R=[`fill`,`stroke`],z=[`fill`],B=[`fill`,`stroke`],V=[`fill`],H=[`xmlns`],U=[`stroke`],de=[`stroke`],fe=[`stroke`],pe=[`stroke`],me=[`stroke`],he=[`stroke`],ge=[`stroke`],_e=[`stroke`],ve=[`stroke`],ye=[`xmlns`],be=[`stroke`,`fill`],xe=[`xmlns`],Se=[`stroke`,`fill`],Ce=[`xmlns`],we=[`fill`],Te=[`fill`],Ee=[`fill`],De=[`fill`],Oe=[`xmlns`],ke=[`stroke`],Ae=[`fill`],je=[`stroke`,`fill`],Me=[`stroke`,`fill`],Ne=[`fill`],Pe=[`stroke`,`fill`],Fe=[`stroke`,`fill`],Ie=[`fill`],Le=[`stroke`,`fill`],Re=[`stroke`,`fill`],ze=[`fill`],Be=[`stroke`,`fill`],Ve=[`stroke`,`fill`],He=[`fill`],Ue=[`stroke`,`fill`],We=[`stroke`,`fill`],Ge=[`xmlns`],Ke=[`stroke`],qe=[`stroke`],Je=[`stroke`,`fill`],Ye=[`stroke`,`fill`],Xe=[`stroke`,`fill`],Ze=[`stroke`,`fill`],Qe=[`stroke`,`fill`],$e=[`stroke`,`fill`],et=[`stroke`,`fill`],tt=[`stroke`,`fill`],nt=[`stroke`,`fill`],rt=[`stroke`,`fill`],it=[`stroke`,`fill`],at=[`stroke`,`fill`],ot=[`stroke`,`fill`],st=[`stroke`,`fill`],ct=[`stroke`,`fill`],lt=[`stroke`,`fill`],ut=[`stroke`,`fill`],dt=[`stroke`,`fill`],ft=[`stroke`,`fill`],pt=[`stroke`,`fill`],mt=[`stroke`,`fill`],ht=[`stroke`,`fill`],gt=[`stroke`,`fill`],_t=[`xmlns`],vt=[`stroke`],yt=[`xmlns`],bt=[`stroke`],xt=[`xmlns`],St=[`stroke`],Ct=[`xmlns`],wt=[`fill`],Tt=[`fill`],Et=[`fill`],Dt=[`fill`],Ot=[`fill`],kt=[`fill`],At=[`fill`],jt=[`fill`],Mt=[`fill`],Nt=[`fill`],Pt=[`fill`],Ft=[`fill`],It=[`xmlns`],Lt=[`stroke`],Rt=[`stroke`],zt=[`stroke`],Bt=[`stroke`],Vt=[`stroke`],Ht=[`stroke`],Ut=[`xmlns`],Wt=[`stroke`],Gt=[`stroke`],Kt=[`stroke`],qt=[`stroke`],Jt=[`stroke`],Yt=[`stroke`],Xt=[`stroke`],Zt=[`stroke`],Qt=[`stroke`],$t=[`xmlns`],en=[`stroke`],tn=[`xmlns`],nn=[`stroke`],rn=[`stroke`],an=[`stroke`],on=[`stroke`],sn=[`stroke`],cn=[`stroke`],ln=[`stroke`],un=[`stroke`],dn=[`stroke`],fn=[`xmlns`],pn=[`x1`,`x2`,`stroke`],mn=[`xmlns`],hn=[`x`,`y`,`width`,`height`,`fill`],gn=[`y`,`width`,`height`,`fill`],_n=[`xmlns`],vn=[`fill`],yn=[`fill`],bn=[`fill`],xn=[`xmlns`],Sn=[`x1`,`x2`,`y1`,`y2`,`stroke`],Cn=[`stroke`],wn=[`fill`],Tn=[`xmlns`],En=[`fill`],Dn=[`fill`],On=[`x1`,`y1`,`x2`,`y2`,`stroke-width`,`stroke`],kn=[`xmlns`],An={key:0},jn=[`stroke`,`stroke-width`],Mn=[`stroke`,`stroke-width`],Nn=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Pn=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Fn=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],In=[`x`,`y`,`height`,`width`,`fill`],Ln=[`xmlns`,`viewBox`],Rn=[`x`,`y`,`stroke`,`fill`],zn=[`xmlns`],Bn=[`d`,`stroke`],Vn=[`cx`,`cy`,`r`,`fill`,`stroke`],Hn=[`cx`,`cy`,`r`,`fill`,`stroke`],Un=[`x`,`y`,`width`,`fill`],Wn=[`cx`,`cy`,`fill`],Gn=[`cx`,`cy`,`fill`],Kn=[`stroke`],qn=[`xmlns`],Jn=[`stroke`,`stroke-width`],Yn=[`stroke`,`stroke-width`],Xn=[`stroke`,`stroke-width`],Zn=[`fill`],Qn=[`fill`],$n=[`fill`],er=[`fill`],tr=[`fill`],nr=[`fill`],rr=[`xmlns`],ir={key:0},ar=[`stroke`,`stroke-width`],or=[`stroke`,`stroke-width`],sr=[`stroke`,`stroke-width`],cr={key:1},lr=[`r`,`fill`],ur=[`r`,`fill`],dr=[`xmlns`],fr={key:0},pr=[`stroke`,`stroke-width`],mr=[`stroke`,`stroke-width`],hr=[`fill`,`rx`,`x`,`y`,`width`,`height`],gr=[`xmlns`],_r=[`stroke-width`,`stroke`],vr=[`stroke-width`,`stroke`],yr=[`stroke-width`,`stroke`],br=[`xmlns`],xr=[`stroke`],Sr=[`stroke`],Cr=[`stroke`],wr=[`stroke`],Tr=[`fill`],Er=[`stroke`],Dr=[`xmlns`],Or=[`stroke`,`stroke-width`],kr=[`stroke`,`stroke-width`],Ar=[`fill`,`r`],jr=[`fill`,`r`],Mr=[`fill`,`r`],Nr=[`fill`,`r`],Pr=[`fill`,`r`],Fr=[`fill`,`r`],Ir=[`fill`,`r`],Lr=[`fill`,`r`],Rr=[`fill`,`r`],zr=[`xmlns`],Br=[`d`,`stroke`,`stroke-width`],Vr=[`d`,`stroke`,`stroke-width`],Hr=[`d`,`stroke`,`stroke-width`],Ur=[`d`,`stroke`,`stroke-width`],Wr=[`stroke`,`stroke-width`],Gr=[`stroke`,`stroke-width`],Kr=[`stroke`,`stroke-width`],qr=[`fill`],Jr=[`fill`],Yr=[`xmlns`],Xr=[`x`,`y`,`fill`],Zr=[`x`,`y`,`fill`],Qr=[`x`,`y`,`fill`],$r=[`xmlns`],ei=[`fill`],ti=[`fill`],ni=[`y1`,`y2`,`stroke`,`stroke-width`],ri=[`x1`,`x2`,`stroke`,`stroke-width`],ii=[`xmlns`,`stroke`],ai=[`fill`],oi=[`xmlns`,`stroke`],si=[`xmlns`,`stroke`],ci=[`fill`],li=[`xmlns`,`stroke`],ui=[`xmlns`,`stroke`],di=[`fill`],fi=[`xmlns`,`stroke`],pi=[`xmlns`,`stroke`],mi=[`fill`],hi=[`xmlns`,`stroke`],W=[`xmlns`,`stroke`],gi=[`fill`],_i=[`xmlns`,`stroke`],vi=[`xmlns`],yi=[`points`,`fill`,`stroke`,`stroke-width`],bi=[`xmlns`],xi={key:0},Si=[`stroke`,`stroke-width`],Ci=[`y`,`width`,`fill`,`rx`],G=/*#__PURE__*/ s({__name:`vue-ui-skeleton`,props:{config:{type:Object,default(){return{}}}},setup(e){let{vue_ui_skeleton:s}=re(),b=e,G=_(`vue-ui-skeleton-${i()}`),K=l(()=>ee({userConfig:b.config,defaultConfig:s})),q=l(()=>K.value.style);te({config:()=>K.value,dataset:()=>[],component:`VueUiSkeleton`,rules:[ne.noHint]});let wi=l(()=>K.value.style.animated),J=l(()=>K.value.type),Ti=_([60,50,55,36,40,25,26,12]),Ei=l(()=>r({plot:{x:50,y:50},radius:40,sides:6}).path),Di=l(()=>r({plot:{x:50,y:50},radius:30,sides:6}).path),Oi=l(()=>r({plot:{x:50,y:50},radius:20,sides:6}).path),ki=l(()=>r({plot:{x:50,y:50},radius:10,sides:6}).path),Y=_([{root:{x:70,y:77,r:44,opacity:100},bars:[{x:200,y:37,opacity:100,width:240},{x:200,y:118,opacity:100,width:180},{x:200,y:253,opacity:100,width:80}]},{root:{x:70,y:177,r:32,opacity:70},bars:[{x:200,y:145,opacity:70,width:160},{x:200,y:172,opacity:70,width:140},{x:200,y:199,opacity:70,width:120}]},{root:{x:70,y:257,r:24,opacity:40},bars:[{x:200,y:64,opacity:40,width:220},{x:200,y:91,opacity:40,width:200},{x:200,y:226,opacity:40,width:100}]}]),X=_([{y:200,height:100,bar:50},{y:180,height:100,bar:40},{y:150,height:100,bar:30},{y:120,height:80,bar:50},{y:110,height:60,bar:30},{y:80,height:80,bar:10},{y:50,height:80,bar:40},{y:24,height:40,bar:24},{y:44,height:20,bar:13},{y:32,height:45,bar:19}]),Z=_([[3,2.5],[4,3.1],[8,6],[9.5,6.5],[12,11],[16,15],[18,18.2],[25,24],[24,26],[32,32],[33,32],[32,31],[38,37],[37,38],[42,41],[40,41],[44,45],[38,35],[31,32]]),Q=_([{x:40,y:30},{x:45,y:28},{x:50,y:25},{x:55,y:20},{x:60,y:27},{x:65,y:14},{x:70,y:23},{x:75,y:16},{x:80,y:25},{x:85,y:10},{x:90,y:18},{x:95,y:7},{x:100,y:12},{x:105,y:10},{x:110,y:20},{x:115,y:7},{x:120,y:14},{x:125,y:10},{x:130,y:19},{x:135,y:3},{x:140,y:10},{x:145,y:2},{x:150,y:1}]);function $(e,t=1){let n=29.85;return{x:200+160*Math.cos(n+e*Math.PI/180)*t,y:200+160*Math.sin(n+e*Math.PI/180)*t}}let Ai=l(()=>{let e=[];for(let t=0;t<100;t+=1)e.push({x1:$(360/100*t).x,y1:$(360/100*t).y,x2:$(360/100*t,.9).x,y2:$(360/100*t,.9).y,color:K.value.style.wheel.color});return e}),ji=_([`M1.74 203.99A204 204 0 01-131.29-156.13l15.44 18.36A180 180 0 001.53 179.99Z`,`M-123.33-162.5A204 204 0 01-10.2-203.75L-9-179.78a180 180 0 00-99.82 36.4Z`,`M0-180A180 180 0 01175.19 41.33l23.36 5.51A204 204 0 000-204Z`,`M172.91 50.03A180 180 0 0110.53 179.69l1.4 23.96A204 204 0 00195.96 56.7Z`,`M-166.87-67.49a180 180 0 0151.02-70.28Q0 0 119.83-134.32a180 180 0 0152.13 81.13Q0 0-166.87-67.49Z`,`M-29.99-177.48a180 180 0 0110.73-1.49Q0 0 112.89 140.2A180 180 0 0153.63 171.83Q0 0-29.99-177.48Z`,`M179.71 10.29a180 180 0 01-4.52 31.04Q0 0-40.87-175.3a180 180 0 0110.88-2.18Q0 0 179.71 10.29Z`,`M-19.26-178.97Q0 0-166.87-67.49a180 180 0 00-12.14 86.36Q0 0-9-179.78a180 180 0 00-10.26.81Z`,`M-108.82-143.38Q0 0-40.87-175.3a180 180 0 00-67.95 31.92Q0 0-40.87-175.3a180 180 0 00-67.95 31.92Z`,`M0-180a180 180 0 01119.83 45.68Q0 0 0-180a180 180 0 01119.83 45.68Q0 0 0-180Z`,`M-148.85 101.22Q0 0-179.01 18.87a180 180 0 0030.16 82.35Q0 0-179.01 18.87a180 180 0 0030.16 82.35Z`,`M1.53 179.99Q0 0 31.73 177.18a180 180 0 0021.9-5.35Q0 0-148.85 101.22A180 180 0 001.53 179.99Z`,`M31.73 177.18a180 180 0 01-21.2 2.51Q0 0 171.96-53.19a180 180 0 017.75 63.48Q0 0 31.73 177.18Z`,`M172.91 50.03Q0 0 112.89 140.2a180 180 0 0060.02-90.17Q0 0 112.89 140.2a180 180 0 0060.02-90.17Z`]);return(e,r)=>(g(),d(`div`,{id:G.value,class:ae({"vue-data-ui-component":!0,"vue-ui-skeleton":!0,"vue-ui-skeleton-animated":wi.value}),style:h(`background:${q.value.backgroundColor};color:${q.value.color};display:flex;align-items:center;justify-content:center;`)},[J.value===`chord`?(g(),d(`svg`,{key:0,xmlns:y(a),width:`100%`,viewBox:`0 0 600 600`,style:h({background:q.value.backgroundColor})},[m(o),f(`g`,ce,[(g(!0),d(c,null,v(ji.value,(e,t)=>(g(),d(`path`,{key:e,d:e,fill:q.value.chord.color,stroke:q.value.backgroundColor,"stroke-width":`2`,style:h({opacity:t>3?.6:1})},null,12,le))),128))])],12,se)):u(``,!0),J.value===`ridgeline`?(g(),d(`svg`,{key:1,xmlns:y(a),width:`100%`,viewBox:`20 0 512 200`,style:h(`background:${q.value.backgroundColor}`)},[m(o),f(`defs`,null,[m(ie,{t:`linear`,id:`ridgeline-gradient-${G.value}`,x1:`50%`,y1:`0%`,x2:`50%`,y2:`100%`,stops:[[`0%`,q.value.ridgeline.color,1],[`30%`,q.value.ridgeline.color,.7],[`70%`,q.value.ridgeline.color,.3],[`100%`,q.value.ridgeline.color,.1]]},null,8,[`id`,`stops`])]),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 60c6.18-.6 12.36-1.11 18.55-1.79 6.18-.68 12.37-2.38 18.55-2.4 6.19-.01 12.37 0 18.56-.01 6.18-.02 12.37-5.3 18.55-5.3 6.19 0 12.37 4.95 18.56 4.95 6.18 0 12.37-2.78 18.55-2.78 6.19 0 12.37 1.02 18.56 1.92 6.18.9 12.37 4.58 18.55 4.58s12.37-6.71 18.55-6.71c6.19 0 12.37.89 18.56.89 6.18 0 12.37-4.48 18.55-4.48 6.19 0 12.37 4.79 18.56 4.79 6.18 0 12.37-26.07 18.55-26.07 6.19 0 12.37 9.31 18.56 13.85 6.18 4.54 12.37 13.39 18.55 13.39 6.19 0 12.37-36.14 18.56-36.14 6.18 0 12.36 38.45 18.55 38.45 6.18 0 12.37-11.46 18.55-16.94 6.19-5.48 12.37-15.97 18.56-15.97 6.18 0 12.37 16.4 18.55 16.4 6.19 0 12.37-.12 18.56-.35 6.18-.22 12.37-38.08 18.55-38.08 6.19 0 12.37 24.07 18.56 36.1V60`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,x),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 90c6.18-.22 12.36-.35 18.55-.67 6.18-.32 12.37-1.65 18.55-1.65 6.19 0 12.37 1.66 18.56 1.66 6.18 0 12.37-8.76 18.55-8.76 6.19 0 12.37 4.15 18.56 4.15 6.18 0 12.37-8.44 18.55-8.44 6.19 0 12.37 10.87 18.56 10.87 6.18 0 12.37-9.21 18.55-12.16 6.18-2.96 12.37-6.97 18.55-6.97 6.19 0 12.37 9.59 18.56 12.77 6.18 3.18 12.37 7.6 18.55 7.6 6.19 0 12.37-24.44 18.56-24.44 6.18 0 12.37 16.97 18.55 16.97 6.19 0 12.37-20.62 18.56-20.62 6.18 0 12.37 20.37 18.55 20.37 6.19 0 12.37-13.13 18.56-13.13 6.18 0 12.36 13.51 18.55 13.51 6.18 0 12.37-26.41 18.55-26.41 6.19 0 12.37.49 18.56 1.26 6.18.78 12.37 13.82 18.55 13.82 6.19 0 12.37-5.3 18.56-8.3 6.18-3 12.37-9.81 18.55-9.81 6.19 0 12.37 19.82 18.56 29.72V90`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,S),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 120c6.18-.34 12.36-.55 18.55-1.01 6.18-.46 12.37-1.17 18.55-2.15 6.19-.99 12.37-3.7 18.56-4.69 6.18-.98 12.37-2.15 18.55-2.15 6.19 0 12.37.52 18.56 1.2 6.18.68 12.37 6.67 18.55 6.67 6.19 0 12.37-12.15 18.56-12.15 6.18 0 12.37 4.6 18.55 4.6S227.5 99.7 233.68 98.99c6.19-.71 12.37-1.18 18.56-1.18 6.18 0 12.37 17.75 18.55 18.22 6.19.48 12.37.74 18.56.74 6.18 0 12.37-17.09 18.55-17.09 6.19 0 12.37 12.68 18.56 12.68 6.18 0 12.37-.33 18.55-.67 6.19-.34 12.37-.79 18.56-2.06 6.18-1.26 12.36-25.45 18.55-25.45 6.18 0 12.37 10.35 18.55 10.35 6.19 0 12.37-21.07 18.56-21.07 6.18 0 12.37 33.27 18.55 33.27 6.19 0 12.37-26.97 18.56-26.97 6.18 0 12.37 26.97 18.55 27.36 6.19.4 12.37.41 18.56.61V120`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,C),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 150c6.18-.52 12.36-1.57 18.55-1.57 6.18 0 12.37 1.36 18.55 1.36 6.19 0 12.37-1.75 18.56-3.18 6.18-1.43 12.37-6.62 18.55-6.62 6.19 0 12.37 9.98 18.56 9.98 6.18 0 12.37-4.94 18.55-5.64 6.19-.71 12.37-.52 18.56-1.31 6.18-.78 12.37-12.43 18.55-12.43s12.37 18.52 18.55 18.52c6.19 0 12.37-2.49 18.56-2.49 6.18 0 12.37 3.02 18.55 3.02 6.19 0 12.37-29.39 18.56-29.39 6.18 0 12.37 5.56 18.55 8.36 6.19 2.81 12.37 5.14 18.56 8.47 6.18 3.34 12.37 12.25 18.55 12.25 6.19 0 12.37-4.3 18.56-8.78 6.18-4.48 12.36-28.77 18.55-28.77 6.18 0 12.37 1.29 18.55 3.02 6.19 1.72 12.37 18.36 18.56 18.36 6.18 0 12.37-7.68 18.55-12.92 6.19-5.24 12.37-18.51 18.56-20.1 6.18-1.58 12.37-2.7 18.55-2.7 6.19 0 12.37 34.69 18.56 52.04V150`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,w),f(`path`,{fill:`url(#ridgeline-gradient-${G.value})`,stroke:q.value.ridgeline.color,"stroke-width":`1`,d:`M66.7 180c6.18-.6 12.36-1.07 18.55-1.81 6.18-.74 12.37-2.86 18.55-2.86 6.19 0 12.37 2.14 18.56 2.14 6.18 0 12.37-7.08 18.55-7.08 6.19 0 12.37 1.08 18.56 2.03 6.18.95 12.37 4.75 18.55 4.75 6.19 0 12.37-2.45 18.56-4.62 6.18-2.17 12.37-10.99 18.55-10.99s12.37 9.58 18.55 9.58c6.19 0 12.37-.25 18.56-.69 6.18-.43 12.37-13.6 18.55-13.6 6.19 0 12.37 17.23 18.56 17.23 6.18 0 12.37-2.5 18.55-5.19 6.19-2.68 12.37-15.45 18.56-18 6.18-2.55 12.37-4.86 18.55-4.86 6.19 0 12.37 18.61 18.56 18.61 6.18 0 12.36-24.22 18.55-26.66 6.18-2.45 12.37-4.25 18.55-4.25 6.19 0 12.37 7.92 18.56 7.92 6.18 0 12.37-1.95 18.55-1.95 6.19 0 12.37 29.69 18.56 29.69 6.18 0 12.37-2.55 18.55-6.14 6.19-3.58 12.37-28.83 18.56-43.25v60`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,T)],12,ue)):u(``,!0),J.value===`historyPlot`?(g(),d(`svg`,{key:2,xmlns:y(a),width:`100%`,viewBox:`0 0 612 512`,style:h(`background:${q.value.backgroundColor}`)},[m(o),f(`line`,{x1:`12`,x2:`12`,y1:`12`,y2:`500`,stroke:q.value.historyPlot.color,"stroke-width":`3`,"stroke-linecap":`round`},null,8,D),f(`line`,{x1:`12`,x2:`600`,y1:`500`,y2:`500`,stroke:q.value.historyPlot.color,"stroke-width":`3`,"stroke-linecap":`round`},null,8,O),f(`path`,{d:`M 80,100 300,200 400,150 560,230 360,420 230,320`,fill:`none`,stroke:q.value.historyPlot.color,"stroke-width":`3`},null,8,k),f(`circle`,{cx:`80`,cy:`100`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,A),f(`text`,{x:`80`,y:`108`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 1 `,8,j),f(`circle`,{cx:`300`,cy:`200`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,M),f(`text`,{x:`300`,y:`208`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 2 `,8,N),f(`circle`,{cx:`400`,cy:`150`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,P),f(`text`,{x:`400`,y:`158`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 3 `,8,F),f(`circle`,{cx:`560`,cy:`230`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,I),f(`text`,{x:`560`,y:`238`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 4 `,8,L),f(`circle`,{cx:`360`,cy:`420`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,R),f(`text`,{x:`360`,y:`428`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 5 `,8,z),f(`circle`,{cx:`230`,cy:`320`,r:`24`,fill:q.value.historyPlot.color,stroke:q.value.backgroundColor,"stroke-width":`3`},null,8,B),f(`text`,{x:`230`,y:`328`,fill:q.value.backgroundColor,"font-size":`24`,"text-anchor":`middle`},` 6 `,8,V)],12,E)):u(``,!0),J.value===`circlePack`?(g(),d(`svg`,{key:3,xmlns:y(a),width:`100%`,viewBox:`0 0 100 100`,style:h(`background:${q.value.backgroundColor}`)},[f(`circle`,{cx:50,cy:50,r:20,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,U),f(`circle`,{cx:80,cy:50,r:10,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,de),f(`circle`,{cx:28,cy:30,r:10,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,fe),f(`circle`,{cx:25,cy:76,r:16,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,pe),f(`circle`,{cx:60,cy:78.5,r:10,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,me),f(`circle`,{cx:64,cy:20,r:13,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,he),f(`circle`,{cx:72,cy:37,r:5,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,ge),f(`circle`,{cx:25,cy:45,r:5,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,_e),f(`circle`,{cx:70,cy:66,r:5,stroke:q.value.circlePack.color,"stroke-width":1,fill:`none`},null,8,ve)],12,H)):u(``,!0),J.value===`flow`?(g(),d(`svg`,{key:4,xmlns:y(a),width:`100%`,viewBox:`0 0 80 60`,style:h(`background:${q.value.backgroundColor}`)},[m(o),f(`path`,{d:`M5 5V55M75 5V55M28 5V55M52 5V55M5 8l23 4L52 9 75 8v4H52L28 21 5 29ZM5 34l23 1L52 24l23-3v6L52 30 28 44l24-5 23 2v6L52 45 28 52H5Z`,stroke:q.value.flow.color,"stroke-width":.8,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:q.value.flow.color},null,8,be)],12,ye)):u(``,!0),J.value===`parallelCoordinatePlot`?(g(),d(`svg`,{key:5,xmlns:y(a),width:`100%`,viewBox:`0 0 80 60`,style:h(`background:${q.value.backgroundColor}`)},[m(o),f(`path`,{d:`M5 5V55M75 5V55M28 5V55M52 5V55M5 10a1 1 0 000 2 1 1 0 000-2m23 5a1 1 0 000 2 1 1 0 000-2M52 8a1 1 0 000 2 1 1 0 000-2m23 3a1 1 0 000 2 1 1 0 000-2M6 11l21 5m2 0L51 9m2 0 21 3M5 50a1 1 0 000-2 1 1 0 000 2M28 39a1 1 0 000 2 1 1 0 000-2m24 6a1 1 0 000 2 1 1 0 000-2m23 0a1 1 0 000 2 1 1 0 000-2M6 49l21-9m2 0 22 6m2 0H74M5 25a1 1 0 000 2 1 1 0 000-2m23 6a1 1 0 000 2 1 1 0 000-2m24-8a1 1 0 000 2 1 1 0 000-2m23-2a1 1 0 000 2 1 1 0 000-2M6 26l21 6m2 0 22-8m2 0 21-2`,stroke:q.value.parallelCoordinatePlot.color,"stroke-width":.8,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:q.value.parallelCoordinatePlot.color},null,8,Se)],12,xe)):u(``,!0),J.value===`bullet`?(g(),d(`svg`,{key:6,xmlns:y(a),width:`100%`,viewBox:`0 0 600 96`,style:h(`background:${q.value.backgroundColor}`)},[f(`rect`,{fill:q.value.bullet.color,x:24,y:12,width:300,height:72,style:{opacity:`0.8`}},null,8,we),f(`rect`,{fill:q.value.bullet.color,x:324,y:12,width:150,height:72,style:{opacity:`0.6`}},null,8,Te),f(`rect`,{fill:q.value.bullet.color,x:474,y:12,width:102,height:72,style:{opacity:`0.3`}},null,8,Ee),f(`rect`,{fill:q.value.bullet.color,x:24,y:36,width:490,height:24,style:{opacity:`1`}},null,8,De)],12,Ce)):u(``,!0),J.value===`dumbbell`?(g(),d(`svg`,{key:7,xmlns:y(a),width:`100%`,viewBox:`0 0 100 55`,style:h(`background:${q.value.backgroundColor}`)},[m(o),f(`line`,{x1:`3`,x2:`3`,y1:`3`,y2:`67`,stroke:q.value.dumbbell.color,"stroke-width":.5,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,ke),f(`path`,{d:`
2
2
  M 30,11
3
3
  C 39,10 39,10
4
4
  45,11
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./resolveChartConfig-0IvbmIE_.js";import{$ as n,Jt as r,Mt as i,P as a,X as ee,at as te,b as o,g as ne,i as re,in as ie,t as ae,zt as s}from"./lib-rPeBMZrn.js";import{c as oe}from"./canvas-lib-22VpOI4_.js";import{n as se,t as ce}from"./useHints-C-TwxM0Y.js";import{t as le}from"./useConfig-_JwRfIqE.js";import{n as ue,t as de}from"./BaseScanner-8NdoBs7B.js";import{t as fe}from"./useFitSvgText-C1QC4P5G.js";import{t as pe}from"./useResponsive-CENUxfEL.js";import{t as me}from"./usePrefersMotion-XLHwega2.js";import{t as he}from"./vue_ui_spark_trend-BgPQfeCz.js";import{t as ge}from"./DefGrad-DKMq1REY.js";import{t as c}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{computed as l,createBlock as _e,createCommentVNode as u,createElementBlock as d,createElementVNode as ve,createVNode as ye,defineAsyncComponent as be,nextTick as xe,normalizeStyle as Se,onMounted as Ce,openBlock as f,ref as p,renderSlot as m,toDisplayString as h,toRefs as we,unref as g,watch as _}from"vue";var Te=/* @__PURE__ */ e({default:()=>v}),Ee=[`id`,`aria-describedby`],De=[`id`],Oe=[`xmlns`,`viewBox`],ke=[`width`,`height`],Ae={key:1},je=[`d`,`fill`],Me=[`d`,`fill`],Ne=[`d`,`stroke`,`stroke-width`,`stroke-linecap`,`stroke-linejoin`],Pe=[`d`,`stroke`,`stroke-width`,`stroke-linecap`,`stroke-linejoin`],Fe=[`d`],Ie=[`fill`,`d`],Le=[`x`,`y`,`width`,`height`],Re=[`x`,`y`,`fill`,`font-size`,`font-weight`],ze=[`stroke`,`cx`,`cy`,`fill`],Be=[`x`,`y`,`font-size`,`fill`,`font-weight`],v=/*#__PURE__*/ c({__name:`vue-ui-spark-trend`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(e){let c=be(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),{vue_ui_spark_trend:Te}=le(),v=me(),y=e,b=p(null),Ve=p(null),x=p(null),S=p(null),C=p(null),w=p(!1),T=p(null),E=p(ee()),D=p(I()),O=l(()=>D.value.style.dataLabel),k=l(()=>D.value.style.trendLabel),A=l(()=>D.value.style.line),j=l(()=>D.value.style.area),M=l(()=>D.value.style);se({config:()=>D.value,dataset:()=>y.dataset,component:`VueUiSparkTrend`,rules:[ce.emptyArray,{test:e=>e.length>1095,message:[`👀 The dataset has > 1095 datapoints. Above this threshold, the dataset is computed through an LTTB algorithm, to preserve the shape of the data without increasing the number of datapoints.`,``,`▶️ If you need this level of detail, you can change config.downsample.threshold and set a higher value. Note that performance will be impacted.`]}]});let He=l(()=>ie({defaultConfig:{style:{animation:{show:!1},backgroundColor:`#99999930`,line:{stroke:`#6A6A6A`,useColorTrend:!1},dataLabel:{show:!1,useColorTrend:!1,color:`#6A6A6A`}}},userConfig:D.value.skeletonConfig??{}})),{loading:N,FINAL_DATASET:P,manualLoading:F}=ue({...we(y),FINAL_CONFIG:D,prepareConfig:I,skeletonDataset:y.config?.skeletonDataset??[1,2,3,5,8,13,21,34,55,89,144,233],skeletonConfig:ie({defaultConfig:D.value,userConfig:He.value})});function I(){return t(y.config,Te,he)}let L=l(()=>i({data:P.value,threshold:D.value.downsample.threshold}));_(()=>y.config,e=>{D.value=I(),H.value=M.value.width,U.value=M.value.height,V()},{deep:!0});function R(e){return e.map(e=>o(e))}let z=p(i({data:P.value,threshold:D.value.downsample.threshold}).map(e=>M.value.animation.show&&!v.value||[void 0,1/0,-1/0,null,NaN].includes(e)?null:e));_(L,e=>{T.value&&=(cancelAnimationFrame(T.value),null),M.value.animation.show&&!v.value?z.value=Array(e.length).fill(null):z.value=e.map(e=>![void 0,1/0,-1/0,null].includes(e)&&!Number.isNaN(e)?e:null),B(),xe(()=>$(`.vue-ui-sparktrend-progress-label`,6))},{deep:!0,immediate:!0}),_(()=>JSON.stringify(y.dataset),()=>{T.value&&=(cancelAnimationFrame(T.value),null),F.value=s(y.dataset);let e=L.value;z.value=M.value.animation.show&&!v.value?Array(e.length).fill(null):e.map(e=>Number.isFinite(e)?e:null),B(),xe(()=>$(`.vue-ui-sparktrend-progress-label`,6))},{deep:!1,immediate:!0});function B(){let e=1e3/M.value.animation.animationFrames,t=performance.now();if(!N.value&&M.value.animation.show&&!v.value&&M.value.animation.animationFrames&&P.value.length>1){z.value=[];let n=0;function r(){w.value=!0;let i=performance.now(),a=i-t;a>e?(t=i-a%e,n<L.value.length?(z.value.push(L.value[n]),n+=1,T.value=requestAnimationFrame(r)):(cancelAnimationFrame(T.value),z.value=R(L.value),w.value=!1,$(`.vue-ui-sparktrend-progress-label`,6))):T.value=requestAnimationFrame(r)}r()}}Ce(()=>{V()});let Ue=l(()=>D.value.debug);function V(){if(s(y.dataset)&&(te({componentName:`VueUiSparkTrend`,type:`dataset`,debug:Ue.value}),F.value=!0),s(y.dataset)||(F.value=!1),D.value.responsive){let e=oe(()=>{let{width:e,height:t}=pe({chart:b.value,source:x.value});requestAnimationFrame(()=>{H.value=e,U.value=t})});S.value&&(C.value&&S.value.unobserve(C.value),S.value.disconnect()),S.value=new ResizeObserver(e),C.value=b.value.parentNode,S.value.observe(C.value)}B(),$(`.vue-ui-sparktrend-progress-label`,6)}let H=p(M.value.width),U=p(M.value.height),W=l(()=>({height:U.value,width:H.value})),G=l(()=>({top:M.value.padding.top,left:M.value.padding.left,right:W.value.width-M.value.padding.right,bottom:W.value.height-M.value.padding.bottom,height:W.value.height-(M.value.padding.top+M.value.padding.bottom)-(O.value.show?O.value.fontSize:0),width:W.value.width-(M.value.padding.left+M.value.padding.right)})),K=l(()=>{let e=R(L.value).filter(Number.isFinite);if(!e.length)return{max:0,min:0};let t=e[0],n=e[0];for(let r=1;r<e.length;r++){let i=e[r];i>t&&(t=i),i<n&&(n=i)}return{max:t,min:n}}),We=l(()=>{let e=L.value,t=e.length?e[e.length-1]:`x`;return[E.value,e.length,Number.isFinite(t)?t:`x`,D.value.downsample.threshold,A.value.smooth?`s`:`l`].join(`-`)}),q=l(()=>{let e=K.value.min>=0?0:K.value.min;return Math.abs(e)}),Ge=l(()=>K.value.max+q.value);function Ke(e){return e/Ge.value}let qe=l(()=>L.value.length),J=l(()=>z.value.map((e,t)=>{let n=isNaN(e)||[void 0,null,`NaN`,NaN,1/0,-1/0].includes(e)?0:e||0;return{value:o(e),absoluteValue:o(n),plotValue:o(n+q.value),toMax:Ke(n+q.value),x:G.value.left+o(t*(G.value.width/(qe.value-1)))-M.value.padding.right,y:G.value.bottom-o(G.value.height*Ke(n+q.value))}})),Y=l(()=>{let e=R(L.value);return k.value.trendType===`global`?ne(e):k.value.trendType===`n-1`&&e.length>1?(e.at(-1)/e.at(-2)-1)*100:k.value.trendType===`lastToFirst`?(e.at(-1)/e[0]-1)*100:0}),X=l(()=>w.value||Y.value===0?`neutral`:Y.value>0?`positive`:`negative`),Z=l(()=>M.value.arrow.colors[X.value]),Je=l(()=>{let e={x:J.value[0].x,y:W.value.height-6},t={x:J.value[J.value.length-1].x,y:W.value.height-6},n=[];return J.value.forEach(e=>{n.push(`${e.x},${e.y} `)}),[e.x,e.y,...n,t.x,t.y].toString()}),Ye=l(()=>{let e=[];return J.value.forEach(t=>{e.push(`${t.x},${t.y} `)}),`M ${e.toString()}`}),Q=l(()=>U.value/2-k.value.fontSize),Xe=l(()=>G.value.left*.8),{fitText:$}=fe({svgRef:Ve,unitWidth:Xe,fontSize:k.value.fontSize}),Ze=l(()=>{if(N.value||w.value)return`Trend chart loading`;let e=J.value?.at(-1),t=e?.value,r=n({p:Y.value>0?`+`:``,v:Y.value,s:`%`,r:k.value.rounding}),i=t==null?`not available`:re(O.value.formatter,t,n({p:O.value.prefix,v:t,s:O.value.suffix,r:O.value.rounding}),{datapoint:e});return`Progression ${X.value===`positive`?`up ${r}`:X.value===`negative`?`down ${r}`:`stable at ${r}`}. Last value ${i}.`}),Qe=l(()=>`sparktrend-a11y-${E.value}`);return(e,t)=>(f(),d(`div`,{ref_key:`sparkTrendChart`,ref:b,class:`vue-data-ui-component vue-ui-spark-trend`,id:E.value,style:Se(`width:100%;font-family:${M.value.fontFamily};background:${M.value.backgroundColor}`),role:`img`,"aria-describedby":Qe.value},[ve(`p`,{id:Qe.value,class:`sr-only`,"aria-live":`polite`},h(Ze.value),9,De),(f(),d(`svg`,{key:We.value,ref_key:`svgRef`,ref:Ve,xmlns:g(ae),viewBox:`0 0 ${W.value.width} ${W.value.height}`,style:`width:100%;background:transparent;overflow:visible`,"aria-hidden":`true`},[ye(g(c)),e.$slots[`chart-background`]?(f(),d(`foreignObject`,{key:0,x:0,y:0,width:W.value.width<=0?10:W.value.width,height:W.value.height<=0?10:W.value.height,style:{pointerEvents:`none`}},[m(e.$slots,`chart-background`,{},void 0,!0)],8,ke)):u(``,!0),ve(`defs`,null,[ye(ge,{t:`linear`,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`,id:`pill_gradient_${E.value}`,stops:[[`0%`,g(r)(A.value.useColorTrend?Z.value:A.value.stroke,j.value.opacity),1],[`100%`,M.value.backgroundColor,1]]},null,8,[`id`,`stops`])]),j.value.show&&J.value[0]?(f(),d(`g`,Ae,[A.value.smooth?(f(),d(`path`,{key:0,d:`M ${J.value[0].x},${G.value.bottom} ${g(a)(J.value)} L ${J.value.at(-1).x},${G.value.bottom} Z`,fill:j.value.useGradient?`url(#pill_gradient_${E.value})`:g(r)(A.value.useColorTrend?Z.value:A.value.stroke,j.value.opacity),stroke:`none`},null,8,je)):(f(),d(`path`,{key:1,d:`M${Je.value}Z`,fill:j.value.useGradient?`url(#pill_gradient_${E.value})`:g(r)(A.value.useColorTrend?Z.value:A.value.stroke,j.value.opacity),stroke:`none`},null,8,Me))])):u(``,!0),A.value.smooth&&J.value.length?(f(),d(`path`,{key:2,d:`M ${g(a)(J.value)}`,stroke:A.value.useColorTrend?Z.value:A.value.stroke,fill:`none`,"stroke-width":A.value.strokeWidth,"stroke-linecap":A.value.strokeLinecap,"stroke-linejoin":A.value.strokeLinejoin},null,8,Ne)):u(``,!0),!A.value.smooth&&J.value.length?(f(),d(`path`,{key:3,d:Ye.value,stroke:A.value.useColorTrend?Z.value:A.value.stroke,fill:`none`,"stroke-width":A.value.strokeWidth,"stroke-linecap":A.value.strokeLinecap,"stroke-linejoin":A.value.strokeLinejoin},null,8,Pe)):u(``,!0),g(N)?(f(),d(`path`,{key:4,fill:`#6A6A6A`,d:`M ${G.value.left/2+6}, ${Q.value+7} ${G.value.left/2-7}, ${Q.value} ${G.value.left/2-7}, ${Q.value+14} Z`},null,8,Fe)):(f(),d(`path`,{key:5,fill:Z.value,d:X.value===`positive`?`M ${G.value.left/2}, ${Q.value} ${G.value.left/2-7}, ${Q.value+12} ${G.value.left/2+7}, ${Q.value+12} Z`:X.value===`negative`?`M ${G.value.left/2}, ${Q.value+12} ${G.value.left/2-7}, ${Q.value} ${G.value.left/2+7}, ${Q.value} Z`:`M ${G.value.left/2+6}, ${Q.value+7} ${G.value.left/2-7}, ${Q.value} ${G.value.left/2-7}, ${Q.value+14} Z`},null,8,Ie)),g(N)?(f(),d(`rect`,{key:6,x:G.value.left/2-k.value.fontSize-2,y:U.value/2+k.value.fontSize-2,width:k.value.fontSize*2,height:k.value.fontSize,fill:`#6A6A6A80`,rx:`3`},null,8,Le)):u(``,!0),!w.value&&!g(N)?(f(),d(`text`,{key:7,class:`vue-ui-sparktrend-progress-label`,x:G.value.left/2,y:U.value/2+k.value.fontSize*2,"text-anchor":`middle`,fill:k.value.useColorTrend?Z.value:k.value.color,"font-size":k.value.fontSize,"font-weight":k.value.bold?`bold`:`normal`},h(g(n)({p:Y.value>0?`+`:``,v:Y.value,s:`%`,r:k.value.rounding})),9,Re)):u(``,!0),J.value.length&&J.value.at(-1).x!==void 0?(f(),d(`circle`,{key:8,stroke:M.value.backgroundColor,"stroke-width":2,cx:J.value.at(-1).x,cy:J.value.at(-1).y,r:4,fill:g(N)?`#6A6A6A`:Z.value},null,8,ze)):u(``,!0),J.value.length&&J.value.at(-1).x!==void 0&&O.value.show?(f(),d(`text`,{key:9,"text-anchor":`middle`,x:J.value.at(-1).x,y:J.value.at(-1).y-O.value.fontSize/1.5,"font-size":O.value.fontSize,fill:O.value.useColorTrend?Z.value:O.value.color,"font-weight":O.value.bold?`bold`:`normal`},h(g(re)(O.value.formatter,J.value.at(-1).value,g(n)({p:O.value.prefix,v:J.value.at(-1).value,s:O.value.suffix,r:O.value.rounding}),{datapoint:J.value.at(-1)})),9,Be)):u(``,!0)],8,Oe)),e.$slots.source?(f(),d(`div`,{key:0,ref_key:`source`,ref:x,dir:`auto`},[m(e.$slots,`source`,{},void 0,!0)],512)):u(``,!0),m(e.$slots,`skeleton`,{},()=>[g(N)?(f(),_e(de,{key:0})):u(``,!0)],!0)],12,Ee))}},[[`__scopeId`,`data-v-814f1b0f`]]);export{Te as n,v as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./resolveChartConfig-0IvbmIE_.js";import{$ as n,Jt as r,Mt as i,P as a,X as ee,at as te,b as o,g as ne,i as re,in as ie,t as ae,zt as s}from"./lib-rPeBMZrn.js";import{c as oe}from"./canvas-lib-22VpOI4_.js";import{n as se,t as ce}from"./useHints-C-TwxM0Y.js";import{t as le}from"./useConfig-_JwRfIqE.js";import{n as ue,t as de}from"./BaseScanner-8NdoBs7B.js";import{t as fe}from"./useFitSvgText-C1QC4P5G.js";import{t as pe}from"./useResponsive-CENUxfEL.js";import{t as me}from"./usePrefersMotion-XLHwega2.js";import{t as he}from"./vue_ui_spark_trend-BgPQfeCz.js";import{t as ge}from"./DefGrad-DKMq1REY.js";import{t as c}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{computed as l,createBlock as _e,createCommentVNode as u,createElementBlock as d,createElementVNode as ve,createVNode as ye,defineAsyncComponent as be,nextTick as xe,normalizeStyle as Se,onMounted as Ce,openBlock as f,ref as p,renderSlot as m,toDisplayString as h,toRefs as we,unref as g,watch as _}from"vue";var Te=/* @__PURE__ */ e({default:()=>v}),Ee=[`id`,`aria-describedby`],De=[`id`],Oe=[`xmlns`,`viewBox`],ke=[`width`,`height`],Ae={key:1},je=[`d`,`fill`],Me=[`d`,`fill`],Ne=[`d`,`stroke`,`stroke-width`,`stroke-linecap`,`stroke-linejoin`],Pe=[`d`,`stroke`,`stroke-width`,`stroke-linecap`,`stroke-linejoin`],Fe=[`d`],Ie=[`fill`,`d`],Le=[`x`,`y`,`width`,`height`],Re=[`x`,`y`,`fill`,`font-size`,`font-weight`],ze=[`stroke`,`cx`,`cy`,`fill`],Be=[`x`,`y`,`font-size`,`fill`,`font-weight`],v=/*#__PURE__*/ c({__name:`vue-ui-spark-trend`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(e){let c=be(()=>import(`./PackageVersion-PdpqwkYX.js`).then(e=>e.t)),{vue_ui_spark_trend:Te}=le(),v=me(),y=e,b=p(null),Ve=p(null),x=p(null),S=p(null),C=p(null),w=p(!1),T=p(null),E=p(ee()),D=p(I()),O=l(()=>D.value.style.dataLabel),k=l(()=>D.value.style.trendLabel),A=l(()=>D.value.style.line),j=l(()=>D.value.style.area),M=l(()=>D.value.style);se({config:()=>D.value,dataset:()=>y.dataset,component:`VueUiSparkTrend`,rules:[ce.emptyArray,{test:e=>e.length>1095,message:[`👀 The dataset has > 1095 datapoints. Above this threshold, the dataset is computed through an LTTB algorithm, to preserve the shape of the data without increasing the number of datapoints.`,``,`▶️ If you need this level of detail, you can change config.downsample.threshold and set a higher value. Note that performance will be impacted.`]}]});let He=l(()=>ie({defaultConfig:{style:{animation:{show:!1},backgroundColor:`#99999930`,line:{stroke:`#6A6A6A`,useColorTrend:!1},dataLabel:{show:!1,useColorTrend:!1,color:`#6A6A6A`}}},userConfig:D.value.skeletonConfig??{}})),{loading:N,FINAL_DATASET:P,manualLoading:F}=ue({...we(y),FINAL_CONFIG:D,prepareConfig:I,skeletonDataset:y.config?.skeletonDataset??[1,2,3,5,8,13,21,34,55,89,144,233],skeletonConfig:ie({defaultConfig:D.value,userConfig:He.value})});function I(){return t(y.config,Te,he)}let L=l(()=>i({data:P.value,threshold:D.value.downsample.threshold}));_(()=>y.config,e=>{D.value=I(),H.value=M.value.width,U.value=M.value.height,V()},{deep:!0});function R(e){return e.map(e=>o(e))}let z=p(i({data:P.value,threshold:D.value.downsample.threshold}).map(e=>M.value.animation.show&&!v.value||[void 0,1/0,-1/0,null,NaN].includes(e)?null:e));_(L,e=>{T.value&&=(cancelAnimationFrame(T.value),null),M.value.animation.show&&!v.value?z.value=Array(e.length).fill(null):z.value=e.map(e=>![void 0,1/0,-1/0,null].includes(e)&&!Number.isNaN(e)?e:null),B(),xe(()=>$(`.vue-ui-sparktrend-progress-label`,6))},{deep:!0,immediate:!0}),_(()=>JSON.stringify(y.dataset),()=>{T.value&&=(cancelAnimationFrame(T.value),null),F.value=s(y.dataset);let e=L.value;z.value=M.value.animation.show&&!v.value?Array(e.length).fill(null):e.map(e=>Number.isFinite(e)?e:null),B(),xe(()=>$(`.vue-ui-sparktrend-progress-label`,6))},{deep:!1,immediate:!0});function B(){let e=1e3/M.value.animation.animationFrames,t=performance.now();if(!N.value&&M.value.animation.show&&!v.value&&M.value.animation.animationFrames&&P.value.length>1){z.value=[];let n=0;function r(){w.value=!0;let i=performance.now(),a=i-t;a>e?(t=i-a%e,n<L.value.length?(z.value.push(L.value[n]),n+=1,T.value=requestAnimationFrame(r)):(cancelAnimationFrame(T.value),z.value=R(L.value),w.value=!1,$(`.vue-ui-sparktrend-progress-label`,6))):T.value=requestAnimationFrame(r)}r()}}Ce(()=>{V()});let Ue=l(()=>D.value.debug);function V(){if(s(y.dataset)&&(te({componentName:`VueUiSparkTrend`,type:`dataset`,debug:Ue.value}),F.value=!0),s(y.dataset)||(F.value=!1),D.value.responsive){let e=oe(()=>{let{width:e,height:t}=pe({chart:b.value,source:x.value});requestAnimationFrame(()=>{H.value=e,U.value=t})});S.value&&(C.value&&S.value.unobserve(C.value),S.value.disconnect()),S.value=new ResizeObserver(e),C.value=b.value.parentNode,S.value.observe(C.value)}B(),$(`.vue-ui-sparktrend-progress-label`,6)}let H=p(M.value.width),U=p(M.value.height),W=l(()=>({height:U.value,width:H.value})),G=l(()=>({top:M.value.padding.top,left:M.value.padding.left,right:W.value.width-M.value.padding.right,bottom:W.value.height-M.value.padding.bottom,height:W.value.height-(M.value.padding.top+M.value.padding.bottom)-(O.value.show?O.value.fontSize:0),width:W.value.width-(M.value.padding.left+M.value.padding.right)})),K=l(()=>{let e=R(L.value).filter(Number.isFinite);if(!e.length)return{max:0,min:0};let t=e[0],n=e[0];for(let r=1;r<e.length;r++){let i=e[r];i>t&&(t=i),i<n&&(n=i)}return{max:t,min:n}}),We=l(()=>{let e=L.value,t=e.length?e[e.length-1]:`x`;return[E.value,e.length,Number.isFinite(t)?t:`x`,D.value.downsample.threshold,A.value.smooth?`s`:`l`].join(`-`)}),q=l(()=>{let e=K.value.min>=0?0:K.value.min;return Math.abs(e)}),Ge=l(()=>K.value.max+q.value);function Ke(e){return e/Ge.value}let qe=l(()=>L.value.length),J=l(()=>z.value.map((e,t)=>{let n=isNaN(e)||[void 0,null,`NaN`,NaN,1/0,-1/0].includes(e)?0:e||0;return{value:o(e),absoluteValue:o(n),plotValue:o(n+q.value),toMax:Ke(n+q.value),x:G.value.left+o(t*(G.value.width/(qe.value-1)))-M.value.padding.right,y:G.value.bottom-o(G.value.height*Ke(n+q.value))}})),Y=l(()=>{let e=R(L.value);return k.value.trendType===`global`?ne(e):k.value.trendType===`n-1`&&e.length>1?(e.at(-1)/e.at(-2)-1)*100:k.value.trendType===`lastToFirst`?(e.at(-1)/e[0]-1)*100:0}),X=l(()=>w.value||Y.value===0?`neutral`:Y.value>0?`positive`:`negative`),Z=l(()=>M.value.arrow.colors[X.value]),Je=l(()=>{let e={x:J.value[0].x,y:W.value.height-6},t={x:J.value[J.value.length-1].x,y:W.value.height-6},n=[];return J.value.forEach(e=>{n.push(`${e.x},${e.y} `)}),[e.x,e.y,...n,t.x,t.y].toString()}),Ye=l(()=>{let e=[];return J.value.forEach(t=>{e.push(`${t.x},${t.y} `)}),`M ${e.toString()}`}),Q=l(()=>U.value/2-k.value.fontSize),Xe=l(()=>G.value.left*.8),{fitText:$}=fe({svgRef:Ve,unitWidth:Xe,fontSize:k.value.fontSize}),Ze=l(()=>{if(N.value||w.value)return`Trend chart loading`;let e=J.value?.at(-1),t=e?.value,r=n({p:Y.value>0?`+`:``,v:Y.value,s:`%`,r:k.value.rounding}),i=t==null?`not available`:re(O.value.formatter,t,n({p:O.value.prefix,v:t,s:O.value.suffix,r:O.value.rounding}),{datapoint:e});return`Progression ${X.value===`positive`?`up ${r}`:X.value===`negative`?`down ${r}`:`stable at ${r}`}. Last value ${i}.`}),Qe=l(()=>`sparktrend-a11y-${E.value}`);return(e,t)=>(f(),d(`div`,{ref_key:`sparkTrendChart`,ref:b,class:`vue-data-ui-component vue-ui-spark-trend`,id:E.value,style:Se(`width:100%;font-family:${M.value.fontFamily};background:${M.value.backgroundColor}`),role:`img`,"aria-describedby":Qe.value},[ve(`p`,{id:Qe.value,class:`sr-only`,"aria-live":`polite`},h(Ze.value),9,De),(f(),d(`svg`,{key:We.value,ref_key:`svgRef`,ref:Ve,xmlns:g(ae),viewBox:`0 0 ${W.value.width} ${W.value.height}`,style:`width:100%;background:transparent;overflow:visible`,"aria-hidden":`true`},[ye(g(c)),e.$slots[`chart-background`]?(f(),d(`foreignObject`,{key:0,x:0,y:0,width:W.value.width<=0?10:W.value.width,height:W.value.height<=0?10:W.value.height,style:{pointerEvents:`none`}},[m(e.$slots,`chart-background`,{},void 0,!0)],8,ke)):u(``,!0),ve(`defs`,null,[ye(ge,{t:`linear`,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`,id:`pill_gradient_${E.value}`,stops:[[`0%`,g(r)(A.value.useColorTrend?Z.value:A.value.stroke,j.value.opacity),1],[`100%`,M.value.backgroundColor,1]]},null,8,[`id`,`stops`])]),j.value.show&&J.value[0]?(f(),d(`g`,Ae,[A.value.smooth?(f(),d(`path`,{key:0,d:`M ${J.value[0].x},${G.value.bottom} ${g(a)(J.value)} L ${J.value.at(-1).x},${G.value.bottom} Z`,fill:j.value.useGradient?`url(#pill_gradient_${E.value})`:g(r)(A.value.useColorTrend?Z.value:A.value.stroke,j.value.opacity),stroke:`none`},null,8,je)):(f(),d(`path`,{key:1,d:`M${Je.value}Z`,fill:j.value.useGradient?`url(#pill_gradient_${E.value})`:g(r)(A.value.useColorTrend?Z.value:A.value.stroke,j.value.opacity),stroke:`none`},null,8,Me))])):u(``,!0),A.value.smooth&&J.value.length?(f(),d(`path`,{key:2,d:`M ${g(a)(J.value)}`,stroke:A.value.useColorTrend?Z.value:A.value.stroke,fill:`none`,"stroke-width":A.value.strokeWidth,"stroke-linecap":A.value.strokeLinecap,"stroke-linejoin":A.value.strokeLinejoin},null,8,Ne)):u(``,!0),!A.value.smooth&&J.value.length?(f(),d(`path`,{key:3,d:Ye.value,stroke:A.value.useColorTrend?Z.value:A.value.stroke,fill:`none`,"stroke-width":A.value.strokeWidth,"stroke-linecap":A.value.strokeLinecap,"stroke-linejoin":A.value.strokeLinejoin},null,8,Pe)):u(``,!0),g(N)?(f(),d(`path`,{key:4,fill:`#6A6A6A`,d:`M ${G.value.left/2+6}, ${Q.value+7} ${G.value.left/2-7}, ${Q.value} ${G.value.left/2-7}, ${Q.value+14} Z`},null,8,Fe)):(f(),d(`path`,{key:5,fill:Z.value,d:X.value===`positive`?`M ${G.value.left/2}, ${Q.value} ${G.value.left/2-7}, ${Q.value+12} ${G.value.left/2+7}, ${Q.value+12} Z`:X.value===`negative`?`M ${G.value.left/2}, ${Q.value+12} ${G.value.left/2-7}, ${Q.value} ${G.value.left/2+7}, ${Q.value} Z`:`M ${G.value.left/2+6}, ${Q.value+7} ${G.value.left/2-7}, ${Q.value} ${G.value.left/2-7}, ${Q.value+14} Z`},null,8,Ie)),g(N)?(f(),d(`rect`,{key:6,x:G.value.left/2-k.value.fontSize-2,y:U.value/2+k.value.fontSize-2,width:k.value.fontSize*2,height:k.value.fontSize,fill:`#6A6A6A80`,rx:`3`},null,8,Le)):u(``,!0),!w.value&&!g(N)?(f(),d(`text`,{key:7,class:`vue-ui-sparktrend-progress-label`,x:G.value.left/2,y:U.value/2+k.value.fontSize*2,"text-anchor":`middle`,fill:k.value.useColorTrend?Z.value:k.value.color,"font-size":k.value.fontSize,"font-weight":k.value.bold?`bold`:`normal`},h(g(n)({p:Y.value>0?`+`:``,v:Y.value,s:`%`,r:k.value.rounding})),9,Re)):u(``,!0),J.value.length&&J.value.at(-1).x!==void 0?(f(),d(`circle`,{key:8,stroke:M.value.backgroundColor,"stroke-width":2,cx:J.value.at(-1).x,cy:J.value.at(-1).y,r:4,fill:g(N)?`#6A6A6A`:Z.value},null,8,ze)):u(``,!0),J.value.length&&J.value.at(-1).x!==void 0&&O.value.show?(f(),d(`text`,{key:9,"text-anchor":`middle`,x:J.value.at(-1).x,y:J.value.at(-1).y-O.value.fontSize/1.5,"font-size":O.value.fontSize,fill:O.value.useColorTrend?Z.value:O.value.color,"font-weight":O.value.bold?`bold`:`normal`},h(g(re)(O.value.formatter,J.value.at(-1).value,g(n)({p:O.value.prefix,v:J.value.at(-1).value,s:O.value.suffix,r:O.value.rounding}),{datapoint:J.value.at(-1)})),9,Be)):u(``,!0)],8,Oe)),e.$slots.source?(f(),d(`div`,{key:0,ref_key:`source`,ref:x,dir:`auto`},[m(e.$slots,`source`,{},void 0,!0)],512)):u(``,!0),m(e.$slots,`skeleton`,{},()=>[g(N)?(f(),_e(de,{key:0})):u(``,!0)],!0)],12,Ee))}},[[`__scopeId`,`data-v-814f1b0f`]]);export{Te as n,v as t};
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t}from"./resolveChartConfig-0IvbmIE_.js";import{$ as n,Ht as r,Jt as i,S as a,X as ee,Yt as te,at as o,i as s,in as c,t as ne,w as re,yt as ie,zt as ae}from"./lib-rPeBMZrn.js";import{n as oe,t as se}from"./useHints-C-TwxM0Y.js";import{t as ce}from"./useConfig-_JwRfIqE.js";import{n as le,t as ue}from"./BaseScanner-8NdoBs7B.js";import{t as de}from"./usePrefersMotion-XLHwega2.js";import{t as l}from"./vue_ui_sparkbar-CvcZ5nwT.js";import{t as u}from"./DefGrad-DKMq1REY.js";import{Fragment as d,computed as f,createBlock as fe,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createVNode as g,defineAsyncComponent as pe,guardReactiveProps as me,mergeProps as he,nextTick as ge,normalizeProps as _e,normalizeStyle as _,onMounted as v,openBlock as y,ref as b,renderList as ve,renderSlot as x,toDisplayString as S,toRefs as ye,unref as C,useSlots as w,watch as T}from"vue";var E=/* @__PURE__ */ e({default:()=>P}),D=[`onClick`,`onMouseenter`,`onMouseleave`],O={key:1,class:`vue-ui-sparkbar-datapoint-value`},k=[`xmlns`,`viewBox`],A=[`height`,`width`,`fill`,`rx`],j=[`height`,`width`,`fill`,`rx`],M=[`height`,`width`,`fill`,`rx`],N={key:2,ref:`source`,dir:`auto`},P={__name:`vue-ui-sparkbar`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},backgroundOpacity:{type:Number,default:null}},emits:[`selectDatapoint`],setup(e,{emit:E}){let P=pe(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),{vue_ui_sparkbar:be}=ce(),F=de(),I=e,xe=w(),L=b(ee()),R=b(G()),z=f(()=>R.value.style.bar),B=f(()=>R.value.style.labels),V=f(()=>R.value.style),H=f(()=>R.value.debug);v(()=>{xe[`chart-background`]&&H.value&&console.warn(`VueUiSparkbar does not support the #chart-background slot.`)}),oe({config:()=>R.value,dataset:()=>I.dataset,component:`VueUiSparkbar`,rules:[se.noHint]});let Se=f(()=>c({defaultConfig:{style:{backgroundColor:`#99999930`,animation:{show:!1},layout:{independant:!0},gutter:{backgroundColor:`#6A6A6A`,opacity:50},bar:{gradient:{underlayerColor:`#6A6A6A`}}}},userConfig:R.value.skeletonConfig??{}})),{loading:U,FINAL_DATASET:W,manualLoading:Ce}=le({...ye(I),FINAL_CONFIG:R,prepareConfig:G,skeletonDataset:I.config?.skeletonDataset??[{name:`_`,value:21,target:25,color:`#808080`},{name:`_`,value:13,target:25,color:`#ADADAD`},{name:`_`,value:8,target:25,color:`#DBDBDB`}],skeletonConfig:c({defaultConfig:R.value,userConfig:Se.value})});function G(){return t(I.config,be,l)}T(()=>I.config,e=>{R.value=G()},{deep:!0});let we=f(()=>re(R.value.customPalette)),K=b(W.value.map(e=>({...e,value:V.value.animation.show?0:e.value||0,formatter:e.formatter||null}))),q=b(null);v(async()=>{ae(I.dataset)&&o({componentName:`VueUiSparkbar`,type:`dataset`,debug:H.value}),J()});function J(){if(V.value.animation.show&&!F.value){let e=V.value.animation.animationFrames,t=W.value.map((t,n)=>t.value/e),n=W.value.map(e=>e.value||0).reduce((e,t)=>e+t,0),r=0;function i(){r+=n/e,r<n?(K.value=K.value.map((e,n)=>({...e,value:e.value+=t[n]})),q.value=requestAnimationFrame(i)):K.value=W.value.map(e=>({...e,value:e.value||0,formatter:e.formatter||null}))}i()}}T(()=>W.value,async e=>{cancelAnimationFrame(q.value),K.value=W.value.map(e=>({...e,value:V.value.animation.show&&!F.value?0:e.value||0,formatter:e.formatter||null})),ge(J)},{deep:!0});let Y=b({width:500,height:16}),Te=f(()=>Math.max(...W.value.map(e=>e.value))),Ee=f(()=>(H.value&&W.value.forEach((e,t)=>{ie({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{o({componentName:`VueUiSparkbar`,type:`datasetSerieAttribute`,property:e,index:t})})}),K.value.map((e,t)=>({...e,value:e.value||0,color:a(e.color)||we.value[t]||r[t]||r[t%r.length]}))));function X(e){return e/Te.value}function Z(e){return V.value.layout.independant?e.target?e.value/e.target:V.value.layout.percentage?e.value>100?1:e.value/100:V.value.layout.target===0?1:e.value/V.value.layout.target:X(e.value)}function Q(e){return V.value.layout.independant&&e.target||V.value.layout.target}let De=E;function Oe(e,t){De(`selectDatapoint`,{datapoint:e,index:t}),R.value.events.datapointClick&&R.value.events.datapointClick({datapoint:e,seriesIndex:t})}function ke(e,t){R.value.events.datapointEnter&&R.value.events.datapointEnter({datapoint:e,seriesIndex:t})}function Ae(e,t){R.value.events.datapointLeave&&R.value.events.datapointLeave({datapoint:e,seriesIndex:t})}let $=f(()=>z.value.borderRadius==null?Y.value.height/2:Math.min(Y.value.height/2,z.value.borderRadius));return(e,t)=>(y(),m(`div`,{class:`vue-data-ui-component vue-ui-sparkbar`,style:_({width:`100%`,position:`relative`,fontFamily:V.value.fontFamily,background:I.backgroundOpacity===null?V.value.backgroundColor:C(i)(V.value.backgroundColor,I.backgroundOpacity)})},[e.$slots.title?x(e.$slots,`title`,_e(me({title:{...e.title,title:V.value.title.text,subtitle:V.value.title.subtitle.text}})),void 0,void 0,0):p(``,!0),!e.$slots.title&&V.value.title.text?(y(),m(`div`,{key:1,class:`vue-ui-sparkbar-title-container`,style:_({background:V.value.title.backgroundColor,margin:V.value.title.margin,textAlign:V.value.title.textAlign})},[h(`div`,{class:`vue-ui-sparkbar-title`,style:_({fontSize:V.value.title.fontSize+`px`,color:V.value.title.color,fontWeight:V.value.title.bold?`bold`:`normal`})},S(V.value.title.text),5),V.value.title.subtitle.text?(y(),m(`div`,{key:0,class:`vue-ui-sparkbar-subtitle`,style:_({fontSize:V.value.title.subtitle.fontSize+`px`,color:V.value.title.subtitle.color,fontWeight:V.value.title.subtitle.bold?`bold`:`normal`})},S(V.value.title.subtitle.text),5)):p(``,!0)],4)):p(``,!0),(y(!0),m(d,null,ve(Ee.value,(t,r)=>(y(),m(`div`,{style:_(`display:flex !important;${[`left`,`right`].includes(B.value.name.position)?`flex-direction: ${B.value.name.position===`right`?`row-reverse`:`row`} !important`:`flex-direction:column !important`};gap:${V.value.gap}px !important;align-items:center;${C(W).length>0&&r!==C(W).length-1?`margin-bottom:6px`:``}`),onClick:e=>Oe(t,r),onMouseenter:e=>ke(t,r),onMouseleave:e=>Ae(t,r)},[C(U)?p(``,!0):x(e.$slots,`data-label`,he({ref_for:!0},{bar:{...t,target:Q(t),valueLabel:C(s)(t.formatter,t.value,C(n)({p:t.prefix||``,v:t.value,s:t.suffix||``,r:t.rounding||0}),{datapoint:t,seriesIndex:r}),targetLabel:C(s)(t.formatter,Q(t),C(n)({p:t.prefix||``,v:Q(t),s:t.suffix||``,r:t.rounding||0}),{datapoint:t,seriesIndex:r})}}),void 0,void 0,0),!e.$slots[`data-label`]||C(U)?(y(),m(`div`,{key:1,style:_({display:`flex`,justifyContent:[`right`,`top-right`].includes(B.value.name.position)?`flex-end`:[`top-center`].includes(B.value.name.position)?`center`:`flex-start`,alignItems:`center`,width:B.value.name.width,color:B.value.name.color,fontSize:B.value.fontSize+`px`,fontWeight:B.value.name.bold?`bold`:`normal`,flexWrap:`wrap`})},[C(U)?(y(),m(`div`,{key:0,class:`vue-ui-sparkbar-skeleton-name`,style:_({width:`60px`,height:B.value.fontSize+`px`,borderRadius:B.value.fontSize/4+`px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginTop:`5px`})},[h(`div`,{style:_({height:`100%`,width:`40px`,borderRadius:B.value.fontSize/4+`px`,backgroundColor:`#6A6A6A80`})},null,4),h(`div`,{style:_({height:`100%`,width:`15px`,borderRadius:B.value.fontSize/4+`px`,backgroundColor:`#6A6A6A80`})},null,4)],4)):(y(),m(d,{key:1},[h(`span`,null,S(t.name),1),B.value.value.show?(y(),m(`span`,{key:0,style:_(`font-weight:${B.value.value.bold?`bold`:`normal`}`),class:`vue-ui-sparkbar-datapoint-name`},`: `+S(C(s)(t.formatter,t.value,C(n)({p:t.prefix||``,v:t.value,s:t.suffix||``,r:t.rounding||0}),{datapoint:t,seriesIndex:r})),5)):p(``,!0),V.value.layout.showTargetValue?(y(),m(`span`,O,S(` `+V.value.layout.targetValueText)+` `+S(C(s)(t.formatter,Q(t),C(n)({p:t.prefix||``,v:Q(t),s:t.suffix||``,r:t.rounding||0}),{datapoint:t,seriesIndex:r})),1)):p(``,!0)],64))],4)):p(``,!0),(y(),m(`svg`,{role:`img`,xmlns:C(ne),viewBox:`0 0 ${Y.value.width} ${Y.value.height}`,width:`100%`},[g(C(P)),h(`defs`,null,[g(u,{t:`linear`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,id:`sparkbar_gradient_${r}_${L.value}`,stops:[[`0%`,C(i)(C(te)(t.color,.03),100-z.value.gradient.intensity),1],[`100%`,t.color,1]]},null,8,[`id`,`stops`])]),h(`rect`,{height:Y.value.height,width:Y.value.width,x:0,y:0,fill:C(i)(V.value.gutter.backgroundColor,V.value.gutter.opacity),rx:$.value},null,8,A),h(`rect`,{height:Y.value.height,width:Y.value.width*Z(t),x:0,y:0,fill:z.value.gradient.underlayerColor,rx:$.value},null,8,j),h(`rect`,{height:Y.value.height,width:Y.value.width*Z(t),x:0,y:0,fill:z.value.gradient.show?`url(#sparkbar_gradient_${r}_${L.value})`:t.color,rx:$.value},null,8,M)],8,k))],44,D))),256)),e.$slots.source?(y(),m(`div`,N,[x(e.$slots,`source`)],512)):p(``,!0),C(U)?(y(),fe(ue,{key:3})):p(``,!0)],4))}};export{E as n,P as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t}from"./resolveChartConfig-0IvbmIE_.js";import{$ as n,Ht as r,Jt as i,S as a,X as ee,Yt as te,at as o,i as s,in as c,t as ne,w as re,yt as ie,zt as ae}from"./lib-rPeBMZrn.js";import{n as oe,t as se}from"./useHints-C-TwxM0Y.js";import{t as ce}from"./useConfig-_JwRfIqE.js";import{n as le,t as ue}from"./BaseScanner-8NdoBs7B.js";import{t as de}from"./usePrefersMotion-XLHwega2.js";import{t as l}from"./vue_ui_sparkbar-CvcZ5nwT.js";import{t as u}from"./DefGrad-DKMq1REY.js";import{Fragment as d,computed as f,createBlock as fe,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createVNode as g,defineAsyncComponent as pe,guardReactiveProps as me,mergeProps as he,nextTick as ge,normalizeProps as _e,normalizeStyle as _,onMounted as v,openBlock as y,ref as b,renderList as ve,renderSlot as x,toDisplayString as S,toRefs as ye,unref as C,useSlots as w,watch as T}from"vue";var E=/* @__PURE__ */ e({default:()=>P}),D=[`onClick`,`onMouseenter`,`onMouseleave`],O={key:1,class:`vue-ui-sparkbar-datapoint-value`},k=[`xmlns`,`viewBox`],A=[`height`,`width`,`fill`,`rx`],j=[`height`,`width`,`fill`,`rx`],M=[`height`,`width`,`fill`,`rx`],N={key:2,ref:`source`,dir:`auto`},P={__name:`vue-ui-sparkbar`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},backgroundOpacity:{type:Number,default:null}},emits:[`selectDatapoint`],setup(e,{emit:E}){let P=pe(()=>import(`./PackageVersion-PdpqwkYX.js`).then(e=>e.t)),{vue_ui_sparkbar:be}=ce(),F=de(),I=e,xe=w(),L=b(ee()),R=b(G()),z=f(()=>R.value.style.bar),B=f(()=>R.value.style.labels),V=f(()=>R.value.style),H=f(()=>R.value.debug);v(()=>{xe[`chart-background`]&&H.value&&console.warn(`VueUiSparkbar does not support the #chart-background slot.`)}),oe({config:()=>R.value,dataset:()=>I.dataset,component:`VueUiSparkbar`,rules:[se.noHint]});let Se=f(()=>c({defaultConfig:{style:{backgroundColor:`#99999930`,animation:{show:!1},layout:{independant:!0},gutter:{backgroundColor:`#6A6A6A`,opacity:50},bar:{gradient:{underlayerColor:`#6A6A6A`}}}},userConfig:R.value.skeletonConfig??{}})),{loading:U,FINAL_DATASET:W,manualLoading:Ce}=le({...ye(I),FINAL_CONFIG:R,prepareConfig:G,skeletonDataset:I.config?.skeletonDataset??[{name:`_`,value:21,target:25,color:`#808080`},{name:`_`,value:13,target:25,color:`#ADADAD`},{name:`_`,value:8,target:25,color:`#DBDBDB`}],skeletonConfig:c({defaultConfig:R.value,userConfig:Se.value})});function G(){return t(I.config,be,l)}T(()=>I.config,e=>{R.value=G()},{deep:!0});let we=f(()=>re(R.value.customPalette)),K=b(W.value.map(e=>({...e,value:V.value.animation.show?0:e.value||0,formatter:e.formatter||null}))),q=b(null);v(async()=>{ae(I.dataset)&&o({componentName:`VueUiSparkbar`,type:`dataset`,debug:H.value}),J()});function J(){if(V.value.animation.show&&!F.value){let e=V.value.animation.animationFrames,t=W.value.map((t,n)=>t.value/e),n=W.value.map(e=>e.value||0).reduce((e,t)=>e+t,0),r=0;function i(){r+=n/e,r<n?(K.value=K.value.map((e,n)=>({...e,value:e.value+=t[n]})),q.value=requestAnimationFrame(i)):K.value=W.value.map(e=>({...e,value:e.value||0,formatter:e.formatter||null}))}i()}}T(()=>W.value,async e=>{cancelAnimationFrame(q.value),K.value=W.value.map(e=>({...e,value:V.value.animation.show&&!F.value?0:e.value||0,formatter:e.formatter||null})),ge(J)},{deep:!0});let Y=b({width:500,height:16}),Te=f(()=>Math.max(...W.value.map(e=>e.value))),Ee=f(()=>(H.value&&W.value.forEach((e,t)=>{ie({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{o({componentName:`VueUiSparkbar`,type:`datasetSerieAttribute`,property:e,index:t})})}),K.value.map((e,t)=>({...e,value:e.value||0,color:a(e.color)||we.value[t]||r[t]||r[t%r.length]}))));function X(e){return e/Te.value}function Z(e){return V.value.layout.independant?e.target?e.value/e.target:V.value.layout.percentage?e.value>100?1:e.value/100:V.value.layout.target===0?1:e.value/V.value.layout.target:X(e.value)}function Q(e){return V.value.layout.independant&&e.target||V.value.layout.target}let De=E;function Oe(e,t){De(`selectDatapoint`,{datapoint:e,index:t}),R.value.events.datapointClick&&R.value.events.datapointClick({datapoint:e,seriesIndex:t})}function ke(e,t){R.value.events.datapointEnter&&R.value.events.datapointEnter({datapoint:e,seriesIndex:t})}function Ae(e,t){R.value.events.datapointLeave&&R.value.events.datapointLeave({datapoint:e,seriesIndex:t})}let $=f(()=>z.value.borderRadius==null?Y.value.height/2:Math.min(Y.value.height/2,z.value.borderRadius));return(e,t)=>(y(),m(`div`,{class:`vue-data-ui-component vue-ui-sparkbar`,style:_({width:`100%`,position:`relative`,fontFamily:V.value.fontFamily,background:I.backgroundOpacity===null?V.value.backgroundColor:C(i)(V.value.backgroundColor,I.backgroundOpacity)})},[e.$slots.title?x(e.$slots,`title`,_e(me({title:{...e.title,title:V.value.title.text,subtitle:V.value.title.subtitle.text}})),void 0,void 0,0):p(``,!0),!e.$slots.title&&V.value.title.text?(y(),m(`div`,{key:1,class:`vue-ui-sparkbar-title-container`,style:_({background:V.value.title.backgroundColor,margin:V.value.title.margin,textAlign:V.value.title.textAlign})},[h(`div`,{class:`vue-ui-sparkbar-title`,style:_({fontSize:V.value.title.fontSize+`px`,color:V.value.title.color,fontWeight:V.value.title.bold?`bold`:`normal`})},S(V.value.title.text),5),V.value.title.subtitle.text?(y(),m(`div`,{key:0,class:`vue-ui-sparkbar-subtitle`,style:_({fontSize:V.value.title.subtitle.fontSize+`px`,color:V.value.title.subtitle.color,fontWeight:V.value.title.subtitle.bold?`bold`:`normal`})},S(V.value.title.subtitle.text),5)):p(``,!0)],4)):p(``,!0),(y(!0),m(d,null,ve(Ee.value,(t,r)=>(y(),m(`div`,{style:_(`display:flex !important;${[`left`,`right`].includes(B.value.name.position)?`flex-direction: ${B.value.name.position===`right`?`row-reverse`:`row`} !important`:`flex-direction:column !important`};gap:${V.value.gap}px !important;align-items:center;${C(W).length>0&&r!==C(W).length-1?`margin-bottom:6px`:``}`),onClick:e=>Oe(t,r),onMouseenter:e=>ke(t,r),onMouseleave:e=>Ae(t,r)},[C(U)?p(``,!0):x(e.$slots,`data-label`,he({ref_for:!0},{bar:{...t,target:Q(t),valueLabel:C(s)(t.formatter,t.value,C(n)({p:t.prefix||``,v:t.value,s:t.suffix||``,r:t.rounding||0}),{datapoint:t,seriesIndex:r}),targetLabel:C(s)(t.formatter,Q(t),C(n)({p:t.prefix||``,v:Q(t),s:t.suffix||``,r:t.rounding||0}),{datapoint:t,seriesIndex:r})}}),void 0,void 0,0),!e.$slots[`data-label`]||C(U)?(y(),m(`div`,{key:1,style:_({display:`flex`,justifyContent:[`right`,`top-right`].includes(B.value.name.position)?`flex-end`:[`top-center`].includes(B.value.name.position)?`center`:`flex-start`,alignItems:`center`,width:B.value.name.width,color:B.value.name.color,fontSize:B.value.fontSize+`px`,fontWeight:B.value.name.bold?`bold`:`normal`,flexWrap:`wrap`})},[C(U)?(y(),m(`div`,{key:0,class:`vue-ui-sparkbar-skeleton-name`,style:_({width:`60px`,height:B.value.fontSize+`px`,borderRadius:B.value.fontSize/4+`px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginTop:`5px`})},[h(`div`,{style:_({height:`100%`,width:`40px`,borderRadius:B.value.fontSize/4+`px`,backgroundColor:`#6A6A6A80`})},null,4),h(`div`,{style:_({height:`100%`,width:`15px`,borderRadius:B.value.fontSize/4+`px`,backgroundColor:`#6A6A6A80`})},null,4)],4)):(y(),m(d,{key:1},[h(`span`,null,S(t.name),1),B.value.value.show?(y(),m(`span`,{key:0,style:_(`font-weight:${B.value.value.bold?`bold`:`normal`}`),class:`vue-ui-sparkbar-datapoint-name`},`: `+S(C(s)(t.formatter,t.value,C(n)({p:t.prefix||``,v:t.value,s:t.suffix||``,r:t.rounding||0}),{datapoint:t,seriesIndex:r})),5)):p(``,!0),V.value.layout.showTargetValue?(y(),m(`span`,O,S(` `+V.value.layout.targetValueText)+` `+S(C(s)(t.formatter,Q(t),C(n)({p:t.prefix||``,v:Q(t),s:t.suffix||``,r:t.rounding||0}),{datapoint:t,seriesIndex:r})),1)):p(``,!0)],64))],4)):p(``,!0),(y(),m(`svg`,{role:`img`,xmlns:C(ne),viewBox:`0 0 ${Y.value.width} ${Y.value.height}`,width:`100%`},[g(C(P)),h(`defs`,null,[g(u,{t:`linear`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,id:`sparkbar_gradient_${r}_${L.value}`,stops:[[`0%`,C(i)(C(te)(t.color,.03),100-z.value.gradient.intensity),1],[`100%`,t.color,1]]},null,8,[`id`,`stops`])]),h(`rect`,{height:Y.value.height,width:Y.value.width,x:0,y:0,fill:C(i)(V.value.gutter.backgroundColor,V.value.gutter.opacity),rx:$.value},null,8,A),h(`rect`,{height:Y.value.height,width:Y.value.width*Z(t),x:0,y:0,fill:z.value.gradient.underlayerColor,rx:$.value},null,8,j),h(`rect`,{height:Y.value.height,width:Y.value.width*Z(t),x:0,y:0,fill:z.value.gradient.show?`url(#sparkbar_gradient_${r}_${L.value})`:t.color,rx:$.value},null,8,M)],8,k))],44,D))),256)),e.$slots.source?(y(),m(`div`,N,[x(e.$slots,`source`)],512)):p(``,!0),C(U)?(y(),fe(ue,{key:3})):p(``,!0)],4))}};export{E as n,P as t};
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./resolveChartConfig-0IvbmIE_.js";import{$ as n,Tt as r,X as i,at as a,b as o,i as s,in as c,t as l,yt as u,zt as ee}from"./lib-rPeBMZrn.js";import{n as te,t as ne}from"./useHints-C-TwxM0Y.js";import{t as re}from"./useConfig-_JwRfIqE.js";import{n as ie,t as ae}from"./BaseScanner-8NdoBs7B.js";import{t as oe}from"./useChartAccessibility-DOMuYJfm.js";import{t as se}from"./usePrefersMotion-XLHwega2.js";import{t as ce}from"./vue_ui_sparkgauge-D3xirz2w.js";import{t as le}from"./DefGrad-DKMq1REY.js";import{computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createVNode as g,defineAsyncComponent as ue,normalizeClass as de,normalizeStyle as _,onBeforeUnmount as fe,onMounted as v,openBlock as y,ref as b,renderSlot as x,toDisplayString as S,toRefs as pe,unref as C,watch as w}from"vue";var T=/* @__PURE__ */ e({default:()=>j}),E=[`xmlns`,`viewBox`],me=[`width`,`height`],he=[`d`,`stroke`,`stroke-linecap`],D=[`d`,`stroke`,`stroke-linecap`,`stroke-dashoffset`],O=[`x`,`y`,`width`,`height`],k=[`x`,`y`,`font-size`,`fill`,`font-weight`],A={key:2,ref:`source`,dir:`auto`},j={__name:`vue-ui-sparkgauge`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(e){let T=ue(()=>import(`./PackageVersion-ksOit8fp.js`).then(e=>e.t)),{vue_ui_sparkgauge:j}=re(),M=se(),N=b(null),P=e,F=b(i()),I=b(W()),L=d(()=>I.value.style.dataLabel),R=d(()=>I.value.style);te({config:()=>I.value,dataset:()=>P.dataset,component:`VueUiSparkgauge`,rules:[ne.noHint]});let z=d(()=>R.value.animation.show&&!M.value),ge=d(()=>c({defaultConfig:{style:{animation:{show:!1},background:`#99999930`,colors:{min:`#CACACA`,max:`#6A6A6A`},track:{autoColor:!0},gutter:{color:`#6A6A6A80`}}},userConfig:I.value.skeletonConfig??{}})),{loading:B,FINAL_DATASET:V}=ie({...pe(P),FINAL_CONFIG:I,prepareConfig:W,skeletonDataset:P.config?.skeletonDataset??{value:0,min:-1,max:1,title:``},skeletonConfig:c({defaultConfig:I.value,userConfig:ge.value})}),H=d(()=>{let e=V.value.min??0,t=V.value.max??0;return{min:e,max:t,diff:t-e}}),U=d(()=>H.value.diff/R.value.animation.speedMs),{svgRef:_e}=oe({config:{text:P.dataset?.title||``}});function W(){return t(P.config,j,ce)}v(()=>{K()});let G=d(()=>I.value.debug);function K(){ee(P.dataset)?a({componentName:`VueUiSparkgauge`,type:`dataset`,debug:G.value}):u({datasetObject:P.dataset,requiredAttributes:[`value`,`min`,`max`]}).forEach(e=>{a({componentName:`VueUiSparkgauge`,type:`datasetAttribute`,property:e,debug:G.value})})}w(()=>P.config,()=>{I.value=W(),J.value=z.value?H.value.min:V.value.value,K()},{deep:!0});let q=d(()=>({height:R.value.height,width:128,base:R.value.basePosition})),J=b(z.value?H.value.min:V.value.value);w([()=>V.value.value,z],([e,t])=>{Y(e||0,t)},{immediate:!0});let ve=d(()=>J.value>H.value.max?H.value.max:J.value<H.value.min?H.value.min:J.value);v(()=>{Y(V.value.value||0)});function Y(e,t=z.value){if(N.value&&=(cancelAnimationFrame(N.value),null),!t){J.value=e;return}function n(){J.value<e?J.value=Math.min(J.value+U.value,e):J.value>e&&(J.value=Math.max(J.value-U.value,e)),J.value===e?N.value=null:N.value=requestAnimationFrame(n)}n()}let X=d(()=>V.value.title??``),Z=d(()=>{let e=H.value.diff;if(!isFinite(e)||e===0)return 0;let t=H.value.min,n=ve.value;return n>=0?(n-t)/e:(Math.abs(t)-Math.abs(n))/e}),Q=d(()=>r(R.value.colors.min,R.value.colors.max,H.value.min,H.value.max,J.value)),$=d(()=>L.value.autoColor?Q.value:L.value.color),ye=d(()=>R.value.track.autoColor?Q.value:R.value.track.color);return fe(()=>{N.value&&cancelAnimationFrame(N.value)}),(e,t)=>(y(),m(`div`,{class:`vue-data-ui-component vue-ui-sparkgauge`,style:_(`font-family:${R.value.fontFamily};width: 100%; background:${R.value.background}`)},[R.value.title.show&&X.value&&R.value.title.position===`top`?(y(),m(`div`,{key:0,class:`vue-data-ui-sparkgauge-label`,style:_(`font-size:${R.value.title.fontSize}px;text-align:${R.value.title.textAlign};font-weight:${R.value.title.bold?`bold`:`normal`};color:${R.value.title.color}`)},S(X.value),5)):p(``,!0),(y(),m(`svg`,{ref_key:`svgRef`,ref:_e,xmlns:C(l),viewBox:`0 0 ${q.value.width} ${q.value.height}`,style:`overflow: visible; background:transparent; width:100%;`},[g(C(T)),e.$slots[`chart-background`]&&!C(B)?(y(),m(`foreignObject`,{key:0,x:0,y:0,width:q.value.width,height:q.value.height,style:{pointerEvents:`none`}},[x(e.$slots,`chart-background`)],8,me)):p(``,!0),h(`defs`,null,[g(le,{t:`linear`,id:`gradient_${F.value}`,x1:`-10%`,y1:`100%`,x2:`110%`,y2:`100%`,stops:[[`0%`,R.value.colors.min,1],[`100%`,R.value.colors.max,1]]},null,8,[`id`,`stops`])]),h(`path`,{d:`M10 ${q.value.base} A 1 1 0 1 1 118 ${q.value.base}`,stroke:R.value.gutter.color,"stroke-width":8,"stroke-linecap":R.value.gutter.strokeLinecap,fill:`none`},null,8,he),Z.value===0?p(``,!0):(y(),m(`path`,{key:1,d:`M10 ${q.value.base} A 1 1 0 1 1 118 ${q.value.base}`,stroke:R.value.colors.showGradient?`url(#gradient_${F.value})`:ye.value,"stroke-width":8,"stroke-linecap":R.value.track.strokeLinecap,fill:`none`,"stroke-dasharray":169.5,"stroke-dashoffset":169.5-169.5*Z.value,class:de({"vue-ui-sparkgauge-track":R.value.animation.show}),style:_(R.value.animation.show?`animation: vue-ui-sparkgauge-animation ${R.value.animation.speedMs}ms ease-in;`:``)},null,14,D)),C(B)?(y(),m(`rect`,{key:2,x:q.value.width/2-L.value.fontSize/2,y:q.value.base+6+L.value.offsetY-L.value.fontSize,width:L.value.fontSize,height:L.value.fontSize,fill:`#6A6A6A50`,rx:3},null,8,O)):(y(),m(`text`,{key:3,"text-anchor":`middle`,x:q.value.width/2,y:q.value.base+6+L.value.offsetY,"font-size":L.value.fontSize,fill:$.value,"font-weight":L.value.bold?`bold`:`normal`},S(C(s)(L.value.formatter,C(o)(J.value),C(n)({p:L.value.prefix,v:C(o)(J.value),s:L.value.suffix,r:L.value.rounding}),{datapoint:C(o)(J.value),color:$.value})),9,k))],8,E)),R.value.title.show&&X.value&&R.value.title.position===`bottom`?(y(),m(`div`,{key:1,class:`vue-data-ui-sparkgauge-label`,style:_(`font-size:${R.value.title.fontSize}px;text-align:${R.value.title.textAlign};font-weight:${R.value.title.bold?`bold`:`normal`};font-weight:${R.value.title.bold?`bold`:`normal`};color:${R.value.title.color}`)},S(X.value),5)):p(``,!0),e.$slots.source?(y(),m(`div`,A,[x(e.$slots,`source`)],512)):p(``,!0),x(e.$slots,`skeleton`,{},()=>[C(B)?(y(),f(ae,{key:0})):p(``,!0)])],4))}};export{T as n,j as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./resolveChartConfig-0IvbmIE_.js";import{$ as n,Tt as r,X as i,at as a,b as o,i as s,in as c,t as l,yt as u,zt as ee}from"./lib-rPeBMZrn.js";import{n as te,t as ne}from"./useHints-C-TwxM0Y.js";import{t as re}from"./useConfig-_JwRfIqE.js";import{n as ie,t as ae}from"./BaseScanner-8NdoBs7B.js";import{t as oe}from"./useChartAccessibility-DOMuYJfm.js";import{t as se}from"./usePrefersMotion-XLHwega2.js";import{t as ce}from"./vue_ui_sparkgauge-D3xirz2w.js";import{t as le}from"./DefGrad-DKMq1REY.js";import{computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createVNode as g,defineAsyncComponent as ue,normalizeClass as de,normalizeStyle as _,onBeforeUnmount as fe,onMounted as v,openBlock as y,ref as b,renderSlot as x,toDisplayString as S,toRefs as pe,unref as C,watch as w}from"vue";var T=/* @__PURE__ */ e({default:()=>j}),E=[`xmlns`,`viewBox`],me=[`width`,`height`],he=[`d`,`stroke`,`stroke-linecap`],D=[`d`,`stroke`,`stroke-linecap`,`stroke-dashoffset`],O=[`x`,`y`,`width`,`height`],k=[`x`,`y`,`font-size`,`fill`,`font-weight`],A={key:2,ref:`source`,dir:`auto`},j={__name:`vue-ui-sparkgauge`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(e){let T=ue(()=>import(`./PackageVersion-PdpqwkYX.js`).then(e=>e.t)),{vue_ui_sparkgauge:j}=re(),M=se(),N=b(null),P=e,F=b(i()),I=b(W()),L=d(()=>I.value.style.dataLabel),R=d(()=>I.value.style);te({config:()=>I.value,dataset:()=>P.dataset,component:`VueUiSparkgauge`,rules:[ne.noHint]});let z=d(()=>R.value.animation.show&&!M.value),ge=d(()=>c({defaultConfig:{style:{animation:{show:!1},background:`#99999930`,colors:{min:`#CACACA`,max:`#6A6A6A`},track:{autoColor:!0},gutter:{color:`#6A6A6A80`}}},userConfig:I.value.skeletonConfig??{}})),{loading:B,FINAL_DATASET:V}=ie({...pe(P),FINAL_CONFIG:I,prepareConfig:W,skeletonDataset:P.config?.skeletonDataset??{value:0,min:-1,max:1,title:``},skeletonConfig:c({defaultConfig:I.value,userConfig:ge.value})}),H=d(()=>{let e=V.value.min??0,t=V.value.max??0;return{min:e,max:t,diff:t-e}}),U=d(()=>H.value.diff/R.value.animation.speedMs),{svgRef:_e}=oe({config:{text:P.dataset?.title||``}});function W(){return t(P.config,j,ce)}v(()=>{K()});let G=d(()=>I.value.debug);function K(){ee(P.dataset)?a({componentName:`VueUiSparkgauge`,type:`dataset`,debug:G.value}):u({datasetObject:P.dataset,requiredAttributes:[`value`,`min`,`max`]}).forEach(e=>{a({componentName:`VueUiSparkgauge`,type:`datasetAttribute`,property:e,debug:G.value})})}w(()=>P.config,()=>{I.value=W(),J.value=z.value?H.value.min:V.value.value,K()},{deep:!0});let q=d(()=>({height:R.value.height,width:128,base:R.value.basePosition})),J=b(z.value?H.value.min:V.value.value);w([()=>V.value.value,z],([e,t])=>{Y(e||0,t)},{immediate:!0});let ve=d(()=>J.value>H.value.max?H.value.max:J.value<H.value.min?H.value.min:J.value);v(()=>{Y(V.value.value||0)});function Y(e,t=z.value){if(N.value&&=(cancelAnimationFrame(N.value),null),!t){J.value=e;return}function n(){J.value<e?J.value=Math.min(J.value+U.value,e):J.value>e&&(J.value=Math.max(J.value-U.value,e)),J.value===e?N.value=null:N.value=requestAnimationFrame(n)}n()}let X=d(()=>V.value.title??``),Z=d(()=>{let e=H.value.diff;if(!isFinite(e)||e===0)return 0;let t=H.value.min,n=ve.value;return n>=0?(n-t)/e:(Math.abs(t)-Math.abs(n))/e}),Q=d(()=>r(R.value.colors.min,R.value.colors.max,H.value.min,H.value.max,J.value)),$=d(()=>L.value.autoColor?Q.value:L.value.color),ye=d(()=>R.value.track.autoColor?Q.value:R.value.track.color);return fe(()=>{N.value&&cancelAnimationFrame(N.value)}),(e,t)=>(y(),m(`div`,{class:`vue-data-ui-component vue-ui-sparkgauge`,style:_(`font-family:${R.value.fontFamily};width: 100%; background:${R.value.background}`)},[R.value.title.show&&X.value&&R.value.title.position===`top`?(y(),m(`div`,{key:0,class:`vue-data-ui-sparkgauge-label`,style:_(`font-size:${R.value.title.fontSize}px;text-align:${R.value.title.textAlign};font-weight:${R.value.title.bold?`bold`:`normal`};color:${R.value.title.color}`)},S(X.value),5)):p(``,!0),(y(),m(`svg`,{ref_key:`svgRef`,ref:_e,xmlns:C(l),viewBox:`0 0 ${q.value.width} ${q.value.height}`,style:`overflow: visible; background:transparent; width:100%;`},[g(C(T)),e.$slots[`chart-background`]&&!C(B)?(y(),m(`foreignObject`,{key:0,x:0,y:0,width:q.value.width,height:q.value.height,style:{pointerEvents:`none`}},[x(e.$slots,`chart-background`)],8,me)):p(``,!0),h(`defs`,null,[g(le,{t:`linear`,id:`gradient_${F.value}`,x1:`-10%`,y1:`100%`,x2:`110%`,y2:`100%`,stops:[[`0%`,R.value.colors.min,1],[`100%`,R.value.colors.max,1]]},null,8,[`id`,`stops`])]),h(`path`,{d:`M10 ${q.value.base} A 1 1 0 1 1 118 ${q.value.base}`,stroke:R.value.gutter.color,"stroke-width":8,"stroke-linecap":R.value.gutter.strokeLinecap,fill:`none`},null,8,he),Z.value===0?p(``,!0):(y(),m(`path`,{key:1,d:`M10 ${q.value.base} A 1 1 0 1 1 118 ${q.value.base}`,stroke:R.value.colors.showGradient?`url(#gradient_${F.value})`:ye.value,"stroke-width":8,"stroke-linecap":R.value.track.strokeLinecap,fill:`none`,"stroke-dasharray":169.5,"stroke-dashoffset":169.5-169.5*Z.value,class:de({"vue-ui-sparkgauge-track":R.value.animation.show}),style:_(R.value.animation.show?`animation: vue-ui-sparkgauge-animation ${R.value.animation.speedMs}ms ease-in;`:``)},null,14,D)),C(B)?(y(),m(`rect`,{key:2,x:q.value.width/2-L.value.fontSize/2,y:q.value.base+6+L.value.offsetY-L.value.fontSize,width:L.value.fontSize,height:L.value.fontSize,fill:`#6A6A6A50`,rx:3},null,8,O)):(y(),m(`text`,{key:3,"text-anchor":`middle`,x:q.value.width/2,y:q.value.base+6+L.value.offsetY,"font-size":L.value.fontSize,fill:$.value,"font-weight":L.value.bold?`bold`:`normal`},S(C(s)(L.value.formatter,C(o)(J.value),C(n)({p:L.value.prefix,v:C(o)(J.value),s:L.value.suffix,r:L.value.rounding}),{datapoint:C(o)(J.value),color:$.value})),9,k))],8,E)),R.value.title.show&&X.value&&R.value.title.position===`bottom`?(y(),m(`div`,{key:1,class:`vue-data-ui-sparkgauge-label`,style:_(`font-size:${R.value.title.fontSize}px;text-align:${R.value.title.textAlign};font-weight:${R.value.title.bold?`bold`:`normal`};font-weight:${R.value.title.bold?`bold`:`normal`};color:${R.value.title.color}`)},S(X.value),5)):p(``,!0),e.$slots.source?(y(),m(`div`,A,[x(e.$slots,`source`)],512)):p(``,!0),x(e.$slots,`skeleton`,{},()=>[C(B)?(y(),f(ae,{key:0})):p(``,!0)])],4))}};export{T as n,j as t};