@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,2891 @@
1
+ import { I as er } from "./chunk-2Q5K7J3B.Dy1Z-bMH.js";
2
+ import { _ as x, G as rr, c as $, l as at, i as Me, d as ar, e as sr, j as N, b as De, s as ir, n as nr, a as or, g as cr, o as lr, H as hr, J as dr, p as Tr, h as Yt, x as Z, I as Q, K as kt, L as Be, Z as pr, y as Ft, M as Er, N as Ve } from "./mermaid.core.Dspbw7Ig.js";
3
+ import { a as ur, b as se, g as dt, d as fr, c as ie, e as ne } from "./chunk-32BRIVSS.BbIrVi3j.js";
4
+ import "./index.CrhRU5m8.js";
5
+ import "./transform.BuqENXeT.js";
6
+ import { s as Wt } from "./select.C6_sM3Pr.js";
7
+ var ee = function() {
8
+ var e = /* @__PURE__ */ x(function(ut, S, v, P) {
9
+ for (v = v || {}, P = ut.length; P--; v[ut[P]] = S) ;
10
+ return v;
11
+ }, "o"), t = [1, 2], a = [1, 3], r = [1, 4], i = [2, 4], n = [1, 9], s = [1, 11], c = [1, 12], E = [1, 14], h = [1, 15], p = [1, 17], _ = [1, 18], u = [1, 19], O = [1, 25], T = [1, 26], g = [1, 27], f = [1, 28], I = [1, 29], L = [1, 30], b = [1, 31], w = [1, 32], A = [1, 33], D = [1, 34], M = [1, 35], V = [1, 36], W = [1, 37], U = [1, 38], G = [1, 39], X = [1, 40], nt = [1, 42], j = [1, 43], q = [1, 44], st = [1, 45], tt = [1, 46], Y = [1, 47], C = [1, 4, 5, 10, 14, 15, 17, 19, 22, 24, 30, 31, 32, 34, 36, 37, 38, 39, 40, 42, 44, 45, 47, 48, 49, 50, 51, 53, 54, 56, 61, 62, 63, 64, 73], St = [1, 74], Dt = [1, 80], m = [1, 81], k = [1, 82], lt = [1, 83], et = [1, 84], K = [1, 85], Ot = [1, 86], oe = [1, 87], ce = [1, 88], le = [1, 89], he = [1, 90], de = [1, 91], Te = [1, 92], pe = [1, 93], Ee = [1, 94], ue = [1, 95], fe = [1, 96], _e = [1, 97], ge = [1, 98], xe = [1, 99], Ie = [1, 100], ye = [1, 101], Re = [1, 102], Oe = [1, 103], Le = [1, 104], be = [1, 105], me = [2, 78], wt = [4, 5, 17, 51, 53, 54], vt = [4, 5, 10, 14, 15, 17, 19, 22, 24, 30, 31, 32, 34, 36, 37, 38, 39, 40, 42, 44, 45, 47, 51, 53, 54, 56, 61, 62, 63, 64, 73], Ae = [4, 5, 10, 14, 15, 17, 19, 22, 24, 30, 31, 32, 34, 36, 37, 38, 39, 40, 42, 44, 45, 47, 50, 51, 53, 54, 56, 61, 62, 63, 64, 73], Gt = [4, 5, 10, 14, 15, 17, 19, 22, 24, 30, 31, 32, 34, 36, 37, 38, 39, 40, 42, 44, 45, 47, 49, 51, 53, 54, 56, 61, 62, 63, 64, 73], Se = [4, 5, 10, 14, 15, 17, 19, 22, 24, 30, 31, 32, 34, 36, 37, 38, 39, 40, 42, 44, 45, 47, 48, 51, 53, 54, 56, 61, 62, 63, 64, 73], Xt = [5, 52], F = [70, 71, 72, 73], ot = [1, 151], Jt = {
12
+ trace: /* @__PURE__ */ x(function() {
13
+ }, "trace"),
14
+ yy: {},
15
+ symbols_: { error: 2, start: 3, SPACE: 4, NEWLINE: 5, SD: 6, document: 7, line: 8, statement: 9, INVALID: 10, box_section: 11, box_line: 12, participant_statement: 13, create: 14, box: 15, restOfLine: 16, end: 17, signal: 18, autonumber: 19, NUM: 20, off: 21, activate: 22, actor: 23, deactivate: 24, note_statement: 25, links_statement: 26, link_statement: 27, properties_statement: 28, details_statement: 29, title: 30, legacy_title: 31, acc_title: 32, acc_title_value: 33, acc_descr: 34, acc_descr_value: 35, acc_descr_multiline_value: 36, loop: 37, rect: 38, opt: 39, alt: 40, else_sections: 41, par: 42, par_sections: 43, par_over: 44, critical: 45, option_sections: 46, break: 47, option: 48, and: 49, else: 50, participant: 51, AS: 52, participant_actor: 53, destroy: 54, actor_with_config: 55, note: 56, placement: 57, text2: 58, over: 59, actor_pair: 60, links: 61, link: 62, properties: 63, details: 64, spaceList: 65, ",": 66, left_of: 67, right_of: 68, signaltype: 69, "+": 70, "-": 71, "()": 72, ACTOR: 73, config_object: 74, CONFIG_START: 75, CONFIG_CONTENT: 76, CONFIG_END: 77, SOLID_OPEN_ARROW: 78, DOTTED_OPEN_ARROW: 79, SOLID_ARROW: 80, SOLID_ARROW_TOP: 81, SOLID_ARROW_BOTTOM: 82, STICK_ARROW_TOP: 83, STICK_ARROW_BOTTOM: 84, SOLID_ARROW_TOP_DOTTED: 85, SOLID_ARROW_BOTTOM_DOTTED: 86, STICK_ARROW_TOP_DOTTED: 87, STICK_ARROW_BOTTOM_DOTTED: 88, SOLID_ARROW_TOP_REVERSE: 89, SOLID_ARROW_BOTTOM_REVERSE: 90, STICK_ARROW_TOP_REVERSE: 91, STICK_ARROW_BOTTOM_REVERSE: 92, SOLID_ARROW_TOP_REVERSE_DOTTED: 93, SOLID_ARROW_BOTTOM_REVERSE_DOTTED: 94, STICK_ARROW_TOP_REVERSE_DOTTED: 95, STICK_ARROW_BOTTOM_REVERSE_DOTTED: 96, BIDIRECTIONAL_SOLID_ARROW: 97, DOTTED_ARROW: 98, BIDIRECTIONAL_DOTTED_ARROW: 99, SOLID_CROSS: 100, DOTTED_CROSS: 101, SOLID_POINT: 102, DOTTED_POINT: 103, TXT: 104, $accept: 0, $end: 1 },
16
+ terminals_: { 2: "error", 4: "SPACE", 5: "NEWLINE", 6: "SD", 10: "INVALID", 14: "create", 15: "box", 16: "restOfLine", 17: "end", 19: "autonumber", 20: "NUM", 21: "off", 22: "activate", 24: "deactivate", 30: "title", 31: "legacy_title", 32: "acc_title", 33: "acc_title_value", 34: "acc_descr", 35: "acc_descr_value", 36: "acc_descr_multiline_value", 37: "loop", 38: "rect", 39: "opt", 40: "alt", 42: "par", 44: "par_over", 45: "critical", 47: "break", 48: "option", 49: "and", 50: "else", 51: "participant", 52: "AS", 53: "participant_actor", 54: "destroy", 56: "note", 59: "over", 61: "links", 62: "link", 63: "properties", 64: "details", 66: ",", 67: "left_of", 68: "right_of", 70: "+", 71: "-", 72: "()", 73: "ACTOR", 75: "CONFIG_START", 76: "CONFIG_CONTENT", 77: "CONFIG_END", 78: "SOLID_OPEN_ARROW", 79: "DOTTED_OPEN_ARROW", 80: "SOLID_ARROW", 81: "SOLID_ARROW_TOP", 82: "SOLID_ARROW_BOTTOM", 83: "STICK_ARROW_TOP", 84: "STICK_ARROW_BOTTOM", 85: "SOLID_ARROW_TOP_DOTTED", 86: "SOLID_ARROW_BOTTOM_DOTTED", 87: "STICK_ARROW_TOP_DOTTED", 88: "STICK_ARROW_BOTTOM_DOTTED", 89: "SOLID_ARROW_TOP_REVERSE", 90: "SOLID_ARROW_BOTTOM_REVERSE", 91: "STICK_ARROW_TOP_REVERSE", 92: "STICK_ARROW_BOTTOM_REVERSE", 93: "SOLID_ARROW_TOP_REVERSE_DOTTED", 94: "SOLID_ARROW_BOTTOM_REVERSE_DOTTED", 95: "STICK_ARROW_TOP_REVERSE_DOTTED", 96: "STICK_ARROW_BOTTOM_REVERSE_DOTTED", 97: "BIDIRECTIONAL_SOLID_ARROW", 98: "DOTTED_ARROW", 99: "BIDIRECTIONAL_DOTTED_ARROW", 100: "SOLID_CROSS", 101: "DOTTED_CROSS", 102: "SOLID_POINT", 103: "DOTTED_POINT", 104: "TXT" },
17
+ productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [8, 1], [11, 0], [11, 2], [12, 2], [12, 1], [12, 1], [9, 1], [9, 2], [9, 4], [9, 2], [9, 4], [9, 3], [9, 3], [9, 2], [9, 3], [9, 3], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [46, 1], [46, 4], [43, 1], [43, 4], [41, 1], [41, 4], [13, 5], [13, 3], [13, 5], [13, 3], [13, 3], [13, 5], [13, 3], [13, 5], [13, 3], [25, 4], [25, 4], [26, 3], [27, 3], [28, 3], [29, 3], [65, 2], [65, 1], [60, 3], [60, 1], [57, 1], [57, 1], [18, 5], [18, 5], [18, 5], [18, 5], [18, 6], [18, 4], [55, 2], [74, 3], [23, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [58, 1]],
18
+ performAction: /* @__PURE__ */ x(function(S, v, P, y, z, o, Nt) {
19
+ var d = o.length - 1;
20
+ switch (z) {
21
+ case 3:
22
+ return y.apply(o[d]), o[d];
23
+ case 4:
24
+ case 10:
25
+ this.$ = [];
26
+ break;
27
+ case 5:
28
+ case 11:
29
+ o[d - 1].push(o[d]), this.$ = o[d - 1];
30
+ break;
31
+ case 6:
32
+ case 7:
33
+ case 12:
34
+ case 13:
35
+ this.$ = o[d];
36
+ break;
37
+ case 8:
38
+ case 9:
39
+ case 14:
40
+ this.$ = [];
41
+ break;
42
+ case 16:
43
+ o[d].type = "createParticipant", this.$ = o[d];
44
+ break;
45
+ case 17:
46
+ o[d - 1].unshift({ type: "boxStart", boxData: y.parseBoxData(o[d - 2]) }), o[d - 1].push({ type: "boxEnd", boxText: o[d - 2] }), this.$ = o[d - 1];
47
+ break;
48
+ case 19:
49
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number(o[d - 2]), sequenceIndexStep: Number(o[d - 1]), sequenceVisible: !0, signalType: y.LINETYPE.AUTONUMBER };
50
+ break;
51
+ case 20:
52
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number(o[d - 1]), sequenceIndexStep: 1, sequenceVisible: !0, signalType: y.LINETYPE.AUTONUMBER };
53
+ break;
54
+ case 21:
55
+ this.$ = { type: "sequenceIndex", sequenceVisible: !1, signalType: y.LINETYPE.AUTONUMBER };
56
+ break;
57
+ case 22:
58
+ this.$ = { type: "sequenceIndex", sequenceVisible: !0, signalType: y.LINETYPE.AUTONUMBER };
59
+ break;
60
+ case 23:
61
+ this.$ = { type: "activeStart", signalType: y.LINETYPE.ACTIVE_START, actor: o[d - 1].actor };
62
+ break;
63
+ case 24:
64
+ this.$ = { type: "activeEnd", signalType: y.LINETYPE.ACTIVE_END, actor: o[d - 1].actor };
65
+ break;
66
+ case 30:
67
+ y.setDiagramTitle(o[d].substring(6)), this.$ = o[d].substring(6);
68
+ break;
69
+ case 31:
70
+ y.setDiagramTitle(o[d].substring(7)), this.$ = o[d].substring(7);
71
+ break;
72
+ case 32:
73
+ this.$ = o[d].trim(), y.setAccTitle(this.$);
74
+ break;
75
+ case 33:
76
+ case 34:
77
+ this.$ = o[d].trim(), y.setAccDescription(this.$);
78
+ break;
79
+ case 35:
80
+ o[d - 1].unshift({ type: "loopStart", loopText: y.parseMessage(o[d - 2]), signalType: y.LINETYPE.LOOP_START }), o[d - 1].push({ type: "loopEnd", loopText: o[d - 2], signalType: y.LINETYPE.LOOP_END }), this.$ = o[d - 1];
81
+ break;
82
+ case 36:
83
+ o[d - 1].unshift({ type: "rectStart", color: y.parseMessage(o[d - 2]), signalType: y.LINETYPE.RECT_START }), o[d - 1].push({ type: "rectEnd", color: y.parseMessage(o[d - 2]), signalType: y.LINETYPE.RECT_END }), this.$ = o[d - 1];
84
+ break;
85
+ case 37:
86
+ o[d - 1].unshift({ type: "optStart", optText: y.parseMessage(o[d - 2]), signalType: y.LINETYPE.OPT_START }), o[d - 1].push({ type: "optEnd", optText: y.parseMessage(o[d - 2]), signalType: y.LINETYPE.OPT_END }), this.$ = o[d - 1];
87
+ break;
88
+ case 38:
89
+ o[d - 1].unshift({ type: "altStart", altText: y.parseMessage(o[d - 2]), signalType: y.LINETYPE.ALT_START }), o[d - 1].push({ type: "altEnd", signalType: y.LINETYPE.ALT_END }), this.$ = o[d - 1];
90
+ break;
91
+ case 39:
92
+ o[d - 1].unshift({ type: "parStart", parText: y.parseMessage(o[d - 2]), signalType: y.LINETYPE.PAR_START }), o[d - 1].push({ type: "parEnd", signalType: y.LINETYPE.PAR_END }), this.$ = o[d - 1];
93
+ break;
94
+ case 40:
95
+ o[d - 1].unshift({ type: "parStart", parText: y.parseMessage(o[d - 2]), signalType: y.LINETYPE.PAR_OVER_START }), o[d - 1].push({ type: "parEnd", signalType: y.LINETYPE.PAR_END }), this.$ = o[d - 1];
96
+ break;
97
+ case 41:
98
+ o[d - 1].unshift({ type: "criticalStart", criticalText: y.parseMessage(o[d - 2]), signalType: y.LINETYPE.CRITICAL_START }), o[d - 1].push({ type: "criticalEnd", signalType: y.LINETYPE.CRITICAL_END }), this.$ = o[d - 1];
99
+ break;
100
+ case 42:
101
+ o[d - 1].unshift({ type: "breakStart", breakText: y.parseMessage(o[d - 2]), signalType: y.LINETYPE.BREAK_START }), o[d - 1].push({ type: "breakEnd", optText: y.parseMessage(o[d - 2]), signalType: y.LINETYPE.BREAK_END }), this.$ = o[d - 1];
102
+ break;
103
+ case 44:
104
+ this.$ = o[d - 3].concat([{ type: "option", optionText: y.parseMessage(o[d - 1]), signalType: y.LINETYPE.CRITICAL_OPTION }, o[d]]);
105
+ break;
106
+ case 46:
107
+ this.$ = o[d - 3].concat([{ type: "and", parText: y.parseMessage(o[d - 1]), signalType: y.LINETYPE.PAR_AND }, o[d]]);
108
+ break;
109
+ case 48:
110
+ this.$ = o[d - 3].concat([{ type: "else", altText: y.parseMessage(o[d - 1]), signalType: y.LINETYPE.ALT_ELSE }, o[d]]);
111
+ break;
112
+ case 49:
113
+ o[d - 3].draw = "participant", o[d - 3].type = "addParticipant", o[d - 3].description = y.parseMessage(o[d - 1]), this.$ = o[d - 3];
114
+ break;
115
+ case 50:
116
+ o[d - 1].draw = "participant", o[d - 1].type = "addParticipant", this.$ = o[d - 1];
117
+ break;
118
+ case 51:
119
+ o[d - 3].draw = "actor", o[d - 3].type = "addParticipant", o[d - 3].description = y.parseMessage(o[d - 1]), this.$ = o[d - 3];
120
+ break;
121
+ case 52:
122
+ case 57:
123
+ o[d - 1].draw = "actor", o[d - 1].type = "addParticipant", this.$ = o[d - 1];
124
+ break;
125
+ case 53:
126
+ o[d - 1].type = "destroyParticipant", this.$ = o[d - 1];
127
+ break;
128
+ case 54:
129
+ o[d - 3].draw = "participant", o[d - 3].type = "addParticipant", o[d - 3].description = y.parseMessage(o[d - 1]), this.$ = o[d - 3];
130
+ break;
131
+ case 55:
132
+ o[d - 1].draw = "participant", o[d - 1].type = "addParticipant", this.$ = o[d - 1];
133
+ break;
134
+ case 56:
135
+ o[d - 3].draw = "actor", o[d - 3].type = "addParticipant", o[d - 3].description = y.parseMessage(o[d - 1]), this.$ = o[d - 3];
136
+ break;
137
+ case 58:
138
+ this.$ = [o[d - 1], { type: "addNote", placement: o[d - 2], actor: o[d - 1].actor, text: o[d] }];
139
+ break;
140
+ case 59:
141
+ o[d - 2] = [].concat(o[d - 1], o[d - 1]).slice(0, 2), o[d - 2][0] = o[d - 2][0].actor, o[d - 2][1] = o[d - 2][1].actor, this.$ = [o[d - 1], { type: "addNote", placement: y.PLACEMENT.OVER, actor: o[d - 2].slice(0, 2), text: o[d] }];
142
+ break;
143
+ case 60:
144
+ this.$ = [o[d - 1], { type: "addLinks", actor: o[d - 1].actor, text: o[d] }];
145
+ break;
146
+ case 61:
147
+ this.$ = [o[d - 1], { type: "addALink", actor: o[d - 1].actor, text: o[d] }];
148
+ break;
149
+ case 62:
150
+ this.$ = [o[d - 1], { type: "addProperties", actor: o[d - 1].actor, text: o[d] }];
151
+ break;
152
+ case 63:
153
+ this.$ = [o[d - 1], { type: "addDetails", actor: o[d - 1].actor, text: o[d] }];
154
+ break;
155
+ case 66:
156
+ this.$ = [o[d - 2], o[d]];
157
+ break;
158
+ case 67:
159
+ this.$ = o[d];
160
+ break;
161
+ case 68:
162
+ this.$ = y.PLACEMENT.LEFTOF;
163
+ break;
164
+ case 69:
165
+ this.$ = y.PLACEMENT.RIGHTOF;
166
+ break;
167
+ case 70:
168
+ this.$ = [
169
+ o[d - 4],
170
+ o[d - 1],
171
+ { type: "addMessage", from: o[d - 4].actor, to: o[d - 1].actor, signalType: o[d - 3], msg: o[d], activate: !0 },
172
+ { type: "activeStart", signalType: y.LINETYPE.ACTIVE_START, actor: o[d - 1].actor }
173
+ ];
174
+ break;
175
+ case 71:
176
+ this.$ = [
177
+ o[d - 4],
178
+ o[d - 1],
179
+ { type: "addMessage", from: o[d - 4].actor, to: o[d - 1].actor, signalType: o[d - 3], msg: o[d] },
180
+ { type: "activeEnd", signalType: y.LINETYPE.ACTIVE_END, actor: o[d - 4].actor }
181
+ ];
182
+ break;
183
+ case 72:
184
+ this.$ = [
185
+ o[d - 4],
186
+ o[d - 1],
187
+ { type: "addMessage", from: o[d - 4].actor, to: o[d - 1].actor, signalType: o[d - 3], msg: o[d], activate: !0, centralConnection: y.LINETYPE.CENTRAL_CONNECTION },
188
+ { type: "centralConnection", signalType: y.LINETYPE.CENTRAL_CONNECTION, actor: o[d - 1].actor }
189
+ ];
190
+ break;
191
+ case 73:
192
+ this.$ = [
193
+ o[d - 4],
194
+ o[d - 1],
195
+ { type: "addMessage", from: o[d - 4].actor, to: o[d - 1].actor, signalType: o[d - 2], msg: o[d], activate: !1, centralConnection: y.LINETYPE.CENTRAL_CONNECTION_REVERSE },
196
+ { type: "centralConnectionReverse", signalType: y.LINETYPE.CENTRAL_CONNECTION_REVERSE, actor: o[d - 4].actor }
197
+ ];
198
+ break;
199
+ case 74:
200
+ this.$ = [
201
+ o[d - 5],
202
+ o[d - 1],
203
+ { type: "addMessage", from: o[d - 5].actor, to: o[d - 1].actor, signalType: o[d - 3], msg: o[d], activate: !0, centralConnection: y.LINETYPE.CENTRAL_CONNECTION_DUAL },
204
+ { type: "centralConnection", signalType: y.LINETYPE.CENTRAL_CONNECTION, actor: o[d - 1].actor },
205
+ { type: "centralConnectionReverse", signalType: y.LINETYPE.CENTRAL_CONNECTION_REVERSE, actor: o[d - 5].actor }
206
+ ];
207
+ break;
208
+ case 75:
209
+ this.$ = [o[d - 3], o[d - 1], { type: "addMessage", from: o[d - 3].actor, to: o[d - 1].actor, signalType: o[d - 2], msg: o[d] }];
210
+ break;
211
+ case 76:
212
+ this.$ = {
213
+ type: "addParticipant",
214
+ actor: o[d - 1],
215
+ config: o[d]
216
+ };
217
+ break;
218
+ case 77:
219
+ this.$ = o[d - 1].trim();
220
+ break;
221
+ case 78:
222
+ this.$ = { type: "addParticipant", actor: o[d] };
223
+ break;
224
+ case 79:
225
+ this.$ = y.LINETYPE.SOLID_OPEN;
226
+ break;
227
+ case 80:
228
+ this.$ = y.LINETYPE.DOTTED_OPEN;
229
+ break;
230
+ case 81:
231
+ this.$ = y.LINETYPE.SOLID;
232
+ break;
233
+ case 82:
234
+ this.$ = y.LINETYPE.SOLID_TOP;
235
+ break;
236
+ case 83:
237
+ this.$ = y.LINETYPE.SOLID_BOTTOM;
238
+ break;
239
+ case 84:
240
+ this.$ = y.LINETYPE.STICK_TOP;
241
+ break;
242
+ case 85:
243
+ this.$ = y.LINETYPE.STICK_BOTTOM;
244
+ break;
245
+ case 86:
246
+ this.$ = y.LINETYPE.SOLID_TOP_DOTTED;
247
+ break;
248
+ case 87:
249
+ this.$ = y.LINETYPE.SOLID_BOTTOM_DOTTED;
250
+ break;
251
+ case 88:
252
+ this.$ = y.LINETYPE.STICK_TOP_DOTTED;
253
+ break;
254
+ case 89:
255
+ this.$ = y.LINETYPE.STICK_BOTTOM_DOTTED;
256
+ break;
257
+ case 90:
258
+ this.$ = y.LINETYPE.SOLID_ARROW_TOP_REVERSE;
259
+ break;
260
+ case 91:
261
+ this.$ = y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;
262
+ break;
263
+ case 92:
264
+ this.$ = y.LINETYPE.STICK_ARROW_TOP_REVERSE;
265
+ break;
266
+ case 93:
267
+ this.$ = y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;
268
+ break;
269
+ case 94:
270
+ this.$ = y.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;
271
+ break;
272
+ case 95:
273
+ this.$ = y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;
274
+ break;
275
+ case 96:
276
+ this.$ = y.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;
277
+ break;
278
+ case 97:
279
+ this.$ = y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;
280
+ break;
281
+ case 98:
282
+ this.$ = y.LINETYPE.BIDIRECTIONAL_SOLID;
283
+ break;
284
+ case 99:
285
+ this.$ = y.LINETYPE.DOTTED;
286
+ break;
287
+ case 100:
288
+ this.$ = y.LINETYPE.BIDIRECTIONAL_DOTTED;
289
+ break;
290
+ case 101:
291
+ this.$ = y.LINETYPE.SOLID_CROSS;
292
+ break;
293
+ case 102:
294
+ this.$ = y.LINETYPE.DOTTED_CROSS;
295
+ break;
296
+ case 103:
297
+ this.$ = y.LINETYPE.SOLID_POINT;
298
+ break;
299
+ case 104:
300
+ this.$ = y.LINETYPE.DOTTED_POINT;
301
+ break;
302
+ case 105:
303
+ this.$ = y.parseMessage(o[d].trim().substring(1));
304
+ break;
305
+ }
306
+ }, "anonymous"),
307
+ table: [{ 3: 1, 4: t, 5: a, 6: r }, { 1: [3] }, { 3: 5, 4: t, 5: a, 6: r }, { 3: 6, 4: t, 5: a, 6: r }, e([1, 4, 5, 10, 14, 15, 19, 22, 24, 30, 31, 32, 34, 36, 37, 38, 39, 40, 42, 44, 45, 47, 51, 53, 54, 56, 61, 62, 63, 64, 73], i, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: n, 5: s, 8: 8, 9: 10, 10: c, 13: 13, 14: E, 15: h, 18: 16, 19: p, 22: _, 23: 41, 24: u, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: O, 31: T, 32: g, 34: f, 36: I, 37: L, 38: b, 39: w, 40: A, 42: D, 44: M, 45: V, 47: W, 51: U, 53: G, 54: X, 56: nt, 61: j, 62: q, 63: st, 64: tt, 73: Y }, e(C, [2, 5]), { 9: 48, 13: 13, 14: E, 15: h, 18: 16, 19: p, 22: _, 23: 41, 24: u, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: O, 31: T, 32: g, 34: f, 36: I, 37: L, 38: b, 39: w, 40: A, 42: D, 44: M, 45: V, 47: W, 51: U, 53: G, 54: X, 56: nt, 61: j, 62: q, 63: st, 64: tt, 73: Y }, e(C, [2, 7]), e(C, [2, 8]), e(C, [2, 9]), e(C, [2, 15]), { 13: 49, 51: U, 53: G, 54: X }, { 16: [1, 50] }, { 5: [1, 51] }, { 5: [1, 54], 20: [1, 52], 21: [1, 53] }, { 23: 55, 73: Y }, { 23: 56, 73: Y }, { 5: [1, 57] }, { 5: [1, 58] }, { 5: [1, 59] }, { 5: [1, 60] }, { 5: [1, 61] }, e(C, [2, 30]), e(C, [2, 31]), { 33: [1, 62] }, { 35: [1, 63] }, e(C, [2, 34]), { 16: [1, 64] }, { 16: [1, 65] }, { 16: [1, 66] }, { 16: [1, 67] }, { 16: [1, 68] }, { 16: [1, 69] }, { 16: [1, 70] }, { 16: [1, 71] }, { 23: 72, 55: 73, 73: St }, { 23: 75, 55: 76, 73: St }, { 23: 77, 73: Y }, { 69: 78, 72: [1, 79], 78: Dt, 79: m, 80: k, 81: lt, 82: et, 83: K, 84: Ot, 85: oe, 86: ce, 87: le, 88: he, 89: de, 90: Te, 91: pe, 92: Ee, 93: ue, 94: fe, 95: _e, 96: ge, 97: xe, 98: Ie, 99: ye, 100: Re, 101: Oe, 102: Le, 103: be }, { 57: 106, 59: [1, 107], 67: [1, 108], 68: [1, 109] }, { 23: 110, 73: Y }, { 23: 111, 73: Y }, { 23: 112, 73: Y }, { 23: 113, 73: Y }, e([5, 66, 72, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104], me), e(C, [2, 6]), e(C, [2, 16]), e(wt, [2, 10], { 11: 114 }), e(C, [2, 18]), { 5: [1, 116], 20: [1, 115] }, { 5: [1, 117] }, e(C, [2, 22]), { 5: [1, 118] }, { 5: [1, 119] }, e(C, [2, 25]), e(C, [2, 26]), e(C, [2, 27]), e(C, [2, 28]), e(C, [2, 29]), e(C, [2, 32]), e(C, [2, 33]), e(vt, i, { 7: 120 }), e(vt, i, { 7: 121 }), e(vt, i, { 7: 122 }), e(Ae, i, { 41: 123, 7: 124 }), e(Gt, i, { 43: 125, 7: 126 }), e(Gt, i, { 7: 126, 43: 127 }), e(Se, i, { 46: 128, 7: 129 }), e(vt, i, { 7: 130 }), { 5: [1, 132], 52: [1, 131] }, { 5: [1, 134], 52: [1, 133] }, e(Xt, me, { 74: 135, 75: [1, 136] }), { 5: [1, 138], 52: [1, 137] }, { 5: [1, 140], 52: [1, 139] }, { 5: [1, 141] }, { 23: 145, 70: [1, 142], 71: [1, 143], 72: [1, 144], 73: Y }, { 69: 146, 78: Dt, 79: m, 80: k, 81: lt, 82: et, 83: K, 84: Ot, 85: oe, 86: ce, 87: le, 88: he, 89: de, 90: Te, 91: pe, 92: Ee, 93: ue, 94: fe, 95: _e, 96: ge, 97: xe, 98: Ie, 99: ye, 100: Re, 101: Oe, 102: Le, 103: be }, e(F, [2, 79]), e(F, [2, 80]), e(F, [2, 81]), e(F, [2, 82]), e(F, [2, 83]), e(F, [2, 84]), e(F, [2, 85]), e(F, [2, 86]), e(F, [2, 87]), e(F, [2, 88]), e(F, [2, 89]), e(F, [2, 90]), e(F, [2, 91]), e(F, [2, 92]), e(F, [2, 93]), e(F, [2, 94]), e(F, [2, 95]), e(F, [2, 96]), e(F, [2, 97]), e(F, [2, 98]), e(F, [2, 99]), e(F, [2, 100]), e(F, [2, 101]), e(F, [2, 102]), e(F, [2, 103]), e(F, [2, 104]), { 23: 147, 73: Y }, { 23: 149, 60: 148, 73: Y }, { 73: [2, 68] }, { 73: [2, 69] }, { 58: 150, 104: ot }, { 58: 152, 104: ot }, { 58: 153, 104: ot }, { 58: 154, 104: ot }, { 4: [1, 157], 5: [1, 159], 12: 156, 13: 158, 17: [1, 155], 51: U, 53: G, 54: X }, { 5: [1, 160] }, e(C, [2, 20]), e(C, [2, 21]), e(C, [2, 23]), e(C, [2, 24]), { 4: n, 5: s, 8: 8, 9: 10, 10: c, 13: 13, 14: E, 15: h, 17: [1, 161], 18: 16, 19: p, 22: _, 23: 41, 24: u, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: O, 31: T, 32: g, 34: f, 36: I, 37: L, 38: b, 39: w, 40: A, 42: D, 44: M, 45: V, 47: W, 51: U, 53: G, 54: X, 56: nt, 61: j, 62: q, 63: st, 64: tt, 73: Y }, { 4: n, 5: s, 8: 8, 9: 10, 10: c, 13: 13, 14: E, 15: h, 17: [1, 162], 18: 16, 19: p, 22: _, 23: 41, 24: u, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: O, 31: T, 32: g, 34: f, 36: I, 37: L, 38: b, 39: w, 40: A, 42: D, 44: M, 45: V, 47: W, 51: U, 53: G, 54: X, 56: nt, 61: j, 62: q, 63: st, 64: tt, 73: Y }, { 4: n, 5: s, 8: 8, 9: 10, 10: c, 13: 13, 14: E, 15: h, 17: [1, 163], 18: 16, 19: p, 22: _, 23: 41, 24: u, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: O, 31: T, 32: g, 34: f, 36: I, 37: L, 38: b, 39: w, 40: A, 42: D, 44: M, 45: V, 47: W, 51: U, 53: G, 54: X, 56: nt, 61: j, 62: q, 63: st, 64: tt, 73: Y }, { 17: [1, 164] }, { 4: n, 5: s, 8: 8, 9: 10, 10: c, 13: 13, 14: E, 15: h, 17: [2, 47], 18: 16, 19: p, 22: _, 23: 41, 24: u, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: O, 31: T, 32: g, 34: f, 36: I, 37: L, 38: b, 39: w, 40: A, 42: D, 44: M, 45: V, 47: W, 50: [1, 165], 51: U, 53: G, 54: X, 56: nt, 61: j, 62: q, 63: st, 64: tt, 73: Y }, { 17: [1, 166] }, { 4: n, 5: s, 8: 8, 9: 10, 10: c, 13: 13, 14: E, 15: h, 17: [2, 45], 18: 16, 19: p, 22: _, 23: 41, 24: u, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: O, 31: T, 32: g, 34: f, 36: I, 37: L, 38: b, 39: w, 40: A, 42: D, 44: M, 45: V, 47: W, 49: [1, 167], 51: U, 53: G, 54: X, 56: nt, 61: j, 62: q, 63: st, 64: tt, 73: Y }, { 17: [1, 168] }, { 17: [1, 169] }, { 4: n, 5: s, 8: 8, 9: 10, 10: c, 13: 13, 14: E, 15: h, 17: [2, 43], 18: 16, 19: p, 22: _, 23: 41, 24: u, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: O, 31: T, 32: g, 34: f, 36: I, 37: L, 38: b, 39: w, 40: A, 42: D, 44: M, 45: V, 47: W, 48: [1, 170], 51: U, 53: G, 54: X, 56: nt, 61: j, 62: q, 63: st, 64: tt, 73: Y }, { 4: n, 5: s, 8: 8, 9: 10, 10: c, 13: 13, 14: E, 15: h, 17: [1, 171], 18: 16, 19: p, 22: _, 23: 41, 24: u, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: O, 31: T, 32: g, 34: f, 36: I, 37: L, 38: b, 39: w, 40: A, 42: D, 44: M, 45: V, 47: W, 51: U, 53: G, 54: X, 56: nt, 61: j, 62: q, 63: st, 64: tt, 73: Y }, { 16: [1, 172] }, e(C, [2, 50]), { 16: [1, 173] }, e(C, [2, 55]), e(Xt, [2, 76]), { 76: [1, 174] }, { 16: [1, 175] }, e(C, [2, 52]), { 16: [1, 176] }, e(C, [2, 57]), e(C, [2, 53]), { 23: 177, 73: Y }, { 23: 178, 73: Y }, { 23: 179, 73: Y }, { 58: 180, 104: ot }, { 23: 181, 72: [1, 182], 73: Y }, { 58: 183, 104: ot }, { 58: 184, 104: ot }, { 66: [1, 185], 104: [2, 67] }, { 5: [2, 60] }, { 5: [2, 105] }, { 5: [2, 61] }, { 5: [2, 62] }, { 5: [2, 63] }, e(C, [2, 17]), e(wt, [2, 11]), { 13: 186, 51: U, 53: G, 54: X }, e(wt, [2, 13]), e(wt, [2, 14]), e(C, [2, 19]), e(C, [2, 35]), e(C, [2, 36]), e(C, [2, 37]), e(C, [2, 38]), { 16: [1, 187] }, e(C, [2, 39]), { 16: [1, 188] }, e(C, [2, 40]), e(C, [2, 41]), { 16: [1, 189] }, e(C, [2, 42]), { 5: [1, 190] }, { 5: [1, 191] }, { 77: [1, 192] }, { 5: [1, 193] }, { 5: [1, 194] }, { 58: 195, 104: ot }, { 58: 196, 104: ot }, { 58: 197, 104: ot }, { 5: [2, 75] }, { 58: 198, 104: ot }, { 23: 199, 73: Y }, { 5: [2, 58] }, { 5: [2, 59] }, { 23: 200, 73: Y }, e(wt, [2, 12]), e(Ae, i, { 7: 124, 41: 201 }), e(Gt, i, { 7: 126, 43: 202 }), e(Se, i, { 7: 129, 46: 203 }), e(C, [2, 49]), e(C, [2, 54]), e(Xt, [2, 77]), e(C, [2, 51]), e(C, [2, 56]), { 5: [2, 70] }, { 5: [2, 71] }, { 5: [2, 72] }, { 5: [2, 73] }, { 58: 204, 104: ot }, { 104: [2, 66] }, { 17: [2, 48] }, { 17: [2, 46] }, { 17: [2, 44] }, { 5: [2, 74] }],
308
+ defaultActions: { 5: [2, 1], 6: [2, 2], 108: [2, 68], 109: [2, 69], 150: [2, 60], 151: [2, 105], 152: [2, 61], 153: [2, 62], 154: [2, 63], 180: [2, 75], 183: [2, 58], 184: [2, 59], 195: [2, 70], 196: [2, 71], 197: [2, 72], 198: [2, 73], 200: [2, 66], 201: [2, 48], 202: [2, 46], 203: [2, 44], 204: [2, 74] },
309
+ parseError: /* @__PURE__ */ x(function(S, v) {
310
+ if (v.recoverable)
311
+ this.trace(S);
312
+ else {
313
+ var P = new Error(S);
314
+ throw P.hash = v, P;
315
+ }
316
+ }, "parseError"),
317
+ parse: /* @__PURE__ */ x(function(S) {
318
+ var v = this, P = [0], y = [], z = [null], o = [], Nt = this.table, d = "", Mt = 0, we = 0, Qe = 2, Ne = 1, $e = o.slice.call(arguments, 1), J = Object.create(this.lexer), gt = { yy: {} };
319
+ for (var Zt in this.yy)
320
+ Object.prototype.hasOwnProperty.call(this.yy, Zt) && (gt.yy[Zt] = this.yy[Zt]);
321
+ J.setInput(S, gt.yy), gt.yy.lexer = J, gt.yy.parser = this, typeof J.yylloc > "u" && (J.yylloc = {});
322
+ var Qt = J.yylloc;
323
+ o.push(Qt);
324
+ var je = J.options && J.options.ranges;
325
+ typeof gt.yy.parseError == "function" ? this.parseError = gt.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
326
+ function tr(it) {
327
+ P.length = P.length - 2 * it, z.length = z.length - it, o.length = o.length - it;
328
+ }
329
+ x(tr, "popStack");
330
+ function Pe() {
331
+ var it;
332
+ return it = y.pop() || J.lex() || Ne, typeof it != "number" && (it instanceof Array && (y = it, it = y.pop()), it = v.symbols_[it] || it), it;
333
+ }
334
+ x(Pe, "lex");
335
+ for (var rt, xt, ct, $t, Lt = {}, Bt, Tt, ke, Vt; ; ) {
336
+ if (xt = P[P.length - 1], this.defaultActions[xt] ? ct = this.defaultActions[xt] : ((rt === null || typeof rt > "u") && (rt = Pe()), ct = Nt[xt] && Nt[xt][rt]), typeof ct > "u" || !ct.length || !ct[0]) {
337
+ var jt = "";
338
+ Vt = [];
339
+ for (Bt in Nt[xt])
340
+ this.terminals_[Bt] && Bt > Qe && Vt.push("'" + this.terminals_[Bt] + "'");
341
+ J.showPosition ? jt = "Parse error on line " + (Mt + 1) + `:
342
+ ` + J.showPosition() + `
343
+ Expecting ` + Vt.join(", ") + ", got '" + (this.terminals_[rt] || rt) + "'" : jt = "Parse error on line " + (Mt + 1) + ": Unexpected " + (rt == Ne ? "end of input" : "'" + (this.terminals_[rt] || rt) + "'"), this.parseError(jt, {
344
+ text: J.match,
345
+ token: this.terminals_[rt] || rt,
346
+ line: J.yylineno,
347
+ loc: Qt,
348
+ expected: Vt
349
+ });
350
+ }
351
+ if (ct[0] instanceof Array && ct.length > 1)
352
+ throw new Error("Parse Error: multiple actions possible at state: " + xt + ", token: " + rt);
353
+ switch (ct[0]) {
354
+ case 1:
355
+ P.push(rt), z.push(J.yytext), o.push(J.yylloc), P.push(ct[1]), rt = null, we = J.yyleng, d = J.yytext, Mt = J.yylineno, Qt = J.yylloc;
356
+ break;
357
+ case 2:
358
+ if (Tt = this.productions_[ct[1]][1], Lt.$ = z[z.length - Tt], Lt._$ = {
359
+ first_line: o[o.length - (Tt || 1)].first_line,
360
+ last_line: o[o.length - 1].last_line,
361
+ first_column: o[o.length - (Tt || 1)].first_column,
362
+ last_column: o[o.length - 1].last_column
363
+ }, je && (Lt._$.range = [
364
+ o[o.length - (Tt || 1)].range[0],
365
+ o[o.length - 1].range[1]
366
+ ]), $t = this.performAction.apply(Lt, [
367
+ d,
368
+ we,
369
+ Mt,
370
+ gt.yy,
371
+ ct[1],
372
+ z,
373
+ o
374
+ ].concat($e)), typeof $t < "u")
375
+ return $t;
376
+ Tt && (P = P.slice(0, -1 * Tt * 2), z = z.slice(0, -1 * Tt), o = o.slice(0, -1 * Tt)), P.push(this.productions_[ct[1]][0]), z.push(Lt.$), o.push(Lt._$), ke = Nt[P[P.length - 2]][P[P.length - 1]], P.push(ke);
377
+ break;
378
+ case 3:
379
+ return !0;
380
+ }
381
+ }
382
+ return !0;
383
+ }, "parse")
384
+ }, Ze = /* @__PURE__ */ function() {
385
+ var ut = {
386
+ EOF: 1,
387
+ parseError: /* @__PURE__ */ x(function(v, P) {
388
+ if (this.yy.parser)
389
+ this.yy.parser.parseError(v, P);
390
+ else
391
+ throw new Error(v);
392
+ }, "parseError"),
393
+ // resets the lexer, sets new input
394
+ setInput: /* @__PURE__ */ x(function(S, v) {
395
+ return this.yy = v || this.yy || {}, this._input = S, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
396
+ first_line: 1,
397
+ first_column: 0,
398
+ last_line: 1,
399
+ last_column: 0
400
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
401
+ }, "setInput"),
402
+ // consumes and returns one char from the input
403
+ input: /* @__PURE__ */ x(function() {
404
+ var S = this._input[0];
405
+ this.yytext += S, this.yyleng++, this.offset++, this.match += S, this.matched += S;
406
+ var v = S.match(/(?:\r\n?|\n).*/g);
407
+ return v ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), S;
408
+ }, "input"),
409
+ // unshifts one char (or a string) into the input
410
+ unput: /* @__PURE__ */ x(function(S) {
411
+ var v = S.length, P = S.split(/(?:\r\n?|\n)/g);
412
+ this._input = S + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - v), this.offset -= v;
413
+ var y = this.match.split(/(?:\r\n?|\n)/g);
414
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), P.length - 1 && (this.yylineno -= P.length - 1);
415
+ var z = this.yylloc.range;
416
+ return this.yylloc = {
417
+ first_line: this.yylloc.first_line,
418
+ last_line: this.yylineno + 1,
419
+ first_column: this.yylloc.first_column,
420
+ last_column: P ? (P.length === y.length ? this.yylloc.first_column : 0) + y[y.length - P.length].length - P[0].length : this.yylloc.first_column - v
421
+ }, this.options.ranges && (this.yylloc.range = [z[0], z[0] + this.yyleng - v]), this.yyleng = this.yytext.length, this;
422
+ }, "unput"),
423
+ // When called from action, caches matched text and appends it on next action
424
+ more: /* @__PURE__ */ x(function() {
425
+ return this._more = !0, this;
426
+ }, "more"),
427
+ // 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.
428
+ reject: /* @__PURE__ */ x(function() {
429
+ if (this.options.backtrack_lexer)
430
+ this._backtrack = !0;
431
+ else
432
+ 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).
433
+ ` + this.showPosition(), {
434
+ text: "",
435
+ token: null,
436
+ line: this.yylineno
437
+ });
438
+ return this;
439
+ }, "reject"),
440
+ // retain first n characters of the match
441
+ less: /* @__PURE__ */ x(function(S) {
442
+ this.unput(this.match.slice(S));
443
+ }, "less"),
444
+ // displays already matched input, i.e. for error messages
445
+ pastInput: /* @__PURE__ */ x(function() {
446
+ var S = this.matched.substr(0, this.matched.length - this.match.length);
447
+ return (S.length > 20 ? "..." : "") + S.substr(-20).replace(/\n/g, "");
448
+ }, "pastInput"),
449
+ // displays upcoming input, i.e. for error messages
450
+ upcomingInput: /* @__PURE__ */ x(function() {
451
+ var S = this.match;
452
+ return S.length < 20 && (S += this._input.substr(0, 20 - S.length)), (S.substr(0, 20) + (S.length > 20 ? "..." : "")).replace(/\n/g, "");
453
+ }, "upcomingInput"),
454
+ // displays the character position where the lexing error occurred, i.e. for error messages
455
+ showPosition: /* @__PURE__ */ x(function() {
456
+ var S = this.pastInput(), v = new Array(S.length + 1).join("-");
457
+ return S + this.upcomingInput() + `
458
+ ` + v + "^";
459
+ }, "showPosition"),
460
+ // test the lexed token: return FALSE when not a match, otherwise return token
461
+ test_match: /* @__PURE__ */ x(function(S, v) {
462
+ var P, y, z;
463
+ if (this.options.backtrack_lexer && (z = {
464
+ yylineno: this.yylineno,
465
+ yylloc: {
466
+ first_line: this.yylloc.first_line,
467
+ last_line: this.last_line,
468
+ first_column: this.yylloc.first_column,
469
+ last_column: this.yylloc.last_column
470
+ },
471
+ yytext: this.yytext,
472
+ match: this.match,
473
+ matches: this.matches,
474
+ matched: this.matched,
475
+ yyleng: this.yyleng,
476
+ offset: this.offset,
477
+ _more: this._more,
478
+ _input: this._input,
479
+ yy: this.yy,
480
+ conditionStack: this.conditionStack.slice(0),
481
+ done: this.done
482
+ }, this.options.ranges && (z.yylloc.range = this.yylloc.range.slice(0))), y = S[0].match(/(?:\r\n?|\n).*/g), y && (this.yylineno += y.length), this.yylloc = {
483
+ first_line: this.yylloc.last_line,
484
+ last_line: this.yylineno + 1,
485
+ first_column: this.yylloc.last_column,
486
+ last_column: y ? y[y.length - 1].length - y[y.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + S[0].length
487
+ }, this.yytext += S[0], this.match += S[0], this.matches = S, 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(S[0].length), this.matched += S[0], P = this.performAction.call(this, this.yy, this, v, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), P)
488
+ return P;
489
+ if (this._backtrack) {
490
+ for (var o in z)
491
+ this[o] = z[o];
492
+ return !1;
493
+ }
494
+ return !1;
495
+ }, "test_match"),
496
+ // return next match in input
497
+ next: /* @__PURE__ */ x(function() {
498
+ if (this.done)
499
+ return this.EOF;
500
+ this._input || (this.done = !0);
501
+ var S, v, P, y;
502
+ this._more || (this.yytext = "", this.match = "");
503
+ for (var z = this._currentRules(), o = 0; o < z.length; o++)
504
+ if (P = this._input.match(this.rules[z[o]]), P && (!v || P[0].length > v[0].length)) {
505
+ if (v = P, y = o, this.options.backtrack_lexer) {
506
+ if (S = this.test_match(P, z[o]), S !== !1)
507
+ return S;
508
+ if (this._backtrack) {
509
+ v = !1;
510
+ continue;
511
+ } else
512
+ return !1;
513
+ } else if (!this.options.flex)
514
+ break;
515
+ }
516
+ return v ? (S = this.test_match(v, z[y]), S !== !1 ? S : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
517
+ ` + this.showPosition(), {
518
+ text: "",
519
+ token: null,
520
+ line: this.yylineno
521
+ });
522
+ }, "next"),
523
+ // return next match that has a token
524
+ lex: /* @__PURE__ */ x(function() {
525
+ var v = this.next();
526
+ return v || this.lex();
527
+ }, "lex"),
528
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
529
+ begin: /* @__PURE__ */ x(function(v) {
530
+ this.conditionStack.push(v);
531
+ }, "begin"),
532
+ // pop the previously active lexer condition state off the condition stack
533
+ popState: /* @__PURE__ */ x(function() {
534
+ var v = this.conditionStack.length - 1;
535
+ return v > 0 ? this.conditionStack.pop() : this.conditionStack[0];
536
+ }, "popState"),
537
+ // produce the lexer rule set which is active for the currently active lexer condition state
538
+ _currentRules: /* @__PURE__ */ x(function() {
539
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
540
+ }, "_currentRules"),
541
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
542
+ topState: /* @__PURE__ */ x(function(v) {
543
+ return v = this.conditionStack.length - 1 - Math.abs(v || 0), v >= 0 ? this.conditionStack[v] : "INITIAL";
544
+ }, "topState"),
545
+ // alias for begin(condition)
546
+ pushState: /* @__PURE__ */ x(function(v) {
547
+ this.begin(v);
548
+ }, "pushState"),
549
+ // return the number of states currently on the stack
550
+ stateStackSize: /* @__PURE__ */ x(function() {
551
+ return this.conditionStack.length;
552
+ }, "stateStackSize"),
553
+ options: { "case-insensitive": !0 },
554
+ performAction: /* @__PURE__ */ x(function(v, P, y, z) {
555
+ switch (y) {
556
+ case 0:
557
+ return 5;
558
+ case 1:
559
+ break;
560
+ case 2:
561
+ break;
562
+ case 3:
563
+ break;
564
+ case 4:
565
+ break;
566
+ case 5:
567
+ break;
568
+ case 6:
569
+ return 20;
570
+ case 7:
571
+ return this.begin("CONFIG"), 75;
572
+ case 8:
573
+ return 76;
574
+ case 9:
575
+ return this.popState(), this.begin("ALIAS"), 77;
576
+ case 10:
577
+ return this.popState(), this.popState(), 77;
578
+ case 11:
579
+ return P.yytext = P.yytext.trim(), 73;
580
+ case 12:
581
+ return P.yytext = P.yytext.trim(), this.begin("ALIAS"), 73;
582
+ case 13:
583
+ return P.yytext = P.yytext.trim(), this.popState(), 73;
584
+ case 14:
585
+ return this.popState(), 10;
586
+ case 15:
587
+ return P.yytext = P.yytext.trim(), this.popState(), 10;
588
+ case 16:
589
+ return this.begin("LINE"), 15;
590
+ case 17:
591
+ return this.begin("ID"), 51;
592
+ case 18:
593
+ return this.begin("ID"), 53;
594
+ case 19:
595
+ return 14;
596
+ case 20:
597
+ return this.begin("ID"), 54;
598
+ case 21:
599
+ return this.popState(), this.popState(), this.begin("LINE"), 52;
600
+ case 22:
601
+ return this.popState(), this.popState(), 5;
602
+ case 23:
603
+ return this.begin("LINE"), 37;
604
+ case 24:
605
+ return this.begin("LINE"), 38;
606
+ case 25:
607
+ return this.begin("LINE"), 39;
608
+ case 26:
609
+ return this.begin("LINE"), 40;
610
+ case 27:
611
+ return this.begin("LINE"), 50;
612
+ case 28:
613
+ return this.begin("LINE"), 42;
614
+ case 29:
615
+ return this.begin("LINE"), 44;
616
+ case 30:
617
+ return this.begin("LINE"), 49;
618
+ case 31:
619
+ return this.begin("LINE"), 45;
620
+ case 32:
621
+ return this.begin("LINE"), 48;
622
+ case 33:
623
+ return this.begin("LINE"), 47;
624
+ case 34:
625
+ return this.popState(), 16;
626
+ case 35:
627
+ return 17;
628
+ case 36:
629
+ return 67;
630
+ case 37:
631
+ return 68;
632
+ case 38:
633
+ return 61;
634
+ case 39:
635
+ return 62;
636
+ case 40:
637
+ return 63;
638
+ case 41:
639
+ return 64;
640
+ case 42:
641
+ return 59;
642
+ case 43:
643
+ return 56;
644
+ case 44:
645
+ return this.begin("ID"), 22;
646
+ case 45:
647
+ return this.begin("ID"), 24;
648
+ case 46:
649
+ return 30;
650
+ case 47:
651
+ return 31;
652
+ case 48:
653
+ return this.begin("acc_title"), 32;
654
+ case 49:
655
+ return this.popState(), "acc_title_value";
656
+ case 50:
657
+ return this.begin("acc_descr"), 34;
658
+ case 51:
659
+ return this.popState(), "acc_descr_value";
660
+ case 52:
661
+ this.begin("acc_descr_multiline");
662
+ break;
663
+ case 53:
664
+ this.popState();
665
+ break;
666
+ case 54:
667
+ return "acc_descr_multiline_value";
668
+ case 55:
669
+ return 6;
670
+ case 56:
671
+ return 19;
672
+ case 57:
673
+ return 21;
674
+ case 58:
675
+ return 66;
676
+ case 59:
677
+ return 5;
678
+ case 60:
679
+ return P.yytext = P.yytext.trim(), 73;
680
+ case 61:
681
+ return 80;
682
+ case 62:
683
+ return 97;
684
+ case 63:
685
+ return 98;
686
+ case 64:
687
+ return 99;
688
+ case 65:
689
+ return 78;
690
+ case 66:
691
+ return 79;
692
+ case 67:
693
+ return 100;
694
+ case 68:
695
+ return 101;
696
+ case 69:
697
+ return 102;
698
+ case 70:
699
+ return 103;
700
+ case 71:
701
+ return 85;
702
+ case 72:
703
+ return 86;
704
+ case 73:
705
+ return 87;
706
+ case 74:
707
+ return 88;
708
+ case 75:
709
+ return 93;
710
+ case 76:
711
+ return 94;
712
+ case 77:
713
+ return 95;
714
+ case 78:
715
+ return 96;
716
+ case 79:
717
+ return 81;
718
+ case 80:
719
+ return 82;
720
+ case 81:
721
+ return 83;
722
+ case 82:
723
+ return 84;
724
+ case 83:
725
+ return 89;
726
+ case 84:
727
+ return 90;
728
+ case 85:
729
+ return 91;
730
+ case 86:
731
+ return 92;
732
+ case 87:
733
+ return 104;
734
+ case 88:
735
+ return 104;
736
+ case 89:
737
+ return 70;
738
+ case 90:
739
+ return 71;
740
+ case 91:
741
+ return 72;
742
+ case 92:
743
+ return 5;
744
+ case 93:
745
+ return 10;
746
+ }
747
+ }, "anonymous"),
748
+ rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i, /^(?:@\{)/i, /^(?:[^\}]+)/i, /^(?:\}(?=\s+as\s))/i, /^(?:\})/i, /^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i, /^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i, /^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i, /^(?:[^<>:\n,;@]*<[^\n]*)/i, /^(?:[^\n]+)/i, /^(?:box\b)/i, /^(?:participant\b)/i, /^(?:actor\b)/i, /^(?:create\b)/i, /^(?:destroy\b)/i, /^(?:as\b)/i, /^(?:(?:))/i, /^(?:loop\b)/i, /^(?:rect\b)/i, /^(?:opt\b)/i, /^(?:alt\b)/i, /^(?:else\b)/i, /^(?:par\b)/i, /^(?:par_over\b)/i, /^(?:and\b)/i, /^(?:critical\b)/i, /^(?:option\b)/i, /^(?:break\b)/i, /^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:links\b)/i, /^(?:link\b)/i, /^(?:properties\b)/i, /^(?:details\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:activate\b)/i, /^(?:deactivate\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:title:\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:sequenceDiagram\b)/i, /^(?:autonumber\b)/i, /^(?:off\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i, /^(?:->>)/i, /^(?:<<->>)/i, /^(?:-->>)/i, /^(?:<<-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?:-[\)])/i, /^(?:--[\)])/i, /^(?:--\|\\)/i, /^(?:--\|\/)/i, /^(?:--\\\\)/i, /^(?:--\/\/)/i, /^(?:\/\|--)/i, /^(?:\\\|--)/i, /^(?:\/\/--)/i, /^(?:\\\\--)/i, /^(?:-\|\\)/i, /^(?:-\|\/)/i, /^(?:-\\\\)/i, /^(?:-\/\/)/i, /^(?:\/\|-)/i, /^(?:\\\|-)/i, /^(?:\/\/-)/i, /^(?:\\\\-)/i, /^(?::(?:(?:no)?wrap)?[^#\n;]*)/i, /^(?::)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:\(\))/i, /^(?:$)/i, /^(?:.)/i],
749
+ conditions: { acc_descr_multiline: { rules: [53, 54], inclusive: !1 }, acc_descr: { rules: [51], inclusive: !1 }, acc_title: { rules: [49], inclusive: !1 }, ID: { rules: [2, 3, 7, 11, 12, 13, 14, 15], inclusive: !1 }, ALIAS: { rules: [2, 3, 21, 22], inclusive: !1 }, LINE: { rules: [2, 3, 34], inclusive: !1 }, CONFIG: { rules: [8, 9, 10], inclusive: !1 }, CONFIG_DATA: { rules: [], inclusive: !1 }, INITIAL: { rules: [0, 1, 3, 4, 5, 6, 16, 17, 18, 19, 20, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 52, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], inclusive: !0 } }
750
+ };
751
+ return ut;
752
+ }();
753
+ Jt.lexer = Ze;
754
+ function Ct() {
755
+ this.yy = {};
756
+ }
757
+ return x(Ct, "Parser"), Ct.prototype = Jt, Jt.Parser = Ct, new Ct();
758
+ }();
759
+ ee.parser = ee;
760
+ var _r = ee, gr = {
761
+ SOLID: 0,
762
+ DOTTED: 1,
763
+ NOTE: 2,
764
+ SOLID_CROSS: 3,
765
+ DOTTED_CROSS: 4,
766
+ SOLID_OPEN: 5,
767
+ DOTTED_OPEN: 6,
768
+ LOOP_START: 10,
769
+ LOOP_END: 11,
770
+ ALT_START: 12,
771
+ ALT_ELSE: 13,
772
+ ALT_END: 14,
773
+ OPT_START: 15,
774
+ OPT_END: 16,
775
+ ACTIVE_START: 17,
776
+ ACTIVE_END: 18,
777
+ PAR_START: 19,
778
+ PAR_AND: 20,
779
+ PAR_END: 21,
780
+ RECT_START: 22,
781
+ RECT_END: 23,
782
+ SOLID_POINT: 24,
783
+ DOTTED_POINT: 25,
784
+ AUTONUMBER: 26,
785
+ CRITICAL_START: 27,
786
+ CRITICAL_OPTION: 28,
787
+ CRITICAL_END: 29,
788
+ BREAK_START: 30,
789
+ BREAK_END: 31,
790
+ PAR_OVER_START: 32,
791
+ BIDIRECTIONAL_SOLID: 33,
792
+ BIDIRECTIONAL_DOTTED: 34,
793
+ SOLID_TOP: 41,
794
+ SOLID_BOTTOM: 42,
795
+ STICK_TOP: 43,
796
+ STICK_BOTTOM: 44,
797
+ SOLID_ARROW_TOP_REVERSE: 45,
798
+ SOLID_ARROW_BOTTOM_REVERSE: 46,
799
+ STICK_ARROW_TOP_REVERSE: 47,
800
+ STICK_ARROW_BOTTOM_REVERSE: 48,
801
+ SOLID_TOP_DOTTED: 51,
802
+ SOLID_BOTTOM_DOTTED: 52,
803
+ STICK_TOP_DOTTED: 53,
804
+ STICK_BOTTOM_DOTTED: 54,
805
+ SOLID_ARROW_TOP_REVERSE_DOTTED: 55,
806
+ SOLID_ARROW_BOTTOM_REVERSE_DOTTED: 56,
807
+ STICK_ARROW_TOP_REVERSE_DOTTED: 57,
808
+ STICK_ARROW_BOTTOM_REVERSE_DOTTED: 58,
809
+ CENTRAL_CONNECTION: 59,
810
+ CENTRAL_CONNECTION_REVERSE: 60,
811
+ CENTRAL_CONNECTION_DUAL: 61
812
+ }, xr = {
813
+ FILLED: 0,
814
+ OPEN: 1
815
+ }, Ir = {
816
+ LEFTOF: 0,
817
+ RIGHTOF: 1,
818
+ OVER: 2
819
+ }, Kt = {
820
+ ACTOR: "actor",
821
+ CONTROL: "control",
822
+ DATABASE: "database",
823
+ ENTITY: "entity"
824
+ }, mt, yr = (mt = class {
825
+ constructor() {
826
+ this.state = new er(() => ({
827
+ prevActor: void 0,
828
+ actors: /* @__PURE__ */ new Map(),
829
+ createdActors: /* @__PURE__ */ new Map(),
830
+ destroyedActors: /* @__PURE__ */ new Map(),
831
+ boxes: [],
832
+ messages: [],
833
+ notes: [],
834
+ sequenceNumbersEnabled: !1,
835
+ wrapEnabled: void 0,
836
+ currentBox: void 0,
837
+ lastCreated: void 0,
838
+ lastDestroyed: void 0
839
+ })), this.setAccTitle = De, this.setAccDescription = ir, this.setDiagramTitle = nr, this.getAccTitle = or, this.getAccDescription = cr, this.getDiagramTitle = lr, this.apply = this.apply.bind(this), this.parseBoxData = this.parseBoxData.bind(this), this.parseMessage = this.parseMessage.bind(this), this.clear(), this.setWrap($().wrap), this.LINETYPE = gr, this.ARROWTYPE = xr, this.PLACEMENT = Ir;
840
+ }
841
+ addBox(t) {
842
+ this.state.records.boxes.push({
843
+ name: t.text,
844
+ wrap: t.wrap ?? this.autoWrap(),
845
+ fill: t.color,
846
+ actorKeys: []
847
+ }), this.state.records.currentBox = this.state.records.boxes.slice(-1)[0];
848
+ }
849
+ addActor(t, a, r, i, n) {
850
+ let s = this.state.records.currentBox, c;
851
+ if (n !== void 0) {
852
+ let h;
853
+ n.includes(`
854
+ `) ? h = n + `
855
+ ` : h = `{
856
+ ` + n + `
857
+ }`, c = hr(h, { schema: dr });
858
+ }
859
+ i = c?.type ?? i, c?.alias && (!r || r.text === a) && (r = { text: c.alias, wrap: r?.wrap, type: i });
860
+ const E = this.state.records.actors.get(t);
861
+ if (E) {
862
+ if (this.state.records.currentBox && E.box && this.state.records.currentBox !== E.box)
863
+ throw new Error(
864
+ `A same participant should only be defined in one Box: ${E.name} can't be in '${E.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`
865
+ );
866
+ if (s = E.box ? E.box : this.state.records.currentBox, E.box = s, E && a === E.name && r == null)
867
+ return;
868
+ }
869
+ if (r?.text == null && (r = { text: a, type: i }), (i == null || r.text == null) && (r = { text: a, type: i }), this.state.records.actors.set(t, {
870
+ box: s,
871
+ name: a,
872
+ description: r.text,
873
+ wrap: r.wrap ?? this.autoWrap(),
874
+ prevActor: this.state.records.prevActor,
875
+ links: {},
876
+ properties: {},
877
+ actorCnt: null,
878
+ rectData: null,
879
+ type: i ?? "participant"
880
+ }), this.state.records.prevActor) {
881
+ const h = this.state.records.actors.get(this.state.records.prevActor);
882
+ h && (h.nextActor = t);
883
+ }
884
+ this.state.records.currentBox && this.state.records.currentBox.actorKeys.push(t), this.state.records.prevActor = t;
885
+ }
886
+ activationCount(t) {
887
+ let a, r = 0;
888
+ if (!t)
889
+ return 0;
890
+ for (a = 0; a < this.state.records.messages.length; a++)
891
+ this.state.records.messages[a].type === this.LINETYPE.ACTIVE_START && this.state.records.messages[a].from === t && r++, this.state.records.messages[a].type === this.LINETYPE.ACTIVE_END && this.state.records.messages[a].from === t && r--;
892
+ return r;
893
+ }
894
+ addMessage(t, a, r, i) {
895
+ this.state.records.messages.push({
896
+ id: this.state.records.messages.length.toString(),
897
+ from: t,
898
+ to: a,
899
+ message: r.text,
900
+ wrap: r.wrap ?? this.autoWrap(),
901
+ answer: i
902
+ });
903
+ }
904
+ addSignal(t, a, r, i, n = !1, s) {
905
+ if (i === this.LINETYPE.ACTIVE_END && this.activationCount(t ?? "") < 1) {
906
+ const E = new Error("Trying to inactivate an inactive participant (" + t + ")");
907
+ throw E.hash = {
908
+ text: "->>-",
909
+ token: "->>-",
910
+ line: "1",
911
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
912
+ expected: ["'ACTIVE_PARTICIPANT'"]
913
+ }, E;
914
+ }
915
+ return this.state.records.messages.push({
916
+ id: this.state.records.messages.length.toString(),
917
+ from: t,
918
+ to: a,
919
+ message: r?.text ?? "",
920
+ wrap: r?.wrap ?? this.autoWrap(),
921
+ type: i,
922
+ activate: n,
923
+ centralConnection: s ?? 0
924
+ }), !0;
925
+ }
926
+ hasAtLeastOneBox() {
927
+ return this.state.records.boxes.length > 0;
928
+ }
929
+ hasAtLeastOneBoxWithTitle() {
930
+ return this.state.records.boxes.some((t) => t.name);
931
+ }
932
+ getMessages() {
933
+ return this.state.records.messages;
934
+ }
935
+ getBoxes() {
936
+ return this.state.records.boxes;
937
+ }
938
+ getActors() {
939
+ return this.state.records.actors;
940
+ }
941
+ getCreatedActors() {
942
+ return this.state.records.createdActors;
943
+ }
944
+ getDestroyedActors() {
945
+ return this.state.records.destroyedActors;
946
+ }
947
+ getActor(t) {
948
+ return this.state.records.actors.get(t);
949
+ }
950
+ getActorKeys() {
951
+ return [...this.state.records.actors.keys()];
952
+ }
953
+ enableSequenceNumbers() {
954
+ this.state.records.sequenceNumbersEnabled = !0;
955
+ }
956
+ disableSequenceNumbers() {
957
+ this.state.records.sequenceNumbersEnabled = !1;
958
+ }
959
+ showSequenceNumbers() {
960
+ return this.state.records.sequenceNumbersEnabled;
961
+ }
962
+ setWrap(t) {
963
+ this.state.records.wrapEnabled = t;
964
+ }
965
+ extractWrap(t) {
966
+ if (t === void 0)
967
+ return {};
968
+ t = t.trim();
969
+ const a = /^:?wrap:/.exec(t) !== null ? !0 : /^:?nowrap:/.exec(t) !== null ? !1 : void 0;
970
+ return { cleanedText: (a === void 0 ? t : t.replace(/^:?(?:no)?wrap:/, "")).trim(), wrap: a };
971
+ }
972
+ autoWrap() {
973
+ return this.state.records.wrapEnabled !== void 0 ? this.state.records.wrapEnabled : $().sequence?.wrap ?? !1;
974
+ }
975
+ clear() {
976
+ this.state.reset(), Tr();
977
+ }
978
+ parseMessage(t) {
979
+ const a = t.trim(), { wrap: r, cleanedText: i } = this.extractWrap(a), n = {
980
+ text: i,
981
+ wrap: r
982
+ };
983
+ return at.debug(`parseMessage: ${JSON.stringify(n)}`), n;
984
+ }
985
+ // We expect the box statement to be color first then description
986
+ // The color can be rgb,rgba,hsl,hsla, or css code names #hex codes are not supported for now because of the way the char # is handled
987
+ // We extract first segment as color, the rest of the line is considered as text
988
+ parseBoxData(t) {
989
+ const a = /^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);
990
+ let r = a?.[1] ? a[1].trim() : "transparent", i = a?.[2] ? a[2].trim() : void 0;
991
+ if (window?.CSS)
992
+ window.CSS.supports("color", r) || (r = "transparent", i = t.trim());
993
+ else {
994
+ const c = new Option().style;
995
+ c.color = r, c.color !== r && (r = "transparent", i = t.trim());
996
+ }
997
+ const { wrap: n, cleanedText: s } = this.extractWrap(i);
998
+ return {
999
+ text: s ? Yt(s, $()) : void 0,
1000
+ color: r,
1001
+ wrap: n
1002
+ };
1003
+ }
1004
+ addNote(t, a, r) {
1005
+ const i = {
1006
+ actor: t,
1007
+ placement: a,
1008
+ message: r.text,
1009
+ wrap: r.wrap ?? this.autoWrap()
1010
+ }, n = [].concat(t, t);
1011
+ this.state.records.notes.push(i), this.state.records.messages.push({
1012
+ id: this.state.records.messages.length.toString(),
1013
+ from: n[0],
1014
+ to: n[1],
1015
+ message: r.text,
1016
+ wrap: r.wrap ?? this.autoWrap(),
1017
+ type: this.LINETYPE.NOTE,
1018
+ placement: a
1019
+ });
1020
+ }
1021
+ addLinks(t, a) {
1022
+ const r = this.getActor(t);
1023
+ try {
1024
+ let i = Yt(a.text, $());
1025
+ i = i.replace(/&equals;/g, "="), i = i.replace(/&amp;/g, "&");
1026
+ const n = JSON.parse(i);
1027
+ this.insertLinks(r, n);
1028
+ } catch (i) {
1029
+ at.error("error while parsing actor link text", i);
1030
+ }
1031
+ }
1032
+ addALink(t, a) {
1033
+ const r = this.getActor(t);
1034
+ try {
1035
+ const i = {};
1036
+ let n = Yt(a.text, $());
1037
+ const s = n.indexOf("@");
1038
+ n = n.replace(/&equals;/g, "="), n = n.replace(/&amp;/g, "&");
1039
+ const c = n.slice(0, s - 1).trim(), E = n.slice(s + 1).trim();
1040
+ i[c] = E, this.insertLinks(r, i);
1041
+ } catch (i) {
1042
+ at.error("error while parsing actor link text", i);
1043
+ }
1044
+ }
1045
+ insertLinks(t, a) {
1046
+ if (t.links == null)
1047
+ t.links = a;
1048
+ else
1049
+ for (const r in a)
1050
+ t.links[r] = a[r];
1051
+ }
1052
+ addProperties(t, a) {
1053
+ const r = this.getActor(t);
1054
+ try {
1055
+ const i = Yt(a.text, $()), n = JSON.parse(i);
1056
+ this.insertProperties(r, n);
1057
+ } catch (i) {
1058
+ at.error("error while parsing actor properties text", i);
1059
+ }
1060
+ }
1061
+ insertProperties(t, a) {
1062
+ if (t.properties == null)
1063
+ t.properties = a;
1064
+ else
1065
+ for (const r in a)
1066
+ t.properties[r] = a[r];
1067
+ }
1068
+ boxEnd() {
1069
+ this.state.records.currentBox = void 0;
1070
+ }
1071
+ addDetails(t, a) {
1072
+ const r = this.getActor(t), i = document.getElementById(a.text);
1073
+ try {
1074
+ const n = i.innerHTML, s = JSON.parse(n);
1075
+ s.properties && this.insertProperties(r, s.properties), s.links && this.insertLinks(r, s.links);
1076
+ } catch (n) {
1077
+ at.error("error while parsing actor details text", n);
1078
+ }
1079
+ }
1080
+ getActorProperty(t, a) {
1081
+ if (t?.properties !== void 0)
1082
+ return t.properties[a];
1083
+ }
1084
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-redundant-type-constituents
1085
+ apply(t) {
1086
+ if (Array.isArray(t))
1087
+ t.forEach((a) => {
1088
+ this.apply(a);
1089
+ });
1090
+ else
1091
+ switch (t.type) {
1092
+ case "sequenceIndex":
1093
+ this.state.records.messages.push({
1094
+ id: this.state.records.messages.length.toString(),
1095
+ from: void 0,
1096
+ to: void 0,
1097
+ message: {
1098
+ start: t.sequenceIndex,
1099
+ step: t.sequenceIndexStep,
1100
+ visible: t.sequenceVisible
1101
+ },
1102
+ wrap: !1,
1103
+ type: t.signalType
1104
+ });
1105
+ break;
1106
+ case "addParticipant":
1107
+ this.addActor(t.actor, t.actor, t.description, t.draw, t.config);
1108
+ break;
1109
+ case "createParticipant":
1110
+ if (this.state.records.actors.has(t.actor))
1111
+ throw new Error(
1112
+ "It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior"
1113
+ );
1114
+ this.state.records.lastCreated = t.actor, this.addActor(t.actor, t.actor, t.description, t.draw, t.config), this.state.records.createdActors.set(t.actor, this.state.records.messages.length);
1115
+ break;
1116
+ case "destroyParticipant":
1117
+ this.state.records.lastDestroyed = t.actor, this.state.records.destroyedActors.set(t.actor, this.state.records.messages.length);
1118
+ break;
1119
+ case "activeStart":
1120
+ this.addSignal(t.actor, void 0, void 0, t.signalType);
1121
+ break;
1122
+ case "centralConnection":
1123
+ this.addSignal(t.actor, void 0, void 0, t.signalType);
1124
+ break;
1125
+ case "centralConnectionReverse":
1126
+ this.addSignal(t.actor, void 0, void 0, t.signalType);
1127
+ break;
1128
+ case "activeEnd":
1129
+ this.addSignal(t.actor, void 0, void 0, t.signalType);
1130
+ break;
1131
+ case "addNote":
1132
+ this.addNote(t.actor, t.placement, t.text);
1133
+ break;
1134
+ case "addLinks":
1135
+ this.addLinks(t.actor, t.text);
1136
+ break;
1137
+ case "addALink":
1138
+ this.addALink(t.actor, t.text);
1139
+ break;
1140
+ case "addProperties":
1141
+ this.addProperties(t.actor, t.text);
1142
+ break;
1143
+ case "addDetails":
1144
+ this.addDetails(t.actor, t.text);
1145
+ break;
1146
+ case "addMessage":
1147
+ if (this.state.records.lastCreated) {
1148
+ if (t.to !== this.state.records.lastCreated)
1149
+ throw new Error(
1150
+ "The created participant " + this.state.records.lastCreated.name + " does not have an associated creating message after its declaration. Please check the sequence diagram."
1151
+ );
1152
+ this.state.records.lastCreated = void 0;
1153
+ } else if (this.state.records.lastDestroyed) {
1154
+ if (t.to !== this.state.records.lastDestroyed && t.from !== this.state.records.lastDestroyed)
1155
+ throw new Error(
1156
+ "The destroyed participant " + this.state.records.lastDestroyed.name + " does not have an associated destroying message after its declaration. Please check the sequence diagram."
1157
+ );
1158
+ this.state.records.lastDestroyed = void 0;
1159
+ }
1160
+ this.addSignal(
1161
+ t.from,
1162
+ t.to,
1163
+ t.msg,
1164
+ t.signalType,
1165
+ t.activate,
1166
+ t.centralConnection
1167
+ );
1168
+ break;
1169
+ case "boxStart":
1170
+ this.addBox(t.boxData);
1171
+ break;
1172
+ case "boxEnd":
1173
+ this.boxEnd();
1174
+ break;
1175
+ case "loopStart":
1176
+ this.addSignal(void 0, void 0, t.loopText, t.signalType);
1177
+ break;
1178
+ case "loopEnd":
1179
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1180
+ break;
1181
+ case "rectStart":
1182
+ this.addSignal(void 0, void 0, t.color, t.signalType);
1183
+ break;
1184
+ case "rectEnd":
1185
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1186
+ break;
1187
+ case "optStart":
1188
+ this.addSignal(void 0, void 0, t.optText, t.signalType);
1189
+ break;
1190
+ case "optEnd":
1191
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1192
+ break;
1193
+ case "altStart":
1194
+ this.addSignal(void 0, void 0, t.altText, t.signalType);
1195
+ break;
1196
+ case "else":
1197
+ this.addSignal(void 0, void 0, t.altText, t.signalType);
1198
+ break;
1199
+ case "altEnd":
1200
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1201
+ break;
1202
+ case "setAccTitle":
1203
+ De(t.text);
1204
+ break;
1205
+ case "parStart":
1206
+ this.addSignal(void 0, void 0, t.parText, t.signalType);
1207
+ break;
1208
+ case "and":
1209
+ this.addSignal(void 0, void 0, t.parText, t.signalType);
1210
+ break;
1211
+ case "parEnd":
1212
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1213
+ break;
1214
+ case "criticalStart":
1215
+ this.addSignal(void 0, void 0, t.criticalText, t.signalType);
1216
+ break;
1217
+ case "option":
1218
+ this.addSignal(void 0, void 0, t.optionText, t.signalType);
1219
+ break;
1220
+ case "criticalEnd":
1221
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1222
+ break;
1223
+ case "breakStart":
1224
+ this.addSignal(void 0, void 0, t.breakText, t.signalType);
1225
+ break;
1226
+ case "breakEnd":
1227
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1228
+ break;
1229
+ }
1230
+ }
1231
+ getConfig() {
1232
+ return $().sequence;
1233
+ }
1234
+ }, x(mt, "SequenceDB"), mt), Rr = /* @__PURE__ */ x((e) => {
1235
+ const t = e.dropShadow ?? "none", { look: a } = $();
1236
+ return `.actor {
1237
+ stroke: ${e.actorBorder};
1238
+ fill: ${e.actorBkg};
1239
+ stroke-width: ${e.strokeWidth ?? 1};
1240
+ }
1241
+
1242
+ rect.actor.outer-path[data-look="neo"] {
1243
+ filter: ${t};
1244
+ }
1245
+
1246
+ rect.note[data-look="neo"] {
1247
+ stroke:${e.noteBorderColor};
1248
+ fill:${e.noteBkgColor};
1249
+ filter: ${t};
1250
+ }
1251
+
1252
+ text.actor > tspan {
1253
+ fill: ${e.actorTextColor};
1254
+ stroke: none;
1255
+ }
1256
+
1257
+ .actor-line {
1258
+ stroke: ${e.actorLineColor};
1259
+ }
1260
+
1261
+ .innerArc {
1262
+ stroke-width: 1.5;
1263
+ stroke-dasharray: none;
1264
+ }
1265
+
1266
+ .messageLine0 {
1267
+ stroke-width: 1.5;
1268
+ stroke-dasharray: none;
1269
+ stroke: ${e.signalColor};
1270
+ }
1271
+
1272
+ .messageLine1 {
1273
+ stroke-width: 1.5;
1274
+ stroke-dasharray: 2, 2;
1275
+ stroke: ${e.signalColor};
1276
+ }
1277
+
1278
+ [id$="-arrowhead"] path {
1279
+ fill: ${e.signalColor};
1280
+ stroke: ${e.signalColor};
1281
+ }
1282
+
1283
+ .sequenceNumber {
1284
+ fill: ${e.sequenceNumberColor};
1285
+ }
1286
+
1287
+ [id$="-sequencenumber"] {
1288
+ fill: ${e.signalColor};
1289
+ }
1290
+
1291
+ [id$="-crosshead"] path {
1292
+ fill: ${e.signalColor};
1293
+ stroke: ${e.signalColor};
1294
+ }
1295
+
1296
+ .messageText {
1297
+ fill: ${e.signalTextColor};
1298
+ stroke: none;
1299
+ }
1300
+
1301
+ .labelBox {
1302
+ stroke: ${e.labelBoxBorderColor};
1303
+ fill: ${e.labelBoxBkgColor};
1304
+ filter: ${a === "neo" ? t : "none"};
1305
+ }
1306
+
1307
+ .labelText, .labelText > tspan {
1308
+ fill: ${e.labelTextColor};
1309
+ stroke: none;
1310
+ }
1311
+
1312
+ .loopText, .loopText > tspan {
1313
+ fill: ${e.loopTextColor};
1314
+ stroke: none;
1315
+ }
1316
+
1317
+ .sectionTitle, .sectionTitle > tspan {
1318
+ fill: ${e.loopTextColor};
1319
+ stroke: none;
1320
+ }
1321
+
1322
+ .loopLine {
1323
+ stroke-width: 2px;
1324
+ stroke-dasharray: 2, 2;
1325
+ stroke: ${e.labelBoxBorderColor};
1326
+ fill: ${e.labelBoxBorderColor};
1327
+ }
1328
+
1329
+ .note {
1330
+ //stroke: #decc93;
1331
+ stroke: ${e.noteBorderColor};
1332
+ fill: ${e.noteBkgColor};
1333
+ }
1334
+
1335
+ .noteText, .noteText > tspan {
1336
+ fill: ${e.noteTextColor};
1337
+ stroke: none;
1338
+ ${e.noteFontWeight ? `font-weight: ${e.noteFontWeight};` : ""}
1339
+ }
1340
+
1341
+ .activation0 {
1342
+ fill: ${e.activationBkgColor};
1343
+ stroke: ${e.activationBorderColor};
1344
+ }
1345
+
1346
+ .activation1 {
1347
+ fill: ${e.activationBkgColor};
1348
+ stroke: ${e.activationBorderColor};
1349
+ }
1350
+
1351
+ .activation2 {
1352
+ fill: ${e.activationBkgColor};
1353
+ stroke: ${e.activationBorderColor};
1354
+ }
1355
+
1356
+ .actorPopupMenu {
1357
+ position: absolute;
1358
+ }
1359
+
1360
+ .actorPopupMenuPanel {
1361
+ position: absolute;
1362
+ fill: ${e.actorBkg};
1363
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
1364
+ filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
1365
+ }
1366
+ .actor-man circle, line {
1367
+ fill: ${e.actorBkg};
1368
+ stroke-width: 2px;
1369
+ }
1370
+
1371
+ g rect.rect {
1372
+ filter: ${t};
1373
+ stroke: ${e.nodeBorder};
1374
+ }
1375
+ `;
1376
+ }, "getStyles"), Or = Rr, It = 36, ft = "actor-top", _t = "actor-bottom", qt = "actor-box", yt = "actor-man", pt = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), Pt = /* @__PURE__ */ x(function(e, t) {
1377
+ const a = fr(e, t);
1378
+ return Ft().look === "neo" && a.attr("data-look", "neo"), a;
1379
+ }, "drawRect"), Lr = /* @__PURE__ */ x(function(e, t, a, r, i) {
1380
+ if (t.links === void 0 || t.links === null || Object.keys(t.links).length === 0)
1381
+ return { height: 0, width: 0 };
1382
+ const n = t.links, s = t.actorCnt, c = t.rectData;
1383
+ var E = "none";
1384
+ i && (E = "block !important");
1385
+ const h = e.append("g");
1386
+ h.attr("id", "actor" + s + "_popup"), h.attr("class", "actorPopupMenu"), h.attr("display", E);
1387
+ var p = "";
1388
+ c.class !== void 0 && (p = " " + c.class);
1389
+ let _ = c.width > a ? c.width : a;
1390
+ const u = h.append("rect");
1391
+ if (u.attr("class", "actorPopupMenuPanel" + p), u.attr("x", c.x), u.attr("y", c.height), u.attr("fill", c.fill), u.attr("stroke", c.stroke), u.attr("width", _), u.attr("height", c.height), u.attr("rx", c.rx), u.attr("ry", c.ry), n != null) {
1392
+ var O = 20;
1393
+ for (let f in n) {
1394
+ var T = h.append("a"), g = Me.sanitizeUrl(n[f]);
1395
+ T.attr("xlink:href", g), T.attr("target", "_blank"), Gr(r)(
1396
+ f,
1397
+ T,
1398
+ c.x + 10,
1399
+ c.height + O,
1400
+ _,
1401
+ 20,
1402
+ { class: "actor" },
1403
+ r
1404
+ ), O += 30;
1405
+ }
1406
+ }
1407
+ return u.attr("height", O), { height: c.height + O, width: _ };
1408
+ }, "drawPopup"), zt = /* @__PURE__ */ x(function(e) {
1409
+ return "var pu = document.getElementById('" + e + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }";
1410
+ }, "popupMenuToggle"), Ht = /* @__PURE__ */ x(async function(e, t, a = null) {
1411
+ let r = e.append("foreignObject");
1412
+ const i = await Ve(t.text, Ft()), s = r.append("xhtml:div").attr("style", "width: fit-content;").attr("xmlns", "http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();
1413
+ if (r.attr("height", Math.round(s.height)).attr("width", Math.round(s.width)), t.class === "noteText") {
1414
+ const c = e.node().firstChild;
1415
+ c.setAttribute("height", s.height + 2 * t.textMargin);
1416
+ const E = c.getBBox();
1417
+ r.attr("x", Math.round(E.x + E.width / 2 - s.width / 2)).attr("y", Math.round(E.y + E.height / 2 - s.height / 2));
1418
+ } else if (a) {
1419
+ let { startx: c, stopx: E, starty: h } = a;
1420
+ if (c > E) {
1421
+ const p = c;
1422
+ c = E, E = p;
1423
+ }
1424
+ r.attr("x", Math.round(c + Math.abs(c - E) / 2 - s.width / 2)), t.class === "loopText" ? r.attr("y", Math.round(h)) : r.attr("y", Math.round(h - s.height));
1425
+ }
1426
+ return [r];
1427
+ }, "drawKatex"), At = /* @__PURE__ */ x(function(e, t) {
1428
+ let a = 0, r = 0;
1429
+ const i = t.text.split(N.lineBreakRegex), [n, s] = Be(t.fontSize);
1430
+ let c = [], E = 0, h = /* @__PURE__ */ x(() => t.y, "yfunc");
1431
+ if (t.valign !== void 0 && t.textMargin !== void 0 && t.textMargin > 0)
1432
+ switch (t.valign) {
1433
+ case "top":
1434
+ case "start":
1435
+ h = /* @__PURE__ */ x(() => Math.round(t.y + t.textMargin), "yfunc");
1436
+ break;
1437
+ case "middle":
1438
+ case "center":
1439
+ h = /* @__PURE__ */ x(() => Math.round(t.y + (a + r + t.textMargin) / 2), "yfunc");
1440
+ break;
1441
+ case "bottom":
1442
+ case "end":
1443
+ h = /* @__PURE__ */ x(() => Math.round(
1444
+ t.y + (a + r + 2 * t.textMargin) - t.textMargin
1445
+ ), "yfunc");
1446
+ break;
1447
+ }
1448
+ if (t.anchor !== void 0 && t.textMargin !== void 0 && t.width !== void 0)
1449
+ switch (t.anchor) {
1450
+ case "left":
1451
+ case "start":
1452
+ t.x = Math.round(t.x + t.textMargin), t.anchor = "start", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1453
+ break;
1454
+ case "middle":
1455
+ case "center":
1456
+ t.x = Math.round(t.x + t.width / 2), t.anchor = "middle", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1457
+ break;
1458
+ case "right":
1459
+ case "end":
1460
+ t.x = Math.round(t.x + t.width - t.textMargin), t.anchor = "end", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1461
+ break;
1462
+ }
1463
+ for (let [p, _] of i.entries()) {
1464
+ t.textMargin !== void 0 && t.textMargin === 0 && n !== void 0 && (E = p * n);
1465
+ const u = e.append("text");
1466
+ u.attr("x", t.x), u.attr("y", h()), t.anchor !== void 0 && u.attr("text-anchor", t.anchor).attr("dominant-baseline", t.dominantBaseline).attr("alignment-baseline", t.alignmentBaseline), t.fontFamily !== void 0 && u.style("font-family", t.fontFamily), s !== void 0 && u.style("font-size", s), t.fontWeight !== void 0 && u.style("font-weight", t.fontWeight), t.fill !== void 0 && u.attr("fill", t.fill), t.class !== void 0 && u.attr("class", t.class), t.dy !== void 0 ? u.attr("dy", t.dy) : E !== 0 && u.attr("dy", E);
1467
+ const O = _ || pr;
1468
+ if (t.tspan) {
1469
+ const T = u.append("tspan");
1470
+ T.attr("x", t.x), t.fill !== void 0 && T.attr("fill", t.fill), T.text(O);
1471
+ } else
1472
+ u.text(O);
1473
+ t.valign !== void 0 && t.textMargin !== void 0 && t.textMargin > 0 && (r += (u._groups || u)[0][0].getBBox().height, a = r), c.push(u);
1474
+ }
1475
+ return c;
1476
+ }, "drawText"), Ye = /* @__PURE__ */ x(function(e, t) {
1477
+ function a(i, n, s, c, E) {
1478
+ return i + "," + n + " " + (i + s) + "," + n + " " + (i + s) + "," + (n + c - E) + " " + (i + s - E * 1.2) + "," + (n + c) + " " + i + "," + (n + c);
1479
+ }
1480
+ x(a, "genPoints");
1481
+ const r = e.append("polygon");
1482
+ return r.attr("points", a(t.x, t.y, t.width, t.height, 7)), r.attr("class", "labelBox"), t.y = t.y + t.height / 2, At(e, t), r;
1483
+ }, "drawLabel"), B = -1, We = /* @__PURE__ */ x((e, t, a, r) => {
1484
+ e.select && a.forEach((i) => {
1485
+ const n = t.get(i), s = e.select("#actor" + n.actorCnt);
1486
+ !r.mirrorActors && n.stopy ? s.attr("y2", n.stopy + n.height / 2) : r.mirrorActors && s.attr("y2", n.stopy);
1487
+ });
1488
+ }, "fixLifeLineHeights"), br = /* @__PURE__ */ x(function(e, t, a, r, i) {
1489
+ const n = r ? t.stopy : t.starty, s = t.x + t.width / 2, c = n + t.height, { look: E, theme: h, themeVariables: p } = a, { bkgColorArray: _, borderColorArray: u } = p, O = e.append("g").lower();
1490
+ var T = O;
1491
+ r || (B++, Object.keys(t.links || {}).length && !a.forceMenus && T.attr("onclick", zt(`actor${B}_popup`)).attr("cursor", "pointer"), T.append("line").attr("id", "actor" + B).attr("x1", s).attr("y1", c).attr("x2", s).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), T = O.append("g"), t.actorCnt = B, t.links != null && T.attr("id", "root-" + B), E === "neo" && T.attr("data-look", "neo"));
1492
+ const g = dt();
1493
+ var f = "actor";
1494
+ t.properties?.class ? f = t.properties.class : g.fill = "#eaeaea", r ? f += ` ${_t}` : f += ` ${ft}`, g.x = t.x, g.y = n, g.width = t.width, g.height = t.height, g.class = f, g.rx = 3, g.ry = 3, g.name = t.name, E === "neo" && (g.rx = 6, g.ry = 6);
1495
+ const I = Pt(T, g), L = i.get(t.name) ?? 0;
1496
+ if (pt.has(h) && (I.style("stroke", u[L % u.length]), I.style("fill", _[L % u.length])), E === "neo" && I.attr("filter", "url(#drop-shadow)"), t.rectData = g, t.properties?.icon) {
1497
+ const w = t.properties.icon.trim();
1498
+ w.charAt(0) === "@" ? ie(T, g.x + g.width - 20, g.y + 10, w.substr(1)) : ne(T, g.x + g.width - 20, g.y + 10, w);
1499
+ }
1500
+ r || (T.attr("data-et", "participant"), T.attr("data-type", "participant"), T.attr("data-id", t.name)), Et(a, Q(t.description))(
1501
+ t.description,
1502
+ T,
1503
+ g.x,
1504
+ g.y,
1505
+ g.width,
1506
+ g.height,
1507
+ { class: `actor ${qt}` },
1508
+ a
1509
+ );
1510
+ let b = t.height;
1511
+ if (I.node) {
1512
+ const w = I.node().getBBox();
1513
+ t.height = w.height, b = w.height;
1514
+ }
1515
+ return b;
1516
+ }, "drawActorTypeParticipant"), mr = /* @__PURE__ */ x(function(e, t, a, r, i) {
1517
+ const n = r ? t.stopy : t.starty, s = t.x + t.width / 2, c = n + t.height, { look: E, theme: h, themeVariables: p } = a, { bkgColorArray: _, borderColorArray: u } = p, O = e.append("g").lower();
1518
+ var T = O;
1519
+ r || (B++, Object.keys(t.links || {}).length && !a.forceMenus && T.attr("onclick", zt(`actor${B}_popup`)).attr("cursor", "pointer"), T.append("line").attr("id", "actor" + B).attr("x1", s).attr("y1", c).attr("x2", s).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), T = O.append("g"), t.actorCnt = B, t.links != null && T.attr("id", "root-" + B), E === "neo" && T.attr("data-look", "neo"));
1520
+ const g = dt();
1521
+ var f = "actor";
1522
+ t.properties?.class ? f = t.properties.class : g.fill = "#eaeaea", r ? f += ` ${_t}` : f += ` ${ft}`, g.x = t.x, g.y = n, g.width = t.width, g.height = t.height, g.class = f, g.name = t.name;
1523
+ const I = 6, L = {
1524
+ ...g,
1525
+ x: g.x + -I,
1526
+ y: g.y + +I,
1527
+ class: "actor"
1528
+ }, b = Pt(T, g), w = Pt(T, L);
1529
+ t.rectData = g, E === "neo" && T.attr("filter", "url(#drop-shadow)");
1530
+ const A = i.get(t.name) ?? 0;
1531
+ if (pt.has(h) && (b.style("stroke", u[A % u.length]), b.style("fill", _[A % u.length]), w.style("stroke", u[A % u.length]), w.style("fill", _[A % u.length])), t.properties?.icon) {
1532
+ const M = t.properties.icon.trim();
1533
+ M.charAt(0) === "@" ? ie(T, g.x + g.width - 20, g.y + 10, M.substr(1)) : ne(T, g.x + g.width - 20, g.y + 10, M);
1534
+ }
1535
+ Et(a, Q(t.description))(
1536
+ t.description,
1537
+ T,
1538
+ g.x - I,
1539
+ g.y + I,
1540
+ g.width,
1541
+ g.height,
1542
+ { class: `actor ${qt}` },
1543
+ a
1544
+ );
1545
+ let D = t.height;
1546
+ if (b.node) {
1547
+ const M = b.node().getBBox();
1548
+ t.height = M.height, D = M.height;
1549
+ }
1550
+ return r || (T.attr("data-et", "participant"), T.attr("data-type", "collections"), T.attr("data-id", t.name)), D;
1551
+ }, "drawActorTypeCollections"), Ar = /* @__PURE__ */ x(function(e, t, a, r, i) {
1552
+ const n = r ? t.stopy : t.starty, s = t.x + t.width / 2, c = n + t.height, { look: E, theme: h, themeVariables: p } = a, { bkgColorArray: _, borderColorArray: u } = p, O = e.append("g").lower();
1553
+ let T = O;
1554
+ r || (B++, Object.keys(t.links || {}).length && !a.forceMenus && T.attr("onclick", zt(`actor${B}_popup`)).attr("cursor", "pointer"), T.append("line").attr("id", "actor" + B).attr("x1", s).attr("y1", c).attr("x2", s).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), T = O.append("g"), t.actorCnt = B, t.links != null && T.attr("id", "root-" + B), E === "neo" && T.attr("data-look", "neo"));
1555
+ const g = dt();
1556
+ let f = "actor";
1557
+ t.properties?.class ? f = t.properties.class : g.fill = "#eaeaea", r ? f += ` ${_t}` : f += ` ${ft}`, T.attr("class", f), g.x = t.x, g.y = n, g.width = t.width, g.height = t.height, g.name = t.name;
1558
+ const I = g.height / 2, L = I / (2.5 + g.height / 50), b = T.append("g"), w = T.append("g"), A = `M ${g.x},${g.y + I}
1559
+ a ${L},${I} 0 0 0 0,${g.height}
1560
+ h ${g.width - 2 * L}
1561
+ a ${L},${I} 0 0 0 0,-${g.height}
1562
+ Z
1563
+ `;
1564
+ b.append("path").attr("d", A), w.append("path").attr(
1565
+ "d",
1566
+ `M ${g.x},${g.y + I}
1567
+ a ${L},${I} 0 0 0 0,${g.height}`
1568
+ ), b.attr("transform", `translate(${L}, ${-(g.height / 2)})`), w.attr("transform", `translate(${g.width - L}, ${-g.height / 2})`), t.rectData = g, E === "neo" && b.attr("filter", "url(#drop-shadow)");
1569
+ const D = i.get(t.name) ?? 0;
1570
+ if (pt.has(h) && (b.style("stroke", u[D % u.length]), b.style("fill", _[D % u.length]), w.style("stroke", u[D % u.length]), w.style("fill", _[D % u.length])), t.properties?.icon) {
1571
+ const W = t.properties.icon.trim(), U = g.x + g.width - 20, G = g.y + 10;
1572
+ W.charAt(0) === "@" ? ie(T, U, G, W.substr(1)) : ne(T, U, G, W);
1573
+ }
1574
+ Et(a, Q(t.description))(
1575
+ t.description,
1576
+ T,
1577
+ g.x,
1578
+ g.y,
1579
+ g.width,
1580
+ g.height,
1581
+ { class: `actor ${qt}` },
1582
+ a
1583
+ );
1584
+ let M = t.height;
1585
+ const V = b.select("path:last-child");
1586
+ if (V.node()) {
1587
+ const W = V.node().getBBox();
1588
+ t.height = W.height, M = W.height;
1589
+ }
1590
+ return r || (T.attr("data-et", "participant"), T.attr("data-type", "queue"), T.attr("data-id", t.name)), M;
1591
+ }, "drawActorTypeQueue"), Sr = /* @__PURE__ */ x(function(e, t, a, r, i, n) {
1592
+ const s = r ? t.stopy : t.starty, c = t.x + t.width / 2, E = s + 75, { look: h, theme: p, themeVariables: _ } = a, { bkgColorArray: u, borderColorArray: O, actorBorder: T, actorBkg: g } = _, f = e.append("g").lower();
1593
+ r || (B++, f.append("line").attr("id", "actor" + B).attr("x1", c).attr("y1", E).attr("x2", c).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = B);
1594
+ const I = e.append("g");
1595
+ let L = yt;
1596
+ r ? L += ` ${_t}` : L += ` ${ft}`, I.attr("class", L), I.attr("name", t.name);
1597
+ const b = dt();
1598
+ b.x = t.x, b.y = s, b.fill = "#eaeaea", b.width = t.width, b.height = t.height, b.class = "actor";
1599
+ const w = t.x + t.width / 2, A = s + 32, D = 22;
1600
+ I.append("defs").append("marker").attr("id", i + "-filled-head-control").attr("refX", 11).attr("refY", 5.8).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "172.5").attr("stroke-width", 1.2).append("path").attr("d", "M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"), I.append("circle").attr("cx", w).attr("cy", A).attr("r", D).attr("filter", `${h === "neo" ? "url(#drop-shadow)" : ""}`), I.append("line").attr("marker-end", "url(#" + i + "-filled-head-control)").attr("transform", `translate(${w}, ${A - D})`);
1601
+ const M = n.get(t.name) ?? 0;
1602
+ pt.has(p) ? (I.style("stroke", O[M % O.length]), I.style("fill", u[M % O.length])) : (I.style("stroke", T), I.style("fill", g));
1603
+ const V = I.node().getBBox();
1604
+ return t.height = V.height + 2 * (a?.sequence?.labelBoxHeight ?? 0), Et(a, Q(t.description))(
1605
+ t.description,
1606
+ I,
1607
+ b.x,
1608
+ b.y + D + (r ? 5 : 12),
1609
+ b.width,
1610
+ b.height,
1611
+ { class: `actor ${yt}` },
1612
+ a
1613
+ ), r || (I.attr("data-et", "participant"), I.attr("data-type", "control"), I.attr("data-id", t.name)), t.height;
1614
+ }, "drawActorTypeControl"), wr = /* @__PURE__ */ x(function(e, t, a, r, i) {
1615
+ const n = r ? t.stopy : t.starty, s = t.x + t.width / 2, c = n + 75, { look: E, theme: h, themeVariables: p } = a, { bkgColorArray: _, borderColorArray: u } = p, O = e.append("g").lower(), T = e.append("g");
1616
+ let g = "actor";
1617
+ r ? g += ` ${_t}` : g += ` ${ft}`, T.attr("class", g), T.attr("name", t.name);
1618
+ const f = dt();
1619
+ f.x = t.x, f.y = n, f.fill = "#eaeaea", f.width = t.width, f.height = t.height, f.class = "actor";
1620
+ const I = t.x + t.width / 2, L = n + (r ? 10 : 25), b = 22;
1621
+ T.append("circle").attr("cx", I).attr("cy", L).attr("r", b).attr("width", t.width).attr("height", t.height), T.append("line").attr("x1", I - b).attr("x2", I + b).attr("y1", L + b).attr("y2", L + b).attr("stroke-width", 2), E === "neo" && T.attr("filter", "url(#drop-shadow)");
1622
+ const w = i.get(t.name) ?? 0;
1623
+ pt.has(h) && (T.style("stroke", u[w % u.length]), T.style("fill", _[w % u.length]));
1624
+ const A = T.node().getBBox();
1625
+ return t.height = A.height + (a?.sequence?.labelBoxHeight ?? 0), r || (B++, O.append("line").attr("id", "actor" + B).attr("x1", s).attr("y1", c).attr("x2", s).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = B), Et(a, Q(t.description))(
1626
+ t.description,
1627
+ T,
1628
+ f.x,
1629
+ f.y + (r ? 15 : 30),
1630
+ f.width,
1631
+ f.height,
1632
+ { class: `actor ${yt}` },
1633
+ a
1634
+ ), r ? T.attr("transform", `translate(0, ${b})`) : (T.attr("transform", `translate(0, ${b / 2 - 5})`), T.attr("data-et", "participant"), T.attr("data-type", "entity"), T.attr("data-id", t.name)), t.height;
1635
+ }, "drawActorTypeEntity"), Nr = /* @__PURE__ */ x(function(e, t, a, r, i) {
1636
+ const n = r ? t.stopy : t.starty, s = t.x + t.width / 2, c = n + t.height + 2 * a.boxTextMargin, { theme: E, themeVariables: h, look: p } = a, { bkgColorArray: _, borderColorArray: u, actorBorder: O } = h, T = e.append("g").lower();
1637
+ let g = T;
1638
+ r || (B++, Object.keys(t.links || {}).length && !a.forceMenus && g.attr("onclick", zt(`actor${B}_popup`)).attr("cursor", "pointer"), g.append("line").attr("id", "actor" + B).attr("x1", s).attr("y1", c).attr("x2", s).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), g = T.append("g"), t.actorCnt = B, t.links != null && g.attr("id", "root-" + B), p === "neo" && g.attr("data-look", "neo"));
1639
+ const f = dt();
1640
+ let I = "actor";
1641
+ t.properties?.class ? I = t.properties.class : f.fill = "#eaeaea", r ? I += ` ${_t}` : I += ` ${ft}`, f.x = t.x, f.y = n, f.width = t.width, f.height = t.height, f.class = I, f.name = t.name, f.x = t.x, f.y = n;
1642
+ const L = f.width / 3, b = f.width / 3, w = L / 2, A = w / (2.5 + L / 50), D = g.append("g");
1643
+ D.attr("class", I);
1644
+ const M = `
1645
+ M ${f.x},${f.y + A}
1646
+ a ${w},${A} 0 0 0 ${L},0
1647
+ a ${w},${A} 0 0 0 -${L},0
1648
+ l 0,${b - 2 * A}
1649
+ a ${w},${A} 0 0 0 ${L},0
1650
+ l 0,-${b - 2 * A}
1651
+ `;
1652
+ D.append("path").attr("d", M), p === "neo" && D.attr("filter", "url(#drop-shadow)");
1653
+ const V = i.get(t.name) ?? 0;
1654
+ pt.has(E) ? (D.style("stroke", u[V % u.length]), D.style("fill", _[V % u.length])) : D.style("stroke", O), D.attr("transform", `translate(${L}, ${A})`), t.rectData = f, Et(a, Q(t.description))(
1655
+ t.description,
1656
+ g,
1657
+ f.x,
1658
+ f.y + 35,
1659
+ f.width,
1660
+ f.height,
1661
+ { class: `actor ${qt}` },
1662
+ a
1663
+ );
1664
+ const W = D.select("path:last-child");
1665
+ if (W.node()) {
1666
+ const U = W.node().getBBox();
1667
+ t.height = U.height + (a.sequence.labelBoxHeight ?? 0);
1668
+ }
1669
+ return r || (g.attr("data-et", "participant"), g.attr("data-type", "database"), g.attr("data-id", t.name)), t.height;
1670
+ }, "drawActorTypeDatabase"), Pr = /* @__PURE__ */ x(function(e, t, a, r, i) {
1671
+ const n = r ? t.stopy : t.starty, s = t.x + t.width / 2, c = n + 80, E = 22, h = e.append("g").lower(), { look: p, theme: _, themeVariables: u } = a, { bkgColorArray: O, borderColorArray: T, actorBorder: g } = u;
1672
+ r || (B++, h.append("line").attr("id", "actor" + B).attr("x1", s).attr("y1", c).attr("x2", s).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = B);
1673
+ const f = e.append("g");
1674
+ let I = yt;
1675
+ r ? I += ` ${_t}` : I += ` ${ft}`, f.attr("class", I), f.attr("name", t.name);
1676
+ const L = dt();
1677
+ L.x = t.x, L.y = n, L.fill = "#eaeaea", L.width = t.width, L.height = t.height, L.class = "actor", f.append("line").attr("id", "actor-man-torso" + B).attr("x1", t.x + t.width / 2 - E * 2.5).attr("y1", n + 12).attr("x2", t.x + t.width / 2 - 15).attr("y2", n + 12), f.append("line").attr("id", "actor-man-arms" + B).attr("x1", t.x + t.width / 2 - E * 2.5).attr("y1", n + 2).attr("x2", t.x + t.width / 2 - E * 2.5).attr("y2", n + 22), f.append("circle").attr("cx", t.x + t.width / 2).attr("cy", n + 12).attr("r", E), p === "neo" && f.attr("filter", "url(#drop-shadow)");
1678
+ const b = i.get(t.name) ?? 0;
1679
+ pt.has(_) ? (f.style("stroke", T[b % T.length]), f.style("fill", O[b % T.length])) : f.style("stroke", g);
1680
+ const w = f.node().getBBox();
1681
+ return t.height = w.height + (a.sequence.labelBoxHeight ?? 0), Et(a, Q(t.description))(
1682
+ t.description,
1683
+ f,
1684
+ L.x,
1685
+ L.y + 15,
1686
+ L.width,
1687
+ L.height,
1688
+ { class: `actor ${yt}` },
1689
+ a
1690
+ ), f.attr("transform", `translate(0,${E / 2 + 10})`), r || (f.attr("data-et", "participant"), f.attr("data-type", "boundary"), f.attr("data-id", t.name)), t.height;
1691
+ }, "drawActorTypeBoundary"), kr = /* @__PURE__ */ x(function(e, t, a, r, i) {
1692
+ const n = r ? t.stopy : t.starty, s = t.x + t.width / 2, c = n + 80, { look: E, theme: h, themeVariables: p } = a, { bkgColorArray: _, borderColorArray: u, actorBorder: O } = p, T = e.append("g").lower();
1693
+ r || (B++, T.append("line").attr("id", "actor" + B).attr("x1", s).attr("y1", c).attr("x2", s).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = B);
1694
+ const g = e.append("g");
1695
+ let f = yt;
1696
+ r ? f += ` ${_t}` : f += ` ${ft}`, g.attr("class", f), g.attr("name", t.name), r || g.attr("data-et", "participant").attr("data-type", "actor").attr("data-id", t.name);
1697
+ const I = E === "neo" ? 0.5 : 1, L = E === "neo" ? n + (1 - I) * 30 : n;
1698
+ g.append("line").attr("id", "actor-man-torso" + B).attr("x1", s).attr("y1", L + 25 * I).attr("x2", s).attr("y2", L + 45 * I), g.append("line").attr("id", "actor-man-arms" + B).attr("x1", s - It / 2 * I).attr("y1", L + 33 * I).attr("x2", s + It / 2 * I).attr("y2", L + 33 * I), g.append("line").attr("x1", s - It / 2 * I).attr("y1", L + 60 * I).attr("x2", s).attr("y2", L + 45 * I), g.append("line").attr("x1", s).attr("y1", L + 45 * I).attr("x2", s + (It / 2 - 2) * I).attr("y2", L + 60 * I);
1699
+ const b = g.append("circle");
1700
+ b.attr("cx", t.x + t.width / 2), b.attr("cy", L + 10 * I), b.attr("r", 15 * I), b.attr("width", t.width * I), b.attr("height", t.height * I);
1701
+ const w = g.node().getBBox();
1702
+ t.height = w.height;
1703
+ const A = dt();
1704
+ A.x = t.x, A.y = L, A.fill = "#eaeaea", A.width = t.width, A.height = t.height / I, A.class = "actor", A.rx = 3, A.ry = 3;
1705
+ const D = i.get(t.name) ?? 0;
1706
+ return pt.has(h) ? (g.style("stroke", u[D % u.length]), g.style("fill", _[D % u.length])) : g.style("stroke", O), Et(a, Q(t.description))(
1707
+ t.description,
1708
+ g,
1709
+ A.x,
1710
+ L + 35 * I - (E === "neo" ? 10 : 0),
1711
+ A.width,
1712
+ A.height,
1713
+ { class: `actor ${yt}` },
1714
+ a
1715
+ ), t.height;
1716
+ }, "drawActorTypeActor"), Dr = /* @__PURE__ */ x(async function(e, t, a, r, i, n, s) {
1717
+ const c = s ?? new Map(
1718
+ [...n.db.getActors().values()].map((E, h) => [E.name, h])
1719
+ );
1720
+ switch (t.type) {
1721
+ case "actor":
1722
+ return await kr(e, t, a, r, c);
1723
+ case "participant":
1724
+ return await br(e, t, a, r, c);
1725
+ case "boundary":
1726
+ return await Pr(e, t, a, r, c);
1727
+ case "control":
1728
+ return await Sr(
1729
+ e,
1730
+ t,
1731
+ a,
1732
+ r,
1733
+ i,
1734
+ c
1735
+ );
1736
+ case "entity":
1737
+ return await wr(e, t, a, r, c);
1738
+ case "database":
1739
+ return await Nr(e, t, a, r, c);
1740
+ case "collections":
1741
+ return await mr(e, t, a, r, c);
1742
+ case "queue":
1743
+ return await Ar(e, t, a, r, c);
1744
+ }
1745
+ }, "drawActor"), vr = /* @__PURE__ */ x(function(e, t, a) {
1746
+ const i = e.append("g");
1747
+ Ke(i, t), t.name && Et(a)(
1748
+ t.name,
1749
+ i,
1750
+ t.x,
1751
+ t.y + a.boxTextMargin + (t.textMaxHeight || 0) / 2,
1752
+ t.width,
1753
+ 0,
1754
+ { class: "text" },
1755
+ a
1756
+ ), i.lower();
1757
+ }, "drawBox"), Cr = /* @__PURE__ */ x(function(e) {
1758
+ return e.append("g");
1759
+ }, "anchorElement"), Mr = /* @__PURE__ */ x(function(e, t, a, r, i, n, s) {
1760
+ const { theme: c, themeVariables: E } = r, { bkgColorArray: h, borderColorArray: p, mainBkg: _ } = E, u = dt(), O = t.anchored, T = t.actor;
1761
+ u.x = t.startx, u.y = t.starty, u.class = "activation" + i % 3, u.width = t.stopx - t.startx, u.height = a - t.starty;
1762
+ const g = Pt(O, u), I = (s ?? new Map(
1763
+ [...n.db.getActors().values()].map((L, b) => [L.name, b])
1764
+ )).get(T) ?? 0;
1765
+ pt.has(c) && (g.style("stroke", p[I % p.length]), g.style("fill", h[I % p.length] ?? _));
1766
+ }, "drawActivation"), Br = /* @__PURE__ */ x(async function(e, t, a, r, i) {
1767
+ const {
1768
+ boxMargin: n,
1769
+ boxTextMargin: s,
1770
+ labelBoxHeight: c,
1771
+ labelBoxWidth: E,
1772
+ messageFontFamily: h,
1773
+ messageFontSize: p,
1774
+ messageFontWeight: _
1775
+ } = r, u = e.append("g").attr("data-et", "control-structure").attr("data-id", "i" + i.id), O = /* @__PURE__ */ x(function(f, I, L, b) {
1776
+ return u.append("line").attr("x1", f).attr("y1", I).attr("x2", L).attr("y2", b).attr("class", "loopLine");
1777
+ }, "drawLoopLine");
1778
+ O(t.startx, t.starty, t.stopx, t.starty), O(t.stopx, t.starty, t.stopx, t.stopy), O(t.startx, t.stopy, t.stopx, t.stopy), O(t.startx, t.starty, t.startx, t.stopy), t.sections !== void 0 && t.sections.forEach(function(f) {
1779
+ O(t.startx, f.y, t.stopx, f.y).style(
1780
+ "stroke-dasharray",
1781
+ "3, 3"
1782
+ );
1783
+ });
1784
+ let T = se();
1785
+ T.text = a, T.x = t.startx, T.y = t.starty, T.fontFamily = h, T.fontSize = p, T.fontWeight = _, T.anchor = "middle", T.valign = "middle", T.tspan = !1, T.width = Math.max(E ?? 0, 50), T.height = c + (r.look === "neo" ? 15 : 0) || 20, T.textMargin = s, T.class = "labelText", Ye(u, T), T = Fe(), T.text = t.title, T.x = t.startx + E / 2 + (t.stopx - t.startx) / 2, T.y = t.starty + n + s, T.anchor = "middle", T.valign = "middle", T.textMargin = s, T.class = "loopText", T.fontFamily = h, T.fontSize = p, T.fontWeight = _, T.wrap = !0;
1786
+ let g = Q(T.text) ? await Ht(u, T, t) : At(u, T);
1787
+ if (t.sectionTitles !== void 0) {
1788
+ for (const [f, I] of Object.entries(t.sectionTitles))
1789
+ if (I.message) {
1790
+ T.text = I.message, T.x = t.startx + (t.stopx - t.startx) / 2, T.y = t.sections[f].y + n + s, T.class = "sectionTitle", T.anchor = "middle", T.valign = "middle", T.tspan = !1, T.fontFamily = h, T.fontSize = p, T.fontWeight = _, T.wrap = t.wrap, Q(T.text) ? (t.starty = t.sections[f].y, await Ht(u, T, t)) : At(u, T);
1791
+ let L = Math.round(
1792
+ g.map((b) => (b._groups || b)[0][0].getBBox().height).reduce((b, w) => b + w)
1793
+ );
1794
+ t.sections[f].height += L - (n + s);
1795
+ }
1796
+ }
1797
+ return t.height = Math.round(t.stopy - t.starty), u;
1798
+ }, "drawLoop"), Ke = /* @__PURE__ */ x(function(e, t) {
1799
+ ur(e, t);
1800
+ }, "drawBackgroundRect"), Vr = /* @__PURE__ */ x(function(e, t) {
1801
+ e.append("defs").append("symbol").attr("id", t + "-database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1802
+ "d",
1803
+ "M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z"
1804
+ );
1805
+ }, "insertDatabaseIcon"), Yr = /* @__PURE__ */ x(function(e, t) {
1806
+ e.append("defs").append("symbol").attr("id", t + "-computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1807
+ "d",
1808
+ "M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z"
1809
+ );
1810
+ }, "insertComputerIcon"), Wr = /* @__PURE__ */ x(function(e, t) {
1811
+ e.append("defs").append("symbol").attr("id", t + "-clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1812
+ "d",
1813
+ "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z"
1814
+ );
1815
+ }, "insertClockIcon"), Kr = /* @__PURE__ */ x(function(e, t) {
1816
+ e.append("defs").append("marker").attr("id", t + "-arrowhead").attr("refX", 7.9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M -1 0 L 10 5 L 0 10 z");
1817
+ }, "insertArrowHead"), Fr = /* @__PURE__ */ x(function(e, t) {
1818
+ e.append("defs").append("marker").attr("id", t + "-filled-head").attr("refX", 15.5).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");
1819
+ }, "insertArrowFilledHead"), Hr = /* @__PURE__ */ x(function(e, t) {
1820
+ e.append("defs").append("marker").attr("id", t + "-sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6);
1821
+ }, "insertSequenceNumber"), qr = /* @__PURE__ */ x(function(e, t) {
1822
+ e.append("defs").append("marker").attr("id", t + "-crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 4).attr("refY", 4.5).append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1pt").attr("d", "M 1,2 L 6,7 M 6,2 L 1,7");
1823
+ }, "insertArrowCrossHead"), zr = /* @__PURE__ */ x(function(e, t) {
1824
+ const { theme: a } = t;
1825
+ e.append("defs").append("filter").attr("id", "drop-shadow").attr("height", "130%").attr("width", "130%").append("feDropShadow").attr("dx", "4").attr("dy", "4").attr("stdDeviation", 0).attr("flood-opacity", "0.06").attr("flood-color", `${a === "redux" || a === "redux-color" ? "#000000" : "#FFFFFF"}`);
1826
+ }, "insertDropShadow"), Fe = /* @__PURE__ */ x(function() {
1827
+ return {
1828
+ x: 0,
1829
+ y: 0,
1830
+ fill: void 0,
1831
+ anchor: void 0,
1832
+ style: "#666",
1833
+ width: void 0,
1834
+ height: void 0,
1835
+ textMargin: 0,
1836
+ rx: 0,
1837
+ ry: 0,
1838
+ tspan: !0,
1839
+ valign: void 0
1840
+ };
1841
+ }, "getTextObj"), Ur = /* @__PURE__ */ x(function() {
1842
+ return {
1843
+ x: 0,
1844
+ y: 0,
1845
+ fill: "#EDF2AE",
1846
+ stroke: "#666",
1847
+ width: 100,
1848
+ anchor: "start",
1849
+ height: 100,
1850
+ rx: 0,
1851
+ ry: 0
1852
+ };
1853
+ }, "getNoteRect"), Et = /* @__PURE__ */ function() {
1854
+ function e(n, s, c, E, h, p, _) {
1855
+ const u = s.append("text").attr("x", c + h / 2).attr("y", E + p / 2 + 5).style("text-anchor", "middle").text(n);
1856
+ i(u, _);
1857
+ }
1858
+ x(e, "byText");
1859
+ function t(n, s, c, E, h, p, _, u) {
1860
+ const { actorFontSize: O, actorFontFamily: T, actorFontWeight: g } = u, [f, I] = Be(O), L = n.split(N.lineBreakRegex);
1861
+ for (let b = 0; b < L.length; b++) {
1862
+ const w = b * f - f * (L.length - 1) / 2, A = s.append("text").attr("x", c + h / 2).attr("y", E).style("text-anchor", "middle").style("font-size", I).style("font-weight", g).style("font-family", T);
1863
+ A.append("tspan").attr("x", c + h / 2).attr("dy", w).text(L[b]), A.attr("y", E + p / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), i(A, _);
1864
+ }
1865
+ }
1866
+ x(t, "byTspan");
1867
+ function a(n, s, c, E, h, p, _, u) {
1868
+ const O = s.append("switch"), g = O.append("foreignObject").attr("x", c).attr("y", E).attr("width", h).attr("height", p).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1869
+ g.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(n), t(n, O, c, E, h, p, _, u), i(g, _);
1870
+ }
1871
+ x(a, "byFo");
1872
+ async function r(n, s, c, E, h, p, _, u) {
1873
+ const O = await kt(n, Ft()), T = s.append("switch"), f = T.append("foreignObject").attr("x", c + h / 2 - O.width / 2).attr("y", E + p / 2 - O.height / 2).attr("width", O.width).attr("height", O.height).append("xhtml:div").style("height", "100%").style("width", "100%");
1874
+ f.append("div").style("text-align", "center").style("vertical-align", "middle").html(await Ve(n, Ft())), t(n, T, c, E, h, p, _, u), i(f, _);
1875
+ }
1876
+ x(r, "byKatex");
1877
+ function i(n, s) {
1878
+ for (const c in s)
1879
+ s.hasOwnProperty(c) && n.attr(c, s[c]);
1880
+ }
1881
+ return x(i, "_setTextAttrs"), function(n, s = !1) {
1882
+ return s ? r : n.textPlacement === "fo" ? a : n.textPlacement === "old" ? e : t;
1883
+ };
1884
+ }(), Gr = /* @__PURE__ */ function() {
1885
+ function e(i, n, s, c, E, h, p) {
1886
+ const _ = n.append("text").attr("x", s).attr("y", c).style("text-anchor", "start").text(i);
1887
+ r(_, p);
1888
+ }
1889
+ x(e, "byText");
1890
+ function t(i, n, s, c, E, h, p, _) {
1891
+ const { actorFontSize: u, actorFontFamily: O, actorFontWeight: T } = _, g = i.split(N.lineBreakRegex);
1892
+ for (let f = 0; f < g.length; f++) {
1893
+ const I = f * u - u * (g.length - 1) / 2, L = n.append("text").attr("x", s).attr("y", c).style("text-anchor", "start").style("font-size", u).style("font-weight", T).style("font-family", O);
1894
+ L.append("tspan").attr("x", s).attr("dy", I).text(g[f]), L.attr("y", c + h / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), r(L, p);
1895
+ }
1896
+ }
1897
+ x(t, "byTspan");
1898
+ function a(i, n, s, c, E, h, p, _) {
1899
+ const u = n.append("switch"), T = u.append("foreignObject").attr("x", s).attr("y", c).attr("width", E).attr("height", h).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1900
+ T.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(i), t(i, u, s, c, E, h, p, _), r(T, p);
1901
+ }
1902
+ x(a, "byFo");
1903
+ function r(i, n) {
1904
+ for (const s in n)
1905
+ n.hasOwnProperty(s) && i.attr(s, n[s]);
1906
+ }
1907
+ return x(r, "_setTextAttrs"), function(i) {
1908
+ return i.textPlacement === "fo" ? a : i.textPlacement === "old" ? e : t;
1909
+ };
1910
+ }(), Xr = /* @__PURE__ */ x(function(e, t) {
1911
+ e.append("defs").append("marker").attr("id", t + "-solidTopArrowHead").attr("refX", 7.9).attr("refY", 7.25).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L 10 8 L 0 8 z");
1912
+ }, "insertSolidTopArrowHead"), Jr = /* @__PURE__ */ x(function(e, t) {
1913
+ e.append("defs").append("marker").attr("id", t + "-solidBottomArrowHead").attr("refX", 7.9).attr("refY", 0.75).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L 10 0 L 0 8 z");
1914
+ }, "insertSolidBottomArrowHead"), Zr = /* @__PURE__ */ x(function(e, t) {
1915
+ e.append("defs").append("marker").attr("id", t + "-stickTopArrowHead").attr("refX", 7.5).attr("refY", 7).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L 7 7").attr("stroke", "black").attr("stroke-width", 1.5).attr("fill", "none");
1916
+ }, "insertStickTopArrowHead"), Qr = /* @__PURE__ */ x(function(e, t) {
1917
+ e.append("defs").append("marker").attr("id", t + "-stickBottomArrowHead").attr("refX", 7.5).attr("refY", 0).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 7 L 7 0").attr("stroke", "black").attr("stroke-width", 1.5).attr("fill", "none");
1918
+ }, "insertStickBottomArrowHead"), H = {
1919
+ drawRect: Pt,
1920
+ drawText: At,
1921
+ drawLabel: Ye,
1922
+ drawActor: Dr,
1923
+ drawBox: vr,
1924
+ drawPopup: Lr,
1925
+ anchorElement: Cr,
1926
+ drawActivation: Mr,
1927
+ drawLoop: Br,
1928
+ drawBackgroundRect: Ke,
1929
+ insertArrowHead: Kr,
1930
+ insertArrowFilledHead: Fr,
1931
+ insertSequenceNumber: Hr,
1932
+ insertArrowCrossHead: qr,
1933
+ insertDatabaseIcon: Vr,
1934
+ insertComputerIcon: Yr,
1935
+ insertClockIcon: Wr,
1936
+ getTextObj: Fe,
1937
+ getNoteRect: Ur,
1938
+ fixLifeLineHeights: We,
1939
+ sanitizeUrl: Me.sanitizeUrl,
1940
+ insertDropShadow: zr,
1941
+ insertSolidTopArrowHead: Xr,
1942
+ insertSolidBottomArrowHead: Jr,
1943
+ insertStickTopArrowHead: Zr,
1944
+ insertStickBottomArrowHead: Qr
1945
+ }, l = {}, R = {
1946
+ data: {
1947
+ startx: void 0,
1948
+ stopx: void 0,
1949
+ starty: void 0,
1950
+ stopy: void 0
1951
+ },
1952
+ verticalPos: 0,
1953
+ sequenceItems: [],
1954
+ activations: [],
1955
+ models: {
1956
+ getHeight: /* @__PURE__ */ x(function() {
1957
+ return Math.max.apply(
1958
+ null,
1959
+ this.actors.length === 0 ? [0] : this.actors.map((e) => e.height || 0)
1960
+ ) + (this.loops.length === 0 ? 0 : this.loops.map((e) => e.height || 0).reduce((e, t) => e + t)) + (this.messages.length === 0 ? 0 : this.messages.map((e) => e.height || 0).reduce((e, t) => e + t)) + (this.notes.length === 0 ? 0 : this.notes.map((e) => e.height || 0).reduce((e, t) => e + t));
1961
+ }, "getHeight"),
1962
+ clear: /* @__PURE__ */ x(function() {
1963
+ this.actors = [], this.boxes = [], this.loops = [], this.messages = [], this.notes = [];
1964
+ }, "clear"),
1965
+ addBox: /* @__PURE__ */ x(function(e) {
1966
+ this.boxes.push(e);
1967
+ }, "addBox"),
1968
+ addActor: /* @__PURE__ */ x(function(e) {
1969
+ this.actors.push(e);
1970
+ }, "addActor"),
1971
+ addLoop: /* @__PURE__ */ x(function(e) {
1972
+ this.loops.push(e);
1973
+ }, "addLoop"),
1974
+ addMessage: /* @__PURE__ */ x(function(e) {
1975
+ this.messages.push(e);
1976
+ }, "addMessage"),
1977
+ addNote: /* @__PURE__ */ x(function(e) {
1978
+ this.notes.push(e);
1979
+ }, "addNote"),
1980
+ lastActor: /* @__PURE__ */ x(function() {
1981
+ return this.actors[this.actors.length - 1];
1982
+ }, "lastActor"),
1983
+ lastLoop: /* @__PURE__ */ x(function() {
1984
+ return this.loops[this.loops.length - 1];
1985
+ }, "lastLoop"),
1986
+ lastMessage: /* @__PURE__ */ x(function() {
1987
+ return this.messages[this.messages.length - 1];
1988
+ }, "lastMessage"),
1989
+ lastNote: /* @__PURE__ */ x(function() {
1990
+ return this.notes[this.notes.length - 1];
1991
+ }, "lastNote"),
1992
+ actors: [],
1993
+ boxes: [],
1994
+ loops: [],
1995
+ messages: [],
1996
+ notes: []
1997
+ },
1998
+ init: /* @__PURE__ */ x(function() {
1999
+ this.sequenceItems = [], this.activations = [], this.models.clear(), this.data = {
2000
+ startx: void 0,
2001
+ stopx: void 0,
2002
+ starty: void 0,
2003
+ stopy: void 0
2004
+ }, this.verticalPos = 0, ze($());
2005
+ }, "init"),
2006
+ updateVal: /* @__PURE__ */ x(function(e, t, a, r) {
2007
+ e[t] === void 0 ? e[t] = a : e[t] = r(a, e[t]);
2008
+ }, "updateVal"),
2009
+ updateBounds: /* @__PURE__ */ x(function(e, t, a, r) {
2010
+ const i = this;
2011
+ let n = 0;
2012
+ function s(c) {
2013
+ return /* @__PURE__ */ x(function(h) {
2014
+ n++;
2015
+ const p = i.sequenceItems.length - n + 1;
2016
+ i.updateVal(h, "starty", t - p * l.boxMargin, Math.min), i.updateVal(h, "stopy", r + p * l.boxMargin, Math.max), i.updateVal(R.data, "startx", e - p * l.boxMargin, Math.min), i.updateVal(R.data, "stopx", a + p * l.boxMargin, Math.max), c !== "activation" && (i.updateVal(h, "startx", e - p * l.boxMargin, Math.min), i.updateVal(h, "stopx", a + p * l.boxMargin, Math.max), i.updateVal(R.data, "starty", t - p * l.boxMargin, Math.min), i.updateVal(R.data, "stopy", r + p * l.boxMargin, Math.max));
2017
+ }, "updateItemBounds");
2018
+ }
2019
+ x(s, "updateFn"), this.sequenceItems.forEach(s()), this.activations.forEach(s("activation"));
2020
+ }, "updateBounds"),
2021
+ insert: /* @__PURE__ */ x(function(e, t, a, r) {
2022
+ const i = N.getMin(e, a), n = N.getMax(e, a), s = N.getMin(t, r), c = N.getMax(t, r);
2023
+ this.updateVal(R.data, "startx", i, Math.min), this.updateVal(R.data, "starty", s, Math.min), this.updateVal(R.data, "stopx", n, Math.max), this.updateVal(R.data, "stopy", c, Math.max), this.updateBounds(i, s, n, c);
2024
+ }, "insert"),
2025
+ newActivation: /* @__PURE__ */ x(function(e, t, a) {
2026
+ const r = a.get(e.from), i = Ut(e.from).length || 0, n = r.x + r.width / 2 + (i - 1) * l.activationWidth / 2;
2027
+ this.activations.push({
2028
+ startx: n,
2029
+ starty: this.verticalPos + 2,
2030
+ stopx: n + l.activationWidth,
2031
+ stopy: void 0,
2032
+ actor: e.from,
2033
+ anchored: H.anchorElement(t)
2034
+ });
2035
+ }, "newActivation"),
2036
+ endActivation: /* @__PURE__ */ x(function(e) {
2037
+ const t = this.activations.map(function(a) {
2038
+ return a.actor;
2039
+ }).lastIndexOf(e.from);
2040
+ return this.activations.splice(t, 1)[0];
2041
+ }, "endActivation"),
2042
+ createLoop: /* @__PURE__ */ x(function(e = { message: void 0, wrap: !1, width: void 0 }, t) {
2043
+ return {
2044
+ startx: void 0,
2045
+ starty: this.verticalPos,
2046
+ stopx: void 0,
2047
+ stopy: void 0,
2048
+ title: e.message,
2049
+ wrap: e.wrap,
2050
+ width: e.width,
2051
+ height: 0,
2052
+ fill: t
2053
+ };
2054
+ }, "createLoop"),
2055
+ newLoop: /* @__PURE__ */ x(function(e = { message: void 0, wrap: !1, width: void 0 }, t) {
2056
+ this.sequenceItems.push(this.createLoop(e, t));
2057
+ }, "newLoop"),
2058
+ endLoop: /* @__PURE__ */ x(function() {
2059
+ return this.sequenceItems.pop();
2060
+ }, "endLoop"),
2061
+ isLoopOverlap: /* @__PURE__ */ x(function() {
2062
+ return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : !1;
2063
+ }, "isLoopOverlap"),
2064
+ addSectionToLoop: /* @__PURE__ */ x(function(e) {
2065
+ const t = this.sequenceItems.pop();
2066
+ t.sections = t.sections || [], t.sectionTitles = t.sectionTitles || [], t.sections.push({ y: R.getVerticalPos(), height: 0 }), t.sectionTitles.push(e), this.sequenceItems.push(t);
2067
+ }, "addSectionToLoop"),
2068
+ saveVerticalPos: /* @__PURE__ */ x(function() {
2069
+ this.isLoopOverlap() && (this.savedVerticalPos = this.verticalPos);
2070
+ }, "saveVerticalPos"),
2071
+ resetVerticalPos: /* @__PURE__ */ x(function() {
2072
+ this.isLoopOverlap() && (this.verticalPos = this.savedVerticalPos);
2073
+ }, "resetVerticalPos"),
2074
+ bumpVerticalPos: /* @__PURE__ */ x(function(e) {
2075
+ this.verticalPos = this.verticalPos + e, this.data.stopy = N.getMax(this.data.stopy, this.verticalPos);
2076
+ }, "bumpVerticalPos"),
2077
+ getVerticalPos: /* @__PURE__ */ x(function() {
2078
+ return this.verticalPos;
2079
+ }, "getVerticalPos"),
2080
+ getBounds: /* @__PURE__ */ x(function() {
2081
+ return { bounds: this.data, models: this.models };
2082
+ }, "getBounds")
2083
+ }, $r = /* @__PURE__ */ x(async function(e, t, a) {
2084
+ R.bumpVerticalPos(l.boxMargin), t.height = l.boxMargin, t.starty = R.getVerticalPos();
2085
+ const r = dt();
2086
+ r.x = t.startx, r.y = t.starty, r.width = t.width || l.width, r.class = "note";
2087
+ const i = e.append("g");
2088
+ i.attr("data-et", "note"), i.attr("data-id", "i" + a);
2089
+ const n = H.drawRect(i, r), s = se();
2090
+ s.x = t.startx, s.y = t.starty, s.width = r.width, s.dy = "1em", s.text = t.message, s.class = "noteText", s.fontFamily = l.noteFontFamily, s.fontSize = l.noteFontSize, s.fontWeight = l.noteFontWeight, s.anchor = l.noteAlign, s.textMargin = l.noteMargin, s.valign = "center";
2091
+ const c = Q(s.text) ? await Ht(i, s) : At(i, s), E = Math.round(
2092
+ c.map((h) => (h._groups || h)[0][0].getBBox().height).reduce((h, p) => h + p)
2093
+ );
2094
+ n.attr("height", E + 2 * l.noteMargin), t.height += E + 2 * l.noteMargin, R.bumpVerticalPos(E + 2 * l.noteMargin), t.stopy = t.starty + E + 2 * l.noteMargin, t.stopx = t.startx + r.width, R.insert(t.startx, t.starty, t.stopx, t.stopy), R.models.addNote(t);
2095
+ }, "drawNote"), ve = /* @__PURE__ */ x(function(e, t, a, r, i, n, s) {
2096
+ const c = r.db.getActors(), E = c.get(t.from), h = c.get(t.to), p = a.sequenceVisible;
2097
+ let _ = E.x + E.width / 2, u = h.x + h.width / 2;
2098
+ const O = _ <= u, T = Je(t, r), g = e.append("g"), f = 16.5, I = /* @__PURE__ */ x((D, M) => {
2099
+ const V = D ? f : -f;
2100
+ return M ? -V : V;
2101
+ }, "getCircleOffset"), L = /* @__PURE__ */ x((D) => {
2102
+ g.append("circle").attr("cx", D).attr("cy", s).attr("r", 5).attr("width", 10).attr("height", 10);
2103
+ }, "drawCircle"), { CENTRAL_CONNECTION: b, CENTRAL_CONNECTION_REVERSE: w, CENTRAL_CONNECTION_DUAL: A } = r.db.LINETYPE;
2104
+ if (p)
2105
+ switch (t.centralConnection) {
2106
+ case b:
2107
+ T && (u += I(O, !0));
2108
+ break;
2109
+ case w:
2110
+ T || (_ += I(O, !1));
2111
+ break;
2112
+ case A:
2113
+ T ? u += I(O, !0) : _ += I(O, !1);
2114
+ break;
2115
+ }
2116
+ switch (t.centralConnection) {
2117
+ case b:
2118
+ L(u);
2119
+ break;
2120
+ case w:
2121
+ L(_);
2122
+ break;
2123
+ case A:
2124
+ L(_), L(u);
2125
+ break;
2126
+ }
2127
+ }, "drawCentralConnection"), Rt = /* @__PURE__ */ x((e) => ({
2128
+ fontFamily: e.messageFontFamily,
2129
+ fontSize: e.messageFontSize,
2130
+ fontWeight: e.messageFontWeight
2131
+ }), "messageFont"), bt = /* @__PURE__ */ x((e) => ({
2132
+ fontFamily: e.noteFontFamily,
2133
+ fontSize: e.noteFontSize,
2134
+ fontWeight: e.noteFontWeight
2135
+ }), "noteFont"), re = /* @__PURE__ */ x((e) => ({
2136
+ fontFamily: e.actorFontFamily,
2137
+ fontSize: e.actorFontSize,
2138
+ fontWeight: e.actorFontWeight
2139
+ }), "actorFont");
2140
+ async function He(e, t) {
2141
+ R.bumpVerticalPos(10);
2142
+ const { startx: a, stopx: r, message: i } = t, n = N.splitBreaks(i).length, s = Q(i), c = s ? await kt(i, $()) : Z.calculateTextDimensions(i, Rt(l));
2143
+ if (!s) {
2144
+ const _ = c.height / n;
2145
+ t.height += _, R.bumpVerticalPos(_);
2146
+ }
2147
+ let E, h = c.height - 10;
2148
+ const p = c.width;
2149
+ if (a === r) {
2150
+ E = R.getVerticalPos() + h, l.rightAngles || (h += l.boxMargin, E = R.getVerticalPos() + h), h += 30;
2151
+ const _ = N.getMax(p / 2, l.width / 2);
2152
+ R.insert(
2153
+ a - _,
2154
+ R.getVerticalPos() - 10 + h,
2155
+ r + _,
2156
+ R.getVerticalPos() + 30 + h
2157
+ );
2158
+ } else
2159
+ h += l.boxMargin, E = R.getVerticalPos() + h, R.insert(a, E - 10, r, E);
2160
+ return R.bumpVerticalPos(h), t.height += h, t.stopy = t.starty + t.height, R.insert(t.fromBounds, t.starty, t.toBounds, t.stopy), E;
2161
+ }
2162
+ x(He, "boundMessage");
2163
+ var jr = /* @__PURE__ */ x(async function(e, t, a, r, i, n) {
2164
+ const { startx: s, stopx: c, starty: E, message: h, type: p, sequenceIndex: _, sequenceVisible: u } = t, O = Z.calculateTextDimensions(h, Rt(l)), T = se();
2165
+ T.x = Math.min(s, c), T.y = E + 10, T.width = Math.abs(c - s), T.class = "messageText", T.dy = "1em", T.text = h, T.fontFamily = l.messageFontFamily, T.fontSize = l.messageFontSize, T.fontWeight = l.messageFontWeight, T.anchor = l.messageAlign, T.valign = "center", T.textMargin = l.wrapPadding, T.tspan = !1, Q(T.text) ? await Ht(e, T, { startx: s, stopx: c, starty: a }) : At(e, T);
2166
+ const g = O.width;
2167
+ let f;
2168
+ if (s === c) {
2169
+ const L = u || l.showSequenceNumbers, b = Je(i, r), w = na(i, r), A = s + (L && (b || w) ? 10 : 0);
2170
+ l.rightAngles ? f = e.append("path").attr(
2171
+ "d",
2172
+ `M ${A},${a} H ${s + N.getMax(l.width / 2, g / 2)} V ${a + 25} H ${s}`
2173
+ ) : f = e.append("path").attr(
2174
+ "d",
2175
+ "M " + A + "," + a + " C " + (A + 60) + "," + (a - 10) + " " + (s + 60) + "," + (a + 30) + " " + s + "," + (a + 20)
2176
+ ), te(i, r) && ve(e, i, t, r, s, c, a);
2177
+ } else
2178
+ f = e.append("line"), f.attr("x1", s), f.attr("y1", a), f.attr("x2", c), f.attr("y2", a), te(i, r) && ve(e, i, t, r, s, c, a);
2179
+ p === r.db.LINETYPE.DOTTED || p === r.db.LINETYPE.DOTTED_CROSS || p === r.db.LINETYPE.DOTTED_POINT || p === r.db.LINETYPE.DOTTED_OPEN || p === r.db.LINETYPE.BIDIRECTIONAL_DOTTED || p === r.db.LINETYPE.SOLID_TOP_DOTTED || p === r.db.LINETYPE.SOLID_BOTTOM_DOTTED || p === r.db.LINETYPE.STICK_TOP_DOTTED || p === r.db.LINETYPE.STICK_BOTTOM_DOTTED || p === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED || p === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED || p === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED || p === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED ? (f.style("stroke-dasharray", "3, 3"), f.attr("class", "messageLine1")) : f.attr("class", "messageLine0"), f.attr("data-et", "message"), f.attr("data-id", "i" + t.id), f.attr("data-from", t.from), f.attr("data-to", t.to);
2180
+ let I = "";
2181
+ if (l.arrowMarkerAbsolute && (I = Er(!0)), f.attr("stroke-width", 2), f.attr("stroke", "none"), f.style("fill", "none"), (p === r.db.LINETYPE.SOLID_TOP || p === r.db.LINETYPE.SOLID_TOP_DOTTED) && f.attr("marker-end", "url(" + I + "#" + n + "-solidTopArrowHead)"), (p === r.db.LINETYPE.SOLID_BOTTOM || p === r.db.LINETYPE.SOLID_BOTTOM_DOTTED) && f.attr("marker-end", "url(" + I + "#" + n + "-solidBottomArrowHead)"), (p === r.db.LINETYPE.STICK_TOP || p === r.db.LINETYPE.STICK_TOP_DOTTED) && f.attr("marker-end", "url(" + I + "#" + n + "-stickTopArrowHead)"), (p === r.db.LINETYPE.STICK_BOTTOM || p === r.db.LINETYPE.STICK_BOTTOM_DOTTED) && f.attr("marker-end", "url(" + I + "#" + n + "-stickBottomArrowHead)"), (p === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE || p === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED) && f.attr("marker-start", "url(" + I + "#" + n + "-solidBottomArrowHead)"), (p === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE || p === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED) && f.attr("marker-start", "url(" + I + "#" + n + "-solidTopArrowHead)"), (p === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE || p === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED) && f.attr("marker-start", "url(" + I + "#" + n + "-stickBottomArrowHead)"), (p === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE || p === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED) && f.attr("marker-start", "url(" + I + "#" + n + "-stickTopArrowHead)"), (p === r.db.LINETYPE.SOLID || p === r.db.LINETYPE.DOTTED) && f.attr("marker-end", "url(" + I + "#" + n + "-arrowhead)"), (p === r.db.LINETYPE.BIDIRECTIONAL_SOLID || p === r.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (f.attr("marker-start", "url(" + I + "#" + n + "-arrowhead)"), f.attr("marker-end", "url(" + I + "#" + n + "-arrowhead)")), (p === r.db.LINETYPE.SOLID_POINT || p === r.db.LINETYPE.DOTTED_POINT) && f.attr("marker-end", "url(" + I + "#" + n + "-filled-head)"), (p === r.db.LINETYPE.SOLID_CROSS || p === r.db.LINETYPE.DOTTED_CROSS) && f.attr("marker-end", "url(" + I + "#" + n + "-crosshead)"), u || l.showSequenceNumbers) {
2182
+ const L = p === r.db.LINETYPE.BIDIRECTIONAL_SOLID || p === r.db.LINETYPE.BIDIRECTIONAL_DOTTED, b = p === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE || p === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED || p === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE || p === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED || p === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE || p === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED || p === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE || p === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED, w = 6, A = te(i, r);
2183
+ let D = s, M = c;
2184
+ L ? (s < c ? D = s + w * 2 : (D = s - w + (A ? -5 : 0), D += i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_DUAL || i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE ? -7.5 : 0), f.attr("x1", D)) : b ? (c > s ? M = c - 2 * w : (M = c - w, D += i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_DUAL || i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE ? -7.5 : 0), M += A ? 15 : 0, f.attr("x2", M), f.attr("x1", D)) : f.attr("x1", s + w);
2185
+ let V = 0;
2186
+ const W = s === c, U = s <= c;
2187
+ W ? V = t.fromBounds + 1 : b ? V = U ? t.toBounds - 1 : t.fromBounds + 1 : V = U ? t.fromBounds + 1 : t.toBounds - 1;
2188
+ let G = "12px";
2189
+ const X = _.toString().length;
2190
+ X > 5 ? G = "7px" : X > 3 && (G = "9px"), e.append("line").attr("x1", V).attr("y1", a).attr("x2", V).attr("y2", a).attr("stroke-width", 0).attr("marker-start", "url(" + I + "#" + n + "-sequencenumber)"), e.append("text").attr("x", V).attr("y", a + 4).attr("font-family", "sans-serif").attr("font-size", G).attr("text-anchor", "middle").attr("class", "sequenceNumber").text(_);
2191
+ }
2192
+ }, "drawMessage"), ta = /* @__PURE__ */ x(function(e, t, a, r, i, n, s) {
2193
+ let c = 0, E = 0, h, p = 0;
2194
+ for (const _ of r) {
2195
+ const u = t.get(_), O = u.box;
2196
+ h && h != O && (s || R.models.addBox(h), E += l.boxMargin + h.margin), O && O != h && (s || (O.x = c + E, O.y = i), E += O.margin), u.width = N.getMax(u.width || l.width, l.width), u.height = N.getMax(u.height || l.height, l.height), u.margin = u.margin || l.actorMargin, p = N.getMax(p, u.height), a.get(u.name) && (E += u.width / 2), u.x = c + E, u.starty = R.getVerticalPos(), R.insert(u.x, i, u.x + u.width, u.height), c += u.width + E, u.box && (u.box.width = c + O.margin - u.box.x), E = u.margin, h = u.box, R.models.addActor(u);
2197
+ }
2198
+ h && !s && R.models.addBox(h), R.bumpVerticalPos(p);
2199
+ }, "addActorRenderingData"), ae = /* @__PURE__ */ x(async function(e, t, a, r, i, n, s) {
2200
+ if (r) {
2201
+ let c = 0;
2202
+ R.bumpVerticalPos(l.boxMargin * 2);
2203
+ for (const E of a) {
2204
+ const h = t.get(E);
2205
+ h.stopy || (h.stopy = R.getVerticalPos());
2206
+ const p = await H.drawActor(
2207
+ e,
2208
+ h,
2209
+ l,
2210
+ !0,
2211
+ i,
2212
+ n,
2213
+ s
2214
+ );
2215
+ c = N.getMax(c, p);
2216
+ }
2217
+ R.bumpVerticalPos(c + l.boxMargin);
2218
+ } else
2219
+ for (const c of a) {
2220
+ const E = t.get(c);
2221
+ await H.drawActor(e, E, l, !1, i, n, s);
2222
+ }
2223
+ }, "drawActors"), qe = /* @__PURE__ */ x(function(e, t, a, r) {
2224
+ let i = 0, n = 0;
2225
+ for (const s of a) {
2226
+ const c = t.get(s), E = ra(c), h = H.drawPopup(
2227
+ e,
2228
+ c,
2229
+ E,
2230
+ l,
2231
+ l.forceMenus,
2232
+ r
2233
+ );
2234
+ h.height > i && (i = h.height), h.width + c.x > n && (n = h.width + c.x);
2235
+ }
2236
+ return { maxHeight: i, maxWidth: n };
2237
+ }, "drawActorsPopup"), ze = /* @__PURE__ */ x(function(e) {
2238
+ sr(l, e), e.fontFamily && (l.actorFontFamily = l.noteFontFamily = l.messageFontFamily = e.fontFamily), e.fontSize && (l.actorFontSize = l.noteFontSize = l.messageFontSize = e.fontSize), e.fontWeight && (l.actorFontWeight = l.noteFontWeight = l.messageFontWeight = e.fontWeight);
2239
+ }, "setConf"), Ut = /* @__PURE__ */ x(function(e) {
2240
+ return R.activations.filter(function(t) {
2241
+ return t.actor === e;
2242
+ });
2243
+ }, "actorActivations"), Ce = /* @__PURE__ */ x(function(e, t) {
2244
+ const a = t.get(e), r = Ut(e), i = r.reduce(
2245
+ function(s, c) {
2246
+ return N.getMin(s, c.startx);
2247
+ },
2248
+ a.x + a.width / 2 - 1
2249
+ ), n = r.reduce(
2250
+ function(s, c) {
2251
+ return N.getMax(s, c.stopx);
2252
+ },
2253
+ a.x + a.width / 2 + 1
2254
+ );
2255
+ return [i, n];
2256
+ }, "activationBounds");
2257
+ function ht(e, t, a, r, i) {
2258
+ R.bumpVerticalPos(a);
2259
+ let n = r;
2260
+ if (t.id && t.message && e[t.id]) {
2261
+ const s = e[t.id].width, c = Rt(l);
2262
+ t.message = Z.wrapLabel(`[${t.message}]`, s - 2 * l.wrapPadding, c), t.width = s, t.wrap = !0;
2263
+ const E = Z.calculateTextDimensions(t.message, c), h = N.getMax(E.height, l.labelBoxHeight);
2264
+ n = r + h, at.debug(`${h} - ${t.message}`);
2265
+ }
2266
+ i(t), R.bumpVerticalPos(n);
2267
+ }
2268
+ x(ht, "adjustLoopHeightForWrap");
2269
+ function Ue(e, t, a, r, i, n, s) {
2270
+ function c(p, _) {
2271
+ p.x < i.get(e.from).x ? (R.insert(
2272
+ t.stopx - _,
2273
+ t.starty,
2274
+ t.startx,
2275
+ t.stopy + p.height / 2 + l.noteMargin
2276
+ ), t.stopx = t.stopx + _) : (R.insert(
2277
+ t.startx,
2278
+ t.starty,
2279
+ t.stopx + _,
2280
+ t.stopy + p.height / 2 + l.noteMargin
2281
+ ), t.stopx = t.stopx - _);
2282
+ }
2283
+ x(c, "receiverAdjustment");
2284
+ function E(p, _) {
2285
+ p.x < i.get(e.to).x ? (R.insert(
2286
+ t.startx - _,
2287
+ t.starty,
2288
+ t.stopx,
2289
+ t.stopy + p.height / 2 + l.noteMargin
2290
+ ), t.startx = t.startx + _) : (R.insert(
2291
+ t.stopx,
2292
+ t.starty,
2293
+ t.startx + _,
2294
+ t.stopy + p.height / 2 + l.noteMargin
2295
+ ), t.startx = t.startx - _);
2296
+ }
2297
+ x(E, "senderAdjustment");
2298
+ const h = [
2299
+ Kt.ACTOR,
2300
+ Kt.CONTROL,
2301
+ Kt.ENTITY,
2302
+ Kt.DATABASE
2303
+ ];
2304
+ if (n.get(e.to) == r) {
2305
+ const p = i.get(e.to), _ = h.includes(p.type) ? It / 2 + 3 : p.width / 2 + 3;
2306
+ c(p, _), p.starty = a - p.height / 2, R.bumpVerticalPos(p.height / 2);
2307
+ } else if (s.get(e.from) == r) {
2308
+ const p = i.get(e.from);
2309
+ if (l.mirrorActors) {
2310
+ const _ = h.includes(p.type) ? It / 2 : p.width / 2;
2311
+ E(p, _);
2312
+ }
2313
+ p.stopy = a - p.height / 2, R.bumpVerticalPos(p.height / 2);
2314
+ } else if (s.get(e.to) == r) {
2315
+ const p = i.get(e.to);
2316
+ if (l.mirrorActors) {
2317
+ const _ = h.includes(p.type) ? It / 2 + 3 : p.width / 2 + 3;
2318
+ c(p, _);
2319
+ }
2320
+ p.stopy = a - p.height / 2, R.bumpVerticalPos(p.height / 2);
2321
+ }
2322
+ }
2323
+ x(Ue, "adjustCreatedDestroyedData");
2324
+ var ea = /* @__PURE__ */ x(async function(e, t, a, r) {
2325
+ const { securityLevel: i, sequence: n, look: s, themeVariables: c } = $();
2326
+ l = n;
2327
+ let E;
2328
+ i === "sandbox" && (E = Wt("#i" + t));
2329
+ const h = i === "sandbox" ? Wt(E.nodes()[0].contentDocument.body) : Wt("body"), p = i === "sandbox" ? E.nodes()[0].contentDocument : document;
2330
+ R.init(), at.debug(r.db);
2331
+ const _ = i === "sandbox" ? h.select(`[id="${t}"]`) : Wt(`[id="${t}"]`), u = r.db.getActors(), O = r.db.getCreatedActors(), T = r.db.getDestroyedActors(), g = r.db.getBoxes();
2332
+ let f = r.db.getActorKeys();
2333
+ const I = r.db.getMessages(), L = r.db.getDiagramTitle(), b = r.db.hasAtLeastOneBox(), w = r.db.hasAtLeastOneBoxWithTitle(), A = await Ge(u, I, r);
2334
+ if (l.height = await Xe(u, A, g), H.insertComputerIcon(_, t), H.insertDatabaseIcon(_, t), H.insertClockIcon(_, t), b && (R.bumpVerticalPos(l.boxMargin), w && R.bumpVerticalPos(g[0].textMaxHeight)), l.hideUnusedParticipants === !0) {
2335
+ const m = /* @__PURE__ */ new Set();
2336
+ I.forEach((k) => {
2337
+ m.add(k.from), m.add(k.to);
2338
+ }), f = f.filter((k) => m.has(k));
2339
+ }
2340
+ const D = new Map(
2341
+ f.map((m, k) => [u.get(m)?.name ?? m, k])
2342
+ );
2343
+ ta(_, u, O, f, 0, I, !1);
2344
+ const M = await ca(I, u, A, r);
2345
+ H.insertArrowHead(_, t), H.insertArrowCrossHead(_, t), H.insertArrowFilledHead(_, t), H.insertSequenceNumber(_, t), H.insertSolidTopArrowHead(_, t), H.insertSolidBottomArrowHead(_, t), H.insertStickTopArrowHead(_, t), H.insertStickBottomArrowHead(_, t), s === "neo" && H.insertDropShadow(_, l);
2346
+ function V(m, k) {
2347
+ const lt = R.endActivation(m);
2348
+ lt.starty + 18 > k && (lt.starty = k - 6, k += 12), H.drawActivation(
2349
+ _,
2350
+ lt,
2351
+ k,
2352
+ l,
2353
+ Ut(m.from).length,
2354
+ r,
2355
+ D
2356
+ ), R.insert(lt.startx, k - 10, lt.stopx, k);
2357
+ }
2358
+ x(V, "activeEnd");
2359
+ let W = 1, U = 1;
2360
+ const G = [], X = [];
2361
+ let nt = 0;
2362
+ for (const m of I) {
2363
+ let k, lt, et;
2364
+ switch (m.type) {
2365
+ case r.db.LINETYPE.NOTE:
2366
+ R.resetVerticalPos(), lt = m.noteModel, await $r(_, lt, m.id);
2367
+ break;
2368
+ case r.db.LINETYPE.ACTIVE_START:
2369
+ R.newActivation(m, _, u);
2370
+ break;
2371
+ case r.db.LINETYPE.CENTRAL_CONNECTION:
2372
+ R.newActivation(m, _, u);
2373
+ break;
2374
+ case r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:
2375
+ R.newActivation(m, _, u);
2376
+ break;
2377
+ case r.db.LINETYPE.ACTIVE_END:
2378
+ V(m, R.getVerticalPos());
2379
+ break;
2380
+ case r.db.LINETYPE.LOOP_START:
2381
+ ht(
2382
+ M,
2383
+ m,
2384
+ l.boxMargin,
2385
+ l.boxMargin + l.boxTextMargin,
2386
+ (K) => R.newLoop(K)
2387
+ );
2388
+ break;
2389
+ case r.db.LINETYPE.LOOP_END:
2390
+ k = R.endLoop(), await H.drawLoop(_, k, "loop", l, m), R.bumpVerticalPos(k.stopy - R.getVerticalPos()), R.models.addLoop(k);
2391
+ break;
2392
+ case r.db.LINETYPE.RECT_START:
2393
+ ht(M, m, l.boxMargin, l.boxMargin, (K) => {
2394
+ let Ot = K.message;
2395
+ Ot || (Ot = c?.rectBkgColor || c?.actorBkg || "rgba(128, 128, 128, 0.5)"), R.newLoop(void 0, Ot);
2396
+ });
2397
+ break;
2398
+ case r.db.LINETYPE.RECT_END:
2399
+ k = R.endLoop(), X.push(k), R.models.addLoop(k), R.bumpVerticalPos(k.stopy - R.getVerticalPos());
2400
+ break;
2401
+ case r.db.LINETYPE.OPT_START:
2402
+ ht(
2403
+ M,
2404
+ m,
2405
+ l.boxMargin,
2406
+ l.boxMargin + l.boxTextMargin,
2407
+ (K) => R.newLoop(K)
2408
+ );
2409
+ break;
2410
+ case r.db.LINETYPE.OPT_END:
2411
+ k = R.endLoop(), await H.drawLoop(_, k, "opt", l, m), R.bumpVerticalPos(k.stopy - R.getVerticalPos()), R.models.addLoop(k);
2412
+ break;
2413
+ case r.db.LINETYPE.ALT_START:
2414
+ ht(
2415
+ M,
2416
+ m,
2417
+ l.boxMargin,
2418
+ l.boxMargin + l.boxTextMargin,
2419
+ (K) => R.newLoop(K)
2420
+ );
2421
+ break;
2422
+ case r.db.LINETYPE.ALT_ELSE:
2423
+ ht(
2424
+ M,
2425
+ m,
2426
+ l.boxMargin + l.boxTextMargin,
2427
+ l.boxMargin,
2428
+ (K) => R.addSectionToLoop(K)
2429
+ );
2430
+ break;
2431
+ case r.db.LINETYPE.ALT_END:
2432
+ k = R.endLoop(), await H.drawLoop(_, k, "alt", l, m), R.bumpVerticalPos(k.stopy - R.getVerticalPos()), R.models.addLoop(k);
2433
+ break;
2434
+ case r.db.LINETYPE.PAR_START:
2435
+ case r.db.LINETYPE.PAR_OVER_START:
2436
+ ht(
2437
+ M,
2438
+ m,
2439
+ l.boxMargin,
2440
+ l.boxMargin + l.boxTextMargin,
2441
+ (K) => R.newLoop(K)
2442
+ ), R.saveVerticalPos();
2443
+ break;
2444
+ case r.db.LINETYPE.PAR_AND:
2445
+ ht(
2446
+ M,
2447
+ m,
2448
+ l.boxMargin + l.boxTextMargin,
2449
+ l.boxMargin,
2450
+ (K) => R.addSectionToLoop(K)
2451
+ );
2452
+ break;
2453
+ case r.db.LINETYPE.PAR_END:
2454
+ k = R.endLoop(), await H.drawLoop(_, k, "par", l, m), R.bumpVerticalPos(k.stopy - R.getVerticalPos()), R.models.addLoop(k);
2455
+ break;
2456
+ case r.db.LINETYPE.AUTONUMBER:
2457
+ W = m.message.start || W, U = m.message.step || U, m.message.visible ? r.db.enableSequenceNumbers() : r.db.disableSequenceNumbers();
2458
+ break;
2459
+ case r.db.LINETYPE.CRITICAL_START:
2460
+ ht(
2461
+ M,
2462
+ m,
2463
+ l.boxMargin,
2464
+ l.boxMargin + l.boxTextMargin,
2465
+ (K) => R.newLoop(K)
2466
+ );
2467
+ break;
2468
+ case r.db.LINETYPE.CRITICAL_OPTION:
2469
+ ht(
2470
+ M,
2471
+ m,
2472
+ l.boxMargin + l.boxTextMargin,
2473
+ l.boxMargin,
2474
+ (K) => R.addSectionToLoop(K)
2475
+ );
2476
+ break;
2477
+ case r.db.LINETYPE.CRITICAL_END:
2478
+ k = R.endLoop(), await H.drawLoop(_, k, "critical", l, m), R.bumpVerticalPos(k.stopy - R.getVerticalPos()), R.models.addLoop(k);
2479
+ break;
2480
+ case r.db.LINETYPE.BREAK_START:
2481
+ ht(
2482
+ M,
2483
+ m,
2484
+ l.boxMargin,
2485
+ l.boxMargin + l.boxTextMargin,
2486
+ (K) => R.newLoop(K)
2487
+ );
2488
+ break;
2489
+ case r.db.LINETYPE.BREAK_END:
2490
+ k = R.endLoop(), await H.drawLoop(_, k, "break", l, m), R.bumpVerticalPos(k.stopy - R.getVerticalPos()), R.models.addLoop(k);
2491
+ break;
2492
+ default:
2493
+ try {
2494
+ et = m.msgModel, et.starty = R.getVerticalPos(), et.sequenceIndex = W, et.sequenceVisible = r.db.showSequenceNumbers(), et.id = m.id, et.from = m.from, et.to = m.to;
2495
+ const K = await He(_, et);
2496
+ Ue(
2497
+ m,
2498
+ et,
2499
+ K,
2500
+ nt,
2501
+ u,
2502
+ O,
2503
+ T
2504
+ ), G.push({ messageModel: et, lineStartY: K, msg: m }), R.models.addMessage(et);
2505
+ } catch (K) {
2506
+ at.error("error while drawing message", K);
2507
+ }
2508
+ }
2509
+ [
2510
+ r.db.LINETYPE.SOLID_OPEN,
2511
+ r.db.LINETYPE.DOTTED_OPEN,
2512
+ r.db.LINETYPE.SOLID,
2513
+ r.db.LINETYPE.SOLID_TOP,
2514
+ r.db.LINETYPE.SOLID_BOTTOM,
2515
+ r.db.LINETYPE.STICK_TOP,
2516
+ r.db.LINETYPE.STICK_BOTTOM,
2517
+ r.db.LINETYPE.SOLID_TOP_DOTTED,
2518
+ r.db.LINETYPE.SOLID_BOTTOM_DOTTED,
2519
+ r.db.LINETYPE.STICK_TOP_DOTTED,
2520
+ r.db.LINETYPE.STICK_BOTTOM_DOTTED,
2521
+ r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
2522
+ r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,
2523
+ r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,
2524
+ r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,
2525
+ r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,
2526
+ r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,
2527
+ r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,
2528
+ r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,
2529
+ r.db.LINETYPE.DOTTED,
2530
+ r.db.LINETYPE.SOLID_CROSS,
2531
+ r.db.LINETYPE.DOTTED_CROSS,
2532
+ r.db.LINETYPE.SOLID_POINT,
2533
+ r.db.LINETYPE.DOTTED_POINT,
2534
+ r.db.LINETYPE.BIDIRECTIONAL_SOLID,
2535
+ r.db.LINETYPE.BIDIRECTIONAL_DOTTED
2536
+ ].includes(m.type) && (W = Math.round((W + U) * 100) / 100), nt++;
2537
+ }
2538
+ at.debug("createdActors", O), at.debug("destroyedActors", T), await ae(_, u, f, !1, t, r, D);
2539
+ for (const m of G)
2540
+ await jr(_, m.messageModel, m.lineStartY, r, m.msg, t);
2541
+ l.mirrorActors && await ae(_, u, f, !0, t, r, D), X.forEach((m) => H.drawBackgroundRect(_, m)), We(_, u, f, l);
2542
+ for (const m of R.models.boxes) {
2543
+ m.height = R.getVerticalPos() - m.y, R.insert(m.x, m.y, m.x + m.width, m.height);
2544
+ const k = l.boxMargin * 2;
2545
+ m.startx = m.x - k, m.starty = m.y - k * 0.25, m.stopx = m.startx + m.width + 2 * k, m.stopy = m.starty + m.height + k * 0.75, m.stroke = "rgb(0,0,0, 0.5)", H.drawBox(_, m, l);
2546
+ }
2547
+ b && R.bumpVerticalPos(l.boxMargin);
2548
+ const j = qe(_, u, f, p), { bounds: q } = R.getBounds();
2549
+ q.startx === void 0 && (q.startx = 0), q.starty === void 0 && (q.starty = 0), q.stopx === void 0 && (q.stopx = 0), q.stopy === void 0 && (q.stopy = 0);
2550
+ let st = q.stopy - q.starty;
2551
+ st < j.maxHeight && (st = j.maxHeight);
2552
+ let tt = st + 2 * l.diagramMarginY;
2553
+ l.mirrorActors && (tt = tt - l.boxMargin + l.bottomMarginAdj);
2554
+ let Y = q.stopx - q.startx;
2555
+ Y < j.maxWidth && (Y = j.maxWidth);
2556
+ const C = Y + 2 * l.diagramMarginX;
2557
+ L && _.append("text").text(L).attr("x", (q.stopx - q.startx) / 2 - 2 * l.diagramMarginX).attr("y", -25), ar(_, tt, C, l.useMaxWidth);
2558
+ const St = L ? 40 : 0, Dt = u.size && s === "neo" ? 30 : 0;
2559
+ _.attr(
2560
+ "viewBox",
2561
+ q.startx - l.diagramMarginX + " -" + (l.diagramMarginY + St) + " " + C + " " + (tt + St + Dt)
2562
+ ), at.debug("models:", R.models);
2563
+ }, "draw");
2564
+ async function Ge(e, t, a) {
2565
+ const r = {};
2566
+ for (const i of t)
2567
+ if (e.get(i.to) && e.get(i.from)) {
2568
+ const n = e.get(i.to);
2569
+ if (i.placement === a.db.PLACEMENT.LEFTOF && !n.prevActor || i.placement === a.db.PLACEMENT.RIGHTOF && !n.nextActor)
2570
+ continue;
2571
+ const s = i.placement !== void 0, c = !s, E = s ? bt(l) : Rt(l), h = i.wrap ? Z.wrapLabel(i.message, l.width - 2 * l.wrapPadding, E) : i.message, _ = (Q(h) ? await kt(i.message, $()) : Z.calculateTextDimensions(h, E)).width + 2 * l.wrapPadding;
2572
+ c && i.from === n.nextActor ? r[i.to] = N.getMax(
2573
+ r[i.to] || 0,
2574
+ _
2575
+ ) : c && i.from === n.prevActor ? r[i.from] = N.getMax(
2576
+ r[i.from] || 0,
2577
+ _
2578
+ ) : c && i.from === i.to ? (r[i.from] = N.getMax(
2579
+ r[i.from] || 0,
2580
+ _ / 2
2581
+ ), r[i.to] = N.getMax(
2582
+ r[i.to] || 0,
2583
+ _ / 2
2584
+ )) : i.placement === a.db.PLACEMENT.RIGHTOF ? r[i.from] = N.getMax(
2585
+ r[i.from] || 0,
2586
+ _
2587
+ ) : i.placement === a.db.PLACEMENT.LEFTOF ? r[n.prevActor] = N.getMax(
2588
+ r[n.prevActor] || 0,
2589
+ _
2590
+ ) : i.placement === a.db.PLACEMENT.OVER && (n.prevActor && (r[n.prevActor] = N.getMax(
2591
+ r[n.prevActor] || 0,
2592
+ _ / 2
2593
+ )), n.nextActor && (r[i.from] = N.getMax(
2594
+ r[i.from] || 0,
2595
+ _ / 2
2596
+ )));
2597
+ }
2598
+ return at.debug("maxMessageWidthPerActor:", r), r;
2599
+ }
2600
+ x(Ge, "getMaxMessageWidthPerActor");
2601
+ var ra = /* @__PURE__ */ x(function(e) {
2602
+ let t = 0;
2603
+ const a = re(l);
2604
+ for (const r in e.links) {
2605
+ const n = Z.calculateTextDimensions(r, a).width + 2 * l.wrapPadding + 2 * l.boxMargin;
2606
+ t < n && (t = n);
2607
+ }
2608
+ return t;
2609
+ }, "getRequiredPopupWidth");
2610
+ async function Xe(e, t, a) {
2611
+ let r = 0;
2612
+ for (const n of e.keys()) {
2613
+ const s = e.get(n);
2614
+ s.wrap && (s.description = Z.wrapLabel(
2615
+ s.description,
2616
+ l.width - 2 * l.wrapPadding,
2617
+ re(l)
2618
+ ));
2619
+ const c = Q(s.description) ? await kt(s.description, $()) : Z.calculateTextDimensions(s.description, re(l));
2620
+ s.width = s.wrap ? l.width : N.getMax(l.width, c.width + 2 * l.wrapPadding), s.height = s.wrap ? N.getMax(c.height, l.height) : l.height, r = N.getMax(r, s.height);
2621
+ }
2622
+ for (const n in t) {
2623
+ const s = e.get(n);
2624
+ if (!s)
2625
+ continue;
2626
+ const c = e.get(s.nextActor);
2627
+ if (!c) {
2628
+ const _ = t[n] + l.actorMargin - s.width / 2;
2629
+ s.margin = N.getMax(_, l.actorMargin);
2630
+ continue;
2631
+ }
2632
+ const h = t[n] + l.actorMargin - s.width / 2 - c.width / 2;
2633
+ s.margin = N.getMax(h, l.actorMargin);
2634
+ }
2635
+ let i = 0;
2636
+ return a.forEach((n) => {
2637
+ const s = Rt(l);
2638
+ let c = n.actorKeys.reduce((_, u) => _ += e.get(u).width + (e.get(u).margin || 0), 0);
2639
+ const E = l.boxMargin * 8;
2640
+ c += E, c -= 2 * l.boxTextMargin, n.wrap && (n.name = Z.wrapLabel(n.name, c - 2 * l.wrapPadding, s));
2641
+ const h = Z.calculateTextDimensions(n.name, s);
2642
+ i = N.getMax(h.height, i);
2643
+ const p = N.getMax(c, h.width + 2 * l.wrapPadding);
2644
+ if (n.margin = l.boxTextMargin, c < p) {
2645
+ const _ = (p - c) / 2;
2646
+ n.margin += _;
2647
+ }
2648
+ }), a.forEach((n) => n.textMaxHeight = i), N.getMax(r, l.height);
2649
+ }
2650
+ x(Xe, "calculateActorMargins");
2651
+ var aa = /* @__PURE__ */ x(async function(e, t, a) {
2652
+ const r = t.get(e.from), i = t.get(e.to), n = r.x, s = i.x, c = e.wrap && e.message;
2653
+ let E = Q(e.message) ? await kt(e.message, $()) : Z.calculateTextDimensions(
2654
+ c ? Z.wrapLabel(e.message, l.width, bt(l)) : e.message,
2655
+ bt(l)
2656
+ );
2657
+ const h = {
2658
+ width: c ? l.width : N.getMax(l.width, E.width + 2 * l.noteMargin),
2659
+ height: 0,
2660
+ startx: r.x,
2661
+ stopx: 0,
2662
+ starty: 0,
2663
+ stopy: 0,
2664
+ message: e.message
2665
+ };
2666
+ return e.placement === a.db.PLACEMENT.RIGHTOF ? (h.width = c ? N.getMax(l.width, E.width) : N.getMax(
2667
+ r.width / 2 + i.width / 2,
2668
+ E.width + 2 * l.noteMargin
2669
+ ), h.startx = n + (r.width + l.actorMargin) / 2) : e.placement === a.db.PLACEMENT.LEFTOF ? (h.width = c ? N.getMax(l.width, E.width + 2 * l.noteMargin) : N.getMax(
2670
+ r.width / 2 + i.width / 2,
2671
+ E.width + 2 * l.noteMargin
2672
+ ), h.startx = n - h.width + (r.width - l.actorMargin) / 2) : e.to === e.from ? (E = Z.calculateTextDimensions(
2673
+ c ? Z.wrapLabel(e.message, N.getMax(l.width, r.width), bt(l)) : e.message,
2674
+ bt(l)
2675
+ ), h.width = c ? N.getMax(l.width, r.width) : N.getMax(r.width, l.width, E.width + 2 * l.noteMargin), h.startx = n + (r.width - h.width) / 2) : (h.width = Math.abs(n + r.width / 2 - (s + i.width / 2)) + l.actorMargin, h.startx = n < s ? n + r.width / 2 - l.actorMargin / 2 : s + i.width / 2 - l.actorMargin / 2), c && (h.message = Z.wrapLabel(
2676
+ e.message,
2677
+ h.width - 2 * l.wrapPadding,
2678
+ bt(l)
2679
+ )), at.debug(
2680
+ `NM:[${h.startx},${h.stopx},${h.starty},${h.stopy}:${h.width},${h.height}=${e.message}]`
2681
+ ), h;
2682
+ }, "buildNoteModel"), sa = 4, te = /* @__PURE__ */ x(function(e, t) {
2683
+ const { CENTRAL_CONNECTION: a, CENTRAL_CONNECTION_REVERSE: r, CENTRAL_CONNECTION_DUAL: i } = t.db.LINETYPE;
2684
+ return [a, r, i].includes(
2685
+ e.centralConnection
2686
+ );
2687
+ }, "hasCentralConnection"), ia = /* @__PURE__ */ x(function(e, t, a) {
2688
+ const {
2689
+ CENTRAL_CONNECTION_REVERSE: r,
2690
+ CENTRAL_CONNECTION_DUAL: i,
2691
+ BIDIRECTIONAL_SOLID: n,
2692
+ BIDIRECTIONAL_DOTTED: s
2693
+ } = t.db.LINETYPE;
2694
+ let c = 0;
2695
+ return (e.centralConnection === r || e.centralConnection === i) && (c += sa), (e.centralConnection === r || e.centralConnection === i) && (e.type === n || e.type === s) && (c += a ? 0 : -6), c;
2696
+ }, "calculateCentralConnectionOffset"), Je = /* @__PURE__ */ x(function(e, t) {
2697
+ const {
2698
+ SOLID_ARROW_TOP_REVERSE: a,
2699
+ SOLID_ARROW_TOP_REVERSE_DOTTED: r,
2700
+ SOLID_ARROW_BOTTOM_REVERSE: i,
2701
+ SOLID_ARROW_BOTTOM_REVERSE_DOTTED: n,
2702
+ STICK_ARROW_TOP_REVERSE: s,
2703
+ STICK_ARROW_TOP_REVERSE_DOTTED: c,
2704
+ STICK_ARROW_BOTTOM_REVERSE: E,
2705
+ STICK_ARROW_BOTTOM_REVERSE_DOTTED: h
2706
+ } = t.db.LINETYPE;
2707
+ return [
2708
+ a,
2709
+ r,
2710
+ i,
2711
+ n,
2712
+ s,
2713
+ c,
2714
+ E,
2715
+ h
2716
+ ].includes(e.type);
2717
+ }, "isReverseArrowType"), na = /* @__PURE__ */ x(function(e, t) {
2718
+ const { BIDIRECTIONAL_SOLID: a, BIDIRECTIONAL_DOTTED: r } = t.db.LINETYPE;
2719
+ return [a, r].includes(e.type);
2720
+ }, "isBidirectionalArrowType"), oa = /* @__PURE__ */ x(function(e, t, a) {
2721
+ const { look: r } = $();
2722
+ if (![
2723
+ a.db.LINETYPE.SOLID_OPEN,
2724
+ a.db.LINETYPE.DOTTED_OPEN,
2725
+ a.db.LINETYPE.SOLID,
2726
+ a.db.LINETYPE.SOLID_TOP,
2727
+ a.db.LINETYPE.SOLID_BOTTOM,
2728
+ a.db.LINETYPE.STICK_TOP,
2729
+ a.db.LINETYPE.STICK_BOTTOM,
2730
+ a.db.LINETYPE.SOLID_TOP_DOTTED,
2731
+ a.db.LINETYPE.SOLID_BOTTOM_DOTTED,
2732
+ a.db.LINETYPE.STICK_TOP_DOTTED,
2733
+ a.db.LINETYPE.STICK_BOTTOM_DOTTED,
2734
+ a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
2735
+ a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,
2736
+ a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,
2737
+ a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,
2738
+ a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,
2739
+ a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,
2740
+ a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,
2741
+ a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,
2742
+ a.db.LINETYPE.DOTTED,
2743
+ a.db.LINETYPE.SOLID_CROSS,
2744
+ a.db.LINETYPE.DOTTED_CROSS,
2745
+ a.db.LINETYPE.SOLID_POINT,
2746
+ a.db.LINETYPE.DOTTED_POINT,
2747
+ a.db.LINETYPE.BIDIRECTIONAL_SOLID,
2748
+ a.db.LINETYPE.BIDIRECTIONAL_DOTTED
2749
+ ].includes(e.type))
2750
+ return {};
2751
+ const [i, n] = Ce(e.from, t), [s, c] = Ce(e.to, t), E = i <= s;
2752
+ let h = E ? n : i, p = E ? s : c;
2753
+ r === "neo" && (e.type !== a.db.LINETYPE.SOLID_OPEN && (p += E ? -3 : 3), (e.type === a.db.LINETYPE.BIDIRECTIONAL_SOLID || e.type === a.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (h += E ? 3 : -3)), h += ia(e, a, E);
2754
+ const _ = Math.abs(s - c) > 2, u = /* @__PURE__ */ x((f) => E ? -f : f, "adjustValue");
2755
+ e.from === e.to ? p = h : (e.activate && !_ && (p += u(l.activationWidth / 2 - 1)), [
2756
+ a.db.LINETYPE.SOLID_OPEN,
2757
+ a.db.LINETYPE.DOTTED_OPEN,
2758
+ a.db.LINETYPE.STICK_TOP,
2759
+ a.db.LINETYPE.STICK_BOTTOM,
2760
+ a.db.LINETYPE.STICK_TOP_DOTTED,
2761
+ a.db.LINETYPE.STICK_BOTTOM_DOTTED,
2762
+ a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,
2763
+ a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,
2764
+ a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,
2765
+ a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,
2766
+ a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,
2767
+ a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,
2768
+ a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
2769
+ a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE
2770
+ ].includes(e.type) || (p += u(3)), [
2771
+ a.db.LINETYPE.BIDIRECTIONAL_SOLID,
2772
+ a.db.LINETYPE.BIDIRECTIONAL_DOTTED,
2773
+ a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,
2774
+ a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,
2775
+ a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
2776
+ a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE
2777
+ ].includes(e.type) && (h -= u(3)));
2778
+ const O = [i, n, s, c], T = Math.abs(h - p);
2779
+ e.wrap && e.message && (e.message = Z.wrapLabel(
2780
+ e.message,
2781
+ N.getMax(T + 2 * l.wrapPadding, l.width),
2782
+ Rt(l)
2783
+ ));
2784
+ const g = Z.calculateTextDimensions(e.message, Rt(l));
2785
+ return {
2786
+ width: N.getMax(
2787
+ e.wrap ? 0 : g.width + 2 * l.wrapPadding,
2788
+ T + 2 * l.wrapPadding,
2789
+ l.width
2790
+ ),
2791
+ height: 0,
2792
+ startx: h,
2793
+ stopx: p,
2794
+ starty: 0,
2795
+ stopy: 0,
2796
+ message: e.message,
2797
+ type: e.type,
2798
+ wrap: e.wrap,
2799
+ fromBounds: Math.min.apply(null, O),
2800
+ toBounds: Math.max.apply(null, O)
2801
+ };
2802
+ }, "buildMessageModel"), ca = /* @__PURE__ */ x(async function(e, t, a, r) {
2803
+ const i = {}, n = [];
2804
+ let s, c, E;
2805
+ for (const h of e) {
2806
+ switch (h.type) {
2807
+ case r.db.LINETYPE.LOOP_START:
2808
+ case r.db.LINETYPE.ALT_START:
2809
+ case r.db.LINETYPE.OPT_START:
2810
+ case r.db.LINETYPE.PAR_START:
2811
+ case r.db.LINETYPE.PAR_OVER_START:
2812
+ case r.db.LINETYPE.CRITICAL_START:
2813
+ case r.db.LINETYPE.BREAK_START:
2814
+ n.push({
2815
+ id: h.id,
2816
+ msg: h.message,
2817
+ from: Number.MAX_SAFE_INTEGER,
2818
+ to: Number.MIN_SAFE_INTEGER,
2819
+ width: 0
2820
+ });
2821
+ break;
2822
+ case r.db.LINETYPE.ALT_ELSE:
2823
+ case r.db.LINETYPE.PAR_AND:
2824
+ case r.db.LINETYPE.CRITICAL_OPTION:
2825
+ h.message && (s = n.pop(), i[s.id] = s, i[h.id] = s, n.push(s));
2826
+ break;
2827
+ case r.db.LINETYPE.LOOP_END:
2828
+ case r.db.LINETYPE.ALT_END:
2829
+ case r.db.LINETYPE.OPT_END:
2830
+ case r.db.LINETYPE.PAR_END:
2831
+ case r.db.LINETYPE.CRITICAL_END:
2832
+ case r.db.LINETYPE.BREAK_END:
2833
+ s = n.pop(), i[s.id] = s;
2834
+ break;
2835
+ case r.db.LINETYPE.ACTIVE_START:
2836
+ {
2837
+ const _ = t.get(h.from ? h.from : h.to.actor), u = Ut(h.from ? h.from : h.to.actor).length, O = _.x + _.width / 2 + (u - 1) * l.activationWidth / 2, T = {
2838
+ startx: O,
2839
+ stopx: O + l.activationWidth,
2840
+ actor: h.from,
2841
+ enabled: !0
2842
+ };
2843
+ R.activations.push(T);
2844
+ }
2845
+ break;
2846
+ case r.db.LINETYPE.ACTIVE_END:
2847
+ {
2848
+ const _ = R.activations.map((u) => u.actor).lastIndexOf(h.from);
2849
+ R.activations.splice(_, 1).splice(0, 1);
2850
+ }
2851
+ break;
2852
+ }
2853
+ h.placement !== void 0 ? (c = await aa(h, t, r), h.noteModel = c, n.forEach((_) => {
2854
+ s = _, s.from = N.getMin(s.from, c.startx), s.to = N.getMax(s.to, c.startx + c.width), s.width = N.getMax(s.width, Math.abs(s.from - s.to)) - l.labelBoxWidth;
2855
+ })) : (E = oa(h, t, r), h.msgModel = E, E.startx && E.stopx && n.length > 0 && n.forEach((_) => {
2856
+ if (s = _, E.startx === E.stopx) {
2857
+ const u = t.get(h.from), O = t.get(h.to);
2858
+ s.from = N.getMin(
2859
+ u.x - E.width / 2,
2860
+ u.x - u.width / 2,
2861
+ s.from
2862
+ ), s.to = N.getMax(
2863
+ O.x + E.width / 2,
2864
+ O.x + u.width / 2,
2865
+ s.to
2866
+ ), s.width = N.getMax(s.width, Math.abs(s.to - s.from)) - l.labelBoxWidth;
2867
+ } else
2868
+ s.from = N.getMin(E.startx, s.from), s.to = N.getMax(E.stopx, s.to), s.width = N.getMax(s.width, E.width) - l.labelBoxWidth;
2869
+ }));
2870
+ }
2871
+ return R.activations = [], at.debug("Loop type widths:", i), i;
2872
+ }, "calculateLoopBounds"), la = {
2873
+ bounds: R,
2874
+ drawActors: ae,
2875
+ drawActorsPopup: qe,
2876
+ setConf: ze,
2877
+ draw: ea
2878
+ }, fa = {
2879
+ parser: _r,
2880
+ get db() {
2881
+ return new yr();
2882
+ },
2883
+ renderer: la,
2884
+ styles: Or,
2885
+ init: /* @__PURE__ */ x((e) => {
2886
+ e.sequence || (e.sequence = {}), e.wrap && (e.sequence.wrap = e.wrap, rr({ sequence: { wrap: e.wrap } }));
2887
+ }, "init")
2888
+ };
2889
+ export {
2890
+ fa as diagram
2891
+ };