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