@orangelogic/design-system 2.162.0 → 2.164.0

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 (285) hide show
  1. package/library/chunks/{AxisLabelRadial.lE2gKah-.js → AxisLabelRadial.fe7zjixN.js} +1 -1
  2. package/library/chunks/{BaseColumnSeries.B57B3iHh.js → BaseColumnSeries.8Mpxz385.js} +1 -1
  3. package/library/chunks/{CandlestickSeries.CmmI426l.js → CandlestickSeries.DuadaOTa.js} +19 -19
  4. package/library/chunks/{Circle.DAhHYhrc.js → Circle.6LomW0ej.js} +1 -1
  5. package/library/chunks/{ColumnSeries.DBgXk-b4.js → ColumnSeries.D1NLfRh5.js} +2 -2
  6. package/library/chunks/{EditableAxisLabel.C6H99qiS.js → EditableAxisLabel.Bi9vxLDV.js} +2 -2
  7. package/library/chunks/{EditableLabel.B7HB7Cu4.js → EditableLabel.CMR3O9E-.js} +1 -1
  8. package/library/chunks/{Gradient.DHhBnhFd.js → Gradient.CquE8_a4.js} +1 -1
  9. package/library/chunks/{LinearGradient.CGx00O8B.js → LinearGradient.CVN1VJp-.js} +9 -9
  10. package/library/chunks/{Picture.DYltTVSo.js → Picture.BYTZ_I8g.js} +1 -1
  11. package/library/chunks/{Polygon.BCrxKagx.js → Polygon.CU2sMltE.js} +1 -1
  12. package/library/chunks/{ProgressPie.CXksPJFv.js → ProgressPie.Dd74dbmm.js} +6 -6
  13. package/library/chunks/{RadialLabel.BYH69FGU.js → RadialLabel.7ka6ND-t.js} +1 -1
  14. package/library/chunks/{Scrollbar.DEv50o4R.js → Scrollbar.DqUnZReo.js} +1 -1
  15. package/library/chunks/Slice.BVI8rfHI.js +34 -0
  16. package/library/chunks/{Slider.BX8g2iGv.js → Slider.DtjYaJOw.js} +1 -1
  17. package/library/chunks/{SpriteResizer.CfIBMSp3.js → SpriteResizer.Ci2Wt2YJ.js} +11 -11
  18. package/library/chunks/{Triangle.CNY8-QfL.js → Triangle.C75emy3D.js} +1 -1
  19. package/library/chunks/{ZoomTools.6jZrzA7x.js → ZoomTools.CA9mtHI8.js} +2 -2
  20. package/library/chunks/_arrayEach.DU4X1H_a.js +8 -0
  21. package/library/chunks/_baseClone.BHNjfIdS.js +215 -0
  22. package/library/chunks/_baseEach.DQk0As2f.js +32 -0
  23. package/library/chunks/{_baseIteratee.BdKyHJ5i.js → _baseIteratee.sC2wLi2m.js} +3 -2
  24. package/library/chunks/{_baseUniq.je-HWbb3.js → _baseUniq.lwMgmtt2.js} +16 -15
  25. package/library/chunks/_baseXor.DixEm6JQ.js +35 -0
  26. package/library/chunks/_flatRest.D3ZVApI5.js +30 -0
  27. package/library/chunks/abnfDiagram-VRR7QNED.DKqYa5p7.js +89 -0
  28. package/library/chunks/{am-chart.CqdmTS0P.js → am-chart.Cr-vMjcY.js} +1577 -1727
  29. package/library/chunks/{animation.S74lUDDc.js → animation.BD-1xugN.js} +1 -1
  30. package/library/chunks/arc.xqNd6x9S.js +84 -0
  31. package/library/chunks/architectureDiagram-ZJ3FMSHR.CBIOk9Kp.js +4757 -0
  32. package/library/chunks/{asset-link-format.DLAzKfhk.js → asset-link-format.0q_MQOYh.js} +691 -635
  33. package/library/chunks/asset-link-format.ClaYu_v8.js +7 -0
  34. package/library/chunks/blockDiagram-677ZJIJ3.CeQxLPwj.js +2428 -0
  35. package/library/chunks/{button.8syoJXYs.js → button.DGyqdBou.js} +2 -2
  36. package/library/chunks/c4Diagram-LMCZKHZV.B73xdpNh.js +1580 -0
  37. package/library/chunks/{capitalize.BTYI3NfM.js → capitalize.CIBKBL10.js} +1 -1
  38. package/library/chunks/{cardinal.BCA_LB0u.js → cardinal.BXTAeOLk.js} +1 -0
  39. package/library/chunks/cardinalClosed.Mdce1x5M.js +59 -0
  40. package/library/chunks/channel.s_XjcUYI.js +5 -0
  41. package/library/chunks/chunk-2Q5K7J3B.Dy1Z-bMH.js +15 -0
  42. package/library/chunks/chunk-32BRIVSS.BbIrVi3j.js +71 -0
  43. package/library/chunks/chunk-5VM5RSS4.D0-lddDM.js +19 -0
  44. package/library/chunks/chunk-EX3LRPZG.L693y8d4.js +1412 -0
  45. package/library/chunks/chunk-JWPE2WC7.BV0i4LDu.js +8 -0
  46. package/library/chunks/chunk-MOJQB5TN.BZstBMYC.js +664 -0
  47. package/library/chunks/chunk-RYQCIY6F.BMsuG7ya.js +314 -0
  48. package/library/chunks/chunk-V7JOEXUC.DcJlyQO0.js +1537 -0
  49. package/library/chunks/chunk-VR4S4FIN.BpryBs7q.js +19 -0
  50. package/library/chunks/chunk-XXDRQBXY.CSOjab1V.js +11 -0
  51. package/library/chunks/classDiagram-OUVF2IWQ.Dvz7CNwe.js +18 -0
  52. package/library/chunks/classDiagram-v2-EOCWNBFH.Dvz7CNwe.js +18 -0
  53. package/library/chunks/cloneDeep.B-5z5SI3.js +51 -0
  54. package/library/chunks/{color-swatch-group.CLv1LSZy.js → color-swatch-group.ChP9amU9.js} +2576 -2723
  55. package/library/chunks/{color-swatch.DsWP2fd-.js → color-swatch.QsHoy_K1.js} +1 -1
  56. package/library/chunks/{colorPicker.GYgA76kc.js → colorPicker.Cg6Zxf8f.js} +5 -5
  57. package/library/chunks/{confirm-popover.C-eHPJaU.js → confirm-popover.D8mdy6KG.js} +2 -2
  58. package/library/chunks/constant.BQ4UJ-kW.js +12 -0
  59. package/library/chunks/cose-bilkent-JH36ORCC.cfzS2XsK.js +2612 -0
  60. package/library/chunks/cynefin-VYW2F7L2.c7H5z9nQ.js +23790 -0
  61. package/library/chunks/cynefinDiagram-TSTJHNR4.C8SgNXWI.js +299 -0
  62. package/library/chunks/cytoscape.esm.Cbrwqewp.js +18786 -0
  63. package/library/chunks/dagre-VKFMJZFB.D5B1cAri.js +343 -0
  64. package/library/chunks/debounce.Bv1rtE8D.js +55 -0
  65. package/library/chunks/defaultLocale.CPy_WVtp.js +171 -0
  66. package/library/chunks/descending.AD5n-tFs.js +10 -0
  67. package/library/chunks/diagram-FQU43EPY.DJukDcLl.js +466 -0
  68. package/library/chunks/diagram-G47NLZAW.BBOvcbcR.js +316 -0
  69. package/library/chunks/diagram-NH7WQ7WH.DOpRwmC2.js +142 -0
  70. package/library/chunks/diagram-OA4YK3LP.Dm5WJs91.js +350 -0
  71. package/library/chunks/diagram-WEI45ONY.COuzdmSR.js +217 -0
  72. package/library/chunks/{dialog.Bzf4-IgH.js → dialog.05FgdLBZ.js} +2 -2
  73. package/library/chunks/{document-viewer.CGyOG1yw.js → document-viewer.Cng07M-1.js} +7 -7
  74. package/library/chunks/{dot-pagination.BdZc-K0r.js → dot-pagination.Pg9O0nIh.js} +1 -1
  75. package/library/chunks/ebnfDiagram-CCIWWBDH.Dz-QBH6Y.js +111 -0
  76. package/library/chunks/erDiagram-Q63AITRT.sSw_w-2B.js +913 -0
  77. package/library/chunks/{exporting.DQhKH1BX.js → exporting.Djsoh75g.js} +11 -11
  78. package/library/chunks/flow.aZRVH3p1.js +1304 -0
  79. package/library/chunks/flowDiagram-23GEKE2U.CMMbuUHf.js +1642 -0
  80. package/library/chunks/{folder-select.BKAuh4GE.js → folder-select.Dw1ZKZAq.js} +160 -140
  81. package/library/chunks/{gantt.tu-w6fQ5.js → gantt.Bv6_3H9y.js} +22 -22
  82. package/library/chunks/ganttDiagram-NO4QXBWP.DZdwd0O4.js +2715 -0
  83. package/library/chunks/gitGraphDiagram-IHSO6WYX.F6mwS3uS.js +818 -0
  84. package/library/chunks/graph.XHMI5hta.js +653 -0
  85. package/library/chunks/{header.e1FLwywx.js → header.DDI0MfJA.js} +1 -1
  86. package/library/chunks/{hierarchy.CTnBzzmQ.js → hierarchy.C4LxmFxx.js} +836 -904
  87. package/library/chunks/{hub-connection.CA_wS_wh.js → hub-connection.BtevPWYb.js} +1 -1
  88. package/library/chunks/{icon-button.DbVIFgu7.js → icon-button.BwmMJ0bI.js} +1 -1
  89. package/library/chunks/{icon.mxNZ85k0.js → icon.D5iM9wXS.js} +1 -1
  90. package/library/chunks/{iframe.DcHjOcLG.js → iframe.Cc-xZIm_.js} +1 -1
  91. package/library/chunks/{image.5mhGPvMN.js → image.BgODrAzQ.js} +2 -2
  92. package/library/chunks/{image.QVlPFadX.js → image.Y5c_hFx8.js} +1 -1
  93. package/library/chunks/{index.BVDhdCk-.js → index.2SOQHTpX.js} +23 -23
  94. package/library/chunks/index.BDn1QW8J.js +167 -0
  95. package/library/chunks/{index.DcjJFMlq.js → index.CrhRU5m8.js} +284 -273
  96. package/library/chunks/index.thKLME8E.js +77 -0
  97. package/library/chunks/infoDiagram-FWYZ7A6U.BnktKL7i.js +24 -0
  98. package/library/chunks/init.DjUOC4st.js +16 -0
  99. package/library/chunks/{input.BcyLZUmv.js → input.DOorVTYZ.js} +2 -2
  100. package/library/chunks/isArrayLikeObject.D7afXo-f.js +86 -0
  101. package/library/chunks/isEmpty.DtTJTUcf.js +27 -0
  102. package/library/chunks/ishikawaDiagram-FXEZZL3T.CFp-9Kes.js +621 -0
  103. package/library/chunks/journeyDiagram-5HDEW3XC.BxO1aPu_.js +837 -0
  104. package/library/chunks/{json.D7WeFaJm.js → json.Dz5QFEi5.js} +3 -3
  105. package/library/chunks/kanban-definition-HUTT4EX6.Bk8vmLFK.js +724 -0
  106. package/library/chunks/katex.DoRnZ_sp.js +11682 -0
  107. package/library/chunks/layout.DZcMFKol.js +1446 -0
  108. package/library/chunks/line.DP-iSN_J.js +157 -0
  109. package/library/chunks/linear.TNHhsH1m.js +215 -0
  110. package/library/chunks/{map.BjtxEozr.js → map.CBcV0WVq.js} +100 -105
  111. package/library/chunks/map.DJnohTgl.js +18 -0
  112. package/library/chunks/markdown.I1AJG75v.js +4180 -0
  113. package/library/chunks/math.D2lKC7md.js +22 -0
  114. package/library/chunks/mermaid.core.Dspbw7Ig.js +13598 -0
  115. package/library/chunks/mindmap-definition-LN4V7U3C.DuCBBYwE.js +808 -0
  116. package/library/chunks/{number.CtCaI0T_.js → number.Cx2ncfJJ.js} +2 -2
  117. package/library/chunks/{option.qN3aaqVI.js → option.DyNR1vzy.js} +2 -2
  118. package/library/chunks/ordinal.bqVaUip-.js +61 -0
  119. package/library/chunks/{pagination.Cupa46TN.js → pagination.qFmncShC.js} +5 -5
  120. package/library/chunks/pegDiagram-2B236MQR.DQrkEdJr.js +97 -0
  121. package/library/chunks/{percent.D_CkaRGb.js → percent.D8mkiJ2G.js} +17 -17
  122. package/library/chunks/pieDiagram-ENE6RG2P.B6nPW8Pj.js +212 -0
  123. package/library/chunks/position-picker.DjnhxIKF.js +4 -0
  124. package/library/chunks/quadrantDiagram-ABIIQ3AL.BFy9moxz.js +1026 -0
  125. package/library/chunks/{radar.BMKaNvJH.js → radar.B3p5bRix.js} +78 -129
  126. package/library/chunks/railroadDiagram-RFXS5EU6.CSao8YZX.js +79 -0
  127. package/library/chunks/range.DdOGybNB.js +9 -0
  128. package/library/chunks/requirementDiagram-TGXJPOKE.CjpliZnF.js +882 -0
  129. package/library/chunks/sankey.BR94A-8L.js +294 -0
  130. package/library/chunks/sankeyDiagram-HTMAVEWB.D8aAxVGe.js +564 -0
  131. package/library/chunks/select.C6_sM3Pr.js +7 -0
  132. package/library/chunks/sequenceDiagram-DBY2YBRQ.Cu9MV3h-.js +2891 -0
  133. package/library/chunks/sizeCapture-X5ZJPWSS.BDByEFcW.js +46 -0
  134. package/library/chunks/{sliceGrouper.C-t5ZRrz.js → sliceGrouper.CcRqQhZX.js} +1 -1
  135. package/library/chunks/stateDiagram-2N3HPSRC.DvrAW9Ck.js +267 -0
  136. package/library/chunks/stateDiagram-v2-6OUMAXLB.CFfuaFM1.js +18 -0
  137. package/library/chunks/step.almIqwJ6.js +51 -0
  138. package/library/chunks/{stock.vF_pji1F.js → stock.CQbn6zW4.js} +9 -9
  139. package/library/chunks/swimlanes-5IMT3BWC.AtMD47q7.js +5332 -0
  140. package/library/chunks/swimlanesDiagram-G3AALYLV.26A1eX7s.js +15 -0
  141. package/library/chunks/{tab-group.kSg5_10g.js → tab-group.1Y71_aN8.js} +3 -3
  142. package/library/chunks/{time.DWfbnPnM.js → time.DYWuX2id.js} +1 -1
  143. package/library/chunks/timeline-definition-FHXFAJF6.CYSh6xl5.js +1058 -0
  144. package/library/chunks/{timeline.gWu0up6r.js → timeline.Czz_uBEd.js} +33 -32
  145. package/library/chunks/toNumber.MuDz8DgU.js +31 -0
  146. package/library/chunks/{toString.Dcbz5jVT.js → toString.B1zKIiZc.js} +1 -1
  147. package/library/chunks/{toast.TDU3wVhq.js → toast.CXEAfCvN.js} +1 -1
  148. package/library/chunks/transformation.8uLv6uwG.js +264 -0
  149. package/library/chunks/{tree.C2dPd6gt.js → tree.vn5sHbdt.js} +123 -117
  150. package/library/chunks/value.BXEGBVFV.js +44 -0
  151. package/library/chunks/{venn.BVBe-JXs.js → venn.B5Jl-c4i.js} +2 -2
  152. package/library/chunks/vennDiagram-L72KCM5P.CSk1WWlu.js +1581 -0
  153. package/library/chunks/wardleyDiagram-EHGQE667.C7UzXYG7.js +675 -0
  154. package/library/chunks/{watch.DOt4Mabe.js → watch.DJF5K-8U.js} +27 -27
  155. package/library/chunks/{wc.DTNpfIc1.js → wc.B2THb2Kk.js} +18 -18
  156. package/library/chunks/xy.BO6U5QrZ.js +294 -0
  157. package/library/chunks/xychartDiagram-FW5EYKEG.idiZWvYS.js +1383 -0
  158. package/library/components/alert.js +2 -2
  159. package/library/components/am-chart.js +3 -3
  160. package/library/components/animated-image.js +2 -2
  161. package/library/components/animation.js +2 -2
  162. package/library/components/array-line-clamp.js +1 -1
  163. package/library/components/asset-link-format.js +8 -7
  164. package/library/components/atoms.js +29 -29
  165. package/library/components/audio.js +3 -3
  166. package/library/components/avatar.js +2 -2
  167. package/library/components/border-input-group.js +1 -1
  168. package/library/components/breadcrumb-item.js +1 -1
  169. package/library/components/breadcrumb.js +1 -1
  170. package/library/components/button.js +3 -3
  171. package/library/components/checkbox.js +195 -18
  172. package/library/components/color-picker.js +4 -4
  173. package/library/components/color-swatch-group.js +5 -5
  174. package/library/components/color-swatch.js +2 -2
  175. package/library/components/confirm-popover.js +3 -3
  176. package/library/components/copy-button.js +2 -2
  177. package/library/components/corner-position-input-group.js +2 -2
  178. package/library/components/cropper.js +4 -4
  179. package/library/components/date-calendar.js +1 -1
  180. package/library/components/details.js +2 -2
  181. package/library/components/dialog.js +3 -3
  182. package/library/components/diff.js +1 -1
  183. package/library/components/divider.js +1 -1
  184. package/library/components/document-viewer.js +3 -3
  185. package/library/components/dot-pagination.js +2 -2
  186. package/library/components/drawer.js +3 -3
  187. package/library/components/dropdown.js +2 -2
  188. package/library/components/dynamic-select.js +6 -6
  189. package/library/components/e-chart.js +1 -1
  190. package/library/components/element-clamp.js +2 -2
  191. package/library/components/file-on-demand.js +350 -374
  192. package/library/components/folder-select.js +5 -5
  193. package/library/components/format-time.js +2 -2
  194. package/library/components/grid-item.js +1 -1
  195. package/library/components/header.js +2 -2
  196. package/library/components/hub-connection.js +2 -2
  197. package/library/components/icon-button.js +2 -2
  198. package/library/components/icon.js +2 -2
  199. package/library/components/iframe.js +2 -2
  200. package/library/components/image-comparer.js +2 -2
  201. package/library/components/image.js +3 -3
  202. package/library/components/include.js +1 -1
  203. package/library/components/input.js +3 -3
  204. package/library/components/line-clamp.js +1 -1
  205. package/library/components/markdown.js +11 -2704
  206. package/library/components/masonry.js +76 -73
  207. package/library/components/menu-item.js +2 -2
  208. package/library/components/molecules.js +3 -3
  209. package/library/components/mutation-observer.js +1 -1
  210. package/library/components/option.js +3 -3
  211. package/library/components/organisms.js +2 -2
  212. package/library/components/padding-input-group.js +1 -1
  213. package/library/components/pagination.js +6 -6
  214. package/library/components/position-picker.js +25 -25
  215. package/library/components/qr-code.js +1 -1
  216. package/library/components/radio-button.js +1 -1
  217. package/library/components/radio-card.js +1 -1
  218. package/library/components/radio-group.js +1 -1
  219. package/library/components/radio.js +2 -2
  220. package/library/components/range.js +1 -1
  221. package/library/components/rating.js +2 -2
  222. package/library/components/resize-observer.js +1 -1
  223. package/library/components/select.js +3 -3
  224. package/library/components/shadow-input-group.js +1 -1
  225. package/library/components/share-option-list.js +2 -2
  226. package/library/components/sidebar.js +3 -3
  227. package/library/components/size-input-group.js +3 -3
  228. package/library/components/split-panel.js +1 -1
  229. package/library/components/step.js +1 -1
  230. package/library/components/stepper-wizard.js +1 -1
  231. package/library/components/stepper.js +1 -1
  232. package/library/components/switch.js +1 -1
  233. package/library/components/tab-group.js +4 -4
  234. package/library/components/tab-panel.js +1 -1
  235. package/library/components/tab.js +2 -2
  236. package/library/components/tag.js +1 -1
  237. package/library/components/textarea.js +1 -1
  238. package/library/components/timecode.js +1 -1
  239. package/library/components/tooltip.js +1 -1
  240. package/library/components/tree-item.js +4 -4
  241. package/library/components/tree.js +2 -2
  242. package/library/components/typeface.js +2 -2
  243. package/library/components/types.js +122327 -120686
  244. package/library/components/video.js +2 -2
  245. package/library/package.json +2 -1
  246. package/library/packages/atoms/src/components/markdown/markdown.d.ts +41 -1
  247. package/library/packages/atoms/src/components/markdown/parser.d.ts +18 -3
  248. package/library/packages/atoms/src/components/markdown/styles.d.ts +17 -0
  249. package/library/packages/atoms/src/components/tree/tree.d.ts +7 -1
  250. package/library/packages/atoms/src/components/tree-item/tree-item.d.ts +11 -1
  251. package/library/packages/events/src/cx-folder-select-loading-change.d.ts +8 -0
  252. package/library/packages/events/src/events.d.ts +1 -0
  253. package/library/packages/hybrid/table-core/src/table/styles/table-frozen.styles.d.ts +8 -0
  254. package/library/packages/hybrid/table-core/src/table/table.d.ts +9 -1
  255. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/FrozenColumns/FrozenColumns.d.ts +14 -1
  256. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/ResizeColumns/ResizeColumns.d.ts +18 -1
  257. package/library/packages/molecules/src/folder-select/components/folder-select-tree/folder-select-tree.d.ts +7 -0
  258. package/library/packages/molecules/src/folder-select/folder-select.d.ts +7 -0
  259. package/library/packages/molecules/src/index.d.ts +1 -0
  260. package/library/packages/molecules/src/markdown-viewer/markdown-viewer.d.ts +124 -0
  261. package/library/packages/molecules/src/markdown-viewer/markdown-viewer.styles.d.ts +6 -0
  262. package/library/packages/molecules/src/masonry/masonry.d.ts +5 -0
  263. package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +9 -0
  264. package/library/packages/organisms/src/asset-link-format/components/asset-link-format-crop/asset-link-format-crop.d.ts +30 -0
  265. package/library/packages/tools/src/tiptap/utils/md/editor-controller.d.ts +57 -0
  266. package/library/packages/tools/src/tiptap/utils/md/from-markdown.d.ts +11 -0
  267. package/library/packages/tools/src/tiptap/utils/md/input-rules.d.ts +15 -0
  268. package/library/packages/tools/src/tiptap/utils/md/schema.d.ts +13 -0
  269. package/library/packages/tools/src/tiptap/utils/md/to-markdown.d.ts +14 -0
  270. package/library/packages/types/src/asset-link-format.d.ts +19 -0
  271. package/library/packages/types/src/markdown-viewer.d.ts +12 -0
  272. package/library/packages/types/src/tree-item.d.ts +12 -0
  273. package/library/react-web-component.d.ts +86 -8
  274. package/library/utils.js +64 -65
  275. package/package.json +2 -1
  276. package/library/chunks/Slice.C5lVu2g_.js +0 -120
  277. package/library/chunks/_baseXor.VohG8cOH.js +0 -116
  278. package/library/chunks/asset-link-format.QzzboHHE.js +0 -6
  279. package/library/chunks/checkbox.3i2j3PHc.js +0 -198
  280. package/library/chunks/content-builder.BU8X7I6V.js +0 -60
  281. package/library/chunks/debounce.C_J-9zJi.js +0 -82
  282. package/library/chunks/flow.hz0UDjCb.js +0 -1594
  283. package/library/chunks/index.DU0XUO4k.js +0 -176
  284. package/library/chunks/transformation.D1alV_s4.js +0 -189
  285. package/library/chunks/xy.BNgyrwGD.js +0 -333
@@ -0,0 +1,2428 @@
1
+ import { g as de } from "./chunk-5VM5RSS4.D0-lddDM.js";
2
+ import { al as pe, am as Kt, an as fe, ao as xe, ap as ye, aq as be, ar as we, as as me, at as Se, au as Le, av as ke, aw as ve, ax as Ee, ay as _e, az as Te, aA as De, aB as Be, aC as Ne, aD as Ie, aE as Ce, aF as Oe, aG as Re, aH as Ae, aI as ze, aJ as Me, _ as g, y as rt, d as Pe, l as k, p as Fe, r as We, c as R, aK as Ye, P as He, M as Ke, aL as M, aM as kt, aN as Q, ad as Ue, x as $, j as Xe, aO as Ve, h as Ct, aP as Ot, aQ as je } from "./mermaid.core.Dspbw7Ig.js";
3
+ import "./index.CrhRU5m8.js";
4
+ import "./transform.BuqENXeT.js";
5
+ import { G as Ge } from "./graph.XHMI5hta.js";
6
+ import { c as Ze } from "./channel.s_XjcUYI.js";
7
+ import { s as D } from "./select.C6_sM3Pr.js";
8
+ import { l as qe } from "./line.DP-iSN_J.js";
9
+ function Je(e) {
10
+ return Array.isArray(e);
11
+ }
12
+ function Qe(e) {
13
+ if (pe(e)) return e;
14
+ const t = Kt(e);
15
+ if (!$e(e)) return {};
16
+ if (Je(e)) {
17
+ const s = Array.from(e);
18
+ return e.length > 0 && typeof e[0] == "string" && Object.hasOwn(e, "index") && (s.index = e.index, s.input = e.input), s;
19
+ }
20
+ if (fe(e)) {
21
+ const s = e, i = s.constructor;
22
+ return new i(s.buffer, s.byteOffset, s.length);
23
+ }
24
+ if (t === "[object ArrayBuffer]") return new ArrayBuffer(e.byteLength);
25
+ if (t === "[object DataView]") {
26
+ const s = e, i = s.buffer, c = s.byteOffset, r = s.byteLength, n = new ArrayBuffer(r), l = new Uint8Array(i, c, r);
27
+ return new Uint8Array(n).set(l), new DataView(n);
28
+ }
29
+ if (t === "[object Boolean]" || t === "[object Number]" || t === "[object String]") {
30
+ const s = e.constructor, i = new s(e.valueOf());
31
+ return t === "[object String]" ? er(i, e) : xt(i, e), i;
32
+ }
33
+ if (t === "[object Date]") return new Date(Number(e));
34
+ if (t === "[object RegExp]") {
35
+ const s = e, i = new RegExp(s.source, s.flags);
36
+ return i.lastIndex = s.lastIndex, i;
37
+ }
38
+ if (t === "[object Symbol]") return Object(Symbol.prototype.valueOf.call(e));
39
+ if (t === "[object Map]") {
40
+ const s = e, i = /* @__PURE__ */ new Map();
41
+ return s.forEach((c, r) => {
42
+ i.set(r, c);
43
+ }), i;
44
+ }
45
+ if (t === "[object Set]") {
46
+ const s = e, i = /* @__PURE__ */ new Set();
47
+ return s.forEach((c) => {
48
+ i.add(c);
49
+ }), i;
50
+ }
51
+ if (t === "[object Arguments]") {
52
+ const s = e, i = {};
53
+ return xt(i, s), i.length = s.length, i[Symbol.iterator] = s[Symbol.iterator], i;
54
+ }
55
+ const a = {};
56
+ return rr(a, e), xt(a, e), tr(a, e), a;
57
+ }
58
+ function $e(e) {
59
+ switch (Kt(e)) {
60
+ case Me:
61
+ case ze:
62
+ case Ae:
63
+ case Re:
64
+ case Oe:
65
+ case Ce:
66
+ case Ie:
67
+ case Ne:
68
+ case Be:
69
+ case De:
70
+ case Te:
71
+ case _e:
72
+ case Ee:
73
+ case ve:
74
+ case ke:
75
+ case Le:
76
+ case Se:
77
+ case me:
78
+ case we:
79
+ case be:
80
+ case ye:
81
+ case xe:
82
+ return !0;
83
+ default:
84
+ return !1;
85
+ }
86
+ }
87
+ function xt(e, t) {
88
+ for (const a in t) Object.hasOwn(t, a) && (e[a] = t[a]);
89
+ }
90
+ function tr(e, t) {
91
+ const a = Object.getOwnPropertySymbols(t);
92
+ for (let s = 0; s < a.length; s++) {
93
+ const i = a[s];
94
+ Object.prototype.propertyIsEnumerable.call(t, i) && (e[i] = t[i]);
95
+ }
96
+ }
97
+ function er(e, t) {
98
+ const a = t.valueOf().length;
99
+ for (const s in t) Object.hasOwn(t, s) && (Number.isNaN(Number(s)) || Number(s) >= a) && (e[s] = t[s]);
100
+ }
101
+ function rr(e, t) {
102
+ const a = Object.getPrototypeOf(t);
103
+ a !== null && typeof t.constructor == "function" && Object.setPrototypeOf(e, a);
104
+ }
105
+ var bt = function() {
106
+ var e = /* @__PURE__ */ g(function(T, m, p, x) {
107
+ for (p = p || {}, x = T.length; x--; p[T[x]] = m) ;
108
+ return p;
109
+ }, "o"), t = [1, 15], a = [1, 7], s = [1, 13], i = [1, 14], c = [1, 19], r = [1, 16], n = [1, 17], l = [1, 18], u = [8, 30], h = [8, 10, 21, 28, 29, 30, 31, 39, 43, 46], d = [1, 23], b = [1, 24], w = [8, 10, 15, 16, 21, 28, 29, 30, 31, 39, 43, 46], y = [8, 10, 15, 16, 21, 27, 28, 29, 30, 31, 39, 43, 46], v = [1, 49], S = {
110
+ trace: /* @__PURE__ */ g(function() {
111
+ }, "trace"),
112
+ yy: {},
113
+ symbols_: { error: 2, spaceLines: 3, SPACELINE: 4, NL: 5, separator: 6, SPACE: 7, EOF: 8, start: 9, BLOCK_DIAGRAM_KEY: 10, document: 11, stop: 12, statement: 13, link: 14, LINK: 15, START_LINK: 16, LINK_LABEL: 17, STR: 18, nodeStatement: 19, columnsStatement: 20, SPACE_BLOCK: 21, blockStatement: 22, classDefStatement: 23, cssClassStatement: 24, styleStatement: 25, node: 26, SIZE: 27, COLUMNS: 28, "id-block": 29, end: 30, NODE_ID: 31, nodeShapeNLabel: 32, dirList: 33, DIR: 34, NODE_DSTART: 35, NODE_DEND: 36, BLOCK_ARROW_START: 37, BLOCK_ARROW_END: 38, classDef: 39, CLASSDEF_ID: 40, CLASSDEF_STYLEOPTS: 41, DEFAULT: 42, class: 43, CLASSENTITY_IDS: 44, STYLECLASS: 45, style: 46, STYLE_ENTITY_IDS: 47, STYLE_DEFINITION_DATA: 48, $accept: 0, $end: 1 },
114
+ terminals_: { 2: "error", 4: "SPACELINE", 5: "NL", 7: "SPACE", 8: "EOF", 10: "BLOCK_DIAGRAM_KEY", 15: "LINK", 16: "START_LINK", 17: "LINK_LABEL", 18: "STR", 21: "SPACE_BLOCK", 27: "SIZE", 28: "COLUMNS", 29: "id-block", 30: "end", 31: "NODE_ID", 34: "DIR", 35: "NODE_DSTART", 36: "NODE_DEND", 37: "BLOCK_ARROW_START", 38: "BLOCK_ARROW_END", 39: "classDef", 40: "CLASSDEF_ID", 41: "CLASSDEF_STYLEOPTS", 42: "DEFAULT", 43: "class", 44: "CLASSENTITY_IDS", 45: "STYLECLASS", 46: "style", 47: "STYLE_ENTITY_IDS", 48: "STYLE_DEFINITION_DATA" },
115
+ productions_: [0, [3, 1], [3, 2], [3, 2], [6, 1], [6, 1], [6, 1], [9, 3], [12, 1], [12, 1], [12, 2], [12, 2], [11, 1], [11, 2], [14, 1], [14, 4], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [19, 3], [19, 2], [19, 1], [20, 1], [22, 4], [22, 3], [26, 1], [26, 2], [33, 1], [33, 2], [32, 3], [32, 4], [23, 3], [23, 3], [24, 3], [25, 3]],
116
+ performAction: /* @__PURE__ */ g(function(m, p, x, L, E, o, F) {
117
+ var f = o.length - 1;
118
+ switch (E) {
119
+ case 4:
120
+ L.getLogger().debug("Rule: separator (NL) ");
121
+ break;
122
+ case 5:
123
+ L.getLogger().debug("Rule: separator (Space) ");
124
+ break;
125
+ case 6:
126
+ L.getLogger().debug("Rule: separator (EOF) ");
127
+ break;
128
+ case 7:
129
+ L.getLogger().debug("Rule: hierarchy: ", o[f - 1]), L.setHierarchy(o[f - 1]);
130
+ break;
131
+ case 8:
132
+ L.getLogger().debug("Stop NL ");
133
+ break;
134
+ case 9:
135
+ L.getLogger().debug("Stop EOF ");
136
+ break;
137
+ case 10:
138
+ L.getLogger().debug("Stop NL2 ");
139
+ break;
140
+ case 11:
141
+ L.getLogger().debug("Stop EOF2 ");
142
+ break;
143
+ case 12:
144
+ L.getLogger().debug("Rule: statement: ", o[f]), typeof o[f].length == "number" ? this.$ = o[f] : this.$ = [o[f]];
145
+ break;
146
+ case 13:
147
+ L.getLogger().debug("Rule: statement #2: ", o[f - 1]), this.$ = [o[f - 1]].concat(o[f]);
148
+ break;
149
+ case 14:
150
+ L.getLogger().debug("Rule: link: ", o[f], m), this.$ = { edgeTypeStr: o[f], label: "" };
151
+ break;
152
+ case 15:
153
+ L.getLogger().debug("Rule: LABEL link: ", o[f - 3], o[f - 1], o[f]), this.$ = { edgeTypeStr: o[f], label: o[f - 1] };
154
+ break;
155
+ case 18:
156
+ const C = parseInt(o[f]), Z = L.generateId();
157
+ this.$ = { id: Z, type: "space", label: "", width: C, children: [] };
158
+ break;
159
+ case 23:
160
+ L.getLogger().debug("Rule: (nodeStatement link node) ", o[f - 2], o[f - 1], o[f], " typestr: ", o[f - 1].edgeTypeStr);
161
+ const V = L.edgeStrToEdgeData(o[f - 1].edgeTypeStr), at = L.edgeStrToEdgeStartData(o[f - 1].edgeTypeStr), gt = L.edgeStrToThickness(o[f - 1].edgeTypeStr), O = L.edgeStrToPattern(o[f - 1].edgeTypeStr);
162
+ this.$ = [
163
+ { id: o[f - 2].id, label: o[f - 2].label, type: o[f - 2].type, directions: o[f - 2].directions },
164
+ { id: o[f - 2].id + "-" + o[f].id, start: o[f - 2].id, end: o[f].id, label: o[f - 1].label, type: "edge", thickness: gt, pattern: O, directions: o[f].directions, arrowTypeEnd: V, arrowTypeStart: at },
165
+ { id: o[f].id, label: o[f].label, type: L.typeStr2Type(o[f].typeStr), directions: o[f].directions }
166
+ ];
167
+ break;
168
+ case 24:
169
+ L.getLogger().debug("Rule: nodeStatement (abc88 node size) ", o[f - 1], o[f]), this.$ = { id: o[f - 1].id, label: o[f - 1].label, type: L.typeStr2Type(o[f - 1].typeStr), directions: o[f - 1].directions, widthInColumns: parseInt(o[f], 10) };
170
+ break;
171
+ case 25:
172
+ L.getLogger().debug("Rule: nodeStatement (node) ", o[f]), this.$ = { id: o[f].id, label: o[f].label, type: L.typeStr2Type(o[f].typeStr), directions: o[f].directions, widthInColumns: 1 };
173
+ break;
174
+ case 26:
175
+ L.getLogger().debug("APA123", this ? this : "na"), L.getLogger().debug("COLUMNS: ", o[f]), this.$ = { type: "column-setting", columns: o[f] === "auto" ? -1 : parseInt(o[f]) };
176
+ break;
177
+ case 27:
178
+ L.getLogger().debug("Rule: id-block statement : ", o[f - 2], o[f - 1]), L.generateId(), this.$ = { ...o[f - 2], type: "composite", children: o[f - 1] };
179
+ break;
180
+ case 28:
181
+ L.getLogger().debug("Rule: blockStatement : ", o[f - 2], o[f - 1], o[f]);
182
+ const j = L.generateId();
183
+ this.$ = { id: j, type: "composite", label: "", children: o[f - 1] };
184
+ break;
185
+ case 29:
186
+ L.getLogger().debug("Rule: node (NODE_ID separator): ", o[f]), this.$ = { id: o[f] };
187
+ break;
188
+ case 30:
189
+ L.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", o[f - 1], o[f]), this.$ = { id: o[f - 1], label: o[f].label, typeStr: o[f].typeStr, directions: o[f].directions };
190
+ break;
191
+ case 31:
192
+ L.getLogger().debug("Rule: dirList: ", o[f]), this.$ = [o[f]];
193
+ break;
194
+ case 32:
195
+ L.getLogger().debug("Rule: dirList: ", o[f - 1], o[f]), this.$ = [o[f - 1]].concat(o[f]);
196
+ break;
197
+ case 33:
198
+ L.getLogger().debug("Rule: nodeShapeNLabel: ", o[f - 2], o[f - 1], o[f]), this.$ = { typeStr: o[f - 2] + o[f], label: o[f - 1] };
199
+ break;
200
+ case 34:
201
+ L.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", o[f - 3], o[f - 2], " #3:", o[f - 1], o[f]), this.$ = { typeStr: o[f - 3] + o[f], label: o[f - 2], directions: o[f - 1] };
202
+ break;
203
+ case 35:
204
+ case 36:
205
+ this.$ = { type: "classDef", id: o[f - 1].trim(), css: o[f].trim() };
206
+ break;
207
+ case 37:
208
+ this.$ = { type: "applyClass", id: o[f - 1].trim(), styleClass: o[f].trim() };
209
+ break;
210
+ case 38:
211
+ this.$ = { type: "applyStyles", id: o[f - 1].trim(), stylesStr: o[f].trim() };
212
+ break;
213
+ }
214
+ }, "anonymous"),
215
+ table: [{ 9: 1, 10: [1, 2] }, { 1: [3] }, { 10: t, 11: 3, 13: 4, 19: 5, 20: 6, 21: a, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: s, 29: i, 31: c, 39: r, 43: n, 46: l }, { 8: [1, 20] }, e(u, [2, 12], { 13: 4, 19: 5, 20: 6, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 11: 21, 10: t, 21: a, 28: s, 29: i, 31: c, 39: r, 43: n, 46: l }), e(h, [2, 16], { 14: 22, 15: d, 16: b }), e(h, [2, 17]), e(h, [2, 18]), e(h, [2, 19]), e(h, [2, 20]), e(h, [2, 21]), e(h, [2, 22]), e(w, [2, 25], { 27: [1, 25] }), e(h, [2, 26]), { 19: 26, 26: 12, 31: c }, { 10: t, 11: 27, 13: 4, 19: 5, 20: 6, 21: a, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: s, 29: i, 31: c, 39: r, 43: n, 46: l }, { 40: [1, 28], 42: [1, 29] }, { 44: [1, 30] }, { 47: [1, 31] }, e(y, [2, 29], { 32: 32, 35: [1, 33], 37: [1, 34] }), { 1: [2, 7] }, e(u, [2, 13]), { 26: 35, 31: c }, { 31: [2, 14] }, { 17: [1, 36] }, e(w, [2, 24]), { 10: t, 11: 37, 13: 4, 14: 22, 15: d, 16: b, 19: 5, 20: 6, 21: a, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: s, 29: i, 31: c, 39: r, 43: n, 46: l }, { 30: [1, 38] }, { 41: [1, 39] }, { 41: [1, 40] }, { 45: [1, 41] }, { 48: [1, 42] }, e(y, [2, 30]), { 18: [1, 43] }, { 18: [1, 44] }, e(w, [2, 23]), { 18: [1, 45] }, { 30: [1, 46] }, e(h, [2, 28]), e(h, [2, 35]), e(h, [2, 36]), e(h, [2, 37]), e(h, [2, 38]), { 36: [1, 47] }, { 33: 48, 34: v }, { 15: [1, 50] }, e(h, [2, 27]), e(y, [2, 33]), { 38: [1, 51] }, { 33: 52, 34: v, 38: [2, 31] }, { 31: [2, 15] }, e(y, [2, 34]), { 38: [2, 32] }],
216
+ defaultActions: { 20: [2, 7], 23: [2, 14], 50: [2, 15], 52: [2, 32] },
217
+ parseError: /* @__PURE__ */ g(function(m, p) {
218
+ if (p.recoverable)
219
+ this.trace(m);
220
+ else {
221
+ var x = new Error(m);
222
+ throw x.hash = p, x;
223
+ }
224
+ }, "parseError"),
225
+ parse: /* @__PURE__ */ g(function(m) {
226
+ var p = this, x = [0], L = [], E = [null], o = [], F = this.table, f = "", C = 0, Z = 0, V = 2, at = 1, gt = o.slice.call(arguments, 1), O = Object.create(this.lexer), j = { yy: {} };
227
+ for (var ut in this.yy)
228
+ Object.prototype.hasOwnProperty.call(this.yy, ut) && (j.yy[ut] = this.yy[ut]);
229
+ O.setInput(m, j.yy), j.yy.lexer = O, j.yy.parser = this, typeof O.yylloc > "u" && (O.yylloc = {});
230
+ var dt = O.yylloc;
231
+ o.push(dt);
232
+ var ge = O.options && O.options.ranges;
233
+ typeof j.yy.parseError == "function" ? this.parseError = j.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
234
+ function ue(W) {
235
+ x.length = x.length - 2 * W, E.length = E.length - W, o.length = o.length - W;
236
+ }
237
+ g(ue, "popStack");
238
+ function Nt() {
239
+ var W;
240
+ return W = L.pop() || O.lex() || at, typeof W != "number" && (W instanceof Array && (L = W, W = L.pop()), W = p.symbols_[W] || W), W;
241
+ }
242
+ g(Nt, "lex");
243
+ for (var P, q, H, pt, J = {}, st, G, It, it; ; ) {
244
+ if (q = x[x.length - 1], this.defaultActions[q] ? H = this.defaultActions[q] : ((P === null || typeof P > "u") && (P = Nt()), H = F[q] && F[q][P]), typeof H > "u" || !H.length || !H[0]) {
245
+ var ft = "";
246
+ it = [];
247
+ for (st in F[q])
248
+ this.terminals_[st] && st > V && it.push("'" + this.terminals_[st] + "'");
249
+ O.showPosition ? ft = "Parse error on line " + (C + 1) + `:
250
+ ` + O.showPosition() + `
251
+ Expecting ` + it.join(", ") + ", got '" + (this.terminals_[P] || P) + "'" : ft = "Parse error on line " + (C + 1) + ": Unexpected " + (P == at ? "end of input" : "'" + (this.terminals_[P] || P) + "'"), this.parseError(ft, {
252
+ text: O.match,
253
+ token: this.terminals_[P] || P,
254
+ line: O.yylineno,
255
+ loc: dt,
256
+ expected: it
257
+ });
258
+ }
259
+ if (H[0] instanceof Array && H.length > 1)
260
+ throw new Error("Parse Error: multiple actions possible at state: " + q + ", token: " + P);
261
+ switch (H[0]) {
262
+ case 1:
263
+ x.push(P), E.push(O.yytext), o.push(O.yylloc), x.push(H[1]), P = null, Z = O.yyleng, f = O.yytext, C = O.yylineno, dt = O.yylloc;
264
+ break;
265
+ case 2:
266
+ if (G = this.productions_[H[1]][1], J.$ = E[E.length - G], J._$ = {
267
+ first_line: o[o.length - (G || 1)].first_line,
268
+ last_line: o[o.length - 1].last_line,
269
+ first_column: o[o.length - (G || 1)].first_column,
270
+ last_column: o[o.length - 1].last_column
271
+ }, ge && (J._$.range = [
272
+ o[o.length - (G || 1)].range[0],
273
+ o[o.length - 1].range[1]
274
+ ]), pt = this.performAction.apply(J, [
275
+ f,
276
+ Z,
277
+ C,
278
+ j.yy,
279
+ H[1],
280
+ E,
281
+ o
282
+ ].concat(gt)), typeof pt < "u")
283
+ return pt;
284
+ G && (x = x.slice(0, -1 * G * 2), E = E.slice(0, -1 * G), o = o.slice(0, -1 * G)), x.push(this.productions_[H[1]][0]), E.push(J.$), o.push(J._$), It = F[x[x.length - 2]][x[x.length - 1]], x.push(It);
285
+ break;
286
+ case 3:
287
+ return !0;
288
+ }
289
+ }
290
+ return !0;
291
+ }, "parse")
292
+ }, N = /* @__PURE__ */ function() {
293
+ var T = {
294
+ EOF: 1,
295
+ parseError: /* @__PURE__ */ g(function(p, x) {
296
+ if (this.yy.parser)
297
+ this.yy.parser.parseError(p, x);
298
+ else
299
+ throw new Error(p);
300
+ }, "parseError"),
301
+ // resets the lexer, sets new input
302
+ setInput: /* @__PURE__ */ g(function(m, p) {
303
+ return this.yy = p || this.yy || {}, this._input = m, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
304
+ first_line: 1,
305
+ first_column: 0,
306
+ last_line: 1,
307
+ last_column: 0
308
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
309
+ }, "setInput"),
310
+ // consumes and returns one char from the input
311
+ input: /* @__PURE__ */ g(function() {
312
+ var m = this._input[0];
313
+ this.yytext += m, this.yyleng++, this.offset++, this.match += m, this.matched += m;
314
+ var p = m.match(/(?:\r\n?|\n).*/g);
315
+ return p ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), m;
316
+ }, "input"),
317
+ // unshifts one char (or a string) into the input
318
+ unput: /* @__PURE__ */ g(function(m) {
319
+ var p = m.length, x = m.split(/(?:\r\n?|\n)/g);
320
+ this._input = m + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - p), this.offset -= p;
321
+ var L = this.match.split(/(?:\r\n?|\n)/g);
322
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), x.length - 1 && (this.yylineno -= x.length - 1);
323
+ var E = this.yylloc.range;
324
+ return this.yylloc = {
325
+ first_line: this.yylloc.first_line,
326
+ last_line: this.yylineno + 1,
327
+ first_column: this.yylloc.first_column,
328
+ last_column: x ? (x.length === L.length ? this.yylloc.first_column : 0) + L[L.length - x.length].length - x[0].length : this.yylloc.first_column - p
329
+ }, this.options.ranges && (this.yylloc.range = [E[0], E[0] + this.yyleng - p]), this.yyleng = this.yytext.length, this;
330
+ }, "unput"),
331
+ // When called from action, caches matched text and appends it on next action
332
+ more: /* @__PURE__ */ g(function() {
333
+ return this._more = !0, this;
334
+ }, "more"),
335
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
336
+ reject: /* @__PURE__ */ g(function() {
337
+ if (this.options.backtrack_lexer)
338
+ this._backtrack = !0;
339
+ else
340
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
341
+ ` + this.showPosition(), {
342
+ text: "",
343
+ token: null,
344
+ line: this.yylineno
345
+ });
346
+ return this;
347
+ }, "reject"),
348
+ // retain first n characters of the match
349
+ less: /* @__PURE__ */ g(function(m) {
350
+ this.unput(this.match.slice(m));
351
+ }, "less"),
352
+ // displays already matched input, i.e. for error messages
353
+ pastInput: /* @__PURE__ */ g(function() {
354
+ var m = this.matched.substr(0, this.matched.length - this.match.length);
355
+ return (m.length > 20 ? "..." : "") + m.substr(-20).replace(/\n/g, "");
356
+ }, "pastInput"),
357
+ // displays upcoming input, i.e. for error messages
358
+ upcomingInput: /* @__PURE__ */ g(function() {
359
+ var m = this.match;
360
+ return m.length < 20 && (m += this._input.substr(0, 20 - m.length)), (m.substr(0, 20) + (m.length > 20 ? "..." : "")).replace(/\n/g, "");
361
+ }, "upcomingInput"),
362
+ // displays the character position where the lexing error occurred, i.e. for error messages
363
+ showPosition: /* @__PURE__ */ g(function() {
364
+ var m = this.pastInput(), p = new Array(m.length + 1).join("-");
365
+ return m + this.upcomingInput() + `
366
+ ` + p + "^";
367
+ }, "showPosition"),
368
+ // test the lexed token: return FALSE when not a match, otherwise return token
369
+ test_match: /* @__PURE__ */ g(function(m, p) {
370
+ var x, L, E;
371
+ if (this.options.backtrack_lexer && (E = {
372
+ yylineno: this.yylineno,
373
+ yylloc: {
374
+ first_line: this.yylloc.first_line,
375
+ last_line: this.last_line,
376
+ first_column: this.yylloc.first_column,
377
+ last_column: this.yylloc.last_column
378
+ },
379
+ yytext: this.yytext,
380
+ match: this.match,
381
+ matches: this.matches,
382
+ matched: this.matched,
383
+ yyleng: this.yyleng,
384
+ offset: this.offset,
385
+ _more: this._more,
386
+ _input: this._input,
387
+ yy: this.yy,
388
+ conditionStack: this.conditionStack.slice(0),
389
+ done: this.done
390
+ }, this.options.ranges && (E.yylloc.range = this.yylloc.range.slice(0))), L = m[0].match(/(?:\r\n?|\n).*/g), L && (this.yylineno += L.length), this.yylloc = {
391
+ first_line: this.yylloc.last_line,
392
+ last_line: this.yylineno + 1,
393
+ first_column: this.yylloc.last_column,
394
+ last_column: L ? L[L.length - 1].length - L[L.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + m[0].length
395
+ }, this.yytext += m[0], this.match += m[0], this.matches = m, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(m[0].length), this.matched += m[0], x = this.performAction.call(this, this.yy, this, p, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), x)
396
+ return x;
397
+ if (this._backtrack) {
398
+ for (var o in E)
399
+ this[o] = E[o];
400
+ return !1;
401
+ }
402
+ return !1;
403
+ }, "test_match"),
404
+ // return next match in input
405
+ next: /* @__PURE__ */ g(function() {
406
+ if (this.done)
407
+ return this.EOF;
408
+ this._input || (this.done = !0);
409
+ var m, p, x, L;
410
+ this._more || (this.yytext = "", this.match = "");
411
+ for (var E = this._currentRules(), o = 0; o < E.length; o++)
412
+ if (x = this._input.match(this.rules[E[o]]), x && (!p || x[0].length > p[0].length)) {
413
+ if (p = x, L = o, this.options.backtrack_lexer) {
414
+ if (m = this.test_match(x, E[o]), m !== !1)
415
+ return m;
416
+ if (this._backtrack) {
417
+ p = !1;
418
+ continue;
419
+ } else
420
+ return !1;
421
+ } else if (!this.options.flex)
422
+ break;
423
+ }
424
+ return p ? (m = this.test_match(p, E[L]), m !== !1 ? m : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
425
+ ` + this.showPosition(), {
426
+ text: "",
427
+ token: null,
428
+ line: this.yylineno
429
+ });
430
+ }, "next"),
431
+ // return next match that has a token
432
+ lex: /* @__PURE__ */ g(function() {
433
+ var p = this.next();
434
+ return p || this.lex();
435
+ }, "lex"),
436
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
437
+ begin: /* @__PURE__ */ g(function(p) {
438
+ this.conditionStack.push(p);
439
+ }, "begin"),
440
+ // pop the previously active lexer condition state off the condition stack
441
+ popState: /* @__PURE__ */ g(function() {
442
+ var p = this.conditionStack.length - 1;
443
+ return p > 0 ? this.conditionStack.pop() : this.conditionStack[0];
444
+ }, "popState"),
445
+ // produce the lexer rule set which is active for the currently active lexer condition state
446
+ _currentRules: /* @__PURE__ */ g(function() {
447
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
448
+ }, "_currentRules"),
449
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
450
+ topState: /* @__PURE__ */ g(function(p) {
451
+ return p = this.conditionStack.length - 1 - Math.abs(p || 0), p >= 0 ? this.conditionStack[p] : "INITIAL";
452
+ }, "topState"),
453
+ // alias for begin(condition)
454
+ pushState: /* @__PURE__ */ g(function(p) {
455
+ this.begin(p);
456
+ }, "pushState"),
457
+ // return the number of states currently on the stack
458
+ stateStackSize: /* @__PURE__ */ g(function() {
459
+ return this.conditionStack.length;
460
+ }, "stateStackSize"),
461
+ options: {},
462
+ performAction: /* @__PURE__ */ g(function(p, x, L, E) {
463
+ switch (L) {
464
+ case 0:
465
+ return p.getLogger().debug("Found block-beta"), 10;
466
+ case 1:
467
+ return p.getLogger().debug("Found id-block"), 29;
468
+ case 2:
469
+ return p.getLogger().debug("Found block"), 10;
470
+ case 3:
471
+ p.getLogger().debug(".", x.yytext);
472
+ break;
473
+ case 4:
474
+ p.getLogger().debug("_", x.yytext);
475
+ break;
476
+ case 5:
477
+ return 5;
478
+ case 6:
479
+ return x.yytext = -1, 28;
480
+ case 7:
481
+ return x.yytext = x.yytext.replace(/columns\s+/, ""), p.getLogger().debug("COLUMNS (LEX)", x.yytext), 28;
482
+ case 8:
483
+ this.pushState("md_string");
484
+ break;
485
+ case 9:
486
+ return "MD_STR";
487
+ case 10:
488
+ this.popState();
489
+ break;
490
+ case 11:
491
+ this.pushState("string");
492
+ break;
493
+ case 12:
494
+ p.getLogger().debug("LEX: POPPING STR:", x.yytext), this.popState();
495
+ break;
496
+ case 13:
497
+ return p.getLogger().debug("LEX: STR end:", x.yytext), "STR";
498
+ case 14:
499
+ return x.yytext = x.yytext.replace(/space\:/, ""), p.getLogger().debug("SPACE NUM (LEX)", x.yytext), 21;
500
+ case 15:
501
+ return x.yytext = "1", p.getLogger().debug("COLUMNS (LEX)", x.yytext), 21;
502
+ case 16:
503
+ return 42;
504
+ case 17:
505
+ return "LINKSTYLE";
506
+ case 18:
507
+ return "INTERPOLATE";
508
+ case 19:
509
+ return this.pushState("CLASSDEF"), 39;
510
+ case 20:
511
+ return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
512
+ case 21:
513
+ return this.popState(), this.pushState("CLASSDEFID"), 40;
514
+ case 22:
515
+ return this.popState(), 41;
516
+ case 23:
517
+ return this.pushState("CLASS"), 43;
518
+ case 24:
519
+ return this.popState(), this.pushState("CLASS_STYLE"), 44;
520
+ case 25:
521
+ return this.popState(), 45;
522
+ case 26:
523
+ return this.pushState("STYLE_STMNT"), 46;
524
+ case 27:
525
+ return this.popState(), this.pushState("STYLE_DEFINITION"), 47;
526
+ case 28:
527
+ return this.popState(), 48;
528
+ case 29:
529
+ return this.pushState("acc_title"), "acc_title";
530
+ case 30:
531
+ return this.popState(), "acc_title_value";
532
+ case 31:
533
+ return this.pushState("acc_descr"), "acc_descr";
534
+ case 32:
535
+ return this.popState(), "acc_descr_value";
536
+ case 33:
537
+ this.pushState("acc_descr_multiline");
538
+ break;
539
+ case 34:
540
+ this.popState();
541
+ break;
542
+ case 35:
543
+ return "acc_descr_multiline_value";
544
+ case 36:
545
+ return 30;
546
+ case 37:
547
+ return this.popState(), p.getLogger().debug("Lex: (("), "NODE_DEND";
548
+ case 38:
549
+ return this.popState(), p.getLogger().debug("Lex: (("), "NODE_DEND";
550
+ case 39:
551
+ return this.popState(), p.getLogger().debug("Lex: ))"), "NODE_DEND";
552
+ case 40:
553
+ return this.popState(), p.getLogger().debug("Lex: (("), "NODE_DEND";
554
+ case 41:
555
+ return this.popState(), p.getLogger().debug("Lex: (("), "NODE_DEND";
556
+ case 42:
557
+ return this.popState(), p.getLogger().debug("Lex: (-"), "NODE_DEND";
558
+ case 43:
559
+ return this.popState(), p.getLogger().debug("Lex: -)"), "NODE_DEND";
560
+ case 44:
561
+ return this.popState(), p.getLogger().debug("Lex: (("), "NODE_DEND";
562
+ case 45:
563
+ return this.popState(), p.getLogger().debug("Lex: ]]"), "NODE_DEND";
564
+ case 46:
565
+ return this.popState(), p.getLogger().debug("Lex: ("), "NODE_DEND";
566
+ case 47:
567
+ return this.popState(), p.getLogger().debug("Lex: ])"), "NODE_DEND";
568
+ case 48:
569
+ return this.popState(), p.getLogger().debug("Lex: /]"), "NODE_DEND";
570
+ case 49:
571
+ return this.popState(), p.getLogger().debug("Lex: /]"), "NODE_DEND";
572
+ case 50:
573
+ return this.popState(), p.getLogger().debug("Lex: )]"), "NODE_DEND";
574
+ case 51:
575
+ return this.popState(), p.getLogger().debug("Lex: )"), "NODE_DEND";
576
+ case 52:
577
+ return this.popState(), p.getLogger().debug("Lex: ]>"), "NODE_DEND";
578
+ case 53:
579
+ return this.popState(), p.getLogger().debug("Lex: ]"), "NODE_DEND";
580
+ case 54:
581
+ return p.getLogger().debug("Lexa: -)"), this.pushState("NODE"), 35;
582
+ case 55:
583
+ return p.getLogger().debug("Lexa: (-"), this.pushState("NODE"), 35;
584
+ case 56:
585
+ return p.getLogger().debug("Lexa: ))"), this.pushState("NODE"), 35;
586
+ case 57:
587
+ return p.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
588
+ case 58:
589
+ return p.getLogger().debug("Lex: ((("), this.pushState("NODE"), 35;
590
+ case 59:
591
+ return p.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
592
+ case 60:
593
+ return p.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
594
+ case 61:
595
+ return p.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
596
+ case 62:
597
+ return p.getLogger().debug("Lexc: >"), this.pushState("NODE"), 35;
598
+ case 63:
599
+ return p.getLogger().debug("Lexa: (["), this.pushState("NODE"), 35;
600
+ case 64:
601
+ return p.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
602
+ case 65:
603
+ return this.pushState("NODE"), 35;
604
+ case 66:
605
+ return this.pushState("NODE"), 35;
606
+ case 67:
607
+ return this.pushState("NODE"), 35;
608
+ case 68:
609
+ return this.pushState("NODE"), 35;
610
+ case 69:
611
+ return this.pushState("NODE"), 35;
612
+ case 70:
613
+ return this.pushState("NODE"), 35;
614
+ case 71:
615
+ return this.pushState("NODE"), 35;
616
+ case 72:
617
+ return p.getLogger().debug("Lexa: ["), this.pushState("NODE"), 35;
618
+ case 73:
619
+ return this.pushState("BLOCK_ARROW"), p.getLogger().debug("LEX ARR START"), 37;
620
+ case 74:
621
+ return p.getLogger().debug("Lex: NODE_ID", x.yytext), 31;
622
+ case 75:
623
+ return p.getLogger().debug("Lex: EOF", x.yytext), 8;
624
+ case 76:
625
+ this.pushState("md_string");
626
+ break;
627
+ case 77:
628
+ this.pushState("md_string");
629
+ break;
630
+ case 78:
631
+ return "NODE_DESCR";
632
+ case 79:
633
+ this.popState();
634
+ break;
635
+ case 80:
636
+ p.getLogger().debug("Lex: Starting string"), this.pushState("string");
637
+ break;
638
+ case 81:
639
+ p.getLogger().debug("LEX ARR: Starting string"), this.pushState("string");
640
+ break;
641
+ case 82:
642
+ return p.getLogger().debug("LEX: NODE_DESCR:", x.yytext), "NODE_DESCR";
643
+ case 83:
644
+ p.getLogger().debug("LEX POPPING"), this.popState();
645
+ break;
646
+ case 84:
647
+ p.getLogger().debug("Lex: =>BAE"), this.pushState("ARROW_DIR");
648
+ break;
649
+ case 85:
650
+ return x.yytext = x.yytext.replace(/^,\s*/, ""), p.getLogger().debug("Lex (right): dir:", x.yytext), "DIR";
651
+ case 86:
652
+ return x.yytext = x.yytext.replace(/^,\s*/, ""), p.getLogger().debug("Lex (left):", x.yytext), "DIR";
653
+ case 87:
654
+ return x.yytext = x.yytext.replace(/^,\s*/, ""), p.getLogger().debug("Lex (x):", x.yytext), "DIR";
655
+ case 88:
656
+ return x.yytext = x.yytext.replace(/^,\s*/, ""), p.getLogger().debug("Lex (y):", x.yytext), "DIR";
657
+ case 89:
658
+ return x.yytext = x.yytext.replace(/^,\s*/, ""), p.getLogger().debug("Lex (up):", x.yytext), "DIR";
659
+ case 90:
660
+ return x.yytext = x.yytext.replace(/^,\s*/, ""), p.getLogger().debug("Lex (down):", x.yytext), "DIR";
661
+ case 91:
662
+ return x.yytext = "]>", p.getLogger().debug("Lex (ARROW_DIR end):", x.yytext), this.popState(), this.popState(), "BLOCK_ARROW_END";
663
+ case 92:
664
+ return p.getLogger().debug("Lex: LINK", "#" + x.yytext + "#"), 15;
665
+ case 93:
666
+ return p.getLogger().debug("Lex: LINK", x.yytext), 15;
667
+ case 94:
668
+ return p.getLogger().debug("Lex: LINK", x.yytext), 15;
669
+ case 95:
670
+ return p.getLogger().debug("Lex: LINK", x.yytext), 15;
671
+ case 96:
672
+ return p.getLogger().debug("Lex: START_LINK", x.yytext), this.pushState("LLABEL"), 16;
673
+ case 97:
674
+ return p.getLogger().debug("Lex: START_LINK", x.yytext), this.pushState("LLABEL"), 16;
675
+ case 98:
676
+ return p.getLogger().debug("Lex: START_LINK", x.yytext), this.pushState("LLABEL"), 16;
677
+ case 99:
678
+ this.pushState("md_string");
679
+ break;
680
+ case 100:
681
+ return p.getLogger().debug("Lex: Starting string"), this.pushState("string"), "LINK_LABEL";
682
+ case 101:
683
+ return this.popState(), p.getLogger().debug("Lex: LINK", "#" + x.yytext + "#"), 15;
684
+ case 102:
685
+ return this.popState(), p.getLogger().debug("Lex: LINK", x.yytext), 15;
686
+ case 103:
687
+ return this.popState(), p.getLogger().debug("Lex: LINK", x.yytext), 15;
688
+ case 104:
689
+ return p.getLogger().debug("Lex: COLON", x.yytext), x.yytext = x.yytext.slice(1), 27;
690
+ }
691
+ }, "anonymous"),
692
+ rules: [/^(?:block-beta\b)/, /^(?:block:)/, /^(?:block\b)/, /^(?:[\s]+)/, /^(?:[\n]+)/, /^(?:((\u000D\u000A)|(\u000A)))/, /^(?:columns\s+auto\b)/, /^(?:columns\s+[\d]+)/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:space[:]\d+)/, /^(?:space\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\s+)/, /^(?:DEFAULT\s+)/, /^(?:\w+\s+)/, /^(?:[^\n]*)/, /^(?:class\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:style\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:end\b\s*)/, /^(?:\(\(\()/, /^(?:\)\)\))/, /^(?:[\)]\))/, /^(?:\}\})/, /^(?:\})/, /^(?:\(-)/, /^(?:-\))/, /^(?:\(\()/, /^(?:\]\])/, /^(?:\()/, /^(?:\]\))/, /^(?:\\\])/, /^(?:\/\])/, /^(?:\)\])/, /^(?:[\)])/, /^(?:\]>)/, /^(?:[\]])/, /^(?:-\))/, /^(?:\(-)/, /^(?:\)\))/, /^(?:\))/, /^(?:\(\(\()/, /^(?:\(\()/, /^(?:\{\{)/, /^(?:\{)/, /^(?:>)/, /^(?:\(\[)/, /^(?:\()/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\[\\)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:\[)/, /^(?:<\[)/, /^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/, /^(?:$)/, /^(?:["][`])/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:\]>\s*\()/, /^(?:,?\s*right\s*)/, /^(?:,?\s*left\s*)/, /^(?:,?\s*x\s*)/, /^(?:,?\s*y\s*)/, /^(?:,?\s*up\s*)/, /^(?:,?\s*down\s*)/, /^(?:\)\s*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*~~[\~]+\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:["][`])/, /^(?:["])/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?::\d+)/],
693
+ conditions: { STYLE_DEFINITION: { rules: [28], inclusive: !1 }, STYLE_STMNT: { rules: [27], inclusive: !1 }, CLASSDEFID: { rules: [22], inclusive: !1 }, CLASSDEF: { rules: [20, 21], inclusive: !1 }, CLASS_STYLE: { rules: [25], inclusive: !1 }, CLASS: { rules: [24], inclusive: !1 }, LLABEL: { rules: [99, 100, 101, 102, 103], inclusive: !1 }, ARROW_DIR: { rules: [85, 86, 87, 88, 89, 90, 91], inclusive: !1 }, BLOCK_ARROW: { rules: [76, 81, 84], inclusive: !1 }, NODE: { rules: [37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 77, 80], inclusive: !1 }, md_string: { rules: [9, 10, 78, 79], inclusive: !1 }, space: { rules: [], inclusive: !1 }, string: { rules: [12, 13, 82, 83], inclusive: !1 }, acc_descr_multiline: { rules: [34, 35], inclusive: !1 }, acc_descr: { rules: [32], inclusive: !1 }, acc_title: { rules: [30], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 14, 15, 16, 17, 18, 19, 23, 26, 29, 31, 33, 36, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 92, 93, 94, 95, 96, 97, 98, 104], inclusive: !0 } }
694
+ };
695
+ return T;
696
+ }();
697
+ S.lexer = N;
698
+ function _() {
699
+ this.yy = {};
700
+ }
701
+ return g(_, "Parser"), _.prototype = S, S.Parser = _, new _();
702
+ }();
703
+ bt.parser = bt;
704
+ var ar = bt, U = /* @__PURE__ */ new Map(), vt = [], wt = /* @__PURE__ */ new Map(), Rt = "color", At = "fill", sr = "bgFill", Ut = ",", ct = /* @__PURE__ */ new Map(), Et = "", ir = /* @__PURE__ */ g((e) => Xe.sanitizeText(e, R()), "sanitizeText"), nr = /* @__PURE__ */ g(function(e, t = "") {
705
+ let a = ct.get(e);
706
+ a || (a = { id: e, styles: [], textStyles: [] }, ct.set(e, a)), t?.split(Ut).forEach((s) => {
707
+ const i = s.replace(/([^;]*);/, "$1").trim();
708
+ if (RegExp(Rt).exec(s)) {
709
+ const r = i.replace(At, sr).replace(Rt, At);
710
+ a.textStyles.push(r);
711
+ }
712
+ a.styles.push(i);
713
+ });
714
+ }, "addStyleClass"), cr = /* @__PURE__ */ g(function(e, t = "") {
715
+ const a = U.get(e);
716
+ t != null && (a.styles = t.split(Ut));
717
+ }, "addStyle2Node"), lr = /* @__PURE__ */ g(function(e, t) {
718
+ e.split(",").forEach(function(a) {
719
+ let s = U.get(a);
720
+ if (s === void 0) {
721
+ const i = a.trim();
722
+ s = { id: i, type: "na", children: [] }, U.set(i, s);
723
+ }
724
+ s.classes || (s.classes = []), s.classes.push(t);
725
+ });
726
+ }, "setCssClass"), Xt = /* @__PURE__ */ g((e, t) => {
727
+ const a = e.flat(), s = [], c = a.find((r) => r?.type === "column-setting")?.columns ?? -1;
728
+ for (const r of a) {
729
+ if (typeof c == "number" && c > 0 && r.type !== "column-setting" && typeof r.widthInColumns == "number" && r.widthInColumns > c && k.warn(
730
+ `Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${c}`
731
+ ), r.label && (r.label = ir(r.label)), r.type === "classDef") {
732
+ nr(r.id, r.css);
733
+ continue;
734
+ }
735
+ if (r.type === "applyClass") {
736
+ lr(r.id, r?.styleClass ?? "");
737
+ continue;
738
+ }
739
+ if (r.type === "applyStyles") {
740
+ r?.stylesStr && cr(r.id, r?.stylesStr);
741
+ continue;
742
+ }
743
+ if (r.type === "column-setting")
744
+ t.columns = r.columns ?? -1;
745
+ else if (r.type === "edge") {
746
+ const n = (wt.get(r.id) ?? 0) + 1;
747
+ wt.set(r.id, n), r.id = n + "-" + r.id, vt.push(r);
748
+ } else {
749
+ r.label || (r.type === "composite" ? r.label = "" : r.label = r.id);
750
+ const n = U.get(r.id);
751
+ if (n === void 0 ? U.set(r.id, r) : (r.type !== "na" && (n.type = r.type), r.label !== r.id && (n.label = r.label)), r.children && Xt(r.children, r), r.type === "space") {
752
+ const l = r.width ?? 1;
753
+ for (let u = 0; u < l; u++) {
754
+ const h = Qe(r);
755
+ h.id = h.id + "-" + u, U.set(h.id, h), s.push(h);
756
+ }
757
+ } else n === void 0 && s.push(r);
758
+ }
759
+ }
760
+ t.children = s;
761
+ }, "populateBlockDatabase"), _t = [], et = { id: "root", type: "composite", children: [], columns: -1 }, or = /* @__PURE__ */ g(() => {
762
+ k.debug("Clear called"), Fe(), et = { id: "root", type: "composite", children: [], columns: -1 }, U = /* @__PURE__ */ new Map([["root", et]]), _t = [], ct = /* @__PURE__ */ new Map(), vt = [], wt = /* @__PURE__ */ new Map(), Et = "";
763
+ }, "clear");
764
+ function Vt(e) {
765
+ switch (k.debug("typeStr2Type", e), e) {
766
+ case "[]":
767
+ return "square";
768
+ case "()":
769
+ return k.debug("we have a round"), "round";
770
+ case "(())":
771
+ return "circle";
772
+ case ">]":
773
+ return "rect_left_inv_arrow";
774
+ case "{}":
775
+ return "diamond";
776
+ case "{{}}":
777
+ return "hexagon";
778
+ case "([])":
779
+ return "stadium";
780
+ case "[[]]":
781
+ return "subroutine";
782
+ case "[()]":
783
+ return "cylinder";
784
+ case "((()))":
785
+ return "doublecircle";
786
+ case "[//]":
787
+ return "lean_right";
788
+ case "[\\\\]":
789
+ return "lean_left";
790
+ case "[/\\]":
791
+ return "trapezoid";
792
+ case "[\\/]":
793
+ return "inv_trapezoid";
794
+ case "<[]>":
795
+ return "block_arrow";
796
+ default:
797
+ return "na";
798
+ }
799
+ }
800
+ g(Vt, "typeStr2Type");
801
+ function jt(e) {
802
+ switch (k.debug("typeStr2Type", e), e) {
803
+ case "==":
804
+ return "thick";
805
+ default:
806
+ return "normal";
807
+ }
808
+ }
809
+ g(jt, "edgeTypeStr2Type");
810
+ function Gt(e) {
811
+ switch (e.trim().slice(-1)) {
812
+ case "x":
813
+ return "arrow_cross";
814
+ case "o":
815
+ return "arrow_circle";
816
+ case ">":
817
+ return "arrow_point";
818
+ default:
819
+ return "";
820
+ }
821
+ }
822
+ g(Gt, "edgeStrToEdgeData");
823
+ function Zt(e) {
824
+ switch (e.trim().charAt(0)) {
825
+ case "x":
826
+ return "arrow_cross";
827
+ case "o":
828
+ return "arrow_circle";
829
+ case "<":
830
+ return "arrow_point";
831
+ default:
832
+ return "arrow_open";
833
+ }
834
+ }
835
+ g(Zt, "edgeStrToEdgeStartData");
836
+ function qt(e) {
837
+ return e.includes("==") ? "thick" : "normal";
838
+ }
839
+ g(qt, "edgeStrToThickness");
840
+ function Jt(e) {
841
+ return e.includes(".-") ? "dotted" : "solid";
842
+ }
843
+ g(Jt, "edgeStrToPattern");
844
+ var zt = 0, hr = /* @__PURE__ */ g(() => (zt++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + zt), "generateId"), gr = /* @__PURE__ */ g((e) => {
845
+ et.children = e, Xt(e, et), _t = et.children;
846
+ }, "setHierarchy"), ur = /* @__PURE__ */ g((e) => {
847
+ const t = U.get(e);
848
+ return t ? t.columns ? t.columns : t.children ? t.children.length : -1 : -1;
849
+ }, "getColumns"), dr = /* @__PURE__ */ g(() => [...U.values()], "getBlocksFlat"), pr = /* @__PURE__ */ g(() => _t || [], "getBlocks"), fr = /* @__PURE__ */ g(() => vt, "getEdges"), xr = /* @__PURE__ */ g((e) => U.get(e), "getBlock"), yr = /* @__PURE__ */ g((e) => {
850
+ U.set(e.id, e);
851
+ }, "setBlock"), br = /* @__PURE__ */ g((e) => {
852
+ Et = e;
853
+ }, "setDiagramId"), wr = /* @__PURE__ */ g(() => Et, "getDiagramId"), mr = /* @__PURE__ */ g(() => k, "getLogger"), Sr = /* @__PURE__ */ g(function() {
854
+ return ct;
855
+ }, "getClasses"), Lr = {
856
+ getConfig: /* @__PURE__ */ g(() => rt().block, "getConfig"),
857
+ typeStr2Type: Vt,
858
+ edgeTypeStr2Type: jt,
859
+ edgeStrToEdgeData: Gt,
860
+ edgeStrToEdgeStartData: Zt,
861
+ edgeStrToThickness: qt,
862
+ edgeStrToPattern: Jt,
863
+ getLogger: mr,
864
+ getBlocksFlat: dr,
865
+ getBlocks: pr,
866
+ getEdges: fr,
867
+ setHierarchy: gr,
868
+ getBlock: xr,
869
+ setBlock: yr,
870
+ getColumns: ur,
871
+ getClasses: Sr,
872
+ clear: or,
873
+ generateId: hr,
874
+ setDiagramId: br,
875
+ getDiagramId: wr
876
+ }, kr = Lr, yt = /* @__PURE__ */ g((e, t) => {
877
+ const a = Ze, s = a(e, "r"), i = a(e, "g"), c = a(e, "b");
878
+ return We(s, i, c, t);
879
+ }, "fade"), vr = /* @__PURE__ */ g((e) => `.label {
880
+ font-family: ${e.fontFamily};
881
+ color: ${e.nodeTextColor || e.textColor};
882
+ }
883
+ .cluster-label text {
884
+ fill: ${e.titleColor};
885
+ }
886
+ .cluster-label span,p {
887
+ color: ${e.titleColor};
888
+ }
889
+
890
+
891
+
892
+ .label text,span,p {
893
+ fill: ${e.nodeTextColor || e.textColor};
894
+ color: ${e.nodeTextColor || e.textColor};
895
+ }
896
+
897
+ .node rect,
898
+ .node circle,
899
+ .node ellipse,
900
+ .node polygon,
901
+ .node path {
902
+ fill: ${e.mainBkg};
903
+ stroke: ${e.nodeBorder};
904
+ stroke-width: 1px;
905
+ }
906
+ .flowchart-label text {
907
+ text-anchor: middle;
908
+ }
909
+ // .flowchart-label .text-outer-tspan {
910
+ // text-anchor: middle;
911
+ // }
912
+ // .flowchart-label .text-inner-tspan {
913
+ // text-anchor: start;
914
+ // }
915
+
916
+ .node .label {
917
+ text-align: center;
918
+ }
919
+ .node.clickable {
920
+ cursor: pointer;
921
+ }
922
+
923
+ .arrowheadPath {
924
+ fill: ${e.arrowheadColor};
925
+ }
926
+
927
+ .edgePath .path {
928
+ stroke: ${e.lineColor};
929
+ stroke-width: 2.0px;
930
+ }
931
+
932
+ .flowchart-link {
933
+ stroke: ${e.lineColor};
934
+ fill: none;
935
+ }
936
+
937
+ .edgeLabel {
938
+ background-color: ${e.edgeLabelBackground};
939
+ /*
940
+ * This is for backward compatibility with existing code that didn't
941
+ * add a \`<p>\` around edge labels.
942
+ *
943
+ * TODO: We should probably remove this in a future release.
944
+ */
945
+ p {
946
+ margin: 0;
947
+ padding: 0;
948
+ display: inline;
949
+ }
950
+ rect {
951
+ opacity: 0.5;
952
+ background-color: ${e.edgeLabelBackground};
953
+ fill: ${e.edgeLabelBackground};
954
+ }
955
+ text-align: center;
956
+ }
957
+
958
+ /* For html labels only */
959
+ .labelBkg {
960
+ background-color: ${e.edgeLabelBackground};
961
+ }
962
+
963
+ .node .cluster {
964
+ // fill: ${yt(e.mainBkg, 0.5)};
965
+ fill: ${yt(e.clusterBkg, 0.5)};
966
+ stroke: ${yt(e.clusterBorder, 0.2)};
967
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
968
+ stroke-width: 1px;
969
+ }
970
+
971
+ .cluster text {
972
+ fill: ${e.titleColor};
973
+ }
974
+
975
+ .cluster span,p {
976
+ color: ${e.titleColor};
977
+ }
978
+ /* .cluster div {
979
+ color: ${e.titleColor};
980
+ } */
981
+
982
+ div.mermaidTooltip {
983
+ position: absolute;
984
+ text-align: center;
985
+ max-width: 200px;
986
+ padding: 2px;
987
+ font-family: ${e.fontFamily};
988
+ font-size: 12px;
989
+ background: ${e.tertiaryColor};
990
+ border: 1px solid ${e.border2};
991
+ border-radius: 2px;
992
+ pointer-events: none;
993
+ z-index: 100;
994
+ }
995
+
996
+ .flowchartTitleText {
997
+ text-anchor: middle;
998
+ font-size: 18px;
999
+ fill: ${e.textColor};
1000
+ }
1001
+ ${de()}
1002
+ `, "getStyles"), Er = vr, _r = /* @__PURE__ */ g((e, t, a, s) => {
1003
+ t.forEach((i) => {
1004
+ zr[i](e, a, s);
1005
+ });
1006
+ }, "insertMarkers"), Tr = /* @__PURE__ */ g((e, t, a) => {
1007
+ k.trace("Making markers for ", a), e.append("defs").append("marker").attr("id", a + "_" + t + "-extensionStart").attr("class", "marker extension " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-extensionEnd").attr("class", "marker extension " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
1008
+ }, "extension"), Dr = /* @__PURE__ */ g((e, t, a) => {
1009
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-compositionStart").attr("class", "marker composition " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-compositionEnd").attr("class", "marker composition " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
1010
+ }, "composition"), Br = /* @__PURE__ */ g((e, t, a) => {
1011
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-aggregationStart").attr("class", "marker aggregation " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-aggregationEnd").attr("class", "marker aggregation " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
1012
+ }, "aggregation"), Nr = /* @__PURE__ */ g((e, t, a) => {
1013
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-dependencyStart").attr("class", "marker dependency " + t).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-dependencyEnd").attr("class", "marker dependency " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
1014
+ }, "dependency"), Ir = /* @__PURE__ */ g((e, t, a) => {
1015
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-lollipopStart").attr("class", "marker lollipop " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6), e.append("defs").append("marker").attr("id", a + "_" + t + "-lollipopEnd").attr("class", "marker lollipop " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
1016
+ }, "lollipop"), Cr = /* @__PURE__ */ g((e, t, a) => {
1017
+ e.append("marker").attr("id", a + "_" + t + "-pointEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 6).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-pointStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
1018
+ }, "point"), Or = /* @__PURE__ */ g((e, t, a) => {
1019
+ e.append("marker").attr("id", a + "_" + t + "-circleEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-circleStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
1020
+ }, "circle"), Rr = /* @__PURE__ */ g((e, t, a) => {
1021
+ e.append("marker").attr("id", a + "_" + t + "-crossEnd").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-crossStart").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
1022
+ }, "cross"), Ar = /* @__PURE__ */ g((e, t, a) => {
1023
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
1024
+ }, "barb"), zr = {
1025
+ extension: Tr,
1026
+ composition: Dr,
1027
+ aggregation: Br,
1028
+ dependency: Nr,
1029
+ lollipop: Ir,
1030
+ point: Cr,
1031
+ circle: Or,
1032
+ cross: Rr,
1033
+ barb: Ar
1034
+ }, Mr = _r;
1035
+ function mt(e, t) {
1036
+ if (e === 0 || !Number.isInteger(e))
1037
+ throw new Error("Columns must be an integer !== 0.");
1038
+ if (t < 0 || !Number.isInteger(t))
1039
+ throw new Error("Position must be a non-negative integer." + t);
1040
+ if (e < 0)
1041
+ return { px: t, py: 0 };
1042
+ if (e === 1)
1043
+ return { px: 0, py: t };
1044
+ const a = t % e, s = Math.floor(t / e);
1045
+ return { px: a, py: s };
1046
+ }
1047
+ g(mt, "calculateBlockPosition");
1048
+ var Pr = /* @__PURE__ */ g((e) => {
1049
+ let t = 0, a = 0;
1050
+ for (const s of e.children) {
1051
+ const { width: i, height: c, x: r, y: n } = s.size ?? { width: 0, height: 0, x: 0, y: 0 };
1052
+ if (k.debug(
1053
+ "getMaxChildSize abc95 child:",
1054
+ s.id,
1055
+ "width:",
1056
+ i,
1057
+ "height:",
1058
+ c,
1059
+ "x:",
1060
+ r,
1061
+ "y:",
1062
+ n,
1063
+ s.type
1064
+ ), s.type === "space")
1065
+ continue;
1066
+ const l = i / (s.widthInColumns ?? 1);
1067
+ l > t && (t = l), c > a && (a = c);
1068
+ }
1069
+ return { width: t, height: a };
1070
+ }, "getMaxChildSize");
1071
+ function lt(e, t, a = 0, s = 0, i = 8) {
1072
+ k.debug(
1073
+ "setBlockSizes abc95 (start)",
1074
+ e.id,
1075
+ e?.size?.x,
1076
+ "block width =",
1077
+ e?.size,
1078
+ "siblingWidth",
1079
+ a
1080
+ ), e?.size?.width || (e.size = {
1081
+ width: a,
1082
+ height: s,
1083
+ x: 0,
1084
+ y: 0
1085
+ });
1086
+ let c = 0, r = 0;
1087
+ if (e.children?.length > 0) {
1088
+ for (const y of e.children)
1089
+ lt(y, t, 0, 0, i);
1090
+ const n = Pr(e);
1091
+ c = n.width, r = n.height, k.debug("setBlockSizes abc95 maxWidth of", e.id, ":s children is ", c, r);
1092
+ for (const y of e.children)
1093
+ y.size && (k.debug(
1094
+ `abc95 Setting size of children of ${e.id} id=${y.id} ${c} ${r} ${JSON.stringify(y.size)}`
1095
+ ), y.size.width = c * (y.widthInColumns ?? 1) + i * ((y.widthInColumns ?? 1) - 1), y.size.height = r, y.size.x = 0, y.size.y = 0, k.debug(
1096
+ `abc95 updating size of ${e.id} children child:${y.id} maxWidth:${c} maxHeight:${r}`
1097
+ ));
1098
+ for (const y of e.children)
1099
+ lt(y, t, c, r, i);
1100
+ const l = e.columns ?? -1;
1101
+ let u = 0;
1102
+ for (const y of e.children)
1103
+ u += y.widthInColumns ?? 1;
1104
+ let h = e.children.length;
1105
+ l > 0 && l < u && (h = l);
1106
+ const d = Math.ceil(u / h);
1107
+ let b = h * (c + i) + i, w = d * (r + i) + i;
1108
+ if (b < a) {
1109
+ k.debug(
1110
+ `Detected to small sibling: abc95 ${e.id} siblingWidth ${a} siblingHeight ${s} width ${b}`
1111
+ ), b = a, w = s;
1112
+ const y = (a - h * i - i) / h, v = (s - d * i - i) / d;
1113
+ k.debug("Size indata abc88", e.id, "childWidth", y, "maxWidth", c), k.debug("Size indata abc88", e.id, "childHeight", v, "maxHeight", r), k.debug("Size indata abc88 xSize", h, "padding", i);
1114
+ for (const S of e.children)
1115
+ S.size && (S.size.width = y, S.size.height = v, S.size.x = 0, S.size.y = 0);
1116
+ }
1117
+ if (k.debug(
1118
+ `abc95 (finale calc) ${e.id} xSize ${h} ySize ${d} columns ${l}${e.children.length} width=${Math.max(b, e.size?.width || 0)}`
1119
+ ), b < (e?.size?.width || 0)) {
1120
+ b = e?.size?.width || 0;
1121
+ const y = l > 0 ? Math.min(e.children.length, l) : e.children.length;
1122
+ if (y > 0) {
1123
+ const v = (b - y * i - i) / y;
1124
+ k.debug("abc95 (growing to fit) width", e.id, b, e.size?.width, v);
1125
+ for (const S of e.children)
1126
+ S.size && (S.size.width = v);
1127
+ }
1128
+ }
1129
+ e.size = {
1130
+ width: b,
1131
+ height: w,
1132
+ x: 0,
1133
+ y: 0
1134
+ };
1135
+ }
1136
+ k.debug(
1137
+ "setBlockSizes abc94 (done)",
1138
+ e.id,
1139
+ e?.size?.x,
1140
+ e?.size?.width,
1141
+ e?.size?.y,
1142
+ e?.size?.height
1143
+ );
1144
+ }
1145
+ g(lt, "setBlockSizes");
1146
+ function Tt(e, t, a = 8) {
1147
+ k.debug(
1148
+ `abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`
1149
+ );
1150
+ const s = e.columns ?? -1;
1151
+ if (k.debug("layoutBlocks columns abc95", e.id, "=>", s, e), e.children && // find max width of children
1152
+ e.children.length > 0) {
1153
+ const i = e?.children[0]?.size?.width ?? 0, c = e.children.length * i + (e.children.length - 1) * a;
1154
+ k.debug("widthOfChildren 88", c, "posX");
1155
+ const r = /* @__PURE__ */ new Map();
1156
+ {
1157
+ let d = 0;
1158
+ for (const b of e.children) {
1159
+ if (!b.size)
1160
+ continue;
1161
+ const { py: w } = mt(s, d), y = r.get(w) ?? 0;
1162
+ b.size.height > y && r.set(w, b.size.height);
1163
+ let v = b?.widthInColumns ?? 1;
1164
+ s > 0 && (v = Math.min(v, s - d % s)), d += v;
1165
+ }
1166
+ }
1167
+ const n = /* @__PURE__ */ new Map();
1168
+ {
1169
+ let d = 0;
1170
+ const b = [...r.keys()].sort((w, y) => w - y);
1171
+ for (const w of b)
1172
+ n.set(w, d), d += (r.get(w) ?? 0) + a;
1173
+ }
1174
+ let l = 0;
1175
+ k.debug("abc91 block?.size?.x", e.id, e?.size?.x);
1176
+ let u = e?.size?.x ? e?.size?.x + (-e?.size?.width / 2 || 0) : -a, h = 0;
1177
+ for (const d of e.children) {
1178
+ const b = e;
1179
+ if (!d.size)
1180
+ continue;
1181
+ const { width: w, height: y } = d.size, { px: v, py: S } = mt(s, l);
1182
+ if (S != h && (h = S, u = e?.size?.x ? e?.size?.x + (-e?.size?.width / 2 || 0) : -a, k.debug("New row in layout for block", e.id, " and child ", d.id, h)), k.debug(
1183
+ `abc89 layout blocks (child) id: ${d.id} Pos: ${l} (px, py) ${v},${S} (${b?.size?.x},${b?.size?.y}) parent: ${b.id} width: ${w}${a}`
1184
+ ), b.size) {
1185
+ const _ = w / 2;
1186
+ d.size.x = u + a + _, k.debug(
1187
+ `abc91 layout blocks (calc) px, pyid:${d.id} startingPos=X${u} new startingPosX${d.size.x} ${_} padding=${a} width=${w} halfWidth=${_} => x:${d.size.x} y:${d.size.y} ${d.widthInColumns} (width * (child?.w || 1)) / 2 ${w * (d?.widthInColumns ?? 1) / 2}`
1188
+ ), u = d.size.x + _;
1189
+ const T = n.get(S) ?? 0, m = r.get(S) ?? y;
1190
+ d.size.y = b.size.y - b.size.height / 2 + T + m / 2 + a, k.debug(
1191
+ `abc88 layout blocks (calc) px, pyid:${d.id}startingPosX${u}${a}${_}=>x:${d.size.x}y:${d.size.y}${d.widthInColumns}(width * (child?.w || 1)) / 2${w * (d?.widthInColumns ?? 1) / 2}`
1192
+ );
1193
+ }
1194
+ d.children && Tt(d, t, a);
1195
+ let N = d?.widthInColumns ?? 1;
1196
+ s > 0 && (N = Math.min(N, s - l % s)), l += N, k.debug("abc88 columnsPos", d, l);
1197
+ }
1198
+ }
1199
+ k.debug(
1200
+ `layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`
1201
+ );
1202
+ }
1203
+ g(Tt, "layoutBlocks");
1204
+ function Dt(e, { minX: t, minY: a, maxX: s, maxY: i } = { minX: 0, minY: 0, maxX: 0, maxY: 0 }) {
1205
+ if (e.size && e.id !== "root") {
1206
+ const { x: c, y: r, width: n, height: l } = e.size;
1207
+ c - n / 2 < t && (t = c - n / 2), r - l / 2 < a && (a = r - l / 2), c + n / 2 > s && (s = c + n / 2), r + l / 2 > i && (i = r + l / 2);
1208
+ }
1209
+ if (e.children)
1210
+ for (const c of e.children)
1211
+ ({ minX: t, minY: a, maxX: s, maxY: i } = Dt(c, { minX: t, minY: a, maxX: s, maxY: i }));
1212
+ return { minX: t, minY: a, maxX: s, maxY: i };
1213
+ }
1214
+ g(Dt, "findBounds");
1215
+ function Qt(e) {
1216
+ const t = e.getBlock("root");
1217
+ if (!t)
1218
+ return;
1219
+ const a = R()?.block?.padding ?? 8;
1220
+ lt(t, e, 0, 0, a), Tt(t, e, a), k.debug("getBlocks", JSON.stringify(t, null, 2));
1221
+ const { minX: s, minY: i, maxX: c, maxY: r } = Dt(t), n = r - i, l = c - s;
1222
+ return { x: s, y: i, width: l, height: n };
1223
+ }
1224
+ g(Qt, "layout");
1225
+ var Fr = /* @__PURE__ */ g(async (e, t, a, s = !1, i = !1) => {
1226
+ let c = t || "";
1227
+ typeof c == "object" && (c = c[0]);
1228
+ const r = R(), n = M(r);
1229
+ return await kt(
1230
+ e,
1231
+ c,
1232
+ {
1233
+ style: a,
1234
+ isTitle: s,
1235
+ useHtmlLabels: n,
1236
+ markdown: !1,
1237
+ isNode: i,
1238
+ width: Number.POSITIVE_INFINITY
1239
+ },
1240
+ r
1241
+ );
1242
+ }, "createLabel"), K = Fr, Wr = /* @__PURE__ */ g((e, t, a, s, i) => {
1243
+ t.arrowTypeStart && Mt(e, "start", t.arrowTypeStart, a, s, i), t.arrowTypeEnd && Mt(e, "end", t.arrowTypeEnd, a, s, i);
1244
+ }, "addEdgeMarkers"), Yr = {
1245
+ arrow_cross: "cross",
1246
+ arrow_point: "point",
1247
+ arrow_barb: "barb",
1248
+ arrow_circle: "circle",
1249
+ aggregation: "aggregation",
1250
+ extension: "extension",
1251
+ composition: "composition",
1252
+ dependency: "dependency",
1253
+ lollipop: "lollipop"
1254
+ }, Mt = /* @__PURE__ */ g((e, t, a, s, i, c) => {
1255
+ const r = Yr[a];
1256
+ if (!r) {
1257
+ k.warn(`Unknown arrow type: ${a}`);
1258
+ return;
1259
+ }
1260
+ const n = t === "start" ? "Start" : "End";
1261
+ e.attr(`marker-${t}`, `url(${s}#${i}_${c}-${r}${n})`);
1262
+ }, "addEdgeMarker"), St = {}, z = {}, Hr = /* @__PURE__ */ g(async (e, t) => {
1263
+ const a = R(), s = M(a), i = e.insert("g").attr("class", "edgeLabel"), c = i.insert("g").attr("class", "label"), r = t.labelType === "markdown", n = await kt(
1264
+ e,
1265
+ t.label,
1266
+ {
1267
+ style: t.labelStyle,
1268
+ useHtmlLabels: s,
1269
+ // TODO: The old code only set addSvgBackground when using markdown, but
1270
+ // this function is only used by block diagrams which never use markdown.
1271
+ addSvgBackground: r,
1272
+ isNode: !1,
1273
+ markdown: r,
1274
+ // If using markdown, wrap using default width
1275
+ width: r ? void 0 : Number.POSITIVE_INFINITY
1276
+ },
1277
+ a
1278
+ );
1279
+ c.node().appendChild(n);
1280
+ let l = n.getBBox(), u = l;
1281
+ if (s) {
1282
+ const d = n.children[0], b = D(n);
1283
+ l = d.getBoundingClientRect(), u = l, b.attr("width", l.width), b.attr("height", l.height);
1284
+ } else {
1285
+ const d = D(n).select("text").node();
1286
+ d && typeof d.getBBox == "function" && (u = d.getBBox());
1287
+ }
1288
+ c.attr("transform", Q(u, s)), St[t.id] = i, t.width = l.width, t.height = l.height;
1289
+ let h;
1290
+ if (t.startLabelLeft) {
1291
+ const d = e.insert("g").attr("class", "edgeTerminals"), b = d.insert("g").attr("class", "inner"), w = await K(b, t.startLabelLeft, t.labelStyle);
1292
+ h = w;
1293
+ let y = w.getBBox();
1294
+ if (s) {
1295
+ const v = w.children[0], S = D(w);
1296
+ y = v.getBoundingClientRect(), S.attr("width", y.width), S.attr("height", y.height);
1297
+ }
1298
+ b.attr("transform", Q(y, s)), z[t.id] || (z[t.id] = {}), z[t.id].startLeft = d, tt(h, t.startLabelLeft);
1299
+ }
1300
+ if (t.startLabelRight) {
1301
+ const d = e.insert("g").attr("class", "edgeTerminals"), b = d.insert("g").attr("class", "inner"), w = await K(b, t.startLabelRight, t.labelStyle);
1302
+ h = w;
1303
+ let y = w.getBBox();
1304
+ if (s) {
1305
+ const v = w.children[0], S = D(w);
1306
+ y = v.getBoundingClientRect(), S.attr("width", y.width), S.attr("height", y.height);
1307
+ }
1308
+ b.attr("transform", Q(y, s)), z[t.id] || (z[t.id] = {}), z[t.id].startRight = d, tt(h, t.startLabelRight);
1309
+ }
1310
+ if (t.endLabelLeft) {
1311
+ const d = e.insert("g").attr("class", "edgeTerminals"), b = d.insert("g").attr("class", "inner"), w = await K(d, t.endLabelLeft, t.labelStyle);
1312
+ h = w;
1313
+ let y = w.getBBox();
1314
+ if (s) {
1315
+ const v = w.children[0], S = D(w);
1316
+ y = v.getBoundingClientRect(), S.attr("width", y.width), S.attr("height", y.height);
1317
+ }
1318
+ b.attr("transform", Q(y, s)), z[t.id] || (z[t.id] = {}), z[t.id].endLeft = d, tt(h, t.endLabelLeft);
1319
+ }
1320
+ if (t.endLabelRight) {
1321
+ const d = e.insert("g").attr("class", "edgeTerminals"), b = d.insert("g").attr("class", "inner"), w = await K(
1322
+ d,
1323
+ t.endLabelRight,
1324
+ t.labelStyle
1325
+ );
1326
+ h = w;
1327
+ let y = w.getBBox();
1328
+ if (s) {
1329
+ const v = w.children[0], S = D(w);
1330
+ y = v.getBoundingClientRect(), S.attr("width", y.width), S.attr("height", y.height);
1331
+ }
1332
+ b.attr("transform", Q(y, s)), z[t.id] || (z[t.id] = {}), z[t.id].endRight = d, tt(h, t.endLabelRight);
1333
+ }
1334
+ return n;
1335
+ }, "insertEdgeLabel");
1336
+ function tt(e, t) {
1337
+ M(R()) && e && (e.style.width = t.length * 9 + "px", e.style.height = "12px");
1338
+ }
1339
+ g(tt, "setTerminalWidth");
1340
+ var Kr = /* @__PURE__ */ g((e, t) => {
1341
+ k.debug("Moving label abc88 ", e.id, e.label, St[e.id], t);
1342
+ let a = t.updatedPath ? t.updatedPath : t.originalPath;
1343
+ const s = R(), { subGraphTitleTotalMargin: i } = Ue(s);
1344
+ if (e.label) {
1345
+ const c = St[e.id];
1346
+ let r = e.x, n = e.y;
1347
+ if (a) {
1348
+ const l = $.calcLabelPosition(a);
1349
+ k.debug(
1350
+ "Moving label " + e.label + " from (",
1351
+ r,
1352
+ ",",
1353
+ n,
1354
+ ") to (",
1355
+ l.x,
1356
+ ",",
1357
+ l.y,
1358
+ ") abc88"
1359
+ ), t.updatedPath && (r = l.x, n = l.y);
1360
+ }
1361
+ c.attr("transform", `translate(${r}, ${n + i / 2})`);
1362
+ }
1363
+ if (e.startLabelLeft) {
1364
+ const c = z[e.id].startLeft;
1365
+ let r = e.x, n = e.y;
1366
+ if (a) {
1367
+ const l = $.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_left", a);
1368
+ r = l.x, n = l.y;
1369
+ }
1370
+ c.attr("transform", `translate(${r}, ${n})`);
1371
+ }
1372
+ if (e.startLabelRight) {
1373
+ const c = z[e.id].startRight;
1374
+ let r = e.x, n = e.y;
1375
+ if (a) {
1376
+ const l = $.calcTerminalLabelPosition(
1377
+ e.arrowTypeStart ? 10 : 0,
1378
+ "start_right",
1379
+ a
1380
+ );
1381
+ r = l.x, n = l.y;
1382
+ }
1383
+ c.attr("transform", `translate(${r}, ${n})`);
1384
+ }
1385
+ if (e.endLabelLeft) {
1386
+ const c = z[e.id].endLeft;
1387
+ let r = e.x, n = e.y;
1388
+ if (a) {
1389
+ const l = $.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_left", a);
1390
+ r = l.x, n = l.y;
1391
+ }
1392
+ c.attr("transform", `translate(${r}, ${n})`);
1393
+ }
1394
+ if (e.endLabelRight) {
1395
+ const c = z[e.id].endRight;
1396
+ let r = e.x, n = e.y;
1397
+ if (a) {
1398
+ const l = $.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_right", a);
1399
+ r = l.x, n = l.y;
1400
+ }
1401
+ c.attr("transform", `translate(${r}, ${n})`);
1402
+ }
1403
+ }, "positionEdgeLabel"), Ur = /* @__PURE__ */ g((e, t) => {
1404
+ const a = e.x, s = e.y, i = Math.abs(t.x - a), c = Math.abs(t.y - s), r = e.width / 2, n = e.height / 2;
1405
+ return i >= r || c >= n;
1406
+ }, "outsideNode"), Xr = /* @__PURE__ */ g((e, t, a) => {
1407
+ k.debug(`intersection calc abc89:
1408
+ outsidePoint: ${JSON.stringify(t)}
1409
+ insidePoint : ${JSON.stringify(a)}
1410
+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);
1411
+ const s = e.x, i = e.y, c = Math.abs(s - a.x), r = e.width / 2;
1412
+ let n = a.x < t.x ? r - c : r + c;
1413
+ const l = e.height / 2, u = Math.abs(t.y - a.y), h = Math.abs(t.x - a.x);
1414
+ if (Math.abs(i - t.y) * r > Math.abs(s - t.x) * l) {
1415
+ let d = a.y < t.y ? t.y - l - i : i - l - t.y;
1416
+ n = h * d / u;
1417
+ const b = {
1418
+ x: a.x < t.x ? a.x + n : a.x - h + n,
1419
+ y: a.y < t.y ? a.y + u - d : a.y - u + d
1420
+ };
1421
+ return n === 0 && (b.x = t.x, b.y = t.y), h === 0 && (b.x = t.x), u === 0 && (b.y = t.y), k.debug(`abc89 topp/bott calc, Q ${u}, q ${d}, R ${h}, r ${n}`, b), b;
1422
+ } else {
1423
+ a.x < t.x ? n = t.x - r - s : n = s - r - t.x;
1424
+ let d = u * n / h, b = a.x < t.x ? a.x + h - n : a.x - h + n, w = a.y < t.y ? a.y + d : a.y - d;
1425
+ return k.debug(`sides calc abc89, Q ${u}, q ${d}, R ${h}, r ${n}`, { _x: b, _y: w }), n === 0 && (b = t.x, w = t.y), h === 0 && (b = t.x), u === 0 && (w = t.y), { x: b, y: w };
1426
+ }
1427
+ }, "intersection"), Pt = /* @__PURE__ */ g((e, t) => {
1428
+ k.debug("abc88 cutPathAtIntersect", e, t);
1429
+ let a = [], s = e[0], i = !1;
1430
+ return e.forEach((c) => {
1431
+ if (!Ur(t, c) && !i) {
1432
+ const r = Xr(t, s, c);
1433
+ let n = !1;
1434
+ a.forEach((l) => {
1435
+ n = n || l.x === r.x && l.y === r.y;
1436
+ }), a.some((l) => l.x === r.x && l.y === r.y) || a.push(r), i = !0;
1437
+ } else
1438
+ s = c, i || a.push(c);
1439
+ }), a;
1440
+ }, "cutPathAtIntersect"), Vr = /* @__PURE__ */ g(function(e, t, a, s, i, c, r) {
1441
+ let n = a.points;
1442
+ k.debug("abc88 InsertEdge: edge=", a, "e=", t);
1443
+ let l = !1;
1444
+ const u = c.node(t.v);
1445
+ var h = c.node(t.w);
1446
+ h?.intersect && u?.intersect && (n = n.slice(1, a.points.length - 1), n.unshift(u.intersect(n[0])), n.push(h.intersect(n[n.length - 1]))), a.toCluster && (k.debug("to cluster abc88", s[a.toCluster]), n = Pt(a.points, s[a.toCluster].node), l = !0), a.fromCluster && (k.debug("from cluster abc88", s[a.fromCluster]), n = Pt(n.reverse(), s[a.fromCluster].node).reverse(), l = !0);
1447
+ const d = n.filter((m) => !Number.isNaN(m.y));
1448
+ let b = He;
1449
+ a.curve && (i === "graph" || i === "flowchart") && (b = a.curve);
1450
+ const { x: w, y } = Ye(a), v = qe().x(w).y(y).curve(b);
1451
+ let S;
1452
+ switch (a.thickness) {
1453
+ case "normal":
1454
+ S = "edge-thickness-normal";
1455
+ break;
1456
+ case "thick":
1457
+ S = "edge-thickness-thick";
1458
+ break;
1459
+ case "invisible":
1460
+ S = "edge-thickness-thick";
1461
+ break;
1462
+ default:
1463
+ S = "";
1464
+ }
1465
+ switch (a.pattern) {
1466
+ case "solid":
1467
+ S += " edge-pattern-solid";
1468
+ break;
1469
+ case "dotted":
1470
+ S += " edge-pattern-dotted";
1471
+ break;
1472
+ case "dashed":
1473
+ S += " edge-pattern-dashed";
1474
+ break;
1475
+ }
1476
+ const N = e.append("path").attr("d", v(d)).attr("id", a.id).attr("class", " " + S + (a.classes ? " " + a.classes : "")).attr("style", a.style);
1477
+ let _ = "";
1478
+ (R().flowchart.arrowMarkerAbsolute || R().state.arrowMarkerAbsolute) && (_ = Ke(!0)), Wr(N, a, _, r, i);
1479
+ let T = {};
1480
+ return l && (T.updatedPath = n), T.originalPath = a.points, T;
1481
+ }, "insertEdge"), jr = /* @__PURE__ */ g((e) => {
1482
+ const t = /* @__PURE__ */ new Set();
1483
+ for (const a of e)
1484
+ switch (a) {
1485
+ case "x":
1486
+ t.add("right"), t.add("left");
1487
+ break;
1488
+ case "y":
1489
+ t.add("up"), t.add("down");
1490
+ break;
1491
+ default:
1492
+ t.add(a);
1493
+ break;
1494
+ }
1495
+ return t;
1496
+ }, "expandAndDeduplicateDirections"), Gr = /* @__PURE__ */ g((e, t, a, s) => {
1497
+ const i = jr(e), c = 2, r = t.height + 2 * a.padding, n = r / c, l = s ?? t.width + 2 * n + a.padding, u = a.padding / 2;
1498
+ return i.has("right") && i.has("left") && i.has("up") && i.has("down") ? [
1499
+ // Bottom
1500
+ { x: 0, y: 0 },
1501
+ { x: n, y: 0 },
1502
+ { x: l / 2, y: 2 * u },
1503
+ { x: l - n, y: 0 },
1504
+ { x: l, y: 0 },
1505
+ // Right
1506
+ { x: l, y: -r / 3 },
1507
+ { x: l + 2 * u, y: -r / 2 },
1508
+ { x: l, y: -2 * r / 3 },
1509
+ { x: l, y: -r },
1510
+ // Top
1511
+ { x: l - n, y: -r },
1512
+ { x: l / 2, y: -r - 2 * u },
1513
+ { x: n, y: -r },
1514
+ // Left
1515
+ { x: 0, y: -r },
1516
+ { x: 0, y: -2 * r / 3 },
1517
+ { x: -2 * u, y: -r / 2 },
1518
+ { x: 0, y: -r / 3 }
1519
+ ] : i.has("right") && i.has("left") && i.has("up") ? [
1520
+ { x: n, y: 0 },
1521
+ { x: l - n, y: 0 },
1522
+ { x: l, y: -r / 2 },
1523
+ { x: l - n, y: -r },
1524
+ { x: n, y: -r },
1525
+ { x: 0, y: -r / 2 }
1526
+ ] : i.has("right") && i.has("left") && i.has("down") ? [
1527
+ { x: 0, y: 0 },
1528
+ { x: n, y: -r },
1529
+ { x: l - n, y: -r },
1530
+ { x: l, y: 0 }
1531
+ ] : i.has("right") && i.has("up") && i.has("down") ? [
1532
+ { x: 0, y: 0 },
1533
+ { x: l, y: -n },
1534
+ { x: l, y: -r + n },
1535
+ { x: 0, y: -r }
1536
+ ] : i.has("left") && i.has("up") && i.has("down") ? [
1537
+ { x: l, y: 0 },
1538
+ { x: 0, y: -n },
1539
+ { x: 0, y: -r + n },
1540
+ { x: l, y: -r }
1541
+ ] : i.has("right") && i.has("left") ? [
1542
+ { x: n, y: 0 },
1543
+ { x: n, y: -u },
1544
+ { x: l - n, y: -u },
1545
+ { x: l - n, y: 0 },
1546
+ { x: l, y: -r / 2 },
1547
+ { x: l - n, y: -r },
1548
+ { x: l - n, y: -r + u },
1549
+ { x: n, y: -r + u },
1550
+ { x: n, y: -r },
1551
+ { x: 0, y: -r / 2 }
1552
+ ] : i.has("up") && i.has("down") ? [
1553
+ // Bottom center
1554
+ { x: l / 2, y: 0 },
1555
+ // Left point of bottom arrow
1556
+ { x: 0, y: -u },
1557
+ { x: n, y: -u },
1558
+ // Left top over vertical section
1559
+ { x: n, y: -r + u },
1560
+ { x: 0, y: -r + u },
1561
+ // Top of arrow
1562
+ { x: l / 2, y: -r },
1563
+ { x: l, y: -r + u },
1564
+ // Top of right vertical bar
1565
+ { x: l - n, y: -r + u },
1566
+ { x: l - n, y: -u },
1567
+ { x: l, y: -u }
1568
+ ] : i.has("right") && i.has("up") ? [
1569
+ { x: 0, y: 0 },
1570
+ { x: l, y: -n },
1571
+ { x: 0, y: -r }
1572
+ ] : i.has("right") && i.has("down") ? [
1573
+ { x: 0, y: 0 },
1574
+ { x: l, y: 0 },
1575
+ { x: 0, y: -r }
1576
+ ] : i.has("left") && i.has("up") ? [
1577
+ { x: l, y: 0 },
1578
+ { x: 0, y: -n },
1579
+ { x: l, y: -r }
1580
+ ] : i.has("left") && i.has("down") ? [
1581
+ { x: l, y: 0 },
1582
+ { x: 0, y: 0 },
1583
+ { x: l, y: -r }
1584
+ ] : i.has("right") ? [
1585
+ { x: n, y: -u },
1586
+ { x: n, y: -u },
1587
+ { x: l - n, y: -u },
1588
+ { x: l - n, y: 0 },
1589
+ { x: l, y: -r / 2 },
1590
+ { x: l - n, y: -r },
1591
+ { x: l - n, y: -r + u },
1592
+ // top left corner of arrow
1593
+ { x: n, y: -r + u },
1594
+ { x: n, y: -r + u }
1595
+ ] : i.has("left") ? [
1596
+ { x: n, y: 0 },
1597
+ { x: n, y: -u },
1598
+ // Two points, the right corners
1599
+ { x: l - n, y: -u },
1600
+ { x: l - n, y: -r + u },
1601
+ { x: n, y: -r + u },
1602
+ { x: n, y: -r },
1603
+ { x: 0, y: -r / 2 }
1604
+ ] : i.has("up") ? [
1605
+ // Bottom center
1606
+ { x: n, y: -u },
1607
+ // Left top over vertical section
1608
+ { x: n, y: -r + u },
1609
+ { x: 0, y: -r + u },
1610
+ // Top of arrow
1611
+ { x: l / 2, y: -r },
1612
+ { x: l, y: -r + u },
1613
+ // Top of right vertical bar
1614
+ { x: l - n, y: -r + u },
1615
+ { x: l - n, y: -u }
1616
+ ] : i.has("down") ? [
1617
+ // Bottom center
1618
+ { x: l / 2, y: 0 },
1619
+ // Left point of bottom arrow
1620
+ { x: 0, y: -u },
1621
+ { x: n, y: -u },
1622
+ // Left top over vertical section
1623
+ { x: n, y: -r + u },
1624
+ { x: l - n, y: -r + u },
1625
+ { x: l - n, y: -u },
1626
+ { x: l, y: -u }
1627
+ ] : [{ x: 0, y: 0 }];
1628
+ }, "getArrowPoints");
1629
+ function $t(e, t) {
1630
+ return e.intersect(t);
1631
+ }
1632
+ g($t, "intersectNode");
1633
+ var Zr = $t;
1634
+ function te(e, t, a, s) {
1635
+ var i = e.x, c = e.y, r = i - s.x, n = c - s.y, l = Math.sqrt(t * t * n * n + a * a * r * r), u = Math.abs(t * a * r / l);
1636
+ s.x < i && (u = -u);
1637
+ var h = Math.abs(t * a * n / l);
1638
+ return s.y < c && (h = -h), { x: i + u, y: c + h };
1639
+ }
1640
+ g(te, "intersectEllipse");
1641
+ var ee = te;
1642
+ function re(e, t, a) {
1643
+ return ee(e, t, t, a);
1644
+ }
1645
+ g(re, "intersectCircle");
1646
+ var qr = re;
1647
+ function ae(e, t, a, s) {
1648
+ var i, c, r, n, l, u, h, d, b, w, y, v, S, N, _;
1649
+ if (i = t.y - e.y, r = e.x - t.x, l = t.x * e.y - e.x * t.y, b = i * a.x + r * a.y + l, w = i * s.x + r * s.y + l, !(b !== 0 && w !== 0 && Lt(b, w)) && (c = s.y - a.y, n = a.x - s.x, u = s.x * a.y - a.x * s.y, h = c * e.x + n * e.y + u, d = c * t.x + n * t.y + u, !(h !== 0 && d !== 0 && Lt(h, d)) && (y = i * n - c * r, y !== 0)))
1650
+ return v = Math.abs(y / 2), S = r * u - n * l, N = S < 0 ? (S - v) / y : (S + v) / y, S = c * l - i * u, _ = S < 0 ? (S - v) / y : (S + v) / y, { x: N, y: _ };
1651
+ }
1652
+ g(ae, "intersectLine");
1653
+ function Lt(e, t) {
1654
+ return e * t > 0;
1655
+ }
1656
+ g(Lt, "sameSign");
1657
+ var Jr = ae, Qr = se;
1658
+ function se(e, t, a) {
1659
+ var s = e.x, i = e.y, c = [], r = Number.POSITIVE_INFINITY, n = Number.POSITIVE_INFINITY;
1660
+ typeof t.forEach == "function" ? t.forEach(function(y) {
1661
+ r = Math.min(r, y.x), n = Math.min(n, y.y);
1662
+ }) : (r = Math.min(r, t.x), n = Math.min(n, t.y));
1663
+ for (var l = s - e.width / 2 - r, u = i - e.height / 2 - n, h = 0; h < t.length; h++) {
1664
+ var d = t[h], b = t[h < t.length - 1 ? h + 1 : 0], w = Jr(
1665
+ e,
1666
+ a,
1667
+ { x: l + d.x, y: u + d.y },
1668
+ { x: l + b.x, y: u + b.y }
1669
+ );
1670
+ w && c.push(w);
1671
+ }
1672
+ return c.length ? (c.length > 1 && c.sort(function(y, v) {
1673
+ var S = y.x - a.x, N = y.y - a.y, _ = Math.sqrt(S * S + N * N), T = v.x - a.x, m = v.y - a.y, p = Math.sqrt(T * T + m * m);
1674
+ return _ < p ? -1 : _ === p ? 0 : 1;
1675
+ }), c[0]) : e;
1676
+ }
1677
+ g(se, "intersectPolygon");
1678
+ var $r = /* @__PURE__ */ g((e, t) => {
1679
+ var a = e.x, s = e.y, i = t.x - a, c = t.y - s, r = e.width / 2, n = e.height / 2, l, u;
1680
+ return Math.abs(c) * r > Math.abs(i) * n ? (c < 0 && (n = -n), l = c === 0 ? 0 : n * i / c, u = n) : (i < 0 && (r = -r), l = r, u = i === 0 ? 0 : r * c / i), { x: a + l, y: s + u };
1681
+ }, "intersectRect"), ta = $r, B = {
1682
+ node: Zr,
1683
+ circle: qr,
1684
+ ellipse: ee,
1685
+ polygon: Qr,
1686
+ rect: ta
1687
+ }, A = /* @__PURE__ */ g(async (e, t, a, s) => {
1688
+ const i = R();
1689
+ let c;
1690
+ const r = t.useHtmlLabels || M(i);
1691
+ a ? c = a : c = "node default";
1692
+ const n = e.insert("g").attr("class", c).attr("id", t.domId || t.id), l = n.insert("g").attr("class", "label").attr("style", t.labelStyle);
1693
+ let u;
1694
+ t.labelText === void 0 ? u = "" : u = typeof t.labelText == "string" ? t.labelText : t.labelText[0];
1695
+ let h;
1696
+ t.labelType === "markdown" ? h = kt(
1697
+ l,
1698
+ Ct(Ot(u), i),
1699
+ {
1700
+ useHtmlLabels: r,
1701
+ width: t.width || i.flowchart.wrappingWidth,
1702
+ classes: "markdown-node-label"
1703
+ },
1704
+ i
1705
+ ) : h = await K(
1706
+ l,
1707
+ Ct(Ot(u), i),
1708
+ t.labelStyle,
1709
+ !1,
1710
+ s
1711
+ );
1712
+ let d = h.getBBox();
1713
+ const b = t.padding / 2;
1714
+ if (M(i)) {
1715
+ const w = h.children[0], y = D(h);
1716
+ await je(w, u), d = w.getBoundingClientRect(), y.attr("width", d.width), y.attr("height", d.height);
1717
+ }
1718
+ return r ? l.attr("transform", "translate(" + -d.width / 2 + ", " + -d.height / 2 + ")") : l.attr("transform", "translate(0, " + -d.height / 2 + ")"), t.centerLabel && l.attr("transform", "translate(" + -d.width / 2 + ", " + -d.height / 2 + ")"), l.insert("rect", ":first-child"), { shapeSvg: n, bbox: d, halfPadding: b, label: l };
1719
+ }, "labelHelper"), I = /* @__PURE__ */ g((e, t) => {
1720
+ const a = t.node().getBBox();
1721
+ e.width = a.width, e.height = a.height;
1722
+ }, "updateNodeBounds");
1723
+ function X(e, t, a, s) {
1724
+ return e.insert("polygon", ":first-child").attr(
1725
+ "points",
1726
+ s.map(function(i) {
1727
+ return i.x + "," + i.y;
1728
+ }).join(" ")
1729
+ ).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + a / 2 + ")");
1730
+ }
1731
+ g(X, "insertPolygonShape");
1732
+ var ea = /* @__PURE__ */ g(async (e, t) => {
1733
+ t.useHtmlLabels || M(R()) || (t.centerLabel = !0);
1734
+ const { shapeSvg: s, bbox: i, halfPadding: c } = await A(
1735
+ e,
1736
+ t,
1737
+ "node " + t.classes,
1738
+ !0
1739
+ );
1740
+ k.info("Classes = ", t.classes);
1741
+ const r = s.insert("rect", ":first-child");
1742
+ return r.attr("rx", t.rx).attr("ry", t.ry).attr("x", -i.width / 2 - c).attr("y", -i.height / 2 - c).attr("width", i.width + t.padding).attr("height", i.height + t.padding), I(t, r), t.intersect = function(n) {
1743
+ return B.rect(t, n);
1744
+ }, s;
1745
+ }, "note"), ra = ea, Ft = /* @__PURE__ */ g((e) => e ? " " + e : "", "formatClass"), Y = /* @__PURE__ */ g((e, t) => `${t || "node default"}${Ft(e.classes)} ${Ft(
1746
+ e.class
1747
+ )}`, "getClassesFromNode"), Wt = /* @__PURE__ */ g(async (e, t) => {
1748
+ const { shapeSvg: a, bbox: s } = await A(
1749
+ e,
1750
+ t,
1751
+ Y(t, void 0),
1752
+ !0
1753
+ ), i = s.width + t.padding, c = s.height + t.padding, r = i + c, n = [
1754
+ { x: r / 2, y: 0 },
1755
+ { x: r, y: -r / 2 },
1756
+ { x: r / 2, y: -r },
1757
+ { x: 0, y: -r / 2 }
1758
+ ];
1759
+ k.info("Question main (Circle)");
1760
+ const l = X(a, r, r, n);
1761
+ return l.attr("style", t.style), I(t, l), t.intersect = function(u) {
1762
+ return k.warn("Intersect called"), B.polygon(t, n, u);
1763
+ }, a;
1764
+ }, "question"), aa = /* @__PURE__ */ g((e, t) => {
1765
+ const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), s = 28, i = [
1766
+ { x: 0, y: s / 2 },
1767
+ { x: s / 2, y: 0 },
1768
+ { x: 0, y: -s / 2 },
1769
+ { x: -s / 2, y: 0 }
1770
+ ];
1771
+ return a.insert("polygon", ":first-child").attr(
1772
+ "points",
1773
+ i.map(function(r) {
1774
+ return r.x + "," + r.y;
1775
+ }).join(" ")
1776
+ ).attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28), t.width = 28, t.height = 28, t.intersect = function(r) {
1777
+ return B.circle(t, 14, r);
1778
+ }, a;
1779
+ }, "choice"), sa = /* @__PURE__ */ g(async (e, t) => {
1780
+ const { shapeSvg: a, bbox: s } = await A(
1781
+ e,
1782
+ t,
1783
+ Y(t, void 0),
1784
+ !0
1785
+ ), i = 4, c = t.positioned ? t.height : s.height + t.padding, r = c / i, n = t.positioned ? t.width : s.width + 2 * r + t.padding, l = [
1786
+ { x: r, y: 0 },
1787
+ { x: n - r, y: 0 },
1788
+ { x: n, y: -c / 2 },
1789
+ { x: n - r, y: -c },
1790
+ { x: r, y: -c },
1791
+ { x: 0, y: -c / 2 }
1792
+ ], u = X(a, n, c, l);
1793
+ return u.attr("style", t.style), I(t, u), t.intersect = function(h) {
1794
+ return B.polygon(t, l, h);
1795
+ }, a;
1796
+ }, "hexagon"), ia = /* @__PURE__ */ g(async (e, t) => {
1797
+ const { shapeSvg: a, bbox: s } = await A(e, t, void 0, !0), i = 2, c = s.height + 2 * t.padding, r = c / i, n = s.width + 2 * r + t.padding, u = t.positioned && (t.widthInColumns ?? 1) > 1 && t.width > n ? t.width : n, h = Gr(t.directions, s, t, u), d = X(a, u, c, h);
1798
+ return d.attr("style", t.style), I(t, d), t.intersect = function(b) {
1799
+ return B.polygon(t, h, b);
1800
+ }, a;
1801
+ }, "block_arrow"), na = /* @__PURE__ */ g(async (e, t) => {
1802
+ const { shapeSvg: a, bbox: s } = await A(
1803
+ e,
1804
+ t,
1805
+ Y(t, void 0),
1806
+ !0
1807
+ ), i = s.width + t.padding, c = s.height + t.padding, r = [
1808
+ { x: -c / 2, y: 0 },
1809
+ { x: i, y: 0 },
1810
+ { x: i, y: -c },
1811
+ { x: -c / 2, y: -c },
1812
+ { x: 0, y: -c / 2 }
1813
+ ];
1814
+ return X(a, i, c, r).attr("style", t.style), t.width = i + c, t.height = c, t.intersect = function(l) {
1815
+ return B.polygon(t, r, l);
1816
+ }, a;
1817
+ }, "rect_left_inv_arrow"), ca = /* @__PURE__ */ g(async (e, t) => {
1818
+ const { shapeSvg: a, bbox: s } = await A(e, t, Y(t), !0), i = s.width + t.padding, c = s.height + t.padding, r = [
1819
+ { x: -2 * c / 6, y: 0 },
1820
+ { x: i - c / 6, y: 0 },
1821
+ { x: i + 2 * c / 6, y: -c },
1822
+ { x: c / 6, y: -c }
1823
+ ], n = X(a, i, c, r);
1824
+ return n.attr("style", t.style), I(t, n), t.intersect = function(l) {
1825
+ return B.polygon(t, r, l);
1826
+ }, a;
1827
+ }, "lean_right"), la = /* @__PURE__ */ g(async (e, t) => {
1828
+ const { shapeSvg: a, bbox: s } = await A(
1829
+ e,
1830
+ t,
1831
+ Y(t, void 0),
1832
+ !0
1833
+ ), i = s.width + t.padding, c = s.height + t.padding, r = [
1834
+ { x: 2 * c / 6, y: 0 },
1835
+ { x: i + c / 6, y: 0 },
1836
+ { x: i - 2 * c / 6, y: -c },
1837
+ { x: -c / 6, y: -c }
1838
+ ], n = X(a, i, c, r);
1839
+ return n.attr("style", t.style), I(t, n), t.intersect = function(l) {
1840
+ return B.polygon(t, r, l);
1841
+ }, a;
1842
+ }, "lean_left"), oa = /* @__PURE__ */ g(async (e, t) => {
1843
+ const { shapeSvg: a, bbox: s } = await A(
1844
+ e,
1845
+ t,
1846
+ Y(t, void 0),
1847
+ !0
1848
+ ), i = s.width + t.padding, c = s.height + t.padding, r = [
1849
+ { x: -2 * c / 6, y: 0 },
1850
+ { x: i + 2 * c / 6, y: 0 },
1851
+ { x: i - c / 6, y: -c },
1852
+ { x: c / 6, y: -c }
1853
+ ], n = X(a, i, c, r);
1854
+ return n.attr("style", t.style), I(t, n), t.intersect = function(l) {
1855
+ return B.polygon(t, r, l);
1856
+ }, a;
1857
+ }, "trapezoid"), ha = /* @__PURE__ */ g(async (e, t) => {
1858
+ const { shapeSvg: a, bbox: s } = await A(
1859
+ e,
1860
+ t,
1861
+ Y(t, void 0),
1862
+ !0
1863
+ ), i = s.width + t.padding, c = s.height + t.padding, r = [
1864
+ { x: c / 6, y: 0 },
1865
+ { x: i - c / 6, y: 0 },
1866
+ { x: i + 2 * c / 6, y: -c },
1867
+ { x: -2 * c / 6, y: -c }
1868
+ ], n = X(a, i, c, r);
1869
+ return n.attr("style", t.style), I(t, n), t.intersect = function(l) {
1870
+ return B.polygon(t, r, l);
1871
+ }, a;
1872
+ }, "inv_trapezoid"), ga = /* @__PURE__ */ g(async (e, t) => {
1873
+ const { shapeSvg: a, bbox: s } = await A(
1874
+ e,
1875
+ t,
1876
+ Y(t, void 0),
1877
+ !0
1878
+ ), i = s.width + t.padding, c = s.height + t.padding, r = [
1879
+ { x: 0, y: 0 },
1880
+ { x: i + c / 2, y: 0 },
1881
+ { x: i, y: -c / 2 },
1882
+ { x: i + c / 2, y: -c },
1883
+ { x: 0, y: -c }
1884
+ ], n = X(a, i, c, r);
1885
+ return n.attr("style", t.style), I(t, n), t.intersect = function(l) {
1886
+ return B.polygon(t, r, l);
1887
+ }, a;
1888
+ }, "rect_right_inv_arrow"), ua = /* @__PURE__ */ g(async (e, t) => {
1889
+ const { shapeSvg: a, bbox: s } = await A(
1890
+ e,
1891
+ t,
1892
+ Y(t, void 0),
1893
+ !0
1894
+ ), i = s.width + t.padding, c = i / 2, r = c / (2.5 + i / 50), n = s.height + r + t.padding, l = "M 0," + r + " a " + c + "," + r + " 0,0,0 " + i + " 0 a " + c + "," + r + " 0,0,0 " + -i + " 0 l 0," + n + " a " + c + "," + r + " 0,0,0 " + i + " 0 l 0," + -n, u = a.attr("label-offset-y", r).insert("path", ":first-child").attr("style", t.style).attr("d", l).attr("transform", "translate(" + -i / 2 + "," + -(n / 2 + r) + ")");
1895
+ return I(t, u), t.intersect = function(h) {
1896
+ const d = B.rect(t, h), b = d.x - t.x;
1897
+ if (c != 0 && (Math.abs(b) < t.width / 2 || Math.abs(b) == t.width / 2 && Math.abs(d.y - t.y) > t.height / 2 - r)) {
1898
+ let w = r * r * (1 - b * b / (c * c));
1899
+ w != 0 && (w = Math.sqrt(w)), w = r - w, h.y - t.y > 0 && (w = -w), d.y += w;
1900
+ }
1901
+ return d;
1902
+ }, a;
1903
+ }, "cylinder"), da = /* @__PURE__ */ g(async (e, t) => {
1904
+ const { shapeSvg: a, bbox: s, halfPadding: i } = await A(
1905
+ e,
1906
+ t,
1907
+ "node " + t.classes + " " + t.class,
1908
+ !0
1909
+ ), c = a.insert("rect", ":first-child"), r = t.positioned ? t.width : s.width + t.padding, n = t.positioned ? t.height : s.height + t.padding, l = t.positioned ? -r / 2 : -s.width / 2 - i, u = t.positioned ? -n / 2 : -s.height / 2 - i;
1910
+ if (c.attr("class", "basic label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", l).attr("y", u).attr("width", r).attr("height", n), t.props) {
1911
+ const h = new Set(Object.keys(t.props));
1912
+ t.props.borders && (ot(c, t.props.borders, r, n), h.delete("borders")), h.forEach((d) => {
1913
+ k.warn(`Unknown node property ${d}`);
1914
+ });
1915
+ }
1916
+ return I(t, c), t.intersect = function(h) {
1917
+ return B.rect(t, h);
1918
+ }, a;
1919
+ }, "rect"), pa = /* @__PURE__ */ g(async (e, t) => {
1920
+ const { shapeSvg: a, bbox: s, halfPadding: i } = await A(
1921
+ e,
1922
+ t,
1923
+ "node " + t.classes,
1924
+ !0
1925
+ ), c = a.insert("rect", ":first-child"), r = t.positioned ? t.width : s.width + t.padding, n = t.positioned ? t.height : s.height + t.padding, l = t.positioned ? -r / 2 : -s.width / 2 - i, u = t.positioned ? -n / 2 : -s.height / 2 - i;
1926
+ if (c.attr("class", "basic cluster composite label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", l).attr("y", u).attr("width", r).attr("height", n), t.props) {
1927
+ const h = new Set(Object.keys(t.props));
1928
+ t.props.borders && (ot(c, t.props.borders, r, n), h.delete("borders")), h.forEach((d) => {
1929
+ k.warn(`Unknown node property ${d}`);
1930
+ });
1931
+ }
1932
+ return I(t, c), t.intersect = function(h) {
1933
+ return B.rect(t, h);
1934
+ }, a;
1935
+ }, "composite"), fa = /* @__PURE__ */ g(async (e, t) => {
1936
+ const { shapeSvg: a } = await A(e, t, "label", !0);
1937
+ k.trace("Classes = ", t.class);
1938
+ const s = a.insert("rect", ":first-child"), i = 0, c = 0;
1939
+ if (s.attr("width", i).attr("height", c), a.attr("class", "label edgeLabel"), t.props) {
1940
+ const r = new Set(Object.keys(t.props));
1941
+ t.props.borders && (ot(s, t.props.borders, i, c), r.delete("borders")), r.forEach((n) => {
1942
+ k.warn(`Unknown node property ${n}`);
1943
+ });
1944
+ }
1945
+ return I(t, s), t.intersect = function(r) {
1946
+ return B.rect(t, r);
1947
+ }, a;
1948
+ }, "labelRect");
1949
+ function ot(e, t, a, s) {
1950
+ const i = [], c = /* @__PURE__ */ g((n) => {
1951
+ i.push(n, 0);
1952
+ }, "addBorder"), r = /* @__PURE__ */ g((n) => {
1953
+ i.push(0, n);
1954
+ }, "skipBorder");
1955
+ t.includes("t") ? (k.debug("add top border"), c(a)) : r(a), t.includes("r") ? (k.debug("add right border"), c(s)) : r(s), t.includes("b") ? (k.debug("add bottom border"), c(a)) : r(a), t.includes("l") ? (k.debug("add left border"), c(s)) : r(s), e.attr("stroke-dasharray", i.join(" "));
1956
+ }
1957
+ g(ot, "applyNodePropertyBorders");
1958
+ var xa = /* @__PURE__ */ g(async (e, t) => {
1959
+ let a;
1960
+ t.classes ? a = "node " + t.classes : a = "node default";
1961
+ const s = e.insert("g").attr("class", a).attr("id", t.domId || t.id), i = s.insert("rect", ":first-child"), c = s.insert("line"), r = s.insert("g").attr("class", "label"), n = t.labelText.flat ? t.labelText.flat() : t.labelText;
1962
+ let l = "";
1963
+ typeof n == "object" ? l = n[0] : l = n, k.info("Label text abc79", l, n, typeof n == "object");
1964
+ const u = await K(r, l, t.labelStyle, !0, !0);
1965
+ let h = { width: 0, height: 0 };
1966
+ if (M(R())) {
1967
+ const v = u.children[0], S = D(u);
1968
+ h = v.getBoundingClientRect(), S.attr("width", h.width), S.attr("height", h.height);
1969
+ }
1970
+ k.info("Text 2", n);
1971
+ const d = n.slice(1, n.length);
1972
+ let b = u.getBBox();
1973
+ const w = await K(
1974
+ r,
1975
+ d.join ? d.join("<br/>") : d,
1976
+ t.labelStyle,
1977
+ !0,
1978
+ !0
1979
+ );
1980
+ if (M(R())) {
1981
+ const v = w.children[0], S = D(w);
1982
+ h = v.getBoundingClientRect(), S.attr("width", h.width), S.attr("height", h.height);
1983
+ }
1984
+ const y = t.padding / 2;
1985
+ return D(w).attr(
1986
+ "transform",
1987
+ "translate( " + // (titleBox.width - bbox.width) / 2 +
1988
+ (h.width > b.width ? 0 : (b.width - h.width) / 2) + ", " + (b.height + y + 5) + ")"
1989
+ ), D(u).attr(
1990
+ "transform",
1991
+ "translate( " + // (titleBox.width - bbox.width) / 2 +
1992
+ (h.width < b.width ? 0 : -(b.width - h.width) / 2) + ", 0)"
1993
+ ), h = r.node().getBBox(), r.attr(
1994
+ "transform",
1995
+ "translate(" + -h.width / 2 + ", " + (-h.height / 2 - y + 3) + ")"
1996
+ ), i.attr("class", "outer title-state").attr("x", -h.width / 2 - y).attr("y", -h.height / 2 - y).attr("width", h.width + t.padding).attr("height", h.height + t.padding), c.attr("class", "divider").attr("x1", -h.width / 2 - y).attr("x2", h.width / 2 + y).attr("y1", -h.height / 2 - y + b.height + y).attr("y2", -h.height / 2 - y + b.height + y), I(t, i), t.intersect = function(v) {
1997
+ return B.rect(t, v);
1998
+ }, s;
1999
+ }, "rectWithTitle"), ya = /* @__PURE__ */ g(async (e, t) => {
2000
+ const { shapeSvg: a, bbox: s } = await A(
2001
+ e,
2002
+ t,
2003
+ Y(t, void 0),
2004
+ !0
2005
+ ), i = s.height + t.padding, c = s.width + i / 4 + t.padding, r = a.insert("rect", ":first-child").attr("style", t.style).attr("rx", i / 2).attr("ry", i / 2).attr("x", -c / 2).attr("y", -i / 2).attr("width", c).attr("height", i);
2006
+ return I(t, r), t.intersect = function(n) {
2007
+ return B.rect(t, n);
2008
+ }, a;
2009
+ }, "stadium"), ba = /* @__PURE__ */ g(async (e, t) => {
2010
+ const { shapeSvg: a, bbox: s, halfPadding: i } = await A(
2011
+ e,
2012
+ t,
2013
+ Y(t, void 0),
2014
+ !0
2015
+ ), c = a.insert("circle", ":first-child");
2016
+ return c.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", s.width / 2 + i).attr("width", s.width + t.padding).attr("height", s.height + t.padding), k.info("Circle main"), I(t, c), t.intersect = function(r) {
2017
+ return k.info("Circle intersect", t, s.width / 2 + i, r), B.circle(t, s.width / 2 + i, r);
2018
+ }, a;
2019
+ }, "circle"), wa = /* @__PURE__ */ g(async (e, t) => {
2020
+ const { shapeSvg: a, bbox: s, halfPadding: i } = await A(
2021
+ e,
2022
+ t,
2023
+ Y(t, void 0),
2024
+ !0
2025
+ ), c = 5, r = a.insert("g", ":first-child"), n = r.insert("circle"), l = r.insert("circle");
2026
+ return r.attr("class", t.class), n.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", s.width / 2 + i + c).attr("width", s.width + t.padding + c * 2).attr("height", s.height + t.padding + c * 2), l.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", s.width / 2 + i).attr("width", s.width + t.padding).attr("height", s.height + t.padding), k.info("DoubleCircle main"), I(t, n), t.intersect = function(u) {
2027
+ return k.info("DoubleCircle intersect", t, s.width / 2 + i + c, u), B.circle(t, s.width / 2 + i + c, u);
2028
+ }, a;
2029
+ }, "doublecircle"), ma = /* @__PURE__ */ g(async (e, t) => {
2030
+ const { shapeSvg: a, bbox: s } = await A(
2031
+ e,
2032
+ t,
2033
+ Y(t, void 0),
2034
+ !0
2035
+ ), i = s.width + t.padding, c = s.height + t.padding, r = [
2036
+ { x: 0, y: 0 },
2037
+ { x: i, y: 0 },
2038
+ { x: i, y: -c },
2039
+ { x: 0, y: -c },
2040
+ { x: 0, y: 0 },
2041
+ { x: -8, y: 0 },
2042
+ { x: i + 8, y: 0 },
2043
+ { x: i + 8, y: -c },
2044
+ { x: -8, y: -c },
2045
+ { x: -8, y: 0 }
2046
+ ], n = X(a, i, c, r);
2047
+ return n.attr("style", t.style), I(t, n), t.intersect = function(l) {
2048
+ return B.polygon(t, r, l);
2049
+ }, a;
2050
+ }, "subroutine"), Sa = /* @__PURE__ */ g((e, t) => {
2051
+ const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), s = a.insert("circle", ":first-child");
2052
+ return s.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), I(t, s), t.intersect = function(i) {
2053
+ return B.circle(t, 7, i);
2054
+ }, a;
2055
+ }, "start"), Yt = /* @__PURE__ */ g((e, t, a) => {
2056
+ const s = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id);
2057
+ let i = 70, c = 10;
2058
+ a === "LR" && (i = 10, c = 70);
2059
+ const r = s.append("rect").attr("x", -1 * i / 2).attr("y", -1 * c / 2).attr("width", i).attr("height", c).attr("class", "fork-join");
2060
+ return I(t, r), t.height = t.height + t.padding / 2, t.width = t.width + t.padding / 2, t.intersect = function(n) {
2061
+ return B.rect(t, n);
2062
+ }, s;
2063
+ }, "forkJoin"), La = /* @__PURE__ */ g((e, t) => {
2064
+ const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), s = a.insert("circle", ":first-child"), i = a.insert("circle", ":first-child");
2065
+ return i.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), s.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10), I(t, i), t.intersect = function(c) {
2066
+ return B.circle(t, 7, c);
2067
+ }, a;
2068
+ }, "end"), ka = /* @__PURE__ */ g(async (e, t) => {
2069
+ const a = t.padding / 2, s = 4, i = 8;
2070
+ let c;
2071
+ t.classes ? c = "node " + t.classes : c = "node default";
2072
+ const r = e.insert("g").attr("class", c).attr("id", t.domId || t.id), n = r.insert("rect", ":first-child"), l = r.insert("line"), u = r.insert("line");
2073
+ let h = 0, d = s;
2074
+ const b = r.insert("g").attr("class", "label");
2075
+ let w = 0;
2076
+ const y = t.classData.annotations?.[0], v = t.classData.annotations[0] ? "«" + t.classData.annotations[0] + "»" : "", S = await K(
2077
+ b,
2078
+ v,
2079
+ t.labelStyle,
2080
+ !0,
2081
+ !0
2082
+ );
2083
+ let N = S.getBBox();
2084
+ if (M(R())) {
2085
+ const E = S.children[0], o = D(S);
2086
+ N = E.getBoundingClientRect(), o.attr("width", N.width), o.attr("height", N.height);
2087
+ }
2088
+ t.classData.annotations[0] && (d += N.height + s, h += N.width);
2089
+ let _ = t.classData.label;
2090
+ t.classData.type !== void 0 && t.classData.type !== "" && (M(R()) ? _ += "&lt;" + t.classData.type + "&gt;" : _ += "<" + t.classData.type + ">");
2091
+ const T = await K(
2092
+ b,
2093
+ _,
2094
+ t.labelStyle,
2095
+ !0,
2096
+ !0
2097
+ );
2098
+ D(T).attr("class", "classTitle");
2099
+ let m = T.getBBox();
2100
+ if (M(R())) {
2101
+ const E = T.children[0], o = D(T);
2102
+ m = E.getBoundingClientRect(), o.attr("width", m.width), o.attr("height", m.height);
2103
+ }
2104
+ d += m.height + s, m.width > h && (h = m.width);
2105
+ const p = [];
2106
+ t.classData.members.forEach(async (E) => {
2107
+ const o = E.getDisplayDetails();
2108
+ let F = o.displayText;
2109
+ M(R()) && (F = F.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
2110
+ const f = await K(
2111
+ b,
2112
+ F,
2113
+ o.cssStyle ? o.cssStyle : t.labelStyle,
2114
+ !0,
2115
+ !0
2116
+ );
2117
+ let C = f.getBBox();
2118
+ if (M(R())) {
2119
+ const Z = f.children[0], V = D(f);
2120
+ C = Z.getBoundingClientRect(), V.attr("width", C.width), V.attr("height", C.height);
2121
+ }
2122
+ C.width > h && (h = C.width), d += C.height + s, p.push(f);
2123
+ }), d += i;
2124
+ const x = [];
2125
+ if (t.classData.methods.forEach(async (E) => {
2126
+ const o = E.getDisplayDetails();
2127
+ let F = o.displayText;
2128
+ M(R()) && (F = F.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
2129
+ const f = await K(
2130
+ b,
2131
+ F,
2132
+ o.cssStyle ? o.cssStyle : t.labelStyle,
2133
+ !0,
2134
+ !0
2135
+ );
2136
+ let C = f.getBBox();
2137
+ if (M(R())) {
2138
+ const Z = f.children[0], V = D(f);
2139
+ C = Z.getBoundingClientRect(), V.attr("width", C.width), V.attr("height", C.height);
2140
+ }
2141
+ C.width > h && (h = C.width), d += C.height + s, x.push(f);
2142
+ }), d += i, y) {
2143
+ let E = (h - N.width) / 2;
2144
+ D(S).attr(
2145
+ "transform",
2146
+ "translate( " + (-1 * h / 2 + E) + ", " + -1 * d / 2 + ")"
2147
+ ), w = N.height + s;
2148
+ }
2149
+ let L = (h - m.width) / 2;
2150
+ return D(T).attr(
2151
+ "transform",
2152
+ "translate( " + (-1 * h / 2 + L) + ", " + (-1 * d / 2 + w) + ")"
2153
+ ), w += m.height + s, l.attr("class", "divider").attr("x1", -h / 2 - a).attr("x2", h / 2 + a).attr("y1", -d / 2 - a + i + w).attr("y2", -d / 2 - a + i + w), w += i, p.forEach((E) => {
2154
+ D(E).attr(
2155
+ "transform",
2156
+ "translate( " + -h / 2 + ", " + (-1 * d / 2 + w + i / 2) + ")"
2157
+ );
2158
+ const o = E?.getBBox();
2159
+ w += (o?.height ?? 0) + s;
2160
+ }), w += i, u.attr("class", "divider").attr("x1", -h / 2 - a).attr("x2", h / 2 + a).attr("y1", -d / 2 - a + i + w).attr("y2", -d / 2 - a + i + w), w += i, x.forEach((E) => {
2161
+ D(E).attr(
2162
+ "transform",
2163
+ "translate( " + -h / 2 + ", " + (-1 * d / 2 + w) + ")"
2164
+ );
2165
+ const o = E?.getBBox();
2166
+ w += (o?.height ?? 0) + s;
2167
+ }), n.attr("style", t.style).attr("class", "outer title-state").attr("x", -h / 2 - a).attr("y", -(d / 2) - a).attr("width", h + t.padding).attr("height", d + t.padding), I(t, n), t.intersect = function(E) {
2168
+ return B.rect(t, E);
2169
+ }, r;
2170
+ }, "class_box"), Ht = {
2171
+ rhombus: Wt,
2172
+ composite: pa,
2173
+ question: Wt,
2174
+ rect: da,
2175
+ labelRect: fa,
2176
+ rectWithTitle: xa,
2177
+ choice: aa,
2178
+ circle: ba,
2179
+ doublecircle: wa,
2180
+ stadium: ya,
2181
+ hexagon: sa,
2182
+ block_arrow: ia,
2183
+ rect_left_inv_arrow: na,
2184
+ lean_right: ca,
2185
+ lean_left: la,
2186
+ trapezoid: oa,
2187
+ inv_trapezoid: ha,
2188
+ rect_right_inv_arrow: ga,
2189
+ cylinder: ua,
2190
+ start: Sa,
2191
+ end: La,
2192
+ note: ra,
2193
+ subroutine: ma,
2194
+ fork: Yt,
2195
+ join: Yt,
2196
+ class_box: ka
2197
+ }, nt = {}, ie = /* @__PURE__ */ g(async (e, t, a) => {
2198
+ let s, i;
2199
+ if (t.link) {
2200
+ let c;
2201
+ R().securityLevel === "sandbox" ? c = "_top" : t.linkTarget && (c = t.linkTarget || "_blank"), s = e.insert("svg:a").attr("xlink:href", t.link).attr("target", c), i = await Ht[t.shape](s, t, a);
2202
+ } else
2203
+ i = await Ht[t.shape](e, t, a), s = i;
2204
+ return t.tooltip && i.attr("title", t.tooltip), t.class && i.attr("class", "node default " + t.class), nt[t.id] = s, t.haveCallback && nt[t.id].attr("class", nt[t.id].attr("class") + " clickable"), s;
2205
+ }, "insertNode"), va = /* @__PURE__ */ g((e) => {
2206
+ const t = nt[e.id];
2207
+ k.trace(
2208
+ "Transforming node",
2209
+ e.diff,
2210
+ e,
2211
+ "translate(" + (e.x - e.width / 2 - 5) + ", " + e.width / 2 + ")"
2212
+ );
2213
+ const a = 8, s = e.diff || 0;
2214
+ return e.clusterNode ? t.attr(
2215
+ "transform",
2216
+ "translate(" + (e.x + s - e.width / 2) + ", " + (e.y - e.height / 2 - a) + ")"
2217
+ ) : t.attr("transform", "translate(" + e.x + ", " + e.y + ")"), s;
2218
+ }, "positionNode");
2219
+ function Bt(e, t, a = !1) {
2220
+ const s = e;
2221
+ let i = "default";
2222
+ (s?.classes?.length || 0) > 0 && (i = (s?.classes ?? []).join(" ")), i = i + " flowchart-label";
2223
+ let c = 0, r = "", n;
2224
+ switch (s.type) {
2225
+ case "round":
2226
+ c = 5, r = "rect";
2227
+ break;
2228
+ case "composite":
2229
+ c = 0, r = "composite", n = 0;
2230
+ break;
2231
+ case "square":
2232
+ r = "rect";
2233
+ break;
2234
+ case "diamond":
2235
+ r = "question";
2236
+ break;
2237
+ case "hexagon":
2238
+ r = "hexagon";
2239
+ break;
2240
+ case "block_arrow":
2241
+ r = "block_arrow";
2242
+ break;
2243
+ case "odd":
2244
+ r = "rect_left_inv_arrow";
2245
+ break;
2246
+ case "lean_right":
2247
+ r = "lean_right";
2248
+ break;
2249
+ case "lean_left":
2250
+ r = "lean_left";
2251
+ break;
2252
+ case "trapezoid":
2253
+ r = "trapezoid";
2254
+ break;
2255
+ case "inv_trapezoid":
2256
+ r = "inv_trapezoid";
2257
+ break;
2258
+ case "rect_left_inv_arrow":
2259
+ r = "rect_left_inv_arrow";
2260
+ break;
2261
+ case "circle":
2262
+ r = "circle";
2263
+ break;
2264
+ case "ellipse":
2265
+ r = "ellipse";
2266
+ break;
2267
+ case "stadium":
2268
+ r = "stadium";
2269
+ break;
2270
+ case "subroutine":
2271
+ r = "subroutine";
2272
+ break;
2273
+ case "cylinder":
2274
+ r = "cylinder";
2275
+ break;
2276
+ case "group":
2277
+ r = "rect";
2278
+ break;
2279
+ case "doublecircle":
2280
+ r = "doublecircle";
2281
+ break;
2282
+ default:
2283
+ r = "rect";
2284
+ }
2285
+ const l = Ve(s?.styles ?? []), u = s.label, h = s.size ?? { width: 0, height: 0, x: 0, y: 0 }, d = t.getDiagramId();
2286
+ return {
2287
+ labelStyle: l.labelStyle,
2288
+ shape: r,
2289
+ labelText: u,
2290
+ rx: c,
2291
+ ry: c,
2292
+ class: i,
2293
+ style: l.style,
2294
+ id: s.id,
2295
+ domId: d ? `${d}-${s.id}` : s.id,
2296
+ directions: s.directions,
2297
+ width: h.width,
2298
+ height: h.height,
2299
+ x: h.x,
2300
+ y: h.y,
2301
+ positioned: a,
2302
+ intersect: void 0,
2303
+ type: s.type,
2304
+ padding: n ?? rt()?.block?.padding ?? 0,
2305
+ widthInColumns: s.widthInColumns ?? 1
2306
+ };
2307
+ }
2308
+ g(Bt, "getNodeFromBlock");
2309
+ async function ne(e, t, a) {
2310
+ const s = Bt(t, a, !1);
2311
+ if (s.type === "group")
2312
+ return;
2313
+ const i = rt(), c = await ie(e, s, { config: i }), r = c.node().getBBox(), n = a.getBlock(s.id);
2314
+ n.size = { width: r.width, height: r.height, x: 0, y: 0, node: c }, a.setBlock(n), c.remove();
2315
+ }
2316
+ g(ne, "calculateBlockSize");
2317
+ async function ce(e, t, a) {
2318
+ const s = Bt(t, a, !0);
2319
+ if (a.getBlock(s.id).type !== "space") {
2320
+ const c = rt();
2321
+ await ie(e, s, { config: c }), t.intersect = s?.intersect, va(s);
2322
+ }
2323
+ }
2324
+ g(ce, "insertBlockPositioned");
2325
+ async function ht(e, t, a, s) {
2326
+ for (const i of t)
2327
+ await s(e, i, a), i.children && await ht(e, i.children, a, s);
2328
+ }
2329
+ g(ht, "performOperations");
2330
+ async function le(e, t, a) {
2331
+ await ht(e, t, a, ne);
2332
+ }
2333
+ g(le, "calculateBlockSizes");
2334
+ async function oe(e, t, a) {
2335
+ await ht(e, t, a, ce);
2336
+ }
2337
+ g(oe, "insertBlocks");
2338
+ async function he(e, t, a, s, i) {
2339
+ const c = new Ge({
2340
+ multigraph: !0,
2341
+ compound: !0
2342
+ });
2343
+ c.setGraph({
2344
+ rankdir: "TB",
2345
+ nodesep: 10,
2346
+ ranksep: 10,
2347
+ marginx: 8,
2348
+ marginy: 8
2349
+ });
2350
+ for (const r of a)
2351
+ r.size && c.setNode(r.id, {
2352
+ width: r.size.width,
2353
+ height: r.size.height,
2354
+ intersect: r.intersect
2355
+ });
2356
+ for (const r of t)
2357
+ if (r.start && r.end) {
2358
+ const n = s.getBlock(r.start), l = s.getBlock(r.end);
2359
+ if (n?.size && l?.size) {
2360
+ const u = n.size, h = l.size, d = [
2361
+ { x: u.x, y: u.y },
2362
+ { x: u.x + (h.x - u.x) / 2, y: u.y + (h.y - u.y) / 2 },
2363
+ { x: h.x, y: h.y }
2364
+ ], b = i ? `${i}-${r.id}` : r.id, w = r.thickness === "thick" ? "edge-thickness-thick" : "edge-thickness-normal", y = r.pattern === "dotted" ? "edge-pattern-dotted" : "edge-pattern-solid", v = `${w} ${y} flowchart-link LS-a1 LE-b1`;
2365
+ Vr(
2366
+ e,
2367
+ { v: r.start, w: r.end, name: b },
2368
+ {
2369
+ ...r,
2370
+ id: b,
2371
+ arrowTypeEnd: r.arrowTypeEnd,
2372
+ arrowTypeStart: r.arrowTypeStart,
2373
+ points: d,
2374
+ classes: v
2375
+ },
2376
+ void 0,
2377
+ "block",
2378
+ c,
2379
+ i
2380
+ ), r.label && (await Hr(e, {
2381
+ ...r,
2382
+ label: r.label,
2383
+ labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
2384
+ arrowTypeEnd: r.arrowTypeEnd,
2385
+ arrowTypeStart: r.arrowTypeStart,
2386
+ points: d,
2387
+ classes: v
2388
+ }), Kr(
2389
+ { ...r, x: d[1].x, y: d[1].y },
2390
+ {
2391
+ originalPath: d
2392
+ }
2393
+ ));
2394
+ }
2395
+ }
2396
+ }
2397
+ g(he, "insertEdges");
2398
+ var Ea = /* @__PURE__ */ g(function(e, t) {
2399
+ return t.db.getClasses();
2400
+ }, "getClasses"), _a = /* @__PURE__ */ g(async function(e, t, a, s) {
2401
+ const { securityLevel: i, block: c } = rt(), r = s.db;
2402
+ r.setDiagramId(t);
2403
+ let n;
2404
+ i === "sandbox" && (n = D("#i" + t));
2405
+ const l = i === "sandbox" ? D(n.nodes()[0].contentDocument.body) : D("body"), u = i === "sandbox" ? l.select(`[id="${t}"]`) : D(`[id="${t}"]`);
2406
+ Mr(u, ["point", "circle", "cross"], s.type, t);
2407
+ const d = r.getBlocks(), b = r.getBlocksFlat(), w = r.getEdges(), y = u.insert("g").attr("class", "block");
2408
+ await le(y, d, r);
2409
+ const v = Qt(r);
2410
+ if (await oe(y, d, r), await he(y, w, b, r, t), v) {
2411
+ const S = v, N = Math.max(1, Math.round(0.125 * (S.width / S.height))), _ = S.height + N + 10, T = S.width + 10, { useMaxWidth: m } = c;
2412
+ Pe(u, _, T, !!m), k.debug("Here Bounds", v, S), u.attr(
2413
+ "viewBox",
2414
+ `${S.x - 5} ${S.y - 5} ${S.width + 10} ${S.height + 10}`
2415
+ );
2416
+ }
2417
+ }, "draw"), Ta = {
2418
+ draw: _a,
2419
+ getClasses: Ea
2420
+ }, za = {
2421
+ parser: ar,
2422
+ db: kr,
2423
+ renderer: Ta,
2424
+ styles: Er
2425
+ };
2426
+ export {
2427
+ za as diagram
2428
+ };