@versini/sassysaint 8.107.3 → 8.108.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/chunks/{AboutChangelog.BmMVyf-Q.js → AboutChangelog.55tIwnGe.js} +2 -2
  2. package/dist/chunks/{AboutEntry.wD5hG0ON.js → AboutEntry.D1zAHjel.js} +7 -7
  3. package/dist/chunks/{App.FyINLNSp.js → App.Br7HE-y0.js} +1746 -1908
  4. package/dist/chunks/{Bubble.Ci-pu6NI.js → Bubble.Ic_8FEhH.js} +47 -74
  5. package/dist/chunks/{Table.Dzy9ts3i.js → ButtonIconDelete.DRBd_G40.js} +125 -104
  6. package/dist/chunks/{Chart.DYVf2gst.js → Chart.CwIVbBYb.js} +2 -2
  7. package/dist/chunks/{ChatBubbleAssistant.CD6bVvcQ.js → ChatBubbleAssistant.DHlLzqdc.js} +199 -208
  8. package/dist/chunks/{ChatBubbleUser.Cre3cX04.js → ChatBubbleUser.D7ksCr76.js} +27 -36
  9. package/dist/chunks/{ChatHistoryTable.D_kOkWN9.js → ChatHistoryTable.DhUDW7QO.js} +108 -121
  10. package/dist/chunks/{HistoryEntry.BFNME4Z8.js → HistoryEntry.BxnMfiXN.js} +6 -6
  11. package/dist/chunks/{LoginEntry.SW7wyEpU.js → LoginEntry.XF9rPWdB.js} +4 -4
  12. package/dist/chunks/{LogoEntry.BAKpdJEy.js → LogoEntry.CnTI8jpv.js} +304 -385
  13. package/dist/chunks/{MemoriesEntry.Ztyx_8Wm.js → MemoriesEntry.BjNXrPW2.js} +164 -169
  14. package/dist/chunks/{ProfileEntry.CjzAusYw.js → ProfileEntry.S6XO2uMT.js} +4 -4
  15. package/dist/chunks/{SettingsEntry.D4IKmfYP.js → SettingsEntry.C5jHUJzu.js} +5 -5
  16. package/dist/chunks/{UsageEntry.D7sTPflE.js → UsageEntry.CQTLPweE.js} +5 -5
  17. package/dist/chunks/_basePickBy.Dj6LWOd3.js +151 -0
  18. package/dist/chunks/_baseUniq.DfiF6jap.js +614 -0
  19. package/dist/chunks/arc.CLrqhM1J.js +83 -0
  20. package/dist/chunks/architecture-U656AL7Q.CuF-GD1P.js +36 -0
  21. package/dist/chunks/architectureDiagram-VXUJARFQ.BGPIWweD.js +4653 -0
  22. package/dist/chunks/blockDiagram-VD42YOAC.cLfUaXxm.js +2254 -0
  23. package/dist/chunks/browser.B8WuOmYx.js +260 -0
  24. package/dist/chunks/c4Diagram-YG6GDRKO.Cc4f8G62.js +1579 -0
  25. package/dist/chunks/channel.D7pUQPat.js +5 -0
  26. package/dist/chunks/chunk-4BX2VUAB.C5gP6CzO.js +8 -0
  27. package/dist/chunks/chunk-55IACEB6.CMTOMhuf.js +8 -0
  28. package/dist/chunks/chunk-B4BG7PRW.CQz5CpXp.js +1375 -0
  29. package/dist/chunks/chunk-DI55MBZ5.C4SOgQau.js +1370 -0
  30. package/dist/chunks/chunk-FMBD7UC4.5tYrPDWZ.js +19 -0
  31. package/dist/chunks/chunk-QN33PNHL.P3o9PZBW.js +19 -0
  32. package/dist/chunks/chunk-QZHKN3VN.COvsjomn.js +15 -0
  33. package/dist/chunks/chunk-TZMSLE5B.C5QPHQlj.js +64 -0
  34. package/dist/chunks/classDiagram-2ON5EDUG.DrIfmpHo.js +16 -0
  35. package/dist/chunks/classDiagram-v2-WZHVMYZB.DrIfmpHo.js +16 -0
  36. package/dist/chunks/clone.47X4nGV4.js +8 -0
  37. package/dist/chunks/cose-bilkent-S5V4N54A.B1umrZne.js +2600 -0
  38. package/dist/chunks/cytoscape.esm.DmRZGnqW.js +18700 -0
  39. package/dist/chunks/dagre-6UL2VRFP.Ce4VSTky.js +444 -0
  40. package/dist/chunks/defaultLocale.CPJLP5jg.js +171 -0
  41. package/dist/chunks/diagram-PSM6KHXK.B1yvSG9p.js +531 -0
  42. package/dist/chunks/diagram-QEK2KX5R.CYDnnLB3.js +217 -0
  43. package/dist/chunks/diagram-S2PKOQOG.BI6w7TZJ.js +142 -0
  44. package/dist/chunks/erDiagram-Q2GNP2WA.D7mTQJ6P.js +841 -0
  45. package/dist/chunks/flowDiagram-NV44I4VS.Col8_E_0.js +1620 -0
  46. package/dist/chunks/ganttDiagram-JELNMOA3.GAUSoSKL.js +2647 -0
  47. package/dist/chunks/gitGraph-F6HP7TQM.3I_jmRrt.js +27 -0
  48. package/dist/chunks/gitGraphDiagram-NY62KEGX.DZQ_LVDe.js +699 -0
  49. package/dist/chunks/graph.BmJVbvPo.js +247 -0
  50. package/dist/chunks/index.Bi0z4EE1.js +90 -0
  51. package/dist/chunks/{index.QiLu2wkI.js → index.C0El17wt.js} +2 -2
  52. package/dist/chunks/{index.DBovegdE.js → index.CUn5zNJg.js} +1 -1
  53. package/dist/chunks/index.CbEVdl_N.js +279 -0
  54. package/dist/chunks/{index.BT3Do9Po.js → index.CoZgV6rn.js} +34 -43
  55. package/dist/chunks/{index.16gcBvke.js → index.DCqTKdor.js} +60 -69
  56. package/dist/chunks/index.DctDXsYU.js +67 -0
  57. package/dist/chunks/{index.BfTDtoYy.js → index.Df-tNwfZ.js} +1 -1
  58. package/dist/chunks/{index.BI1_ccPN.js → index.DxGkXGdu.js} +3 -3
  59. package/dist/chunks/{index.uILjvEfo.js → index.z2e7pMwp.js} +1 -1
  60. package/dist/chunks/info-NVLQJR56.D9ao7_Su.js +27 -0
  61. package/dist/chunks/infoDiagram-WHAUD3N6.DmFB-CXk.js +24 -0
  62. package/dist/chunks/init.DAGnb5BH.js +16 -0
  63. package/dist/chunks/journeyDiagram-XKPGCS4Q.C9FISQxf.js +834 -0
  64. package/dist/chunks/kanban-definition-3W4ZIXB7.ChmJnTyd.js +719 -0
  65. package/dist/chunks/{index.DJlv39cv.js → katex.D0sQThIv.js} +1638 -1943
  66. package/dist/chunks/layout.DtZQLIyC.js +1332 -0
  67. package/dist/chunks/linear.CIDfImUo.js +625 -0
  68. package/dist/chunks/mermaid-parser.core.CO83pegl.js +12724 -0
  69. package/dist/chunks/mindmap-definition-VGOIOE7T.B3dfWebK.js +759 -0
  70. package/dist/chunks/ordinal.EWT-qnu7.js +61 -0
  71. package/dist/chunks/packet-BFZMPI3H.q9qJMgm9.js +27 -0
  72. package/dist/chunks/pie-7BOR55EZ.BTnKDmrp.js +32 -0
  73. package/dist/chunks/pieDiagram-ADFJNKIX.B23eDSnQ.js +161 -0
  74. package/dist/chunks/quadrantDiagram-AYHSOK5B.B3ZIlLhO.js +1022 -0
  75. package/dist/chunks/radar-NHE76QYJ.BeKykujs.js +27 -0
  76. package/dist/chunks/rehype-mermaid.DkS2NcIa.js +14283 -0
  77. package/dist/chunks/requirementDiagram-UZGBJVZJ.0vOl9IL2.js +850 -0
  78. package/dist/chunks/sankeyDiagram-TZEHDZUN.DxwTK65F.js +810 -0
  79. package/dist/chunks/sequenceDiagram-WL72ISMW.BmOg83Gx.js +2511 -0
  80. package/dist/chunks/stateDiagram-FKZM4ZOC.DBiU28Wu.js +263 -0
  81. package/dist/chunks/stateDiagram-v2-4FDKWEC3.B6t8_4cH.js +16 -0
  82. package/dist/chunks/timeline-definition-IT6M3QCI.DpWxwytE.js +795 -0
  83. package/dist/chunks/treemap-KMMF4GRG.KqgFrxbV.js +81 -0
  84. package/dist/chunks/{useMarkdown.BberHabr.js → useMarkdown.CxuK_DLo.js} +2078 -2072
  85. package/dist/chunks/xychartDiagram-PRI3JC2R.CBaIBQ89.js +1340 -0
  86. package/dist/components/SassySaint/SassySaint.js +1 -1
  87. package/dist/index.js +3 -3
  88. package/dist/style.css +1 -1
  89. package/package.json +5 -5
  90. package/dist/chunks/index.BjnVQ4X3.js +0 -99
  91. package/dist/chunks/index.uVDYkuxz.js +0 -297
@@ -0,0 +1,2511 @@
1
+ import { drawBackgroundRect as we, getTextObj as Xt, getNoteRect as ct, drawRect as ve, drawEmbeddedImage as Jt, drawImage as Qt } from "./chunk-TZMSLE5B.C5QPHQlj.js";
2
+ import { __name as f, setConfig2 as Ie, getConfig2 as st, select as St, log as Q, distExports as re, configureSvgSize as Le, assignWithDepth_default as _e, common_default as I, setAccTitle as se, setAccDescription as Ae, setDiagramTitle as ke, getAccTitle as Pe, getAccDescription as Ne, getDiagramTitle as Se, load as Me, JSON_SCHEMA as Re, clear as De, sanitizeText as Mt, utils_default as W, hasKatex as z, calculateMathMLDimensions as _t, parseFontSize as ie, ZERO_WIDTH_SPACE as Ce, getUrl as Oe, renderKatexSanitized as ne, getConfig as Ht } from "./rehype-mermaid.DkS2NcIa.js";
3
+ import { ImperativeState as Be } from "./chunk-QZHKN3VN.COvsjomn.js";
4
+ var Ut = (function() {
5
+ var e = /* @__PURE__ */ f(function(pt, v, A, L) {
6
+ for (A = A || {}, L = pt.length; L--; A[pt[L]] = v) ;
7
+ return A;
8
+ }, "o"), t = [1, 2], n = [1, 3], s = [1, 4], r = [2, 4], i = [1, 9], c = [1, 11], h = [1, 13], o = [1, 14], a = [1, 16], p = [1, 17], g = [1, 18], x = [1, 24], y = [1, 25], m = [1, 26], w = [1, 27], k = [1, 28], N = [1, 29], S = [1, 30], O = [1, 31], B = [1, 32], q = [1, 33], H = [1, 34], Z = [1, 35], at = [1, 36], U = [1, 37], G = [1, 38], F = [1, 39], D = [1, 41], $ = [1, 42], K = [1, 43], j = [1, 44], rt = [1, 45], R = [1, 46], E = [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, 55, 60, 61, 62, 63, 71], _ = [2, 71], X = [4, 5, 16, 50, 52, 53], tt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 55, 60, 61, 62, 63, 71], M = [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, 55, 60, 61, 62, 63, 71], Vt = [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, 55, 60, 61, 62, 63, 71], Zt = [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, 55, 60, 61, 62, 63, 71], ot = [69, 70, 71], lt = [1, 127], Yt = {
9
+ trace: /* @__PURE__ */ f(function() {
10
+ }, "trace"),
11
+ yy: {},
12
+ 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, actor_with_config: 54, note: 55, placement: 56, text2: 57, over: 58, actor_pair: 59, links: 60, link: 61, properties: 62, details: 63, spaceList: 64, ",": 65, left_of: 66, right_of: 67, signaltype: 68, "+": 69, "-": 70, ACTOR: 71, config_object: 72, CONFIG_START: 73, CONFIG_CONTENT: 74, CONFIG_END: 75, SOLID_OPEN_ARROW: 76, DOTTED_OPEN_ARROW: 77, SOLID_ARROW: 78, BIDIRECTIONAL_SOLID_ARROW: 79, DOTTED_ARROW: 80, BIDIRECTIONAL_DOTTED_ARROW: 81, SOLID_CROSS: 82, DOTTED_CROSS: 83, SOLID_POINT: 84, DOTTED_POINT: 85, TXT: 86, $accept: 0, $end: 1 },
13
+ 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", 55: "note", 58: "over", 60: "links", 61: "link", 62: "properties", 63: "details", 65: ",", 66: "left_of", 67: "right_of", 69: "+", 70: "-", 71: "ACTOR", 73: "CONFIG_START", 74: "CONFIG_CONTENT", 75: "CONFIG_END", 76: "SOLID_OPEN_ARROW", 77: "DOTTED_OPEN_ARROW", 78: "SOLID_ARROW", 79: "BIDIRECTIONAL_SOLID_ARROW", 80: "DOTTED_ARROW", 81: "BIDIRECTIONAL_DOTTED_ARROW", 82: "SOLID_CROSS", 83: "DOTTED_CROSS", 84: "SOLID_POINT", 85: "DOTTED_POINT", 86: "TXT" },
14
+ 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], [12, 3], [24, 4], [24, 4], [25, 3], [26, 3], [27, 3], [28, 3], [64, 2], [64, 1], [59, 3], [59, 1], [56, 1], [56, 1], [17, 5], [17, 5], [17, 4], [54, 2], [72, 3], [22, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [57, 1]],
15
+ performAction: /* @__PURE__ */ f(function(v, A, L, b, C, d, It) {
16
+ var u = d.length - 1;
17
+ switch (C) {
18
+ case 3:
19
+ return b.apply(d[u]), d[u];
20
+ case 4:
21
+ case 9:
22
+ this.$ = [];
23
+ break;
24
+ case 5:
25
+ case 10:
26
+ d[u - 1].push(d[u]), this.$ = d[u - 1];
27
+ break;
28
+ case 6:
29
+ case 7:
30
+ case 11:
31
+ case 12:
32
+ this.$ = d[u];
33
+ break;
34
+ case 8:
35
+ case 13:
36
+ this.$ = [];
37
+ break;
38
+ case 15:
39
+ d[u].type = "createParticipant", this.$ = d[u];
40
+ break;
41
+ case 16:
42
+ d[u - 1].unshift({ type: "boxStart", boxData: b.parseBoxData(d[u - 2]) }), d[u - 1].push({ type: "boxEnd", boxText: d[u - 2] }), this.$ = d[u - 1];
43
+ break;
44
+ case 18:
45
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number(d[u - 2]), sequenceIndexStep: Number(d[u - 1]), sequenceVisible: !0, signalType: b.LINETYPE.AUTONUMBER };
46
+ break;
47
+ case 19:
48
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number(d[u - 1]), sequenceIndexStep: 1, sequenceVisible: !0, signalType: b.LINETYPE.AUTONUMBER };
49
+ break;
50
+ case 20:
51
+ this.$ = { type: "sequenceIndex", sequenceVisible: !1, signalType: b.LINETYPE.AUTONUMBER };
52
+ break;
53
+ case 21:
54
+ this.$ = { type: "sequenceIndex", sequenceVisible: !0, signalType: b.LINETYPE.AUTONUMBER };
55
+ break;
56
+ case 22:
57
+ this.$ = { type: "activeStart", signalType: b.LINETYPE.ACTIVE_START, actor: d[u - 1].actor };
58
+ break;
59
+ case 23:
60
+ this.$ = { type: "activeEnd", signalType: b.LINETYPE.ACTIVE_END, actor: d[u - 1].actor };
61
+ break;
62
+ case 29:
63
+ b.setDiagramTitle(d[u].substring(6)), this.$ = d[u].substring(6);
64
+ break;
65
+ case 30:
66
+ b.setDiagramTitle(d[u].substring(7)), this.$ = d[u].substring(7);
67
+ break;
68
+ case 31:
69
+ this.$ = d[u].trim(), b.setAccTitle(this.$);
70
+ break;
71
+ case 32:
72
+ case 33:
73
+ this.$ = d[u].trim(), b.setAccDescription(this.$);
74
+ break;
75
+ case 34:
76
+ d[u - 1].unshift({ type: "loopStart", loopText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.LOOP_START }), d[u - 1].push({ type: "loopEnd", loopText: d[u - 2], signalType: b.LINETYPE.LOOP_END }), this.$ = d[u - 1];
77
+ break;
78
+ case 35:
79
+ d[u - 1].unshift({ type: "rectStart", color: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.RECT_START }), d[u - 1].push({ type: "rectEnd", color: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.RECT_END }), this.$ = d[u - 1];
80
+ break;
81
+ case 36:
82
+ d[u - 1].unshift({ type: "optStart", optText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.OPT_START }), d[u - 1].push({ type: "optEnd", optText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.OPT_END }), this.$ = d[u - 1];
83
+ break;
84
+ case 37:
85
+ d[u - 1].unshift({ type: "altStart", altText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.ALT_START }), d[u - 1].push({ type: "altEnd", signalType: b.LINETYPE.ALT_END }), this.$ = d[u - 1];
86
+ break;
87
+ case 38:
88
+ d[u - 1].unshift({ type: "parStart", parText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.PAR_START }), d[u - 1].push({ type: "parEnd", signalType: b.LINETYPE.PAR_END }), this.$ = d[u - 1];
89
+ break;
90
+ case 39:
91
+ d[u - 1].unshift({ type: "parStart", parText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.PAR_OVER_START }), d[u - 1].push({ type: "parEnd", signalType: b.LINETYPE.PAR_END }), this.$ = d[u - 1];
92
+ break;
93
+ case 40:
94
+ d[u - 1].unshift({ type: "criticalStart", criticalText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.CRITICAL_START }), d[u - 1].push({ type: "criticalEnd", signalType: b.LINETYPE.CRITICAL_END }), this.$ = d[u - 1];
95
+ break;
96
+ case 41:
97
+ d[u - 1].unshift({ type: "breakStart", breakText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.BREAK_START }), d[u - 1].push({ type: "breakEnd", optText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.BREAK_END }), this.$ = d[u - 1];
98
+ break;
99
+ case 43:
100
+ this.$ = d[u - 3].concat([{ type: "option", optionText: b.parseMessage(d[u - 1]), signalType: b.LINETYPE.CRITICAL_OPTION }, d[u]]);
101
+ break;
102
+ case 45:
103
+ this.$ = d[u - 3].concat([{ type: "and", parText: b.parseMessage(d[u - 1]), signalType: b.LINETYPE.PAR_AND }, d[u]]);
104
+ break;
105
+ case 47:
106
+ this.$ = d[u - 3].concat([{ type: "else", altText: b.parseMessage(d[u - 1]), signalType: b.LINETYPE.ALT_ELSE }, d[u]]);
107
+ break;
108
+ case 48:
109
+ d[u - 3].draw = "participant", d[u - 3].type = "addParticipant", d[u - 3].description = b.parseMessage(d[u - 1]), this.$ = d[u - 3];
110
+ break;
111
+ case 49:
112
+ d[u - 1].draw = "participant", d[u - 1].type = "addParticipant", this.$ = d[u - 1];
113
+ break;
114
+ case 50:
115
+ d[u - 3].draw = "actor", d[u - 3].type = "addParticipant", d[u - 3].description = b.parseMessage(d[u - 1]), this.$ = d[u - 3];
116
+ break;
117
+ case 51:
118
+ d[u - 1].draw = "actor", d[u - 1].type = "addParticipant", this.$ = d[u - 1];
119
+ break;
120
+ case 52:
121
+ d[u - 1].type = "destroyParticipant", this.$ = d[u - 1];
122
+ break;
123
+ case 53:
124
+ d[u - 1].draw = "participant", d[u - 1].type = "addParticipant", this.$ = d[u - 1];
125
+ break;
126
+ case 54:
127
+ this.$ = [d[u - 1], { type: "addNote", placement: d[u - 2], actor: d[u - 1].actor, text: d[u] }];
128
+ break;
129
+ case 55:
130
+ d[u - 2] = [].concat(d[u - 1], d[u - 1]).slice(0, 2), d[u - 2][0] = d[u - 2][0].actor, d[u - 2][1] = d[u - 2][1].actor, this.$ = [d[u - 1], { type: "addNote", placement: b.PLACEMENT.OVER, actor: d[u - 2].slice(0, 2), text: d[u] }];
131
+ break;
132
+ case 56:
133
+ this.$ = [d[u - 1], { type: "addLinks", actor: d[u - 1].actor, text: d[u] }];
134
+ break;
135
+ case 57:
136
+ this.$ = [d[u - 1], { type: "addALink", actor: d[u - 1].actor, text: d[u] }];
137
+ break;
138
+ case 58:
139
+ this.$ = [d[u - 1], { type: "addProperties", actor: d[u - 1].actor, text: d[u] }];
140
+ break;
141
+ case 59:
142
+ this.$ = [d[u - 1], { type: "addDetails", actor: d[u - 1].actor, text: d[u] }];
143
+ break;
144
+ case 62:
145
+ this.$ = [d[u - 2], d[u]];
146
+ break;
147
+ case 63:
148
+ this.$ = d[u];
149
+ break;
150
+ case 64:
151
+ this.$ = b.PLACEMENT.LEFTOF;
152
+ break;
153
+ case 65:
154
+ this.$ = b.PLACEMENT.RIGHTOF;
155
+ break;
156
+ case 66:
157
+ this.$ = [
158
+ d[u - 4],
159
+ d[u - 1],
160
+ { type: "addMessage", from: d[u - 4].actor, to: d[u - 1].actor, signalType: d[u - 3], msg: d[u], activate: !0 },
161
+ { type: "activeStart", signalType: b.LINETYPE.ACTIVE_START, actor: d[u - 1].actor }
162
+ ];
163
+ break;
164
+ case 67:
165
+ this.$ = [
166
+ d[u - 4],
167
+ d[u - 1],
168
+ { type: "addMessage", from: d[u - 4].actor, to: d[u - 1].actor, signalType: d[u - 3], msg: d[u] },
169
+ { type: "activeEnd", signalType: b.LINETYPE.ACTIVE_END, actor: d[u - 4].actor }
170
+ ];
171
+ break;
172
+ case 68:
173
+ this.$ = [d[u - 3], d[u - 1], { type: "addMessage", from: d[u - 3].actor, to: d[u - 1].actor, signalType: d[u - 2], msg: d[u] }];
174
+ break;
175
+ case 69:
176
+ this.$ = {
177
+ type: "addParticipant",
178
+ actor: d[u - 1],
179
+ config: d[u]
180
+ };
181
+ break;
182
+ case 70:
183
+ this.$ = d[u - 1].trim();
184
+ break;
185
+ case 71:
186
+ this.$ = { type: "addParticipant", actor: d[u] };
187
+ break;
188
+ case 72:
189
+ this.$ = b.LINETYPE.SOLID_OPEN;
190
+ break;
191
+ case 73:
192
+ this.$ = b.LINETYPE.DOTTED_OPEN;
193
+ break;
194
+ case 74:
195
+ this.$ = b.LINETYPE.SOLID;
196
+ break;
197
+ case 75:
198
+ this.$ = b.LINETYPE.BIDIRECTIONAL_SOLID;
199
+ break;
200
+ case 76:
201
+ this.$ = b.LINETYPE.DOTTED;
202
+ break;
203
+ case 77:
204
+ this.$ = b.LINETYPE.BIDIRECTIONAL_DOTTED;
205
+ break;
206
+ case 78:
207
+ this.$ = b.LINETYPE.SOLID_CROSS;
208
+ break;
209
+ case 79:
210
+ this.$ = b.LINETYPE.DOTTED_CROSS;
211
+ break;
212
+ case 80:
213
+ this.$ = b.LINETYPE.SOLID_POINT;
214
+ break;
215
+ case 81:
216
+ this.$ = b.LINETYPE.DOTTED_POINT;
217
+ break;
218
+ case 82:
219
+ this.$ = b.parseMessage(d[u].trim().substring(1));
220
+ break;
221
+ }
222
+ }, "anonymous"),
223
+ table: [{ 3: 1, 4: t, 5: n, 6: s }, { 1: [3] }, { 3: 5, 4: t, 5: n, 6: s }, { 3: 6, 4: t, 5: n, 6: s }, e([1, 4, 5, 13, 14, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 55, 60, 61, 62, 63, 71], r, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, e(E, [2, 5]), { 9: 47, 12: 12, 13: h, 14: o, 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, e(E, [2, 7]), e(E, [2, 8]), e(E, [2, 14]), { 12: 48, 50: U, 52: G, 53: F }, { 15: [1, 49] }, { 5: [1, 50] }, { 5: [1, 53], 19: [1, 51], 20: [1, 52] }, { 22: 54, 71: R }, { 22: 55, 71: R }, { 5: [1, 56] }, { 5: [1, 57] }, { 5: [1, 58] }, { 5: [1, 59] }, { 5: [1, 60] }, e(E, [2, 29]), e(E, [2, 30]), { 32: [1, 61] }, { 34: [1, 62] }, e(E, [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, 54: 72, 71: [1, 73] }, { 22: 74, 71: R }, { 22: 75, 71: R }, { 68: 76, 76: [1, 77], 77: [1, 78], 78: [1, 79], 79: [1, 80], 80: [1, 81], 81: [1, 82], 82: [1, 83], 83: [1, 84], 84: [1, 85], 85: [1, 86] }, { 56: 87, 58: [1, 88], 66: [1, 89], 67: [1, 90] }, { 22: 91, 71: R }, { 22: 92, 71: R }, { 22: 93, 71: R }, { 22: 94, 71: R }, e([5, 51, 65, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86], _), e(E, [2, 6]), e(E, [2, 15]), e(X, [2, 9], { 10: 95 }), e(E, [2, 17]), { 5: [1, 97], 19: [1, 96] }, { 5: [1, 98] }, e(E, [2, 21]), { 5: [1, 99] }, { 5: [1, 100] }, e(E, [2, 24]), e(E, [2, 25]), e(E, [2, 26]), e(E, [2, 27]), e(E, [2, 28]), e(E, [2, 31]), e(E, [2, 32]), e(tt, r, { 7: 101 }), e(tt, r, { 7: 102 }), e(tt, r, { 7: 103 }), e(M, r, { 40: 104, 7: 105 }), e(Vt, r, { 42: 106, 7: 107 }), e(Vt, r, { 7: 107, 42: 108 }), e(Zt, r, { 45: 109, 7: 110 }), e(tt, r, { 7: 111 }), { 5: [1, 113], 51: [1, 112] }, { 5: [1, 114] }, e([5, 51], _, { 72: 115, 73: [1, 116] }), { 5: [1, 118], 51: [1, 117] }, { 5: [1, 119] }, { 22: 122, 69: [1, 120], 70: [1, 121], 71: R }, e(ot, [2, 72]), e(ot, [2, 73]), e(ot, [2, 74]), e(ot, [2, 75]), e(ot, [2, 76]), e(ot, [2, 77]), e(ot, [2, 78]), e(ot, [2, 79]), e(ot, [2, 80]), e(ot, [2, 81]), { 22: 123, 71: R }, { 22: 125, 59: 124, 71: R }, { 71: [2, 64] }, { 71: [2, 65] }, { 57: 126, 86: lt }, { 57: 128, 86: lt }, { 57: 129, 86: lt }, { 57: 130, 86: lt }, { 4: [1, 133], 5: [1, 135], 11: 132, 12: 134, 16: [1, 131], 50: U, 52: G, 53: F }, { 5: [1, 136] }, e(E, [2, 19]), e(E, [2, 20]), e(E, [2, 22]), e(E, [2, 23]), { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [1, 137], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [1, 138], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [1, 139], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, { 16: [1, 140] }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [2, 46], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 49: [1, 141], 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, { 16: [1, 142] }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [2, 44], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 48: [1, 143], 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, { 16: [1, 144] }, { 16: [1, 145] }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [2, 42], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 47: [1, 146], 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [1, 147], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, { 15: [1, 148] }, e(E, [2, 49]), e(E, [2, 53]), { 5: [2, 69] }, { 74: [1, 149] }, { 15: [1, 150] }, e(E, [2, 51]), e(E, [2, 52]), { 22: 151, 71: R }, { 22: 152, 71: R }, { 57: 153, 86: lt }, { 57: 154, 86: lt }, { 57: 155, 86: lt }, { 65: [1, 156], 86: [2, 63] }, { 5: [2, 56] }, { 5: [2, 82] }, { 5: [2, 57] }, { 5: [2, 58] }, { 5: [2, 59] }, e(E, [2, 16]), e(X, [2, 10]), { 12: 157, 50: U, 52: G, 53: F }, e(X, [2, 12]), e(X, [2, 13]), e(E, [2, 18]), e(E, [2, 34]), e(E, [2, 35]), e(E, [2, 36]), e(E, [2, 37]), { 15: [1, 158] }, e(E, [2, 38]), { 15: [1, 159] }, e(E, [2, 39]), e(E, [2, 40]), { 15: [1, 160] }, e(E, [2, 41]), { 5: [1, 161] }, { 75: [1, 162] }, { 5: [1, 163] }, { 57: 164, 86: lt }, { 57: 165, 86: lt }, { 5: [2, 68] }, { 5: [2, 54] }, { 5: [2, 55] }, { 22: 166, 71: R }, e(X, [2, 11]), e(M, r, { 7: 105, 40: 167 }), e(Vt, r, { 7: 107, 42: 168 }), e(Zt, r, { 7: 110, 45: 169 }), e(E, [2, 48]), { 5: [2, 70] }, e(E, [2, 50]), { 5: [2, 66] }, { 5: [2, 67] }, { 86: [2, 62] }, { 16: [2, 47] }, { 16: [2, 45] }, { 16: [2, 43] }],
224
+ defaultActions: { 5: [2, 1], 6: [2, 2], 89: [2, 64], 90: [2, 65], 115: [2, 69], 126: [2, 56], 127: [2, 82], 128: [2, 57], 129: [2, 58], 130: [2, 59], 153: [2, 68], 154: [2, 54], 155: [2, 55], 162: [2, 70], 164: [2, 66], 165: [2, 67], 166: [2, 62], 167: [2, 47], 168: [2, 45], 169: [2, 43] },
225
+ parseError: /* @__PURE__ */ f(function(v, A) {
226
+ if (A.recoverable)
227
+ this.trace(v);
228
+ else {
229
+ var L = new Error(v);
230
+ throw L.hash = A, L;
231
+ }
232
+ }, "parseError"),
233
+ parse: /* @__PURE__ */ f(function(v) {
234
+ var A = this, L = [0], b = [], C = [null], d = [], It = this.table, u = "", kt = 0, $t = 0, Te = 2, jt = 1, Ee = d.slice.call(arguments, 1), Y = Object.create(this.lexer), ft = { yy: {} };
235
+ for (var Wt in this.yy)
236
+ Object.prototype.hasOwnProperty.call(this.yy, Wt) && (ft.yy[Wt] = this.yy[Wt]);
237
+ Y.setInput(v, ft.yy), ft.yy.lexer = Y, ft.yy.parser = this, typeof Y.yylloc > "u" && (Y.yylloc = {});
238
+ var Ft = Y.yylloc;
239
+ d.push(Ft);
240
+ var be = Y.options && Y.options.ranges;
241
+ typeof ft.yy.parseError == "function" ? this.parseError = ft.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
242
+ function me(et) {
243
+ L.length = L.length - 2 * et, C.length = C.length - et, d.length = d.length - et;
244
+ }
245
+ f(me, "popStack");
246
+ function te() {
247
+ var et;
248
+ return et = b.pop() || Y.lex() || jt, typeof et != "number" && (et instanceof Array && (b = et, et = b.pop()), et = A.symbols_[et] || et), et;
249
+ }
250
+ f(te, "lex");
251
+ for (var J, yt, it, qt, bt = {}, Pt, ht, ee, Nt; ; ) {
252
+ if (yt = L[L.length - 1], this.defaultActions[yt] ? it = this.defaultActions[yt] : ((J === null || typeof J > "u") && (J = te()), it = It[yt] && It[yt][J]), typeof it > "u" || !it.length || !it[0]) {
253
+ var zt = "";
254
+ Nt = [];
255
+ for (Pt in It[yt])
256
+ this.terminals_[Pt] && Pt > Te && Nt.push("'" + this.terminals_[Pt] + "'");
257
+ Y.showPosition ? zt = "Parse error on line " + (kt + 1) + `:
258
+ ` + Y.showPosition() + `
259
+ Expecting ` + Nt.join(", ") + ", got '" + (this.terminals_[J] || J) + "'" : zt = "Parse error on line " + (kt + 1) + ": Unexpected " + (J == jt ? "end of input" : "'" + (this.terminals_[J] || J) + "'"), this.parseError(zt, {
260
+ text: Y.match,
261
+ token: this.terminals_[J] || J,
262
+ line: Y.yylineno,
263
+ loc: Ft,
264
+ expected: Nt
265
+ });
266
+ }
267
+ if (it[0] instanceof Array && it.length > 1)
268
+ throw new Error("Parse Error: multiple actions possible at state: " + yt + ", token: " + J);
269
+ switch (it[0]) {
270
+ case 1:
271
+ L.push(J), C.push(Y.yytext), d.push(Y.yylloc), L.push(it[1]), J = null, $t = Y.yyleng, u = Y.yytext, kt = Y.yylineno, Ft = Y.yylloc;
272
+ break;
273
+ case 2:
274
+ if (ht = this.productions_[it[1]][1], bt.$ = C[C.length - ht], bt._$ = {
275
+ first_line: d[d.length - (ht || 1)].first_line,
276
+ last_line: d[d.length - 1].last_line,
277
+ first_column: d[d.length - (ht || 1)].first_column,
278
+ last_column: d[d.length - 1].last_column
279
+ }, be && (bt._$.range = [
280
+ d[d.length - (ht || 1)].range[0],
281
+ d[d.length - 1].range[1]
282
+ ]), qt = this.performAction.apply(bt, [
283
+ u,
284
+ $t,
285
+ kt,
286
+ ft.yy,
287
+ it[1],
288
+ C,
289
+ d
290
+ ].concat(Ee)), typeof qt < "u")
291
+ return qt;
292
+ ht && (L = L.slice(0, -1 * ht * 2), C = C.slice(0, -1 * ht), d = d.slice(0, -1 * ht)), L.push(this.productions_[it[1]][0]), C.push(bt.$), d.push(bt._$), ee = It[L[L.length - 2]][L[L.length - 1]], L.push(ee);
293
+ break;
294
+ case 3:
295
+ return !0;
296
+ }
297
+ }
298
+ return !0;
299
+ }, "parse")
300
+ }, ye = /* @__PURE__ */ (function() {
301
+ var pt = {
302
+ EOF: 1,
303
+ parseError: /* @__PURE__ */ f(function(A, L) {
304
+ if (this.yy.parser)
305
+ this.yy.parser.parseError(A, L);
306
+ else
307
+ throw new Error(A);
308
+ }, "parseError"),
309
+ // resets the lexer, sets new input
310
+ setInput: /* @__PURE__ */ f(function(v, A) {
311
+ return this.yy = A || this.yy || {}, this._input = v, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
312
+ first_line: 1,
313
+ first_column: 0,
314
+ last_line: 1,
315
+ last_column: 0
316
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
317
+ }, "setInput"),
318
+ // consumes and returns one char from the input
319
+ input: /* @__PURE__ */ f(function() {
320
+ var v = this._input[0];
321
+ this.yytext += v, this.yyleng++, this.offset++, this.match += v, this.matched += v;
322
+ var A = v.match(/(?:\r\n?|\n).*/g);
323
+ return A ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), v;
324
+ }, "input"),
325
+ // unshifts one char (or a string) into the input
326
+ unput: /* @__PURE__ */ f(function(v) {
327
+ var A = v.length, L = v.split(/(?:\r\n?|\n)/g);
328
+ this._input = v + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - A), this.offset -= A;
329
+ var b = this.match.split(/(?:\r\n?|\n)/g);
330
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), L.length - 1 && (this.yylineno -= L.length - 1);
331
+ var C = this.yylloc.range;
332
+ return this.yylloc = {
333
+ first_line: this.yylloc.first_line,
334
+ last_line: this.yylineno + 1,
335
+ first_column: this.yylloc.first_column,
336
+ last_column: L ? (L.length === b.length ? this.yylloc.first_column : 0) + b[b.length - L.length].length - L[0].length : this.yylloc.first_column - A
337
+ }, this.options.ranges && (this.yylloc.range = [C[0], C[0] + this.yyleng - A]), this.yyleng = this.yytext.length, this;
338
+ }, "unput"),
339
+ // When called from action, caches matched text and appends it on next action
340
+ more: /* @__PURE__ */ f(function() {
341
+ return this._more = !0, this;
342
+ }, "more"),
343
+ // 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.
344
+ reject: /* @__PURE__ */ f(function() {
345
+ if (this.options.backtrack_lexer)
346
+ this._backtrack = !0;
347
+ else
348
+ 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).
349
+ ` + this.showPosition(), {
350
+ text: "",
351
+ token: null,
352
+ line: this.yylineno
353
+ });
354
+ return this;
355
+ }, "reject"),
356
+ // retain first n characters of the match
357
+ less: /* @__PURE__ */ f(function(v) {
358
+ this.unput(this.match.slice(v));
359
+ }, "less"),
360
+ // displays already matched input, i.e. for error messages
361
+ pastInput: /* @__PURE__ */ f(function() {
362
+ var v = this.matched.substr(0, this.matched.length - this.match.length);
363
+ return (v.length > 20 ? "..." : "") + v.substr(-20).replace(/\n/g, "");
364
+ }, "pastInput"),
365
+ // displays upcoming input, i.e. for error messages
366
+ upcomingInput: /* @__PURE__ */ f(function() {
367
+ var v = this.match;
368
+ return v.length < 20 && (v += this._input.substr(0, 20 - v.length)), (v.substr(0, 20) + (v.length > 20 ? "..." : "")).replace(/\n/g, "");
369
+ }, "upcomingInput"),
370
+ // displays the character position where the lexing error occurred, i.e. for error messages
371
+ showPosition: /* @__PURE__ */ f(function() {
372
+ var v = this.pastInput(), A = new Array(v.length + 1).join("-");
373
+ return v + this.upcomingInput() + `
374
+ ` + A + "^";
375
+ }, "showPosition"),
376
+ // test the lexed token: return FALSE when not a match, otherwise return token
377
+ test_match: /* @__PURE__ */ f(function(v, A) {
378
+ var L, b, C;
379
+ if (this.options.backtrack_lexer && (C = {
380
+ yylineno: this.yylineno,
381
+ yylloc: {
382
+ first_line: this.yylloc.first_line,
383
+ last_line: this.last_line,
384
+ first_column: this.yylloc.first_column,
385
+ last_column: this.yylloc.last_column
386
+ },
387
+ yytext: this.yytext,
388
+ match: this.match,
389
+ matches: this.matches,
390
+ matched: this.matched,
391
+ yyleng: this.yyleng,
392
+ offset: this.offset,
393
+ _more: this._more,
394
+ _input: this._input,
395
+ yy: this.yy,
396
+ conditionStack: this.conditionStack.slice(0),
397
+ done: this.done
398
+ }, this.options.ranges && (C.yylloc.range = this.yylloc.range.slice(0))), b = v[0].match(/(?:\r\n?|\n).*/g), b && (this.yylineno += b.length), this.yylloc = {
399
+ first_line: this.yylloc.last_line,
400
+ last_line: this.yylineno + 1,
401
+ first_column: this.yylloc.last_column,
402
+ last_column: b ? b[b.length - 1].length - b[b.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + v[0].length
403
+ }, this.yytext += v[0], this.match += v[0], this.matches = v, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(v[0].length), this.matched += v[0], L = this.performAction.call(this, this.yy, this, A, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), L)
404
+ return L;
405
+ if (this._backtrack) {
406
+ for (var d in C)
407
+ this[d] = C[d];
408
+ return !1;
409
+ }
410
+ return !1;
411
+ }, "test_match"),
412
+ // return next match in input
413
+ next: /* @__PURE__ */ f(function() {
414
+ if (this.done)
415
+ return this.EOF;
416
+ this._input || (this.done = !0);
417
+ var v, A, L, b;
418
+ this._more || (this.yytext = "", this.match = "");
419
+ for (var C = this._currentRules(), d = 0; d < C.length; d++)
420
+ if (L = this._input.match(this.rules[C[d]]), L && (!A || L[0].length > A[0].length)) {
421
+ if (A = L, b = d, this.options.backtrack_lexer) {
422
+ if (v = this.test_match(L, C[d]), v !== !1)
423
+ return v;
424
+ if (this._backtrack) {
425
+ A = !1;
426
+ continue;
427
+ } else
428
+ return !1;
429
+ } else if (!this.options.flex)
430
+ break;
431
+ }
432
+ return A ? (v = this.test_match(A, C[b]), v !== !1 ? v : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
433
+ ` + this.showPosition(), {
434
+ text: "",
435
+ token: null,
436
+ line: this.yylineno
437
+ });
438
+ }, "next"),
439
+ // return next match that has a token
440
+ lex: /* @__PURE__ */ f(function() {
441
+ var A = this.next();
442
+ return A || this.lex();
443
+ }, "lex"),
444
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
445
+ begin: /* @__PURE__ */ f(function(A) {
446
+ this.conditionStack.push(A);
447
+ }, "begin"),
448
+ // pop the previously active lexer condition state off the condition stack
449
+ popState: /* @__PURE__ */ f(function() {
450
+ var A = this.conditionStack.length - 1;
451
+ return A > 0 ? this.conditionStack.pop() : this.conditionStack[0];
452
+ }, "popState"),
453
+ // produce the lexer rule set which is active for the currently active lexer condition state
454
+ _currentRules: /* @__PURE__ */ f(function() {
455
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
456
+ }, "_currentRules"),
457
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
458
+ topState: /* @__PURE__ */ f(function(A) {
459
+ return A = this.conditionStack.length - 1 - Math.abs(A || 0), A >= 0 ? this.conditionStack[A] : "INITIAL";
460
+ }, "topState"),
461
+ // alias for begin(condition)
462
+ pushState: /* @__PURE__ */ f(function(A) {
463
+ this.begin(A);
464
+ }, "pushState"),
465
+ // return the number of states currently on the stack
466
+ stateStackSize: /* @__PURE__ */ f(function() {
467
+ return this.conditionStack.length;
468
+ }, "stateStackSize"),
469
+ options: { "case-insensitive": !0 },
470
+ performAction: /* @__PURE__ */ f(function(A, L, b, C) {
471
+ switch (b) {
472
+ case 0:
473
+ return 5;
474
+ case 1:
475
+ break;
476
+ case 2:
477
+ break;
478
+ case 3:
479
+ break;
480
+ case 4:
481
+ break;
482
+ case 5:
483
+ break;
484
+ case 6:
485
+ return 19;
486
+ case 7:
487
+ return this.begin("CONFIG"), 73;
488
+ case 8:
489
+ return 74;
490
+ case 9:
491
+ return this.popState(), this.popState(), 75;
492
+ case 10:
493
+ return L.yytext = L.yytext.trim(), 71;
494
+ case 11:
495
+ return L.yytext = L.yytext.trim(), this.begin("ALIAS"), 71;
496
+ case 12:
497
+ return this.begin("LINE"), 14;
498
+ case 13:
499
+ return this.begin("ID"), 50;
500
+ case 14:
501
+ return this.begin("ID"), 52;
502
+ case 15:
503
+ return 13;
504
+ case 16:
505
+ return this.begin("ID"), 53;
506
+ case 17:
507
+ return L.yytext = L.yytext.trim(), this.begin("ALIAS"), 71;
508
+ case 18:
509
+ return this.popState(), this.popState(), this.begin("LINE"), 51;
510
+ case 19:
511
+ return this.popState(), this.popState(), 5;
512
+ case 20:
513
+ return this.begin("LINE"), 36;
514
+ case 21:
515
+ return this.begin("LINE"), 37;
516
+ case 22:
517
+ return this.begin("LINE"), 38;
518
+ case 23:
519
+ return this.begin("LINE"), 39;
520
+ case 24:
521
+ return this.begin("LINE"), 49;
522
+ case 25:
523
+ return this.begin("LINE"), 41;
524
+ case 26:
525
+ return this.begin("LINE"), 43;
526
+ case 27:
527
+ return this.begin("LINE"), 48;
528
+ case 28:
529
+ return this.begin("LINE"), 44;
530
+ case 29:
531
+ return this.begin("LINE"), 47;
532
+ case 30:
533
+ return this.begin("LINE"), 46;
534
+ case 31:
535
+ return this.popState(), 15;
536
+ case 32:
537
+ return 16;
538
+ case 33:
539
+ return 66;
540
+ case 34:
541
+ return 67;
542
+ case 35:
543
+ return 60;
544
+ case 36:
545
+ return 61;
546
+ case 37:
547
+ return 62;
548
+ case 38:
549
+ return 63;
550
+ case 39:
551
+ return 58;
552
+ case 40:
553
+ return 55;
554
+ case 41:
555
+ return this.begin("ID"), 21;
556
+ case 42:
557
+ return this.begin("ID"), 23;
558
+ case 43:
559
+ return 29;
560
+ case 44:
561
+ return 30;
562
+ case 45:
563
+ return this.begin("acc_title"), 31;
564
+ case 46:
565
+ return this.popState(), "acc_title_value";
566
+ case 47:
567
+ return this.begin("acc_descr"), 33;
568
+ case 48:
569
+ return this.popState(), "acc_descr_value";
570
+ case 49:
571
+ this.begin("acc_descr_multiline");
572
+ break;
573
+ case 50:
574
+ this.popState();
575
+ break;
576
+ case 51:
577
+ return "acc_descr_multiline_value";
578
+ case 52:
579
+ return 6;
580
+ case 53:
581
+ return 18;
582
+ case 54:
583
+ return 20;
584
+ case 55:
585
+ return 65;
586
+ case 56:
587
+ return 5;
588
+ case 57:
589
+ return L.yytext = L.yytext.trim(), 71;
590
+ case 58:
591
+ return 78;
592
+ case 59:
593
+ return 79;
594
+ case 60:
595
+ return 80;
596
+ case 61:
597
+ return 81;
598
+ case 62:
599
+ return 76;
600
+ case 63:
601
+ return 77;
602
+ case 64:
603
+ return 82;
604
+ case 65:
605
+ return 83;
606
+ case 66:
607
+ return 84;
608
+ case 67:
609
+ return 85;
610
+ case 68:
611
+ return 86;
612
+ case 69:
613
+ return 86;
614
+ case 70:
615
+ return 69;
616
+ case 71:
617
+ return 70;
618
+ case 72:
619
+ return 5;
620
+ case 73:
621
+ return "INVALID";
622
+ }
623
+ }, "anonymous"),
624
+ rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[0-9]+(?=[ \n]+))/i, /^(?:@\{)/i, /^(?:[^\}]+)/i, /^(?:\})/i, /^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i, /^(?:[^\<->\->:\n,;@]+?([\-]*[^\<->\->:\n,;@]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\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],
625
+ conditions: { acc_descr_multiline: { rules: [50, 51], inclusive: !1 }, acc_descr: { rules: [48], inclusive: !1 }, acc_title: { rules: [46], inclusive: !1 }, ID: { rules: [2, 3, 7, 10, 11, 17], inclusive: !1 }, ALIAS: { rules: [2, 3, 18, 19], inclusive: !1 }, LINE: { rules: [2, 3, 31], inclusive: !1 }, CONFIG: { rules: [8, 9], inclusive: !1 }, CONFIG_DATA: { rules: [], inclusive: !1 }, INITIAL: { rules: [0, 1, 3, 4, 5, 6, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 47, 49, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73], inclusive: !0 } }
626
+ };
627
+ return pt;
628
+ })();
629
+ Yt.lexer = ye;
630
+ function At() {
631
+ this.yy = {};
632
+ }
633
+ return f(At, "Parser"), At.prototype = Yt, Yt.Parser = At, new At();
634
+ })();
635
+ Ut.parser = Ut;
636
+ var Ve = Ut, Ye = {
637
+ SOLID: 0,
638
+ DOTTED: 1,
639
+ NOTE: 2,
640
+ SOLID_CROSS: 3,
641
+ DOTTED_CROSS: 4,
642
+ SOLID_OPEN: 5,
643
+ DOTTED_OPEN: 6,
644
+ LOOP_START: 10,
645
+ LOOP_END: 11,
646
+ ALT_START: 12,
647
+ ALT_ELSE: 13,
648
+ ALT_END: 14,
649
+ OPT_START: 15,
650
+ OPT_END: 16,
651
+ ACTIVE_START: 17,
652
+ ACTIVE_END: 18,
653
+ PAR_START: 19,
654
+ PAR_AND: 20,
655
+ PAR_END: 21,
656
+ RECT_START: 22,
657
+ RECT_END: 23,
658
+ SOLID_POINT: 24,
659
+ DOTTED_POINT: 25,
660
+ AUTONUMBER: 26,
661
+ CRITICAL_START: 27,
662
+ CRITICAL_OPTION: 28,
663
+ CRITICAL_END: 29,
664
+ BREAK_START: 30,
665
+ BREAK_END: 31,
666
+ PAR_OVER_START: 32,
667
+ BIDIRECTIONAL_SOLID: 33,
668
+ BIDIRECTIONAL_DOTTED: 34
669
+ }, We = {
670
+ FILLED: 0,
671
+ OPEN: 1
672
+ }, Fe = {
673
+ LEFTOF: 0,
674
+ RIGHTOF: 1,
675
+ OVER: 2
676
+ }, Rt = {
677
+ ACTOR: "actor",
678
+ CONTROL: "control",
679
+ DATABASE: "database",
680
+ ENTITY: "entity"
681
+ }, wt, qe = (wt = class {
682
+ constructor() {
683
+ this.state = new Be(() => ({
684
+ prevActor: void 0,
685
+ actors: /* @__PURE__ */ new Map(),
686
+ createdActors: /* @__PURE__ */ new Map(),
687
+ destroyedActors: /* @__PURE__ */ new Map(),
688
+ boxes: [],
689
+ messages: [],
690
+ notes: [],
691
+ sequenceNumbersEnabled: !1,
692
+ wrapEnabled: void 0,
693
+ currentBox: void 0,
694
+ lastCreated: void 0,
695
+ lastDestroyed: void 0
696
+ })), this.setAccTitle = se, this.setAccDescription = Ae, this.setDiagramTitle = ke, this.getAccTitle = Pe, this.getAccDescription = Ne, this.getDiagramTitle = Se, this.apply = this.apply.bind(this), this.parseBoxData = this.parseBoxData.bind(this), this.parseMessage = this.parseMessage.bind(this), this.clear(), this.setWrap(st().wrap), this.LINETYPE = Ye, this.ARROWTYPE = We, this.PLACEMENT = Fe;
697
+ }
698
+ addBox(t) {
699
+ this.state.records.boxes.push({
700
+ name: t.text,
701
+ wrap: t.wrap ?? this.autoWrap(),
702
+ fill: t.color,
703
+ actorKeys: []
704
+ }), this.state.records.currentBox = this.state.records.boxes.slice(-1)[0];
705
+ }
706
+ addActor(t, n, s, r, i) {
707
+ let c = this.state.records.currentBox, h;
708
+ if (i !== void 0) {
709
+ let a;
710
+ i.includes(`
711
+ `) ? a = i + `
712
+ ` : a = `{
713
+ ` + i + `
714
+ }`, h = Me(a, { schema: Re });
715
+ }
716
+ r = h?.type ?? r;
717
+ const o = this.state.records.actors.get(t);
718
+ if (o) {
719
+ if (this.state.records.currentBox && o.box && this.state.records.currentBox !== o.box)
720
+ throw new Error(
721
+ `A same participant should only be defined in one Box: ${o.name} can't be in '${o.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`
722
+ );
723
+ if (c = o.box ? o.box : this.state.records.currentBox, o.box = c, o && n === o.name && s == null)
724
+ return;
725
+ }
726
+ if (s?.text == null && (s = { text: n, type: r }), (r == null || s.text == null) && (s = { text: n, type: r }), this.state.records.actors.set(t, {
727
+ box: c,
728
+ name: n,
729
+ description: s.text,
730
+ wrap: s.wrap ?? this.autoWrap(),
731
+ prevActor: this.state.records.prevActor,
732
+ links: {},
733
+ properties: {},
734
+ actorCnt: null,
735
+ rectData: null,
736
+ type: r ?? "participant"
737
+ }), this.state.records.prevActor) {
738
+ const a = this.state.records.actors.get(this.state.records.prevActor);
739
+ a && (a.nextActor = t);
740
+ }
741
+ this.state.records.currentBox && this.state.records.currentBox.actorKeys.push(t), this.state.records.prevActor = t;
742
+ }
743
+ activationCount(t) {
744
+ let n, s = 0;
745
+ if (!t)
746
+ return 0;
747
+ for (n = 0; n < this.state.records.messages.length; n++)
748
+ this.state.records.messages[n].type === this.LINETYPE.ACTIVE_START && this.state.records.messages[n].from === t && s++, this.state.records.messages[n].type === this.LINETYPE.ACTIVE_END && this.state.records.messages[n].from === t && s--;
749
+ return s;
750
+ }
751
+ addMessage(t, n, s, r) {
752
+ this.state.records.messages.push({
753
+ id: this.state.records.messages.length.toString(),
754
+ from: t,
755
+ to: n,
756
+ message: s.text,
757
+ wrap: s.wrap ?? this.autoWrap(),
758
+ answer: r
759
+ });
760
+ }
761
+ addSignal(t, n, s, r, i = !1) {
762
+ if (r === this.LINETYPE.ACTIVE_END && this.activationCount(t ?? "") < 1) {
763
+ const h = new Error("Trying to inactivate an inactive participant (" + t + ")");
764
+ throw h.hash = {
765
+ text: "->>-",
766
+ token: "->>-",
767
+ line: "1",
768
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
769
+ expected: ["'ACTIVE_PARTICIPANT'"]
770
+ }, h;
771
+ }
772
+ return this.state.records.messages.push({
773
+ id: this.state.records.messages.length.toString(),
774
+ from: t,
775
+ to: n,
776
+ message: s?.text ?? "",
777
+ wrap: s?.wrap ?? this.autoWrap(),
778
+ type: r,
779
+ activate: i
780
+ }), !0;
781
+ }
782
+ hasAtLeastOneBox() {
783
+ return this.state.records.boxes.length > 0;
784
+ }
785
+ hasAtLeastOneBoxWithTitle() {
786
+ return this.state.records.boxes.some((t) => t.name);
787
+ }
788
+ getMessages() {
789
+ return this.state.records.messages;
790
+ }
791
+ getBoxes() {
792
+ return this.state.records.boxes;
793
+ }
794
+ getActors() {
795
+ return this.state.records.actors;
796
+ }
797
+ getCreatedActors() {
798
+ return this.state.records.createdActors;
799
+ }
800
+ getDestroyedActors() {
801
+ return this.state.records.destroyedActors;
802
+ }
803
+ getActor(t) {
804
+ return this.state.records.actors.get(t);
805
+ }
806
+ getActorKeys() {
807
+ return [...this.state.records.actors.keys()];
808
+ }
809
+ enableSequenceNumbers() {
810
+ this.state.records.sequenceNumbersEnabled = !0;
811
+ }
812
+ disableSequenceNumbers() {
813
+ this.state.records.sequenceNumbersEnabled = !1;
814
+ }
815
+ showSequenceNumbers() {
816
+ return this.state.records.sequenceNumbersEnabled;
817
+ }
818
+ setWrap(t) {
819
+ this.state.records.wrapEnabled = t;
820
+ }
821
+ extractWrap(t) {
822
+ if (t === void 0)
823
+ return {};
824
+ t = t.trim();
825
+ const n = /^:?wrap:/.exec(t) !== null ? !0 : /^:?nowrap:/.exec(t) !== null ? !1 : void 0;
826
+ return { cleanedText: (n === void 0 ? t : t.replace(/^:?(?:no)?wrap:/, "")).trim(), wrap: n };
827
+ }
828
+ autoWrap() {
829
+ return this.state.records.wrapEnabled !== void 0 ? this.state.records.wrapEnabled : st().sequence?.wrap ?? !1;
830
+ }
831
+ clear() {
832
+ this.state.reset(), De();
833
+ }
834
+ parseMessage(t) {
835
+ const n = t.trim(), { wrap: s, cleanedText: r } = this.extractWrap(n), i = {
836
+ text: r,
837
+ wrap: s
838
+ };
839
+ return Q.debug(`parseMessage: ${JSON.stringify(i)}`), i;
840
+ }
841
+ // We expect the box statement to be color first then description
842
+ // 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
843
+ // We extract first segment as color, the rest of the line is considered as text
844
+ parseBoxData(t) {
845
+ const n = /^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);
846
+ let s = n?.[1] ? n[1].trim() : "transparent", r = n?.[2] ? n[2].trim() : void 0;
847
+ if (window?.CSS)
848
+ window.CSS.supports("color", s) || (s = "transparent", r = t.trim());
849
+ else {
850
+ const h = new Option().style;
851
+ h.color = s, h.color !== s && (s = "transparent", r = t.trim());
852
+ }
853
+ const { wrap: i, cleanedText: c } = this.extractWrap(r);
854
+ return {
855
+ text: c ? Mt(c, st()) : void 0,
856
+ color: s,
857
+ wrap: i
858
+ };
859
+ }
860
+ addNote(t, n, s) {
861
+ const r = {
862
+ actor: t,
863
+ placement: n,
864
+ message: s.text,
865
+ wrap: s.wrap ?? this.autoWrap()
866
+ }, i = [].concat(t, t);
867
+ this.state.records.notes.push(r), this.state.records.messages.push({
868
+ id: this.state.records.messages.length.toString(),
869
+ from: i[0],
870
+ to: i[1],
871
+ message: s.text,
872
+ wrap: s.wrap ?? this.autoWrap(),
873
+ type: this.LINETYPE.NOTE,
874
+ placement: n
875
+ });
876
+ }
877
+ addLinks(t, n) {
878
+ const s = this.getActor(t);
879
+ try {
880
+ let r = Mt(n.text, st());
881
+ r = r.replace(/&equals;/g, "="), r = r.replace(/&amp;/g, "&");
882
+ const i = JSON.parse(r);
883
+ this.insertLinks(s, i);
884
+ } catch (r) {
885
+ Q.error("error while parsing actor link text", r);
886
+ }
887
+ }
888
+ addALink(t, n) {
889
+ const s = this.getActor(t);
890
+ try {
891
+ const r = {};
892
+ let i = Mt(n.text, st());
893
+ const c = i.indexOf("@");
894
+ i = i.replace(/&equals;/g, "="), i = i.replace(/&amp;/g, "&");
895
+ const h = i.slice(0, c - 1).trim(), o = i.slice(c + 1).trim();
896
+ r[h] = o, this.insertLinks(s, r);
897
+ } catch (r) {
898
+ Q.error("error while parsing actor link text", r);
899
+ }
900
+ }
901
+ insertLinks(t, n) {
902
+ if (t.links == null)
903
+ t.links = n;
904
+ else
905
+ for (const s in n)
906
+ t.links[s] = n[s];
907
+ }
908
+ addProperties(t, n) {
909
+ const s = this.getActor(t);
910
+ try {
911
+ const r = Mt(n.text, st()), i = JSON.parse(r);
912
+ this.insertProperties(s, i);
913
+ } catch (r) {
914
+ Q.error("error while parsing actor properties text", r);
915
+ }
916
+ }
917
+ insertProperties(t, n) {
918
+ if (t.properties == null)
919
+ t.properties = n;
920
+ else
921
+ for (const s in n)
922
+ t.properties[s] = n[s];
923
+ }
924
+ boxEnd() {
925
+ this.state.records.currentBox = void 0;
926
+ }
927
+ addDetails(t, n) {
928
+ const s = this.getActor(t), r = document.getElementById(n.text);
929
+ try {
930
+ const i = r.innerHTML, c = JSON.parse(i);
931
+ c.properties && this.insertProperties(s, c.properties), c.links && this.insertLinks(s, c.links);
932
+ } catch (i) {
933
+ Q.error("error while parsing actor details text", i);
934
+ }
935
+ }
936
+ getActorProperty(t, n) {
937
+ if (t?.properties !== void 0)
938
+ return t.properties[n];
939
+ }
940
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-redundant-type-constituents
941
+ apply(t) {
942
+ if (Array.isArray(t))
943
+ t.forEach((n) => {
944
+ this.apply(n);
945
+ });
946
+ else
947
+ switch (t.type) {
948
+ case "sequenceIndex":
949
+ this.state.records.messages.push({
950
+ id: this.state.records.messages.length.toString(),
951
+ from: void 0,
952
+ to: void 0,
953
+ message: {
954
+ start: t.sequenceIndex,
955
+ step: t.sequenceIndexStep,
956
+ visible: t.sequenceVisible
957
+ },
958
+ wrap: !1,
959
+ type: t.signalType
960
+ });
961
+ break;
962
+ case "addParticipant":
963
+ this.addActor(t.actor, t.actor, t.description, t.draw, t.config);
964
+ break;
965
+ case "createParticipant":
966
+ if (this.state.records.actors.has(t.actor))
967
+ throw new Error(
968
+ "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"
969
+ );
970
+ this.state.records.lastCreated = t.actor, this.addActor(t.actor, t.actor, t.description, t.draw, t.config), this.state.records.createdActors.set(t.actor, this.state.records.messages.length);
971
+ break;
972
+ case "destroyParticipant":
973
+ this.state.records.lastDestroyed = t.actor, this.state.records.destroyedActors.set(t.actor, this.state.records.messages.length);
974
+ break;
975
+ case "activeStart":
976
+ this.addSignal(t.actor, void 0, void 0, t.signalType);
977
+ break;
978
+ case "activeEnd":
979
+ this.addSignal(t.actor, void 0, void 0, t.signalType);
980
+ break;
981
+ case "addNote":
982
+ this.addNote(t.actor, t.placement, t.text);
983
+ break;
984
+ case "addLinks":
985
+ this.addLinks(t.actor, t.text);
986
+ break;
987
+ case "addALink":
988
+ this.addALink(t.actor, t.text);
989
+ break;
990
+ case "addProperties":
991
+ this.addProperties(t.actor, t.text);
992
+ break;
993
+ case "addDetails":
994
+ this.addDetails(t.actor, t.text);
995
+ break;
996
+ case "addMessage":
997
+ if (this.state.records.lastCreated) {
998
+ if (t.to !== this.state.records.lastCreated)
999
+ throw new Error(
1000
+ "The created participant " + this.state.records.lastCreated.name + " does not have an associated creating message after its declaration. Please check the sequence diagram."
1001
+ );
1002
+ this.state.records.lastCreated = void 0;
1003
+ } else if (this.state.records.lastDestroyed) {
1004
+ if (t.to !== this.state.records.lastDestroyed && t.from !== this.state.records.lastDestroyed)
1005
+ throw new Error(
1006
+ "The destroyed participant " + this.state.records.lastDestroyed.name + " does not have an associated destroying message after its declaration. Please check the sequence diagram."
1007
+ );
1008
+ this.state.records.lastDestroyed = void 0;
1009
+ }
1010
+ this.addSignal(t.from, t.to, t.msg, t.signalType, t.activate);
1011
+ break;
1012
+ case "boxStart":
1013
+ this.addBox(t.boxData);
1014
+ break;
1015
+ case "boxEnd":
1016
+ this.boxEnd();
1017
+ break;
1018
+ case "loopStart":
1019
+ this.addSignal(void 0, void 0, t.loopText, t.signalType);
1020
+ break;
1021
+ case "loopEnd":
1022
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1023
+ break;
1024
+ case "rectStart":
1025
+ this.addSignal(void 0, void 0, t.color, t.signalType);
1026
+ break;
1027
+ case "rectEnd":
1028
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1029
+ break;
1030
+ case "optStart":
1031
+ this.addSignal(void 0, void 0, t.optText, t.signalType);
1032
+ break;
1033
+ case "optEnd":
1034
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1035
+ break;
1036
+ case "altStart":
1037
+ this.addSignal(void 0, void 0, t.altText, t.signalType);
1038
+ break;
1039
+ case "else":
1040
+ this.addSignal(void 0, void 0, t.altText, t.signalType);
1041
+ break;
1042
+ case "altEnd":
1043
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1044
+ break;
1045
+ case "setAccTitle":
1046
+ se(t.text);
1047
+ break;
1048
+ case "parStart":
1049
+ this.addSignal(void 0, void 0, t.parText, t.signalType);
1050
+ break;
1051
+ case "and":
1052
+ this.addSignal(void 0, void 0, t.parText, t.signalType);
1053
+ break;
1054
+ case "parEnd":
1055
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1056
+ break;
1057
+ case "criticalStart":
1058
+ this.addSignal(void 0, void 0, t.criticalText, t.signalType);
1059
+ break;
1060
+ case "option":
1061
+ this.addSignal(void 0, void 0, t.optionText, t.signalType);
1062
+ break;
1063
+ case "criticalEnd":
1064
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1065
+ break;
1066
+ case "breakStart":
1067
+ this.addSignal(void 0, void 0, t.breakText, t.signalType);
1068
+ break;
1069
+ case "breakEnd":
1070
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1071
+ break;
1072
+ }
1073
+ }
1074
+ getConfig() {
1075
+ return st().sequence;
1076
+ }
1077
+ }, f(wt, "SequenceDB"), wt), ze = /* @__PURE__ */ f((e) => `.actor {
1078
+ stroke: ${e.actorBorder};
1079
+ fill: ${e.actorBkg};
1080
+ }
1081
+
1082
+ text.actor > tspan {
1083
+ fill: ${e.actorTextColor};
1084
+ stroke: none;
1085
+ }
1086
+
1087
+ .actor-line {
1088
+ stroke: ${e.actorLineColor};
1089
+ }
1090
+
1091
+ .innerArc {
1092
+ stroke-width: 1.5;
1093
+ stroke-dasharray: none;
1094
+ }
1095
+
1096
+ .messageLine0 {
1097
+ stroke-width: 1.5;
1098
+ stroke-dasharray: none;
1099
+ stroke: ${e.signalColor};
1100
+ }
1101
+
1102
+ .messageLine1 {
1103
+ stroke-width: 1.5;
1104
+ stroke-dasharray: 2, 2;
1105
+ stroke: ${e.signalColor};
1106
+ }
1107
+
1108
+ #arrowhead path {
1109
+ fill: ${e.signalColor};
1110
+ stroke: ${e.signalColor};
1111
+ }
1112
+
1113
+ .sequenceNumber {
1114
+ fill: ${e.sequenceNumberColor};
1115
+ }
1116
+
1117
+ #sequencenumber {
1118
+ fill: ${e.signalColor};
1119
+ }
1120
+
1121
+ #crosshead path {
1122
+ fill: ${e.signalColor};
1123
+ stroke: ${e.signalColor};
1124
+ }
1125
+
1126
+ .messageText {
1127
+ fill: ${e.signalTextColor};
1128
+ stroke: none;
1129
+ }
1130
+
1131
+ .labelBox {
1132
+ stroke: ${e.labelBoxBorderColor};
1133
+ fill: ${e.labelBoxBkgColor};
1134
+ }
1135
+
1136
+ .labelText, .labelText > tspan {
1137
+ fill: ${e.labelTextColor};
1138
+ stroke: none;
1139
+ }
1140
+
1141
+ .loopText, .loopText > tspan {
1142
+ fill: ${e.loopTextColor};
1143
+ stroke: none;
1144
+ }
1145
+
1146
+ .loopLine {
1147
+ stroke-width: 2px;
1148
+ stroke-dasharray: 2, 2;
1149
+ stroke: ${e.labelBoxBorderColor};
1150
+ fill: ${e.labelBoxBorderColor};
1151
+ }
1152
+
1153
+ .note {
1154
+ //stroke: #decc93;
1155
+ stroke: ${e.noteBorderColor};
1156
+ fill: ${e.noteBkgColor};
1157
+ }
1158
+
1159
+ .noteText, .noteText > tspan {
1160
+ fill: ${e.noteTextColor};
1161
+ stroke: none;
1162
+ }
1163
+
1164
+ .activation0 {
1165
+ fill: ${e.activationBkgColor};
1166
+ stroke: ${e.activationBorderColor};
1167
+ }
1168
+
1169
+ .activation1 {
1170
+ fill: ${e.activationBkgColor};
1171
+ stroke: ${e.activationBorderColor};
1172
+ }
1173
+
1174
+ .activation2 {
1175
+ fill: ${e.activationBkgColor};
1176
+ stroke: ${e.activationBorderColor};
1177
+ }
1178
+
1179
+ .actorPopupMenu {
1180
+ position: absolute;
1181
+ }
1182
+
1183
+ .actorPopupMenuPanel {
1184
+ position: absolute;
1185
+ fill: ${e.actorBkg};
1186
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
1187
+ filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
1188
+ }
1189
+ .actor-man line {
1190
+ stroke: ${e.actorBorder};
1191
+ fill: ${e.actorBkg};
1192
+ }
1193
+ .actor-man circle, line {
1194
+ stroke: ${e.actorBorder};
1195
+ fill: ${e.actorBkg};
1196
+ stroke-width: 2px;
1197
+ }
1198
+
1199
+ `, "getStyles"), He = ze, Tt = 36, gt = "actor-top", xt = "actor-bottom", Ct = "actor-box", ut = "actor-man", Lt = /* @__PURE__ */ f(function(e, t) {
1200
+ return ve(e, t);
1201
+ }, "drawRect"), Ue = /* @__PURE__ */ f(function(e, t, n, s, r) {
1202
+ if (t.links === void 0 || t.links === null || Object.keys(t.links).length === 0)
1203
+ return { height: 0, width: 0 };
1204
+ const i = t.links, c = t.actorCnt, h = t.rectData;
1205
+ var o = "none";
1206
+ r && (o = "block !important");
1207
+ const a = e.append("g");
1208
+ a.attr("id", "actor" + c + "_popup"), a.attr("class", "actorPopupMenu"), a.attr("display", o);
1209
+ var p = "";
1210
+ h.class !== void 0 && (p = " " + h.class);
1211
+ let g = h.width > n ? h.width : n;
1212
+ const x = a.append("rect");
1213
+ if (x.attr("class", "actorPopupMenuPanel" + p), x.attr("x", h.x), x.attr("y", h.height), x.attr("fill", h.fill), x.attr("stroke", h.stroke), x.attr("width", g), x.attr("height", h.height), x.attr("rx", h.rx), x.attr("ry", h.ry), i != null) {
1214
+ var y = 20;
1215
+ for (let k in i) {
1216
+ var m = a.append("a"), w = re.sanitizeUrl(i[k]);
1217
+ m.attr("xlink:href", w), m.attr("target", "_blank"), us(s)(
1218
+ k,
1219
+ m,
1220
+ h.x + 10,
1221
+ h.height + y,
1222
+ g,
1223
+ 20,
1224
+ { class: "actor" },
1225
+ s
1226
+ ), y += 30;
1227
+ }
1228
+ }
1229
+ return x.attr("height", y), { height: h.height + y, width: g };
1230
+ }, "drawPopup"), Ot = /* @__PURE__ */ f(function(e) {
1231
+ return "var pu = document.getElementById('" + e + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }";
1232
+ }, "popupMenuToggle"), Dt = /* @__PURE__ */ f(async function(e, t, n = null) {
1233
+ let s = e.append("foreignObject");
1234
+ const r = await ne(t.text, Ht()), c = s.append("xhtml:div").attr("style", "width: fit-content;").attr("xmlns", "http://www.w3.org/1999/xhtml").html(r).node().getBoundingClientRect();
1235
+ if (s.attr("height", Math.round(c.height)).attr("width", Math.round(c.width)), t.class === "noteText") {
1236
+ const h = e.node().firstChild;
1237
+ h.setAttribute("height", c.height + 2 * t.textMargin);
1238
+ const o = h.getBBox();
1239
+ s.attr("x", Math.round(o.x + o.width / 2 - c.width / 2)).attr("y", Math.round(o.y + o.height / 2 - c.height / 2));
1240
+ } else if (n) {
1241
+ let { startx: h, stopx: o, starty: a } = n;
1242
+ if (h > o) {
1243
+ const p = h;
1244
+ h = o, o = p;
1245
+ }
1246
+ s.attr("x", Math.round(h + Math.abs(h - o) / 2 - c.width / 2)), t.class === "loopText" ? s.attr("y", Math.round(a)) : s.attr("y", Math.round(a - c.height));
1247
+ }
1248
+ return [s];
1249
+ }, "drawKatex"), vt = /* @__PURE__ */ f(function(e, t) {
1250
+ let n = 0, s = 0;
1251
+ const r = t.text.split(I.lineBreakRegex), [i, c] = ie(t.fontSize);
1252
+ let h = [], o = 0, a = /* @__PURE__ */ f(() => t.y, "yfunc");
1253
+ if (t.valign !== void 0 && t.textMargin !== void 0 && t.textMargin > 0)
1254
+ switch (t.valign) {
1255
+ case "top":
1256
+ case "start":
1257
+ a = /* @__PURE__ */ f(() => Math.round(t.y + t.textMargin), "yfunc");
1258
+ break;
1259
+ case "middle":
1260
+ case "center":
1261
+ a = /* @__PURE__ */ f(() => Math.round(t.y + (n + s + t.textMargin) / 2), "yfunc");
1262
+ break;
1263
+ case "bottom":
1264
+ case "end":
1265
+ a = /* @__PURE__ */ f(() => Math.round(
1266
+ t.y + (n + s + 2 * t.textMargin) - t.textMargin
1267
+ ), "yfunc");
1268
+ break;
1269
+ }
1270
+ if (t.anchor !== void 0 && t.textMargin !== void 0 && t.width !== void 0)
1271
+ switch (t.anchor) {
1272
+ case "left":
1273
+ case "start":
1274
+ t.x = Math.round(t.x + t.textMargin), t.anchor = "start", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1275
+ break;
1276
+ case "middle":
1277
+ case "center":
1278
+ t.x = Math.round(t.x + t.width / 2), t.anchor = "middle", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1279
+ break;
1280
+ case "right":
1281
+ case "end":
1282
+ t.x = Math.round(t.x + t.width - t.textMargin), t.anchor = "end", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1283
+ break;
1284
+ }
1285
+ for (let [p, g] of r.entries()) {
1286
+ t.textMargin !== void 0 && t.textMargin === 0 && i !== void 0 && (o = p * i);
1287
+ const x = e.append("text");
1288
+ x.attr("x", t.x), x.attr("y", a()), t.anchor !== void 0 && x.attr("text-anchor", t.anchor).attr("dominant-baseline", t.dominantBaseline).attr("alignment-baseline", t.alignmentBaseline), t.fontFamily !== void 0 && x.style("font-family", t.fontFamily), c !== void 0 && x.style("font-size", c), t.fontWeight !== void 0 && x.style("font-weight", t.fontWeight), t.fill !== void 0 && x.attr("fill", t.fill), t.class !== void 0 && x.attr("class", t.class), t.dy !== void 0 ? x.attr("dy", t.dy) : o !== 0 && x.attr("dy", o);
1289
+ const y = g || Ce;
1290
+ if (t.tspan) {
1291
+ const m = x.append("tspan");
1292
+ m.attr("x", t.x), t.fill !== void 0 && m.attr("fill", t.fill), m.text(y);
1293
+ } else
1294
+ x.text(y);
1295
+ t.valign !== void 0 && t.textMargin !== void 0 && t.textMargin > 0 && (s += (x._groups || x)[0][0].getBBox().height, n = s), h.push(x);
1296
+ }
1297
+ return h;
1298
+ }, "drawText"), oe = /* @__PURE__ */ f(function(e, t) {
1299
+ function n(r, i, c, h, o) {
1300
+ return r + "," + i + " " + (r + c) + "," + i + " " + (r + c) + "," + (i + h - o) + " " + (r + c - o * 1.2) + "," + (i + h) + " " + r + "," + (i + h);
1301
+ }
1302
+ f(n, "genPoints");
1303
+ const s = e.append("polygon");
1304
+ return s.attr("points", n(t.x, t.y, t.width, t.height, 7)), s.attr("class", "labelBox"), t.y = t.y + t.height / 2, vt(e, t), s;
1305
+ }, "drawLabel"), P = -1, ce = /* @__PURE__ */ f((e, t, n, s) => {
1306
+ e.select && n.forEach((r) => {
1307
+ const i = t.get(r), c = e.select("#actor" + i.actorCnt);
1308
+ !s.mirrorActors && i.stopy ? c.attr("y2", i.stopy + i.height / 2) : s.mirrorActors && c.attr("y2", i.stopy);
1309
+ });
1310
+ }, "fixLifeLineHeights"), Ge = /* @__PURE__ */ f(function(e, t, n, s) {
1311
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + t.height, h = e.append("g").lower();
1312
+ var o = h;
1313
+ s || (P++, Object.keys(t.links || {}).length && !n.forceMenus && o.attr("onclick", Ot(`actor${P}_popup`)).attr("cursor", "pointer"), o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), o = h.append("g"), t.actorCnt = P, t.links != null && o.attr("id", "root-" + P));
1314
+ const a = ct();
1315
+ var p = "actor";
1316
+ t.properties?.class ? p = t.properties.class : a.fill = "#eaeaea", s ? p += ` ${xt}` : p += ` ${gt}`, a.x = t.x, a.y = r, a.width = t.width, a.height = t.height, a.class = p, a.rx = 3, a.ry = 3, a.name = t.name;
1317
+ const g = Lt(o, a);
1318
+ if (t.rectData = a, t.properties?.icon) {
1319
+ const y = t.properties.icon.trim();
1320
+ y.charAt(0) === "@" ? Jt(o, a.x + a.width - 20, a.y + 10, y.substr(1)) : Qt(o, a.x + a.width - 20, a.y + 10, y);
1321
+ }
1322
+ dt(n, z(t.description))(
1323
+ t.description,
1324
+ o,
1325
+ a.x,
1326
+ a.y,
1327
+ a.width,
1328
+ a.height,
1329
+ { class: `actor ${Ct}` },
1330
+ n
1331
+ );
1332
+ let x = t.height;
1333
+ if (g.node) {
1334
+ const y = g.node().getBBox();
1335
+ t.height = y.height, x = y.height;
1336
+ }
1337
+ return x;
1338
+ }, "drawActorTypeParticipant"), Ke = /* @__PURE__ */ f(function(e, t, n, s) {
1339
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + t.height, h = e.append("g").lower();
1340
+ var o = h;
1341
+ s || (P++, Object.keys(t.links || {}).length && !n.forceMenus && o.attr("onclick", Ot(`actor${P}_popup`)).attr("cursor", "pointer"), o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), o = h.append("g"), t.actorCnt = P, t.links != null && o.attr("id", "root-" + P));
1342
+ const a = ct();
1343
+ var p = "actor";
1344
+ t.properties?.class ? p = t.properties.class : a.fill = "#eaeaea", s ? p += ` ${xt}` : p += ` ${gt}`, a.x = t.x, a.y = r, a.width = t.width, a.height = t.height, a.class = p, a.name = t.name;
1345
+ const g = 6, x = {
1346
+ ...a,
1347
+ x: a.x + -g,
1348
+ y: a.y + +g,
1349
+ class: "actor"
1350
+ }, y = Lt(o, a);
1351
+ if (Lt(o, x), t.rectData = a, t.properties?.icon) {
1352
+ const w = t.properties.icon.trim();
1353
+ w.charAt(0) === "@" ? Jt(o, a.x + a.width - 20, a.y + 10, w.substr(1)) : Qt(o, a.x + a.width - 20, a.y + 10, w);
1354
+ }
1355
+ dt(n, z(t.description))(
1356
+ t.description,
1357
+ o,
1358
+ a.x - g,
1359
+ a.y + g,
1360
+ a.width,
1361
+ a.height,
1362
+ { class: `actor ${Ct}` },
1363
+ n
1364
+ );
1365
+ let m = t.height;
1366
+ if (y.node) {
1367
+ const w = y.node().getBBox();
1368
+ t.height = w.height, m = w.height;
1369
+ }
1370
+ return m;
1371
+ }, "drawActorTypeCollections"), Xe = /* @__PURE__ */ f(function(e, t, n, s) {
1372
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + t.height, h = e.append("g").lower();
1373
+ let o = h;
1374
+ s || (P++, Object.keys(t.links || {}).length && !n.forceMenus && o.attr("onclick", Ot(`actor${P}_popup`)).attr("cursor", "pointer"), o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), o = h.append("g"), t.actorCnt = P, t.links != null && o.attr("id", "root-" + P));
1375
+ const a = ct();
1376
+ let p = "actor";
1377
+ t.properties?.class ? p = t.properties.class : a.fill = "#eaeaea", s ? p += ` ${xt}` : p += ` ${gt}`, a.x = t.x, a.y = r, a.width = t.width, a.height = t.height, a.class = p, a.name = t.name;
1378
+ const g = a.height / 2, x = g / (2.5 + a.height / 50), y = o.append("g"), m = o.append("g");
1379
+ if (y.append("path").attr(
1380
+ "d",
1381
+ `M ${a.x},${a.y + g}
1382
+ a ${x},${g} 0 0 0 0,${a.height}
1383
+ h ${a.width - 2 * x}
1384
+ a ${x},${g} 0 0 0 0,-${a.height}
1385
+ Z
1386
+ `
1387
+ ).attr("class", p), m.append("path").attr(
1388
+ "d",
1389
+ `M ${a.x},${a.y + g}
1390
+ a ${x},${g} 0 0 0 0,${a.height}`
1391
+ ).attr("stroke", "#666").attr("stroke-width", "1px").attr("class", p), y.attr("transform", `translate(${x}, ${-(a.height / 2)})`), m.attr("transform", `translate(${a.width - x}, ${-a.height / 2})`), t.rectData = a, t.properties?.icon) {
1392
+ const N = t.properties.icon.trim(), S = a.x + a.width - 20, O = a.y + 10;
1393
+ N.charAt(0) === "@" ? Jt(o, S, O, N.substr(1)) : Qt(o, S, O, N);
1394
+ }
1395
+ dt(n, z(t.description))(
1396
+ t.description,
1397
+ o,
1398
+ a.x,
1399
+ a.y,
1400
+ a.width,
1401
+ a.height,
1402
+ { class: `actor ${Ct}` },
1403
+ n
1404
+ );
1405
+ let w = t.height;
1406
+ const k = y.select("path:last-child");
1407
+ if (k.node()) {
1408
+ const N = k.node().getBBox();
1409
+ t.height = N.height, w = N.height;
1410
+ }
1411
+ return w;
1412
+ }, "drawActorTypeQueue"), Je = /* @__PURE__ */ f(function(e, t, n, s) {
1413
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + 75, h = e.append("g").lower();
1414
+ s || (P++, h.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = P);
1415
+ const o = e.append("g");
1416
+ let a = ut;
1417
+ s ? a += ` ${xt}` : a += ` ${gt}`, o.attr("class", a), o.attr("name", t.name);
1418
+ const p = ct();
1419
+ p.x = t.x, p.y = r, p.fill = "#eaeaea", p.width = t.width, p.height = t.height, p.class = "actor";
1420
+ const g = t.x + t.width / 2, x = r + 30, y = 18;
1421
+ o.append("defs").append("marker").attr("id", "filled-head-control").attr("refX", 11).attr("refY", 5.8).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "172.5").append("path").attr("d", "M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"), o.append("circle").attr("cx", g).attr("cy", x).attr("r", y).attr("fill", "#eaeaf7").attr("stroke", "#666").attr("stroke-width", 1.2), o.append("line").attr("marker-end", "url(#filled-head-control)").attr("transform", `translate(${g}, ${x - y})`);
1422
+ const m = o.node().getBBox();
1423
+ return t.height = m.height + 2 * (n?.sequence?.labelBoxHeight ?? 0), dt(n, z(t.description))(
1424
+ t.description,
1425
+ o,
1426
+ p.x,
1427
+ p.y + y + (s ? 5 : 10),
1428
+ p.width,
1429
+ p.height,
1430
+ { class: `actor ${ut}` },
1431
+ n
1432
+ ), t.height;
1433
+ }, "drawActorTypeControl"), Qe = /* @__PURE__ */ f(function(e, t, n, s) {
1434
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + 75, h = e.append("g").lower(), o = e.append("g");
1435
+ let a = ut;
1436
+ s ? a += ` ${xt}` : a += ` ${gt}`, o.attr("class", a), o.attr("name", t.name);
1437
+ const p = ct();
1438
+ p.x = t.x, p.y = r, p.fill = "#eaeaea", p.width = t.width, p.height = t.height, p.class = "actor";
1439
+ const g = t.x + t.width / 2, x = r + (s ? 10 : 25), y = 18;
1440
+ o.append("circle").attr("cx", g).attr("cy", x).attr("r", y).attr("width", t.width).attr("height", t.height), o.append("line").attr("x1", g - y).attr("x2", g + y).attr("y1", x + y).attr("y2", x + y).attr("stroke", "#333").attr("stroke-width", 2);
1441
+ const m = o.node().getBBox();
1442
+ return t.height = m.height + (n?.sequence?.labelBoxHeight ?? 0), s || (P++, h.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = P), dt(n, z(t.description))(
1443
+ t.description,
1444
+ o,
1445
+ p.x,
1446
+ p.y + (s ? (x - r + y - 5) / 2 : (x + y - r) / 2),
1447
+ p.width,
1448
+ p.height,
1449
+ { class: `actor ${ut}` },
1450
+ n
1451
+ ), s ? o.attr("transform", `translate(0, ${y / 2})`) : o.attr("transform", `translate(0, ${y / 2})`), t.height;
1452
+ }, "drawActorTypeEntity"), Ze = /* @__PURE__ */ f(function(e, t, n, s) {
1453
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + t.height + 2 * n.boxTextMargin, h = e.append("g").lower();
1454
+ let o = h;
1455
+ s || (P++, Object.keys(t.links || {}).length && !n.forceMenus && o.attr("onclick", Ot(`actor${P}_popup`)).attr("cursor", "pointer"), o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), o = h.append("g"), t.actorCnt = P, t.links != null && o.attr("id", "root-" + P));
1456
+ const a = ct();
1457
+ let p = "actor";
1458
+ t.properties?.class ? p = t.properties.class : a.fill = "#eaeaea", s ? p += ` ${xt}` : p += ` ${gt}`, a.x = t.x, a.y = r, a.width = t.width, a.height = t.height, a.class = p, a.name = t.name, a.x = t.x, a.y = r;
1459
+ const g = a.width / 4, x = a.width / 4, y = g / 2, m = y / (2.5 + g / 50), w = o.append("g"), k = `
1460
+ M ${a.x},${a.y + m}
1461
+ a ${y},${m} 0 0 0 ${g},0
1462
+ a ${y},${m} 0 0 0 -${g},0
1463
+ l 0,${x - 2 * m}
1464
+ a ${y},${m} 0 0 0 ${g},0
1465
+ l 0,-${x - 2 * m}
1466
+ `;
1467
+ w.append("path").attr("d", k).attr("fill", "#eaeaea").attr("stroke", "#000").attr("stroke-width", 1).attr("class", p), s ? w.attr("transform", `translate(${g * 1.5}, ${a.height / 4 - 2 * m})`) : w.attr("transform", `translate(${g * 1.5}, ${(a.height + m) / 4})`), t.rectData = a, dt(n, z(t.description))(
1468
+ t.description,
1469
+ o,
1470
+ a.x,
1471
+ a.y + (s ? (a.height + x) / 4 : (a.height + m) / 2),
1472
+ a.width,
1473
+ a.height,
1474
+ { class: `actor ${Ct}` },
1475
+ n
1476
+ );
1477
+ const N = w.select("path:last-child");
1478
+ if (N.node()) {
1479
+ const S = N.node().getBBox();
1480
+ t.height = S.height + (n.sequence.labelBoxHeight ?? 0);
1481
+ }
1482
+ return t.height;
1483
+ }, "drawActorTypeDatabase"), $e = /* @__PURE__ */ f(function(e, t, n, s) {
1484
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + 80, h = 30, o = e.append("g").lower();
1485
+ s || (P++, o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = P);
1486
+ const a = e.append("g");
1487
+ let p = ut;
1488
+ s ? p += ` ${xt}` : p += ` ${gt}`, a.attr("class", p), a.attr("name", t.name);
1489
+ const g = ct();
1490
+ g.x = t.x, g.y = r, g.fill = "#eaeaea", g.width = t.width, g.height = t.height, g.class = "actor", a.append("line").attr("id", "actor-man-torso" + P).attr("x1", t.x + t.width / 2 - h * 2.5).attr("y1", r + 10).attr("x2", t.x + t.width / 2 - 15).attr("y2", r + 10), a.append("line").attr("id", "actor-man-arms" + P).attr("x1", t.x + t.width / 2 - h * 2.5).attr("y1", r + 0).attr("x2", t.x + t.width / 2 - h * 2.5).attr("y2", r + 20), a.append("circle").attr("cx", t.x + t.width / 2).attr("cy", r + 10).attr("r", h);
1491
+ const x = a.node().getBBox();
1492
+ return t.height = x.height + (n.sequence.labelBoxHeight ?? 0), dt(n, z(t.description))(
1493
+ t.description,
1494
+ a,
1495
+ g.x,
1496
+ g.y + (s ? h / 2 - 4 : h / 2 + 3),
1497
+ g.width,
1498
+ g.height,
1499
+ { class: `actor ${ut}` },
1500
+ n
1501
+ ), s ? a.attr("transform", `translate(0,${h / 2 + 7})`) : a.attr("transform", `translate(0,${h / 2 + 7})`), t.height;
1502
+ }, "drawActorTypeBoundary"), je = /* @__PURE__ */ f(function(e, t, n, s) {
1503
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + 80, h = e.append("g").lower();
1504
+ s || (P++, h.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = P);
1505
+ const o = e.append("g");
1506
+ let a = ut;
1507
+ s ? a += ` ${xt}` : a += ` ${gt}`, o.attr("class", a), o.attr("name", t.name);
1508
+ const p = ct();
1509
+ p.x = t.x, p.y = r, p.fill = "#eaeaea", p.width = t.width, p.height = t.height, p.class = "actor", p.rx = 3, p.ry = 3, o.append("line").attr("id", "actor-man-torso" + P).attr("x1", i).attr("y1", r + 25).attr("x2", i).attr("y2", r + 45), o.append("line").attr("id", "actor-man-arms" + P).attr("x1", i - Tt / 2).attr("y1", r + 33).attr("x2", i + Tt / 2).attr("y2", r + 33), o.append("line").attr("x1", i - Tt / 2).attr("y1", r + 60).attr("x2", i).attr("y2", r + 45), o.append("line").attr("x1", i).attr("y1", r + 45).attr("x2", i + Tt / 2 - 2).attr("y2", r + 60);
1510
+ const g = o.append("circle");
1511
+ g.attr("cx", t.x + t.width / 2), g.attr("cy", r + 10), g.attr("r", 15), g.attr("width", t.width), g.attr("height", t.height);
1512
+ const x = o.node().getBBox();
1513
+ return t.height = x.height, dt(n, z(t.description))(
1514
+ t.description,
1515
+ o,
1516
+ p.x,
1517
+ p.y + 35,
1518
+ p.width,
1519
+ p.height,
1520
+ { class: `actor ${ut}` },
1521
+ n
1522
+ ), t.height;
1523
+ }, "drawActorTypeActor"), ts = /* @__PURE__ */ f(async function(e, t, n, s) {
1524
+ switch (t.type) {
1525
+ case "actor":
1526
+ return await je(e, t, n, s);
1527
+ case "participant":
1528
+ return await Ge(e, t, n, s);
1529
+ case "boundary":
1530
+ return await $e(e, t, n, s);
1531
+ case "control":
1532
+ return await Je(e, t, n, s);
1533
+ case "entity":
1534
+ return await Qe(e, t, n, s);
1535
+ case "database":
1536
+ return await Ze(e, t, n, s);
1537
+ case "collections":
1538
+ return await Ke(e, t, n, s);
1539
+ case "queue":
1540
+ return await Xe(e, t, n, s);
1541
+ }
1542
+ }, "drawActor"), es = /* @__PURE__ */ f(function(e, t, n) {
1543
+ const r = e.append("g");
1544
+ le(r, t), t.name && dt(n)(
1545
+ t.name,
1546
+ r,
1547
+ t.x,
1548
+ t.y + n.boxTextMargin + (t.textMaxHeight || 0) / 2,
1549
+ t.width,
1550
+ 0,
1551
+ { class: "text" },
1552
+ n
1553
+ ), r.lower();
1554
+ }, "drawBox"), ss = /* @__PURE__ */ f(function(e) {
1555
+ return e.append("g");
1556
+ }, "anchorElement"), as = /* @__PURE__ */ f(function(e, t, n, s, r) {
1557
+ const i = ct(), c = t.anchored;
1558
+ i.x = t.startx, i.y = t.starty, i.class = "activation" + r % 3, i.width = t.stopx - t.startx, i.height = n - t.starty, Lt(c, i);
1559
+ }, "drawActivation"), rs = /* @__PURE__ */ f(async function(e, t, n, s) {
1560
+ const {
1561
+ boxMargin: r,
1562
+ boxTextMargin: i,
1563
+ labelBoxHeight: c,
1564
+ labelBoxWidth: h,
1565
+ messageFontFamily: o,
1566
+ messageFontSize: a,
1567
+ messageFontWeight: p
1568
+ } = s, g = e.append("g"), x = /* @__PURE__ */ f(function(w, k, N, S) {
1569
+ return g.append("line").attr("x1", w).attr("y1", k).attr("x2", N).attr("y2", S).attr("class", "loopLine");
1570
+ }, "drawLoopLine");
1571
+ x(t.startx, t.starty, t.stopx, t.starty), x(t.stopx, t.starty, t.stopx, t.stopy), x(t.startx, t.stopy, t.stopx, t.stopy), x(t.startx, t.starty, t.startx, t.stopy), t.sections !== void 0 && t.sections.forEach(function(w) {
1572
+ x(t.startx, w.y, t.stopx, w.y).style(
1573
+ "stroke-dasharray",
1574
+ "3, 3"
1575
+ );
1576
+ });
1577
+ let y = Xt();
1578
+ y.text = n, y.x = t.startx, y.y = t.starty, y.fontFamily = o, y.fontSize = a, y.fontWeight = p, y.anchor = "middle", y.valign = "middle", y.tspan = !1, y.width = h || 50, y.height = c || 20, y.textMargin = i, y.class = "labelText", oe(g, y), y = he(), y.text = t.title, y.x = t.startx + h / 2 + (t.stopx - t.startx) / 2, y.y = t.starty + r + i, y.anchor = "middle", y.valign = "middle", y.textMargin = i, y.class = "loopText", y.fontFamily = o, y.fontSize = a, y.fontWeight = p, y.wrap = !0;
1579
+ let m = z(y.text) ? await Dt(g, y, t) : vt(g, y);
1580
+ if (t.sectionTitles !== void 0) {
1581
+ for (const [w, k] of Object.entries(t.sectionTitles))
1582
+ if (k.message) {
1583
+ y.text = k.message, y.x = t.startx + (t.stopx - t.startx) / 2, y.y = t.sections[w].y + r + i, y.class = "loopText", y.anchor = "middle", y.valign = "middle", y.tspan = !1, y.fontFamily = o, y.fontSize = a, y.fontWeight = p, y.wrap = t.wrap, z(y.text) ? (t.starty = t.sections[w].y, await Dt(g, y, t)) : vt(g, y);
1584
+ let N = Math.round(
1585
+ m.map((S) => (S._groups || S)[0][0].getBBox().height).reduce((S, O) => S + O)
1586
+ );
1587
+ t.sections[w].height += N - (r + i);
1588
+ }
1589
+ }
1590
+ return t.height = Math.round(t.stopy - t.starty), g;
1591
+ }, "drawLoop"), le = /* @__PURE__ */ f(function(e, t) {
1592
+ we(e, t);
1593
+ }, "drawBackgroundRect"), is = /* @__PURE__ */ f(function(e) {
1594
+ e.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1595
+ "d",
1596
+ "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"
1597
+ );
1598
+ }, "insertDatabaseIcon"), ns = /* @__PURE__ */ f(function(e) {
1599
+ e.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1600
+ "d",
1601
+ "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"
1602
+ );
1603
+ }, "insertComputerIcon"), os = /* @__PURE__ */ f(function(e) {
1604
+ e.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1605
+ "d",
1606
+ "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"
1607
+ );
1608
+ }, "insertClockIcon"), cs = /* @__PURE__ */ f(function(e) {
1609
+ e.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");
1610
+ }, "insertArrowHead"), ls = /* @__PURE__ */ f(function(e) {
1611
+ e.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");
1612
+ }, "insertArrowFilledHead"), hs = /* @__PURE__ */ f(function(e) {
1613
+ e.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);
1614
+ }, "insertSequenceNumber"), ds = /* @__PURE__ */ f(function(e) {
1615
+ e.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");
1616
+ }, "insertArrowCrossHead"), he = /* @__PURE__ */ f(function() {
1617
+ return {
1618
+ x: 0,
1619
+ y: 0,
1620
+ fill: void 0,
1621
+ anchor: void 0,
1622
+ style: "#666",
1623
+ width: void 0,
1624
+ height: void 0,
1625
+ textMargin: 0,
1626
+ rx: 0,
1627
+ ry: 0,
1628
+ tspan: !0,
1629
+ valign: void 0
1630
+ };
1631
+ }, "getTextObj"), ps = /* @__PURE__ */ f(function() {
1632
+ return {
1633
+ x: 0,
1634
+ y: 0,
1635
+ fill: "#EDF2AE",
1636
+ stroke: "#666",
1637
+ width: 100,
1638
+ anchor: "start",
1639
+ height: 100,
1640
+ rx: 0,
1641
+ ry: 0
1642
+ };
1643
+ }, "getNoteRect"), dt = /* @__PURE__ */ (function() {
1644
+ function e(i, c, h, o, a, p, g) {
1645
+ const x = c.append("text").attr("x", h + a / 2).attr("y", o + p / 2 + 5).style("text-anchor", "middle").text(i);
1646
+ r(x, g);
1647
+ }
1648
+ f(e, "byText");
1649
+ function t(i, c, h, o, a, p, g, x) {
1650
+ const { actorFontSize: y, actorFontFamily: m, actorFontWeight: w } = x, [k, N] = ie(y), S = i.split(I.lineBreakRegex);
1651
+ for (let O = 0; O < S.length; O++) {
1652
+ const B = O * k - k * (S.length - 1) / 2, q = c.append("text").attr("x", h + a / 2).attr("y", o).style("text-anchor", "middle").style("font-size", N).style("font-weight", w).style("font-family", m);
1653
+ q.append("tspan").attr("x", h + a / 2).attr("dy", B).text(S[O]), q.attr("y", o + p / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), r(q, g);
1654
+ }
1655
+ }
1656
+ f(t, "byTspan");
1657
+ function n(i, c, h, o, a, p, g, x) {
1658
+ const y = c.append("switch"), w = y.append("foreignObject").attr("x", h).attr("y", o).attr("width", a).attr("height", p).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1659
+ w.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(i), t(i, y, h, o, a, p, g, x), r(w, g);
1660
+ }
1661
+ f(n, "byFo");
1662
+ async function s(i, c, h, o, a, p, g, x) {
1663
+ const y = await _t(i, Ht()), m = c.append("switch"), k = m.append("foreignObject").attr("x", h + a / 2 - y.width / 2).attr("y", o + p / 2 - y.height / 2).attr("width", y.width).attr("height", y.height).append("xhtml:div").style("height", "100%").style("width", "100%");
1664
+ k.append("div").style("text-align", "center").style("vertical-align", "middle").html(await ne(i, Ht())), t(i, m, h, o, a, p, g, x), r(k, g);
1665
+ }
1666
+ f(s, "byKatex");
1667
+ function r(i, c) {
1668
+ for (const h in c)
1669
+ c.hasOwnProperty(h) && i.attr(h, c[h]);
1670
+ }
1671
+ return f(r, "_setTextAttrs"), function(i, c = !1) {
1672
+ return c ? s : i.textPlacement === "fo" ? n : i.textPlacement === "old" ? e : t;
1673
+ };
1674
+ })(), us = /* @__PURE__ */ (function() {
1675
+ function e(r, i, c, h, o, a, p) {
1676
+ const g = i.append("text").attr("x", c).attr("y", h).style("text-anchor", "start").text(r);
1677
+ s(g, p);
1678
+ }
1679
+ f(e, "byText");
1680
+ function t(r, i, c, h, o, a, p, g) {
1681
+ const { actorFontSize: x, actorFontFamily: y, actorFontWeight: m } = g, w = r.split(I.lineBreakRegex);
1682
+ for (let k = 0; k < w.length; k++) {
1683
+ const N = k * x - x * (w.length - 1) / 2, S = i.append("text").attr("x", c).attr("y", h).style("text-anchor", "start").style("font-size", x).style("font-weight", m).style("font-family", y);
1684
+ S.append("tspan").attr("x", c).attr("dy", N).text(w[k]), S.attr("y", h + a / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), s(S, p);
1685
+ }
1686
+ }
1687
+ f(t, "byTspan");
1688
+ function n(r, i, c, h, o, a, p, g) {
1689
+ const x = i.append("switch"), m = x.append("foreignObject").attr("x", c).attr("y", h).attr("width", o).attr("height", a).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1690
+ m.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(r), t(r, x, c, h, o, a, p, g), s(m, p);
1691
+ }
1692
+ f(n, "byFo");
1693
+ function s(r, i) {
1694
+ for (const c in i)
1695
+ i.hasOwnProperty(c) && r.attr(c, i[c]);
1696
+ }
1697
+ return f(s, "_setTextAttrs"), function(r) {
1698
+ return r.textPlacement === "fo" ? n : r.textPlacement === "old" ? e : t;
1699
+ };
1700
+ })(), V = {
1701
+ drawRect: Lt,
1702
+ drawText: vt,
1703
+ drawLabel: oe,
1704
+ drawActor: ts,
1705
+ drawBox: es,
1706
+ drawPopup: Ue,
1707
+ anchorElement: ss,
1708
+ drawActivation: as,
1709
+ drawLoop: rs,
1710
+ drawBackgroundRect: le,
1711
+ insertArrowHead: cs,
1712
+ insertArrowFilledHead: ls,
1713
+ insertSequenceNumber: hs,
1714
+ insertArrowCrossHead: ds,
1715
+ insertDatabaseIcon: is,
1716
+ insertComputerIcon: ns,
1717
+ insertClockIcon: os,
1718
+ getTextObj: he,
1719
+ getNoteRect: ps,
1720
+ fixLifeLineHeights: ce,
1721
+ sanitizeUrl: re.sanitizeUrl
1722
+ }, l = {}, T = {
1723
+ data: {
1724
+ startx: void 0,
1725
+ stopx: void 0,
1726
+ starty: void 0,
1727
+ stopy: void 0
1728
+ },
1729
+ verticalPos: 0,
1730
+ sequenceItems: [],
1731
+ activations: [],
1732
+ models: {
1733
+ getHeight: /* @__PURE__ */ f(function() {
1734
+ return Math.max.apply(
1735
+ null,
1736
+ this.actors.length === 0 ? [0] : this.actors.map((e) => e.height || 0)
1737
+ ) + (this.loops.length === 0 ? 0 : this.loops.map((e) => e.height || 0).reduce((e, t) => e + t)) + (this.messages.length === 0 ? 0 : this.messages.map((e) => e.height || 0).reduce((e, t) => e + t)) + (this.notes.length === 0 ? 0 : this.notes.map((e) => e.height || 0).reduce((e, t) => e + t));
1738
+ }, "getHeight"),
1739
+ clear: /* @__PURE__ */ f(function() {
1740
+ this.actors = [], this.boxes = [], this.loops = [], this.messages = [], this.notes = [];
1741
+ }, "clear"),
1742
+ addBox: /* @__PURE__ */ f(function(e) {
1743
+ this.boxes.push(e);
1744
+ }, "addBox"),
1745
+ addActor: /* @__PURE__ */ f(function(e) {
1746
+ this.actors.push(e);
1747
+ }, "addActor"),
1748
+ addLoop: /* @__PURE__ */ f(function(e) {
1749
+ this.loops.push(e);
1750
+ }, "addLoop"),
1751
+ addMessage: /* @__PURE__ */ f(function(e) {
1752
+ this.messages.push(e);
1753
+ }, "addMessage"),
1754
+ addNote: /* @__PURE__ */ f(function(e) {
1755
+ this.notes.push(e);
1756
+ }, "addNote"),
1757
+ lastActor: /* @__PURE__ */ f(function() {
1758
+ return this.actors[this.actors.length - 1];
1759
+ }, "lastActor"),
1760
+ lastLoop: /* @__PURE__ */ f(function() {
1761
+ return this.loops[this.loops.length - 1];
1762
+ }, "lastLoop"),
1763
+ lastMessage: /* @__PURE__ */ f(function() {
1764
+ return this.messages[this.messages.length - 1];
1765
+ }, "lastMessage"),
1766
+ lastNote: /* @__PURE__ */ f(function() {
1767
+ return this.notes[this.notes.length - 1];
1768
+ }, "lastNote"),
1769
+ actors: [],
1770
+ boxes: [],
1771
+ loops: [],
1772
+ messages: [],
1773
+ notes: []
1774
+ },
1775
+ init: /* @__PURE__ */ f(function() {
1776
+ this.sequenceItems = [], this.activations = [], this.models.clear(), this.data = {
1777
+ startx: void 0,
1778
+ stopx: void 0,
1779
+ starty: void 0,
1780
+ stopy: void 0
1781
+ }, this.verticalPos = 0, ue(st());
1782
+ }, "init"),
1783
+ updateVal: /* @__PURE__ */ f(function(e, t, n, s) {
1784
+ e[t] === void 0 ? e[t] = n : e[t] = s(n, e[t]);
1785
+ }, "updateVal"),
1786
+ updateBounds: /* @__PURE__ */ f(function(e, t, n, s) {
1787
+ const r = this;
1788
+ let i = 0;
1789
+ function c(h) {
1790
+ return /* @__PURE__ */ f(function(a) {
1791
+ i++;
1792
+ const p = r.sequenceItems.length - i + 1;
1793
+ r.updateVal(a, "starty", t - p * l.boxMargin, Math.min), r.updateVal(a, "stopy", s + p * l.boxMargin, Math.max), r.updateVal(T.data, "startx", e - p * l.boxMargin, Math.min), r.updateVal(T.data, "stopx", n + p * l.boxMargin, Math.max), h !== "activation" && (r.updateVal(a, "startx", e - p * l.boxMargin, Math.min), r.updateVal(a, "stopx", n + p * l.boxMargin, Math.max), r.updateVal(T.data, "starty", t - p * l.boxMargin, Math.min), r.updateVal(T.data, "stopy", s + p * l.boxMargin, Math.max));
1794
+ }, "updateItemBounds");
1795
+ }
1796
+ f(c, "updateFn"), this.sequenceItems.forEach(c()), this.activations.forEach(c("activation"));
1797
+ }, "updateBounds"),
1798
+ insert: /* @__PURE__ */ f(function(e, t, n, s) {
1799
+ const r = I.getMin(e, n), i = I.getMax(e, n), c = I.getMin(t, s), h = I.getMax(t, s);
1800
+ this.updateVal(T.data, "startx", r, Math.min), this.updateVal(T.data, "starty", c, Math.min), this.updateVal(T.data, "stopx", i, Math.max), this.updateVal(T.data, "stopy", h, Math.max), this.updateBounds(r, c, i, h);
1801
+ }, "insert"),
1802
+ newActivation: /* @__PURE__ */ f(function(e, t, n) {
1803
+ const s = n.get(e.from), r = Bt(e.from).length || 0, i = s.x + s.width / 2 + (r - 1) * l.activationWidth / 2;
1804
+ this.activations.push({
1805
+ startx: i,
1806
+ starty: this.verticalPos + 2,
1807
+ stopx: i + l.activationWidth,
1808
+ stopy: void 0,
1809
+ actor: e.from,
1810
+ anchored: V.anchorElement(t)
1811
+ });
1812
+ }, "newActivation"),
1813
+ endActivation: /* @__PURE__ */ f(function(e) {
1814
+ const t = this.activations.map(function(n) {
1815
+ return n.actor;
1816
+ }).lastIndexOf(e.from);
1817
+ return this.activations.splice(t, 1)[0];
1818
+ }, "endActivation"),
1819
+ createLoop: /* @__PURE__ */ f(function(e = { message: void 0, wrap: !1, width: void 0 }, t) {
1820
+ return {
1821
+ startx: void 0,
1822
+ starty: this.verticalPos,
1823
+ stopx: void 0,
1824
+ stopy: void 0,
1825
+ title: e.message,
1826
+ wrap: e.wrap,
1827
+ width: e.width,
1828
+ height: 0,
1829
+ fill: t
1830
+ };
1831
+ }, "createLoop"),
1832
+ newLoop: /* @__PURE__ */ f(function(e = { message: void 0, wrap: !1, width: void 0 }, t) {
1833
+ this.sequenceItems.push(this.createLoop(e, t));
1834
+ }, "newLoop"),
1835
+ endLoop: /* @__PURE__ */ f(function() {
1836
+ return this.sequenceItems.pop();
1837
+ }, "endLoop"),
1838
+ isLoopOverlap: /* @__PURE__ */ f(function() {
1839
+ return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : !1;
1840
+ }, "isLoopOverlap"),
1841
+ addSectionToLoop: /* @__PURE__ */ f(function(e) {
1842
+ const t = this.sequenceItems.pop();
1843
+ t.sections = t.sections || [], t.sectionTitles = t.sectionTitles || [], t.sections.push({ y: T.getVerticalPos(), height: 0 }), t.sectionTitles.push(e), this.sequenceItems.push(t);
1844
+ }, "addSectionToLoop"),
1845
+ saveVerticalPos: /* @__PURE__ */ f(function() {
1846
+ this.isLoopOverlap() && (this.savedVerticalPos = this.verticalPos);
1847
+ }, "saveVerticalPos"),
1848
+ resetVerticalPos: /* @__PURE__ */ f(function() {
1849
+ this.isLoopOverlap() && (this.verticalPos = this.savedVerticalPos);
1850
+ }, "resetVerticalPos"),
1851
+ bumpVerticalPos: /* @__PURE__ */ f(function(e) {
1852
+ this.verticalPos = this.verticalPos + e, this.data.stopy = I.getMax(this.data.stopy, this.verticalPos);
1853
+ }, "bumpVerticalPos"),
1854
+ getVerticalPos: /* @__PURE__ */ f(function() {
1855
+ return this.verticalPos;
1856
+ }, "getVerticalPos"),
1857
+ getBounds: /* @__PURE__ */ f(function() {
1858
+ return { bounds: this.data, models: this.models };
1859
+ }, "getBounds")
1860
+ }, gs = /* @__PURE__ */ f(async function(e, t) {
1861
+ T.bumpVerticalPos(l.boxMargin), t.height = l.boxMargin, t.starty = T.getVerticalPos();
1862
+ const n = ct();
1863
+ n.x = t.startx, n.y = t.starty, n.width = t.width || l.width, n.class = "note";
1864
+ const s = e.append("g"), r = V.drawRect(s, n), i = Xt();
1865
+ i.x = t.startx, i.y = t.starty, i.width = n.width, i.dy = "1em", i.text = t.message, i.class = "noteText", i.fontFamily = l.noteFontFamily, i.fontSize = l.noteFontSize, i.fontWeight = l.noteFontWeight, i.anchor = l.noteAlign, i.textMargin = l.noteMargin, i.valign = "center";
1866
+ const c = z(i.text) ? await Dt(s, i) : vt(s, i), h = Math.round(
1867
+ c.map((o) => (o._groups || o)[0][0].getBBox().height).reduce((o, a) => o + a)
1868
+ );
1869
+ r.attr("height", h + 2 * l.noteMargin), t.height += h + 2 * l.noteMargin, T.bumpVerticalPos(h + 2 * l.noteMargin), t.stopy = t.starty + h + 2 * l.noteMargin, t.stopx = t.startx + n.width, T.insert(t.startx, t.starty, t.stopx, t.stopy), T.models.addNote(t);
1870
+ }, "drawNote"), Et = /* @__PURE__ */ f((e) => ({
1871
+ fontFamily: e.messageFontFamily,
1872
+ fontSize: e.messageFontSize,
1873
+ fontWeight: e.messageFontWeight
1874
+ }), "messageFont"), mt = /* @__PURE__ */ f((e) => ({
1875
+ fontFamily: e.noteFontFamily,
1876
+ fontSize: e.noteFontSize,
1877
+ fontWeight: e.noteFontWeight
1878
+ }), "noteFont"), Gt = /* @__PURE__ */ f((e) => ({
1879
+ fontFamily: e.actorFontFamily,
1880
+ fontSize: e.actorFontSize,
1881
+ fontWeight: e.actorFontWeight
1882
+ }), "actorFont");
1883
+ async function de(e, t) {
1884
+ T.bumpVerticalPos(10);
1885
+ const { startx: n, stopx: s, message: r } = t, i = I.splitBreaks(r).length, c = z(r), h = c ? await _t(r, st()) : W.calculateTextDimensions(r, Et(l));
1886
+ if (!c) {
1887
+ const g = h.height / i;
1888
+ t.height += g, T.bumpVerticalPos(g);
1889
+ }
1890
+ let o, a = h.height - 10;
1891
+ const p = h.width;
1892
+ if (n === s) {
1893
+ o = T.getVerticalPos() + a, l.rightAngles || (a += l.boxMargin, o = T.getVerticalPos() + a), a += 30;
1894
+ const g = I.getMax(p / 2, l.width / 2);
1895
+ T.insert(
1896
+ n - g,
1897
+ T.getVerticalPos() - 10 + a,
1898
+ s + g,
1899
+ T.getVerticalPos() + 30 + a
1900
+ );
1901
+ } else
1902
+ a += l.boxMargin, o = T.getVerticalPos() + a, T.insert(n, o - 10, s, o);
1903
+ return T.bumpVerticalPos(a), t.height += a, t.stopy = t.starty + t.height, T.insert(t.fromBounds, t.starty, t.toBounds, t.stopy), o;
1904
+ }
1905
+ f(de, "boundMessage");
1906
+ var xs = /* @__PURE__ */ f(async function(e, t, n, s) {
1907
+ const { startx: r, stopx: i, starty: c, message: h, type: o, sequenceIndex: a, sequenceVisible: p } = t, g = W.calculateTextDimensions(h, Et(l)), x = Xt();
1908
+ x.x = r, x.y = c + 10, x.width = i - r, x.class = "messageText", x.dy = "1em", x.text = h, x.fontFamily = l.messageFontFamily, x.fontSize = l.messageFontSize, x.fontWeight = l.messageFontWeight, x.anchor = l.messageAlign, x.valign = "center", x.textMargin = l.wrapPadding, x.tspan = !1, z(x.text) ? await Dt(e, x, { startx: r, stopx: i, starty: n }) : vt(e, x);
1909
+ const y = g.width;
1910
+ let m;
1911
+ r === i ? l.rightAngles ? m = e.append("path").attr(
1912
+ "d",
1913
+ `M ${r},${n} H ${r + I.getMax(l.width / 2, y / 2)} V ${n + 25} H ${r}`
1914
+ ) : m = e.append("path").attr(
1915
+ "d",
1916
+ "M " + r + "," + n + " C " + (r + 60) + "," + (n - 10) + " " + (r + 60) + "," + (n + 30) + " " + r + "," + (n + 20)
1917
+ ) : (m = e.append("line"), m.attr("x1", r), m.attr("y1", n), m.attr("x2", i), m.attr("y2", n)), o === s.db.LINETYPE.DOTTED || o === s.db.LINETYPE.DOTTED_CROSS || o === s.db.LINETYPE.DOTTED_POINT || o === s.db.LINETYPE.DOTTED_OPEN || o === s.db.LINETYPE.BIDIRECTIONAL_DOTTED ? (m.style("stroke-dasharray", "3, 3"), m.attr("class", "messageLine1")) : m.attr("class", "messageLine0");
1918
+ let w = "";
1919
+ l.arrowMarkerAbsolute && (w = Oe(!0)), m.attr("stroke-width", 2), m.attr("stroke", "none"), m.style("fill", "none"), (o === s.db.LINETYPE.SOLID || o === s.db.LINETYPE.DOTTED) && m.attr("marker-end", "url(" + w + "#arrowhead)"), (o === s.db.LINETYPE.BIDIRECTIONAL_SOLID || o === s.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (m.attr("marker-start", "url(" + w + "#arrowhead)"), m.attr("marker-end", "url(" + w + "#arrowhead)")), (o === s.db.LINETYPE.SOLID_POINT || o === s.db.LINETYPE.DOTTED_POINT) && m.attr("marker-end", "url(" + w + "#filled-head)"), (o === s.db.LINETYPE.SOLID_CROSS || o === s.db.LINETYPE.DOTTED_CROSS) && m.attr("marker-end", "url(" + w + "#crosshead)"), (p || l.showSequenceNumbers) && ((o === s.db.LINETYPE.BIDIRECTIONAL_SOLID || o === s.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (r < i ? m.attr("x1", r + 12) : m.attr("x1", r + 6)), e.append("line").attr("x1", r).attr("y1", n).attr("x2", r).attr("y2", n).attr("stroke-width", 0).attr("marker-start", "url(" + w + "#sequencenumber)"), e.append("text").attr("x", r).attr("y", n + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(a));
1920
+ }, "drawMessage"), fs = /* @__PURE__ */ f(function(e, t, n, s, r, i, c) {
1921
+ let h = 0, o = 0, a, p = 0;
1922
+ for (const g of s) {
1923
+ const x = t.get(g), y = x.box;
1924
+ a && a != y && (c || T.models.addBox(a), o += l.boxMargin + a.margin), y && y != a && (c || (y.x = h + o, y.y = r), o += y.margin), x.width = x.width || l.width, x.height = I.getMax(x.height || l.height, l.height), x.margin = x.margin || l.actorMargin, p = I.getMax(p, x.height), n.get(x.name) && (o += x.width / 2), x.x = h + o, x.starty = T.getVerticalPos(), T.insert(x.x, r, x.x + x.width, x.height), h += x.width + o, x.box && (x.box.width = h + y.margin - x.box.x), o = x.margin, a = x.box, T.models.addActor(x);
1925
+ }
1926
+ a && !c && T.models.addBox(a), T.bumpVerticalPos(p);
1927
+ }, "addActorRenderingData"), Kt = /* @__PURE__ */ f(async function(e, t, n, s) {
1928
+ if (s) {
1929
+ let r = 0;
1930
+ T.bumpVerticalPos(l.boxMargin * 2);
1931
+ for (const i of n) {
1932
+ const c = t.get(i);
1933
+ c.stopy || (c.stopy = T.getVerticalPos());
1934
+ const h = await V.drawActor(e, c, l, !0);
1935
+ r = I.getMax(r, h);
1936
+ }
1937
+ T.bumpVerticalPos(r + l.boxMargin);
1938
+ } else
1939
+ for (const r of n) {
1940
+ const i = t.get(r);
1941
+ await V.drawActor(e, i, l, !1);
1942
+ }
1943
+ }, "drawActors"), pe = /* @__PURE__ */ f(function(e, t, n, s) {
1944
+ let r = 0, i = 0;
1945
+ for (const c of n) {
1946
+ const h = t.get(c), o = Ts(h), a = V.drawPopup(
1947
+ e,
1948
+ h,
1949
+ o,
1950
+ l,
1951
+ l.forceMenus,
1952
+ s
1953
+ );
1954
+ a.height > r && (r = a.height), a.width + h.x > i && (i = a.width + h.x);
1955
+ }
1956
+ return { maxHeight: r, maxWidth: i };
1957
+ }, "drawActorsPopup"), ue = /* @__PURE__ */ f(function(e) {
1958
+ _e(l, e), e.fontFamily && (l.actorFontFamily = l.noteFontFamily = l.messageFontFamily = e.fontFamily), e.fontSize && (l.actorFontSize = l.noteFontSize = l.messageFontSize = e.fontSize), e.fontWeight && (l.actorFontWeight = l.noteFontWeight = l.messageFontWeight = e.fontWeight);
1959
+ }, "setConf"), Bt = /* @__PURE__ */ f(function(e) {
1960
+ return T.activations.filter(function(t) {
1961
+ return t.actor === e;
1962
+ });
1963
+ }, "actorActivations"), ae = /* @__PURE__ */ f(function(e, t) {
1964
+ const n = t.get(e), s = Bt(e), r = s.reduce(
1965
+ function(c, h) {
1966
+ return I.getMin(c, h.startx);
1967
+ },
1968
+ n.x + n.width / 2 - 1
1969
+ ), i = s.reduce(
1970
+ function(c, h) {
1971
+ return I.getMax(c, h.stopx);
1972
+ },
1973
+ n.x + n.width / 2 + 1
1974
+ );
1975
+ return [r, i];
1976
+ }, "activationBounds");
1977
+ function nt(e, t, n, s, r) {
1978
+ T.bumpVerticalPos(n);
1979
+ let i = s;
1980
+ if (t.id && t.message && e[t.id]) {
1981
+ const c = e[t.id].width, h = Et(l);
1982
+ t.message = W.wrapLabel(`[${t.message}]`, c - 2 * l.wrapPadding, h), t.width = c, t.wrap = !0;
1983
+ const o = W.calculateTextDimensions(t.message, h), a = I.getMax(o.height, l.labelBoxHeight);
1984
+ i = s + a, Q.debug(`${a} - ${t.message}`);
1985
+ }
1986
+ r(t), T.bumpVerticalPos(i);
1987
+ }
1988
+ f(nt, "adjustLoopHeightForWrap");
1989
+ function ge(e, t, n, s, r, i, c) {
1990
+ function h(p, g) {
1991
+ p.x < r.get(e.from).x ? (T.insert(
1992
+ t.stopx - g,
1993
+ t.starty,
1994
+ t.startx,
1995
+ t.stopy + p.height / 2 + l.noteMargin
1996
+ ), t.stopx = t.stopx + g) : (T.insert(
1997
+ t.startx,
1998
+ t.starty,
1999
+ t.stopx + g,
2000
+ t.stopy + p.height / 2 + l.noteMargin
2001
+ ), t.stopx = t.stopx - g);
2002
+ }
2003
+ f(h, "receiverAdjustment");
2004
+ function o(p, g) {
2005
+ p.x < r.get(e.to).x ? (T.insert(
2006
+ t.startx - g,
2007
+ t.starty,
2008
+ t.stopx,
2009
+ t.stopy + p.height / 2 + l.noteMargin
2010
+ ), t.startx = t.startx + g) : (T.insert(
2011
+ t.stopx,
2012
+ t.starty,
2013
+ t.startx + g,
2014
+ t.stopy + p.height / 2 + l.noteMargin
2015
+ ), t.startx = t.startx - g);
2016
+ }
2017
+ f(o, "senderAdjustment");
2018
+ const a = [
2019
+ Rt.ACTOR,
2020
+ Rt.CONTROL,
2021
+ Rt.ENTITY,
2022
+ Rt.DATABASE
2023
+ ];
2024
+ if (i.get(e.to) == s) {
2025
+ const p = r.get(e.to), g = a.includes(p.type) ? Tt / 2 + 3 : p.width / 2 + 3;
2026
+ h(p, g), p.starty = n - p.height / 2, T.bumpVerticalPos(p.height / 2);
2027
+ } else if (c.get(e.from) == s) {
2028
+ const p = r.get(e.from);
2029
+ if (l.mirrorActors) {
2030
+ const g = a.includes(p.type) ? Tt / 2 : p.width / 2;
2031
+ o(p, g);
2032
+ }
2033
+ p.stopy = n - p.height / 2, T.bumpVerticalPos(p.height / 2);
2034
+ } else if (c.get(e.to) == s) {
2035
+ const p = r.get(e.to);
2036
+ if (l.mirrorActors) {
2037
+ const g = a.includes(p.type) ? Tt / 2 + 3 : p.width / 2 + 3;
2038
+ h(p, g);
2039
+ }
2040
+ p.stopy = n - p.height / 2, T.bumpVerticalPos(p.height / 2);
2041
+ }
2042
+ }
2043
+ f(ge, "adjustCreatedDestroyedData");
2044
+ var ys = /* @__PURE__ */ f(async function(e, t, n, s) {
2045
+ const { securityLevel: r, sequence: i } = st();
2046
+ l = i;
2047
+ let c;
2048
+ r === "sandbox" && (c = St("#i" + t));
2049
+ const h = r === "sandbox" ? St(c.nodes()[0].contentDocument.body) : St("body"), o = r === "sandbox" ? c.nodes()[0].contentDocument : document;
2050
+ T.init(), Q.debug(s.db);
2051
+ const a = r === "sandbox" ? h.select(`[id="${t}"]`) : St(`[id="${t}"]`), p = s.db.getActors(), g = s.db.getCreatedActors(), x = s.db.getDestroyedActors(), y = s.db.getBoxes();
2052
+ let m = s.db.getActorKeys();
2053
+ const w = s.db.getMessages(), k = s.db.getDiagramTitle(), N = s.db.hasAtLeastOneBox(), S = s.db.hasAtLeastOneBoxWithTitle(), O = await xe(p, w, s);
2054
+ if (l.height = await fe(p, O, y), V.insertComputerIcon(a), V.insertDatabaseIcon(a), V.insertClockIcon(a), N && (T.bumpVerticalPos(l.boxMargin), S && T.bumpVerticalPos(y[0].textMaxHeight)), l.hideUnusedParticipants === !0) {
2055
+ const E = /* @__PURE__ */ new Set();
2056
+ w.forEach((_) => {
2057
+ E.add(_.from), E.add(_.to);
2058
+ }), m = m.filter((_) => E.has(_));
2059
+ }
2060
+ fs(a, p, g, m, 0, w, !1);
2061
+ const B = await ms(w, p, O, s);
2062
+ V.insertArrowHead(a), V.insertArrowCrossHead(a), V.insertArrowFilledHead(a), V.insertSequenceNumber(a);
2063
+ function q(E, _) {
2064
+ const X = T.endActivation(E);
2065
+ X.starty + 18 > _ && (X.starty = _ - 6, _ += 12), V.drawActivation(
2066
+ a,
2067
+ X,
2068
+ _,
2069
+ l,
2070
+ Bt(E.from).length
2071
+ ), T.insert(X.startx, _ - 10, X.stopx, _);
2072
+ }
2073
+ f(q, "activeEnd");
2074
+ let H = 1, Z = 1;
2075
+ const at = [], U = [];
2076
+ let G = 0;
2077
+ for (const E of w) {
2078
+ let _, X, tt;
2079
+ switch (E.type) {
2080
+ case s.db.LINETYPE.NOTE:
2081
+ T.resetVerticalPos(), X = E.noteModel, await gs(a, X);
2082
+ break;
2083
+ case s.db.LINETYPE.ACTIVE_START:
2084
+ T.newActivation(E, a, p);
2085
+ break;
2086
+ case s.db.LINETYPE.ACTIVE_END:
2087
+ q(E, T.getVerticalPos());
2088
+ break;
2089
+ case s.db.LINETYPE.LOOP_START:
2090
+ nt(
2091
+ B,
2092
+ E,
2093
+ l.boxMargin,
2094
+ l.boxMargin + l.boxTextMargin,
2095
+ (M) => T.newLoop(M)
2096
+ );
2097
+ break;
2098
+ case s.db.LINETYPE.LOOP_END:
2099
+ _ = T.endLoop(), await V.drawLoop(a, _, "loop", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2100
+ break;
2101
+ case s.db.LINETYPE.RECT_START:
2102
+ nt(
2103
+ B,
2104
+ E,
2105
+ l.boxMargin,
2106
+ l.boxMargin,
2107
+ (M) => T.newLoop(void 0, M.message)
2108
+ );
2109
+ break;
2110
+ case s.db.LINETYPE.RECT_END:
2111
+ _ = T.endLoop(), U.push(_), T.models.addLoop(_), T.bumpVerticalPos(_.stopy - T.getVerticalPos());
2112
+ break;
2113
+ case s.db.LINETYPE.OPT_START:
2114
+ nt(
2115
+ B,
2116
+ E,
2117
+ l.boxMargin,
2118
+ l.boxMargin + l.boxTextMargin,
2119
+ (M) => T.newLoop(M)
2120
+ );
2121
+ break;
2122
+ case s.db.LINETYPE.OPT_END:
2123
+ _ = T.endLoop(), await V.drawLoop(a, _, "opt", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2124
+ break;
2125
+ case s.db.LINETYPE.ALT_START:
2126
+ nt(
2127
+ B,
2128
+ E,
2129
+ l.boxMargin,
2130
+ l.boxMargin + l.boxTextMargin,
2131
+ (M) => T.newLoop(M)
2132
+ );
2133
+ break;
2134
+ case s.db.LINETYPE.ALT_ELSE:
2135
+ nt(
2136
+ B,
2137
+ E,
2138
+ l.boxMargin + l.boxTextMargin,
2139
+ l.boxMargin,
2140
+ (M) => T.addSectionToLoop(M)
2141
+ );
2142
+ break;
2143
+ case s.db.LINETYPE.ALT_END:
2144
+ _ = T.endLoop(), await V.drawLoop(a, _, "alt", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2145
+ break;
2146
+ case s.db.LINETYPE.PAR_START:
2147
+ case s.db.LINETYPE.PAR_OVER_START:
2148
+ nt(
2149
+ B,
2150
+ E,
2151
+ l.boxMargin,
2152
+ l.boxMargin + l.boxTextMargin,
2153
+ (M) => T.newLoop(M)
2154
+ ), T.saveVerticalPos();
2155
+ break;
2156
+ case s.db.LINETYPE.PAR_AND:
2157
+ nt(
2158
+ B,
2159
+ E,
2160
+ l.boxMargin + l.boxTextMargin,
2161
+ l.boxMargin,
2162
+ (M) => T.addSectionToLoop(M)
2163
+ );
2164
+ break;
2165
+ case s.db.LINETYPE.PAR_END:
2166
+ _ = T.endLoop(), await V.drawLoop(a, _, "par", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2167
+ break;
2168
+ case s.db.LINETYPE.AUTONUMBER:
2169
+ H = E.message.start || H, Z = E.message.step || Z, E.message.visible ? s.db.enableSequenceNumbers() : s.db.disableSequenceNumbers();
2170
+ break;
2171
+ case s.db.LINETYPE.CRITICAL_START:
2172
+ nt(
2173
+ B,
2174
+ E,
2175
+ l.boxMargin,
2176
+ l.boxMargin + l.boxTextMargin,
2177
+ (M) => T.newLoop(M)
2178
+ );
2179
+ break;
2180
+ case s.db.LINETYPE.CRITICAL_OPTION:
2181
+ nt(
2182
+ B,
2183
+ E,
2184
+ l.boxMargin + l.boxTextMargin,
2185
+ l.boxMargin,
2186
+ (M) => T.addSectionToLoop(M)
2187
+ );
2188
+ break;
2189
+ case s.db.LINETYPE.CRITICAL_END:
2190
+ _ = T.endLoop(), await V.drawLoop(a, _, "critical", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2191
+ break;
2192
+ case s.db.LINETYPE.BREAK_START:
2193
+ nt(
2194
+ B,
2195
+ E,
2196
+ l.boxMargin,
2197
+ l.boxMargin + l.boxTextMargin,
2198
+ (M) => T.newLoop(M)
2199
+ );
2200
+ break;
2201
+ case s.db.LINETYPE.BREAK_END:
2202
+ _ = T.endLoop(), await V.drawLoop(a, _, "break", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2203
+ break;
2204
+ default:
2205
+ try {
2206
+ tt = E.msgModel, tt.starty = T.getVerticalPos(), tt.sequenceIndex = H, tt.sequenceVisible = s.db.showSequenceNumbers();
2207
+ const M = await de(a, tt);
2208
+ ge(
2209
+ E,
2210
+ tt,
2211
+ M,
2212
+ G,
2213
+ p,
2214
+ g,
2215
+ x
2216
+ ), at.push({ messageModel: tt, lineStartY: M }), T.models.addMessage(tt);
2217
+ } catch (M) {
2218
+ Q.error("error while drawing message", M);
2219
+ }
2220
+ }
2221
+ [
2222
+ s.db.LINETYPE.SOLID_OPEN,
2223
+ s.db.LINETYPE.DOTTED_OPEN,
2224
+ s.db.LINETYPE.SOLID,
2225
+ s.db.LINETYPE.DOTTED,
2226
+ s.db.LINETYPE.SOLID_CROSS,
2227
+ s.db.LINETYPE.DOTTED_CROSS,
2228
+ s.db.LINETYPE.SOLID_POINT,
2229
+ s.db.LINETYPE.DOTTED_POINT,
2230
+ s.db.LINETYPE.BIDIRECTIONAL_SOLID,
2231
+ s.db.LINETYPE.BIDIRECTIONAL_DOTTED
2232
+ ].includes(E.type) && (H = H + Z), G++;
2233
+ }
2234
+ Q.debug("createdActors", g), Q.debug("destroyedActors", x), await Kt(a, p, m, !1);
2235
+ for (const E of at)
2236
+ await xs(a, E.messageModel, E.lineStartY, s);
2237
+ l.mirrorActors && await Kt(a, p, m, !0), U.forEach((E) => V.drawBackgroundRect(a, E)), ce(a, p, m, l);
2238
+ for (const E of T.models.boxes) {
2239
+ E.height = T.getVerticalPos() - E.y, T.insert(E.x, E.y, E.x + E.width, E.height);
2240
+ const _ = l.boxMargin * 2;
2241
+ E.startx = E.x - _, E.starty = E.y - _ * 0.25, E.stopx = E.startx + E.width + 2 * _, E.stopy = E.starty + E.height + _ * 0.75, E.stroke = "rgb(0,0,0, 0.5)", V.drawBox(a, E, l);
2242
+ }
2243
+ N && T.bumpVerticalPos(l.boxMargin);
2244
+ const F = pe(a, p, m, o), { bounds: D } = T.getBounds();
2245
+ D.startx === void 0 && (D.startx = 0), D.starty === void 0 && (D.starty = 0), D.stopx === void 0 && (D.stopx = 0), D.stopy === void 0 && (D.stopy = 0);
2246
+ let $ = D.stopy - D.starty;
2247
+ $ < F.maxHeight && ($ = F.maxHeight);
2248
+ let K = $ + 2 * l.diagramMarginY;
2249
+ l.mirrorActors && (K = K - l.boxMargin + l.bottomMarginAdj);
2250
+ let j = D.stopx - D.startx;
2251
+ j < F.maxWidth && (j = F.maxWidth);
2252
+ const rt = j + 2 * l.diagramMarginX;
2253
+ k && a.append("text").text(k).attr("x", (D.stopx - D.startx) / 2 - 2 * l.diagramMarginX).attr("y", -25), Le(a, K, rt, l.useMaxWidth);
2254
+ const R = k ? 40 : 0;
2255
+ a.attr(
2256
+ "viewBox",
2257
+ D.startx - l.diagramMarginX + " -" + (l.diagramMarginY + R) + " " + rt + " " + (K + R)
2258
+ ), Q.debug("models:", T.models);
2259
+ }, "draw");
2260
+ async function xe(e, t, n) {
2261
+ const s = {};
2262
+ for (const r of t)
2263
+ if (e.get(r.to) && e.get(r.from)) {
2264
+ const i = e.get(r.to);
2265
+ if (r.placement === n.db.PLACEMENT.LEFTOF && !i.prevActor || r.placement === n.db.PLACEMENT.RIGHTOF && !i.nextActor)
2266
+ continue;
2267
+ const c = r.placement !== void 0, h = !c, o = c ? mt(l) : Et(l), a = r.wrap ? W.wrapLabel(r.message, l.width - 2 * l.wrapPadding, o) : r.message, g = (z(a) ? await _t(r.message, st()) : W.calculateTextDimensions(a, o)).width + 2 * l.wrapPadding;
2268
+ h && r.from === i.nextActor ? s[r.to] = I.getMax(
2269
+ s[r.to] || 0,
2270
+ g
2271
+ ) : h && r.from === i.prevActor ? s[r.from] = I.getMax(
2272
+ s[r.from] || 0,
2273
+ g
2274
+ ) : h && r.from === r.to ? (s[r.from] = I.getMax(
2275
+ s[r.from] || 0,
2276
+ g / 2
2277
+ ), s[r.to] = I.getMax(
2278
+ s[r.to] || 0,
2279
+ g / 2
2280
+ )) : r.placement === n.db.PLACEMENT.RIGHTOF ? s[r.from] = I.getMax(
2281
+ s[r.from] || 0,
2282
+ g
2283
+ ) : r.placement === n.db.PLACEMENT.LEFTOF ? s[i.prevActor] = I.getMax(
2284
+ s[i.prevActor] || 0,
2285
+ g
2286
+ ) : r.placement === n.db.PLACEMENT.OVER && (i.prevActor && (s[i.prevActor] = I.getMax(
2287
+ s[i.prevActor] || 0,
2288
+ g / 2
2289
+ )), i.nextActor && (s[r.from] = I.getMax(
2290
+ s[r.from] || 0,
2291
+ g / 2
2292
+ )));
2293
+ }
2294
+ return Q.debug("maxMessageWidthPerActor:", s), s;
2295
+ }
2296
+ f(xe, "getMaxMessageWidthPerActor");
2297
+ var Ts = /* @__PURE__ */ f(function(e) {
2298
+ let t = 0;
2299
+ const n = Gt(l);
2300
+ for (const s in e.links) {
2301
+ const i = W.calculateTextDimensions(s, n).width + 2 * l.wrapPadding + 2 * l.boxMargin;
2302
+ t < i && (t = i);
2303
+ }
2304
+ return t;
2305
+ }, "getRequiredPopupWidth");
2306
+ async function fe(e, t, n) {
2307
+ let s = 0;
2308
+ for (const i of e.keys()) {
2309
+ const c = e.get(i);
2310
+ c.wrap && (c.description = W.wrapLabel(
2311
+ c.description,
2312
+ l.width - 2 * l.wrapPadding,
2313
+ Gt(l)
2314
+ ));
2315
+ const h = z(c.description) ? await _t(c.description, st()) : W.calculateTextDimensions(c.description, Gt(l));
2316
+ c.width = c.wrap ? l.width : I.getMax(l.width, h.width + 2 * l.wrapPadding), c.height = c.wrap ? I.getMax(h.height, l.height) : l.height, s = I.getMax(s, c.height);
2317
+ }
2318
+ for (const i in t) {
2319
+ const c = e.get(i);
2320
+ if (!c)
2321
+ continue;
2322
+ const h = e.get(c.nextActor);
2323
+ if (!h) {
2324
+ const g = t[i] + l.actorMargin - c.width / 2;
2325
+ c.margin = I.getMax(g, l.actorMargin);
2326
+ continue;
2327
+ }
2328
+ const a = t[i] + l.actorMargin - c.width / 2 - h.width / 2;
2329
+ c.margin = I.getMax(a, l.actorMargin);
2330
+ }
2331
+ let r = 0;
2332
+ return n.forEach((i) => {
2333
+ const c = Et(l);
2334
+ let h = i.actorKeys.reduce((g, x) => g += e.get(x).width + (e.get(x).margin || 0), 0);
2335
+ const o = l.boxMargin * 8;
2336
+ h += o, h -= 2 * l.boxTextMargin, i.wrap && (i.name = W.wrapLabel(i.name, h - 2 * l.wrapPadding, c));
2337
+ const a = W.calculateTextDimensions(i.name, c);
2338
+ r = I.getMax(a.height, r);
2339
+ const p = I.getMax(h, a.width + 2 * l.wrapPadding);
2340
+ if (i.margin = l.boxTextMargin, h < p) {
2341
+ const g = (p - h) / 2;
2342
+ i.margin += g;
2343
+ }
2344
+ }), n.forEach((i) => i.textMaxHeight = r), I.getMax(s, l.height);
2345
+ }
2346
+ f(fe, "calculateActorMargins");
2347
+ var Es = /* @__PURE__ */ f(async function(e, t, n) {
2348
+ const s = t.get(e.from), r = t.get(e.to), i = s.x, c = r.x, h = e.wrap && e.message;
2349
+ let o = z(e.message) ? await _t(e.message, st()) : W.calculateTextDimensions(
2350
+ h ? W.wrapLabel(e.message, l.width, mt(l)) : e.message,
2351
+ mt(l)
2352
+ );
2353
+ const a = {
2354
+ width: h ? l.width : I.getMax(l.width, o.width + 2 * l.noteMargin),
2355
+ height: 0,
2356
+ startx: s.x,
2357
+ stopx: 0,
2358
+ starty: 0,
2359
+ stopy: 0,
2360
+ message: e.message
2361
+ };
2362
+ return e.placement === n.db.PLACEMENT.RIGHTOF ? (a.width = h ? I.getMax(l.width, o.width) : I.getMax(
2363
+ s.width / 2 + r.width / 2,
2364
+ o.width + 2 * l.noteMargin
2365
+ ), a.startx = i + (s.width + l.actorMargin) / 2) : e.placement === n.db.PLACEMENT.LEFTOF ? (a.width = h ? I.getMax(l.width, o.width + 2 * l.noteMargin) : I.getMax(
2366
+ s.width / 2 + r.width / 2,
2367
+ o.width + 2 * l.noteMargin
2368
+ ), a.startx = i - a.width + (s.width - l.actorMargin) / 2) : e.to === e.from ? (o = W.calculateTextDimensions(
2369
+ h ? W.wrapLabel(e.message, I.getMax(l.width, s.width), mt(l)) : e.message,
2370
+ mt(l)
2371
+ ), a.width = h ? I.getMax(l.width, s.width) : I.getMax(s.width, l.width, o.width + 2 * l.noteMargin), a.startx = i + (s.width - a.width) / 2) : (a.width = Math.abs(i + s.width / 2 - (c + r.width / 2)) + l.actorMargin, a.startx = i < c ? i + s.width / 2 - l.actorMargin / 2 : c + r.width / 2 - l.actorMargin / 2), h && (a.message = W.wrapLabel(
2372
+ e.message,
2373
+ a.width - 2 * l.wrapPadding,
2374
+ mt(l)
2375
+ )), Q.debug(
2376
+ `NM:[${a.startx},${a.stopx},${a.starty},${a.stopy}:${a.width},${a.height}=${e.message}]`
2377
+ ), a;
2378
+ }, "buildNoteModel"), bs = /* @__PURE__ */ f(function(e, t, n) {
2379
+ if (![
2380
+ n.db.LINETYPE.SOLID_OPEN,
2381
+ n.db.LINETYPE.DOTTED_OPEN,
2382
+ n.db.LINETYPE.SOLID,
2383
+ n.db.LINETYPE.DOTTED,
2384
+ n.db.LINETYPE.SOLID_CROSS,
2385
+ n.db.LINETYPE.DOTTED_CROSS,
2386
+ n.db.LINETYPE.SOLID_POINT,
2387
+ n.db.LINETYPE.DOTTED_POINT,
2388
+ n.db.LINETYPE.BIDIRECTIONAL_SOLID,
2389
+ n.db.LINETYPE.BIDIRECTIONAL_DOTTED
2390
+ ].includes(e.type))
2391
+ return {};
2392
+ const [s, r] = ae(e.from, t), [i, c] = ae(e.to, t), h = s <= i;
2393
+ let o = h ? r : s, a = h ? i : c;
2394
+ const p = Math.abs(i - c) > 2, g = /* @__PURE__ */ f((w) => h ? -w : w, "adjustValue");
2395
+ e.from === e.to ? a = o : (e.activate && !p && (a += g(l.activationWidth / 2 - 1)), [n.db.LINETYPE.SOLID_OPEN, n.db.LINETYPE.DOTTED_OPEN].includes(e.type) || (a += g(3)), [n.db.LINETYPE.BIDIRECTIONAL_SOLID, n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(
2396
+ e.type
2397
+ ) && (o -= g(3)));
2398
+ const x = [s, r, i, c], y = Math.abs(o - a);
2399
+ e.wrap && e.message && (e.message = W.wrapLabel(
2400
+ e.message,
2401
+ I.getMax(y + 2 * l.wrapPadding, l.width),
2402
+ Et(l)
2403
+ ));
2404
+ const m = W.calculateTextDimensions(e.message, Et(l));
2405
+ return {
2406
+ width: I.getMax(
2407
+ e.wrap ? 0 : m.width + 2 * l.wrapPadding,
2408
+ y + 2 * l.wrapPadding,
2409
+ l.width
2410
+ ),
2411
+ height: 0,
2412
+ startx: o,
2413
+ stopx: a,
2414
+ starty: 0,
2415
+ stopy: 0,
2416
+ message: e.message,
2417
+ type: e.type,
2418
+ wrap: e.wrap,
2419
+ fromBounds: Math.min.apply(null, x),
2420
+ toBounds: Math.max.apply(null, x)
2421
+ };
2422
+ }, "buildMessageModel"), ms = /* @__PURE__ */ f(async function(e, t, n, s) {
2423
+ const r = {}, i = [];
2424
+ let c, h, o;
2425
+ for (const a of e) {
2426
+ switch (a.type) {
2427
+ case s.db.LINETYPE.LOOP_START:
2428
+ case s.db.LINETYPE.ALT_START:
2429
+ case s.db.LINETYPE.OPT_START:
2430
+ case s.db.LINETYPE.PAR_START:
2431
+ case s.db.LINETYPE.PAR_OVER_START:
2432
+ case s.db.LINETYPE.CRITICAL_START:
2433
+ case s.db.LINETYPE.BREAK_START:
2434
+ i.push({
2435
+ id: a.id,
2436
+ msg: a.message,
2437
+ from: Number.MAX_SAFE_INTEGER,
2438
+ to: Number.MIN_SAFE_INTEGER,
2439
+ width: 0
2440
+ });
2441
+ break;
2442
+ case s.db.LINETYPE.ALT_ELSE:
2443
+ case s.db.LINETYPE.PAR_AND:
2444
+ case s.db.LINETYPE.CRITICAL_OPTION:
2445
+ a.message && (c = i.pop(), r[c.id] = c, r[a.id] = c, i.push(c));
2446
+ break;
2447
+ case s.db.LINETYPE.LOOP_END:
2448
+ case s.db.LINETYPE.ALT_END:
2449
+ case s.db.LINETYPE.OPT_END:
2450
+ case s.db.LINETYPE.PAR_END:
2451
+ case s.db.LINETYPE.CRITICAL_END:
2452
+ case s.db.LINETYPE.BREAK_END:
2453
+ c = i.pop(), r[c.id] = c;
2454
+ break;
2455
+ case s.db.LINETYPE.ACTIVE_START:
2456
+ {
2457
+ const g = t.get(a.from ? a.from : a.to.actor), x = Bt(a.from ? a.from : a.to.actor).length, y = g.x + g.width / 2 + (x - 1) * l.activationWidth / 2, m = {
2458
+ startx: y,
2459
+ stopx: y + l.activationWidth,
2460
+ actor: a.from,
2461
+ enabled: !0
2462
+ };
2463
+ T.activations.push(m);
2464
+ }
2465
+ break;
2466
+ case s.db.LINETYPE.ACTIVE_END:
2467
+ {
2468
+ const g = T.activations.map((x) => x.actor).lastIndexOf(a.from);
2469
+ T.activations.splice(g, 1).splice(0, 1);
2470
+ }
2471
+ break;
2472
+ }
2473
+ a.placement !== void 0 ? (h = await Es(a, t, s), a.noteModel = h, i.forEach((g) => {
2474
+ c = g, c.from = I.getMin(c.from, h.startx), c.to = I.getMax(c.to, h.startx + h.width), c.width = I.getMax(c.width, Math.abs(c.from - c.to)) - l.labelBoxWidth;
2475
+ })) : (o = bs(a, t, s), a.msgModel = o, o.startx && o.stopx && i.length > 0 && i.forEach((g) => {
2476
+ if (c = g, o.startx === o.stopx) {
2477
+ const x = t.get(a.from), y = t.get(a.to);
2478
+ c.from = I.getMin(
2479
+ x.x - o.width / 2,
2480
+ x.x - x.width / 2,
2481
+ c.from
2482
+ ), c.to = I.getMax(
2483
+ y.x + o.width / 2,
2484
+ y.x + x.width / 2,
2485
+ c.to
2486
+ ), c.width = I.getMax(c.width, Math.abs(c.to - c.from)) - l.labelBoxWidth;
2487
+ } else
2488
+ c.from = I.getMin(o.startx, c.from), c.to = I.getMax(o.stopx, c.to), c.width = I.getMax(c.width, o.width) - l.labelBoxWidth;
2489
+ }));
2490
+ }
2491
+ return T.activations = [], Q.debug("Loop type widths:", r), r;
2492
+ }, "calculateLoopBounds"), ws = {
2493
+ bounds: T,
2494
+ drawActors: Kt,
2495
+ drawActorsPopup: pe,
2496
+ setConf: ue,
2497
+ draw: ys
2498
+ }, _s = {
2499
+ parser: Ve,
2500
+ get db() {
2501
+ return new qe();
2502
+ },
2503
+ renderer: ws,
2504
+ styles: He,
2505
+ init: /* @__PURE__ */ f((e) => {
2506
+ e.sequence || (e.sequence = {}), e.wrap && (e.sequence.wrap = e.wrap, Ie({ sequence: { wrap: e.wrap } }));
2507
+ }, "init")
2508
+ };
2509
+ export {
2510
+ _s as diagram
2511
+ };