hub-ui-x 0.0.1

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 (65) hide show
  1. package/README.md +5 -0
  2. package/dist/_basePickBy-C1WsytTM.js +151 -0
  3. package/dist/_baseUniq-CGQBVjq6.js +614 -0
  4. package/dist/arc-CfWEFjh8.js +84 -0
  5. package/dist/architecture-4AB2E3PP-DcT_AgQk.js +5 -0
  6. package/dist/architectureDiagram-IEHRJDOE-HOxolPJX.js +4635 -0
  7. package/dist/blockDiagram-JOT3LUYC-DOUpbN2x.js +2248 -0
  8. package/dist/c4Diagram-VJAJSXHY-BFAcC0i5.js +1582 -0
  9. package/dist/channel-Cu0z2gst.js +5 -0
  10. package/dist/chart-CJ_SRNKN.js +9241 -0
  11. package/dist/chunk-4BMEZGHF-BBaiA8MA.js +9 -0
  12. package/dist/chunk-A2AXSNBT-BWpKSYi4.js +1373 -0
  13. package/dist/chunk-AEK57VVT-doTsaHuQ.js +1415 -0
  14. package/dist/chunk-D6G4REZN-B6Iq6yid.js +64 -0
  15. package/dist/chunk-RZ5BOZE2-OspkSZtw.js +25 -0
  16. package/dist/chunk-XZIHB7SX-BTYIr8g5.js +15 -0
  17. package/dist/classDiagram-GIVACNV2-B_ES2mS7.js +17 -0
  18. package/dist/classDiagram-v2-COTLJTTW-B_ES2mS7.js +17 -0
  19. package/dist/clone-BZBtMp_G.js +8 -0
  20. package/dist/colors-BD7LS4qt.js +7 -0
  21. package/dist/cytoscape.esm-Swd9B-1A.js +18633 -0
  22. package/dist/dagre-OKDRZEBW-qXmKnSET.js +447 -0
  23. package/dist/diagram-SSKATNLV-D9zp03W0.js +221 -0
  24. package/dist/diagram-VNBRO52H-CBXg8AYQ.js +126 -0
  25. package/dist/download-B6Cbg_6N.js +39 -0
  26. package/dist/echarts-CvKQD1G1.js +44028 -0
  27. package/dist/erDiagram-Q7BY3M3F-BOJJGO7u.js +842 -0
  28. package/dist/flowDiagram-4HSFHLVR-jSArwKHg.js +1623 -0
  29. package/dist/ganttDiagram-APWFNJXF-DlkSU7D9.js +2472 -0
  30. package/dist/gitGraph-O2Q2CXLX-BKCeQqs8.js +5 -0
  31. package/dist/gitGraphDiagram-7IBYFJ6S-DUvZEq_S.js +713 -0
  32. package/dist/graph-zFu0gYaZ.js +247 -0
  33. package/dist/helper-C5NlRbA2.js +13 -0
  34. package/dist/hub-ui-x.css +1 -0
  35. package/dist/hub-ui-x.es.ts +5 -0
  36. package/dist/hub-ui-x.umd.ts +3258 -0
  37. package/dist/index-evjDGH2n.js +62533 -0
  38. package/dist/info-4N47QTOZ-BYDGL7Ae.js +5 -0
  39. package/dist/infoDiagram-PH2N3AL5-DJvDYk-t.js +22 -0
  40. package/dist/init-DjUOC4st.js +16 -0
  41. package/dist/journeyDiagram-U35MCT3I---dClVe4.js +810 -0
  42. package/dist/kanban-definition-NDS4AKOZ-DPL_aBPT.js +719 -0
  43. package/dist/katex-9tX9hjoM.js +11692 -0
  44. package/dist/layout-BqSq5ofg.js +1324 -0
  45. package/dist/linear-fJjgKrP9.js +423 -0
  46. package/dist/mermaid-CZvYCPmi.js +14243 -0
  47. package/dist/mermaid-parser.core-Bz7ADZ88.js +12835 -0
  48. package/dist/min-DLf0xQMm.js +28 -0
  49. package/dist/mindmap-definition-ALO5MXBD-CzxIzyQv.js +3222 -0
  50. package/dist/mindmap-r94UHoYv.js +21909 -0
  51. package/dist/ordinal-DfAQgscy.js +61 -0
  52. package/dist/packet-KVYON367-D4di2cz5.js +5 -0
  53. package/dist/pie-R6RNRRYF-CcxAsT3F.js +5 -0
  54. package/dist/pieDiagram-IB7DONF6-B5HBkGlO.js +162 -0
  55. package/dist/quadrantDiagram-7GDLP6J5-BS5bmqKW.js +1025 -0
  56. package/dist/radar-MK3ICKWK-CVYy5goT.js +5 -0
  57. package/dist/requirementDiagram-KVF5MWMF-Cr8GcN4Y.js +851 -0
  58. package/dist/sankeyDiagram-QLVOVGJD-Bhq9k8_q.js +806 -0
  59. package/dist/sequenceDiagram-X6HHIX6F-CCmFoYyv.js +2282 -0
  60. package/dist/stateDiagram-DGXRK772-JkIqKyGq.js +271 -0
  61. package/dist/stateDiagram-v2-YXO3MK2T-DMxAxUZ1.js +17 -0
  62. package/dist/timeline-definition-BDJGKUSR-Bi42udQn.js +805 -0
  63. package/dist/transform-Bsa6BTXX.js +1834 -0
  64. package/dist/xychartDiagram-VJFVF3MP-BI97ppBM.js +1305 -0
  65. package/package.json +55 -0
@@ -0,0 +1,2282 @@
1
+ import { a as xe, b as Yt, g as At, d as Te, c as ye, e as Ee } from "./chunk-D6G4REZN-B6Iq6yid.js";
2
+ import { I as be } from "./chunk-XZIHB7SX-BTYIr8g5.js";
3
+ import { _ as u, m as me, c as $, l as G, i as Zt, d as we, e as ve, j as I, b as Gt, s as Ie, o as Le, a as _e, g as Pe, p as Ae, x as ke, h as Lt, u as Y, K as ot, L as bt, M as Qt, Z as Ne, N as jt, D as Ct } from "./mermaid-CZvYCPmi.js";
4
+ import { s as _t } from "./transform-Bsa6BTXX.js";
5
+ var Ot = function() {
6
+ var e = /* @__PURE__ */ u(function(ht, v, L, P) {
7
+ for (L = L || {}, P = ht.length; P--; L[ht[P]] = v) ;
8
+ return L;
9
+ }, "o"), t = [1, 2], c = [1, 3], s = [1, 4], a = [2, 4], i = [1, 9], n = [1, 11], h = [1, 13], d = [1, 14], r = [1, 16], f = [1, 17], E = [1, 18], g = [1, 24], T = [1, 25], m = [1, 26], w = [1, 27], A = [1, 28], O = [1, 29], S = [1, 30], B = [1, 31], D = [1, 32], F = [1, 33], q = [1, 34], X = [1, 35], tt = [1, 36], z = [1, 37], H = [1, 38], W = [1, 39], M = [1, 41], J = [1, 42], K = [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], qt = [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], Nt = {
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(v, L, P, b, R, l, Et) {
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: t, 5: c, 6: s }, { 1: [3] }, { 3: 5, 4: t, 5: c, 6: s }, { 3: 6, 4: t, 5: c, 6: s }, e([1, 4, 5, 13, 14, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], a, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: i, 5: n, 8: 8, 9: 10, 12: 12, 13: h, 14: d, 17: 15, 18: r, 21: f, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: T, 31: m, 33: w, 35: A, 36: O, 37: S, 38: B, 39: D, 41: F, 43: q, 44: X, 46: tt, 50: z, 52: H, 53: W, 54: M, 59: J, 60: K, 61: Z, 62: et, 70: N }, e(y, [2, 5]), { 9: 47, 12: 12, 13: h, 14: d, 17: 15, 18: r, 21: f, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: T, 31: m, 33: w, 35: A, 36: O, 37: S, 38: B, 39: D, 41: F, 43: q, 44: X, 46: tt, 50: z, 52: H, 53: W, 54: M, 59: J, 60: K, 61: Z, 62: et, 70: N }, e(y, [2, 7]), e(y, [2, 8]), e(y, [2, 14]), { 12: 48, 50: z, 52: H, 53: W }, { 15: [1, 49] }, { 5: [1, 50] }, { 5: [1, 53], 19: [1, 51], 20: [1, 52] }, { 22: 54, 70: N }, { 22: 55, 70: N }, { 5: [1, 56] }, { 5: [1, 57] }, { 5: [1, 58] }, { 5: [1, 59] }, { 5: [1, 60] }, e(y, [2, 29]), e(y, [2, 30]), { 32: [1, 61] }, { 34: [1, 62] }, e(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 }, e([5, 51, 64, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81], [2, 68]), e(y, [2, 6]), e(y, [2, 15]), e(_, [2, 9], { 10: 93 }), e(y, [2, 17]), { 5: [1, 95], 19: [1, 94] }, { 5: [1, 96] }, e(y, [2, 21]), { 5: [1, 97] }, { 5: [1, 98] }, e(y, [2, 24]), e(y, [2, 25]), e(y, [2, 26]), e(y, [2, 27]), e(y, [2, 28]), e(y, [2, 31]), e(y, [2, 32]), e(Q, a, { 7: 99 }), e(Q, a, { 7: 100 }), e(Q, a, { 7: 101 }), e(at, a, { 40: 102, 7: 103 }), e(k, a, { 42: 104, 7: 105 }), e(k, a, { 7: 105, 42: 106 }), e(qt, a, { 45: 107, 7: 108 }), e(Q, a, { 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 }, e(it, [2, 69]), e(it, [2, 70]), e(it, [2, 71]), e(it, [2, 72]), e(it, [2, 73]), e(it, [2, 74]), e(it, [2, 75]), e(it, [2, 76]), e(it, [2, 77]), e(it, [2, 78]), { 22: 118, 70: N }, { 22: 120, 58: 119, 70: N }, { 70: [2, 63] }, { 70: [2, 64] }, { 56: 121, 81: ct }, { 56: 123, 81: ct }, { 56: 124, 81: ct }, { 56: 125, 81: ct }, { 4: [1, 128], 5: [1, 130], 11: 127, 12: 129, 16: [1, 126], 50: z, 52: H, 53: W }, { 5: [1, 131] }, e(y, [2, 19]), e(y, [2, 20]), e(y, [2, 22]), e(y, [2, 23]), { 4: i, 5: n, 8: 8, 9: 10, 12: 12, 13: h, 14: d, 16: [1, 132], 17: 15, 18: r, 21: f, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: T, 31: m, 33: w, 35: A, 36: O, 37: S, 38: B, 39: D, 41: F, 43: q, 44: X, 46: tt, 50: z, 52: H, 53: W, 54: M, 59: J, 60: K, 61: Z, 62: et, 70: N }, { 4: i, 5: n, 8: 8, 9: 10, 12: 12, 13: h, 14: d, 16: [1, 133], 17: 15, 18: r, 21: f, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: T, 31: m, 33: w, 35: A, 36: O, 37: S, 38: B, 39: D, 41: F, 43: q, 44: X, 46: tt, 50: z, 52: H, 53: W, 54: M, 59: J, 60: K, 61: Z, 62: et, 70: N }, { 4: i, 5: n, 8: 8, 9: 10, 12: 12, 13: h, 14: d, 16: [1, 134], 17: 15, 18: r, 21: f, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: T, 31: m, 33: w, 35: A, 36: O, 37: S, 38: B, 39: D, 41: F, 43: q, 44: X, 46: tt, 50: z, 52: H, 53: W, 54: M, 59: J, 60: K, 61: Z, 62: et, 70: N }, { 16: [1, 135] }, { 4: i, 5: n, 8: 8, 9: 10, 12: 12, 13: h, 14: d, 16: [2, 46], 17: 15, 18: r, 21: f, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: T, 31: m, 33: w, 35: A, 36: O, 37: S, 38: B, 39: D, 41: F, 43: q, 44: X, 46: tt, 49: [1, 136], 50: z, 52: H, 53: W, 54: M, 59: J, 60: K, 61: Z, 62: et, 70: N }, { 16: [1, 137] }, { 4: i, 5: n, 8: 8, 9: 10, 12: 12, 13: h, 14: d, 16: [2, 44], 17: 15, 18: r, 21: f, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: T, 31: m, 33: w, 35: A, 36: O, 37: S, 38: B, 39: D, 41: F, 43: q, 44: X, 46: tt, 48: [1, 138], 50: z, 52: H, 53: W, 54: M, 59: J, 60: K, 61: Z, 62: et, 70: N }, { 16: [1, 139] }, { 16: [1, 140] }, { 4: i, 5: n, 8: 8, 9: 10, 12: 12, 13: h, 14: d, 16: [2, 42], 17: 15, 18: r, 21: f, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: T, 31: m, 33: w, 35: A, 36: O, 37: S, 38: B, 39: D, 41: F, 43: q, 44: X, 46: tt, 47: [1, 141], 50: z, 52: H, 53: W, 54: M, 59: J, 60: K, 61: Z, 62: et, 70: N }, { 4: i, 5: n, 8: 8, 9: 10, 12: 12, 13: h, 14: d, 16: [1, 142], 17: 15, 18: r, 21: f, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: g, 30: T, 31: m, 33: w, 35: A, 36: O, 37: S, 38: B, 39: D, 41: F, 43: q, 44: X, 46: tt, 50: z, 52: H, 53: W, 54: M, 59: J, 60: K, 61: Z, 62: et, 70: N }, { 15: [1, 143] }, e(y, [2, 49]), { 15: [1, 144] }, e(y, [2, 51]), e(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] }, e(y, [2, 16]), e(_, [2, 10]), { 12: 151, 50: z, 52: H, 53: W }, e(_, [2, 12]), e(_, [2, 13]), e(y, [2, 18]), e(y, [2, 34]), e(y, [2, 35]), e(y, [2, 36]), e(y, [2, 37]), { 15: [1, 152] }, e(y, [2, 38]), { 15: [1, 153] }, e(y, [2, 39]), e(y, [2, 40]), { 15: [1, 154] }, e(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 }, e(_, [2, 11]), e(at, a, { 7: 103, 40: 160 }), e(k, a, { 7: 105, 42: 161 }), e(qt, a, { 7: 108, 45: 162 }), e(y, [2, 48]), e(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(v, L) {
214
+ if (L.recoverable)
215
+ this.trace(v);
216
+ else {
217
+ var P = new Error(v);
218
+ throw P.hash = L, P;
219
+ }
220
+ }, "parseError"),
221
+ parse: /* @__PURE__ */ u(function(v) {
222
+ var L = this, P = [0], b = [], R = [null], l = [], Et = this.table, p = "", wt = 0, zt = 0, pe = 2, Ht = 1, ue = l.slice.call(arguments, 1), V = Object.create(this.lexer), dt = { yy: {} };
223
+ for (var St in this.yy)
224
+ Object.prototype.hasOwnProperty.call(this.yy, St) && (dt.yy[St] = this.yy[St]);
225
+ V.setInput(v, dt.yy), dt.yy.lexer = V, dt.yy.parser = this, typeof V.yylloc > "u" && (V.yylloc = {});
226
+ var Mt = V.yylloc;
227
+ l.push(Mt);
228
+ var ge = V.options && V.options.ranges;
229
+ typeof dt.yy.parseError == "function" ? this.parseError = dt.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
230
+ function fe(j) {
231
+ P.length = P.length - 2 * j, R.length = R.length - j, l.length = l.length - j;
232
+ }
233
+ u(fe, "popStack");
234
+ function Kt() {
235
+ var j;
236
+ return j = b.pop() || V.lex() || Ht, typeof j != "number" && (j instanceof Array && (b = j, j = b.pop()), j = L.symbols_[j] || j), j;
237
+ }
238
+ u(Kt, "lex");
239
+ for (var U, pt, st, Rt, ft = {}, vt, lt, Ut, It; ; ) {
240
+ if (pt = P[P.length - 1], this.defaultActions[pt] ? st = this.defaultActions[pt] : ((U === null || typeof U > "u") && (U = Kt()), st = Et[pt] && Et[pt][U]), typeof st > "u" || !st.length || !st[0]) {
241
+ var Dt = "";
242
+ It = [];
243
+ for (vt in Et[pt])
244
+ this.terminals_[vt] && vt > pe && It.push("'" + this.terminals_[vt] + "'");
245
+ V.showPosition ? Dt = "Parse error on line " + (wt + 1) + `:
246
+ ` + V.showPosition() + `
247
+ Expecting ` + It.join(", ") + ", got '" + (this.terminals_[U] || U) + "'" : Dt = "Parse error on line " + (wt + 1) + ": Unexpected " + (U == Ht ? "end of input" : "'" + (this.terminals_[U] || U) + "'"), this.parseError(Dt, {
248
+ text: V.match,
249
+ token: this.terminals_[U] || U,
250
+ line: V.yylineno,
251
+ loc: Mt,
252
+ expected: It
253
+ });
254
+ }
255
+ if (st[0] instanceof Array && st.length > 1)
256
+ throw new Error("Parse Error: multiple actions possible at state: " + pt + ", token: " + U);
257
+ switch (st[0]) {
258
+ case 1:
259
+ P.push(U), R.push(V.yytext), l.push(V.yylloc), P.push(st[1]), U = null, zt = V.yyleng, p = V.yytext, wt = V.yylineno, Mt = 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
+ }, ge && (ft._$.range = [
268
+ l[l.length - (lt || 1)].range[0],
269
+ l[l.length - 1].range[1]
270
+ ]), Rt = this.performAction.apply(ft, [
271
+ p,
272
+ zt,
273
+ wt,
274
+ dt.yy,
275
+ st[1],
276
+ R,
277
+ l
278
+ ].concat(ue)), typeof Rt < "u")
279
+ return Rt;
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 = Et[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
+ }, de = /* @__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(v, L) {
299
+ return this.yy = L || this.yy || {}, this._input = v, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
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 v = this._input[0];
309
+ this.yytext += v, this.yyleng++, this.offset++, this.match += v, this.matched += v;
310
+ var L = v.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), v;
312
+ }, "input"),
313
+ // unshifts one char (or a string) into the input
314
+ unput: /* @__PURE__ */ u(function(v) {
315
+ var L = v.length, P = v.split(/(?:\r\n?|\n)/g);
316
+ this._input = v + 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(v) {
346
+ this.unput(this.match.slice(v));
347
+ }, "less"),
348
+ // displays already matched input, i.e. for error messages
349
+ pastInput: /* @__PURE__ */ u(function() {
350
+ var v = this.matched.substr(0, this.matched.length - this.match.length);
351
+ return (v.length > 20 ? "..." : "") + v.substr(-20).replace(/\n/g, "");
352
+ }, "pastInput"),
353
+ // displays upcoming input, i.e. for error messages
354
+ upcomingInput: /* @__PURE__ */ u(function() {
355
+ var v = this.match;
356
+ return v.length < 20 && (v += this._input.substr(0, 20 - v.length)), (v.substr(0, 20) + (v.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 v = this.pastInput(), L = new Array(v.length + 1).join("-");
361
+ return v + 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(v, 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 = v[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 + v[0].length
391
+ }, this.yytext += v[0], this.match += v[0], this.matches = v, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(v[0].length), this.matched += v[0], 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 v, 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 (v = this.test_match(P, R[l]), v !== !1)
411
+ return v;
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 ? (v = this.test_match(L, R[b]), v !== !1 ? v : !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
+ Nt.lexer = de;
606
+ function mt() {
607
+ this.yy = {};
608
+ }
609
+ return u(mt, "Parser"), mt.prototype = Nt, Nt.Parser = mt, new mt();
610
+ }();
611
+ Ot.parser = Ot;
612
+ var Se = Ot, Me = {
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
+ }, Re = {
646
+ FILLED: 0,
647
+ OPEN: 1
648
+ }, De = {
649
+ LEFTOF: 0,
650
+ RIGHTOF: 1,
651
+ OVER: 2
652
+ }, Tt, Ce = (Tt = class {
653
+ constructor() {
654
+ this.state = new be(() => ({
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 = Gt, 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 = Me, this.ARROWTYPE = Re, this.PLACEMENT = De;
668
+ }
669
+ addBox(t) {
670
+ this.state.records.boxes.push({
671
+ name: t.text,
672
+ wrap: t.wrap ?? this.autoWrap(),
673
+ fill: t.color,
674
+ actorKeys: []
675
+ }), this.state.records.currentBox = this.state.records.boxes.slice(-1)[0];
676
+ }
677
+ addActor(t, c, s, a) {
678
+ let i = this.state.records.currentBox;
679
+ const n = this.state.records.actors.get(t);
680
+ if (n) {
681
+ if (this.state.records.currentBox && n.box && this.state.records.currentBox !== n.box)
682
+ throw new Error(
683
+ `A same participant should only be defined in one Box: ${n.name} can't be in '${n.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`
684
+ );
685
+ if (i = n.box ? n.box : this.state.records.currentBox, n.box = i, n && c === n.name && s == null)
686
+ return;
687
+ }
688
+ if ((s == null ? void 0 : s.text) == null && (s = { text: c, type: a }), (a == null || s.text == null) && (s = { text: c, type: a }), this.state.records.actors.set(t, {
689
+ box: i,
690
+ name: c,
691
+ description: s.text,
692
+ wrap: s.wrap ?? this.autoWrap(),
693
+ prevActor: this.state.records.prevActor,
694
+ links: {},
695
+ properties: {},
696
+ actorCnt: null,
697
+ rectData: null,
698
+ type: a ?? "participant"
699
+ }), this.state.records.prevActor) {
700
+ const h = this.state.records.actors.get(this.state.records.prevActor);
701
+ h && (h.nextActor = t);
702
+ }
703
+ this.state.records.currentBox && this.state.records.currentBox.actorKeys.push(t), this.state.records.prevActor = t;
704
+ }
705
+ activationCount(t) {
706
+ let c, s = 0;
707
+ if (!t)
708
+ return 0;
709
+ for (c = 0; c < this.state.records.messages.length; c++)
710
+ this.state.records.messages[c].type === this.LINETYPE.ACTIVE_START && this.state.records.messages[c].from === t && s++, this.state.records.messages[c].type === this.LINETYPE.ACTIVE_END && this.state.records.messages[c].from === t && s--;
711
+ return s;
712
+ }
713
+ addMessage(t, c, s, a) {
714
+ this.state.records.messages.push({
715
+ id: this.state.records.messages.length.toString(),
716
+ from: t,
717
+ to: c,
718
+ message: s.text,
719
+ wrap: s.wrap ?? this.autoWrap(),
720
+ answer: a
721
+ });
722
+ }
723
+ addSignal(t, c, s, a, i = !1) {
724
+ if (a === this.LINETYPE.ACTIVE_END && this.activationCount(t ?? "") < 1) {
725
+ const h = new Error("Trying to inactivate an inactive participant (" + t + ")");
726
+ throw h.hash = {
727
+ text: "->>-",
728
+ token: "->>-",
729
+ line: "1",
730
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
731
+ expected: ["'ACTIVE_PARTICIPANT'"]
732
+ }, h;
733
+ }
734
+ return this.state.records.messages.push({
735
+ id: this.state.records.messages.length.toString(),
736
+ from: t,
737
+ to: c,
738
+ message: (s == null ? void 0 : s.text) ?? "",
739
+ wrap: (s == null ? void 0 : s.wrap) ?? this.autoWrap(),
740
+ type: a,
741
+ activate: i
742
+ }), !0;
743
+ }
744
+ hasAtLeastOneBox() {
745
+ return this.state.records.boxes.length > 0;
746
+ }
747
+ hasAtLeastOneBoxWithTitle() {
748
+ return this.state.records.boxes.some((t) => t.name);
749
+ }
750
+ getMessages() {
751
+ return this.state.records.messages;
752
+ }
753
+ getBoxes() {
754
+ return this.state.records.boxes;
755
+ }
756
+ getActors() {
757
+ return this.state.records.actors;
758
+ }
759
+ getCreatedActors() {
760
+ return this.state.records.createdActors;
761
+ }
762
+ getDestroyedActors() {
763
+ return this.state.records.destroyedActors;
764
+ }
765
+ getActor(t) {
766
+ return this.state.records.actors.get(t);
767
+ }
768
+ getActorKeys() {
769
+ return [...this.state.records.actors.keys()];
770
+ }
771
+ enableSequenceNumbers() {
772
+ this.state.records.sequenceNumbersEnabled = !0;
773
+ }
774
+ disableSequenceNumbers() {
775
+ this.state.records.sequenceNumbersEnabled = !1;
776
+ }
777
+ showSequenceNumbers() {
778
+ return this.state.records.sequenceNumbersEnabled;
779
+ }
780
+ setWrap(t) {
781
+ this.state.records.wrapEnabled = t;
782
+ }
783
+ extractWrap(t) {
784
+ if (t === void 0)
785
+ return {};
786
+ t = t.trim();
787
+ const c = /^:?wrap:/.exec(t) !== null ? !0 : /^:?nowrap:/.exec(t) !== null ? !1 : void 0;
788
+ return { cleanedText: (c === void 0 ? t : t.replace(/^:?(?:no)?wrap:/, "")).trim(), wrap: c };
789
+ }
790
+ autoWrap() {
791
+ var t;
792
+ return this.state.records.wrapEnabled !== void 0 ? this.state.records.wrapEnabled : ((t = $().sequence) == null ? void 0 : t.wrap) ?? !1;
793
+ }
794
+ clear() {
795
+ this.state.reset(), ke();
796
+ }
797
+ parseMessage(t) {
798
+ const c = t.trim(), { wrap: s, cleanedText: a } = this.extractWrap(c), i = {
799
+ text: a,
800
+ wrap: s
801
+ };
802
+ return G.debug(`parseMessage: ${JSON.stringify(i)}`), i;
803
+ }
804
+ // We expect the box statement to be color first then description
805
+ // 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
806
+ // We extract first segment as color, the rest of the line is considered as text
807
+ parseBoxData(t) {
808
+ const c = /^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);
809
+ let s = c != null && c[1] ? c[1].trim() : "transparent", a = c != null && c[2] ? c[2].trim() : void 0;
810
+ if (window != null && window.CSS)
811
+ window.CSS.supports("color", s) || (s = "transparent", a = t.trim());
812
+ else {
813
+ const h = new Option().style;
814
+ h.color = s, h.color !== s && (s = "transparent", a = t.trim());
815
+ }
816
+ const { wrap: i, cleanedText: n } = this.extractWrap(a);
817
+ return {
818
+ text: n ? Lt(n, $()) : void 0,
819
+ color: s,
820
+ wrap: i
821
+ };
822
+ }
823
+ addNote(t, c, s) {
824
+ const a = {
825
+ actor: t,
826
+ placement: c,
827
+ message: s.text,
828
+ wrap: s.wrap ?? this.autoWrap()
829
+ }, i = [].concat(t, t);
830
+ this.state.records.notes.push(a), this.state.records.messages.push({
831
+ id: this.state.records.messages.length.toString(),
832
+ from: i[0],
833
+ to: i[1],
834
+ message: s.text,
835
+ wrap: s.wrap ?? this.autoWrap(),
836
+ type: this.LINETYPE.NOTE,
837
+ placement: c
838
+ });
839
+ }
840
+ addLinks(t, c) {
841
+ const s = this.getActor(t);
842
+ try {
843
+ let a = Lt(c.text, $());
844
+ a = a.replace(/&equals;/g, "="), a = a.replace(/&amp;/g, "&");
845
+ const i = JSON.parse(a);
846
+ this.insertLinks(s, i);
847
+ } catch (a) {
848
+ G.error("error while parsing actor link text", a);
849
+ }
850
+ }
851
+ addALink(t, c) {
852
+ const s = this.getActor(t);
853
+ try {
854
+ const a = {};
855
+ let i = Lt(c.text, $());
856
+ const n = i.indexOf("@");
857
+ i = i.replace(/&equals;/g, "="), i = i.replace(/&amp;/g, "&");
858
+ const h = i.slice(0, n - 1).trim(), d = i.slice(n + 1).trim();
859
+ a[h] = d, this.insertLinks(s, a);
860
+ } catch (a) {
861
+ G.error("error while parsing actor link text", a);
862
+ }
863
+ }
864
+ insertLinks(t, c) {
865
+ if (t.links == null)
866
+ t.links = c;
867
+ else
868
+ for (const s in c)
869
+ t.links[s] = c[s];
870
+ }
871
+ addProperties(t, c) {
872
+ const s = this.getActor(t);
873
+ try {
874
+ const a = Lt(c.text, $()), i = JSON.parse(a);
875
+ this.insertProperties(s, i);
876
+ } catch (a) {
877
+ G.error("error while parsing actor properties text", a);
878
+ }
879
+ }
880
+ insertProperties(t, c) {
881
+ if (t.properties == null)
882
+ t.properties = c;
883
+ else
884
+ for (const s in c)
885
+ t.properties[s] = c[s];
886
+ }
887
+ boxEnd() {
888
+ this.state.records.currentBox = void 0;
889
+ }
890
+ addDetails(t, c) {
891
+ const s = this.getActor(t), a = document.getElementById(c.text);
892
+ try {
893
+ const i = a.innerHTML, n = JSON.parse(i);
894
+ n.properties && this.insertProperties(s, n.properties), n.links && this.insertLinks(s, n.links);
895
+ } catch (i) {
896
+ G.error("error while parsing actor details text", i);
897
+ }
898
+ }
899
+ getActorProperty(t, c) {
900
+ if ((t == null ? void 0 : t.properties) !== void 0)
901
+ return t.properties[c];
902
+ }
903
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-redundant-type-constituents
904
+ apply(t) {
905
+ if (Array.isArray(t))
906
+ t.forEach((c) => {
907
+ this.apply(c);
908
+ });
909
+ else
910
+ switch (t.type) {
911
+ case "sequenceIndex":
912
+ this.state.records.messages.push({
913
+ id: this.state.records.messages.length.toString(),
914
+ from: void 0,
915
+ to: void 0,
916
+ message: {
917
+ start: t.sequenceIndex,
918
+ step: t.sequenceIndexStep,
919
+ visible: t.sequenceVisible
920
+ },
921
+ wrap: !1,
922
+ type: t.signalType
923
+ });
924
+ break;
925
+ case "addParticipant":
926
+ this.addActor(t.actor, t.actor, t.description, t.draw);
927
+ break;
928
+ case "createParticipant":
929
+ if (this.state.records.actors.has(t.actor))
930
+ throw new Error(
931
+ "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"
932
+ );
933
+ 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);
934
+ break;
935
+ case "destroyParticipant":
936
+ this.state.records.lastDestroyed = t.actor, this.state.records.destroyedActors.set(t.actor, this.state.records.messages.length);
937
+ break;
938
+ case "activeStart":
939
+ this.addSignal(t.actor, void 0, void 0, t.signalType);
940
+ break;
941
+ case "activeEnd":
942
+ this.addSignal(t.actor, void 0, void 0, t.signalType);
943
+ break;
944
+ case "addNote":
945
+ this.addNote(t.actor, t.placement, t.text);
946
+ break;
947
+ case "addLinks":
948
+ this.addLinks(t.actor, t.text);
949
+ break;
950
+ case "addALink":
951
+ this.addALink(t.actor, t.text);
952
+ break;
953
+ case "addProperties":
954
+ this.addProperties(t.actor, t.text);
955
+ break;
956
+ case "addDetails":
957
+ this.addDetails(t.actor, t.text);
958
+ break;
959
+ case "addMessage":
960
+ if (this.state.records.lastCreated) {
961
+ if (t.to !== this.state.records.lastCreated)
962
+ throw new Error(
963
+ "The created participant " + this.state.records.lastCreated.name + " does not have an associated creating message after its declaration. Please check the sequence diagram."
964
+ );
965
+ this.state.records.lastCreated = void 0;
966
+ } else if (this.state.records.lastDestroyed) {
967
+ if (t.to !== this.state.records.lastDestroyed && t.from !== this.state.records.lastDestroyed)
968
+ throw new Error(
969
+ "The destroyed participant " + this.state.records.lastDestroyed.name + " does not have an associated destroying message after its declaration. Please check the sequence diagram."
970
+ );
971
+ this.state.records.lastDestroyed = void 0;
972
+ }
973
+ this.addSignal(t.from, t.to, t.msg, t.signalType, t.activate);
974
+ break;
975
+ case "boxStart":
976
+ this.addBox(t.boxData);
977
+ break;
978
+ case "boxEnd":
979
+ this.boxEnd();
980
+ break;
981
+ case "loopStart":
982
+ this.addSignal(void 0, void 0, t.loopText, t.signalType);
983
+ break;
984
+ case "loopEnd":
985
+ this.addSignal(void 0, void 0, void 0, t.signalType);
986
+ break;
987
+ case "rectStart":
988
+ this.addSignal(void 0, void 0, t.color, t.signalType);
989
+ break;
990
+ case "rectEnd":
991
+ this.addSignal(void 0, void 0, void 0, t.signalType);
992
+ break;
993
+ case "optStart":
994
+ this.addSignal(void 0, void 0, t.optText, t.signalType);
995
+ break;
996
+ case "optEnd":
997
+ this.addSignal(void 0, void 0, void 0, t.signalType);
998
+ break;
999
+ case "altStart":
1000
+ this.addSignal(void 0, void 0, t.altText, t.signalType);
1001
+ break;
1002
+ case "else":
1003
+ this.addSignal(void 0, void 0, t.altText, t.signalType);
1004
+ break;
1005
+ case "altEnd":
1006
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1007
+ break;
1008
+ case "setAccTitle":
1009
+ Gt(t.text);
1010
+ break;
1011
+ case "parStart":
1012
+ this.addSignal(void 0, void 0, t.parText, t.signalType);
1013
+ break;
1014
+ case "and":
1015
+ this.addSignal(void 0, void 0, t.parText, t.signalType);
1016
+ break;
1017
+ case "parEnd":
1018
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1019
+ break;
1020
+ case "criticalStart":
1021
+ this.addSignal(void 0, void 0, t.criticalText, t.signalType);
1022
+ break;
1023
+ case "option":
1024
+ this.addSignal(void 0, void 0, t.optionText, t.signalType);
1025
+ break;
1026
+ case "criticalEnd":
1027
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1028
+ break;
1029
+ case "breakStart":
1030
+ this.addSignal(void 0, void 0, t.breakText, t.signalType);
1031
+ break;
1032
+ case "breakEnd":
1033
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1034
+ break;
1035
+ }
1036
+ }
1037
+ getConfig() {
1038
+ return $().sequence;
1039
+ }
1040
+ }, u(Tt, "SequenceDB"), Tt), Oe = /* @__PURE__ */ u((e) => `.actor {
1041
+ stroke: ${e.actorBorder};
1042
+ fill: ${e.actorBkg};
1043
+ }
1044
+
1045
+ text.actor > tspan {
1046
+ fill: ${e.actorTextColor};
1047
+ stroke: none;
1048
+ }
1049
+
1050
+ .actor-line {
1051
+ stroke: ${e.actorLineColor};
1052
+ }
1053
+
1054
+ .messageLine0 {
1055
+ stroke-width: 1.5;
1056
+ stroke-dasharray: none;
1057
+ stroke: ${e.signalColor};
1058
+ }
1059
+
1060
+ .messageLine1 {
1061
+ stroke-width: 1.5;
1062
+ stroke-dasharray: 2, 2;
1063
+ stroke: ${e.signalColor};
1064
+ }
1065
+
1066
+ #arrowhead path {
1067
+ fill: ${e.signalColor};
1068
+ stroke: ${e.signalColor};
1069
+ }
1070
+
1071
+ .sequenceNumber {
1072
+ fill: ${e.sequenceNumberColor};
1073
+ }
1074
+
1075
+ #sequencenumber {
1076
+ fill: ${e.signalColor};
1077
+ }
1078
+
1079
+ #crosshead path {
1080
+ fill: ${e.signalColor};
1081
+ stroke: ${e.signalColor};
1082
+ }
1083
+
1084
+ .messageText {
1085
+ fill: ${e.signalTextColor};
1086
+ stroke: none;
1087
+ }
1088
+
1089
+ .labelBox {
1090
+ stroke: ${e.labelBoxBorderColor};
1091
+ fill: ${e.labelBoxBkgColor};
1092
+ }
1093
+
1094
+ .labelText, .labelText > tspan {
1095
+ fill: ${e.labelTextColor};
1096
+ stroke: none;
1097
+ }
1098
+
1099
+ .loopText, .loopText > tspan {
1100
+ fill: ${e.loopTextColor};
1101
+ stroke: none;
1102
+ }
1103
+
1104
+ .loopLine {
1105
+ stroke-width: 2px;
1106
+ stroke-dasharray: 2, 2;
1107
+ stroke: ${e.labelBoxBorderColor};
1108
+ fill: ${e.labelBoxBorderColor};
1109
+ }
1110
+
1111
+ .note {
1112
+ //stroke: #decc93;
1113
+ stroke: ${e.noteBorderColor};
1114
+ fill: ${e.noteBkgColor};
1115
+ }
1116
+
1117
+ .noteText, .noteText > tspan {
1118
+ fill: ${e.noteTextColor};
1119
+ stroke: none;
1120
+ }
1121
+
1122
+ .activation0 {
1123
+ fill: ${e.activationBkgColor};
1124
+ stroke: ${e.activationBorderColor};
1125
+ }
1126
+
1127
+ .activation1 {
1128
+ fill: ${e.activationBkgColor};
1129
+ stroke: ${e.activationBorderColor};
1130
+ }
1131
+
1132
+ .activation2 {
1133
+ fill: ${e.activationBkgColor};
1134
+ stroke: ${e.activationBorderColor};
1135
+ }
1136
+
1137
+ .actorPopupMenu {
1138
+ position: absolute;
1139
+ }
1140
+
1141
+ .actorPopupMenuPanel {
1142
+ position: absolute;
1143
+ fill: ${e.actorBkg};
1144
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
1145
+ filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
1146
+ }
1147
+ .actor-man line {
1148
+ stroke: ${e.actorBorder};
1149
+ fill: ${e.actorBkg};
1150
+ }
1151
+ .actor-man circle, line {
1152
+ stroke: ${e.actorBorder};
1153
+ fill: ${e.actorBkg};
1154
+ stroke-width: 2px;
1155
+ }
1156
+ `, "getStyles"), Be = Oe, ut = 18 * 2, $t = "actor-top", te = "actor-bottom", Ve = "actor-box", Xt = "actor-man", Wt = /* @__PURE__ */ u(function(e, t) {
1157
+ return Te(e, t);
1158
+ }, "drawRect"), Ye = /* @__PURE__ */ u(function(e, t, c, s, a) {
1159
+ if (t.links === void 0 || t.links === null || Object.keys(t.links).length === 0)
1160
+ return { height: 0, width: 0 };
1161
+ const i = t.links, n = t.actorCnt, h = t.rectData;
1162
+ var d = "none";
1163
+ a && (d = "block !important");
1164
+ const r = e.append("g");
1165
+ r.attr("id", "actor" + n + "_popup"), r.attr("class", "actorPopupMenu"), r.attr("display", d);
1166
+ var f = "";
1167
+ h.class !== void 0 && (f = " " + h.class);
1168
+ let E = h.width > c ? h.width : c;
1169
+ const g = r.append("rect");
1170
+ 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) {
1171
+ var T = 20;
1172
+ for (let A in i) {
1173
+ var m = r.append("a"), w = Zt.sanitizeUrl(i[A]);
1174
+ m.attr("xlink:href", w), m.attr("target", "_blank"), ss(s)(
1175
+ A,
1176
+ m,
1177
+ h.x + 10,
1178
+ h.height + T,
1179
+ E,
1180
+ 20,
1181
+ { class: "actor" },
1182
+ s
1183
+ ), T += 30;
1184
+ }
1185
+ }
1186
+ return g.attr("height", T), { height: h.height + T, width: E };
1187
+ }, "drawPopup"), We = /* @__PURE__ */ u(function(e) {
1188
+ return "var pu = document.getElementById('" + e + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }";
1189
+ }, "popupMenuToggle"), Pt = /* @__PURE__ */ u(async function(e, t, c = null) {
1190
+ let s = e.append("foreignObject");
1191
+ const a = await jt(t.text, Ct()), n = s.append("xhtml:div").attr("style", "width: fit-content;").attr("xmlns", "http://www.w3.org/1999/xhtml").html(a).node().getBoundingClientRect();
1192
+ if (s.attr("height", Math.round(n.height)).attr("width", Math.round(n.width)), t.class === "noteText") {
1193
+ const h = e.node().firstChild;
1194
+ h.setAttribute("height", n.height + 2 * t.textMargin);
1195
+ const d = h.getBBox();
1196
+ s.attr("x", Math.round(d.x + d.width / 2 - n.width / 2)).attr("y", Math.round(d.y + d.height / 2 - n.height / 2));
1197
+ } else if (c) {
1198
+ let { startx: h, stopx: d, starty: r } = c;
1199
+ if (h > d) {
1200
+ const f = h;
1201
+ h = d, d = f;
1202
+ }
1203
+ s.attr("x", Math.round(h + Math.abs(h - d) / 2 - n.width / 2)), t.class === "loopText" ? s.attr("y", Math.round(r)) : s.attr("y", Math.round(r - n.height));
1204
+ }
1205
+ return [s];
1206
+ }, "drawKatex"), yt = /* @__PURE__ */ u(function(e, t) {
1207
+ let c = 0, s = 0;
1208
+ const a = t.text.split(I.lineBreakRegex), [i, n] = Qt(t.fontSize);
1209
+ let h = [], d = 0, r = /* @__PURE__ */ u(() => t.y, "yfunc");
1210
+ if (t.valign !== void 0 && t.textMargin !== void 0 && t.textMargin > 0)
1211
+ switch (t.valign) {
1212
+ case "top":
1213
+ case "start":
1214
+ r = /* @__PURE__ */ u(() => Math.round(t.y + t.textMargin), "yfunc");
1215
+ break;
1216
+ case "middle":
1217
+ case "center":
1218
+ r = /* @__PURE__ */ u(() => Math.round(t.y + (c + s + t.textMargin) / 2), "yfunc");
1219
+ break;
1220
+ case "bottom":
1221
+ case "end":
1222
+ r = /* @__PURE__ */ u(() => Math.round(
1223
+ t.y + (c + s + 2 * t.textMargin) - t.textMargin
1224
+ ), "yfunc");
1225
+ break;
1226
+ }
1227
+ if (t.anchor !== void 0 && t.textMargin !== void 0 && t.width !== void 0)
1228
+ switch (t.anchor) {
1229
+ case "left":
1230
+ case "start":
1231
+ t.x = Math.round(t.x + t.textMargin), t.anchor = "start", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1232
+ break;
1233
+ case "middle":
1234
+ case "center":
1235
+ t.x = Math.round(t.x + t.width / 2), t.anchor = "middle", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1236
+ break;
1237
+ case "right":
1238
+ case "end":
1239
+ t.x = Math.round(t.x + t.width - t.textMargin), t.anchor = "end", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1240
+ break;
1241
+ }
1242
+ for (let [f, E] of a.entries()) {
1243
+ t.textMargin !== void 0 && t.textMargin === 0 && i !== void 0 && (d = f * i);
1244
+ const g = e.append("text");
1245
+ g.attr("x", t.x), g.attr("y", r()), t.anchor !== void 0 && g.attr("text-anchor", t.anchor).attr("dominant-baseline", t.dominantBaseline).attr("alignment-baseline", t.alignmentBaseline), t.fontFamily !== void 0 && g.style("font-family", t.fontFamily), n !== void 0 && g.style("font-size", n), t.fontWeight !== void 0 && g.style("font-weight", t.fontWeight), t.fill !== void 0 && g.attr("fill", t.fill), t.class !== void 0 && g.attr("class", t.class), t.dy !== void 0 ? g.attr("dy", t.dy) : d !== 0 && g.attr("dy", d);
1246
+ const T = E || Ne;
1247
+ if (t.tspan) {
1248
+ const m = g.append("tspan");
1249
+ m.attr("x", t.x), t.fill !== void 0 && m.attr("fill", t.fill), m.text(T);
1250
+ } else
1251
+ g.text(T);
1252
+ t.valign !== void 0 && t.textMargin !== void 0 && t.textMargin > 0 && (s += (g._groups || g)[0][0].getBBox().height, c = s), h.push(g);
1253
+ }
1254
+ return h;
1255
+ }, "drawText"), ee = /* @__PURE__ */ u(function(e, t) {
1256
+ function c(a, i, n, h, d) {
1257
+ return a + "," + i + " " + (a + n) + "," + i + " " + (a + n) + "," + (i + h - d) + " " + (a + n - d * 1.2) + "," + (i + h) + " " + a + "," + (i + h);
1258
+ }
1259
+ u(c, "genPoints");
1260
+ const s = e.append("polygon");
1261
+ return s.attr("points", c(t.x, t.y, t.width, t.height, 7)), s.attr("class", "labelBox"), t.y = t.y + t.height / 2, yt(e, t), s;
1262
+ }, "drawLabel"), nt = -1, se = /* @__PURE__ */ u((e, t, c, s) => {
1263
+ e.select && c.forEach((a) => {
1264
+ const i = t.get(a), n = e.select("#actor" + i.actorCnt);
1265
+ !s.mirrorActors && i.stopy ? n.attr("y2", i.stopy + i.height / 2) : s.mirrorActors && n.attr("y2", i.stopy);
1266
+ });
1267
+ }, "fixLifeLineHeights"), Fe = /* @__PURE__ */ u(function(e, t, c, s) {
1268
+ var T, m;
1269
+ const a = s ? t.stopy : t.starty, i = t.x + t.width / 2, n = a + t.height, h = e.append("g").lower();
1270
+ var d = h;
1271
+ s || (nt++, Object.keys(t.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", n).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), d = h.append("g"), t.actorCnt = nt, t.links != null && d.attr("id", "root-" + nt));
1272
+ const r = At();
1273
+ var f = "actor";
1274
+ (T = t.properties) != null && T.class ? f = t.properties.class : r.fill = "#eaeaea", s ? f += ` ${te}` : f += ` ${$t}`, r.x = t.x, r.y = a, r.width = t.width, r.height = t.height, r.class = f, r.rx = 3, r.ry = 3, r.name = t.name;
1275
+ const E = Wt(d, r);
1276
+ if (t.rectData = r, (m = t.properties) != null && m.icon) {
1277
+ const w = t.properties.icon.trim();
1278
+ w.charAt(0) === "@" ? ye(d, r.x + r.width - 20, r.y + 10, w.substr(1)) : Ee(d, r.x + r.width - 20, r.y + 10, w);
1279
+ }
1280
+ Ft(c, ot(t.description))(
1281
+ t.description,
1282
+ d,
1283
+ r.x,
1284
+ r.y,
1285
+ r.width,
1286
+ r.height,
1287
+ { class: `actor ${Ve}` },
1288
+ c
1289
+ );
1290
+ let g = t.height;
1291
+ if (E.node) {
1292
+ const w = E.node().getBBox();
1293
+ t.height = w.height, g = w.height;
1294
+ }
1295
+ return g;
1296
+ }, "drawActorTypeParticipant"), qe = /* @__PURE__ */ u(function(e, t, c, s) {
1297
+ const a = s ? t.stopy : t.starty, i = t.x + t.width / 2, n = a + 80, h = e.append("g").lower();
1298
+ s || (nt++, h.append("line").attr("id", "actor" + nt).attr("x1", i).attr("y1", n).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = nt);
1299
+ const d = e.append("g");
1300
+ let r = Xt;
1301
+ s ? r += ` ${te}` : r += ` ${$t}`, d.attr("class", r), d.attr("name", t.name);
1302
+ const f = At();
1303
+ f.x = t.x, f.y = a, f.fill = "#eaeaea", f.width = t.width, f.height = t.height, f.class = "actor", f.rx = 3, f.ry = 3, d.append("line").attr("id", "actor-man-torso" + nt).attr("x1", i).attr("y1", a + 25).attr("x2", i).attr("y2", a + 45), d.append("line").attr("id", "actor-man-arms" + nt).attr("x1", i - ut / 2).attr("y1", a + 33).attr("x2", i + ut / 2).attr("y2", a + 33), d.append("line").attr("x1", i - ut / 2).attr("y1", a + 60).attr("x2", i).attr("y2", a + 45), d.append("line").attr("x1", i).attr("y1", a + 45).attr("x2", i + ut / 2 - 2).attr("y2", a + 60);
1304
+ const E = d.append("circle");
1305
+ E.attr("cx", t.x + t.width / 2), E.attr("cy", a + 10), E.attr("r", 15), E.attr("width", t.width), E.attr("height", t.height);
1306
+ const g = d.node().getBBox();
1307
+ return t.height = g.height, Ft(c, ot(t.description))(
1308
+ t.description,
1309
+ d,
1310
+ f.x,
1311
+ f.y + 35,
1312
+ f.width,
1313
+ f.height,
1314
+ { class: `actor ${Xt}` },
1315
+ c
1316
+ ), t.height;
1317
+ }, "drawActorTypeActor"), ze = /* @__PURE__ */ u(async function(e, t, c, s) {
1318
+ switch (t.type) {
1319
+ case "actor":
1320
+ return await qe(e, t, c, s);
1321
+ case "participant":
1322
+ return await Fe(e, t, c, s);
1323
+ }
1324
+ }, "drawActor"), He = /* @__PURE__ */ u(function(e, t, c) {
1325
+ const a = e.append("g");
1326
+ ae(a, t), t.name && Ft(c)(
1327
+ t.name,
1328
+ a,
1329
+ t.x,
1330
+ t.y + (t.textMaxHeight || 0) / 2,
1331
+ t.width,
1332
+ 0,
1333
+ { class: "text" },
1334
+ c
1335
+ ), a.lower();
1336
+ }, "drawBox"), Ke = /* @__PURE__ */ u(function(e) {
1337
+ return e.append("g");
1338
+ }, "anchorElement"), Ue = /* @__PURE__ */ u(function(e, t, c, s, a) {
1339
+ const i = At(), n = t.anchored;
1340
+ i.x = t.startx, i.y = t.starty, i.class = "activation" + a % 3, i.width = t.stopx - t.startx, i.height = c - t.starty, Wt(n, i);
1341
+ }, "drawActivation"), Ge = /* @__PURE__ */ u(async function(e, t, c, s) {
1342
+ const {
1343
+ boxMargin: a,
1344
+ boxTextMargin: i,
1345
+ labelBoxHeight: n,
1346
+ labelBoxWidth: h,
1347
+ messageFontFamily: d,
1348
+ messageFontSize: r,
1349
+ messageFontWeight: f
1350
+ } = s, E = e.append("g"), g = /* @__PURE__ */ u(function(w, A, O, S) {
1351
+ return E.append("line").attr("x1", w).attr("y1", A).attr("x2", O).attr("y2", S).attr("class", "loopLine");
1352
+ }, "drawLoopLine");
1353
+ g(t.startx, t.starty, t.stopx, t.starty), g(t.stopx, t.starty, t.stopx, t.stopy), g(t.startx, t.stopy, t.stopx, t.stopy), g(t.startx, t.starty, t.startx, t.stopy), t.sections !== void 0 && t.sections.forEach(function(w) {
1354
+ g(t.startx, w.y, t.stopx, w.y).style(
1355
+ "stroke-dasharray",
1356
+ "3, 3"
1357
+ );
1358
+ });
1359
+ let T = Yt();
1360
+ T.text = c, T.x = t.startx, T.y = t.starty, T.fontFamily = d, T.fontSize = r, T.fontWeight = f, T.anchor = "middle", T.valign = "middle", T.tspan = !1, T.width = h || 50, T.height = n || 20, T.textMargin = i, T.class = "labelText", ee(E, T), T = re(), T.text = t.title, T.x = t.startx + h / 2 + (t.stopx - t.startx) / 2, T.y = t.starty + a + i, T.anchor = "middle", T.valign = "middle", T.textMargin = i, T.class = "loopText", T.fontFamily = d, T.fontSize = r, T.fontWeight = f, T.wrap = !0;
1361
+ let m = ot(T.text) ? await Pt(E, T, t) : yt(E, T);
1362
+ if (t.sectionTitles !== void 0) {
1363
+ for (const [w, A] of Object.entries(t.sectionTitles))
1364
+ if (A.message) {
1365
+ T.text = A.message, T.x = t.startx + (t.stopx - t.startx) / 2, T.y = t.sections[w].y + a + i, T.class = "loopText", T.anchor = "middle", T.valign = "middle", T.tspan = !1, T.fontFamily = d, T.fontSize = r, T.fontWeight = f, T.wrap = t.wrap, ot(T.text) ? (t.starty = t.sections[w].y, await Pt(E, T, t)) : yt(E, T);
1366
+ let O = Math.round(
1367
+ m.map((S) => (S._groups || S)[0][0].getBBox().height).reduce((S, B) => S + B)
1368
+ );
1369
+ t.sections[w].height += O - (a + i);
1370
+ }
1371
+ }
1372
+ return t.height = Math.round(t.stopy - t.starty), E;
1373
+ }, "drawLoop"), ae = /* @__PURE__ */ u(function(e, t) {
1374
+ xe(e, t);
1375
+ }, "drawBackgroundRect"), Xe = /* @__PURE__ */ u(function(e) {
1376
+ e.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1377
+ "d",
1378
+ "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"
1379
+ );
1380
+ }, "insertDatabaseIcon"), Je = /* @__PURE__ */ u(function(e) {
1381
+ e.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1382
+ "d",
1383
+ "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"
1384
+ );
1385
+ }, "insertComputerIcon"), Ze = /* @__PURE__ */ u(function(e) {
1386
+ e.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1387
+ "d",
1388
+ "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"
1389
+ );
1390
+ }, "insertClockIcon"), Qe = /* @__PURE__ */ u(function(e) {
1391
+ e.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 7.9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M -1 0 L 10 5 L 0 10 z");
1392
+ }, "insertArrowHead"), je = /* @__PURE__ */ u(function(e) {
1393
+ e.append("defs").append("marker").attr("id", "filled-head").attr("refX", 15.5).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
1394
+ }, "insertArrowFilledHead"), $e = /* @__PURE__ */ u(function(e) {
1395
+ e.append("defs").append("marker").attr("id", "sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6);
1396
+ }, "insertSequenceNumber"), ts = /* @__PURE__ */ u(function(e) {
1397
+ e.append("defs").append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 4).attr("refY", 4.5).append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1pt").attr("d", "M 1,2 L 6,7 M 6,2 L 1,7");
1398
+ }, "insertArrowCrossHead"), re = /* @__PURE__ */ u(function() {
1399
+ return {
1400
+ x: 0,
1401
+ y: 0,
1402
+ fill: void 0,
1403
+ anchor: void 0,
1404
+ style: "#666",
1405
+ width: void 0,
1406
+ height: void 0,
1407
+ textMargin: 0,
1408
+ rx: 0,
1409
+ ry: 0,
1410
+ tspan: !0,
1411
+ valign: void 0
1412
+ };
1413
+ }, "getTextObj"), es = /* @__PURE__ */ u(function() {
1414
+ return {
1415
+ x: 0,
1416
+ y: 0,
1417
+ fill: "#EDF2AE",
1418
+ stroke: "#666",
1419
+ width: 100,
1420
+ anchor: "start",
1421
+ height: 100,
1422
+ rx: 0,
1423
+ ry: 0
1424
+ };
1425
+ }, "getNoteRect"), Ft = /* @__PURE__ */ function() {
1426
+ function e(i, n, h, d, r, f, E) {
1427
+ const g = n.append("text").attr("x", h + r / 2).attr("y", d + f / 2 + 5).style("text-anchor", "middle").text(i);
1428
+ a(g, E);
1429
+ }
1430
+ u(e, "byText");
1431
+ function t(i, n, h, d, r, f, E, g) {
1432
+ const { actorFontSize: T, actorFontFamily: m, actorFontWeight: w } = g, [A, O] = Qt(T), S = i.split(I.lineBreakRegex);
1433
+ for (let B = 0; B < S.length; B++) {
1434
+ const D = B * A - A * (S.length - 1) / 2, F = n.append("text").attr("x", h + r / 2).attr("y", d).style("text-anchor", "middle").style("font-size", O).style("font-weight", w).style("font-family", m);
1435
+ F.append("tspan").attr("x", h + r / 2).attr("dy", D).text(S[B]), F.attr("y", d + f / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), a(F, E);
1436
+ }
1437
+ }
1438
+ u(t, "byTspan");
1439
+ function c(i, n, h, d, r, f, E, g) {
1440
+ const T = n.append("switch"), w = T.append("foreignObject").attr("x", h).attr("y", d).attr("width", r).attr("height", f).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1441
+ w.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(i), t(i, T, h, d, r, f, E, g), a(w, E);
1442
+ }
1443
+ u(c, "byFo");
1444
+ async function s(i, n, h, d, r, f, E, g) {
1445
+ const T = await bt(i, Ct()), m = n.append("switch"), A = m.append("foreignObject").attr("x", h + r / 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%");
1446
+ A.append("div").style("text-align", "center").style("vertical-align", "middle").html(await jt(i, Ct())), t(i, m, h, d, r, f, E, g), a(A, E);
1447
+ }
1448
+ u(s, "byKatex");
1449
+ function a(i, n) {
1450
+ for (const h in n)
1451
+ n.hasOwnProperty(h) && i.attr(h, n[h]);
1452
+ }
1453
+ return u(a, "_setTextAttrs"), function(i, n = !1) {
1454
+ return n ? s : i.textPlacement === "fo" ? c : i.textPlacement === "old" ? e : t;
1455
+ };
1456
+ }(), ss = /* @__PURE__ */ function() {
1457
+ function e(a, i, n, h, d, r, f) {
1458
+ const E = i.append("text").attr("x", n).attr("y", h).style("text-anchor", "start").text(a);
1459
+ s(E, f);
1460
+ }
1461
+ u(e, "byText");
1462
+ function t(a, i, n, h, d, r, f, E) {
1463
+ const { actorFontSize: g, actorFontFamily: T, actorFontWeight: m } = E, w = a.split(I.lineBreakRegex);
1464
+ for (let A = 0; A < w.length; A++) {
1465
+ const O = A * g - g * (w.length - 1) / 2, S = i.append("text").attr("x", n).attr("y", h).style("text-anchor", "start").style("font-size", g).style("font-weight", m).style("font-family", T);
1466
+ S.append("tspan").attr("x", n).attr("dy", O).text(w[A]), S.attr("y", h + r / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), s(S, f);
1467
+ }
1468
+ }
1469
+ u(t, "byTspan");
1470
+ function c(a, i, n, h, d, r, f, E) {
1471
+ const g = i.append("switch"), m = g.append("foreignObject").attr("x", n).attr("y", h).attr("width", d).attr("height", r).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1472
+ m.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(a), t(a, g, n, h, d, r, f, E), s(m, f);
1473
+ }
1474
+ u(c, "byFo");
1475
+ function s(a, i) {
1476
+ for (const n in i)
1477
+ i.hasOwnProperty(n) && a.attr(n, i[n]);
1478
+ }
1479
+ return u(s, "_setTextAttrs"), function(a) {
1480
+ return a.textPlacement === "fo" ? c : a.textPlacement === "old" ? e : t;
1481
+ };
1482
+ }(), C = {
1483
+ drawRect: Wt,
1484
+ drawText: yt,
1485
+ drawLabel: ee,
1486
+ drawActor: ze,
1487
+ drawBox: He,
1488
+ drawPopup: Ye,
1489
+ anchorElement: Ke,
1490
+ drawActivation: Ue,
1491
+ drawLoop: Ge,
1492
+ drawBackgroundRect: ae,
1493
+ insertArrowHead: Qe,
1494
+ insertArrowFilledHead: je,
1495
+ insertSequenceNumber: $e,
1496
+ insertArrowCrossHead: ts,
1497
+ insertDatabaseIcon: Xe,
1498
+ insertComputerIcon: Je,
1499
+ insertClockIcon: Ze,
1500
+ getTextObj: re,
1501
+ getNoteRect: es,
1502
+ fixLifeLineHeights: se,
1503
+ sanitizeUrl: Zt.sanitizeUrl
1504
+ }, o = {}, x = {
1505
+ data: {
1506
+ startx: void 0,
1507
+ stopx: void 0,
1508
+ starty: void 0,
1509
+ stopy: void 0
1510
+ },
1511
+ verticalPos: 0,
1512
+ sequenceItems: [],
1513
+ activations: [],
1514
+ models: {
1515
+ getHeight: /* @__PURE__ */ u(function() {
1516
+ return Math.max.apply(
1517
+ null,
1518
+ this.actors.length === 0 ? [0] : this.actors.map((e) => e.height || 0)
1519
+ ) + (this.loops.length === 0 ? 0 : this.loops.map((e) => e.height || 0).reduce((e, t) => e + t)) + (this.messages.length === 0 ? 0 : this.messages.map((e) => e.height || 0).reduce((e, t) => e + t)) + (this.notes.length === 0 ? 0 : this.notes.map((e) => e.height || 0).reduce((e, t) => e + t));
1520
+ }, "getHeight"),
1521
+ clear: /* @__PURE__ */ u(function() {
1522
+ this.actors = [], this.boxes = [], this.loops = [], this.messages = [], this.notes = [];
1523
+ }, "clear"),
1524
+ addBox: /* @__PURE__ */ u(function(e) {
1525
+ this.boxes.push(e);
1526
+ }, "addBox"),
1527
+ addActor: /* @__PURE__ */ u(function(e) {
1528
+ this.actors.push(e);
1529
+ }, "addActor"),
1530
+ addLoop: /* @__PURE__ */ u(function(e) {
1531
+ this.loops.push(e);
1532
+ }, "addLoop"),
1533
+ addMessage: /* @__PURE__ */ u(function(e) {
1534
+ this.messages.push(e);
1535
+ }, "addMessage"),
1536
+ addNote: /* @__PURE__ */ u(function(e) {
1537
+ this.notes.push(e);
1538
+ }, "addNote"),
1539
+ lastActor: /* @__PURE__ */ u(function() {
1540
+ return this.actors[this.actors.length - 1];
1541
+ }, "lastActor"),
1542
+ lastLoop: /* @__PURE__ */ u(function() {
1543
+ return this.loops[this.loops.length - 1];
1544
+ }, "lastLoop"),
1545
+ lastMessage: /* @__PURE__ */ u(function() {
1546
+ return this.messages[this.messages.length - 1];
1547
+ }, "lastMessage"),
1548
+ lastNote: /* @__PURE__ */ u(function() {
1549
+ return this.notes[this.notes.length - 1];
1550
+ }, "lastNote"),
1551
+ actors: [],
1552
+ boxes: [],
1553
+ loops: [],
1554
+ messages: [],
1555
+ notes: []
1556
+ },
1557
+ init: /* @__PURE__ */ u(function() {
1558
+ this.sequenceItems = [], this.activations = [], this.models.clear(), this.data = {
1559
+ startx: void 0,
1560
+ stopx: void 0,
1561
+ starty: void 0,
1562
+ stopy: void 0
1563
+ }, this.verticalPos = 0, oe($());
1564
+ }, "init"),
1565
+ updateVal: /* @__PURE__ */ u(function(e, t, c, s) {
1566
+ e[t] === void 0 ? e[t] = c : e[t] = s(c, e[t]);
1567
+ }, "updateVal"),
1568
+ updateBounds: /* @__PURE__ */ u(function(e, t, c, s) {
1569
+ const a = this;
1570
+ let i = 0;
1571
+ function n(h) {
1572
+ return /* @__PURE__ */ u(function(r) {
1573
+ i++;
1574
+ const f = a.sequenceItems.length - i + 1;
1575
+ a.updateVal(r, "starty", t - f * o.boxMargin, Math.min), a.updateVal(r, "stopy", s + f * o.boxMargin, Math.max), a.updateVal(x.data, "startx", e - f * o.boxMargin, Math.min), a.updateVal(x.data, "stopx", c + f * o.boxMargin, Math.max), h !== "activation" && (a.updateVal(r, "startx", e - f * o.boxMargin, Math.min), a.updateVal(r, "stopx", c + f * o.boxMargin, Math.max), a.updateVal(x.data, "starty", t - f * o.boxMargin, Math.min), a.updateVal(x.data, "stopy", s + f * o.boxMargin, Math.max));
1576
+ }, "updateItemBounds");
1577
+ }
1578
+ u(n, "updateFn"), this.sequenceItems.forEach(n()), this.activations.forEach(n("activation"));
1579
+ }, "updateBounds"),
1580
+ insert: /* @__PURE__ */ u(function(e, t, c, s) {
1581
+ const a = I.getMin(e, c), i = I.getMax(e, c), n = I.getMin(t, s), h = I.getMax(t, s);
1582
+ this.updateVal(x.data, "startx", a, Math.min), this.updateVal(x.data, "starty", n, Math.min), this.updateVal(x.data, "stopx", i, Math.max), this.updateVal(x.data, "stopy", h, Math.max), this.updateBounds(a, n, i, h);
1583
+ }, "insert"),
1584
+ newActivation: /* @__PURE__ */ u(function(e, t, c) {
1585
+ const s = c.get(e.from), a = kt(e.from).length || 0, i = s.x + s.width / 2 + (a - 1) * o.activationWidth / 2;
1586
+ this.activations.push({
1587
+ startx: i,
1588
+ starty: this.verticalPos + 2,
1589
+ stopx: i + o.activationWidth,
1590
+ stopy: void 0,
1591
+ actor: e.from,
1592
+ anchored: C.anchorElement(t)
1593
+ });
1594
+ }, "newActivation"),
1595
+ endActivation: /* @__PURE__ */ u(function(e) {
1596
+ const t = this.activations.map(function(c) {
1597
+ return c.actor;
1598
+ }).lastIndexOf(e.from);
1599
+ return this.activations.splice(t, 1)[0];
1600
+ }, "endActivation"),
1601
+ createLoop: /* @__PURE__ */ u(function(e = { message: void 0, wrap: !1, width: void 0 }, t) {
1602
+ return {
1603
+ startx: void 0,
1604
+ starty: this.verticalPos,
1605
+ stopx: void 0,
1606
+ stopy: void 0,
1607
+ title: e.message,
1608
+ wrap: e.wrap,
1609
+ width: e.width,
1610
+ height: 0,
1611
+ fill: t
1612
+ };
1613
+ }, "createLoop"),
1614
+ newLoop: /* @__PURE__ */ u(function(e = { message: void 0, wrap: !1, width: void 0 }, t) {
1615
+ this.sequenceItems.push(this.createLoop(e, t));
1616
+ }, "newLoop"),
1617
+ endLoop: /* @__PURE__ */ u(function() {
1618
+ return this.sequenceItems.pop();
1619
+ }, "endLoop"),
1620
+ isLoopOverlap: /* @__PURE__ */ u(function() {
1621
+ return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : !1;
1622
+ }, "isLoopOverlap"),
1623
+ addSectionToLoop: /* @__PURE__ */ u(function(e) {
1624
+ const t = this.sequenceItems.pop();
1625
+ t.sections = t.sections || [], t.sectionTitles = t.sectionTitles || [], t.sections.push({ y: x.getVerticalPos(), height: 0 }), t.sectionTitles.push(e), this.sequenceItems.push(t);
1626
+ }, "addSectionToLoop"),
1627
+ saveVerticalPos: /* @__PURE__ */ u(function() {
1628
+ this.isLoopOverlap() && (this.savedVerticalPos = this.verticalPos);
1629
+ }, "saveVerticalPos"),
1630
+ resetVerticalPos: /* @__PURE__ */ u(function() {
1631
+ this.isLoopOverlap() && (this.verticalPos = this.savedVerticalPos);
1632
+ }, "resetVerticalPos"),
1633
+ bumpVerticalPos: /* @__PURE__ */ u(function(e) {
1634
+ this.verticalPos = this.verticalPos + e, this.data.stopy = I.getMax(this.data.stopy, this.verticalPos);
1635
+ }, "bumpVerticalPos"),
1636
+ getVerticalPos: /* @__PURE__ */ u(function() {
1637
+ return this.verticalPos;
1638
+ }, "getVerticalPos"),
1639
+ getBounds: /* @__PURE__ */ u(function() {
1640
+ return { bounds: this.data, models: this.models };
1641
+ }, "getBounds")
1642
+ }, as = /* @__PURE__ */ u(async function(e, t) {
1643
+ x.bumpVerticalPos(o.boxMargin), t.height = o.boxMargin, t.starty = x.getVerticalPos();
1644
+ const c = At();
1645
+ c.x = t.startx, c.y = t.starty, c.width = t.width || o.width, c.class = "note";
1646
+ const s = e.append("g"), a = C.drawRect(s, c), i = Yt();
1647
+ i.x = t.startx, i.y = t.starty, i.width = c.width, i.dy = "1em", i.text = t.message, i.class = "noteText", i.fontFamily = o.noteFontFamily, i.fontSize = o.noteFontSize, i.fontWeight = o.noteFontWeight, i.anchor = o.noteAlign, i.textMargin = o.noteMargin, i.valign = "center";
1648
+ const n = ot(i.text) ? await Pt(s, i) : yt(s, i), h = Math.round(
1649
+ n.map((d) => (d._groups || d)[0][0].getBBox().height).reduce((d, r) => d + r)
1650
+ );
1651
+ a.attr("height", h + 2 * o.noteMargin), t.height += h + 2 * o.noteMargin, x.bumpVerticalPos(h + 2 * o.noteMargin), t.stopy = t.starty + h + 2 * o.noteMargin, t.stopx = t.startx + c.width, x.insert(t.startx, t.starty, t.stopx, t.stopy), x.models.addNote(t);
1652
+ }, "drawNote"), gt = /* @__PURE__ */ u((e) => ({
1653
+ fontFamily: e.messageFontFamily,
1654
+ fontSize: e.messageFontSize,
1655
+ fontWeight: e.messageFontWeight
1656
+ }), "messageFont"), xt = /* @__PURE__ */ u((e) => ({
1657
+ fontFamily: e.noteFontFamily,
1658
+ fontSize: e.noteFontSize,
1659
+ fontWeight: e.noteFontWeight
1660
+ }), "noteFont"), Bt = /* @__PURE__ */ u((e) => ({
1661
+ fontFamily: e.actorFontFamily,
1662
+ fontSize: e.actorFontSize,
1663
+ fontWeight: e.actorFontWeight
1664
+ }), "actorFont");
1665
+ async function ie(e, t) {
1666
+ x.bumpVerticalPos(10);
1667
+ const { startx: c, stopx: s, message: a } = t, i = I.splitBreaks(a).length, n = ot(a), h = n ? await bt(a, $()) : Y.calculateTextDimensions(a, gt(o));
1668
+ if (!n) {
1669
+ const E = h.height / i;
1670
+ t.height += E, x.bumpVerticalPos(E);
1671
+ }
1672
+ let d, r = h.height - 10;
1673
+ const f = h.width;
1674
+ if (c === s) {
1675
+ d = x.getVerticalPos() + r, o.rightAngles || (r += o.boxMargin, d = x.getVerticalPos() + r), r += 30;
1676
+ const E = I.getMax(f / 2, o.width / 2);
1677
+ x.insert(
1678
+ c - E,
1679
+ x.getVerticalPos() - 10 + r,
1680
+ s + E,
1681
+ x.getVerticalPos() + 30 + r
1682
+ );
1683
+ } else
1684
+ r += o.boxMargin, d = x.getVerticalPos() + r, x.insert(c, d - 10, s, d);
1685
+ return x.bumpVerticalPos(r), t.height += r, t.stopy = t.starty + t.height, x.insert(t.fromBounds, t.starty, t.toBounds, t.stopy), d;
1686
+ }
1687
+ u(ie, "boundMessage");
1688
+ var rs = /* @__PURE__ */ u(async function(e, t, c, s) {
1689
+ const { startx: a, stopx: i, starty: n, message: h, type: d, sequenceIndex: r, sequenceVisible: f } = t, E = Y.calculateTextDimensions(h, gt(o)), g = Yt();
1690
+ g.x = a, g.y = n + 10, g.width = i - a, g.class = "messageText", g.dy = "1em", g.text = h, g.fontFamily = o.messageFontFamily, g.fontSize = o.messageFontSize, g.fontWeight = o.messageFontWeight, g.anchor = o.messageAlign, g.valign = "center", g.textMargin = o.wrapPadding, g.tspan = !1, ot(g.text) ? await Pt(e, g, { startx: a, stopx: i, starty: c }) : yt(e, g);
1691
+ const T = E.width;
1692
+ let m;
1693
+ a === i ? o.rightAngles ? m = e.append("path").attr(
1694
+ "d",
1695
+ `M ${a},${c} H ${a + I.getMax(o.width / 2, T / 2)} V ${c + 25} H ${a}`
1696
+ ) : m = e.append("path").attr(
1697
+ "d",
1698
+ "M " + a + "," + c + " C " + (a + 60) + "," + (c - 10) + " " + (a + 60) + "," + (c + 30) + " " + a + "," + (c + 20)
1699
+ ) : (m = e.append("line"), m.attr("x1", a), 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");
1700
+ let w = "";
1701
+ o.arrowMarkerAbsolute && (w = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, w = w.replace(/\(/g, "\\("), w = w.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(" + w + "#arrowhead)"), (d === s.db.LINETYPE.BIDIRECTIONAL_SOLID || d === s.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (m.attr("marker-start", "url(" + w + "#arrowhead)"), m.attr("marker-end", "url(" + w + "#arrowhead)")), (d === s.db.LINETYPE.SOLID_POINT || d === s.db.LINETYPE.DOTTED_POINT) && m.attr("marker-end", "url(" + w + "#filled-head)"), (d === s.db.LINETYPE.SOLID_CROSS || d === s.db.LINETYPE.DOTTED_CROSS) && m.attr("marker-end", "url(" + w + "#crosshead)"), (f || o.showSequenceNumbers) && (m.attr("marker-start", "url(" + w + "#sequencenumber)"), e.append("text").attr("x", a).attr("y", c + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(r));
1702
+ }, "drawMessage"), is = /* @__PURE__ */ u(function(e, t, c, s, a, i, n) {
1703
+ let h = 0, d = 0, r, f = 0;
1704
+ for (const E of s) {
1705
+ const g = t.get(E), T = g.box;
1706
+ r && r != T && (n || x.models.addBox(r), d += o.boxMargin + r.margin), T && T != r && (n || (T.x = h + d, T.y = a), d += T.margin), g.width = g.width || o.width, g.height = I.getMax(g.height || o.height, o.height), g.margin = g.margin || o.actorMargin, f = I.getMax(f, g.height), c.get(g.name) && (d += g.width / 2), g.x = h + d, g.starty = x.getVerticalPos(), x.insert(g.x, a, g.x + g.width, g.height), h += g.width + d, g.box && (g.box.width = h + T.margin - g.box.x), d = g.margin, r = g.box, x.models.addActor(g);
1707
+ }
1708
+ r && !n && x.models.addBox(r), x.bumpVerticalPos(f);
1709
+ }, "addActorRenderingData"), Vt = /* @__PURE__ */ u(async function(e, t, c, s) {
1710
+ if (s) {
1711
+ let a = 0;
1712
+ x.bumpVerticalPos(o.boxMargin * 2);
1713
+ for (const i of c) {
1714
+ const n = t.get(i);
1715
+ n.stopy || (n.stopy = x.getVerticalPos());
1716
+ const h = await C.drawActor(e, n, o, !0);
1717
+ a = I.getMax(a, h);
1718
+ }
1719
+ x.bumpVerticalPos(a + o.boxMargin);
1720
+ } else
1721
+ for (const a of c) {
1722
+ const i = t.get(a);
1723
+ await C.drawActor(e, i, o, !1);
1724
+ }
1725
+ }, "drawActors"), ne = /* @__PURE__ */ u(function(e, t, c, s) {
1726
+ let a = 0, i = 0;
1727
+ for (const n of c) {
1728
+ const h = t.get(n), d = os(h), r = C.drawPopup(
1729
+ e,
1730
+ h,
1731
+ d,
1732
+ o,
1733
+ o.forceMenus,
1734
+ s
1735
+ );
1736
+ r.height > a && (a = r.height), r.width + h.x > i && (i = r.width + h.x);
1737
+ }
1738
+ return { maxHeight: a, maxWidth: i };
1739
+ }, "drawActorsPopup"), oe = /* @__PURE__ */ u(function(e) {
1740
+ ve(o, e), e.fontFamily && (o.actorFontFamily = o.noteFontFamily = o.messageFontFamily = e.fontFamily), e.fontSize && (o.actorFontSize = o.noteFontSize = o.messageFontSize = e.fontSize), e.fontWeight && (o.actorFontWeight = o.noteFontWeight = o.messageFontWeight = e.fontWeight);
1741
+ }, "setConf"), kt = /* @__PURE__ */ u(function(e) {
1742
+ return x.activations.filter(function(t) {
1743
+ return t.actor === e;
1744
+ });
1745
+ }, "actorActivations"), Jt = /* @__PURE__ */ u(function(e, t) {
1746
+ const c = t.get(e), s = kt(e), a = s.reduce(
1747
+ function(n, h) {
1748
+ return I.getMin(n, h.startx);
1749
+ },
1750
+ c.x + c.width / 2 - 1
1751
+ ), i = s.reduce(
1752
+ function(n, h) {
1753
+ return I.getMax(n, h.stopx);
1754
+ },
1755
+ c.x + c.width / 2 + 1
1756
+ );
1757
+ return [a, i];
1758
+ }, "activationBounds");
1759
+ function rt(e, t, c, s, a) {
1760
+ x.bumpVerticalPos(c);
1761
+ let i = s;
1762
+ if (t.id && t.message && e[t.id]) {
1763
+ const n = e[t.id].width, h = gt(o);
1764
+ t.message = Y.wrapLabel(`[${t.message}]`, n - 2 * o.wrapPadding, h), t.width = n, t.wrap = !0;
1765
+ const d = Y.calculateTextDimensions(t.message, h), r = I.getMax(d.height, o.labelBoxHeight);
1766
+ i = s + r, G.debug(`${r} - ${t.message}`);
1767
+ }
1768
+ a(t), x.bumpVerticalPos(i);
1769
+ }
1770
+ u(rt, "adjustLoopHeightForWrap");
1771
+ function ce(e, t, c, s, a, i, n) {
1772
+ function h(r, f) {
1773
+ r.x < a.get(e.from).x ? (x.insert(
1774
+ t.stopx - f,
1775
+ t.starty,
1776
+ t.startx,
1777
+ t.stopy + r.height / 2 + o.noteMargin
1778
+ ), t.stopx = t.stopx + f) : (x.insert(
1779
+ t.startx,
1780
+ t.starty,
1781
+ t.stopx + f,
1782
+ t.stopy + r.height / 2 + o.noteMargin
1783
+ ), t.stopx = t.stopx - f);
1784
+ }
1785
+ u(h, "receiverAdjustment");
1786
+ function d(r, f) {
1787
+ r.x < a.get(e.to).x ? (x.insert(
1788
+ t.startx - f,
1789
+ t.starty,
1790
+ t.stopx,
1791
+ t.stopy + r.height / 2 + o.noteMargin
1792
+ ), t.startx = t.startx + f) : (x.insert(
1793
+ t.stopx,
1794
+ t.starty,
1795
+ t.startx + f,
1796
+ t.stopy + r.height / 2 + o.noteMargin
1797
+ ), t.startx = t.startx - f);
1798
+ }
1799
+ if (u(d, "senderAdjustment"), i.get(e.to) == s) {
1800
+ const r = a.get(e.to), f = r.type == "actor" ? ut / 2 + 3 : r.width / 2 + 3;
1801
+ h(r, f), r.starty = c - r.height / 2, x.bumpVerticalPos(r.height / 2);
1802
+ } else if (n.get(e.from) == s) {
1803
+ const r = a.get(e.from);
1804
+ if (o.mirrorActors) {
1805
+ const f = r.type == "actor" ? ut / 2 : r.width / 2;
1806
+ d(r, f);
1807
+ }
1808
+ r.stopy = c - r.height / 2, x.bumpVerticalPos(r.height / 2);
1809
+ } else if (n.get(e.to) == s) {
1810
+ const r = a.get(e.to);
1811
+ if (o.mirrorActors) {
1812
+ const f = r.type == "actor" ? ut / 2 + 3 : r.width / 2 + 3;
1813
+ h(r, f);
1814
+ }
1815
+ r.stopy = c - r.height / 2, x.bumpVerticalPos(r.height / 2);
1816
+ }
1817
+ }
1818
+ u(ce, "adjustCreatedDestroyedData");
1819
+ var ns = /* @__PURE__ */ u(async function(e, t, c, s) {
1820
+ const { securityLevel: a, sequence: i } = $();
1821
+ o = i;
1822
+ let n;
1823
+ a === "sandbox" && (n = _t("#i" + t));
1824
+ const h = a === "sandbox" ? _t(n.nodes()[0].contentDocument.body) : _t("body"), d = a === "sandbox" ? n.nodes()[0].contentDocument : document;
1825
+ x.init(), G.debug(s.db);
1826
+ const r = a === "sandbox" ? h.select(`[id="${t}"]`) : _t(`[id="${t}"]`), f = s.db.getActors(), E = s.db.getCreatedActors(), g = s.db.getDestroyedActors(), T = s.db.getBoxes();
1827
+ let m = s.db.getActorKeys();
1828
+ const w = s.db.getMessages(), A = s.db.getDiagramTitle(), O = s.db.hasAtLeastOneBox(), S = s.db.hasAtLeastOneBoxWithTitle(), B = await le(f, w, s);
1829
+ if (o.height = await he(f, B, T), C.insertComputerIcon(r), C.insertDatabaseIcon(r), C.insertClockIcon(r), O && (x.bumpVerticalPos(o.boxMargin), S && x.bumpVerticalPos(T[0].textMaxHeight)), o.hideUnusedParticipants === !0) {
1830
+ const y = /* @__PURE__ */ new Set();
1831
+ w.forEach((_) => {
1832
+ y.add(_.from), y.add(_.to);
1833
+ }), m = m.filter((_) => y.has(_));
1834
+ }
1835
+ is(r, f, E, m, 0, w, !1);
1836
+ const D = await hs(w, f, B, s);
1837
+ C.insertArrowHead(r), C.insertArrowCrossHead(r), C.insertArrowFilledHead(r), C.insertSequenceNumber(r);
1838
+ function F(y, _) {
1839
+ const Q = x.endActivation(y);
1840
+ Q.starty + 18 > _ && (Q.starty = _ - 6, _ += 12), C.drawActivation(
1841
+ r,
1842
+ Q,
1843
+ _,
1844
+ o,
1845
+ kt(y.from).length
1846
+ ), x.insert(Q.startx, _ - 10, Q.stopx, _);
1847
+ }
1848
+ u(F, "activeEnd");
1849
+ let q = 1, X = 1;
1850
+ const tt = [], z = [];
1851
+ let H = 0;
1852
+ for (const y of w) {
1853
+ let _, Q, at;
1854
+ switch (y.type) {
1855
+ case s.db.LINETYPE.NOTE:
1856
+ x.resetVerticalPos(), Q = y.noteModel, await as(r, Q);
1857
+ break;
1858
+ case s.db.LINETYPE.ACTIVE_START:
1859
+ x.newActivation(y, r, f);
1860
+ break;
1861
+ case s.db.LINETYPE.ACTIVE_END:
1862
+ F(y, x.getVerticalPos());
1863
+ break;
1864
+ case s.db.LINETYPE.LOOP_START:
1865
+ rt(
1866
+ D,
1867
+ y,
1868
+ o.boxMargin,
1869
+ o.boxMargin + o.boxTextMargin,
1870
+ (k) => x.newLoop(k)
1871
+ );
1872
+ break;
1873
+ case s.db.LINETYPE.LOOP_END:
1874
+ _ = x.endLoop(), await C.drawLoop(r, _, "loop", o), x.bumpVerticalPos(_.stopy - x.getVerticalPos()), x.models.addLoop(_);
1875
+ break;
1876
+ case s.db.LINETYPE.RECT_START:
1877
+ rt(
1878
+ D,
1879
+ y,
1880
+ o.boxMargin,
1881
+ o.boxMargin,
1882
+ (k) => x.newLoop(void 0, k.message)
1883
+ );
1884
+ break;
1885
+ case s.db.LINETYPE.RECT_END:
1886
+ _ = x.endLoop(), z.push(_), x.models.addLoop(_), x.bumpVerticalPos(_.stopy - x.getVerticalPos());
1887
+ break;
1888
+ case s.db.LINETYPE.OPT_START:
1889
+ rt(
1890
+ D,
1891
+ y,
1892
+ o.boxMargin,
1893
+ o.boxMargin + o.boxTextMargin,
1894
+ (k) => x.newLoop(k)
1895
+ );
1896
+ break;
1897
+ case s.db.LINETYPE.OPT_END:
1898
+ _ = x.endLoop(), await C.drawLoop(r, _, "opt", o), x.bumpVerticalPos(_.stopy - x.getVerticalPos()), x.models.addLoop(_);
1899
+ break;
1900
+ case s.db.LINETYPE.ALT_START:
1901
+ rt(
1902
+ D,
1903
+ y,
1904
+ o.boxMargin,
1905
+ o.boxMargin + o.boxTextMargin,
1906
+ (k) => x.newLoop(k)
1907
+ );
1908
+ break;
1909
+ case s.db.LINETYPE.ALT_ELSE:
1910
+ rt(
1911
+ D,
1912
+ y,
1913
+ o.boxMargin + o.boxTextMargin,
1914
+ o.boxMargin,
1915
+ (k) => x.addSectionToLoop(k)
1916
+ );
1917
+ break;
1918
+ case s.db.LINETYPE.ALT_END:
1919
+ _ = x.endLoop(), await C.drawLoop(r, _, "alt", o), x.bumpVerticalPos(_.stopy - x.getVerticalPos()), x.models.addLoop(_);
1920
+ break;
1921
+ case s.db.LINETYPE.PAR_START:
1922
+ case s.db.LINETYPE.PAR_OVER_START:
1923
+ rt(
1924
+ D,
1925
+ y,
1926
+ o.boxMargin,
1927
+ o.boxMargin + o.boxTextMargin,
1928
+ (k) => x.newLoop(k)
1929
+ ), x.saveVerticalPos();
1930
+ break;
1931
+ case s.db.LINETYPE.PAR_AND:
1932
+ rt(
1933
+ D,
1934
+ y,
1935
+ o.boxMargin + o.boxTextMargin,
1936
+ o.boxMargin,
1937
+ (k) => x.addSectionToLoop(k)
1938
+ );
1939
+ break;
1940
+ case s.db.LINETYPE.PAR_END:
1941
+ _ = x.endLoop(), await C.drawLoop(r, _, "par", o), x.bumpVerticalPos(_.stopy - x.getVerticalPos()), x.models.addLoop(_);
1942
+ break;
1943
+ case s.db.LINETYPE.AUTONUMBER:
1944
+ q = y.message.start || q, X = y.message.step || X, y.message.visible ? s.db.enableSequenceNumbers() : s.db.disableSequenceNumbers();
1945
+ break;
1946
+ case s.db.LINETYPE.CRITICAL_START:
1947
+ rt(
1948
+ D,
1949
+ y,
1950
+ o.boxMargin,
1951
+ o.boxMargin + o.boxTextMargin,
1952
+ (k) => x.newLoop(k)
1953
+ );
1954
+ break;
1955
+ case s.db.LINETYPE.CRITICAL_OPTION:
1956
+ rt(
1957
+ D,
1958
+ y,
1959
+ o.boxMargin + o.boxTextMargin,
1960
+ o.boxMargin,
1961
+ (k) => x.addSectionToLoop(k)
1962
+ );
1963
+ break;
1964
+ case s.db.LINETYPE.CRITICAL_END:
1965
+ _ = x.endLoop(), await C.drawLoop(r, _, "critical", o), x.bumpVerticalPos(_.stopy - x.getVerticalPos()), x.models.addLoop(_);
1966
+ break;
1967
+ case s.db.LINETYPE.BREAK_START:
1968
+ rt(
1969
+ D,
1970
+ y,
1971
+ o.boxMargin,
1972
+ o.boxMargin + o.boxTextMargin,
1973
+ (k) => x.newLoop(k)
1974
+ );
1975
+ break;
1976
+ case s.db.LINETYPE.BREAK_END:
1977
+ _ = x.endLoop(), await C.drawLoop(r, _, "break", o), x.bumpVerticalPos(_.stopy - x.getVerticalPos()), x.models.addLoop(_);
1978
+ break;
1979
+ default:
1980
+ try {
1981
+ at = y.msgModel, at.starty = x.getVerticalPos(), at.sequenceIndex = q, at.sequenceVisible = s.db.showSequenceNumbers();
1982
+ const k = await ie(r, at);
1983
+ ce(
1984
+ y,
1985
+ at,
1986
+ k,
1987
+ H,
1988
+ f,
1989
+ E,
1990
+ g
1991
+ ), tt.push({ messageModel: at, lineStartY: k }), x.models.addMessage(at);
1992
+ } catch (k) {
1993
+ G.error("error while drawing message", k);
1994
+ }
1995
+ }
1996
+ [
1997
+ s.db.LINETYPE.SOLID_OPEN,
1998
+ s.db.LINETYPE.DOTTED_OPEN,
1999
+ s.db.LINETYPE.SOLID,
2000
+ s.db.LINETYPE.DOTTED,
2001
+ s.db.LINETYPE.SOLID_CROSS,
2002
+ s.db.LINETYPE.DOTTED_CROSS,
2003
+ s.db.LINETYPE.SOLID_POINT,
2004
+ s.db.LINETYPE.DOTTED_POINT,
2005
+ s.db.LINETYPE.BIDIRECTIONAL_SOLID,
2006
+ s.db.LINETYPE.BIDIRECTIONAL_DOTTED
2007
+ ].includes(y.type) && (q = q + X), H++;
2008
+ }
2009
+ G.debug("createdActors", E), G.debug("destroyedActors", g), await Vt(r, f, m, !1);
2010
+ for (const y of tt)
2011
+ await rs(r, y.messageModel, y.lineStartY, s);
2012
+ o.mirrorActors && await Vt(r, f, m, !0), z.forEach((y) => C.drawBackgroundRect(r, y)), se(r, f, m, o);
2013
+ for (const y of x.models.boxes)
2014
+ 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(r, y, o);
2015
+ O && x.bumpVerticalPos(o.boxMargin);
2016
+ const W = ne(r, f, m, d), { bounds: M } = x.getBounds();
2017
+ 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);
2018
+ let J = M.stopy - M.starty;
2019
+ J < W.maxHeight && (J = W.maxHeight);
2020
+ let K = J + 2 * o.diagramMarginY;
2021
+ o.mirrorActors && (K = K - o.boxMargin + o.bottomMarginAdj);
2022
+ let Z = M.stopx - M.startx;
2023
+ Z < W.maxWidth && (Z = W.maxWidth);
2024
+ const et = Z + 2 * o.diagramMarginX;
2025
+ A && r.append("text").text(A).attr("x", (M.stopx - M.startx) / 2 - 2 * o.diagramMarginX).attr("y", -25), we(r, K, et, o.useMaxWidth);
2026
+ const N = A ? 40 : 0;
2027
+ r.attr(
2028
+ "viewBox",
2029
+ M.startx - o.diagramMarginX + " -" + (o.diagramMarginY + N) + " " + et + " " + (K + N)
2030
+ ), G.debug("models:", x.models);
2031
+ }, "draw");
2032
+ async function le(e, t, c) {
2033
+ const s = {};
2034
+ for (const a of t)
2035
+ if (e.get(a.to) && e.get(a.from)) {
2036
+ const i = e.get(a.to);
2037
+ if (a.placement === c.db.PLACEMENT.LEFTOF && !i.prevActor || a.placement === c.db.PLACEMENT.RIGHTOF && !i.nextActor)
2038
+ continue;
2039
+ const n = a.placement !== void 0, h = !n, d = n ? xt(o) : gt(o), r = a.wrap ? Y.wrapLabel(a.message, o.width - 2 * o.wrapPadding, d) : a.message, E = (ot(r) ? await bt(a.message, $()) : Y.calculateTextDimensions(r, d)).width + 2 * o.wrapPadding;
2040
+ h && a.from === i.nextActor ? s[a.to] = I.getMax(
2041
+ s[a.to] || 0,
2042
+ E
2043
+ ) : h && a.from === i.prevActor ? s[a.from] = I.getMax(
2044
+ s[a.from] || 0,
2045
+ E
2046
+ ) : h && a.from === a.to ? (s[a.from] = I.getMax(
2047
+ s[a.from] || 0,
2048
+ E / 2
2049
+ ), s[a.to] = I.getMax(
2050
+ s[a.to] || 0,
2051
+ E / 2
2052
+ )) : a.placement === c.db.PLACEMENT.RIGHTOF ? s[a.from] = I.getMax(
2053
+ s[a.from] || 0,
2054
+ E
2055
+ ) : a.placement === c.db.PLACEMENT.LEFTOF ? s[i.prevActor] = I.getMax(
2056
+ s[i.prevActor] || 0,
2057
+ E
2058
+ ) : a.placement === c.db.PLACEMENT.OVER && (i.prevActor && (s[i.prevActor] = I.getMax(
2059
+ s[i.prevActor] || 0,
2060
+ E / 2
2061
+ )), i.nextActor && (s[a.from] = I.getMax(
2062
+ s[a.from] || 0,
2063
+ E / 2
2064
+ )));
2065
+ }
2066
+ return G.debug("maxMessageWidthPerActor:", s), s;
2067
+ }
2068
+ u(le, "getMaxMessageWidthPerActor");
2069
+ var os = /* @__PURE__ */ u(function(e) {
2070
+ let t = 0;
2071
+ const c = Bt(o);
2072
+ for (const s in e.links) {
2073
+ const i = Y.calculateTextDimensions(s, c).width + 2 * o.wrapPadding + 2 * o.boxMargin;
2074
+ t < i && (t = i);
2075
+ }
2076
+ return t;
2077
+ }, "getRequiredPopupWidth");
2078
+ async function he(e, t, c) {
2079
+ let s = 0;
2080
+ for (const i of e.keys()) {
2081
+ const n = e.get(i);
2082
+ n.wrap && (n.description = Y.wrapLabel(
2083
+ n.description,
2084
+ o.width - 2 * o.wrapPadding,
2085
+ Bt(o)
2086
+ ));
2087
+ const h = ot(n.description) ? await bt(n.description, $()) : Y.calculateTextDimensions(n.description, Bt(o));
2088
+ n.width = n.wrap ? o.width : I.getMax(o.width, h.width + 2 * o.wrapPadding), n.height = n.wrap ? I.getMax(h.height, o.height) : o.height, s = I.getMax(s, n.height);
2089
+ }
2090
+ for (const i in t) {
2091
+ const n = e.get(i);
2092
+ if (!n)
2093
+ continue;
2094
+ const h = e.get(n.nextActor);
2095
+ if (!h) {
2096
+ const E = t[i] + o.actorMargin - n.width / 2;
2097
+ n.margin = I.getMax(E, o.actorMargin);
2098
+ continue;
2099
+ }
2100
+ const r = t[i] + o.actorMargin - n.width / 2 - h.width / 2;
2101
+ n.margin = I.getMax(r, o.actorMargin);
2102
+ }
2103
+ let a = 0;
2104
+ return c.forEach((i) => {
2105
+ const n = gt(o);
2106
+ let h = i.actorKeys.reduce((f, E) => f += e.get(E).width + (e.get(E).margin || 0), 0);
2107
+ h -= 2 * o.boxTextMargin, i.wrap && (i.name = Y.wrapLabel(i.name, h - 2 * o.wrapPadding, n));
2108
+ const d = Y.calculateTextDimensions(i.name, n);
2109
+ a = I.getMax(d.height, a);
2110
+ const r = I.getMax(h, d.width + 2 * o.wrapPadding);
2111
+ if (i.margin = o.boxTextMargin, h < r) {
2112
+ const f = (r - h) / 2;
2113
+ i.margin += f;
2114
+ }
2115
+ }), c.forEach((i) => i.textMaxHeight = a), I.getMax(s, o.height);
2116
+ }
2117
+ u(he, "calculateActorMargins");
2118
+ var cs = /* @__PURE__ */ u(async function(e, t, c) {
2119
+ const s = t.get(e.from), a = t.get(e.to), i = s.x, n = a.x, h = e.wrap && e.message;
2120
+ let d = ot(e.message) ? await bt(e.message, $()) : Y.calculateTextDimensions(
2121
+ h ? Y.wrapLabel(e.message, o.width, xt(o)) : e.message,
2122
+ xt(o)
2123
+ );
2124
+ const r = {
2125
+ width: h ? o.width : I.getMax(o.width, d.width + 2 * o.noteMargin),
2126
+ height: 0,
2127
+ startx: s.x,
2128
+ stopx: 0,
2129
+ starty: 0,
2130
+ stopy: 0,
2131
+ message: e.message
2132
+ };
2133
+ return e.placement === c.db.PLACEMENT.RIGHTOF ? (r.width = h ? I.getMax(o.width, d.width) : I.getMax(
2134
+ s.width / 2 + a.width / 2,
2135
+ d.width + 2 * o.noteMargin
2136
+ ), r.startx = i + (s.width + o.actorMargin) / 2) : e.placement === c.db.PLACEMENT.LEFTOF ? (r.width = h ? I.getMax(o.width, d.width + 2 * o.noteMargin) : I.getMax(
2137
+ s.width / 2 + a.width / 2,
2138
+ d.width + 2 * o.noteMargin
2139
+ ), r.startx = i - r.width + (s.width - o.actorMargin) / 2) : e.to === e.from ? (d = Y.calculateTextDimensions(
2140
+ h ? Y.wrapLabel(e.message, I.getMax(o.width, s.width), xt(o)) : e.message,
2141
+ xt(o)
2142
+ ), r.width = h ? I.getMax(o.width, s.width) : I.getMax(s.width, o.width, d.width + 2 * o.noteMargin), r.startx = i + (s.width - r.width) / 2) : (r.width = Math.abs(i + s.width / 2 - (n + a.width / 2)) + o.actorMargin, r.startx = i < n ? i + s.width / 2 - o.actorMargin / 2 : n + a.width / 2 - o.actorMargin / 2), h && (r.message = Y.wrapLabel(
2143
+ e.message,
2144
+ r.width - 2 * o.wrapPadding,
2145
+ xt(o)
2146
+ )), G.debug(
2147
+ `NM:[${r.startx},${r.stopx},${r.starty},${r.stopy}:${r.width},${r.height}=${e.message}]`
2148
+ ), r;
2149
+ }, "buildNoteModel"), ls = /* @__PURE__ */ u(function(e, t, c) {
2150
+ if (![
2151
+ c.db.LINETYPE.SOLID_OPEN,
2152
+ c.db.LINETYPE.DOTTED_OPEN,
2153
+ c.db.LINETYPE.SOLID,
2154
+ c.db.LINETYPE.DOTTED,
2155
+ c.db.LINETYPE.SOLID_CROSS,
2156
+ c.db.LINETYPE.DOTTED_CROSS,
2157
+ c.db.LINETYPE.SOLID_POINT,
2158
+ c.db.LINETYPE.DOTTED_POINT,
2159
+ c.db.LINETYPE.BIDIRECTIONAL_SOLID,
2160
+ c.db.LINETYPE.BIDIRECTIONAL_DOTTED
2161
+ ].includes(e.type))
2162
+ return {};
2163
+ const [s, a] = Jt(e.from, t), [i, n] = Jt(e.to, t), h = s <= i;
2164
+ let d = h ? a : s, r = h ? i : n;
2165
+ const f = Math.abs(i - n) > 2, E = /* @__PURE__ */ u((w) => h ? -w : w, "adjustValue");
2166
+ e.from === e.to ? r = d : (e.activate && !f && (r += E(o.activationWidth / 2 - 1)), [c.db.LINETYPE.SOLID_OPEN, c.db.LINETYPE.DOTTED_OPEN].includes(e.type) || (r += E(3)), [c.db.LINETYPE.BIDIRECTIONAL_SOLID, c.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(
2167
+ e.type
2168
+ ) && (d -= E(3)));
2169
+ const g = [s, a, i, n], T = Math.abs(d - r);
2170
+ e.wrap && e.message && (e.message = Y.wrapLabel(
2171
+ e.message,
2172
+ I.getMax(T + 2 * o.wrapPadding, o.width),
2173
+ gt(o)
2174
+ ));
2175
+ const m = Y.calculateTextDimensions(e.message, gt(o));
2176
+ return {
2177
+ width: I.getMax(
2178
+ e.wrap ? 0 : m.width + 2 * o.wrapPadding,
2179
+ T + 2 * o.wrapPadding,
2180
+ o.width
2181
+ ),
2182
+ height: 0,
2183
+ startx: d,
2184
+ stopx: r,
2185
+ starty: 0,
2186
+ stopy: 0,
2187
+ message: e.message,
2188
+ type: e.type,
2189
+ wrap: e.wrap,
2190
+ fromBounds: Math.min.apply(null, g),
2191
+ toBounds: Math.max.apply(null, g)
2192
+ };
2193
+ }, "buildMessageModel"), hs = /* @__PURE__ */ u(async function(e, t, c, s) {
2194
+ const a = {}, i = [];
2195
+ let n, h, d;
2196
+ for (const r of e) {
2197
+ switch (r.type) {
2198
+ case s.db.LINETYPE.LOOP_START:
2199
+ case s.db.LINETYPE.ALT_START:
2200
+ case s.db.LINETYPE.OPT_START:
2201
+ case s.db.LINETYPE.PAR_START:
2202
+ case s.db.LINETYPE.PAR_OVER_START:
2203
+ case s.db.LINETYPE.CRITICAL_START:
2204
+ case s.db.LINETYPE.BREAK_START:
2205
+ i.push({
2206
+ id: r.id,
2207
+ msg: r.message,
2208
+ from: Number.MAX_SAFE_INTEGER,
2209
+ to: Number.MIN_SAFE_INTEGER,
2210
+ width: 0
2211
+ });
2212
+ break;
2213
+ case s.db.LINETYPE.ALT_ELSE:
2214
+ case s.db.LINETYPE.PAR_AND:
2215
+ case s.db.LINETYPE.CRITICAL_OPTION:
2216
+ r.message && (n = i.pop(), a[n.id] = n, a[r.id] = n, i.push(n));
2217
+ break;
2218
+ case s.db.LINETYPE.LOOP_END:
2219
+ case s.db.LINETYPE.ALT_END:
2220
+ case s.db.LINETYPE.OPT_END:
2221
+ case s.db.LINETYPE.PAR_END:
2222
+ case s.db.LINETYPE.CRITICAL_END:
2223
+ case s.db.LINETYPE.BREAK_END:
2224
+ n = i.pop(), a[n.id] = n;
2225
+ break;
2226
+ case s.db.LINETYPE.ACTIVE_START:
2227
+ {
2228
+ const E = t.get(r.from ? r.from : r.to.actor), g = kt(r.from ? r.from : r.to.actor).length, T = E.x + E.width / 2 + (g - 1) * o.activationWidth / 2, m = {
2229
+ startx: T,
2230
+ stopx: T + o.activationWidth,
2231
+ actor: r.from,
2232
+ enabled: !0
2233
+ };
2234
+ x.activations.push(m);
2235
+ }
2236
+ break;
2237
+ case s.db.LINETYPE.ACTIVE_END:
2238
+ {
2239
+ const E = x.activations.map((g) => g.actor).lastIndexOf(r.from);
2240
+ x.activations.splice(E, 1).splice(0, 1);
2241
+ }
2242
+ break;
2243
+ }
2244
+ r.placement !== void 0 ? (h = await cs(r, t, s), r.noteModel = h, i.forEach((E) => {
2245
+ n = E, n.from = I.getMin(n.from, h.startx), n.to = I.getMax(n.to, h.startx + h.width), n.width = I.getMax(n.width, Math.abs(n.from - n.to)) - o.labelBoxWidth;
2246
+ })) : (d = ls(r, t, s), r.msgModel = d, d.startx && d.stopx && i.length > 0 && i.forEach((E) => {
2247
+ if (n = E, d.startx === d.stopx) {
2248
+ const g = t.get(r.from), T = t.get(r.to);
2249
+ n.from = I.getMin(
2250
+ g.x - d.width / 2,
2251
+ g.x - g.width / 2,
2252
+ n.from
2253
+ ), n.to = I.getMax(
2254
+ T.x + d.width / 2,
2255
+ T.x + g.width / 2,
2256
+ n.to
2257
+ ), n.width = I.getMax(n.width, Math.abs(n.to - n.from)) - o.labelBoxWidth;
2258
+ } else
2259
+ n.from = I.getMin(d.startx, n.from), n.to = I.getMax(d.stopx, n.to), n.width = I.getMax(n.width, d.width) - o.labelBoxWidth;
2260
+ }));
2261
+ }
2262
+ return x.activations = [], G.debug("Loop type widths:", a), a;
2263
+ }, "calculateLoopBounds"), ds = {
2264
+ bounds: x,
2265
+ drawActors: Vt,
2266
+ drawActorsPopup: ne,
2267
+ setConf: oe,
2268
+ draw: ns
2269
+ }, xs = {
2270
+ parser: Se,
2271
+ get db() {
2272
+ return new Ce();
2273
+ },
2274
+ renderer: ds,
2275
+ styles: Be,
2276
+ init: /* @__PURE__ */ u((e) => {
2277
+ e.sequence || (e.sequence = {}), e.wrap && (e.sequence.wrap = e.wrap, me({ sequence: { wrap: e.wrap } }));
2278
+ }, "init")
2279
+ };
2280
+ export {
2281
+ xs as diagram
2282
+ };