vue-data-ui 3.28.8 → 3.28.9

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 (144) hide show
  1. package/dist/{PackageVersion-Bczw6rsP.js → PackageVersion-D6_O7PmZ.js} +1 -1
  2. package/dist/UserOptions-B9EyfU9n.js +1 -0
  3. package/dist/{XyAnalysisOptions-U4UJx51x.js → XyAnalysisOptions-djGOJdKc.js} +1 -1
  4. package/dist/components/vue-ui-3d-bar.js +1 -1
  5. package/dist/components/vue-ui-age-pyramid.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-molecule.js +1 -1
  33. package/dist/components/vue-ui-mood-radar.js +1 -1
  34. package/dist/components/vue-ui-nested-donuts.js +1 -1
  35. package/dist/components/vue-ui-onion.js +1 -1
  36. package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
  37. package/dist/components/vue-ui-quadrant.js +1 -1
  38. package/dist/components/vue-ui-quick-chart.js +1 -1
  39. package/dist/components/vue-ui-radar.js +1 -1
  40. package/dist/components/vue-ui-relation-circle.js +1 -1
  41. package/dist/components/vue-ui-ridgeline.js +1 -1
  42. package/dist/components/vue-ui-rings.js +1 -1
  43. package/dist/components/vue-ui-scatter.js +1 -1
  44. package/dist/components/vue-ui-skeleton.js +1 -1
  45. package/dist/components/vue-ui-spark-trend.js +1 -1
  46. package/dist/components/vue-ui-sparkbar.js +1 -1
  47. package/dist/components/vue-ui-sparkgauge.js +1 -1
  48. package/dist/components/vue-ui-sparkhistogram.js +1 -1
  49. package/dist/components/vue-ui-sparkline.js +1 -1
  50. package/dist/components/vue-ui-sparkstackbar.js +1 -1
  51. package/dist/components/vue-ui-stackbar.js +1 -1
  52. package/dist/components/vue-ui-stackline.js +1 -1
  53. package/dist/components/vue-ui-strip-plot.js +1 -1
  54. package/dist/components/vue-ui-table-heatmap.js +1 -1
  55. package/dist/components/vue-ui-table-sparkline.js +1 -1
  56. package/dist/components/vue-ui-table.js +1 -1
  57. package/dist/components/vue-ui-thermometer.js +1 -1
  58. package/dist/components/vue-ui-timer.js +1 -1
  59. package/dist/components/vue-ui-tiremarks.js +1 -1
  60. package/dist/components/vue-ui-treemap.js +1 -1
  61. package/dist/components/vue-ui-vertical-bar.js +1 -1
  62. package/dist/components/vue-ui-waffle.js +1 -1
  63. package/dist/components/vue-ui-wheel.js +1 -1
  64. package/dist/components/vue-ui-word-cloud.js +1 -1
  65. package/dist/components/vue-ui-world.js +1 -1
  66. package/dist/components/vue-ui-xy-canvas.js +1 -1
  67. package/dist/components/vue-ui-xy.js +1 -1
  68. package/dist/package-BEq7yyhf.js +1 -0
  69. package/dist/{render-common-DY4sNXDz.js → render-common-BbY81Ao2.js} +1 -1
  70. package/dist/ssr/vue-ui-donut.js +1 -1
  71. package/dist/ssr/vue-ui-xy.js +1 -1
  72. package/dist/ssr.js +1 -1
  73. package/dist/style.css +1 -1
  74. package/dist/vue-data-ui-BwiGr37w.js +1 -0
  75. package/dist/vue-data-ui.js +1 -1
  76. package/dist/{vue-ui-3d-bar-DmRrbXjK.js → vue-ui-3d-bar-C2igj6OX.js} +1 -1
  77. package/dist/{vue-ui-age-pyramid-CJJIp5gY.js → vue-ui-age-pyramid-DOG_ZOgO.js} +1 -1
  78. package/dist/{vue-ui-bullet-Br7H7FSM.js → vue-ui-bullet-HUKP90GR.js} +1 -1
  79. package/dist/{vue-ui-bump-DCDHNvWE.js → vue-ui-bump-BuHuxEzm.js} +1 -1
  80. package/dist/{vue-ui-candlestick-C_swW8gM.js → vue-ui-candlestick-CZkyowA5.js} +1 -1
  81. package/dist/{vue-ui-carousel-table-BP_yVdDm.js → vue-ui-carousel-table-B73USTMi.js} +1 -1
  82. package/dist/{vue-ui-chestnut-CIGNqBsT.js → vue-ui-chestnut-VdMHjsWk.js} +1 -1
  83. package/dist/{vue-ui-chord-DZRFBkRJ.js → vue-ui-chord-DfWjMAuo.js} +1 -1
  84. package/dist/{vue-ui-circle-pack-CtdPeMsY.js → vue-ui-circle-pack-ByV3SOkF.js} +1 -1
  85. package/dist/{vue-ui-cursor-DRQc_V2R.js → vue-ui-cursor-D3E3f7Lc.js} +1 -1
  86. package/dist/{vue-ui-dag-Cj0CcntI.js → vue-ui-dag-DlllVyCV.js} +1 -1
  87. package/dist/{vue-ui-dashboard-HyzHqAtX.js → vue-ui-dashboard-C9aGsEAi.js} +1 -1
  88. package/dist/{vue-ui-digits-CfdB0vaP.js → vue-ui-digits-p2met3a2.js} +1 -1
  89. package/dist/{vue-ui-donut-Cv-bYyBN.js → vue-ui-donut-BlQXnf7O.js} +1 -1
  90. package/dist/{vue-ui-donut-Dy4j7B9b.js → vue-ui-donut-CZbBq7bs.js} +1 -1
  91. package/dist/{vue-ui-donut-evolution-DL112anx.js → vue-ui-donut-evolution-Csq1sqhK.js} +1 -1
  92. package/dist/{vue-ui-dumbbell-owG24VsQ.js → vue-ui-dumbbell-ChLfyyGq.js} +1 -1
  93. package/dist/{vue-ui-flow-BMNIydqI.js → vue-ui-flow-DfEHi_Cq.js} +1 -1
  94. package/dist/{vue-ui-funnel-BsVS3vuI.js → vue-ui-funnel-QCG-rmsx.js} +1 -1
  95. package/dist/{vue-ui-galaxy-B8HgdBjc.js → vue-ui-galaxy-DFTeXUse.js} +1 -1
  96. package/dist/{vue-ui-gauge-B1A_NFY6.js → vue-ui-gauge-XTx--A-H.js} +1 -1
  97. package/dist/{vue-ui-geo-_TG4jaV9.js → vue-ui-geo-BXB5xFcV.js} +1 -1
  98. package/dist/{vue-ui-gizmo-D0QjzIGt.js → vue-ui-gizmo-COJHVo7O.js} +1 -1
  99. package/dist/{vue-ui-graph-DScVnTzu.js → vue-ui-graph-BqnyGn9p.js} +1 -1
  100. package/dist/{vue-ui-heatmap-BbQseEbM.js → vue-ui-heatmap-CPq3bcnS.js} +1 -1
  101. package/dist/{vue-ui-hill-D3V84h_t.js → vue-ui-hill-DKm3PjHT.js} +1 -1
  102. package/dist/{vue-ui-history-plot-Bx4WYG6U.js → vue-ui-history-plot-B5OPsHZ1.js} +1 -1
  103. package/dist/{vue-ui-horizontal-bar-Do0HJy4f.js → vue-ui-horizontal-bar-C8SymyhN.js} +1 -1
  104. package/dist/{vue-ui-kpi-CF7pAl08.js → vue-ui-kpi-D1Ps7D_O.js} +1 -1
  105. package/dist/{vue-ui-molecule-bAMGCA2Y.js → vue-ui-molecule-f-GNAQ0p.js} +1 -1
  106. package/dist/{vue-ui-mood-radar-CFpgxjuR.js → vue-ui-mood-radar-kp-jOb4S.js} +1 -1
  107. package/dist/{vue-ui-nested-donuts-CWY26iKX.js → vue-ui-nested-donuts-DCCSKIGa.js} +1 -1
  108. package/dist/{vue-ui-onion-DsBUqL_c.js → vue-ui-onion-KqzGj1z_.js} +1 -1
  109. package/dist/{vue-ui-parallel-coordinate-plot-BF3gO85b.js → vue-ui-parallel-coordinate-plot-dn_41Wv5.js} +1 -1
  110. package/dist/{vue-ui-quadrant-BkNG2LGm.js → vue-ui-quadrant-CP8n4v5B.js} +1 -1
  111. package/dist/{vue-ui-quick-chart-CYxvgVpD.js → vue-ui-quick-chart-D8PbGpSw.js} +1 -1
  112. package/dist/{vue-ui-radar-0H8CiLmc.js → vue-ui-radar-ybR3N44-.js} +1 -1
  113. package/dist/{vue-ui-relation-circle-B0BM4xf8.js → vue-ui-relation-circle-B0PwfFpT.js} +1 -1
  114. package/dist/{vue-ui-ridgeline-D-fDuE3y.js → vue-ui-ridgeline-BnslUzA-.js} +1 -1
  115. package/dist/{vue-ui-rings-UtlBiaZZ.js → vue-ui-rings-B-cOW0Dw.js} +1 -1
  116. package/dist/{vue-ui-scatter-CduaARRt.js → vue-ui-scatter-BX5cTC01.js} +1 -1
  117. package/dist/{vue-ui-skeleton-an0peDis.js → vue-ui-skeleton-98OnGJ2N.js} +1 -1
  118. package/dist/{vue-ui-spark-trend-DCP7blHB.js → vue-ui-spark-trend-C4uYyXEy.js} +1 -1
  119. package/dist/{vue-ui-sparkbar-DT3sDgda.js → vue-ui-sparkbar-BcZyqPB9.js} +1 -1
  120. package/dist/{vue-ui-sparkgauge-AQt2L5dI.js → vue-ui-sparkgauge-dBZzMqn5.js} +1 -1
  121. package/dist/{vue-ui-sparkhistogram-a_jc2Dv2.js → vue-ui-sparkhistogram-DcbAY6vr.js} +1 -1
  122. package/dist/{vue-ui-sparkline-D2-KcHAU.js → vue-ui-sparkline-BizzsAR5.js} +1 -1
  123. package/dist/{vue-ui-sparkstackbar-CBI4S5cu.js → vue-ui-sparkstackbar-xlg048YB.js} +1 -1
  124. package/dist/{vue-ui-stackbar-DS_31-a3.js → vue-ui-stackbar-2AX-m3Pb.js} +1 -1
  125. package/dist/{vue-ui-stackline-CuxohB0U.js → vue-ui-stackline-GKaZJh8y.js} +1 -1
  126. package/dist/{vue-ui-strip-plot-bYGhsPA5.js → vue-ui-strip-plot-BhxIrd67.js} +1 -1
  127. package/dist/{vue-ui-table-lzolsJ_n.js → vue-ui-table-D9FJBxrk.js} +1 -1
  128. package/dist/{vue-ui-table-heatmap-D6gpmHg8.js → vue-ui-table-heatmap-SGJGI5Wq.js} +1 -1
  129. package/dist/{vue-ui-table-sparkline-By319cB8.js → vue-ui-table-sparkline-B6ynMUGE.js} +1 -1
  130. package/dist/{vue-ui-thermometer-B3Uv3aWc.js → vue-ui-thermometer-SE_c51TO.js} +1 -1
  131. package/dist/{vue-ui-timer-C6Pevf4N.js → vue-ui-timer-B1JNZk6j.js} +1 -1
  132. package/dist/{vue-ui-tiremarks-DeNdCFVD.js → vue-ui-tiremarks-Cr8EG4T5.js} +1 -1
  133. package/dist/{vue-ui-treemap-Ck9_llHA.js → vue-ui-treemap-DKJVe7v7.js} +1 -1
  134. package/dist/{vue-ui-waffle-BW2SacnV.js → vue-ui-waffle-DSq3l2sE.js} +1 -1
  135. package/dist/{vue-ui-wheel-BXDhx5bf.js → vue-ui-wheel-CcYOzS05.js} +1 -1
  136. package/dist/{vue-ui-word-cloud-DKPtoruY.js → vue-ui-word-cloud-gogYiwIU.js} +1 -1
  137. package/dist/{vue-ui-world-D9vpDbN7.js → vue-ui-world-C2zGhq_U.js} +1 -1
  138. package/dist/{vue-ui-xy-Df5gIADT.js → vue-ui-xy-B2lrTGG4.js} +1 -1
  139. package/dist/{vue-ui-xy-CMckdUft.js → vue-ui-xy-CpS-ASnd.js} +3 -3
  140. package/dist/{vue-ui-xy-canvas-CBrKi3nN.js → vue-ui-xy-canvas-CXBsRU35.js} +1 -1
  141. package/package.json +1 -1
  142. package/dist/UserOptions-DW84OKKr.js +0 -1
  143. package/dist/package-CNWVs68D.js +0 -1
  144. package/dist/vue-data-ui-BWqplouA.js +0 -1
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./annotationSlots-OLiW25XN.js";import{t as i}from"./useConfig-By3Vb5kz.js";import{Pt as a,S as o,St as s,X as c,Y as l,at as u,in as d,rt as f,t as p,zt as m}from"./lib-rPeBMZrn.js";import{n as h,t as g}from"./BaseScanner-8NdoBs7B.js";import{n as ee,t as te}from"./useHints-C-TwxM0Y.js";import{t as ne}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as re}from"./resolveChartConfig-CIhClE5R.js";import{t as ie}from"./img-D4RQwASc.js";import{t as ae}from"./BaseZoomControls-JSk9zW3D.js";import{n as oe}from"./Title-BliHuXfT.js";import{t as se}from"./useChartExport-BZts4KFb.js";import{n as ce,t as le}from"./userOptionsSlots-DYuo-E5m.js";import{t as ue}from"./usePrinter-DVf3YcG5.js";import{c as de}from"./canvas-lib-22VpOI4_.js";import{t as fe}from"./useResponsive-CENUxfEL.js";import{t as pe}from"./A11yDataTable-DWNlWXzs.js";import{t as me}from"./useUserOptionState-CXlFnwPv.js";import{t as he}from"./useChartAccessibility-DOMuYJfm.js";import{n as ge}from"./annotationViewport-X8fvs7pz.js";import{t as _e}from"./usePanZoom-CE6Ofyy8.js";import{t as ve}from"./vue_ui_dag-1b_dLSym.js";import{Fragment as ye,Teleport as be,Transition as xe,computed as _,createBlock as v,createCommentVNode as y,createElementBlock as b,createElementVNode as x,createSlots as Se,createTextVNode as Ce,createVNode as we,defineAsyncComponent as Te,guardReactiveProps as Ee,mergeProps as De,nextTick as Oe,normalizeClass as ke,normalizeProps as Ae,normalizeStyle as je,onBeforeUnmount as Me,onMounted as Ne,openBlock as S,ref as C,renderList as Pe,renderSlot as w,toDisplayString as Fe,toRefs as Ie,unref as T,watch as Le,watchEffect as Re,withCtx as ze,withModifiers as Be}from"vue";var Ve=`\0`,He=`\0`,Ue=``,E=class{_isDirected=!0;_isMultigraph=!1;_isCompound=!1;_label;_defaultNodeLabelFn=()=>void 0;_defaultEdgeLabelFn=()=>void 0;_nodes={};_in={};_preds={};_out={};_sucs={};_edgeObjs={};_edgeLabels={};_nodeCount=0;_edgeCount=0;_parent;_children;constructor(e){e&&(this._isDirected=!Object.hasOwn(e,`directed`)||e.directed,this._isMultigraph=Object.hasOwn(e,`multigraph`)?e.multigraph:!1,this._isCompound=Object.hasOwn(e,`compound`)?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[He]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,typeof e!=`function`&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){let e=this;return this.nodes().filter(t=>Object.keys(e._in[t]).length===0)}sinks(){let e=this;return this.nodes().filter(t=>Object.keys(e._out[t]).length===0)}setNodes(e,t){let n=arguments,r=this;return e.forEach(e=>{n.length>1?r.setNode(e,t):r.setNode(e)}),this}setNode(e,t){return Object.hasOwn(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=He,this._children[e]={},this._children[He][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){let t=this;if(Object.hasOwn(this._nodes,e)){let n=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(n),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=He;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==He)return t}}children(e=He){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else if(e===He)return this.nodes();else if(this.hasNode(e))return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let t of this.successors(e))n.add(t);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());let n=this;Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});let r={};function i(e){let a=n.parent(e);return a===void 0||t.hasNode(a)?(r[e]=a,a):a in r?r[a]:i(a)}return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,i(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,typeof e!=`function`&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){let n=this,r=arguments;return e.reduce((e,i)=>(r.length>1?n.setEdge(e,i,t):n.setEdge(e,i),i)),this}setEdge(){let e,t,n,r,i=!1,a=arguments[0];typeof a==`object`&&a&&`v`in a?(e=a.v,t=a.w,n=a.name,arguments.length===2&&(r=arguments[1],i=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),e=``+e,t=``+t,n!==void 0&&(n=``+n);let o=O(this._isDirected,e,t,n);if(Object.hasOwn(this._edgeLabels,o))return i&&(this._edgeLabels[o]=r),this;if(n!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(e),this.setNode(t),this._edgeLabels[o]=i?r:this._defaultEdgeLabelFn(e,t,n);let s=Ge(this._isDirected,e,t,n);return e=s.v,t=s.w,Object.freeze(s),this._edgeObjs[o]=s,We(this._preds[t],e),We(this._sucs[e],t),this._in[t][o]=s,this._out[e][o]=s,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?Ke(this._isDirected,arguments[0]):O(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(){let e=this.edge(...arguments);return typeof e==`object`?e:{label:e}}hasEdge(e,t,n){let r=arguments.length===1?Ke(this._isDirected,arguments[0]):O(this._isDirected,e,t,n);return Object.hasOwn(this._edgeLabels,r)}removeEdge(e,t,n){let r=arguments.length===1?Ke(this._isDirected,arguments[0]):O(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],D(this._preds[t],e),D(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this}inEdges(e,t){let n=this._in[e];if(n){let e=Object.values(n);return t?e.filter(e=>e.v===t):e}}outEdges(e,t){let n=this._out[e];if(n){let e=Object.values(n);return t?e.filter(e=>e.w===t):e}}nodeEdges(e,t){let n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}};function We(e,t){e[t]?e[t]++:e[t]=1}function D(e,t){--e[t]||delete e[t]}function O(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+Ue+a+Ue+(r===void 0?Ve:r)}function Ge(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function Ke(e,t){return O(e,t.v,t.w,t.name)}var qe=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return Je(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&Je(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,Ye)),n=n._prev;return`[`+e.join(`, `)+`]`}};function Je(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Ye(e,t){if(e!==`_next`&&e!==`_prev`)return t}var Xe=()=>1;function Ze(e,t){if(e.nodeCount()<=1)return[];let n=j(e,t||Xe);return k(n.graph,n.buckets,n.zeroIndex).flatMap(t=>e.outEdges(t.v,t.w))}function k(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)A(e,t,n,o);for(;o=i.dequeue();)A(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i].dequeue(),o){r=r.concat(A(e,t,n,o,!0));break}}}return r}function A(e,t,n,r,i){let a=i?[]:void 0;return e.inEdges(r.v).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,M(t,n,s)}),e.outEdges(r.v).forEach(r=>{let i=e.edge(r),a=e.node(r.w);a.in-=i,M(t,n,a)}),e.removeNode(r.v),a}function j(e,t){let n=new E,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});let a=Qe(i+r+3).map(()=>new qe),o=r+1;return n.nodes().forEach(e=>{M(a,o,n.node(e))}),{graph:n,buckets:a,zeroIndex:o}}function M(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function Qe(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function $e(e,t,n,r){let i=r;for(;e.hasNode(i);)i=B(r);return n.dummy=t,e.setNode(i,n),i}function et(e){let t=new E().setGraph(e.graph());return e.nodes().forEach(n=>{t.setNode(n,e.node(n))}),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function N(e){let t=new E({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function P(e){let t=e.nodes().map(t=>{let n={};return e.outEdges(t).forEach(t=>{n[t.w]=(n[t.w]||0)+e.edge(t).weight}),n});return H(e.nodes(),t)}function tt(e){let t=e.nodes().map(t=>{let n={};return e.inEdges(t).forEach(t=>{n[t.v]=(n[t.v]||0)+e.edge(t).weight}),n});return H(e.nodes(),t)}function F(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function I(e){let t=V(ot(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i][r.order]=n)}),t}function nt(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=R(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function rt(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=R(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>{e.node(t).rank+=i})})}function it(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),$e(e,`border`,i,t)}var at=65535;function L(e,t=at){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}function R(e,t){if(t.length>at){let n=L(t);return e.apply(null,n.map(t=>e.apply(null,t)))}return e.apply(null,t)}function ot(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return R(Math.max,t)}function st(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function z(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function ct(e,t){return t()}var lt=0;function B(e){let t=++lt;return e+String(t)}function V(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function ut(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function dt(e,t){let n=t;if(typeof t==`string`){let e=t;n=t=>t[e]}return Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function H(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var U={addBorderNode:it,addDummyNode:$e,applyWithChunking:R,asNonCompoundGraph:N,buildLayerMatrix:I,intersectRect:F,mapValues:dt,maxRank:ot,normalizeRanks:nt,notime:ct,partition:st,pick:ut,predecessorWeights:tt,range:V,removeEmptyRanks:rt,simplify:et,successorWeights:P,time:z,uniqueId:B,zipObject:H};function W(e){(e.graph().acyclicer===`greedy`?Ze(e,t(e)):pt(e)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,B(`rev`))});function t(e){return t=>e.edge(t).weight}}function ft(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function pt(e){let t=[],n={},r={};function i(a){Object.hasOwn(r,a)||(r[a]=!0,n[a]=!0,e.outEdges(a).forEach(e=>{Object.hasOwn(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return e.nodes().forEach(i),t}function mt(e){e.graph().dummyChains=[],e.edges().forEach(t=>G(e,t))}function G(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=$e(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function ht(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel;e.setEdge(n.edgeObj,r);let i;for(;n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function gt(e){function t(n){let r=e.node(n);if(r&&Object.prototype.hasOwnProperty.call(r,`rank`))return r.rank;let i=e.outEdges(n)||[];if(!i.length)return r&&(r.rank=0),0;let a=i.map(n=>e.node(n.w)?t(n.w)-e.edge(n).minlen:1/0),o=R(Math.min,a);return o===1/0&&(o=0),r&&(r.rank=o),o}(e.sources()||[]).forEach(t)}function _t(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}function vt(e){yt(e);let t=new E;e.nodes().forEach(e=>{t.setNode(e,{})});let n=e.nodes();if(!n.length)return t;let r=n[0],i=/* @__PURE__ */ new Set([r]);for(;i.size<n.length;){let r=bt(e,i);if(!r){let e=n.find(e=>!i.has(e));i.add(e),t.setNode(e,{});continue}let{edgeObject:a,delta:o,attachFrom:s,attachTo:c}=r;xt(e,i,s,o),t.setEdge(a.v,a.w,{}),i.add(c)}return t}function yt(e){e.nodes().forEach(t=>{let n=e.node(t)||{};Object.prototype.hasOwnProperty.call(n,`rank`)||(n.rank=0,e.setNode(t,n))})}function bt(e,t){let n=null;return e.edges().forEach(r=>{let i=t.has(r.v);if(i===t.has(r.w))return;let a=_t(e,r),o=Math.abs(a);if(!n||o<n.absoluteSlack){let e=i?r.v:r.w,t=i?r.w:r.v;n={edgeObject:r,delta:i?a:-a,attachFrom:e,attachTo:t,absoluteSlack:o}}}),n}function xt(e,t,n,r){r&&e.nodes().forEach(n=>{if(!t.has(n)){let t=e.node(n);t.rank+=r}})}function K(e){let t=et(e);return gt(t),t.nodes().forEach(n=>{let r=t.node(n),i=e.node(n)||{};i.rank=r.rank,e.setNode(n,i)}),e}function St(e,t){}function Ct(e,t){}function wt(e,t,n){return 0}function Tt(e){return null}function Et(e,t){return null}K.initLowLimValues=St,K.initCutValues=Ct,K.calcCutValue=wt,K.leaveEdge=Tt,K.enterEdge=Et;var Dt=gt;function Ot(e){let t=e.graph().ranker;if(t instanceof Function)return t(e);switch(e.graph().ranker){case`network-simplex`:jt(e);break;case`tight-tree`:At(e);break;case`longest-path`:kt(e);break;case`none`:break;default:jt(e)}}var kt=Dt;function At(e){Dt(e),vt(e)}function jt(e){K(e)}function Mt(e){let t=Nt(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=q(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0,d=n;for(;d!==i.w;){if(r=e.node(d),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(l=o[c+1]).minRank<=r.rank;)c++;l=o[c]}e.setParent(d,l),d=e.successors(d)[0]}})}function q(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c,l;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function Nt(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children().forEach(r),t}function Pt(e){let t=U.addDummyNode(e,`root`,{},`_root`),n=Ft(e),r=Object.values(n),i=U.applyWithChunking(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>{e.edge(t).minlen*=a});let o=It(e)+1;e.children().forEach(r=>{J(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function J(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=U.addBorderNode(e,`_bt`),l=U.addBorderNode(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{J(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-a[o]+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+a[o]})}function Ft(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children().forEach(e=>n(e,1)),t}function It(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function Y(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}function Lt(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)Rt(e,`borderLeft`,`_bl`,n,i,t),Rt(e,`borderRight`,`_br`,n,i,t)}}e.children().forEach(t)}function Rt(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=$e(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function zt(e){let t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&Vt(e)}function Bt(e){let t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&Ut(e),(t===`lr`||t===`rl`)&&(Gt(e),Vt(e))}function Vt(e){e.nodes().forEach(t=>{Ht(e.node(t))}),e.edges().forEach(t=>{Ht(e.edge(t))})}function Ht(e){let t=e.width;e.width=e.height,e.height=t}function Ut(e){e.nodes().forEach(t=>{Wt(e.node(t))}),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(Wt),Object.hasOwn(n,`y`)&&Wt(n)})}function Wt(e){e.y=-e.y}function Gt(e){e.nodes().forEach(t=>{X(e.node(t))}),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(X),Object.hasOwn(n,`x`)&&X(n)})}function X(e){let t=e.x;e.x=e.y,e.y=t}var Kt={adjust:zt,undo:Bt};function qt(e){let t={},n=e.nodes().filter(t=>e.children(t).length===0),r=n.map(t=>e.node(t).rank),i=V(R(Math.max,r)+1).map(()=>[]);function a(n){if(t[n])return;t[n]=!0;let r=e.node(n);i[r.rank].push(n),e.successors(n).forEach(a)}return n.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(a),i}function Jt(e,t){let n=0;for(let r=1;r<t.length;++r)n+=Yt(e,t[r-1],t[r]);return n}function Yt(e,t,n){let r=H(n,n.map((e,t)=>t)),i=t.flatMap(t=>e.outEdges(t).map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos)),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function Xt(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n.length)return{v:t};let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}})}function Zt(e,t){let n={};return e.forEach((e,t)=>{let r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight)}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),Qt(Object.values(n).filter(e=>!e.indegree))}function Qt(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&$t(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>ut(e,[`vs`,`i`,`barycenter`,`weight`]))}function $t(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function en(e,t){let n=st(e,e=>Object.hasOwn(e,`barycenter`)),r=n.lhs,i=n.rhs.sort((e,t)=>t.i-e.i),a=[],o=0,s=0,c=0;r.sort(Z(!!t)),c=tn(a,i,c),r.forEach(e=>{c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=tn(a,i,c)});let l={vs:a.flat(!0)};return s&&(l.barycenter=o/s,l.weight=s),l}function tn(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Z(e){return(t,n)=>t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}function nn(e,t,n,r){let i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=i.filter(e=>e!==o&&e!==s));let l=Xt(e,i);l.forEach(t=>{if(e.children(t.v).length){let i=nn(e,t.v,n,r);c[t.v]=i,Object.hasOwn(i,`barycenter`)&&an(t,i)}});let u=Zt(l,n);rn(u,c);let d=en(u,r);if(o&&(d.vs=[o,d.vs,s].flat(!0),e.predecessors(o).length)){let t=e.node(e.predecessors(o)[0]),n=e.node(e.predecessors(s)[0]);Object.hasOwn(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+t.order+n.order)/(d.weight+2),d.weight+=2}return d}function rn(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function an(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function on(e,t,n,r){r||=e.nodes();let i=sn(e),a=new E({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(a.setNode(r),a.setParent(r,s||i),e[n](r).forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i?i.weight:0;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),a}function sn(e){let t;for(;e.hasNode(t=B(`_root`)););return t}function cn(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function ln(e,t={}){if(typeof t.customOrder==`function`){t.customOrder(e,ln);return}let n=ot(e),r=un(e,V(1,n+1),`inEdges`),i=un(e,V(n-1,-1,-1),`outEdges`),a=qt(e);if(fn(e,a),t.disableOptimalOrderHeuristic)return;let o=1/0,s,c=t.constraints||[];for(let t=0,n=0;n<4;++t,++n){dn(t%2==0?r:i,t%4>=2,c),a=I(e);let l=Jt(e,a);l<o?(o=l,n=0,s=structuredClone(a)):l===o&&(s=structuredClone(a))}fn(e,s)}function un(e,t,n){let r=/* @__PURE__ */ new Map;function i(e,t){r.has(e)||r.set(e,[]),r.get(e).push(t)}for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(t=>on(e,t,n,r.get(t)||[]))}function dn(e,t,n){let r=new E;e.forEach(e=>{n.forEach(e=>r.setEdge(e.left,e.right));let i=e.graph().root,a=nn(e,i,r,t);a.vs.forEach((t,n)=>{e.node(t).order=n}),cn(e,r,a.vs)})}function fn(e,t){Object.values(t).forEach(t=>{t.forEach((t,n)=>{e.node(t).order=n})})}function pn(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=hn(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{e.predecessors(t).forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&gn(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function mn(e,t){let n={};function r(t,r,i,a,o){let s;V(r,i).forEach(r=>{s=t[r],e.node(s).dummy&&e.predecessors(s).forEach(t=>{let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&gn(n,t,s)})})}function i(t,n){let i=-1,a,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);t.length&&(a=e.node(t[0]).order,r(n,o,c,i,a),o=c,i=a)}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function hn(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}function gn(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function _n(e,t,n){if(t>n){let e=t;t=n,n=e}return!!e[t]&&Object.hasOwn(e[t],n)}function vn(e,t,n,r){let i={},a={},o={};return t.forEach(e=>{e.forEach((e,t)=>{i[e]=e,a[e]=e,o[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let s=r(e);if(s.length){s=s.sort((e,t)=>o[e]-o[t]);let r=(s.length-1)/2;for(let c=Math.floor(r),l=Math.ceil(r);c<=l;++c){let r=s[c];a[e]===e&&t<o[r]&&!_n(n,e,r)&&(a[r]=e,a[e]=i[e]=i[r],t=o[r])}}})}),{root:i,align:a}}function Q(e,t,n,r,i){let a={},o=yn(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){a[e]=o.inEdges(e).reduce((e,t)=>Math.max(e,a[t.v]+o.edge(t)),0)}function u(t){let n=o.outEdges(t).reduce((e,t)=>Math.min(e,a[t.w]-o.edge(t)),1/0),r=e.node(t);n!==1/0&&r.borderType!==s&&(a[t]=Math.max(a[t],n))}return c(l,o.predecessors.bind(o)),c(u,o.successors.bind(o)),Object.keys(r).forEach(e=>{a[e]=a[n[e]]}),a}function yn(e,t,n,r){let i=new e.constructor,a=e.graph(),o=wn(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(i.setNode(a),r){let s=n[r],c=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),c||0))}r=t})}),i}function bn(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=Tn(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function xn(e,t){let n=Object.values(t),r=R(Math.min,n),i=R(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(s===t)return;let c=Object.values(s),l=r-R(Math.min,c);a!==`l`&&(l=i-R(Math.max,c)),l&&(s=dt(s,e=>e+l),e[o]=s)})})}function Sn(e,t){return dt(e.ul,(n,r)=>{if(t)return e[t.toLowerCase()][r];let i=Object.values(e).map(e=>e[r]).sort((e,t)=>e-t);return(i[1]+i[2])/2})}function Cn(e){let t=I(e),n=Object.assign(pn(e,t),mn(e,t)),r={},i;return[`u`,`d`].forEach(a=>{i=a===`u`?t:Object.values(t).reverse(),[`l`,`r`].forEach(t=>{let o=i;t===`r`&&(o=o.map(e=>Object.values(e).reverse()));let s=(a===`u`?e.predecessors:e.successors).bind(e),c=vn(e,o,n,s),l=Q(e,o,c.root,c.align,t===`r`);t===`r`&&(l=dt(l,e=>-e)),r[a+t]=l})}),xn(r,bn(e,r)),Sn(r,e.graph().align)}function wn(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),l=0,c}}function Tn(e,t){return e.node(t).width}function En(e){let t=N(e);Dn(t);let n=Cn(t);Object.entries(n).forEach(([t,n])=>{e.node(t).x=n})}function Dn(e){let t=I(e),n=e.graph().ranksep,r=0;t.forEach(t=>{let i=t.reduce((t,n)=>{let r=e.node(n).height;return t>r?t:r},0);t.forEach(t=>{e.node(t).y=r+i/2}),r+=i+n})}function On(e,t={}){let n=t.debugTiming?z:ct;return n(`layout`,()=>{let r=n(` buildLayoutGraph`,()=>Rn(e));return n(` runLayout`,()=>kn(r,n,t)),n(` updateInputGraph`,()=>An(e,r)),r})}function kn(e,t,n){t(` makeSpaceForEdgeLabels`,()=>zn(e)),t(` removeSelfEdges`,()=>Yn(e)),t(` acyclic`,()=>W(e)),t(` nestingGraph.run`,()=>Pt(e)),t(` rank`,()=>Ot(N(e))),t(` injectEdgeLabelProxies`,()=>Bn(e)),t(` removeEmptyRanks`,()=>rt(e)),t(` nestingGraph.cleanup`,()=>Y(e)),t(` normalizeRanks`,()=>nt(e)),t(` assignRankMinMax`,()=>Vn(e)),t(` removeEdgeLabelProxies`,()=>Hn(e)),t(` normalize.run`,()=>mt(e)),t(` parentDummyChains`,()=>Mt(e)),t(` addBorderSegments`,()=>Lt(e)),t(` order`,()=>ln(e,n)),t(` insertSelfEdges`,()=>Xn(e)),t(` adjustCoordinateSystem`,()=>Kt.adjust(e)),t(` position`,()=>En(e)),t(` positionSelfEdges`,()=>Zn(e)),t(` removeBorderNodes`,()=>Jn(e)),t(` normalize.undo`,()=>ht(e)),t(` fixupEdgeLabelCoords`,()=>Kn(e)),t(` undoCoordinateSystem`,()=>Kt.undo(e)),t(` translateGraph`,()=>Un(e)),t(` assignNodeIntersects`,()=>Gn(e)),t(` reversePoints`,()=>qn(e)),t(` acyclic.undo`,()=>ft(e))}function An(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)});let n=t.graph(),r=e.graph();r.width=n.width,r.height=n.height}var jn=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],Mn={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},Nn=[`acyclicer`,`ranker`,`rankdir`,`align`],Pn=[`width`,`height`,`rank`],$={width:0,height:0},Fn=[`minlen`,`weight`,`width`,`height`,`labeloffset`],In={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},Ln=[`labelpos`,`arrowshape`];function Rn(e){let t=$n(e.graph()),n={...Mn,...Qn(t,jn),...ut(t,Nn)},r=new E({multigraph:!0,compound:!0});return r.setGraph(n),e.nodes().forEach(t=>{let n=Qn($n(e.node(t)),Pn);Object.keys($).forEach(e=>{n[e]===void 0&&(n[e]=$[e])}),r.setNode(t,n),r.setParent(t,e.parent(t))}),e.edges().forEach(t=>{let n=$n(e.edge(t));r.setEdge(t,{...In,...Qn(n,Fn),...ut(n,Ln)})}),r}function zn(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function Bn(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);$e(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function Vn(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function Hn(e){e.nodes().forEach(t=>{let n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function Un(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function Wn(e,t,n){if(!n||!t)return e;let r=t.x-e.x,i=t.y-e.y,a=Math.sqrt(r*r+i*i);if(!a||a<=n)return e;let o=n/a;return{x:e.x+r*o,y:e.y+i*o}}function Gn(e){e.edges().forEach(t=>{let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;!n.points||!n.points.length?(n.points=[],a=i,o=r):(a=n.points[0],o=n.points[n.points.length-1]);let s=F(r,a),c=F(i,o),l=n.points.length?n.points[0]:a,u=n.points.length?n.points[n.points.length-1]:o,d=n.arrowshape,f=d===`normal`||d===`vee`,p=!!n.reversed,m=s,h=c;f&&(p?m=Wn(s,l,4):h=Wn(c,u,4)),n.points.unshift(m),n.points.push(h)})}function Kn(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function qn(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function Jn(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function Yn(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Xn(e){I(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);i.order=r+n,(i.selfEdges||[]).forEach(t=>{$e(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function Zn(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`selfedge`){let r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function Qn(e,t){return dt(ut(e,t),Number)}function $n(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{let r=e;typeof r==`string`&&(r=r.toLowerCase()),t[r]=n}),t}var er={rankDirection:`TB`,nodeSeparation:50,rankSeparation:50,edgeSeparation:10,align:void 0,nodeWidth:100,nodeHeight:40,curvedEdges:!1,padding:20,arrowShape:`normal`,arrowSize:10};function tr(e){return e.length?e.map((e,t)=>`${t===0?`M`:`L`} ${e.x} ${e.y}`).join(` `):``}function nr(e){if(!e.length)return``;if(e.length===1){let t=e[0];return`M ${t.x} ${t.y}`}if(e.length===2)return`M ${e[0].x} ${e[0].y} L ${e[1].x} ${e[1].y}`;let[t]=e,n=`M ${t.x} ${t.y}`;for(let t=1;t<e.length-1;t+=1){e[t-1];let r=e[t],i=e[t+1],a=r.x,o=r.y,s=(r.x+i.x)/2,c=(r.y+i.y)/2;n+=` Q ${a} ${o} ${s} ${c}`}let r=e[e.length-1];return n+=` L ${r.x} ${r.y}`,n}function rr(e){let{nodes:t,edges:n,configuration:r}=e,i=C(null),a=C(null),o=`dag-arrow-${c()}`;function l(e,t,n){a.value=null,i.value=null;let r={...er,...n},l=new E({multigraph:!0,compound:!0});l.setGraph({rankdir:r.rankDirection,nodesep:r.nodeSeparation,ranksep:r.rankSeparation,edgesep:r.edgeSeparation,align:r.align}),e.forEach(e=>{l.setNode(e.id,{label:e.label,width:e.width??r.nodeWidth,height:e.height??r.nodeHeight})}),t.forEach(e=>{l.setEdge(e.from,e.to,{weight:e.weight??1,minlen:e.minLength??1,arrowShape:r.arrowShape??`normal`})}),On(l);let u=e.map(e=>{let t=l.node(e.id);return{id:e.id,label:e.label,x:t.x,y:t.y,width:t.width,height:t.height,original:e}}),d=l.edges().map(e=>{let n=l.edge(e),i=n.points||[];if(!i.length)return null;let a=r.curvedEdges?nr(i):tr(i),s=r.arrowShape===`undirected`?null:`url(#${o})`,u=t.find(t=>t?.from===e.v&&t?.to===e.w);return{id:`${e.v}->${e.w}->${c()}`,from:e.v,to:e.w,points:i,pathData:a,markerEnd:s,original:{...u,...n}}}).filter(Boolean),f=r.padding;if(!u.length){i.value={nodes:[],edges:d,viewBox:`0 0 0 0`,arrowShape:r.arrowShape,arrowSize:r.arrowSize};return}let p=u.flatMap(e=>[e.x-e.width/2,e.x+e.width/2]),m=u.flatMap(e=>[e.y-e.height/2,e.y+e.height/2]),h=Math.min(...p)-f,g=Math.max(...p)+f,ee=Math.min(...m)-f,te=Math.max(...m)+f;i.value={nodes:u,edges:d.map(e=>({...e,midpoint:e.pathData?s(e.pathData):{x:0,y:0}})),viewBox:`${h} ${ee} ${g-h} ${te-ee}`,arrowShape:r.arrowShape,arrowSize:r.arrowSize}}return Re(()=>{try{l(T(t)||[],T(n)||[],T(r)||{})}catch(e){console.error(`[useDag] layout error:`,e),a.value=e,i.value=null}}),{layoutData:i,lastError:a,arrowMarkerIdentifier:o,recomputeLayout:()=>{l(T(t)||[],T(n)||[],T(r)||{})}}}var ir=/* @__PURE__ */ e({default:()=>Rr}),ar=[`id`],or=[`id`],sr={key:1,class:`dag-chart-error`},cr={style:{position:`relative`}},lr=[`viewBox`,`xmlns`,`aria-describedby`],ur={key:0},dr=[`id`,`width`,`height`],fr=[`cx`,`cy`,`r`,`fill`],pr=[`x`,`y`,`width`,`height`,`fill`],mr={key:2},hr=[`id`,`markerWidth`,`markerHeight`,`refX`,`refY`],gr=[`d`,`fill`,`stroke`],_r=[`d`,`fill`,`stroke`],vr={class:`vue-ui-dag-edges`},yr=[`data-a11y-midpoint-id`,`aria-label`,`onMouseenter`],br={class:`vue-ui-dag-nodes`},xr=[`onClick`,`onMouseenter`,`onMouseleave`],Sr=[`data-a11y-node-id`,`aria-label`],Cr=[`x`,`y`,`width`,`height`],wr={class:`vue-ui-dag-edges`},Tr=[`d`,`stroke-width`,`marker-end`],Er={class:`vue-ui-dag-node-labels`},Dr=[`onClick`,`onMouseenter`,`onMouseleave`],Or=[`x`,`y`,`font-size`,`fill`,`font-weight`],kr=[`x`,`y`,`font-size`,`fill`,`font-weight`,`innerHTML`],Ar={key:1},jr={key:1,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Mr={key:6,class:`vue-data-ui-watermark`},Nr=[`data-position`],Pr={key:0},Fr=[`data-position`],Ir={key:0},Lr=1.5,Rr=/*#__PURE__*/ ne({__name:`vue-ui-dag`,props:{dataset:{type:Object,default(){return{nodes:[],edges:[]}}},config:{type:Object,default(){return{}}}},emits:[`onNodeClick`,`onMidpointEnter`,`onMidpointLeave`,`copyAlt`,`rotate`],setup(e,{expose:s,emit:ne}){let Re=Te(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),Ve=Te(()=>import(`./UserOptions-DW84OKKr.js`).then(e=>e.n)),He=Te(()=>import(`./PackageVersion-Bczw6rsP.js`).then(e=>e.t)),{vue_ui_dag:Ue}=i(),E=e,We=ne,D=C(null),O=C(c()),Ge=C(null),Ke=C(null),qe=C(null),Je=C(0),Ye=C(0),Xe=C(!1),Ze=C(!1),k=C(null),A=C(null),j=C(null),M=C(null),Qe=C(null),$e=C(`pointer`),et=C(!1),N=C(yt()),P=_(()=>N.value.style.chart.nodes),tt=_(()=>N.value.style.chart.edges),F=_(()=>N.value.style.chart.midpoints),I=_(()=>N.value.style.chart);ee({config:()=>N.value,dataset:()=>E.dataset,component:`VueUiDag`,rules:[te.noHint]});let nt=_(()=>N.value.userOptions.useCursorPointer),rt=C(N.value.style.chart.width),it=C(N.value.style.chart.height),at=C({x:0,y:0}),L=C(null),R=C(null),ot=C({left:`0px`,top:`0px`}),st=C(`top`),z=C(!1),ct=C({x:0,y:0}),lt=C({x:0,y:0}),B=C(null),V=C(null),ut=C({left:`0px`,top:`0px`}),dt=C(`top`),H=C(!1),U=C(!1),{svgRef:W}=he({config:I.value.title}),{userOptionsVisible:ft,setUserOptionsVisibility:pt,keepUserOptionState:mt}=me({config:N.value}),G=C(N.value.style.chart.layout.rankDirection),ht=_(()=>d({defaultConfig:{userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,nodes:{stroke:`#CCCCCC`,backgroundColor:`#DDDDDD50`},edges:{stroke:`#CCCCCC`},midpoints:{stroke:`#CCCCCC`,fill:`#CCCCCC`}}}},userConfig:N.value.skeletonConfig??{}})),{loading:gt,FINAL_DATASET:_t,manualLoading:vt}=h({...Ie(E),FINAL_CONFIG:N,prepareConfig:yt,skeletonDataset:E.config?.skeletonDataset??{nodes:[{id:`A`,label:``},{id:`B`,label:``},{id:`C`,label:``}],edges:[{from:`A`,to:`B`},{from:`A`,to:`C`}]},skeletonConfig:d({defaultConfig:N.value,userConfig:ht.value})});function yt(){return re(E.config,Ue,ve)}let bt=_(()=>N.value.debug);Ne(async()=>{m(E.dataset)&&(u({componentName:`VueUiDag`,type:`dataset`,debug:bt.value}),Ze.value=!1,vt.value=!0),E.dataset.nodes&&E.dataset.nodes.length!==0||(u({componentName:`VueUiDag`,type:`datasetAttributeEmpty`,property:`nodes`,index:0,debug:bt.value}),Ze.value=!1,vt.value=!0),Ze.value=!0,await Oe(),ln()}),Le(()=>E.config,async e=>{gt.value||(N.value=yt()),ft.value=!N.value.userOptions.showOnChartHover,Je.value+=1,G.value=I.value.layout.rankDirection,rt.value=I.value.width,it.value=I.value.height,It.value=I.value.zoom.active,await Oe(),ln()},{deep:!0});let{isPrinting:xt,isImaging:K,generatePdf:St,generateImage:Ct}=ue({elementId:`dag_${O.value}`,fileName:I.value.title.text||`vue-ui-dag`,options:N.value.userOptions.print}),wt=_(()=>I.value.backgroundColor),Tt=_(()=>I.value.title),{isCallbackImaging:Et,isCallbackSvg:Dt,generateSvg:Ot,onGenerateImage:kt}=se({svg:W,title:Tt,legend:null,legendItems:null,backgroundColor:wt,getSvgCallback:()=>N.value.userOptions.callbacks.svg,generateImage:Ct});function At(){Xe.value=!0,pt(!0)}function jt(){pt(!1),Xe.value=!1}function Mt({tooltipRef:e,isVisibleRef:t,anchorRef:n,styleRef:r,placementRef:i,offsetRef:a,margin:o=24}){return function(){let s=e.value;if(!s||!t.value)return;let c=s.getBoundingClientRect(),l=window.innerWidth,u=window.innerHeight,d=n.value.x,f=n.value.y,p=a?.value?.x??0,m=a?.value?.y??0,h=f-m-c.height-o,g=d-c.width/2,ee=`top`;if(h<o){let e=f+m+o;e+c.height<=u-o?(h=e,ee=`bottom`):(h=f-c.height/2,h<o&&(h=o),h+c.height>u-o&&(h=u-c.height-o),ee=`center`)}g<o&&(g=o),g+c.width>l-o&&(g=l-c.width-o);let te=g<=o,ne=g+c.width>=l-o;if((te||ne)&&ee!==`center`){let e,t,n=d-p-o;l-(d+p)-o>=n?(e=`right`,t=d+p+o):(e=`left`,t=d-p-o-c.width),t>=o&&t+c.width<=l-o&&(g=t,h=f-c.height/2,h<o&&(h=o),h+c.height>u-o&&(h=u-c.height-o),ee=e)}i.value=ee,r.value={left:`${g}px`,top:`${h}px`}}}let{layoutData:q,lastError:Nt,arrowMarkerIdentifier:Pt}=rr({nodes:_(()=>_t.value.nodes.map(e=>({...e,backgroundColor:e.backgroundColor?o(e.backgroundColor):P.value.backgroundColor,color:e.color?o(e.color):P.value.labels.color}))),edges:_(()=>_t.value.edges),configuration:_(()=>({...I.value.layout,rankDirection:G.value}))});function J(e){return q.value?q.value.nodes.find(t=>t.id===e):null}_(()=>{if(!q.value)return[];let e=tt.value.stroke,t=/* @__PURE__ */ new Set;return q.value.edges.forEach(n=>{t.add({id:n.id,from:n.from,to:n.to,color:n.original?.color||e})}),Array.from(t)});let Ft=_(()=>{let e=rt.value,t=it.value,n=Number(e),r=Number(t),i=Number.isFinite(n)&&n>0,a=Number.isFinite(r)&&r>0;return!i&&!a?null:{width:i?n:null,height:a?r:null}}),It=C(I.value.zoom.active),{viewBox:Y,resetZoom:Lt,setInitialViewBox:Rt,scale:zt,zoomByFactor:Bt}=_e(W,{x:0,y:0,width:100,height:100},1,It,()=>{z.value=!1}),Vt=null;async function Ht(e,{smooth:t=!0,duration:n=300,zoomReset:r=!1,zoom:i=null}={}){let o=J(e);if(!o)return!1;let s=Y.value;if(!s)return!1;let c={x:Number(s.x),y:Number(s.y),width:Number(s.width),height:Number(s.height)},l=zt.value,u=c.width,d=c.height,p=l;if(Number.isFinite(i)&&i>0||r){Lt(!1);let e=Y.value,t=Number.isFinite(i)&&i>0?i/100:1;u=Number(e.width)/t,d=Number(e.height)/t,p=t,Y.value={...c},zt.value=l}let m=Number(o.x),h=Number(o.y);if(!Number.isFinite(c.x)||!Number.isFinite(c.y)||!Number.isFinite(c.width)||!Number.isFinite(c.height)||!Number.isFinite(u)||!Number.isFinite(d)||!Number.isFinite(m)||!Number.isFinite(h))return!1;let g={x:m-u/2,y:h-d/2,width:u,height:d};if(Vt!==null&&(cancelAnimationFrame(Vt),Vt=null),z.value=!1,!t||n<=0)return Y.value=g,zt.value=p,!0;let ee=performance.now();function te(e){let t=Math.min((e-ee)/n,1),r=f(t);Y.value={x:a(c.x,g.x,r),y:a(c.y,g.y,r),width:a(c.width,g.width,r),height:a(c.height,g.height,r)},zt.value=a(l,p,r),t<1?Vt=requestAnimationFrame(te):(Y.value=g,zt.value=p,Vt=null)}return Vt=requestAnimationFrame(te),!0}function Ut(){It.value=!It.value}function Wt(){let e=q.value&&q.value.viewBox;if(!e)return;let t=String(e).split(` `).map(Number);if(t.length!==4)return;let[n,r,i,a]=t;if(!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a))return;let o=i,s=a,c=n,l=r,u=Ft.value;u&&(u.width!==null&&(o=u.width),u.height!==null&&(s=u.height),c=n-(o-i)/2,l=r-(s-a)/2),Rt({x:c,y:l,width:o,height:s},{overwriteCurrentIfNotZoomed:!0})}Le(()=>q.value&&q.value.viewBox,()=>{Wt()},{immediate:!0}),Le(()=>Ft.value,()=>{Wt()}),Le(()=>U.value,e=>{It.value=!e});let Gt=_(()=>{let e=Y.value;return e?`${e.x} ${e.y} ${e.width} ${e.height}`:`0 0 0 0`}),X=C(!1),Kt=C({width:0,height:0});Le([W,X,()=>I.value.backgroundPattern.show],([e,t,n],r,i)=>{if(!e||!t||!n)return;let a=()=>{let{width:t,height:n}=e.getBoundingClientRect();(t!==Kt.value.width||n!==Kt.value.height)&&(Kt.value={width:t,height:n})};a();let o=new ResizeObserver(a);o.observe(e),i(()=>o.disconnect())},{flush:`post`});let qt=_(()=>{let e=Y.value;if(!e||!X.value)return e;let{width:t,height:n}=Kt.value;if(!(t>0&&n>0&&e.width>0&&e.height>0))return e;let r=Math.min(t/e.width,n/e.height),i=t/r,a=n/r;return{x:e.x-(i-e.width)/2,y:e.y-(a-e.height)/2,width:i,height:a}});function Jt(e){X.value=e,Ye.value+=1}function Yt(){U.value=!U.value}function Xt(){Bt(Lr,!0)}function Zt(){Bt(1/Lr,!0)}let Qt=[`TB`,`RL`,`BT`,`LR`];function $t(){G.value=Qt[(Qt.indexOf(G.value)+1)%Qt.length],Lt(),We(`rotate`,G.value)}let en=Mt({tooltipRef:R,isVisibleRef:H,anchorRef:at,styleRef:ot,placementRef:st,isNode:!1}),tn=Mt({tooltipRef:V,isVisibleRef:z,anchorRef:ct,styleRef:ut,placementRef:dt,offsetRef:lt}),Z=C(null);async function nn(e){We(`onMidpointEnter`,e);let t=W.value;if(!t||!e?.midpoint)return;let n=t.createSVGPoint();n.x=e.midpoint.x,n.y=e.midpoint.y;let r=t.getScreenCTM();if(!r)return;let i=n.matrixTransform(r);at.value={x:i.x,y:i.y},L.value=e,H.value=!0,F.value.selectedEdge.animated===!0&&(Z.value=e.id,hn()),await Oe(),en()}function rn(){H.value=!1,L.value=null,We(`onMidpointLeave`),F.value.selectedEdge.animated===!0&&(Z.value=null,hn())}async function an(e){if(We(`onNodeClick`,e),!P.value.tooltip.showOnClick)return;let t=W.value;if(!t)return;let n=t.createSVGPoint();n.x=e.x,n.y=e.y;let r=t.getScreenCTM();if(!r)return;let i=n.matrixTransform(r),a=I.value.layout.nodeWidth,o=I.value.layout.nodeHeight,s=r.a,c=r.d,l=a*s,u=o*c;lt.value={x:l/2,y:u/2},ct.value={x:i.x,y:i.y},B.value=e,z.value=!0,await Oe(),tn()}function on(){z.value=!1,B.value=null}function sn(e){if(!(z.value||H.value))return;let t=V.value;if(t&&t.contains(e.target))return;let n=R.value;if(n&&n.contains(e.target))return;let r=W.value;if(r&&r.contains(e.target)){let t=e.target.closest(`.vue-ui-dag-node`),n=e.target.closest(`.vue-ui-dag-edge-midpoint`);if(t||n)return}on(),rn(),et.value||Vn()}function cn(e){e.key===`Escape`&&(z.value&&on(),H.value&&rn())}Ne(()=>{document.addEventListener(`mousedown`,sn),document.addEventListener(`keydown`,cn)}),Me(()=>{document.removeEventListener(`mousedown`,sn),document.removeEventListener(`keydown`,cn),k.value&&(A.value&&k.value.unobserve(A.value),k.value.disconnect())});function ln(){if(!N.value.responsive){k.value&&(A.value&&k.value.unobserve(A.value),k.value.disconnect(),k.value=null,A.value=null);return}let e=de(()=>{if(!D.value)return;let{width:e,height:t}=fe({chart:D.value,title:I.value.title.text?Ge.value:null,legend:I.value.controls.show?qe.value?.$el:null,source:Ke.value});requestAnimationFrame(()=>{rt.value=Math.max(.1,e),it.value=Math.max(.1,t-12)})});k.value&&(A.value&&k.value.unobserve(A.value),k.value.disconnect()),k.value=new ResizeObserver(e),A.value=D.value?D.value.parentNode:null,A.value&&k.value.observe(A.value),e()}function un(e,t={}){let{direction:n=-1,mode:r=`oneLapNearest`,dasharray:i=null}=t;if(!e||typeof e.getTotalLength!=`function`)return bt.value&&console.warn(`VueUiDag @getIdealDashoffsetDelta: invalid path element`,e),0;let a=e.getTotalLength(),o=d(i??e.getAttribute(`stroke-dasharray`)??(typeof getComputedStyle==`function`?getComputedStyle(e).strokeDasharray:``));if(!Number.isFinite(o)||o<=0)return n*a;let s=Math.max(1,Math.round(a/o)),c=Math.max(1,Math.ceil(a/o)),l=Math.max(1,Math.floor(a/o)),u;return u=r===`pattern`?o:r===`oneLapCeil`?c*o:r===`oneLapFloor`?l*o:s*o,n*u;function d(e){if(!e||e===`none`)return NaN;let t=String(e).replace(/,/g,` `).trim().split(/\s+/).map(e=>Number.parseFloat(e)).filter(e=>Number.isFinite(e));if(!t.length)return NaN;let n=t.reduce((e,t)=>e+t,0);return t.length%2==1?n*2:n}}let dn=C(/* @__PURE__ */ new Map),fn=C(/* @__PURE__ */ new Map);function pn(e){return function(t){t?dn.value.set(e,t):dn.value.delete(e)}}function mn(){fn.value.forEach(e=>{try{e.cancel()}catch{}}),fn.value.clear()}function hn(){mn();let e=q.value?.edges??[];if(!e.length)return;let t=tt.value.animations,n=Number(t.referenceDistance)>0?Number(t.referenceDistance):24;e.forEach(e=>{let r=F.value.selectedEdge.animated===!0&&Z.value!=null&&e.id===Z.value,i=!!e?.original?.animated||!!e?.animated||r,a=dn.value.get(e.id);if(!a)return;if(!i){a.style.strokeDasharray=`0`,a.style.strokeDashoffset=`0`;return}let o=e?.original?.dasharray??t.dasharray;a.style.strokeDasharray=String(o),a.style.strokeDashoffset=`0`;let s=![void 0,null].includes(e?.original?.animationDirection),c=![void 0,null].includes(t.animationDirection),l=un(a,{direction:s?Number(e.original.animationDirection):c?Number(t.animationDirection):-1,mode:`oneLapNearest`,dasharray:String(o)}),u=e?.original?.animationDurationMs??t.animationDurationMs??1e3,d=Number(u),f=Number.isFinite(d)&&d>0?n/d:n/1e3,p=Math.max(1,Math.round(Math.abs(l)/Math.max(1e-9,f))),m=a.animate([{strokeDashoffset:0},{strokeDashoffset:l}],{duration:p,iterations:1/0,easing:`linear`});fn.value.set(e.id,m)})}Le(()=>q.value&&q.value.edges,async()=>{await Oe(),hn()},{deep:!0,immediate:!0}),Me(()=>{mn()});async function gn({scale:e=2}={}){if(!D.value)return;let{width:t,height:n}=D.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await ie({domElement:D.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:I.value.title.text??`vue-ui-dag`,width:t,height:n,aspectRatio:r}}let _n=_(()=>{let e=Number(I.value.layout.nodeHeight);return Number.isFinite(e)&&e>0?e/I.value.backgroundPattern.spacingRatio:12}),vn=_(()=>_n.value*(I.value.backgroundPattern.dotRadiusRatio/100)),Q=C(null),yn=null,bn=0;function xn(e){yn&&=(clearTimeout(yn),null),Q.value!==e&&(Q.value=e,(P.value.selected.downstreamEdges.animated===!0||P.value.selected.upstreamEdges.animated===!0)&&hn())}function Sn(e){$e.value=`pointer`,Z.value=null,xn(e)}async function Cn(e){$e.value=`pointer`,Q.value=null,await nn(e)}function wn(e){let t=++bn;yn&&clearTimeout(yn),yn=setTimeout(()=>{t===bn&&Q.value===e&&(Q.value=null,(P.value.selected.downstreamEdges.animated===!0||P.value.selected.upstreamEdges.animated===!0)&&hn())},20)}function Tn(e){let t=e.from===Q.value,n=e.to===Q.value,r=M.value===`midpoint`&&j.value===e.id,i=Z.value===e.id||L.value?.id===e.id||r,a=e.original.color??tt.value.stroke;return i&&F.value.selectedEdge.stroke!=null?a=F.value.selectedEdge.stroke:t&&P.value.selected.downstreamEdges.stroke!=null?a=P.value.selected.downstreamEdges.stroke:n&&P.value.selected.upstreamEdges.stroke!=null&&(a=P.value.selected.upstreamEdges.stroke),e.animated=t&&P.value.selected.downstreamEdges.animated===!0||n&&P.value.selected.upstreamEdges.animated===!0||r&&F.value.selectedEdge.animated===!0?!0:(q.value?.edges.find(t=>t.id===e.id))?.original?.animated??!1,{d:e.pathData,fill:`none`,stroke:a,"stroke-width":tt.value.strokeWidth*(i||e.from===Q.value?2:1),"stroke-linecap":`round`,"stroke-linejoin":`round`}}function En(e){return M.value===`node`&&j.value===e}function Dn(e){let t=Q.value===e.id,n=M.value===`node`&&j.value===e.id,r=t||n,i=r&&P.value.selected.backgroundColor!=null?P.value.selected.backgroundColor:e.original.backgroundColor,a=r&&P.value.selected.stroke!=null?P.value.selected.stroke:P.value.stroke,o=r&&P.value.selected.strokeWidth!=null?P.value.selected.strokeWidth:P.value.strokeWidth;return{x:e.x-e.width/2,y:e.y-e.height/2,width:e.width,height:e.height,rx:P.value.borderRadius,fill:i,stroke:a,"stroke-width":o}}function On(e){let t=e.from===Q.value,n=e.to===Q.value,r=M.value===`midpoint`&&j.value===e.id,i=Z.value===e.id||L.value?.id===e.id||r,a=e.original.color??tt.value.stroke;return i&&F.value.selectedEdge.stroke!=null?a=F.value.selectedEdge.stroke:t&&P.value.selected.downstreamEdges.stroke!=null?a=P.value.selected.downstreamEdges.stroke:n&&P.value.selected.upstreamEdges.stroke!=null&&(a=P.value.selected.upstreamEdges.stroke),{cx:e?.midpoint?.x,cy:e?.midpoint?.y,r:F.value.radius,fill:r?F.value.selectedEdge.stroke??F.value.fill:F.value.fill,stroke:a,"stroke-width":tt.value.strokeWidth*(i||e.from===Q.value?2:1)}}function kn(e){let t=e.from===Q.value,n=e.to===Q.value,r=M.value===`midpoint`&&j.value===e.id,i=Z.value===e.id||L.value?.id===e.id||r,a=e.color??e.original?.color??tt.value.stroke;return i&&F.value.selectedEdge.stroke!=null?a=F.value.selectedEdge.stroke:t&&P.value.selected.downstreamEdges.stroke!=null?a=P.value.selected.downstreamEdges.stroke:n&&P.value.selected.upstreamEdges.stroke!=null&&(a=P.value.selected.upstreamEdges.stroke),a}function An(e){return`${Pt}-${String(e).replace(/[^a-zA-Z0-9_-]/g,`_`)}`}function jn(){return q.value}async function Mn(){We(`copyAlt`,{config:N.value,dataset:_t.value}),N.value.userOptions.callbacks.altCopy?await Promise.resolve(N.value.userOptions.callbacks.altCopy({config:N.value,dataset:_t.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let Nn=_(()=>(q.value?.nodes??[]).map(e=>({id:e.id,type:`node`,x:e.x,y:e.y,label:e.label??e.id,raw:e}))),Pn=_(()=>F.value.show?(q.value?.edges??[]).filter(e=>e?.midpoint).map(e=>({id:e.id,type:`midpoint`,x:e.midpoint.x,y:e.midpoint.y,label:`${J(e.from)?.label??e.from} → ${J(e.to)?.label??e.to}`,raw:e})):[]),$=_(()=>[...Nn.value,...Pn.value].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)),Fn=_(()=>{let e=/* @__PURE__ */ new Map;return $.value.forEach((t,n)=>{e.set(`${t.type}:${t.id}`,n)}),e}),In=_(()=>{let e=q.value?.nodes??[],t=q.value?.edges??[];return{headers:[N.value.a11y?.translations?.node??`Node`,N.value.a11y?.translations?.parents??`Parents`,N.value.a11y?.translations?.children??`Children`],rows:e.map(e=>{let n=t.filter(t=>t.to===e.id).map(e=>J(e.from)?.label??e.from).join(`, `),r=t.filter(t=>t.from===e.id).map(e=>J(e.to)?.label??e.to).join(`, `);return[e.label??e.id,n||`—`,r||`—`]})}});function Ln(e){return`${e.type}:${e.id}`}function Rn(){return j.value==null||M.value==null?null:$.value.find(e=>e.id===j.value&&e.type===M.value)??null}async function zn(e){e&&(e.type===`node`?rn():e.type===`midpoint`&&(on(),await nn(e.raw)))}function Bn(e){e&&(j.value=e.id,M.value=e.type,Qe.value=Fn.value.get(Ln(e))??null,e.type===`node`?(xn(e.id),Z.value=null):e.type===`midpoint`&&(Q.value=null,Z.value=e.id,F.value.selectedEdge.animated===!0&&hn()))}function Vn(){j.value=null,M.value=null,Qe.value=null,z.value||(Q.value=null),H.value||(Z.value=null,F.value.selectedEdge.animated===!0&&hn())}function Hn(){et.value=!0,Vn()}function Un(){et.value=!1,on(),rn(),Vn()}function Wn(e,t,n){let r=t.x-e.x,i=t.y-e.y;return n===`right`&&r<=0||n===`left`&&r>=0||n===`down`&&i<=0||n===`up`&&i>=0?1/0:n===`right`||n===`left`?Math.abs(r)*1e3+Math.abs(i):Math.abs(i)*1e3+Math.abs(r)}function Gn(e,t){let n=$.value.filter(t=>Ln(t)!==Ln(e));if(!n.length)return null;let r=null,i=1/0;return n.forEach(n=>{let a=Wn(e,n,t);a<i&&(i=a,r=n)}),r||(t===`right`||t===`down`?$.value[0]??null:$.value[$.value.length-1]??null)}async function Kn(e){e&&($e.value=`keyboard`,e.type===`node`&&(rn(),await an(e.raw)))}async function qn(e){if(!W.value||U.value||document.activeElement!==W.value||!$.value.length)return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`ArrowUp`,i=e.key===`ArrowDown`,a=e.key===`Enter`||e.key===` `,o=e.key===`Escape`;if(!t&&!n&&!r&&!i&&!a&&!o)return;if(e.preventDefault(),e.stopPropagation(),o){on(),rn(),Vn();return}let s=Rn();if(a){if(!s)return;s.type===`node`&&await Kn(s);return}if(!s){let e=$.value[0];if(!e)return;Bn(e),await zn(e);return}let c=null;n?c=Gn(s,`right`):t?c=Gn(s,`left`):i?c=Gn(s,`down`):r&&(c=Gn(s,`up`)),c&&(on(),rn(),Bn(c),await zn(c))}s({getData:jn,getImage:gn,generatePdf:St,generateSvg:Ot,generateImage:Ct,toggleAnnotator:Yt,toggleFullscreen:Jt,zoomIn:Xt,zoomOut:Zt,resetZoom:Lt,switchDirection:$t,copyAlt:Mn,focusOnNode:Ht});let Jn=_(()=>ge(N.value.userOptions?.annotator?.followZoom,Y.value));return(e,i)=>(S(),b(`div`,{class:ke(`vue-data-ui-component vue-ui-dag ${X.value?`vue-data-ui-wrapper-fullscreen`:``} ${N.value.responsive?`vue-ui-dag-responsive`:``}`),id:`dag_${O.value}`,ref_key:`dagChart`,ref:D,style:je({fontFamily:N.value.style.fontFamily,backgroundColor:I.value.backgroundColor,padding:`0.5rem`}),onMouseenter:At,onMouseleave:jt},[x(`div`,{id:`chart-instructions-${O.value}`,class:`sr-only`},[x(`p`,null,Fe(N.value.a11y.translations.keyboardNavigation),1)],8,or),In.value?.rows?.length?(S(),v(pe,{key:0,uid:O.value,head:In.value.headers,body:In.value.rows,notice:N.value.a11y.translations.tableAvailable,caption:N.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):y(``,!0),T(Nt)?(S(),b(`div`,sr,Fe(String(T(Nt))),1)):y(``,!0),N.value.userOptions.buttons.annotator?(S(),v(T(Re),De({key:2},T(n)(N.value.userOptions.annotator),{svgRef:T(W),followZoom:N.value.userOptions?.annotator?.followZoom,annotationViewport:Jn.value,backgroundColor:I.value.backgroundColor,color:I.value.color,active:U.value,isCursorPointer:nt.value,palette:N.value.userOptions.annotatorPalette,onClose:Yt}),Se({_:2},[Pe(T(r),n=>({name:n,fn:ze(r=>[w(e.$slots,n,Ae(Ee(T(t)(n,r))),void 0,!0)])}))]),1040,[`svgRef`,`followZoom`,`annotationViewport`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):y(``,!0),N.value.userOptions.show&&Ze.value&&(T(mt)||T(ft))?(S(),v(T(Ve),{ref:`userOptionsRef`,key:`user_option_${Ye.value}`,backgroundColor:I.value.backgroundColor,color:I.value.color,isPrinting:T(xt),isImaging:T(K),uid:O.value,hasTooltip:!1,hasTable:!1,hasXls:!1,hasLabel:!1,hasPdf:N.value.userOptions.buttons.pdf,hasImg:N.value.userOptions.buttons.img,hasSvg:N.value.userOptions.buttons.svg,hasFullscreen:N.value.userOptions.buttons.fullscreen,hasAltCopy:N.value.userOptions.buttons.altCopy,isFullscreen:X.value,chartElement:D.value,position:N.value.userOptions.position,titles:{...N.value.userOptions.buttonTitles},hasAnnotator:N.value.userOptions.buttons.annotator,isAnnotation:U.value,callbacks:N.value.userOptions.callbacks,printScale:N.value.userOptions.print.scale,hasZoom:N.value.userOptions.buttons.zoom,isZoom:It.value,isCursorPointer:nt.value,onToggleFullscreen:Jt,onGeneratePdf:T(St),onGenerateImage:T(kt),onGenerateSvg:T(Ot),onToggleAnnotator:Yt,onToggleZoom:Ut,onCopyAlt:Mn,style:je({visibility:T(mt)?T(ft)?`visible`:`hidden`:`visible`})},Se({_:2},[Pe(T(ce)(e.$slots,`menuIcon optionPdf optionImg optionSvg optionFullscreen optionAnnotator optionZoom optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:ze(n=>[w(e.$slots,t,Ae(Ee(T(le)(t,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasPdf`,`hasImg`,`hasSvg`,`hasFullscreen`,`hasAltCopy`,`isFullscreen`,`chartElement`,`position`,`titles`,`hasAnnotator`,`isAnnotation`,`callbacks`,`printScale`,`hasZoom`,`isZoom`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):y(``,!0),I.value.title.text?(S(),b(`div`,{key:4,ref_key:`chartTitle`,ref:Ge,style:`width:100%;background:transparent;`},[(S(),v(oe,{key:`title_${Je.value}`,config:{title:{cy:`dag-title`,...I.value.title},subtitle:{cy:`dag-subtitle`,...I.value.title.subtitle}}},null,8,[`config`]))],512)):y(``,!0),I.value.controls.position===`top`&&!T(gt)&&I.value.controls.show?(S(),v(ae,{key:5,ref_key:`zoomControls`,ref:qe,config:N.value,scale:T(zt),isFullscreen:X.value,withDirection:``,onZoomIn:Xt,onZoomOut:Zt,onResetZoom:i[0]||=()=>T(Lt)(!0),onSwitchDirection:$t},null,8,[`config`,`scale`,`isFullscreen`])):y(``,!0),x(`div`,cr,[T(q)?(S(),b(`svg`,{key:0,ref_key:`svgRef`,ref:W,class:ke({"vue-ui-dag-svg":!0,"vue-data-ui-loading":T(gt)}),viewBox:Gt.value,xmlns:T(p),style:je({backgroundColor:I.value.backgroundColor,height:`100%`,width:`100%`}),tabindex:`0`,"aria-describedby":`chart-instructions-${O.value}`,onFocus:Hn,onBlur:Un,onKeydown:qn},[we(T(He)),w(e.$slots,`svg-underlayer`,{svg:{drawingArea:T(Y),data:T(q),orientation:G.value,isPrintingImg:T(xt)||T(K)||T(Et),isPrintingSvg:T(Dt)}},void 0,!0),I.value.backgroundPattern.show?(S(),b(`defs`,ur,[x(`pattern`,{id:`dag_bg_pattern_${O.value}`,patternUnits:`userSpaceOnUse`,width:_n.value,height:_n.value},[w(e.$slots,`background-pattern`,Ae(Ee({x:_n.value/2,y:_n.value/2,color:I.value.backgroundPattern.dotColor})),()=>[x(`circle`,{cx:_n.value/2,cy:_n.value/2,r:vn.value,fill:I.value.backgroundPattern.dotColor},null,8,fr)],!0)],8,dr)])):y(``,!0),I.value.backgroundPattern.show?(S(),b(`rect`,{key:1,x:qt.value?.x??0,y:qt.value?.y??0,width:qt.value?.width??0,height:qt.value?.height??0,fill:`url(#dag_bg_pattern_${O.value})`,style:je({pointerEvents:`none`,opacity:I.value.backgroundPattern.opacity})},null,12,pr)):y(``,!0),T(q).arrowShape===`undirected`?y(``,!0):(S(),b(`defs`,mr,[(S(!0),b(ye,null,Pe(T(q).edges,e=>(S(),b(`marker`,{key:`marker_${e.id}`,id:An(e.id),markerWidth:T(q).arrowSize,markerHeight:T(q).arrowSize,refX:T(q).arrowSize-3,refY:T(q).arrowSize/2,orient:`auto`,markerUnits:`strokeWidth`},[T(q).arrowShape===`normal`?(S(),b(`path`,{key:0,d:`M 0 0 L ${T(q).arrowSize} ${T(q).arrowSize/2} L 0 ${T(q).arrowSize} Z`,fill:kn(e),stroke:kn(e),"stroke-width":`0`,style:{transition:`stroke 0.2s ease-in-out,
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./annotationSlots-OLiW25XN.js";import{t as i}from"./useConfig-By3Vb5kz.js";import{Pt as a,S as o,St as s,X as c,Y as l,at as u,in as d,rt as f,t as p,zt as m}from"./lib-rPeBMZrn.js";import{n as h,t as g}from"./BaseScanner-8NdoBs7B.js";import{n as ee,t as te}from"./useHints-C-TwxM0Y.js";import{t as ne}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as re}from"./resolveChartConfig-CIhClE5R.js";import{t as ie}from"./img-D4RQwASc.js";import{t as ae}from"./BaseZoomControls-JSk9zW3D.js";import{n as oe}from"./Title-BliHuXfT.js";import{t as se}from"./useChartExport-BZts4KFb.js";import{n as ce,t as le}from"./userOptionsSlots-DYuo-E5m.js";import{t as ue}from"./usePrinter-DVf3YcG5.js";import{c as de}from"./canvas-lib-22VpOI4_.js";import{t as fe}from"./useResponsive-CENUxfEL.js";import{t as pe}from"./A11yDataTable-DWNlWXzs.js";import{t as me}from"./useUserOptionState-CXlFnwPv.js";import{t as he}from"./useChartAccessibility-DOMuYJfm.js";import{n as ge}from"./annotationViewport-X8fvs7pz.js";import{t as _e}from"./usePanZoom-CE6Ofyy8.js";import{t as ve}from"./vue_ui_dag-1b_dLSym.js";import{Fragment as ye,Teleport as be,Transition as xe,computed as _,createBlock as v,createCommentVNode as y,createElementBlock as b,createElementVNode as x,createSlots as Se,createTextVNode as Ce,createVNode as we,defineAsyncComponent as Te,guardReactiveProps as Ee,mergeProps as De,nextTick as Oe,normalizeClass as ke,normalizeProps as Ae,normalizeStyle as je,onBeforeUnmount as Me,onMounted as Ne,openBlock as S,ref as C,renderList as Pe,renderSlot as w,toDisplayString as Fe,toRefs as Ie,unref as T,watch as Le,watchEffect as Re,withCtx as ze,withModifiers as Be}from"vue";var Ve=`\0`,He=`\0`,Ue=``,E=class{_isDirected=!0;_isMultigraph=!1;_isCompound=!1;_label;_defaultNodeLabelFn=()=>void 0;_defaultEdgeLabelFn=()=>void 0;_nodes={};_in={};_preds={};_out={};_sucs={};_edgeObjs={};_edgeLabels={};_nodeCount=0;_edgeCount=0;_parent;_children;constructor(e){e&&(this._isDirected=!Object.hasOwn(e,`directed`)||e.directed,this._isMultigraph=Object.hasOwn(e,`multigraph`)?e.multigraph:!1,this._isCompound=Object.hasOwn(e,`compound`)?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[He]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,typeof e!=`function`&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){let e=this;return this.nodes().filter(t=>Object.keys(e._in[t]).length===0)}sinks(){let e=this;return this.nodes().filter(t=>Object.keys(e._out[t]).length===0)}setNodes(e,t){let n=arguments,r=this;return e.forEach(e=>{n.length>1?r.setNode(e,t):r.setNode(e)}),this}setNode(e,t){return Object.hasOwn(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=He,this._children[e]={},this._children[He][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){let t=this;if(Object.hasOwn(this._nodes,e)){let n=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(n),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=He;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==He)return t}}children(e=He){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else if(e===He)return this.nodes();else if(this.hasNode(e))return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let t of this.successors(e))n.add(t);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());let n=this;Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});let r={};function i(e){let a=n.parent(e);return a===void 0||t.hasNode(a)?(r[e]=a,a):a in r?r[a]:i(a)}return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,i(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,typeof e!=`function`&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){let n=this,r=arguments;return e.reduce((e,i)=>(r.length>1?n.setEdge(e,i,t):n.setEdge(e,i),i)),this}setEdge(){let e,t,n,r,i=!1,a=arguments[0];typeof a==`object`&&a&&`v`in a?(e=a.v,t=a.w,n=a.name,arguments.length===2&&(r=arguments[1],i=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),e=``+e,t=``+t,n!==void 0&&(n=``+n);let o=O(this._isDirected,e,t,n);if(Object.hasOwn(this._edgeLabels,o))return i&&(this._edgeLabels[o]=r),this;if(n!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(e),this.setNode(t),this._edgeLabels[o]=i?r:this._defaultEdgeLabelFn(e,t,n);let s=Ge(this._isDirected,e,t,n);return e=s.v,t=s.w,Object.freeze(s),this._edgeObjs[o]=s,We(this._preds[t],e),We(this._sucs[e],t),this._in[t][o]=s,this._out[e][o]=s,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?Ke(this._isDirected,arguments[0]):O(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(){let e=this.edge(...arguments);return typeof e==`object`?e:{label:e}}hasEdge(e,t,n){let r=arguments.length===1?Ke(this._isDirected,arguments[0]):O(this._isDirected,e,t,n);return Object.hasOwn(this._edgeLabels,r)}removeEdge(e,t,n){let r=arguments.length===1?Ke(this._isDirected,arguments[0]):O(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],D(this._preds[t],e),D(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this}inEdges(e,t){let n=this._in[e];if(n){let e=Object.values(n);return t?e.filter(e=>e.v===t):e}}outEdges(e,t){let n=this._out[e];if(n){let e=Object.values(n);return t?e.filter(e=>e.w===t):e}}nodeEdges(e,t){let n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}};function We(e,t){e[t]?e[t]++:e[t]=1}function D(e,t){--e[t]||delete e[t]}function O(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+Ue+a+Ue+(r===void 0?Ve:r)}function Ge(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function Ke(e,t){return O(e,t.v,t.w,t.name)}var qe=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return Je(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&Je(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,Ye)),n=n._prev;return`[`+e.join(`, `)+`]`}};function Je(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Ye(e,t){if(e!==`_next`&&e!==`_prev`)return t}var Xe=()=>1;function Ze(e,t){if(e.nodeCount()<=1)return[];let n=j(e,t||Xe);return k(n.graph,n.buckets,n.zeroIndex).flatMap(t=>e.outEdges(t.v,t.w))}function k(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)A(e,t,n,o);for(;o=i.dequeue();)A(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i].dequeue(),o){r=r.concat(A(e,t,n,o,!0));break}}}return r}function A(e,t,n,r,i){let a=i?[]:void 0;return e.inEdges(r.v).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,M(t,n,s)}),e.outEdges(r.v).forEach(r=>{let i=e.edge(r),a=e.node(r.w);a.in-=i,M(t,n,a)}),e.removeNode(r.v),a}function j(e,t){let n=new E,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});let a=Qe(i+r+3).map(()=>new qe),o=r+1;return n.nodes().forEach(e=>{M(a,o,n.node(e))}),{graph:n,buckets:a,zeroIndex:o}}function M(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function Qe(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function $e(e,t,n,r){let i=r;for(;e.hasNode(i);)i=B(r);return n.dummy=t,e.setNode(i,n),i}function et(e){let t=new E().setGraph(e.graph());return e.nodes().forEach(n=>{t.setNode(n,e.node(n))}),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function N(e){let t=new E({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function P(e){let t=e.nodes().map(t=>{let n={};return e.outEdges(t).forEach(t=>{n[t.w]=(n[t.w]||0)+e.edge(t).weight}),n});return H(e.nodes(),t)}function tt(e){let t=e.nodes().map(t=>{let n={};return e.inEdges(t).forEach(t=>{n[t.v]=(n[t.v]||0)+e.edge(t).weight}),n});return H(e.nodes(),t)}function F(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function I(e){let t=V(ot(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i][r.order]=n)}),t}function nt(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=R(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function rt(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=R(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>{e.node(t).rank+=i})})}function it(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),$e(e,`border`,i,t)}var at=65535;function L(e,t=at){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}function R(e,t){if(t.length>at){let n=L(t);return e.apply(null,n.map(t=>e.apply(null,t)))}return e.apply(null,t)}function ot(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return R(Math.max,t)}function st(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function z(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function ct(e,t){return t()}var lt=0;function B(e){let t=++lt;return e+String(t)}function V(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function ut(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function dt(e,t){let n=t;if(typeof t==`string`){let e=t;n=t=>t[e]}return Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function H(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var U={addBorderNode:it,addDummyNode:$e,applyWithChunking:R,asNonCompoundGraph:N,buildLayerMatrix:I,intersectRect:F,mapValues:dt,maxRank:ot,normalizeRanks:nt,notime:ct,partition:st,pick:ut,predecessorWeights:tt,range:V,removeEmptyRanks:rt,simplify:et,successorWeights:P,time:z,uniqueId:B,zipObject:H};function W(e){(e.graph().acyclicer===`greedy`?Ze(e,t(e)):pt(e)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,B(`rev`))});function t(e){return t=>e.edge(t).weight}}function ft(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function pt(e){let t=[],n={},r={};function i(a){Object.hasOwn(r,a)||(r[a]=!0,n[a]=!0,e.outEdges(a).forEach(e=>{Object.hasOwn(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return e.nodes().forEach(i),t}function mt(e){e.graph().dummyChains=[],e.edges().forEach(t=>G(e,t))}function G(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=$e(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function ht(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel;e.setEdge(n.edgeObj,r);let i;for(;n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function gt(e){function t(n){let r=e.node(n);if(r&&Object.prototype.hasOwnProperty.call(r,`rank`))return r.rank;let i=e.outEdges(n)||[];if(!i.length)return r&&(r.rank=0),0;let a=i.map(n=>e.node(n.w)?t(n.w)-e.edge(n).minlen:1/0),o=R(Math.min,a);return o===1/0&&(o=0),r&&(r.rank=o),o}(e.sources()||[]).forEach(t)}function _t(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}function vt(e){yt(e);let t=new E;e.nodes().forEach(e=>{t.setNode(e,{})});let n=e.nodes();if(!n.length)return t;let r=n[0],i=/* @__PURE__ */ new Set([r]);for(;i.size<n.length;){let r=bt(e,i);if(!r){let e=n.find(e=>!i.has(e));i.add(e),t.setNode(e,{});continue}let{edgeObject:a,delta:o,attachFrom:s,attachTo:c}=r;xt(e,i,s,o),t.setEdge(a.v,a.w,{}),i.add(c)}return t}function yt(e){e.nodes().forEach(t=>{let n=e.node(t)||{};Object.prototype.hasOwnProperty.call(n,`rank`)||(n.rank=0,e.setNode(t,n))})}function bt(e,t){let n=null;return e.edges().forEach(r=>{let i=t.has(r.v);if(i===t.has(r.w))return;let a=_t(e,r),o=Math.abs(a);if(!n||o<n.absoluteSlack){let e=i?r.v:r.w,t=i?r.w:r.v;n={edgeObject:r,delta:i?a:-a,attachFrom:e,attachTo:t,absoluteSlack:o}}}),n}function xt(e,t,n,r){r&&e.nodes().forEach(n=>{if(!t.has(n)){let t=e.node(n);t.rank+=r}})}function K(e){let t=et(e);return gt(t),t.nodes().forEach(n=>{let r=t.node(n),i=e.node(n)||{};i.rank=r.rank,e.setNode(n,i)}),e}function St(e,t){}function Ct(e,t){}function wt(e,t,n){return 0}function Tt(e){return null}function Et(e,t){return null}K.initLowLimValues=St,K.initCutValues=Ct,K.calcCutValue=wt,K.leaveEdge=Tt,K.enterEdge=Et;var Dt=gt;function Ot(e){let t=e.graph().ranker;if(t instanceof Function)return t(e);switch(e.graph().ranker){case`network-simplex`:jt(e);break;case`tight-tree`:At(e);break;case`longest-path`:kt(e);break;case`none`:break;default:jt(e)}}var kt=Dt;function At(e){Dt(e),vt(e)}function jt(e){K(e)}function Mt(e){let t=Nt(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=q(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0,d=n;for(;d!==i.w;){if(r=e.node(d),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(l=o[c+1]).minRank<=r.rank;)c++;l=o[c]}e.setParent(d,l),d=e.successors(d)[0]}})}function q(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c,l;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function Nt(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children().forEach(r),t}function Pt(e){let t=U.addDummyNode(e,`root`,{},`_root`),n=Ft(e),r=Object.values(n),i=U.applyWithChunking(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>{e.edge(t).minlen*=a});let o=It(e)+1;e.children().forEach(r=>{J(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function J(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=U.addBorderNode(e,`_bt`),l=U.addBorderNode(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{J(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-a[o]+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+a[o]})}function Ft(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children().forEach(e=>n(e,1)),t}function It(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function Y(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}function Lt(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)Rt(e,`borderLeft`,`_bl`,n,i,t),Rt(e,`borderRight`,`_br`,n,i,t)}}e.children().forEach(t)}function Rt(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=$e(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function zt(e){let t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&Vt(e)}function Bt(e){let t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&Ut(e),(t===`lr`||t===`rl`)&&(Gt(e),Vt(e))}function Vt(e){e.nodes().forEach(t=>{Ht(e.node(t))}),e.edges().forEach(t=>{Ht(e.edge(t))})}function Ht(e){let t=e.width;e.width=e.height,e.height=t}function Ut(e){e.nodes().forEach(t=>{Wt(e.node(t))}),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(Wt),Object.hasOwn(n,`y`)&&Wt(n)})}function Wt(e){e.y=-e.y}function Gt(e){e.nodes().forEach(t=>{X(e.node(t))}),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(X),Object.hasOwn(n,`x`)&&X(n)})}function X(e){let t=e.x;e.x=e.y,e.y=t}var Kt={adjust:zt,undo:Bt};function qt(e){let t={},n=e.nodes().filter(t=>e.children(t).length===0),r=n.map(t=>e.node(t).rank),i=V(R(Math.max,r)+1).map(()=>[]);function a(n){if(t[n])return;t[n]=!0;let r=e.node(n);i[r.rank].push(n),e.successors(n).forEach(a)}return n.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(a),i}function Jt(e,t){let n=0;for(let r=1;r<t.length;++r)n+=Yt(e,t[r-1],t[r]);return n}function Yt(e,t,n){let r=H(n,n.map((e,t)=>t)),i=t.flatMap(t=>e.outEdges(t).map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos)),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function Xt(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n.length)return{v:t};let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}})}function Zt(e,t){let n={};return e.forEach((e,t)=>{let r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight)}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),Qt(Object.values(n).filter(e=>!e.indegree))}function Qt(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&$t(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>ut(e,[`vs`,`i`,`barycenter`,`weight`]))}function $t(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function en(e,t){let n=st(e,e=>Object.hasOwn(e,`barycenter`)),r=n.lhs,i=n.rhs.sort((e,t)=>t.i-e.i),a=[],o=0,s=0,c=0;r.sort(Z(!!t)),c=tn(a,i,c),r.forEach(e=>{c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=tn(a,i,c)});let l={vs:a.flat(!0)};return s&&(l.barycenter=o/s,l.weight=s),l}function tn(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Z(e){return(t,n)=>t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}function nn(e,t,n,r){let i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=i.filter(e=>e!==o&&e!==s));let l=Xt(e,i);l.forEach(t=>{if(e.children(t.v).length){let i=nn(e,t.v,n,r);c[t.v]=i,Object.hasOwn(i,`barycenter`)&&an(t,i)}});let u=Zt(l,n);rn(u,c);let d=en(u,r);if(o&&(d.vs=[o,d.vs,s].flat(!0),e.predecessors(o).length)){let t=e.node(e.predecessors(o)[0]),n=e.node(e.predecessors(s)[0]);Object.hasOwn(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+t.order+n.order)/(d.weight+2),d.weight+=2}return d}function rn(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function an(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function on(e,t,n,r){r||=e.nodes();let i=sn(e),a=new E({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(a.setNode(r),a.setParent(r,s||i),e[n](r).forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i?i.weight:0;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),a}function sn(e){let t;for(;e.hasNode(t=B(`_root`)););return t}function cn(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function ln(e,t={}){if(typeof t.customOrder==`function`){t.customOrder(e,ln);return}let n=ot(e),r=un(e,V(1,n+1),`inEdges`),i=un(e,V(n-1,-1,-1),`outEdges`),a=qt(e);if(fn(e,a),t.disableOptimalOrderHeuristic)return;let o=1/0,s,c=t.constraints||[];for(let t=0,n=0;n<4;++t,++n){dn(t%2==0?r:i,t%4>=2,c),a=I(e);let l=Jt(e,a);l<o?(o=l,n=0,s=structuredClone(a)):l===o&&(s=structuredClone(a))}fn(e,s)}function un(e,t,n){let r=/* @__PURE__ */ new Map;function i(e,t){r.has(e)||r.set(e,[]),r.get(e).push(t)}for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(t=>on(e,t,n,r.get(t)||[]))}function dn(e,t,n){let r=new E;e.forEach(e=>{n.forEach(e=>r.setEdge(e.left,e.right));let i=e.graph().root,a=nn(e,i,r,t);a.vs.forEach((t,n)=>{e.node(t).order=n}),cn(e,r,a.vs)})}function fn(e,t){Object.values(t).forEach(t=>{t.forEach((t,n)=>{e.node(t).order=n})})}function pn(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=hn(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{e.predecessors(t).forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&gn(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function mn(e,t){let n={};function r(t,r,i,a,o){let s;V(r,i).forEach(r=>{s=t[r],e.node(s).dummy&&e.predecessors(s).forEach(t=>{let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&gn(n,t,s)})})}function i(t,n){let i=-1,a,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);t.length&&(a=e.node(t[0]).order,r(n,o,c,i,a),o=c,i=a)}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function hn(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}function gn(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function _n(e,t,n){if(t>n){let e=t;t=n,n=e}return!!e[t]&&Object.hasOwn(e[t],n)}function vn(e,t,n,r){let i={},a={},o={};return t.forEach(e=>{e.forEach((e,t)=>{i[e]=e,a[e]=e,o[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let s=r(e);if(s.length){s=s.sort((e,t)=>o[e]-o[t]);let r=(s.length-1)/2;for(let c=Math.floor(r),l=Math.ceil(r);c<=l;++c){let r=s[c];a[e]===e&&t<o[r]&&!_n(n,e,r)&&(a[r]=e,a[e]=i[e]=i[r],t=o[r])}}})}),{root:i,align:a}}function Q(e,t,n,r,i){let a={},o=yn(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){a[e]=o.inEdges(e).reduce((e,t)=>Math.max(e,a[t.v]+o.edge(t)),0)}function u(t){let n=o.outEdges(t).reduce((e,t)=>Math.min(e,a[t.w]-o.edge(t)),1/0),r=e.node(t);n!==1/0&&r.borderType!==s&&(a[t]=Math.max(a[t],n))}return c(l,o.predecessors.bind(o)),c(u,o.successors.bind(o)),Object.keys(r).forEach(e=>{a[e]=a[n[e]]}),a}function yn(e,t,n,r){let i=new e.constructor,a=e.graph(),o=wn(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(i.setNode(a),r){let s=n[r],c=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),c||0))}r=t})}),i}function bn(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=Tn(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function xn(e,t){let n=Object.values(t),r=R(Math.min,n),i=R(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(s===t)return;let c=Object.values(s),l=r-R(Math.min,c);a!==`l`&&(l=i-R(Math.max,c)),l&&(s=dt(s,e=>e+l),e[o]=s)})})}function Sn(e,t){return dt(e.ul,(n,r)=>{if(t)return e[t.toLowerCase()][r];let i=Object.values(e).map(e=>e[r]).sort((e,t)=>e-t);return(i[1]+i[2])/2})}function Cn(e){let t=I(e),n=Object.assign(pn(e,t),mn(e,t)),r={},i;return[`u`,`d`].forEach(a=>{i=a===`u`?t:Object.values(t).reverse(),[`l`,`r`].forEach(t=>{let o=i;t===`r`&&(o=o.map(e=>Object.values(e).reverse()));let s=(a===`u`?e.predecessors:e.successors).bind(e),c=vn(e,o,n,s),l=Q(e,o,c.root,c.align,t===`r`);t===`r`&&(l=dt(l,e=>-e)),r[a+t]=l})}),xn(r,bn(e,r)),Sn(r,e.graph().align)}function wn(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),l=0,c}}function Tn(e,t){return e.node(t).width}function En(e){let t=N(e);Dn(t);let n=Cn(t);Object.entries(n).forEach(([t,n])=>{e.node(t).x=n})}function Dn(e){let t=I(e),n=e.graph().ranksep,r=0;t.forEach(t=>{let i=t.reduce((t,n)=>{let r=e.node(n).height;return t>r?t:r},0);t.forEach(t=>{e.node(t).y=r+i/2}),r+=i+n})}function On(e,t={}){let n=t.debugTiming?z:ct;return n(`layout`,()=>{let r=n(` buildLayoutGraph`,()=>Rn(e));return n(` runLayout`,()=>kn(r,n,t)),n(` updateInputGraph`,()=>An(e,r)),r})}function kn(e,t,n){t(` makeSpaceForEdgeLabels`,()=>zn(e)),t(` removeSelfEdges`,()=>Yn(e)),t(` acyclic`,()=>W(e)),t(` nestingGraph.run`,()=>Pt(e)),t(` rank`,()=>Ot(N(e))),t(` injectEdgeLabelProxies`,()=>Bn(e)),t(` removeEmptyRanks`,()=>rt(e)),t(` nestingGraph.cleanup`,()=>Y(e)),t(` normalizeRanks`,()=>nt(e)),t(` assignRankMinMax`,()=>Vn(e)),t(` removeEdgeLabelProxies`,()=>Hn(e)),t(` normalize.run`,()=>mt(e)),t(` parentDummyChains`,()=>Mt(e)),t(` addBorderSegments`,()=>Lt(e)),t(` order`,()=>ln(e,n)),t(` insertSelfEdges`,()=>Xn(e)),t(` adjustCoordinateSystem`,()=>Kt.adjust(e)),t(` position`,()=>En(e)),t(` positionSelfEdges`,()=>Zn(e)),t(` removeBorderNodes`,()=>Jn(e)),t(` normalize.undo`,()=>ht(e)),t(` fixupEdgeLabelCoords`,()=>Kn(e)),t(` undoCoordinateSystem`,()=>Kt.undo(e)),t(` translateGraph`,()=>Un(e)),t(` assignNodeIntersects`,()=>Gn(e)),t(` reversePoints`,()=>qn(e)),t(` acyclic.undo`,()=>ft(e))}function An(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)});let n=t.graph(),r=e.graph();r.width=n.width,r.height=n.height}var jn=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],Mn={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},Nn=[`acyclicer`,`ranker`,`rankdir`,`align`],Pn=[`width`,`height`,`rank`],$={width:0,height:0},Fn=[`minlen`,`weight`,`width`,`height`,`labeloffset`],In={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},Ln=[`labelpos`,`arrowshape`];function Rn(e){let t=$n(e.graph()),n={...Mn,...Qn(t,jn),...ut(t,Nn)},r=new E({multigraph:!0,compound:!0});return r.setGraph(n),e.nodes().forEach(t=>{let n=Qn($n(e.node(t)),Pn);Object.keys($).forEach(e=>{n[e]===void 0&&(n[e]=$[e])}),r.setNode(t,n),r.setParent(t,e.parent(t))}),e.edges().forEach(t=>{let n=$n(e.edge(t));r.setEdge(t,{...In,...Qn(n,Fn),...ut(n,Ln)})}),r}function zn(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function Bn(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);$e(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function Vn(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function Hn(e){e.nodes().forEach(t=>{let n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function Un(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function Wn(e,t,n){if(!n||!t)return e;let r=t.x-e.x,i=t.y-e.y,a=Math.sqrt(r*r+i*i);if(!a||a<=n)return e;let o=n/a;return{x:e.x+r*o,y:e.y+i*o}}function Gn(e){e.edges().forEach(t=>{let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;!n.points||!n.points.length?(n.points=[],a=i,o=r):(a=n.points[0],o=n.points[n.points.length-1]);let s=F(r,a),c=F(i,o),l=n.points.length?n.points[0]:a,u=n.points.length?n.points[n.points.length-1]:o,d=n.arrowshape,f=d===`normal`||d===`vee`,p=!!n.reversed,m=s,h=c;f&&(p?m=Wn(s,l,4):h=Wn(c,u,4)),n.points.unshift(m),n.points.push(h)})}function Kn(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function qn(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function Jn(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function Yn(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Xn(e){I(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);i.order=r+n,(i.selfEdges||[]).forEach(t=>{$e(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function Zn(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`selfedge`){let r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function Qn(e,t){return dt(ut(e,t),Number)}function $n(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{let r=e;typeof r==`string`&&(r=r.toLowerCase()),t[r]=n}),t}var er={rankDirection:`TB`,nodeSeparation:50,rankSeparation:50,edgeSeparation:10,align:void 0,nodeWidth:100,nodeHeight:40,curvedEdges:!1,padding:20,arrowShape:`normal`,arrowSize:10};function tr(e){return e.length?e.map((e,t)=>`${t===0?`M`:`L`} ${e.x} ${e.y}`).join(` `):``}function nr(e){if(!e.length)return``;if(e.length===1){let t=e[0];return`M ${t.x} ${t.y}`}if(e.length===2)return`M ${e[0].x} ${e[0].y} L ${e[1].x} ${e[1].y}`;let[t]=e,n=`M ${t.x} ${t.y}`;for(let t=1;t<e.length-1;t+=1){e[t-1];let r=e[t],i=e[t+1],a=r.x,o=r.y,s=(r.x+i.x)/2,c=(r.y+i.y)/2;n+=` Q ${a} ${o} ${s} ${c}`}let r=e[e.length-1];return n+=` L ${r.x} ${r.y}`,n}function rr(e){let{nodes:t,edges:n,configuration:r}=e,i=C(null),a=C(null),o=`dag-arrow-${c()}`;function l(e,t,n){a.value=null,i.value=null;let r={...er,...n},l=new E({multigraph:!0,compound:!0});l.setGraph({rankdir:r.rankDirection,nodesep:r.nodeSeparation,ranksep:r.rankSeparation,edgesep:r.edgeSeparation,align:r.align}),e.forEach(e=>{l.setNode(e.id,{label:e.label,width:e.width??r.nodeWidth,height:e.height??r.nodeHeight})}),t.forEach(e=>{l.setEdge(e.from,e.to,{weight:e.weight??1,minlen:e.minLength??1,arrowShape:r.arrowShape??`normal`})}),On(l);let u=e.map(e=>{let t=l.node(e.id);return{id:e.id,label:e.label,x:t.x,y:t.y,width:t.width,height:t.height,original:e}}),d=l.edges().map(e=>{let n=l.edge(e),i=n.points||[];if(!i.length)return null;let a=r.curvedEdges?nr(i):tr(i),s=r.arrowShape===`undirected`?null:`url(#${o})`,u=t.find(t=>t?.from===e.v&&t?.to===e.w);return{id:`${e.v}->${e.w}->${c()}`,from:e.v,to:e.w,points:i,pathData:a,markerEnd:s,original:{...u,...n}}}).filter(Boolean),f=r.padding;if(!u.length){i.value={nodes:[],edges:d,viewBox:`0 0 0 0`,arrowShape:r.arrowShape,arrowSize:r.arrowSize};return}let p=u.flatMap(e=>[e.x-e.width/2,e.x+e.width/2]),m=u.flatMap(e=>[e.y-e.height/2,e.y+e.height/2]),h=Math.min(...p)-f,g=Math.max(...p)+f,ee=Math.min(...m)-f,te=Math.max(...m)+f;i.value={nodes:u,edges:d.map(e=>({...e,midpoint:e.pathData?s(e.pathData):{x:0,y:0}})),viewBox:`${h} ${ee} ${g-h} ${te-ee}`,arrowShape:r.arrowShape,arrowSize:r.arrowSize}}return Re(()=>{try{l(T(t)||[],T(n)||[],T(r)||{})}catch(e){console.error(`[useDag] layout error:`,e),a.value=e,i.value=null}}),{layoutData:i,lastError:a,arrowMarkerIdentifier:o,recomputeLayout:()=>{l(T(t)||[],T(n)||[],T(r)||{})}}}var ir=/* @__PURE__ */ e({default:()=>Rr}),ar=[`id`],or=[`id`],sr={key:1,class:`dag-chart-error`},cr={style:{position:`relative`}},lr=[`viewBox`,`xmlns`,`aria-describedby`],ur={key:0},dr=[`id`,`width`,`height`],fr=[`cx`,`cy`,`r`,`fill`],pr=[`x`,`y`,`width`,`height`,`fill`],mr={key:2},hr=[`id`,`markerWidth`,`markerHeight`,`refX`,`refY`],gr=[`d`,`fill`,`stroke`],_r=[`d`,`fill`,`stroke`],vr={class:`vue-ui-dag-edges`},yr=[`data-a11y-midpoint-id`,`aria-label`,`onMouseenter`],br={class:`vue-ui-dag-nodes`},xr=[`onClick`,`onMouseenter`,`onMouseleave`],Sr=[`data-a11y-node-id`,`aria-label`],Cr=[`x`,`y`,`width`,`height`],wr={class:`vue-ui-dag-edges`},Tr=[`d`,`stroke-width`,`marker-end`],Er={class:`vue-ui-dag-node-labels`},Dr=[`onClick`,`onMouseenter`,`onMouseleave`],Or=[`x`,`y`,`font-size`,`fill`,`font-weight`],kr=[`x`,`y`,`font-size`,`fill`,`font-weight`,`innerHTML`],Ar={key:1},jr={key:1,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},Mr={key:6,class:`vue-data-ui-watermark`},Nr=[`data-position`],Pr={key:0},Fr=[`data-position`],Ir={key:0},Lr=1.5,Rr=/*#__PURE__*/ ne({__name:`vue-ui-dag`,props:{dataset:{type:Object,default(){return{nodes:[],edges:[]}}},config:{type:Object,default(){return{}}}},emits:[`onNodeClick`,`onMidpointEnter`,`onMidpointLeave`,`copyAlt`,`rotate`],setup(e,{expose:s,emit:ne}){let Re=Te(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),Ve=Te(()=>import(`./UserOptions-B9EyfU9n.js`).then(e=>e.n)),He=Te(()=>import(`./PackageVersion-D6_O7PmZ.js`).then(e=>e.t)),{vue_ui_dag:Ue}=i(),E=e,We=ne,D=C(null),O=C(c()),Ge=C(null),Ke=C(null),qe=C(null),Je=C(0),Ye=C(0),Xe=C(!1),Ze=C(!1),k=C(null),A=C(null),j=C(null),M=C(null),Qe=C(null),$e=C(`pointer`),et=C(!1),N=C(yt()),P=_(()=>N.value.style.chart.nodes),tt=_(()=>N.value.style.chart.edges),F=_(()=>N.value.style.chart.midpoints),I=_(()=>N.value.style.chart);ee({config:()=>N.value,dataset:()=>E.dataset,component:`VueUiDag`,rules:[te.noHint]});let nt=_(()=>N.value.userOptions.useCursorPointer),rt=C(N.value.style.chart.width),it=C(N.value.style.chart.height),at=C({x:0,y:0}),L=C(null),R=C(null),ot=C({left:`0px`,top:`0px`}),st=C(`top`),z=C(!1),ct=C({x:0,y:0}),lt=C({x:0,y:0}),B=C(null),V=C(null),ut=C({left:`0px`,top:`0px`}),dt=C(`top`),H=C(!1),U=C(!1),{svgRef:W}=he({config:I.value.title}),{userOptionsVisible:ft,setUserOptionsVisibility:pt,keepUserOptionState:mt}=me({config:N.value}),G=C(N.value.style.chart.layout.rankDirection),ht=_(()=>d({defaultConfig:{userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,nodes:{stroke:`#CCCCCC`,backgroundColor:`#DDDDDD50`},edges:{stroke:`#CCCCCC`},midpoints:{stroke:`#CCCCCC`,fill:`#CCCCCC`}}}},userConfig:N.value.skeletonConfig??{}})),{loading:gt,FINAL_DATASET:_t,manualLoading:vt}=h({...Ie(E),FINAL_CONFIG:N,prepareConfig:yt,skeletonDataset:E.config?.skeletonDataset??{nodes:[{id:`A`,label:``},{id:`B`,label:``},{id:`C`,label:``}],edges:[{from:`A`,to:`B`},{from:`A`,to:`C`}]},skeletonConfig:d({defaultConfig:N.value,userConfig:ht.value})});function yt(){return re(E.config,Ue,ve)}let bt=_(()=>N.value.debug);Ne(async()=>{m(E.dataset)&&(u({componentName:`VueUiDag`,type:`dataset`,debug:bt.value}),Ze.value=!1,vt.value=!0),E.dataset.nodes&&E.dataset.nodes.length!==0||(u({componentName:`VueUiDag`,type:`datasetAttributeEmpty`,property:`nodes`,index:0,debug:bt.value}),Ze.value=!1,vt.value=!0),Ze.value=!0,await Oe(),ln()}),Le(()=>E.config,async e=>{gt.value||(N.value=yt()),ft.value=!N.value.userOptions.showOnChartHover,Je.value+=1,G.value=I.value.layout.rankDirection,rt.value=I.value.width,it.value=I.value.height,It.value=I.value.zoom.active,await Oe(),ln()},{deep:!0});let{isPrinting:xt,isImaging:K,generatePdf:St,generateImage:Ct}=ue({elementId:`dag_${O.value}`,fileName:I.value.title.text||`vue-ui-dag`,options:N.value.userOptions.print}),wt=_(()=>I.value.backgroundColor),Tt=_(()=>I.value.title),{isCallbackImaging:Et,isCallbackSvg:Dt,generateSvg:Ot,onGenerateImage:kt}=se({svg:W,title:Tt,legend:null,legendItems:null,backgroundColor:wt,getSvgCallback:()=>N.value.userOptions.callbacks.svg,generateImage:Ct});function At(){Xe.value=!0,pt(!0)}function jt(){pt(!1),Xe.value=!1}function Mt({tooltipRef:e,isVisibleRef:t,anchorRef:n,styleRef:r,placementRef:i,offsetRef:a,margin:o=24}){return function(){let s=e.value;if(!s||!t.value)return;let c=s.getBoundingClientRect(),l=window.innerWidth,u=window.innerHeight,d=n.value.x,f=n.value.y,p=a?.value?.x??0,m=a?.value?.y??0,h=f-m-c.height-o,g=d-c.width/2,ee=`top`;if(h<o){let e=f+m+o;e+c.height<=u-o?(h=e,ee=`bottom`):(h=f-c.height/2,h<o&&(h=o),h+c.height>u-o&&(h=u-c.height-o),ee=`center`)}g<o&&(g=o),g+c.width>l-o&&(g=l-c.width-o);let te=g<=o,ne=g+c.width>=l-o;if((te||ne)&&ee!==`center`){let e,t,n=d-p-o;l-(d+p)-o>=n?(e=`right`,t=d+p+o):(e=`left`,t=d-p-o-c.width),t>=o&&t+c.width<=l-o&&(g=t,h=f-c.height/2,h<o&&(h=o),h+c.height>u-o&&(h=u-c.height-o),ee=e)}i.value=ee,r.value={left:`${g}px`,top:`${h}px`}}}let{layoutData:q,lastError:Nt,arrowMarkerIdentifier:Pt}=rr({nodes:_(()=>_t.value.nodes.map(e=>({...e,backgroundColor:e.backgroundColor?o(e.backgroundColor):P.value.backgroundColor,color:e.color?o(e.color):P.value.labels.color}))),edges:_(()=>_t.value.edges),configuration:_(()=>({...I.value.layout,rankDirection:G.value}))});function J(e){return q.value?q.value.nodes.find(t=>t.id===e):null}_(()=>{if(!q.value)return[];let e=tt.value.stroke,t=/* @__PURE__ */ new Set;return q.value.edges.forEach(n=>{t.add({id:n.id,from:n.from,to:n.to,color:n.original?.color||e})}),Array.from(t)});let Ft=_(()=>{let e=rt.value,t=it.value,n=Number(e),r=Number(t),i=Number.isFinite(n)&&n>0,a=Number.isFinite(r)&&r>0;return!i&&!a?null:{width:i?n:null,height:a?r:null}}),It=C(I.value.zoom.active),{viewBox:Y,resetZoom:Lt,setInitialViewBox:Rt,scale:zt,zoomByFactor:Bt}=_e(W,{x:0,y:0,width:100,height:100},1,It,()=>{z.value=!1}),Vt=null;async function Ht(e,{smooth:t=!0,duration:n=300,zoomReset:r=!1,zoom:i=null}={}){let o=J(e);if(!o)return!1;let s=Y.value;if(!s)return!1;let c={x:Number(s.x),y:Number(s.y),width:Number(s.width),height:Number(s.height)},l=zt.value,u=c.width,d=c.height,p=l;if(Number.isFinite(i)&&i>0||r){Lt(!1);let e=Y.value,t=Number.isFinite(i)&&i>0?i/100:1;u=Number(e.width)/t,d=Number(e.height)/t,p=t,Y.value={...c},zt.value=l}let m=Number(o.x),h=Number(o.y);if(!Number.isFinite(c.x)||!Number.isFinite(c.y)||!Number.isFinite(c.width)||!Number.isFinite(c.height)||!Number.isFinite(u)||!Number.isFinite(d)||!Number.isFinite(m)||!Number.isFinite(h))return!1;let g={x:m-u/2,y:h-d/2,width:u,height:d};if(Vt!==null&&(cancelAnimationFrame(Vt),Vt=null),z.value=!1,!t||n<=0)return Y.value=g,zt.value=p,!0;let ee=performance.now();function te(e){let t=Math.min((e-ee)/n,1),r=f(t);Y.value={x:a(c.x,g.x,r),y:a(c.y,g.y,r),width:a(c.width,g.width,r),height:a(c.height,g.height,r)},zt.value=a(l,p,r),t<1?Vt=requestAnimationFrame(te):(Y.value=g,zt.value=p,Vt=null)}return Vt=requestAnimationFrame(te),!0}function Ut(){It.value=!It.value}function Wt(){let e=q.value&&q.value.viewBox;if(!e)return;let t=String(e).split(` `).map(Number);if(t.length!==4)return;let[n,r,i,a]=t;if(!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a))return;let o=i,s=a,c=n,l=r,u=Ft.value;u&&(u.width!==null&&(o=u.width),u.height!==null&&(s=u.height),c=n-(o-i)/2,l=r-(s-a)/2),Rt({x:c,y:l,width:o,height:s},{overwriteCurrentIfNotZoomed:!0})}Le(()=>q.value&&q.value.viewBox,()=>{Wt()},{immediate:!0}),Le(()=>Ft.value,()=>{Wt()}),Le(()=>U.value,e=>{It.value=!e});let Gt=_(()=>{let e=Y.value;return e?`${e.x} ${e.y} ${e.width} ${e.height}`:`0 0 0 0`}),X=C(!1),Kt=C({width:0,height:0});Le([W,X,()=>I.value.backgroundPattern.show],([e,t,n],r,i)=>{if(!e||!t||!n)return;let a=()=>{let{width:t,height:n}=e.getBoundingClientRect();(t!==Kt.value.width||n!==Kt.value.height)&&(Kt.value={width:t,height:n})};a();let o=new ResizeObserver(a);o.observe(e),i(()=>o.disconnect())},{flush:`post`});let qt=_(()=>{let e=Y.value;if(!e||!X.value)return e;let{width:t,height:n}=Kt.value;if(!(t>0&&n>0&&e.width>0&&e.height>0))return e;let r=Math.min(t/e.width,n/e.height),i=t/r,a=n/r;return{x:e.x-(i-e.width)/2,y:e.y-(a-e.height)/2,width:i,height:a}});function Jt(e){X.value=e,Ye.value+=1}function Yt(){U.value=!U.value}function Xt(){Bt(Lr,!0)}function Zt(){Bt(1/Lr,!0)}let Qt=[`TB`,`RL`,`BT`,`LR`];function $t(){G.value=Qt[(Qt.indexOf(G.value)+1)%Qt.length],Lt(),We(`rotate`,G.value)}let en=Mt({tooltipRef:R,isVisibleRef:H,anchorRef:at,styleRef:ot,placementRef:st,isNode:!1}),tn=Mt({tooltipRef:V,isVisibleRef:z,anchorRef:ct,styleRef:ut,placementRef:dt,offsetRef:lt}),Z=C(null);async function nn(e){We(`onMidpointEnter`,e);let t=W.value;if(!t||!e?.midpoint)return;let n=t.createSVGPoint();n.x=e.midpoint.x,n.y=e.midpoint.y;let r=t.getScreenCTM();if(!r)return;let i=n.matrixTransform(r);at.value={x:i.x,y:i.y},L.value=e,H.value=!0,F.value.selectedEdge.animated===!0&&(Z.value=e.id,hn()),await Oe(),en()}function rn(){H.value=!1,L.value=null,We(`onMidpointLeave`),F.value.selectedEdge.animated===!0&&(Z.value=null,hn())}async function an(e){if(We(`onNodeClick`,e),!P.value.tooltip.showOnClick)return;let t=W.value;if(!t)return;let n=t.createSVGPoint();n.x=e.x,n.y=e.y;let r=t.getScreenCTM();if(!r)return;let i=n.matrixTransform(r),a=I.value.layout.nodeWidth,o=I.value.layout.nodeHeight,s=r.a,c=r.d,l=a*s,u=o*c;lt.value={x:l/2,y:u/2},ct.value={x:i.x,y:i.y},B.value=e,z.value=!0,await Oe(),tn()}function on(){z.value=!1,B.value=null}function sn(e){if(!(z.value||H.value))return;let t=V.value;if(t&&t.contains(e.target))return;let n=R.value;if(n&&n.contains(e.target))return;let r=W.value;if(r&&r.contains(e.target)){let t=e.target.closest(`.vue-ui-dag-node`),n=e.target.closest(`.vue-ui-dag-edge-midpoint`);if(t||n)return}on(),rn(),et.value||Vn()}function cn(e){e.key===`Escape`&&(z.value&&on(),H.value&&rn())}Ne(()=>{document.addEventListener(`mousedown`,sn),document.addEventListener(`keydown`,cn)}),Me(()=>{document.removeEventListener(`mousedown`,sn),document.removeEventListener(`keydown`,cn),k.value&&(A.value&&k.value.unobserve(A.value),k.value.disconnect())});function ln(){if(!N.value.responsive){k.value&&(A.value&&k.value.unobserve(A.value),k.value.disconnect(),k.value=null,A.value=null);return}let e=de(()=>{if(!D.value)return;let{width:e,height:t}=fe({chart:D.value,title:I.value.title.text?Ge.value:null,legend:I.value.controls.show?qe.value?.$el:null,source:Ke.value});requestAnimationFrame(()=>{rt.value=Math.max(.1,e),it.value=Math.max(.1,t-12)})});k.value&&(A.value&&k.value.unobserve(A.value),k.value.disconnect()),k.value=new ResizeObserver(e),A.value=D.value?D.value.parentNode:null,A.value&&k.value.observe(A.value),e()}function un(e,t={}){let{direction:n=-1,mode:r=`oneLapNearest`,dasharray:i=null}=t;if(!e||typeof e.getTotalLength!=`function`)return bt.value&&console.warn(`VueUiDag @getIdealDashoffsetDelta: invalid path element`,e),0;let a=e.getTotalLength(),o=d(i??e.getAttribute(`stroke-dasharray`)??(typeof getComputedStyle==`function`?getComputedStyle(e).strokeDasharray:``));if(!Number.isFinite(o)||o<=0)return n*a;let s=Math.max(1,Math.round(a/o)),c=Math.max(1,Math.ceil(a/o)),l=Math.max(1,Math.floor(a/o)),u;return u=r===`pattern`?o:r===`oneLapCeil`?c*o:r===`oneLapFloor`?l*o:s*o,n*u;function d(e){if(!e||e===`none`)return NaN;let t=String(e).replace(/,/g,` `).trim().split(/\s+/).map(e=>Number.parseFloat(e)).filter(e=>Number.isFinite(e));if(!t.length)return NaN;let n=t.reduce((e,t)=>e+t,0);return t.length%2==1?n*2:n}}let dn=C(/* @__PURE__ */ new Map),fn=C(/* @__PURE__ */ new Map);function pn(e){return function(t){t?dn.value.set(e,t):dn.value.delete(e)}}function mn(){fn.value.forEach(e=>{try{e.cancel()}catch{}}),fn.value.clear()}function hn(){mn();let e=q.value?.edges??[];if(!e.length)return;let t=tt.value.animations,n=Number(t.referenceDistance)>0?Number(t.referenceDistance):24;e.forEach(e=>{let r=F.value.selectedEdge.animated===!0&&Z.value!=null&&e.id===Z.value,i=!!e?.original?.animated||!!e?.animated||r,a=dn.value.get(e.id);if(!a)return;if(!i){a.style.strokeDasharray=`0`,a.style.strokeDashoffset=`0`;return}let o=e?.original?.dasharray??t.dasharray;a.style.strokeDasharray=String(o),a.style.strokeDashoffset=`0`;let s=![void 0,null].includes(e?.original?.animationDirection),c=![void 0,null].includes(t.animationDirection),l=un(a,{direction:s?Number(e.original.animationDirection):c?Number(t.animationDirection):-1,mode:`oneLapNearest`,dasharray:String(o)}),u=e?.original?.animationDurationMs??t.animationDurationMs??1e3,d=Number(u),f=Number.isFinite(d)&&d>0?n/d:n/1e3,p=Math.max(1,Math.round(Math.abs(l)/Math.max(1e-9,f))),m=a.animate([{strokeDashoffset:0},{strokeDashoffset:l}],{duration:p,iterations:1/0,easing:`linear`});fn.value.set(e.id,m)})}Le(()=>q.value&&q.value.edges,async()=>{await Oe(),hn()},{deep:!0,immediate:!0}),Me(()=>{mn()});async function gn({scale:e=2}={}){if(!D.value)return;let{width:t,height:n}=D.value.getBoundingClientRect(),r=t/n,{imageUri:i,base64:a}=await ie({domElement:D.value,base64:!0,img:!0,scale:e});return{imageUri:i,base64:a,title:I.value.title.text??`vue-ui-dag`,width:t,height:n,aspectRatio:r}}let _n=_(()=>{let e=Number(I.value.layout.nodeHeight);return Number.isFinite(e)&&e>0?e/I.value.backgroundPattern.spacingRatio:12}),vn=_(()=>_n.value*(I.value.backgroundPattern.dotRadiusRatio/100)),Q=C(null),yn=null,bn=0;function xn(e){yn&&=(clearTimeout(yn),null),Q.value!==e&&(Q.value=e,(P.value.selected.downstreamEdges.animated===!0||P.value.selected.upstreamEdges.animated===!0)&&hn())}function Sn(e){$e.value=`pointer`,Z.value=null,xn(e)}async function Cn(e){$e.value=`pointer`,Q.value=null,await nn(e)}function wn(e){let t=++bn;yn&&clearTimeout(yn),yn=setTimeout(()=>{t===bn&&Q.value===e&&(Q.value=null,(P.value.selected.downstreamEdges.animated===!0||P.value.selected.upstreamEdges.animated===!0)&&hn())},20)}function Tn(e){let t=e.from===Q.value,n=e.to===Q.value,r=M.value===`midpoint`&&j.value===e.id,i=Z.value===e.id||L.value?.id===e.id||r,a=e.original.color??tt.value.stroke;return i&&F.value.selectedEdge.stroke!=null?a=F.value.selectedEdge.stroke:t&&P.value.selected.downstreamEdges.stroke!=null?a=P.value.selected.downstreamEdges.stroke:n&&P.value.selected.upstreamEdges.stroke!=null&&(a=P.value.selected.upstreamEdges.stroke),e.animated=t&&P.value.selected.downstreamEdges.animated===!0||n&&P.value.selected.upstreamEdges.animated===!0||r&&F.value.selectedEdge.animated===!0?!0:(q.value?.edges.find(t=>t.id===e.id))?.original?.animated??!1,{d:e.pathData,fill:`none`,stroke:a,"stroke-width":tt.value.strokeWidth*(i||e.from===Q.value?2:1),"stroke-linecap":`round`,"stroke-linejoin":`round`}}function En(e){return M.value===`node`&&j.value===e}function Dn(e){let t=Q.value===e.id,n=M.value===`node`&&j.value===e.id,r=t||n,i=r&&P.value.selected.backgroundColor!=null?P.value.selected.backgroundColor:e.original.backgroundColor,a=r&&P.value.selected.stroke!=null?P.value.selected.stroke:P.value.stroke,o=r&&P.value.selected.strokeWidth!=null?P.value.selected.strokeWidth:P.value.strokeWidth;return{x:e.x-e.width/2,y:e.y-e.height/2,width:e.width,height:e.height,rx:P.value.borderRadius,fill:i,stroke:a,"stroke-width":o}}function On(e){let t=e.from===Q.value,n=e.to===Q.value,r=M.value===`midpoint`&&j.value===e.id,i=Z.value===e.id||L.value?.id===e.id||r,a=e.original.color??tt.value.stroke;return i&&F.value.selectedEdge.stroke!=null?a=F.value.selectedEdge.stroke:t&&P.value.selected.downstreamEdges.stroke!=null?a=P.value.selected.downstreamEdges.stroke:n&&P.value.selected.upstreamEdges.stroke!=null&&(a=P.value.selected.upstreamEdges.stroke),{cx:e?.midpoint?.x,cy:e?.midpoint?.y,r:F.value.radius,fill:r?F.value.selectedEdge.stroke??F.value.fill:F.value.fill,stroke:a,"stroke-width":tt.value.strokeWidth*(i||e.from===Q.value?2:1)}}function kn(e){let t=e.from===Q.value,n=e.to===Q.value,r=M.value===`midpoint`&&j.value===e.id,i=Z.value===e.id||L.value?.id===e.id||r,a=e.color??e.original?.color??tt.value.stroke;return i&&F.value.selectedEdge.stroke!=null?a=F.value.selectedEdge.stroke:t&&P.value.selected.downstreamEdges.stroke!=null?a=P.value.selected.downstreamEdges.stroke:n&&P.value.selected.upstreamEdges.stroke!=null&&(a=P.value.selected.upstreamEdges.stroke),a}function An(e){return`${Pt}-${String(e).replace(/[^a-zA-Z0-9_-]/g,`_`)}`}function jn(){return q.value}async function Mn(){We(`copyAlt`,{config:N.value,dataset:_t.value}),N.value.userOptions.callbacks.altCopy?await Promise.resolve(N.value.userOptions.callbacks.altCopy({config:N.value,dataset:_t.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}let Nn=_(()=>(q.value?.nodes??[]).map(e=>({id:e.id,type:`node`,x:e.x,y:e.y,label:e.label??e.id,raw:e}))),Pn=_(()=>F.value.show?(q.value?.edges??[]).filter(e=>e?.midpoint).map(e=>({id:e.id,type:`midpoint`,x:e.midpoint.x,y:e.midpoint.y,label:`${J(e.from)?.label??e.from} → ${J(e.to)?.label??e.to}`,raw:e})):[]),$=_(()=>[...Nn.value,...Pn.value].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)),Fn=_(()=>{let e=/* @__PURE__ */ new Map;return $.value.forEach((t,n)=>{e.set(`${t.type}:${t.id}`,n)}),e}),In=_(()=>{let e=q.value?.nodes??[],t=q.value?.edges??[];return{headers:[N.value.a11y?.translations?.node??`Node`,N.value.a11y?.translations?.parents??`Parents`,N.value.a11y?.translations?.children??`Children`],rows:e.map(e=>{let n=t.filter(t=>t.to===e.id).map(e=>J(e.from)?.label??e.from).join(`, `),r=t.filter(t=>t.from===e.id).map(e=>J(e.to)?.label??e.to).join(`, `);return[e.label??e.id,n||`—`,r||`—`]})}});function Ln(e){return`${e.type}:${e.id}`}function Rn(){return j.value==null||M.value==null?null:$.value.find(e=>e.id===j.value&&e.type===M.value)??null}async function zn(e){e&&(e.type===`node`?rn():e.type===`midpoint`&&(on(),await nn(e.raw)))}function Bn(e){e&&(j.value=e.id,M.value=e.type,Qe.value=Fn.value.get(Ln(e))??null,e.type===`node`?(xn(e.id),Z.value=null):e.type===`midpoint`&&(Q.value=null,Z.value=e.id,F.value.selectedEdge.animated===!0&&hn()))}function Vn(){j.value=null,M.value=null,Qe.value=null,z.value||(Q.value=null),H.value||(Z.value=null,F.value.selectedEdge.animated===!0&&hn())}function Hn(){et.value=!0,Vn()}function Un(){et.value=!1,on(),rn(),Vn()}function Wn(e,t,n){let r=t.x-e.x,i=t.y-e.y;return n===`right`&&r<=0||n===`left`&&r>=0||n===`down`&&i<=0||n===`up`&&i>=0?1/0:n===`right`||n===`left`?Math.abs(r)*1e3+Math.abs(i):Math.abs(i)*1e3+Math.abs(r)}function Gn(e,t){let n=$.value.filter(t=>Ln(t)!==Ln(e));if(!n.length)return null;let r=null,i=1/0;return n.forEach(n=>{let a=Wn(e,n,t);a<i&&(i=a,r=n)}),r||(t===`right`||t===`down`?$.value[0]??null:$.value[$.value.length-1]??null)}async function Kn(e){e&&($e.value=`keyboard`,e.type===`node`&&(rn(),await an(e.raw)))}async function qn(e){if(!W.value||U.value||document.activeElement!==W.value||!$.value.length)return;let t=e.key===`ArrowLeft`,n=e.key===`ArrowRight`,r=e.key===`ArrowUp`,i=e.key===`ArrowDown`,a=e.key===`Enter`||e.key===` `,o=e.key===`Escape`;if(!t&&!n&&!r&&!i&&!a&&!o)return;if(e.preventDefault(),e.stopPropagation(),o){on(),rn(),Vn();return}let s=Rn();if(a){if(!s)return;s.type===`node`&&await Kn(s);return}if(!s){let e=$.value[0];if(!e)return;Bn(e),await zn(e);return}let c=null;n?c=Gn(s,`right`):t?c=Gn(s,`left`):i?c=Gn(s,`down`):r&&(c=Gn(s,`up`)),c&&(on(),rn(),Bn(c),await zn(c))}s({getData:jn,getImage:gn,generatePdf:St,generateSvg:Ot,generateImage:Ct,toggleAnnotator:Yt,toggleFullscreen:Jt,zoomIn:Xt,zoomOut:Zt,resetZoom:Lt,switchDirection:$t,copyAlt:Mn,focusOnNode:Ht});let Jn=_(()=>ge(N.value.userOptions?.annotator?.followZoom,Y.value));return(e,i)=>(S(),b(`div`,{class:ke(`vue-data-ui-component vue-ui-dag ${X.value?`vue-data-ui-wrapper-fullscreen`:``} ${N.value.responsive?`vue-ui-dag-responsive`:``}`),id:`dag_${O.value}`,ref_key:`dagChart`,ref:D,style:je({fontFamily:N.value.style.fontFamily,backgroundColor:I.value.backgroundColor,padding:`0.5rem`}),onMouseenter:At,onMouseleave:jt},[x(`div`,{id:`chart-instructions-${O.value}`,class:`sr-only`},[x(`p`,null,Fe(N.value.a11y.translations.keyboardNavigation),1)],8,or),In.value?.rows?.length?(S(),v(pe,{key:0,uid:O.value,head:In.value.headers,body:In.value.rows,notice:N.value.a11y.translations.tableAvailable,caption:N.value.a11y.translations.tableCaption},null,8,[`uid`,`head`,`body`,`notice`,`caption`])):y(``,!0),T(Nt)?(S(),b(`div`,sr,Fe(String(T(Nt))),1)):y(``,!0),N.value.userOptions.buttons.annotator?(S(),v(T(Re),De({key:2},T(n)(N.value.userOptions.annotator),{svgRef:T(W),followZoom:N.value.userOptions?.annotator?.followZoom,annotationViewport:Jn.value,backgroundColor:I.value.backgroundColor,color:I.value.color,active:U.value,isCursorPointer:nt.value,palette:N.value.userOptions.annotatorPalette,onClose:Yt}),Se({_:2},[Pe(T(r),n=>({name:n,fn:ze(r=>[w(e.$slots,n,Ae(Ee(T(t)(n,r))),void 0,!0)])}))]),1040,[`svgRef`,`followZoom`,`annotationViewport`,`backgroundColor`,`color`,`active`,`isCursorPointer`,`palette`])):y(``,!0),N.value.userOptions.show&&Ze.value&&(T(mt)||T(ft))?(S(),v(T(Ve),{ref:`userOptionsRef`,key:`user_option_${Ye.value}`,backgroundColor:I.value.backgroundColor,color:I.value.color,isPrinting:T(xt),isImaging:T(K),uid:O.value,hasTooltip:!1,hasTable:!1,hasXls:!1,hasLabel:!1,hasPdf:N.value.userOptions.buttons.pdf,hasImg:N.value.userOptions.buttons.img,hasSvg:N.value.userOptions.buttons.svg,hasFullscreen:N.value.userOptions.buttons.fullscreen,hasAltCopy:N.value.userOptions.buttons.altCopy,isFullscreen:X.value,chartElement:D.value,position:N.value.userOptions.position,titles:{...N.value.userOptions.buttonTitles},hasAnnotator:N.value.userOptions.buttons.annotator,isAnnotation:U.value,callbacks:N.value.userOptions.callbacks,printScale:N.value.userOptions.print.scale,hasZoom:N.value.userOptions.buttons.zoom,isZoom:It.value,isCursorPointer:nt.value,onToggleFullscreen:Jt,onGeneratePdf:T(St),onGenerateImage:T(kt),onGenerateSvg:T(Ot),onToggleAnnotator:Yt,onToggleZoom:Ut,onCopyAlt:Mn,style:je({visibility:T(mt)?T(ft)?`visible`:`hidden`:`visible`})},Se({_:2},[Pe(T(ce)(e.$slots,`menuIcon optionPdf optionImg optionSvg optionFullscreen optionAnnotator optionZoom optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:ze(n=>[w(e.$slots,t,Ae(Ee(T(le)(t,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`hasPdf`,`hasImg`,`hasSvg`,`hasFullscreen`,`hasAltCopy`,`isFullscreen`,`chartElement`,`position`,`titles`,`hasAnnotator`,`isAnnotation`,`callbacks`,`printScale`,`hasZoom`,`isZoom`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`onGenerateSvg`,`style`])):y(``,!0),I.value.title.text?(S(),b(`div`,{key:4,ref_key:`chartTitle`,ref:Ge,style:`width:100%;background:transparent;`},[(S(),v(oe,{key:`title_${Je.value}`,config:{title:{cy:`dag-title`,...I.value.title},subtitle:{cy:`dag-subtitle`,...I.value.title.subtitle}}},null,8,[`config`]))],512)):y(``,!0),I.value.controls.position===`top`&&!T(gt)&&I.value.controls.show?(S(),v(ae,{key:5,ref_key:`zoomControls`,ref:qe,config:N.value,scale:T(zt),isFullscreen:X.value,withDirection:``,onZoomIn:Xt,onZoomOut:Zt,onResetZoom:i[0]||=()=>T(Lt)(!0),onSwitchDirection:$t},null,8,[`config`,`scale`,`isFullscreen`])):y(``,!0),x(`div`,cr,[T(q)?(S(),b(`svg`,{key:0,ref_key:`svgRef`,ref:W,class:ke({"vue-ui-dag-svg":!0,"vue-data-ui-loading":T(gt)}),viewBox:Gt.value,xmlns:T(p),style:je({backgroundColor:I.value.backgroundColor,height:`100%`,width:`100%`}),tabindex:`0`,"aria-describedby":`chart-instructions-${O.value}`,onFocus:Hn,onBlur:Un,onKeydown:qn},[we(T(He)),w(e.$slots,`svg-underlayer`,{svg:{drawingArea:T(Y),data:T(q),orientation:G.value,isPrintingImg:T(xt)||T(K)||T(Et),isPrintingSvg:T(Dt)}},void 0,!0),I.value.backgroundPattern.show?(S(),b(`defs`,ur,[x(`pattern`,{id:`dag_bg_pattern_${O.value}`,patternUnits:`userSpaceOnUse`,width:_n.value,height:_n.value},[w(e.$slots,`background-pattern`,Ae(Ee({x:_n.value/2,y:_n.value/2,color:I.value.backgroundPattern.dotColor})),()=>[x(`circle`,{cx:_n.value/2,cy:_n.value/2,r:vn.value,fill:I.value.backgroundPattern.dotColor},null,8,fr)],!0)],8,dr)])):y(``,!0),I.value.backgroundPattern.show?(S(),b(`rect`,{key:1,x:qt.value?.x??0,y:qt.value?.y??0,width:qt.value?.width??0,height:qt.value?.height??0,fill:`url(#dag_bg_pattern_${O.value})`,style:je({pointerEvents:`none`,opacity:I.value.backgroundPattern.opacity})},null,12,pr)):y(``,!0),T(q).arrowShape===`undirected`?y(``,!0):(S(),b(`defs`,mr,[(S(!0),b(ye,null,Pe(T(q).edges,e=>(S(),b(`marker`,{key:`marker_${e.id}`,id:An(e.id),markerWidth:T(q).arrowSize,markerHeight:T(q).arrowSize,refX:T(q).arrowSize-3,refY:T(q).arrowSize/2,orient:`auto`,markerUnits:`strokeWidth`},[T(q).arrowShape===`normal`?(S(),b(`path`,{key:0,d:`M 0 0 L ${T(q).arrowSize} ${T(q).arrowSize/2} L 0 ${T(q).arrowSize} Z`,fill:kn(e),stroke:kn(e),"stroke-width":`0`,style:{transition:`stroke 0.2s ease-in-out,
2
2
  fill 0.2s ease-in-out,
3
3
  stroke-width 0.2s ease-in-out`}},null,8,gr)):(S(),b(`path`,{key:1,d:`M 0 0 L ${T(q).arrowSize} ${T(q).arrowSize/2} L 0 ${T(q).arrowSize} L ${T(q).arrowSize/3} ${T(q).arrowSize/2} Z`,fill:kn(e),stroke:kn(e),"stroke-width":`0`,style:{transition:`stroke 0.2s ease-in-out,
4
4
  fill 0.2s ease-in-out,
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./annotationSlots-OLiW25XN.js";import{t as i}from"./useConfig-By3Vb5kz.js";import{X as a}from"./lib-rPeBMZrn.js";import{n as ee,t as te}from"./useHints-C-TwxM0Y.js";import{t as o}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as ne}from"./useNestedProp-DnGoh-XS.js";import{n as re,t as ie}from"./userOptionsSlots-DYuo-E5m.js";import{t as ae}from"./usePrinter-DVf3YcG5.js";import{t as oe}from"./useUserOptionState-CXlFnwPv.js";import{t as se}from"./UserOptions-DW84OKKr.js";import{n as ce}from"./PenAndPaper-DoNTA-SV.js";import{Fragment as s,computed as c,createBlock as l,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createSlots as p,defineAsyncComponent as m,guardReactiveProps as h,mergeProps as g,normalizeClass as le,normalizeProps as _,normalizeStyle as v,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as ue,unref as C,useCssVars as de,watch as w,withCtx as T}from"vue";var fe=/* @__PURE__ */ e({default:()=>D}),pe=[`id`],me=[`onMousedown`,`onTouchstart`],he=[`onMousedown`,`onTouchstart`],ge=[`onMousedown`,`onTouchstart`],_e=[`onMousedown`,`onTouchstart`],ve=[`onMousedown`,`onTouchstart`],E=1,D=/*#__PURE__*/ o({__name:`vue-ui-dashboard`,props:{dataset:Array,config:Object},emits:[`change`,`copyAlt`],setup(e,{expose:o,emit:fe}){de(e=>({v59c7b0d3:Ne.value,v5277b0e7:Pe.value}));let D={VueDataUi:m(()=>import(`./vue-data-ui-BWqplouA.js`).then(e=>e.n)),VueUi3dBar:m(()=>import(`./vue-ui-3d-bar-DmRrbXjK.js`).then(e=>e.n)),VueUiAccordion:m(()=>import(`./vue-ui-accordion-DFxSW8ET.js`).then(e=>e.n)),VueUiAgePyramid:m(()=>import(`./vue-ui-age-pyramid-CJJIp5gY.js`).then(e=>e.n)),VueUiAnnotator:m(()=>import(`./vue-ui-annotator-BnR2XnsL.js`).then(e=>e.n)),VueUiCandlestick:m(()=>import(`./vue-ui-candlestick-C_swW8gM.js`).then(e=>e.n)),VueUiChestnut:m(()=>import(`./vue-ui-chestnut-CIGNqBsT.js`).then(e=>e.n)),VueUiDigits:m(()=>import(`./vue-ui-digits-CfdB0vaP.js`).then(e=>e.n)),VueUiDonut:m(()=>import(`./vue-ui-donut-Cv-bYyBN.js`).then(e=>e.n)),VueUiDonutEvolution:m(()=>import(`./vue-ui-donut-evolution-DL112anx.js`).then(e=>e.n)),VueUiDumbbell:m(()=>import(`./vue-ui-dumbbell-owG24VsQ.js`).then(e=>e.n)),VueUiFlow:m(()=>import(`./vue-ui-flow-BMNIydqI.js`).then(e=>e.n)),VueUiGalaxy:m(()=>import(`./vue-ui-galaxy-B8HgdBjc.js`).then(e=>e.n)),VueUiGauge:m(()=>import(`./vue-ui-gauge-B1A_NFY6.js`).then(e=>e.n)),VueUiHeatmap:m(()=>import(`./vue-ui-heatmap-BbQseEbM.js`).then(e=>e.n)),VueUiKpi:m(()=>import(`./vue-ui-kpi-CF7pAl08.js`).then(e=>e.n)),VueUiMiniLoader:m(()=>import(`./vue-ui-mini-loader-OLYDdN3T.js`).then(e=>e.n)),VueUiMolecule:m(()=>import(`./vue-ui-molecule-bAMGCA2Y.js`).then(e=>e.n)),VueUiMoodRadar:m(()=>import(`./vue-ui-mood-radar-CFpgxjuR.js`).then(e=>e.n)),VueUiNestedDonuts:m(()=>import(`./vue-ui-nested-donuts-CWY26iKX.js`).then(e=>e.n)),VueUiOnion:m(()=>import(`./vue-ui-onion-DsBUqL_c.js`).then(e=>e.n)),VueUiParallelCoordinatePlot:m(()=>import(`./vue-ui-parallel-coordinate-plot-BF3gO85b.js`).then(e=>e.n)),VueUiQuadrant:m(()=>import(`./vue-ui-quadrant-BkNG2LGm.js`).then(e=>e.n)),VueUiQuickChart:m(()=>import(`./vue-ui-quick-chart-CYxvgVpD.js`).then(e=>e.n)),VueUiRadar:m(()=>import(`./vue-ui-radar-0H8CiLmc.js`).then(e=>e.n)),VueUiRating:m(()=>import(`./vue-ui-rating-B9HeTCLa.js`).then(e=>e.n)),VueUiRelationCircle:m(()=>import(`./vue-ui-relation-circle-B0BM4xf8.js`).then(e=>e.n)),VueUiRings:m(()=>import(`./vue-ui-rings-UtlBiaZZ.js`).then(e=>e.n)),VueUiScatter:m(()=>import(`./vue-ui-scatter-CduaARRt.js`).then(e=>e.n)),VueUiSkeleton:m(()=>import(`./vue-ui-skeleton-an0peDis.js`).then(e=>e.n)),VueUiSmiley:m(()=>import(`./vue-ui-smiley-Cht1imV-.js`).then(e=>e.n)),VueUiSparkHistogram:m(()=>import(`./vue-ui-sparkhistogram-a_jc2Dv2.js`).then(e=>e.n)),VueUiSparkStackbar:m(()=>import(`./vue-ui-sparkstackbar-CBI4S5cu.js`).then(e=>e.n)),VueUiSparkTrend:m(()=>import(`./vue-ui-spark-trend-DCP7blHB.js`).then(e=>e.n)),VueUiSparkbar:m(()=>import(`./vue-ui-sparkbar-DT3sDgda.js`).then(e=>e.n)),VueUiSparkgauge:m(()=>import(`./vue-ui-sparkgauge-AQt2L5dI.js`).then(e=>e.n)),VueUiSparkline:m(()=>import(`./vue-ui-sparkline-D2-KcHAU.js`).then(e=>e.n)),VueUiStripPlot:m(()=>import(`./vue-ui-strip-plot-bYGhsPA5.js`).then(e=>e.n)),VueUiTable:m(()=>import(`./vue-ui-table-lzolsJ_n.js`).then(e=>e.n)),VueUiTableHeatmap:m(()=>import(`./vue-ui-table-heatmap-D6gpmHg8.js`).then(e=>e.n)),VueUiTableSparkline:m(()=>import(`./vue-ui-table-sparkline-By319cB8.js`).then(e=>e.n)),VueUiThermometer:m(()=>import(`./vue-ui-thermometer-B3Uv3aWc.js`).then(e=>e.n)),VueUiTimer:m(()=>import(`./vue-ui-timer-C6Pevf4N.js`).then(e=>e.n)),VueUiTiremarks:m(()=>import(`./vue-ui-tiremarks-DeNdCFVD.js`).then(e=>e.n)),VueUiTreemap:m(()=>import(`./vue-ui-treemap-Ck9_llHA.js`).then(e=>e.n)),VueUiVerticalBar:m(()=>import(`./vue-ui-horizontal-bar-Do0HJy4f.js`).then(e=>e.n)),VueUiHorizontalBar:m(()=>import(`./vue-ui-horizontal-bar-Do0HJy4f.js`).then(e=>e.n)),VueUiWaffle:m(()=>import(`./vue-ui-waffle-BW2SacnV.js`).then(e=>e.n)),VueUiWheel:m(()=>import(`./vue-ui-wheel-BXDhx5bf.js`).then(e=>e.n)),VueUiWordCloud:m(()=>import(`./vue-ui-word-cloud-DKPtoruY.js`).then(e=>e.n)),VueUiXy:m(()=>import(`./vue-ui-xy-CMckdUft.js`).then(e=>e.n)),VueUiXyCanvas:m(()=>import(`./vue-ui-xy-canvas-CBrKi3nN.js`).then(e=>e.n)),VueUiCarouselTable:m(()=>import(`./vue-ui-carousel-table-BP_yVdDm.js`).then(e=>e.n)),VueUiGizmo:m(()=>import(`./vue-ui-gizmo-D0QjzIGt.js`).then(e=>e.n)),VueUiStackbar:m(()=>import(`./vue-ui-stackbar-DS_31-a3.js`).then(e=>e.n)),VueUiStackline:m(()=>import(`./vue-ui-stackline-CuxohB0U.js`).then(e=>e.n)),VueUiBullet:m(()=>import(`./vue-ui-bullet-Br7H7FSM.js`).then(e=>e.n)),VueUiFunnel:m(()=>import(`./vue-ui-funnel-BsVS3vuI.js`).then(e=>e.n)),VueUiHistoryPlot:m(()=>import(`./vue-ui-history-plot-Bx4WYG6U.js`).then(e=>e.n)),VueUiCirclePack:m(()=>import(`./vue-ui-circle-pack-CtdPeMsY.js`).then(e=>e.n)),VueUiWorld:m(()=>import(`./vue-ui-world-D9vpDbN7.js`).then(e=>e.n)),VueUiChord:m(()=>import(`./vue-ui-chord-DZRFBkRJ.js`).then(e=>e.n)),VueUiRidgeline:m(()=>import(`./vue-ui-ridgeline-D-fDuE3y.js`).then(e=>e.n)),VueUiDag:m(()=>import(`./vue-ui-dag-Cj0CcntI.js`).then(e=>e.n))},{vue_ui_dashboard:ye}=i(),be=b(null),xe=b(null),O=b(null),k=e,A=c(()=>ne({userConfig:k.config,defaultConfig:ye}));ee({config:()=>A.value,dataset:()=>k.dataset,component:`VueUiDashboard`,rules:[te.noHint]});let j=c(()=>A.value.userOptions.useCursorPointer),M=b(a()),N=b(A.value.locked);function Se(){N.value=!N.value}w(()=>k.config,()=>{N.value=A.value.locked,ze.value=!A.value.userOptions.showOnChartHover});function P(){return k.dataset.map((e,t)=>({...e,index:t}))}let F=b(P());w(()=>k.dataset,()=>{F.value=P()});let I=c(()=>F.value.map(e=>({...e,resolvedComponent:typeof e.component==`string`?D[e.component]:e.component}))),L=b(null),R=b(null),z=b({x:0,y:0}),B=b({x:0,y:0}),V=b(null),H=b(!1),U=b(null),W=b(!1);function G(e){let t=e.target;(t.tagName===`INPUT`&&t.type===`range`||t.classList.contains(`range-handle`))&&(W.value=!0)}function K(e){let t=e.target;t.tagName===`INPUT`&&t.type===`range`&&(W.value=!1)}let{isPrinting:Ce,isImaging:we,generatePdf:q,generateImage:Te}=ae({elementId:`vue-ui-dashboard_${M.value}`,fileName:A.value.userOptions.print.filename||`dashboard`,options:{...A.value.userOptions.print,aspectRatio:A.value.style.board.aspectRatio}});function Ee(e){if(!N.value&&(H.value=!0,U.value=e,R.value===null)){L.value=e,z.value={x:event.clientX,y:event.clientY};let t=F.value[e],n=100-t.width,r=100-t.height;t.left<0&&(t.left=0),t.top<0&&(t.top=0),t.left>n&&(t.left=n),t.top>r&&(t.top=r),t.left<0&&(t.left=0),t.top<0&&(t.top=0),t.left+t.width>100&&(t.left=100-t.width),t.top+t.height>100&&(t.top=100-t.height)}}function J(e,t){H.value=!0,U.value=e,R.value={index:e,direction:t};let n=F.value[e];B.value={x:event.clientX,y:event.clientY,initialWidth:n.width,initialHeight:n.height}}function De(e,t,n){if(R.value.direction.includes(`top`)){let t=e.height-n/V.value.offsetHeight*100;t>=E&&(e.top+=n/V.value.offsetHeight*100,e.height=t)}if(R.value.direction.includes(`bottom`)){let t=e.height+n/V.value.offsetHeight*100;t>=E&&(e.height=t)}if(R.value.direction.includes(`left`)){let n=e.width-t/V.value.offsetWidth*100;n>=E&&(e.left+=t/V.value.offsetWidth*100,e.width=n)}if(R.value.direction.includes(`right`)){let n=e.width+t/V.value.offsetWidth*100;n>=E&&(e.width=n)}}function Oe(e){if(!(N.value||W.value)){if(H.value=!0,L.value!==null){let t=F.value[L.value],n=e.clientX-z.value.x,r=e.clientY-z.value.y,i=t.left+n/V.value.offsetWidth*100,a=t.top+r/V.value.offsetHeight*100;i>=0&&a>=0&&i+t.width<=100&&a+t.height<=100&&(t.left=i,t.top=a),z.value={x:e.clientX,y:e.clientY}}if(R.value!==null){let t=F.value[R.value.index];De(t,e.clientX-B.value.x,e.clientY-B.value.y),B.value={x:e.clientX,y:e.clientY}}}}let ke=fe;w(F,e=>{e&&!H.value&&ke(`change`,F.value)},{deep:!0});function Ae(){L.value=null,R.value=null,H.value=!1,U.value=null,F.value.forEach(e=>{e.left=Math.round(e.left/100*100),e.top=Math.round(e.top/100*100),e.width=Math.round(e.width/100*100),e.height=Math.round(e.height/100*100)})}function je(e){N.value||W.value||(H.value=!0,U.value=e,R.value===null&&(L.value=e,z.value={x:event.touches[0].clientX,y:event.touches[0].clientY}))}function Y(e,t,n){if(H.value=!0,U.value=e,R.value===null){R.value={index:e,direction:t};let r=F.value[e];B.value={x:n.touches[0].clientX,y:n.touches[0].clientY,initialWidth:r.width,initialHeight:r.height}}}function X(e){if(H.value=!0,e.preventDefault(),R.value!==null){let t=F.value[R.value.index];De(t,e.touches[0].clientX-B.value.x,e.touches[0].clientY-B.value.y),B.value={x:e.touches[0].clientX,y:e.touches[0].clientY}}}function Me(e){if(!(N.value||W.value)&&(H.value=!0,e.preventDefault(),L.value!==null)){let t=F.value[L.value],n=e.touches[0].clientX-z.value.x,r=e.touches[0].clientY-z.value.y,i=t.left+n/V.value.offsetWidth*100,a=t.top+r/V.value.offsetHeight*100;i>=0&&a>=0&&i+t.width<=100&&a+t.height<=100&&(t.left=i,t.top=a),z.value={x:e.touches[0].clientX,y:e.touches[0].clientY}}}function Z(){H.value=!1,U.value=null,L.value=null,R.value=null,F.value.forEach(e=>{e.left=Math.round(e.left/100*100),e.top=Math.round(e.top/100*100),e.width=Math.round(e.width/100*100),e.height=Math.round(e.height/100*100)})}let Ne=c(()=>A.value.style.item.borderColor),Pe=c(()=>A.value.style.resizeHandles.backgroundColor),Fe=c(()=>A.value.style.board.aspectRatio),Ie=c(()=>A.value.style.board.backgroundColor),Le=c(()=>A.value.style.board.border);function Re(){return F.value}let{userOptionsVisible:ze,setUserOptionsVisibility:Be,keepUserOptionState:Ve}=oe({config:A.value}),Q=b(!1);function He(){Q.value=!Q.value}function Ue(){Be(!0)}function We(){Be(!1)}async function $(){ke(`copyAlt`,{config:A.value,dataset:I.value}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:I.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}return o({generatePdf:q,getItemsPositions:Re,toggleLock:Se,copyAlt:$}),(e,i)=>(y(),d(`div`,{id:`vue-ui-dashboard_${M.value}`,onMousedown:G,onMouseup:K,onTouchstart:G,onTouchend:K,onMouseenter:Ue,onMouseleave:We,ref_key:`dashboardRef`,ref:be,style:{position:`relative`},class:`vue-data-ui-component`},[f(`div`,{class:`vue-ui-dashboard-container`,ref_key:`dashboardContainer`,ref:V,style:v(`outline:${Le.value}; background:${Ie.value}; aspect-ratio:${Fe.value};${Q.value?`pointer-events:none`:``}`)},[f(`div`,{class:`vue-ui-dashboard-grid-container`,ref:`container`,onMousemove:Oe,onMouseup:Ae,onTouchmove:Me,onTouchend:Z,style:v(`background:${A.value.style.board.backgroundColor}`)},[i[4]||=f(`div`,{class:`vue-ui-dashboard-grid`},null,-1),(y(!0),d(s,null,x(I.value,(t,n)=>(y(),d(`div`,{key:t.id,class:le({"vue-ui-dashboard-grid-item":!0,"vue-ui-dashboard-grid-item--locked":N.value}),style:v({width:`${t.width}%`,height:`${t.height}%`,left:`${t.left}%`,top:`${t.top}%`,cursor:`move`,boxShadow:U.value===n?`0 6px 12px -3px rgba(0,0,0,0.3)`:``,zIndex:U.value===n?I.value.length+1:t.index,backgroundColor:A.value.style.item.backgroundColor}),onMousedown:e=>Ee(n),onTouchstart:e=>je(n,t)},[N.value?u(``,!0):(y(),d(s,{key:0},[f(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-top-left`,onMousedown:e=>J(n,`top-left`),onTouchstart:e=>Y(n,`top-left`,e),onTouchmove:i[0]||=e=>X(e),onTouchend:Z},null,40,he),f(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-top-right`,onMousedown:e=>J(n,`top-right`),onTouchstart:e=>Y(n,`top-right`,e),onTouchmove:i[1]||=e=>X(e),onTouchend:Z},null,40,ge),f(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-bottom-left`,onMousedown:e=>J(n,`bottom-left`),onTouchstart:e=>Y(n,`bottom-left`,e),onTouchmove:i[2]||=e=>X(e),onTouchend:Z},null,40,_e),f(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-bottom-right`,onMousedown:e=>J(n,`bottom-right`),onTouchstart:e=>Y(n,`bottom-right`,e),onTouchmove:i[3]||=e=>X(e),onTouchend:Z},null,40,ve)],64)),S(e.$slots,`top`,{item:t,index:n},void 0,!0),t.resolvedComponent?(y(),l(ue(t.resolvedComponent),g({key:1,ref_for:!0},t.props),null,16)):S(e.$slots,`content`,{item:t,index:n,left:t.left,top:t.top,height:t.height,width:t.width},void 0,!0,2),S(e.$slots,`bottom`,{item:t,index:n},void 0,!0)],46,me))),128))],36)],4),(y(),d(`svg`,{style:v({width:`100%`,height:`100%`,pointerEvents:`none`,position:`absolute`,top:0,left:0,zIndex:I.value.length+1}),ref_key:`svgRef`,ref:O},null,4)),A.value.userOptions.buttons.annotator&&V.value&&O.value?(y(),l(ce,g({key:0},C(n)(A.value.userOptions.annotator),{color:A.value.style.board.color,backgroundColor:A.value.style.board.backgroundColor,active:Q.value,svgRef:O.value,isCursorPointer:j.value,onClose:He,style:{zIndex:I.value.length+1},palette:A.value.userOptions.annotatorPalette}),p({_:2},[x(C(r),n=>({name:n,fn:T(r=>[S(e.$slots,n,_(h(C(t)(n,r))),void 0,!0)])}))]),1040,[`color`,`backgroundColor`,`active`,`svgRef`,`isCursorPointer`,`style`,`palette`])):u(``,!0),(A.value.allowPrint||A.value.userOptions.show)&&(A.value.userOptions.buttons.pdf||A.value.userOptions.buttons.img)?(y(),l(se,{key:1,ref_key:`userOptionsRef`,ref:xe,backgroundColor:A.value.style.board.backgroundColor,color:A.value.style.board.color,isPrinting:C(Ce),isImaging:C(we),uid:M.value,position:A.value.userOptions.position,hasTooltip:!1,hasPdf:A.value.userOptions.buttons.pdf,hasImg:A.value.userOptions.buttons.img,hasXls:!1,hasTable:!1,hasLabel:!1,hasFullscreen:!1,hasAltCopy:A.value.userOptions.buttons.altCopy,chartElement:V.value,callbacks:A.value.userOptions.callbacks,hasAnnotator:A.value.userOptions.buttons.annotator,isAnnotation:Q.value,printScale:A.value.userOptions.print.scale,titles:{...A.value.userOptions.buttonTitles},isCursorPointer:j.value,onGeneratePdf:C(q),onGenerateImage:C(Te),onToggleAnnotator:He,onCopyAlt:$,style:v({visibility:C(Ve)?C(ze)?`visible`:`hidden`:`visible`,zIndex:I.value.length+1})},p({_:2},[x(C(re)(e.$slots,`menuIcon optionPdf optionImg optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:T(n=>[S(e.$slots,t,_(h(C(ie)(t,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`position`,`hasPdf`,`hasImg`,`hasAltCopy`,`chartElement`,`callbacks`,`hasAnnotator`,`isAnnotation`,`printScale`,`titles`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`style`])):u(``,!0)],40,pe))}},[[`__scopeId`,`data-v-cda62ea6`]]);export{fe as n,D as t};
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./annotationSlots-OLiW25XN.js";import{t as i}from"./useConfig-By3Vb5kz.js";import{X as a}from"./lib-rPeBMZrn.js";import{n as ee,t as te}from"./useHints-C-TwxM0Y.js";import{t as o}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as ne}from"./useNestedProp-DnGoh-XS.js";import{n as re,t as ie}from"./userOptionsSlots-DYuo-E5m.js";import{t as ae}from"./usePrinter-DVf3YcG5.js";import{t as oe}from"./useUserOptionState-CXlFnwPv.js";import{t as se}from"./UserOptions-B9EyfU9n.js";import{n as ce}from"./PenAndPaper-DoNTA-SV.js";import{Fragment as s,computed as c,createBlock as l,createCommentVNode as u,createElementBlock as d,createElementVNode as f,createSlots as p,defineAsyncComponent as m,guardReactiveProps as h,mergeProps as g,normalizeClass as le,normalizeProps as _,normalizeStyle as v,openBlock as y,ref as b,renderList as x,renderSlot as S,resolveDynamicComponent as ue,unref as C,useCssVars as de,watch as w,withCtx as T}from"vue";var fe=/* @__PURE__ */ e({default:()=>D}),pe=[`id`],me=[`onMousedown`,`onTouchstart`],he=[`onMousedown`,`onTouchstart`],ge=[`onMousedown`,`onTouchstart`],_e=[`onMousedown`,`onTouchstart`],ve=[`onMousedown`,`onTouchstart`],E=1,D=/*#__PURE__*/ o({__name:`vue-ui-dashboard`,props:{dataset:Array,config:Object},emits:[`change`,`copyAlt`],setup(e,{expose:o,emit:fe}){de(e=>({v59c7b0d3:Ne.value,v5277b0e7:Pe.value}));let D={VueDataUi:m(()=>import(`./vue-data-ui-BwiGr37w.js`).then(e=>e.n)),VueUi3dBar:m(()=>import(`./vue-ui-3d-bar-C2igj6OX.js`).then(e=>e.n)),VueUiAccordion:m(()=>import(`./vue-ui-accordion-DFxSW8ET.js`).then(e=>e.n)),VueUiAgePyramid:m(()=>import(`./vue-ui-age-pyramid-DOG_ZOgO.js`).then(e=>e.n)),VueUiAnnotator:m(()=>import(`./vue-ui-annotator-BnR2XnsL.js`).then(e=>e.n)),VueUiCandlestick:m(()=>import(`./vue-ui-candlestick-CZkyowA5.js`).then(e=>e.n)),VueUiChestnut:m(()=>import(`./vue-ui-chestnut-VdMHjsWk.js`).then(e=>e.n)),VueUiDigits:m(()=>import(`./vue-ui-digits-p2met3a2.js`).then(e=>e.n)),VueUiDonut:m(()=>import(`./vue-ui-donut-BlQXnf7O.js`).then(e=>e.n)),VueUiDonutEvolution:m(()=>import(`./vue-ui-donut-evolution-Csq1sqhK.js`).then(e=>e.n)),VueUiDumbbell:m(()=>import(`./vue-ui-dumbbell-ChLfyyGq.js`).then(e=>e.n)),VueUiFlow:m(()=>import(`./vue-ui-flow-DfEHi_Cq.js`).then(e=>e.n)),VueUiGalaxy:m(()=>import(`./vue-ui-galaxy-DFTeXUse.js`).then(e=>e.n)),VueUiGauge:m(()=>import(`./vue-ui-gauge-XTx--A-H.js`).then(e=>e.n)),VueUiHeatmap:m(()=>import(`./vue-ui-heatmap-CPq3bcnS.js`).then(e=>e.n)),VueUiKpi:m(()=>import(`./vue-ui-kpi-D1Ps7D_O.js`).then(e=>e.n)),VueUiMiniLoader:m(()=>import(`./vue-ui-mini-loader-OLYDdN3T.js`).then(e=>e.n)),VueUiMolecule:m(()=>import(`./vue-ui-molecule-f-GNAQ0p.js`).then(e=>e.n)),VueUiMoodRadar:m(()=>import(`./vue-ui-mood-radar-kp-jOb4S.js`).then(e=>e.n)),VueUiNestedDonuts:m(()=>import(`./vue-ui-nested-donuts-DCCSKIGa.js`).then(e=>e.n)),VueUiOnion:m(()=>import(`./vue-ui-onion-KqzGj1z_.js`).then(e=>e.n)),VueUiParallelCoordinatePlot:m(()=>import(`./vue-ui-parallel-coordinate-plot-dn_41Wv5.js`).then(e=>e.n)),VueUiQuadrant:m(()=>import(`./vue-ui-quadrant-CP8n4v5B.js`).then(e=>e.n)),VueUiQuickChart:m(()=>import(`./vue-ui-quick-chart-D8PbGpSw.js`).then(e=>e.n)),VueUiRadar:m(()=>import(`./vue-ui-radar-ybR3N44-.js`).then(e=>e.n)),VueUiRating:m(()=>import(`./vue-ui-rating-B9HeTCLa.js`).then(e=>e.n)),VueUiRelationCircle:m(()=>import(`./vue-ui-relation-circle-B0PwfFpT.js`).then(e=>e.n)),VueUiRings:m(()=>import(`./vue-ui-rings-B-cOW0Dw.js`).then(e=>e.n)),VueUiScatter:m(()=>import(`./vue-ui-scatter-BX5cTC01.js`).then(e=>e.n)),VueUiSkeleton:m(()=>import(`./vue-ui-skeleton-98OnGJ2N.js`).then(e=>e.n)),VueUiSmiley:m(()=>import(`./vue-ui-smiley-Cht1imV-.js`).then(e=>e.n)),VueUiSparkHistogram:m(()=>import(`./vue-ui-sparkhistogram-DcbAY6vr.js`).then(e=>e.n)),VueUiSparkStackbar:m(()=>import(`./vue-ui-sparkstackbar-xlg048YB.js`).then(e=>e.n)),VueUiSparkTrend:m(()=>import(`./vue-ui-spark-trend-C4uYyXEy.js`).then(e=>e.n)),VueUiSparkbar:m(()=>import(`./vue-ui-sparkbar-BcZyqPB9.js`).then(e=>e.n)),VueUiSparkgauge:m(()=>import(`./vue-ui-sparkgauge-dBZzMqn5.js`).then(e=>e.n)),VueUiSparkline:m(()=>import(`./vue-ui-sparkline-BizzsAR5.js`).then(e=>e.n)),VueUiStripPlot:m(()=>import(`./vue-ui-strip-plot-BhxIrd67.js`).then(e=>e.n)),VueUiTable:m(()=>import(`./vue-ui-table-D9FJBxrk.js`).then(e=>e.n)),VueUiTableHeatmap:m(()=>import(`./vue-ui-table-heatmap-SGJGI5Wq.js`).then(e=>e.n)),VueUiTableSparkline:m(()=>import(`./vue-ui-table-sparkline-B6ynMUGE.js`).then(e=>e.n)),VueUiThermometer:m(()=>import(`./vue-ui-thermometer-SE_c51TO.js`).then(e=>e.n)),VueUiTimer:m(()=>import(`./vue-ui-timer-B1JNZk6j.js`).then(e=>e.n)),VueUiTiremarks:m(()=>import(`./vue-ui-tiremarks-Cr8EG4T5.js`).then(e=>e.n)),VueUiTreemap:m(()=>import(`./vue-ui-treemap-DKJVe7v7.js`).then(e=>e.n)),VueUiVerticalBar:m(()=>import(`./vue-ui-horizontal-bar-C8SymyhN.js`).then(e=>e.n)),VueUiHorizontalBar:m(()=>import(`./vue-ui-horizontal-bar-C8SymyhN.js`).then(e=>e.n)),VueUiWaffle:m(()=>import(`./vue-ui-waffle-DSq3l2sE.js`).then(e=>e.n)),VueUiWheel:m(()=>import(`./vue-ui-wheel-CcYOzS05.js`).then(e=>e.n)),VueUiWordCloud:m(()=>import(`./vue-ui-word-cloud-gogYiwIU.js`).then(e=>e.n)),VueUiXy:m(()=>import(`./vue-ui-xy-CpS-ASnd.js`).then(e=>e.n)),VueUiXyCanvas:m(()=>import(`./vue-ui-xy-canvas-CXBsRU35.js`).then(e=>e.n)),VueUiCarouselTable:m(()=>import(`./vue-ui-carousel-table-B73USTMi.js`).then(e=>e.n)),VueUiGizmo:m(()=>import(`./vue-ui-gizmo-COJHVo7O.js`).then(e=>e.n)),VueUiStackbar:m(()=>import(`./vue-ui-stackbar-2AX-m3Pb.js`).then(e=>e.n)),VueUiStackline:m(()=>import(`./vue-ui-stackline-GKaZJh8y.js`).then(e=>e.n)),VueUiBullet:m(()=>import(`./vue-ui-bullet-HUKP90GR.js`).then(e=>e.n)),VueUiFunnel:m(()=>import(`./vue-ui-funnel-QCG-rmsx.js`).then(e=>e.n)),VueUiHistoryPlot:m(()=>import(`./vue-ui-history-plot-B5OPsHZ1.js`).then(e=>e.n)),VueUiCirclePack:m(()=>import(`./vue-ui-circle-pack-ByV3SOkF.js`).then(e=>e.n)),VueUiWorld:m(()=>import(`./vue-ui-world-C2zGhq_U.js`).then(e=>e.n)),VueUiChord:m(()=>import(`./vue-ui-chord-DfWjMAuo.js`).then(e=>e.n)),VueUiRidgeline:m(()=>import(`./vue-ui-ridgeline-BnslUzA-.js`).then(e=>e.n)),VueUiDag:m(()=>import(`./vue-ui-dag-DlllVyCV.js`).then(e=>e.n))},{vue_ui_dashboard:ye}=i(),be=b(null),xe=b(null),O=b(null),k=e,A=c(()=>ne({userConfig:k.config,defaultConfig:ye}));ee({config:()=>A.value,dataset:()=>k.dataset,component:`VueUiDashboard`,rules:[te.noHint]});let j=c(()=>A.value.userOptions.useCursorPointer),M=b(a()),N=b(A.value.locked);function Se(){N.value=!N.value}w(()=>k.config,()=>{N.value=A.value.locked,ze.value=!A.value.userOptions.showOnChartHover});function P(){return k.dataset.map((e,t)=>({...e,index:t}))}let F=b(P());w(()=>k.dataset,()=>{F.value=P()});let I=c(()=>F.value.map(e=>({...e,resolvedComponent:typeof e.component==`string`?D[e.component]:e.component}))),L=b(null),R=b(null),z=b({x:0,y:0}),B=b({x:0,y:0}),V=b(null),H=b(!1),U=b(null),W=b(!1);function G(e){let t=e.target;(t.tagName===`INPUT`&&t.type===`range`||t.classList.contains(`range-handle`))&&(W.value=!0)}function K(e){let t=e.target;t.tagName===`INPUT`&&t.type===`range`&&(W.value=!1)}let{isPrinting:Ce,isImaging:we,generatePdf:q,generateImage:Te}=ae({elementId:`vue-ui-dashboard_${M.value}`,fileName:A.value.userOptions.print.filename||`dashboard`,options:{...A.value.userOptions.print,aspectRatio:A.value.style.board.aspectRatio}});function Ee(e){if(!N.value&&(H.value=!0,U.value=e,R.value===null)){L.value=e,z.value={x:event.clientX,y:event.clientY};let t=F.value[e],n=100-t.width,r=100-t.height;t.left<0&&(t.left=0),t.top<0&&(t.top=0),t.left>n&&(t.left=n),t.top>r&&(t.top=r),t.left<0&&(t.left=0),t.top<0&&(t.top=0),t.left+t.width>100&&(t.left=100-t.width),t.top+t.height>100&&(t.top=100-t.height)}}function J(e,t){H.value=!0,U.value=e,R.value={index:e,direction:t};let n=F.value[e];B.value={x:event.clientX,y:event.clientY,initialWidth:n.width,initialHeight:n.height}}function De(e,t,n){if(R.value.direction.includes(`top`)){let t=e.height-n/V.value.offsetHeight*100;t>=E&&(e.top+=n/V.value.offsetHeight*100,e.height=t)}if(R.value.direction.includes(`bottom`)){let t=e.height+n/V.value.offsetHeight*100;t>=E&&(e.height=t)}if(R.value.direction.includes(`left`)){let n=e.width-t/V.value.offsetWidth*100;n>=E&&(e.left+=t/V.value.offsetWidth*100,e.width=n)}if(R.value.direction.includes(`right`)){let n=e.width+t/V.value.offsetWidth*100;n>=E&&(e.width=n)}}function Oe(e){if(!(N.value||W.value)){if(H.value=!0,L.value!==null){let t=F.value[L.value],n=e.clientX-z.value.x,r=e.clientY-z.value.y,i=t.left+n/V.value.offsetWidth*100,a=t.top+r/V.value.offsetHeight*100;i>=0&&a>=0&&i+t.width<=100&&a+t.height<=100&&(t.left=i,t.top=a),z.value={x:e.clientX,y:e.clientY}}if(R.value!==null){let t=F.value[R.value.index];De(t,e.clientX-B.value.x,e.clientY-B.value.y),B.value={x:e.clientX,y:e.clientY}}}}let ke=fe;w(F,e=>{e&&!H.value&&ke(`change`,F.value)},{deep:!0});function Ae(){L.value=null,R.value=null,H.value=!1,U.value=null,F.value.forEach(e=>{e.left=Math.round(e.left/100*100),e.top=Math.round(e.top/100*100),e.width=Math.round(e.width/100*100),e.height=Math.round(e.height/100*100)})}function je(e){N.value||W.value||(H.value=!0,U.value=e,R.value===null&&(L.value=e,z.value={x:event.touches[0].clientX,y:event.touches[0].clientY}))}function Y(e,t,n){if(H.value=!0,U.value=e,R.value===null){R.value={index:e,direction:t};let r=F.value[e];B.value={x:n.touches[0].clientX,y:n.touches[0].clientY,initialWidth:r.width,initialHeight:r.height}}}function X(e){if(H.value=!0,e.preventDefault(),R.value!==null){let t=F.value[R.value.index];De(t,e.touches[0].clientX-B.value.x,e.touches[0].clientY-B.value.y),B.value={x:e.touches[0].clientX,y:e.touches[0].clientY}}}function Me(e){if(!(N.value||W.value)&&(H.value=!0,e.preventDefault(),L.value!==null)){let t=F.value[L.value],n=e.touches[0].clientX-z.value.x,r=e.touches[0].clientY-z.value.y,i=t.left+n/V.value.offsetWidth*100,a=t.top+r/V.value.offsetHeight*100;i>=0&&a>=0&&i+t.width<=100&&a+t.height<=100&&(t.left=i,t.top=a),z.value={x:e.touches[0].clientX,y:e.touches[0].clientY}}}function Z(){H.value=!1,U.value=null,L.value=null,R.value=null,F.value.forEach(e=>{e.left=Math.round(e.left/100*100),e.top=Math.round(e.top/100*100),e.width=Math.round(e.width/100*100),e.height=Math.round(e.height/100*100)})}let Ne=c(()=>A.value.style.item.borderColor),Pe=c(()=>A.value.style.resizeHandles.backgroundColor),Fe=c(()=>A.value.style.board.aspectRatio),Ie=c(()=>A.value.style.board.backgroundColor),Le=c(()=>A.value.style.board.border);function Re(){return F.value}let{userOptionsVisible:ze,setUserOptionsVisibility:Be,keepUserOptionState:Ve}=oe({config:A.value}),Q=b(!1);function He(){Q.value=!Q.value}function Ue(){Be(!0)}function We(){Be(!1)}async function $(){ke(`copyAlt`,{config:A.value,dataset:I.value}),A.value.userOptions.callbacks.altCopy?await Promise.resolve(A.value.userOptions.callbacks.altCopy({config:A.value,dataset:I.value})):console.warn("Vue Data UI - A callback must be set for `altCopy` in userOptions.")}return o({generatePdf:q,getItemsPositions:Re,toggleLock:Se,copyAlt:$}),(e,i)=>(y(),d(`div`,{id:`vue-ui-dashboard_${M.value}`,onMousedown:G,onMouseup:K,onTouchstart:G,onTouchend:K,onMouseenter:Ue,onMouseleave:We,ref_key:`dashboardRef`,ref:be,style:{position:`relative`},class:`vue-data-ui-component`},[f(`div`,{class:`vue-ui-dashboard-container`,ref_key:`dashboardContainer`,ref:V,style:v(`outline:${Le.value}; background:${Ie.value}; aspect-ratio:${Fe.value};${Q.value?`pointer-events:none`:``}`)},[f(`div`,{class:`vue-ui-dashboard-grid-container`,ref:`container`,onMousemove:Oe,onMouseup:Ae,onTouchmove:Me,onTouchend:Z,style:v(`background:${A.value.style.board.backgroundColor}`)},[i[4]||=f(`div`,{class:`vue-ui-dashboard-grid`},null,-1),(y(!0),d(s,null,x(I.value,(t,n)=>(y(),d(`div`,{key:t.id,class:le({"vue-ui-dashboard-grid-item":!0,"vue-ui-dashboard-grid-item--locked":N.value}),style:v({width:`${t.width}%`,height:`${t.height}%`,left:`${t.left}%`,top:`${t.top}%`,cursor:`move`,boxShadow:U.value===n?`0 6px 12px -3px rgba(0,0,0,0.3)`:``,zIndex:U.value===n?I.value.length+1:t.index,backgroundColor:A.value.style.item.backgroundColor}),onMousedown:e=>Ee(n),onTouchstart:e=>je(n,t)},[N.value?u(``,!0):(y(),d(s,{key:0},[f(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-top-left`,onMousedown:e=>J(n,`top-left`),onTouchstart:e=>Y(n,`top-left`,e),onTouchmove:i[0]||=e=>X(e),onTouchend:Z},null,40,he),f(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-top-right`,onMousedown:e=>J(n,`top-right`),onTouchstart:e=>Y(n,`top-right`,e),onTouchmove:i[1]||=e=>X(e),onTouchend:Z},null,40,ge),f(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-bottom-left`,onMousedown:e=>J(n,`bottom-left`),onTouchstart:e=>Y(n,`bottom-left`,e),onTouchmove:i[2]||=e=>X(e),onTouchend:Z},null,40,_e),f(`div`,{class:`vue-ui-dashboard-resize-handle vue-ui-dashboard-bottom-right`,onMousedown:e=>J(n,`bottom-right`),onTouchstart:e=>Y(n,`bottom-right`,e),onTouchmove:i[3]||=e=>X(e),onTouchend:Z},null,40,ve)],64)),S(e.$slots,`top`,{item:t,index:n},void 0,!0),t.resolvedComponent?(y(),l(ue(t.resolvedComponent),g({key:1,ref_for:!0},t.props),null,16)):S(e.$slots,`content`,{item:t,index:n,left:t.left,top:t.top,height:t.height,width:t.width},void 0,!0,2),S(e.$slots,`bottom`,{item:t,index:n},void 0,!0)],46,me))),128))],36)],4),(y(),d(`svg`,{style:v({width:`100%`,height:`100%`,pointerEvents:`none`,position:`absolute`,top:0,left:0,zIndex:I.value.length+1}),ref_key:`svgRef`,ref:O},null,4)),A.value.userOptions.buttons.annotator&&V.value&&O.value?(y(),l(ce,g({key:0},C(n)(A.value.userOptions.annotator),{color:A.value.style.board.color,backgroundColor:A.value.style.board.backgroundColor,active:Q.value,svgRef:O.value,isCursorPointer:j.value,onClose:He,style:{zIndex:I.value.length+1},palette:A.value.userOptions.annotatorPalette}),p({_:2},[x(C(r),n=>({name:n,fn:T(r=>[S(e.$slots,n,_(h(C(t)(n,r))),void 0,!0)])}))]),1040,[`color`,`backgroundColor`,`active`,`svgRef`,`isCursorPointer`,`style`,`palette`])):u(``,!0),(A.value.allowPrint||A.value.userOptions.show)&&(A.value.userOptions.buttons.pdf||A.value.userOptions.buttons.img)?(y(),l(se,{key:1,ref_key:`userOptionsRef`,ref:xe,backgroundColor:A.value.style.board.backgroundColor,color:A.value.style.board.color,isPrinting:C(Ce),isImaging:C(we),uid:M.value,position:A.value.userOptions.position,hasTooltip:!1,hasPdf:A.value.userOptions.buttons.pdf,hasImg:A.value.userOptions.buttons.img,hasXls:!1,hasTable:!1,hasLabel:!1,hasFullscreen:!1,hasAltCopy:A.value.userOptions.buttons.altCopy,chartElement:V.value,callbacks:A.value.userOptions.callbacks,hasAnnotator:A.value.userOptions.buttons.annotator,isAnnotation:Q.value,printScale:A.value.userOptions.print.scale,titles:{...A.value.userOptions.buttonTitles},isCursorPointer:j.value,onGeneratePdf:C(q),onGenerateImage:C(Te),onToggleAnnotator:He,onCopyAlt:$,style:v({visibility:C(Ve)?C(ze)?`visible`:`hidden`:`visible`,zIndex:I.value.length+1})},p({_:2},[x(C(re)(e.$slots,`menuIcon optionPdf optionImg optionAnnotator optionAltCopy custom-menu-before custom-menu-after`),t=>({name:t,fn:T(n=>[S(e.$slots,t,_(h(C(ie)(t,n))),void 0,!0)])}))]),1032,[`backgroundColor`,`color`,`isPrinting`,`isImaging`,`uid`,`position`,`hasPdf`,`hasImg`,`hasAltCopy`,`chartElement`,`callbacks`,`hasAnnotator`,`isAnnotation`,`printScale`,`titles`,`isCursorPointer`,`onGeneratePdf`,`onGenerateImage`,`style`])):u(``,!0)],40,pe))}},[[`__scopeId`,`data-v-cda62ea6`]]);export{fe as n,D as t};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-By3Vb5kz.js";import{X as n,t as r}from"./lib-rPeBMZrn.js";import{n as i,t as a}from"./useHints-C-TwxM0Y.js";import{t as o}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as s}from"./useNestedProp-DnGoh-XS.js";import{n as c}from"./PackageVersion-Bczw6rsP.js";import{Fragment as l,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createVNode as h,normalizeStyle as g,openBlock as _,ref as v,renderList as y,toDisplayString as b,unref as x}from"vue";var S={key:0},C=[`d`,`fill`],w=[`d`,`fill`],T=[`d`,`fill`],E=[`d`,`fill`],D=[`d`,`fill`],O=[`d`,`fill`],k=[`d`,`fill`],A={key:1},j=[`cx`,`cy`,`r`,`fill`],M={__name:`Digit`,props:{quanta:{type:String,default:null},backgroundColor:{type:String,default:`#e1e5e8`},color:{type:String,default:`#000000`},x:{type:Number,default:0},y:{type:Number,default:0},thickness:{type:Number,default:1}},setup(e){let t=e,n=v({0:`1111110`,1:`0110000`,2:`1101101`,3:`1111001`,4:`0110011`,5:`1011011`,6:`1011111`,7:`1110000`,8:`1111111`,9:`1111011`,"-":`0000001`,X:`0000000`}),r=u(()=>2*(t.thickness||1)),i=u(()=>[void 0,null].includes(t.quanta)?n.value.X:n.value[t.quanta]);return(t,n)=>(_(),p(l,null,[[void 0,null,`.`].includes(e.quanta)?f(``,!0):(_(),p(`g`,S,[m(`path`,{d:`M ${e.x} ${e.y}
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{t}from"./useConfig-By3Vb5kz.js";import{X as n,t as r}from"./lib-rPeBMZrn.js";import{n as i,t as a}from"./useHints-C-TwxM0Y.js";import{t as o}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as s}from"./useNestedProp-DnGoh-XS.js";import{n as c}from"./PackageVersion-D6_O7PmZ.js";import{Fragment as l,computed as u,createBlock as d,createCommentVNode as f,createElementBlock as p,createElementVNode as m,createVNode as h,normalizeStyle as g,openBlock as _,ref as v,renderList as y,toDisplayString as b,unref as x}from"vue";var S={key:0},C=[`d`,`fill`],w=[`d`,`fill`],T=[`d`,`fill`],E=[`d`,`fill`],D=[`d`,`fill`],O=[`d`,`fill`],k=[`d`,`fill`],A={key:1},j=[`cx`,`cy`,`r`,`fill`],M={__name:`Digit`,props:{quanta:{type:String,default:null},backgroundColor:{type:String,default:`#e1e5e8`},color:{type:String,default:`#000000`},x:{type:Number,default:0},y:{type:Number,default:0},thickness:{type:Number,default:1}},setup(e){let t=e,n=v({0:`1111110`,1:`0110000`,2:`1101101`,3:`1111001`,4:`0110011`,5:`1011011`,6:`1011111`,7:`1110000`,8:`1111111`,9:`1111011`,"-":`0000001`,X:`0000000`}),r=u(()=>2*(t.thickness||1)),i=u(()=>[void 0,null].includes(t.quanta)?n.value.X:n.value[t.quanta]);return(t,n)=>(_(),p(l,null,[[void 0,null,`.`].includes(e.quanta)?f(``,!0):(_(),p(`g`,S,[m(`path`,{d:`M ${e.x} ${e.y}
2
2
  L ${e.x+r.value} ${e.y-r.value}
3
3
  L ${e.x+26-r.value} ${e.y-r.value}
4
4
  L ${e.x+26} ${e.y}
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./annotationSlots-OLiW25XN.js";import{t as i}from"./useConfig-By3Vb5kz.js";import{$ as a,Bt as o,D as s,Dt as c,Ht as l,It as u,Jt as ee,S as te,X as ne,Y as d,Yt as re,Zt as ie,at as f,b as p,dt as ae,f as m,h as oe,i as h,in as se,it as ce,j as le,nn as ue,nt as de,p as g,s as fe,t as pe,ut as me,w as he,yt as ge,zt as _e}from"./lib-rPeBMZrn.js";import{n as ve,t as ye}from"./BaseScanner-8NdoBs7B.js";import{n as be,t as xe}from"./useHints-C-TwxM0Y.js";import{t as Se}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as Ce}from"./useNestedProp-DnGoh-XS.js";import{t as we}from"./useThemeCheck-BKNRbGeC.js";import{t as Te}from"./chartImage-DPGnEuYM.js";import{n as Ee}from"./Title-BliHuXfT.js";import{t as De}from"./useChartExport-BZts4KFb.js";import{n as Oe,t as ke}from"./tableIntegration-CNoJ1CIY.js";import{n as Ae,t as je}from"./userOptionsSlots-DYuo-E5m.js";import{t as Me}from"./usePrinter-DVf3YcG5.js";import{t as Ne}from"./Shape-CRe8woTu.js";import{c as Pe}from"./canvas-lib-22VpOI4_.js";import{t as Fe}from"./useResponsive-CENUxfEL.js";import{t as Ie}from"./DefGrad-DKMq1REY.js";import{t as Le}from"./BaseLegendToggle-BIzyyI1h.js";import{t as Re}from"./A11yDataTable-DWNlWXzs.js";import{t as ze}from"./useUserOptionState-CXlFnwPv.js";import{t as Be}from"./useChartAccessibility-DOMuYJfm.js";import{n as Ve,t as He}from"./labelUtils-CdtU-yB_.js";import{t as Ue}from"./vue_ui_donut-T5PeOqvf.js";import{t as We}from"./Legend-DM0ClX3D.js";import{Fragment as _,Teleport as Ge,computed as v,createBlock as y,createCommentVNode as b,createElementBlock as x,createElementVNode as S,createSlots as Ke,createTextVNode as qe,createVNode as Je,defineAsyncComponent as Ye,guardReactiveProps as Xe,mergeProps as Ze,nextTick as Qe,normalizeClass as $e,normalizeProps as et,normalizeStyle as C,onBeforeUnmount as tt,onMounted as nt,openBlock as w,ref as T,renderList as E,renderSlot as D,resolveDynamicComponent as rt,shallowRef as it,toDisplayString as O,toRefs as at,unref as k,useSlots as ot,vShow as st,watch as ct,withCtx as A,withDirectives as lt}from"vue";function ut(e){let{FINAL_CONFIG:t,noGhostDonut:n,svg:r,padding:i,labels_inline_fontSize:a,minSize:o,findArcMidpoint:s,calcMarkerOffsetX:c,calcMarkerOffsetY:l,animatingIndex:u,segregated:ee,isSmallArc:te}=e;return{smallArcLayoutsClassic:v(()=>{if(t.value.type!==`classic`)return{};let e={},ne=n.value||[];if(!ne.length)return e;let d=r.value.width/2,re=r.value.height/2,ie=i.value.top+16,f=r.value.height-i.value.bottom-16,p=a.value,ae=p/3,m=p*1.5,oe=d-(o.value+6),h=d+(o.value+6),se=!!t.value.style.chart.layout.curvedMarkers;function ce({midX:e,midY:t,bandX:n,bandY:r}){if(!se)return`M ${e} ${t} L ${e} ${r} L ${n} ${r}`;let i=n<d?-1:1,a=n-e,o=r-t,s=Math.sqrt(a*a+o*o)||1,c=e-d,l=t-re,u=Math.sqrt(c*c+l*l)||1,ee=c/u,te=l/u,ne=u+9;function ie({x:e,y:t}){let n=e-d,r=t-re,i=Math.sqrt(n*n+r*r)||1;if(i>=ne)return{x:e,y:t};let a=ne/i;return{x:d+n*a,y:re+r*a}}if(s<56){let i=a/s,c=-(o/s),l=i,u=(e+n)*.5,ne=(t+r)*.5,f=u+c,p=ne+l,ae=(f-d)*(f-d)+(p-re)*(p-re),m=u-c,oe=ne-l;(m-d)*(m-d)+(oe-re)*(oe-re)>ae&&(c=-c,l=-l);let h=.78,se=e+a*h,ce=t+o*h,le=Math.max(0,Math.min(1,(s-18)/44)),ue=le*le*(3-2*le),de=2.5+ue*4,g=1+ue*2.5;de*=.9;let fe=ie({x:se+c*de+ee*g,y:ce+l*de+te*g});return`M ${e} ${t} Q ${fe.x} ${fe.y} ${n} ${r}`}let f=s*.34;f<20&&(f=20),f>46&&(f=46);let p=s*.46;p<22&&(p=22),p>70&&(p=70);let ae={x:e+ee*f,y:t+te*f},m=d+i*Math.max(Math.abs(n-d),ne),oe={x:n-i*Math.min(p,Math.abs(m-n)*.75),y:r},h=ie(ae),ce=ie(oe);return`M ${e} ${t} C ${h.x} ${h.y} ${ce.x} ${ce.y} ${n} ${r}`}function le(e){let t=String(e??``).split(/\n/g),n=Math.max(0,t.length-1)*(p*1.2);return m+n}function ue({arc:e,index:t}){let{x:n,y:r}=s(e.path);return{arc:e,index:t,midX:n,midY:r,inlineMarkerX:c(e).x,inlineMarkerY:l(e)-3.5,labelHeight:le(e.name)}}function de(e){let{arc:t}=e,n=t.seriesIndex??0;return u.value===n||ee.value.includes(n)?!1:te(t,n)}function g(e){let t=e.inlineMarkerY<re,n=e.inlineMarkerX<d;return t&&n?`TL`:t&&!n?`TR`:!t&&n?`BL`:`BR`}function fe(e,t){t.startsWith(`T`)?e.sort((e,t)=>e.inlineMarkerY-t.inlineMarkerY||e.index-t.index):e.sort((e,t)=>t.inlineMarkerY-e.inlineMarkerY||e.index-t.index)}function pe({side:e,markerX:t,markerY:n,labelY:r,connectorPath:i}){return{side:e,labelX:e===`left`?t-8:t+8,labelY:r+ae,textAnchor:e===`left`?`end`:`start`,markerX:t,markerY:n,connectorPath:i}}function me({candidateList:t,side:n,bandMarkerX:r,startY:i,direction:a}){let o=i;t.forEach(t=>{let{index:i,midX:s,midY:c,labelHeight:l}=t,u;a===`down`?(u=o,o+=l):(o-=l,u=o);let ee=u,te=ce({midX:s,midY:c,bandX:r,bandY:ee});e[i]=pe({side:n,markerX:r,markerY:ee,labelY:u,connectorPath:te})})}let he=ne.map((e,t)=>ue({arc:e,index:t})).filter(de),ge={TL:[],TR:[],BL:[],BR:[]};return he.forEach(e=>{ge[g(e)].push(e)}),Object.keys(ge).forEach(e=>{fe(ge[e],e)}),me({candidateList:ge.TL,side:`left`,bandMarkerX:oe,startY:ie,direction:`down`}),me({candidateList:ge.TR,side:`right`,bandMarkerX:h,startY:ie,direction:`down`}),ge.BL.length>1&&me({candidateList:ge.BL,side:`left`,bandMarkerX:oe,startY:f,direction:`up`}),ge.BR.length>1&&me({candidateList:ge.BR,side:`right`,bandMarkerX:h,startY:f,direction:`up`}),e})}}var dt=/* @__PURE__ */ e({default:()=>En}),ft=[`id`],pt=[`id`],mt=[`id`],ht={style:{position:`relative`}},gt=[`xmlns`,`aria-describedby`,`viewBox`],_t=[`width`,`height`],vt={key:1},yt={key:2},bt=[`id`],xt=[`id`],St=[`id`],Ct=[`flood-color`],wt=[`id`],Tt=[`flood-color`],Et=[`d`,`stroke`,`filter`],Dt=[`d`,`stroke`,`filter`],Ot=[`cx`,`cy`,`r`,`fill`,`filter`],kt={key:6},At=[`stroke`,`d`],jt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Mt={key:0},Nt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Pt={key:0},Ft=[`stroke`,`d`],It={key:0},Lt=[`d`,`stroke`,`stroke-width`,`filter`],Rt={key:1},zt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Bt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Vt={key:1},Ht=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Ut=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Wt={key:0},Gt=[`d`,`fill`,`stroke`,`stroke-width`],Kt=[`cx`,`cy`,`r`,`stroke`],qt=[`cx`,`cy`,`r`,`fill`],Jt=[`cx`,`cy`,`r`],Yt={key:0},Xt=[`d`,`stroke`,`fill`,`onMouseenter`,`onMouseleave`,`onClick`],Zt={key:1},Qt=[`cx`,`cy`,`r`],$t=[`x`,`y`,`fill`,`font-size`],en=[`x`,`y`,`fill`,`font-size`],tn=[`x`,`y`,`fill`,`font-size`],nn=[`x`,`y`,`fill`,`font-size`],rn=[`filter`,`opacity`],an={key:0},on=[`x`,`y`],sn={key:1},cn=[`cx`,`cy`,`fill`,`stroke`,`filter`,`onClick`,`onMouseenter`,`onMouseleave`],ln=[`text-anchor`,`x`,`y`,`onClick`,`onMouseenter`,`onMouseleave`,`innerHTML`],un=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`onClick`,`onMouseenter`,`onMouseleave`],dn=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`onClick`,`onMouseenter`,`onMouseleave`,`innerHTML`],fn=[`cx`,`cy`,`fill`,`stroke`,`filter`,`onClick`,`onMouseenter`,`onMouseleave`],pn=[`text-anchor`,`x`,`y`,`onClick`,`onMouseenter`,`onMouseleave`,`innerHTML`],mn=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`onClick`,`onMouseenter`,`onMouseleave`],hn=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`onClick`,`onMouseenter`,`onMouseleave`,`innerHTML`],gn={key:2},_n=[`x`,`y`,`width`],vn=[`x`,`y`,`width`],yn={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},bn={key:5,class:`vue-data-ui-watermark`},xn=[`id`],Sn=[`onClick`],Cn={key:8,class:`vue-ui-donut-hollow`},wn={key:0},Tn={key:1},En=/*#__PURE__*/ Se({__name:`vue-ui-donut`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`copyAlt`],setup(e,{expose:Se,emit:dt}){let En=Ye(()=>import(`./Tooltip-C1q0Qoh7.js`)),Dn=Ye(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),On=Ye(()=>import(`./vue-ui-accordion-DFxSW8ET.js`).then(e=>e.n)),kn=Ye(()=>import(`./DataTable-Dof6yhO7.js`)),An=Ye(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),jn=Ye(()=>import(`./UserOptions-DW84OKKr.js`).then(e=>e.n)),Mn=Ye(()=>import(`./PackageVersion-Bczw6rsP.js`).then(e=>e.t)),Nn=Ye(()=>import(`./BaseDraggableDialog-BK7dj9O6.js`).then(e=>e.n)),{vue_ui_donut:Pn}=i(),{isThemeValid:Fn,warnInvalidTheme:In}=we(),Ln=ot(),j=e,Rn=v({get(){return!!j.dataset&&j.dataset.length},set(e){return e}}),zn=it(null),Bn=T(null),Vn=T(null),Hn=T(null),Un=it(null),Wn=it(null),Gn=it(null),Kn=it(null),qn=it(null),Jn=it(null),Yn=T(0),Xn=T(0),Zn=T(0),Qn=T(!1),$n=T(null),er=T(null),tr=T(null),nr=T({x:0,y:0}),rr=T(`pointer`),ir=T(!1),ar=v({get:()=>F.value.style.chart.layout.labels.percentage.fontSize,set:e=>e}),M=v({get:()=>F.value.style.chart.layout.labels.name.fontSize,set:e=>e}),or=v({get:()=>F.value.style.chart.layout.labels.dataLabels.smallArcClusterFontSize,set:e=>e}),sr=!1,cr=()=>{F.value.autoSize&&!sr&&(sr=!0,requestAnimationFrame(()=>{sr=!1;let e=F.value,t=Bn.value,n=B.value;if(!e.autoSize||!t||!n)return;let[r,i,a,o]=n.getAttribute(`viewBox`).split(` `).map(Number),s={x:r,y:i,width:a,height:o},c=[{selector:`.vue-data-ui-datalabel-value`,baseSize:I.value.percentage.fontSize,minSize:I.value.percentage.minFontSize,sizeRef:ar},{selector:`.vue-data-ui-datalabel-name`,baseSize:I.value.name.fontSize,minSize:I.value.name.minFontSize,sizeRef:M},{selector:`.vue-data-ui-datalabel-inline`,baseSize:I.value.dataLabels.smallArcClusterFontSize,minSize:I.value.name.minFontSize,sizeRef:or}];c.map(e=>t.querySelectorAll(e.selector).length).reduce((e,t)=>e+t,0)!==0&&c.forEach(({selector:e,baseSize:n,minSize:r,sizeRef:i})=>{t.querySelectorAll(e).forEach(e=>{i.value=fe({el:e,bounds:s,currentFontSize:n,minFontSize:r,attempts:200,padding:1})})})}))};nt(async()=>{Qn.value=!0,dr(),requestAnimationFrame(cr)});let lr;nt(()=>{zn.value&&(lr=new ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;if(e>0&&n>0){cr();break}}}),lr.observe(zn.value.parentElement))}),tt(()=>{lr?.disconnect()}),tt(()=>{Gn.value&&(Kn.value&&Gn.value.unobserve(Kn.value),Gn.value.disconnect())});let ur=v(()=>F.value.debug);function dr(){if(_e(j.dataset)?(f({componentName:`VueUiDonut`,type:`dataset`,debug:ur.value}),Rn.value=!1,xr.value=!0):(j.dataset.forEach((e,t)=>{ge({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{f({componentName:`VueUiDonut`,type:`datasetSerieAttribute`,property:e,index:t,debug:ur.value}),Rn.value=!1,xr.value=!0})}),ur.value&&j.dataset.forEach((e,t)=>{e.name&&e.name!==``||f({componentName:`VueUiDonut`,type:`datasetAttributeEmpty`,property:`name`,index:t})})),_e(j.dataset)||(xr.value=F.value.loading),F.value.responsive){let e=Pe(()=>{let{width:e,height:t}=Fe({chart:zn.value,title:F.value.style.chart.title.text?Un.value:null,legend:F.value.style.chart.legend.show?Wn.value:null,source:qn.value,noTitle:Jn.value,padding:F.value.autoSize?void 0:Nr.value});requestAnimationFrame(()=>{H.value.width=e,H.value.height=t,cr()})});Gn.value&&(Kn.value&&Gn.value.unobserve(Kn.value),Gn.value.disconnect()),Gn.value=new ResizeObserver(e),Kn.value=zn.value.parentNode,Gn.value.observe(Kn.value)}}let N=T(ne()),fr=T(!1),pr=T(``),P=T(null),mr=T(0);function hr(){let e=Ce({userConfig:j.config,defaultConfig:Pn}),t={},n=e.theme;if(!n)t=e;else if(!Fn.value(e))In(e),t=e;else{let r=Ce({userConfig:Ue[n]||j.config,defaultConfig:e});t={...Ce({userConfig:j.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:ue[n]||l}}return t}let F=T(hr()),I=v(()=>F.value.style.chart.layout.labels),L=v(()=>F.value.style.chart.layout.donut),gr=v(()=>F.value.style.chart.layout),R=v(()=>F.value.style.chart);be({config:()=>F.value,dataset:()=>j.dataset,component:`VueUiDonut`,rules:[xe.singleSeries,xe.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series is > 6. Consider:`,``,`▶️ Grouping small values dynamically into a single "Other" series.`,``,`▶️ Using filters to let users choose a maximum number of series to display.`,``,`▶️ Using VueUiHorizontalBar instead to make the dataset breakdown easier to read.`]}]});let _r=v(()=>F.value.userOptions.useCursorPointer),vr=v(()=>se({defaultConfig:{useCssAnimation:!1,table:{show:!1},startAnimation:{show:!1},userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{labels:{dataLabels:{show:!1},hollow:{average:{show:!1},total:{show:!1}},value:{show:!1}}},legend:{backgroundColor:`transparent`,showValue:!1,showPercentage:!1},title:{color:`#1A1A1A`,subtitle:{color:`#5A5A5A`}}}}},userConfig:F.value.skeletonConfig??{}})),{loading:yr,FINAL_DATASET:br,manualLoading:xr,skeletonDataset:Sr}=ve({...at(j),FINAL_CONFIG:F,prepareConfig:hr,skeletonDataset:j.config?.skeletonDataset??[{name:``,values:[3],color:`#BABABA`},{name:``,values:[2],color:`#AAAAAA`},{name:``,values:[1],color:`#CACACA`}],skeletonConfig:se({defaultConfig:F.value,userConfig:vr.value})}),z=T(!0),Cr=T(0),wr=T(!1),Tr=null;function Er(e=1e3){return new Promise(t=>{let n=performance.now();function r(i){let a=i-n,o=Math.min(a/e,1),s=ce(o);Cr.value=s,o<1?Tr=requestAnimationFrame(r):(Cr.value=1,Tr=null,t())}Tr!==null&&cancelAnimationFrame(Tr),Cr.value=0,Tr=requestAnimationFrame(r)})}ct(()=>yr.value,async e=>{if(e||wr.value)return;let t=br.value===Sr,n=F.value.startAnimation?.show;!t&&n?(wr.value=!0,await Er(F.value.startAnimation.durationMs||1e3)):Cr.value=1,z.value=!1},{immediate:!0});let{userOptionsVisible:Dr,setUserOptionsVisibility:Or,keepUserOptionState:kr}=ze({config:F.value}),{svgRef:B}=Be({config:R.value.title});function Ar(){Or(!0)}function jr(){Or(!1)}let Mr=ie(j.config);ct(()=>j.config,(e,t)=>{let n=ie(e),r=n!==Mr;Mr=n;let i=hr();r?(yr.value||(F.value=i),Dr.value=!F.value.userOptions.showOnChartHover,dr(),Yn.value+=1,Xn.value+=1,Zn.value+=1,V.value.dataLabels.show=I.value.dataLabels.show,V.value.showTable=F.value.table.show,V.value.showTooltip=R.value.tooltip.show,H.value.height=R.value.height,H.value.width=R.value.width):(F.value.style.chart.tooltip=i.style.chart.tooltip,V.value.showTooltip=F.value.style.chart.tooltip.show)},{deep:!0});let Nr=v(()=>{let{top:e,right:t,bottom:n,left:r}=R.value.padding;return{css:`padding:${e}px ${t}px ${n}px ${r}px`,top:e,right:t,bottom:n,left:r}}),{isPrinting:Pr,isImaging:Fr,generatePdf:Ir,generateImage:Lr}=Me({elementId:`donut__${N.value}`,fileName:R.value.title.text||`vue-ui-donut`,options:F.value.userOptions.print}),Rr=v(()=>F.value.userOptions.show&&!R.value.title.text),zr=v(()=>he(F.value.customPalette)),V=T({dataLabels:{show:I.value.dataLabels.show},showTable:F.value.table.show,showTooltip:R.value.tooltip.show});ct(F,()=>{V.value={dataLabels:{show:I.value.dataLabels.show},showTable:F.value.table.show,showTooltip:R.value.tooltip.show}},{immediate:!0});let H=T({height:R.value.height,width:R.value.width}),Br=v(()=>{if(F.value.pie)return K.value;let e=L.value.strokeWidth/512,t=Math.min(H.value.width,H.value.height)*e,n=t>K.value?K.value:t;return Math.max(n,12*(1+e))}),Vr=dt,U=v(()=>br.value.sort((e,t)=>{let n=Array.isArray(e.values)?e.values.reduce((e,t)=>e+t,0):e.value??0,r=Array.isArray(t.values)?t.values.reduce((e,t)=>e+t,0):t.value??0;return e.ghost&&!t.ghost?1:t.ghost&&!e.ghost?-1:r-n}).map((e,t)=>({name:e.name,color:te(e.color)||zr.value[t]||l[t]||l[t%l.length],value:p(e.values.reduce((e,t)=>e+t,0)),absoluteValues:e.values,comment:e.comment||``,patternIndex:t,seriesIndex:t,ghost:!1,pattern:`pattern_${N.value}_${t}`})));ct(()=>j.dataset,e=>{Array.isArray(e)&&e.length>0&&(xr.value=!1)},{immediate:!0});let W=it(U.value);ct(()=>U.value,e=>{W.value=e,requestAnimationFrame(cr)});function Hr(){return U.value.map(e=>({name:e.name,color:e.color,value:e.value}))}let G=T([]),Ur=T(!1),Wr=T(null);function Gr(){Vr(`selectLegend`,$r.value.map(e=>({name:e.name,color:e.color,value:e.value})))}function Kr({from:e,to:t,duration:n,onUpdate:r,onDone:i,easing:a=ce}){let o=performance.now();function s(c){let l=Math.min((c-o)/n,1),u=a(l);r(e+(t-e)*u,l),l<1?requestAnimationFrame(s):(r(t,1),i&&i())}requestAnimationFrame(s)}function qr(){G.value.length?G.value=[]:ei.value.forEach((e,t)=>{G.value.push(t)}),Gr()}function Jr(e){let t=U.value.find((t,n)=>n===e),n=W.value.find((t,n)=>n===e).value;if(G.value.includes(e)){G.value=G.value.filter(t=>t!==e);let r=t.value;function i(){W.value=W.value.map((t,n)=>e===n?{...t,value:r}:t),Gr()}function a(){Ur.value=!0,Wr.value=e,Kr({from:n,to:r,duration:F.value.serieToggleAnimation.durationMs,onUpdate:(t,n)=>{W.value=W.value.map((n,r)=>e===r?{...n,value:t}:n),requestAnimationFrame(cr)},onDone:()=>{i(),Ur.value=!1,Wr.value=null}})}F.value.serieToggleAnimation.show&&F.value.type===`classic`?a():(i(),requestAnimationFrame(cr))}else if(G.value.length<U.value.length-1){function t(){G.value.push(e),W.value=W.value.map((t,n)=>e===n?{...t,value:0}:t),Gr()}function r(){Ur.value=!0,Wr.value=e,Kr({from:n,to:0,duration:F.value.serieToggleAnimation.durationMs,onUpdate:(t,n)=>{W.value=W.value.map((n,r)=>e===r?{...n,value:t}:n),requestAnimationFrame(cr)},onDone:()=>{t(),requestAnimationFrame(cr),Ur.value=!1,Wr.value=null}})}F.value.serieToggleAnimation.show&&F.value.type===`classic`?r():t()}}function Yr(e){return U.value.length?U.value.find(t=>t.name===e)||(ur.value&&console.warn(`VueUiDonut - Series name not found "${e}"`),null):(ur.value&&console.warn(`VueUiDonut - There are no series to show.`),null)}function Xr(e){let t=Yr(e);t!==null&&G.value.includes(t.seriesIndex)&&Jr(t.seriesIndex)}function Zr(e){let t=Yr(e);t!==null&&(G.value.includes(t.seriesIndex)||Jr(t.seriesIndex))}let Qr=v(()=>br.value.reduce((e,t)=>e+t.values.reduce((e,t)=>e+t,0),0)),$r=v(()=>{if(z.value&&!yr.value){let e=Cr.value,t=U.value.map(t=>({...t,value:t.value*e,color:t.color,ghost:!1})),n=Qr.value*(1-e);return n>0&&t.push({name:`__ghost__`,value:n,color:`transparent`,ghost:!0}),t}return W.value.forEach(e=>{if([null,void 0].includes(e.values))return{...e,values:[]}}),W.value.map((e,t)=>({...e,seriesIndex:t})).filter((e,t)=>!G.value.includes(t))}),ei=v(()=>br.value.map((e,t)=>{let n=(e.values||[]).reduce((e,t)=>e+t,0),r=n/br.value.map(e=>(e.values||[]).reduce((e,t)=>e+t,0)).reduce((e,t)=>e+t,0);return{name:e.name,color:te(e.color)||zr.value[t]||l[t]||l[t%l.length],value:n,shape:`circle`,patternIndex:t,proportion:r}}).map((e,t)=>{let n=h(I.value.value.formatter,e.value,a({p:I.value.dataLabels.prefix,v:e.value,s:I.value.dataLabels.suffix,r:R.value.legend.roundingValue}),{datapoint:e,index:t}),r=h(I.value.percentage.formatter,di(e),a({v:di(e),s:`%`,r:R.value.legend.roundingPercentage})),i=Oi({val:n,percentage:G.value.includes(t)?`${Di(e.proportion*100)}%`:r,showVal:R.value.legend.showValue,showPercentage:R.value.legend.showPercentage,config:R.value.legend});return{...e,opacity:G.value.includes(t)?.5:1,segregate:()=>!Ur.value&&Jr(t),isSegregated:G.value.includes(t),display:`${e.name}${R.value.legend.showPercentage||R.value.legend.showValue?`: `:``}${i}`}})),ti=v(()=>({cy:`donut-div-legend`,backgroundColor:R.value.legend.backgroundColor,color:R.value.legend.color,fontSize:R.value.legend.fontSize,paddingBottom:12,fontWeight:R.value.legend.bold?`bold`:``})),K=v(()=>{let e=L.value.radiusRatio,t=Math.max(.1,Math.min(.50001,e)),n=Math.min(H.value.width*t,H.value.height*t);return Math.max(12,n)}),q=v(()=>u({series:$r.value},H.value.width/2,H.value.height/2,K.value,K.value,1.99999,2,1,360,105.25,Br.value)),ni=v(()=>Math.abs($r.value.map(e=>e.value).reduce((e,t)=>e+t,0))>0),ri=v(()=>u({series:[{value:1,color:L.value.emptyFill,name:`_`,seriesIndex:0,patternIndex:-1,ghost:!1,absoluteValues:[1]}]},H.value.width/2,H.value.height/2,K.value,K.value,1.99999,2,1,360,105.25,Br.value)),J=v(()=>q.value.filter(e=>!e.ghost)),Y=v(()=>{let e=Math.max(...$r.value.map(e=>e.value)),t=$r.value.map(t=>t.value/e);return le({series:t,center:{x:H.value.width/2,y:H.value.height/2},maxRadius:Math.min(H.value.width,H.value.height)/3,hasGhost:z.value})});function ii(e){return e.x>H.value.width/2+6?`start`:e.x<H.value.width/2-6?`end`:`middle`}function ai(e){return e.middlePoint.y>H.value.height/2?o({initX:e.middlePoint.x,initY:e.middlePoint.y,offset:100,centerX:H.value.width/2,centerY:H.value.height/2}).y:o({initX:e.middlePoint.x,initY:e.middlePoint.y,offset:0,centerX:H.value.width/2,centerY:H.value.height/2}).y-100}function X(e){return e.proportion*100>I.value.dataLabels.hideUnderValue}function oi(e,t){let n=I.value.dataLabels.hideUnderValue,r=I.value.dataLabels.smallArcClusterThreshold,i=(li.value[t]??e.proportion??0)*100;return i>n&&i<=r}let{smallArcLayoutsClassic:Z}=ut({FINAL_CONFIG:F,noGhostDonut:J,svg:H,padding:Nr,labels_inline_fontSize:or,minSize:K,findArcMidpoint:me,calcMarkerOffsetX:m,calcMarkerOffsetY:g,animatingIndex:Wr,segregated:G,isSmallArc:oi});function si(e,t){let n=e.value/ci(t);return isNaN(n)?0:h(I.value.percentage.formatter,n*100,a({v:n*100,s:`%`,r:I.value.percentage.rounding}),{datapoint:e})}function ci(e){return[...e].map(e=>e.value).reduce((e,t)=>e+t,0)}let Q=v(()=>$r.value.map(e=>e.value).reduce((e,t)=>e+t,0)),li=v(()=>{let e=U.value.reduce((e,t)=>e+t.value,0);return e<=0?[]:U.value.map(t=>t.value/e)}),ui=v(()=>Q.value/$r.value.length);function di(e){return Ur.value?e.proportion*100:e.value/Q.value*100}let fi=T(null),pi=T(!1);function mi({datapoint:e,seriesIndex:t}){F.value.events.datapointLeave&&F.value.events.datapointLeave({datapoint:e,seriesIndex:t}),fr.value=!1,P.value=null,tr.value=null,rr.value=`pointer`}function hi({datapoint:e,relativeIndex:t,seriesIndex:n,show:r=!1,triggerMode:i=`pointer`}){F.value.events.datapointEnter&&F.value.events.datapointEnter({datapoint:e,seriesIndex:n}),rr.value=i,tr.value=t,fi.value={datapoint:e,seriesIndex:n,config:F.value,series:U.value},fr.value=r,P.value=t;let o=``,s=R.value.tooltip.customFormat;if(pi.value=!1,c(s))try{let t=s({seriesIndex:n,datapoint:e,series:U.value,config:F.value});typeof t==`string`&&(pr.value=t,pi.value=!0)}catch{console.warn(`Custom format cannot be applied.`),pi.value=!1}pi.value||(o+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${R.value.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${e.name}</div>`,o+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 60 60" height="14" width="14"><circle cx="30" cy="30" r="30" stroke="none" fill="${e.color}"/>${Ln.pattern?`<circle cx="30" cy="30" r="30" stroke="none" fill="url(#pattern_${N.value}_${n})"/>`:``}</svg>`,o+=`<b>${Oi({showVal:R.value.tooltip.showValue,showPercentage:R.value.tooltip.showPercentage,val:`<span>${h(I.value.value.formatter,e.value,a({p:I.value.dataLabels.prefix,v:e.value,s:I.value.dataLabels.suffix,r:R.value.tooltip.roundingValue}),{datapoint:e,relativeIndex:t,seriesIndex:n})}</span>`,percentage:h(I.value.percentage.formatter,e.proportion*100,a({v:e.proportion*100,s:`%`,r:R.value.tooltip.roundingPercentage}),{datapoint:e,relativeIndex:t,seriesIndex:n}),config:R.value.tooltip})}</b></div>`,R.value.comments.showInTooltip&&e.comment&&(o+=`<div class="vue-data-ui-tooltip-comment" style="background:${ee(e.color,12.5)}; padding: 6px; margin-bottom: 6px; margin-top:6px; border-left: 1px solid ${e.color}">${e.comment}</div>`),pr.value=`<div>${o}</div>`)}function gi(e,t){let n=Z.value[t];if(n)return{textAnchor:n.textAnchor,x:n.labelX,y:n.labelY};let r=m(e,!0,12);return{textAnchor:r.anchor,x:r.x,y:g(e)}}function _i(e,t,n){let{textAnchor:r,x:i}=gi(e,t),a=ki(e),o=`
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{n as t,r as n,t as r}from"./annotationSlots-OLiW25XN.js";import{t as i}from"./useConfig-By3Vb5kz.js";import{$ as a,Bt as o,D as s,Dt as c,Ht as l,It as u,Jt as ee,S as te,X as ne,Y as d,Yt as re,Zt as ie,at as f,b as p,dt as ae,f as m,h as oe,i as h,in as se,it as ce,j as le,nn as ue,nt as de,p as g,s as fe,t as pe,ut as me,w as he,yt as ge,zt as _e}from"./lib-rPeBMZrn.js";import{n as ve,t as ye}from"./BaseScanner-8NdoBs7B.js";import{n as be,t as xe}from"./useHints-C-TwxM0Y.js";import{t as Se}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as Ce}from"./useNestedProp-DnGoh-XS.js";import{t as we}from"./useThemeCheck-BKNRbGeC.js";import{t as Te}from"./chartImage-DPGnEuYM.js";import{n as Ee}from"./Title-BliHuXfT.js";import{t as De}from"./useChartExport-BZts4KFb.js";import{n as Oe,t as ke}from"./tableIntegration-CNoJ1CIY.js";import{n as Ae,t as je}from"./userOptionsSlots-DYuo-E5m.js";import{t as Me}from"./usePrinter-DVf3YcG5.js";import{t as Ne}from"./Shape-CRe8woTu.js";import{c as Pe}from"./canvas-lib-22VpOI4_.js";import{t as Fe}from"./useResponsive-CENUxfEL.js";import{t as Ie}from"./DefGrad-DKMq1REY.js";import{t as Le}from"./BaseLegendToggle-BIzyyI1h.js";import{t as Re}from"./A11yDataTable-DWNlWXzs.js";import{t as ze}from"./useUserOptionState-CXlFnwPv.js";import{t as Be}from"./useChartAccessibility-DOMuYJfm.js";import{n as Ve,t as He}from"./labelUtils-CdtU-yB_.js";import{t as Ue}from"./vue_ui_donut-T5PeOqvf.js";import{t as We}from"./Legend-DM0ClX3D.js";import{Fragment as _,Teleport as Ge,computed as v,createBlock as y,createCommentVNode as b,createElementBlock as x,createElementVNode as S,createSlots as Ke,createTextVNode as qe,createVNode as Je,defineAsyncComponent as Ye,guardReactiveProps as Xe,mergeProps as Ze,nextTick as Qe,normalizeClass as $e,normalizeProps as et,normalizeStyle as C,onBeforeUnmount as tt,onMounted as nt,openBlock as w,ref as T,renderList as E,renderSlot as D,resolveDynamicComponent as rt,shallowRef as it,toDisplayString as O,toRefs as at,unref as k,useSlots as ot,vShow as st,watch as ct,withCtx as A,withDirectives as lt}from"vue";function ut(e){let{FINAL_CONFIG:t,noGhostDonut:n,svg:r,padding:i,labels_inline_fontSize:a,minSize:o,findArcMidpoint:s,calcMarkerOffsetX:c,calcMarkerOffsetY:l,animatingIndex:u,segregated:ee,isSmallArc:te}=e;return{smallArcLayoutsClassic:v(()=>{if(t.value.type!==`classic`)return{};let e={},ne=n.value||[];if(!ne.length)return e;let d=r.value.width/2,re=r.value.height/2,ie=i.value.top+16,f=r.value.height-i.value.bottom-16,p=a.value,ae=p/3,m=p*1.5,oe=d-(o.value+6),h=d+(o.value+6),se=!!t.value.style.chart.layout.curvedMarkers;function ce({midX:e,midY:t,bandX:n,bandY:r}){if(!se)return`M ${e} ${t} L ${e} ${r} L ${n} ${r}`;let i=n<d?-1:1,a=n-e,o=r-t,s=Math.sqrt(a*a+o*o)||1,c=e-d,l=t-re,u=Math.sqrt(c*c+l*l)||1,ee=c/u,te=l/u,ne=u+9;function ie({x:e,y:t}){let n=e-d,r=t-re,i=Math.sqrt(n*n+r*r)||1;if(i>=ne)return{x:e,y:t};let a=ne/i;return{x:d+n*a,y:re+r*a}}if(s<56){let i=a/s,c=-(o/s),l=i,u=(e+n)*.5,ne=(t+r)*.5,f=u+c,p=ne+l,ae=(f-d)*(f-d)+(p-re)*(p-re),m=u-c,oe=ne-l;(m-d)*(m-d)+(oe-re)*(oe-re)>ae&&(c=-c,l=-l);let h=.78,se=e+a*h,ce=t+o*h,le=Math.max(0,Math.min(1,(s-18)/44)),ue=le*le*(3-2*le),de=2.5+ue*4,g=1+ue*2.5;de*=.9;let fe=ie({x:se+c*de+ee*g,y:ce+l*de+te*g});return`M ${e} ${t} Q ${fe.x} ${fe.y} ${n} ${r}`}let f=s*.34;f<20&&(f=20),f>46&&(f=46);let p=s*.46;p<22&&(p=22),p>70&&(p=70);let ae={x:e+ee*f,y:t+te*f},m=d+i*Math.max(Math.abs(n-d),ne),oe={x:n-i*Math.min(p,Math.abs(m-n)*.75),y:r},h=ie(ae),ce=ie(oe);return`M ${e} ${t} C ${h.x} ${h.y} ${ce.x} ${ce.y} ${n} ${r}`}function le(e){let t=String(e??``).split(/\n/g),n=Math.max(0,t.length-1)*(p*1.2);return m+n}function ue({arc:e,index:t}){let{x:n,y:r}=s(e.path);return{arc:e,index:t,midX:n,midY:r,inlineMarkerX:c(e).x,inlineMarkerY:l(e)-3.5,labelHeight:le(e.name)}}function de(e){let{arc:t}=e,n=t.seriesIndex??0;return u.value===n||ee.value.includes(n)?!1:te(t,n)}function g(e){let t=e.inlineMarkerY<re,n=e.inlineMarkerX<d;return t&&n?`TL`:t&&!n?`TR`:!t&&n?`BL`:`BR`}function fe(e,t){t.startsWith(`T`)?e.sort((e,t)=>e.inlineMarkerY-t.inlineMarkerY||e.index-t.index):e.sort((e,t)=>t.inlineMarkerY-e.inlineMarkerY||e.index-t.index)}function pe({side:e,markerX:t,markerY:n,labelY:r,connectorPath:i}){return{side:e,labelX:e===`left`?t-8:t+8,labelY:r+ae,textAnchor:e===`left`?`end`:`start`,markerX:t,markerY:n,connectorPath:i}}function me({candidateList:t,side:n,bandMarkerX:r,startY:i,direction:a}){let o=i;t.forEach(t=>{let{index:i,midX:s,midY:c,labelHeight:l}=t,u;a===`down`?(u=o,o+=l):(o-=l,u=o);let ee=u,te=ce({midX:s,midY:c,bandX:r,bandY:ee});e[i]=pe({side:n,markerX:r,markerY:ee,labelY:u,connectorPath:te})})}let he=ne.map((e,t)=>ue({arc:e,index:t})).filter(de),ge={TL:[],TR:[],BL:[],BR:[]};return he.forEach(e=>{ge[g(e)].push(e)}),Object.keys(ge).forEach(e=>{fe(ge[e],e)}),me({candidateList:ge.TL,side:`left`,bandMarkerX:oe,startY:ie,direction:`down`}),me({candidateList:ge.TR,side:`right`,bandMarkerX:h,startY:ie,direction:`down`}),ge.BL.length>1&&me({candidateList:ge.BL,side:`left`,bandMarkerX:oe,startY:f,direction:`up`}),ge.BR.length>1&&me({candidateList:ge.BR,side:`right`,bandMarkerX:h,startY:f,direction:`up`}),e})}}var dt=/* @__PURE__ */ e({default:()=>En}),ft=[`id`],pt=[`id`],mt=[`id`],ht={style:{position:`relative`}},gt=[`xmlns`,`aria-describedby`,`viewBox`],_t=[`width`,`height`],vt={key:1},yt={key:2},bt=[`id`],xt=[`id`],St=[`id`],Ct=[`flood-color`],wt=[`id`],Tt=[`flood-color`],Et=[`d`,`stroke`,`filter`],Dt=[`d`,`stroke`,`filter`],Ot=[`cx`,`cy`,`r`,`fill`,`filter`],kt={key:6},At=[`stroke`,`d`],jt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Mt={key:0},Nt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Pt={key:0},Ft=[`stroke`,`d`],It={key:0},Lt=[`d`,`stroke`,`stroke-width`,`filter`],Rt={key:1},zt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Bt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Vt={key:1},Ht=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Ut=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`],Wt={key:0},Gt=[`d`,`fill`,`stroke`,`stroke-width`],Kt=[`cx`,`cy`,`r`,`stroke`],qt=[`cx`,`cy`,`r`,`fill`],Jt=[`cx`,`cy`,`r`],Yt={key:0},Xt=[`d`,`stroke`,`fill`,`onMouseenter`,`onMouseleave`,`onClick`],Zt={key:1},Qt=[`cx`,`cy`,`r`],$t=[`x`,`y`,`fill`,`font-size`],en=[`x`,`y`,`fill`,`font-size`],tn=[`x`,`y`,`fill`,`font-size`],nn=[`x`,`y`,`fill`,`font-size`],rn=[`filter`,`opacity`],an={key:0},on=[`x`,`y`],sn={key:1},cn=[`cx`,`cy`,`fill`,`stroke`,`filter`,`onClick`,`onMouseenter`,`onMouseleave`],ln=[`text-anchor`,`x`,`y`,`onClick`,`onMouseenter`,`onMouseleave`,`innerHTML`],un=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`onClick`,`onMouseenter`,`onMouseleave`],dn=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`onClick`,`onMouseenter`,`onMouseleave`,`innerHTML`],fn=[`cx`,`cy`,`fill`,`stroke`,`filter`,`onClick`,`onMouseenter`,`onMouseleave`],pn=[`text-anchor`,`x`,`y`,`onClick`,`onMouseenter`,`onMouseleave`,`innerHTML`],mn=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`onClick`,`onMouseenter`,`onMouseleave`],hn=[`text-anchor`,`x`,`y`,`fill`,`font-size`,`onClick`,`onMouseenter`,`onMouseleave`,`innerHTML`],gn={key:2},_n=[`x`,`y`,`width`],vn=[`x`,`y`,`width`],yn={key:0,style:{position:`absolute`,top:`100%`,left:`0`,width:`100%`},"data-dom-to-png-ignore":``,"aria-hidden":`true`},bn={key:5,class:`vue-data-ui-watermark`},xn=[`id`],Sn=[`onClick`],Cn={key:8,class:`vue-ui-donut-hollow`},wn={key:0},Tn={key:1},En=/*#__PURE__*/ Se({__name:`vue-ui-donut`,props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:[`selectLegend`,`selectDatapoint`,`copyAlt`],setup(e,{expose:Se,emit:dt}){let En=Ye(()=>import(`./Tooltip-C1q0Qoh7.js`)),Dn=Ye(()=>import(`./BaseIcon-CoY0vuL3.js`).then(e=>e.n)),On=Ye(()=>import(`./vue-ui-accordion-DFxSW8ET.js`).then(e=>e.n)),kn=Ye(()=>import(`./DataTable-Dof6yhO7.js`)),An=Ye(()=>import(`./PenAndPaper-DoNTA-SV.js`).then(e=>e.t)),jn=Ye(()=>import(`./UserOptions-B9EyfU9n.js`).then(e=>e.n)),Mn=Ye(()=>import(`./PackageVersion-D6_O7PmZ.js`).then(e=>e.t)),Nn=Ye(()=>import(`./BaseDraggableDialog-BK7dj9O6.js`).then(e=>e.n)),{vue_ui_donut:Pn}=i(),{isThemeValid:Fn,warnInvalidTheme:In}=we(),Ln=ot(),j=e,Rn=v({get(){return!!j.dataset&&j.dataset.length},set(e){return e}}),zn=it(null),Bn=T(null),Vn=T(null),Hn=T(null),Un=it(null),Wn=it(null),Gn=it(null),Kn=it(null),qn=it(null),Jn=it(null),Yn=T(0),Xn=T(0),Zn=T(0),Qn=T(!1),$n=T(null),er=T(null),tr=T(null),nr=T({x:0,y:0}),rr=T(`pointer`),ir=T(!1),ar=v({get:()=>F.value.style.chart.layout.labels.percentage.fontSize,set:e=>e}),M=v({get:()=>F.value.style.chart.layout.labels.name.fontSize,set:e=>e}),or=v({get:()=>F.value.style.chart.layout.labels.dataLabels.smallArcClusterFontSize,set:e=>e}),sr=!1,cr=()=>{F.value.autoSize&&!sr&&(sr=!0,requestAnimationFrame(()=>{sr=!1;let e=F.value,t=Bn.value,n=B.value;if(!e.autoSize||!t||!n)return;let[r,i,a,o]=n.getAttribute(`viewBox`).split(` `).map(Number),s={x:r,y:i,width:a,height:o},c=[{selector:`.vue-data-ui-datalabel-value`,baseSize:I.value.percentage.fontSize,minSize:I.value.percentage.minFontSize,sizeRef:ar},{selector:`.vue-data-ui-datalabel-name`,baseSize:I.value.name.fontSize,minSize:I.value.name.minFontSize,sizeRef:M},{selector:`.vue-data-ui-datalabel-inline`,baseSize:I.value.dataLabels.smallArcClusterFontSize,minSize:I.value.name.minFontSize,sizeRef:or}];c.map(e=>t.querySelectorAll(e.selector).length).reduce((e,t)=>e+t,0)!==0&&c.forEach(({selector:e,baseSize:n,minSize:r,sizeRef:i})=>{t.querySelectorAll(e).forEach(e=>{i.value=fe({el:e,bounds:s,currentFontSize:n,minFontSize:r,attempts:200,padding:1})})})}))};nt(async()=>{Qn.value=!0,dr(),requestAnimationFrame(cr)});let lr;nt(()=>{zn.value&&(lr=new ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;if(e>0&&n>0){cr();break}}}),lr.observe(zn.value.parentElement))}),tt(()=>{lr?.disconnect()}),tt(()=>{Gn.value&&(Kn.value&&Gn.value.unobserve(Kn.value),Gn.value.disconnect())});let ur=v(()=>F.value.debug);function dr(){if(_e(j.dataset)?(f({componentName:`VueUiDonut`,type:`dataset`,debug:ur.value}),Rn.value=!1,xr.value=!0):(j.dataset.forEach((e,t)=>{ge({datasetObject:e,requiredAttributes:[`name`,`values`]}).forEach(e=>{f({componentName:`VueUiDonut`,type:`datasetSerieAttribute`,property:e,index:t,debug:ur.value}),Rn.value=!1,xr.value=!0})}),ur.value&&j.dataset.forEach((e,t)=>{e.name&&e.name!==``||f({componentName:`VueUiDonut`,type:`datasetAttributeEmpty`,property:`name`,index:t})})),_e(j.dataset)||(xr.value=F.value.loading),F.value.responsive){let e=Pe(()=>{let{width:e,height:t}=Fe({chart:zn.value,title:F.value.style.chart.title.text?Un.value:null,legend:F.value.style.chart.legend.show?Wn.value:null,source:qn.value,noTitle:Jn.value,padding:F.value.autoSize?void 0:Nr.value});requestAnimationFrame(()=>{H.value.width=e,H.value.height=t,cr()})});Gn.value&&(Kn.value&&Gn.value.unobserve(Kn.value),Gn.value.disconnect()),Gn.value=new ResizeObserver(e),Kn.value=zn.value.parentNode,Gn.value.observe(Kn.value)}}let N=T(ne()),fr=T(!1),pr=T(``),P=T(null),mr=T(0);function hr(){let e=Ce({userConfig:j.config,defaultConfig:Pn}),t={},n=e.theme;if(!n)t=e;else if(!Fn.value(e))In(e),t=e;else{let r=Ce({userConfig:Ue[n]||j.config,defaultConfig:e});t={...Ce({userConfig:j.config,defaultConfig:r}),customPalette:e.customPalette.length?e.customPalette:ue[n]||l}}return t}let F=T(hr()),I=v(()=>F.value.style.chart.layout.labels),L=v(()=>F.value.style.chart.layout.donut),gr=v(()=>F.value.style.chart.layout),R=v(()=>F.value.style.chart);be({config:()=>F.value,dataset:()=>j.dataset,component:`VueUiDonut`,rules:[xe.singleSeries,xe.emptyArray,{test:e=>e.length>6,message:[`👀 The number of series is > 6. Consider:`,``,`▶️ Grouping small values dynamically into a single "Other" series.`,``,`▶️ Using filters to let users choose a maximum number of series to display.`,``,`▶️ Using VueUiHorizontalBar instead to make the dataset breakdown easier to read.`]}]});let _r=v(()=>F.value.userOptions.useCursorPointer),vr=v(()=>se({defaultConfig:{useCssAnimation:!1,table:{show:!1},startAnimation:{show:!1},userOptions:{show:!1},style:{chart:{backgroundColor:`#99999930`,layout:{labels:{dataLabels:{show:!1},hollow:{average:{show:!1},total:{show:!1}},value:{show:!1}}},legend:{backgroundColor:`transparent`,showValue:!1,showPercentage:!1},title:{color:`#1A1A1A`,subtitle:{color:`#5A5A5A`}}}}},userConfig:F.value.skeletonConfig??{}})),{loading:yr,FINAL_DATASET:br,manualLoading:xr,skeletonDataset:Sr}=ve({...at(j),FINAL_CONFIG:F,prepareConfig:hr,skeletonDataset:j.config?.skeletonDataset??[{name:``,values:[3],color:`#BABABA`},{name:``,values:[2],color:`#AAAAAA`},{name:``,values:[1],color:`#CACACA`}],skeletonConfig:se({defaultConfig:F.value,userConfig:vr.value})}),z=T(!0),Cr=T(0),wr=T(!1),Tr=null;function Er(e=1e3){return new Promise(t=>{let n=performance.now();function r(i){let a=i-n,o=Math.min(a/e,1),s=ce(o);Cr.value=s,o<1?Tr=requestAnimationFrame(r):(Cr.value=1,Tr=null,t())}Tr!==null&&cancelAnimationFrame(Tr),Cr.value=0,Tr=requestAnimationFrame(r)})}ct(()=>yr.value,async e=>{if(e||wr.value)return;let t=br.value===Sr,n=F.value.startAnimation?.show;!t&&n?(wr.value=!0,await Er(F.value.startAnimation.durationMs||1e3)):Cr.value=1,z.value=!1},{immediate:!0});let{userOptionsVisible:Dr,setUserOptionsVisibility:Or,keepUserOptionState:kr}=ze({config:F.value}),{svgRef:B}=Be({config:R.value.title});function Ar(){Or(!0)}function jr(){Or(!1)}let Mr=ie(j.config);ct(()=>j.config,(e,t)=>{let n=ie(e),r=n!==Mr;Mr=n;let i=hr();r?(yr.value||(F.value=i),Dr.value=!F.value.userOptions.showOnChartHover,dr(),Yn.value+=1,Xn.value+=1,Zn.value+=1,V.value.dataLabels.show=I.value.dataLabels.show,V.value.showTable=F.value.table.show,V.value.showTooltip=R.value.tooltip.show,H.value.height=R.value.height,H.value.width=R.value.width):(F.value.style.chart.tooltip=i.style.chart.tooltip,V.value.showTooltip=F.value.style.chart.tooltip.show)},{deep:!0});let Nr=v(()=>{let{top:e,right:t,bottom:n,left:r}=R.value.padding;return{css:`padding:${e}px ${t}px ${n}px ${r}px`,top:e,right:t,bottom:n,left:r}}),{isPrinting:Pr,isImaging:Fr,generatePdf:Ir,generateImage:Lr}=Me({elementId:`donut__${N.value}`,fileName:R.value.title.text||`vue-ui-donut`,options:F.value.userOptions.print}),Rr=v(()=>F.value.userOptions.show&&!R.value.title.text),zr=v(()=>he(F.value.customPalette)),V=T({dataLabels:{show:I.value.dataLabels.show},showTable:F.value.table.show,showTooltip:R.value.tooltip.show});ct(F,()=>{V.value={dataLabels:{show:I.value.dataLabels.show},showTable:F.value.table.show,showTooltip:R.value.tooltip.show}},{immediate:!0});let H=T({height:R.value.height,width:R.value.width}),Br=v(()=>{if(F.value.pie)return K.value;let e=L.value.strokeWidth/512,t=Math.min(H.value.width,H.value.height)*e,n=t>K.value?K.value:t;return Math.max(n,12*(1+e))}),Vr=dt,U=v(()=>br.value.sort((e,t)=>{let n=Array.isArray(e.values)?e.values.reduce((e,t)=>e+t,0):e.value??0,r=Array.isArray(t.values)?t.values.reduce((e,t)=>e+t,0):t.value??0;return e.ghost&&!t.ghost?1:t.ghost&&!e.ghost?-1:r-n}).map((e,t)=>({name:e.name,color:te(e.color)||zr.value[t]||l[t]||l[t%l.length],value:p(e.values.reduce((e,t)=>e+t,0)),absoluteValues:e.values,comment:e.comment||``,patternIndex:t,seriesIndex:t,ghost:!1,pattern:`pattern_${N.value}_${t}`})));ct(()=>j.dataset,e=>{Array.isArray(e)&&e.length>0&&(xr.value=!1)},{immediate:!0});let W=it(U.value);ct(()=>U.value,e=>{W.value=e,requestAnimationFrame(cr)});function Hr(){return U.value.map(e=>({name:e.name,color:e.color,value:e.value}))}let G=T([]),Ur=T(!1),Wr=T(null);function Gr(){Vr(`selectLegend`,$r.value.map(e=>({name:e.name,color:e.color,value:e.value})))}function Kr({from:e,to:t,duration:n,onUpdate:r,onDone:i,easing:a=ce}){let o=performance.now();function s(c){let l=Math.min((c-o)/n,1),u=a(l);r(e+(t-e)*u,l),l<1?requestAnimationFrame(s):(r(t,1),i&&i())}requestAnimationFrame(s)}function qr(){G.value.length?G.value=[]:ei.value.forEach((e,t)=>{G.value.push(t)}),Gr()}function Jr(e){let t=U.value.find((t,n)=>n===e),n=W.value.find((t,n)=>n===e).value;if(G.value.includes(e)){G.value=G.value.filter(t=>t!==e);let r=t.value;function i(){W.value=W.value.map((t,n)=>e===n?{...t,value:r}:t),Gr()}function a(){Ur.value=!0,Wr.value=e,Kr({from:n,to:r,duration:F.value.serieToggleAnimation.durationMs,onUpdate:(t,n)=>{W.value=W.value.map((n,r)=>e===r?{...n,value:t}:n),requestAnimationFrame(cr)},onDone:()=>{i(),Ur.value=!1,Wr.value=null}})}F.value.serieToggleAnimation.show&&F.value.type===`classic`?a():(i(),requestAnimationFrame(cr))}else if(G.value.length<U.value.length-1){function t(){G.value.push(e),W.value=W.value.map((t,n)=>e===n?{...t,value:0}:t),Gr()}function r(){Ur.value=!0,Wr.value=e,Kr({from:n,to:0,duration:F.value.serieToggleAnimation.durationMs,onUpdate:(t,n)=>{W.value=W.value.map((n,r)=>e===r?{...n,value:t}:n),requestAnimationFrame(cr)},onDone:()=>{t(),requestAnimationFrame(cr),Ur.value=!1,Wr.value=null}})}F.value.serieToggleAnimation.show&&F.value.type===`classic`?r():t()}}function Yr(e){return U.value.length?U.value.find(t=>t.name===e)||(ur.value&&console.warn(`VueUiDonut - Series name not found "${e}"`),null):(ur.value&&console.warn(`VueUiDonut - There are no series to show.`),null)}function Xr(e){let t=Yr(e);t!==null&&G.value.includes(t.seriesIndex)&&Jr(t.seriesIndex)}function Zr(e){let t=Yr(e);t!==null&&(G.value.includes(t.seriesIndex)||Jr(t.seriesIndex))}let Qr=v(()=>br.value.reduce((e,t)=>e+t.values.reduce((e,t)=>e+t,0),0)),$r=v(()=>{if(z.value&&!yr.value){let e=Cr.value,t=U.value.map(t=>({...t,value:t.value*e,color:t.color,ghost:!1})),n=Qr.value*(1-e);return n>0&&t.push({name:`__ghost__`,value:n,color:`transparent`,ghost:!0}),t}return W.value.forEach(e=>{if([null,void 0].includes(e.values))return{...e,values:[]}}),W.value.map((e,t)=>({...e,seriesIndex:t})).filter((e,t)=>!G.value.includes(t))}),ei=v(()=>br.value.map((e,t)=>{let n=(e.values||[]).reduce((e,t)=>e+t,0),r=n/br.value.map(e=>(e.values||[]).reduce((e,t)=>e+t,0)).reduce((e,t)=>e+t,0);return{name:e.name,color:te(e.color)||zr.value[t]||l[t]||l[t%l.length],value:n,shape:`circle`,patternIndex:t,proportion:r}}).map((e,t)=>{let n=h(I.value.value.formatter,e.value,a({p:I.value.dataLabels.prefix,v:e.value,s:I.value.dataLabels.suffix,r:R.value.legend.roundingValue}),{datapoint:e,index:t}),r=h(I.value.percentage.formatter,di(e),a({v:di(e),s:`%`,r:R.value.legend.roundingPercentage})),i=Oi({val:n,percentage:G.value.includes(t)?`${Di(e.proportion*100)}%`:r,showVal:R.value.legend.showValue,showPercentage:R.value.legend.showPercentage,config:R.value.legend});return{...e,opacity:G.value.includes(t)?.5:1,segregate:()=>!Ur.value&&Jr(t),isSegregated:G.value.includes(t),display:`${e.name}${R.value.legend.showPercentage||R.value.legend.showValue?`: `:``}${i}`}})),ti=v(()=>({cy:`donut-div-legend`,backgroundColor:R.value.legend.backgroundColor,color:R.value.legend.color,fontSize:R.value.legend.fontSize,paddingBottom:12,fontWeight:R.value.legend.bold?`bold`:``})),K=v(()=>{let e=L.value.radiusRatio,t=Math.max(.1,Math.min(.50001,e)),n=Math.min(H.value.width*t,H.value.height*t);return Math.max(12,n)}),q=v(()=>u({series:$r.value},H.value.width/2,H.value.height/2,K.value,K.value,1.99999,2,1,360,105.25,Br.value)),ni=v(()=>Math.abs($r.value.map(e=>e.value).reduce((e,t)=>e+t,0))>0),ri=v(()=>u({series:[{value:1,color:L.value.emptyFill,name:`_`,seriesIndex:0,patternIndex:-1,ghost:!1,absoluteValues:[1]}]},H.value.width/2,H.value.height/2,K.value,K.value,1.99999,2,1,360,105.25,Br.value)),J=v(()=>q.value.filter(e=>!e.ghost)),Y=v(()=>{let e=Math.max(...$r.value.map(e=>e.value)),t=$r.value.map(t=>t.value/e);return le({series:t,center:{x:H.value.width/2,y:H.value.height/2},maxRadius:Math.min(H.value.width,H.value.height)/3,hasGhost:z.value})});function ii(e){return e.x>H.value.width/2+6?`start`:e.x<H.value.width/2-6?`end`:`middle`}function ai(e){return e.middlePoint.y>H.value.height/2?o({initX:e.middlePoint.x,initY:e.middlePoint.y,offset:100,centerX:H.value.width/2,centerY:H.value.height/2}).y:o({initX:e.middlePoint.x,initY:e.middlePoint.y,offset:0,centerX:H.value.width/2,centerY:H.value.height/2}).y-100}function X(e){return e.proportion*100>I.value.dataLabels.hideUnderValue}function oi(e,t){let n=I.value.dataLabels.hideUnderValue,r=I.value.dataLabels.smallArcClusterThreshold,i=(li.value[t]??e.proportion??0)*100;return i>n&&i<=r}let{smallArcLayoutsClassic:Z}=ut({FINAL_CONFIG:F,noGhostDonut:J,svg:H,padding:Nr,labels_inline_fontSize:or,minSize:K,findArcMidpoint:me,calcMarkerOffsetX:m,calcMarkerOffsetY:g,animatingIndex:Wr,segregated:G,isSmallArc:oi});function si(e,t){let n=e.value/ci(t);return isNaN(n)?0:h(I.value.percentage.formatter,n*100,a({v:n*100,s:`%`,r:I.value.percentage.rounding}),{datapoint:e})}function ci(e){return[...e].map(e=>e.value).reduce((e,t)=>e+t,0)}let Q=v(()=>$r.value.map(e=>e.value).reduce((e,t)=>e+t,0)),li=v(()=>{let e=U.value.reduce((e,t)=>e+t.value,0);return e<=0?[]:U.value.map(t=>t.value/e)}),ui=v(()=>Q.value/$r.value.length);function di(e){return Ur.value?e.proportion*100:e.value/Q.value*100}let fi=T(null),pi=T(!1);function mi({datapoint:e,seriesIndex:t}){F.value.events.datapointLeave&&F.value.events.datapointLeave({datapoint:e,seriesIndex:t}),fr.value=!1,P.value=null,tr.value=null,rr.value=`pointer`}function hi({datapoint:e,relativeIndex:t,seriesIndex:n,show:r=!1,triggerMode:i=`pointer`}){F.value.events.datapointEnter&&F.value.events.datapointEnter({datapoint:e,seriesIndex:n}),rr.value=i,tr.value=t,fi.value={datapoint:e,seriesIndex:n,config:F.value,series:U.value},fr.value=r,P.value=t;let o=``,s=R.value.tooltip.customFormat;if(pi.value=!1,c(s))try{let t=s({seriesIndex:n,datapoint:e,series:U.value,config:F.value});typeof t==`string`&&(pr.value=t,pi.value=!0)}catch{console.warn(`Custom format cannot be applied.`),pi.value=!1}pi.value||(o+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${R.value.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${e.name}</div>`,o+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 60 60" height="14" width="14"><circle cx="30" cy="30" r="30" stroke="none" fill="${e.color}"/>${Ln.pattern?`<circle cx="30" cy="30" r="30" stroke="none" fill="url(#pattern_${N.value}_${n})"/>`:``}</svg>`,o+=`<b>${Oi({showVal:R.value.tooltip.showValue,showPercentage:R.value.tooltip.showPercentage,val:`<span>${h(I.value.value.formatter,e.value,a({p:I.value.dataLabels.prefix,v:e.value,s:I.value.dataLabels.suffix,r:R.value.tooltip.roundingValue}),{datapoint:e,relativeIndex:t,seriesIndex:n})}</span>`,percentage:h(I.value.percentage.formatter,e.proportion*100,a({v:e.proportion*100,s:`%`,r:R.value.tooltip.roundingPercentage}),{datapoint:e,relativeIndex:t,seriesIndex:n}),config:R.value.tooltip})}</b></div>`,R.value.comments.showInTooltip&&e.comment&&(o+=`<div class="vue-data-ui-tooltip-comment" style="background:${ee(e.color,12.5)}; padding: 6px; margin-bottom: 6px; margin-top:6px; border-left: 1px solid ${e.color}">${e.comment}</div>`),pr.value=`<div>${o}</div>`)}function gi(e,t){let n=Z.value[t];if(n)return{textAnchor:n.textAnchor,x:n.labelX,y:n.labelY};let r=m(e,!0,12);return{textAnchor:r.anchor,x:r.x,y:g(e)}}function _i(e,t,n){let{textAnchor:r,x:i}=gi(e,t),a=ki(e),o=`
2
2
  <tspan
3
3
  class="vue-data-ui-datalabel-inline"
4
4
  fill="${I.value.percentage.color}"