vue-data-ui 3.28.2 → 3.28.4

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 (166) hide show
  1. package/README.md +25 -1
  2. package/dist/{PackageVersion-BIhjLNBU.js → PackageVersion-DhptF5oD.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-annotator.js +1 -1
  6. package/dist/components/vue-ui-bullet.js +1 -1
  7. package/dist/components/vue-ui-bump.js +1 -1
  8. package/dist/components/vue-ui-candlestick.js +1 -1
  9. package/dist/components/vue-ui-carousel-table.js +1 -1
  10. package/dist/components/vue-ui-chestnut.js +1 -1
  11. package/dist/components/vue-ui-chord.js +1 -1
  12. package/dist/components/vue-ui-circle-pack.js +1 -1
  13. package/dist/components/vue-ui-cursor.js +1 -1
  14. package/dist/components/vue-ui-dag.js +1 -1
  15. package/dist/components/vue-ui-dashboard.js +1 -1
  16. package/dist/components/vue-ui-digits.js +1 -1
  17. package/dist/components/vue-ui-donut-evolution.js +1 -1
  18. package/dist/components/vue-ui-donut.js +1 -1
  19. package/dist/components/vue-ui-dumbbell.js +1 -1
  20. package/dist/components/vue-ui-flow.js +1 -1
  21. package/dist/components/vue-ui-funnel.js +1 -1
  22. package/dist/components/vue-ui-galaxy.js +1 -1
  23. package/dist/components/vue-ui-gauge.js +1 -1
  24. package/dist/components/vue-ui-geo.js +1 -1
  25. package/dist/components/vue-ui-gizmo.js +1 -1
  26. package/dist/components/vue-ui-graph.js +1 -1
  27. package/dist/components/vue-ui-heatmap.js +1 -1
  28. package/dist/components/vue-ui-hill.js +1 -1
  29. package/dist/components/vue-ui-history-plot.js +1 -1
  30. package/dist/components/vue-ui-horizontal-bar.js +1 -1
  31. package/dist/components/vue-ui-kpi.js +1 -1
  32. package/dist/components/vue-ui-mini-loader.js +1 -1
  33. package/dist/components/vue-ui-molecule.js +1 -1
  34. package/dist/components/vue-ui-mood-radar.js +1 -1
  35. package/dist/components/vue-ui-nested-donuts.js +1 -1
  36. package/dist/components/vue-ui-onion.js +1 -1
  37. package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
  38. package/dist/components/vue-ui-quadrant.js +1 -1
  39. package/dist/components/vue-ui-quick-chart.js +1 -1
  40. package/dist/components/vue-ui-radar.js +1 -1
  41. package/dist/components/vue-ui-rating.js +1 -1
  42. package/dist/components/vue-ui-relation-circle.js +1 -1
  43. package/dist/components/vue-ui-ridgeline.js +1 -1
  44. package/dist/components/vue-ui-rings.js +1 -1
  45. package/dist/components/vue-ui-scatter.js +1 -1
  46. package/dist/components/vue-ui-skeleton.js +1 -1
  47. package/dist/components/vue-ui-smiley.js +1 -1
  48. package/dist/components/vue-ui-spark-trend.js +1 -1
  49. package/dist/components/vue-ui-sparkbar.js +1 -1
  50. package/dist/components/vue-ui-sparkgauge.js +1 -1
  51. package/dist/components/vue-ui-sparkhistogram.js +1 -1
  52. package/dist/components/vue-ui-sparkline.js +1 -1
  53. package/dist/components/vue-ui-sparkstackbar.js +1 -1
  54. package/dist/components/vue-ui-stackbar.js +1 -1
  55. package/dist/components/vue-ui-stackline.js +1 -1
  56. package/dist/components/vue-ui-strip-plot.js +1 -1
  57. package/dist/components/vue-ui-table-heatmap.js +1 -1
  58. package/dist/components/vue-ui-table-sparkline.js +1 -1
  59. package/dist/components/vue-ui-table.js +1 -1
  60. package/dist/components/vue-ui-thermometer.js +1 -1
  61. package/dist/components/vue-ui-timer.js +1 -1
  62. package/dist/components/vue-ui-tiremarks.js +1 -1
  63. package/dist/components/vue-ui-treemap.js +1 -1
  64. package/dist/components/vue-ui-vertical-bar.js +1 -1
  65. package/dist/components/vue-ui-waffle.js +1 -1
  66. package/dist/components/vue-ui-wheel.js +1 -1
  67. package/dist/components/vue-ui-word-cloud.js +1 -1
  68. package/dist/components/vue-ui-world.js +1 -1
  69. package/dist/components/vue-ui-xy-canvas.js +1 -1
  70. package/dist/components/vue-ui-xy.js +1 -1
  71. package/dist/geoProjections-CX3Pvo1N.js +1 -0
  72. package/dist/llms.txt +9 -34
  73. package/dist/package-CX7pZToh.js +1 -0
  74. package/dist/pdf-CVdqBWVS.js +1 -0
  75. package/dist/{render-common-B-s2XJ_I.js → render-common-DwEiRIJ0.js} +1 -1
  76. package/dist/ssr/vue-ui-donut.js +1 -1
  77. package/dist/ssr/vue-ui-xy.js +1 -1
  78. package/dist/ssr.js +1 -1
  79. package/dist/style.css +1 -1
  80. package/dist/{useHints-BH9r_0Vd.js → useHints-C-TwxM0Y.js} +1 -1
  81. package/dist/{useObjectBindings-DiMX4HGv.js → useObjectBindings-C15PEyQD.js} +1 -1
  82. package/dist/{usePrinter-sVoTzet1.js → usePrinter-DVf3YcG5.js} +1 -1
  83. package/dist/useSvgLabelLayout-42Kats14.js +1 -0
  84. package/dist/utils.js +1 -1
  85. package/dist/vue-data-ui-CORn0LF6.js +1 -0
  86. package/dist/vue-data-ui.js +1 -1
  87. package/dist/{vue-ui-3d-bar-CkHFiFp4.js → vue-ui-3d-bar-CJTKyv3A.js} +2 -2
  88. package/dist/{vue-ui-age-pyramid-vpIjdLg5.js → vue-ui-age-pyramid-6uZzf1w6.js} +1 -1
  89. package/dist/{vue-ui-annotator-CdCDYzdK.js → vue-ui-annotator-DCJdieNC.js} +3 -3
  90. package/dist/{vue-ui-bullet-rgxGRR1p.js → vue-ui-bullet-CsJcLhmV.js} +2 -2
  91. package/dist/{vue-ui-bump-CeDsunDi.js → vue-ui-bump-DXpxBWp_.js} +2 -2
  92. package/dist/{vue-ui-candlestick-KJHOS5F7.js → vue-ui-candlestick-Bn_RSZ0k.js} +2 -2
  93. package/dist/{vue-ui-carousel-table-CeI5SIxH.js → vue-ui-carousel-table-ChNykS-r.js} +1 -1
  94. package/dist/vue-ui-chestnut-DMYQTkxM.js +1 -0
  95. package/dist/{vue-ui-chord-8rk7304-.js → vue-ui-chord-Pp0U0-zV.js} +2 -2
  96. package/dist/{vue-ui-circle-pack-BsH09EPG.js → vue-ui-circle-pack-We23fOaF.js} +2 -2
  97. package/dist/{vue-ui-cursor-Cpov2m58.js → vue-ui-cursor-3-RTIIl-.js} +1 -1
  98. package/dist/{vue-ui-dag-BHFL2cUA.js → vue-ui-dag-5fVnwEXd.js} +2 -2
  99. package/dist/{vue-ui-dashboard-BxXdhdNJ.js → vue-ui-dashboard-Dlwnintv.js} +1 -1
  100. package/dist/{vue-ui-digits-xHOLjA2_.js → vue-ui-digits-ZMK0aBxE.js} +1 -1
  101. package/dist/{vue-ui-donut-Vbp5Xs2-.js → vue-ui-donut-CmLo1r4-.js} +2 -2
  102. package/dist/{vue-ui-donut-evolution-BTmztL3Y.js → vue-ui-donut-evolution-CYvo7Cww.js} +2 -2
  103. package/dist/vue-ui-donut-j1bv0KyD.js +22 -0
  104. package/dist/{vue-ui-dumbbell-CDcgKS2A.js → vue-ui-dumbbell-DigrSGwq.js} +2 -2
  105. package/dist/{vue-ui-flow-kVocPE27.js → vue-ui-flow-D9cc9yXD.js} +2 -2
  106. package/dist/vue-ui-funnel-U88Hs0nL.js +1 -0
  107. package/dist/{vue-ui-galaxy-hP-9mVlB.js → vue-ui-galaxy-B1Vuz8CA.js} +1 -1
  108. package/dist/{vue-ui-gauge-BRabsLkh.js → vue-ui-gauge-1MgZSPXt.js} +1 -1
  109. package/dist/{vue-ui-geo-Dacnp6iw.js → vue-ui-geo-BV8ARcaX.js} +1 -1
  110. package/dist/{vue-ui-gizmo-Dp3hpHIX.js → vue-ui-gizmo-DtsERB-E.js} +1 -1
  111. package/dist/{vue-ui-graph-DHU9hUry.js → vue-ui-graph-BVTPTDl5.js} +2 -2
  112. package/dist/{vue-ui-heatmap-kPnmZgWi.js → vue-ui-heatmap-6YwaVr3F.js} +1 -1
  113. package/dist/{vue-ui-hill-Ddbup7-b.js → vue-ui-hill-BvrNT8KZ.js} +1 -1
  114. package/dist/{vue-ui-history-plot-CwO2o-2s.js → vue-ui-history-plot-CJIILQPt.js} +2 -2
  115. package/dist/{vue-ui-horizontal-bar-CvX77vE4.js → vue-ui-horizontal-bar-Dfo-kTqg.js} +2 -2
  116. package/dist/{vue-ui-kpi-CCOOwX_Q.js → vue-ui-kpi-DHfExr9d.js} +1 -1
  117. package/dist/{vue-ui-mini-loader-7gqQI5jy.js → vue-ui-mini-loader-Bbupx66Y.js} +1 -1
  118. package/dist/vue-ui-molecule-C8e5IeHG.js +1 -0
  119. package/dist/{vue-ui-mood-radar-GJ-lhgI0.js → vue-ui-mood-radar-DsnT2U65.js} +1 -1
  120. package/dist/{vue-ui-nested-donuts-CrlPwpg8.js → vue-ui-nested-donuts-JkpqMhuL.js} +2 -2
  121. package/dist/{vue-ui-onion-CKmyy-Y_.js → vue-ui-onion-CIA2tlff.js} +2 -2
  122. package/dist/{vue-ui-parallel-coordinate-plot-C0UqWt0M.js → vue-ui-parallel-coordinate-plot-Bcr3B3NI.js} +2 -2
  123. package/dist/{vue-ui-quadrant-CTGFBNo9.js → vue-ui-quadrant-DKVFawhC.js} +2 -2
  124. package/dist/{vue-ui-quick-chart-ZBOPZhxA.js → vue-ui-quick-chart-Bk2N8Hmd.js} +2 -2
  125. package/dist/{vue-ui-radar-B1z3Ux3E.js → vue-ui-radar-CdH-BFKA.js} +1 -1
  126. package/dist/{vue-ui-rating-CV2b0tjA.js → vue-ui-rating-ChWXrWNJ.js} +1 -1
  127. package/dist/{vue-ui-relation-circle-DqN5N08e.js → vue-ui-relation-circle-COZpOybS.js} +1 -1
  128. package/dist/{vue-ui-ridgeline-DcSB5Qef.js → vue-ui-ridgeline-MLknaTUO.js} +2 -2
  129. package/dist/{vue-ui-rings-CJqAnf-l.js → vue-ui-rings-ARqLCM_P.js} +1 -1
  130. package/dist/{vue-ui-scatter-THQAeoWs.js → vue-ui-scatter-CX2wsXdE.js} +2 -2
  131. package/dist/{vue-ui-skeleton-DqmhigQ0.js → vue-ui-skeleton-wyvAru88.js} +1 -1
  132. package/dist/{vue-ui-smiley-VTdQetY0.js → vue-ui-smiley--VTlUAdp.js} +1 -1
  133. package/dist/{vue-ui-spark-trend-B2Nf1raK.js → vue-ui-spark-trend-C02PmIq_.js} +1 -1
  134. package/dist/{vue-ui-sparkbar-CamZ_49V.js → vue-ui-sparkbar-CjD57-Xi.js} +1 -1
  135. package/dist/{vue-ui-sparkgauge-Ffrp_7VV.js → vue-ui-sparkgauge-8Eia8T2W.js} +1 -1
  136. package/dist/{vue-ui-sparkhistogram-CLfzi3PO.js → vue-ui-sparkhistogram-C-0f7XCl.js} +1 -1
  137. package/dist/{vue-ui-sparkline-Y-sljnbS.js → vue-ui-sparkline-BMMrpUPR.js} +1 -1
  138. package/dist/{vue-ui-sparkstackbar-CYZ-ADO1.js → vue-ui-sparkstackbar-BmgCVCKG.js} +1 -1
  139. package/dist/{vue-ui-stackbar-CQLYm10x.js → vue-ui-stackbar-G_zZRAa9.js} +2 -2
  140. package/dist/{vue-ui-stackline-VpvF7MRx.js → vue-ui-stackline-DchZoEAg.js} +2 -2
  141. package/dist/{vue-ui-strip-plot-B9Ogpw7K.js → vue-ui-strip-plot-DVyPa3sp.js} +2 -2
  142. package/dist/{vue-ui-table-heatmap-BtziURiu.js → vue-ui-table-heatmap-DzvPQnY9.js} +1 -1
  143. package/dist/{vue-ui-table-Bi9C3LzP.js → vue-ui-table-qTF_q-Qu.js} +1 -1
  144. package/dist/{vue-ui-table-sparkline-DEVAL0cR.js → vue-ui-table-sparkline-B2Q-7-GQ.js} +1 -1
  145. package/dist/{vue-ui-thermometer-ClN4EO0I.js → vue-ui-thermometer-CxNoxslq.js} +1 -1
  146. package/dist/{vue-ui-timer-nqZxt1vU.js → vue-ui-timer-DRjoRidI.js} +2 -2
  147. package/dist/{vue-ui-tiremarks-BeJBsgXo.js → vue-ui-tiremarks-BC_YGp3T.js} +1 -1
  148. package/dist/{vue-ui-treemap-FA-yXwmv.js → vue-ui-treemap-CNM5ohoO.js} +1 -1
  149. package/dist/{vue-ui-waffle-CO07S6HV.js → vue-ui-waffle-BiJshI4O.js} +1 -1
  150. package/dist/{vue-ui-wheel-BeaSWB4x.js → vue-ui-wheel-BxR0_iNZ.js} +1 -1
  151. package/dist/{vue-ui-word-cloud-C1OWGFng.js → vue-ui-word-cloud-CZzC3R1K.js} +2 -2
  152. package/dist/{vue-ui-world-CUS_mKgl.js → vue-ui-world-CJgt0ESz.js} +2 -2
  153. package/dist/vue-ui-xy-B6XNUCzQ.js +24 -0
  154. package/dist/{vue-ui-xy-BigPHE0Q.js → vue-ui-xy-DrKVPSg7.js} +1 -1
  155. package/dist/{vue-ui-xy-canvas-CeC3gcrW.js → vue-ui-xy-canvas-Do4P4ajB.js} +2 -2
  156. package/package.json +141 -131
  157. package/dist/geoProjections-Bvj-eMvq.js +0 -1
  158. package/dist/package-DwcKiXuI.js +0 -1
  159. package/dist/pdf-DAicVFxx.js +0 -1
  160. package/dist/useSvgLabelLayout-D1I8sQUi.js +0 -1
  161. package/dist/vue-data-ui-BvHCscNE.js +0 -1
  162. package/dist/vue-ui-chestnut-CiY-2e77.js +0 -1
  163. package/dist/vue-ui-donut-CR3klUbX.js +0 -22
  164. package/dist/vue-ui-funnel-CZAdPYqK.js +0 -1
  165. package/dist/vue-ui-molecule-BPGs9Dom.js +0 -1
  166. package/dist/vue-ui-xy-6B_K-quN.js +0 -24
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,D as r,Dt as i,Jt as a,Qt as o,X as s,Yt as c,_ as l,_t as ee,at as te,b as u,c as ne,gt as re,in as ie,nt as ae,pt as oe,rn as se,t as ce,wt as le,zt as ue}from"./lib-rPeBMZrn.js";import{n as de,t as fe}from"./BaseScanner-8NdoBs7B.js";import{n as pe,t as me}from"./useHints-BH9r_0Vd.js";import{t as he}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as ge}from"./useNestedProp-DnGoh-XS.js";import{t as _e}from"./useThemeCheck-BKNRbGeC.js";import{t as ve}from"./img-D4RQwASc.js";import{n as ye}from"./Title-BliHuXfT.js";import{t as be}from"./useChartExport-BZts4KFb.js";import{n as xe,t as Se}from"./tableIntegration-CNoJ1CIY.js";import{n as Ce,t as we}from"./annotationSlots-BRR85CqJ.js";import{n as Te,t as Ee}from"./userOptionsSlots-DYuo-E5m.js";import{n as De,r as Oe,t as ke}from"./useTimeLabels-Das5O74F.js";import{t as Ae}from"./usePrinter-sVoTzet1.js";import{t as je}from"./useTransitions-ChGGrtrv.js";import{t as Me}from"./useSvgLabelLayout-D1I8sQUi.js";import{t as Ne}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Pe}from"./useResponsive-CENUxfEL.js";import{t as Fe}from"./DefGrad-DKMq1REY.js";import{t as Ie}from"./SlicerPreview-CFFUOlQr.js";import{t as Le}from"./A11yDataTable-DWNlWXzs.js";import{t as Re}from"./useUserOptionState-CXlFnwPv.js";import{t as ze}from"./useChartAccessibility-DOMuYJfm.js";import{t as Be}from"./vue_ui_candlestick-DKvha_Ab.js";import{Fragment as d,computed as f,createBlock as Ve,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as He,createTextVNode as Ue,createVNode as We,defineAsyncComponent as Ge,guardReactiveProps as Ke,mergeProps as qe,nextTick as Je,normalizeClass as g,normalizeProps as Ye,normalizeStyle as Xe,onBeforeUnmount as Ze,onMounted as Qe,openBlock as _,ref as v,renderList as y,renderSlot as b,resolveDynamicComponent as $e,shallowRef as et,toDisplayString as tt,toRefs as nt,unref as x,watch as rt,watchEffect as it,withCtx as S}from"vue";var at=/* @__PURE__ */ e({default:()=>Bt}),ot=[`id`],st=[`id`],ct={style:{position:`relative`}},lt=[`xmlns`,`aria-describedby`,`viewBox`],ut=[`x`,`y`,`width`,`height`],dt={key:1},ft={key:0},pt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],mt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ht=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],gt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],_t=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],vt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],yt=[`transform`,`text-anchor`,`font-size`,`fill`,`font-weight`],bt=[`transform`,`text-anchor`,`font-size`,`fill`,`font-weight`],xt=[`transform`,`text-anchor`,`font-size`,`fill`,`stroke`,`font-weight`],St=[`x`,`y`,`width`,`height`,`fill`,`rx`],Ct={key:0},wt=[`cx`,`cy`,`r`,`fill`],Tt=[`cx`,`cy`,`r`,`fill`],Et={key:1},Dt=[`x`,`y`,`width`,`height`,`rx`,`fill`],Ot=[`x`,`y`,`width`,`height`,`fill`,`rx`],kt=[`x`,`y`,`height`,`width`,`fill`,`rx`],At=[`x`,`y`,`height`,`width`,`fill`,`rx`,`stroke`,`stroke-width`],jt=[`d`,`stroke`],Mt=[`x`,`y`,`height`,`width`,`fill`,`onMouseover`,`onMouseleave`,`onClick`],Nt=[`x`,`y`,`width`,`height`,`fill`,`fill-opacity`,`stroke`,`stroke-opacity`,`stroke-width`,`stroke-dasharray`],Pt=[`data-start`,`data-end`],Ft={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},It={key:5,class:`vue-data-ui-watermark`},Lt=[`d`,`stroke`],Rt=[`d`,`stroke`,`stroke-width`],zt=[`innerHTML`],Bt=/*#__PURE__*/ he({__name:`vue-ui-candlestick`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},selectedXIndex:{type:Number,default:void 0},zoomState:{type:Object,default:null}},emits:[`selectX`,`zoomStart`,`zoomEnd`,`zoomReset`,`update:zoomState`,`copyAlt`],setup(e,{expose:he,emit:at}){let Bt=Ge(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),Vt=Ge(()=>import(`./Tooltip-C1q0Qoh7.js`)),Ht=Ge(()=>import(`./vue-ui-accordion-S3nRtTU-.js`).then(e=>e.n)),Ut=Ge(()=>import(`./DataTable-0Vv-aGHD.js`)),Wt=Ge(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),Gt=Ge(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),Kt=Ge(()=>import(`./PackageVersion-BIhjLNBU.js`).then(e=>e.t)),qt=Ge(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),{vue_ui_candlestick:Jt}=t(),{isThemeValid:Yt,warnInvalidTheme:Xt}=_e(),C=e,w=at,Zt=f(()=>!!C.dataset&&C.dataset.length),T=v(!1),Qt=v(!1),$t=0,en=v(null),E=v(s()),tn=v(!1),nn=v(``),D=v(void 0),rn=v(0),O=v(null),an=v(null),on=v(null),sn=v(null),cn=v(null),ln=v(null),un=v(0),dn=v(0),fn=v(0),pn=v(null),mn=v(null),hn=v(null),gn=v(null),_n=v(null),k=v(null),vn=v({x:0,y:0}),yn=v(`pointer`),bn=v(!1),A=v(An()),j=f(()=>A.value.style.layout.candle),M=f(()=>A.value.style.layout.grid),N=f(()=>A.value.style.layout),P=f(()=>A.value.style),F=f(()=>A.value.userOptions);pe({config:()=>A.value,dataset:()=>C.dataset,component:`VueUiCandlestick`,rules:[me.emptyArray,{test:e=>e.length>200,message:[`👀 Dataset has > 200 points, which can cause performance issues. Consider:`,``,`▶️ Adding date inputs to constraint the dataset into a specific timeframe`,``,`▶️ Aggregate the data to larger time series to reduce the number of datapoints.`]}]});let{transitionEnabled:xn}=je({config:()=>A.value.transitions,dataset:()=>C.dataset}),Sn=f(()=>A.value.userOptions.useCursorPointer),Cn=f(()=>ie({defaultConfig:{useCssAnimation:!1,userOptions:{show:!1},table:{show:!1},style:{backgroundColor:`#99999930`,layout:{candle:{colors:{bearish:`#BABABA`,bullish:`#CACACA`}},grid:{stroke:`#6A6A6A`,verticalLines:{stroke:`#6A6A6A`},horizontalLines:{stroke:`#6A6A6A`},yAxis:{dataLabels:{show:!1},scale:{min:null,max:null}}},wick:{stroke:`#6A6A6A`,extremity:{color:`#6A6A6A`}}},tooltip:{show:!1},zoom:{show:!1,startIndex:null,endIndex:null}}},userConfig:A.value.skeletonConfig??{}})),{loading:I,FINAL_DATASET:L,manualLoading:wn}=de({...nt(C),FINAL_CONFIG:A,prepareConfig:An,callback:()=>{Promise.resolve().then(async()=>{await Ur()})},skeletonDataset:C.config?.skeletonDataset??[[17040672e5,10,20,2,10,30],[17067456e5,10,30,5,20,50],[17092512e5,20,50,10,30,80],[17119296e5,30,80,20,50,130],[17145216e5,50,130,30,100,210],[17172e8,80,210,50,150,340],[1719792e6,130,340,80,280,550],[17224704e5,210,550,130,450,890],[17251488e5,340,890,210,750,1440],[17277408e5,550,1440,340,1230,2330],[17304192e5,890,2330,550,1950,3770],[17330112e5,1440,3770,890,3200,5100]],skeletonConfig:ie({defaultConfig:A.value,userConfig:Cn.value})}),{userOptionsVisible:Tn,setUserOptionsVisibility:En,keepUserOptionState:Dn}=Re({config:A.value}),{svgRef:R}=ze({config:P.value.title});function On(){En(!0)}function kn(){En(!1),w(`selectX`,{seriesIndex:null,datapoint:null}),D.value=null}function An(){let e=ge({userConfig:C.config,defaultConfig:Jt}),t={};C.config&&le(C.config,`style.layout.grid.xAxis.dataLabels.showFirstAndLast`)&&(e.style.layout.grid.xAxis.dataLabels.showFirstAndLast=!!C.config.style.layout.grid.xAxis.dataLabels.showFirstAndLast);let n=e.theme;if(n){if(!Yt.value(e))Xt(e),t=e;else{let r=ge({userConfig:Be[n]||C.config,defaultConfig:e});t={...ge({userConfig:C.config,defaultConfig:r})}}}else t=e;return t}let jn=o(C.config);rt(()=>C.config,(e,t)=>{let n=o(e),r=n!==jn;jn=n;let i=An();r?(I.value||(A.value=An()),Tn.value=!A.value.userOptions.showOnChartHover,Fn(),un.value+=1,fn.value+=1,dn.value+=1,B.value.showTable=A.value.table.show,B.value.showTooltip=P.value.tooltip.show,lr()):(A.value.style.tooltip=i.style.tooltip,B.value.showTooltip=A.value.style.tooltip.show)},{deep:!0}),rt(()=>C.dataset,e=>{Array.isArray(e)&&e.length>0&&(wn.value=!1),zr()},{deep:!0});let z=v({height:P.value.height,width:P.value.width,xAxisFontSize:M.value.xAxis.dataLabels.fontSize,yAxisFontSize:M.value.yAxis.dataLabels.fontSize}),Mn=et(null),Nn=et(null);Qe(()=>{Fn()});let Pn=f(()=>A.value.debug);function Fn(){ue(C.dataset)&&(te({componentName:`VueUiCandlestick`,type:`dataset`,debug:Pn.value}),wn.value=!0),ue(C.dataset)||(wn.value=A.value.loading),setTimeout(()=>{T.value=!0},10),A.value.responsive&&(Mn.value&&(Nn.value&&Mn.value.unobserve(Nn.value),Mn.value.disconnect()),Mn.value=new ResizeObserver(()=>{T.value=!1;let{width:e,height:t}=Pe({chart:O.value,title:P.value.title.text?an.value:null,slicer:P.value.zoom.show&&U.value>6?sn.value.$el:null,legend:on.value,source:cn.value,noTitle:ln.value});cancelAnimationFrame($t),$t=requestAnimationFrame(()=>{z.value.width=e,z.value.height=t-12,Qt.value=!0,A.value.responsiveProportionalSizing?(z.value.xAxisFontSize=se({relator:Math.min(e,t),adjuster:P.value.width,source:M.value.xAxis.dataLabels.fontSize,threshold:6,fallback:6}),z.value.yAxisFontSize=se({relator:Math.min(e,t),adjuster:P.value.width,source:M.value.yAxis.dataLabels.fontSize,threshold:6,fallback:6})):(z.value.xAxisFontSize=M.value.xAxis.dataLabels.fontSize,z.value.yAxisFontSize=M.value.yAxis.dataLabels.fontSize),en.value&&clearTimeout(en.value),en.value=setTimeout(()=>{T.value=!0},10)})}),Nn.value=O.value.parentNode,Mn.value.observe(Nn.value)),Ur()}Ze(()=>{cancelAnimationFrame($t),Mn.value&&(Nn.value&&Mn.value.unobserve(Nn.value),Mn.value.disconnect())});let{isPrinting:In,isImaging:Ln,generatePdf:Rn,generateImage:zn}=Ae({elementId:`vue-ui-candlestick_${E.value}`,fileName:P.value.title.text||`vue-ui-candlestick`,options:A.value.userOptions.print}),Bn=f(()=>A.value.userOptions.show&&!P.value.title.text),B=v({showTable:A.value.table.show,showTooltip:P.value.tooltip.show}),{metrics:Vn,ready:Hn,settling:V,update:Un}=Me({svgRef:R,canMeasure:()=>(!A.value.responsive||Qt.value)&&(!M.value.xAxis.dataLabels.show||xr.value),initialMetrics:{scaleLabelsWidth:0,timeLabelsHeight:0},measure:e=>({scaleLabelsWidth:pn.value?e(pn.value).textWidth:M.value.yAxis.dataLabels.offsetX,timeLabelsHeight:e(mn.value).height})}),Wn=f(()=>mn.value?Vn.value.timeLabelsHeight+z.value.xAxisFontSize:0),Gn=f(()=>M.value.yAxis.position===`right`);function Kn(){let e=Vn.value.scaleLabelsWidth,t=M.value.yAxis.axisName?.show?M.value.yAxis.axisName.fontSize+M.value.yAxis.axisName.offsetX:0,n=e+13+t;return{left:Gn.value?0:n,right:Gn.value?n:0,scaleLabelsWidth:e,yAxisNameWidth:t,crosshair:13}}let H=f(()=>{let{top:e,right:t,bottom:n,left:r}=N.value.padding,i=Kn();return{top:e+12,right:z.value.width-t-i.right,left:r+i.left,bottom:z.value.height-n-Wn.value,width:z.value.width-r-t-i.left-i.right,height:z.value.height-e-n-Wn.value-12,scaleLabelsWidth:i.scaleLabelsWidth,yAxisNameWidth:i.yAxisNameWidth,crosshair:i.crosshair}}),qn=f(()=>{let{left:e,top:t,width:n,height:r}=H.value,i=W.value.start,a=W.value.end-i,o=n/a,s=G.value.start-i,c=G.value.end-i,l=Math.max(0,Math.min(a,s)),ee=Math.max(0,Math.min(a,c));return{x:e+l*o,y:t,width:(ee-l)*o,height:r,fill:P.value.zoom.preview.fill,stroke:P.value.zoom.preview.stroke,"stroke-width":P.value.zoom.preview.strokeWidth,"stroke-dasharray":P.value.zoom.preview.strokeDasharray,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{pointerEvents:`none`,transition:`none !important`,animation:`none !important`}}}),U=f(()=>L.value.length),W=v({start:0,end:U.value}),G=v({start:0,end:U.value}),Jn=v(!1),Yn=v(!1),Xn=v(null),K=v(null),q=v(null),Zn=v(!1),Qn=v({time:0,x:0,y:0,pointerType:null}),$n=f(()=>P.value.zoom?.dragToZoom),J=f(()=>$n.value.show&&Zt.value&&Vr.value&&U.value>1&&!I.value),er=null,tr={},nr=f(()=>P.value.zoom.preview.enable&&(G.value.start!==W.value.start||G.value.end!==W.value.end));function rr(e,t){G.value[e]=t}function ir(e,t=W.value){if(!e||typeof e!=`object`)return null;let n=e.start!==void 0&&e.start!==null,r=e.end!==void 0&&e.end!==null;if(!n&&!r)return null;let i=Number(n?e.start:t.start),a=Number(r?e.end:t.end);return!Number.isFinite(i)||!Number.isFinite(a)?null:{start:i,end:a}}function ar(e){let t=ir(e);t&&w(`update:zoomState`,t)}function or(){er&&=(cancelAnimationFrame(er),null),tr={}}function sr(e){let t=ir(e);if(!t)return null;let{start:n,end:r}=t;return(n!==Number(W.value.start)||r!==Number(W.value.end))&&(or(),W.value={start:n,end:r},G.value={start:n,end:r},lr()),{start:Number(W.value.start),end:Number(W.value.end)}}function cr(e){let t=sr(e);return t?(w(`update:zoomState`,t),t):null}function lr(){let e=Math.max(0,Math.min(W.value.start??0,U.value-1)),t=Math.max(e+1,Math.min(W.value.end??U.value,U.value));(!Number.isFinite(e)||!Number.isFinite(t)||t<=e)&&(e=0,t=U.value),W.value.start=e,W.value.end=t,G.value.start=e,G.value.end=t,sn.value&&sn.value.setRangeValues(e,t)}let ur=f(()=>L.value.map((e,t)=>({...e,absoluteIndex:t}))),dr=f(()=>ur.value.slice(W.value.start,W.value.end)),Y=f(()=>(Pn.value&&L.value.forEach((e,t)=>{[null,void 0].includes(e[0])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`period (index 0)`,index:t}),[null,void 0].includes(e[1])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`open (index 1)`,index:t}),[null,void 0].includes(e[2])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`high (index 2)`,index:t}),[null,void 0].includes(e[3])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`low (index 3)`,index:t}),[null,void 0].includes(e[4])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`close (index 4)`,index:t}),[null,void 0].includes(e[5])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`volume (index 5)`,index:t})}),dr.value.map(e=>({absoluteIndex:e.absoluteIndex,period:e[0],open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5]})))),fr=f(()=>ur.value.map(e=>({absoluteIndex:e.absoluteIndex,period:e[0],open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5]}))),X=f(()=>H.value.width/dr.value.length),pr=f(()=>({max:M.value.yAxis.scale.max===null?Math.max(...Y.value.map(e=>e.high)):M.value.yAxis.scale.max,min:M.value.yAxis.scale.min===null?0:M.value.yAxis.scale.min})),Z=f(()=>l(pr.value.min,pr.value.max,M.value.yAxis.dataLabels.steps));function mr(e,t,n=null,r=null){return{...e,x:u(H.value.left+t*X.value+X.value/2),y:u(H.value.top+(1-(e-Z.value.min)/(Z.value.max-Z.value.min))*H.value.height),value:u(e),isMax:e===n,isMin:e===r}}let Q=f(()=>{let e={o:Math.max(...Y.value.map(e=>e.open)),h:Math.max(...Y.value.map(e=>e.high)),l:Math.max(...Y.value.map(e=>e.low)),c:Math.max(...Y.value.map(e=>e.low))},t={o:Math.min(...Y.value.map(e=>e.open)),h:Math.min(...Y.value.map(e=>e.high)),l:Math.min(...Y.value.map(e=>e.low)),c:Math.min(...Y.value.map(e=>e.low))},n=Math.max(...Y.value.map(e=>e.volume)),r=Math.min(...Y.value.map(e=>e.volume));return Y.value.map((i,a)=>{let o=mr(i.open,a,e.o,t.o),s=mr(i.high,a,e.h,t.h),c=mr(i.low,a,e.l,t.l),l=mr(i.close,a,e.c,t.c),ee=i.close>i.open,te=i.volume===n,u=i.volume===r;return{period:i.period,open:o,high:s,low:c,close:l,volume:i.volume,isBullish:ee,absoluteIndex:i.absoluteIndex,isMaxVolume:te,isMinVolume:u}})});function hr({item:e,index:t,minimapH:n,unitW:r}){let i=M.value.yAxis.scale.min??0,a=M.value.yAxis.scale.max??Math.max(...L.value.map(e=>e[2]));return{...e,x:u(t*r),y:u((1-(e-i)/(a-i))*n),value:u(e)}}let gr=f(()=>({minimapH:e,unitW:t})=>fr.value.map((n,r)=>{let i=hr({item:n.open,index:r,minimapH:e,unitW:t}),a=hr({item:n.high,index:r,minimapH:e,unitW:t}),o=hr({item:n.low,index:r,minimapH:e,unitW:t}),s=hr({item:n.close,index:r,minimapH:e,unitW:t}),c=n.close>n.open;return{period:n.period,open:i,high:a,low:o,close:s,volume:n.volume,isBullish:c,absoluteIndex:n.absoluteIndex}})),_r=f(()=>P.value.zoom.minimap.show?[{name:``,series:L.value.map(e=>e[2]),color:`#000000`,isVisible:!0}]:[]);function vr(e){return u((e-Z.value.min)/(Z.value.max-Z.value.min))}let yr=f(()=>Z.value.ticks.map(e=>({y:H.value.bottom-H.value.height*vr(e),value:u(e)}))),br=f(()=>Y.value.map(e=>e.period)),$=v([]),xr=v(!1),Sr=v([]),Cr=0;it(()=>{let e=++Cr;(async()=>{let t=await ke({values:L.value.map(e=>e[0]),maxDatapoints:L.value.length,formatter:M.value.xAxis.dataLabels.datetimeFormatter,start:W.value.start,end:W.value.end});e===Cr&&($.value=t,xr.value=!0)})()});let wr=0;it(()=>{let e=++wr;(async()=>{let t=await ke({values:L.value.map(e=>e[0]),maxDatapoints:L.value.length,formatter:M.value.xAxis.dataLabels.datetimeFormatter,start:0,end:U.value});e===wr&&(Sr.value=t)})()});let Tr=v({months:[],shortMonths:[],days:[],shortDays:[]}),Er=0;it(()=>{let e=++Er,t=M.value.xAxis.dataLabels.datetimeFormatter;(async()=>{let n=await Oe(t.locale).catch(()=>Oe(`en`));e===Er&&(Tr.value=n.data)})()});let Dr=f(()=>{let e=M.value.xAxis.dataLabels.datetimeFormatter,t=De({useUTC:e.useUTC,locale:Tr.value,januaryAsYear:e.januaryAsYear});return(e,n)=>{let r=L.value.map(e=>e[0])?.[e];return r==null?``:t.formatDate(new Date(r),n)}}),Or=f(()=>(L.value.map(e=>e[0])||[]).map((e,t)=>({text:Dr.value(t,P.value.tooltip.timeFormat),absoluteIndex:t}))),kr=f(()=>(L.value.map(e=>e[0])||[]).map((e,t)=>({text:Dr.value(t,P.value.zoom.timeFormat),absoluteIndex:t}))),Ar=f(()=>{let e=Math.max(1,Math.floor(Number(M.value.xAxis.dataLabels.modulo)||1)),t=($.value||[]).map(e=>e?.text??``),n=(Sr.value||[]).map(e=>e?.text??``),r=W.value.start??0,i=r>0||t.length<n.length;return re({configuredModulo:e,visibleTexts:t,allTexts:n,startAbs:r,isZoomed:i})}),jr=f(()=>{let e=M.value.xAxis.dataLabels,t=$.value||[],n=Sr.value||[],r=W.value.start??0,i=D.value,a=U.value,o=t.map(e=>e?.text??``),s=n.map(e=>e?.text??``),c=ne(!!e.showOnlyFirstAndLast,!!e.showOnlyAtModulo,Ar.value,o,s,r,i,a);if(!e.showFirstAndLast||e.showOnlyFirstAndLast||!c.length)return c;let l=c.length-1;return c.map((e,t)=>t!==0&&t!==l?e:{...e,text:o[t]??``})}),Mr=f(()=>M.value.xAxis.dataLabels.datetimeFormatter.enable?{start:$.value.find(e=>e.absoluteIndex===W.value.start)?.text??``,end:$.value.find(e=>e.absoluteIndex===W.value.end-1)?.text??``}:{start:L.value[W.value.start]?L.value[W.value.start][0]:L.value[0][0],end:L.value[W.value.end-1]?L.value[W.value.end-1][0]:L.value.at(-1)[0]}),Nr=v(null);function Pr(e,t){A.value.events.datapointClick&&A.value.events.datapointClick({datapoint:t,seriesIndex:e+W.value.start})}function Fr(e,t){A.value.events.datapointLeave&&A.value.events.datapointLeave({datapoint:t,seriesIndex:e+W.value.start}),D.value=void 0,tn.value=!1,k.value=null,yn.value=`pointer`}rt(()=>C.selectedXIndex,e=>{if([null,void 0].includes(C.selectedXIndex)){D.value=null;return}let t=e-W.value.start;t<0||e>=W.value.end?D.value=null:D.value=t??null},{immediate:!0});function Ir(e,t,r=`pointer`){A.value.events.datapointEnter&&A.value.events.datapointEnter({datapoint:t,seriesIndex:e+W.value.start}),D.value=e,k.value=e,yn.value=r,Nr.value={datapoint:t,seriesIndex:e,series:Q.value,config:A.value},ki({seriesIndex:e,datapoint:t});let a=P.value.tooltip.customFormat;if(i(a)&&oe(()=>a({seriesIndex:e,datapoint:t,series:Q.value,config:A.value})))nn.value=a({seriesIndex:e,datapoint:t,series:Q.value,config:A.value});else if(P.value.tooltip.show){let r=``,{period:i,open:a,high:o,low:s,close:c,volume:l,isBullish:ee}=Q.value[e],{period:te,open:u,high:ne,low:re,close:ie,volume:ae}=A.value.translations,oe=M.value.xAxis.dataLabels.datetimeFormatter.enable?P.value.tooltip.useDefaultTimeFormat?$.value[e].text:Or.value[e].text:i;r+=`<div><svg style="margin-right:6px" viewBox="0 0 12 12" height="12" width="12"><rect x="0" y="0" height="12" width="12" rx="${j.value.borderRadius*3}" stroke="${j.value.stroke}" stroke-width="${j.value.strokeWidth}"
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,D as r,Dt as i,Jt as a,Qt as o,X as s,Yt as c,_ as l,_t as ee,at as te,b as u,c as ne,gt as re,in as ie,nt as ae,pt as oe,rn as se,t as ce,wt as le,zt as ue}from"./lib-rPeBMZrn.js";import{n as de,t as fe}from"./BaseScanner-8NdoBs7B.js";import{n as pe,t as me}from"./useHints-C-TwxM0Y.js";import{t as he}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as ge}from"./useNestedProp-DnGoh-XS.js";import{t as _e}from"./useThemeCheck-BKNRbGeC.js";import{t as ve}from"./img-D4RQwASc.js";import{n as ye}from"./Title-BliHuXfT.js";import{t as be}from"./useChartExport-BZts4KFb.js";import{n as xe,t as Se}from"./tableIntegration-CNoJ1CIY.js";import{n as Ce,t as we}from"./annotationSlots-BRR85CqJ.js";import{n as Te,t as Ee}from"./userOptionsSlots-DYuo-E5m.js";import{n as De,r as Oe,t as ke}from"./useTimeLabels-Das5O74F.js";import{t as Ae}from"./usePrinter-DVf3YcG5.js";import{t as je}from"./useTransitions-ChGGrtrv.js";import{t as Me}from"./useSvgLabelLayout-42Kats14.js";import{t as Ne}from"./useTimeLabelCollider-BTybMUFi.js";import{t as Pe}from"./useResponsive-CENUxfEL.js";import{t as Fe}from"./DefGrad-DKMq1REY.js";import{t as Ie}from"./SlicerPreview-CFFUOlQr.js";import{t as Le}from"./A11yDataTable-DWNlWXzs.js";import{t as Re}from"./useUserOptionState-CXlFnwPv.js";import{t as ze}from"./useChartAccessibility-DOMuYJfm.js";import{t as Be}from"./vue_ui_candlestick-DKvha_Ab.js";import{Fragment as d,computed as f,createBlock as Ve,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as He,createTextVNode as Ue,createVNode as We,defineAsyncComponent as Ge,guardReactiveProps as Ke,mergeProps as qe,nextTick as Je,normalizeClass as g,normalizeProps as Ye,normalizeStyle as Xe,onBeforeUnmount as Ze,onMounted as Qe,openBlock as _,ref as v,renderList as y,renderSlot as b,resolveDynamicComponent as $e,shallowRef as et,toDisplayString as tt,toRefs as nt,unref as x,watch as rt,watchEffect as it,withCtx as S}from"vue";var at=/* @__PURE__ */ e({default:()=>Bt}),ot=[`id`],st=[`id`],ct={style:{position:`relative`}},lt=[`xmlns`,`aria-describedby`,`viewBox`],ut=[`x`,`y`,`width`,`height`],dt={key:1},ft={key:0},pt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],mt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],ht=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],gt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`,`stroke-dasharray`],_t=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],vt=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],yt=[`transform`,`text-anchor`,`font-size`,`fill`,`font-weight`],bt=[`transform`,`text-anchor`,`font-size`,`fill`,`font-weight`],xt=[`transform`,`text-anchor`,`font-size`,`fill`,`stroke`,`font-weight`],St=[`x`,`y`,`width`,`height`,`fill`,`rx`],Ct={key:0},wt=[`cx`,`cy`,`r`,`fill`],Tt=[`cx`,`cy`,`r`,`fill`],Et={key:1},Dt=[`x`,`y`,`width`,`height`,`rx`,`fill`],Ot=[`x`,`y`,`width`,`height`,`fill`,`rx`],kt=[`x`,`y`,`height`,`width`,`fill`,`rx`],At=[`x`,`y`,`height`,`width`,`fill`,`rx`,`stroke`,`stroke-width`],jt=[`d`,`stroke`],Mt=[`x`,`y`,`height`,`width`,`fill`,`onMouseover`,`onMouseleave`,`onClick`],Nt=[`x`,`y`,`width`,`height`,`fill`,`fill-opacity`,`stroke`,`stroke-opacity`,`stroke-width`,`stroke-dasharray`],Pt=[`data-start`,`data-end`],Ft={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},It={key:5,class:`vue-data-ui-watermark`},Lt=[`d`,`stroke`],Rt=[`d`,`stroke`,`stroke-width`],zt=[`innerHTML`],Bt=/*#__PURE__*/ he({__name:`vue-ui-candlestick`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},selectedXIndex:{type:Number,default:void 0},zoomState:{type:Object,default:null}},emits:[`selectX`,`zoomStart`,`zoomEnd`,`zoomReset`,`update:zoomState`,`copyAlt`],setup(e,{expose:he,emit:at}){let Bt=Ge(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),Vt=Ge(()=>import(`./Tooltip-C1q0Qoh7.js`)),Ht=Ge(()=>import(`./vue-ui-accordion-S3nRtTU-.js`).then(e=>e.n)),Ut=Ge(()=>import(`./DataTable-0Vv-aGHD.js`)),Wt=Ge(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),Gt=Ge(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),Kt=Ge(()=>import(`./PackageVersion-DhptF5oD.js`).then(e=>e.t)),qt=Ge(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),{vue_ui_candlestick:Jt}=t(),{isThemeValid:Yt,warnInvalidTheme:Xt}=_e(),C=e,w=at,Zt=f(()=>!!C.dataset&&C.dataset.length),T=v(!1),Qt=v(!1),$t=0,en=v(null),E=v(s()),tn=v(!1),nn=v(``),D=v(void 0),rn=v(0),O=v(null),an=v(null),on=v(null),sn=v(null),cn=v(null),ln=v(null),un=v(0),dn=v(0),fn=v(0),pn=v(null),mn=v(null),hn=v(null),gn=v(null),_n=v(null),k=v(null),vn=v({x:0,y:0}),yn=v(`pointer`),bn=v(!1),A=v(An()),j=f(()=>A.value.style.layout.candle),M=f(()=>A.value.style.layout.grid),N=f(()=>A.value.style.layout),P=f(()=>A.value.style),F=f(()=>A.value.userOptions);pe({config:()=>A.value,dataset:()=>C.dataset,component:`VueUiCandlestick`,rules:[me.emptyArray,{test:e=>e.length>200,message:[`👀 Dataset has > 200 points, which can cause performance issues. Consider:`,``,`▶️ Adding date inputs to constraint the dataset into a specific timeframe`,``,`▶️ Aggregate the data to larger time series to reduce the number of datapoints.`]}]});let{transitionEnabled:xn}=je({config:()=>A.value.transitions,dataset:()=>C.dataset}),Sn=f(()=>A.value.userOptions.useCursorPointer),Cn=f(()=>ie({defaultConfig:{useCssAnimation:!1,userOptions:{show:!1},table:{show:!1},style:{backgroundColor:`#99999930`,layout:{candle:{colors:{bearish:`#BABABA`,bullish:`#CACACA`}},grid:{stroke:`#6A6A6A`,verticalLines:{stroke:`#6A6A6A`},horizontalLines:{stroke:`#6A6A6A`},yAxis:{dataLabels:{show:!1},scale:{min:null,max:null}}},wick:{stroke:`#6A6A6A`,extremity:{color:`#6A6A6A`}}},tooltip:{show:!1},zoom:{show:!1,startIndex:null,endIndex:null}}},userConfig:A.value.skeletonConfig??{}})),{loading:I,FINAL_DATASET:L,manualLoading:wn}=de({...nt(C),FINAL_CONFIG:A,prepareConfig:An,callback:()=>{Promise.resolve().then(async()=>{await Ur()})},skeletonDataset:C.config?.skeletonDataset??[[17040672e5,10,20,2,10,30],[17067456e5,10,30,5,20,50],[17092512e5,20,50,10,30,80],[17119296e5,30,80,20,50,130],[17145216e5,50,130,30,100,210],[17172e8,80,210,50,150,340],[1719792e6,130,340,80,280,550],[17224704e5,210,550,130,450,890],[17251488e5,340,890,210,750,1440],[17277408e5,550,1440,340,1230,2330],[17304192e5,890,2330,550,1950,3770],[17330112e5,1440,3770,890,3200,5100]],skeletonConfig:ie({defaultConfig:A.value,userConfig:Cn.value})}),{userOptionsVisible:Tn,setUserOptionsVisibility:En,keepUserOptionState:Dn}=Re({config:A.value}),{svgRef:R}=ze({config:P.value.title});function On(){En(!0)}function kn(){En(!1),w(`selectX`,{seriesIndex:null,datapoint:null}),D.value=null}function An(){let e=ge({userConfig:C.config,defaultConfig:Jt}),t={};C.config&&le(C.config,`style.layout.grid.xAxis.dataLabels.showFirstAndLast`)&&(e.style.layout.grid.xAxis.dataLabels.showFirstAndLast=!!C.config.style.layout.grid.xAxis.dataLabels.showFirstAndLast);let n=e.theme;if(n){if(!Yt.value(e))Xt(e),t=e;else{let r=ge({userConfig:Be[n]||C.config,defaultConfig:e});t={...ge({userConfig:C.config,defaultConfig:r})}}}else t=e;return t}let jn=o(C.config);rt(()=>C.config,(e,t)=>{let n=o(e),r=n!==jn;jn=n;let i=An();r?(I.value||(A.value=An()),Tn.value=!A.value.userOptions.showOnChartHover,Fn(),un.value+=1,fn.value+=1,dn.value+=1,B.value.showTable=A.value.table.show,B.value.showTooltip=P.value.tooltip.show,lr()):(A.value.style.tooltip=i.style.tooltip,B.value.showTooltip=A.value.style.tooltip.show)},{deep:!0}),rt(()=>C.dataset,e=>{Array.isArray(e)&&e.length>0&&(wn.value=!1),zr()},{deep:!0});let z=v({height:P.value.height,width:P.value.width,xAxisFontSize:M.value.xAxis.dataLabels.fontSize,yAxisFontSize:M.value.yAxis.dataLabels.fontSize}),Mn=et(null),Nn=et(null);Qe(()=>{Fn()});let Pn=f(()=>A.value.debug);function Fn(){ue(C.dataset)&&(te({componentName:`VueUiCandlestick`,type:`dataset`,debug:Pn.value}),wn.value=!0),ue(C.dataset)||(wn.value=A.value.loading),setTimeout(()=>{T.value=!0},10),A.value.responsive&&(Mn.value&&(Nn.value&&Mn.value.unobserve(Nn.value),Mn.value.disconnect()),Mn.value=new ResizeObserver(()=>{T.value=!1;let{width:e,height:t}=Pe({chart:O.value,title:P.value.title.text?an.value:null,slicer:P.value.zoom.show&&U.value>6?sn.value.$el:null,legend:on.value,source:cn.value,noTitle:ln.value});cancelAnimationFrame($t),$t=requestAnimationFrame(()=>{z.value.width=e,z.value.height=t-12,Qt.value=!0,A.value.responsiveProportionalSizing?(z.value.xAxisFontSize=se({relator:Math.min(e,t),adjuster:P.value.width,source:M.value.xAxis.dataLabels.fontSize,threshold:6,fallback:6}),z.value.yAxisFontSize=se({relator:Math.min(e,t),adjuster:P.value.width,source:M.value.yAxis.dataLabels.fontSize,threshold:6,fallback:6})):(z.value.xAxisFontSize=M.value.xAxis.dataLabels.fontSize,z.value.yAxisFontSize=M.value.yAxis.dataLabels.fontSize),en.value&&clearTimeout(en.value),en.value=setTimeout(()=>{T.value=!0},10)})}),Nn.value=O.value.parentNode,Mn.value.observe(Nn.value)),Ur()}Ze(()=>{cancelAnimationFrame($t),Mn.value&&(Nn.value&&Mn.value.unobserve(Nn.value),Mn.value.disconnect())});let{isPrinting:In,isImaging:Ln,generatePdf:Rn,generateImage:zn}=Ae({elementId:`vue-ui-candlestick_${E.value}`,fileName:P.value.title.text||`vue-ui-candlestick`,options:A.value.userOptions.print}),Bn=f(()=>A.value.userOptions.show&&!P.value.title.text),B=v({showTable:A.value.table.show,showTooltip:P.value.tooltip.show}),{metrics:Vn,ready:Hn,settling:V,update:Un}=Me({svgRef:R,canMeasure:()=>(!A.value.responsive||Qt.value)&&(!M.value.xAxis.dataLabels.show||xr.value),initialMetrics:{scaleLabelsWidth:0,timeLabelsHeight:0},measure:e=>({scaleLabelsWidth:pn.value?e(pn.value).textWidth:M.value.yAxis.dataLabels.offsetX,timeLabelsHeight:e(mn.value).height})}),Wn=f(()=>mn.value?Vn.value.timeLabelsHeight+z.value.xAxisFontSize:0),Gn=f(()=>M.value.yAxis.position===`right`);function Kn(){let e=Vn.value.scaleLabelsWidth,t=M.value.yAxis.axisName?.show?M.value.yAxis.axisName.fontSize+M.value.yAxis.axisName.offsetX:0,n=e+13+t;return{left:Gn.value?0:n,right:Gn.value?n:0,scaleLabelsWidth:e,yAxisNameWidth:t,crosshair:13}}let H=f(()=>{let{top:e,right:t,bottom:n,left:r}=N.value.padding,i=Kn();return{top:e+12,right:z.value.width-t-i.right,left:r+i.left,bottom:z.value.height-n-Wn.value,width:z.value.width-r-t-i.left-i.right,height:z.value.height-e-n-Wn.value-12,scaleLabelsWidth:i.scaleLabelsWidth,yAxisNameWidth:i.yAxisNameWidth,crosshair:i.crosshair}}),qn=f(()=>{let{left:e,top:t,width:n,height:r}=H.value,i=W.value.start,a=W.value.end-i,o=n/a,s=G.value.start-i,c=G.value.end-i,l=Math.max(0,Math.min(a,s)),ee=Math.max(0,Math.min(a,c));return{x:e+l*o,y:t,width:(ee-l)*o,height:r,fill:P.value.zoom.preview.fill,stroke:P.value.zoom.preview.stroke,"stroke-width":P.value.zoom.preview.strokeWidth,"stroke-dasharray":P.value.zoom.preview.strokeDasharray,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{pointerEvents:`none`,transition:`none !important`,animation:`none !important`}}}),U=f(()=>L.value.length),W=v({start:0,end:U.value}),G=v({start:0,end:U.value}),Jn=v(!1),Yn=v(!1),Xn=v(null),K=v(null),q=v(null),Zn=v(!1),Qn=v({time:0,x:0,y:0,pointerType:null}),$n=f(()=>P.value.zoom?.dragToZoom),J=f(()=>$n.value.show&&Zt.value&&Vr.value&&U.value>1&&!I.value),er=null,tr={},nr=f(()=>P.value.zoom.preview.enable&&(G.value.start!==W.value.start||G.value.end!==W.value.end));function rr(e,t){G.value[e]=t}function ir(e,t=W.value){if(!e||typeof e!=`object`)return null;let n=e.start!==void 0&&e.start!==null,r=e.end!==void 0&&e.end!==null;if(!n&&!r)return null;let i=Number(n?e.start:t.start),a=Number(r?e.end:t.end);return!Number.isFinite(i)||!Number.isFinite(a)?null:{start:i,end:a}}function ar(e){let t=ir(e);t&&w(`update:zoomState`,t)}function or(){er&&=(cancelAnimationFrame(er),null),tr={}}function sr(e){let t=ir(e);if(!t)return null;let{start:n,end:r}=t;return(n!==Number(W.value.start)||r!==Number(W.value.end))&&(or(),W.value={start:n,end:r},G.value={start:n,end:r},lr()),{start:Number(W.value.start),end:Number(W.value.end)}}function cr(e){let t=sr(e);return t?(w(`update:zoomState`,t),t):null}function lr(){let e=Math.max(0,Math.min(W.value.start??0,U.value-1)),t=Math.max(e+1,Math.min(W.value.end??U.value,U.value));(!Number.isFinite(e)||!Number.isFinite(t)||t<=e)&&(e=0,t=U.value),W.value.start=e,W.value.end=t,G.value.start=e,G.value.end=t,sn.value&&sn.value.setRangeValues(e,t)}let ur=f(()=>L.value.map((e,t)=>({...e,absoluteIndex:t}))),dr=f(()=>ur.value.slice(W.value.start,W.value.end)),Y=f(()=>(Pn.value&&L.value.forEach((e,t)=>{[null,void 0].includes(e[0])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`period (index 0)`,index:t}),[null,void 0].includes(e[1])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`open (index 1)`,index:t}),[null,void 0].includes(e[2])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`high (index 2)`,index:t}),[null,void 0].includes(e[3])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`low (index 3)`,index:t}),[null,void 0].includes(e[4])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`close (index 4)`,index:t}),[null,void 0].includes(e[5])&&te({componentName:`VueUiCandlestick`,type:`datasetAttribute`,property:`volume (index 5)`,index:t})}),dr.value.map(e=>({absoluteIndex:e.absoluteIndex,period:e[0],open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5]})))),fr=f(()=>ur.value.map(e=>({absoluteIndex:e.absoluteIndex,period:e[0],open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5]}))),X=f(()=>H.value.width/dr.value.length),pr=f(()=>({max:M.value.yAxis.scale.max===null?Math.max(...Y.value.map(e=>e.high)):M.value.yAxis.scale.max,min:M.value.yAxis.scale.min===null?0:M.value.yAxis.scale.min})),Z=f(()=>l(pr.value.min,pr.value.max,M.value.yAxis.dataLabels.steps));function mr(e,t,n=null,r=null){return{...e,x:u(H.value.left+t*X.value+X.value/2),y:u(H.value.top+(1-(e-Z.value.min)/(Z.value.max-Z.value.min))*H.value.height),value:u(e),isMax:e===n,isMin:e===r}}let Q=f(()=>{let e={o:Math.max(...Y.value.map(e=>e.open)),h:Math.max(...Y.value.map(e=>e.high)),l:Math.max(...Y.value.map(e=>e.low)),c:Math.max(...Y.value.map(e=>e.low))},t={o:Math.min(...Y.value.map(e=>e.open)),h:Math.min(...Y.value.map(e=>e.high)),l:Math.min(...Y.value.map(e=>e.low)),c:Math.min(...Y.value.map(e=>e.low))},n=Math.max(...Y.value.map(e=>e.volume)),r=Math.min(...Y.value.map(e=>e.volume));return Y.value.map((i,a)=>{let o=mr(i.open,a,e.o,t.o),s=mr(i.high,a,e.h,t.h),c=mr(i.low,a,e.l,t.l),l=mr(i.close,a,e.c,t.c),ee=i.close>i.open,te=i.volume===n,u=i.volume===r;return{period:i.period,open:o,high:s,low:c,close:l,volume:i.volume,isBullish:ee,absoluteIndex:i.absoluteIndex,isMaxVolume:te,isMinVolume:u}})});function hr({item:e,index:t,minimapH:n,unitW:r}){let i=M.value.yAxis.scale.min??0,a=M.value.yAxis.scale.max??Math.max(...L.value.map(e=>e[2]));return{...e,x:u(t*r),y:u((1-(e-i)/(a-i))*n),value:u(e)}}let gr=f(()=>({minimapH:e,unitW:t})=>fr.value.map((n,r)=>{let i=hr({item:n.open,index:r,minimapH:e,unitW:t}),a=hr({item:n.high,index:r,minimapH:e,unitW:t}),o=hr({item:n.low,index:r,minimapH:e,unitW:t}),s=hr({item:n.close,index:r,minimapH:e,unitW:t}),c=n.close>n.open;return{period:n.period,open:i,high:a,low:o,close:s,volume:n.volume,isBullish:c,absoluteIndex:n.absoluteIndex}})),_r=f(()=>P.value.zoom.minimap.show?[{name:``,series:L.value.map(e=>e[2]),color:`#000000`,isVisible:!0}]:[]);function vr(e){return u((e-Z.value.min)/(Z.value.max-Z.value.min))}let yr=f(()=>Z.value.ticks.map(e=>({y:H.value.bottom-H.value.height*vr(e),value:u(e)}))),br=f(()=>Y.value.map(e=>e.period)),$=v([]),xr=v(!1),Sr=v([]),Cr=0;it(()=>{let e=++Cr;(async()=>{let t=await ke({values:L.value.map(e=>e[0]),maxDatapoints:L.value.length,formatter:M.value.xAxis.dataLabels.datetimeFormatter,start:W.value.start,end:W.value.end});e===Cr&&($.value=t,xr.value=!0)})()});let wr=0;it(()=>{let e=++wr;(async()=>{let t=await ke({values:L.value.map(e=>e[0]),maxDatapoints:L.value.length,formatter:M.value.xAxis.dataLabels.datetimeFormatter,start:0,end:U.value});e===wr&&(Sr.value=t)})()});let Tr=v({months:[],shortMonths:[],days:[],shortDays:[]}),Er=0;it(()=>{let e=++Er,t=M.value.xAxis.dataLabels.datetimeFormatter;(async()=>{let n=await Oe(t.locale).catch(()=>Oe(`en`));e===Er&&(Tr.value=n.data)})()});let Dr=f(()=>{let e=M.value.xAxis.dataLabels.datetimeFormatter,t=De({useUTC:e.useUTC,locale:Tr.value,januaryAsYear:e.januaryAsYear});return(e,n)=>{let r=L.value.map(e=>e[0])?.[e];return r==null?``:t.formatDate(new Date(r),n)}}),Or=f(()=>(L.value.map(e=>e[0])||[]).map((e,t)=>({text:Dr.value(t,P.value.tooltip.timeFormat),absoluteIndex:t}))),kr=f(()=>(L.value.map(e=>e[0])||[]).map((e,t)=>({text:Dr.value(t,P.value.zoom.timeFormat),absoluteIndex:t}))),Ar=f(()=>{let e=Math.max(1,Math.floor(Number(M.value.xAxis.dataLabels.modulo)||1)),t=($.value||[]).map(e=>e?.text??``),n=(Sr.value||[]).map(e=>e?.text??``),r=W.value.start??0,i=r>0||t.length<n.length;return re({configuredModulo:e,visibleTexts:t,allTexts:n,startAbs:r,isZoomed:i})}),jr=f(()=>{let e=M.value.xAxis.dataLabels,t=$.value||[],n=Sr.value||[],r=W.value.start??0,i=D.value,a=U.value,o=t.map(e=>e?.text??``),s=n.map(e=>e?.text??``),c=ne(!!e.showOnlyFirstAndLast,!!e.showOnlyAtModulo,Ar.value,o,s,r,i,a);if(!e.showFirstAndLast||e.showOnlyFirstAndLast||!c.length)return c;let l=c.length-1;return c.map((e,t)=>t!==0&&t!==l?e:{...e,text:o[t]??``})}),Mr=f(()=>M.value.xAxis.dataLabels.datetimeFormatter.enable?{start:$.value.find(e=>e.absoluteIndex===W.value.start)?.text??``,end:$.value.find(e=>e.absoluteIndex===W.value.end-1)?.text??``}:{start:L.value[W.value.start]?L.value[W.value.start][0]:L.value[0][0],end:L.value[W.value.end-1]?L.value[W.value.end-1][0]:L.value.at(-1)[0]}),Nr=v(null);function Pr(e,t){A.value.events.datapointClick&&A.value.events.datapointClick({datapoint:t,seriesIndex:e+W.value.start})}function Fr(e,t){A.value.events.datapointLeave&&A.value.events.datapointLeave({datapoint:t,seriesIndex:e+W.value.start}),D.value=void 0,tn.value=!1,k.value=null,yn.value=`pointer`}rt(()=>C.selectedXIndex,e=>{if([null,void 0].includes(C.selectedXIndex)){D.value=null;return}let t=e-W.value.start;t<0||e>=W.value.end?D.value=null:D.value=t??null},{immediate:!0});function Ir(e,t,r=`pointer`){A.value.events.datapointEnter&&A.value.events.datapointEnter({datapoint:t,seriesIndex:e+W.value.start}),D.value=e,k.value=e,yn.value=r,Nr.value={datapoint:t,seriesIndex:e,series:Q.value,config:A.value},ki({seriesIndex:e,datapoint:t});let a=P.value.tooltip.customFormat;if(i(a)&&oe(()=>a({seriesIndex:e,datapoint:t,series:Q.value,config:A.value})))nn.value=a({seriesIndex:e,datapoint:t,series:Q.value,config:A.value});else if(P.value.tooltip.show){let r=``,{period:i,open:a,high:o,low:s,close:c,volume:l,isBullish:ee}=Q.value[e],{period:te,open:u,high:ne,low:re,close:ie,volume:ae}=A.value.translations,oe=M.value.xAxis.dataLabels.datetimeFormatter.enable?P.value.tooltip.useDefaultTimeFormat?$.value[e].text:Or.value[e].text:i;r+=`<div><svg style="margin-right:6px" viewBox="0 0 12 12" height="12" width="12"><rect x="0" y="0" height="12" width="12" rx="${j.value.borderRadius*3}" stroke="${j.value.stroke}" stroke-width="${j.value.strokeWidth}"
2
2
  fill="${j.value.gradient.show?ee?`url(#bullish_gradient_${E.value})`:`url(#bearish_gradient_${E.value})`:ee?j.value.colors.bullish:j.value.colors.bearish}"/></svg>${oe}</div>`,r+=`${ae} : <b>${isNaN(l)?`-`:Number(l.toFixed(P.value.tooltip.roundingValue)).toLocaleString()}</b>`,r+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${P.value.tooltip.borderColor}">`;let se=n({p:P.value.tooltip.prefix,v:a.value,s:P.value.tooltip.suffix,r:P.value.tooltip.roundingValue}),ce=n({p:P.value.tooltip.prefix,v:o.value,s:P.value.tooltip.suffix,r:P.value.tooltip.roundingValue}),le=n({p:P.value.tooltip.prefix,v:s.value,s:P.value.tooltip.suffix,r:P.value.tooltip.roundingValue}),ue=n({p:P.value.tooltip.prefix,v:c.value,s:P.value.tooltip.suffix,r:P.value.tooltip.roundingValue});P.value.tooltip.showChart?r+=`<div style="width:100%;display:flex;align-items:center;justify-content:center;">
3
3
  <svg viewBox="0 0 100 100" width="100px" style="background: transparent; overflow: visible">
4
4
  <g>
@@ -19,4 +19,4 @@ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO
19
19
  <g>
20
20
  </svg>
21
21
  <div>
22
- `:(r+=`<div>${u}: <b>${se}</b></div>`,r+=`<div>${ne}: <b>${ce}</b></div>`,r+=`<div>${re}: <b>${le}</b></div>`,r+=`<div>${ie}: <b>${ue}</b></div>`),r+=`</div>`,nn.value=`<div style="text-align:right">${r}</div>`}tn.value=!0}let Lr=v(null);function Rr(){return new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(()=>e())))}Ze(()=>{Lr.value&&cancelAnimationFrame(Lr.value),or(),yi()});async function zr({force:e=!1,publish:t=!1}={}){let n=!e;Ur(n),await Je(),Lr.value&&cancelAnimationFrame(Lr.value),Lr.value=requestAnimationFrame(async()=>{await Rr(),Ur(n),Lr.value=null,t&&(ar({start:Number(W.value.start),end:Number(W.value.end)}),w(`zoomReset`))})}let Br=v(!1),Vr=v(!1),Hr=v(!1);rt([()=>C.zoomState,Vr],([e,t])=>{t&&e&&sr(e)},{deep:!0,immediate:!0});function Ur(e=!0){if(!Br.value){Br.value=!0;try{let{startIndex:t,endIndex:n}=P.value.zoom,r=U.value,i=t??0,a=n==null?r:Math.min(Wr(n+1,i),r);Hr.value=!0,W.value.start=i,W.value.end=a,G.value.start=i,G.value.end=a,lr(),Vr.value=!0,e&&C.zoomState&&sr(C.zoomState)}finally{queueMicrotask(()=>{Hr.value=!1}),Br.value=!1}}}function Wr(e,t=W.value.start){let n=U.value,r=Number(t);return e>n?n:e<0||e<=r?Math.min(r+1,n):e}function Gr(e=null){Je(()=>{let t=[A.value.translations.period,A.value.translations.open,A.value.translations.high,A.value.translations.low,A.value.translations.close,A.value.translations.volume],n=Q.value.map((e,t)=>[M.value.xAxis.dataLabels.datetimeFormatter.enable?$.value[t].text:e.period,e.open.value,e.high.value,e.low.value,e.close.value,e.volume]),i=[[P.value.title.text],[P.value.title.subtitle.text],[[``],[``],[``]],t].concat(n),a=r(i);e?e(a):ae({csvContent:a,title:P.value.title.text||`vue-ui-candlestick`})})}let Kr=f(()=>{let e=Q.value.map((e,t)=>{let r=M.value.xAxis.dataLabels.datetimeFormatter.enable?$.value?.[t]?.text??``:e.period,i=n({p:A.value.table.td.prefix,v:e.open.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),a=n({p:A.value.table.td.prefix,v:e.high.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),o=n({p:A.value.table.td.prefix,v:e.low.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),s=n({p:A.value.table.td.prefix,v:e.close.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue});return[`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" height="12" width="12" style="margin-right: 6px"><rect x="0" y="0" height="12" width="12" rx="${j.value.borderRadius*3}" fill="${j.value.gradient.show?e.isBullish?`url(#bullish_gradient_${E.value})`:`url(#bearish_gradient_${E.value})`:e.isBullish?j.value.colors.bullish:j.value.colors.bearish}"/></svg> ${r}`,i,a,o,s,`${isNaN(e.volume)?`-`:e.volume.toLocaleString()}`]}),t=Q.value.map((e,t)=>[M.value.xAxis.dataLabels.datetimeFormatter.enable?$.value?.[t]?.text??``:e.period,n({p:A.value.table.td.prefix,v:e.open.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),n({p:A.value.table.td.prefix,v:e.high.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),n({p:A.value.table.td.prefix,v:e.low.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),n({p:A.value.table.td.prefix,v:e.close.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),`${isNaN(e.volume)?`-`:e.volume}`]),r={th:{backgroundColor:A.value.table.th.backgroundColor,color:A.value.table.th.color,outline:A.value.table.th.outline},td:{backgroundColor:A.value.table.td.backgroundColor,color:A.value.table.td.color,outline:A.value.table.td.outline},breakpoint:A.value.table.responsiveBreakpoint},i=[A.value.translations.period,A.value.translations.open,A.value.translations.high,A.value.translations.low,A.value.translations.last,A.value.translations.volume];return{head:i,body:e,bodyA11y:t,config:r,colNames:i}}),qr=v(!1);function Jr(e){qr.value=e,rn.value+=1}function Yr(){B.value.showTable=!B.value.showTable}function Xr(){B.value.showTooltip=!B.value.showTooltip}let Zr=v(!1);function Qr(){Zr.value=!Zr.value}async function $r({scale:e=2}={}){if(!O.value)return;let{imageUri:t,base64:n}=await ve({domElement:O.value,base64:!0,img:!0,scale:e}),r=O.value.getBoundingClientRect(),i={width:r.width,height:r.height,aspectRatio:r.height?r.width/r.height:0},a=await ee(t,e)??i;return{imageUri:t,base64:n,title:P.value.title.text,...a}}let ei=f(()=>z.value.width),ti=f(()=>z.value.height);Ne({timeLabelsEls:mn,timeLabels:$,slicer:W,configRef:A,rotationPath:[`style`,`layout`,`grid`,`xAxis`,`dataLabels`,`rotation`],autoRotatePath:[`style`,`layout`,`grid`,`xAxis`,`dataLabels`,`autoRotate`,`enable`],isAutoSize:!1,rotation:M.value.xAxis.dataLabels.autoRotate.angle,width:ei,height:ti}),rt(A,()=>{B.value={showTable:A.value.table.show,showTooltip:P.value.tooltip.show}},{immediate:!0});let ni=f(()=>Se({config:A,style:P,mutableConfig:B,dialog:qt,accordion:Ht,isFullscreen:qr,parent:O,maxWidth:800,isCursorPointer:Sn}));rt(()=>B.value.showTable,e=>xe(e,A,hn));function ri(){B.value.showTable=!1,gn.value&&gn.value.setTableIconState(!1)}let ii=f(()=>P.value.backgroundColor),ai=f(()=>P.value.title),{isCallbackImaging:oi,isCallbackSvg:si,generateSvg:ci,onGenerateImage:li}=be({svg:R,title:ai,legend:null,legendItems:null,backgroundColor:ii,getSvgCallback:()=>A.value.userOptions.callbacks.svg,generateImage:zn});function ui(e){_n.value=e}function di(e){tr={...tr,...e},er&&cancelAnimationFrame(er),er=requestAnimationFrame(()=>{let e={...W.value,...tr};tr={},er=null,W.value=e,G.value={...e},lr(),ar({start:Number(W.value.start),end:Number(W.value.end)})})}function fi(e){if(Br.value||Hr.value)return;let t=Number(e);Number.isFinite(t)&&(w(`zoomStart`,{index:t,isZoom:t!==0}),t!==W.value.start&&di({start:t}))}function pi(e){if(Br.value||Hr.value)return;let t=tr.start===void 0?W.value.start:tr.start,n=Wr(Number(e),t);Number.isFinite(n)&&(w(`zoomEnd`,{index:n,isZoom:n!==U.value}),(n!==W.value.end||tr.start!==void 0)&&di({end:n}))}function mi(e){let t=R.value;if(!t)return null;if(t.createSVGPoint&&t.getScreenCTM){let n=t.createSVGPoint();n.x=e.clientX,n.y=e.clientY;let r=t.getScreenCTM();if(r){let e=n.matrixTransform(r.inverse());return{x:e.x,y:e.y}}}let n=t.getBoundingClientRect(),r=t.viewBox?.baseVal||{x:0,y:0,width:n.width,height:n.height},i=Math.min(n.width/r.width,n.height/r.height);if(!Number.isFinite(i)||i<=0)return null;let a=r.width*i,o=r.height*i,s=(n.width-a)/2,c=(n.height-o)/2;return{x:(e.clientX-n.left-s)/i+r.x,y:(e.clientY-n.top-c)/i+r.y}}let hi=f(()=>!Jn.value||Xn.value==null||K.value==null?null:{x:Math.min(Xn.value,K.value),y:H.value.top,width:Math.abs(K.value-Xn.value),height:H.value.height}),gi=f(()=>Vr.value?Number(W.value.start)!==0||Number(W.value.end)!==Number(U.value):!1);function _i(e){return Math.min(Math.max(e,H.value.left),H.value.right)}function vi(){D.value=void 0,k.value=null,yn.value=`pointer`,tn.value=!1,_n.value=null}function yi(e){let t=e?.pointerId==null?q.value:e.pointerId;t!=null&&R.value?.hasPointerCapture?.(t)&&R.value.releasePointerCapture(t),Jn.value=!1,Xn.value=null,K.value=null,q.value=null}function bi(){Zn.value=!0,setTimeout(()=>{Zn.value=!1},0)}function xi(e){Zn.value&&(Zn.value=!1,e.preventDefault(),e.stopPropagation())}function Si(e){if(!J.value||!gi.value||!e)return!1;let t=Date.now(),n=e.pointerType||`mouse`,r=Qn.value,i=n===`touch`?450:350,a=n===`touch`?28:10,o=Math.hypot(e.clientX-r.x,e.clientY-r.y);return r.time>0&&r.pointerType===n&&t-r.time<=i&&o<=a?(Qn.value={time:0,x:0,y:0,pointerType:null},bi(),yi(e),zr({force:!0,publish:!0}),!0):(Qn.value={time:t,x:e.clientX,y:e.clientY,pointerType:n},!1)}function Ci(e){let t=Number(W.value.end)-Number(W.value.start);if(t<=0||!Number.isFinite(X.value)||X.value<=0)return null;let n=Math.floor((_i(e)-H.value.left)/X.value);return Math.max(0,Math.min(t-1,n))}function wi(e,t){let n=Ci(e),r=Ci(t);if(n==null||r==null)return null;let i=Math.min(n,r),a=Math.max(n,r);return a<=i?null:{start:Number(W.value.start)+i,end:Number(W.value.start)+a+1}}function Ti(e){let t=cr(e);return t?(w(`zoomStart`,{index:t.start,isZoom:t.start!==0}),w(`zoomEnd`,{index:t.end,isZoom:t.end!==U.value}),t):null}function Ei(e){if(!J.value||Zr.value||e.button!==void 0&&e.button!==0||q.value!=null&&e.pointerId!==q.value)return;let t=mi(e);if(!t)return;let{left:n,right:r,top:i,bottom:a}=H.value;if(t.x<n||t.x>r||t.y<i||t.y>a||Number(W.value.end)-Number(W.value.start)<=1)return;Yn.value=!0,R.value?.focus?.({preventScroll:!0}),vi();let o=_i(t.x);q.value=e.pointerId,Jn.value=!0,Xn.value=o,K.value=o}function Di(e){if(!J.value||!Jn.value||q.value!=null&&e.pointerId!==q.value)return;let t=mi(e);t&&(K.value=_i(t.x),vi(),Xn.value!=null&&Math.abs(K.value-Xn.value)>=2&&!R.value?.hasPointerCapture?.(e.pointerId)&&R.value?.setPointerCapture?.(e.pointerId))}function Oi(e){if(!J.value||!Jn.value||q.value!=null&&e.pointerId!==q.value)return;let t=mi(e);t&&(K.value=_i(t.x));let n=Xn.value,r=K.value;if((n==null||r==null?0:Math.abs(r-n))<Math.max(4,H.value.width*.01)){if(Si(e))return;yi(e);return}let i=wi(Math.min(n,r),Math.max(n,r));i?(yi(e),Ti(i)&&(Qn.value={time:0,x:0,y:0,pointerType:null},vi(),bi())):yi(e)}function ki({seriesIndex:e,datapoint:t}){let n=W.value.start+e;w(`selectX`,{dataset:t,index:n,indexLabel:``})}async function Ai(){w(`copyAlt`,{config:A.value,dataset:Q.value}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:Q.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function ji(){k.value=null,bn.value=!0}function Mi(){Yn.value=!1,k.value=null,yn.value=`pointer`,tn.value=!1,D.value=void 0,bn.value=!1}function Ni(e){if(!R.value||Zr.value||document.activeElement!==R.value||(Yn.value=!1,!Q.value.length))return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){if(J.value&&(gi.value||Jn.value)){yi(),zr({force:!0,publish:!0});return}k.value=null,yn.value=`pointer`,tn.value=!1,D.value=void 0;return}if(r){if(k.value===null)return;let e=Q.value[k.value];if(!e)return;Pr(k.value,e);return}let a=k.value,o=D.value,s=a!==null&&a>=0&&a<Q.value.length,c=o!=null&&o>=0&&o<Q.value.length;s?n?(a+=1,a>=Q.value.length&&(a=0)):t&&(--a,a<0&&(a=Q.value.length-1)):c?(a=n?o+1:o-1,a>=Q.value.length&&(a=0),a<0&&(a=Q.value.length-1)):a=n?0:Q.value.length-1;let l=Q.value[a];l&&(Pi(a),Ir(a,l,`keyboard`))}function Pi(e){if(!Number.isFinite(e)||!R.value)return;let t=H.value.left+X.value*e+X.value/2,n=H.value.top+H.value.height/2,r=R.value.getBoundingClientRect();vn.value={x:r.left+t/z.value.width*r.width,y:r.top+n/z.value.height*r.height}}let Fi=f(()=>({headers:Kr.value?.colNames??[],rows:Kr.value?.bodyA11y??[]}));return he({getImage:$r,generatePdf:Rn,generateCsv:Gr,generateImage:zn,generateSvg:ci,toggleTable:Yr,toggleTooltip:Xr,toggleAnnotator:Qr,toggleFullscreen:Jr,copyAlt:Ai,resetZoom:()=>zr({force:!0,publish:!0}),setZoomState:cr}),rt(()=>[z.value,M.value,A.value.style.fontFamily,C.dataset,W.value.start,W.value.end,$.value,xr.value,Qt.value,pn.value,mn.value],Un,{flush:`post`,deep:!0}),(e,t)=>(_(),m(`div`,{ref_key:`candlestickChart`,ref:O,class:g(`vue-data-ui-component vue-ui-candlestick ${qr.value?`vue-data-ui-wrapper-fullscreen`:``} ${A.value.useCssAnimation?``:`vue-ui-dna`}`),style:Xe(`position:relative;font-family:${P.value.fontFamily}; text-align:center;background:${P.value.backgroundColor}; ${A.value.responsive?`height: 100%`:``}`),id:`vue-ui-candlestick_${E.value}`,onMouseenter:On,onMouseleave:kn},[h(`div`,{id:`chart-instructions-${E.value}`,class:`sr-only`},[h(`p`,null,tt(A.value.a11y.translations.keyboardNavigation),1)],8,st),Fi.value?.rows?.length?(_(),Ve(Le,{key:0,uid:E.value,head:Fi.value.headers,body:Fi.value.rows,notice:A.value.a11y.translations.tableAvailable,caption:A.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):p(``,!0),F.value.buttons.annotator?(_(),Ve(x(Wt),{key:1,svgRef:x(R),backgroundColor:P.value.backgroundColor,color:P.value.color,active:Zr.value,isCursorPointer:Sn.value,palette:F.value.annotatorPalette,onClose:Qr},He({_:2},[y(x(we),t=>({name:t,fn:S(n=>[b(e.$slots,t,Ye(Ke(x(Ce)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):p(``,!0),Bn.value?(_(),m(`div`,{key:2,ref_key:`noTitle`,ref:ln,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):p(``,!0),P.value.title.text?(_(),m(`div`,{key:3,ref_key:`chartTitle`,ref:an,style:`width:100%;background:transparent`},[(_(),Ve(ye,{key:`title_${fn.value}`,config:{title:{cy:`candlestick-div-title`,...P.value.title},subtitle:{cy:`candlestick-div-subtitle`,...P.value.title.subtitle}}},null,8,[`config`]))],512)):p(``,!0),F.value.show&&Zt.value&&(x(Dn)||x(Tn))?(_(),Ve(x(Gt),{ref_key:`userOptionsRef`,ref:gn,key:`user_options_${rn.value}`,backgroundColor:P.value.backgroundColor,color:P.value.color,isImaging:x(Ln),isPrinting:x(In),uid:E.value,hasTooltip:F.value.buttons.tooltip&&P.value.tooltip.show,hasPdf:F.value.buttons.pdf,hasImg:F.value.buttons.img,hasSvg:F.value.buttons.svg,hasXls:F.value.buttons.csv,hasTable:F.value.buttons.table,hasFullscreen:F.value.buttons.fullscreen,hasAltCopy:F.value.buttons.altCopy,isFullscreen:qr.value,isTooltip:B.value.showTooltip,titles:{...F.value.buttonTitles},chartElement:O.value,position:F.value.position,hasAnnotator:F.value.buttons.annotator,isAnnotation:Zr.value,callbacks:F.value.callbacks,printScale:F.value.print.scale,tableDialog:A.value.table.useDialog,isCursorPointer:Sn.value,onToggleFullscreen:Jr,onGeneratePdf:x(Rn),onGenerateCsv:Gr,onGenerateImage:x(li),onGenerateSvg:x(ci),onToggleTable:Yr,onToggleTooltip:Xr,onToggleAnnotator:Qr,onCopyAlt:Ai,style:Xe({visibility:x(Dn)?x(Tn)?`visible`:`hidden`:`visible`})},He({_:2},[y(x(Te)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:S(n=>[b(e.$slots,t,Ye(Ke(x(Ee)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isImaging.isPrinting.uid.hasTooltip.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasFullscreen.hasAltCopy.isFullscreen.isTooltip.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):p(``,!0),h(`div`,ct,[(_(),m(`svg`,{ref_key:`svgRef`,ref:R,xmlns:x(ce),"aria-describedby":`chart-instructions-${E.value}`,class:g({"vue-data-ui-fullscreen--on":qr.value,"vue-data-ui-fulscreen--off":!qr.value,"vue-data-ui-no-transition":!x(xn)||x(V),"vue-ui-candlestick-chart-zoom-pointer-focus":J.value&&Yn.value}),viewBox:`0 0 ${z.value.width<=0?10:z.value.width} ${z.value.height<=0?10:z.value.height}`,style:Xe({maxWidth:`100%`,visibility:x(Hn)?`visible`:`hidden`,overflow:`visible`,background:`transparent`,color:P.value.color,cursor:J.value?Jn.value?`col-resize`:`crosshair`:void 0,touchAction:J.value?`pan-y`:void 0,userSelect:J.value?`none`:void 0}),tabindex:`0`,onFocus:ji,onBlur:Mi,onKeydown:Ni,onPointerdown:Ei,onPointermove:Di,onPointerup:Oi,onPointercancel:yi,onClickCapture:xi},[We(x(Kt)),b(e.$slots,`svg-underlayer`,{svg:{...z.value,data:Q.value,drawingArea:H.value,isPrintingImg:x(In)||x(Ln)||x(oi),isPrintingSvg:x(si)}},void 0,!0),e.$slots[`chart-background`]?(_(),m(`foreignObject`,{key:0,x:H.value.left,y:H.value.top,width:Math.max(.1,H.value.width),height:Math.max(.1,H.value.height),style:{pointerEvents:`none`}},[b(e.$slots,`chart-background`,{},void 0,!0)],8,ut)):p(``,!0),Q.value.length>0?(_(),m(`g`,dt,[h(`defs`,null,[We(Fe,{t:`linear`,id:`bearish_gradient_${E.value}`,x2:`0%`,y2:`100%`,stops:[[`0%`,j.value.colors.bearish,1],[`50%`,x(c)(j.value.colors.bearish,.02),.87],[`100%`,x(c)(j.value.colors.bearish,.05),.4]]},null,8,[`id`,`stops`]),We(Fe,{t:`linear`,id:`bullish_gradient_${E.value}`,x2:`0%`,y2:`100%`,stops:[[`0%`,j.value.colors.bullish,1],[`50%`,x(c)(j.value.colors.bullish,.02),.87],[`100%`,x(c)(j.value.colors.bullish,.05),.4]]},null,8,[`id`,`stops`])]),M.value.show?(_(),m(`g`,ft,[h(`line`,{x1:Gn.value?H.value.right:H.value.left,x2:Gn.value?H.value.right:H.value.left,y1:H.value.top,y2:H.value.bottom,stroke:M.value.stroke,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`},null,8,pt),h(`line`,{x1:H.value.left,x2:H.value.right,y1:H.value.bottom,y2:H.value.bottom,stroke:M.value.stroke,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`},null,8,mt),M.value.horizontalLines.show?(_(!0),m(d,{key:0},y(yr.value,e=>(_(),m(`line`,{x1:H.value.left,x2:H.value.right,y1:e.y,y2:e.y,stroke:M.value.horizontalLines.stroke,"stroke-width":M.value.horizontalLines.strokeWidth,"stroke-dasharray":M.value.horizontalLines.strokeDasharray,"stroke-linecap":`round`},null,8,ht))),256)):p(``,!0),M.value.verticalLines.show?(_(!0),m(d,{key:1},y(jr.value,(e,t)=>(_(),m(`g`,null,[e.text?(_(),m(`line`,{key:0,x1:H.value.left+X.value*t+X.value/2,x2:H.value.left+X.value*t+X.value/2,y1:H.value.top,y2:H.value.bottom,stroke:M.value.verticalLines.stroke,"stroke-width":M.value.verticalLines.strokeWidth,"stroke-dasharray":M.value.verticalLines.strokeDasharray,"stroke-linecap":`round`},null,8,gt)):p(``,!0)]))),256)):p(``,!0),M.value.xAxis.ticks.show?(_(!0),m(d,{key:2},y(jr.value,(e,t)=>(_(),m(`g`,null,[e.text?(_(),m(`line`,{key:0,x1:H.value.left+X.value*t+X.value/2,x2:H.value.left+X.value*t+X.value/2,y1:H.value.bottom,y2:H.value.bottom+3,stroke:M.value.stroke,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`},null,8,_t)):p(``,!0)]))),256)):p(``,!0)])):p(``,!0),M.value.yAxis.dataLabels.show?(_(),m(`g`,{key:1,ref_key:`scaleLabels`,ref:pn},[(_(!0),m(d,null,y(yr.value,(e,t)=>(_(),m(`g`,{key:`sl_${t}`},[e.value>=Z.value.min&&e.value<=Z.value.max?(_(),m(`line`,{key:0,x1:Gn.value?H.value.right:H.value.left,x2:Gn.value?H.value.right+5:H.value.left-5,y1:e.y,y2:e.y,stroke:M.value.stroke,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`},null,8,vt)):p(``,!0),e.value>=Z.value.min&&e.value<=Z.value.max?(_(),m(`text`,{key:1,class:g({"vue-data-ui-transition":x(xn)&&!x(V)}),transform:`translate(${Gn.value?H.value.right+8+M.value.yAxis.dataLabels.offsetX:H.value.left-8+M.value.yAxis.dataLabels.offsetX}, ${e.y+z.value.yAxisFontSize/3})`,"text-anchor":Gn.value?`start`:`end`,"font-size":z.value.yAxisFontSize,fill:M.value.yAxis.dataLabels.color,"font-weight":M.value.yAxis.dataLabels.bold?`bold`:`normal`},tt(x(n)({p:M.value.yAxis.dataLabels.prefix,v:e.value,s:M.value.yAxis.dataLabels.suffix,r:M.value.yAxis.dataLabels.roundingValue})),11,yt)):p(``,!0)]))),128))],512)):p(``,!0),M.value.xAxis.dataLabels.show&&!M.value.xAxis.dataLabels.datetimeFormatter.enable?(_(),m(`g`,{key:2,ref_key:`timeLabelsEls`,ref:mn},[(_(!0),m(d,null,y(br.value,(e,t)=>(_(),m(`g`,null,[h(`text`,{class:`vue-data-ui-time-label`,transform:`translate(${H.value.left+X.value*t+X.value/2}, ${H.value.bottom+z.value.xAxisFontSize*1.5}), rotate(${M.value.xAxis.dataLabels.rotation})`,"text-anchor":M.value.xAxis.dataLabels.rotation>0?`start`:M.value.xAxis.dataLabels.rotation<0?`end`:`middle`,"font-size":z.value.xAxisFontSize,fill:M.value.xAxis.dataLabels.color,"font-weight":M.value.xAxis.dataLabels.bold?`bold`:`normal`},tt(e),9,bt)]))),256))],512)):p(``,!0),M.value.xAxis.dataLabels.show&&M.value.xAxis.dataLabels.datetimeFormatter.enable?(_(),m(`g`,{key:3,ref_key:`timeLabelsEls`,ref:mn},[(_(!0),m(d,null,y(jr.value,(e,t)=>(_(),m(`g`,null,[h(`text`,{class:`vue-data-ui-time-label`,transform:`translate(${H.value.left+X.value*t+X.value/2}, ${H.value.bottom+z.value.xAxisFontSize*1.5}), rotate(${M.value.xAxis.dataLabels.rotation})`,"text-anchor":M.value.xAxis.dataLabels.rotation>0?`start`:M.value.xAxis.dataLabels.rotation<0?`end`:`middle`,"font-size":z.value.xAxisFontSize,fill:M.value.xAxis.dataLabels.color,stroke:P.value.backgroundColor,"stroke-width":`3`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"paint-order":`stroke fill`,"font-weight":M.value.xAxis.dataLabels.bold?`bold`:`normal`},tt(e?.text??``),9,xt)]))),256))],512)):p(``,!0),A.value.type===`candlestick`?(_(),m(d,{key:4},[h(`g`,null,[(_(!0),m(d,null,y(Q.value,(e,t)=>(_(),m(`g`,null,[h(`rect`,{x:e.open.x-N.value.wick.strokeWidth/2,y:e.high.y,width:N.value.wick.strokeWidth,height:Math.abs(e.high.y-e.low.y),fill:N.value.wick.stroke,stroke:`none`,rx:N.value.wick.strokeWidth/2,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(V)})},null,10,St),N.value.wick.extremity.shape===`circle`?(_(),m(`g`,Ct,[h(`circle`,{cx:e.high.x,cy:e.high.y,r:N.value.wick.extremity.size===`auto`?X.value/20:N.value.wick.extremity.size,fill:N.value.wick.extremity.color,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(V)})},null,10,wt),h(`circle`,{cx:e.low.x,cy:e.low.y,r:N.value.wick.extremity.size===`auto`?X.value/20:N.value.wick.extremity.size,fill:N.value.wick.extremity.color,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(V)})},null,10,Tt)])):p(``,!0),N.value.wick.extremity.shape===`line`?(_(),m(`g`,Et,[h(`rect`,{x:e.high.x-(N.value.wick.extremity.size===`auto`?X.value*N.value.candle.widthRatio:N.value.wick.extremity.size)/2,y:e.high.y-N.value.wick.strokeWidth/2,width:Math.abs(e.high.x-(N.value.wick.extremity.size===`auto`?X.value*P.value.layout.candle.widthRatio:P.value.layout.wick.extremity.size)/2-(e.high.x+(P.value.layout.wick.extremity.size===`auto`?X.value*P.value.layout.candle.widthRatio:P.value.layout.wick.extremity.size)/2)),height:N.value.wick.strokeWidth,rx:N.value.wick.strokeWidth/2,fill:N.value.wick.extremity.color,stroke:`none`,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(V)})},null,10,Dt),h(`rect`,{x:e.low.x-(N.value.wick.extremity.size===`auto`?X.value*N.value.candle.widthRatio:N.value.wick.extremity.size)/2,y:e.low.y-N.value.wick.strokeWidth/2,width:Math.abs(e.low.x-(N.value.wick.extremity.size===`auto`?X.value*P.value.layout.candle.widthRatio:P.value.layout.wick.extremity.size)/2-(e.low.x+(P.value.layout.wick.extremity.size===`auto`?X.value*P.value.layout.candle.widthRatio:P.value.layout.wick.extremity.size)/2)),height:N.value.wick.strokeWidth,fill:N.value.wick.extremity.color,stroke:`none`,rx:N.value.wick.strokeWidth/2,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(V)})},null,10,Ot)])):p(``,!0)]))),256))]),h(`g`,null,[(_(!0),m(d,null,y(Q.value,(e,t)=>(_(),m(`rect`,{x:e.open.x-X.value/2+X.value*(1-j.value.widthRatio)/2,y:e.isBullish?e.close.y:e.open.y,height:Math.abs(e.close.y-e.open.y)<=0?1e-4:Math.abs(e.close.y-e.open.y),width:X.value*j.value.widthRatio<=0?1e-4:X.value*j.value.widthRatio,fill:j.value.gradient.underlayer,rx:j.value.borderRadius,stroke:`none`,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(V)})},null,10,kt))),256)),(_(!0),m(d,null,y(Q.value,(e,t)=>(_(),m(`rect`,{x:e.open.x-X.value/2+X.value*(1-j.value.widthRatio)/2,y:e.isBullish?e.close.y:e.open.y,height:Math.abs(e.close.y-e.open.y)<=0?1e-4:Math.abs(e.close.y-e.open.y),width:X.value*j.value.widthRatio<=0?1e-4:X.value*j.value.widthRatio,fill:e.isBullish?j.value.gradient.show?`url(#bullish_gradient_${E.value})`:j.value.colors.bullish:j.value.gradient.show?`url(#bearish_gradient_${E.value})`:j.value.colors.bearish,rx:j.value.borderRadius,stroke:j.value.stroke,"stroke-width":j.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(V)})},null,10,At))),256))])],64)):p(``,!0),A.value.type===`ohlc`?(_(!0),m(d,{key:5},y(Q.value,(e,t)=>(_(),m(`g`,{key:`ohlc_${e.absoluteIndex}`},[h(`path`,{d:`M ${e.high.x},${e.high.y} ${e.low.x},${e.low.y} M${e.open.x-Math.min(6,X.value/3)},${e.open.y} ${e.open.x},${e.open.y} M${e.close.x},${e.close.y} ${e.close.x+Math.min(6,X.value/3)},${e.close.y}`,stroke:e.isBullish?j.value.colors.bullish:j.value.colors.bearish,"stroke-width":1,class:g({"vue-data-ui-transition":x(xn)&&!x(V)}),"stroke-linecap":`round`,"stroke-linejoin":`round`},null,10,jt)]))),128)):p(``,!0),h(`g`,null,[(_(!0),m(d,null,y(Q.value,(e,t)=>(_(),m(`rect`,{x:H.value.left+t*X.value,y:H.value.top,height:H.value.height<=0?1e-4:H.value.height,width:X.value<=0?1e-4:X.value,fill:D.value===t||_n.value===t?x(a)(N.value.selector.color,N.value.selector.opacity):`transparent`,onMouseover:()=>Ir(t,e,`pointer`),onMouseleave:()=>Fr(t,e),onClick:()=>Pr(t,e)},null,40,Mt))),256))])])):p(``,!0),hi.value?(_(),m(`rect`,{key:2,x:hi.value.x,y:hi.value.y,width:hi.value.width,height:hi.value.height,fill:$n.value.selection.fill,"fill-opacity":$n.value.selection.fillOpacity,stroke:$n.value.selection.stroke,"stroke-opacity":$n.value.selection.strokeOpacity,"stroke-width":$n.value.selection.strokeWidth,"stroke-dasharray":$n.value.selection.strokeDasharray,"stroke-linecap":`round`,"stroke-linejoin":`round`,"pointer-events":`none`},null,8,Nt)):p(``,!0),nr.value?(_(),m(`rect`,qe({key:3},qn.value,{"data-start":W.value.start,"data-end":W.value.end}),null,16,Pt)):p(``,!0),b(e.$slots,`svg`,{svg:{...z.value,data:Q.value,drawingArea:H.value,isPrintingImg:x(In)||x(Ln)||x(oi),isPrintingSvg:x(si)}},void 0,!0)],46,lt)),e.$slots.hint?(_(),m(`div`,Ft,[b(e.$slots,`hint`,Ye(Ke({hint:A.value.a11y.translations.keyboardNavigation,isVisible:bn.value})),void 0,!0)])):p(``,!0)]),e.$slots.watermark?(_(),m(`div`,It,[b(e.$slots,`watermark`,Ye(Ke({isPrinting:x(In)||x(Ln)||x(oi)||x(si)})),void 0,!0)])):p(``,!0),P.value.zoom.show&&U.value>6&&Zt.value&&Vr.value?(_(),Ve(Ie,{key:6,ref_key:`chartSlicer`,ref:sn,"data-dom-to-png-ignore-layout":``,allMinimaps:_r.value,background:P.value.zoom.color,borderColor:P.value.backgroundColor,customFormat:P.value.zoom.customFormat,cutNullValues:!1,enableRangeHandles:P.value.zoom.enableRangeHandles,enableSelectionDrag:P.value.zoom.enableSelectionDrag,end:W.value.end,focusOnDrag:P.value.zoom.focusOnDrag,focusRangeRatio:P.value.zoom.focusRangeRatio,fontSize:P.value.zoom.fontSize,immediate:!P.value.zoom.preview.enable,inputColor:P.value.zoom.color,isPreview:nr.value,labelLeft:Mr.value.start||``,labelRight:Mr.value.end||``,max:U.value,min:0,minimap:P.value.zoom.minimap.show?x(L).map(e=>e[2]):[],minimapCompact:P.value.zoom.minimap.compact,minimapFrameColor:P.value.zoom.minimap.frameColor,minimapIndicatorColor:P.value.zoom.minimap.indicatorColor,minimapMerged:!1,minimapSelectedColor:P.value.zoom.minimap.selectedColor,minimapSelectedColorOpacity:P.value.zoom.minimap.selectedColorOpacity,minimapSelectedIndex:D.value,minimapSelectionRadius:1,preciseLabels:kr.value,refreshEndPoint:P.value.zoom.endIndex===null?U.value:P.value.zoom.endIndex+1,refreshStartPoint:P.value.zoom.startIndex===null?0:P.value.zoom.startIndex,selectColor:P.value.zoom.highlightColor,selectedSeries:x(L),smoothMinimap:!1,start:W.value.start,textColor:P.value.color,timeLabels:Sr.value,usePreciseLabels:M.value.xAxis.dataLabels.datetimeFormatter.enable&&!P.value.zoom.useDefaultFormat,useResetSlot:P.value.zoom.useResetSlot,valueEnd:W.value.end,valueStart:W.value.start,verticalHandles:P.value.zoom.minimap.verticalHandles,minScale:M.value.yAxis.scale.min,maxScale:M.value.yAxis.scale.max,maxWidth:P.value.zoom.maxWidth,minimapLeftInsetRatio:z.value.width>0&&P.value.zoom.autoFit?H.value.left/z.value.width:null,minimapRightInsetRatio:z.value.width>0&&P.value.zoom.autoFit?(z.value.width-H.value.right)/z.value.width:null,additionalMinimapHeight:P.value.zoom.minimap.additionalHeight,handleType:P.value.zoom.minimap.handleType,handleIconColor:P.value.zoom.minimap.handleIconColor,handleBorderWidth:P.value.zoom.minimap.handleBorderWidth,handleBorderColor:P.value.zoom.minimap.handleBorderColor,handleFill:P.value.zoom.minimap.handleFill,handleWidth:P.value.zoom.minimap.handleWidth,"onUpdate:end":pi,"onUpdate:start":fi,onTrapMouse:ui,onReset:t[0]||=()=>zr({force:!0,publish:!0}),onFutureEnd:t[1]||=e=>rr(`end`,e),onFutureStart:t[2]||=e=>rr(`start`,e)},{"reset-action":S(({reset:t})=>[b(e.$slots,`reset-action`,Ye(Ke({reset:t})),void 0,!0)]),slotMap:S(({height:e,unitW:t})=>[(_(!0),m(d,null,y(gr.value({minimapH:e,unitW:t}),(e,n)=>(_(),m(`g`,null,[h(`path`,{d:`M ${e.high.x},${e.high.y} ${e.low.x},${e.low.y}`,stroke:e.isBullish?j.value.colors.bullish:j.value.colors.bearish,"stroke-width":1,style:Xe({opacity:n>=G.value.start&&n<=G.value.end?1:.6})},null,12,Lt),h(`path`,{d:`M ${e.open.x},${e.open.y} ${e.close.x},${e.close.y}`,stroke:e.isBullish?j.value.colors.bullish:j.value.colors.bearish,"stroke-width":Math.min(6,t/1.5),style:Xe({opacity:n>=G.value.start&&n<=G.value.end?1:.6})},null,12,Rt)]))),256))]),_:3},8,/* @__PURE__ */ `allMinimaps.background.borderColor.customFormat.enableRangeHandles.enableSelectionDrag.end.focusOnDrag.focusRangeRatio.fontSize.immediate.inputColor.isPreview.labelLeft.labelRight.max.minimap.minimapCompact.minimapFrameColor.minimapIndicatorColor.minimapSelectedColor.minimapSelectedColorOpacity.minimapSelectedIndex.preciseLabels.refreshEndPoint.refreshStartPoint.selectColor.selectedSeries.start.textColor.timeLabels.usePreciseLabels.useResetSlot.valueEnd.valueStart.verticalHandles.minScale.maxScale.maxWidth.minimapLeftInsetRatio.minimapRightInsetRatio.additionalMinimapHeight.handleType.handleIconColor.handleBorderWidth.handleBorderColor.handleFill.handleWidth`.split(`.`))):p(``,!0),h(`div`,{ref_key:`chartLegend`,ref:on},[b(e.$slots,`legend`,{legend:Q.value},void 0,!0)],512),e.$slots.source?(_(),m(`div`,{key:7,ref_key:`source`,ref:cn,dir:`auto`},[b(e.$slots,`source`,{},void 0,!0)],512)):p(``,!0),We(x(Vt),{teleportTo:P.value.tooltip.teleportTo,show:B.value.showTooltip&&tn.value,backgroundColor:P.value.tooltip.backgroundColor,color:P.value.tooltip.color,borderRadius:P.value.tooltip.borderRadius,borderColor:P.value.tooltip.borderColor,borderWidth:P.value.tooltip.borderWidth,fontSize:P.value.tooltip.fontSize,backgroundOpacity:P.value.tooltip.backgroundOpacity,position:P.value.tooltip.position,offsetX:P.value.tooltip.offsetX,offsetY:P.value.tooltip.offsetY,parent:O.value,content:nn.value,isFullscreen:qr.value,isCustom:P.value.tooltip.customFormat&&typeof P.value.tooltip.customFormat==`function`,smooth:P.value.tooltip.smooth,backdropFilter:P.value.tooltip.backdropFilter,smoothForce:P.value.tooltip.smoothForce,smoothSnapThreshold:P.value.tooltip.smoothSnapThreshold,isA11yMode:yn.value===`keyboard`,a11yPosition:vn.value},{"tooltip-before":S(()=>[b(e.$slots,`tooltip-before`,Ye(Ke({...Nr.value})),void 0,!0)]),tooltip:S(()=>[b(e.$slots,`tooltip`,Ye(Ke({...Nr.value})),void 0,!0)]),"tooltip-after":S(()=>[b(e.$slots,`tooltip-after`,Ye(Ke({...Nr.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`]),Zt.value&&F.value.buttons.table?(_(),Ve($e(ni.value.component),qe({key:8},ni.value.props,{ref_key:`tableUnit`,ref:hn,onClose:ri}),He({content:S(()=>[(_(),Ve(x(Ut),{key:`table_${dn.value}`,colNames:Kr.value.colNames,head:Kr.value.head,body:Kr.value.body,config:Kr.value.config,title:A.value.table.useDialog?``:ni.value.title,withCloseButton:!A.value.table.useDialog,isCursorPointer:Sn.value,onClose:ri},{th:S(({th:e})=>[Ue(tt(e),1)]),td:S(({td:e})=>[h(`div`,{innerHTML:e},null,8,zt)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[A.value.table.useDialog?{name:`title`,fn:S(()=>[Ue(tt(ni.value.title),1)]),key:`0`}:void 0,A.value.table.useDialog?{name:`actions`,fn:S(()=>[h(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[3]||=e=>Gr(F.value.callbacks.csv),style:Xe({cursor:Sn.value?`pointer`:`default`})},[We(x(Bt),{name:`fileCsv`,stroke:ni.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):p(``,!0),b(e.$slots,`skeleton`,{},()=>[x(I)?(_(),Ve(fe,{key:0})):p(``,!0)],!0)],46,ot))}},[[`__scopeId`,`data-v-3b361025`]]);export{at as n,Bt as t};
22
+ `:(r+=`<div>${u}: <b>${se}</b></div>`,r+=`<div>${ne}: <b>${ce}</b></div>`,r+=`<div>${re}: <b>${le}</b></div>`,r+=`<div>${ie}: <b>${ue}</b></div>`),r+=`</div>`,nn.value=`<div style="text-align:right">${r}</div>`}tn.value=!0}let Lr=v(null);function Rr(){return new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(()=>e())))}Ze(()=>{Lr.value&&cancelAnimationFrame(Lr.value),or(),yi()});async function zr({force:e=!1,publish:t=!1}={}){let n=!e;Ur(n),await Je(),Lr.value&&cancelAnimationFrame(Lr.value),Lr.value=requestAnimationFrame(async()=>{await Rr(),Ur(n),Lr.value=null,t&&(ar({start:Number(W.value.start),end:Number(W.value.end)}),w(`zoomReset`))})}let Br=v(!1),Vr=v(!1),Hr=v(!1);rt([()=>C.zoomState,Vr],([e,t])=>{t&&e&&sr(e)},{deep:!0,immediate:!0});function Ur(e=!0){if(!Br.value){Br.value=!0;try{let{startIndex:t,endIndex:n}=P.value.zoom,r=U.value,i=t??0,a=n==null?r:Math.min(Wr(n+1,i),r);Hr.value=!0,W.value.start=i,W.value.end=a,G.value.start=i,G.value.end=a,lr(),Vr.value=!0,e&&C.zoomState&&sr(C.zoomState)}finally{queueMicrotask(()=>{Hr.value=!1}),Br.value=!1}}}function Wr(e,t=W.value.start){let n=U.value,r=Number(t);return e>n?n:e<0||e<=r?Math.min(r+1,n):e}function Gr(e=null){Je(()=>{let t=[A.value.translations.period,A.value.translations.open,A.value.translations.high,A.value.translations.low,A.value.translations.close,A.value.translations.volume],n=Q.value.map((e,t)=>[M.value.xAxis.dataLabels.datetimeFormatter.enable?$.value[t].text:e.period,e.open.value,e.high.value,e.low.value,e.close.value,e.volume]),i=[[P.value.title.text],[P.value.title.subtitle.text],[[``],[``],[``]],t].concat(n),a=r(i);e?e(a):ae({csvContent:a,title:P.value.title.text||`vue-ui-candlestick`})})}let Kr=f(()=>{let e=Q.value.map((e,t)=>{let r=M.value.xAxis.dataLabels.datetimeFormatter.enable?$.value?.[t]?.text??``:e.period,i=n({p:A.value.table.td.prefix,v:e.open.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),a=n({p:A.value.table.td.prefix,v:e.high.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),o=n({p:A.value.table.td.prefix,v:e.low.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),s=n({p:A.value.table.td.prefix,v:e.close.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue});return[`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" height="12" width="12" style="margin-right: 6px"><rect x="0" y="0" height="12" width="12" rx="${j.value.borderRadius*3}" fill="${j.value.gradient.show?e.isBullish?`url(#bullish_gradient_${E.value})`:`url(#bearish_gradient_${E.value})`:e.isBullish?j.value.colors.bullish:j.value.colors.bearish}"/></svg> ${r}`,i,a,o,s,`${isNaN(e.volume)?`-`:e.volume.toLocaleString()}`]}),t=Q.value.map((e,t)=>[M.value.xAxis.dataLabels.datetimeFormatter.enable?$.value?.[t]?.text??``:e.period,n({p:A.value.table.td.prefix,v:e.open.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),n({p:A.value.table.td.prefix,v:e.high.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),n({p:A.value.table.td.prefix,v:e.low.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),n({p:A.value.table.td.prefix,v:e.close.value,s:A.value.table.td.suffix,r:A.value.table.td.roundingValue}),`${isNaN(e.volume)?`-`:e.volume}`]),r={th:{backgroundColor:A.value.table.th.backgroundColor,color:A.value.table.th.color,outline:A.value.table.th.outline},td:{backgroundColor:A.value.table.td.backgroundColor,color:A.value.table.td.color,outline:A.value.table.td.outline},breakpoint:A.value.table.responsiveBreakpoint},i=[A.value.translations.period,A.value.translations.open,A.value.translations.high,A.value.translations.low,A.value.translations.last,A.value.translations.volume];return{head:i,body:e,bodyA11y:t,config:r,colNames:i}}),qr=v(!1);function Jr(e){qr.value=e,rn.value+=1}function Yr(){B.value.showTable=!B.value.showTable}function Xr(){B.value.showTooltip=!B.value.showTooltip}let Zr=v(!1);function Qr(){Zr.value=!Zr.value}async function $r({scale:e=2}={}){if(!O.value)return;let{imageUri:t,base64:n}=await ve({domElement:O.value,base64:!0,img:!0,scale:e}),r=O.value.getBoundingClientRect(),i={width:r.width,height:r.height,aspectRatio:r.height?r.width/r.height:0},a=await ee(t,e)??i;return{imageUri:t,base64:n,title:P.value.title.text,...a}}let ei=f(()=>z.value.width),ti=f(()=>z.value.height);Ne({timeLabelsEls:mn,timeLabels:$,slicer:W,configRef:A,rotationPath:[`style`,`layout`,`grid`,`xAxis`,`dataLabels`,`rotation`],autoRotatePath:[`style`,`layout`,`grid`,`xAxis`,`dataLabels`,`autoRotate`,`enable`],isAutoSize:!1,rotation:M.value.xAxis.dataLabels.autoRotate.angle,width:ei,height:ti}),rt(A,()=>{B.value={showTable:A.value.table.show,showTooltip:P.value.tooltip.show}},{immediate:!0});let ni=f(()=>Se({config:A,style:P,mutableConfig:B,dialog:qt,accordion:Ht,isFullscreen:qr,parent:O,maxWidth:800,isCursorPointer:Sn}));rt(()=>B.value.showTable,e=>xe(e,A,hn));function ri(){B.value.showTable=!1,gn.value&&gn.value.setTableIconState(!1)}let ii=f(()=>P.value.backgroundColor),ai=f(()=>P.value.title),{isCallbackImaging:oi,isCallbackSvg:si,generateSvg:ci,onGenerateImage:li}=be({svg:R,title:ai,legend:null,legendItems:null,backgroundColor:ii,getSvgCallback:()=>A.value.userOptions.callbacks.svg,generateImage:zn});function ui(e){_n.value=e}function di(e){tr={...tr,...e},er&&cancelAnimationFrame(er),er=requestAnimationFrame(()=>{let e={...W.value,...tr};tr={},er=null,W.value=e,G.value={...e},lr(),ar({start:Number(W.value.start),end:Number(W.value.end)})})}function fi(e){if(Br.value||Hr.value)return;let t=Number(e);Number.isFinite(t)&&(w(`zoomStart`,{index:t,isZoom:t!==0}),t!==W.value.start&&di({start:t}))}function pi(e){if(Br.value||Hr.value)return;let t=tr.start===void 0?W.value.start:tr.start,n=Wr(Number(e),t);Number.isFinite(n)&&(w(`zoomEnd`,{index:n,isZoom:n!==U.value}),(n!==W.value.end||tr.start!==void 0)&&di({end:n}))}function mi(e){let t=R.value;if(!t)return null;if(t.createSVGPoint&&t.getScreenCTM){let n=t.createSVGPoint();n.x=e.clientX,n.y=e.clientY;let r=t.getScreenCTM();if(r){let e=n.matrixTransform(r.inverse());return{x:e.x,y:e.y}}}let n=t.getBoundingClientRect(),r=t.viewBox?.baseVal||{x:0,y:0,width:n.width,height:n.height},i=Math.min(n.width/r.width,n.height/r.height);if(!Number.isFinite(i)||i<=0)return null;let a=r.width*i,o=r.height*i,s=(n.width-a)/2,c=(n.height-o)/2;return{x:(e.clientX-n.left-s)/i+r.x,y:(e.clientY-n.top-c)/i+r.y}}let hi=f(()=>!Jn.value||Xn.value==null||K.value==null?null:{x:Math.min(Xn.value,K.value),y:H.value.top,width:Math.abs(K.value-Xn.value),height:H.value.height}),gi=f(()=>Vr.value?Number(W.value.start)!==0||Number(W.value.end)!==Number(U.value):!1);function _i(e){return Math.min(Math.max(e,H.value.left),H.value.right)}function vi(){D.value=void 0,k.value=null,yn.value=`pointer`,tn.value=!1,_n.value=null}function yi(e){let t=e?.pointerId==null?q.value:e.pointerId;t!=null&&R.value?.hasPointerCapture?.(t)&&R.value.releasePointerCapture(t),Jn.value=!1,Xn.value=null,K.value=null,q.value=null}function bi(){Zn.value=!0,setTimeout(()=>{Zn.value=!1},0)}function xi(e){Zn.value&&(Zn.value=!1,e.preventDefault(),e.stopPropagation())}function Si(e){if(!J.value||!gi.value||!e)return!1;let t=Date.now(),n=e.pointerType||`mouse`,r=Qn.value,i=n===`touch`?450:350,a=n===`touch`?28:10,o=Math.hypot(e.clientX-r.x,e.clientY-r.y);return r.time>0&&r.pointerType===n&&t-r.time<=i&&o<=a?(Qn.value={time:0,x:0,y:0,pointerType:null},bi(),yi(e),zr({force:!0,publish:!0}),!0):(Qn.value={time:t,x:e.clientX,y:e.clientY,pointerType:n},!1)}function Ci(e){let t=Number(W.value.end)-Number(W.value.start);if(t<=0||!Number.isFinite(X.value)||X.value<=0)return null;let n=Math.floor((_i(e)-H.value.left)/X.value);return Math.max(0,Math.min(t-1,n))}function wi(e,t){let n=Ci(e),r=Ci(t);if(n==null||r==null)return null;let i=Math.min(n,r),a=Math.max(n,r);return a<=i?null:{start:Number(W.value.start)+i,end:Number(W.value.start)+a+1}}function Ti(e){let t=cr(e);return t?(w(`zoomStart`,{index:t.start,isZoom:t.start!==0}),w(`zoomEnd`,{index:t.end,isZoom:t.end!==U.value}),t):null}function Ei(e){if(!J.value||Zr.value||e.button!==void 0&&e.button!==0||q.value!=null&&e.pointerId!==q.value)return;let t=mi(e);if(!t)return;let{left:n,right:r,top:i,bottom:a}=H.value;if(t.x<n||t.x>r||t.y<i||t.y>a||Number(W.value.end)-Number(W.value.start)<=1)return;Yn.value=!0,R.value?.focus?.({preventScroll:!0}),vi();let o=_i(t.x);q.value=e.pointerId,Jn.value=!0,Xn.value=o,K.value=o}function Di(e){if(!J.value||!Jn.value||q.value!=null&&e.pointerId!==q.value)return;let t=mi(e);t&&(K.value=_i(t.x),vi(),Xn.value!=null&&Math.abs(K.value-Xn.value)>=2&&!R.value?.hasPointerCapture?.(e.pointerId)&&R.value?.setPointerCapture?.(e.pointerId))}function Oi(e){if(!J.value||!Jn.value||q.value!=null&&e.pointerId!==q.value)return;let t=mi(e);t&&(K.value=_i(t.x));let n=Xn.value,r=K.value;if((n==null||r==null?0:Math.abs(r-n))<Math.max(4,H.value.width*.01)){if(Si(e))return;yi(e);return}let i=wi(Math.min(n,r),Math.max(n,r));i?(yi(e),Ti(i)&&(Qn.value={time:0,x:0,y:0,pointerType:null},vi(),bi())):yi(e)}function ki({seriesIndex:e,datapoint:t}){let n=W.value.start+e;w(`selectX`,{dataset:t,index:n,indexLabel:``})}async function Ai(){w(`copyAlt`,{config:A.value,dataset:Q.value}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:Q.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function ji(){k.value=null,bn.value=!0}function Mi(){Yn.value=!1,k.value=null,yn.value=`pointer`,tn.value=!1,D.value=void 0,bn.value=!1}function Ni(e){if(!R.value||Zr.value||document.activeElement!==R.value||(Yn.value=!1,!Q.value.length))return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`Enter`||e.key===` `,i=e.key===`Escape`;if(!t&&!n&&!r&&!i)return;if(e.preventDefault(),e.stopPropagation(),i){if(J.value&&(gi.value||Jn.value)){yi(),zr({force:!0,publish:!0});return}k.value=null,yn.value=`pointer`,tn.value=!1,D.value=void 0;return}if(r){if(k.value===null)return;let e=Q.value[k.value];if(!e)return;Pr(k.value,e);return}let a=k.value,o=D.value,s=a!==null&&a>=0&&a<Q.value.length,c=o!=null&&o>=0&&o<Q.value.length;s?n?(a+=1,a>=Q.value.length&&(a=0)):t&&(--a,a<0&&(a=Q.value.length-1)):c?(a=n?o+1:o-1,a>=Q.value.length&&(a=0),a<0&&(a=Q.value.length-1)):a=n?0:Q.value.length-1;let l=Q.value[a];l&&(Pi(a),Ir(a,l,`keyboard`))}function Pi(e){if(!Number.isFinite(e)||!R.value)return;let t=H.value.left+X.value*e+X.value/2,n=H.value.top+H.value.height/2,r=R.value.getBoundingClientRect();vn.value={x:r.left+t/z.value.width*r.width,y:r.top+n/z.value.height*r.height}}let Fi=f(()=>({headers:Kr.value?.colNames??[],rows:Kr.value?.bodyA11y??[]}));return he({getImage:$r,generatePdf:Rn,generateCsv:Gr,generateImage:zn,generateSvg:ci,toggleTable:Yr,toggleTooltip:Xr,toggleAnnotator:Qr,toggleFullscreen:Jr,copyAlt:Ai,resetZoom:()=>zr({force:!0,publish:!0}),setZoomState:cr}),rt(()=>[z.value,M.value,A.value.style.fontFamily,C.dataset,W.value.start,W.value.end,$.value,xr.value,Qt.value,pn.value,mn.value],Un,{flush:`post`,deep:!0}),(e,t)=>(_(),m(`div`,{ref_key:`candlestickChart`,ref:O,class:g(`vue-data-ui-component vue-ui-candlestick ${qr.value?`vue-data-ui-wrapper-fullscreen`:``} ${A.value.useCssAnimation?``:`vue-ui-dna`}`),style:Xe(`position:relative;font-family:${P.value.fontFamily}; text-align:center;background:${P.value.backgroundColor}; ${A.value.responsive?`height: 100%`:``}`),id:`vue-ui-candlestick_${E.value}`,onMouseenter:On,onMouseleave:kn},[h(`div`,{id:`chart-instructions-${E.value}`,class:`sr-only`},[h(`p`,null,tt(A.value.a11y.translations.keyboardNavigation),1)],8,st),Fi.value?.rows?.length?(_(),Ve(Le,{key:0,uid:E.value,head:Fi.value.headers,body:Fi.value.rows,notice:A.value.a11y.translations.tableAvailable,caption:A.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):p(``,!0),F.value.buttons.annotator?(_(),Ve(x(Wt),{key:1,svgRef:x(R),backgroundColor:P.value.backgroundColor,color:P.value.color,active:Zr.value,isCursorPointer:Sn.value,palette:F.value.annotatorPalette,onClose:Qr},He({_:2},[y(x(we),t=>({name:t,fn:S(n=>[b(e.$slots,t,Ye(Ke(x(Ce)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):p(``,!0),Bn.value?(_(),m(`div`,{key:2,ref_key:`noTitle`,ref:ln,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},null,512)):p(``,!0),P.value.title.text?(_(),m(`div`,{key:3,ref_key:`chartTitle`,ref:an,style:`width:100%;background:transparent`},[(_(),Ve(ye,{key:`title_${fn.value}`,config:{title:{cy:`candlestick-div-title`,...P.value.title},subtitle:{cy:`candlestick-div-subtitle`,...P.value.title.subtitle}}},null,8,[`config`]))],512)):p(``,!0),F.value.show&&Zt.value&&(x(Dn)||x(Tn))?(_(),Ve(x(Gt),{ref_key:`userOptionsRef`,ref:gn,key:`user_options_${rn.value}`,backgroundColor:P.value.backgroundColor,color:P.value.color,isImaging:x(Ln),isPrinting:x(In),uid:E.value,hasTooltip:F.value.buttons.tooltip&&P.value.tooltip.show,hasPdf:F.value.buttons.pdf,hasImg:F.value.buttons.img,hasSvg:F.value.buttons.svg,hasXls:F.value.buttons.csv,hasTable:F.value.buttons.table,hasFullscreen:F.value.buttons.fullscreen,hasAltCopy:F.value.buttons.altCopy,isFullscreen:qr.value,isTooltip:B.value.showTooltip,titles:{...F.value.buttonTitles},chartElement:O.value,position:F.value.position,hasAnnotator:F.value.buttons.annotator,isAnnotation:Zr.value,callbacks:F.value.callbacks,printScale:F.value.print.scale,tableDialog:A.value.table.useDialog,isCursorPointer:Sn.value,onToggleFullscreen:Jr,onGeneratePdf:x(Rn),onGenerateCsv:Gr,onGenerateImage:x(li),onGenerateSvg:x(ci),onToggleTable:Yr,onToggleTooltip:Xr,onToggleAnnotator:Qr,onCopyAlt:Ai,style:Xe({visibility:x(Dn)?x(Tn)?`visible`:`hidden`:`visible`})},He({_:2},[y(x(Te)(e.$slots,`menuIcon optionTooltip optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:S(n=>[b(e.$slots,t,Ye(Ke(x(Ee)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isImaging.isPrinting.uid.hasTooltip.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasFullscreen.hasAltCopy.isFullscreen.isTooltip.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):p(``,!0),h(`div`,ct,[(_(),m(`svg`,{ref_key:`svgRef`,ref:R,xmlns:x(ce),"aria-describedby":`chart-instructions-${E.value}`,class:g({"vue-data-ui-fullscreen--on":qr.value,"vue-data-ui-fulscreen--off":!qr.value,"vue-data-ui-no-transition":!x(xn)||x(V),"vue-ui-candlestick-chart-zoom-pointer-focus":J.value&&Yn.value}),viewBox:`0 0 ${z.value.width<=0?10:z.value.width} ${z.value.height<=0?10:z.value.height}`,style:Xe({maxWidth:`100%`,visibility:x(Hn)?`visible`:`hidden`,overflow:`visible`,background:`transparent`,color:P.value.color,cursor:J.value?Jn.value?`col-resize`:`crosshair`:void 0,touchAction:J.value?`pan-y`:void 0,userSelect:J.value?`none`:void 0}),tabindex:`0`,onFocus:ji,onBlur:Mi,onKeydown:Ni,onPointerdown:Ei,onPointermove:Di,onPointerup:Oi,onPointercancel:yi,onClickCapture:xi},[We(x(Kt)),b(e.$slots,`svg-underlayer`,{svg:{...z.value,data:Q.value,drawingArea:H.value,isPrintingImg:x(In)||x(Ln)||x(oi),isPrintingSvg:x(si)}},void 0,!0),e.$slots[`chart-background`]?(_(),m(`foreignObject`,{key:0,x:H.value.left,y:H.value.top,width:Math.max(.1,H.value.width),height:Math.max(.1,H.value.height),style:{pointerEvents:`none`}},[b(e.$slots,`chart-background`,{},void 0,!0)],8,ut)):p(``,!0),Q.value.length>0?(_(),m(`g`,dt,[h(`defs`,null,[We(Fe,{t:`linear`,id:`bearish_gradient_${E.value}`,x2:`0%`,y2:`100%`,stops:[[`0%`,j.value.colors.bearish,1],[`50%`,x(c)(j.value.colors.bearish,.02),.87],[`100%`,x(c)(j.value.colors.bearish,.05),.4]]},null,8,[`id`,`stops`]),We(Fe,{t:`linear`,id:`bullish_gradient_${E.value}`,x2:`0%`,y2:`100%`,stops:[[`0%`,j.value.colors.bullish,1],[`50%`,x(c)(j.value.colors.bullish,.02),.87],[`100%`,x(c)(j.value.colors.bullish,.05),.4]]},null,8,[`id`,`stops`])]),M.value.show?(_(),m(`g`,ft,[h(`line`,{x1:Gn.value?H.value.right:H.value.left,x2:Gn.value?H.value.right:H.value.left,y1:H.value.top,y2:H.value.bottom,stroke:M.value.stroke,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`},null,8,pt),h(`line`,{x1:H.value.left,x2:H.value.right,y1:H.value.bottom,y2:H.value.bottom,stroke:M.value.stroke,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`},null,8,mt),M.value.horizontalLines.show?(_(!0),m(d,{key:0},y(yr.value,e=>(_(),m(`line`,{x1:H.value.left,x2:H.value.right,y1:e.y,y2:e.y,stroke:M.value.horizontalLines.stroke,"stroke-width":M.value.horizontalLines.strokeWidth,"stroke-dasharray":M.value.horizontalLines.strokeDasharray,"stroke-linecap":`round`},null,8,ht))),256)):p(``,!0),M.value.verticalLines.show?(_(!0),m(d,{key:1},y(jr.value,(e,t)=>(_(),m(`g`,null,[e.text?(_(),m(`line`,{key:0,x1:H.value.left+X.value*t+X.value/2,x2:H.value.left+X.value*t+X.value/2,y1:H.value.top,y2:H.value.bottom,stroke:M.value.verticalLines.stroke,"stroke-width":M.value.verticalLines.strokeWidth,"stroke-dasharray":M.value.verticalLines.strokeDasharray,"stroke-linecap":`round`},null,8,gt)):p(``,!0)]))),256)):p(``,!0),M.value.xAxis.ticks.show?(_(!0),m(d,{key:2},y(jr.value,(e,t)=>(_(),m(`g`,null,[e.text?(_(),m(`line`,{key:0,x1:H.value.left+X.value*t+X.value/2,x2:H.value.left+X.value*t+X.value/2,y1:H.value.bottom,y2:H.value.bottom+3,stroke:M.value.stroke,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`},null,8,_t)):p(``,!0)]))),256)):p(``,!0)])):p(``,!0),M.value.yAxis.dataLabels.show?(_(),m(`g`,{key:1,ref_key:`scaleLabels`,ref:pn},[(_(!0),m(d,null,y(yr.value,(e,t)=>(_(),m(`g`,{key:`sl_${t}`},[e.value>=Z.value.min&&e.value<=Z.value.max?(_(),m(`line`,{key:0,x1:Gn.value?H.value.right:H.value.left,x2:Gn.value?H.value.right+5:H.value.left-5,y1:e.y,y2:e.y,stroke:M.value.stroke,"stroke-width":M.value.strokeWidth,"stroke-linecap":`round`},null,8,vt)):p(``,!0),e.value>=Z.value.min&&e.value<=Z.value.max?(_(),m(`text`,{key:1,class:g({"vue-data-ui-transition":x(xn)&&!x(V)}),transform:`translate(${Gn.value?H.value.right+8+M.value.yAxis.dataLabels.offsetX:H.value.left-8+M.value.yAxis.dataLabels.offsetX}, ${e.y+z.value.yAxisFontSize/3})`,"text-anchor":Gn.value?`start`:`end`,"font-size":z.value.yAxisFontSize,fill:M.value.yAxis.dataLabels.color,"font-weight":M.value.yAxis.dataLabels.bold?`bold`:`normal`},tt(x(n)({p:M.value.yAxis.dataLabels.prefix,v:e.value,s:M.value.yAxis.dataLabels.suffix,r:M.value.yAxis.dataLabels.roundingValue})),11,yt)):p(``,!0)]))),128))],512)):p(``,!0),M.value.xAxis.dataLabels.show&&!M.value.xAxis.dataLabels.datetimeFormatter.enable?(_(),m(`g`,{key:2,ref_key:`timeLabelsEls`,ref:mn},[(_(!0),m(d,null,y(br.value,(e,t)=>(_(),m(`g`,null,[h(`text`,{class:`vue-data-ui-time-label`,transform:`translate(${H.value.left+X.value*t+X.value/2}, ${H.value.bottom+z.value.xAxisFontSize*1.5}), rotate(${M.value.xAxis.dataLabels.rotation})`,"text-anchor":M.value.xAxis.dataLabels.rotation>0?`start`:M.value.xAxis.dataLabels.rotation<0?`end`:`middle`,"font-size":z.value.xAxisFontSize,fill:M.value.xAxis.dataLabels.color,"font-weight":M.value.xAxis.dataLabels.bold?`bold`:`normal`},tt(e),9,bt)]))),256))],512)):p(``,!0),M.value.xAxis.dataLabels.show&&M.value.xAxis.dataLabels.datetimeFormatter.enable?(_(),m(`g`,{key:3,ref_key:`timeLabelsEls`,ref:mn},[(_(!0),m(d,null,y(jr.value,(e,t)=>(_(),m(`g`,null,[h(`text`,{class:`vue-data-ui-time-label`,transform:`translate(${H.value.left+X.value*t+X.value/2}, ${H.value.bottom+z.value.xAxisFontSize*1.5}), rotate(${M.value.xAxis.dataLabels.rotation})`,"text-anchor":M.value.xAxis.dataLabels.rotation>0?`start`:M.value.xAxis.dataLabels.rotation<0?`end`:`middle`,"font-size":z.value.xAxisFontSize,fill:M.value.xAxis.dataLabels.color,stroke:P.value.backgroundColor,"stroke-width":`3`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"paint-order":`stroke fill`,"font-weight":M.value.xAxis.dataLabels.bold?`bold`:`normal`},tt(e?.text??``),9,xt)]))),256))],512)):p(``,!0),A.value.type===`candlestick`?(_(),m(d,{key:4},[h(`g`,null,[(_(!0),m(d,null,y(Q.value,(e,t)=>(_(),m(`g`,null,[h(`rect`,{x:e.open.x-N.value.wick.strokeWidth/2,y:e.high.y,width:N.value.wick.strokeWidth,height:Math.abs(e.high.y-e.low.y),fill:N.value.wick.stroke,stroke:`none`,rx:N.value.wick.strokeWidth/2,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(V)})},null,10,St),N.value.wick.extremity.shape===`circle`?(_(),m(`g`,Ct,[h(`circle`,{cx:e.high.x,cy:e.high.y,r:N.value.wick.extremity.size===`auto`?X.value/20:N.value.wick.extremity.size,fill:N.value.wick.extremity.color,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(V)})},null,10,wt),h(`circle`,{cx:e.low.x,cy:e.low.y,r:N.value.wick.extremity.size===`auto`?X.value/20:N.value.wick.extremity.size,fill:N.value.wick.extremity.color,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(V)})},null,10,Tt)])):p(``,!0),N.value.wick.extremity.shape===`line`?(_(),m(`g`,Et,[h(`rect`,{x:e.high.x-(N.value.wick.extremity.size===`auto`?X.value*N.value.candle.widthRatio:N.value.wick.extremity.size)/2,y:e.high.y-N.value.wick.strokeWidth/2,width:Math.abs(e.high.x-(N.value.wick.extremity.size===`auto`?X.value*P.value.layout.candle.widthRatio:P.value.layout.wick.extremity.size)/2-(e.high.x+(P.value.layout.wick.extremity.size===`auto`?X.value*P.value.layout.candle.widthRatio:P.value.layout.wick.extremity.size)/2)),height:N.value.wick.strokeWidth,rx:N.value.wick.strokeWidth/2,fill:N.value.wick.extremity.color,stroke:`none`,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(V)})},null,10,Dt),h(`rect`,{x:e.low.x-(N.value.wick.extremity.size===`auto`?X.value*N.value.candle.widthRatio:N.value.wick.extremity.size)/2,y:e.low.y-N.value.wick.strokeWidth/2,width:Math.abs(e.low.x-(N.value.wick.extremity.size===`auto`?X.value*P.value.layout.candle.widthRatio:P.value.layout.wick.extremity.size)/2-(e.low.x+(P.value.layout.wick.extremity.size===`auto`?X.value*P.value.layout.candle.widthRatio:P.value.layout.wick.extremity.size)/2)),height:N.value.wick.strokeWidth,fill:N.value.wick.extremity.color,stroke:`none`,rx:N.value.wick.strokeWidth/2,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(V)})},null,10,Ot)])):p(``,!0)]))),256))]),h(`g`,null,[(_(!0),m(d,null,y(Q.value,(e,t)=>(_(),m(`rect`,{x:e.open.x-X.value/2+X.value*(1-j.value.widthRatio)/2,y:e.isBullish?e.close.y:e.open.y,height:Math.abs(e.close.y-e.open.y)<=0?1e-4:Math.abs(e.close.y-e.open.y),width:X.value*j.value.widthRatio<=0?1e-4:X.value*j.value.widthRatio,fill:j.value.gradient.underlayer,rx:j.value.borderRadius,stroke:`none`,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(V)})},null,10,kt))),256)),(_(!0),m(d,null,y(Q.value,(e,t)=>(_(),m(`rect`,{x:e.open.x-X.value/2+X.value*(1-j.value.widthRatio)/2,y:e.isBullish?e.close.y:e.open.y,height:Math.abs(e.close.y-e.open.y)<=0?1e-4:Math.abs(e.close.y-e.open.y),width:X.value*j.value.widthRatio<=0?1e-4:X.value*j.value.widthRatio,fill:e.isBullish?j.value.gradient.show?`url(#bullish_gradient_${E.value})`:j.value.colors.bullish:j.value.gradient.show?`url(#bearish_gradient_${E.value})`:j.value.colors.bearish,rx:j.value.borderRadius,stroke:j.value.stroke,"stroke-width":j.value.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:g({"vue-data-ui-transition":T.value&&!x(I)&&!x(V)})},null,10,At))),256))])],64)):p(``,!0),A.value.type===`ohlc`?(_(!0),m(d,{key:5},y(Q.value,(e,t)=>(_(),m(`g`,{key:`ohlc_${e.absoluteIndex}`},[h(`path`,{d:`M ${e.high.x},${e.high.y} ${e.low.x},${e.low.y} M${e.open.x-Math.min(6,X.value/3)},${e.open.y} ${e.open.x},${e.open.y} M${e.close.x},${e.close.y} ${e.close.x+Math.min(6,X.value/3)},${e.close.y}`,stroke:e.isBullish?j.value.colors.bullish:j.value.colors.bearish,"stroke-width":1,class:g({"vue-data-ui-transition":x(xn)&&!x(V)}),"stroke-linecap":`round`,"stroke-linejoin":`round`},null,10,jt)]))),128)):p(``,!0),h(`g`,null,[(_(!0),m(d,null,y(Q.value,(e,t)=>(_(),m(`rect`,{x:H.value.left+t*X.value,y:H.value.top,height:H.value.height<=0?1e-4:H.value.height,width:X.value<=0?1e-4:X.value,fill:D.value===t||_n.value===t?x(a)(N.value.selector.color,N.value.selector.opacity):`transparent`,onMouseover:()=>Ir(t,e,`pointer`),onMouseleave:()=>Fr(t,e),onClick:()=>Pr(t,e)},null,40,Mt))),256))])])):p(``,!0),hi.value?(_(),m(`rect`,{key:2,x:hi.value.x,y:hi.value.y,width:hi.value.width,height:hi.value.height,fill:$n.value.selection.fill,"fill-opacity":$n.value.selection.fillOpacity,stroke:$n.value.selection.stroke,"stroke-opacity":$n.value.selection.strokeOpacity,"stroke-width":$n.value.selection.strokeWidth,"stroke-dasharray":$n.value.selection.strokeDasharray,"stroke-linecap":`round`,"stroke-linejoin":`round`,"pointer-events":`none`},null,8,Nt)):p(``,!0),nr.value?(_(),m(`rect`,qe({key:3},qn.value,{"data-start":W.value.start,"data-end":W.value.end}),null,16,Pt)):p(``,!0),b(e.$slots,`svg`,{svg:{...z.value,data:Q.value,drawingArea:H.value,isPrintingImg:x(In)||x(Ln)||x(oi),isPrintingSvg:x(si)}},void 0,!0)],46,lt)),e.$slots.hint?(_(),m(`div`,Ft,[b(e.$slots,`hint`,Ye(Ke({hint:A.value.a11y.translations.keyboardNavigation,isVisible:bn.value})),void 0,!0)])):p(``,!0)]),e.$slots.watermark?(_(),m(`div`,It,[b(e.$slots,`watermark`,Ye(Ke({isPrinting:x(In)||x(Ln)||x(oi)||x(si)})),void 0,!0)])):p(``,!0),P.value.zoom.show&&U.value>6&&Zt.value&&Vr.value?(_(),Ve(Ie,{key:6,ref_key:`chartSlicer`,ref:sn,"data-dom-to-png-ignore-layout":``,allMinimaps:_r.value,background:P.value.zoom.color,borderColor:P.value.backgroundColor,customFormat:P.value.zoom.customFormat,cutNullValues:!1,enableRangeHandles:P.value.zoom.enableRangeHandles,enableSelectionDrag:P.value.zoom.enableSelectionDrag,end:W.value.end,focusOnDrag:P.value.zoom.focusOnDrag,focusRangeRatio:P.value.zoom.focusRangeRatio,fontSize:P.value.zoom.fontSize,immediate:!P.value.zoom.preview.enable,inputColor:P.value.zoom.color,isPreview:nr.value,labelLeft:Mr.value.start||``,labelRight:Mr.value.end||``,max:U.value,min:0,minimap:P.value.zoom.minimap.show?x(L).map(e=>e[2]):[],minimapCompact:P.value.zoom.minimap.compact,minimapFrameColor:P.value.zoom.minimap.frameColor,minimapIndicatorColor:P.value.zoom.minimap.indicatorColor,minimapMerged:!1,minimapSelectedColor:P.value.zoom.minimap.selectedColor,minimapSelectedColorOpacity:P.value.zoom.minimap.selectedColorOpacity,minimapSelectedIndex:D.value,minimapSelectionRadius:1,preciseLabels:kr.value,refreshEndPoint:P.value.zoom.endIndex===null?U.value:P.value.zoom.endIndex+1,refreshStartPoint:P.value.zoom.startIndex===null?0:P.value.zoom.startIndex,selectColor:P.value.zoom.highlightColor,selectedSeries:x(L),smoothMinimap:!1,start:W.value.start,textColor:P.value.color,timeLabels:Sr.value,usePreciseLabels:M.value.xAxis.dataLabels.datetimeFormatter.enable&&!P.value.zoom.useDefaultFormat,useResetSlot:P.value.zoom.useResetSlot,valueEnd:W.value.end,valueStart:W.value.start,verticalHandles:P.value.zoom.minimap.verticalHandles,minScale:M.value.yAxis.scale.min,maxScale:M.value.yAxis.scale.max,maxWidth:P.value.zoom.maxWidth,minimapLeftInsetRatio:z.value.width>0&&P.value.zoom.autoFit?H.value.left/z.value.width:null,minimapRightInsetRatio:z.value.width>0&&P.value.zoom.autoFit?(z.value.width-H.value.right)/z.value.width:null,additionalMinimapHeight:P.value.zoom.minimap.additionalHeight,handleType:P.value.zoom.minimap.handleType,handleIconColor:P.value.zoom.minimap.handleIconColor,handleBorderWidth:P.value.zoom.minimap.handleBorderWidth,handleBorderColor:P.value.zoom.minimap.handleBorderColor,handleFill:P.value.zoom.minimap.handleFill,handleWidth:P.value.zoom.minimap.handleWidth,"onUpdate:end":pi,"onUpdate:start":fi,onTrapMouse:ui,onReset:t[0]||=()=>zr({force:!0,publish:!0}),onFutureEnd:t[1]||=e=>rr(`end`,e),onFutureStart:t[2]||=e=>rr(`start`,e)},{"reset-action":S(({reset:t})=>[b(e.$slots,`reset-action`,Ye(Ke({reset:t})),void 0,!0)]),slotMap:S(({height:e,unitW:t})=>[(_(!0),m(d,null,y(gr.value({minimapH:e,unitW:t}),(e,n)=>(_(),m(`g`,null,[h(`path`,{d:`M ${e.high.x},${e.high.y} ${e.low.x},${e.low.y}`,stroke:e.isBullish?j.value.colors.bullish:j.value.colors.bearish,"stroke-width":1,style:Xe({opacity:n>=G.value.start&&n<=G.value.end?1:.6})},null,12,Lt),h(`path`,{d:`M ${e.open.x},${e.open.y} ${e.close.x},${e.close.y}`,stroke:e.isBullish?j.value.colors.bullish:j.value.colors.bearish,"stroke-width":Math.min(6,t/1.5),style:Xe({opacity:n>=G.value.start&&n<=G.value.end?1:.6})},null,12,Rt)]))),256))]),_:3},8,/* @__PURE__ */ `allMinimaps.background.borderColor.customFormat.enableRangeHandles.enableSelectionDrag.end.focusOnDrag.focusRangeRatio.fontSize.immediate.inputColor.isPreview.labelLeft.labelRight.max.minimap.minimapCompact.minimapFrameColor.minimapIndicatorColor.minimapSelectedColor.minimapSelectedColorOpacity.minimapSelectedIndex.preciseLabels.refreshEndPoint.refreshStartPoint.selectColor.selectedSeries.start.textColor.timeLabels.usePreciseLabels.useResetSlot.valueEnd.valueStart.verticalHandles.minScale.maxScale.maxWidth.minimapLeftInsetRatio.minimapRightInsetRatio.additionalMinimapHeight.handleType.handleIconColor.handleBorderWidth.handleBorderColor.handleFill.handleWidth`.split(`.`))):p(``,!0),h(`div`,{ref_key:`chartLegend`,ref:on},[b(e.$slots,`legend`,{legend:Q.value},void 0,!0)],512),e.$slots.source?(_(),m(`div`,{key:7,ref_key:`source`,ref:cn,dir:`auto`},[b(e.$slots,`source`,{},void 0,!0)],512)):p(``,!0),We(x(Vt),{teleportTo:P.value.tooltip.teleportTo,show:B.value.showTooltip&&tn.value,backgroundColor:P.value.tooltip.backgroundColor,color:P.value.tooltip.color,borderRadius:P.value.tooltip.borderRadius,borderColor:P.value.tooltip.borderColor,borderWidth:P.value.tooltip.borderWidth,fontSize:P.value.tooltip.fontSize,backgroundOpacity:P.value.tooltip.backgroundOpacity,position:P.value.tooltip.position,offsetX:P.value.tooltip.offsetX,offsetY:P.value.tooltip.offsetY,parent:O.value,content:nn.value,isFullscreen:qr.value,isCustom:P.value.tooltip.customFormat&&typeof P.value.tooltip.customFormat==`function`,smooth:P.value.tooltip.smooth,backdropFilter:P.value.tooltip.backdropFilter,smoothForce:P.value.tooltip.smoothForce,smoothSnapThreshold:P.value.tooltip.smoothSnapThreshold,isA11yMode:yn.value===`keyboard`,a11yPosition:vn.value},{"tooltip-before":S(()=>[b(e.$slots,`tooltip-before`,Ye(Ke({...Nr.value})),void 0,!0)]),tooltip:S(()=>[b(e.$slots,`tooltip`,Ye(Ke({...Nr.value})),void 0,!0)]),"tooltip-after":S(()=>[b(e.$slots,`tooltip-after`,Ye(Ke({...Nr.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`]),Zt.value&&F.value.buttons.table?(_(),Ve($e(ni.value.component),qe({key:8},ni.value.props,{ref_key:`tableUnit`,ref:hn,onClose:ri}),He({content:S(()=>[(_(),Ve(x(Ut),{key:`table_${dn.value}`,colNames:Kr.value.colNames,head:Kr.value.head,body:Kr.value.body,config:Kr.value.config,title:A.value.table.useDialog?``:ni.value.title,withCloseButton:!A.value.table.useDialog,isCursorPointer:Sn.value,onClose:ri},{th:S(({th:e})=>[Ue(tt(e),1)]),td:S(({td:e})=>[h(`div`,{innerHTML:e},null,8,zt)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[A.value.table.useDialog?{name:`title`,fn:S(()=>[Ue(tt(ni.value.title),1)]),key:`0`}:void 0,A.value.table.useDialog?{name:`actions`,fn:S(()=>[h(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[3]||=e=>Gr(F.value.callbacks.csv),style:Xe({cursor:Sn.value?`pointer`:`default`})},[We(x(Bt),{name:`fileCsv`,stroke:ni.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):p(``,!0),b(e.$slots,`skeleton`,{},()=>[x(I)?(_(),Ve(fe,{key:0})):p(``,!0)],!0)],46,ot))}},[[`__scopeId`,`data-v-0981f9b6`]]);export{at as n,Bt as t};
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{D as n,Jt as r,X as i,at as a,nt as ee,zt as o}from"./lib-rPeBMZrn.js";import{n as te,t as ne}from"./useHints-BH9r_0Vd.js";import{t as re}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as ie}from"./useNestedProp-DnGoh-XS.js";import{n as ae,t as oe}from"./userOptionsSlots-DYuo-E5m.js";import{t as se}from"./usePrinter-sVoTzet1.js";import{t as ce}from"./useUserOptionState-CXlFnwPv.js";import{t as le}from"./usePrefersMotion-XLHwega2.js";import{Fragment as s,computed as c,createBlock as ue,createCommentVNode as l,createElementBlock as u,createElementVNode as d,createSlots as de,createTextVNode as f,defineAsyncComponent as fe,guardReactiveProps as pe,mergeProps as me,nextTick as he,normalizeClass as ge,normalizeProps as _e,normalizeStyle as p,onBeforeUnmount as m,onMounted as h,openBlock as g,ref as _,renderList as v,renderSlot as y,shallowRef as ve,toDisplayString as b,unref as x,useSlots as ye,watch as S,withCtx as be}from"vue";var C=/* @__PURE__ */ e({default:()=>w}),xe=[`id`],Se=[`aria-labelledby`],Ce=[`id`],we=[`height`],Te=[`id`],Ee=[`data-cell`,`aria-label`,`height`],De={key:2,ref:`source`,dir:`auto`},w=/*#__PURE__*/ re({__name:`vue-ui-carousel-table`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:re,emit:C}){let w=fe(()=>import(`./vue-ui-skeleton-DqmhigQ0.js`).then(e=>e.n)),Oe=fe(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),{vue_ui_carousel_table:ke}=t(),Ae=le(),T=e,je=C,E=_(i()),Me=_(!1),D=_(!!T.dataset),Ne=ye();h(()=>{Pe()});let O=c({get:()=>N(),set:e=>e}),k=c(()=>O.value.debug);h(()=>{Ne[`chart-background`]&&k.value&&console.warn(`VueUiCarouselTable does not support the #chart-background slot.`)});function Pe(){o(T.dataset)?a({componentName:`VueUiCarouselTable`,type:`dataset`,debug:k.value}):((!T.dataset.head||o(T.dataset.head))&&(a({componentName:`VueUiCarouselTable`,type:`datasetAttribute`,property:`head`,debug:k.value}),D.value=!1),(!T.dataset.body||o(T.dataset.body))&&(a({componentName:`VueUiCarouselTable`,type:`datasetAttribute`,property:`body`,debug:k.value}),D.value=!1)),Ae.value&&(O.value.userOptions.buttons.animation=!1)}te({config:()=>O.value,dataset:()=>T.dataset,component:`VueUiCarouselTable`,rules:[ne.noHint]});let Fe=c(()=>O.value.userOptions.useCursorPointer),{userOptionsVisible:A,setUserOptionsVisibility:j,keepUserOptionState:M}=ce({config:O.value});function N(){return ie({userConfig:T.config,defaultConfig:ke})}S(()=>T.config,e=>{O.value=N(),A.value=!O.value.userOptions.showOnChartHover,Pe()},{deep:!0}),S(()=>T.dataset,e=>{G()},{deep:!0});let{isPrinting:P,isImaging:Ie,generatePdf:Le,generateImage:Re}=se({elementId:`carousel-table_${E.value}`,fileName:O.value.caption.text||`vue-ui-carousel-table`,options:O.value.userOptions.print}),F=_({showAnimation:O.value.animation.use}),I=_(null),ze=_(null),L=_(null),R=_(null),z=_(0),B=_(0),V=_(!1),H=_(null),U=_(null),W=_(0);function G(){H.value&&(U.value={elements:H.value.getElementsByTagName(`tr`),heights:Array.from(H.value.getElementsByTagName(`tr`)).map(e=>e.getBoundingClientRect().height)})}h(G);let Be=c(()=>!U.value||!U.value.heights.length?0:Math.max(...U.value.heights)+z.value+B.value),Ve=c(()=>T.dataset.body?O.value.tbody.tr.visible<=T.dataset.body.length?O.value.tbody.tr.visible:T.dataset.body.length:0),He=c(()=>(O.value.tbody.tr.height+O.value.tbody.tr.td.padding.top+O.value.tbody.tr.td.padding.bottom+O.value.tbody.tr.border.size*2)*Ve.value+z.value+B.value),K=_(0),q=_(null),J=_(0),Y=_(!1),Ue=_(0);h(()=>{L.value&&(z.value=L.value.getBoundingClientRect().height),R.value&&(B.value=R.value.getBoundingClientRect().height),F.value.showAnimation&&U.value&&Ge()}),h(()=>{if(I.value){let e=I.value.querySelector(`thead`),t=Array.from(H.value.querySelectorAll(`tr`));function n(){let n=e.getBoundingClientRect().bottom;t.forEach(e=>{e.getBoundingClientRect().top<n?e.style.visibility=`hidden`:e.style.visibility=`visible`})}I.value.addEventListener(`scroll`,n),n(),m(()=>{I.value.removeEventListener(`scroll`,n)})}});function We(e){Me.value=e,Ue.value+=1}function Ge(){Ae.value||!q.value&&!Y.value&&(O.value.animation.type===`scroll`?q.value=requestAnimationFrame(qe):q.value=requestAnimationFrame(Je))}function Ke(){if(!I.value)return!1;let{scrollTop:e,scrollHeight:t,clientHeight:n}=I.value;return e+n>=t}function qe(e){Y.value||(J.value||=e,e-J.value>=O.value.animation.speedMs&&(K.value+=U.value.heights[W.value],(Ke()||W.value>=U.value.heights.length)&&(K.value=0,W.value=-1),W.value+=1,I.value&&I.value.scrollTo({top:K.value,behavior:`smooth`}),J.value=e),q.value=requestAnimationFrame(qe))}function Je(e){if(Y.value)return;J.value||=e;let t=e-J.value,n=O.value.animation.speedMs/4/1e3;t>=n&&(K.value+=n,K.value>=I.value.scrollHeight-I.value.clientHeight&&(K.value=0),I.value&&I.value.scrollTo({top:K.value,behavior:`auto`}),J.value=e),q.value=requestAnimationFrame(Je)}function X(){Y.value=!0,cancelAnimationFrame(q.value),q.value=null}m(X);function Z(){Y.value&&F.value.showAnimation&&(Y.value=!1,J.value=0,Ge())}function Ye(){O.value.animation.pauseOnHover&&X()}let Q=_(null);function Xe(){X(),clearTimeout(Q.value)}function Ze(){clearTimeout(Q.value),Q.value=setTimeout(Z,1e3)}S(()=>O.value.animation.use,e=>{e?(F.value.showAnimation=!0,Z()):(F.value.showAnimation=!1,X())}),S(()=>O.value.animation.type,e=>{X(),K.value=0,W.value=0,I.value.scrollTo({top:0,behavior:`auto`}),Z()});let Qe=c(()=>O.value.responsiveBreakpoint),$=ve(null);h(()=>{$.value=new ResizeObserver(e=>{e.forEach(e=>{V.value=e.contentRect.width<Qe.value}),z.value=L.value?L.value.getBoundingClientRect().height:0,B.value=R.value?R.value.getBoundingClientRect().height:0,W.value=0,he(()=>{X(),J.value=0,K.value=0,G(),Z()})}),I.value&&$.value.observe(I.value)}),m(()=>{$.value&&$.value.disconnect()});function $e(){Le()}function et(){F.value.showAnimation=!F.value.showAnimation,F.value.showAnimation?Z():X()}function tt(e=null){he(()=>{let t=T.dataset.head.map((e,t)=>[[T.dataset.body[t]]]),r=[[O.value.caption.text],[T.dataset.head.map(e=>[e])]].concat(t),i=n(r);e?e(i):ee({csvContent:i,title:O.value.caption.text||`vue-ui-carousel-table`})})}async function nt(){je(`copyAlt`,{config:O.value,dataset:T.dataset}),O.value.userOptions.callbacks.altCopy?await Promise.resolve(O.value.userOptions.callbacks.altCopy({config:O.value,dataset:T.dataset})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}return re({pauseAnimation:X,resumeAnimation:Z,toggleAnimation:et,generateCsv:tt,generatePdf:$e,generateImage:Re,copyAlt:nt}),(t,n)=>(g(),u(`div`,{class:`vue-data-ui-component vue-ui-carousel-table`,style:{position:`relative`,overflow:`visible`},ref_key:`chartContainer`,ref:ze,onMouseenter:n[5]||=()=>x(j)(!0),onMouseleave:n[6]||=()=>x(j)(!1)},[d(`div`,{ref_key:`tableContainer`,ref:I,id:`carousel-table_${E.value}`,style:p({height:x(P)||x(Ie)?`auto`:`${Math.max(He.value,Be.value)}px`,containerType:`inline-size`,position:`relative`,overflow:`auto`,fontFamily:O.value.fontFamily}),class:ge({"vue-ui-responsive":V.value,"is-playing":O.value.scrollbar.hide||!Y.value&&O.value.scrollbar.showOnlyOnHover}),onMouseover:n[0]||=e=>Ye(),onMouseleave:n[1]||=e=>Z(),onTouchstart:n[2]||=e=>Xe(),onTouchend:n[3]||=e=>Ze(),onTouchcancel:n[4]||=e=>Ze()},[D.value?(g(),u(`table`,{key:0,class:`vue-data-ui-carousel-table`,"aria-labelledby":`carousel-caption-${E.value}`,style:p({...O.value.style,border:`${O.value.border.size}px solid ${O.value.border.color}`,width:`100%`,borderCollapse:`collapse`,backgroundColor:O.value.tbody.backgroundColor})},[d(`caption`,{ref_key:`caption`,ref:L,class:`vue-data-ui-carousel-table-caption`,id:`carousel-caption-${E.value}`,style:p({...O.value.caption.style,fontFamily:`inherit`,position:`sticky`,top:0,zIndex:2,paddingTop:O.value.caption.padding.top+`px`,paddingRight:O.value.caption.padding.right+`px`,paddingBottom:O.value.caption.padding.bottom+`px`,paddingLeft:O.value.caption.padding.left+`px`,boxShadow:V.value?O.value.thead.tr.style.boxShadow:`none`,minHeight:`36px`,display:t.$slots.caption||O.value.caption.text||O.value.userOptions.show?``:`none`})},[f(b(O.value.caption.text&&!t.$slots.caption?O.value.caption.text:``)+` `,1),y(t.$slots,`caption`,{},void 0,!0)],12,Ce),d(`thead`,{role:`rowgroup`,style:p({...O.value.thead.style,position:`sticky`,top:`${t.$slots.caption||O.value.caption.text||O.value.userOptions.show?z.value:0}px`,zIndex:1})},[d(`tr`,{ref_key:`tableRow`,ref:R,role:`row`,style:p({...O.value.thead.tr.style,border:O.value.thead.tr.border.size?`${O.value.thead.tr.border.size}px solid ${O.value.thead.tr.border.color}`:`none`,boxShadow:V.value?`none`:O.value.thead.tr.style.boxShadow}),height:`${O.value.thead.tr.height}px`},[(g(!0),u(s,null,v(e.dataset.head,(e,n)=>(g(),u(`th`,{role:`cell`,key:`th_${n}`,id:`col-${n}`,scope:`col`,style:p({...O.value.thead.tr.th.style,border:O.value.thead.tr.th.border.size?`${O.value.thead.tr.th.border.size}px solid ${O.value.thead.tr.th.border.color}`:`none`,paddingTop:O.value.thead.tr.th.padding.top+`px`,paddingRight:O.value.thead.tr.th.padding.right+`px`,paddingBottom:O.value.thead.tr.th.padding.bottom+`px`,paddingLeft:O.value.thead.tr.th.padding.left+`px`})},[f(b(t.$slots.th?``:e)+` `,1),y(t.$slots,`th`,me({ref_for:!0},{th:e,colIndex:n}),void 0,!0)],12,Te))),128))],12,we)],4),e.dataset.body&&e.dataset.head?(g(),u(`tbody`,{key:0,ref_key:`tbody`,ref:H,"aria-live":`polite`,style:{clipPath:`inset(0,0,0,0)`}},[(g(!0),u(s,null,v(e.dataset.body,(n,i)=>(g(),u(`tr`,{style:p({...O.value.tbody.tr.style,border:`${O.value.tbody.tr.border.size}px solid ${O.value.tbody.tr.border.color}`,verticalAlign:`middle`})},[(g(!0),u(s,null,v(n,(n,a)=>(g(),u(`td`,{role:`cell`,"data-cell":e.dataset.head[a]||``,"aria-label":`${e.dataset.head[a]}: ${n}`,style:p({...O.value.tbody.tr.td.style,border:`${O.value.tbody.tr.td.border.size}px solid ${O.value.tbody.tr.td.border.color}`,backgroundColor:x(r)(O.value.tbody.tr.td.style.backgroundColor,i%2==0&&O.value.tbody.tr.td.alternateColor?O.value.tbody.tr.td.alternateOpacity*100:100),paddingTop:O.value.tbody.tr.td.padding.top+`px`,paddingRight:O.value.tbody.tr.td.padding.right+`px`,paddingBottom:O.value.tbody.tr.td.padding.bottom+`px`,paddingLeft:O.value.tbody.tr.td.padding.left+`px`,verticalAlign:`middle`}),height:`${O.value.tbody.tr.height}px`},[f(b(t.$slots.td?``:n)+` `,1),y(t.$slots,`td`,me({ref_for:!0},{td:n,rowIndex:i,colIndex:a}),void 0,!0)],12,Ee))),256))],4))),256))],512)):l(``,!0)],12,Se)):l(``,!0)],46,xe),D.value?l(``,!0):(g(),ue(x(w),{key:0,config:{type:`table`}})),O.value.userOptions.show&&D.value&&(x(M)||x(A))?(g(),ue(x(Oe),{ref:`details`,key:`user_option_${Ue.value}`,backgroundColor:O.value.style.backgroundColor,color:O.value.style.color,isPrinting:x(P),isImaging:x(Ie),uid:E.value,hasTooltip:!1,hasPdf:O.value.userOptions.buttons.pdf,hasImg:O.value.userOptions.buttons.img,hasXls:O.value.userOptions.buttons.csv,hasTable:!1,hasLabel:!1,hasAnimation:O.value.userOptions.buttons.animation,isAnimation:!F.value.showAnimation,hasFullscreen:O.value.userOptions.buttons.fullscreen,hasAltCopy:O.value.userOptions.buttons.altCopy,isFullscreen:Me.value,chartElement:ze.value,position:O.value.userOptions.position,titles:{...O.value.userOptions.buttonTitles},zIndex:3,offsetX:12,callbacks:O.value.userOptions.callbacks,printScale:O.value.userOptions.print.scale,isCursorPointer:Fe.value,onGeneratePdf:$e,onGenerateCsv:tt,onGenerateImage:x(Re),onToggleAnimation:et,onToggleFullscreen:We,onCopyAlt:nt,style:p({visibility:x(M)?x(A)?`visible`:`hidden`:`visible`})},de({_:2},[v(x(ae)(t.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionAnimation optionFullscreen optionAltCopy custom-menu-before custom-menu-after`),e=>({name:e,fn:be(n=>[y(t.$slots,e,_e(pe(x(oe)(e,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasPdf`,`hasImg`,`hasXls`,`hasAnimation`,`isAnimation`,`hasFullscreen`,`hasAltCopy`,`isFullscreen`,`chartElement`,`position`,`titles`,`callbacks`,`printScale`,`isCursorPointer`,`onGenerateImage`,`style`])):l(``,!0),t.$slots.source?(g(),u(`div`,De,[y(t.$slots,`source`,{},void 0,!0)],512)):l(``,!0)],544))}},[[`__scopeId`,`data-v-f8c6267a`]]);export{C as n,w as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{D as n,Jt as r,X as i,at as a,nt as ee,zt as o}from"./lib-rPeBMZrn.js";import{n as te,t as ne}from"./useHints-C-TwxM0Y.js";import{t as re}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as ie}from"./useNestedProp-DnGoh-XS.js";import{n as ae,t as oe}from"./userOptionsSlots-DYuo-E5m.js";import{t as se}from"./usePrinter-DVf3YcG5.js";import{t as ce}from"./useUserOptionState-CXlFnwPv.js";import{t as le}from"./usePrefersMotion-XLHwega2.js";import{Fragment as s,computed as c,createBlock as ue,createCommentVNode as l,createElementBlock as u,createElementVNode as d,createSlots as de,createTextVNode as f,defineAsyncComponent as fe,guardReactiveProps as pe,mergeProps as me,nextTick as he,normalizeClass as ge,normalizeProps as _e,normalizeStyle as p,onBeforeUnmount as m,onMounted as h,openBlock as g,ref as _,renderList as v,renderSlot as y,shallowRef as ve,toDisplayString as b,unref as x,useSlots as ye,watch as S,withCtx as be}from"vue";var C=/* @__PURE__ */ e({default:()=>w}),xe=[`id`],Se=[`aria-labelledby`],Ce=[`id`],we=[`height`],Te=[`id`],Ee=[`data-cell`,`aria-label`,`height`],De={key:2,ref:`source`,dir:`auto`},w=/*#__PURE__*/ re({__name:`vue-ui-carousel-table`,props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:[`copyAlt`],setup(e,{expose:re,emit:C}){let w=fe(()=>import(`./vue-ui-skeleton-wyvAru88.js`).then(e=>e.n)),Oe=fe(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),{vue_ui_carousel_table:ke}=t(),Ae=le(),T=e,je=C,E=_(i()),Me=_(!1),D=_(!!T.dataset),Ne=ye();h(()=>{Pe()});let O=c({get:()=>N(),set:e=>e}),k=c(()=>O.value.debug);h(()=>{Ne[`chart-background`]&&k.value&&console.warn(`VueUiCarouselTable does not support the #chart-background slot.`)});function Pe(){o(T.dataset)?a({componentName:`VueUiCarouselTable`,type:`dataset`,debug:k.value}):((!T.dataset.head||o(T.dataset.head))&&(a({componentName:`VueUiCarouselTable`,type:`datasetAttribute`,property:`head`,debug:k.value}),D.value=!1),(!T.dataset.body||o(T.dataset.body))&&(a({componentName:`VueUiCarouselTable`,type:`datasetAttribute`,property:`body`,debug:k.value}),D.value=!1)),Ae.value&&(O.value.userOptions.buttons.animation=!1)}te({config:()=>O.value,dataset:()=>T.dataset,component:`VueUiCarouselTable`,rules:[ne.noHint]});let Fe=c(()=>O.value.userOptions.useCursorPointer),{userOptionsVisible:A,setUserOptionsVisibility:j,keepUserOptionState:M}=ce({config:O.value});function N(){return ie({userConfig:T.config,defaultConfig:ke})}S(()=>T.config,e=>{O.value=N(),A.value=!O.value.userOptions.showOnChartHover,Pe()},{deep:!0}),S(()=>T.dataset,e=>{G()},{deep:!0});let{isPrinting:P,isImaging:Ie,generatePdf:Le,generateImage:Re}=se({elementId:`carousel-table_${E.value}`,fileName:O.value.caption.text||`vue-ui-carousel-table`,options:O.value.userOptions.print}),F=_({showAnimation:O.value.animation.use}),I=_(null),ze=_(null),L=_(null),R=_(null),z=_(0),B=_(0),V=_(!1),H=_(null),U=_(null),W=_(0);function G(){H.value&&(U.value={elements:H.value.getElementsByTagName(`tr`),heights:Array.from(H.value.getElementsByTagName(`tr`)).map(e=>e.getBoundingClientRect().height)})}h(G);let Be=c(()=>!U.value||!U.value.heights.length?0:Math.max(...U.value.heights)+z.value+B.value),Ve=c(()=>T.dataset.body?O.value.tbody.tr.visible<=T.dataset.body.length?O.value.tbody.tr.visible:T.dataset.body.length:0),He=c(()=>(O.value.tbody.tr.height+O.value.tbody.tr.td.padding.top+O.value.tbody.tr.td.padding.bottom+O.value.tbody.tr.border.size*2)*Ve.value+z.value+B.value),K=_(0),q=_(null),J=_(0),Y=_(!1),Ue=_(0);h(()=>{L.value&&(z.value=L.value.getBoundingClientRect().height),R.value&&(B.value=R.value.getBoundingClientRect().height),F.value.showAnimation&&U.value&&Ge()}),h(()=>{if(I.value){let e=I.value.querySelector(`thead`),t=Array.from(H.value.querySelectorAll(`tr`));function n(){let n=e.getBoundingClientRect().bottom;t.forEach(e=>{e.getBoundingClientRect().top<n?e.style.visibility=`hidden`:e.style.visibility=`visible`})}I.value.addEventListener(`scroll`,n),n(),m(()=>{I.value.removeEventListener(`scroll`,n)})}});function We(e){Me.value=e,Ue.value+=1}function Ge(){Ae.value||!q.value&&!Y.value&&(O.value.animation.type===`scroll`?q.value=requestAnimationFrame(qe):q.value=requestAnimationFrame(Je))}function Ke(){if(!I.value)return!1;let{scrollTop:e,scrollHeight:t,clientHeight:n}=I.value;return e+n>=t}function qe(e){Y.value||(J.value||=e,e-J.value>=O.value.animation.speedMs&&(K.value+=U.value.heights[W.value],(Ke()||W.value>=U.value.heights.length)&&(K.value=0,W.value=-1),W.value+=1,I.value&&I.value.scrollTo({top:K.value,behavior:`smooth`}),J.value=e),q.value=requestAnimationFrame(qe))}function Je(e){if(Y.value)return;J.value||=e;let t=e-J.value,n=O.value.animation.speedMs/4/1e3;t>=n&&(K.value+=n,K.value>=I.value.scrollHeight-I.value.clientHeight&&(K.value=0),I.value&&I.value.scrollTo({top:K.value,behavior:`auto`}),J.value=e),q.value=requestAnimationFrame(Je)}function X(){Y.value=!0,cancelAnimationFrame(q.value),q.value=null}m(X);function Z(){Y.value&&F.value.showAnimation&&(Y.value=!1,J.value=0,Ge())}function Ye(){O.value.animation.pauseOnHover&&X()}let Q=_(null);function Xe(){X(),clearTimeout(Q.value)}function Ze(){clearTimeout(Q.value),Q.value=setTimeout(Z,1e3)}S(()=>O.value.animation.use,e=>{e?(F.value.showAnimation=!0,Z()):(F.value.showAnimation=!1,X())}),S(()=>O.value.animation.type,e=>{X(),K.value=0,W.value=0,I.value.scrollTo({top:0,behavior:`auto`}),Z()});let Qe=c(()=>O.value.responsiveBreakpoint),$=ve(null);h(()=>{$.value=new ResizeObserver(e=>{e.forEach(e=>{V.value=e.contentRect.width<Qe.value}),z.value=L.value?L.value.getBoundingClientRect().height:0,B.value=R.value?R.value.getBoundingClientRect().height:0,W.value=0,he(()=>{X(),J.value=0,K.value=0,G(),Z()})}),I.value&&$.value.observe(I.value)}),m(()=>{$.value&&$.value.disconnect()});function $e(){Le()}function et(){F.value.showAnimation=!F.value.showAnimation,F.value.showAnimation?Z():X()}function tt(e=null){he(()=>{let t=T.dataset.head.map((e,t)=>[[T.dataset.body[t]]]),r=[[O.value.caption.text],[T.dataset.head.map(e=>[e])]].concat(t),i=n(r);e?e(i):ee({csvContent:i,title:O.value.caption.text||`vue-ui-carousel-table`})})}async function nt(){je(`copyAlt`,{config:O.value,dataset:T.dataset}),O.value.userOptions.callbacks.altCopy?await Promise.resolve(O.value.userOptions.callbacks.altCopy({config:O.value,dataset:T.dataset})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}return re({pauseAnimation:X,resumeAnimation:Z,toggleAnimation:et,generateCsv:tt,generatePdf:$e,generateImage:Re,copyAlt:nt}),(t,n)=>(g(),u(`div`,{class:`vue-data-ui-component vue-ui-carousel-table`,style:{position:`relative`,overflow:`visible`},ref_key:`chartContainer`,ref:ze,onMouseenter:n[5]||=()=>x(j)(!0),onMouseleave:n[6]||=()=>x(j)(!1)},[d(`div`,{ref_key:`tableContainer`,ref:I,id:`carousel-table_${E.value}`,style:p({height:x(P)||x(Ie)?`auto`:`${Math.max(He.value,Be.value)}px`,containerType:`inline-size`,position:`relative`,overflow:`auto`,fontFamily:O.value.fontFamily}),class:ge({"vue-ui-responsive":V.value,"is-playing":O.value.scrollbar.hide||!Y.value&&O.value.scrollbar.showOnlyOnHover}),onMouseover:n[0]||=e=>Ye(),onMouseleave:n[1]||=e=>Z(),onTouchstart:n[2]||=e=>Xe(),onTouchend:n[3]||=e=>Ze(),onTouchcancel:n[4]||=e=>Ze()},[D.value?(g(),u(`table`,{key:0,class:`vue-data-ui-carousel-table`,"aria-labelledby":`carousel-caption-${E.value}`,style:p({...O.value.style,border:`${O.value.border.size}px solid ${O.value.border.color}`,width:`100%`,borderCollapse:`collapse`,backgroundColor:O.value.tbody.backgroundColor})},[d(`caption`,{ref_key:`caption`,ref:L,class:`vue-data-ui-carousel-table-caption`,id:`carousel-caption-${E.value}`,style:p({...O.value.caption.style,fontFamily:`inherit`,position:`sticky`,top:0,zIndex:2,paddingTop:O.value.caption.padding.top+`px`,paddingRight:O.value.caption.padding.right+`px`,paddingBottom:O.value.caption.padding.bottom+`px`,paddingLeft:O.value.caption.padding.left+`px`,boxShadow:V.value?O.value.thead.tr.style.boxShadow:`none`,minHeight:`36px`,display:t.$slots.caption||O.value.caption.text||O.value.userOptions.show?``:`none`})},[f(b(O.value.caption.text&&!t.$slots.caption?O.value.caption.text:``)+` `,1),y(t.$slots,`caption`,{},void 0,!0)],12,Ce),d(`thead`,{role:`rowgroup`,style:p({...O.value.thead.style,position:`sticky`,top:`${t.$slots.caption||O.value.caption.text||O.value.userOptions.show?z.value:0}px`,zIndex:1})},[d(`tr`,{ref_key:`tableRow`,ref:R,role:`row`,style:p({...O.value.thead.tr.style,border:O.value.thead.tr.border.size?`${O.value.thead.tr.border.size}px solid ${O.value.thead.tr.border.color}`:`none`,boxShadow:V.value?`none`:O.value.thead.tr.style.boxShadow}),height:`${O.value.thead.tr.height}px`},[(g(!0),u(s,null,v(e.dataset.head,(e,n)=>(g(),u(`th`,{role:`cell`,key:`th_${n}`,id:`col-${n}`,scope:`col`,style:p({...O.value.thead.tr.th.style,border:O.value.thead.tr.th.border.size?`${O.value.thead.tr.th.border.size}px solid ${O.value.thead.tr.th.border.color}`:`none`,paddingTop:O.value.thead.tr.th.padding.top+`px`,paddingRight:O.value.thead.tr.th.padding.right+`px`,paddingBottom:O.value.thead.tr.th.padding.bottom+`px`,paddingLeft:O.value.thead.tr.th.padding.left+`px`})},[f(b(t.$slots.th?``:e)+` `,1),y(t.$slots,`th`,me({ref_for:!0},{th:e,colIndex:n}),void 0,!0)],12,Te))),128))],12,we)],4),e.dataset.body&&e.dataset.head?(g(),u(`tbody`,{key:0,ref_key:`tbody`,ref:H,"aria-live":`polite`,style:{clipPath:`inset(0,0,0,0)`}},[(g(!0),u(s,null,v(e.dataset.body,(n,i)=>(g(),u(`tr`,{style:p({...O.value.tbody.tr.style,border:`${O.value.tbody.tr.border.size}px solid ${O.value.tbody.tr.border.color}`,verticalAlign:`middle`})},[(g(!0),u(s,null,v(n,(n,a)=>(g(),u(`td`,{role:`cell`,"data-cell":e.dataset.head[a]||``,"aria-label":`${e.dataset.head[a]}: ${n}`,style:p({...O.value.tbody.tr.td.style,border:`${O.value.tbody.tr.td.border.size}px solid ${O.value.tbody.tr.td.border.color}`,backgroundColor:x(r)(O.value.tbody.tr.td.style.backgroundColor,i%2==0&&O.value.tbody.tr.td.alternateColor?O.value.tbody.tr.td.alternateOpacity*100:100),paddingTop:O.value.tbody.tr.td.padding.top+`px`,paddingRight:O.value.tbody.tr.td.padding.right+`px`,paddingBottom:O.value.tbody.tr.td.padding.bottom+`px`,paddingLeft:O.value.tbody.tr.td.padding.left+`px`,verticalAlign:`middle`}),height:`${O.value.tbody.tr.height}px`},[f(b(t.$slots.td?``:n)+` `,1),y(t.$slots,`td`,me({ref_for:!0},{td:n,rowIndex:i,colIndex:a}),void 0,!0)],12,Ee))),256))],4))),256))],512)):l(``,!0)],12,Se)):l(``,!0)],46,xe),D.value?l(``,!0):(g(),ue(x(w),{key:0,config:{type:`table`}})),O.value.userOptions.show&&D.value&&(x(M)||x(A))?(g(),ue(x(Oe),{ref:`details`,key:`user_option_${Ue.value}`,backgroundColor:O.value.style.backgroundColor,color:O.value.style.color,isPrinting:x(P),isImaging:x(Ie),uid:E.value,hasTooltip:!1,hasPdf:O.value.userOptions.buttons.pdf,hasImg:O.value.userOptions.buttons.img,hasXls:O.value.userOptions.buttons.csv,hasTable:!1,hasLabel:!1,hasAnimation:O.value.userOptions.buttons.animation,isAnimation:!F.value.showAnimation,hasFullscreen:O.value.userOptions.buttons.fullscreen,hasAltCopy:O.value.userOptions.buttons.altCopy,isFullscreen:Me.value,chartElement:ze.value,position:O.value.userOptions.position,titles:{...O.value.userOptions.buttonTitles},zIndex:3,offsetX:12,callbacks:O.value.userOptions.callbacks,printScale:O.value.userOptions.print.scale,isCursorPointer:Fe.value,onGeneratePdf:$e,onGenerateCsv:tt,onGenerateImage:x(Re),onToggleAnimation:et,onToggleFullscreen:We,onCopyAlt:nt,style:p({visibility:x(M)?x(A)?`visible`:`hidden`:`visible`})},de({_:2},[v(x(ae)(t.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionAnimation optionFullscreen optionAltCopy custom-menu-before custom-menu-after`),e=>({name:e,fn:be(n=>[y(t.$slots,e,_e(pe(x(oe)(e,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasPdf`,`hasImg`,`hasXls`,`hasAnimation`,`isAnimation`,`hasFullscreen`,`hasAltCopy`,`isFullscreen`,`chartElement`,`position`,`titles`,`callbacks`,`printScale`,`isCursorPointer`,`onGenerateImage`,`style`])):l(``,!0),t.$slots.source?(g(),u(`div`,De,[y(t.$slots,`source`,{},void 0,!0)],512)):l(``,!0)],544))}},[[`__scopeId`,`data-v-f8c6267a`]]);export{C as n,w as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,D as r,Ht as i,It as a,Jt as o,S as ee,X as te,Yt as ne,at as re,f as s,h as ie,i as c,in as ae,nt as oe,p as se,r as ce,t as le,w as ue,yt as de,zt as fe}from"./lib-rPeBMZrn.js";import{n as pe,t as me}from"./BaseScanner-8NdoBs7B.js";import{n as he,t as ge}from"./useHints-C-TwxM0Y.js";import{t as _e}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as ve}from"./resolveChartConfig-CIhClE5R.js";import{t as ye}from"./img-D4RQwASc.js";import{t as be}from"./useChartExport-BZts4KFb.js";import{t as xe}from"./tableIntegration-CNoJ1CIY.js";import{n as Se,t as Ce}from"./annotationSlots-BRR85CqJ.js";import{n as we,t as Te}from"./userOptionsSlots-DYuo-E5m.js";import{t as Ee}from"./usePrinter-DVf3YcG5.js";import{t as De}from"./DefGrad-DKMq1REY.js";import{t as Oe}from"./A11yDataTable-DWNlWXzs.js";import{t as ke}from"./useUserOptionState-CXlFnwPv.js";import{t as Ae}from"./useChartAccessibility-DOMuYJfm.js";import{t as je}from"./useTableResponsive-uSz_qZOB.js";import{t as Me}from"./vue_ui_chestnut-BxxivKN7.js";import{Fragment as l,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createSlots as Ne,createTextVNode as Pe,createVNode as h,defineAsyncComponent as Fe,guardReactiveProps as Ie,mergeProps as Le,nextTick as Re,normalizeClass as g,normalizeProps as ze,normalizeStyle as _,onMounted as Be,openBlock as v,ref as y,renderList as b,renderSlot as x,resolveDynamicComponent as Ve,toDisplayString as S,toRefs as He,unref as C,useCssVars as Ue,watch as We,withCtx as Ge,withKeys as Ke}from"vue";var qe=/* @__PURE__ */ e({default:()=>zn}),Je=[`id`],Ye=[`id`],Xe={"aria-live":`polite`,class:`sr-only`},Ze={key:2,ref:`noTitle`,class:`vue-data-ui-no-title-space`,style:`height:36px; width: 100%;background:transparent`},Qe={style:{position:`relative`}},$e=[`xmlns`,`aria-describedby`,`viewBox`],et=[`width`,`height`],tt={key:1},nt=[`fill`,`font-weight`,`font-size`,`x`,`y`],rt=[`fill`,`font-weight`,`font-size`,`x`,`y`],it={key:2},at=[`x`,`y`,`font-size`,`font-weight`,`fill`],ot=[`x`,`y`,`font-size`,`font-weight`,`fill`],st=[`d`,`stroke`,`fill`],ct=[`cx`,`cy`,`r`,`fill`],lt=[`aria-label`,`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`,`onClick`],ut={key:3},dt=[`x`,`y`,`font-size`,`fill`,`onClick`],ft={key:0},pt=[`x`,`y`,`fill`,`font-size`,`font-weight`],mt=[`x`,`y`,`height`,`width`,`fill`,`rx`,`onClick`],ht=[`aria-label`,`x`,`y`,`height`,`width`,`fill`,`rx`,`stroke`,`stroke-width`,`onClick`],gt={key:4},_t=[`x`,`y`,`fill`,`font-size`,`onClick`],vt=[`d`,`stroke`],yt=[`aria-label`,`fill`,`cx`,`cy`,`r`,`onClick`],bt={key:5},xt=[`x`,`y`,`font-size`,`font-weight`,`fill`],St=[`x1`,`x2`,`y1`,`y2`,`stroke`,`stroke-width`],Ct=[`y`,`height`,`width`],wt={style:{width:`100%`,height:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`,"flex-direction":`column`}},Tt={style:{display:`flex`,"align-items":`center`,"justify-content":`center`,gap:`12px`,"flex-wrap":`wrap`,"flex-direction":`row`}},Et={viewBox:`0 0 20 20`,height:`16`,width:`16`},Dt=[`fill`],Ot={key:7},kt=[`y`,`height`,`width`],At={style:{width:`100%`,height:`100%`,display:`flex`,"align-items":`center`,"justify-content":`center`,"flex-direction":`column`}},jt={style:{display:`flex`,"align-items":`center`,"justify-content":`center`,gap:`12px`,"flex-wrap":`wrap`,"flex-direction":`row`}},Mt={viewBox:`0 0 20 20`,height:`16`,width:`16`},Nt=[`fill`],Pt=[`cx`,`cy`,`fill`],Ft=[`d`,`stroke`],It=[`cx`,`cy`,`fill`],Lt=[`d`,`stroke`],Rt=[`cx`,`cy`,`fill`],zt=[`cx`,`cy`,`fill`],Bt=[`x`,`y`,`fill`,`font-size`,`font-weight`],Vt=[`x`,`y`,`fill`,`font-size`,`font-weight`],Ht=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Ut=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Wt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Gt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],Kt=[`x`,`text-anchor`,`y`,`fill`,`font-size`],qt=[`x`,`y`,`font-size`,`fill`],Jt=[`x`,`y`,`font-size`,`fill`],Yt=[`x`,`y`,`font-size`,`fill`],Xt={key:4,class:`vue-data-ui-watermark`},Zt={key:5,ref:`source`,dir:`auto`},Qt={class:`vue-ui-data-table`},$t={key:0},en=[`data-cell`],tn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},nn={key:0},rn={key:1},an=[`data-cell`],on={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},sn={key:0},cn={key:1},ln=[`data-cell`],un={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},dn={key:0},fn={key:1},pn=[`data-cell`],mn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},hn={key:0},gn={key:1},_n=[`data-cell`],vn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},yn={key:0},bn={key:1},xn=[`data-cell`],Sn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Cn={key:0},wn={key:1},Tn=[`data-cell`],En={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Dn={key:0},On={key:1},kn=[`data-cell`],An={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},jn=[`data-cell`],Mn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Nn=[`data-cell`],Pn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Fn=[`data-cell`],In={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},Ln=[`data-cell`],Rn={style:{display:`flex`,"align-items":`center`,gap:`5px`,"justify-content":`flex-end`,width:`100%`,"padding-right":`3px`}},zn=/*#__PURE__*/ _e({__name:`vue-ui-chestnut`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectRoot`,`selectBranch`,`selectNut`,`copyAlt`],setup(e,{expose:_e,emit:qe}){Ue(e=>({v3d231ac9:e.tdo}));let zn=Fe(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),Bn=Fe(()=>import(`./vue-ui-accordion-S3nRtTU-.js`).then(e=>e.n)),Vn=Fe(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),Hn=Fe(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),Un=Fe(()=>import(`./PackageVersion-DhptF5oD.js`).then(e=>e.t)),Wn=Fe(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),{vue_ui_chestnut:Gn}=t(),w=e,Kn=u(()=>!!w.dataset&&w.dataset.length),T=y(te()),qn=y(null),Jn=y(0),Yn=y(null),Xn=y(null),Zn=y(!1),E=y(!1),D=y(``),O=y({level:`root`,rootIndex:0,branchIndex:0,nutIndex:0,locked:!1}),k=y(ar()),A=u(()=>k.value.style.chart.layout.roots),j=u(()=>k.value.style.chart.layout.branches),M=u(()=>k.value.style.chart.layout.nuts),N=u(()=>k.value.style.chart.layout),P=u(()=>k.value.style.chart);he({config:()=>k.value,dataset:()=>w.dataset,component:`VueUiChestnut`,rules:[ge.emptyArray,{test:e=>e.some(e=>e?.branches&&e.branches.length>10),message:[`👀 Some root has > 10 branches, which can make the chart heavy. Consider:`,``,`▶️ Grouping some branches in broader categories.`]},{test:e=>e.some(e=>e?.branches&&e.branches.some(e=>e?.breakdown&&e?.breakdown.length>6)),message:[`👀 Some donuts have > 6 series. Consider:`,``,`▶️ Grouping small values into an "Other" category.`]}]});let F=u(()=>k.value.userOptions.useCursorPointer),Qn=u(()=>ae({defaultConfig:{userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{grandTotal:{show:!1},roots:{stroke:`#6A6A6A`,labels:{show:!1}},verticalSeparator:{stroke:`transparent`},branches:{stroke:`#6A6A6A`,underlayerColor:`#6A6A6A90`,labels:{show:!1,dataLabels:{show:!1}}}}}}},userConfig:k.value.skeletonConfig??{}})),{loading:$n,FINAL_DATASET:er}=pe({...He(w),FINAL_CONFIG:k,prepareConfig:ar,skeletonDataset:w.config?.skeletonDataset??[{name:`_`,color:`#969696`,branches:[{name:`_`,value:32,breakdown:[{name:`_`,value:16,color:`#CACACA`},{name:`_`,value:16,color:`#6A6A6A`}]},{name:`_`,value:16,breakdown:[{name:`_`,value:8,color:`#CACACA`},{name:`_`,value:8,color:`#6A6A6A`}]},{name:`_`,value:8,breakdown:[{name:`_`,value:4,color:`#CACACA`},{name:`_`,value:4,color:`#6A6A6A`}]},{name:`_`,value:4,breakdown:[{name:`_`,value:2,color:`#CACACA`},{name:`_`,value:2,color:`#6A6A6A`}]}]},{name:`_`,color:`#C4C4C4`,branches:[{name:`_`,value:24,breakdown:[{name:`_`,value:12,color:`#CACACA`},{name:`_`,value:12,color:`#6A6A6A`}]},{name:`_`,value:12,breakdown:[{name:`_`,value:6,color:`#CACACA`},{name:`_`,value:6,color:`#6A6A6A`}]},{name:`_`,value:6,breakdown:[{name:`_`,value:3,color:`#CACACA`},{name:`_`,value:3,color:`#6A6A6A`}]},{name:`_`,value:2,breakdown:[{name:`_`,value:1,color:`#CACACA`},{name:`_`,value:1,color:`#6A6A6A`}]}]}],skeletonConfig:ae({defaultConfig:k.value,userConfig:Qn.value})}),{userOptionsVisible:tr,setUserOptionsVisibility:nr,keepUserOptionState:rr}=ke({config:k.value}),{svgRef:ir}=Ae({config:N.value.title});function ar(){return ve(w.config,Gn,Me)}We(()=>w.config,e=>{k.value=ar(),tr.value=!k.value.userOptions.showOnChartHover,fr.value.showTable=k.value.table.show,Nr()},{deep:!0});let{isPrinting:or,isImaging:sr,generatePdf:cr,generateImage:lr}=Ee({elementId:`vue-ui-chestnut_${T.value}`,fileName:N.value.title.text||`vue-ui-chestnut`,options:k.value.userOptions.print}),ur=u(()=>k.value.userOptions.show),dr=u(()=>ue(k.value.customPalette)),fr=y({showTable:k.value.table.show});We(k,()=>{fr.value={showTable:k.value.table.show}},{immediate:!0});let pr=y(null),mr=u(()=>k.value.table.responsiveBreakpoint),I=y({gap:6,padding:{top:102,left:12,right:12,bottom:96},width:1024,height:0,branchSize:32,branchStart:128}),L=u(()=>({left:I.value.padding.left,top:I.value.padding.top,right:I.value.width-I.value.padding.right,bottom:I.value.height-I.value.padding.bottom,width:I.value.width-(I.value.padding.left+I.value.padding.right),height:I.value.height-(I.value.padding.top+I.value.padding.bottom),seedX:I.value.padding.left+64})),R=u(()=>er.value.flatMap(e=>(e.branches||[]).map(e=>e.value||0)).reduce((e,t)=>e+t,0)),hr=u(()=>k.value.debug),z=u(()=>(hr.value&&er.value.forEach((e,t)=>{de({datasetObject:e,requiredAttributes:[`name`,`branches`]}).forEach(e=>{re({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:t})}),e.branches&&e.branches.forEach((e,n)=>{de({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{re({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:`${t} - ${n}`})}),e.breakdown&&e.breakdown.forEach((e,r)=>{de({datasetObject:e,requiredAttributes:[`name`,`value`]}).forEach(e=>{re({componentName:`VueUiChestnut`,type:`datasetSerieAttribute`,property:e,index:`${t} - ${n} - ${r}`})})})})}),er.value.map((e,t)=>{let n=(e.branches||[]).map(e=>e.value||0).reduce((e,t)=>e+t,0);return{...e,color:ee(e.color)||dr.value[t]||i[t]||i[t%i.length],id:e.id||`root_${t}_${T.value}`,type:`root`,total:n,rootIndex:t,branches:(e.branches||[]).map((r,a)=>({...r,rootName:e.name,rootIndex:t,color:ee(e.color)||dr.value[t]||i[t]||i[t%i.length],value:r.value>=0?r.value:0,id:r.id||`branch_${t}_${a}_${T.value}`,proportionToRoot:r.value/n,type:`branch`,breakdown:(r.breakdown||[]).map((o,te)=>({table:{rootName:e.name,rootValue:n,rootToTotal:n/R.value,branchName:r.name,branchValue:r.value,branchToTotal:r.value/R.value,branchToRoot:r.value/n,nutName:o.name,nutValue:o.value,nutToTotal:o.value/R.value,nutToRoot:o.value/n,nutToBranch:o.value/r.value},...o,type:`nut`,branchName:r.name,rootName:e.name,branchTotal:r.value>=0?r.value:0,proportionToBranch:o.value/r.value,proportionToRoot:o.value/n,proportionToTree:o.value/R.value,rootIndex:t,id:o.id||`nut_${t}_${a}_${te}_${T.value}`,color:ee(o.color)||dr.value[te]||i[te]||i[te%i.length],value:o.value>=0?o.value:0}))}))}})));function gr(){return z.value}let _r=qe,vr=u(()=>z.value.flatMap(e=>e.branches).length),yr=u(()=>Math.max(...z.value.map(e=>e.branches.map(e=>e.value).reduce((e,t)=>e+t,0)))),br=u(()=>Math.max(...z.value.flatMap(e=>e.branches.map(e=>e.value)))),xr=u(()=>256+I.value.padding.left),B=u(()=>z.value.sort((e,t)=>t.total-e.total).map((e,t)=>{let n=L.value.height/z.value.length/2,r=e.total/yr.value*(n>64?64:n);return{...e,x:L.value.seedX,y:L.value.top+L.value.height/z.value.length*(t+1)-(L.value.height/z.value.length/2+I.value.gap/2),r:r<I.value.branchSize/2?I.value.branchSize/2:r}})),Sr=u(()=>j.value.widthRatio<=0?.1:j.value.widthRatio>1.8?1.8:j.value.widthRatio),Cr=u(()=>B.value.flatMap(e=>e.branches)),V=u(()=>Cr.value.sort((e,t)=>t.value-e.value).map((e,t)=>({...e,y1:t*I.value.branchSize+L.value.top+t*I.value.gap,y2:t*I.value.branchSize+I.value.branchSize,x1:xr.value,x2:384*e.value/br.value*Sr.value+xr.value}))),wr=u(()=>B.value),Tr=u(()=>wr.value.map(e=>V.value.filter(t=>t.rootIndex===e.rootIndex).sort((e,t)=>e.y1-t.y1))),Er=u(()=>wr.value.map((e,t)=>Tr.value[t].map(e=>(e.breakdown||[]).map((t,n)=>({...t,nutIndex:n,rootIndex:e.rootIndex,branchId:e.id,branchName:e.name,branchValue:e.value,rootName:e.rootName})))));function Dr(e){let t=B.value.find(t=>t.rootIndex===e.rootIndex);return{x:t.x,y:t.y,r:t.r}}let H=y(null),U=y(null),W=y(null),G=y(null);function K(){H.value=null,W.value=null,G.value=null}function q(e){if(H.value)return e.type===`root`?e.rootIndex===H.value.rootIndex:e.type===`branch`?e.id===H.value.id:e.type===`nut`&&e.branchName===H.value.name&&e.rootIndex===H.value.rootIndex;if(W.value)return e.type===`root`?e.rootIndex===W.value.rootIndex:e.type===`branch`?e.id===W.value.id:e.type===`nut`&&e.branchName===W.value.name&&e.rootIndex===W.value.rootIndex;if(G.value)return e.type===`root`?e.id===G.value.id:e.type===`branch`||e.type===`nut`?e.rootIndex===G.value.rootIndex:!1;if(ci.value&&E.value){if(O.value.level===`root`)return e.type===`root`?Z.value&&e.id===Z.value.id:e.type===`branch`||e.type===`nut`?Z.value&&e.rootIndex===Z.value.rootIndex:!1;if(O.value.level===`branch`)return e.type===`root`?Z.value&&e.rootIndex===Z.value.rootIndex:e.type===`branch`?oi.value&&e.id===oi.value.id:(e.type,!1);if(O.value.level===`nut`)return e.type===`root`?Z.value&&e.rootIndex===Z.value.rootIndex:e.type===`branch`?si.value&&e.id===si.value.id:e.type===`nut`&&si.value&&e.branchName===si.value.name&&e.rootIndex===si.value.rootIndex}return!0}function Or(e){K();let t=wr.value.findIndex(t=>t.rootIndex===e.rootIndex),n=(Tr.value[t]||[]).findIndex(t=>t.id===e.id);t!==-1&&(O.value.rootIndex=t),n!==-1&&(O.value.branchIndex=n),O.value.level=`nut`,O.value.nutIndex=0,Re(()=>{H.value=e,W.value=e,U.value=a({series:e.breakdown,base:1},e.x2+24+M.value.offsetX,e.y1+I.value.branchSize/2,80,80),_r(`selectNut`,e.breakdown),Q()})}function J(){H.value=null,U.value=null,_r(`selectNut`,null)}function kr(e){let t=wr.value.findIndex(t=>t.rootIndex===e.rootIndex),n=(Tr.value[t]||[]).findIndex(t=>t.id===e.id);t!==-1&&(O.value.rootIndex=t),n!==-1&&(O.value.branchIndex=n),O.value.level=`branch`,O.value.nutIndex=0,W.value&&W.value.id===e.id?(W.value=null,K(),_r(`selectBranch`,null),Q()):(K(),W.value=e,_r(`selectBranch`,e),Q())}function Ar(e){let t=wr.value.findIndex(t=>t.id===e.id);t!==-1&&(O.value.rootIndex=t),O.value.level=`root`,O.value.branchIndex=0,O.value.nutIndex=0,G.value&&G.value.id===e.id?(K(),_r(`selectRoot`,null),Q()):(K(),G.value=e,_r(`selectRoot`,e),Q())}function jr(){return L.value.bottom-(H.value.y1+180)<0?0:L.value.bottom}function Mr(e){return e.proportion*100>M.value.selected.labels.dataLabels.hideUnderValue}Be(()=>{Nr()});function Nr(){fe(w.dataset)&&re({componentName:`VueUiChestnut`,type:`dataset`,debug:hr.value});let e=vr.value*(I.value.branchSize+I.value.gap)+I.value.padding.top+I.value.padding.bottom;I.value.height=e}let Y=u(()=>({head:[k.value.table.th.translations.rootName,k.value.table.th.translations.rootValue,k.value.table.th.translations.rootToTotal,k.value.table.th.translations.branchName,k.value.table.th.translations.branchValue,k.value.table.th.translations.branchToRoot,k.value.table.th.translations.branchToTotal,k.value.table.th.translations.nutName,k.value.table.th.translations.nutValue,k.value.table.th.translations.nutToBranch,k.value.table.th.translations.nutToRoot,k.value.table.th.translations.nutToTotal],body:z.value.flatMap((e,t)=>e.branches.flatMap((e,t)=>e.breakdown.flatMap((e,t)=>e.table)))}));function Pr(e=null){Re(()=>{let t=[[N.value.title.text],[N.value.title.subtitle.text],[``],[`Grand total`,R.value],[``]],n=Y.value.head,i=Y.value.body.map((e,t)=>[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?``:e.rootName,Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?``:e.rootValue,Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?``:e.rootToTotal,Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?``:e.branchName,Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?``:e.branchValue,Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?``:e.branchToRoot,Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?``:e.branchToTotal,e.nutName,e.nutValue,e.nutToBranch,e.nutToRoot,e.nutToTotal]),a=t.concat([n]).concat(i),o=r(a);e?e(o):oe({csvContent:o,title:N.value.title.text||`vue-ui-chestnut`})})}let Fr=y(!1);function Ir(e){Fr.value=e,Jn.value+=1}function Lr(){fr.value.showTable=!fr.value.showTable}let Rr=y(!1);function zr(){Rr.value=!Rr.value}async function Br({scale:e=2}={}){if(!qn.value)return;let{width:t,height:n}=qn.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await ye({domElement:qn.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:N.value.title.text,width:t,height:n,aspectRatio:r}}function Vr(e){let t=Dr(e),n=e.x1,r=e.y1,i=I.value.branchSize,a=t.x+t.r/2,o=t.y;return[`M ${n},${r}`,`C ${n-20},${r} ${n-20},${r} ${a},${o}`,`C ${a},${o} ${n-20},${r+i} ${n},${r+i}`,`Z`].join(` `)}let Hr=u(()=>xe({config:k,style:P,mutableConfig:fr,dialog:Wn,accordion:Bn,isFullscreen:Fr,parent:qn,maxWidth:800,titleStyle:N,isCursorPointer:F}));We(()=>fr.value.showTable,async e=>{k.value.table.show||(e&&k.value.table.useDialog&&Yn.value?(await Re(),Yn.value.open()):`close`in Yn.value&&Yn.value.close())});let{isResponsive:Ur}=je(pr,mr);function Wr(){fr.value.showTable=!1,Xn.value&&Xn.value.setTableIconState(!1)}let Gr=u(()=>z.value.map((e,t)=>({...e,display:`${e.name}: ${c(A.value.labels.formatter,e.total,n({p:N.value.legend.prefix,v:e.total,s:N.value.legend.suffix,r:N.value.legend.roundingValue}),{datapoint:e})} (${n({v:e.total/R.value*100,s:`%`,r:N.value.legend.roundingPercentage})})`}))),Kr=u(()=>Gr.value.map(e=>({color:e.color,name:e.display,shape:`circle`}))),qr=u(()=>P.value.backgroundColor),Jr=u(()=>({...N.value.legend,textAlign:`center`,show:!0,position:`bottom`})),Yr=u(()=>N.value.title),{isCallbackImaging:Xr,isCallbackSvg:Zr,generateSvg:Qr,onGenerateImage:$r}=be({svg:ir,title:Yr,legend:Jr,legendItems:Kr,backgroundColor:qr,titleEmbedded:!0,getSvgCallback:()=>k.value.userOptions.callbacks.svg,generateImage:lr});async function ei(){_r(`copyAlt`,{config:k.value,dataset:z.value}),k.value.userOptions.callbacks.altCopy?await Promise.resolve(k.value.userOptions.callbacks.altCopy({config:k.value,dataset:z.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}function ti(e){if(!e)return``;let t=n({p:N.value.legend.prefix,v:e.total,s:N.value.legend.suffix,r:N.value.legend.roundingValue}),r=n({v:e.total/R.value*100,s:`%`,r:N.value.legend.roundingPercentage});return`Root ${e.name}. Value ${t}. ${r} of total.`}function ni(e){if(!e)return``;let t=n({p:j.value.labels.dataLabels.prefix,v:e.value,s:j.value.labels.dataLabels.suffix,r:j.value.labels.dataLabels.roundingValue}),r=n({v:e.proportionToRoot*100,s:`%`,r:N.value.legend.roundingPercentage});return`Branch ${e.name}. Root ${e.rootName}. Value ${t}. ${r} of root ${e.rootName}.`}function ri(e){if(!e)return``;let t=n({p:N.value.legend.prefix,v:e.value,s:N.value.legend.suffix,r:M.value.selected.labels.roundingValue}),r=n({v:e.proportionToBranch*100,s:`%`,r:M.value.selected.labels.roundingPercentage});return`Nut ${e.name}. Branch ${e.branchName}. Root ${e.rootName}. Value ${t}. ${r} of branch ${e.branchName}.`}let ii=u(()=>wr.value[O.value.rootIndex]||null),X=u(()=>(Tr.value[O.value.rootIndex]||[])[O.value.branchIndex]||null),ai=u(()=>((Er.value[O.value.rootIndex]||[])[O.value.branchIndex]||[])[O.value.nutIndex]||null),Z=u(()=>ii.value),oi=u(()=>X.value),si=u(()=>O.value.level===`nut`?X.value:null),ci=u(()=>Zn.value);function Q(){O.value.level===`root`?D.value=ti(ii.value):O.value.level===`branch`?D.value=ni(X.value):O.value.level===`nut`&&(D.value=ri(ai.value))}function $(){O.value={level:`root`,rootIndex:0,branchIndex:0,nutIndex:0,locked:!1},D.value=``}function li(){let e=Tr.value[O.value.rootIndex]||[];e.length?(O.value.branchIndex>=e.length&&(O.value.branchIndex=0),O.value.branchIndex<0&&(O.value.branchIndex=e.length-1)):O.value.branchIndex=0}function ui(){let e=(Er.value[O.value.rootIndex]||[])[O.value.branchIndex]||[];e.length?(O.value.nutIndex>=e.length&&(O.value.nutIndex=0),O.value.nutIndex<0&&(O.value.nutIndex=e.length-1)):O.value.nutIndex=0}function di(e){if(O.value.level===`root`){let t=wr.value.length;if(!t)return;O.value.rootIndex+=e,O.value.rootIndex>=t&&(O.value.rootIndex=0),O.value.rootIndex<0&&(O.value.rootIndex=t-1),O.value.branchIndex=0,O.value.nutIndex=0,Q()}else O.value.level===`branch`?(O.value.branchIndex+=e,li(),O.value.nutIndex=0,Q()):O.value.level===`nut`&&(O.value.nutIndex+=e,ui(),Q())}function fi(e){if(e>0){if(O.value.level===`root`){if(!(Tr.value[O.value.rootIndex]||[]).length)return;O.value.level=`branch`,O.value.branchIndex=0,O.value.nutIndex=0,Q();return}if(O.value.level===`branch`){if(!((Er.value[O.value.rootIndex]||[])[O.value.branchIndex]||[]).length)return;O.value.level=`nut`,O.value.nutIndex=0,X.value?Or(X.value):Q();return}}else O.value.level===`nut`?(J(),W.value=null,O.value.level=`branch`,O.value.nutIndex=0,Q()):O.value.level===`branch`&&(W.value=null,G.value=null,O.value.level=`root`,O.value.nutIndex=0,Q())}function pi(){O.value.level===`root`&&ii.value?(Ar(ii.value),D.value=`${ti(ii.value)} selected.`):O.value.level===`branch`&&X.value?(kr(X.value),D.value=`${ni(X.value)} selected.`):O.value.level===`nut`&&X.value&&ai.value&&(Or(X.value),D.value=`${ri(ai.value)} details opened.`)}function mi(){Zn.value=!0,E.value=!1}function hi(){Zn.value=!1,E.value=!1,D.value=``,G.value||W.value||H.value||$()}function gi(e){let t=e.key===`ArrowUp`,n=e.key===`ArrowDown`,r=e.key===`ArrowLeft`,i=e.key===`ArrowRight`,a=e.key===`Enter`||e.key===` `,o=e.key===`Escape`;(t||n||r||i||a||o)&&(e.preventDefault(),e.stopPropagation(),Zn.value||=!0,o?(K(),$(),E.value=!1):((t||n||r||i)&&(E.value=!0),t?di(-1):n?di(1):r?fi(-1):i?fi(1):a&&pi()))}let _i=u(()=>({headers:Y.value.head,rows:Y.value.body.map(e=>[e.rootName,e.rootValue,n({v:e.rootToTotal*100,s:`%`,r:k.value.table.td.roundingPercentage}),e.branchName,e.branchValue,n({v:e.branchToRoot*100,s:`%`,r:k.value.table.td.roundingPercentage}),n({v:e.branchToTotal*100,s:`%`,r:k.value.table.td.roundingPercentage}),e.nutName,e.nutValue,n({v:e.nutToBranch*100,s:`%`,r:k.value.table.td.roundingPercentage}),n({v:e.nutToRoot*100,s:`%`,r:k.value.table.td.roundingPercentage}),n({v:e.nutToTotal*100,s:`%`,r:k.value.table.td.roundingPercentage})])}));return _e({getData:gr,getImage:Br,generatePdf:cr,generateCsv:Pr,generateImage:lr,generateSvg:Qr,toggleTable:Lr,toggleAnnotator:zr,toggleFullscreen:Ir,copyAlt:ei}),(e,t)=>(v(),p(`div`,{class:g(`vue-data-ui-component vue-ui-chestnut ${Fr.value?`vue-data-ui-wrapper-fullscreen`:``}`),ref_key:`chestnutChart`,ref:qn,id:`vue-ui-chestnut_${T.value}`,style:_(`font-family:${k.value.style.fontFamily};width:100%; text-align:center;background:${P.value.backgroundColor}`),onMouseenter:t[12]||=()=>C(nr)(!0),onMouseleave:t[13]||=()=>C(nr)(!1)},[m(`div`,{id:`chart-instructions-${T.value}`,class:`sr-only`},[m(`p`,null,S(k.value.a11y.translations.keyboardNavigation),1)],8,Ye),m(`div`,Xe,S(D.value),1),_i.value?.rows?.length?(v(),d(Oe,{key:0,uid:T.value,head:_i.value.headers,body:_i.value.rows,notice:k.value.a11y.translations.tableAvailable,caption:k.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):f(``,!0),k.value.userOptions.buttons.annotator?(v(),d(C(Vn),{key:1,svgRef:C(ir),backgroundColor:P.value.backgroundColor,color:P.value.color,active:Rr.value,isCursorPointer:F.value,palette:k.value.userOptions.annotatorPalette,onClose:zr},Ne({_:2},[b(C(Ce),t=>({name:t,fn:Ge(n=>[x(e.$slots,t,ze(Ie(C(Se)(t,n))),void 0,!0)])}))]),1032,[`svgRef`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):f(``,!0),ur.value?(v(),p(`div`,Ze,null,512)):f(``,!0),k.value.userOptions.show&&Kn.value&&(C(rr)||C(tr))?(v(),d(C(Hn),{ref_key:`userOptionsRef`,ref:Xn,key:`user_options_${Jn.value}`,backgroundColor:P.value.backgroundColor,color:P.value.color,isImaging:C(sr),isPrinting:C(or),uid:T.value,hasPdf:k.value.userOptions.buttons.pdf,hasImg:k.value.userOptions.buttons.img,hasSvg:k.value.userOptions.buttons.svg,hasXls:k.value.userOptions.buttons.csv,hasTable:k.value.userOptions.buttons.table,hasFullscreen:k.value.userOptions.buttons.fullscreen,hasAltCopy:k.value.userOptions.buttons.altCopy,isFullscreen:Fr.value,titles:{...k.value.userOptions.buttonTitles},chartElement:qn.value,position:k.value.userOptions.position,hasAnnotator:k.value.userOptions.buttons.annotator,isAnnotation:Rr.value,callbacks:k.value.userOptions.callbacks,printScale:k.value.userOptions.print.scale,tableDialog:k.value.table.useDialog,isCursorPointer:F.value,onToggleFullscreen:Ir,onGeneratePdf:C(cr),onGenerateCsv:Pr,onGenerateImage:C($r),onGenerateSvg:C(Qr),onToggleTable:Lr,onToggleAnnotator:zr,onCopyAlt:ei,style:_({visibility:C(rr)?C(tr)?`visible`:`hidden`:`visible`})},Ne({_:2},[b(C(we)(e.$slots,`menuIcon optionPdf optionCsv optionImg optionSvg optionTable optionFullscreen optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:Ge(n=>[x(e.$slots,t,ze(Ie(C(Te)(t,n))),void 0,!0)])}))]),1032,/* @__PURE__ */ `backgroundColor.color.isImaging.isPrinting.uid.hasPdf.hasImg.hasSvg.hasXls.hasTable.hasFullscreen.hasAltCopy.isFullscreen.titles.chartElement.position.hasAnnotator.isAnnotation.callbacks.printScale.tableDialog.isCursorPointer.onGeneratePdf.onGenerateImage.onGenerateSvg.style`.split(`.`))):f(``,!0),m(`div`,Qe,[I.value.height>0?(v(),p(`svg`,{key:0,ref_key:`svgRef`,ref:ir,xmlns:C(le),"aria-describedby":`chart-instructions-${T.value}`,class:g({"vue-data-ui-fullscreen--on":Fr.value,"vue-data-ui-fulscreen--off":!Fr.value}),viewBox:`0 0 ${I.value.width<=0?10:I.value.width} ${I.value.height<=0?10:I.value.height}`,style:_(`overflow:visible;background:transparent;color:${P.value.color}`),tabindex:`0`,onFocus:mi,onBlur:hi,onKeydown:gi},[h(C(Un)),x(e.$slots,`svg-underlayer`,{svg:{...I.value,isPrintingImg:C(or)||C(sr)||C(Xr),isPrintingSvg:C(Zr)}},void 0,!0),e.$slots[`chart-background`]?(v(),p(`foreignObject`,{key:0,x:0,y:0,width:I.value.width<=0?10:I.value.width,height:I.value.height<=0?10:I.value.height,style:{pointerEvents:`none`}},[x(e.$slots,`chart-background`,{},void 0,!0)],8,et)):f(``,!0),H.value?f(``,!0):(v(),p(`g`,tt,[N.value.title.text?(v(),p(`text`,{key:0,"text-anchor":`middle`,fill:N.value.title.color,"font-weight":N.value.title.bold?`bold`:`normal`,"font-size":N.value.title.fontSize,x:I.value.width/2,y:12+N.value.title.fontSize+N.value.title.offsetY,onClick:t[0]||=()=>{K(),$(),E.value=!1}},S(N.value.title.text),9,nt)):f(``,!0),N.value.title.subtitle.text?(v(),p(`text`,{key:1,"text-anchor":`middle`,fill:N.value.title.subtitle.color,"font-weight":N.value.title.subtitle.bold?`bold`:`normal`,"font-size":N.value.title.subtitle.fontSize,x:I.value.width/2,y:48+N.value.title.subtitle.fontSize+N.value.title.subtitle.offsetY,onClick:t[1]||=()=>{K(),$(),E.value=!1}},S(N.value.title.subtitle.text),9,rt)):f(``,!0)])),m(`defs`,null,[(v(!0),p(l,null,b(z.value,(e,t)=>(v(),d(De,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`root_gradient_${T.value}_${e.rootIndex}`,key:`root_gradient_${T.value}_${e.rootIndex}`,stops:[[`0%`,C(o)(C(ne)(e.color,.05),100-A.value.gradientIntensity),1],[`100%`,e.color,1]]},null,8,[`id`,`stops`]))),128)),(v(!0),p(l,null,b(z.value,e=>(v(),d(De,{t:`linear`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,id:`branch_gradient_${T.value}_${e.rootIndex}`,key:`branch_gradient_${T.value}_${e.rootIndex}`,stops:[[`0%`,e.color,1],[`100%`,C(o)(C(ne)(e.color,.02),100-j.value.gradientIntensity),1]]},null,8,[`id`,`stops`]))),128)),h(De,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nutpick_${T.value}`,stops:[[`0%`,C(o)(`#FFFFFF`,0),0],[`80%`,C(o)(`#FFFFFF`,M.value.selected.gradientIntensity),1],[`100%`,C(o)(`#FFFFFF`,0),0]]},null,8,[`id`,`stops`]),h(De,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nut_${T.value}`,stops:[[`0%`,C(o)(`#FFFFFF`,0),0],[`80%`,C(o)(`#FFFFFF`,M.value.gradientIntensity),1],[`100%`,C(o)(`#FFFFFF`,0),0]]},null,8,[`id`,`stops`]),h(De,{t:`radial`,cx:`50%`,cy:`50%`,r:`50%`,fx:`50%`,fy:`50%`,id:`nut_underlayer_${T.value}`,stops:[[`0%`,C(o)(P.value.backgroundColor,100),1],[`80%`,C(o)(P.value.backgroundColor,60),1],[`100%`,C(o)(P.value.backgroundColor,0),1]]},null,8,[`id`,`stops`])]),N.value.grandTotal.show?(v(),p(`g`,it,[m(`text`,{x:L.value.seedX,y:32+N.value.grandTotal.offsetY,"font-size":N.value.grandTotal.fontSize,"font-weight":N.value.grandTotal.bold?`bold`:`normal`,fill:N.value.grandTotal.color,"text-anchor":`middle`,onClick:t[2]||=()=>{K(),$(),E.value=!1}},S(N.value.grandTotal.text),9,at),m(`text`,{x:L.value.seedX,y:38+N.value.grandTotal.fontSize+N.value.grandTotal.offsetY,"font-size":N.value.grandTotal.fontSize,"font-weight":N.value.grandTotal.bold?`bold`:`normal`,fill:N.value.grandTotal.color,"text-anchor":`middle`,onClick:t[3]||=()=>{K(),$(),E.value=!1}},S(C(c)(N.value.grandTotal.formatter,R.value,C(n)({p:N.value.grandTotal.prefix,v:R.value,s:N.value.grandTotal.suffix,r:N.value.grandTotal.roundingValue}))),9,ot)])):f(``,!0),(v(!0),p(l,null,b(V.value,e=>(v(),p(`g`,null,[m(`defs`,null,[h(De,{t:`linear`,id:`link_grad_${e.id}`,stops:[[`0%`,e.color,1],[`100%`,C(o)(e.color,N.value.links.opacity),1]]},null,8,[`id`,`stops`])]),m(`path`,{d:Vr(e),stroke:C(o)(e.color,N.value.links.opacity),fill:`url(#link_grad_${e.id})`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:_(`opacity:${+!!q(e)}`),onClick:t[4]||=()=>{K(),$(),E.value=!1}},null,12,st)]))),256)),(v(!0),p(l,null,b(B.value,e=>(v(),p(`circle`,{cx:e.x,cy:e.y,r:e.r,fill:A.value.underlayerColor,stroke:`none`,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`)},null,12,ct))),256)),(v(!0),p(l,null,b(B.value,(e,t)=>(v(),p(`circle`,{"aria-label":ti(e),cx:e.x,cy:e.y,r:e.r,fill:A.value.useGradient?`url(#root_gradient_${T.value}_${e.rootIndex})`:e.color,stroke:A.value.stroke,"stroke-width":A.value.strokeWidth,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>Ar(e)},null,12,lt))),256)),A.value.labels.show?(v(),p(`g`,ut,[(v(!0),p(l,null,b(B.value,(e,t)=>(v(),p(`text`,{x:e.x,y:e.y+A.value.labels.fontSize/2.6,"text-anchor":`middle`,"font-size":A.value.labels.fontSize,fill:A.value.labels.adaptColorToBackground?C(ce)(e.color):A.value.labels.color,"font-weight":`bold`,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>Ar(e)},S(C(c)(A.value.labels.formatter,e.total,C(n)({p:A.value.labels.prefix,v:e.total,s:A.value.labels.suffix,r:A.value.labels.roundingValue}),{datapoint:e})),13,dt))),256)),(v(!0),p(l,null,b(B.value,e=>(v(),p(`g`,null,[H.value&&e.rootIndex===H.value.rootIndex||W.value&&e.rootIndex===W.value.rootIndex||G.value&&e.rootIndex===G.value.rootIndex?(v(),p(`g`,ft,[m(`text`,{x:e.x,y:e.y+e.r+24,"text-anchor":`middle`,fill:A.value.labels.name.color,"font-size":A.value.labels.name.fontSize,"font-weight":A.value.labels.name.bold?`bold`:`normal`,onClick:t[5]||=()=>{K(),$(),E.value=!1}},S(e.name),9,pt)])):f(``,!0)]))),256))])):f(``,!0),(v(!0),p(l,null,b(V.value,e=>(v(),p(`rect`,{x:e.x1,y:e.y1,height:I.value.branchSize,width:e.x2-e.x1,fill:j.value.underlayerColor,rx:j.value.borderRadius,stroke:`none`,style:_(`opacity:${q(e)?1:.05}`),onClick:t=>kr(e)},null,12,mt))),256)),(v(!0),p(l,null,b(V.value,(e,t)=>(v(),p(`rect`,{"aria-label":ni(e),x:e.x1,y:e.y1,height:I.value.branchSize,width:e.x2-e.x1,fill:j.value.useGradient?`url(#branch_gradient_${T.value}_${e.rootIndex})`:e.color,rx:j.value.borderRadius,stroke:j.value.stroke,"stroke-width":j.value.strokeWidth,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>kr(e)},null,12,ht))),256)),j.value.labels.dataLabels.show?(v(),p(`g`,gt,[(v(!0),p(l,null,b(V.value,e=>(v(),p(`g`,null,[e.proportionToRoot*100>j.value.labels.dataLabels.hideUnderValue?(v(),p(`text`,{key:0,x:e.x1+6,y:e.y1+I.value.branchSize/1.5,"text-anchor":`start`,fill:C(ce)(e.color),"font-size":j.value.labels.dataLabels.fontSize,"font-weight":`bold`,style:_(`cursor:${F.value?`pointer`:`default`}; opacity:${q(e)?1:.05}`),onClick:t=>kr(e)},S(C(c)(j.value.labels.dataLabels.formatter,e.value,C(n)({p:N.value.branches.labels.dataLabels.prefix,v:e.value,s:N.value.branches.labels.dataLabels.suffix,r:N.value.branches.labels.dataLabels.roundingValue}),{datapoint:e})),13,_t)):f(``,!0)]))),256))])):f(``,!0),(v(!0),p(l,null,b(V.value,(e,t)=>(v(),p(`g`,null,[(v(!0),p(l,null,b(C(a)({series:e.breakdown,base:1},e.x2+24+M.value.offsetX,e.y1+I.value.branchSize/2,I.value.branchSize/3,I.value.branchSize/3),(t,n)=>(v(),p(`path`,{d:t.path,stroke:t.color,"stroke-width":10,fill:`none`,style:_(`opacity:${q(e)?1:.1}`)},null,12,vt))),256)),m(`circle`,{"aria-label":`Open details for branch ${e.name} in root ${e.rootName}`,fill:M.value.useGradient?`url(#nut_${T.value})`:`transparent`,cx:e.x2+24+M.value.offsetX,cy:e.y1+I.value.branchSize/2,r:I.value.branchSize/2+2,onClick:t=>Or(e),style:_(`cursor:${F.value?`pointer`:`default`};opacity:${q(e)?1:.1}`)},null,12,yt)]))),256)),j.value.labels.show&&!W.value?(v(),p(`g`,bt,[(v(!0),p(l,null,b(V.value,e=>(v(),p(`text`,{x:e.x2+I.value.branchSize+24+M.value.offsetX,y:e.y1+I.value.branchSize/2+5,"font-size":j.value.labels.fontSize,"font-weight":j.value.labels.bold?`bold`:`normal`,fill:j.value.labels.color,"text-anchor":`start`,style:_(`opacity:${q(e)?1:.1}`)},S(e.name),13,xt))),256))])):f(``,!0),m(`line`,{x1:256+I.value.padding.left,x2:256+I.value.padding.left,y1:L.value.top,y2:L.value.bottom,stroke:N.value.verticalSeparator.stroke,"stroke-width":N.value.verticalSeparator.strokeWidth},null,8,St),!H.value&&!W.value?(v(),p(`foreignObject`,{key:6,x:0,y:L.value.bottom,height:I.value.height-L.value.bottom,width:I.value.width,style:{overflow:`visible`},"data-no-svg-export":``,onClick:t[6]||=()=>{K(),$(),E.value=!1}},[m(`div`,wt,[m(`div`,Tt,[(v(!0),p(l,null,b(B.value,e=>(v(),p(`div`,{style:_(`display:flex;align-items:center;gap:3px;flex-direction:row;font-size:${N.value.legend.fontSize}px;`)},[(v(),p(`svg`,Et,[m(`circle`,{cx:`10`,cy:`10`,r:`10`,fill:e.color,stroke:`none`},null,8,Dt)])),C($n)?f(``,!0):(v(),p(l,{key:0},[m(`span`,null,S(e.name)+`:`,1),m(`b`,null,S(C(c)(N.value.roots.labels.formatter,e.total,C(n)({p:P.value.layout.legend.prefix,v:e.total,s:P.value.layout.legend.suffix,r:P.value.layout.legend.roundingValue}),{datapoint:e})),1),Pe(` (`+S(C(n)({v:e.total/R.value*100,s:`%`,r:N.value.legend.roundingPercentage}))+`) `,1)],64))],4))),256))])])],8,Ct)):f(``,!0),H.value&&U.value?(v(),p(`g`,Ot,[(v(),p(`foreignObject`,{x:0,y:jr(),height:I.value.height-L.value.bottom,width:I.value.width,style:{overflow:`visible`},onClick:t[7]||=()=>{K(),$(),E.value=!1}},[m(`div`,At,[m(`b`,null,S(H.value.name),1),m(`div`,jt,[(v(!0),p(l,null,b(H.value.breakdown,(e,t)=>(v(),p(`div`,{style:_(`display:flex;align-items:center;gap:6px;flex-direction:row;font-size:${N.value.legend.fontSize}px;`)},[(v(),p(`svg`,Mt,[m(`circle`,{cx:`10`,cy:`10`,r:`10`,fill:e.color,stroke:`none`},null,8,Nt)])),m(`span`,null,[Pe(S(e.name)+`: `,1),m(`b`,null,S(N.value.legend.prefix)+` `+S(e.value.toFixed(P.value.layout.nuts.selected.labels.roundingValue))+` `+S(N.value.legend.suffix),1),Pe(` (`+S((e.proportionToBranch*100).toFixed(N.value.nuts.selected.labels.roundingPercentage))+`%)`,1)])],4))),256))])])],8,kt)),m(`circle`,{cx:H.value.x2+24+M.value.offsetX,cy:H.value.y1+I.value.branchSize/2,r:256,fill:`url(#nut_underlayer_${T.value})`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Pt),(v(!0),p(l,null,b(U.value,e=>(v(),p(`g`,null,[Mr(e)?(v(),p(`path`,{key:0,d:C(ie)(e,{x:H.value.x2+24+M.value.offsetX,y:H.value.y1+I.value.branchSize/2},16,16,!1,!1,64),stroke:e.color,"stroke-width":`1`,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Ft)):f(``,!0)]))),256)),m(`circle`,{cx:H.value.x2+24+M.value.offsetX,cy:H.value.y1+I.value.branchSize/2,r:118,fill:P.value.backgroundColor,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,It),(v(!0),p(l,null,b(U.value,e=>(v(),p(`path`,{d:e.path,stroke:e.color,"stroke-width":64,fill:`none`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Lt))),256)),m(`circle`,{cx:H.value.x2+24+M.value.offsetX,cy:H.value.y1+I.value.branchSize/2,r:110,fill:`url(#nutpick_${T.value})`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,Rt),m(`circle`,{cx:H.value.x2+24+M.value.offsetX,cy:H.value.y1+I.value.branchSize/2,r:64,fill:P.value.backgroundColor,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},null,10,zt),m(`text`,{x:H.value.x2+24+M.value.offsetX,y:H.value.y1+8,fill:M.value.selected.labels.core.total.color,"font-size":M.value.selected.labels.core.total.fontSize,"font-weight":M.value.selected.labels.core.total.bold?`bold`:`normal`,"text-anchor":`middle`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(k.value.translations.total),11,Bt),m(`text`,{x:H.value.x2+24+M.value.offsetX,y:H.value.y1+36,fill:M.value.selected.labels.core.value.color,"font-size":M.value.selected.labels.core.value.fontSize,"font-weight":M.value.selected.labels.core.value.bold?`bold`:`normal`,"text-anchor":`middle`,onClick:J,class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(c)(M.value.selected.labels.dataLabels.formatter,H.value.value,C(n)({p:M.value.selected.labels.core.value.prefix,v:H.value.value,s:M.value.selected.labels.core.value.suffix,r:M.value.selected.roundingValue}),{datapoint:H.value})),11,Vt),(v(!0),p(l,null,b(U.value,(e,t)=>(v(),p(`g`,null,[Mr(e)?(v(),p(`text`,{key:0,x:C(s)(e).x,"text-anchor":C(s)(e).anchor,y:C(se)(e)-M.value.selected.labels.dataLabels.fontSize/6,fill:e.color,"font-size":M.value.selected.labels.dataLabels.fontSize/2,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},` ⬤ `,14,Ht)):f(``,!0),Mr(e)?(v(),p(`text`,{key:1,x:C(s)(e,!0).x,"text-anchor":C(s)(e,!0).anchor,y:C(se)(e),fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(H.value.breakdown[t].name),15,Ut)):f(``,!0)]))),256)),(v(!0),p(l,null,b(U.value,(e,t)=>(v(),p(`g`,null,[Mr(e)?(v(),p(`text`,{key:0,x:C(s)(e,!0).x,"text-anchor":C(s)(e).anchor,y:C(se)(e)+M.value.selected.labels.dataLabels.fontSize,fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(n)({v:H.value.breakdown[t].value/H.value.value*100,s:`%`,r:M.value.selected.labels.roundingPercentage}))+` `+S(k.value.translations.of)+` `+S(H.value.breakdown[t].branchName)+` `+S(C(c)(M.value.selected.labels.dataLabels.formatter,H.value.breakdown[t].value,C(n)({p:M.value.selected.labels.dataLabels.prefix,v:H.value.breakdown[t].value,s:M.value.selected.labels.dataLabels.suffix,r:M.value.selected.roundingValue}),{datapoint:U.value,seriesIndex:t})),15,Wt)):f(``,!0),Mr(e)?(v(),p(`text`,{key:1,x:C(s)(e,!0).x,"text-anchor":C(s)(e).anchor,y:C(se)(e)+M.value.selected.labels.dataLabels.fontSize*2,fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(n)({v:H.value.breakdown[t].proportionToRoot*100,s:`%`,r:M.value.selected.labels.roundingPercentage}))+` `+S(k.value.translations.of)+` `+S(H.value.breakdown[t].rootName),15,Gt)):f(``,!0),Mr(e)?(v(),p(`text`,{key:2,x:C(s)(e,!0).x,"text-anchor":C(s)(e).anchor,y:C(se)(e)+M.value.selected.labels.dataLabels.fontSize*3,fill:M.value.selected.labels.dataLabels.color,"font-size":M.value.selected.labels.dataLabels.fontSize,style:_(`font-weight:${M.value.selected.labels.dataLabels.bold?`bold`:``}`),class:g(M.value.selected.useMotion?`vue-ui-chestnut-animated`:``)},S(C(n)({v:H.value.breakdown[t].proportionToTree*100,s:`%`,r:M.value.selected.labels.roundingPercentage}))+` `+S(k.value.translations.proportionToTree),15,Kt)):f(``,!0)]))),256))])):f(``,!0),(v(!0),p(l,null,b(V.value,e=>(v(),p(`g`,null,[W.value&&W.value.id===e.id&&!H.value?(v(),p(`text`,{key:0,x:e.x1+6,y:e.y1+I.value.branchSize+24,"font-weight":`bold`,"text-anchor":`start`,"font-size":j.value.labels.dataLabels.fontSize,fill:j.value.labels.color,onClick:t[8]||=()=>{K(),$(),E.value=!1}},S(e.name)+`: `+S(C(c)(j.value.labels.dataLabels.formatter,e.value,C(n)({p:j.value.labels.dataLabels.prefix,v:e.value,s:j.value.labels.dataLabels.suffix,r:j.value.labels.dataLabels.roundingValue}),{datapoint:e})),9,qt)):f(``,!0),W.value&&W.value.id===e.id&&!H.value?(v(),p(`text`,{key:1,x:e.x1+6,y:e.y1+I.value.branchSize+48,"text-anchor":`start`,"font-size":j.value.labels.dataLabels.fontSize,fill:j.value.labels.color,onClick:t[9]||=()=>{K(),$(),E.value=!1}},S(C(n)({v:e.proportionToRoot*100,s:`%`,r:j.value.labels.dataLabels.roundingPercentage}))+` `+S(k.value.translations.of)+` `+S(e.rootName),9,Jt)):f(``,!0),W.value&&W.value.id===e.id&&!H.value?(v(),p(`text`,{key:2,x:e.x1+6,y:e.y1+I.value.branchSize+72,"text-anchor":`start`,"font-size":j.value.labels.dataLabels.fontSize,fill:j.value.labels.color,onClick:t[10]||=()=>{K(),$(),E.value=!1}},S(C(n)({v:e.value/R.value*100,s:`%`,r:j.value.labels.dataLabels.roundingPercentage}))+` `+S(k.value.translations.proportionToTree),9,Yt)):f(``,!0)]))),256)),x(e.$slots,`svg`,{svg:{...I.value,isPrintingImg:C(or)||C(sr)||C(Xr),isPrintingSvg:C(Zr)}},void 0,!0)],46,$e)):f(``,!0)]),e.$slots.watermark?(v(),p(`div`,Xt,[x(e.$slots,`watermark`,ze(Ie({isPrinting:C(or)||C(sr)||C(Xr)||C(Zr)})),void 0,!0)])):f(``,!0),x(e.$slots,`legend`,{legend:z.value},void 0,!0),e.$slots.source?(v(),p(`div`,Zt,[x(e.$slots,`source`,{},void 0,!0)],512)):f(``,!0),Kn.value&&k.value.userOptions.buttons.table?(v(),d(Ve(Hr.value.component),Le({key:6},Hr.value.props,{ref_key:`tableUnit`,ref:Yn,onClose:Wr}),Ne({content:Ge(()=>[m(`div`,{ref_key:`tableContainer`,ref:pr,class:`vue-ui-chestnut-table`,style:_(`${k.value.table.useDialog?``:`max-height: 300px;margin-top:24px`}`)},[m(`div`,{style:_(`${k.value.table.useDialog?``:`padding-top:36px;`}position: relative`)},[k.value.table.useDialog?f(``,!0):(v(),p(`div`,{key:0,role:`button`,tabindex:`0`,style:_(`width:32px; position: absolute; top: 0; left:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:${F.value?`pointer`:`default`}; background:${k.value.table.th.backgroundColor};`),onClick:Wr,onKeypress:Ke(Wr,[`enter`])},[h(C(zn),{name:`close`,stroke:k.value.table.th.color,"stroke-width":2},null,8,[`stroke`])],36)),m(`div`,{style:{width:`100%`},class:g({"vue-ui-responsive":C(Ur)})},[m(`table`,Qt,[k.value.table.useDialog?f(``,!0):(v(),p(`caption`,{key:0,style:_({backgroundColor:k.value.table.th.backgroundColor,color:k.value.table.th.color,outline:k.value.table.th.outline}),class:`vue-ui-data-table__caption`},[Pe(S(N.value.title.text)+` `,1),N.value.title.subtitle.text?(v(),p(`span`,$t,S(N.value.title.subtitle.text),1)):f(``,!0)],4)),m(`thead`,null,[m(`tr`,{role:`row`,style:_(`background:${k.value.table.th.backgroundColor};color:${k.value.table.th.color}`)},[(v(!0),p(l,null,b(Y.value.head,e=>(v(),p(`th`,{style:_(`outline:${k.value.table.th.outline}`)},S(e),5))),256))],4)]),m(`tbody`,null,[(v(!0),p(l,null,b(Y.value.body,(e,t)=>(v(),p(`tr`,{class:g({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":t%2==0,"vue-ui-data-table__tbody__row-odd":t%2!=0}),style:_(`background:${k.value.table.td.backgroundColor};color:${k.value.table.td.color}`)},[m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[0]},[m(`div`,tn,[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?(v(),p(`span`,nn)):(v(),p(`span`,rn,S(e.rootName),1))])],12,en),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[1]},[m(`div`,on,[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?(v(),p(`span`,sn)):(v(),p(`span`,cn,S(e.rootValue.toFixed(k.value.table.td.roundingValue)),1))])],12,an),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[2]},[m(`div`,un,[Y.value.body[t-1]&&Y.value.body[t-1].rootName===e.rootName?(v(),p(`span`,dn)):(v(),p(`span`,fn,S((e.rootToTotal*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1))])],12,ln),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[3]},[m(`div`,mn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(v(),p(`span`,hn)):(v(),p(`span`,gn,S(e.branchName),1))])],12,pn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[4]},[m(`div`,vn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(v(),p(`span`,yn)):(v(),p(`span`,bn,S(e.branchValue.toFixed(k.value.table.td.roundingValue)),1))])],12,_n),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[5]},[m(`div`,Sn,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(v(),p(`span`,Cn)):(v(),p(`span`,wn,S((e.branchToRoot*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1))])],12,xn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[6]},[m(`div`,En,[Y.value.body[t-1]&&Y.value.body[t-1].branchName===e.branchName?(v(),p(`span`,Dn)):(v(),p(`span`,On,S((e.branchToTotal*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1))])],12,Tn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[7]},[m(`div`,An,S(e.nutName),1)],12,kn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[8]},[m(`div`,Mn,S(e.nutValue.toFixed(k.value.table.td.roundingValue)),1)],12,jn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[9]},[m(`div`,Pn,S((e.nutToBranch*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1)],12,Nn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[10]},[m(`div`,In,S((e.nutToRoot*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1)],12,Fn),m(`td`,{class:`vue-ui-data-table__tbody__td`,style:_(`outline:${k.value.table.td.outline}`),"data-cell":Y.value.head[11]},[m(`div`,Rn,S((e.nutToTotal*100).toFixed(k.value.table.td.roundingPercentage))+`% `,1)],12,Ln)],6))),256))])])],2)],4)],4)]),_:2},[k.value.table.useDialog?{name:`title`,fn:Ge(()=>[Pe(S(Hr.value.title),1)]),key:`0`}:void 0,k.value.table.useDialog?{name:`actions`,fn:Ge(()=>[m(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[11]||=e=>Pr(k.value.userOptions.callbacks.csv)},[h(C(zn),{name:`fileCsv`,stroke:Hr.value.props.color},null,8,[`stroke`])])]),key:`1`}:void 0]),1040)):f(``,!0),x(e.$slots,`skeleton`,{},()=>[C($n)?(v(),d(me,{key:0})):f(``,!0)],!0)],46,Je))}},[[`__scopeId`,`data-v-19d2209e`]]);export{qe as n,zn as t};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,D as r,Ht as i,S as a,X as o,Y as s,at as c,i as ee,in as l,nt as te,r as ne,sn as re,t as ie,w as ae,yt as oe,zt as se}from"./lib-rPeBMZrn.js";import{n as ce,t as le}from"./BaseScanner-8NdoBs7B.js";import{n as ue}from"./useHints-BH9r_0Vd.js";import{t as de}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as fe}from"./resolveChartConfig-CIhClE5R.js";import{t as pe}from"./chartImage-DPGnEuYM.js";import{n as me}from"./Title-BliHuXfT.js";import{t as he}from"./useChartExport-BZts4KFb.js";import{n as ge,t as _e}from"./tableIntegration-CNoJ1CIY.js";import{n as ve,t as ye}from"./annotationSlots-BRR85CqJ.js";import{n as be,t as xe}from"./userOptionsSlots-DYuo-E5m.js";import{t as Se}from"./usePrinter-sVoTzet1.js";import{t as Ce}from"./Shape-CRe8woTu.js";import{c as we}from"./canvas-lib-22VpOI4_.js";import{t as Te}from"./useResponsive-CENUxfEL.js";import{t as Ee}from"./A11yDataTable-DWNlWXzs.js";import{t as De}from"./useUserOptionState-CXlFnwPv.js";import{t as Oe}from"./useChartAccessibility-DOMuYJfm.js";import{t as ke}from"./Legend-DM0ClX3D.js";import{t as Ae}from"./vue_ui_chord-Fq6VBRT1.js";import{Fragment as u,Teleport as je,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as Me,createTextVNode as Ne,createVNode as Pe,defineAsyncComponent as g,guardReactiveProps as Fe,mergeProps as Ie,nextTick as Le,normalizeClass as _,normalizeProps as Re,normalizeStyle as v,onBeforeUnmount as ze,onMounted as Be,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as Ve,shallowRef as He,toDisplayString as C,toRefs as Ue,unref as w,useCssVars as We,watch as Ge,withCtx as T,withModifiers as Ke}from"vue";var qe=/* @__PURE__ */ e({default:()=>Tt}),Je=[`id`],Ye=[`id`],Xe=[`id`],Ze=[`xmlns`,`viewBox`,`aria-describedby`],Qe=[`width`,`height`],$e={key:1},et=[`id`,`d`],tt={key:2},nt=[`transform`],rt=[`d`,`fill`,`stroke`,`stroke-width`,`onMouseenter`,`onMouseleave`,`onClick`],it=[`d`,`fill`,`stroke`,`stroke-width`],at=[`d`,`fill`],ot=[`d`,`fill`,`stroke`,`stroke-width`,`onMouseenter`,`onClick`,`onMouseleave`],st=[`d`,`fill`,`stroke`,`stroke-width`],ct=[`d`,`fill`,`stroke`,`stroke-width`],lt=[`d`,`fill`,`stroke`,`stroke-width`],ut={key:0},dt=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],ft=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],pt=[`cx`,`cy`,`r`,`stroke`,`stroke-width`,`fill`],mt=[`transform`,`fill`,`text-anchor`,`font-size`,`font-weight`],ht={key:1},gt=[`font-size`,`font-weight`,`fill`],_t=[`href`],vt=[`transform`,`text-anchor`,`font-size`,`font-weight`,`fill`,`innerHTML`],yt={key:5,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},bt={key:6,class:`vue-data-ui-watermark`},xt=[`id`],St=[`onClick`],Ct={key:9,"data-dom-to-png-ignore":``,class:`reset-wrapper`},wt={style:{"text-align":`right`,width:`100%`}},Tt=/*#__PURE__*/ de({__name:`vue-ui-chord`,props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},emits:[`selectLegend`,`selectGroup`,`selectRibbon`,`copyAlt`],setup(e,{expose:de,emit:qe}){We(e=>({v4f2ad1de:e.slicerColor}));let Tt=g(()=>import(`./vue-ui-accordion-S3nRtTU-.js`).then(e=>e.n)),Et=g(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),Dt=g(()=>import(`./DataTable-0Vv-aGHD.js`)),Ot=g(()=>import(`./PackageVersion-BIhjLNBU.js`).then(e=>e.t)),kt=g(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),At=g(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),jt=g(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),{vue_ui_chord:Mt}=t(),E=e,Nt=qe,D=b(!!E.dataset&&Object.hasOwn(E.dataset,`matrix`)),O=b(o()),k=b(null),A=b(null),j=b(null),Pt=b(0),M=b(null),Ft=b(null),It=b(null),Lt=b(null),Rt=b(null),zt=b(0),Bt=b(0),Vt=b(0),Ht=b(!1),N=He(null),P=He(null),Ut=b(!1),Wt=b(null),Gt=b(null),F=b(`group`),I=b(null),Kt=b(!1),L=b(rn()),R=d(()=>L.value.style.chart.arcs),z=d(()=>L.value.style.chart.ribbons),B=d(()=>L.value.style.chart);ue({config:()=>L.value,dataset:()=>E.dataset,component:`VueUiChord`,rules:[{test:e=>e.matrix&&e.matrix.length>12,message:[`👀 The number of groups > 12, the chart might become hard to read. Consider:`,``,`▶️ Using broader groups to reduce their number.`]}]});let V=d(()=>L.value.userOptions.useCursorPointer),qt=d(()=>l({defaultConfig:{useCssAnimation:!1,userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,legend:{backgroundColor:`transparent`},arcs:{stroke:`#6A6A6A`,labels:{show:!1}},ribbons:{stroke:`#6A6A6A`,underlayerOpacity:0,labels:{show:!1}}}}},userConfig:L.value.skeletonConfig??{}})),{loading:Jt,FINAL_DATASET:H,manualLoading:Yt}=ce({...Ue(E),FINAL_CONFIG:L,prepareConfig:rn,callback:()=>{Promise.resolve().then(async()=>{await Le(),W.value.showTable=L.value.table.show})},skeletonDataset:E.config?.skeletonDataset??{matrix:[[12e3,6e3,9e3,3e3],[2e3,1e4,2e3,6001],[8e3,1600,8e3,8001],[1e3,1e3,1e3,7001]],labels:[],colors:[`#DBDBDB`,`#C4C4C4`,`#ADADAD`,`#969696`]},skeletonConfig:l({defaultConfig:L.value,userConfig:qt.value})}),{userOptionsVisible:Xt,setUserOptionsVisibility:Zt,keepUserOptionState:Qt}=De({config:L.value}),{svgRef:U}=Oe({config:B.value.title}),{isPrinting:$t,isImaging:en,generatePdf:tn,generateImage:nn}=Se({elementId:`chord_${O.value}`,fileName:B.value.title.text||`vue-ui-chord`,options:L.value.userOptions.print}),W=b({showTable:L.value.table.show});function rn(){return fe(E.config,Mt,Ae)}Ge(()=>E.config,e=>{Jt.value||(L.value=rn()),Xt.value=!L.value.userOptions.showOnChartHover,on(),zt.value+=1,Bt.value+=1,Vt.value+=1,X.value=L.value.initialRotation,W.value.showTable=L.value.table.show},{deep:!0});let G=d(()=>L.value.debug);Ge(()=>E.dataset,()=>{an(),on(),zt.value+=1,Bt.value+=1,Vt.value+=1});function an(){if(se(E.dataset)){c({componentName:`VueUiChord`,type:`dataset`,debug:G.value}),D.value=!1,Yt.value=!0;return}let e=oe({datasetObject:E.dataset,requiredAttributes:[`matrix`]});if(e.length){G.value&&e.forEach(e=>{c({componentName:`VueUiChord`,type:`datasetAttribute`,property:e})}),D.value=!1,Yt.value=!0;return}let t=E.dataset.matrix;if(!Array.isArray(t)||t.length<2){G.value&&console.warn(`VueUiChord: dataset.matrix requires a minimum of 2 datapoints, for example:
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-6jO1fkp5.js";import{$ as n,D as r,Ht as i,S as a,X as o,Y as s,at as c,i as ee,in as l,nt as te,r as ne,sn as re,t as ie,w as ae,yt as oe,zt as se}from"./lib-rPeBMZrn.js";import{n as ce,t as le}from"./BaseScanner-8NdoBs7B.js";import{n as ue}from"./useHints-C-TwxM0Y.js";import{t as de}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as fe}from"./resolveChartConfig-CIhClE5R.js";import{t as pe}from"./chartImage-DPGnEuYM.js";import{n as me}from"./Title-BliHuXfT.js";import{t as he}from"./useChartExport-BZts4KFb.js";import{n as ge,t as _e}from"./tableIntegration-CNoJ1CIY.js";import{n as ve,t as ye}from"./annotationSlots-BRR85CqJ.js";import{n as be,t as xe}from"./userOptionsSlots-DYuo-E5m.js";import{t as Se}from"./usePrinter-DVf3YcG5.js";import{t as Ce}from"./Shape-CRe8woTu.js";import{c as we}from"./canvas-lib-22VpOI4_.js";import{t as Te}from"./useResponsive-CENUxfEL.js";import{t as Ee}from"./A11yDataTable-DWNlWXzs.js";import{t as De}from"./useUserOptionState-CXlFnwPv.js";import{t as Oe}from"./useChartAccessibility-DOMuYJfm.js";import{t as ke}from"./Legend-DM0ClX3D.js";import{t as Ae}from"./vue_ui_chord-Fq6VBRT1.js";import{Fragment as u,Teleport as je,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as Me,createTextVNode as Ne,createVNode as Pe,defineAsyncComponent as g,guardReactiveProps as Fe,mergeProps as Ie,nextTick as Le,normalizeClass as _,normalizeProps as Re,normalizeStyle as v,onBeforeUnmount as ze,onMounted as Be,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as Ve,shallowRef as He,toDisplayString as C,toRefs as Ue,unref as w,useCssVars as We,watch as Ge,withCtx as T,withModifiers as Ke}from"vue";var qe=/* @__PURE__ */ e({default:()=>Tt}),Je=[`id`],Ye=[`id`],Xe=[`id`],Ze=[`xmlns`,`viewBox`,`aria-describedby`],Qe=[`width`,`height`],$e={key:1},et=[`id`,`d`],tt={key:2},nt=[`transform`],rt=[`d`,`fill`,`stroke`,`stroke-width`,`onMouseenter`,`onMouseleave`,`onClick`],it=[`d`,`fill`,`stroke`,`stroke-width`],at=[`d`,`fill`],ot=[`d`,`fill`,`stroke`,`stroke-width`,`onMouseenter`,`onClick`,`onMouseleave`],st=[`d`,`fill`,`stroke`,`stroke-width`],ct=[`d`,`fill`,`stroke`,`stroke-width`],lt=[`d`,`fill`,`stroke`,`stroke-width`],ut={key:0},dt=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],ft=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],pt=[`cx`,`cy`,`r`,`stroke`,`stroke-width`,`fill`],mt=[`transform`,`fill`,`text-anchor`,`font-size`,`font-weight`],ht={key:1},gt=[`font-size`,`font-weight`,`fill`],_t=[`href`],vt=[`transform`,`text-anchor`,`font-size`,`font-weight`,`fill`,`innerHTML`],yt={key:5,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},bt={key:6,class:`vue-data-ui-watermark`},xt=[`id`],St=[`onClick`],Ct={key:9,"data-dom-to-png-ignore":``,class:`reset-wrapper`},wt={style:{"text-align":`right`,width:`100%`}},Tt=/*#__PURE__*/ de({__name:`vue-ui-chord`,props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},emits:[`selectLegend`,`selectGroup`,`selectRibbon`,`copyAlt`],setup(e,{expose:de,emit:qe}){We(e=>({v25ca2581:e.slicerColor}));let Tt=g(()=>import(`./vue-ui-accordion-S3nRtTU-.js`).then(e=>e.n)),Et=g(()=>import(`./BaseIcon-Cm-IJ179.js`).then(e=>e.n)),Dt=g(()=>import(`./DataTable-0Vv-aGHD.js`)),Ot=g(()=>import(`./PackageVersion-DhptF5oD.js`).then(e=>e.t)),kt=g(()=>import(`./PenAndPaper-BGEp-TUm.js`).then(e=>e.t)),At=g(()=>import(`./UserOptions-uWHV_zPB.js`).then(e=>e.n)),jt=g(()=>import(`./BaseDraggableDialog-DHgIPVmz.js`).then(e=>e.n)),{vue_ui_chord:Mt}=t(),E=e,Nt=qe,D=b(!!E.dataset&&Object.hasOwn(E.dataset,`matrix`)),O=b(o()),k=b(null),A=b(null),j=b(null),Pt=b(0),M=b(null),Ft=b(null),It=b(null),Lt=b(null),Rt=b(null),zt=b(0),Bt=b(0),Vt=b(0),Ht=b(!1),N=He(null),P=He(null),Ut=b(!1),Wt=b(null),Gt=b(null),F=b(`group`),I=b(null),Kt=b(!1),L=b(rn()),R=d(()=>L.value.style.chart.arcs),z=d(()=>L.value.style.chart.ribbons),B=d(()=>L.value.style.chart);ue({config:()=>L.value,dataset:()=>E.dataset,component:`VueUiChord`,rules:[{test:e=>e.matrix&&e.matrix.length>12,message:[`👀 The number of groups > 12, the chart might become hard to read. Consider:`,``,`▶️ Using broader groups to reduce their number.`]}]});let V=d(()=>L.value.userOptions.useCursorPointer),qt=d(()=>l({defaultConfig:{useCssAnimation:!1,userOptions:{show:!1},table:{show:!1},style:{chart:{backgroundColor:`#99999930`,legend:{backgroundColor:`transparent`},arcs:{stroke:`#6A6A6A`,labels:{show:!1}},ribbons:{stroke:`#6A6A6A`,underlayerOpacity:0,labels:{show:!1}}}}},userConfig:L.value.skeletonConfig??{}})),{loading:Jt,FINAL_DATASET:H,manualLoading:Yt}=ce({...Ue(E),FINAL_CONFIG:L,prepareConfig:rn,callback:()=>{Promise.resolve().then(async()=>{await Le(),W.value.showTable=L.value.table.show})},skeletonDataset:E.config?.skeletonDataset??{matrix:[[12e3,6e3,9e3,3e3],[2e3,1e4,2e3,6001],[8e3,1600,8e3,8001],[1e3,1e3,1e3,7001]],labels:[],colors:[`#DBDBDB`,`#C4C4C4`,`#ADADAD`,`#969696`]},skeletonConfig:l({defaultConfig:L.value,userConfig:qt.value})}),{userOptionsVisible:Xt,setUserOptionsVisibility:Zt,keepUserOptionState:Qt}=De({config:L.value}),{svgRef:U}=Oe({config:B.value.title}),{isPrinting:$t,isImaging:en,generatePdf:tn,generateImage:nn}=Se({elementId:`chord_${O.value}`,fileName:B.value.title.text||`vue-ui-chord`,options:L.value.userOptions.print}),W=b({showTable:L.value.table.show});function rn(){return fe(E.config,Mt,Ae)}Ge(()=>E.config,e=>{Jt.value||(L.value=rn()),Xt.value=!L.value.userOptions.showOnChartHover,on(),zt.value+=1,Bt.value+=1,Vt.value+=1,X.value=L.value.initialRotation,W.value.showTable=L.value.table.show},{deep:!0});let G=d(()=>L.value.debug);Ge(()=>E.dataset,()=>{an(),on(),zt.value+=1,Bt.value+=1,Vt.value+=1});function an(){if(se(E.dataset)){c({componentName:`VueUiChord`,type:`dataset`,debug:G.value}),D.value=!1,Yt.value=!0;return}let e=oe({datasetObject:E.dataset,requiredAttributes:[`matrix`]});if(e.length){G.value&&e.forEach(e=>{c({componentName:`VueUiChord`,type:`datasetAttribute`,property:e})}),D.value=!1,Yt.value=!0;return}let t=E.dataset.matrix;if(!Array.isArray(t)||t.length<2){G.value&&console.warn(`VueUiChord: dataset.matrix requires a minimum of 2 datapoints, for example:
2
2
 
3
3
  matrix:[
4
4
  [1, 1],
@@ -18,4 +18,4 @@ matrix:[
18
18
  `,fill:z.value.labels.useSerieColor?e.groupColor:z.value.labels.color,"text-anchor":bn(e.theta),"font-size":z.value.labels.fontSize,"font-weight":z.value.labels.bold?`bold`:`normal`,dy:`.35em`,"pointer-events":`none`},C(An(e.value)),9,mt)],64))),128))])):p(``,!0),R.value.labels.show?(y(),m(`g`,ht,[R.value.labels.curved?(y(!0),m(u,{key:0},x(Y.value.groups,(e,t)=>(y(),m(`text`,{class:`vue-ui-chord-label-curved`,key:`curved-label-${t}`,"font-size":R.value.labels.fontSize,"font-weight":R.value.labels.bold?`bold`:`normal`,fill:R.value.labels.adaptColorToBackground?w(ne)(J.value.colors[t]):R.value.labels.color},[h(`textPath`,{href:`#labelPath-${t}_${O.value}`,startOffset:`50%`,"text-anchor":`middle`},C(J.value.labels[t])+C(R.value.labels.showPercentage?w(n)({p:` (`,v:isNaN(e.proportion)?0:e.proportion*100,s:`%)`,r:R.value.labels.roundingPercentage}):``),9,_t)],8,gt))),128)):!k.value&&!A.value&&!j.value?(y(!0),m(u,{key:1},x(Y.value.groups,(e,t)=>(y(),m(`text`,{class:`vue-ui-chord-label-straight`,key:`label-${t}`,transform:`
19
19
  ${xn((e.startAngle+e.endAngle)/2)}
20
20
  rotate(${-X.value})
21
- `,dy:`.35em`,"text-anchor":yn(e)>Math.PI?`end`:`start`,"font-size":R.value.labels.fontSize,"font-weight":R.value.labels.bold?`bold`:`normal`,fill:R.value.labels.color,innerHTML:w(s)({content:w(re)(Qn(e,t)),fontSize:R.value.labels.fontSize,fill:R.value.labels.color,x:0,y:0})},null,8,vt))),128)):p(``,!0)])):p(``,!0)],8,nt),S(e.$slots,`svg`,{svg:{height:600,width:600,isPrintingImg:w($t)||w(en)||w(ir),isPrintingSvg:w(ar)}},void 0,!0)],42,Ze)),e.$slots.hint?(y(),m(`div`,yt,[S(e.$slots,`hint`,Re(Fe({hint:L.value.a11y.translations.keyboardNavigation,isVisible:Kt.value})),void 0,!0)])):p(``,!0),e.$slots.watermark?(y(),m(`div`,bt,[S(e.$slots,`watermark`,Re(Fe({isPrinting:w($t)||w(en)||w(ir)||w(ar)})),void 0,!0)])):p(``,!0),h(`div`,{id:`legend-bottom-${O.value}`},null,8,xt),Ut.value&&(B.value.legend.show||e.$slots.legend)?(y(),f(je,{key:7,to:B.value.legend.position===`top`?`#legend-top-${O.value}`:`#legend-bottom-${O.value}`},[h(`div`,{ref_key:`chartLegend`,ref:It},[S(e.$slots,`legend`,{legend:qn.value},()=>[B.value.legend.show?(y(),f(ke,{key:`legend_${Vt.value}`,legendSet:qn.value,config:Jn.value,isCursorPointer:V.value,onClickMarker:t[0]||=({legend:e})=>Kn(e.id)},Me({item:T(({legend:e})=>[h(`div`,{style:v({opacity:j.value?j.value===e.id?1:.3:1}),onClick:t=>e.select()},C(e.name),13,St)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:T(({legend:e,index:t})=>[Pe(Ce,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${O.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`])):p(``,!0)],!0)],512)],8,[`to`])):p(``,!0),e.$slots.source?(y(),m(`div`,{key:8,ref_key:`source`,ref:Lt,dir:`auto`},[S(e.$slots,`source`,{},void 0,!0)],512)):p(``,!0),X.value===L.value.initialRotation?p(``,!0):(y(),m(`div`,Ct,[S(e.$slots,`reset-action`,{reset:Gn},()=>[h(`button`,{"data-cy-reset":``,tabindex:`0`,role:`button`,class:`vue-data-ui-refresh-button`,style:v({background:B.value.backgroundColor,cursor:V.value?`pointer`:`default`}),onClick:Gn},[Pe(w(Et),{name:`refresh`,stroke:B.value.color},null,8,[`stroke`])],4)],!0)])),D.value&&L.value.userOptions.buttons.table?(y(),f(Ve($n.value.component),Ie({key:10},$n.value.props,{ref_key:`tableUnit`,ref:Wt,onClose:er}),Me({content:T(()=>[(y(),f(w(Dt),{key:`table_${Bt.value}`,colNames:Yn.value.colNames,head:Yn.value.head,body:Yn.value.body,config:Yn.value.config,title:L.value.table.useDialog?``:$n.value.title,withCloseButton:!L.value.table.useDialog,isCursorPointer:V.value,onClose:er},{th:T(({th:e})=>[Ne(C(e.name),1)]),td:T(({td:e})=>[h(`div`,wt,C(e.name?e.name:An(e)),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[L.value.table.useDialog?{name:`title`,fn:T(()=>[Ne(C($n.value.title),1)]),key:`0`}:void 0,L.value.table.useDialog?{name:`actions`,fn:T(()=>[h(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[1]||=e=>Xn(L.value.userOptions.callbacks.csv),style:v({cursor:V.value?`pointer`:`default`})},[Pe(w(Et),{name:`fileCsv`,stroke:$n.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):p(``,!0),S(e.$slots,`skeleton`,{},()=>[w(Jt)?(y(),f(le,{key:0})):p(``,!0)],!0)],46,Je))}},[[`__scopeId`,`data-v-64db52b8`]]);export{qe as n,Tt as t};
21
+ `,dy:`.35em`,"text-anchor":yn(e)>Math.PI?`end`:`start`,"font-size":R.value.labels.fontSize,"font-weight":R.value.labels.bold?`bold`:`normal`,fill:R.value.labels.color,innerHTML:w(s)({content:w(re)(Qn(e,t)),fontSize:R.value.labels.fontSize,fill:R.value.labels.color,x:0,y:0})},null,8,vt))),128)):p(``,!0)])):p(``,!0)],8,nt),S(e.$slots,`svg`,{svg:{height:600,width:600,isPrintingImg:w($t)||w(en)||w(ir),isPrintingSvg:w(ar)}},void 0,!0)],42,Ze)),e.$slots.hint?(y(),m(`div`,yt,[S(e.$slots,`hint`,Re(Fe({hint:L.value.a11y.translations.keyboardNavigation,isVisible:Kt.value})),void 0,!0)])):p(``,!0),e.$slots.watermark?(y(),m(`div`,bt,[S(e.$slots,`watermark`,Re(Fe({isPrinting:w($t)||w(en)||w(ir)||w(ar)})),void 0,!0)])):p(``,!0),h(`div`,{id:`legend-bottom-${O.value}`},null,8,xt),Ut.value&&(B.value.legend.show||e.$slots.legend)?(y(),f(je,{key:7,to:B.value.legend.position===`top`?`#legend-top-${O.value}`:`#legend-bottom-${O.value}`},[h(`div`,{ref_key:`chartLegend`,ref:It},[S(e.$slots,`legend`,{legend:qn.value},()=>[B.value.legend.show?(y(),f(ke,{key:`legend_${Vt.value}`,legendSet:qn.value,config:Jn.value,isCursorPointer:V.value,onClickMarker:t[0]||=({legend:e})=>Kn(e.id)},Me({item:T(({legend:e})=>[h(`div`,{style:v({opacity:j.value?j.value===e.id?1:.3:1}),onClick:t=>e.select()},C(e.name),13,St)]),_:2},[e.$slots.pattern?{name:`legend-pattern`,fn:T(({legend:e,index:t})=>[Pe(Ce,{shape:e.shape,radius:30,stroke:`none`,plot:{x:30,y:30},fill:`url(#pattern_${O.value}_${t})`},null,8,[`shape`,`fill`])]),key:`0`}:void 0]),1032,[`legendSet`,`config`,`isCursorPointer`])):p(``,!0)],!0)],512)],8,[`to`])):p(``,!0),e.$slots.source?(y(),m(`div`,{key:8,ref_key:`source`,ref:Lt,dir:`auto`},[S(e.$slots,`source`,{},void 0,!0)],512)):p(``,!0),X.value===L.value.initialRotation?p(``,!0):(y(),m(`div`,Ct,[S(e.$slots,`reset-action`,{reset:Gn},()=>[h(`button`,{"data-cy-reset":``,tabindex:`0`,role:`button`,class:`vue-data-ui-refresh-button`,style:v({background:B.value.backgroundColor,cursor:V.value?`pointer`:`default`}),onClick:Gn},[Pe(w(Et),{name:`refresh`,stroke:B.value.color},null,8,[`stroke`])],4)],!0)])),D.value&&L.value.userOptions.buttons.table?(y(),f(Ve($n.value.component),Ie({key:10},$n.value.props,{ref_key:`tableUnit`,ref:Wt,onClose:er}),Me({content:T(()=>[(y(),f(w(Dt),{key:`table_${Bt.value}`,colNames:Yn.value.colNames,head:Yn.value.head,body:Yn.value.body,config:Yn.value.config,title:L.value.table.useDialog?``:$n.value.title,withCloseButton:!L.value.table.useDialog,isCursorPointer:V.value,onClose:er},{th:T(({th:e})=>[Ne(C(e.name),1)]),td:T(({td:e})=>[h(`div`,wt,C(e.name?e.name:An(e)),1)]),_:1},8,[`colNames`,`head`,`body`,`config`,`title`,`withCloseButton`,`isCursorPointer`]))]),_:2},[L.value.table.useDialog?{name:`title`,fn:T(()=>[Ne(C($n.value.title),1)]),key:`0`}:void 0,L.value.table.useDialog?{name:`actions`,fn:T(()=>[h(`button`,{tabindex:`0`,class:`vue-ui-user-options-button`,onClick:t[1]||=e=>Xn(L.value.userOptions.callbacks.csv),style:v({cursor:V.value?`pointer`:`default`})},[Pe(w(Et),{name:`fileCsv`,stroke:$n.value.props.color},null,8,[`stroke`])],4)]),key:`1`}:void 0]),1040)):p(``,!0),S(e.$slots,`skeleton`,{},()=>[w(Jt)?(y(),f(le,{key:0})):p(``,!0)],!0)],46,Je))}},[[`__scopeId`,`data-v-c6918ee9`]]);export{qe as n,Tt as t};