@readme/markdown 7.6.7 → 7.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/components/Code/index.tsx +4 -0
  2. package/components/Code/style.scss +6 -0
  3. package/components/CodeTabs/index.tsx +25 -2
  4. package/components/Image/style.scss +1 -4
  5. package/dist/10.js +22718 -0
  6. package/dist/10.node.js +22721 -0
  7. package/dist/11.js +1440 -0
  8. package/dist/11.node.js +1443 -0
  9. package/dist/120.js +19 -0
  10. package/dist/120.node.js +22 -0
  11. package/dist/134.js +19 -0
  12. package/dist/134.node.js +22 -0
  13. package/dist/150.js +1888 -0
  14. package/dist/150.node.js +1891 -0
  15. package/dist/17.js +1373 -0
  16. package/dist/17.node.js +1376 -0
  17. package/dist/246.js +1929 -0
  18. package/dist/246.node.js +1932 -0
  19. package/dist/351.js +2400 -0
  20. package/dist/351.node.js +2403 -0
  21. package/dist/366.js +1181 -0
  22. package/dist/366.node.js +1184 -0
  23. package/dist/403.js +2192 -0
  24. package/dist/403.node.js +2195 -0
  25. package/dist/429.js +11130 -0
  26. package/dist/429.node.js +11133 -0
  27. package/dist/485.js +514 -0
  28. package/dist/485.node.js +517 -0
  29. package/dist/488.js +55 -0
  30. package/dist/488.node.js +58 -0
  31. package/dist/489.js +18472 -0
  32. package/dist/489.node.js +18475 -0
  33. package/dist/510.js +246 -0
  34. package/dist/510.node.js +249 -0
  35. package/dist/52.js +808 -0
  36. package/dist/52.node.js +811 -0
  37. package/dist/550.node.js +1456 -0
  38. package/dist/551.js +2722 -0
  39. package/dist/551.node.js +2725 -0
  40. package/dist/617.js +19 -0
  41. package/dist/617.node.js +22 -0
  42. package/dist/687.js +3671 -0
  43. package/dist/687.node.js +3674 -0
  44. package/dist/745.js +7504 -0
  45. package/dist/745.node.js +7507 -0
  46. package/dist/775.js +1900 -0
  47. package/dist/775.node.js +1903 -0
  48. package/dist/786.js +31378 -0
  49. package/dist/786.node.js +31381 -0
  50. package/dist/788.js +1021 -0
  51. package/dist/788.node.js +1024 -0
  52. package/dist/81.js +382 -0
  53. package/dist/81.node.js +385 -0
  54. package/dist/849.js +2586 -0
  55. package/dist/849.node.js +2589 -0
  56. package/dist/863.js +19 -0
  57. package/dist/863.node.js +22 -0
  58. package/dist/867.js +1414 -0
  59. package/dist/867.node.js +1417 -0
  60. package/dist/871.js +1533 -0
  61. package/dist/881.js +1276 -0
  62. package/dist/881.node.js +1279 -0
  63. package/dist/885.js +48 -0
  64. package/dist/885.node.js +51 -0
  65. package/dist/896.js +1613 -0
  66. package/dist/896.node.js +1616 -0
  67. package/dist/906.js +1815 -0
  68. package/dist/906.node.js +1818 -0
  69. package/dist/91.js +19 -0
  70. package/dist/91.node.js +22 -0
  71. package/dist/940.js +3359 -0
  72. package/dist/940.node.js +3362 -0
  73. package/dist/952.js +243 -0
  74. package/dist/952.node.js +246 -0
  75. package/dist/995.js +5734 -0
  76. package/dist/995.node.js +5737 -0
  77. package/dist/components/Code/index.d.ts +1 -1
  78. package/dist/main.css +1 -1
  79. package/dist/main.js +94897 -73869
  80. package/dist/main.node.js +103618 -82699
  81. package/package.json +3 -3
package/dist/687.js ADDED
@@ -0,0 +1,3671 @@
1
+ "use strict";
2
+ (self["webpackChunk_readme_markdown"] = self["webpackChunk_readme_markdown"] || []).push([[687],{
3
+
4
+ /***/ 1271:
5
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6
+
7
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8
+ /* harmony export */ m: () => (/* binding */ ImperativeState)
9
+ /* harmony export */ });
10
+ /* harmony import */ var _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6322);
11
+
12
+
13
+ // src/utils/imperativeState.ts
14
+ var ImperativeState = class {
15
+ /**
16
+ * @param init - Function that creates the default state.
17
+ */
18
+ constructor(init) {
19
+ this.init = init;
20
+ this.records = this.init();
21
+ }
22
+ static {
23
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .K2)(this, "ImperativeState");
24
+ }
25
+ reset() {
26
+ this.records = this.init();
27
+ }
28
+ };
29
+
30
+
31
+
32
+
33
+ /***/ }),
34
+
35
+ /***/ 242:
36
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
37
+
38
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
39
+ /* harmony export */ CP: () => (/* binding */ drawEmbeddedImage),
40
+ /* harmony export */ HT: () => (/* binding */ getTextObj),
41
+ /* harmony export */ PB: () => (/* binding */ getNoteRect),
42
+ /* harmony export */ aC: () => (/* binding */ drawImage),
43
+ /* harmony export */ lC: () => (/* binding */ drawBackgroundRect),
44
+ /* harmony export */ m: () => (/* binding */ drawText),
45
+ /* harmony export */ tk: () => (/* binding */ drawRect)
46
+ /* harmony export */ });
47
+ /* harmony import */ var _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6322);
48
+ /* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6750);
49
+
50
+
51
+ // src/diagrams/common/svgDrawCommon.ts
52
+
53
+ var drawRect = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .K2)((element, rectData) => {
54
+ const rectElement = element.append("rect");
55
+ rectElement.attr("x", rectData.x);
56
+ rectElement.attr("y", rectData.y);
57
+ rectElement.attr("fill", rectData.fill);
58
+ rectElement.attr("stroke", rectData.stroke);
59
+ rectElement.attr("width", rectData.width);
60
+ rectElement.attr("height", rectData.height);
61
+ if (rectData.name) {
62
+ rectElement.attr("name", rectData.name);
63
+ }
64
+ if (rectData.rx) {
65
+ rectElement.attr("rx", rectData.rx);
66
+ }
67
+ if (rectData.ry) {
68
+ rectElement.attr("ry", rectData.ry);
69
+ }
70
+ if (rectData.attrs !== void 0) {
71
+ for (const attrKey in rectData.attrs) {
72
+ rectElement.attr(attrKey, rectData.attrs[attrKey]);
73
+ }
74
+ }
75
+ if (rectData.class) {
76
+ rectElement.attr("class", rectData.class);
77
+ }
78
+ return rectElement;
79
+ }, "drawRect");
80
+ var drawBackgroundRect = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .K2)((element, bounds) => {
81
+ const rectData = {
82
+ x: bounds.startx,
83
+ y: bounds.starty,
84
+ width: bounds.stopx - bounds.startx,
85
+ height: bounds.stopy - bounds.starty,
86
+ fill: bounds.fill,
87
+ stroke: bounds.stroke,
88
+ class: "rect"
89
+ };
90
+ const rectElement = drawRect(element, rectData);
91
+ rectElement.lower();
92
+ }, "drawBackgroundRect");
93
+ var drawText = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .K2)((element, textData) => {
94
+ const nText = textData.text.replace(_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_0__/* .lineBreakRegex */ .H1, " ");
95
+ const textElem = element.append("text");
96
+ textElem.attr("x", textData.x);
97
+ textElem.attr("y", textData.y);
98
+ textElem.attr("class", "legend");
99
+ textElem.style("text-anchor", textData.anchor);
100
+ if (textData.class) {
101
+ textElem.attr("class", textData.class);
102
+ }
103
+ const tspan = textElem.append("tspan");
104
+ tspan.attr("x", textData.x + textData.textMargin * 2);
105
+ tspan.text(nText);
106
+ return textElem;
107
+ }, "drawText");
108
+ var drawImage = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .K2)((elem, x, y, link) => {
109
+ const imageElement = elem.append("image");
110
+ imageElement.attr("x", x);
111
+ imageElement.attr("y", y);
112
+ const sanitizedLink = (0,_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__/* .sanitizeUrl */ .J)(link);
113
+ imageElement.attr("xlink:href", sanitizedLink);
114
+ }, "drawImage");
115
+ var drawEmbeddedImage = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .K2)((element, x, y, link) => {
116
+ const imageElement = element.append("use");
117
+ imageElement.attr("x", x);
118
+ imageElement.attr("y", y);
119
+ const sanitizedLink = (0,_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__/* .sanitizeUrl */ .J)(link);
120
+ imageElement.attr("xlink:href", `#${sanitizedLink}`);
121
+ }, "drawEmbeddedImage");
122
+ var getNoteRect = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .K2)(() => {
123
+ const noteRectData = {
124
+ x: 0,
125
+ y: 0,
126
+ width: 100,
127
+ height: 100,
128
+ fill: "#EDF2AE",
129
+ stroke: "#666",
130
+ anchor: "start",
131
+ rx: 0,
132
+ ry: 0
133
+ };
134
+ return noteRectData;
135
+ }, "getNoteRect");
136
+ var getTextObj = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_0__/* .__name */ .K2)(() => {
137
+ const testObject = {
138
+ x: 0,
139
+ y: 0,
140
+ width: 100,
141
+ height: 100,
142
+ "text-anchor": "start",
143
+ style: "#666",
144
+ textMargin: 0,
145
+ rx: 0,
146
+ ry: 0,
147
+ tspan: true
148
+ };
149
+ return testObject;
150
+ }, "getTextObj");
151
+
152
+
153
+
154
+
155
+ /***/ }),
156
+
157
+ /***/ 6687:
158
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
159
+
160
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
161
+ /* harmony export */ diagram: () => (/* binding */ diagram)
162
+ /* harmony export */ });
163
+ /* harmony import */ var _chunk_V35ELUW5_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(242);
164
+ /* harmony import */ var _chunk_6JKP7OK7_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1271);
165
+ /* harmony import */ var _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2843);
166
+ /* harmony import */ var _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6322);
167
+ /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8066);
168
+ /* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6750);
169
+
170
+
171
+
172
+
173
+
174
+ // src/diagrams/sequence/parser/sequenceDiagram.jison
175
+ var parser = function() {
176
+ var o = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(k, v, o2, l) {
177
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
178
+ return o2;
179
+ }, "o"), $V0 = [1, 2], $V1 = [1, 3], $V2 = [1, 4], $V3 = [2, 4], $V4 = [1, 9], $V5 = [1, 11], $V6 = [1, 13], $V7 = [1, 14], $V8 = [1, 16], $V9 = [1, 17], $Va = [1, 18], $Vb = [1, 24], $Vc = [1, 25], $Vd = [1, 26], $Ve = [1, 27], $Vf = [1, 28], $Vg = [1, 29], $Vh = [1, 30], $Vi = [1, 31], $Vj = [1, 32], $Vk = [1, 33], $Vl = [1, 34], $Vm = [1, 35], $Vn = [1, 36], $Vo = [1, 37], $Vp = [1, 38], $Vq = [1, 39], $Vr = [1, 41], $Vs = [1, 42], $Vt = [1, 43], $Vu = [1, 44], $Vv = [1, 45], $Vw = [1, 46], $Vx = [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], $Vy = [4, 5, 16, 50, 52, 53], $Vz = [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], $VA = [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], $VB = [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], $VC = [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], $VD = [68, 69, 70], $VE = [1, 122];
180
+ var parser2 = {
181
+ trace: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function trace() {
182
+ }, "trace"),
183
+ yy: {},
184
+ symbols_: { "error": 2, "start": 3, "SPACE": 4, "NEWLINE": 5, "SD": 6, "document": 7, "line": 8, "statement": 9, "box_section": 10, "box_line": 11, "participant_statement": 12, "create": 13, "box": 14, "restOfLine": 15, "end": 16, "signal": 17, "autonumber": 18, "NUM": 19, "off": 20, "activate": 21, "actor": 22, "deactivate": 23, "note_statement": 24, "links_statement": 25, "link_statement": 26, "properties_statement": 27, "details_statement": 28, "title": 29, "legacy_title": 30, "acc_title": 31, "acc_title_value": 32, "acc_descr": 33, "acc_descr_value": 34, "acc_descr_multiline_value": 35, "loop": 36, "rect": 37, "opt": 38, "alt": 39, "else_sections": 40, "par": 41, "par_sections": 42, "par_over": 43, "critical": 44, "option_sections": 45, "break": 46, "option": 47, "and": 48, "else": 49, "participant": 50, "AS": 51, "participant_actor": 52, "destroy": 53, "note": 54, "placement": 55, "text2": 56, "over": 57, "actor_pair": 58, "links": 59, "link": 60, "properties": 61, "details": 62, "spaceList": 63, ",": 64, "left_of": 65, "right_of": 66, "signaltype": 67, "+": 68, "-": 69, "ACTOR": 70, "SOLID_OPEN_ARROW": 71, "DOTTED_OPEN_ARROW": 72, "SOLID_ARROW": 73, "BIDIRECTIONAL_SOLID_ARROW": 74, "DOTTED_ARROW": 75, "BIDIRECTIONAL_DOTTED_ARROW": 76, "SOLID_CROSS": 77, "DOTTED_CROSS": 78, "SOLID_POINT": 79, "DOTTED_POINT": 80, "TXT": 81, "$accept": 0, "$end": 1 },
185
+ terminals_: { 2: "error", 4: "SPACE", 5: "NEWLINE", 6: "SD", 13: "create", 14: "box", 15: "restOfLine", 16: "end", 18: "autonumber", 19: "NUM", 20: "off", 21: "activate", 23: "deactivate", 29: "title", 30: "legacy_title", 31: "acc_title", 32: "acc_title_value", 33: "acc_descr", 34: "acc_descr_value", 35: "acc_descr_multiline_value", 36: "loop", 37: "rect", 38: "opt", 39: "alt", 41: "par", 43: "par_over", 44: "critical", 46: "break", 47: "option", 48: "and", 49: "else", 50: "participant", 51: "AS", 52: "participant_actor", 53: "destroy", 54: "note", 57: "over", 59: "links", 60: "link", 61: "properties", 62: "details", 64: ",", 65: "left_of", 66: "right_of", 68: "+", 69: "-", 70: "ACTOR", 71: "SOLID_OPEN_ARROW", 72: "DOTTED_OPEN_ARROW", 73: "SOLID_ARROW", 74: "BIDIRECTIONAL_SOLID_ARROW", 75: "DOTTED_ARROW", 76: "BIDIRECTIONAL_DOTTED_ARROW", 77: "SOLID_CROSS", 78: "DOTTED_CROSS", 79: "SOLID_POINT", 80: "DOTTED_POINT", 81: "TXT" },
186
+ productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [10, 0], [10, 2], [11, 2], [11, 1], [11, 1], [9, 1], [9, 2], [9, 4], [9, 2], [9, 4], [9, 3], [9, 3], [9, 2], [9, 3], [9, 3], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [45, 1], [45, 4], [42, 1], [42, 4], [40, 1], [40, 4], [12, 5], [12, 3], [12, 5], [12, 3], [12, 3], [24, 4], [24, 4], [25, 3], [26, 3], [27, 3], [28, 3], [63, 2], [63, 1], [58, 3], [58, 1], [55, 1], [55, 1], [17, 5], [17, 5], [17, 4], [22, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [56, 1]],
187
+ performAction: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
188
+ var $0 = $$.length - 1;
189
+ switch (yystate) {
190
+ case 3:
191
+ yy.apply($$[$0]);
192
+ return $$[$0];
193
+ break;
194
+ case 4:
195
+ case 9:
196
+ this.$ = [];
197
+ break;
198
+ case 5:
199
+ case 10:
200
+ $$[$0 - 1].push($$[$0]);
201
+ this.$ = $$[$0 - 1];
202
+ break;
203
+ case 6:
204
+ case 7:
205
+ case 11:
206
+ case 12:
207
+ this.$ = $$[$0];
208
+ break;
209
+ case 8:
210
+ case 13:
211
+ this.$ = [];
212
+ break;
213
+ case 15:
214
+ $$[$0].type = "createParticipant";
215
+ this.$ = $$[$0];
216
+ break;
217
+ case 16:
218
+ $$[$0 - 1].unshift({ type: "boxStart", boxData: yy.parseBoxData($$[$0 - 2]) });
219
+ $$[$0 - 1].push({ type: "boxEnd", boxText: $$[$0 - 2] });
220
+ this.$ = $$[$0 - 1];
221
+ break;
222
+ case 18:
223
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number($$[$0 - 2]), sequenceIndexStep: Number($$[$0 - 1]), sequenceVisible: true, signalType: yy.LINETYPE.AUTONUMBER };
224
+ break;
225
+ case 19:
226
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number($$[$0 - 1]), sequenceIndexStep: 1, sequenceVisible: true, signalType: yy.LINETYPE.AUTONUMBER };
227
+ break;
228
+ case 20:
229
+ this.$ = { type: "sequenceIndex", sequenceVisible: false, signalType: yy.LINETYPE.AUTONUMBER };
230
+ break;
231
+ case 21:
232
+ this.$ = { type: "sequenceIndex", sequenceVisible: true, signalType: yy.LINETYPE.AUTONUMBER };
233
+ break;
234
+ case 22:
235
+ this.$ = { type: "activeStart", signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1].actor };
236
+ break;
237
+ case 23:
238
+ this.$ = { type: "activeEnd", signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 1].actor };
239
+ break;
240
+ case 29:
241
+ yy.setDiagramTitle($$[$0].substring(6));
242
+ this.$ = $$[$0].substring(6);
243
+ break;
244
+ case 30:
245
+ yy.setDiagramTitle($$[$0].substring(7));
246
+ this.$ = $$[$0].substring(7);
247
+ break;
248
+ case 31:
249
+ this.$ = $$[$0].trim();
250
+ yy.setAccTitle(this.$);
251
+ break;
252
+ case 32:
253
+ case 33:
254
+ this.$ = $$[$0].trim();
255
+ yy.setAccDescription(this.$);
256
+ break;
257
+ case 34:
258
+ $$[$0 - 1].unshift({ type: "loopStart", loopText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.LOOP_START });
259
+ $$[$0 - 1].push({ type: "loopEnd", loopText: $$[$0 - 2], signalType: yy.LINETYPE.LOOP_END });
260
+ this.$ = $$[$0 - 1];
261
+ break;
262
+ case 35:
263
+ $$[$0 - 1].unshift({ type: "rectStart", color: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.RECT_START });
264
+ $$[$0 - 1].push({ type: "rectEnd", color: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.RECT_END });
265
+ this.$ = $$[$0 - 1];
266
+ break;
267
+ case 36:
268
+ $$[$0 - 1].unshift({ type: "optStart", optText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.OPT_START });
269
+ $$[$0 - 1].push({ type: "optEnd", optText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.OPT_END });
270
+ this.$ = $$[$0 - 1];
271
+ break;
272
+ case 37:
273
+ $$[$0 - 1].unshift({ type: "altStart", altText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.ALT_START });
274
+ $$[$0 - 1].push({ type: "altEnd", signalType: yy.LINETYPE.ALT_END });
275
+ this.$ = $$[$0 - 1];
276
+ break;
277
+ case 38:
278
+ $$[$0 - 1].unshift({ type: "parStart", parText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.PAR_START });
279
+ $$[$0 - 1].push({ type: "parEnd", signalType: yy.LINETYPE.PAR_END });
280
+ this.$ = $$[$0 - 1];
281
+ break;
282
+ case 39:
283
+ $$[$0 - 1].unshift({ type: "parStart", parText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.PAR_OVER_START });
284
+ $$[$0 - 1].push({ type: "parEnd", signalType: yy.LINETYPE.PAR_END });
285
+ this.$ = $$[$0 - 1];
286
+ break;
287
+ case 40:
288
+ $$[$0 - 1].unshift({ type: "criticalStart", criticalText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.CRITICAL_START });
289
+ $$[$0 - 1].push({ type: "criticalEnd", signalType: yy.LINETYPE.CRITICAL_END });
290
+ this.$ = $$[$0 - 1];
291
+ break;
292
+ case 41:
293
+ $$[$0 - 1].unshift({ type: "breakStart", breakText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.BREAK_START });
294
+ $$[$0 - 1].push({ type: "breakEnd", optText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.BREAK_END });
295
+ this.$ = $$[$0 - 1];
296
+ break;
297
+ case 43:
298
+ this.$ = $$[$0 - 3].concat([{ type: "option", optionText: yy.parseMessage($$[$0 - 1]), signalType: yy.LINETYPE.CRITICAL_OPTION }, $$[$0]]);
299
+ break;
300
+ case 45:
301
+ this.$ = $$[$0 - 3].concat([{ type: "and", parText: yy.parseMessage($$[$0 - 1]), signalType: yy.LINETYPE.PAR_AND }, $$[$0]]);
302
+ break;
303
+ case 47:
304
+ this.$ = $$[$0 - 3].concat([{ type: "else", altText: yy.parseMessage($$[$0 - 1]), signalType: yy.LINETYPE.ALT_ELSE }, $$[$0]]);
305
+ break;
306
+ case 48:
307
+ $$[$0 - 3].draw = "participant";
308
+ $$[$0 - 3].type = "addParticipant";
309
+ $$[$0 - 3].description = yy.parseMessage($$[$0 - 1]);
310
+ this.$ = $$[$0 - 3];
311
+ break;
312
+ case 49:
313
+ $$[$0 - 1].draw = "participant";
314
+ $$[$0 - 1].type = "addParticipant";
315
+ this.$ = $$[$0 - 1];
316
+ break;
317
+ case 50:
318
+ $$[$0 - 3].draw = "actor";
319
+ $$[$0 - 3].type = "addParticipant";
320
+ $$[$0 - 3].description = yy.parseMessage($$[$0 - 1]);
321
+ this.$ = $$[$0 - 3];
322
+ break;
323
+ case 51:
324
+ $$[$0 - 1].draw = "actor";
325
+ $$[$0 - 1].type = "addParticipant";
326
+ this.$ = $$[$0 - 1];
327
+ break;
328
+ case 52:
329
+ $$[$0 - 1].type = "destroyParticipant";
330
+ this.$ = $$[$0 - 1];
331
+ break;
332
+ case 53:
333
+ this.$ = [$$[$0 - 1], { type: "addNote", placement: $$[$0 - 2], actor: $$[$0 - 1].actor, text: $$[$0] }];
334
+ break;
335
+ case 54:
336
+ $$[$0 - 2] = [].concat($$[$0 - 1], $$[$0 - 1]).slice(0, 2);
337
+ $$[$0 - 2][0] = $$[$0 - 2][0].actor;
338
+ $$[$0 - 2][1] = $$[$0 - 2][1].actor;
339
+ this.$ = [$$[$0 - 1], { type: "addNote", placement: yy.PLACEMENT.OVER, actor: $$[$0 - 2].slice(0, 2), text: $$[$0] }];
340
+ break;
341
+ case 55:
342
+ this.$ = [$$[$0 - 1], { type: "addLinks", actor: $$[$0 - 1].actor, text: $$[$0] }];
343
+ break;
344
+ case 56:
345
+ this.$ = [$$[$0 - 1], { type: "addALink", actor: $$[$0 - 1].actor, text: $$[$0] }];
346
+ break;
347
+ case 57:
348
+ this.$ = [$$[$0 - 1], { type: "addProperties", actor: $$[$0 - 1].actor, text: $$[$0] }];
349
+ break;
350
+ case 58:
351
+ this.$ = [$$[$0 - 1], { type: "addDetails", actor: $$[$0 - 1].actor, text: $$[$0] }];
352
+ break;
353
+ case 61:
354
+ this.$ = [$$[$0 - 2], $$[$0]];
355
+ break;
356
+ case 62:
357
+ this.$ = $$[$0];
358
+ break;
359
+ case 63:
360
+ this.$ = yy.PLACEMENT.LEFTOF;
361
+ break;
362
+ case 64:
363
+ this.$ = yy.PLACEMENT.RIGHTOF;
364
+ break;
365
+ case 65:
366
+ this.$ = [
367
+ $$[$0 - 4],
368
+ $$[$0 - 1],
369
+ { type: "addMessage", from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0], activate: true },
370
+ { type: "activeStart", signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1].actor }
371
+ ];
372
+ break;
373
+ case 66:
374
+ this.$ = [
375
+ $$[$0 - 4],
376
+ $$[$0 - 1],
377
+ { type: "addMessage", from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0] },
378
+ { type: "activeEnd", signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 4].actor }
379
+ ];
380
+ break;
381
+ case 67:
382
+ this.$ = [$$[$0 - 3], $$[$0 - 1], { type: "addMessage", from: $$[$0 - 3].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 2], msg: $$[$0] }];
383
+ break;
384
+ case 68:
385
+ this.$ = { type: "addParticipant", actor: $$[$0] };
386
+ break;
387
+ case 69:
388
+ this.$ = yy.LINETYPE.SOLID_OPEN;
389
+ break;
390
+ case 70:
391
+ this.$ = yy.LINETYPE.DOTTED_OPEN;
392
+ break;
393
+ case 71:
394
+ this.$ = yy.LINETYPE.SOLID;
395
+ break;
396
+ case 72:
397
+ this.$ = yy.LINETYPE.BIDIRECTIONAL_SOLID;
398
+ break;
399
+ case 73:
400
+ this.$ = yy.LINETYPE.DOTTED;
401
+ break;
402
+ case 74:
403
+ this.$ = yy.LINETYPE.BIDIRECTIONAL_DOTTED;
404
+ break;
405
+ case 75:
406
+ this.$ = yy.LINETYPE.SOLID_CROSS;
407
+ break;
408
+ case 76:
409
+ this.$ = yy.LINETYPE.DOTTED_CROSS;
410
+ break;
411
+ case 77:
412
+ this.$ = yy.LINETYPE.SOLID_POINT;
413
+ break;
414
+ case 78:
415
+ this.$ = yy.LINETYPE.DOTTED_POINT;
416
+ break;
417
+ case 79:
418
+ this.$ = yy.parseMessage($$[$0].trim().substring(1));
419
+ break;
420
+ }
421
+ }, "anonymous"),
422
+ table: [{ 3: 1, 4: $V0, 5: $V1, 6: $V2 }, { 1: [3] }, { 3: 5, 4: $V0, 5: $V1, 6: $V2 }, { 3: 6, 4: $V0, 5: $V1, 6: $V2 }, o([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], $V3, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, o($Vx, [2, 5]), { 9: 47, 12: 12, 13: $V6, 14: $V7, 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, o($Vx, [2, 7]), o($Vx, [2, 8]), o($Vx, [2, 14]), { 12: 48, 50: $Vo, 52: $Vp, 53: $Vq }, { 15: [1, 49] }, { 5: [1, 50] }, { 5: [1, 53], 19: [1, 51], 20: [1, 52] }, { 22: 54, 70: $Vw }, { 22: 55, 70: $Vw }, { 5: [1, 56] }, { 5: [1, 57] }, { 5: [1, 58] }, { 5: [1, 59] }, { 5: [1, 60] }, o($Vx, [2, 29]), o($Vx, [2, 30]), { 32: [1, 61] }, { 34: [1, 62] }, o($Vx, [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: $Vw }, { 22: 72, 70: $Vw }, { 22: 73, 70: $Vw }, { 67: 74, 71: [1, 75], 72: [1, 76], 73: [1, 77], 74: [1, 78], 75: [1, 79], 76: [1, 80], 77: [1, 81], 78: [1, 82], 79: [1, 83], 80: [1, 84] }, { 55: 85, 57: [1, 86], 65: [1, 87], 66: [1, 88] }, { 22: 89, 70: $Vw }, { 22: 90, 70: $Vw }, { 22: 91, 70: $Vw }, { 22: 92, 70: $Vw }, o([5, 51, 64, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81], [2, 68]), o($Vx, [2, 6]), o($Vx, [2, 15]), o($Vy, [2, 9], { 10: 93 }), o($Vx, [2, 17]), { 5: [1, 95], 19: [1, 94] }, { 5: [1, 96] }, o($Vx, [2, 21]), { 5: [1, 97] }, { 5: [1, 98] }, o($Vx, [2, 24]), o($Vx, [2, 25]), o($Vx, [2, 26]), o($Vx, [2, 27]), o($Vx, [2, 28]), o($Vx, [2, 31]), o($Vx, [2, 32]), o($Vz, $V3, { 7: 99 }), o($Vz, $V3, { 7: 100 }), o($Vz, $V3, { 7: 101 }), o($VA, $V3, { 40: 102, 7: 103 }), o($VB, $V3, { 42: 104, 7: 105 }), o($VB, $V3, { 7: 105, 42: 106 }), o($VC, $V3, { 45: 107, 7: 108 }), o($Vz, $V3, { 7: 109 }), { 5: [1, 111], 51: [1, 110] }, { 5: [1, 113], 51: [1, 112] }, { 5: [1, 114] }, { 22: 117, 68: [1, 115], 69: [1, 116], 70: $Vw }, o($VD, [2, 69]), o($VD, [2, 70]), o($VD, [2, 71]), o($VD, [2, 72]), o($VD, [2, 73]), o($VD, [2, 74]), o($VD, [2, 75]), o($VD, [2, 76]), o($VD, [2, 77]), o($VD, [2, 78]), { 22: 118, 70: $Vw }, { 22: 120, 58: 119, 70: $Vw }, { 70: [2, 63] }, { 70: [2, 64] }, { 56: 121, 81: $VE }, { 56: 123, 81: $VE }, { 56: 124, 81: $VE }, { 56: 125, 81: $VE }, { 4: [1, 128], 5: [1, 130], 11: 127, 12: 129, 16: [1, 126], 50: $Vo, 52: $Vp, 53: $Vq }, { 5: [1, 131] }, o($Vx, [2, 19]), o($Vx, [2, 20]), o($Vx, [2, 22]), o($Vx, [2, 23]), { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [1, 132], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [1, 133], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [1, 134], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 16: [1, 135] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [2, 46], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 49: [1, 136], 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 16: [1, 137] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [2, 44], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 48: [1, 138], 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 16: [1, 139] }, { 16: [1, 140] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [2, 42], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 47: [1, 141], 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [1, 142], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 15: [1, 143] }, o($Vx, [2, 49]), { 15: [1, 144] }, o($Vx, [2, 51]), o($Vx, [2, 52]), { 22: 145, 70: $Vw }, { 22: 146, 70: $Vw }, { 56: 147, 81: $VE }, { 56: 148, 81: $VE }, { 56: 149, 81: $VE }, { 64: [1, 150], 81: [2, 62] }, { 5: [2, 55] }, { 5: [2, 79] }, { 5: [2, 56] }, { 5: [2, 57] }, { 5: [2, 58] }, o($Vx, [2, 16]), o($Vy, [2, 10]), { 12: 151, 50: $Vo, 52: $Vp, 53: $Vq }, o($Vy, [2, 12]), o($Vy, [2, 13]), o($Vx, [2, 18]), o($Vx, [2, 34]), o($Vx, [2, 35]), o($Vx, [2, 36]), o($Vx, [2, 37]), { 15: [1, 152] }, o($Vx, [2, 38]), { 15: [1, 153] }, o($Vx, [2, 39]), o($Vx, [2, 40]), { 15: [1, 154] }, o($Vx, [2, 41]), { 5: [1, 155] }, { 5: [1, 156] }, { 56: 157, 81: $VE }, { 56: 158, 81: $VE }, { 5: [2, 67] }, { 5: [2, 53] }, { 5: [2, 54] }, { 22: 159, 70: $Vw }, o($Vy, [2, 11]), o($VA, $V3, { 7: 103, 40: 160 }), o($VB, $V3, { 7: 105, 42: 161 }), o($VC, $V3, { 7: 108, 45: 162 }), o($Vx, [2, 48]), o($Vx, [2, 50]), { 5: [2, 65] }, { 5: [2, 66] }, { 81: [2, 61] }, { 16: [2, 47] }, { 16: [2, 45] }, { 16: [2, 43] }],
423
+ defaultActions: { 5: [2, 1], 6: [2, 2], 87: [2, 63], 88: [2, 64], 121: [2, 55], 122: [2, 79], 123: [2, 56], 124: [2, 57], 125: [2, 58], 147: [2, 67], 148: [2, 53], 149: [2, 54], 157: [2, 65], 158: [2, 66], 159: [2, 61], 160: [2, 47], 161: [2, 45], 162: [2, 43] },
424
+ parseError: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function parseError(str, hash) {
425
+ if (hash.recoverable) {
426
+ this.trace(str);
427
+ } else {
428
+ var error = new Error(str);
429
+ error.hash = hash;
430
+ throw error;
431
+ }
432
+ }, "parseError"),
433
+ parse: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function parse(input) {
434
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
435
+ var args = lstack.slice.call(arguments, 1);
436
+ var lexer2 = Object.create(this.lexer);
437
+ var sharedState = { yy: {} };
438
+ for (var k in this.yy) {
439
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
440
+ sharedState.yy[k] = this.yy[k];
441
+ }
442
+ }
443
+ lexer2.setInput(input, sharedState.yy);
444
+ sharedState.yy.lexer = lexer2;
445
+ sharedState.yy.parser = this;
446
+ if (typeof lexer2.yylloc == "undefined") {
447
+ lexer2.yylloc = {};
448
+ }
449
+ var yyloc = lexer2.yylloc;
450
+ lstack.push(yyloc);
451
+ var ranges = lexer2.options && lexer2.options.ranges;
452
+ if (typeof sharedState.yy.parseError === "function") {
453
+ this.parseError = sharedState.yy.parseError;
454
+ } else {
455
+ this.parseError = Object.getPrototypeOf(this).parseError;
456
+ }
457
+ function popStack(n) {
458
+ stack.length = stack.length - 2 * n;
459
+ vstack.length = vstack.length - n;
460
+ lstack.length = lstack.length - n;
461
+ }
462
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(popStack, "popStack");
463
+ function lex() {
464
+ var token;
465
+ token = tstack.pop() || lexer2.lex() || EOF;
466
+ if (typeof token !== "number") {
467
+ if (token instanceof Array) {
468
+ tstack = token;
469
+ token = tstack.pop();
470
+ }
471
+ token = self.symbols_[token] || token;
472
+ }
473
+ return token;
474
+ }
475
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(lex, "lex");
476
+ var symbol, preErrorSymbol, state2, action, a, r, yyval = {}, p, len, newState, expected;
477
+ while (true) {
478
+ state2 = stack[stack.length - 1];
479
+ if (this.defaultActions[state2]) {
480
+ action = this.defaultActions[state2];
481
+ } else {
482
+ if (symbol === null || typeof symbol == "undefined") {
483
+ symbol = lex();
484
+ }
485
+ action = table[state2] && table[state2][symbol];
486
+ }
487
+ if (typeof action === "undefined" || !action.length || !action[0]) {
488
+ var errStr = "";
489
+ expected = [];
490
+ for (p in table[state2]) {
491
+ if (this.terminals_[p] && p > TERROR) {
492
+ expected.push("'" + this.terminals_[p] + "'");
493
+ }
494
+ }
495
+ if (lexer2.showPosition) {
496
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
497
+ } else {
498
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
499
+ }
500
+ this.parseError(errStr, {
501
+ text: lexer2.match,
502
+ token: this.terminals_[symbol] || symbol,
503
+ line: lexer2.yylineno,
504
+ loc: yyloc,
505
+ expected
506
+ });
507
+ }
508
+ if (action[0] instanceof Array && action.length > 1) {
509
+ throw new Error("Parse Error: multiple actions possible at state: " + state2 + ", token: " + symbol);
510
+ }
511
+ switch (action[0]) {
512
+ case 1:
513
+ stack.push(symbol);
514
+ vstack.push(lexer2.yytext);
515
+ lstack.push(lexer2.yylloc);
516
+ stack.push(action[1]);
517
+ symbol = null;
518
+ if (!preErrorSymbol) {
519
+ yyleng = lexer2.yyleng;
520
+ yytext = lexer2.yytext;
521
+ yylineno = lexer2.yylineno;
522
+ yyloc = lexer2.yylloc;
523
+ if (recovering > 0) {
524
+ recovering--;
525
+ }
526
+ } else {
527
+ symbol = preErrorSymbol;
528
+ preErrorSymbol = null;
529
+ }
530
+ break;
531
+ case 2:
532
+ len = this.productions_[action[1]][1];
533
+ yyval.$ = vstack[vstack.length - len];
534
+ yyval._$ = {
535
+ first_line: lstack[lstack.length - (len || 1)].first_line,
536
+ last_line: lstack[lstack.length - 1].last_line,
537
+ first_column: lstack[lstack.length - (len || 1)].first_column,
538
+ last_column: lstack[lstack.length - 1].last_column
539
+ };
540
+ if (ranges) {
541
+ yyval._$.range = [
542
+ lstack[lstack.length - (len || 1)].range[0],
543
+ lstack[lstack.length - 1].range[1]
544
+ ];
545
+ }
546
+ r = this.performAction.apply(yyval, [
547
+ yytext,
548
+ yyleng,
549
+ yylineno,
550
+ sharedState.yy,
551
+ action[1],
552
+ vstack,
553
+ lstack
554
+ ].concat(args));
555
+ if (typeof r !== "undefined") {
556
+ return r;
557
+ }
558
+ if (len) {
559
+ stack = stack.slice(0, -1 * len * 2);
560
+ vstack = vstack.slice(0, -1 * len);
561
+ lstack = lstack.slice(0, -1 * len);
562
+ }
563
+ stack.push(this.productions_[action[1]][0]);
564
+ vstack.push(yyval.$);
565
+ lstack.push(yyval._$);
566
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
567
+ stack.push(newState);
568
+ break;
569
+ case 3:
570
+ return true;
571
+ }
572
+ }
573
+ return true;
574
+ }, "parse")
575
+ };
576
+ var lexer = /* @__PURE__ */ function() {
577
+ var lexer2 = {
578
+ EOF: 1,
579
+ parseError: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function parseError(str, hash) {
580
+ if (this.yy.parser) {
581
+ this.yy.parser.parseError(str, hash);
582
+ } else {
583
+ throw new Error(str);
584
+ }
585
+ }, "parseError"),
586
+ // resets the lexer, sets new input
587
+ setInput: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(input, yy) {
588
+ this.yy = yy || this.yy || {};
589
+ this._input = input;
590
+ this._more = this._backtrack = this.done = false;
591
+ this.yylineno = this.yyleng = 0;
592
+ this.yytext = this.matched = this.match = "";
593
+ this.conditionStack = ["INITIAL"];
594
+ this.yylloc = {
595
+ first_line: 1,
596
+ first_column: 0,
597
+ last_line: 1,
598
+ last_column: 0
599
+ };
600
+ if (this.options.ranges) {
601
+ this.yylloc.range = [0, 0];
602
+ }
603
+ this.offset = 0;
604
+ return this;
605
+ }, "setInput"),
606
+ // consumes and returns one char from the input
607
+ input: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
608
+ var ch = this._input[0];
609
+ this.yytext += ch;
610
+ this.yyleng++;
611
+ this.offset++;
612
+ this.match += ch;
613
+ this.matched += ch;
614
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
615
+ if (lines) {
616
+ this.yylineno++;
617
+ this.yylloc.last_line++;
618
+ } else {
619
+ this.yylloc.last_column++;
620
+ }
621
+ if (this.options.ranges) {
622
+ this.yylloc.range[1]++;
623
+ }
624
+ this._input = this._input.slice(1);
625
+ return ch;
626
+ }, "input"),
627
+ // unshifts one char (or a string) into the input
628
+ unput: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(ch) {
629
+ var len = ch.length;
630
+ var lines = ch.split(/(?:\r\n?|\n)/g);
631
+ this._input = ch + this._input;
632
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
633
+ this.offset -= len;
634
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
635
+ this.match = this.match.substr(0, this.match.length - 1);
636
+ this.matched = this.matched.substr(0, this.matched.length - 1);
637
+ if (lines.length - 1) {
638
+ this.yylineno -= lines.length - 1;
639
+ }
640
+ var r = this.yylloc.range;
641
+ this.yylloc = {
642
+ first_line: this.yylloc.first_line,
643
+ last_line: this.yylineno + 1,
644
+ first_column: this.yylloc.first_column,
645
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
646
+ };
647
+ if (this.options.ranges) {
648
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
649
+ }
650
+ this.yyleng = this.yytext.length;
651
+ return this;
652
+ }, "unput"),
653
+ // When called from action, caches matched text and appends it on next action
654
+ more: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
655
+ this._more = true;
656
+ return this;
657
+ }, "more"),
658
+ // 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.
659
+ reject: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
660
+ if (this.options.backtrack_lexer) {
661
+ this._backtrack = true;
662
+ } else {
663
+ 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).\n" + this.showPosition(), {
664
+ text: "",
665
+ token: null,
666
+ line: this.yylineno
667
+ });
668
+ }
669
+ return this;
670
+ }, "reject"),
671
+ // retain first n characters of the match
672
+ less: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(n) {
673
+ this.unput(this.match.slice(n));
674
+ }, "less"),
675
+ // displays already matched input, i.e. for error messages
676
+ pastInput: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
677
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
678
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
679
+ }, "pastInput"),
680
+ // displays upcoming input, i.e. for error messages
681
+ upcomingInput: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
682
+ var next = this.match;
683
+ if (next.length < 20) {
684
+ next += this._input.substr(0, 20 - next.length);
685
+ }
686
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
687
+ }, "upcomingInput"),
688
+ // displays the character position where the lexing error occurred, i.e. for error messages
689
+ showPosition: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
690
+ var pre = this.pastInput();
691
+ var c = new Array(pre.length + 1).join("-");
692
+ return pre + this.upcomingInput() + "\n" + c + "^";
693
+ }, "showPosition"),
694
+ // test the lexed token: return FALSE when not a match, otherwise return token
695
+ test_match: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(match, indexed_rule) {
696
+ var token, lines, backup;
697
+ if (this.options.backtrack_lexer) {
698
+ backup = {
699
+ yylineno: this.yylineno,
700
+ yylloc: {
701
+ first_line: this.yylloc.first_line,
702
+ last_line: this.last_line,
703
+ first_column: this.yylloc.first_column,
704
+ last_column: this.yylloc.last_column
705
+ },
706
+ yytext: this.yytext,
707
+ match: this.match,
708
+ matches: this.matches,
709
+ matched: this.matched,
710
+ yyleng: this.yyleng,
711
+ offset: this.offset,
712
+ _more: this._more,
713
+ _input: this._input,
714
+ yy: this.yy,
715
+ conditionStack: this.conditionStack.slice(0),
716
+ done: this.done
717
+ };
718
+ if (this.options.ranges) {
719
+ backup.yylloc.range = this.yylloc.range.slice(0);
720
+ }
721
+ }
722
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
723
+ if (lines) {
724
+ this.yylineno += lines.length;
725
+ }
726
+ this.yylloc = {
727
+ first_line: this.yylloc.last_line,
728
+ last_line: this.yylineno + 1,
729
+ first_column: this.yylloc.last_column,
730
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
731
+ };
732
+ this.yytext += match[0];
733
+ this.match += match[0];
734
+ this.matches = match;
735
+ this.yyleng = this.yytext.length;
736
+ if (this.options.ranges) {
737
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
738
+ }
739
+ this._more = false;
740
+ this._backtrack = false;
741
+ this._input = this._input.slice(match[0].length);
742
+ this.matched += match[0];
743
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
744
+ if (this.done && this._input) {
745
+ this.done = false;
746
+ }
747
+ if (token) {
748
+ return token;
749
+ } else if (this._backtrack) {
750
+ for (var k in backup) {
751
+ this[k] = backup[k];
752
+ }
753
+ return false;
754
+ }
755
+ return false;
756
+ }, "test_match"),
757
+ // return next match in input
758
+ next: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
759
+ if (this.done) {
760
+ return this.EOF;
761
+ }
762
+ if (!this._input) {
763
+ this.done = true;
764
+ }
765
+ var token, match, tempMatch, index;
766
+ if (!this._more) {
767
+ this.yytext = "";
768
+ this.match = "";
769
+ }
770
+ var rules = this._currentRules();
771
+ for (var i = 0; i < rules.length; i++) {
772
+ tempMatch = this._input.match(this.rules[rules[i]]);
773
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
774
+ match = tempMatch;
775
+ index = i;
776
+ if (this.options.backtrack_lexer) {
777
+ token = this.test_match(tempMatch, rules[i]);
778
+ if (token !== false) {
779
+ return token;
780
+ } else if (this._backtrack) {
781
+ match = false;
782
+ continue;
783
+ } else {
784
+ return false;
785
+ }
786
+ } else if (!this.options.flex) {
787
+ break;
788
+ }
789
+ }
790
+ }
791
+ if (match) {
792
+ token = this.test_match(match, rules[index]);
793
+ if (token !== false) {
794
+ return token;
795
+ }
796
+ return false;
797
+ }
798
+ if (this._input === "") {
799
+ return this.EOF;
800
+ } else {
801
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
802
+ text: "",
803
+ token: null,
804
+ line: this.yylineno
805
+ });
806
+ }
807
+ }, "next"),
808
+ // return next match that has a token
809
+ lex: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function lex() {
810
+ var r = this.next();
811
+ if (r) {
812
+ return r;
813
+ } else {
814
+ return this.lex();
815
+ }
816
+ }, "lex"),
817
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
818
+ begin: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function begin(condition) {
819
+ this.conditionStack.push(condition);
820
+ }, "begin"),
821
+ // pop the previously active lexer condition state off the condition stack
822
+ popState: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function popState() {
823
+ var n = this.conditionStack.length - 1;
824
+ if (n > 0) {
825
+ return this.conditionStack.pop();
826
+ } else {
827
+ return this.conditionStack[0];
828
+ }
829
+ }, "popState"),
830
+ // produce the lexer rule set which is active for the currently active lexer condition state
831
+ _currentRules: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function _currentRules() {
832
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
833
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
834
+ } else {
835
+ return this.conditions["INITIAL"].rules;
836
+ }
837
+ }, "_currentRules"),
838
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
839
+ topState: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function topState(n) {
840
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
841
+ if (n >= 0) {
842
+ return this.conditionStack[n];
843
+ } else {
844
+ return "INITIAL";
845
+ }
846
+ }, "topState"),
847
+ // alias for begin(condition)
848
+ pushState: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function pushState(condition) {
849
+ this.begin(condition);
850
+ }, "pushState"),
851
+ // return the number of states currently on the stack
852
+ stateStackSize: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function stateStackSize() {
853
+ return this.conditionStack.length;
854
+ }, "stateStackSize"),
855
+ options: { "case-insensitive": true },
856
+ performAction: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
857
+ var YYSTATE = YY_START;
858
+ switch ($avoiding_name_collisions) {
859
+ case 0:
860
+ return 5;
861
+ break;
862
+ case 1:
863
+ break;
864
+ case 2:
865
+ break;
866
+ case 3:
867
+ break;
868
+ case 4:
869
+ break;
870
+ case 5:
871
+ break;
872
+ case 6:
873
+ return 19;
874
+ break;
875
+ case 7:
876
+ this.begin("LINE");
877
+ return 14;
878
+ break;
879
+ case 8:
880
+ this.begin("ID");
881
+ return 50;
882
+ break;
883
+ case 9:
884
+ this.begin("ID");
885
+ return 52;
886
+ break;
887
+ case 10:
888
+ return 13;
889
+ break;
890
+ case 11:
891
+ this.begin("ID");
892
+ return 53;
893
+ break;
894
+ case 12:
895
+ yy_.yytext = yy_.yytext.trim();
896
+ this.begin("ALIAS");
897
+ return 70;
898
+ break;
899
+ case 13:
900
+ this.popState();
901
+ this.popState();
902
+ this.begin("LINE");
903
+ return 51;
904
+ break;
905
+ case 14:
906
+ this.popState();
907
+ this.popState();
908
+ return 5;
909
+ break;
910
+ case 15:
911
+ this.begin("LINE");
912
+ return 36;
913
+ break;
914
+ case 16:
915
+ this.begin("LINE");
916
+ return 37;
917
+ break;
918
+ case 17:
919
+ this.begin("LINE");
920
+ return 38;
921
+ break;
922
+ case 18:
923
+ this.begin("LINE");
924
+ return 39;
925
+ break;
926
+ case 19:
927
+ this.begin("LINE");
928
+ return 49;
929
+ break;
930
+ case 20:
931
+ this.begin("LINE");
932
+ return 41;
933
+ break;
934
+ case 21:
935
+ this.begin("LINE");
936
+ return 43;
937
+ break;
938
+ case 22:
939
+ this.begin("LINE");
940
+ return 48;
941
+ break;
942
+ case 23:
943
+ this.begin("LINE");
944
+ return 44;
945
+ break;
946
+ case 24:
947
+ this.begin("LINE");
948
+ return 47;
949
+ break;
950
+ case 25:
951
+ this.begin("LINE");
952
+ return 46;
953
+ break;
954
+ case 26:
955
+ this.popState();
956
+ return 15;
957
+ break;
958
+ case 27:
959
+ return 16;
960
+ break;
961
+ case 28:
962
+ return 65;
963
+ break;
964
+ case 29:
965
+ return 66;
966
+ break;
967
+ case 30:
968
+ return 59;
969
+ break;
970
+ case 31:
971
+ return 60;
972
+ break;
973
+ case 32:
974
+ return 61;
975
+ break;
976
+ case 33:
977
+ return 62;
978
+ break;
979
+ case 34:
980
+ return 57;
981
+ break;
982
+ case 35:
983
+ return 54;
984
+ break;
985
+ case 36:
986
+ this.begin("ID");
987
+ return 21;
988
+ break;
989
+ case 37:
990
+ this.begin("ID");
991
+ return 23;
992
+ break;
993
+ case 38:
994
+ return 29;
995
+ break;
996
+ case 39:
997
+ return 30;
998
+ break;
999
+ case 40:
1000
+ this.begin("acc_title");
1001
+ return 31;
1002
+ break;
1003
+ case 41:
1004
+ this.popState();
1005
+ return "acc_title_value";
1006
+ break;
1007
+ case 42:
1008
+ this.begin("acc_descr");
1009
+ return 33;
1010
+ break;
1011
+ case 43:
1012
+ this.popState();
1013
+ return "acc_descr_value";
1014
+ break;
1015
+ case 44:
1016
+ this.begin("acc_descr_multiline");
1017
+ break;
1018
+ case 45:
1019
+ this.popState();
1020
+ break;
1021
+ case 46:
1022
+ return "acc_descr_multiline_value";
1023
+ break;
1024
+ case 47:
1025
+ return 6;
1026
+ break;
1027
+ case 48:
1028
+ return 18;
1029
+ break;
1030
+ case 49:
1031
+ return 20;
1032
+ break;
1033
+ case 50:
1034
+ return 64;
1035
+ break;
1036
+ case 51:
1037
+ return 5;
1038
+ break;
1039
+ case 52:
1040
+ yy_.yytext = yy_.yytext.trim();
1041
+ return 70;
1042
+ break;
1043
+ case 53:
1044
+ return 73;
1045
+ break;
1046
+ case 54:
1047
+ return 74;
1048
+ break;
1049
+ case 55:
1050
+ return 75;
1051
+ break;
1052
+ case 56:
1053
+ return 76;
1054
+ break;
1055
+ case 57:
1056
+ return 71;
1057
+ break;
1058
+ case 58:
1059
+ return 72;
1060
+ break;
1061
+ case 59:
1062
+ return 77;
1063
+ break;
1064
+ case 60:
1065
+ return 78;
1066
+ break;
1067
+ case 61:
1068
+ return 79;
1069
+ break;
1070
+ case 62:
1071
+ return 80;
1072
+ break;
1073
+ case 63:
1074
+ return 81;
1075
+ break;
1076
+ case 64:
1077
+ return 68;
1078
+ break;
1079
+ case 65:
1080
+ return 69;
1081
+ break;
1082
+ case 66:
1083
+ return 5;
1084
+ break;
1085
+ case 67:
1086
+ return "INVALID";
1087
+ break;
1088
+ }
1089
+ }, "anonymous"),
1090
+ rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[0-9]+(?=[ \n]+))/i, /^(?:box\b)/i, /^(?:participant\b)/i, /^(?:actor\b)/i, /^(?:create\b)/i, /^(?:destroy\b)/i, /^(?:[^\<->\->:\n,;]+?([\-]*[^\<->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:as\b)/i, /^(?:(?:))/i, /^(?:loop\b)/i, /^(?:rect\b)/i, /^(?:opt\b)/i, /^(?:alt\b)/i, /^(?:else\b)/i, /^(?:par\b)/i, /^(?:par_over\b)/i, /^(?:and\b)/i, /^(?:critical\b)/i, /^(?:option\b)/i, /^(?:break\b)/i, /^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:links\b)/i, /^(?:link\b)/i, /^(?:properties\b)/i, /^(?:details\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:activate\b)/i, /^(?:deactivate\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:title:\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:sequenceDiagram\b)/i, /^(?:autonumber\b)/i, /^(?:off\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^\+\<->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\<->\->:\n,;]+)*)/i, /^(?:->>)/i, /^(?:<<->>)/i, /^(?:-->>)/i, /^(?:<<-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?:-[\)])/i, /^(?:--[\)])/i, /^(?::(?:(?:no)?wrap)?[^#\n;]+)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:$)/i, /^(?:.)/i],
1091
+ conditions: { "acc_descr_multiline": { "rules": [45, 46], "inclusive": false }, "acc_descr": { "rules": [43], "inclusive": false }, "acc_title": { "rules": [41], "inclusive": false }, "ID": { "rules": [2, 3, 12], "inclusive": false }, "ALIAS": { "rules": [2, 3, 13, 14], "inclusive": false }, "LINE": { "rules": [2, 3, 26], "inclusive": false }, "INITIAL": { "rules": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 42, 44, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67], "inclusive": true } }
1092
+ };
1093
+ return lexer2;
1094
+ }();
1095
+ parser2.lexer = lexer;
1096
+ function Parser() {
1097
+ this.yy = {};
1098
+ }
1099
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(Parser, "Parser");
1100
+ Parser.prototype = parser2;
1101
+ parser2.Parser = Parser;
1102
+ return new Parser();
1103
+ }();
1104
+ parser.parser = parser;
1105
+ var sequenceDiagram_default = parser;
1106
+
1107
+ // src/diagrams/sequence/sequenceDb.ts
1108
+ var state = new _chunk_6JKP7OK7_mjs__WEBPACK_IMPORTED_MODULE_1__/* .ImperativeState */ .m(() => ({
1109
+ prevActor: void 0,
1110
+ actors: /* @__PURE__ */ new Map(),
1111
+ createdActors: /* @__PURE__ */ new Map(),
1112
+ destroyedActors: /* @__PURE__ */ new Map(),
1113
+ boxes: [],
1114
+ messages: [],
1115
+ notes: [],
1116
+ sequenceNumbersEnabled: false,
1117
+ wrapEnabled: void 0,
1118
+ currentBox: void 0,
1119
+ lastCreated: void 0,
1120
+ lastDestroyed: void 0
1121
+ }));
1122
+ var addBox = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(data) {
1123
+ state.records.boxes.push({
1124
+ name: data.text,
1125
+ wrap: data.wrap ?? autoWrap(),
1126
+ fill: data.color,
1127
+ actorKeys: []
1128
+ });
1129
+ state.records.currentBox = state.records.boxes.slice(-1)[0];
1130
+ }, "addBox");
1131
+ var addActor = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(id, name, description, type) {
1132
+ let assignedBox = state.records.currentBox;
1133
+ const old = state.records.actors.get(id);
1134
+ if (old) {
1135
+ if (state.records.currentBox && old.box && state.records.currentBox !== old.box) {
1136
+ throw new Error(
1137
+ `A same participant should only be defined in one Box: ${old.name} can't be in '${old.box.name}' and in '${state.records.currentBox.name}' at the same time.`
1138
+ );
1139
+ }
1140
+ assignedBox = old.box ? old.box : state.records.currentBox;
1141
+ old.box = assignedBox;
1142
+ if (old && name === old.name && description == null) {
1143
+ return;
1144
+ }
1145
+ }
1146
+ if (description?.text == null) {
1147
+ description = { text: name, type };
1148
+ }
1149
+ if (type == null || description.text == null) {
1150
+ description = { text: name, type };
1151
+ }
1152
+ state.records.actors.set(id, {
1153
+ box: assignedBox,
1154
+ name,
1155
+ description: description.text,
1156
+ wrap: description.wrap ?? autoWrap(),
1157
+ prevActor: state.records.prevActor,
1158
+ links: {},
1159
+ properties: {},
1160
+ actorCnt: null,
1161
+ rectData: null,
1162
+ type: type ?? "participant"
1163
+ });
1164
+ if (state.records.prevActor) {
1165
+ const prevActorInRecords = state.records.actors.get(state.records.prevActor);
1166
+ if (prevActorInRecords) {
1167
+ prevActorInRecords.nextActor = id;
1168
+ }
1169
+ }
1170
+ if (state.records.currentBox) {
1171
+ state.records.currentBox.actorKeys.push(id);
1172
+ }
1173
+ state.records.prevActor = id;
1174
+ }, "addActor");
1175
+ var activationCount = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((part) => {
1176
+ let i;
1177
+ let count = 0;
1178
+ if (!part) {
1179
+ return 0;
1180
+ }
1181
+ for (i = 0; i < state.records.messages.length; i++) {
1182
+ if (state.records.messages[i].type === LINETYPE.ACTIVE_START && state.records.messages[i].from === part) {
1183
+ count++;
1184
+ }
1185
+ if (state.records.messages[i].type === LINETYPE.ACTIVE_END && state.records.messages[i].from === part) {
1186
+ count--;
1187
+ }
1188
+ }
1189
+ return count;
1190
+ }, "activationCount");
1191
+ var addMessage = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(idFrom, idTo, message, answer) {
1192
+ state.records.messages.push({
1193
+ from: idFrom,
1194
+ to: idTo,
1195
+ message: message.text,
1196
+ wrap: message.wrap ?? autoWrap(),
1197
+ answer
1198
+ });
1199
+ }, "addMessage");
1200
+ var addSignal = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(idFrom, idTo, message, messageType, activate = false) {
1201
+ if (messageType === LINETYPE.ACTIVE_END) {
1202
+ const cnt = activationCount(idFrom ?? "");
1203
+ if (cnt < 1) {
1204
+ const error = new Error("Trying to inactivate an inactive participant (" + idFrom + ")");
1205
+ error.hash = {
1206
+ text: "->>-",
1207
+ token: "->>-",
1208
+ line: "1",
1209
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
1210
+ expected: ["'ACTIVE_PARTICIPANT'"]
1211
+ };
1212
+ throw error;
1213
+ }
1214
+ }
1215
+ state.records.messages.push({
1216
+ from: idFrom,
1217
+ to: idTo,
1218
+ message: message?.text ?? "",
1219
+ wrap: message?.wrap ?? autoWrap(),
1220
+ type: messageType,
1221
+ activate
1222
+ });
1223
+ return true;
1224
+ }, "addSignal");
1225
+ var hasAtLeastOneBox = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
1226
+ return state.records.boxes.length > 0;
1227
+ }, "hasAtLeastOneBox");
1228
+ var hasAtLeastOneBoxWithTitle = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
1229
+ return state.records.boxes.some((b) => b.name);
1230
+ }, "hasAtLeastOneBoxWithTitle");
1231
+ var getMessages = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
1232
+ return state.records.messages;
1233
+ }, "getMessages");
1234
+ var getBoxes = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
1235
+ return state.records.boxes;
1236
+ }, "getBoxes");
1237
+ var getActors = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
1238
+ return state.records.actors;
1239
+ }, "getActors");
1240
+ var getCreatedActors = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
1241
+ return state.records.createdActors;
1242
+ }, "getCreatedActors");
1243
+ var getDestroyedActors = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
1244
+ return state.records.destroyedActors;
1245
+ }, "getDestroyedActors");
1246
+ var getActor = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(id) {
1247
+ return state.records.actors.get(id);
1248
+ }, "getActor");
1249
+ var getActorKeys = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
1250
+ return [...state.records.actors.keys()];
1251
+ }, "getActorKeys");
1252
+ var enableSequenceNumbers = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
1253
+ state.records.sequenceNumbersEnabled = true;
1254
+ }, "enableSequenceNumbers");
1255
+ var disableSequenceNumbers = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
1256
+ state.records.sequenceNumbersEnabled = false;
1257
+ }, "disableSequenceNumbers");
1258
+ var showSequenceNumbers = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(() => state.records.sequenceNumbersEnabled, "showSequenceNumbers");
1259
+ var setWrap = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(wrapSetting) {
1260
+ state.records.wrapEnabled = wrapSetting;
1261
+ }, "setWrap");
1262
+ var extractWrap = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((text) => {
1263
+ if (text === void 0) {
1264
+ return {};
1265
+ }
1266
+ text = text.trim();
1267
+ const wrap = /^:?wrap:/.exec(text) !== null ? true : /^:?nowrap:/.exec(text) !== null ? false : void 0;
1268
+ const cleanedText = (wrap === void 0 ? text : text.replace(/^:?(?:no)?wrap:/, "")).trim();
1269
+ return { cleanedText, wrap };
1270
+ }, "extractWrap");
1271
+ var autoWrap = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(() => {
1272
+ if (state.records.wrapEnabled !== void 0) {
1273
+ return state.records.wrapEnabled;
1274
+ }
1275
+ return (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().sequence?.wrap ?? false;
1276
+ }, "autoWrap");
1277
+ var clear2 = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
1278
+ state.reset();
1279
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .clear */ .IU)();
1280
+ }, "clear");
1281
+ var parseMessage = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(str) {
1282
+ const trimmedStr = str.trim();
1283
+ const { wrap, cleanedText } = extractWrap(trimmedStr);
1284
+ const message = {
1285
+ text: cleanedText,
1286
+ wrap
1287
+ };
1288
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug(`parseMessage: ${JSON.stringify(message)}`);
1289
+ return message;
1290
+ }, "parseMessage");
1291
+ var parseBoxData = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(str) {
1292
+ const match = /^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(str);
1293
+ let color = match?.[1] ? match[1].trim() : "transparent";
1294
+ let title = match?.[2] ? match[2].trim() : void 0;
1295
+ if (window?.CSS) {
1296
+ if (!window.CSS.supports("color", color)) {
1297
+ color = "transparent";
1298
+ title = str.trim();
1299
+ }
1300
+ } else {
1301
+ const style = new Option().style;
1302
+ style.color = color;
1303
+ if (style.color !== color) {
1304
+ color = "transparent";
1305
+ title = str.trim();
1306
+ }
1307
+ }
1308
+ const { wrap, cleanedText } = extractWrap(title);
1309
+ return {
1310
+ text: cleanedText ? (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .sanitizeText */ .jZ)(cleanedText, (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)()) : void 0,
1311
+ color,
1312
+ wrap
1313
+ };
1314
+ }, "parseBoxData");
1315
+ var LINETYPE = {
1316
+ SOLID: 0,
1317
+ DOTTED: 1,
1318
+ NOTE: 2,
1319
+ SOLID_CROSS: 3,
1320
+ DOTTED_CROSS: 4,
1321
+ SOLID_OPEN: 5,
1322
+ DOTTED_OPEN: 6,
1323
+ LOOP_START: 10,
1324
+ LOOP_END: 11,
1325
+ ALT_START: 12,
1326
+ ALT_ELSE: 13,
1327
+ ALT_END: 14,
1328
+ OPT_START: 15,
1329
+ OPT_END: 16,
1330
+ ACTIVE_START: 17,
1331
+ ACTIVE_END: 18,
1332
+ PAR_START: 19,
1333
+ PAR_AND: 20,
1334
+ PAR_END: 21,
1335
+ RECT_START: 22,
1336
+ RECT_END: 23,
1337
+ SOLID_POINT: 24,
1338
+ DOTTED_POINT: 25,
1339
+ AUTONUMBER: 26,
1340
+ CRITICAL_START: 27,
1341
+ CRITICAL_OPTION: 28,
1342
+ CRITICAL_END: 29,
1343
+ BREAK_START: 30,
1344
+ BREAK_END: 31,
1345
+ PAR_OVER_START: 32,
1346
+ BIDIRECTIONAL_SOLID: 33,
1347
+ BIDIRECTIONAL_DOTTED: 34
1348
+ };
1349
+ var ARROWTYPE = {
1350
+ FILLED: 0,
1351
+ OPEN: 1
1352
+ };
1353
+ var PLACEMENT = {
1354
+ LEFTOF: 0,
1355
+ RIGHTOF: 1,
1356
+ OVER: 2
1357
+ };
1358
+ var addNote = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(actor, placement, message) {
1359
+ const note = {
1360
+ actor,
1361
+ placement,
1362
+ message: message.text,
1363
+ wrap: message.wrap ?? autoWrap()
1364
+ };
1365
+ const actors = [].concat(actor, actor);
1366
+ state.records.notes.push(note);
1367
+ state.records.messages.push({
1368
+ from: actors[0],
1369
+ to: actors[1],
1370
+ message: message.text,
1371
+ wrap: message.wrap ?? autoWrap(),
1372
+ type: LINETYPE.NOTE,
1373
+ placement
1374
+ });
1375
+ }, "addNote");
1376
+ var addLinks = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(actorId, text) {
1377
+ const actor = getActor(actorId);
1378
+ try {
1379
+ let sanitizedText = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .sanitizeText */ .jZ)(text.text, (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)());
1380
+ sanitizedText = sanitizedText.replace(/&amp;/g, "&");
1381
+ sanitizedText = sanitizedText.replace(/&equals;/g, "=");
1382
+ const links = JSON.parse(sanitizedText);
1383
+ insertLinks(actor, links);
1384
+ } catch (e) {
1385
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.error("error while parsing actor link text", e);
1386
+ }
1387
+ }, "addLinks");
1388
+ var addALink = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(actorId, text) {
1389
+ const actor = getActor(actorId);
1390
+ try {
1391
+ const links = {};
1392
+ let sanitizedText = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .sanitizeText */ .jZ)(text.text, (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)());
1393
+ const sep = sanitizedText.indexOf("@");
1394
+ sanitizedText = sanitizedText.replace(/&amp;/g, "&");
1395
+ sanitizedText = sanitizedText.replace(/&equals;/g, "=");
1396
+ const label = sanitizedText.slice(0, sep - 1).trim();
1397
+ const link = sanitizedText.slice(sep + 1).trim();
1398
+ links[label] = link;
1399
+ insertLinks(actor, links);
1400
+ } catch (e) {
1401
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.error("error while parsing actor link text", e);
1402
+ }
1403
+ }, "addALink");
1404
+ function insertLinks(actor, links) {
1405
+ if (actor.links == null) {
1406
+ actor.links = links;
1407
+ } else {
1408
+ for (const key in links) {
1409
+ actor.links[key] = links[key];
1410
+ }
1411
+ }
1412
+ }
1413
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(insertLinks, "insertLinks");
1414
+ var addProperties = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(actorId, text) {
1415
+ const actor = getActor(actorId);
1416
+ try {
1417
+ const sanitizedText = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .sanitizeText */ .jZ)(text.text, (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)());
1418
+ const properties = JSON.parse(sanitizedText);
1419
+ insertProperties(actor, properties);
1420
+ } catch (e) {
1421
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.error("error while parsing actor properties text", e);
1422
+ }
1423
+ }, "addProperties");
1424
+ function insertProperties(actor, properties) {
1425
+ if (actor.properties == null) {
1426
+ actor.properties = properties;
1427
+ } else {
1428
+ for (const key in properties) {
1429
+ actor.properties[key] = properties[key];
1430
+ }
1431
+ }
1432
+ }
1433
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(insertProperties, "insertProperties");
1434
+ function boxEnd() {
1435
+ state.records.currentBox = void 0;
1436
+ }
1437
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(boxEnd, "boxEnd");
1438
+ var addDetails = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(actorId, text) {
1439
+ const actor = getActor(actorId);
1440
+ const elem = document.getElementById(text.text);
1441
+ try {
1442
+ const text2 = elem.innerHTML;
1443
+ const details = JSON.parse(text2);
1444
+ if (details.properties) {
1445
+ insertProperties(actor, details.properties);
1446
+ }
1447
+ if (details.links) {
1448
+ insertLinks(actor, details.links);
1449
+ }
1450
+ } catch (e) {
1451
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.error("error while parsing actor details text", e);
1452
+ }
1453
+ }, "addDetails");
1454
+ var getActorProperty = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(actor, key) {
1455
+ if (actor?.properties !== void 0) {
1456
+ return actor.properties[key];
1457
+ }
1458
+ return void 0;
1459
+ }, "getActorProperty");
1460
+ var apply = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(param) {
1461
+ if (Array.isArray(param)) {
1462
+ param.forEach(function(item) {
1463
+ apply(item);
1464
+ });
1465
+ } else {
1466
+ switch (param.type) {
1467
+ case "sequenceIndex":
1468
+ state.records.messages.push({
1469
+ from: void 0,
1470
+ to: void 0,
1471
+ message: {
1472
+ start: param.sequenceIndex,
1473
+ step: param.sequenceIndexStep,
1474
+ visible: param.sequenceVisible
1475
+ },
1476
+ wrap: false,
1477
+ type: param.signalType
1478
+ });
1479
+ break;
1480
+ case "addParticipant":
1481
+ addActor(param.actor, param.actor, param.description, param.draw);
1482
+ break;
1483
+ case "createParticipant":
1484
+ if (state.records.actors.has(param.actor)) {
1485
+ throw new Error(
1486
+ "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"
1487
+ );
1488
+ }
1489
+ state.records.lastCreated = param.actor;
1490
+ addActor(param.actor, param.actor, param.description, param.draw);
1491
+ state.records.createdActors.set(param.actor, state.records.messages.length);
1492
+ break;
1493
+ case "destroyParticipant":
1494
+ state.records.lastDestroyed = param.actor;
1495
+ state.records.destroyedActors.set(param.actor, state.records.messages.length);
1496
+ break;
1497
+ case "activeStart":
1498
+ addSignal(param.actor, void 0, void 0, param.signalType);
1499
+ break;
1500
+ case "activeEnd":
1501
+ addSignal(param.actor, void 0, void 0, param.signalType);
1502
+ break;
1503
+ case "addNote":
1504
+ addNote(param.actor, param.placement, param.text);
1505
+ break;
1506
+ case "addLinks":
1507
+ addLinks(param.actor, param.text);
1508
+ break;
1509
+ case "addALink":
1510
+ addALink(param.actor, param.text);
1511
+ break;
1512
+ case "addProperties":
1513
+ addProperties(param.actor, param.text);
1514
+ break;
1515
+ case "addDetails":
1516
+ addDetails(param.actor, param.text);
1517
+ break;
1518
+ case "addMessage":
1519
+ if (state.records.lastCreated) {
1520
+ if (param.to !== state.records.lastCreated) {
1521
+ throw new Error(
1522
+ "The created participant " + state.records.lastCreated.name + " does not have an associated creating message after its declaration. Please check the sequence diagram."
1523
+ );
1524
+ } else {
1525
+ state.records.lastCreated = void 0;
1526
+ }
1527
+ } else if (state.records.lastDestroyed) {
1528
+ if (param.to !== state.records.lastDestroyed && param.from !== state.records.lastDestroyed) {
1529
+ throw new Error(
1530
+ "The destroyed participant " + state.records.lastDestroyed.name + " does not have an associated destroying message after its declaration. Please check the sequence diagram."
1531
+ );
1532
+ } else {
1533
+ state.records.lastDestroyed = void 0;
1534
+ }
1535
+ }
1536
+ addSignal(param.from, param.to, param.msg, param.signalType, param.activate);
1537
+ break;
1538
+ case "boxStart":
1539
+ addBox(param.boxData);
1540
+ break;
1541
+ case "boxEnd":
1542
+ boxEnd();
1543
+ break;
1544
+ case "loopStart":
1545
+ addSignal(void 0, void 0, param.loopText, param.signalType);
1546
+ break;
1547
+ case "loopEnd":
1548
+ addSignal(void 0, void 0, void 0, param.signalType);
1549
+ break;
1550
+ case "rectStart":
1551
+ addSignal(void 0, void 0, param.color, param.signalType);
1552
+ break;
1553
+ case "rectEnd":
1554
+ addSignal(void 0, void 0, void 0, param.signalType);
1555
+ break;
1556
+ case "optStart":
1557
+ addSignal(void 0, void 0, param.optText, param.signalType);
1558
+ break;
1559
+ case "optEnd":
1560
+ addSignal(void 0, void 0, void 0, param.signalType);
1561
+ break;
1562
+ case "altStart":
1563
+ addSignal(void 0, void 0, param.altText, param.signalType);
1564
+ break;
1565
+ case "else":
1566
+ addSignal(void 0, void 0, param.altText, param.signalType);
1567
+ break;
1568
+ case "altEnd":
1569
+ addSignal(void 0, void 0, void 0, param.signalType);
1570
+ break;
1571
+ case "setAccTitle":
1572
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .setAccTitle */ .SV)(param.text);
1573
+ break;
1574
+ case "parStart":
1575
+ addSignal(void 0, void 0, param.parText, param.signalType);
1576
+ break;
1577
+ case "and":
1578
+ addSignal(void 0, void 0, param.parText, param.signalType);
1579
+ break;
1580
+ case "parEnd":
1581
+ addSignal(void 0, void 0, void 0, param.signalType);
1582
+ break;
1583
+ case "criticalStart":
1584
+ addSignal(void 0, void 0, param.criticalText, param.signalType);
1585
+ break;
1586
+ case "option":
1587
+ addSignal(void 0, void 0, param.optionText, param.signalType);
1588
+ break;
1589
+ case "criticalEnd":
1590
+ addSignal(void 0, void 0, void 0, param.signalType);
1591
+ break;
1592
+ case "breakStart":
1593
+ addSignal(void 0, void 0, param.breakText, param.signalType);
1594
+ break;
1595
+ case "breakEnd":
1596
+ addSignal(void 0, void 0, void 0, param.signalType);
1597
+ break;
1598
+ }
1599
+ }
1600
+ }, "apply");
1601
+ var sequenceDb_default = {
1602
+ addActor,
1603
+ addMessage,
1604
+ addSignal,
1605
+ addLinks,
1606
+ addDetails,
1607
+ addProperties,
1608
+ autoWrap,
1609
+ setWrap,
1610
+ enableSequenceNumbers,
1611
+ disableSequenceNumbers,
1612
+ showSequenceNumbers,
1613
+ getMessages,
1614
+ getActors,
1615
+ getCreatedActors,
1616
+ getDestroyedActors,
1617
+ getActor,
1618
+ getActorKeys,
1619
+ getActorProperty,
1620
+ getAccTitle: _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getAccTitle */ .iN,
1621
+ getBoxes,
1622
+ getDiagramTitle: _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getDiagramTitle */ .ab,
1623
+ setDiagramTitle: _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .setDiagramTitle */ .ke,
1624
+ getConfig: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(() => (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)().sequence, "getConfig"),
1625
+ clear: clear2,
1626
+ parseMessage,
1627
+ parseBoxData,
1628
+ LINETYPE,
1629
+ ARROWTYPE,
1630
+ PLACEMENT,
1631
+ addNote,
1632
+ setAccTitle: _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .setAccTitle */ .SV,
1633
+ apply,
1634
+ setAccDescription: _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .setAccDescription */ .EI,
1635
+ getAccDescription: _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getAccDescription */ .m7,
1636
+ hasAtLeastOneBox,
1637
+ hasAtLeastOneBoxWithTitle
1638
+ };
1639
+
1640
+ // src/diagrams/sequence/styles.js
1641
+ var getStyles = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((options) => `.actor {
1642
+ stroke: ${options.actorBorder};
1643
+ fill: ${options.actorBkg};
1644
+ }
1645
+
1646
+ text.actor > tspan {
1647
+ fill: ${options.actorTextColor};
1648
+ stroke: none;
1649
+ }
1650
+
1651
+ .actor-line {
1652
+ stroke: ${options.actorLineColor};
1653
+ }
1654
+
1655
+ .messageLine0 {
1656
+ stroke-width: 1.5;
1657
+ stroke-dasharray: none;
1658
+ stroke: ${options.signalColor};
1659
+ }
1660
+
1661
+ .messageLine1 {
1662
+ stroke-width: 1.5;
1663
+ stroke-dasharray: 2, 2;
1664
+ stroke: ${options.signalColor};
1665
+ }
1666
+
1667
+ #arrowhead path {
1668
+ fill: ${options.signalColor};
1669
+ stroke: ${options.signalColor};
1670
+ }
1671
+
1672
+ .sequenceNumber {
1673
+ fill: ${options.sequenceNumberColor};
1674
+ }
1675
+
1676
+ #sequencenumber {
1677
+ fill: ${options.signalColor};
1678
+ }
1679
+
1680
+ #crosshead path {
1681
+ fill: ${options.signalColor};
1682
+ stroke: ${options.signalColor};
1683
+ }
1684
+
1685
+ .messageText {
1686
+ fill: ${options.signalTextColor};
1687
+ stroke: none;
1688
+ }
1689
+
1690
+ .labelBox {
1691
+ stroke: ${options.labelBoxBorderColor};
1692
+ fill: ${options.labelBoxBkgColor};
1693
+ }
1694
+
1695
+ .labelText, .labelText > tspan {
1696
+ fill: ${options.labelTextColor};
1697
+ stroke: none;
1698
+ }
1699
+
1700
+ .loopText, .loopText > tspan {
1701
+ fill: ${options.loopTextColor};
1702
+ stroke: none;
1703
+ }
1704
+
1705
+ .loopLine {
1706
+ stroke-width: 2px;
1707
+ stroke-dasharray: 2, 2;
1708
+ stroke: ${options.labelBoxBorderColor};
1709
+ fill: ${options.labelBoxBorderColor};
1710
+ }
1711
+
1712
+ .note {
1713
+ //stroke: #decc93;
1714
+ stroke: ${options.noteBorderColor};
1715
+ fill: ${options.noteBkgColor};
1716
+ }
1717
+
1718
+ .noteText, .noteText > tspan {
1719
+ fill: ${options.noteTextColor};
1720
+ stroke: none;
1721
+ }
1722
+
1723
+ .activation0 {
1724
+ fill: ${options.activationBkgColor};
1725
+ stroke: ${options.activationBorderColor};
1726
+ }
1727
+
1728
+ .activation1 {
1729
+ fill: ${options.activationBkgColor};
1730
+ stroke: ${options.activationBorderColor};
1731
+ }
1732
+
1733
+ .activation2 {
1734
+ fill: ${options.activationBkgColor};
1735
+ stroke: ${options.activationBorderColor};
1736
+ }
1737
+
1738
+ .actorPopupMenu {
1739
+ position: absolute;
1740
+ }
1741
+
1742
+ .actorPopupMenuPanel {
1743
+ position: absolute;
1744
+ fill: ${options.actorBkg};
1745
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
1746
+ filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
1747
+ }
1748
+ .actor-man line {
1749
+ stroke: ${options.actorBorder};
1750
+ fill: ${options.actorBkg};
1751
+ }
1752
+ .actor-man circle, line {
1753
+ stroke: ${options.actorBorder};
1754
+ fill: ${options.actorBkg};
1755
+ stroke-width: 2px;
1756
+ }
1757
+ `, "getStyles");
1758
+ var styles_default = getStyles;
1759
+
1760
+ // src/diagrams/sequence/sequenceRenderer.ts
1761
+
1762
+
1763
+ // src/diagrams/sequence/svgDraw.js
1764
+
1765
+ var ACTOR_TYPE_WIDTH = 18 * 2;
1766
+ var TOP_ACTOR_CLASS = "actor-top";
1767
+ var BOTTOM_ACTOR_CLASS = "actor-bottom";
1768
+ var ACTOR_BOX_CLASS = "actor-box";
1769
+ var ACTOR_MAN_FIGURE_CLASS = "actor-man";
1770
+ var drawRect2 = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(elem, rectData) {
1771
+ return (0,_chunk_V35ELUW5_mjs__WEBPACK_IMPORTED_MODULE_0__/* .drawRect */ .tk)(elem, rectData);
1772
+ }, "drawRect");
1773
+ var drawPopup = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(elem, actor, minMenuWidth, textAttrs, forceMenus) {
1774
+ if (actor.links === void 0 || actor.links === null || Object.keys(actor.links).length === 0) {
1775
+ return { height: 0, width: 0 };
1776
+ }
1777
+ const links = actor.links;
1778
+ const actorCnt2 = actor.actorCnt;
1779
+ const rectData = actor.rectData;
1780
+ var displayValue = "none";
1781
+ if (forceMenus) {
1782
+ displayValue = "block !important";
1783
+ }
1784
+ const g = elem.append("g");
1785
+ g.attr("id", "actor" + actorCnt2 + "_popup");
1786
+ g.attr("class", "actorPopupMenu");
1787
+ g.attr("display", displayValue);
1788
+ var actorClass = "";
1789
+ if (rectData.class !== void 0) {
1790
+ actorClass = " " + rectData.class;
1791
+ }
1792
+ let menuWidth = rectData.width > minMenuWidth ? rectData.width : minMenuWidth;
1793
+ const rectElem = g.append("rect");
1794
+ rectElem.attr("class", "actorPopupMenuPanel" + actorClass);
1795
+ rectElem.attr("x", rectData.x);
1796
+ rectElem.attr("y", rectData.height);
1797
+ rectElem.attr("fill", rectData.fill);
1798
+ rectElem.attr("stroke", rectData.stroke);
1799
+ rectElem.attr("width", menuWidth);
1800
+ rectElem.attr("height", rectData.height);
1801
+ rectElem.attr("rx", rectData.rx);
1802
+ rectElem.attr("ry", rectData.ry);
1803
+ if (links != null) {
1804
+ var linkY = 20;
1805
+ for (let key in links) {
1806
+ var linkElem = g.append("a");
1807
+ var sanitizedLink = (0,_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_5__/* .sanitizeUrl */ .J)(links[key]);
1808
+ linkElem.attr("xlink:href", sanitizedLink);
1809
+ linkElem.attr("target", "_blank");
1810
+ _drawMenuItemTextCandidateFunc(textAttrs)(
1811
+ key,
1812
+ linkElem,
1813
+ rectData.x + 10,
1814
+ rectData.height + linkY,
1815
+ menuWidth,
1816
+ 20,
1817
+ { class: "actor" },
1818
+ textAttrs
1819
+ );
1820
+ linkY += 30;
1821
+ }
1822
+ }
1823
+ rectElem.attr("height", linkY);
1824
+ return { height: rectData.height + linkY, width: menuWidth };
1825
+ }, "drawPopup");
1826
+ var popupMenuToggle = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(popId) {
1827
+ return "var pu = document.getElementById('" + popId + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }";
1828
+ }, "popupMenuToggle");
1829
+ var drawKatex = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async function(elem, textData, msgModel = null) {
1830
+ let textElem = elem.append("foreignObject");
1831
+ const lines = await (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .renderKatex */ .VJ)(textData.text, (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig */ .zj)());
1832
+ const divElem = textElem.append("xhtml:div").attr("style", "width: fit-content;").attr("xmlns", "http://www.w3.org/1999/xhtml").html(lines);
1833
+ const dim = divElem.node().getBoundingClientRect();
1834
+ textElem.attr("height", Math.round(dim.height)).attr("width", Math.round(dim.width));
1835
+ if (textData.class === "noteText") {
1836
+ const rectElem = elem.node().firstChild;
1837
+ rectElem.setAttribute("height", dim.height + 2 * textData.textMargin);
1838
+ const rectDim = rectElem.getBBox();
1839
+ textElem.attr("x", Math.round(rectDim.x + rectDim.width / 2 - dim.width / 2)).attr("y", Math.round(rectDim.y + rectDim.height / 2 - dim.height / 2));
1840
+ } else if (msgModel) {
1841
+ let { startx, stopx, starty } = msgModel;
1842
+ if (startx > stopx) {
1843
+ const temp = startx;
1844
+ startx = stopx;
1845
+ stopx = temp;
1846
+ }
1847
+ textElem.attr("x", Math.round(startx + Math.abs(startx - stopx) / 2 - dim.width / 2));
1848
+ if (textData.class === "loopText") {
1849
+ textElem.attr("y", Math.round(starty));
1850
+ } else {
1851
+ textElem.attr("y", Math.round(starty - dim.height));
1852
+ }
1853
+ }
1854
+ return [textElem];
1855
+ }, "drawKatex");
1856
+ var drawText = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(elem, textData) {
1857
+ let prevTextHeight = 0;
1858
+ let textHeight = 0;
1859
+ const lines = textData.text.split(_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.lineBreakRegex);
1860
+ const [_textFontSize, _textFontSizePx] = (0,_chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .parseFontSize */ .I5)(textData.fontSize);
1861
+ let textElems = [];
1862
+ let dy = 0;
1863
+ let yfunc = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(() => textData.y, "yfunc");
1864
+ if (textData.valign !== void 0 && textData.textMargin !== void 0 && textData.textMargin > 0) {
1865
+ switch (textData.valign) {
1866
+ case "top":
1867
+ case "start":
1868
+ yfunc = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(() => Math.round(textData.y + textData.textMargin), "yfunc");
1869
+ break;
1870
+ case "middle":
1871
+ case "center":
1872
+ yfunc = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(() => Math.round(textData.y + (prevTextHeight + textHeight + textData.textMargin) / 2), "yfunc");
1873
+ break;
1874
+ case "bottom":
1875
+ case "end":
1876
+ yfunc = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(() => Math.round(
1877
+ textData.y + (prevTextHeight + textHeight + 2 * textData.textMargin) - textData.textMargin
1878
+ ), "yfunc");
1879
+ break;
1880
+ }
1881
+ }
1882
+ if (textData.anchor !== void 0 && textData.textMargin !== void 0 && textData.width !== void 0) {
1883
+ switch (textData.anchor) {
1884
+ case "left":
1885
+ case "start":
1886
+ textData.x = Math.round(textData.x + textData.textMargin);
1887
+ textData.anchor = "start";
1888
+ textData.dominantBaseline = "middle";
1889
+ textData.alignmentBaseline = "middle";
1890
+ break;
1891
+ case "middle":
1892
+ case "center":
1893
+ textData.x = Math.round(textData.x + textData.width / 2);
1894
+ textData.anchor = "middle";
1895
+ textData.dominantBaseline = "middle";
1896
+ textData.alignmentBaseline = "middle";
1897
+ break;
1898
+ case "right":
1899
+ case "end":
1900
+ textData.x = Math.round(textData.x + textData.width - textData.textMargin);
1901
+ textData.anchor = "end";
1902
+ textData.dominantBaseline = "middle";
1903
+ textData.alignmentBaseline = "middle";
1904
+ break;
1905
+ }
1906
+ }
1907
+ for (let [i, line] of lines.entries()) {
1908
+ if (textData.textMargin !== void 0 && textData.textMargin === 0 && _textFontSize !== void 0) {
1909
+ dy = i * _textFontSize;
1910
+ }
1911
+ const textElem = elem.append("text");
1912
+ textElem.attr("x", textData.x);
1913
+ textElem.attr("y", yfunc());
1914
+ if (textData.anchor !== void 0) {
1915
+ textElem.attr("text-anchor", textData.anchor).attr("dominant-baseline", textData.dominantBaseline).attr("alignment-baseline", textData.alignmentBaseline);
1916
+ }
1917
+ if (textData.fontFamily !== void 0) {
1918
+ textElem.style("font-family", textData.fontFamily);
1919
+ }
1920
+ if (_textFontSizePx !== void 0) {
1921
+ textElem.style("font-size", _textFontSizePx);
1922
+ }
1923
+ if (textData.fontWeight !== void 0) {
1924
+ textElem.style("font-weight", textData.fontWeight);
1925
+ }
1926
+ if (textData.fill !== void 0) {
1927
+ textElem.attr("fill", textData.fill);
1928
+ }
1929
+ if (textData.class !== void 0) {
1930
+ textElem.attr("class", textData.class);
1931
+ }
1932
+ if (textData.dy !== void 0) {
1933
+ textElem.attr("dy", textData.dy);
1934
+ } else if (dy !== 0) {
1935
+ textElem.attr("dy", dy);
1936
+ }
1937
+ const text = line || _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .ZERO_WIDTH_SPACE */ .pe;
1938
+ if (textData.tspan) {
1939
+ const span = textElem.append("tspan");
1940
+ span.attr("x", textData.x);
1941
+ if (textData.fill !== void 0) {
1942
+ span.attr("fill", textData.fill);
1943
+ }
1944
+ span.text(text);
1945
+ } else {
1946
+ textElem.text(text);
1947
+ }
1948
+ if (textData.valign !== void 0 && textData.textMargin !== void 0 && textData.textMargin > 0) {
1949
+ textHeight += (textElem._groups || textElem)[0][0].getBBox().height;
1950
+ prevTextHeight = textHeight;
1951
+ }
1952
+ textElems.push(textElem);
1953
+ }
1954
+ return textElems;
1955
+ }, "drawText");
1956
+ var drawLabel = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(elem, txtObject) {
1957
+ function genPoints(x, y, width, height, cut) {
1958
+ return x + "," + y + " " + (x + width) + "," + y + " " + (x + width) + "," + (y + height - cut) + " " + (x + width - cut * 1.2) + "," + (y + height) + " " + x + "," + (y + height);
1959
+ }
1960
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(genPoints, "genPoints");
1961
+ const polygon = elem.append("polygon");
1962
+ polygon.attr("points", genPoints(txtObject.x, txtObject.y, txtObject.width, txtObject.height, 7));
1963
+ polygon.attr("class", "labelBox");
1964
+ txtObject.y = txtObject.y + txtObject.height / 2;
1965
+ drawText(elem, txtObject);
1966
+ return polygon;
1967
+ }, "drawLabel");
1968
+ var actorCnt = -1;
1969
+ var fixLifeLineHeights = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((diagram2, actors, actorKeys, conf2) => {
1970
+ if (!diagram2.select) {
1971
+ return;
1972
+ }
1973
+ actorKeys.forEach((actorKey) => {
1974
+ const actor = actors.get(actorKey);
1975
+ const actorDOM = diagram2.select("#actor" + actor.actorCnt);
1976
+ if (!conf2.mirrorActors && actor.stopy) {
1977
+ actorDOM.attr("y2", actor.stopy + actor.height / 2);
1978
+ } else if (conf2.mirrorActors) {
1979
+ actorDOM.attr("y2", actor.stopy);
1980
+ }
1981
+ });
1982
+ }, "fixLifeLineHeights");
1983
+ var drawActorTypeParticipant = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(elem, actor, conf2, isFooter) {
1984
+ const actorY = isFooter ? actor.stopy : actor.starty;
1985
+ const center = actor.x + actor.width / 2;
1986
+ const centerY = actorY + actor.height;
1987
+ const boxplusLineGroup = elem.append("g").lower();
1988
+ var g = boxplusLineGroup;
1989
+ if (!isFooter) {
1990
+ actorCnt++;
1991
+ if (Object.keys(actor.links || {}).length && !conf2.forceMenus) {
1992
+ g.attr("onclick", popupMenuToggle(`actor${actorCnt}_popup`)).attr("cursor", "pointer");
1993
+ }
1994
+ g.append("line").attr("id", "actor" + actorCnt).attr("x1", center).attr("y1", centerY).attr("x2", center).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", actor.name);
1995
+ g = boxplusLineGroup.append("g");
1996
+ actor.actorCnt = actorCnt;
1997
+ if (actor.links != null) {
1998
+ g.attr("id", "root-" + actorCnt);
1999
+ }
2000
+ }
2001
+ const rect = (0,_chunk_V35ELUW5_mjs__WEBPACK_IMPORTED_MODULE_0__/* .getNoteRect */ .PB)();
2002
+ var cssclass = "actor";
2003
+ if (actor.properties?.class) {
2004
+ cssclass = actor.properties.class;
2005
+ } else {
2006
+ rect.fill = "#eaeaea";
2007
+ }
2008
+ if (isFooter) {
2009
+ cssclass += ` ${BOTTOM_ACTOR_CLASS}`;
2010
+ } else {
2011
+ cssclass += ` ${TOP_ACTOR_CLASS}`;
2012
+ }
2013
+ rect.x = actor.x;
2014
+ rect.y = actorY;
2015
+ rect.width = actor.width;
2016
+ rect.height = actor.height;
2017
+ rect.class = cssclass;
2018
+ rect.rx = 3;
2019
+ rect.ry = 3;
2020
+ rect.name = actor.name;
2021
+ const rectElem = drawRect2(g, rect);
2022
+ actor.rectData = rect;
2023
+ if (actor.properties?.icon) {
2024
+ const iconSrc = actor.properties.icon.trim();
2025
+ if (iconSrc.charAt(0) === "@") {
2026
+ (0,_chunk_V35ELUW5_mjs__WEBPACK_IMPORTED_MODULE_0__/* .drawEmbeddedImage */ .CP)(g, rect.x + rect.width - 20, rect.y + 10, iconSrc.substr(1));
2027
+ } else {
2028
+ (0,_chunk_V35ELUW5_mjs__WEBPACK_IMPORTED_MODULE_0__/* .drawImage */ .aC)(g, rect.x + rect.width - 20, rect.y + 10, iconSrc);
2029
+ }
2030
+ }
2031
+ _drawTextCandidateFunc(conf2, (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .hasKatex */ .Wi)(actor.description))(
2032
+ actor.description,
2033
+ g,
2034
+ rect.x,
2035
+ rect.y,
2036
+ rect.width,
2037
+ rect.height,
2038
+ { class: `actor ${ACTOR_BOX_CLASS}` },
2039
+ conf2
2040
+ );
2041
+ let height = actor.height;
2042
+ if (rectElem.node) {
2043
+ const bounds2 = rectElem.node().getBBox();
2044
+ actor.height = bounds2.height;
2045
+ height = bounds2.height;
2046
+ }
2047
+ return height;
2048
+ }, "drawActorTypeParticipant");
2049
+ var drawActorTypeActor = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(elem, actor, conf2, isFooter) {
2050
+ const actorY = isFooter ? actor.stopy : actor.starty;
2051
+ const center = actor.x + actor.width / 2;
2052
+ const centerY = actorY + 80;
2053
+ const line = elem.append("g").lower();
2054
+ if (!isFooter) {
2055
+ actorCnt++;
2056
+ line.append("line").attr("id", "actor" + actorCnt).attr("x1", center).attr("y1", centerY).attr("x2", center).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", actor.name);
2057
+ actor.actorCnt = actorCnt;
2058
+ }
2059
+ const actElem = elem.append("g");
2060
+ let cssClass = ACTOR_MAN_FIGURE_CLASS;
2061
+ if (isFooter) {
2062
+ cssClass += ` ${BOTTOM_ACTOR_CLASS}`;
2063
+ } else {
2064
+ cssClass += ` ${TOP_ACTOR_CLASS}`;
2065
+ }
2066
+ actElem.attr("class", cssClass);
2067
+ actElem.attr("name", actor.name);
2068
+ const rect = (0,_chunk_V35ELUW5_mjs__WEBPACK_IMPORTED_MODULE_0__/* .getNoteRect */ .PB)();
2069
+ rect.x = actor.x;
2070
+ rect.y = actorY;
2071
+ rect.fill = "#eaeaea";
2072
+ rect.width = actor.width;
2073
+ rect.height = actor.height;
2074
+ rect.class = "actor";
2075
+ rect.rx = 3;
2076
+ rect.ry = 3;
2077
+ actElem.append("line").attr("id", "actor-man-torso" + actorCnt).attr("x1", center).attr("y1", actorY + 25).attr("x2", center).attr("y2", actorY + 45);
2078
+ actElem.append("line").attr("id", "actor-man-arms" + actorCnt).attr("x1", center - ACTOR_TYPE_WIDTH / 2).attr("y1", actorY + 33).attr("x2", center + ACTOR_TYPE_WIDTH / 2).attr("y2", actorY + 33);
2079
+ actElem.append("line").attr("x1", center - ACTOR_TYPE_WIDTH / 2).attr("y1", actorY + 60).attr("x2", center).attr("y2", actorY + 45);
2080
+ actElem.append("line").attr("x1", center).attr("y1", actorY + 45).attr("x2", center + ACTOR_TYPE_WIDTH / 2 - 2).attr("y2", actorY + 60);
2081
+ const circle = actElem.append("circle");
2082
+ circle.attr("cx", actor.x + actor.width / 2);
2083
+ circle.attr("cy", actorY + 10);
2084
+ circle.attr("r", 15);
2085
+ circle.attr("width", actor.width);
2086
+ circle.attr("height", actor.height);
2087
+ const bounds2 = actElem.node().getBBox();
2088
+ actor.height = bounds2.height;
2089
+ _drawTextCandidateFunc(conf2, (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .hasKatex */ .Wi)(actor.description))(
2090
+ actor.description,
2091
+ actElem,
2092
+ rect.x,
2093
+ rect.y + 35,
2094
+ rect.width,
2095
+ rect.height,
2096
+ { class: `actor ${ACTOR_MAN_FIGURE_CLASS}` },
2097
+ conf2
2098
+ );
2099
+ return actor.height;
2100
+ }, "drawActorTypeActor");
2101
+ var drawActor = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async function(elem, actor, conf2, isFooter) {
2102
+ switch (actor.type) {
2103
+ case "actor":
2104
+ return await drawActorTypeActor(elem, actor, conf2, isFooter);
2105
+ case "participant":
2106
+ return await drawActorTypeParticipant(elem, actor, conf2, isFooter);
2107
+ }
2108
+ }, "drawActor");
2109
+ var drawBox = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(elem, box, conf2) {
2110
+ const boxplusTextGroup = elem.append("g");
2111
+ const g = boxplusTextGroup;
2112
+ drawBackgroundRect2(g, box);
2113
+ if (box.name) {
2114
+ _drawTextCandidateFunc(conf2)(
2115
+ box.name,
2116
+ g,
2117
+ box.x,
2118
+ box.y + (box.textMaxHeight || 0) / 2,
2119
+ box.width,
2120
+ 0,
2121
+ { class: "text" },
2122
+ conf2
2123
+ );
2124
+ }
2125
+ g.lower();
2126
+ }, "drawBox");
2127
+ var anchorElement = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(elem) {
2128
+ return elem.append("g");
2129
+ }, "anchorElement");
2130
+ var drawActivation = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(elem, bounds2, verticalPos, conf2, actorActivations2) {
2131
+ const rect = (0,_chunk_V35ELUW5_mjs__WEBPACK_IMPORTED_MODULE_0__/* .getNoteRect */ .PB)();
2132
+ const g = bounds2.anchored;
2133
+ rect.x = bounds2.startx;
2134
+ rect.y = bounds2.starty;
2135
+ rect.class = "activation" + actorActivations2 % 3;
2136
+ rect.width = bounds2.stopx - bounds2.startx;
2137
+ rect.height = verticalPos - bounds2.starty;
2138
+ drawRect2(g, rect);
2139
+ }, "drawActivation");
2140
+ var drawLoop = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async function(elem, loopModel, labelText, conf2) {
2141
+ const {
2142
+ boxMargin,
2143
+ boxTextMargin,
2144
+ labelBoxHeight,
2145
+ labelBoxWidth,
2146
+ messageFontFamily: fontFamily,
2147
+ messageFontSize: fontSize,
2148
+ messageFontWeight: fontWeight
2149
+ } = conf2;
2150
+ const g = elem.append("g");
2151
+ const drawLoopLine = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(startx, starty, stopx, stopy) {
2152
+ return g.append("line").attr("x1", startx).attr("y1", starty).attr("x2", stopx).attr("y2", stopy).attr("class", "loopLine");
2153
+ }, "drawLoopLine");
2154
+ drawLoopLine(loopModel.startx, loopModel.starty, loopModel.stopx, loopModel.starty);
2155
+ drawLoopLine(loopModel.stopx, loopModel.starty, loopModel.stopx, loopModel.stopy);
2156
+ drawLoopLine(loopModel.startx, loopModel.stopy, loopModel.stopx, loopModel.stopy);
2157
+ drawLoopLine(loopModel.startx, loopModel.starty, loopModel.startx, loopModel.stopy);
2158
+ if (loopModel.sections !== void 0) {
2159
+ loopModel.sections.forEach(function(item) {
2160
+ drawLoopLine(loopModel.startx, item.y, loopModel.stopx, item.y).style(
2161
+ "stroke-dasharray",
2162
+ "3, 3"
2163
+ );
2164
+ });
2165
+ }
2166
+ let txt = (0,_chunk_V35ELUW5_mjs__WEBPACK_IMPORTED_MODULE_0__/* .getTextObj */ .HT)();
2167
+ txt.text = labelText;
2168
+ txt.x = loopModel.startx;
2169
+ txt.y = loopModel.starty;
2170
+ txt.fontFamily = fontFamily;
2171
+ txt.fontSize = fontSize;
2172
+ txt.fontWeight = fontWeight;
2173
+ txt.anchor = "middle";
2174
+ txt.valign = "middle";
2175
+ txt.tspan = false;
2176
+ txt.width = labelBoxWidth || 50;
2177
+ txt.height = labelBoxHeight || 20;
2178
+ txt.textMargin = boxTextMargin;
2179
+ txt.class = "labelText";
2180
+ drawLabel(g, txt);
2181
+ txt = getTextObj2();
2182
+ txt.text = loopModel.title;
2183
+ txt.x = loopModel.startx + labelBoxWidth / 2 + (loopModel.stopx - loopModel.startx) / 2;
2184
+ txt.y = loopModel.starty + boxMargin + boxTextMargin;
2185
+ txt.anchor = "middle";
2186
+ txt.valign = "middle";
2187
+ txt.textMargin = boxTextMargin;
2188
+ txt.class = "loopText";
2189
+ txt.fontFamily = fontFamily;
2190
+ txt.fontSize = fontSize;
2191
+ txt.fontWeight = fontWeight;
2192
+ txt.wrap = true;
2193
+ let textElem = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .hasKatex */ .Wi)(txt.text) ? await drawKatex(g, txt, loopModel) : drawText(g, txt);
2194
+ if (loopModel.sectionTitles !== void 0) {
2195
+ for (const [idx, item] of Object.entries(loopModel.sectionTitles)) {
2196
+ if (item.message) {
2197
+ txt.text = item.message;
2198
+ txt.x = loopModel.startx + (loopModel.stopx - loopModel.startx) / 2;
2199
+ txt.y = loopModel.sections[idx].y + boxMargin + boxTextMargin;
2200
+ txt.class = "loopText";
2201
+ txt.anchor = "middle";
2202
+ txt.valign = "middle";
2203
+ txt.tspan = false;
2204
+ txt.fontFamily = fontFamily;
2205
+ txt.fontSize = fontSize;
2206
+ txt.fontWeight = fontWeight;
2207
+ txt.wrap = loopModel.wrap;
2208
+ if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .hasKatex */ .Wi)(txt.text)) {
2209
+ loopModel.starty = loopModel.sections[idx].y;
2210
+ await drawKatex(g, txt, loopModel);
2211
+ } else {
2212
+ drawText(g, txt);
2213
+ }
2214
+ let sectionHeight = Math.round(
2215
+ textElem.map((te) => (te._groups || te)[0][0].getBBox().height).reduce((acc, curr) => acc + curr)
2216
+ );
2217
+ loopModel.sections[idx].height += sectionHeight - (boxMargin + boxTextMargin);
2218
+ }
2219
+ }
2220
+ }
2221
+ loopModel.height = Math.round(loopModel.stopy - loopModel.starty);
2222
+ return g;
2223
+ }, "drawLoop");
2224
+ var drawBackgroundRect2 = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(elem, bounds2) {
2225
+ (0,_chunk_V35ELUW5_mjs__WEBPACK_IMPORTED_MODULE_0__/* .drawBackgroundRect */ .lC)(elem, bounds2);
2226
+ }, "drawBackgroundRect");
2227
+ var insertDatabaseIcon = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(elem) {
2228
+ elem.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
2229
+ "d",
2230
+ "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"
2231
+ );
2232
+ }, "insertDatabaseIcon");
2233
+ var insertComputerIcon = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(elem) {
2234
+ elem.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
2235
+ "d",
2236
+ "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"
2237
+ );
2238
+ }, "insertComputerIcon");
2239
+ var insertClockIcon = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(elem) {
2240
+ elem.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
2241
+ "d",
2242
+ "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"
2243
+ );
2244
+ }, "insertClockIcon");
2245
+ var insertArrowHead = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(elem) {
2246
+ elem.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 7.9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M -1 0 L 10 5 L 0 10 z");
2247
+ }, "insertArrowHead");
2248
+ var insertArrowFilledHead = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(elem) {
2249
+ elem.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");
2250
+ }, "insertArrowFilledHead");
2251
+ var insertSequenceNumber = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(elem) {
2252
+ elem.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);
2253
+ }, "insertSequenceNumber");
2254
+ var insertArrowCrossHead = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(elem) {
2255
+ const defs = elem.append("defs");
2256
+ const marker = defs.append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 4).attr("refY", 4.5);
2257
+ marker.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");
2258
+ }, "insertArrowCrossHead");
2259
+ var getTextObj2 = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
2260
+ return {
2261
+ x: 0,
2262
+ y: 0,
2263
+ fill: void 0,
2264
+ anchor: void 0,
2265
+ style: "#666",
2266
+ width: void 0,
2267
+ height: void 0,
2268
+ textMargin: 0,
2269
+ rx: 0,
2270
+ ry: 0,
2271
+ tspan: true,
2272
+ valign: void 0
2273
+ };
2274
+ }, "getTextObj");
2275
+ var getNoteRect2 = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
2276
+ return {
2277
+ x: 0,
2278
+ y: 0,
2279
+ fill: "#EDF2AE",
2280
+ stroke: "#666",
2281
+ width: 100,
2282
+ anchor: "start",
2283
+ height: 100,
2284
+ rx: 0,
2285
+ ry: 0
2286
+ };
2287
+ }, "getNoteRect");
2288
+ var _drawTextCandidateFunc = /* @__PURE__ */ function() {
2289
+ function byText(content, g, x, y, width, height, textAttrs) {
2290
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y + height / 2 + 5).style("text-anchor", "middle").text(content);
2291
+ _setTextAttrs(text, textAttrs);
2292
+ }
2293
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(byText, "byText");
2294
+ function byTspan(content, g, x, y, width, height, textAttrs, conf2) {
2295
+ const { actorFontSize, actorFontFamily, actorFontWeight } = conf2;
2296
+ const [_actorFontSize, _actorFontSizePx] = (0,_chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .parseFontSize */ .I5)(actorFontSize);
2297
+ const lines = content.split(_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.lineBreakRegex);
2298
+ for (let i = 0; i < lines.length; i++) {
2299
+ const dy = i * _actorFontSize - _actorFontSize * (lines.length - 1) / 2;
2300
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y).style("text-anchor", "middle").style("font-size", _actorFontSizePx).style("font-weight", actorFontWeight).style("font-family", actorFontFamily);
2301
+ text.append("tspan").attr("x", x + width / 2).attr("dy", dy).text(lines[i]);
2302
+ text.attr("y", y + height / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
2303
+ _setTextAttrs(text, textAttrs);
2304
+ }
2305
+ }
2306
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(byTspan, "byTspan");
2307
+ function byFo(content, g, x, y, width, height, textAttrs, conf2) {
2308
+ const s = g.append("switch");
2309
+ const f = s.append("foreignObject").attr("x", x).attr("y", y).attr("width", width).attr("height", height);
2310
+ const text = f.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
2311
+ text.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
2312
+ byTspan(content, s, x, y, width, height, textAttrs, conf2);
2313
+ _setTextAttrs(text, textAttrs);
2314
+ }
2315
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(byFo, "byFo");
2316
+ async function byKatex(content, g, x, y, width, height, textAttrs, conf2) {
2317
+ const dim = await (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .calculateMathMLDimensions */ .Dl)(content, (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig */ .zj)());
2318
+ const s = g.append("switch");
2319
+ const f = s.append("foreignObject").attr("x", x + width / 2 - dim.width / 2).attr("y", y + height / 2 - dim.height / 2).attr("width", dim.width).attr("height", dim.height);
2320
+ const text = f.append("xhtml:div").style("height", "100%").style("width", "100%");
2321
+ text.append("div").style("text-align", "center").style("vertical-align", "middle").html(await (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .renderKatex */ .VJ)(content, (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig */ .zj)()));
2322
+ byTspan(content, s, x, y, width, height, textAttrs, conf2);
2323
+ _setTextAttrs(text, textAttrs);
2324
+ }
2325
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(byKatex, "byKatex");
2326
+ function _setTextAttrs(toText, fromTextAttrsDict) {
2327
+ for (const key in fromTextAttrsDict) {
2328
+ if (fromTextAttrsDict.hasOwnProperty(key)) {
2329
+ toText.attr(key, fromTextAttrsDict[key]);
2330
+ }
2331
+ }
2332
+ }
2333
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(_setTextAttrs, "_setTextAttrs");
2334
+ return function(conf2, hasKatex2 = false) {
2335
+ if (hasKatex2) {
2336
+ return byKatex;
2337
+ }
2338
+ return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan;
2339
+ };
2340
+ }();
2341
+ var _drawMenuItemTextCandidateFunc = /* @__PURE__ */ function() {
2342
+ function byText(content, g, x, y, width, height, textAttrs) {
2343
+ const text = g.append("text").attr("x", x).attr("y", y).style("text-anchor", "start").text(content);
2344
+ _setTextAttrs(text, textAttrs);
2345
+ }
2346
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(byText, "byText");
2347
+ function byTspan(content, g, x, y, width, height, textAttrs, conf2) {
2348
+ const { actorFontSize, actorFontFamily, actorFontWeight } = conf2;
2349
+ const lines = content.split(_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.lineBreakRegex);
2350
+ for (let i = 0; i < lines.length; i++) {
2351
+ const dy = i * actorFontSize - actorFontSize * (lines.length - 1) / 2;
2352
+ const text = g.append("text").attr("x", x).attr("y", y).style("text-anchor", "start").style("font-size", actorFontSize).style("font-weight", actorFontWeight).style("font-family", actorFontFamily);
2353
+ text.append("tspan").attr("x", x).attr("dy", dy).text(lines[i]);
2354
+ text.attr("y", y + height / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
2355
+ _setTextAttrs(text, textAttrs);
2356
+ }
2357
+ }
2358
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(byTspan, "byTspan");
2359
+ function byFo(content, g, x, y, width, height, textAttrs, conf2) {
2360
+ const s = g.append("switch");
2361
+ const f = s.append("foreignObject").attr("x", x).attr("y", y).attr("width", width).attr("height", height);
2362
+ const text = f.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
2363
+ text.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
2364
+ byTspan(content, s, x, y, width, height, textAttrs, conf2);
2365
+ _setTextAttrs(text, textAttrs);
2366
+ }
2367
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(byFo, "byFo");
2368
+ function _setTextAttrs(toText, fromTextAttrsDict) {
2369
+ for (const key in fromTextAttrsDict) {
2370
+ if (fromTextAttrsDict.hasOwnProperty(key)) {
2371
+ toText.attr(key, fromTextAttrsDict[key]);
2372
+ }
2373
+ }
2374
+ }
2375
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(_setTextAttrs, "_setTextAttrs");
2376
+ return function(conf2) {
2377
+ return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan;
2378
+ };
2379
+ }();
2380
+ var svgDraw_default = {
2381
+ drawRect: drawRect2,
2382
+ drawText,
2383
+ drawLabel,
2384
+ drawActor,
2385
+ drawBox,
2386
+ drawPopup,
2387
+ anchorElement,
2388
+ drawActivation,
2389
+ drawLoop,
2390
+ drawBackgroundRect: drawBackgroundRect2,
2391
+ insertArrowHead,
2392
+ insertArrowFilledHead,
2393
+ insertSequenceNumber,
2394
+ insertArrowCrossHead,
2395
+ insertDatabaseIcon,
2396
+ insertComputerIcon,
2397
+ insertClockIcon,
2398
+ getTextObj: getTextObj2,
2399
+ getNoteRect: getNoteRect2,
2400
+ fixLifeLineHeights,
2401
+ sanitizeUrl: _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_5__/* .sanitizeUrl */ .J
2402
+ };
2403
+
2404
+ // src/diagrams/sequence/sequenceRenderer.ts
2405
+ var conf = {};
2406
+ var bounds = {
2407
+ data: {
2408
+ startx: void 0,
2409
+ stopx: void 0,
2410
+ starty: void 0,
2411
+ stopy: void 0
2412
+ },
2413
+ verticalPos: 0,
2414
+ sequenceItems: [],
2415
+ activations: [],
2416
+ models: {
2417
+ getHeight: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
2418
+ return Math.max.apply(
2419
+ null,
2420
+ this.actors.length === 0 ? [0] : this.actors.map((actor) => actor.height || 0)
2421
+ ) + (this.loops.length === 0 ? 0 : this.loops.map((it) => it.height || 0).reduce((acc, h) => acc + h)) + (this.messages.length === 0 ? 0 : this.messages.map((it) => it.height || 0).reduce((acc, h) => acc + h)) + (this.notes.length === 0 ? 0 : this.notes.map((it) => it.height || 0).reduce((acc, h) => acc + h));
2422
+ }, "getHeight"),
2423
+ clear: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
2424
+ this.actors = [];
2425
+ this.boxes = [];
2426
+ this.loops = [];
2427
+ this.messages = [];
2428
+ this.notes = [];
2429
+ }, "clear"),
2430
+ addBox: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(boxModel) {
2431
+ this.boxes.push(boxModel);
2432
+ }, "addBox"),
2433
+ addActor: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(actorModel) {
2434
+ this.actors.push(actorModel);
2435
+ }, "addActor"),
2436
+ addLoop: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(loopModel) {
2437
+ this.loops.push(loopModel);
2438
+ }, "addLoop"),
2439
+ addMessage: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(msgModel) {
2440
+ this.messages.push(msgModel);
2441
+ }, "addMessage"),
2442
+ addNote: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(noteModel) {
2443
+ this.notes.push(noteModel);
2444
+ }, "addNote"),
2445
+ lastActor: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
2446
+ return this.actors[this.actors.length - 1];
2447
+ }, "lastActor"),
2448
+ lastLoop: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
2449
+ return this.loops[this.loops.length - 1];
2450
+ }, "lastLoop"),
2451
+ lastMessage: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
2452
+ return this.messages[this.messages.length - 1];
2453
+ }, "lastMessage"),
2454
+ lastNote: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
2455
+ return this.notes[this.notes.length - 1];
2456
+ }, "lastNote"),
2457
+ actors: [],
2458
+ boxes: [],
2459
+ loops: [],
2460
+ messages: [],
2461
+ notes: []
2462
+ },
2463
+ init: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
2464
+ this.sequenceItems = [];
2465
+ this.activations = [];
2466
+ this.models.clear();
2467
+ this.data = {
2468
+ startx: void 0,
2469
+ stopx: void 0,
2470
+ starty: void 0,
2471
+ stopy: void 0
2472
+ };
2473
+ this.verticalPos = 0;
2474
+ setConf((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)());
2475
+ }, "init"),
2476
+ updateVal: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(obj, key, val, fun) {
2477
+ if (obj[key] === void 0) {
2478
+ obj[key] = val;
2479
+ } else {
2480
+ obj[key] = fun(val, obj[key]);
2481
+ }
2482
+ }, "updateVal"),
2483
+ updateBounds: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(startx, starty, stopx, stopy) {
2484
+ const _self = this;
2485
+ let cnt = 0;
2486
+ function updateFn(type) {
2487
+ return /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function updateItemBounds(item) {
2488
+ cnt++;
2489
+ const n = _self.sequenceItems.length - cnt + 1;
2490
+ _self.updateVal(item, "starty", starty - n * conf.boxMargin, Math.min);
2491
+ _self.updateVal(item, "stopy", stopy + n * conf.boxMargin, Math.max);
2492
+ _self.updateVal(bounds.data, "startx", startx - n * conf.boxMargin, Math.min);
2493
+ _self.updateVal(bounds.data, "stopx", stopx + n * conf.boxMargin, Math.max);
2494
+ if (!(type === "activation")) {
2495
+ _self.updateVal(item, "startx", startx - n * conf.boxMargin, Math.min);
2496
+ _self.updateVal(item, "stopx", stopx + n * conf.boxMargin, Math.max);
2497
+ _self.updateVal(bounds.data, "starty", starty - n * conf.boxMargin, Math.min);
2498
+ _self.updateVal(bounds.data, "stopy", stopy + n * conf.boxMargin, Math.max);
2499
+ }
2500
+ }, "updateItemBounds");
2501
+ }
2502
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(updateFn, "updateFn");
2503
+ this.sequenceItems.forEach(updateFn());
2504
+ this.activations.forEach(updateFn("activation"));
2505
+ }, "updateBounds"),
2506
+ insert: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(startx, starty, stopx, stopy) {
2507
+ const _startx = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMin(startx, stopx);
2508
+ const _stopx = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(startx, stopx);
2509
+ const _starty = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMin(starty, stopy);
2510
+ const _stopy = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(starty, stopy);
2511
+ this.updateVal(bounds.data, "startx", _startx, Math.min);
2512
+ this.updateVal(bounds.data, "starty", _starty, Math.min);
2513
+ this.updateVal(bounds.data, "stopx", _stopx, Math.max);
2514
+ this.updateVal(bounds.data, "stopy", _stopy, Math.max);
2515
+ this.updateBounds(_startx, _starty, _stopx, _stopy);
2516
+ }, "insert"),
2517
+ newActivation: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(message, diagram2, actors) {
2518
+ const actorRect = actors.get(message.from);
2519
+ const stackedSize = actorActivations(message.from).length || 0;
2520
+ const x = actorRect.x + actorRect.width / 2 + (stackedSize - 1) * conf.activationWidth / 2;
2521
+ this.activations.push({
2522
+ startx: x,
2523
+ starty: this.verticalPos + 2,
2524
+ stopx: x + conf.activationWidth,
2525
+ stopy: void 0,
2526
+ actor: message.from,
2527
+ anchored: svgDraw_default.anchorElement(diagram2)
2528
+ });
2529
+ }, "newActivation"),
2530
+ endActivation: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(message) {
2531
+ const lastActorActivationIdx = this.activations.map(function(activation) {
2532
+ return activation.actor;
2533
+ }).lastIndexOf(message.from);
2534
+ return this.activations.splice(lastActorActivationIdx, 1)[0];
2535
+ }, "endActivation"),
2536
+ createLoop: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(title = { message: void 0, wrap: false, width: void 0 }, fill) {
2537
+ return {
2538
+ startx: void 0,
2539
+ starty: this.verticalPos,
2540
+ stopx: void 0,
2541
+ stopy: void 0,
2542
+ title: title.message,
2543
+ wrap: title.wrap,
2544
+ width: title.width,
2545
+ height: 0,
2546
+ fill
2547
+ };
2548
+ }, "createLoop"),
2549
+ newLoop: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(title = { message: void 0, wrap: false, width: void 0 }, fill) {
2550
+ this.sequenceItems.push(this.createLoop(title, fill));
2551
+ }, "newLoop"),
2552
+ endLoop: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
2553
+ return this.sequenceItems.pop();
2554
+ }, "endLoop"),
2555
+ isLoopOverlap: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
2556
+ return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : false;
2557
+ }, "isLoopOverlap"),
2558
+ addSectionToLoop: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(message) {
2559
+ const loop = this.sequenceItems.pop();
2560
+ loop.sections = loop.sections || [];
2561
+ loop.sectionTitles = loop.sectionTitles || [];
2562
+ loop.sections.push({ y: bounds.getVerticalPos(), height: 0 });
2563
+ loop.sectionTitles.push(message);
2564
+ this.sequenceItems.push(loop);
2565
+ }, "addSectionToLoop"),
2566
+ saveVerticalPos: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
2567
+ if (this.isLoopOverlap()) {
2568
+ this.savedVerticalPos = this.verticalPos;
2569
+ }
2570
+ }, "saveVerticalPos"),
2571
+ resetVerticalPos: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
2572
+ if (this.isLoopOverlap()) {
2573
+ this.verticalPos = this.savedVerticalPos;
2574
+ }
2575
+ }, "resetVerticalPos"),
2576
+ bumpVerticalPos: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(bump) {
2577
+ this.verticalPos = this.verticalPos + bump;
2578
+ this.data.stopy = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(this.data.stopy, this.verticalPos);
2579
+ }, "bumpVerticalPos"),
2580
+ getVerticalPos: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
2581
+ return this.verticalPos;
2582
+ }, "getVerticalPos"),
2583
+ getBounds: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function() {
2584
+ return { bounds: this.data, models: this.models };
2585
+ }, "getBounds")
2586
+ };
2587
+ var drawNote = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async function(elem, noteModel) {
2588
+ bounds.bumpVerticalPos(conf.boxMargin);
2589
+ noteModel.height = conf.boxMargin;
2590
+ noteModel.starty = bounds.getVerticalPos();
2591
+ const rect = (0,_chunk_V35ELUW5_mjs__WEBPACK_IMPORTED_MODULE_0__/* .getNoteRect */ .PB)();
2592
+ rect.x = noteModel.startx;
2593
+ rect.y = noteModel.starty;
2594
+ rect.width = noteModel.width || conf.width;
2595
+ rect.class = "note";
2596
+ const g = elem.append("g");
2597
+ const rectElem = svgDraw_default.drawRect(g, rect);
2598
+ const textObj = (0,_chunk_V35ELUW5_mjs__WEBPACK_IMPORTED_MODULE_0__/* .getTextObj */ .HT)();
2599
+ textObj.x = noteModel.startx;
2600
+ textObj.y = noteModel.starty;
2601
+ textObj.width = rect.width;
2602
+ textObj.dy = "1em";
2603
+ textObj.text = noteModel.message;
2604
+ textObj.class = "noteText";
2605
+ textObj.fontFamily = conf.noteFontFamily;
2606
+ textObj.fontSize = conf.noteFontSize;
2607
+ textObj.fontWeight = conf.noteFontWeight;
2608
+ textObj.anchor = conf.noteAlign;
2609
+ textObj.textMargin = conf.noteMargin;
2610
+ textObj.valign = "center";
2611
+ const textElem = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .hasKatex */ .Wi)(textObj.text) ? await drawKatex(g, textObj) : drawText(g, textObj);
2612
+ const textHeight = Math.round(
2613
+ textElem.map((te) => (te._groups || te)[0][0].getBBox().height).reduce((acc, curr) => acc + curr)
2614
+ );
2615
+ rectElem.attr("height", textHeight + 2 * conf.noteMargin);
2616
+ noteModel.height += textHeight + 2 * conf.noteMargin;
2617
+ bounds.bumpVerticalPos(textHeight + 2 * conf.noteMargin);
2618
+ noteModel.stopy = noteModel.starty + textHeight + 2 * conf.noteMargin;
2619
+ noteModel.stopx = noteModel.startx + rect.width;
2620
+ bounds.insert(noteModel.startx, noteModel.starty, noteModel.stopx, noteModel.stopy);
2621
+ bounds.models.addNote(noteModel);
2622
+ }, "drawNote");
2623
+ var messageFont = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((cnf) => {
2624
+ return {
2625
+ fontFamily: cnf.messageFontFamily,
2626
+ fontSize: cnf.messageFontSize,
2627
+ fontWeight: cnf.messageFontWeight
2628
+ };
2629
+ }, "messageFont");
2630
+ var noteFont = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((cnf) => {
2631
+ return {
2632
+ fontFamily: cnf.noteFontFamily,
2633
+ fontSize: cnf.noteFontSize,
2634
+ fontWeight: cnf.noteFontWeight
2635
+ };
2636
+ }, "noteFont");
2637
+ var actorFont = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((cnf) => {
2638
+ return {
2639
+ fontFamily: cnf.actorFontFamily,
2640
+ fontSize: cnf.actorFontSize,
2641
+ fontWeight: cnf.actorFontWeight
2642
+ };
2643
+ }, "actorFont");
2644
+ async function boundMessage(_diagram, msgModel) {
2645
+ bounds.bumpVerticalPos(10);
2646
+ const { startx, stopx, message } = msgModel;
2647
+ const lines = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.splitBreaks(message).length;
2648
+ const isKatexMsg = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .hasKatex */ .Wi)(message);
2649
+ const textDims = isKatexMsg ? await (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .calculateMathMLDimensions */ .Dl)(message, (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)()) : _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.calculateTextDimensions(message, messageFont(conf));
2650
+ if (!isKatexMsg) {
2651
+ const lineHeight = textDims.height / lines;
2652
+ msgModel.height += lineHeight;
2653
+ bounds.bumpVerticalPos(lineHeight);
2654
+ }
2655
+ let lineStartY;
2656
+ let totalOffset = textDims.height - 10;
2657
+ const textWidth = textDims.width;
2658
+ if (startx === stopx) {
2659
+ lineStartY = bounds.getVerticalPos() + totalOffset;
2660
+ if (!conf.rightAngles) {
2661
+ totalOffset += conf.boxMargin;
2662
+ lineStartY = bounds.getVerticalPos() + totalOffset;
2663
+ }
2664
+ totalOffset += 30;
2665
+ const dx = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(textWidth / 2, conf.width / 2);
2666
+ bounds.insert(
2667
+ startx - dx,
2668
+ bounds.getVerticalPos() - 10 + totalOffset,
2669
+ stopx + dx,
2670
+ bounds.getVerticalPos() + 30 + totalOffset
2671
+ );
2672
+ } else {
2673
+ totalOffset += conf.boxMargin;
2674
+ lineStartY = bounds.getVerticalPos() + totalOffset;
2675
+ bounds.insert(startx, lineStartY - 10, stopx, lineStartY);
2676
+ }
2677
+ bounds.bumpVerticalPos(totalOffset);
2678
+ msgModel.height += totalOffset;
2679
+ msgModel.stopy = msgModel.starty + msgModel.height;
2680
+ bounds.insert(msgModel.fromBounds, msgModel.starty, msgModel.toBounds, msgModel.stopy);
2681
+ return lineStartY;
2682
+ }
2683
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(boundMessage, "boundMessage");
2684
+ var drawMessage = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async function(diagram2, msgModel, lineStartY, diagObj) {
2685
+ const { startx, stopx, starty, message, type, sequenceIndex, sequenceVisible } = msgModel;
2686
+ const textDims = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.calculateTextDimensions(message, messageFont(conf));
2687
+ const textObj = (0,_chunk_V35ELUW5_mjs__WEBPACK_IMPORTED_MODULE_0__/* .getTextObj */ .HT)();
2688
+ textObj.x = startx;
2689
+ textObj.y = starty + 10;
2690
+ textObj.width = stopx - startx;
2691
+ textObj.class = "messageText";
2692
+ textObj.dy = "1em";
2693
+ textObj.text = message;
2694
+ textObj.fontFamily = conf.messageFontFamily;
2695
+ textObj.fontSize = conf.messageFontSize;
2696
+ textObj.fontWeight = conf.messageFontWeight;
2697
+ textObj.anchor = conf.messageAlign;
2698
+ textObj.valign = "center";
2699
+ textObj.textMargin = conf.wrapPadding;
2700
+ textObj.tspan = false;
2701
+ if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .hasKatex */ .Wi)(textObj.text)) {
2702
+ await drawKatex(diagram2, textObj, { startx, stopx, starty: lineStartY });
2703
+ } else {
2704
+ drawText(diagram2, textObj);
2705
+ }
2706
+ const textWidth = textDims.width;
2707
+ let line;
2708
+ if (startx === stopx) {
2709
+ if (conf.rightAngles) {
2710
+ line = diagram2.append("path").attr(
2711
+ "d",
2712
+ `M ${startx},${lineStartY} H ${startx + _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(conf.width / 2, textWidth / 2)} V ${lineStartY + 25} H ${startx}`
2713
+ );
2714
+ } else {
2715
+ line = diagram2.append("path").attr(
2716
+ "d",
2717
+ "M " + startx + "," + lineStartY + " C " + (startx + 60) + "," + (lineStartY - 10) + " " + (startx + 60) + "," + (lineStartY + 30) + " " + startx + "," + (lineStartY + 20)
2718
+ );
2719
+ }
2720
+ } else {
2721
+ line = diagram2.append("line");
2722
+ line.attr("x1", startx);
2723
+ line.attr("y1", lineStartY);
2724
+ line.attr("x2", stopx);
2725
+ line.attr("y2", lineStartY);
2726
+ }
2727
+ if (type === diagObj.db.LINETYPE.DOTTED || type === diagObj.db.LINETYPE.DOTTED_CROSS || type === diagObj.db.LINETYPE.DOTTED_POINT || type === diagObj.db.LINETYPE.DOTTED_OPEN || type === diagObj.db.LINETYPE.BIDIRECTIONAL_DOTTED) {
2728
+ line.style("stroke-dasharray", "3, 3");
2729
+ line.attr("class", "messageLine1");
2730
+ } else {
2731
+ line.attr("class", "messageLine0");
2732
+ }
2733
+ let url = "";
2734
+ if (conf.arrowMarkerAbsolute) {
2735
+ url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
2736
+ url = url.replace(/\(/g, "\\(");
2737
+ url = url.replace(/\)/g, "\\)");
2738
+ }
2739
+ line.attr("stroke-width", 2);
2740
+ line.attr("stroke", "none");
2741
+ line.style("fill", "none");
2742
+ if (type === diagObj.db.LINETYPE.SOLID || type === diagObj.db.LINETYPE.DOTTED) {
2743
+ line.attr("marker-end", "url(" + url + "#arrowhead)");
2744
+ }
2745
+ if (type === diagObj.db.LINETYPE.BIDIRECTIONAL_SOLID || type === diagObj.db.LINETYPE.BIDIRECTIONAL_DOTTED) {
2746
+ line.attr("marker-start", "url(" + url + "#arrowhead)");
2747
+ line.attr("marker-end", "url(" + url + "#arrowhead)");
2748
+ }
2749
+ if (type === diagObj.db.LINETYPE.SOLID_POINT || type === diagObj.db.LINETYPE.DOTTED_POINT) {
2750
+ line.attr("marker-end", "url(" + url + "#filled-head)");
2751
+ }
2752
+ if (type === diagObj.db.LINETYPE.SOLID_CROSS || type === diagObj.db.LINETYPE.DOTTED_CROSS) {
2753
+ line.attr("marker-end", "url(" + url + "#crosshead)");
2754
+ }
2755
+ if (sequenceVisible || conf.showSequenceNumbers) {
2756
+ line.attr("marker-start", "url(" + url + "#sequencenumber)");
2757
+ diagram2.append("text").attr("x", startx).attr("y", lineStartY + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(sequenceIndex);
2758
+ }
2759
+ }, "drawMessage");
2760
+ var addActorRenderingData = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(diagram2, actors, createdActors, actorKeys, verticalPos, messages, isFooter) {
2761
+ let prevWidth = 0;
2762
+ let prevMargin = 0;
2763
+ let prevBox = void 0;
2764
+ let maxHeight = 0;
2765
+ for (const actorKey of actorKeys) {
2766
+ const actor = actors.get(actorKey);
2767
+ const box = actor.box;
2768
+ if (prevBox && prevBox != box) {
2769
+ if (!isFooter) {
2770
+ bounds.models.addBox(prevBox);
2771
+ }
2772
+ prevMargin += conf.boxMargin + prevBox.margin;
2773
+ }
2774
+ if (box && box != prevBox) {
2775
+ if (!isFooter) {
2776
+ box.x = prevWidth + prevMargin;
2777
+ box.y = verticalPos;
2778
+ }
2779
+ prevMargin += box.margin;
2780
+ }
2781
+ actor.width = actor.width || conf.width;
2782
+ actor.height = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(actor.height || conf.height, conf.height);
2783
+ actor.margin = actor.margin || conf.actorMargin;
2784
+ maxHeight = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(maxHeight, actor.height);
2785
+ if (createdActors.get(actor.name)) {
2786
+ prevMargin += actor.width / 2;
2787
+ }
2788
+ actor.x = prevWidth + prevMargin;
2789
+ actor.starty = bounds.getVerticalPos();
2790
+ bounds.insert(actor.x, verticalPos, actor.x + actor.width, actor.height);
2791
+ prevWidth += actor.width + prevMargin;
2792
+ if (actor.box) {
2793
+ actor.box.width = prevWidth + box.margin - actor.box.x;
2794
+ }
2795
+ prevMargin = actor.margin;
2796
+ prevBox = actor.box;
2797
+ bounds.models.addActor(actor);
2798
+ }
2799
+ if (prevBox && !isFooter) {
2800
+ bounds.models.addBox(prevBox);
2801
+ }
2802
+ bounds.bumpVerticalPos(maxHeight);
2803
+ }, "addActorRenderingData");
2804
+ var drawActors = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async function(diagram2, actors, actorKeys, isFooter) {
2805
+ if (!isFooter) {
2806
+ for (const actorKey of actorKeys) {
2807
+ const actor = actors.get(actorKey);
2808
+ await svgDraw_default.drawActor(diagram2, actor, conf, false);
2809
+ }
2810
+ } else {
2811
+ let maxHeight = 0;
2812
+ bounds.bumpVerticalPos(conf.boxMargin * 2);
2813
+ for (const actorKey of actorKeys) {
2814
+ const actor = actors.get(actorKey);
2815
+ if (!actor.stopy) {
2816
+ actor.stopy = bounds.getVerticalPos();
2817
+ }
2818
+ const height = await svgDraw_default.drawActor(diagram2, actor, conf, true);
2819
+ maxHeight = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(maxHeight, height);
2820
+ }
2821
+ bounds.bumpVerticalPos(maxHeight + conf.boxMargin);
2822
+ }
2823
+ }, "drawActors");
2824
+ var drawActorsPopup = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(diagram2, actors, actorKeys, doc) {
2825
+ let maxHeight = 0;
2826
+ let maxWidth = 0;
2827
+ for (const actorKey of actorKeys) {
2828
+ const actor = actors.get(actorKey);
2829
+ const minMenuWidth = getRequiredPopupWidth(actor);
2830
+ const menuDimensions = svgDraw_default.drawPopup(
2831
+ diagram2,
2832
+ actor,
2833
+ minMenuWidth,
2834
+ conf,
2835
+ conf.forceMenus,
2836
+ doc
2837
+ );
2838
+ if (menuDimensions.height > maxHeight) {
2839
+ maxHeight = menuDimensions.height;
2840
+ }
2841
+ if (menuDimensions.width + actor.x > maxWidth) {
2842
+ maxWidth = menuDimensions.width + actor.x;
2843
+ }
2844
+ }
2845
+ return { maxHeight, maxWidth };
2846
+ }, "drawActorsPopup");
2847
+ var setConf = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(cnf) {
2848
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .assignWithDepth_default */ .hH)(conf, cnf);
2849
+ if (cnf.fontFamily) {
2850
+ conf.actorFontFamily = conf.noteFontFamily = conf.messageFontFamily = cnf.fontFamily;
2851
+ }
2852
+ if (cnf.fontSize) {
2853
+ conf.actorFontSize = conf.noteFontSize = conf.messageFontSize = cnf.fontSize;
2854
+ }
2855
+ if (cnf.fontWeight) {
2856
+ conf.actorFontWeight = conf.noteFontWeight = conf.messageFontWeight = cnf.fontWeight;
2857
+ }
2858
+ }, "setConf");
2859
+ var actorActivations = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(actor) {
2860
+ return bounds.activations.filter(function(activation) {
2861
+ return activation.actor === actor;
2862
+ });
2863
+ }, "actorActivations");
2864
+ var activationBounds = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(actor, actors) {
2865
+ const actorObj = actors.get(actor);
2866
+ const activations = actorActivations(actor);
2867
+ const left = activations.reduce(
2868
+ function(acc, activation) {
2869
+ return _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMin(acc, activation.startx);
2870
+ },
2871
+ actorObj.x + actorObj.width / 2 - 1
2872
+ );
2873
+ const right = activations.reduce(
2874
+ function(acc, activation) {
2875
+ return _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(acc, activation.stopx);
2876
+ },
2877
+ actorObj.x + actorObj.width / 2 + 1
2878
+ );
2879
+ return [left, right];
2880
+ }, "activationBounds");
2881
+ function adjustLoopHeightForWrap(loopWidths, msg, preMargin, postMargin, addLoopFn) {
2882
+ bounds.bumpVerticalPos(preMargin);
2883
+ let heightAdjust = postMargin;
2884
+ if (msg.id && msg.message && loopWidths[msg.id]) {
2885
+ const loopWidth = loopWidths[msg.id].width;
2886
+ const textConf = messageFont(conf);
2887
+ msg.message = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.wrapLabel(`[${msg.message}]`, loopWidth - 2 * conf.wrapPadding, textConf);
2888
+ msg.width = loopWidth;
2889
+ msg.wrap = true;
2890
+ const textDims = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.calculateTextDimensions(msg.message, textConf);
2891
+ const totalOffset = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(textDims.height, conf.labelBoxHeight);
2892
+ heightAdjust = postMargin + totalOffset;
2893
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug(`${totalOffset} - ${msg.message}`);
2894
+ }
2895
+ addLoopFn(msg);
2896
+ bounds.bumpVerticalPos(heightAdjust);
2897
+ }
2898
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(adjustLoopHeightForWrap, "adjustLoopHeightForWrap");
2899
+ function adjustCreatedDestroyedData(msg, msgModel, lineStartY, index, actors, createdActors, destroyedActors) {
2900
+ function receiverAdjustment(actor, adjustment) {
2901
+ if (actor.x < actors.get(msg.from).x) {
2902
+ bounds.insert(
2903
+ msgModel.stopx - adjustment,
2904
+ msgModel.starty,
2905
+ msgModel.startx,
2906
+ msgModel.stopy + actor.height / 2 + conf.noteMargin
2907
+ );
2908
+ msgModel.stopx = msgModel.stopx + adjustment;
2909
+ } else {
2910
+ bounds.insert(
2911
+ msgModel.startx,
2912
+ msgModel.starty,
2913
+ msgModel.stopx + adjustment,
2914
+ msgModel.stopy + actor.height / 2 + conf.noteMargin
2915
+ );
2916
+ msgModel.stopx = msgModel.stopx - adjustment;
2917
+ }
2918
+ }
2919
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(receiverAdjustment, "receiverAdjustment");
2920
+ function senderAdjustment(actor, adjustment) {
2921
+ if (actor.x < actors.get(msg.to).x) {
2922
+ bounds.insert(
2923
+ msgModel.startx - adjustment,
2924
+ msgModel.starty,
2925
+ msgModel.stopx,
2926
+ msgModel.stopy + actor.height / 2 + conf.noteMargin
2927
+ );
2928
+ msgModel.startx = msgModel.startx + adjustment;
2929
+ } else {
2930
+ bounds.insert(
2931
+ msgModel.stopx,
2932
+ msgModel.starty,
2933
+ msgModel.startx + adjustment,
2934
+ msgModel.stopy + actor.height / 2 + conf.noteMargin
2935
+ );
2936
+ msgModel.startx = msgModel.startx - adjustment;
2937
+ }
2938
+ }
2939
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(senderAdjustment, "senderAdjustment");
2940
+ if (createdActors.get(msg.to) == index) {
2941
+ const actor = actors.get(msg.to);
2942
+ const adjustment = actor.type == "actor" ? ACTOR_TYPE_WIDTH / 2 + 3 : actor.width / 2 + 3;
2943
+ receiverAdjustment(actor, adjustment);
2944
+ actor.starty = lineStartY - actor.height / 2;
2945
+ bounds.bumpVerticalPos(actor.height / 2);
2946
+ } else if (destroyedActors.get(msg.from) == index) {
2947
+ const actor = actors.get(msg.from);
2948
+ if (conf.mirrorActors) {
2949
+ const adjustment = actor.type == "actor" ? ACTOR_TYPE_WIDTH / 2 : actor.width / 2;
2950
+ senderAdjustment(actor, adjustment);
2951
+ }
2952
+ actor.stopy = lineStartY - actor.height / 2;
2953
+ bounds.bumpVerticalPos(actor.height / 2);
2954
+ } else if (destroyedActors.get(msg.to) == index) {
2955
+ const actor = actors.get(msg.to);
2956
+ if (conf.mirrorActors) {
2957
+ const adjustment = actor.type == "actor" ? ACTOR_TYPE_WIDTH / 2 + 3 : actor.width / 2 + 3;
2958
+ receiverAdjustment(actor, adjustment);
2959
+ }
2960
+ actor.stopy = lineStartY - actor.height / 2;
2961
+ bounds.bumpVerticalPos(actor.height / 2);
2962
+ }
2963
+ }
2964
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(adjustCreatedDestroyedData, "adjustCreatedDestroyedData");
2965
+ var draw = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async function(_text, id, _version, diagObj) {
2966
+ const { securityLevel, sequence } = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)();
2967
+ conf = sequence;
2968
+ let sandboxElement;
2969
+ if (securityLevel === "sandbox") {
2970
+ sandboxElement = (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)("#i" + id);
2971
+ }
2972
+ const root = securityLevel === "sandbox" ? (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(sandboxElement.nodes()[0].contentDocument.body) : (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)("body");
2973
+ const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document;
2974
+ bounds.init();
2975
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug(diagObj.db);
2976
+ const diagram2 = securityLevel === "sandbox" ? root.select(`[id="${id}"]`) : (0,d3__WEBPACK_IMPORTED_MODULE_4__/* .select */ .Ltv)(`[id="${id}"]`);
2977
+ const actors = diagObj.db.getActors();
2978
+ const createdActors = diagObj.db.getCreatedActors();
2979
+ const destroyedActors = diagObj.db.getDestroyedActors();
2980
+ const boxes = diagObj.db.getBoxes();
2981
+ let actorKeys = diagObj.db.getActorKeys();
2982
+ const messages = diagObj.db.getMessages();
2983
+ const title = diagObj.db.getDiagramTitle();
2984
+ const hasBoxes = diagObj.db.hasAtLeastOneBox();
2985
+ const hasBoxTitles = diagObj.db.hasAtLeastOneBoxWithTitle();
2986
+ const maxMessageWidthPerActor = await getMaxMessageWidthPerActor(actors, messages, diagObj);
2987
+ conf.height = await calculateActorMargins(actors, maxMessageWidthPerActor, boxes);
2988
+ svgDraw_default.insertComputerIcon(diagram2);
2989
+ svgDraw_default.insertDatabaseIcon(diagram2);
2990
+ svgDraw_default.insertClockIcon(diagram2);
2991
+ if (hasBoxes) {
2992
+ bounds.bumpVerticalPos(conf.boxMargin);
2993
+ if (hasBoxTitles) {
2994
+ bounds.bumpVerticalPos(boxes[0].textMaxHeight);
2995
+ }
2996
+ }
2997
+ if (conf.hideUnusedParticipants === true) {
2998
+ const newActors = /* @__PURE__ */ new Set();
2999
+ messages.forEach((message) => {
3000
+ newActors.add(message.from);
3001
+ newActors.add(message.to);
3002
+ });
3003
+ actorKeys = actorKeys.filter((actorKey) => newActors.has(actorKey));
3004
+ }
3005
+ addActorRenderingData(diagram2, actors, createdActors, actorKeys, 0, messages, false);
3006
+ const loopWidths = await calculateLoopBounds(messages, actors, maxMessageWidthPerActor, diagObj);
3007
+ svgDraw_default.insertArrowHead(diagram2);
3008
+ svgDraw_default.insertArrowCrossHead(diagram2);
3009
+ svgDraw_default.insertArrowFilledHead(diagram2);
3010
+ svgDraw_default.insertSequenceNumber(diagram2);
3011
+ function activeEnd(msg, verticalPos) {
3012
+ const activationData = bounds.endActivation(msg);
3013
+ if (activationData.starty + 18 > verticalPos) {
3014
+ activationData.starty = verticalPos - 6;
3015
+ verticalPos += 12;
3016
+ }
3017
+ svgDraw_default.drawActivation(
3018
+ diagram2,
3019
+ activationData,
3020
+ verticalPos,
3021
+ conf,
3022
+ actorActivations(msg.from).length
3023
+ );
3024
+ bounds.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos);
3025
+ }
3026
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(activeEnd, "activeEnd");
3027
+ let sequenceIndex = 1;
3028
+ let sequenceIndexStep = 1;
3029
+ const messagesToDraw = [];
3030
+ const backgrounds = [];
3031
+ let index = 0;
3032
+ for (const msg of messages) {
3033
+ let loopModel, noteModel, msgModel;
3034
+ switch (msg.type) {
3035
+ case diagObj.db.LINETYPE.NOTE:
3036
+ bounds.resetVerticalPos();
3037
+ noteModel = msg.noteModel;
3038
+ await drawNote(diagram2, noteModel);
3039
+ break;
3040
+ case diagObj.db.LINETYPE.ACTIVE_START:
3041
+ bounds.newActivation(msg, diagram2, actors);
3042
+ break;
3043
+ case diagObj.db.LINETYPE.ACTIVE_END:
3044
+ activeEnd(msg, bounds.getVerticalPos());
3045
+ break;
3046
+ case diagObj.db.LINETYPE.LOOP_START:
3047
+ adjustLoopHeightForWrap(
3048
+ loopWidths,
3049
+ msg,
3050
+ conf.boxMargin,
3051
+ conf.boxMargin + conf.boxTextMargin,
3052
+ (message) => bounds.newLoop(message)
3053
+ );
3054
+ break;
3055
+ case diagObj.db.LINETYPE.LOOP_END:
3056
+ loopModel = bounds.endLoop();
3057
+ await svgDraw_default.drawLoop(diagram2, loopModel, "loop", conf);
3058
+ bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());
3059
+ bounds.models.addLoop(loopModel);
3060
+ break;
3061
+ case diagObj.db.LINETYPE.RECT_START:
3062
+ adjustLoopHeightForWrap(
3063
+ loopWidths,
3064
+ msg,
3065
+ conf.boxMargin,
3066
+ conf.boxMargin,
3067
+ (message) => bounds.newLoop(void 0, message.message)
3068
+ );
3069
+ break;
3070
+ case diagObj.db.LINETYPE.RECT_END:
3071
+ loopModel = bounds.endLoop();
3072
+ backgrounds.push(loopModel);
3073
+ bounds.models.addLoop(loopModel);
3074
+ bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());
3075
+ break;
3076
+ case diagObj.db.LINETYPE.OPT_START:
3077
+ adjustLoopHeightForWrap(
3078
+ loopWidths,
3079
+ msg,
3080
+ conf.boxMargin,
3081
+ conf.boxMargin + conf.boxTextMargin,
3082
+ (message) => bounds.newLoop(message)
3083
+ );
3084
+ break;
3085
+ case diagObj.db.LINETYPE.OPT_END:
3086
+ loopModel = bounds.endLoop();
3087
+ await svgDraw_default.drawLoop(diagram2, loopModel, "opt", conf);
3088
+ bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());
3089
+ bounds.models.addLoop(loopModel);
3090
+ break;
3091
+ case diagObj.db.LINETYPE.ALT_START:
3092
+ adjustLoopHeightForWrap(
3093
+ loopWidths,
3094
+ msg,
3095
+ conf.boxMargin,
3096
+ conf.boxMargin + conf.boxTextMargin,
3097
+ (message) => bounds.newLoop(message)
3098
+ );
3099
+ break;
3100
+ case diagObj.db.LINETYPE.ALT_ELSE:
3101
+ adjustLoopHeightForWrap(
3102
+ loopWidths,
3103
+ msg,
3104
+ conf.boxMargin + conf.boxTextMargin,
3105
+ conf.boxMargin,
3106
+ (message) => bounds.addSectionToLoop(message)
3107
+ );
3108
+ break;
3109
+ case diagObj.db.LINETYPE.ALT_END:
3110
+ loopModel = bounds.endLoop();
3111
+ await svgDraw_default.drawLoop(diagram2, loopModel, "alt", conf);
3112
+ bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());
3113
+ bounds.models.addLoop(loopModel);
3114
+ break;
3115
+ case diagObj.db.LINETYPE.PAR_START:
3116
+ case diagObj.db.LINETYPE.PAR_OVER_START:
3117
+ adjustLoopHeightForWrap(
3118
+ loopWidths,
3119
+ msg,
3120
+ conf.boxMargin,
3121
+ conf.boxMargin + conf.boxTextMargin,
3122
+ (message) => bounds.newLoop(message)
3123
+ );
3124
+ bounds.saveVerticalPos();
3125
+ break;
3126
+ case diagObj.db.LINETYPE.PAR_AND:
3127
+ adjustLoopHeightForWrap(
3128
+ loopWidths,
3129
+ msg,
3130
+ conf.boxMargin + conf.boxTextMargin,
3131
+ conf.boxMargin,
3132
+ (message) => bounds.addSectionToLoop(message)
3133
+ );
3134
+ break;
3135
+ case diagObj.db.LINETYPE.PAR_END:
3136
+ loopModel = bounds.endLoop();
3137
+ await svgDraw_default.drawLoop(diagram2, loopModel, "par", conf);
3138
+ bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());
3139
+ bounds.models.addLoop(loopModel);
3140
+ break;
3141
+ case diagObj.db.LINETYPE.AUTONUMBER:
3142
+ sequenceIndex = msg.message.start || sequenceIndex;
3143
+ sequenceIndexStep = msg.message.step || sequenceIndexStep;
3144
+ if (msg.message.visible) {
3145
+ diagObj.db.enableSequenceNumbers();
3146
+ } else {
3147
+ diagObj.db.disableSequenceNumbers();
3148
+ }
3149
+ break;
3150
+ case diagObj.db.LINETYPE.CRITICAL_START:
3151
+ adjustLoopHeightForWrap(
3152
+ loopWidths,
3153
+ msg,
3154
+ conf.boxMargin,
3155
+ conf.boxMargin + conf.boxTextMargin,
3156
+ (message) => bounds.newLoop(message)
3157
+ );
3158
+ break;
3159
+ case diagObj.db.LINETYPE.CRITICAL_OPTION:
3160
+ adjustLoopHeightForWrap(
3161
+ loopWidths,
3162
+ msg,
3163
+ conf.boxMargin + conf.boxTextMargin,
3164
+ conf.boxMargin,
3165
+ (message) => bounds.addSectionToLoop(message)
3166
+ );
3167
+ break;
3168
+ case diagObj.db.LINETYPE.CRITICAL_END:
3169
+ loopModel = bounds.endLoop();
3170
+ await svgDraw_default.drawLoop(diagram2, loopModel, "critical", conf);
3171
+ bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());
3172
+ bounds.models.addLoop(loopModel);
3173
+ break;
3174
+ case diagObj.db.LINETYPE.BREAK_START:
3175
+ adjustLoopHeightForWrap(
3176
+ loopWidths,
3177
+ msg,
3178
+ conf.boxMargin,
3179
+ conf.boxMargin + conf.boxTextMargin,
3180
+ (message) => bounds.newLoop(message)
3181
+ );
3182
+ break;
3183
+ case diagObj.db.LINETYPE.BREAK_END:
3184
+ loopModel = bounds.endLoop();
3185
+ await svgDraw_default.drawLoop(diagram2, loopModel, "break", conf);
3186
+ bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());
3187
+ bounds.models.addLoop(loopModel);
3188
+ break;
3189
+ default:
3190
+ try {
3191
+ msgModel = msg.msgModel;
3192
+ msgModel.starty = bounds.getVerticalPos();
3193
+ msgModel.sequenceIndex = sequenceIndex;
3194
+ msgModel.sequenceVisible = diagObj.db.showSequenceNumbers();
3195
+ const lineStartY = await boundMessage(diagram2, msgModel);
3196
+ adjustCreatedDestroyedData(
3197
+ msg,
3198
+ msgModel,
3199
+ lineStartY,
3200
+ index,
3201
+ actors,
3202
+ createdActors,
3203
+ destroyedActors
3204
+ );
3205
+ messagesToDraw.push({ messageModel: msgModel, lineStartY });
3206
+ bounds.models.addMessage(msgModel);
3207
+ } catch (e) {
3208
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.error("error while drawing message", e);
3209
+ }
3210
+ }
3211
+ if ([
3212
+ diagObj.db.LINETYPE.SOLID_OPEN,
3213
+ diagObj.db.LINETYPE.DOTTED_OPEN,
3214
+ diagObj.db.LINETYPE.SOLID,
3215
+ diagObj.db.LINETYPE.DOTTED,
3216
+ diagObj.db.LINETYPE.SOLID_CROSS,
3217
+ diagObj.db.LINETYPE.DOTTED_CROSS,
3218
+ diagObj.db.LINETYPE.SOLID_POINT,
3219
+ diagObj.db.LINETYPE.DOTTED_POINT,
3220
+ diagObj.db.LINETYPE.BIDIRECTIONAL_SOLID,
3221
+ diagObj.db.LINETYPE.BIDIRECTIONAL_DOTTED
3222
+ ].includes(msg.type)) {
3223
+ sequenceIndex = sequenceIndex + sequenceIndexStep;
3224
+ }
3225
+ index++;
3226
+ }
3227
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("createdActors", createdActors);
3228
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("destroyedActors", destroyedActors);
3229
+ await drawActors(diagram2, actors, actorKeys, false);
3230
+ for (const e of messagesToDraw) {
3231
+ await drawMessage(diagram2, e.messageModel, e.lineStartY, diagObj);
3232
+ }
3233
+ if (conf.mirrorActors) {
3234
+ await drawActors(diagram2, actors, actorKeys, true);
3235
+ }
3236
+ backgrounds.forEach((e) => svgDraw_default.drawBackgroundRect(diagram2, e));
3237
+ fixLifeLineHeights(diagram2, actors, actorKeys, conf);
3238
+ for (const box2 of bounds.models.boxes) {
3239
+ box2.height = bounds.getVerticalPos() - box2.y;
3240
+ bounds.insert(box2.x, box2.y, box2.x + box2.width, box2.height);
3241
+ box2.startx = box2.x;
3242
+ box2.starty = box2.y;
3243
+ box2.stopx = box2.startx + box2.width;
3244
+ box2.stopy = box2.starty + box2.height;
3245
+ box2.stroke = "rgb(0,0,0, 0.5)";
3246
+ svgDraw_default.drawBox(diagram2, box2, conf);
3247
+ }
3248
+ if (hasBoxes) {
3249
+ bounds.bumpVerticalPos(conf.boxMargin);
3250
+ }
3251
+ const requiredBoxSize = drawActorsPopup(diagram2, actors, actorKeys, doc);
3252
+ const { bounds: box } = bounds.getBounds();
3253
+ if (box.startx === void 0) {
3254
+ box.startx = 0;
3255
+ }
3256
+ if (box.starty === void 0) {
3257
+ box.starty = 0;
3258
+ }
3259
+ if (box.stopx === void 0) {
3260
+ box.stopx = 0;
3261
+ }
3262
+ if (box.stopy === void 0) {
3263
+ box.stopy = 0;
3264
+ }
3265
+ let boxHeight = box.stopy - box.starty;
3266
+ if (boxHeight < requiredBoxSize.maxHeight) {
3267
+ boxHeight = requiredBoxSize.maxHeight;
3268
+ }
3269
+ let height = boxHeight + 2 * conf.diagramMarginY;
3270
+ if (conf.mirrorActors) {
3271
+ height = height - conf.boxMargin + conf.bottomMarginAdj;
3272
+ }
3273
+ let boxWidth = box.stopx - box.startx;
3274
+ if (boxWidth < requiredBoxSize.maxWidth) {
3275
+ boxWidth = requiredBoxSize.maxWidth;
3276
+ }
3277
+ const width = boxWidth + 2 * conf.diagramMarginX;
3278
+ if (title) {
3279
+ diagram2.append("text").text(title).attr("x", (box.stopx - box.startx) / 2 - 2 * conf.diagramMarginX).attr("y", -25);
3280
+ }
3281
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .configureSvgSize */ .a$)(diagram2, height, width, conf.useMaxWidth);
3282
+ const extraVertForTitle = title ? 40 : 0;
3283
+ diagram2.attr(
3284
+ "viewBox",
3285
+ box.startx - conf.diagramMarginX + " -" + (conf.diagramMarginY + extraVertForTitle) + " " + width + " " + (height + extraVertForTitle)
3286
+ );
3287
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug(`models:`, bounds.models);
3288
+ }, "draw");
3289
+ async function getMaxMessageWidthPerActor(actors, messages, diagObj) {
3290
+ const maxMessageWidthPerActor = {};
3291
+ for (const msg of messages) {
3292
+ if (actors.get(msg.to) && actors.get(msg.from)) {
3293
+ const actor = actors.get(msg.to);
3294
+ if (msg.placement === diagObj.db.PLACEMENT.LEFTOF && !actor.prevActor) {
3295
+ continue;
3296
+ }
3297
+ if (msg.placement === diagObj.db.PLACEMENT.RIGHTOF && !actor.nextActor) {
3298
+ continue;
3299
+ }
3300
+ const isNote = msg.placement !== void 0;
3301
+ const isMessage = !isNote;
3302
+ const textFont = isNote ? noteFont(conf) : messageFont(conf);
3303
+ const wrappedMessage = msg.wrap ? _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.wrapLabel(msg.message, conf.width - 2 * conf.wrapPadding, textFont) : msg.message;
3304
+ const messageDimensions = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .hasKatex */ .Wi)(wrappedMessage) ? await (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .calculateMathMLDimensions */ .Dl)(msg.message, (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)()) : _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.calculateTextDimensions(wrappedMessage, textFont);
3305
+ const messageWidth = messageDimensions.width + 2 * conf.wrapPadding;
3306
+ if (isMessage && msg.from === actor.nextActor) {
3307
+ maxMessageWidthPerActor[msg.to] = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(
3308
+ maxMessageWidthPerActor[msg.to] || 0,
3309
+ messageWidth
3310
+ );
3311
+ } else if (isMessage && msg.from === actor.prevActor) {
3312
+ maxMessageWidthPerActor[msg.from] = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(
3313
+ maxMessageWidthPerActor[msg.from] || 0,
3314
+ messageWidth
3315
+ );
3316
+ } else if (isMessage && msg.from === msg.to) {
3317
+ maxMessageWidthPerActor[msg.from] = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(
3318
+ maxMessageWidthPerActor[msg.from] || 0,
3319
+ messageWidth / 2
3320
+ );
3321
+ maxMessageWidthPerActor[msg.to] = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(
3322
+ maxMessageWidthPerActor[msg.to] || 0,
3323
+ messageWidth / 2
3324
+ );
3325
+ } else if (msg.placement === diagObj.db.PLACEMENT.RIGHTOF) {
3326
+ maxMessageWidthPerActor[msg.from] = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(
3327
+ maxMessageWidthPerActor[msg.from] || 0,
3328
+ messageWidth
3329
+ );
3330
+ } else if (msg.placement === diagObj.db.PLACEMENT.LEFTOF) {
3331
+ maxMessageWidthPerActor[actor.prevActor] = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(
3332
+ maxMessageWidthPerActor[actor.prevActor] || 0,
3333
+ messageWidth
3334
+ );
3335
+ } else if (msg.placement === diagObj.db.PLACEMENT.OVER) {
3336
+ if (actor.prevActor) {
3337
+ maxMessageWidthPerActor[actor.prevActor] = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(
3338
+ maxMessageWidthPerActor[actor.prevActor] || 0,
3339
+ messageWidth / 2
3340
+ );
3341
+ }
3342
+ if (actor.nextActor) {
3343
+ maxMessageWidthPerActor[msg.from] = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(
3344
+ maxMessageWidthPerActor[msg.from] || 0,
3345
+ messageWidth / 2
3346
+ );
3347
+ }
3348
+ }
3349
+ }
3350
+ }
3351
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("maxMessageWidthPerActor:", maxMessageWidthPerActor);
3352
+ return maxMessageWidthPerActor;
3353
+ }
3354
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(getMaxMessageWidthPerActor, "getMaxMessageWidthPerActor");
3355
+ var getRequiredPopupWidth = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(actor) {
3356
+ let requiredPopupWidth = 0;
3357
+ const textFont = actorFont(conf);
3358
+ for (const key in actor.links) {
3359
+ const labelDimensions = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.calculateTextDimensions(key, textFont);
3360
+ const labelWidth = labelDimensions.width + 2 * conf.wrapPadding + 2 * conf.boxMargin;
3361
+ if (requiredPopupWidth < labelWidth) {
3362
+ requiredPopupWidth = labelWidth;
3363
+ }
3364
+ }
3365
+ return requiredPopupWidth;
3366
+ }, "getRequiredPopupWidth");
3367
+ async function calculateActorMargins(actors, actorToMessageWidth, boxes) {
3368
+ let maxHeight = 0;
3369
+ for (const prop of actors.keys()) {
3370
+ const actor = actors.get(prop);
3371
+ if (actor.wrap) {
3372
+ actor.description = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.wrapLabel(
3373
+ actor.description,
3374
+ conf.width - 2 * conf.wrapPadding,
3375
+ actorFont(conf)
3376
+ );
3377
+ }
3378
+ const actDims = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .hasKatex */ .Wi)(actor.description) ? await (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .calculateMathMLDimensions */ .Dl)(actor.description, (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)()) : _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.calculateTextDimensions(actor.description, actorFont(conf));
3379
+ actor.width = actor.wrap ? conf.width : _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(conf.width, actDims.width + 2 * conf.wrapPadding);
3380
+ actor.height = actor.wrap ? _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(actDims.height, conf.height) : conf.height;
3381
+ maxHeight = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(maxHeight, actor.height);
3382
+ }
3383
+ for (const actorKey in actorToMessageWidth) {
3384
+ const actor = actors.get(actorKey);
3385
+ if (!actor) {
3386
+ continue;
3387
+ }
3388
+ const nextActor = actors.get(actor.nextActor);
3389
+ if (!nextActor) {
3390
+ const messageWidth2 = actorToMessageWidth[actorKey];
3391
+ const actorWidth2 = messageWidth2 + conf.actorMargin - actor.width / 2;
3392
+ actor.margin = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(actorWidth2, conf.actorMargin);
3393
+ continue;
3394
+ }
3395
+ const messageWidth = actorToMessageWidth[actorKey];
3396
+ const actorWidth = messageWidth + conf.actorMargin - actor.width / 2 - nextActor.width / 2;
3397
+ actor.margin = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(actorWidth, conf.actorMargin);
3398
+ }
3399
+ let maxBoxHeight = 0;
3400
+ boxes.forEach((box) => {
3401
+ const textFont = messageFont(conf);
3402
+ let totalWidth = box.actorKeys.reduce((total, aKey) => {
3403
+ return total += actors.get(aKey).width + (actors.get(aKey).margin || 0);
3404
+ }, 0);
3405
+ totalWidth -= 2 * conf.boxTextMargin;
3406
+ if (box.wrap) {
3407
+ box.name = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.wrapLabel(box.name, totalWidth - 2 * conf.wrapPadding, textFont);
3408
+ }
3409
+ const boxMsgDimensions = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.calculateTextDimensions(box.name, textFont);
3410
+ maxBoxHeight = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(boxMsgDimensions.height, maxBoxHeight);
3411
+ const minWidth = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(totalWidth, boxMsgDimensions.width + 2 * conf.wrapPadding);
3412
+ box.margin = conf.boxTextMargin;
3413
+ if (totalWidth < minWidth) {
3414
+ const missing = (minWidth - totalWidth) / 2;
3415
+ box.margin += missing;
3416
+ }
3417
+ });
3418
+ boxes.forEach((box) => box.textMaxHeight = maxBoxHeight);
3419
+ return _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(maxHeight, conf.height);
3420
+ }
3421
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(calculateActorMargins, "calculateActorMargins");
3422
+ var buildNoteModel = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async function(msg, actors, diagObj) {
3423
+ const fromActor = actors.get(msg.from);
3424
+ const toActor = actors.get(msg.to);
3425
+ const startx = fromActor.x;
3426
+ const stopx = toActor.x;
3427
+ const shouldWrap = msg.wrap && msg.message;
3428
+ let textDimensions = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .hasKatex */ .Wi)(msg.message) ? await (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .calculateMathMLDimensions */ .Dl)(msg.message, (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .getConfig2 */ .D7)()) : _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.calculateTextDimensions(
3429
+ shouldWrap ? _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.wrapLabel(msg.message, conf.width, noteFont(conf)) : msg.message,
3430
+ noteFont(conf)
3431
+ );
3432
+ const noteModel = {
3433
+ width: shouldWrap ? conf.width : _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(conf.width, textDimensions.width + 2 * conf.noteMargin),
3434
+ height: 0,
3435
+ startx: fromActor.x,
3436
+ stopx: 0,
3437
+ starty: 0,
3438
+ stopy: 0,
3439
+ message: msg.message
3440
+ };
3441
+ if (msg.placement === diagObj.db.PLACEMENT.RIGHTOF) {
3442
+ noteModel.width = shouldWrap ? _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(conf.width, textDimensions.width) : _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(
3443
+ fromActor.width / 2 + toActor.width / 2,
3444
+ textDimensions.width + 2 * conf.noteMargin
3445
+ );
3446
+ noteModel.startx = startx + (fromActor.width + conf.actorMargin) / 2;
3447
+ } else if (msg.placement === diagObj.db.PLACEMENT.LEFTOF) {
3448
+ noteModel.width = shouldWrap ? _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(conf.width, textDimensions.width + 2 * conf.noteMargin) : _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(
3449
+ fromActor.width / 2 + toActor.width / 2,
3450
+ textDimensions.width + 2 * conf.noteMargin
3451
+ );
3452
+ noteModel.startx = startx - noteModel.width + (fromActor.width - conf.actorMargin) / 2;
3453
+ } else if (msg.to === msg.from) {
3454
+ textDimensions = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.calculateTextDimensions(
3455
+ shouldWrap ? _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.wrapLabel(msg.message, _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(conf.width, fromActor.width), noteFont(conf)) : msg.message,
3456
+ noteFont(conf)
3457
+ );
3458
+ noteModel.width = shouldWrap ? _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(conf.width, fromActor.width) : _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(fromActor.width, conf.width, textDimensions.width + 2 * conf.noteMargin);
3459
+ noteModel.startx = startx + (fromActor.width - noteModel.width) / 2;
3460
+ } else {
3461
+ noteModel.width = Math.abs(startx + fromActor.width / 2 - (stopx + toActor.width / 2)) + conf.actorMargin;
3462
+ noteModel.startx = startx < stopx ? startx + fromActor.width / 2 - conf.actorMargin / 2 : stopx + toActor.width / 2 - conf.actorMargin / 2;
3463
+ }
3464
+ if (shouldWrap) {
3465
+ noteModel.message = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.wrapLabel(
3466
+ msg.message,
3467
+ noteModel.width - 2 * conf.wrapPadding,
3468
+ noteFont(conf)
3469
+ );
3470
+ }
3471
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug(
3472
+ `NM:[${noteModel.startx},${noteModel.stopx},${noteModel.starty},${noteModel.stopy}:${noteModel.width},${noteModel.height}=${msg.message}]`
3473
+ );
3474
+ return noteModel;
3475
+ }, "buildNoteModel");
3476
+ var buildMessageModel = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(function(msg, actors, diagObj) {
3477
+ if (![
3478
+ diagObj.db.LINETYPE.SOLID_OPEN,
3479
+ diagObj.db.LINETYPE.DOTTED_OPEN,
3480
+ diagObj.db.LINETYPE.SOLID,
3481
+ diagObj.db.LINETYPE.DOTTED,
3482
+ diagObj.db.LINETYPE.SOLID_CROSS,
3483
+ diagObj.db.LINETYPE.DOTTED_CROSS,
3484
+ diagObj.db.LINETYPE.SOLID_POINT,
3485
+ diagObj.db.LINETYPE.DOTTED_POINT,
3486
+ diagObj.db.LINETYPE.BIDIRECTIONAL_SOLID,
3487
+ diagObj.db.LINETYPE.BIDIRECTIONAL_DOTTED
3488
+ ].includes(msg.type)) {
3489
+ return {};
3490
+ }
3491
+ const [fromLeft, fromRight] = activationBounds(msg.from, actors);
3492
+ const [toLeft, toRight] = activationBounds(msg.to, actors);
3493
+ const isArrowToRight = fromLeft <= toLeft;
3494
+ let startx = isArrowToRight ? fromRight : fromLeft;
3495
+ let stopx = isArrowToRight ? toLeft : toRight;
3496
+ const isArrowToActivation = Math.abs(toLeft - toRight) > 2;
3497
+ const adjustValue = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)((value) => {
3498
+ return isArrowToRight ? -value : value;
3499
+ }, "adjustValue");
3500
+ if (msg.from === msg.to) {
3501
+ stopx = startx;
3502
+ } else {
3503
+ if (msg.activate && !isArrowToActivation) {
3504
+ stopx += adjustValue(conf.activationWidth / 2 - 1);
3505
+ }
3506
+ if (![diagObj.db.LINETYPE.SOLID_OPEN, diagObj.db.LINETYPE.DOTTED_OPEN].includes(msg.type)) {
3507
+ stopx += adjustValue(3);
3508
+ }
3509
+ if ([diagObj.db.LINETYPE.BIDIRECTIONAL_SOLID, diagObj.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(
3510
+ msg.type
3511
+ )) {
3512
+ startx -= adjustValue(3);
3513
+ }
3514
+ }
3515
+ const allBounds = [fromLeft, fromRight, toLeft, toRight];
3516
+ const boundedWidth = Math.abs(startx - stopx);
3517
+ if (msg.wrap && msg.message) {
3518
+ msg.message = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.wrapLabel(
3519
+ msg.message,
3520
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(boundedWidth + 2 * conf.wrapPadding, conf.width),
3521
+ messageFont(conf)
3522
+ );
3523
+ }
3524
+ const msgDims = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.calculateTextDimensions(msg.message, messageFont(conf));
3525
+ return {
3526
+ width: _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(
3527
+ msg.wrap ? 0 : msgDims.width + 2 * conf.wrapPadding,
3528
+ boundedWidth + 2 * conf.wrapPadding,
3529
+ conf.width
3530
+ ),
3531
+ height: 0,
3532
+ startx,
3533
+ stopx,
3534
+ starty: 0,
3535
+ stopy: 0,
3536
+ message: msg.message,
3537
+ type: msg.type,
3538
+ wrap: msg.wrap,
3539
+ fromBounds: Math.min.apply(null, allBounds),
3540
+ toBounds: Math.max.apply(null, allBounds)
3541
+ };
3542
+ }, "buildMessageModel");
3543
+ var calculateLoopBounds = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(async function(messages, actors, _maxWidthPerActor, diagObj) {
3544
+ const loops = {};
3545
+ const stack = [];
3546
+ let current, noteModel, msgModel;
3547
+ for (const msg of messages) {
3548
+ msg.id = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_2__/* .utils_default */ ._K.random({ length: 10 });
3549
+ switch (msg.type) {
3550
+ case diagObj.db.LINETYPE.LOOP_START:
3551
+ case diagObj.db.LINETYPE.ALT_START:
3552
+ case diagObj.db.LINETYPE.OPT_START:
3553
+ case diagObj.db.LINETYPE.PAR_START:
3554
+ case diagObj.db.LINETYPE.PAR_OVER_START:
3555
+ case diagObj.db.LINETYPE.CRITICAL_START:
3556
+ case diagObj.db.LINETYPE.BREAK_START:
3557
+ stack.push({
3558
+ id: msg.id,
3559
+ msg: msg.message,
3560
+ from: Number.MAX_SAFE_INTEGER,
3561
+ to: Number.MIN_SAFE_INTEGER,
3562
+ width: 0
3563
+ });
3564
+ break;
3565
+ case diagObj.db.LINETYPE.ALT_ELSE:
3566
+ case diagObj.db.LINETYPE.PAR_AND:
3567
+ case diagObj.db.LINETYPE.CRITICAL_OPTION:
3568
+ if (msg.message) {
3569
+ current = stack.pop();
3570
+ loops[current.id] = current;
3571
+ loops[msg.id] = current;
3572
+ stack.push(current);
3573
+ }
3574
+ break;
3575
+ case diagObj.db.LINETYPE.LOOP_END:
3576
+ case diagObj.db.LINETYPE.ALT_END:
3577
+ case diagObj.db.LINETYPE.OPT_END:
3578
+ case diagObj.db.LINETYPE.PAR_END:
3579
+ case diagObj.db.LINETYPE.CRITICAL_END:
3580
+ case diagObj.db.LINETYPE.BREAK_END:
3581
+ current = stack.pop();
3582
+ loops[current.id] = current;
3583
+ break;
3584
+ case diagObj.db.LINETYPE.ACTIVE_START:
3585
+ {
3586
+ const actorRect = actors.get(msg.from ? msg.from : msg.to.actor);
3587
+ const stackedSize = actorActivations(msg.from ? msg.from : msg.to.actor).length;
3588
+ const x = actorRect.x + actorRect.width / 2 + (stackedSize - 1) * conf.activationWidth / 2;
3589
+ const toAdd = {
3590
+ startx: x,
3591
+ stopx: x + conf.activationWidth,
3592
+ actor: msg.from,
3593
+ enabled: true
3594
+ };
3595
+ bounds.activations.push(toAdd);
3596
+ }
3597
+ break;
3598
+ case diagObj.db.LINETYPE.ACTIVE_END:
3599
+ {
3600
+ const lastActorActivationIdx = bounds.activations.map((a) => a.actor).lastIndexOf(msg.from);
3601
+ bounds.activations.splice(lastActorActivationIdx, 1).splice(0, 1);
3602
+ }
3603
+ break;
3604
+ }
3605
+ const isNote = msg.placement !== void 0;
3606
+ if (isNote) {
3607
+ noteModel = await buildNoteModel(msg, actors, diagObj);
3608
+ msg.noteModel = noteModel;
3609
+ stack.forEach((stk) => {
3610
+ current = stk;
3611
+ current.from = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMin(current.from, noteModel.startx);
3612
+ current.to = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(current.to, noteModel.startx + noteModel.width);
3613
+ current.width = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(current.width, Math.abs(current.from - current.to)) - conf.labelBoxWidth;
3614
+ });
3615
+ } else {
3616
+ msgModel = buildMessageModel(msg, actors, diagObj);
3617
+ msg.msgModel = msgModel;
3618
+ if (msgModel.startx && msgModel.stopx && stack.length > 0) {
3619
+ stack.forEach((stk) => {
3620
+ current = stk;
3621
+ if (msgModel.startx === msgModel.stopx) {
3622
+ const from = actors.get(msg.from);
3623
+ const to = actors.get(msg.to);
3624
+ current.from = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMin(
3625
+ from.x - msgModel.width / 2,
3626
+ from.x - from.width / 2,
3627
+ current.from
3628
+ );
3629
+ current.to = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(
3630
+ to.x + msgModel.width / 2,
3631
+ to.x + from.width / 2,
3632
+ current.to
3633
+ );
3634
+ current.width = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(current.width, Math.abs(current.to - current.from)) - conf.labelBoxWidth;
3635
+ } else {
3636
+ current.from = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMin(msgModel.startx, current.from);
3637
+ current.to = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(msgModel.stopx, current.to);
3638
+ current.width = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .common_default */ .Y2.getMax(current.width, msgModel.width) - conf.labelBoxWidth;
3639
+ }
3640
+ });
3641
+ }
3642
+ }
3643
+ }
3644
+ bounds.activations = [];
3645
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .log */ .Rm.debug("Loop type widths:", loops);
3646
+ return loops;
3647
+ }, "calculateLoopBounds");
3648
+ var sequenceRenderer_default = {
3649
+ bounds,
3650
+ drawActors,
3651
+ drawActorsPopup,
3652
+ setConf,
3653
+ draw
3654
+ };
3655
+
3656
+ // src/diagrams/sequence/sequenceDiagram.ts
3657
+ var diagram = {
3658
+ parser: sequenceDiagram_default,
3659
+ db: sequenceDb_default,
3660
+ renderer: sequenceRenderer_default,
3661
+ styles: styles_default,
3662
+ init: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_3__/* .__name */ .K2)(({ wrap }) => {
3663
+ sequenceDb_default.setWrap(wrap);
3664
+ }, "init")
3665
+ };
3666
+
3667
+
3668
+
3669
+ /***/ })
3670
+
3671
+ }]);