@schmitech/chatbot-widget 0.5.3 → 0.5.4

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