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