@marimo-team/islands 0.15.2 → 0.15.3

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 (189) hide show
  1. package/dist/{ConnectedDataExplorerComponent-C39nQwtD.js → ConnectedDataExplorerComponent-DfvW3rBn.js} +323 -328
  2. package/dist/{ImageComparisonComponent-BhkiyswP.js → ImageComparisonComponent-XaJshw7d.js} +13 -13
  3. package/dist/{_baseUniq-DdHL34FO.js → _baseUniq-dN9WKF9m.js} +67 -67
  4. package/dist/any-language-editor-CpFniVi-.js +27 -0
  5. package/dist/{arc-BXrety1g.js → arc-BOhn-m2C.js} +1 -1
  6. package/dist/{architectureDiagram-KFL7JDKH-BMy6ywCF.js → architectureDiagram-W76B3OCA-Bpg85ZKv.js} +144 -144
  7. package/dist/assets/{worker-COGufAQn.js → worker-Y-Q4G-N2.js} +30 -26
  8. package/dist/asterisk-DS281yxp.js +271 -0
  9. package/dist/{blockDiagram-ZYB65J3Q-DYT2-nlI.js → blockDiagram-QIGZ2CNN-DS1kOHlW.js} +10 -10
  10. package/dist/{c4Diagram-AAMF2YG6-ZiQzioe6.js → c4Diagram-FPNF74CW-CyRVKssw.js} +8 -8
  11. package/dist/{channel-CeuXqUAU.js → channel-BilGXox7.js} +1 -1
  12. package/dist/{chunk-ANTBXLJU-BvYnIrdq.js → chunk-4BX2VUAB-CZR39zCO.js} +1 -1
  13. package/dist/{chunk-WVR4S24B-DXj8yaUk.js → chunk-55IACEB6-BIH-MYov.js} +1 -1
  14. package/dist/{chunk-GLLZNHP4-CyFsosAe.js → chunk-FMBD7UC4-4PZXFZE8.js} +1 -1
  15. package/dist/{chunk-JBRWN2VN-DA_EEhy2.js → chunk-K7UQS3LO-CEvWKznk.js} +117 -117
  16. package/dist/{chunk-NRVI72HA-BYx2jMlI.js → chunk-QN33PNHL-D5LO5Jq_.js} +1 -1
  17. package/dist/{chunk-FHKO5MBM-DfCztBk8.js → chunk-QZHKN3VN-6gwUonWI.js} +1 -1
  18. package/dist/{chunk-LXBSTHXV-Se7vdY6J.js → chunk-TVAH2DTR-3gm06QdU.js} +7 -7
  19. package/dist/{chunk-OMD6QJNC-CqgcPMgL.js → chunk-TZMSLE5B-Cm8Iy9bO.js} +1 -1
  20. package/dist/{classDiagram-v2-QTMF73CY-B19A3G1l.js → classDiagram-KNZD7YFC-DC529O_z.js} +2 -2
  21. package/dist/{classDiagram-3BZAVTQC-B19A3G1l.js → classDiagram-v2-RKCZMP56-DC529O_z.js} +2 -2
  22. package/dist/{clone-78au0tn1.js → clone-CLoRX3j6.js} +1 -1
  23. package/dist/cose-bilkent-S5V4N54A-qf5DlS6Y.js +2609 -0
  24. package/dist/{cytoscape.esm-BYnVVhJX.js → cytoscape.esm-DfdJODL8.js} +34 -34
  25. package/dist/{dagre-2BBEFEWP-BfEn3ZUV.js → dagre-5GWH7T2D-Ceocls0m.js} +6 -6
  26. package/dist/{data-grid-overlay-editor-CH_qLkV2.js → data-grid-overlay-editor-AqDS_UKe.js} +11 -11
  27. package/dist/{diagram-4IRLE6MV-CL8xidnG.js → diagram-N5W7TBWH-CP66oSiv.js} +59 -60
  28. package/dist/{diagram-RP2FKANI-B1BPcUew.js → diagram-QEK2KX5R-_YD4kxxi.js} +15 -15
  29. package/dist/{diagram-GUPCWM2R-CZ5cfqlq.js → diagram-S2PKOQOG-Cnj8T-OP.js} +10 -10
  30. package/dist/dockerfile-Cm8cRYCN.js +194 -0
  31. package/dist/ebnf-DUPDuY4r.js +78 -0
  32. package/dist/{erDiagram-HZWUO2LU-BEAIww50.js → erDiagram-AWTI2OKA-CGnvoHx6.js} +8 -8
  33. package/dist/fcl-CPC2WYrI.js +103 -0
  34. package/dist/{flowDiagram-THRYKUMA-Czs2UAI2.js → flowDiagram-PVAE7QVJ-DG-pr9R9.js} +9 -9
  35. package/dist/{ganttDiagram-WV7ZQ7D5-ByYIAVFO.js → ganttDiagram-OWAHRB6G-JmChtxvn.js} +34 -34
  36. package/dist/{gitGraphDiagram-OJR772UL-BcpDsiyB.js → gitGraphDiagram-NY62KEGX-D8wLfOPd.js} +4 -4
  37. package/dist/{glide-data-editor-CmN6FVyi.js → glide-data-editor-9nC3iCIZ.js} +33 -33
  38. package/dist/{graph-77W6heli.js → graph-CoRe7vAN.js} +3 -3
  39. package/dist/http-D9LttvKF.js +44 -0
  40. package/dist/{index-Bfk9dnyS.js → index-6qYeHHjQ.js} +33090 -32892
  41. package/dist/{index-BOojn38D.js → index-BpzLh4Qe.js} +7711 -7711
  42. package/dist/{index-CmozKMxx.js → index-BthgsgYX.js} +6 -6
  43. package/dist/{index-pBmAzQJl.js → index-MCx5v1x0.js} +2 -2
  44. package/dist/index-jkm77Jrz.js +98 -0
  45. package/dist/{infoDiagram-6WOFNB3A-CfzLHHVP.js → infoDiagram-STP46IZ2-BlXxvOrR.js} +2 -2
  46. package/dist/{journeyDiagram-FFXJYRFH-ndAcpkGn.js → journeyDiagram-BIP6EPQ6-CNRYs_Fc.js} +24 -26
  47. package/dist/{kanban-definition-KOZQBZVT-DcQYzNvc.js → kanban-definition-6OIFK2YF-B9HeMAuP.js} +14 -14
  48. package/dist/{layout-XySVHJgD.js → layout-m2vOUiW1.js} +81 -81
  49. package/dist/{linear-PbooOqg7.js → linear-DU6Q5CX3.js} +35 -35
  50. package/dist/{main-B5yML0bw.js → main-BD2KGFpU.js} +74594 -68034
  51. package/dist/main.js +1 -1
  52. package/dist/{mermaid-Cg5IX6Nv.js → mermaid-HVCtvbyx.js} +6160 -7493
  53. package/dist/min-DcGMA4e_.js +80 -0
  54. package/dist/mindmap-definition-Q6HEUPPD-BW8UmIDQ.js +785 -0
  55. package/dist/nginx-zDPm3Z74.js +89 -0
  56. package/dist/{number-overlay-editor-DUhfZqtP.js → number-overlay-editor-D8Hl0Syo.js} +19 -19
  57. package/dist/{pieDiagram-DBDJKBY4-DTOlNsja.js → pieDiagram-ADFJNKIX-Bg-3zg5U.js} +17 -17
  58. package/dist/{quadrantDiagram-YPSRARAO-BX2d8VS-.js → quadrantDiagram-LMRXKWRM-BO4IG6Yz.js} +6 -6
  59. package/dist/{react-plotly-Dcyw-3Sa.js → react-plotly-dkvHVuRb.js} +3577 -3577
  60. package/dist/{requirementDiagram-EGVEC5DT-D1T5u-wG.js → requirementDiagram-4UW4RH46-5sdTguSM.js} +7 -7
  61. package/dist/{sankeyDiagram-HRAUVNP4-G6xDfnp-.js → sankeyDiagram-GR3RE2ED-Buhlv9OI.js} +5 -5
  62. package/dist/sequenceDiagram-C3RYC4MD-C3qsM2UP.js +2519 -0
  63. package/dist/{slides-component-BJLlPJSr.js → slides-component-D209A0-s.js} +66 -66
  64. package/dist/solr-BNlsLglM.js +41 -0
  65. package/dist/spreadsheet-C-cy4P5N.js +49 -0
  66. package/dist/{stateDiagram-UUKSUZ4H-CYXbjaom.js → stateDiagram-KXAO66HF-CopJ7G6P.js} +5 -5
  67. package/dist/{stateDiagram-v2-EYPG3UTE-Br1HYKT6.js → stateDiagram-v2-UMBNRL4Z-CejL8AKf.js} +2 -2
  68. package/dist/style.css +1 -1
  69. package/dist/tiddlywiki-5wqsXtSk.js +155 -0
  70. package/dist/tiki-__Kn3CeS.js +181 -0
  71. package/dist/{time-B9SZnSen.js → time-BwSBitlN.js} +58 -58
  72. package/dist/{timeline-definition-3HZDQTIS-DeK_ZRD0.js → timeline-definition-XQNQX7LJ-DzMNTX-C.js} +10 -12
  73. package/dist/{timer-BYwnU4DF.js → timer-B0-z63CM.js} +16 -16
  74. package/dist/{treemap-75Q7IDZK-CKP4vV_0.js → treemap-75Q7IDZK-zeJG07dk.js} +14 -14
  75. package/dist/{vega-component-CpgdqX2d.js → vega-component-CUkiTayd.js} +30 -30
  76. package/dist/{xychartDiagram-FDP5SA34-AMEPsx_R.js → xychartDiagram-6GGTOJPD-DiENNXMS.js} +7 -7
  77. package/package.json +39 -39
  78. package/src/__mocks__/notebook.ts +3 -0
  79. package/src/__mocks__/requests.ts +3 -0
  80. package/src/__tests__/__snapshots__/CellStatus.test.tsx.snap +12 -12
  81. package/src/__tests__/chat-utils.test.ts +26 -211
  82. package/src/components/ai/ai-model-dropdown.tsx +25 -9
  83. package/src/components/app-config/ai-config.tsx +7 -0
  84. package/src/components/chat/chat-components.tsx +71 -0
  85. package/src/components/chat/chat-panel.tsx +481 -291
  86. package/src/components/chat/chat-utils.ts +50 -0
  87. package/src/components/chat/markdown-renderer.tsx +3 -7
  88. package/src/components/chat/tool-call-accordion.tsx +5 -5
  89. package/src/components/datasources/__tests__/utils.test.ts +6 -0
  90. package/src/components/datasources/column-preview.tsx +1 -3
  91. package/src/components/editor/actions/useNotebookActions.tsx +1 -1
  92. package/src/components/editor/ai/add-cell-with-ai.tsx +20 -15
  93. package/src/components/editor/ai/ai-completion-editor.tsx +22 -3
  94. package/src/components/editor/ai/completion-handlers.tsx +2 -4
  95. package/src/components/editor/ai/completion-utils.ts +85 -11
  96. package/src/components/editor/alerts/startup-logs-alert.tsx +72 -0
  97. package/src/components/editor/chrome/panels/datasources-panel.tsx +3 -1
  98. package/src/components/editor/chrome/panels/dependency-graph-panel.tsx +3 -1
  99. package/src/components/editor/chrome/panels/documentation-panel.tsx +3 -1
  100. package/src/components/editor/chrome/panels/error-panel.tsx +3 -1
  101. package/src/components/editor/chrome/panels/file-explorer-panel.tsx +3 -1
  102. package/src/components/editor/chrome/panels/logs-panel.tsx +3 -1
  103. package/src/components/editor/chrome/panels/outline-panel.tsx +3 -1
  104. package/src/components/editor/chrome/panels/packages-panel.tsx +4 -2
  105. package/src/components/editor/chrome/panels/scratchpad-panel.tsx +3 -1
  106. package/src/components/editor/chrome/panels/secrets-panel.tsx +3 -1
  107. package/src/components/editor/chrome/panels/snippets-panel.tsx +3 -1
  108. package/src/components/editor/chrome/panels/tracing-panel.tsx +3 -1
  109. package/src/components/editor/chrome/panels/variable-panel.tsx +3 -1
  110. package/src/components/editor/chrome/wrapper/app-chrome.tsx +38 -28
  111. package/src/components/editor/controls/command-palette-button.tsx +1 -1
  112. package/src/components/editor/controls/command-palette.tsx +5 -4
  113. package/src/components/editor/controls/state.ts +4 -0
  114. package/src/components/editor/package-alert.tsx +108 -58
  115. package/src/components/editor/renderers/CellArray.tsx +2 -0
  116. package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +0 -1
  117. package/src/components/pages/edit-page.tsx +7 -3
  118. package/src/core/ai/chat-utils.ts +26 -43
  119. package/src/core/ai/config.ts +1 -1
  120. package/src/core/ai/context/__tests__/registry.test.ts +277 -3
  121. package/src/core/ai/context/context.ts +11 -1
  122. package/src/core/ai/context/providers/__tests__/cell-output.test.ts +378 -0
  123. package/src/core/ai/context/providers/__tests__/error.test.ts +3 -2
  124. package/src/core/ai/context/providers/__tests__/file.test.ts +119 -0
  125. package/src/core/ai/context/providers/cell-output.ts +349 -0
  126. package/src/core/ai/context/providers/common.ts +5 -1
  127. package/src/core/ai/context/providers/file.ts +287 -0
  128. package/src/core/ai/context/registry.ts +79 -0
  129. package/src/core/ai/state.ts +22 -5
  130. package/src/core/alerts/state.ts +71 -3
  131. package/src/core/cells/cell.ts +2 -2
  132. package/src/core/cells/cells.ts +1 -1
  133. package/src/core/cells/logs.ts +1 -1
  134. package/src/core/cells/runs.ts +6 -5
  135. package/src/core/codemirror/ai/resources.ts +47 -5
  136. package/src/core/codemirror/ai/state.ts +12 -0
  137. package/src/core/codemirror/language/__tests__/sql.test.ts +45 -0
  138. package/src/core/codemirror/markdown/__tests__/commands.test.ts +1 -0
  139. package/src/core/codemirror/theme/dark.ts +1 -1
  140. package/src/core/config/capabilities.ts +1 -1
  141. package/src/core/datasets/__tests__/data-source.test.ts +24 -0
  142. package/src/core/errors/__tests__/errors.test.ts +2 -0
  143. package/src/core/islands/bridge.ts +1 -0
  144. package/src/core/islands/main.ts +1 -0
  145. package/src/core/kernel/messages.ts +12 -6
  146. package/src/core/layout/layout.ts +3 -3
  147. package/src/core/network/requests-network.ts +8 -0
  148. package/src/core/network/requests-static.ts +1 -0
  149. package/src/core/network/requests-toasting.ts +1 -0
  150. package/src/core/network/types.ts +4 -1
  151. package/src/core/wasm/bridge.ts +18 -2
  152. package/src/core/wasm/worker/bootstrap.ts +3 -1
  153. package/src/core/wasm/worker/getMarimoWheel.ts +3 -8
  154. package/src/core/wasm/worker/types.ts +3 -0
  155. package/src/core/websocket/useMarimoWebSocket.tsx +7 -1
  156. package/src/css/app/Cell.css +42 -21
  157. package/src/css/app/codemirror.css +5 -1
  158. package/src/css/globals.css +3 -0
  159. package/src/css/md.css +1 -1
  160. package/src/plugins/impl/MicrophonePlugin.tsx +2 -2
  161. package/src/plugins/impl/chat/ChatPlugin.tsx +2 -9
  162. package/src/plugins/impl/chat/chat-ui.tsx +129 -110
  163. package/src/plugins/impl/chat/types.ts +5 -8
  164. package/src/plugins/impl/code/__tests__/language.test.ts +15 -0
  165. package/src/plugins/impl/code/any-language-editor.tsx +11 -8
  166. package/src/plugins/layout/MimeRenderPlugin.tsx +3 -6
  167. package/src/stories/cell.stories.tsx +6 -0
  168. package/src/stories/layout/vertical/one-column.stories.tsx +215 -0
  169. package/src/theme/useTheme.ts +11 -6
  170. package/src/utils/__tests__/blob.test.ts +37 -0
  171. package/src/utils/arrays.ts +13 -0
  172. package/src/utils/fileToBase64.ts +21 -6
  173. package/src/utils/json/base64.ts +5 -2
  174. package/src/utils/numbers.ts +9 -7
  175. package/dist/any-language-editor-DC5170DQ.js +0 -45
  176. package/dist/asn1-jKiBa2Ya.js +0 -95
  177. package/dist/clojure-CCKyeQKf.js +0 -800
  178. package/dist/css-BkF-NPzE.js +0 -1553
  179. package/dist/index-5ZH_qS8j.js +0 -288
  180. package/dist/index-U4yn89qO.js +0 -341
  181. package/dist/javascript-C2yteZeJ.js +0 -691
  182. package/dist/min-DS5Jz-hg.js +0 -80
  183. package/dist/mindmap-definition-LNHGMQRG-0aOVaMR8.js +0 -3234
  184. package/dist/mllike-BSnXJBGA.js +0 -272
  185. package/dist/pug-CwAQJzGR.js +0 -248
  186. package/dist/python-BkR3uSy8.js +0 -313
  187. package/dist/rpm-IznJm2Xc.js +0 -57
  188. package/dist/sequenceDiagram-WFGC7UMF-DMhHzllb.js +0 -2284
  189. package/dist/ttcn-cfg-Bac_acMi.js +0 -88
@@ -1,2284 +0,0 @@
1
- var _a;
2
- import { a as fe, b as Vt, g as Pt, d as xe, c as Te, e as ye } from "./chunk-OMD6QJNC-CqgcPMgL.js";
3
- import { I as Ee } from "./chunk-FHKO5MBM-DfCztBk8.js";
4
- import { _ as u, o as be, c as $, d as It, l as G, j as Jt, e as me, f as we, k as v, b as Kt, s as ve, q as Ie, a as Le, g as _e, t as Pe, z as Ae, i as Lt, u as Y, N as ot, O as Et, P as Zt, Z as ke, Q as Ne, R as Qt, G as Dt } from "./mermaid-Cg5IX6Nv.js";
5
- var Ct = function() {
6
- var t = /* @__PURE__ */ u(function(ht, w, I, P) {
7
- for (I = I || {}, P = ht.length; P--; I[ht[P]] = w) ;
8
- return I;
9
- }, "o"), e = [1, 2], c = [1, 3], s = [1, 4], r = [2, 4], i = [1, 9], o = [1, 11], h = [1, 13], d = [1, 14], a = [1, 16], f = [1, 17], E = [1, 18], g = [1, 24], T = [1, 25], m = [1, 26], L = [1, 27], A = [1, 28], O = [1, 29], S = [1, 30], B = [1, 31], D = [1, 32], F = [1, 33], q = [1, 34], X = [1, 35], tt = [1, 36], z = [1, 37], H = [1, 38], W = [1, 39], M = [1, 41], J = [1, 42], U = [1, 43], Z = [1, 44], et = [1, 45], N = [1, 46], y = [1, 4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 48, 49, 50, 52, 53, 54, 59, 60, 61, 62, 70], _ = [4, 5, 16, 50, 52, 53], Q = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], at = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 49, 50, 52, 53, 54, 59, 60, 61, 62, 70], k = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 48, 50, 52, 53, 54, 59, 60, 61, 62, 70], Ft = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 50, 52, 53, 54, 59, 60, 61, 62, 70], it = [68, 69, 70], ct = [1, 122], kt = {
10
- trace: /* @__PURE__ */ u(function() {
11
- }, "trace"),
12
- yy: {},
13
- symbols_: { error: 2, start: 3, SPACE: 4, NEWLINE: 5, SD: 6, document: 7, line: 8, statement: 9, box_section: 10, box_line: 11, participant_statement: 12, create: 13, box: 14, restOfLine: 15, end: 16, signal: 17, autonumber: 18, NUM: 19, off: 20, activate: 21, actor: 22, deactivate: 23, note_statement: 24, links_statement: 25, link_statement: 26, properties_statement: 27, details_statement: 28, title: 29, legacy_title: 30, acc_title: 31, acc_title_value: 32, acc_descr: 33, acc_descr_value: 34, acc_descr_multiline_value: 35, loop: 36, rect: 37, opt: 38, alt: 39, else_sections: 40, par: 41, par_sections: 42, par_over: 43, critical: 44, option_sections: 45, break: 46, option: 47, and: 48, else: 49, participant: 50, AS: 51, participant_actor: 52, destroy: 53, note: 54, placement: 55, text2: 56, over: 57, actor_pair: 58, links: 59, link: 60, properties: 61, details: 62, spaceList: 63, ",": 64, left_of: 65, right_of: 66, signaltype: 67, "+": 68, "-": 69, ACTOR: 70, SOLID_OPEN_ARROW: 71, DOTTED_OPEN_ARROW: 72, SOLID_ARROW: 73, BIDIRECTIONAL_SOLID_ARROW: 74, DOTTED_ARROW: 75, BIDIRECTIONAL_DOTTED_ARROW: 76, SOLID_CROSS: 77, DOTTED_CROSS: 78, SOLID_POINT: 79, DOTTED_POINT: 80, TXT: 81, $accept: 0, $end: 1 },
14
- terminals_: { 2: "error", 4: "SPACE", 5: "NEWLINE", 6: "SD", 13: "create", 14: "box", 15: "restOfLine", 16: "end", 18: "autonumber", 19: "NUM", 20: "off", 21: "activate", 23: "deactivate", 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", 41: "par", 43: "par_over", 44: "critical", 46: "break", 47: "option", 48: "and", 49: "else", 50: "participant", 51: "AS", 52: "participant_actor", 53: "destroy", 54: "note", 57: "over", 59: "links", 60: "link", 61: "properties", 62: "details", 64: ",", 65: "left_of", 66: "right_of", 68: "+", 69: "-", 70: "ACTOR", 71: "SOLID_OPEN_ARROW", 72: "DOTTED_OPEN_ARROW", 73: "SOLID_ARROW", 74: "BIDIRECTIONAL_SOLID_ARROW", 75: "DOTTED_ARROW", 76: "BIDIRECTIONAL_DOTTED_ARROW", 77: "SOLID_CROSS", 78: "DOTTED_CROSS", 79: "SOLID_POINT", 80: "DOTTED_POINT", 81: "TXT" },
15
- productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [10, 0], [10, 2], [11, 2], [11, 1], [11, 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], [45, 1], [45, 4], [42, 1], [42, 4], [40, 1], [40, 4], [12, 5], [12, 3], [12, 5], [12, 3], [12, 3], [24, 4], [24, 4], [25, 3], [26, 3], [27, 3], [28, 3], [63, 2], [63, 1], [58, 3], [58, 1], [55, 1], [55, 1], [17, 5], [17, 5], [17, 4], [22, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [56, 1]],
16
- performAction: /* @__PURE__ */ u(function(w, I, P, b, R, l, yt) {
17
- var p = l.length - 1;
18
- switch (R) {
19
- case 3:
20
- return b.apply(l[p]), l[p];
21
- case 4:
22
- case 9:
23
- this.$ = [];
24
- break;
25
- case 5:
26
- case 10:
27
- l[p - 1].push(l[p]), this.$ = l[p - 1];
28
- break;
29
- case 6:
30
- case 7:
31
- case 11:
32
- case 12:
33
- this.$ = l[p];
34
- break;
35
- case 8:
36
- case 13:
37
- this.$ = [];
38
- break;
39
- case 15:
40
- l[p].type = "createParticipant", this.$ = l[p];
41
- break;
42
- case 16:
43
- l[p - 1].unshift({ type: "boxStart", boxData: b.parseBoxData(l[p - 2]) }), l[p - 1].push({ type: "boxEnd", boxText: l[p - 2] }), this.$ = l[p - 1];
44
- break;
45
- case 18:
46
- this.$ = { type: "sequenceIndex", sequenceIndex: Number(l[p - 2]), sequenceIndexStep: Number(l[p - 1]), sequenceVisible: true, signalType: b.LINETYPE.AUTONUMBER };
47
- break;
48
- case 19:
49
- this.$ = { type: "sequenceIndex", sequenceIndex: Number(l[p - 1]), sequenceIndexStep: 1, sequenceVisible: true, signalType: b.LINETYPE.AUTONUMBER };
50
- break;
51
- case 20:
52
- this.$ = { type: "sequenceIndex", sequenceVisible: false, signalType: b.LINETYPE.AUTONUMBER };
53
- break;
54
- case 21:
55
- this.$ = { type: "sequenceIndex", sequenceVisible: true, signalType: b.LINETYPE.AUTONUMBER };
56
- break;
57
- case 22:
58
- this.$ = { type: "activeStart", signalType: b.LINETYPE.ACTIVE_START, actor: l[p - 1].actor };
59
- break;
60
- case 23:
61
- this.$ = { type: "activeEnd", signalType: b.LINETYPE.ACTIVE_END, actor: l[p - 1].actor };
62
- break;
63
- case 29:
64
- b.setDiagramTitle(l[p].substring(6)), this.$ = l[p].substring(6);
65
- break;
66
- case 30:
67
- b.setDiagramTitle(l[p].substring(7)), this.$ = l[p].substring(7);
68
- break;
69
- case 31:
70
- this.$ = l[p].trim(), b.setAccTitle(this.$);
71
- break;
72
- case 32:
73
- case 33:
74
- this.$ = l[p].trim(), b.setAccDescription(this.$);
75
- break;
76
- case 34:
77
- l[p - 1].unshift({ type: "loopStart", loopText: b.parseMessage(l[p - 2]), signalType: b.LINETYPE.LOOP_START }), l[p - 1].push({ type: "loopEnd", loopText: l[p - 2], signalType: b.LINETYPE.LOOP_END }), this.$ = l[p - 1];
78
- break;
79
- case 35:
80
- l[p - 1].unshift({ type: "rectStart", color: b.parseMessage(l[p - 2]), signalType: b.LINETYPE.RECT_START }), l[p - 1].push({ type: "rectEnd", color: b.parseMessage(l[p - 2]), signalType: b.LINETYPE.RECT_END }), this.$ = l[p - 1];
81
- break;
82
- case 36:
83
- l[p - 1].unshift({ type: "optStart", optText: b.parseMessage(l[p - 2]), signalType: b.LINETYPE.OPT_START }), l[p - 1].push({ type: "optEnd", optText: b.parseMessage(l[p - 2]), signalType: b.LINETYPE.OPT_END }), this.$ = l[p - 1];
84
- break;
85
- case 37:
86
- l[p - 1].unshift({ type: "altStart", altText: b.parseMessage(l[p - 2]), signalType: b.LINETYPE.ALT_START }), l[p - 1].push({ type: "altEnd", signalType: b.LINETYPE.ALT_END }), this.$ = l[p - 1];
87
- break;
88
- case 38:
89
- l[p - 1].unshift({ type: "parStart", parText: b.parseMessage(l[p - 2]), signalType: b.LINETYPE.PAR_START }), l[p - 1].push({ type: "parEnd", signalType: b.LINETYPE.PAR_END }), this.$ = l[p - 1];
90
- break;
91
- case 39:
92
- l[p - 1].unshift({ type: "parStart", parText: b.parseMessage(l[p - 2]), signalType: b.LINETYPE.PAR_OVER_START }), l[p - 1].push({ type: "parEnd", signalType: b.LINETYPE.PAR_END }), this.$ = l[p - 1];
93
- break;
94
- case 40:
95
- l[p - 1].unshift({ type: "criticalStart", criticalText: b.parseMessage(l[p - 2]), signalType: b.LINETYPE.CRITICAL_START }), l[p - 1].push({ type: "criticalEnd", signalType: b.LINETYPE.CRITICAL_END }), this.$ = l[p - 1];
96
- break;
97
- case 41:
98
- l[p - 1].unshift({ type: "breakStart", breakText: b.parseMessage(l[p - 2]), signalType: b.LINETYPE.BREAK_START }), l[p - 1].push({ type: "breakEnd", optText: b.parseMessage(l[p - 2]), signalType: b.LINETYPE.BREAK_END }), this.$ = l[p - 1];
99
- break;
100
- case 43:
101
- this.$ = l[p - 3].concat([{ type: "option", optionText: b.parseMessage(l[p - 1]), signalType: b.LINETYPE.CRITICAL_OPTION }, l[p]]);
102
- break;
103
- case 45:
104
- this.$ = l[p - 3].concat([{ type: "and", parText: b.parseMessage(l[p - 1]), signalType: b.LINETYPE.PAR_AND }, l[p]]);
105
- break;
106
- case 47:
107
- this.$ = l[p - 3].concat([{ type: "else", altText: b.parseMessage(l[p - 1]), signalType: b.LINETYPE.ALT_ELSE }, l[p]]);
108
- break;
109
- case 48:
110
- l[p - 3].draw = "participant", l[p - 3].type = "addParticipant", l[p - 3].description = b.parseMessage(l[p - 1]), this.$ = l[p - 3];
111
- break;
112
- case 49:
113
- l[p - 1].draw = "participant", l[p - 1].type = "addParticipant", this.$ = l[p - 1];
114
- break;
115
- case 50:
116
- l[p - 3].draw = "actor", l[p - 3].type = "addParticipant", l[p - 3].description = b.parseMessage(l[p - 1]), this.$ = l[p - 3];
117
- break;
118
- case 51:
119
- l[p - 1].draw = "actor", l[p - 1].type = "addParticipant", this.$ = l[p - 1];
120
- break;
121
- case 52:
122
- l[p - 1].type = "destroyParticipant", this.$ = l[p - 1];
123
- break;
124
- case 53:
125
- this.$ = [l[p - 1], { type: "addNote", placement: l[p - 2], actor: l[p - 1].actor, text: l[p] }];
126
- break;
127
- case 54:
128
- l[p - 2] = [].concat(l[p - 1], l[p - 1]).slice(0, 2), l[p - 2][0] = l[p - 2][0].actor, l[p - 2][1] = l[p - 2][1].actor, this.$ = [l[p - 1], { type: "addNote", placement: b.PLACEMENT.OVER, actor: l[p - 2].slice(0, 2), text: l[p] }];
129
- break;
130
- case 55:
131
- this.$ = [l[p - 1], { type: "addLinks", actor: l[p - 1].actor, text: l[p] }];
132
- break;
133
- case 56:
134
- this.$ = [l[p - 1], { type: "addALink", actor: l[p - 1].actor, text: l[p] }];
135
- break;
136
- case 57:
137
- this.$ = [l[p - 1], { type: "addProperties", actor: l[p - 1].actor, text: l[p] }];
138
- break;
139
- case 58:
140
- this.$ = [l[p - 1], { type: "addDetails", actor: l[p - 1].actor, text: l[p] }];
141
- break;
142
- case 61:
143
- this.$ = [l[p - 2], l[p]];
144
- break;
145
- case 62:
146
- this.$ = l[p];
147
- break;
148
- case 63:
149
- this.$ = b.PLACEMENT.LEFTOF;
150
- break;
151
- case 64:
152
- this.$ = b.PLACEMENT.RIGHTOF;
153
- break;
154
- case 65:
155
- this.$ = [
156
- l[p - 4],
157
- l[p - 1],
158
- { type: "addMessage", from: l[p - 4].actor, to: l[p - 1].actor, signalType: l[p - 3], msg: l[p], activate: true },
159
- { type: "activeStart", signalType: b.LINETYPE.ACTIVE_START, actor: l[p - 1].actor }
160
- ];
161
- break;
162
- case 66:
163
- this.$ = [
164
- l[p - 4],
165
- l[p - 1],
166
- { type: "addMessage", from: l[p - 4].actor, to: l[p - 1].actor, signalType: l[p - 3], msg: l[p] },
167
- { type: "activeEnd", signalType: b.LINETYPE.ACTIVE_END, actor: l[p - 4].actor }
168
- ];
169
- break;
170
- case 67:
171
- this.$ = [l[p - 3], l[p - 1], { type: "addMessage", from: l[p - 3].actor, to: l[p - 1].actor, signalType: l[p - 2], msg: l[p] }];
172
- break;
173
- case 68:
174
- this.$ = { type: "addParticipant", actor: l[p] };
175
- break;
176
- case 69:
177
- this.$ = b.LINETYPE.SOLID_OPEN;
178
- break;
179
- case 70:
180
- this.$ = b.LINETYPE.DOTTED_OPEN;
181
- break;
182
- case 71:
183
- this.$ = b.LINETYPE.SOLID;
184
- break;
185
- case 72:
186
- this.$ = b.LINETYPE.BIDIRECTIONAL_SOLID;
187
- break;
188
- case 73:
189
- this.$ = b.LINETYPE.DOTTED;
190
- break;
191
- case 74:
192
- this.$ = b.LINETYPE.BIDIRECTIONAL_DOTTED;
193
- break;
194
- case 75:
195
- this.$ = b.LINETYPE.SOLID_CROSS;
196
- break;
197
- case 76:
198
- this.$ = b.LINETYPE.DOTTED_CROSS;
199
- break;
200
- case 77:
201
- this.$ = b.LINETYPE.SOLID_POINT;
202
- break;
203
- case 78:
204
- this.$ = b.LINETYPE.DOTTED_POINT;
205
- break;
206
- case 79:
207
- this.$ = b.parseMessage(l[p].trim().substring(1));
208
- break;
209
- }
210
- }, "anonymous"),
211
- table: [{ 3: 1, 4: e, 5: c, 6: s }, { 1: [3] }, { 3: 5, 4: e, 5: c, 6: s }, { 3: 6, 4: e, 5: c, 6: s }, t([1, 4, 5, 13, 14, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], r, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: i, 5: o, 8: 8, 9: 10, 12: 12, 13: h, 14: d, 17: 15, 18: a, 21: f, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: T, 31: m, 33: L, 35: A, 36: O, 37: S, 38: B, 39: D, 41: F, 43: q, 44: X, 46: tt, 50: z, 52: H, 53: W, 54: M, 59: J, 60: U, 61: Z, 62: et, 70: N }, t(y, [2, 5]), { 9: 47, 12: 12, 13: h, 14: d, 17: 15, 18: a, 21: f, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: T, 31: m, 33: L, 35: A, 36: O, 37: S, 38: B, 39: D, 41: F, 43: q, 44: X, 46: tt, 50: z, 52: H, 53: W, 54: M, 59: J, 60: U, 61: Z, 62: et, 70: N }, t(y, [2, 7]), t(y, [2, 8]), t(y, [2, 14]), { 12: 48, 50: z, 52: H, 53: W }, { 15: [1, 49] }, { 5: [1, 50] }, { 5: [1, 53], 19: [1, 51], 20: [1, 52] }, { 22: 54, 70: N }, { 22: 55, 70: N }, { 5: [1, 56] }, { 5: [1, 57] }, { 5: [1, 58] }, { 5: [1, 59] }, { 5: [1, 60] }, t(y, [2, 29]), t(y, [2, 30]), { 32: [1, 61] }, { 34: [1, 62] }, t(y, [2, 33]), { 15: [1, 63] }, { 15: [1, 64] }, { 15: [1, 65] }, { 15: [1, 66] }, { 15: [1, 67] }, { 15: [1, 68] }, { 15: [1, 69] }, { 15: [1, 70] }, { 22: 71, 70: N }, { 22: 72, 70: N }, { 22: 73, 70: N }, { 67: 74, 71: [1, 75], 72: [1, 76], 73: [1, 77], 74: [1, 78], 75: [1, 79], 76: [1, 80], 77: [1, 81], 78: [1, 82], 79: [1, 83], 80: [1, 84] }, { 55: 85, 57: [1, 86], 65: [1, 87], 66: [1, 88] }, { 22: 89, 70: N }, { 22: 90, 70: N }, { 22: 91, 70: N }, { 22: 92, 70: N }, t([5, 51, 64, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81], [2, 68]), t(y, [2, 6]), t(y, [2, 15]), t(_, [2, 9], { 10: 93 }), t(y, [2, 17]), { 5: [1, 95], 19: [1, 94] }, { 5: [1, 96] }, t(y, [2, 21]), { 5: [1, 97] }, { 5: [1, 98] }, t(y, [2, 24]), t(y, [2, 25]), t(y, [2, 26]), t(y, [2, 27]), t(y, [2, 28]), t(y, [2, 31]), t(y, [2, 32]), t(Q, r, { 7: 99 }), t(Q, r, { 7: 100 }), t(Q, r, { 7: 101 }), t(at, r, { 40: 102, 7: 103 }), t(k, r, { 42: 104, 7: 105 }), t(k, r, { 7: 105, 42: 106 }), t(Ft, r, { 45: 107, 7: 108 }), t(Q, r, { 7: 109 }), { 5: [1, 111], 51: [1, 110] }, { 5: [1, 113], 51: [1, 112] }, { 5: [1, 114] }, { 22: 117, 68: [1, 115], 69: [1, 116], 70: N }, t(it, [2, 69]), t(it, [2, 70]), t(it, [2, 71]), t(it, [2, 72]), t(it, [2, 73]), t(it, [2, 74]), t(it, [2, 75]), t(it, [2, 76]), t(it, [2, 77]), t(it, [2, 78]), { 22: 118, 70: N }, { 22: 120, 58: 119, 70: N }, { 70: [2, 63] }, { 70: [2, 64] }, { 56: 121, 81: ct }, { 56: 123, 81: ct }, { 56: 124, 81: ct }, { 56: 125, 81: ct }, { 4: [1, 128], 5: [1, 130], 11: 127, 12: 129, 16: [1, 126], 50: z, 52: H, 53: W }, { 5: [1, 131] }, t(y, [2, 19]), t(y, [2, 20]), t(y, [2, 22]), t(y, [2, 23]), { 4: i, 5: o, 8: 8, 9: 10, 12: 12, 13: h, 14: d, 16: [1, 132], 17: 15, 18: a, 21: f, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: T, 31: m, 33: L, 35: A, 36: O, 37: S, 38: B, 39: D, 41: F, 43: q, 44: X, 46: tt, 50: z, 52: H, 53: W, 54: M, 59: J, 60: U, 61: Z, 62: et, 70: N }, { 4: i, 5: o, 8: 8, 9: 10, 12: 12, 13: h, 14: d, 16: [1, 133], 17: 15, 18: a, 21: f, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: T, 31: m, 33: L, 35: A, 36: O, 37: S, 38: B, 39: D, 41: F, 43: q, 44: X, 46: tt, 50: z, 52: H, 53: W, 54: M, 59: J, 60: U, 61: Z, 62: et, 70: N }, { 4: i, 5: o, 8: 8, 9: 10, 12: 12, 13: h, 14: d, 16: [1, 134], 17: 15, 18: a, 21: f, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: T, 31: m, 33: L, 35: A, 36: O, 37: S, 38: B, 39: D, 41: F, 43: q, 44: X, 46: tt, 50: z, 52: H, 53: W, 54: M, 59: J, 60: U, 61: Z, 62: et, 70: N }, { 16: [1, 135] }, { 4: i, 5: o, 8: 8, 9: 10, 12: 12, 13: h, 14: d, 16: [2, 46], 17: 15, 18: a, 21: f, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: T, 31: m, 33: L, 35: A, 36: O, 37: S, 38: B, 39: D, 41: F, 43: q, 44: X, 46: tt, 49: [1, 136], 50: z, 52: H, 53: W, 54: M, 59: J, 60: U, 61: Z, 62: et, 70: N }, { 16: [1, 137] }, { 4: i, 5: o, 8: 8, 9: 10, 12: 12, 13: h, 14: d, 16: [2, 44], 17: 15, 18: a, 21: f, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: T, 31: m, 33: L, 35: A, 36: O, 37: S, 38: B, 39: D, 41: F, 43: q, 44: X, 46: tt, 48: [1, 138], 50: z, 52: H, 53: W, 54: M, 59: J, 60: U, 61: Z, 62: et, 70: N }, { 16: [1, 139] }, { 16: [1, 140] }, { 4: i, 5: o, 8: 8, 9: 10, 12: 12, 13: h, 14: d, 16: [2, 42], 17: 15, 18: a, 21: f, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: T, 31: m, 33: L, 35: A, 36: O, 37: S, 38: B, 39: D, 41: F, 43: q, 44: X, 46: tt, 47: [1, 141], 50: z, 52: H, 53: W, 54: M, 59: J, 60: U, 61: Z, 62: et, 70: N }, { 4: i, 5: o, 8: 8, 9: 10, 12: 12, 13: h, 14: d, 16: [1, 142], 17: 15, 18: a, 21: f, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: T, 31: m, 33: L, 35: A, 36: O, 37: S, 38: B, 39: D, 41: F, 43: q, 44: X, 46: tt, 50: z, 52: H, 53: W, 54: M, 59: J, 60: U, 61: Z, 62: et, 70: N }, { 15: [1, 143] }, t(y, [2, 49]), { 15: [1, 144] }, t(y, [2, 51]), t(y, [2, 52]), { 22: 145, 70: N }, { 22: 146, 70: N }, { 56: 147, 81: ct }, { 56: 148, 81: ct }, { 56: 149, 81: ct }, { 64: [1, 150], 81: [2, 62] }, { 5: [2, 55] }, { 5: [2, 79] }, { 5: [2, 56] }, { 5: [2, 57] }, { 5: [2, 58] }, t(y, [2, 16]), t(_, [2, 10]), { 12: 151, 50: z, 52: H, 53: W }, t(_, [2, 12]), t(_, [2, 13]), t(y, [2, 18]), t(y, [2, 34]), t(y, [2, 35]), t(y, [2, 36]), t(y, [2, 37]), { 15: [1, 152] }, t(y, [2, 38]), { 15: [1, 153] }, t(y, [2, 39]), t(y, [2, 40]), { 15: [1, 154] }, t(y, [2, 41]), { 5: [1, 155] }, { 5: [1, 156] }, { 56: 157, 81: ct }, { 56: 158, 81: ct }, { 5: [2, 67] }, { 5: [2, 53] }, { 5: [2, 54] }, { 22: 159, 70: N }, t(_, [2, 11]), t(at, r, { 7: 103, 40: 160 }), t(k, r, { 7: 105, 42: 161 }), t(Ft, r, { 7: 108, 45: 162 }), t(y, [2, 48]), t(y, [2, 50]), { 5: [2, 65] }, { 5: [2, 66] }, { 81: [2, 61] }, { 16: [2, 47] }, { 16: [2, 45] }, { 16: [2, 43] }],
212
- defaultActions: { 5: [2, 1], 6: [2, 2], 87: [2, 63], 88: [2, 64], 121: [2, 55], 122: [2, 79], 123: [2, 56], 124: [2, 57], 125: [2, 58], 147: [2, 67], 148: [2, 53], 149: [2, 54], 157: [2, 65], 158: [2, 66], 159: [2, 61], 160: [2, 47], 161: [2, 45], 162: [2, 43] },
213
- parseError: /* @__PURE__ */ u(function(w, I) {
214
- if (I.recoverable)
215
- this.trace(w);
216
- else {
217
- var P = new Error(w);
218
- throw P.hash = I, P;
219
- }
220
- }, "parseError"),
221
- parse: /* @__PURE__ */ u(function(w) {
222
- var I = this, P = [0], b = [], R = [null], l = [], yt = this.table, p = "", mt = 0, qt = 0, de = 2, zt = 1, pe = l.slice.call(arguments, 1), V = Object.create(this.lexer), dt = { yy: {} };
223
- for (var Nt in this.yy)
224
- Object.prototype.hasOwnProperty.call(this.yy, Nt) && (dt.yy[Nt] = this.yy[Nt]);
225
- V.setInput(w, dt.yy), dt.yy.lexer = V, dt.yy.parser = this, typeof V.yylloc > "u" && (V.yylloc = {});
226
- var St = V.yylloc;
227
- l.push(St);
228
- var ue = V.options && V.options.ranges;
229
- typeof dt.yy.parseError == "function" ? this.parseError = dt.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
230
- function ge(j) {
231
- P.length = P.length - 2 * j, R.length = R.length - j, l.length = l.length - j;
232
- }
233
- u(ge, "popStack");
234
- function Ht() {
235
- var j;
236
- return j = b.pop() || V.lex() || zt, typeof j != "number" && (j instanceof Array && (b = j, j = b.pop()), j = I.symbols_[j] || j), j;
237
- }
238
- u(Ht, "lex");
239
- for (var K, pt, st, Mt, ft = {}, wt, lt, Ut, vt; ; ) {
240
- if (pt = P[P.length - 1], this.defaultActions[pt] ? st = this.defaultActions[pt] : ((K === null || typeof K > "u") && (K = Ht()), st = yt[pt] && yt[pt][K]), typeof st > "u" || !st.length || !st[0]) {
241
- var Rt = "";
242
- vt = [];
243
- for (wt in yt[pt])
244
- this.terminals_[wt] && wt > de && vt.push("'" + this.terminals_[wt] + "'");
245
- V.showPosition ? Rt = "Parse error on line " + (mt + 1) + `:
246
- ` + V.showPosition() + `
247
- Expecting ` + vt.join(", ") + ", got '" + (this.terminals_[K] || K) + "'" : Rt = "Parse error on line " + (mt + 1) + ": Unexpected " + (K == zt ? "end of input" : "'" + (this.terminals_[K] || K) + "'"), this.parseError(Rt, {
248
- text: V.match,
249
- token: this.terminals_[K] || K,
250
- line: V.yylineno,
251
- loc: St,
252
- expected: vt
253
- });
254
- }
255
- if (st[0] instanceof Array && st.length > 1)
256
- throw new Error("Parse Error: multiple actions possible at state: " + pt + ", token: " + K);
257
- switch (st[0]) {
258
- case 1:
259
- P.push(K), R.push(V.yytext), l.push(V.yylloc), P.push(st[1]), K = null, qt = V.yyleng, p = V.yytext, mt = V.yylineno, St = V.yylloc;
260
- break;
261
- case 2:
262
- if (lt = this.productions_[st[1]][1], ft.$ = R[R.length - lt], ft._$ = {
263
- first_line: l[l.length - (lt || 1)].first_line,
264
- last_line: l[l.length - 1].last_line,
265
- first_column: l[l.length - (lt || 1)].first_column,
266
- last_column: l[l.length - 1].last_column
267
- }, ue && (ft._$.range = [
268
- l[l.length - (lt || 1)].range[0],
269
- l[l.length - 1].range[1]
270
- ]), Mt = this.performAction.apply(ft, [
271
- p,
272
- qt,
273
- mt,
274
- dt.yy,
275
- st[1],
276
- R,
277
- l
278
- ].concat(pe)), typeof Mt < "u")
279
- return Mt;
280
- lt && (P = P.slice(0, -1 * lt * 2), R = R.slice(0, -1 * lt), l = l.slice(0, -1 * lt)), P.push(this.productions_[st[1]][0]), R.push(ft.$), l.push(ft._$), Ut = yt[P[P.length - 2]][P[P.length - 1]], P.push(Ut);
281
- break;
282
- case 3:
283
- return true;
284
- }
285
- }
286
- return true;
287
- }, "parse")
288
- }, he = /* @__PURE__ */ function() {
289
- var ht = {
290
- EOF: 1,
291
- parseError: /* @__PURE__ */ u(function(I, P) {
292
- if (this.yy.parser)
293
- this.yy.parser.parseError(I, P);
294
- else
295
- throw new Error(I);
296
- }, "parseError"),
297
- // resets the lexer, sets new input
298
- setInput: /* @__PURE__ */ u(function(w, I) {
299
- return this.yy = I || this.yy || {}, this._input = w, this._more = this._backtrack = this.done = false, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
300
- first_line: 1,
301
- first_column: 0,
302
- last_line: 1,
303
- last_column: 0
304
- }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
305
- }, "setInput"),
306
- // consumes and returns one char from the input
307
- input: /* @__PURE__ */ u(function() {
308
- var w = this._input[0];
309
- this.yytext += w, this.yyleng++, this.offset++, this.match += w, this.matched += w;
310
- var I = w.match(/(?:\r\n?|\n).*/g);
311
- return I ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), w;
312
- }, "input"),
313
- // unshifts one char (or a string) into the input
314
- unput: /* @__PURE__ */ u(function(w) {
315
- var I = w.length, P = w.split(/(?:\r\n?|\n)/g);
316
- this._input = w + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - I), this.offset -= I;
317
- var b = this.match.split(/(?:\r\n?|\n)/g);
318
- 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);
319
- var R = this.yylloc.range;
320
- return this.yylloc = {
321
- first_line: this.yylloc.first_line,
322
- last_line: this.yylineno + 1,
323
- first_column: this.yylloc.first_column,
324
- last_column: P ? (P.length === b.length ? this.yylloc.first_column : 0) + b[b.length - P.length].length - P[0].length : this.yylloc.first_column - I
325
- }, this.options.ranges && (this.yylloc.range = [R[0], R[0] + this.yyleng - I]), this.yyleng = this.yytext.length, this;
326
- }, "unput"),
327
- // When called from action, caches matched text and appends it on next action
328
- more: /* @__PURE__ */ u(function() {
329
- return this._more = true, this;
330
- }, "more"),
331
- // 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.
332
- reject: /* @__PURE__ */ u(function() {
333
- if (this.options.backtrack_lexer)
334
- this._backtrack = true;
335
- else
336
- 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).
337
- ` + this.showPosition(), {
338
- text: "",
339
- token: null,
340
- line: this.yylineno
341
- });
342
- return this;
343
- }, "reject"),
344
- // retain first n characters of the match
345
- less: /* @__PURE__ */ u(function(w) {
346
- this.unput(this.match.slice(w));
347
- }, "less"),
348
- // displays already matched input, i.e. for error messages
349
- pastInput: /* @__PURE__ */ u(function() {
350
- var w = this.matched.substr(0, this.matched.length - this.match.length);
351
- return (w.length > 20 ? "..." : "") + w.substr(-20).replace(/\n/g, "");
352
- }, "pastInput"),
353
- // displays upcoming input, i.e. for error messages
354
- upcomingInput: /* @__PURE__ */ u(function() {
355
- var w = this.match;
356
- return w.length < 20 && (w += this._input.substr(0, 20 - w.length)), (w.substr(0, 20) + (w.length > 20 ? "..." : "")).replace(/\n/g, "");
357
- }, "upcomingInput"),
358
- // displays the character position where the lexing error occurred, i.e. for error messages
359
- showPosition: /* @__PURE__ */ u(function() {
360
- var w = this.pastInput(), I = new Array(w.length + 1).join("-");
361
- return w + this.upcomingInput() + `
362
- ` + I + "^";
363
- }, "showPosition"),
364
- // test the lexed token: return FALSE when not a match, otherwise return token
365
- test_match: /* @__PURE__ */ u(function(w, I) {
366
- var P, b, R;
367
- if (this.options.backtrack_lexer && (R = {
368
- yylineno: this.yylineno,
369
- yylloc: {
370
- first_line: this.yylloc.first_line,
371
- last_line: this.last_line,
372
- first_column: this.yylloc.first_column,
373
- last_column: this.yylloc.last_column
374
- },
375
- yytext: this.yytext,
376
- match: this.match,
377
- matches: this.matches,
378
- matched: this.matched,
379
- yyleng: this.yyleng,
380
- offset: this.offset,
381
- _more: this._more,
382
- _input: this._input,
383
- yy: this.yy,
384
- conditionStack: this.conditionStack.slice(0),
385
- done: this.done
386
- }, this.options.ranges && (R.yylloc.range = this.yylloc.range.slice(0))), b = w[0].match(/(?:\r\n?|\n).*/g), b && (this.yylineno += b.length), this.yylloc = {
387
- first_line: this.yylloc.last_line,
388
- last_line: this.yylineno + 1,
389
- first_column: this.yylloc.last_column,
390
- last_column: b ? b[b.length - 1].length - b[b.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + w[0].length
391
- }, this.yytext += w[0], this.match += w[0], this.matches = w, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = false, this._backtrack = false, this._input = this._input.slice(w[0].length), this.matched += w[0], P = this.performAction.call(this, this.yy, this, I, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = false), P)
392
- return P;
393
- if (this._backtrack) {
394
- for (var l in R)
395
- this[l] = R[l];
396
- return false;
397
- }
398
- return false;
399
- }, "test_match"),
400
- // return next match in input
401
- next: /* @__PURE__ */ u(function() {
402
- if (this.done)
403
- return this.EOF;
404
- this._input || (this.done = true);
405
- var w, I, P, b;
406
- this._more || (this.yytext = "", this.match = "");
407
- for (var R = this._currentRules(), l = 0; l < R.length; l++)
408
- if (P = this._input.match(this.rules[R[l]]), P && (!I || P[0].length > I[0].length)) {
409
- if (I = P, b = l, this.options.backtrack_lexer) {
410
- if (w = this.test_match(P, R[l]), w !== false)
411
- return w;
412
- if (this._backtrack) {
413
- I = false;
414
- continue;
415
- } else
416
- return false;
417
- } else if (!this.options.flex)
418
- break;
419
- }
420
- return I ? (w = this.test_match(I, R[b]), w !== false ? w : false) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
421
- ` + this.showPosition(), {
422
- text: "",
423
- token: null,
424
- line: this.yylineno
425
- });
426
- }, "next"),
427
- // return next match that has a token
428
- lex: /* @__PURE__ */ u(function() {
429
- var I = this.next();
430
- return I || this.lex();
431
- }, "lex"),
432
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
433
- begin: /* @__PURE__ */ u(function(I) {
434
- this.conditionStack.push(I);
435
- }, "begin"),
436
- // pop the previously active lexer condition state off the condition stack
437
- popState: /* @__PURE__ */ u(function() {
438
- var I = this.conditionStack.length - 1;
439
- return I > 0 ? this.conditionStack.pop() : this.conditionStack[0];
440
- }, "popState"),
441
- // produce the lexer rule set which is active for the currently active lexer condition state
442
- _currentRules: /* @__PURE__ */ u(function() {
443
- return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
444
- }, "_currentRules"),
445
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
446
- topState: /* @__PURE__ */ u(function(I) {
447
- return I = this.conditionStack.length - 1 - Math.abs(I || 0), I >= 0 ? this.conditionStack[I] : "INITIAL";
448
- }, "topState"),
449
- // alias for begin(condition)
450
- pushState: /* @__PURE__ */ u(function(I) {
451
- this.begin(I);
452
- }, "pushState"),
453
- // return the number of states currently on the stack
454
- stateStackSize: /* @__PURE__ */ u(function() {
455
- return this.conditionStack.length;
456
- }, "stateStackSize"),
457
- options: { "case-insensitive": true },
458
- performAction: /* @__PURE__ */ u(function(I, P, b, R) {
459
- switch (b) {
460
- case 0:
461
- return 5;
462
- case 1:
463
- break;
464
- case 2:
465
- break;
466
- case 3:
467
- break;
468
- case 4:
469
- break;
470
- case 5:
471
- break;
472
- case 6:
473
- return 19;
474
- case 7:
475
- return this.begin("LINE"), 14;
476
- case 8:
477
- return this.begin("ID"), 50;
478
- case 9:
479
- return this.begin("ID"), 52;
480
- case 10:
481
- return 13;
482
- case 11:
483
- return this.begin("ID"), 53;
484
- case 12:
485
- return P.yytext = P.yytext.trim(), this.begin("ALIAS"), 70;
486
- case 13:
487
- return this.popState(), this.popState(), this.begin("LINE"), 51;
488
- case 14:
489
- return this.popState(), this.popState(), 5;
490
- case 15:
491
- return this.begin("LINE"), 36;
492
- case 16:
493
- return this.begin("LINE"), 37;
494
- case 17:
495
- return this.begin("LINE"), 38;
496
- case 18:
497
- return this.begin("LINE"), 39;
498
- case 19:
499
- return this.begin("LINE"), 49;
500
- case 20:
501
- return this.begin("LINE"), 41;
502
- case 21:
503
- return this.begin("LINE"), 43;
504
- case 22:
505
- return this.begin("LINE"), 48;
506
- case 23:
507
- return this.begin("LINE"), 44;
508
- case 24:
509
- return this.begin("LINE"), 47;
510
- case 25:
511
- return this.begin("LINE"), 46;
512
- case 26:
513
- return this.popState(), 15;
514
- case 27:
515
- return 16;
516
- case 28:
517
- return 65;
518
- case 29:
519
- return 66;
520
- case 30:
521
- return 59;
522
- case 31:
523
- return 60;
524
- case 32:
525
- return 61;
526
- case 33:
527
- return 62;
528
- case 34:
529
- return 57;
530
- case 35:
531
- return 54;
532
- case 36:
533
- return this.begin("ID"), 21;
534
- case 37:
535
- return this.begin("ID"), 23;
536
- case 38:
537
- return 29;
538
- case 39:
539
- return 30;
540
- case 40:
541
- return this.begin("acc_title"), 31;
542
- case 41:
543
- return this.popState(), "acc_title_value";
544
- case 42:
545
- return this.begin("acc_descr"), 33;
546
- case 43:
547
- return this.popState(), "acc_descr_value";
548
- case 44:
549
- this.begin("acc_descr_multiline");
550
- break;
551
- case 45:
552
- this.popState();
553
- break;
554
- case 46:
555
- return "acc_descr_multiline_value";
556
- case 47:
557
- return 6;
558
- case 48:
559
- return 18;
560
- case 49:
561
- return 20;
562
- case 50:
563
- return 64;
564
- case 51:
565
- return 5;
566
- case 52:
567
- return P.yytext = P.yytext.trim(), 70;
568
- case 53:
569
- return 73;
570
- case 54:
571
- return 74;
572
- case 55:
573
- return 75;
574
- case 56:
575
- return 76;
576
- case 57:
577
- return 71;
578
- case 58:
579
- return 72;
580
- case 59:
581
- return 77;
582
- case 60:
583
- return 78;
584
- case 61:
585
- return 79;
586
- case 62:
587
- return 80;
588
- case 63:
589
- return 81;
590
- case 64:
591
- return 81;
592
- case 65:
593
- return 68;
594
- case 66:
595
- return 69;
596
- case 67:
597
- return 5;
598
- case 68:
599
- return "INVALID";
600
- }
601
- }, "anonymous"),
602
- rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[0-9]+(?=[ \n]+))/i, /^(?:box\b)/i, /^(?:participant\b)/i, /^(?:actor\b)/i, /^(?:create\b)/i, /^(?:destroy\b)/i, /^(?:[^<\->\->:\n,;]+?([\-]*[^<\->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/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, /^(?::(?:(?:no)?wrap)?[^#\n;]*)/i, /^(?::)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:$)/i, /^(?:.)/i],
603
- conditions: { acc_descr_multiline: { rules: [45, 46], inclusive: false }, acc_descr: { rules: [43], inclusive: false }, acc_title: { rules: [41], inclusive: false }, ID: { rules: [2, 3, 12], inclusive: false }, ALIAS: { rules: [2, 3, 13, 14], inclusive: false }, LINE: { rules: [2, 3, 26], inclusive: false }, INITIAL: { rules: [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 42, 44, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68], inclusive: true } }
604
- };
605
- return ht;
606
- }();
607
- kt.lexer = he;
608
- function bt() {
609
- this.yy = {};
610
- }
611
- return u(bt, "Parser"), bt.prototype = kt, kt.Parser = bt, new bt();
612
- }();
613
- Ct.parser = Ct;
614
- var Se = Ct, Me = {
615
- SOLID: 0,
616
- DOTTED: 1,
617
- NOTE: 2,
618
- SOLID_CROSS: 3,
619
- DOTTED_CROSS: 4,
620
- SOLID_OPEN: 5,
621
- DOTTED_OPEN: 6,
622
- LOOP_START: 10,
623
- LOOP_END: 11,
624
- ALT_START: 12,
625
- ALT_ELSE: 13,
626
- ALT_END: 14,
627
- OPT_START: 15,
628
- OPT_END: 16,
629
- ACTIVE_START: 17,
630
- ACTIVE_END: 18,
631
- PAR_START: 19,
632
- PAR_AND: 20,
633
- PAR_END: 21,
634
- RECT_START: 22,
635
- RECT_END: 23,
636
- SOLID_POINT: 24,
637
- DOTTED_POINT: 25,
638
- AUTONUMBER: 26,
639
- CRITICAL_START: 27,
640
- CRITICAL_OPTION: 28,
641
- CRITICAL_END: 29,
642
- BREAK_START: 30,
643
- BREAK_END: 31,
644
- PAR_OVER_START: 32,
645
- BIDIRECTIONAL_SOLID: 33,
646
- BIDIRECTIONAL_DOTTED: 34
647
- }, Re = {
648
- FILLED: 0,
649
- OPEN: 1
650
- }, De = {
651
- LEFTOF: 0,
652
- RIGHTOF: 1,
653
- OVER: 2
654
- }, Ce = (_a = class {
655
- constructor() {
656
- this.state = new Ee(() => ({
657
- prevActor: void 0,
658
- actors: /* @__PURE__ */ new Map(),
659
- createdActors: /* @__PURE__ */ new Map(),
660
- destroyedActors: /* @__PURE__ */ new Map(),
661
- boxes: [],
662
- messages: [],
663
- notes: [],
664
- sequenceNumbersEnabled: false,
665
- wrapEnabled: void 0,
666
- currentBox: void 0,
667
- lastCreated: void 0,
668
- lastDestroyed: void 0
669
- })), this.setAccTitle = Kt, this.setAccDescription = ve, this.setDiagramTitle = Ie, this.getAccTitle = Le, this.getAccDescription = _e, this.getDiagramTitle = Pe, 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 = Me, this.ARROWTYPE = Re, this.PLACEMENT = De;
670
- }
671
- addBox(t) {
672
- this.state.records.boxes.push({
673
- name: t.text,
674
- wrap: t.wrap ?? this.autoWrap(),
675
- fill: t.color,
676
- actorKeys: []
677
- }), this.state.records.currentBox = this.state.records.boxes.slice(-1)[0];
678
- }
679
- addActor(t, e, c, s) {
680
- let r = this.state.records.currentBox;
681
- const i = this.state.records.actors.get(t);
682
- if (i) {
683
- if (this.state.records.currentBox && i.box && this.state.records.currentBox !== i.box)
684
- throw new Error(
685
- `A same participant should only be defined in one Box: ${i.name} can't be in '${i.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`
686
- );
687
- if (r = i.box ? i.box : this.state.records.currentBox, i.box = r, i && e === i.name && c == null)
688
- return;
689
- }
690
- if ((c == null ? void 0 : c.text) == null && (c = { text: e, type: s }), (s == null || c.text == null) && (c = { text: e, type: s }), this.state.records.actors.set(t, {
691
- box: r,
692
- name: e,
693
- description: c.text,
694
- wrap: c.wrap ?? this.autoWrap(),
695
- prevActor: this.state.records.prevActor,
696
- links: {},
697
- properties: {},
698
- actorCnt: null,
699
- rectData: null,
700
- type: s ?? "participant"
701
- }), this.state.records.prevActor) {
702
- const o = this.state.records.actors.get(this.state.records.prevActor);
703
- o && (o.nextActor = t);
704
- }
705
- this.state.records.currentBox && this.state.records.currentBox.actorKeys.push(t), this.state.records.prevActor = t;
706
- }
707
- activationCount(t) {
708
- let e, c = 0;
709
- if (!t)
710
- return 0;
711
- for (e = 0; e < this.state.records.messages.length; e++)
712
- this.state.records.messages[e].type === this.LINETYPE.ACTIVE_START && this.state.records.messages[e].from === t && c++, this.state.records.messages[e].type === this.LINETYPE.ACTIVE_END && this.state.records.messages[e].from === t && c--;
713
- return c;
714
- }
715
- addMessage(t, e, c, s) {
716
- this.state.records.messages.push({
717
- id: this.state.records.messages.length.toString(),
718
- from: t,
719
- to: e,
720
- message: c.text,
721
- wrap: c.wrap ?? this.autoWrap(),
722
- answer: s
723
- });
724
- }
725
- addSignal(t, e, c, s, r = false) {
726
- if (s === this.LINETYPE.ACTIVE_END && this.activationCount(t ?? "") < 1) {
727
- const o = new Error("Trying to inactivate an inactive participant (" + t + ")");
728
- throw o.hash = {
729
- text: "->>-",
730
- token: "->>-",
731
- line: "1",
732
- loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
733
- expected: ["'ACTIVE_PARTICIPANT'"]
734
- }, o;
735
- }
736
- return this.state.records.messages.push({
737
- id: this.state.records.messages.length.toString(),
738
- from: t,
739
- to: e,
740
- message: (c == null ? void 0 : c.text) ?? "",
741
- wrap: (c == null ? void 0 : c.wrap) ?? this.autoWrap(),
742
- type: s,
743
- activate: r
744
- }), true;
745
- }
746
- hasAtLeastOneBox() {
747
- return this.state.records.boxes.length > 0;
748
- }
749
- hasAtLeastOneBoxWithTitle() {
750
- return this.state.records.boxes.some((t) => t.name);
751
- }
752
- getMessages() {
753
- return this.state.records.messages;
754
- }
755
- getBoxes() {
756
- return this.state.records.boxes;
757
- }
758
- getActors() {
759
- return this.state.records.actors;
760
- }
761
- getCreatedActors() {
762
- return this.state.records.createdActors;
763
- }
764
- getDestroyedActors() {
765
- return this.state.records.destroyedActors;
766
- }
767
- getActor(t) {
768
- return this.state.records.actors.get(t);
769
- }
770
- getActorKeys() {
771
- return [...this.state.records.actors.keys()];
772
- }
773
- enableSequenceNumbers() {
774
- this.state.records.sequenceNumbersEnabled = true;
775
- }
776
- disableSequenceNumbers() {
777
- this.state.records.sequenceNumbersEnabled = false;
778
- }
779
- showSequenceNumbers() {
780
- return this.state.records.sequenceNumbersEnabled;
781
- }
782
- setWrap(t) {
783
- this.state.records.wrapEnabled = t;
784
- }
785
- extractWrap(t) {
786
- if (t === void 0)
787
- return {};
788
- t = t.trim();
789
- const e = /^:?wrap:/.exec(t) !== null ? true : /^:?nowrap:/.exec(t) !== null ? false : void 0;
790
- return { cleanedText: (e === void 0 ? t : t.replace(/^:?(?:no)?wrap:/, "")).trim(), wrap: e };
791
- }
792
- autoWrap() {
793
- var _a2;
794
- return this.state.records.wrapEnabled !== void 0 ? this.state.records.wrapEnabled : ((_a2 = $().sequence) == null ? void 0 : _a2.wrap) ?? false;
795
- }
796
- clear() {
797
- this.state.reset(), Ae();
798
- }
799
- parseMessage(t) {
800
- const e = t.trim(), { wrap: c, cleanedText: s } = this.extractWrap(e), r = {
801
- text: s,
802
- wrap: c
803
- };
804
- return G.debug(`parseMessage: ${JSON.stringify(r)}`), r;
805
- }
806
- // We expect the box statement to be color first then description
807
- // 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
808
- // We extract first segment as color, the rest of the line is considered as text
809
- parseBoxData(t) {
810
- const e = /^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);
811
- let c = (e == null ? void 0 : e[1]) ? e[1].trim() : "transparent", s = (e == null ? void 0 : e[2]) ? e[2].trim() : void 0;
812
- if (window == null ? void 0 : window.CSS)
813
- window.CSS.supports("color", c) || (c = "transparent", s = t.trim());
814
- else {
815
- const o = new Option().style;
816
- o.color = c, o.color !== c && (c = "transparent", s = t.trim());
817
- }
818
- const { wrap: r, cleanedText: i } = this.extractWrap(s);
819
- return {
820
- text: i ? Lt(i, $()) : void 0,
821
- color: c,
822
- wrap: r
823
- };
824
- }
825
- addNote(t, e, c) {
826
- const s = {
827
- actor: t,
828
- placement: e,
829
- message: c.text,
830
- wrap: c.wrap ?? this.autoWrap()
831
- }, r = [].concat(t, t);
832
- this.state.records.notes.push(s), this.state.records.messages.push({
833
- id: this.state.records.messages.length.toString(),
834
- from: r[0],
835
- to: r[1],
836
- message: c.text,
837
- wrap: c.wrap ?? this.autoWrap(),
838
- type: this.LINETYPE.NOTE,
839
- placement: e
840
- });
841
- }
842
- addLinks(t, e) {
843
- const c = this.getActor(t);
844
- try {
845
- let s = Lt(e.text, $());
846
- s = s.replace(/&equals;/g, "="), s = s.replace(/&amp;/g, "&");
847
- const r = JSON.parse(s);
848
- this.insertLinks(c, r);
849
- } catch (s) {
850
- G.error("error while parsing actor link text", s);
851
- }
852
- }
853
- addALink(t, e) {
854
- const c = this.getActor(t);
855
- try {
856
- const s = {};
857
- let r = Lt(e.text, $());
858
- const i = r.indexOf("@");
859
- r = r.replace(/&equals;/g, "="), r = r.replace(/&amp;/g, "&");
860
- const o = r.slice(0, i - 1).trim(), h = r.slice(i + 1).trim();
861
- s[o] = h, this.insertLinks(c, s);
862
- } catch (s) {
863
- G.error("error while parsing actor link text", s);
864
- }
865
- }
866
- insertLinks(t, e) {
867
- if (t.links == null)
868
- t.links = e;
869
- else
870
- for (const c in e)
871
- t.links[c] = e[c];
872
- }
873
- addProperties(t, e) {
874
- const c = this.getActor(t);
875
- try {
876
- const s = Lt(e.text, $()), r = JSON.parse(s);
877
- this.insertProperties(c, r);
878
- } catch (s) {
879
- G.error("error while parsing actor properties text", s);
880
- }
881
- }
882
- insertProperties(t, e) {
883
- if (t.properties == null)
884
- t.properties = e;
885
- else
886
- for (const c in e)
887
- t.properties[c] = e[c];
888
- }
889
- boxEnd() {
890
- this.state.records.currentBox = void 0;
891
- }
892
- addDetails(t, e) {
893
- const c = this.getActor(t), s = document.getElementById(e.text);
894
- try {
895
- const r = s.innerHTML, i = JSON.parse(r);
896
- i.properties && this.insertProperties(c, i.properties), i.links && this.insertLinks(c, i.links);
897
- } catch (r) {
898
- G.error("error while parsing actor details text", r);
899
- }
900
- }
901
- getActorProperty(t, e) {
902
- if ((t == null ? void 0 : t.properties) !== void 0)
903
- return t.properties[e];
904
- }
905
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-redundant-type-constituents
906
- apply(t) {
907
- if (Array.isArray(t))
908
- t.forEach((e) => {
909
- this.apply(e);
910
- });
911
- else
912
- switch (t.type) {
913
- case "sequenceIndex":
914
- this.state.records.messages.push({
915
- id: this.state.records.messages.length.toString(),
916
- from: void 0,
917
- to: void 0,
918
- message: {
919
- start: t.sequenceIndex,
920
- step: t.sequenceIndexStep,
921
- visible: t.sequenceVisible
922
- },
923
- wrap: false,
924
- type: t.signalType
925
- });
926
- break;
927
- case "addParticipant":
928
- this.addActor(t.actor, t.actor, t.description, t.draw);
929
- break;
930
- case "createParticipant":
931
- if (this.state.records.actors.has(t.actor))
932
- throw new Error(
933
- "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"
934
- );
935
- this.state.records.lastCreated = t.actor, this.addActor(t.actor, t.actor, t.description, t.draw), this.state.records.createdActors.set(t.actor, this.state.records.messages.length);
936
- break;
937
- case "destroyParticipant":
938
- this.state.records.lastDestroyed = t.actor, this.state.records.destroyedActors.set(t.actor, this.state.records.messages.length);
939
- break;
940
- case "activeStart":
941
- this.addSignal(t.actor, void 0, void 0, t.signalType);
942
- break;
943
- case "activeEnd":
944
- this.addSignal(t.actor, void 0, void 0, t.signalType);
945
- break;
946
- case "addNote":
947
- this.addNote(t.actor, t.placement, t.text);
948
- break;
949
- case "addLinks":
950
- this.addLinks(t.actor, t.text);
951
- break;
952
- case "addALink":
953
- this.addALink(t.actor, t.text);
954
- break;
955
- case "addProperties":
956
- this.addProperties(t.actor, t.text);
957
- break;
958
- case "addDetails":
959
- this.addDetails(t.actor, t.text);
960
- break;
961
- case "addMessage":
962
- if (this.state.records.lastCreated) {
963
- if (t.to !== this.state.records.lastCreated)
964
- throw new Error(
965
- "The created participant " + this.state.records.lastCreated.name + " does not have an associated creating message after its declaration. Please check the sequence diagram."
966
- );
967
- this.state.records.lastCreated = void 0;
968
- } else if (this.state.records.lastDestroyed) {
969
- if (t.to !== this.state.records.lastDestroyed && t.from !== this.state.records.lastDestroyed)
970
- throw new Error(
971
- "The destroyed participant " + this.state.records.lastDestroyed.name + " does not have an associated destroying message after its declaration. Please check the sequence diagram."
972
- );
973
- this.state.records.lastDestroyed = void 0;
974
- }
975
- this.addSignal(t.from, t.to, t.msg, t.signalType, t.activate);
976
- break;
977
- case "boxStart":
978
- this.addBox(t.boxData);
979
- break;
980
- case "boxEnd":
981
- this.boxEnd();
982
- break;
983
- case "loopStart":
984
- this.addSignal(void 0, void 0, t.loopText, t.signalType);
985
- break;
986
- case "loopEnd":
987
- this.addSignal(void 0, void 0, void 0, t.signalType);
988
- break;
989
- case "rectStart":
990
- this.addSignal(void 0, void 0, t.color, t.signalType);
991
- break;
992
- case "rectEnd":
993
- this.addSignal(void 0, void 0, void 0, t.signalType);
994
- break;
995
- case "optStart":
996
- this.addSignal(void 0, void 0, t.optText, t.signalType);
997
- break;
998
- case "optEnd":
999
- this.addSignal(void 0, void 0, void 0, t.signalType);
1000
- break;
1001
- case "altStart":
1002
- this.addSignal(void 0, void 0, t.altText, t.signalType);
1003
- break;
1004
- case "else":
1005
- this.addSignal(void 0, void 0, t.altText, t.signalType);
1006
- break;
1007
- case "altEnd":
1008
- this.addSignal(void 0, void 0, void 0, t.signalType);
1009
- break;
1010
- case "setAccTitle":
1011
- Kt(t.text);
1012
- break;
1013
- case "parStart":
1014
- this.addSignal(void 0, void 0, t.parText, t.signalType);
1015
- break;
1016
- case "and":
1017
- this.addSignal(void 0, void 0, t.parText, t.signalType);
1018
- break;
1019
- case "parEnd":
1020
- this.addSignal(void 0, void 0, void 0, t.signalType);
1021
- break;
1022
- case "criticalStart":
1023
- this.addSignal(void 0, void 0, t.criticalText, t.signalType);
1024
- break;
1025
- case "option":
1026
- this.addSignal(void 0, void 0, t.optionText, t.signalType);
1027
- break;
1028
- case "criticalEnd":
1029
- this.addSignal(void 0, void 0, void 0, t.signalType);
1030
- break;
1031
- case "breakStart":
1032
- this.addSignal(void 0, void 0, t.breakText, t.signalType);
1033
- break;
1034
- case "breakEnd":
1035
- this.addSignal(void 0, void 0, void 0, t.signalType);
1036
- break;
1037
- }
1038
- }
1039
- getConfig() {
1040
- return $().sequence;
1041
- }
1042
- }, u(_a, "SequenceDB"), _a), Oe = /* @__PURE__ */ u((t) => `.actor {
1043
- stroke: ${t.actorBorder};
1044
- fill: ${t.actorBkg};
1045
- }
1046
-
1047
- text.actor > tspan {
1048
- fill: ${t.actorTextColor};
1049
- stroke: none;
1050
- }
1051
-
1052
- .actor-line {
1053
- stroke: ${t.actorLineColor};
1054
- }
1055
-
1056
- .messageLine0 {
1057
- stroke-width: 1.5;
1058
- stroke-dasharray: none;
1059
- stroke: ${t.signalColor};
1060
- }
1061
-
1062
- .messageLine1 {
1063
- stroke-width: 1.5;
1064
- stroke-dasharray: 2, 2;
1065
- stroke: ${t.signalColor};
1066
- }
1067
-
1068
- #arrowhead path {
1069
- fill: ${t.signalColor};
1070
- stroke: ${t.signalColor};
1071
- }
1072
-
1073
- .sequenceNumber {
1074
- fill: ${t.sequenceNumberColor};
1075
- }
1076
-
1077
- #sequencenumber {
1078
- fill: ${t.signalColor};
1079
- }
1080
-
1081
- #crosshead path {
1082
- fill: ${t.signalColor};
1083
- stroke: ${t.signalColor};
1084
- }
1085
-
1086
- .messageText {
1087
- fill: ${t.signalTextColor};
1088
- stroke: none;
1089
- }
1090
-
1091
- .labelBox {
1092
- stroke: ${t.labelBoxBorderColor};
1093
- fill: ${t.labelBoxBkgColor};
1094
- }
1095
-
1096
- .labelText, .labelText > tspan {
1097
- fill: ${t.labelTextColor};
1098
- stroke: none;
1099
- }
1100
-
1101
- .loopText, .loopText > tspan {
1102
- fill: ${t.loopTextColor};
1103
- stroke: none;
1104
- }
1105
-
1106
- .loopLine {
1107
- stroke-width: 2px;
1108
- stroke-dasharray: 2, 2;
1109
- stroke: ${t.labelBoxBorderColor};
1110
- fill: ${t.labelBoxBorderColor};
1111
- }
1112
-
1113
- .note {
1114
- //stroke: #decc93;
1115
- stroke: ${t.noteBorderColor};
1116
- fill: ${t.noteBkgColor};
1117
- }
1118
-
1119
- .noteText, .noteText > tspan {
1120
- fill: ${t.noteTextColor};
1121
- stroke: none;
1122
- }
1123
-
1124
- .activation0 {
1125
- fill: ${t.activationBkgColor};
1126
- stroke: ${t.activationBorderColor};
1127
- }
1128
-
1129
- .activation1 {
1130
- fill: ${t.activationBkgColor};
1131
- stroke: ${t.activationBorderColor};
1132
- }
1133
-
1134
- .activation2 {
1135
- fill: ${t.activationBkgColor};
1136
- stroke: ${t.activationBorderColor};
1137
- }
1138
-
1139
- .actorPopupMenu {
1140
- position: absolute;
1141
- }
1142
-
1143
- .actorPopupMenuPanel {
1144
- position: absolute;
1145
- fill: ${t.actorBkg};
1146
- box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
1147
- filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
1148
- }
1149
- .actor-man line {
1150
- stroke: ${t.actorBorder};
1151
- fill: ${t.actorBkg};
1152
- }
1153
- .actor-man circle, line {
1154
- stroke: ${t.actorBorder};
1155
- fill: ${t.actorBkg};
1156
- stroke-width: 2px;
1157
- }
1158
- `, "getStyles"), Be = Oe, ut = 18 * 2, jt = "actor-top", $t = "actor-bottom", Ve = "actor-box", Gt = "actor-man", Yt = /* @__PURE__ */ u(function(t, e) {
1159
- return xe(t, e);
1160
- }, "drawRect"), Ye = /* @__PURE__ */ u(function(t, e, c, s, r) {
1161
- if (e.links === void 0 || e.links === null || Object.keys(e.links).length === 0)
1162
- return { height: 0, width: 0 };
1163
- const i = e.links, o = e.actorCnt, h = e.rectData;
1164
- var d = "none";
1165
- r && (d = "block !important");
1166
- const a = t.append("g");
1167
- a.attr("id", "actor" + o + "_popup"), a.attr("class", "actorPopupMenu"), a.attr("display", d);
1168
- var f = "";
1169
- h.class !== void 0 && (f = " " + h.class);
1170
- let E = h.width > c ? h.width : c;
1171
- const g = a.append("rect");
1172
- if (g.attr("class", "actorPopupMenuPanel" + f), g.attr("x", h.x), g.attr("y", h.height), g.attr("fill", h.fill), g.attr("stroke", h.stroke), g.attr("width", E), g.attr("height", h.height), g.attr("rx", h.rx), g.attr("ry", h.ry), i != null) {
1173
- var T = 20;
1174
- for (let A in i) {
1175
- var m = a.append("a"), L = Jt.sanitizeUrl(i[A]);
1176
- m.attr("xlink:href", L), m.attr("target", "_blank"), ss(s)(
1177
- A,
1178
- m,
1179
- h.x + 10,
1180
- h.height + T,
1181
- E,
1182
- 20,
1183
- { class: "actor" },
1184
- s
1185
- ), T += 30;
1186
- }
1187
- }
1188
- return g.attr("height", T), { height: h.height + T, width: E };
1189
- }, "drawPopup"), We = /* @__PURE__ */ u(function(t) {
1190
- return "var pu = document.getElementById('" + t + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }";
1191
- }, "popupMenuToggle"), _t = /* @__PURE__ */ u(async function(t, e, c = null) {
1192
- let s = t.append("foreignObject");
1193
- const r = await Qt(e.text, Dt()), o = s.append("xhtml:div").attr("style", "width: fit-content;").attr("xmlns", "http://www.w3.org/1999/xhtml").html(r).node().getBoundingClientRect();
1194
- if (s.attr("height", Math.round(o.height)).attr("width", Math.round(o.width)), e.class === "noteText") {
1195
- const h = t.node().firstChild;
1196
- h.setAttribute("height", o.height + 2 * e.textMargin);
1197
- const d = h.getBBox();
1198
- s.attr("x", Math.round(d.x + d.width / 2 - o.width / 2)).attr("y", Math.round(d.y + d.height / 2 - o.height / 2));
1199
- } else if (c) {
1200
- let { startx: h, stopx: d, starty: a } = c;
1201
- if (h > d) {
1202
- const f = h;
1203
- h = d, d = f;
1204
- }
1205
- s.attr("x", Math.round(h + Math.abs(h - d) / 2 - o.width / 2)), e.class === "loopText" ? s.attr("y", Math.round(a)) : s.attr("y", Math.round(a - o.height));
1206
- }
1207
- return [s];
1208
- }, "drawKatex"), Tt = /* @__PURE__ */ u(function(t, e) {
1209
- let c = 0, s = 0;
1210
- const r = e.text.split(v.lineBreakRegex), [i, o] = Zt(e.fontSize);
1211
- let h = [], d = 0, a = /* @__PURE__ */ u(() => e.y, "yfunc");
1212
- if (e.valign !== void 0 && e.textMargin !== void 0 && e.textMargin > 0)
1213
- switch (e.valign) {
1214
- case "top":
1215
- case "start":
1216
- a = /* @__PURE__ */ u(() => Math.round(e.y + e.textMargin), "yfunc");
1217
- break;
1218
- case "middle":
1219
- case "center":
1220
- a = /* @__PURE__ */ u(() => Math.round(e.y + (c + s + e.textMargin) / 2), "yfunc");
1221
- break;
1222
- case "bottom":
1223
- case "end":
1224
- a = /* @__PURE__ */ u(() => Math.round(
1225
- e.y + (c + s + 2 * e.textMargin) - e.textMargin
1226
- ), "yfunc");
1227
- break;
1228
- }
1229
- if (e.anchor !== void 0 && e.textMargin !== void 0 && e.width !== void 0)
1230
- switch (e.anchor) {
1231
- case "left":
1232
- case "start":
1233
- e.x = Math.round(e.x + e.textMargin), e.anchor = "start", e.dominantBaseline = "middle", e.alignmentBaseline = "middle";
1234
- break;
1235
- case "middle":
1236
- case "center":
1237
- e.x = Math.round(e.x + e.width / 2), e.anchor = "middle", e.dominantBaseline = "middle", e.alignmentBaseline = "middle";
1238
- break;
1239
- case "right":
1240
- case "end":
1241
- e.x = Math.round(e.x + e.width - e.textMargin), e.anchor = "end", e.dominantBaseline = "middle", e.alignmentBaseline = "middle";
1242
- break;
1243
- }
1244
- for (let [f, E] of r.entries()) {
1245
- e.textMargin !== void 0 && e.textMargin === 0 && i !== void 0 && (d = f * i);
1246
- const g = t.append("text");
1247
- g.attr("x", e.x), g.attr("y", a()), e.anchor !== void 0 && g.attr("text-anchor", e.anchor).attr("dominant-baseline", e.dominantBaseline).attr("alignment-baseline", e.alignmentBaseline), e.fontFamily !== void 0 && g.style("font-family", e.fontFamily), o !== void 0 && g.style("font-size", o), e.fontWeight !== void 0 && g.style("font-weight", e.fontWeight), e.fill !== void 0 && g.attr("fill", e.fill), e.class !== void 0 && g.attr("class", e.class), e.dy !== void 0 ? g.attr("dy", e.dy) : d !== 0 && g.attr("dy", d);
1248
- const T = E || ke;
1249
- if (e.tspan) {
1250
- const m = g.append("tspan");
1251
- m.attr("x", e.x), e.fill !== void 0 && m.attr("fill", e.fill), m.text(T);
1252
- } else
1253
- g.text(T);
1254
- e.valign !== void 0 && e.textMargin !== void 0 && e.textMargin > 0 && (s += (g._groups || g)[0][0].getBBox().height, c = s), h.push(g);
1255
- }
1256
- return h;
1257
- }, "drawText"), te = /* @__PURE__ */ u(function(t, e) {
1258
- function c(r, i, o, h, d) {
1259
- return r + "," + i + " " + (r + o) + "," + i + " " + (r + o) + "," + (i + h - d) + " " + (r + o - d * 1.2) + "," + (i + h) + " " + r + "," + (i + h);
1260
- }
1261
- u(c, "genPoints");
1262
- const s = t.append("polygon");
1263
- return s.attr("points", c(e.x, e.y, e.width, e.height, 7)), s.attr("class", "labelBox"), e.y = e.y + e.height / 2, Tt(t, e), s;
1264
- }, "drawLabel"), nt = -1, ee = /* @__PURE__ */ u((t, e, c, s) => {
1265
- t.select && c.forEach((r) => {
1266
- const i = e.get(r), o = t.select("#actor" + i.actorCnt);
1267
- !s.mirrorActors && i.stopy ? o.attr("y2", i.stopy + i.height / 2) : s.mirrorActors && o.attr("y2", i.stopy);
1268
- });
1269
- }, "fixLifeLineHeights"), Fe = /* @__PURE__ */ u(function(t, e, c, s) {
1270
- var _a2, _b;
1271
- const r = s ? e.stopy : e.starty, i = e.x + e.width / 2, o = r + e.height, h = t.append("g").lower();
1272
- var d = h;
1273
- s || (nt++, Object.keys(e.links || {}).length && !c.forceMenus && d.attr("onclick", We(`actor${nt}_popup`)).attr("cursor", "pointer"), d.append("line").attr("id", "actor" + nt).attr("x1", i).attr("y1", o).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", e.name), d = h.append("g"), e.actorCnt = nt, e.links != null && d.attr("id", "root-" + nt));
1274
- const a = Pt();
1275
- var f = "actor";
1276
- ((_a2 = e.properties) == null ? void 0 : _a2.class) ? f = e.properties.class : a.fill = "#eaeaea", s ? f += ` ${$t}` : f += ` ${jt}`, a.x = e.x, a.y = r, a.width = e.width, a.height = e.height, a.class = f, a.rx = 3, a.ry = 3, a.name = e.name;
1277
- const E = Yt(d, a);
1278
- if (e.rectData = a, (_b = e.properties) == null ? void 0 : _b.icon) {
1279
- const T = e.properties.icon.trim();
1280
- T.charAt(0) === "@" ? Te(d, a.x + a.width - 20, a.y + 10, T.substr(1)) : ye(d, a.x + a.width - 20, a.y + 10, T);
1281
- }
1282
- Wt(c, ot(e.description))(
1283
- e.description,
1284
- d,
1285
- a.x,
1286
- a.y,
1287
- a.width,
1288
- a.height,
1289
- { class: `actor ${Ve}` },
1290
- c
1291
- );
1292
- let g = e.height;
1293
- if (E.node) {
1294
- const T = E.node().getBBox();
1295
- e.height = T.height, g = T.height;
1296
- }
1297
- return g;
1298
- }, "drawActorTypeParticipant"), qe = /* @__PURE__ */ u(function(t, e, c, s) {
1299
- const r = s ? e.stopy : e.starty, i = e.x + e.width / 2, o = r + 80, h = t.append("g").lower();
1300
- s || (nt++, h.append("line").attr("id", "actor" + nt).attr("x1", i).attr("y1", o).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", e.name), e.actorCnt = nt);
1301
- const d = t.append("g");
1302
- let a = Gt;
1303
- s ? a += ` ${$t}` : a += ` ${jt}`, d.attr("class", a), d.attr("name", e.name);
1304
- const f = Pt();
1305
- f.x = e.x, f.y = r, f.fill = "#eaeaea", f.width = e.width, f.height = e.height, f.class = "actor", f.rx = 3, f.ry = 3, d.append("line").attr("id", "actor-man-torso" + nt).attr("x1", i).attr("y1", r + 25).attr("x2", i).attr("y2", r + 45), d.append("line").attr("id", "actor-man-arms" + nt).attr("x1", i - ut / 2).attr("y1", r + 33).attr("x2", i + ut / 2).attr("y2", r + 33), d.append("line").attr("x1", i - ut / 2).attr("y1", r + 60).attr("x2", i).attr("y2", r + 45), d.append("line").attr("x1", i).attr("y1", r + 45).attr("x2", i + ut / 2 - 2).attr("y2", r + 60);
1306
- const E = d.append("circle");
1307
- E.attr("cx", e.x + e.width / 2), E.attr("cy", r + 10), E.attr("r", 15), E.attr("width", e.width), E.attr("height", e.height);
1308
- const g = d.node().getBBox();
1309
- return e.height = g.height, Wt(c, ot(e.description))(
1310
- e.description,
1311
- d,
1312
- f.x,
1313
- f.y + 35,
1314
- f.width,
1315
- f.height,
1316
- { class: `actor ${Gt}` },
1317
- c
1318
- ), e.height;
1319
- }, "drawActorTypeActor"), ze = /* @__PURE__ */ u(async function(t, e, c, s) {
1320
- switch (e.type) {
1321
- case "actor":
1322
- return await qe(t, e, c, s);
1323
- case "participant":
1324
- return await Fe(t, e, c, s);
1325
- }
1326
- }, "drawActor"), He = /* @__PURE__ */ u(function(t, e, c) {
1327
- const r = t.append("g");
1328
- se(r, e), e.name && Wt(c)(
1329
- e.name,
1330
- r,
1331
- e.x,
1332
- e.y + c.boxTextMargin + (e.textMaxHeight || 0) / 2,
1333
- e.width,
1334
- 0,
1335
- { class: "text" },
1336
- c
1337
- ), r.lower();
1338
- }, "drawBox"), Ue = /* @__PURE__ */ u(function(t) {
1339
- return t.append("g");
1340
- }, "anchorElement"), Ke = /* @__PURE__ */ u(function(t, e, c, s, r) {
1341
- const i = Pt(), o = e.anchored;
1342
- i.x = e.startx, i.y = e.starty, i.class = "activation" + r % 3, i.width = e.stopx - e.startx, i.height = c - e.starty, Yt(o, i);
1343
- }, "drawActivation"), Ge = /* @__PURE__ */ u(async function(t, e, c, s) {
1344
- const {
1345
- boxMargin: r,
1346
- boxTextMargin: i,
1347
- labelBoxHeight: o,
1348
- labelBoxWidth: h,
1349
- messageFontFamily: d,
1350
- messageFontSize: a,
1351
- messageFontWeight: f
1352
- } = s, E = t.append("g"), g = /* @__PURE__ */ u(function(L, A, O, S) {
1353
- return E.append("line").attr("x1", L).attr("y1", A).attr("x2", O).attr("y2", S).attr("class", "loopLine");
1354
- }, "drawLoopLine");
1355
- g(e.startx, e.starty, e.stopx, e.starty), g(e.stopx, e.starty, e.stopx, e.stopy), g(e.startx, e.stopy, e.stopx, e.stopy), g(e.startx, e.starty, e.startx, e.stopy), e.sections !== void 0 && e.sections.forEach(function(L) {
1356
- g(e.startx, L.y, e.stopx, L.y).style(
1357
- "stroke-dasharray",
1358
- "3, 3"
1359
- );
1360
- });
1361
- let T = Vt();
1362
- T.text = c, T.x = e.startx, T.y = e.starty, T.fontFamily = d, T.fontSize = a, T.fontWeight = f, T.anchor = "middle", T.valign = "middle", T.tspan = false, T.width = h || 50, T.height = o || 20, T.textMargin = i, T.class = "labelText", te(E, T), T = ae(), T.text = e.title, T.x = e.startx + h / 2 + (e.stopx - e.startx) / 2, T.y = e.starty + r + i, T.anchor = "middle", T.valign = "middle", T.textMargin = i, T.class = "loopText", T.fontFamily = d, T.fontSize = a, T.fontWeight = f, T.wrap = true;
1363
- let m = ot(T.text) ? await _t(E, T, e) : Tt(E, T);
1364
- if (e.sectionTitles !== void 0) {
1365
- for (const [L, A] of Object.entries(e.sectionTitles))
1366
- if (A.message) {
1367
- T.text = A.message, T.x = e.startx + (e.stopx - e.startx) / 2, T.y = e.sections[L].y + r + i, T.class = "loopText", T.anchor = "middle", T.valign = "middle", T.tspan = false, T.fontFamily = d, T.fontSize = a, T.fontWeight = f, T.wrap = e.wrap, ot(T.text) ? (e.starty = e.sections[L].y, await _t(E, T, e)) : Tt(E, T);
1368
- let O = Math.round(
1369
- m.map((S) => (S._groups || S)[0][0].getBBox().height).reduce((S, B) => S + B)
1370
- );
1371
- e.sections[L].height += O - (r + i);
1372
- }
1373
- }
1374
- return e.height = Math.round(e.stopy - e.starty), E;
1375
- }, "drawLoop"), se = /* @__PURE__ */ u(function(t, e) {
1376
- fe(t, e);
1377
- }, "drawBackgroundRect"), Xe = /* @__PURE__ */ u(function(t) {
1378
- t.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1379
- "d",
1380
- "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"
1381
- );
1382
- }, "insertDatabaseIcon"), Je = /* @__PURE__ */ u(function(t) {
1383
- t.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1384
- "d",
1385
- "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"
1386
- );
1387
- }, "insertComputerIcon"), Ze = /* @__PURE__ */ u(function(t) {
1388
- t.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1389
- "d",
1390
- "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"
1391
- );
1392
- }, "insertClockIcon"), Qe = /* @__PURE__ */ u(function(t) {
1393
- t.append("defs").append("marker").attr("id", "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");
1394
- }, "insertArrowHead"), je = /* @__PURE__ */ u(function(t) {
1395
- t.append("defs").append("marker").attr("id", "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");
1396
- }, "insertArrowFilledHead"), $e = /* @__PURE__ */ u(function(t) {
1397
- t.append("defs").append("marker").attr("id", "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);
1398
- }, "insertSequenceNumber"), ts = /* @__PURE__ */ u(function(t) {
1399
- t.append("defs").append("marker").attr("id", "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");
1400
- }, "insertArrowCrossHead"), ae = /* @__PURE__ */ u(function() {
1401
- return {
1402
- x: 0,
1403
- y: 0,
1404
- fill: void 0,
1405
- anchor: void 0,
1406
- style: "#666",
1407
- width: void 0,
1408
- height: void 0,
1409
- textMargin: 0,
1410
- rx: 0,
1411
- ry: 0,
1412
- tspan: true,
1413
- valign: void 0
1414
- };
1415
- }, "getTextObj"), es = /* @__PURE__ */ u(function() {
1416
- return {
1417
- x: 0,
1418
- y: 0,
1419
- fill: "#EDF2AE",
1420
- stroke: "#666",
1421
- width: 100,
1422
- anchor: "start",
1423
- height: 100,
1424
- rx: 0,
1425
- ry: 0
1426
- };
1427
- }, "getNoteRect"), Wt = /* @__PURE__ */ function() {
1428
- function t(i, o, h, d, a, f, E) {
1429
- const g = o.append("text").attr("x", h + a / 2).attr("y", d + f / 2 + 5).style("text-anchor", "middle").text(i);
1430
- r(g, E);
1431
- }
1432
- u(t, "byText");
1433
- function e(i, o, h, d, a, f, E, g) {
1434
- const { actorFontSize: T, actorFontFamily: m, actorFontWeight: L } = g, [A, O] = Zt(T), S = i.split(v.lineBreakRegex);
1435
- for (let B = 0; B < S.length; B++) {
1436
- const D = B * A - A * (S.length - 1) / 2, F = o.append("text").attr("x", h + a / 2).attr("y", d).style("text-anchor", "middle").style("font-size", O).style("font-weight", L).style("font-family", m);
1437
- F.append("tspan").attr("x", h + a / 2).attr("dy", D).text(S[B]), F.attr("y", d + f / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), r(F, E);
1438
- }
1439
- }
1440
- u(e, "byTspan");
1441
- function c(i, o, h, d, a, f, E, g) {
1442
- const T = o.append("switch"), L = T.append("foreignObject").attr("x", h).attr("y", d).attr("width", a).attr("height", f).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1443
- L.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(i), e(i, T, h, d, a, f, E, g), r(L, E);
1444
- }
1445
- u(c, "byFo");
1446
- async function s(i, o, h, d, a, f, E, g) {
1447
- const T = await Et(i, Dt()), m = o.append("switch"), A = m.append("foreignObject").attr("x", h + a / 2 - T.width / 2).attr("y", d + f / 2 - T.height / 2).attr("width", T.width).attr("height", T.height).append("xhtml:div").style("height", "100%").style("width", "100%");
1448
- A.append("div").style("text-align", "center").style("vertical-align", "middle").html(await Qt(i, Dt())), e(i, m, h, d, a, f, E, g), r(A, E);
1449
- }
1450
- u(s, "byKatex");
1451
- function r(i, o) {
1452
- for (const h in o)
1453
- o.hasOwnProperty(h) && i.attr(h, o[h]);
1454
- }
1455
- return u(r, "_setTextAttrs"), function(i, o = false) {
1456
- return o ? s : i.textPlacement === "fo" ? c : i.textPlacement === "old" ? t : e;
1457
- };
1458
- }(), ss = /* @__PURE__ */ function() {
1459
- function t(r, i, o, h, d, a, f) {
1460
- const E = i.append("text").attr("x", o).attr("y", h).style("text-anchor", "start").text(r);
1461
- s(E, f);
1462
- }
1463
- u(t, "byText");
1464
- function e(r, i, o, h, d, a, f, E) {
1465
- const { actorFontSize: g, actorFontFamily: T, actorFontWeight: m } = E, L = r.split(v.lineBreakRegex);
1466
- for (let A = 0; A < L.length; A++) {
1467
- const O = A * g - g * (L.length - 1) / 2, S = i.append("text").attr("x", o).attr("y", h).style("text-anchor", "start").style("font-size", g).style("font-weight", m).style("font-family", T);
1468
- S.append("tspan").attr("x", o).attr("dy", O).text(L[A]), S.attr("y", h + a / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), s(S, f);
1469
- }
1470
- }
1471
- u(e, "byTspan");
1472
- function c(r, i, o, h, d, a, f, E) {
1473
- const g = i.append("switch"), m = g.append("foreignObject").attr("x", o).attr("y", h).attr("width", d).attr("height", a).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1474
- m.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(r), e(r, g, o, h, d, a, f, E), s(m, f);
1475
- }
1476
- u(c, "byFo");
1477
- function s(r, i) {
1478
- for (const o in i)
1479
- i.hasOwnProperty(o) && r.attr(o, i[o]);
1480
- }
1481
- return u(s, "_setTextAttrs"), function(r) {
1482
- return r.textPlacement === "fo" ? c : r.textPlacement === "old" ? t : e;
1483
- };
1484
- }(), C = {
1485
- drawRect: Yt,
1486
- drawText: Tt,
1487
- drawLabel: te,
1488
- drawActor: ze,
1489
- drawBox: He,
1490
- drawPopup: Ye,
1491
- anchorElement: Ue,
1492
- drawActivation: Ke,
1493
- drawLoop: Ge,
1494
- drawBackgroundRect: se,
1495
- insertArrowHead: Qe,
1496
- insertArrowFilledHead: je,
1497
- insertSequenceNumber: $e,
1498
- insertArrowCrossHead: ts,
1499
- insertDatabaseIcon: Xe,
1500
- insertComputerIcon: Je,
1501
- insertClockIcon: Ze,
1502
- getTextObj: ae,
1503
- getNoteRect: es,
1504
- fixLifeLineHeights: ee,
1505
- sanitizeUrl: Jt.sanitizeUrl
1506
- }, n = {}, x = {
1507
- data: {
1508
- startx: void 0,
1509
- stopx: void 0,
1510
- starty: void 0,
1511
- stopy: void 0
1512
- },
1513
- verticalPos: 0,
1514
- sequenceItems: [],
1515
- activations: [],
1516
- models: {
1517
- getHeight: /* @__PURE__ */ u(function() {
1518
- return Math.max.apply(
1519
- null,
1520
- this.actors.length === 0 ? [0] : this.actors.map((t) => t.height || 0)
1521
- ) + (this.loops.length === 0 ? 0 : this.loops.map((t) => t.height || 0).reduce((t, e) => t + e)) + (this.messages.length === 0 ? 0 : this.messages.map((t) => t.height || 0).reduce((t, e) => t + e)) + (this.notes.length === 0 ? 0 : this.notes.map((t) => t.height || 0).reduce((t, e) => t + e));
1522
- }, "getHeight"),
1523
- clear: /* @__PURE__ */ u(function() {
1524
- this.actors = [], this.boxes = [], this.loops = [], this.messages = [], this.notes = [];
1525
- }, "clear"),
1526
- addBox: /* @__PURE__ */ u(function(t) {
1527
- this.boxes.push(t);
1528
- }, "addBox"),
1529
- addActor: /* @__PURE__ */ u(function(t) {
1530
- this.actors.push(t);
1531
- }, "addActor"),
1532
- addLoop: /* @__PURE__ */ u(function(t) {
1533
- this.loops.push(t);
1534
- }, "addLoop"),
1535
- addMessage: /* @__PURE__ */ u(function(t) {
1536
- this.messages.push(t);
1537
- }, "addMessage"),
1538
- addNote: /* @__PURE__ */ u(function(t) {
1539
- this.notes.push(t);
1540
- }, "addNote"),
1541
- lastActor: /* @__PURE__ */ u(function() {
1542
- return this.actors[this.actors.length - 1];
1543
- }, "lastActor"),
1544
- lastLoop: /* @__PURE__ */ u(function() {
1545
- return this.loops[this.loops.length - 1];
1546
- }, "lastLoop"),
1547
- lastMessage: /* @__PURE__ */ u(function() {
1548
- return this.messages[this.messages.length - 1];
1549
- }, "lastMessage"),
1550
- lastNote: /* @__PURE__ */ u(function() {
1551
- return this.notes[this.notes.length - 1];
1552
- }, "lastNote"),
1553
- actors: [],
1554
- boxes: [],
1555
- loops: [],
1556
- messages: [],
1557
- notes: []
1558
- },
1559
- init: /* @__PURE__ */ u(function() {
1560
- this.sequenceItems = [], this.activations = [], this.models.clear(), this.data = {
1561
- startx: void 0,
1562
- stopx: void 0,
1563
- starty: void 0,
1564
- stopy: void 0
1565
- }, this.verticalPos = 0, ne($());
1566
- }, "init"),
1567
- updateVal: /* @__PURE__ */ u(function(t, e, c, s) {
1568
- t[e] === void 0 ? t[e] = c : t[e] = s(c, t[e]);
1569
- }, "updateVal"),
1570
- updateBounds: /* @__PURE__ */ u(function(t, e, c, s) {
1571
- const r = this;
1572
- let i = 0;
1573
- function o(h) {
1574
- return /* @__PURE__ */ u(function(a) {
1575
- i++;
1576
- const f = r.sequenceItems.length - i + 1;
1577
- r.updateVal(a, "starty", e - f * n.boxMargin, Math.min), r.updateVal(a, "stopy", s + f * n.boxMargin, Math.max), r.updateVal(x.data, "startx", t - f * n.boxMargin, Math.min), r.updateVal(x.data, "stopx", c + f * n.boxMargin, Math.max), h !== "activation" && (r.updateVal(a, "startx", t - f * n.boxMargin, Math.min), r.updateVal(a, "stopx", c + f * n.boxMargin, Math.max), r.updateVal(x.data, "starty", e - f * n.boxMargin, Math.min), r.updateVal(x.data, "stopy", s + f * n.boxMargin, Math.max));
1578
- }, "updateItemBounds");
1579
- }
1580
- u(o, "updateFn"), this.sequenceItems.forEach(o()), this.activations.forEach(o("activation"));
1581
- }, "updateBounds"),
1582
- insert: /* @__PURE__ */ u(function(t, e, c, s) {
1583
- const r = v.getMin(t, c), i = v.getMax(t, c), o = v.getMin(e, s), h = v.getMax(e, s);
1584
- this.updateVal(x.data, "startx", r, Math.min), this.updateVal(x.data, "starty", o, Math.min), this.updateVal(x.data, "stopx", i, Math.max), this.updateVal(x.data, "stopy", h, Math.max), this.updateBounds(r, o, i, h);
1585
- }, "insert"),
1586
- newActivation: /* @__PURE__ */ u(function(t, e, c) {
1587
- const s = c.get(t.from), r = At(t.from).length || 0, i = s.x + s.width / 2 + (r - 1) * n.activationWidth / 2;
1588
- this.activations.push({
1589
- startx: i,
1590
- starty: this.verticalPos + 2,
1591
- stopx: i + n.activationWidth,
1592
- stopy: void 0,
1593
- actor: t.from,
1594
- anchored: C.anchorElement(e)
1595
- });
1596
- }, "newActivation"),
1597
- endActivation: /* @__PURE__ */ u(function(t) {
1598
- const e = this.activations.map(function(c) {
1599
- return c.actor;
1600
- }).lastIndexOf(t.from);
1601
- return this.activations.splice(e, 1)[0];
1602
- }, "endActivation"),
1603
- createLoop: /* @__PURE__ */ u(function(t = { message: void 0, wrap: false, width: void 0 }, e) {
1604
- return {
1605
- startx: void 0,
1606
- starty: this.verticalPos,
1607
- stopx: void 0,
1608
- stopy: void 0,
1609
- title: t.message,
1610
- wrap: t.wrap,
1611
- width: t.width,
1612
- height: 0,
1613
- fill: e
1614
- };
1615
- }, "createLoop"),
1616
- newLoop: /* @__PURE__ */ u(function(t = { message: void 0, wrap: false, width: void 0 }, e) {
1617
- this.sequenceItems.push(this.createLoop(t, e));
1618
- }, "newLoop"),
1619
- endLoop: /* @__PURE__ */ u(function() {
1620
- return this.sequenceItems.pop();
1621
- }, "endLoop"),
1622
- isLoopOverlap: /* @__PURE__ */ u(function() {
1623
- return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : false;
1624
- }, "isLoopOverlap"),
1625
- addSectionToLoop: /* @__PURE__ */ u(function(t) {
1626
- const e = this.sequenceItems.pop();
1627
- e.sections = e.sections || [], e.sectionTitles = e.sectionTitles || [], e.sections.push({ y: x.getVerticalPos(), height: 0 }), e.sectionTitles.push(t), this.sequenceItems.push(e);
1628
- }, "addSectionToLoop"),
1629
- saveVerticalPos: /* @__PURE__ */ u(function() {
1630
- this.isLoopOverlap() && (this.savedVerticalPos = this.verticalPos);
1631
- }, "saveVerticalPos"),
1632
- resetVerticalPos: /* @__PURE__ */ u(function() {
1633
- this.isLoopOverlap() && (this.verticalPos = this.savedVerticalPos);
1634
- }, "resetVerticalPos"),
1635
- bumpVerticalPos: /* @__PURE__ */ u(function(t) {
1636
- this.verticalPos = this.verticalPos + t, this.data.stopy = v.getMax(this.data.stopy, this.verticalPos);
1637
- }, "bumpVerticalPos"),
1638
- getVerticalPos: /* @__PURE__ */ u(function() {
1639
- return this.verticalPos;
1640
- }, "getVerticalPos"),
1641
- getBounds: /* @__PURE__ */ u(function() {
1642
- return { bounds: this.data, models: this.models };
1643
- }, "getBounds")
1644
- }, as = /* @__PURE__ */ u(async function(t, e) {
1645
- x.bumpVerticalPos(n.boxMargin), e.height = n.boxMargin, e.starty = x.getVerticalPos();
1646
- const c = Pt();
1647
- c.x = e.startx, c.y = e.starty, c.width = e.width || n.width, c.class = "note";
1648
- const s = t.append("g"), r = C.drawRect(s, c), i = Vt();
1649
- i.x = e.startx, i.y = e.starty, i.width = c.width, i.dy = "1em", i.text = e.message, i.class = "noteText", i.fontFamily = n.noteFontFamily, i.fontSize = n.noteFontSize, i.fontWeight = n.noteFontWeight, i.anchor = n.noteAlign, i.textMargin = n.noteMargin, i.valign = "center";
1650
- const o = ot(i.text) ? await _t(s, i) : Tt(s, i), h = Math.round(
1651
- o.map((d) => (d._groups || d)[0][0].getBBox().height).reduce((d, a) => d + a)
1652
- );
1653
- r.attr("height", h + 2 * n.noteMargin), e.height += h + 2 * n.noteMargin, x.bumpVerticalPos(h + 2 * n.noteMargin), e.stopy = e.starty + h + 2 * n.noteMargin, e.stopx = e.startx + c.width, x.insert(e.startx, e.starty, e.stopx, e.stopy), x.models.addNote(e);
1654
- }, "drawNote"), gt = /* @__PURE__ */ u((t) => ({
1655
- fontFamily: t.messageFontFamily,
1656
- fontSize: t.messageFontSize,
1657
- fontWeight: t.messageFontWeight
1658
- }), "messageFont"), xt = /* @__PURE__ */ u((t) => ({
1659
- fontFamily: t.noteFontFamily,
1660
- fontSize: t.noteFontSize,
1661
- fontWeight: t.noteFontWeight
1662
- }), "noteFont"), Ot = /* @__PURE__ */ u((t) => ({
1663
- fontFamily: t.actorFontFamily,
1664
- fontSize: t.actorFontSize,
1665
- fontWeight: t.actorFontWeight
1666
- }), "actorFont");
1667
- async function re(t, e) {
1668
- x.bumpVerticalPos(10);
1669
- const { startx: c, stopx: s, message: r } = e, i = v.splitBreaks(r).length, o = ot(r), h = o ? await Et(r, $()) : Y.calculateTextDimensions(r, gt(n));
1670
- if (!o) {
1671
- const E = h.height / i;
1672
- e.height += E, x.bumpVerticalPos(E);
1673
- }
1674
- let d, a = h.height - 10;
1675
- const f = h.width;
1676
- if (c === s) {
1677
- d = x.getVerticalPos() + a, n.rightAngles || (a += n.boxMargin, d = x.getVerticalPos() + a), a += 30;
1678
- const E = v.getMax(f / 2, n.width / 2);
1679
- x.insert(
1680
- c - E,
1681
- x.getVerticalPos() - 10 + a,
1682
- s + E,
1683
- x.getVerticalPos() + 30 + a
1684
- );
1685
- } else
1686
- a += n.boxMargin, d = x.getVerticalPos() + a, x.insert(c, d - 10, s, d);
1687
- return x.bumpVerticalPos(a), e.height += a, e.stopy = e.starty + e.height, x.insert(e.fromBounds, e.starty, e.toBounds, e.stopy), d;
1688
- }
1689
- u(re, "boundMessage");
1690
- var rs = /* @__PURE__ */ u(async function(t, e, c, s) {
1691
- const { startx: r, stopx: i, starty: o, message: h, type: d, sequenceIndex: a, sequenceVisible: f } = e, E = Y.calculateTextDimensions(h, gt(n)), g = Vt();
1692
- g.x = r, g.y = o + 10, g.width = i - r, g.class = "messageText", g.dy = "1em", g.text = h, g.fontFamily = n.messageFontFamily, g.fontSize = n.messageFontSize, g.fontWeight = n.messageFontWeight, g.anchor = n.messageAlign, g.valign = "center", g.textMargin = n.wrapPadding, g.tspan = false, ot(g.text) ? await _t(t, g, { startx: r, stopx: i, starty: c }) : Tt(t, g);
1693
- const T = E.width;
1694
- let m;
1695
- r === i ? n.rightAngles ? m = t.append("path").attr(
1696
- "d",
1697
- `M ${r},${c} H ${r + v.getMax(n.width / 2, T / 2)} V ${c + 25} H ${r}`
1698
- ) : m = t.append("path").attr(
1699
- "d",
1700
- "M " + r + "," + c + " C " + (r + 60) + "," + (c - 10) + " " + (r + 60) + "," + (c + 30) + " " + r + "," + (c + 20)
1701
- ) : (m = t.append("line"), m.attr("x1", r), m.attr("y1", c), m.attr("x2", i), m.attr("y2", c)), d === s.db.LINETYPE.DOTTED || d === s.db.LINETYPE.DOTTED_CROSS || d === s.db.LINETYPE.DOTTED_POINT || d === s.db.LINETYPE.DOTTED_OPEN || d === s.db.LINETYPE.BIDIRECTIONAL_DOTTED ? (m.style("stroke-dasharray", "3, 3"), m.attr("class", "messageLine1")) : m.attr("class", "messageLine0");
1702
- let L = "";
1703
- n.arrowMarkerAbsolute && (L = Ne(true)), m.attr("stroke-width", 2), m.attr("stroke", "none"), m.style("fill", "none"), (d === s.db.LINETYPE.SOLID || d === s.db.LINETYPE.DOTTED) && m.attr("marker-end", "url(" + L + "#arrowhead)"), (d === s.db.LINETYPE.BIDIRECTIONAL_SOLID || d === s.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (m.attr("marker-start", "url(" + L + "#arrowhead)"), m.attr("marker-end", "url(" + L + "#arrowhead)")), (d === s.db.LINETYPE.SOLID_POINT || d === s.db.LINETYPE.DOTTED_POINT) && m.attr("marker-end", "url(" + L + "#filled-head)"), (d === s.db.LINETYPE.SOLID_CROSS || d === s.db.LINETYPE.DOTTED_CROSS) && m.attr("marker-end", "url(" + L + "#crosshead)"), (f || n.showSequenceNumbers) && (m.attr("marker-start", "url(" + L + "#sequencenumber)"), t.append("text").attr("x", r).attr("y", c + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(a));
1704
- }, "drawMessage"), is = /* @__PURE__ */ u(function(t, e, c, s, r, i, o) {
1705
- let h = 0, d = 0, a, f = 0;
1706
- for (const E of s) {
1707
- const g = e.get(E), T = g.box;
1708
- a && a != T && (o || x.models.addBox(a), d += n.boxMargin + a.margin), T && T != a && (o || (T.x = h + d, T.y = r), d += T.margin), g.width = g.width || n.width, g.height = v.getMax(g.height || n.height, n.height), g.margin = g.margin || n.actorMargin, f = v.getMax(f, g.height), c.get(g.name) && (d += g.width / 2), g.x = h + d, g.starty = x.getVerticalPos(), x.insert(g.x, r, g.x + g.width, g.height), h += g.width + d, g.box && (g.box.width = h + T.margin - g.box.x), d = g.margin, a = g.box, x.models.addActor(g);
1709
- }
1710
- a && !o && x.models.addBox(a), x.bumpVerticalPos(f);
1711
- }, "addActorRenderingData"), Bt = /* @__PURE__ */ u(async function(t, e, c, s) {
1712
- if (s) {
1713
- let r = 0;
1714
- x.bumpVerticalPos(n.boxMargin * 2);
1715
- for (const i of c) {
1716
- const o = e.get(i);
1717
- o.stopy || (o.stopy = x.getVerticalPos());
1718
- const h = await C.drawActor(t, o, n, true);
1719
- r = v.getMax(r, h);
1720
- }
1721
- x.bumpVerticalPos(r + n.boxMargin);
1722
- } else
1723
- for (const r of c) {
1724
- const i = e.get(r);
1725
- await C.drawActor(t, i, n, false);
1726
- }
1727
- }, "drawActors"), ie = /* @__PURE__ */ u(function(t, e, c, s) {
1728
- let r = 0, i = 0;
1729
- for (const o of c) {
1730
- const h = e.get(o), d = os(h), a = C.drawPopup(
1731
- t,
1732
- h,
1733
- d,
1734
- n,
1735
- n.forceMenus,
1736
- s
1737
- );
1738
- a.height > r && (r = a.height), a.width + h.x > i && (i = a.width + h.x);
1739
- }
1740
- return { maxHeight: r, maxWidth: i };
1741
- }, "drawActorsPopup"), ne = /* @__PURE__ */ u(function(t) {
1742
- we(n, t), t.fontFamily && (n.actorFontFamily = n.noteFontFamily = n.messageFontFamily = t.fontFamily), t.fontSize && (n.actorFontSize = n.noteFontSize = n.messageFontSize = t.fontSize), t.fontWeight && (n.actorFontWeight = n.noteFontWeight = n.messageFontWeight = t.fontWeight);
1743
- }, "setConf"), At = /* @__PURE__ */ u(function(t) {
1744
- return x.activations.filter(function(e) {
1745
- return e.actor === t;
1746
- });
1747
- }, "actorActivations"), Xt = /* @__PURE__ */ u(function(t, e) {
1748
- const c = e.get(t), s = At(t), r = s.reduce(
1749
- function(o, h) {
1750
- return v.getMin(o, h.startx);
1751
- },
1752
- c.x + c.width / 2 - 1
1753
- ), i = s.reduce(
1754
- function(o, h) {
1755
- return v.getMax(o, h.stopx);
1756
- },
1757
- c.x + c.width / 2 + 1
1758
- );
1759
- return [r, i];
1760
- }, "activationBounds");
1761
- function rt(t, e, c, s, r) {
1762
- x.bumpVerticalPos(c);
1763
- let i = s;
1764
- if (e.id && e.message && t[e.id]) {
1765
- const o = t[e.id].width, h = gt(n);
1766
- e.message = Y.wrapLabel(`[${e.message}]`, o - 2 * n.wrapPadding, h), e.width = o, e.wrap = true;
1767
- const d = Y.calculateTextDimensions(e.message, h), a = v.getMax(d.height, n.labelBoxHeight);
1768
- i = s + a, G.debug(`${a} - ${e.message}`);
1769
- }
1770
- r(e), x.bumpVerticalPos(i);
1771
- }
1772
- u(rt, "adjustLoopHeightForWrap");
1773
- function oe(t, e, c, s, r, i, o) {
1774
- function h(a, f) {
1775
- a.x < r.get(t.from).x ? (x.insert(
1776
- e.stopx - f,
1777
- e.starty,
1778
- e.startx,
1779
- e.stopy + a.height / 2 + n.noteMargin
1780
- ), e.stopx = e.stopx + f) : (x.insert(
1781
- e.startx,
1782
- e.starty,
1783
- e.stopx + f,
1784
- e.stopy + a.height / 2 + n.noteMargin
1785
- ), e.stopx = e.stopx - f);
1786
- }
1787
- u(h, "receiverAdjustment");
1788
- function d(a, f) {
1789
- a.x < r.get(t.to).x ? (x.insert(
1790
- e.startx - f,
1791
- e.starty,
1792
- e.stopx,
1793
- e.stopy + a.height / 2 + n.noteMargin
1794
- ), e.startx = e.startx + f) : (x.insert(
1795
- e.stopx,
1796
- e.starty,
1797
- e.startx + f,
1798
- e.stopy + a.height / 2 + n.noteMargin
1799
- ), e.startx = e.startx - f);
1800
- }
1801
- if (u(d, "senderAdjustment"), i.get(t.to) == s) {
1802
- const a = r.get(t.to), f = a.type == "actor" ? ut / 2 + 3 : a.width / 2 + 3;
1803
- h(a, f), a.starty = c - a.height / 2, x.bumpVerticalPos(a.height / 2);
1804
- } else if (o.get(t.from) == s) {
1805
- const a = r.get(t.from);
1806
- if (n.mirrorActors) {
1807
- const f = a.type == "actor" ? ut / 2 : a.width / 2;
1808
- d(a, f);
1809
- }
1810
- a.stopy = c - a.height / 2, x.bumpVerticalPos(a.height / 2);
1811
- } else if (o.get(t.to) == s) {
1812
- const a = r.get(t.to);
1813
- if (n.mirrorActors) {
1814
- const f = a.type == "actor" ? ut / 2 + 3 : a.width / 2 + 3;
1815
- h(a, f);
1816
- }
1817
- a.stopy = c - a.height / 2, x.bumpVerticalPos(a.height / 2);
1818
- }
1819
- }
1820
- u(oe, "adjustCreatedDestroyedData");
1821
- var ns = /* @__PURE__ */ u(async function(t, e, c, s) {
1822
- const { securityLevel: r, sequence: i } = $();
1823
- n = i;
1824
- let o;
1825
- r === "sandbox" && (o = It("#i" + e));
1826
- const h = r === "sandbox" ? It(o.nodes()[0].contentDocument.body) : It("body"), d = r === "sandbox" ? o.nodes()[0].contentDocument : document;
1827
- x.init(), G.debug(s.db);
1828
- const a = r === "sandbox" ? h.select(`[id="${e}"]`) : It(`[id="${e}"]`), f = s.db.getActors(), E = s.db.getCreatedActors(), g = s.db.getDestroyedActors(), T = s.db.getBoxes();
1829
- let m = s.db.getActorKeys();
1830
- const L = s.db.getMessages(), A = s.db.getDiagramTitle(), O = s.db.hasAtLeastOneBox(), S = s.db.hasAtLeastOneBoxWithTitle(), B = await ce(f, L, s);
1831
- if (n.height = await le(f, B, T), C.insertComputerIcon(a), C.insertDatabaseIcon(a), C.insertClockIcon(a), O && (x.bumpVerticalPos(n.boxMargin), S && x.bumpVerticalPos(T[0].textMaxHeight)), n.hideUnusedParticipants === true) {
1832
- const y = /* @__PURE__ */ new Set();
1833
- L.forEach((_) => {
1834
- y.add(_.from), y.add(_.to);
1835
- }), m = m.filter((_) => y.has(_));
1836
- }
1837
- is(a, f, E, m, 0, L, false);
1838
- const D = await hs(L, f, B, s);
1839
- C.insertArrowHead(a), C.insertArrowCrossHead(a), C.insertArrowFilledHead(a), C.insertSequenceNumber(a);
1840
- function F(y, _) {
1841
- const Q = x.endActivation(y);
1842
- Q.starty + 18 > _ && (Q.starty = _ - 6, _ += 12), C.drawActivation(
1843
- a,
1844
- Q,
1845
- _,
1846
- n,
1847
- At(y.from).length
1848
- ), x.insert(Q.startx, _ - 10, Q.stopx, _);
1849
- }
1850
- u(F, "activeEnd");
1851
- let q = 1, X = 1;
1852
- const tt = [], z = [];
1853
- let H = 0;
1854
- for (const y of L) {
1855
- let _, Q, at;
1856
- switch (y.type) {
1857
- case s.db.LINETYPE.NOTE:
1858
- x.resetVerticalPos(), Q = y.noteModel, await as(a, Q);
1859
- break;
1860
- case s.db.LINETYPE.ACTIVE_START:
1861
- x.newActivation(y, a, f);
1862
- break;
1863
- case s.db.LINETYPE.ACTIVE_END:
1864
- F(y, x.getVerticalPos());
1865
- break;
1866
- case s.db.LINETYPE.LOOP_START:
1867
- rt(
1868
- D,
1869
- y,
1870
- n.boxMargin,
1871
- n.boxMargin + n.boxTextMargin,
1872
- (k) => x.newLoop(k)
1873
- );
1874
- break;
1875
- case s.db.LINETYPE.LOOP_END:
1876
- _ = x.endLoop(), await C.drawLoop(a, _, "loop", n), x.bumpVerticalPos(_.stopy - x.getVerticalPos()), x.models.addLoop(_);
1877
- break;
1878
- case s.db.LINETYPE.RECT_START:
1879
- rt(
1880
- D,
1881
- y,
1882
- n.boxMargin,
1883
- n.boxMargin,
1884
- (k) => x.newLoop(void 0, k.message)
1885
- );
1886
- break;
1887
- case s.db.LINETYPE.RECT_END:
1888
- _ = x.endLoop(), z.push(_), x.models.addLoop(_), x.bumpVerticalPos(_.stopy - x.getVerticalPos());
1889
- break;
1890
- case s.db.LINETYPE.OPT_START:
1891
- rt(
1892
- D,
1893
- y,
1894
- n.boxMargin,
1895
- n.boxMargin + n.boxTextMargin,
1896
- (k) => x.newLoop(k)
1897
- );
1898
- break;
1899
- case s.db.LINETYPE.OPT_END:
1900
- _ = x.endLoop(), await C.drawLoop(a, _, "opt", n), x.bumpVerticalPos(_.stopy - x.getVerticalPos()), x.models.addLoop(_);
1901
- break;
1902
- case s.db.LINETYPE.ALT_START:
1903
- rt(
1904
- D,
1905
- y,
1906
- n.boxMargin,
1907
- n.boxMargin + n.boxTextMargin,
1908
- (k) => x.newLoop(k)
1909
- );
1910
- break;
1911
- case s.db.LINETYPE.ALT_ELSE:
1912
- rt(
1913
- D,
1914
- y,
1915
- n.boxMargin + n.boxTextMargin,
1916
- n.boxMargin,
1917
- (k) => x.addSectionToLoop(k)
1918
- );
1919
- break;
1920
- case s.db.LINETYPE.ALT_END:
1921
- _ = x.endLoop(), await C.drawLoop(a, _, "alt", n), x.bumpVerticalPos(_.stopy - x.getVerticalPos()), x.models.addLoop(_);
1922
- break;
1923
- case s.db.LINETYPE.PAR_START:
1924
- case s.db.LINETYPE.PAR_OVER_START:
1925
- rt(
1926
- D,
1927
- y,
1928
- n.boxMargin,
1929
- n.boxMargin + n.boxTextMargin,
1930
- (k) => x.newLoop(k)
1931
- ), x.saveVerticalPos();
1932
- break;
1933
- case s.db.LINETYPE.PAR_AND:
1934
- rt(
1935
- D,
1936
- y,
1937
- n.boxMargin + n.boxTextMargin,
1938
- n.boxMargin,
1939
- (k) => x.addSectionToLoop(k)
1940
- );
1941
- break;
1942
- case s.db.LINETYPE.PAR_END:
1943
- _ = x.endLoop(), await C.drawLoop(a, _, "par", n), x.bumpVerticalPos(_.stopy - x.getVerticalPos()), x.models.addLoop(_);
1944
- break;
1945
- case s.db.LINETYPE.AUTONUMBER:
1946
- q = y.message.start || q, X = y.message.step || X, y.message.visible ? s.db.enableSequenceNumbers() : s.db.disableSequenceNumbers();
1947
- break;
1948
- case s.db.LINETYPE.CRITICAL_START:
1949
- rt(
1950
- D,
1951
- y,
1952
- n.boxMargin,
1953
- n.boxMargin + n.boxTextMargin,
1954
- (k) => x.newLoop(k)
1955
- );
1956
- break;
1957
- case s.db.LINETYPE.CRITICAL_OPTION:
1958
- rt(
1959
- D,
1960
- y,
1961
- n.boxMargin + n.boxTextMargin,
1962
- n.boxMargin,
1963
- (k) => x.addSectionToLoop(k)
1964
- );
1965
- break;
1966
- case s.db.LINETYPE.CRITICAL_END:
1967
- _ = x.endLoop(), await C.drawLoop(a, _, "critical", n), x.bumpVerticalPos(_.stopy - x.getVerticalPos()), x.models.addLoop(_);
1968
- break;
1969
- case s.db.LINETYPE.BREAK_START:
1970
- rt(
1971
- D,
1972
- y,
1973
- n.boxMargin,
1974
- n.boxMargin + n.boxTextMargin,
1975
- (k) => x.newLoop(k)
1976
- );
1977
- break;
1978
- case s.db.LINETYPE.BREAK_END:
1979
- _ = x.endLoop(), await C.drawLoop(a, _, "break", n), x.bumpVerticalPos(_.stopy - x.getVerticalPos()), x.models.addLoop(_);
1980
- break;
1981
- default:
1982
- try {
1983
- at = y.msgModel, at.starty = x.getVerticalPos(), at.sequenceIndex = q, at.sequenceVisible = s.db.showSequenceNumbers();
1984
- const k = await re(a, at);
1985
- oe(
1986
- y,
1987
- at,
1988
- k,
1989
- H,
1990
- f,
1991
- E,
1992
- g
1993
- ), tt.push({ messageModel: at, lineStartY: k }), x.models.addMessage(at);
1994
- } catch (k) {
1995
- G.error("error while drawing message", k);
1996
- }
1997
- }
1998
- [
1999
- s.db.LINETYPE.SOLID_OPEN,
2000
- s.db.LINETYPE.DOTTED_OPEN,
2001
- s.db.LINETYPE.SOLID,
2002
- s.db.LINETYPE.DOTTED,
2003
- s.db.LINETYPE.SOLID_CROSS,
2004
- s.db.LINETYPE.DOTTED_CROSS,
2005
- s.db.LINETYPE.SOLID_POINT,
2006
- s.db.LINETYPE.DOTTED_POINT,
2007
- s.db.LINETYPE.BIDIRECTIONAL_SOLID,
2008
- s.db.LINETYPE.BIDIRECTIONAL_DOTTED
2009
- ].includes(y.type) && (q = q + X), H++;
2010
- }
2011
- G.debug("createdActors", E), G.debug("destroyedActors", g), await Bt(a, f, m, false);
2012
- for (const y of tt)
2013
- await rs(a, y.messageModel, y.lineStartY, s);
2014
- n.mirrorActors && await Bt(a, f, m, true), z.forEach((y) => C.drawBackgroundRect(a, y)), ee(a, f, m, n);
2015
- for (const y of x.models.boxes)
2016
- y.height = x.getVerticalPos() - y.y, x.insert(y.x, y.y, y.x + y.width, y.height), y.startx = y.x, y.starty = y.y, y.stopx = y.startx + y.width, y.stopy = y.starty + y.height, y.stroke = "rgb(0,0,0, 0.5)", C.drawBox(a, y, n);
2017
- O && x.bumpVerticalPos(n.boxMargin);
2018
- const W = ie(a, f, m, d), { bounds: M } = x.getBounds();
2019
- M.startx === void 0 && (M.startx = 0), M.starty === void 0 && (M.starty = 0), M.stopx === void 0 && (M.stopx = 0), M.stopy === void 0 && (M.stopy = 0);
2020
- let J = M.stopy - M.starty;
2021
- J < W.maxHeight && (J = W.maxHeight);
2022
- let U = J + 2 * n.diagramMarginY;
2023
- n.mirrorActors && (U = U - n.boxMargin + n.bottomMarginAdj);
2024
- let Z = M.stopx - M.startx;
2025
- Z < W.maxWidth && (Z = W.maxWidth);
2026
- const et = Z + 2 * n.diagramMarginX;
2027
- A && a.append("text").text(A).attr("x", (M.stopx - M.startx) / 2 - 2 * n.diagramMarginX).attr("y", -25), me(a, U, et, n.useMaxWidth);
2028
- const N = A ? 40 : 0;
2029
- a.attr(
2030
- "viewBox",
2031
- M.startx - n.diagramMarginX + " -" + (n.diagramMarginY + N) + " " + et + " " + (U + N)
2032
- ), G.debug("models:", x.models);
2033
- }, "draw");
2034
- async function ce(t, e, c) {
2035
- const s = {};
2036
- for (const r of e)
2037
- if (t.get(r.to) && t.get(r.from)) {
2038
- const i = t.get(r.to);
2039
- if (r.placement === c.db.PLACEMENT.LEFTOF && !i.prevActor || r.placement === c.db.PLACEMENT.RIGHTOF && !i.nextActor)
2040
- continue;
2041
- const o = r.placement !== void 0, h = !o, d = o ? xt(n) : gt(n), a = r.wrap ? Y.wrapLabel(r.message, n.width - 2 * n.wrapPadding, d) : r.message, E = (ot(a) ? await Et(r.message, $()) : Y.calculateTextDimensions(a, d)).width + 2 * n.wrapPadding;
2042
- h && r.from === i.nextActor ? s[r.to] = v.getMax(
2043
- s[r.to] || 0,
2044
- E
2045
- ) : h && r.from === i.prevActor ? s[r.from] = v.getMax(
2046
- s[r.from] || 0,
2047
- E
2048
- ) : h && r.from === r.to ? (s[r.from] = v.getMax(
2049
- s[r.from] || 0,
2050
- E / 2
2051
- ), s[r.to] = v.getMax(
2052
- s[r.to] || 0,
2053
- E / 2
2054
- )) : r.placement === c.db.PLACEMENT.RIGHTOF ? s[r.from] = v.getMax(
2055
- s[r.from] || 0,
2056
- E
2057
- ) : r.placement === c.db.PLACEMENT.LEFTOF ? s[i.prevActor] = v.getMax(
2058
- s[i.prevActor] || 0,
2059
- E
2060
- ) : r.placement === c.db.PLACEMENT.OVER && (i.prevActor && (s[i.prevActor] = v.getMax(
2061
- s[i.prevActor] || 0,
2062
- E / 2
2063
- )), i.nextActor && (s[r.from] = v.getMax(
2064
- s[r.from] || 0,
2065
- E / 2
2066
- )));
2067
- }
2068
- return G.debug("maxMessageWidthPerActor:", s), s;
2069
- }
2070
- u(ce, "getMaxMessageWidthPerActor");
2071
- var os = /* @__PURE__ */ u(function(t) {
2072
- let e = 0;
2073
- const c = Ot(n);
2074
- for (const s in t.links) {
2075
- const i = Y.calculateTextDimensions(s, c).width + 2 * n.wrapPadding + 2 * n.boxMargin;
2076
- e < i && (e = i);
2077
- }
2078
- return e;
2079
- }, "getRequiredPopupWidth");
2080
- async function le(t, e, c) {
2081
- let s = 0;
2082
- for (const i of t.keys()) {
2083
- const o = t.get(i);
2084
- o.wrap && (o.description = Y.wrapLabel(
2085
- o.description,
2086
- n.width - 2 * n.wrapPadding,
2087
- Ot(n)
2088
- ));
2089
- const h = ot(o.description) ? await Et(o.description, $()) : Y.calculateTextDimensions(o.description, Ot(n));
2090
- o.width = o.wrap ? n.width : v.getMax(n.width, h.width + 2 * n.wrapPadding), o.height = o.wrap ? v.getMax(h.height, n.height) : n.height, s = v.getMax(s, o.height);
2091
- }
2092
- for (const i in e) {
2093
- const o = t.get(i);
2094
- if (!o)
2095
- continue;
2096
- const h = t.get(o.nextActor);
2097
- if (!h) {
2098
- const E = e[i] + n.actorMargin - o.width / 2;
2099
- o.margin = v.getMax(E, n.actorMargin);
2100
- continue;
2101
- }
2102
- const a = e[i] + n.actorMargin - o.width / 2 - h.width / 2;
2103
- o.margin = v.getMax(a, n.actorMargin);
2104
- }
2105
- let r = 0;
2106
- return c.forEach((i) => {
2107
- const o = gt(n);
2108
- let h = i.actorKeys.reduce((f, E) => f += t.get(E).width + (t.get(E).margin || 0), 0);
2109
- h -= 2 * n.boxTextMargin, i.wrap && (i.name = Y.wrapLabel(i.name, h - 2 * n.wrapPadding, o));
2110
- const d = Y.calculateTextDimensions(i.name, o);
2111
- r = v.getMax(d.height, r);
2112
- const a = v.getMax(h, d.width + 2 * n.wrapPadding);
2113
- if (i.margin = n.boxTextMargin, h < a) {
2114
- const f = (a - h) / 2;
2115
- i.margin += f;
2116
- }
2117
- }), c.forEach((i) => i.textMaxHeight = r), v.getMax(s, n.height);
2118
- }
2119
- u(le, "calculateActorMargins");
2120
- var cs = /* @__PURE__ */ u(async function(t, e, c) {
2121
- const s = e.get(t.from), r = e.get(t.to), i = s.x, o = r.x, h = t.wrap && t.message;
2122
- let d = ot(t.message) ? await Et(t.message, $()) : Y.calculateTextDimensions(
2123
- h ? Y.wrapLabel(t.message, n.width, xt(n)) : t.message,
2124
- xt(n)
2125
- );
2126
- const a = {
2127
- width: h ? n.width : v.getMax(n.width, d.width + 2 * n.noteMargin),
2128
- height: 0,
2129
- startx: s.x,
2130
- stopx: 0,
2131
- starty: 0,
2132
- stopy: 0,
2133
- message: t.message
2134
- };
2135
- return t.placement === c.db.PLACEMENT.RIGHTOF ? (a.width = h ? v.getMax(n.width, d.width) : v.getMax(
2136
- s.width / 2 + r.width / 2,
2137
- d.width + 2 * n.noteMargin
2138
- ), a.startx = i + (s.width + n.actorMargin) / 2) : t.placement === c.db.PLACEMENT.LEFTOF ? (a.width = h ? v.getMax(n.width, d.width + 2 * n.noteMargin) : v.getMax(
2139
- s.width / 2 + r.width / 2,
2140
- d.width + 2 * n.noteMargin
2141
- ), a.startx = i - a.width + (s.width - n.actorMargin) / 2) : t.to === t.from ? (d = Y.calculateTextDimensions(
2142
- h ? Y.wrapLabel(t.message, v.getMax(n.width, s.width), xt(n)) : t.message,
2143
- xt(n)
2144
- ), a.width = h ? v.getMax(n.width, s.width) : v.getMax(s.width, n.width, d.width + 2 * n.noteMargin), a.startx = i + (s.width - a.width) / 2) : (a.width = Math.abs(i + s.width / 2 - (o + r.width / 2)) + n.actorMargin, a.startx = i < o ? i + s.width / 2 - n.actorMargin / 2 : o + r.width / 2 - n.actorMargin / 2), h && (a.message = Y.wrapLabel(
2145
- t.message,
2146
- a.width - 2 * n.wrapPadding,
2147
- xt(n)
2148
- )), G.debug(
2149
- `NM:[${a.startx},${a.stopx},${a.starty},${a.stopy}:${a.width},${a.height}=${t.message}]`
2150
- ), a;
2151
- }, "buildNoteModel"), ls = /* @__PURE__ */ u(function(t, e, c) {
2152
- if (![
2153
- c.db.LINETYPE.SOLID_OPEN,
2154
- c.db.LINETYPE.DOTTED_OPEN,
2155
- c.db.LINETYPE.SOLID,
2156
- c.db.LINETYPE.DOTTED,
2157
- c.db.LINETYPE.SOLID_CROSS,
2158
- c.db.LINETYPE.DOTTED_CROSS,
2159
- c.db.LINETYPE.SOLID_POINT,
2160
- c.db.LINETYPE.DOTTED_POINT,
2161
- c.db.LINETYPE.BIDIRECTIONAL_SOLID,
2162
- c.db.LINETYPE.BIDIRECTIONAL_DOTTED
2163
- ].includes(t.type))
2164
- return {};
2165
- const [s, r] = Xt(t.from, e), [i, o] = Xt(t.to, e), h = s <= i;
2166
- let d = h ? r : s, a = h ? i : o;
2167
- const f = Math.abs(i - o) > 2, E = /* @__PURE__ */ u((L) => h ? -L : L, "adjustValue");
2168
- t.from === t.to ? a = d : (t.activate && !f && (a += E(n.activationWidth / 2 - 1)), [c.db.LINETYPE.SOLID_OPEN, c.db.LINETYPE.DOTTED_OPEN].includes(t.type) || (a += E(3)), [c.db.LINETYPE.BIDIRECTIONAL_SOLID, c.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(
2169
- t.type
2170
- ) && (d -= E(3)));
2171
- const g = [s, r, i, o], T = Math.abs(d - a);
2172
- t.wrap && t.message && (t.message = Y.wrapLabel(
2173
- t.message,
2174
- v.getMax(T + 2 * n.wrapPadding, n.width),
2175
- gt(n)
2176
- ));
2177
- const m = Y.calculateTextDimensions(t.message, gt(n));
2178
- return {
2179
- width: v.getMax(
2180
- t.wrap ? 0 : m.width + 2 * n.wrapPadding,
2181
- T + 2 * n.wrapPadding,
2182
- n.width
2183
- ),
2184
- height: 0,
2185
- startx: d,
2186
- stopx: a,
2187
- starty: 0,
2188
- stopy: 0,
2189
- message: t.message,
2190
- type: t.type,
2191
- wrap: t.wrap,
2192
- fromBounds: Math.min.apply(null, g),
2193
- toBounds: Math.max.apply(null, g)
2194
- };
2195
- }, "buildMessageModel"), hs = /* @__PURE__ */ u(async function(t, e, c, s) {
2196
- const r = {}, i = [];
2197
- let o, h, d;
2198
- for (const a of t) {
2199
- switch (a.type) {
2200
- case s.db.LINETYPE.LOOP_START:
2201
- case s.db.LINETYPE.ALT_START:
2202
- case s.db.LINETYPE.OPT_START:
2203
- case s.db.LINETYPE.PAR_START:
2204
- case s.db.LINETYPE.PAR_OVER_START:
2205
- case s.db.LINETYPE.CRITICAL_START:
2206
- case s.db.LINETYPE.BREAK_START:
2207
- i.push({
2208
- id: a.id,
2209
- msg: a.message,
2210
- from: Number.MAX_SAFE_INTEGER,
2211
- to: Number.MIN_SAFE_INTEGER,
2212
- width: 0
2213
- });
2214
- break;
2215
- case s.db.LINETYPE.ALT_ELSE:
2216
- case s.db.LINETYPE.PAR_AND:
2217
- case s.db.LINETYPE.CRITICAL_OPTION:
2218
- a.message && (o = i.pop(), r[o.id] = o, r[a.id] = o, i.push(o));
2219
- break;
2220
- case s.db.LINETYPE.LOOP_END:
2221
- case s.db.LINETYPE.ALT_END:
2222
- case s.db.LINETYPE.OPT_END:
2223
- case s.db.LINETYPE.PAR_END:
2224
- case s.db.LINETYPE.CRITICAL_END:
2225
- case s.db.LINETYPE.BREAK_END:
2226
- o = i.pop(), r[o.id] = o;
2227
- break;
2228
- case s.db.LINETYPE.ACTIVE_START:
2229
- {
2230
- const E = e.get(a.from ? a.from : a.to.actor), g = At(a.from ? a.from : a.to.actor).length, T = E.x + E.width / 2 + (g - 1) * n.activationWidth / 2, m = {
2231
- startx: T,
2232
- stopx: T + n.activationWidth,
2233
- actor: a.from,
2234
- enabled: true
2235
- };
2236
- x.activations.push(m);
2237
- }
2238
- break;
2239
- case s.db.LINETYPE.ACTIVE_END:
2240
- {
2241
- const E = x.activations.map((g) => g.actor).lastIndexOf(a.from);
2242
- x.activations.splice(E, 1).splice(0, 1);
2243
- }
2244
- break;
2245
- }
2246
- a.placement !== void 0 ? (h = await cs(a, e, s), a.noteModel = h, i.forEach((E) => {
2247
- o = E, o.from = v.getMin(o.from, h.startx), o.to = v.getMax(o.to, h.startx + h.width), o.width = v.getMax(o.width, Math.abs(o.from - o.to)) - n.labelBoxWidth;
2248
- })) : (d = ls(a, e, s), a.msgModel = d, d.startx && d.stopx && i.length > 0 && i.forEach((E) => {
2249
- if (o = E, d.startx === d.stopx) {
2250
- const g = e.get(a.from), T = e.get(a.to);
2251
- o.from = v.getMin(
2252
- g.x - d.width / 2,
2253
- g.x - g.width / 2,
2254
- o.from
2255
- ), o.to = v.getMax(
2256
- T.x + d.width / 2,
2257
- T.x + g.width / 2,
2258
- o.to
2259
- ), o.width = v.getMax(o.width, Math.abs(o.to - o.from)) - n.labelBoxWidth;
2260
- } else
2261
- o.from = v.getMin(d.startx, o.from), o.to = v.getMax(d.stopx, o.to), o.width = v.getMax(o.width, d.width) - n.labelBoxWidth;
2262
- }));
2263
- }
2264
- return x.activations = [], G.debug("Loop type widths:", r), r;
2265
- }, "calculateLoopBounds"), ds = {
2266
- bounds: x,
2267
- drawActors: Bt,
2268
- drawActorsPopup: ie,
2269
- setConf: ne,
2270
- draw: ns
2271
- }, fs = {
2272
- parser: Se,
2273
- get db() {
2274
- return new Ce();
2275
- },
2276
- renderer: ds,
2277
- styles: Be,
2278
- init: /* @__PURE__ */ u((t) => {
2279
- t.sequence || (t.sequence = {}), t.wrap && (t.sequence.wrap = t.wrap, be({ sequence: { wrap: t.wrap } }));
2280
- }, "init")
2281
- };
2282
- export {
2283
- fs as diagram
2284
- };