@blueking/ai-blueking 2.0.0-dev.2 → 2.0.0-dev.3

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