@sourcegraph/amp 0.0.1749571294-gef5aa3 → 0.0.1749600114-g5c00b8

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