@layers-app/editor 0.4.1 → 0.5.1

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 (241) hide show
  1. package/README.md +37 -1
  2. package/package.json +10 -10
  3. package/dist/index.cjs +0 -2
  4. package/dist/index.d.ts +0 -315
  5. package/dist/index.js +0 -13
  6. package/dist/layers.-23sKdPr.js +0 -10
  7. package/dist/layers.2Zh_Eqge.js +0 -118
  8. package/dist/layers.52famHy6.js +0 -1
  9. package/dist/layers.6xiY7Dmk.js +0 -10
  10. package/dist/layers.7JqFgE4-.js +0 -15
  11. package/dist/layers.7aWFCBDk.js +0 -36
  12. package/dist/layers.9--aZzKT.js +0 -41
  13. package/dist/layers.99J97lec.js +0 -40
  14. package/dist/layers.9QK1wiQj.js +0 -1
  15. package/dist/layers.9pNaFvaX.js +0 -1
  16. package/dist/layers.B16HCOzz.js +0 -11
  17. package/dist/layers.B19hGmey.js +0 -1
  18. package/dist/layers.B1GsQlw2.js +0 -202
  19. package/dist/layers.B1VWPJr7.js +0 -61
  20. package/dist/layers.B2AGu32C.js +0 -11692
  21. package/dist/layers.B3D4g2HH.js +0 -1
  22. package/dist/layers.B4Jcovwh.js +0 -160
  23. package/dist/layers.B4o4Yght.js +0 -39
  24. package/dist/layers.B51TBzz6.js +0 -1
  25. package/dist/layers.B5HV5CkN.js +0 -6
  26. package/dist/layers.B5VQ5ysd.js +0 -230
  27. package/dist/layers.B7uv8aVq.js +0 -39
  28. package/dist/layers.B9ypkXfB.js +0 -1
  29. package/dist/layers.BATSJhNp.js +0 -10
  30. package/dist/layers.BAe6u370.js +0 -793
  31. package/dist/layers.BAtv1CM7.js +0 -1
  32. package/dist/layers.BCMyc6dl.js +0 -1
  33. package/dist/layers.BChBzZgi.js +0 -139
  34. package/dist/layers.BCtnSgBi.js +0 -139
  35. package/dist/layers.BGXN8iGN.js +0 -36
  36. package/dist/layers.BH9NvW2c.js +0 -1
  37. package/dist/layers.BHEN4Zl8.js +0 -9
  38. package/dist/layers.BI-S-U1z.js +0 -34
  39. package/dist/layers.BIATzXuT.js +0 -5
  40. package/dist/layers.BId9R-tt.js +0 -9
  41. package/dist/layers.BIeVwYKL.js +0 -1
  42. package/dist/layers.BIj1zRV6.js +0 -8
  43. package/dist/layers.BK7Umu5k.js +0 -40
  44. package/dist/layers.BL7PsAnh.js +0 -40
  45. package/dist/layers.BLha5Ags.js +0 -1
  46. package/dist/layers.BNcxqXDY.js +0 -2
  47. package/dist/layers.BOY6DvLj.js +0 -41
  48. package/dist/layers.BQ5pHr1t.js +0 -9
  49. package/dist/layers.BR9erYvc.js +0 -425
  50. package/dist/layers.BSTBZrFn.js +0 -1
  51. package/dist/layers.BTjqsj2D.js +0 -32
  52. package/dist/layers.BU0ouPbJ.js +0 -40
  53. package/dist/layers.BVLHr0fv.js +0 -21938
  54. package/dist/layers.BVhV_yLo.js +0 -59
  55. package/dist/layers.BWppdp8z.js +0 -37
  56. package/dist/layers.BXGZ-IPG.js +0 -37
  57. package/dist/layers.BXIQjroR.js +0 -8
  58. package/dist/layers.BXe2f2v0.js +0 -10
  59. package/dist/layers.BaREUEpY.js +0 -1
  60. package/dist/layers.BbCfEXyj.js +0 -55
  61. package/dist/layers.BdxgA5Mh.js +0 -40
  62. package/dist/layers.BeXV53PI.js +0 -38
  63. package/dist/layers.Bf4maS9l.js +0 -41
  64. package/dist/layers.BgOa2ZQq.js +0 -7
  65. package/dist/layers.BgXRgBMD.js +0 -9
  66. package/dist/layers.Bgx4q6Yl.js +0 -1
  67. package/dist/layers.BiJ8hfRt.js +0 -1510
  68. package/dist/layers.BiK_NhRx.js +0 -13
  69. package/dist/layers.BjIrZvhA.js +0 -41
  70. package/dist/layers.BkDwnhF3.js +0 -39
  71. package/dist/layers.BkZl0e9Y.js +0 -10
  72. package/dist/layers.BkkBEMI4.js +0 -122
  73. package/dist/layers.Bl2uWPK5.js +0 -35
  74. package/dist/layers.BldgpPoA.js +0 -21763
  75. package/dist/layers.BmdNYA8O.js +0 -39
  76. package/dist/layers.BoUDsd20.js +0 -84
  77. package/dist/layers.BpilXLfW.js +0 -6
  78. package/dist/layers.Bqy_BDRk.js +0 -960
  79. package/dist/layers.BvQfT02S.js +0 -9
  80. package/dist/layers.BxCLnc_z.js +0 -52
  81. package/dist/layers.Bxuc5Ku1.js +0 -6
  82. package/dist/layers.Bxx3QiqH.js +0 -5
  83. package/dist/layers.BzufRV9o.js +0 -4
  84. package/dist/layers.C-S1uftF.js +0 -1
  85. package/dist/layers.C00McVdb.js +0 -116
  86. package/dist/layers.C3-Awt80.js +0 -186
  87. package/dist/layers.C46xOyCn.js +0 -1
  88. package/dist/layers.C4Z2eV4H.js +0 -437
  89. package/dist/layers.C5fqgGR6.js +0 -33
  90. package/dist/layers.C5pjkDUm.js +0 -8
  91. package/dist/layers.C5th-3Bk.js +0 -4
  92. package/dist/layers.C5vdiuk-.js +0 -1
  93. package/dist/layers.C6FZDcP0.js +0 -5
  94. package/dist/layers.C6ueRaWn.js +0 -1
  95. package/dist/layers.C6vMG-T6.js +0 -39
  96. package/dist/layers.C7lIplJU.js +0 -247
  97. package/dist/layers.C7md-mpb.js +0 -373
  98. package/dist/layers.C8Lyyff8.js +0 -39
  99. package/dist/layers.C8WU47YC.js +0 -7
  100. package/dist/layers.C8_lu5UH.js +0 -23
  101. package/dist/layers.CAZF51iw.js +0 -769
  102. package/dist/layers.CDmsB9ui.js +0 -9
  103. package/dist/layers.CENOzW4d.js +0 -32
  104. package/dist/layers.CESONz7C.js +0 -35
  105. package/dist/layers.CEW7Z5oj.js +0 -40
  106. package/dist/layers.CHE9Vv0w.js +0 -2966
  107. package/dist/layers.CHMDrzTP.js +0 -1
  108. package/dist/layers.CHZsXQcr.js +0 -1
  109. package/dist/layers.CIkcRflS.js +0 -32
  110. package/dist/layers.CJdGap0M.js +0 -40
  111. package/dist/layers.CJgtfrlM.js +0 -9
  112. package/dist/layers.CK15u90j.js +0 -32
  113. package/dist/layers.CKyZ6fil.js +0 -220
  114. package/dist/layers.COAF7f8g.js +0 -1
  115. package/dist/layers.CP7ZgLdQ.js +0 -802
  116. package/dist/layers.CQ_KfkMs.js +0 -1
  117. package/dist/layers.CSKgny-q.js +0 -1359
  118. package/dist/layers.CX4-2iW9.js +0 -8
  119. package/dist/layers.CX4mdDUE.js +0 -40
  120. package/dist/layers.CXFcyuib.js +0 -51
  121. package/dist/layers.CXnC6LGK.js +0 -1
  122. package/dist/layers.CXoz8wje.js +0 -11
  123. package/dist/layers.CZianMah.js +0 -33
  124. package/dist/layers.CbrkK8Nl.js +0 -6
  125. package/dist/layers.CdPjGs2x.js +0 -32
  126. package/dist/layers.CdZEenM8.js +0 -8
  127. package/dist/layers.CeESKes4.js +0 -37
  128. package/dist/layers.CebNnxUV.js +0 -185
  129. package/dist/layers.Cg0Puk92.js +0 -40
  130. package/dist/layers.ChG4YWfr.js +0 -1034
  131. package/dist/layers.ChLLCYeV.js +0 -7
  132. package/dist/layers.Cj5o49qm.js +0 -7
  133. package/dist/layers.Ck_m9yBu.js +0 -41
  134. package/dist/layers.Cl9YbTGP.js +0 -1
  135. package/dist/layers.Clo5oIEO.js +0 -70
  136. package/dist/layers.Cmeg2JEe.js +0 -10
  137. package/dist/layers.CqVTtuYm.js +0 -6
  138. package/dist/layers.Cs24L6er.js +0 -261
  139. package/dist/layers.Ctcl9I58.js +0 -10
  140. package/dist/layers.Cuf8LL65.js +0 -4
  141. package/dist/layers.CusXQPSP.js +0 -41
  142. package/dist/layers.CyaiBxcg.js +0 -1
  143. package/dist/layers.D-4MyOv6.js +0 -1126
  144. package/dist/layers.D0fuzbA_.js +0 -1580
  145. package/dist/layers.D0t24lyP.js +0 -1619
  146. package/dist/layers.D0zn4_Mx.js +0 -1
  147. package/dist/layers.D37kPodI.js +0 -7
  148. package/dist/layers.D3PBqBbY.js +0 -4
  149. package/dist/layers.D3eSioXs.js +0 -1
  150. package/dist/layers.D4fGb2cV.js +0 -1272
  151. package/dist/layers.D56jgM5P.js +0 -803
  152. package/dist/layers.D7jGxypv.js +0 -8
  153. package/dist/layers.DBgQS_TD.js +0 -39
  154. package/dist/layers.DE8kdoob.js +0 -8
  155. package/dist/layers.DEMbeDH5.js +0 -96
  156. package/dist/layers.DGfERl47.js +0 -39
  157. package/dist/layers.DGhEo4ps.js +0 -6
  158. package/dist/layers.DHbgl38J.js +0 -1
  159. package/dist/layers.DIW19mY0.js +0 -2235
  160. package/dist/layers.DIsd_eLu.js +0 -931
  161. package/dist/layers.DKhnUElF.js +0 -3
  162. package/dist/layers.DLwuMfdd.js +0 -84
  163. package/dist/layers.DMXwnUhk.js +0 -10
  164. package/dist/layers.DMkBISW1.js +0 -1
  165. package/dist/layers.DN9HoVxI.js +0 -18
  166. package/dist/layers.DOjcR2u6.js +0 -44
  167. package/dist/layers.DOrgOHBr.js +0 -1
  168. package/dist/layers.DRd1i4Pe.js +0 -2
  169. package/dist/layers.DSiVxrm-.js +0 -9
  170. package/dist/layers.DV0u_-wO.js +0 -1
  171. package/dist/layers.DYJhYqR2.js +0 -1089
  172. package/dist/layers.DYR-z4Xd.js +0 -65
  173. package/dist/layers.D_KjhW7m.js +0 -9
  174. package/dist/layers.DaA4pT9g.js +0 -42
  175. package/dist/layers.DbaKVP5e.js +0 -1
  176. package/dist/layers.DcGuLvyP.js +0 -1
  177. package/dist/layers.DczwzPio.js +0 -1
  178. package/dist/layers.DdULzc5-.js +0 -42
  179. package/dist/layers.De4i5Pzr.js +0 -423
  180. package/dist/layers.Dg_ubB5o.js +0 -38
  181. package/dist/layers.DhtUpSvn.js +0 -7
  182. package/dist/layers.DiAtOpGJ.js +0 -38
  183. package/dist/layers.DjUOC4st.js +0 -16
  184. package/dist/layers.DlH0lUyY.js +0 -7
  185. package/dist/layers.Dms1jgA7.js +0 -7
  186. package/dist/layers.DnvdN9TC.js +0 -9
  187. package/dist/layers.Doo3HAhr.js +0 -42
  188. package/dist/layers.Dpl-_pRd.js +0 -282
  189. package/dist/layers.Dq7WsWG1.js +0 -8
  190. package/dist/layers.Dr-_us97.js +0 -5
  191. package/dist/layers.Dr9AgtBT.js +0 -1265
  192. package/dist/layers.DsIrXvQc.js +0 -36
  193. package/dist/layers.DuC5Q-Uc.js +0 -1
  194. package/dist/layers.Dwrpihyi.js +0 -9148
  195. package/dist/layers.Dx7QSKbZ.js +0 -257
  196. package/dist/layers.DxA6ocdw.js +0 -70
  197. package/dist/layers.Dy1naDTQ.js +0 -14
  198. package/dist/layers.DyIa2FAJ.js +0 -501
  199. package/dist/layers.DyrpParn.js +0 -42
  200. package/dist/layers.G0qyEFRn.js +0 -7
  201. package/dist/layers.HnnZ9X3g.js +0 -41
  202. package/dist/layers.Ih_DycCa.js +0 -904
  203. package/dist/layers.JWCLFILJ.js +0 -1
  204. package/dist/layers.MXTL7J0X.js +0 -45828
  205. package/dist/layers.N0KTyT8H.js +0 -10
  206. package/dist/layers.NLvydYLt.js +0 -19
  207. package/dist/layers.NQOujqxE.js +0 -207
  208. package/dist/layers.O7rgjuxq.js +0 -35
  209. package/dist/layers.OF4XgnEn.js +0 -320
  210. package/dist/layers.OqM7Ogm0.js +0 -6
  211. package/dist/layers.P0RFt4vw.js +0 -10
  212. package/dist/layers.PWkD3FXd.js +0 -32
  213. package/dist/layers.Q933nYVT.js +0 -14
  214. package/dist/layers.ShoHTpWp.js +0 -11
  215. package/dist/layers.TP-LPR2e.js +0 -1283
  216. package/dist/layers.U8d2vvil.js +0 -11
  217. package/dist/layers.UHdtuNW7.js +0 -6
  218. package/dist/layers.UPBrkQqm.js +0 -1088
  219. package/dist/layers.Y1n_hIuc.js +0 -1
  220. package/dist/layers._uHasBFO.js +0 -40
  221. package/dist/layers._uJVChzG.js +0 -48146
  222. package/dist/layers.b0h5ZBmD.js +0 -61
  223. package/dist/layers.b_l02tem.js +0 -319
  224. package/dist/layers.d0donhTp.js +0 -36
  225. package/dist/layers.fjvgvmUK.js +0 -37
  226. package/dist/layers.gSOgK4cv.js +0 -41
  227. package/dist/layers.h2SsCt7w.js +0 -8
  228. package/dist/layers.hzJoyUwS.js +0 -268
  229. package/dist/layers.j4D7aRnj.js +0 -42
  230. package/dist/layers.l7Uj4NoM.js +0 -8
  231. package/dist/layers.lCpg7dOn.js +0 -21
  232. package/dist/layers.mS0YwpDF.js +0 -2479
  233. package/dist/layers.oLym9I6R.js +0 -8
  234. package/dist/layers.pGJnLNqj.js +0 -285
  235. package/dist/layers.pRFngToG.js +0 -1
  236. package/dist/layers.rK-vslvx.js +0 -2
  237. package/dist/layers.rSvdeOjc.js +0 -84
  238. package/dist/layers.rwvkqrdF.js +0 -11
  239. package/dist/layers.wRnSjyfZ.js +0 -5
  240. package/dist/layers.xbymChc4.js +0 -790
  241. package/dist/layers.xlbtHZsv.js +0 -39
@@ -1,2235 +0,0 @@
1
- import { a as we, s as ve, c as $t, g as st, o as _e, n as ke, b as Pe, d as Lt, l as X, e as Le, f as Ie, j as v, i as At, q as Ae, u as B, R as nt, S as wt, T as te, Z as Ne, V as ee, W as Bt } from "./layers.Dwrpihyi.js";
2
- import { K as se } from "./layers.BldgpPoA.js";
3
- import { a as Se, b as zt, d as Me, g as Nt, c as Re, e as Ce } from "./layers.DYR-z4Xd.js";
4
- var Yt = (function() {
5
- var t = function(dt, w, k, L) {
6
- for (k = k || {}, L = dt.length; L--; k[dt[L]] = w)
7
- ;
8
- return k;
9
- }, e = [1, 2], o = [1, 3], s = [1, 4], i = [2, 4], a = [1, 9], c = [1, 11], l = [1, 13], p = [1, 14], r = [1, 16], x = [1, 17], T = [1, 18], u = [1, 24], g = [1, 25], m = [1, 26], _ = [1, 27], I = [1, 28], V = [1, 29], S = [1, 30], O = [1, 31], R = [1, 32], q = [1, 33], z = [1, 34], J = [1, 35], $ = [1, 36], H = [1, 37], K = [1, 38], F = [1, 39], W = [1, 41], Z = [1, 42], U = [1, 43], Q = [1, 44], tt = [1, 45], N = [1, 46], y = [1, 4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 48, 49, 50, 52, 53, 54, 59, 60, 61, 62, 70], P = [4, 5, 16, 50, 52, 53], j = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], rt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 49, 50, 52, 53, 54, 59, 60, 61, 62, 70], A = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 48, 50, 52, 53, 54, 59, 60, 61, 62, 70], Gt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 50, 52, 53, 54, 59, 60, 61, 62, 70], ht = [68, 69, 70], ot = [1, 120], Mt = {
10
- trace: function() {
11
- },
12
- yy: {},
13
- symbols_: { error: 2, start: 3, SPACE: 4, NEWLINE: 5, SD: 6, document: 7, line: 8, statement: 9, box_section: 10, box_line: 11, participant_statement: 12, create: 13, box: 14, restOfLine: 15, end: 16, signal: 17, autonumber: 18, NUM: 19, off: 20, activate: 21, actor: 22, deactivate: 23, note_statement: 24, links_statement: 25, link_statement: 26, properties_statement: 27, details_statement: 28, title: 29, legacy_title: 30, acc_title: 31, acc_title_value: 32, acc_descr: 33, acc_descr_value: 34, acc_descr_multiline_value: 35, loop: 36, rect: 37, opt: 38, alt: 39, else_sections: 40, par: 41, par_sections: 42, par_over: 43, critical: 44, option_sections: 45, break: 46, option: 47, and: 48, else: 49, participant: 50, AS: 51, participant_actor: 52, destroy: 53, note: 54, placement: 55, text2: 56, over: 57, actor_pair: 58, links: 59, link: 60, properties: 61, details: 62, spaceList: 63, ",": 64, left_of: 65, right_of: 66, signaltype: 67, "+": 68, "-": 69, ACTOR: 70, SOLID_OPEN_ARROW: 71, DOTTED_OPEN_ARROW: 72, SOLID_ARROW: 73, DOTTED_ARROW: 74, SOLID_CROSS: 75, DOTTED_CROSS: 76, SOLID_POINT: 77, DOTTED_POINT: 78, TXT: 79, $accept: 0, $end: 1 },
14
- terminals_: { 2: "error", 4: "SPACE", 5: "NEWLINE", 6: "SD", 13: "create", 14: "box", 15: "restOfLine", 16: "end", 18: "autonumber", 19: "NUM", 20: "off", 21: "activate", 23: "deactivate", 29: "title", 30: "legacy_title", 31: "acc_title", 32: "acc_title_value", 33: "acc_descr", 34: "acc_descr_value", 35: "acc_descr_multiline_value", 36: "loop", 37: "rect", 38: "opt", 39: "alt", 41: "par", 43: "par_over", 44: "critical", 46: "break", 47: "option", 48: "and", 49: "else", 50: "participant", 51: "AS", 52: "participant_actor", 53: "destroy", 54: "note", 57: "over", 59: "links", 60: "link", 61: "properties", 62: "details", 64: ",", 65: "left_of", 66: "right_of", 68: "+", 69: "-", 70: "ACTOR", 71: "SOLID_OPEN_ARROW", 72: "DOTTED_OPEN_ARROW", 73: "SOLID_ARROW", 74: "DOTTED_ARROW", 75: "SOLID_CROSS", 76: "DOTTED_CROSS", 77: "SOLID_POINT", 78: "DOTTED_POINT", 79: "TXT" },
15
- productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [10, 0], [10, 2], [11, 2], [11, 1], [11, 1], [9, 1], [9, 2], [9, 4], [9, 2], [9, 4], [9, 3], [9, 3], [9, 2], [9, 3], [9, 3], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [45, 1], [45, 4], [42, 1], [42, 4], [40, 1], [40, 4], [12, 5], [12, 3], [12, 5], [12, 3], [12, 3], [24, 4], [24, 4], [25, 3], [26, 3], [27, 3], [28, 3], [63, 2], [63, 1], [58, 3], [58, 1], [55, 1], [55, 1], [17, 5], [17, 5], [17, 4], [22, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [56, 1]],
16
- performAction: function(w, k, L, b, M, h, Et) {
17
- var d = h.length - 1;
18
- switch (M) {
19
- case 3:
20
- return b.apply(h[d]), h[d];
21
- case 4:
22
- case 9:
23
- this.$ = [];
24
- break;
25
- case 5:
26
- case 10:
27
- h[d - 1].push(h[d]), this.$ = h[d - 1];
28
- break;
29
- case 6:
30
- case 7:
31
- case 11:
32
- case 12:
33
- this.$ = h[d];
34
- break;
35
- case 8:
36
- case 13:
37
- this.$ = [];
38
- break;
39
- case 15:
40
- h[d].type = "createParticipant", this.$ = h[d];
41
- break;
42
- case 16:
43
- h[d - 1].unshift({ type: "boxStart", boxData: b.parseBoxData(h[d - 2]) }), h[d - 1].push({ type: "boxEnd", boxText: h[d - 2] }), this.$ = h[d - 1];
44
- break;
45
- case 18:
46
- this.$ = { type: "sequenceIndex", sequenceIndex: Number(h[d - 2]), sequenceIndexStep: Number(h[d - 1]), sequenceVisible: !0, signalType: b.LINETYPE.AUTONUMBER };
47
- break;
48
- case 19:
49
- this.$ = { type: "sequenceIndex", sequenceIndex: Number(h[d - 1]), sequenceIndexStep: 1, sequenceVisible: !0, signalType: b.LINETYPE.AUTONUMBER };
50
- break;
51
- case 20:
52
- this.$ = { type: "sequenceIndex", sequenceVisible: !1, signalType: b.LINETYPE.AUTONUMBER };
53
- break;
54
- case 21:
55
- this.$ = { type: "sequenceIndex", sequenceVisible: !0, signalType: b.LINETYPE.AUTONUMBER };
56
- break;
57
- case 22:
58
- this.$ = { type: "activeStart", signalType: b.LINETYPE.ACTIVE_START, actor: h[d - 1] };
59
- break;
60
- case 23:
61
- this.$ = { type: "activeEnd", signalType: b.LINETYPE.ACTIVE_END, actor: h[d - 1] };
62
- break;
63
- case 29:
64
- b.setDiagramTitle(h[d].substring(6)), this.$ = h[d].substring(6);
65
- break;
66
- case 30:
67
- b.setDiagramTitle(h[d].substring(7)), this.$ = h[d].substring(7);
68
- break;
69
- case 31:
70
- this.$ = h[d].trim(), b.setAccTitle(this.$);
71
- break;
72
- case 32:
73
- case 33:
74
- this.$ = h[d].trim(), b.setAccDescription(this.$);
75
- break;
76
- case 34:
77
- h[d - 1].unshift({ type: "loopStart", loopText: b.parseMessage(h[d - 2]), signalType: b.LINETYPE.LOOP_START }), h[d - 1].push({ type: "loopEnd", loopText: h[d - 2], signalType: b.LINETYPE.LOOP_END }), this.$ = h[d - 1];
78
- break;
79
- case 35:
80
- h[d - 1].unshift({ type: "rectStart", color: b.parseMessage(h[d - 2]), signalType: b.LINETYPE.RECT_START }), h[d - 1].push({ type: "rectEnd", color: b.parseMessage(h[d - 2]), signalType: b.LINETYPE.RECT_END }), this.$ = h[d - 1];
81
- break;
82
- case 36:
83
- h[d - 1].unshift({ type: "optStart", optText: b.parseMessage(h[d - 2]), signalType: b.LINETYPE.OPT_START }), h[d - 1].push({ type: "optEnd", optText: b.parseMessage(h[d - 2]), signalType: b.LINETYPE.OPT_END }), this.$ = h[d - 1];
84
- break;
85
- case 37:
86
- h[d - 1].unshift({ type: "altStart", altText: b.parseMessage(h[d - 2]), signalType: b.LINETYPE.ALT_START }), h[d - 1].push({ type: "altEnd", signalType: b.LINETYPE.ALT_END }), this.$ = h[d - 1];
87
- break;
88
- case 38:
89
- h[d - 1].unshift({ type: "parStart", parText: b.parseMessage(h[d - 2]), signalType: b.LINETYPE.PAR_START }), h[d - 1].push({ type: "parEnd", signalType: b.LINETYPE.PAR_END }), this.$ = h[d - 1];
90
- break;
91
- case 39:
92
- h[d - 1].unshift({ type: "parStart", parText: b.parseMessage(h[d - 2]), signalType: b.LINETYPE.PAR_OVER_START }), h[d - 1].push({ type: "parEnd", signalType: b.LINETYPE.PAR_END }), this.$ = h[d - 1];
93
- break;
94
- case 40:
95
- h[d - 1].unshift({ type: "criticalStart", criticalText: b.parseMessage(h[d - 2]), signalType: b.LINETYPE.CRITICAL_START }), h[d - 1].push({ type: "criticalEnd", signalType: b.LINETYPE.CRITICAL_END }), this.$ = h[d - 1];
96
- break;
97
- case 41:
98
- h[d - 1].unshift({ type: "breakStart", breakText: b.parseMessage(h[d - 2]), signalType: b.LINETYPE.BREAK_START }), h[d - 1].push({ type: "breakEnd", optText: b.parseMessage(h[d - 2]), signalType: b.LINETYPE.BREAK_END }), this.$ = h[d - 1];
99
- break;
100
- case 43:
101
- this.$ = h[d - 3].concat([{ type: "option", optionText: b.parseMessage(h[d - 1]), signalType: b.LINETYPE.CRITICAL_OPTION }, h[d]]);
102
- break;
103
- case 45:
104
- this.$ = h[d - 3].concat([{ type: "and", parText: b.parseMessage(h[d - 1]), signalType: b.LINETYPE.PAR_AND }, h[d]]);
105
- break;
106
- case 47:
107
- this.$ = h[d - 3].concat([{ type: "else", altText: b.parseMessage(h[d - 1]), signalType: b.LINETYPE.ALT_ELSE }, h[d]]);
108
- break;
109
- case 48:
110
- h[d - 3].draw = "participant", h[d - 3].type = "addParticipant", h[d - 3].description = b.parseMessage(h[d - 1]), this.$ = h[d - 3];
111
- break;
112
- case 49:
113
- h[d - 1].draw = "participant", h[d - 1].type = "addParticipant", this.$ = h[d - 1];
114
- break;
115
- case 50:
116
- h[d - 3].draw = "actor", h[d - 3].type = "addParticipant", h[d - 3].description = b.parseMessage(h[d - 1]), this.$ = h[d - 3];
117
- break;
118
- case 51:
119
- h[d - 1].draw = "actor", h[d - 1].type = "addParticipant", this.$ = h[d - 1];
120
- break;
121
- case 52:
122
- h[d - 1].type = "destroyParticipant", this.$ = h[d - 1];
123
- break;
124
- case 53:
125
- this.$ = [h[d - 1], { type: "addNote", placement: h[d - 2], actor: h[d - 1].actor, text: h[d] }];
126
- break;
127
- case 54:
128
- h[d - 2] = [].concat(h[d - 1], h[d - 1]).slice(0, 2), h[d - 2][0] = h[d - 2][0].actor, h[d - 2][1] = h[d - 2][1].actor, this.$ = [h[d - 1], { type: "addNote", placement: b.PLACEMENT.OVER, actor: h[d - 2].slice(0, 2), text: h[d] }];
129
- break;
130
- case 55:
131
- this.$ = [h[d - 1], { type: "addLinks", actor: h[d - 1].actor, text: h[d] }];
132
- break;
133
- case 56:
134
- this.$ = [h[d - 1], { type: "addALink", actor: h[d - 1].actor, text: h[d] }];
135
- break;
136
- case 57:
137
- this.$ = [h[d - 1], { type: "addProperties", actor: h[d - 1].actor, text: h[d] }];
138
- break;
139
- case 58:
140
- this.$ = [h[d - 1], { type: "addDetails", actor: h[d - 1].actor, text: h[d] }];
141
- break;
142
- case 61:
143
- this.$ = [h[d - 2], h[d]];
144
- break;
145
- case 62:
146
- this.$ = h[d];
147
- break;
148
- case 63:
149
- this.$ = b.PLACEMENT.LEFTOF;
150
- break;
151
- case 64:
152
- this.$ = b.PLACEMENT.RIGHTOF;
153
- break;
154
- case 65:
155
- this.$ = [
156
- h[d - 4],
157
- h[d - 1],
158
- { type: "addMessage", from: h[d - 4].actor, to: h[d - 1].actor, signalType: h[d - 3], msg: h[d], activate: !0 },
159
- { type: "activeStart", signalType: b.LINETYPE.ACTIVE_START, actor: h[d - 1] }
160
- ];
161
- break;
162
- case 66:
163
- this.$ = [
164
- h[d - 4],
165
- h[d - 1],
166
- { type: "addMessage", from: h[d - 4].actor, to: h[d - 1].actor, signalType: h[d - 3], msg: h[d] },
167
- { type: "activeEnd", signalType: b.LINETYPE.ACTIVE_END, actor: h[d - 4] }
168
- ];
169
- break;
170
- case 67:
171
- this.$ = [h[d - 3], h[d - 1], { type: "addMessage", from: h[d - 3].actor, to: h[d - 1].actor, signalType: h[d - 2], msg: h[d] }];
172
- break;
173
- case 68:
174
- this.$ = { type: "addParticipant", actor: h[d] };
175
- break;
176
- case 69:
177
- this.$ = b.LINETYPE.SOLID_OPEN;
178
- break;
179
- case 70:
180
- this.$ = b.LINETYPE.DOTTED_OPEN;
181
- break;
182
- case 71:
183
- this.$ = b.LINETYPE.SOLID;
184
- break;
185
- case 72:
186
- this.$ = b.LINETYPE.DOTTED;
187
- break;
188
- case 73:
189
- this.$ = b.LINETYPE.SOLID_CROSS;
190
- break;
191
- case 74:
192
- this.$ = b.LINETYPE.DOTTED_CROSS;
193
- break;
194
- case 75:
195
- this.$ = b.LINETYPE.SOLID_POINT;
196
- break;
197
- case 76:
198
- this.$ = b.LINETYPE.DOTTED_POINT;
199
- break;
200
- case 77:
201
- this.$ = b.parseMessage(h[d].trim().substring(1));
202
- break;
203
- }
204
- },
205
- table: [{ 3: 1, 4: e, 5: o, 6: s }, { 1: [3] }, { 3: 5, 4: e, 5: o, 6: s }, { 3: 6, 4: e, 5: o, 6: s }, t([1, 4, 5, 13, 14, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], i, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: a, 5: c, 8: 8, 9: 10, 12: 12, 13: l, 14: p, 17: 15, 18: r, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: g, 31: m, 33: _, 35: I, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 50: H, 52: K, 53: F, 54: W, 59: Z, 60: U, 61: Q, 62: tt, 70: N }, t(y, [2, 5]), { 9: 47, 12: 12, 13: l, 14: p, 17: 15, 18: r, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: g, 31: m, 33: _, 35: I, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 50: H, 52: K, 53: F, 54: W, 59: Z, 60: U, 61: Q, 62: tt, 70: N }, t(y, [2, 7]), t(y, [2, 8]), t(y, [2, 14]), { 12: 48, 50: H, 52: K, 53: F }, { 15: [1, 49] }, { 5: [1, 50] }, { 5: [1, 53], 19: [1, 51], 20: [1, 52] }, { 22: 54, 70: N }, { 22: 55, 70: N }, { 5: [1, 56] }, { 5: [1, 57] }, { 5: [1, 58] }, { 5: [1, 59] }, { 5: [1, 60] }, t(y, [2, 29]), t(y, [2, 30]), { 32: [1, 61] }, { 34: [1, 62] }, t(y, [2, 33]), { 15: [1, 63] }, { 15: [1, 64] }, { 15: [1, 65] }, { 15: [1, 66] }, { 15: [1, 67] }, { 15: [1, 68] }, { 15: [1, 69] }, { 15: [1, 70] }, { 22: 71, 70: N }, { 22: 72, 70: N }, { 22: 73, 70: N }, { 67: 74, 71: [1, 75], 72: [1, 76], 73: [1, 77], 74: [1, 78], 75: [1, 79], 76: [1, 80], 77: [1, 81], 78: [1, 82] }, { 55: 83, 57: [1, 84], 65: [1, 85], 66: [1, 86] }, { 22: 87, 70: N }, { 22: 88, 70: N }, { 22: 89, 70: N }, { 22: 90, 70: N }, t([5, 51, 64, 71, 72, 73, 74, 75, 76, 77, 78, 79], [2, 68]), t(y, [2, 6]), t(y, [2, 15]), t(P, [2, 9], { 10: 91 }), t(y, [2, 17]), { 5: [1, 93], 19: [1, 92] }, { 5: [1, 94] }, t(y, [2, 21]), { 5: [1, 95] }, { 5: [1, 96] }, t(y, [2, 24]), t(y, [2, 25]), t(y, [2, 26]), t(y, [2, 27]), t(y, [2, 28]), t(y, [2, 31]), t(y, [2, 32]), t(j, i, { 7: 97 }), t(j, i, { 7: 98 }), t(j, i, { 7: 99 }), t(rt, i, { 40: 100, 7: 101 }), t(A, i, { 42: 102, 7: 103 }), t(A, i, { 7: 103, 42: 104 }), t(Gt, i, { 45: 105, 7: 106 }), t(j, i, { 7: 107 }), { 5: [1, 109], 51: [1, 108] }, { 5: [1, 111], 51: [1, 110] }, { 5: [1, 112] }, { 22: 115, 68: [1, 113], 69: [1, 114], 70: N }, t(ht, [2, 69]), t(ht, [2, 70]), t(ht, [2, 71]), t(ht, [2, 72]), t(ht, [2, 73]), t(ht, [2, 74]), t(ht, [2, 75]), t(ht, [2, 76]), { 22: 116, 70: N }, { 22: 118, 58: 117, 70: N }, { 70: [2, 63] }, { 70: [2, 64] }, { 56: 119, 79: ot }, { 56: 121, 79: ot }, { 56: 122, 79: ot }, { 56: 123, 79: ot }, { 4: [1, 126], 5: [1, 128], 11: 125, 12: 127, 16: [1, 124], 50: H, 52: K, 53: F }, { 5: [1, 129] }, t(y, [2, 19]), t(y, [2, 20]), t(y, [2, 22]), t(y, [2, 23]), { 4: a, 5: c, 8: 8, 9: 10, 12: 12, 13: l, 14: p, 16: [1, 130], 17: 15, 18: r, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: g, 31: m, 33: _, 35: I, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 50: H, 52: K, 53: F, 54: W, 59: Z, 60: U, 61: Q, 62: tt, 70: N }, { 4: a, 5: c, 8: 8, 9: 10, 12: 12, 13: l, 14: p, 16: [1, 131], 17: 15, 18: r, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: g, 31: m, 33: _, 35: I, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 50: H, 52: K, 53: F, 54: W, 59: Z, 60: U, 61: Q, 62: tt, 70: N }, { 4: a, 5: c, 8: 8, 9: 10, 12: 12, 13: l, 14: p, 16: [1, 132], 17: 15, 18: r, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: g, 31: m, 33: _, 35: I, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 50: H, 52: K, 53: F, 54: W, 59: Z, 60: U, 61: Q, 62: tt, 70: N }, { 16: [1, 133] }, { 4: a, 5: c, 8: 8, 9: 10, 12: 12, 13: l, 14: p, 16: [2, 46], 17: 15, 18: r, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: g, 31: m, 33: _, 35: I, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 49: [1, 134], 50: H, 52: K, 53: F, 54: W, 59: Z, 60: U, 61: Q, 62: tt, 70: N }, { 16: [1, 135] }, { 4: a, 5: c, 8: 8, 9: 10, 12: 12, 13: l, 14: p, 16: [2, 44], 17: 15, 18: r, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: g, 31: m, 33: _, 35: I, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 48: [1, 136], 50: H, 52: K, 53: F, 54: W, 59: Z, 60: U, 61: Q, 62: tt, 70: N }, { 16: [1, 137] }, { 16: [1, 138] }, { 4: a, 5: c, 8: 8, 9: 10, 12: 12, 13: l, 14: p, 16: [2, 42], 17: 15, 18: r, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: g, 31: m, 33: _, 35: I, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 47: [1, 139], 50: H, 52: K, 53: F, 54: W, 59: Z, 60: U, 61: Q, 62: tt, 70: N }, { 4: a, 5: c, 8: 8, 9: 10, 12: 12, 13: l, 14: p, 16: [1, 140], 17: 15, 18: r, 21: x, 22: 40, 23: T, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: u, 30: g, 31: m, 33: _, 35: I, 36: V, 37: S, 38: O, 39: R, 41: q, 43: z, 44: J, 46: $, 50: H, 52: K, 53: F, 54: W, 59: Z, 60: U, 61: Q, 62: tt, 70: N }, { 15: [1, 141] }, t(y, [2, 49]), { 15: [1, 142] }, t(y, [2, 51]), t(y, [2, 52]), { 22: 143, 70: N }, { 22: 144, 70: N }, { 56: 145, 79: ot }, { 56: 146, 79: ot }, { 56: 147, 79: ot }, { 64: [1, 148], 79: [2, 62] }, { 5: [2, 55] }, { 5: [2, 77] }, { 5: [2, 56] }, { 5: [2, 57] }, { 5: [2, 58] }, t(y, [2, 16]), t(P, [2, 10]), { 12: 149, 50: H, 52: K, 53: F }, t(P, [2, 12]), t(P, [2, 13]), t(y, [2, 18]), t(y, [2, 34]), t(y, [2, 35]), t(y, [2, 36]), t(y, [2, 37]), { 15: [1, 150] }, t(y, [2, 38]), { 15: [1, 151] }, t(y, [2, 39]), t(y, [2, 40]), { 15: [1, 152] }, t(y, [2, 41]), { 5: [1, 153] }, { 5: [1, 154] }, { 56: 155, 79: ot }, { 56: 156, 79: ot }, { 5: [2, 67] }, { 5: [2, 53] }, { 5: [2, 54] }, { 22: 157, 70: N }, t(P, [2, 11]), t(rt, i, { 7: 101, 40: 158 }), t(A, i, { 7: 103, 42: 159 }), t(Gt, i, { 7: 106, 45: 160 }), t(y, [2, 48]), t(y, [2, 50]), { 5: [2, 65] }, { 5: [2, 66] }, { 79: [2, 61] }, { 16: [2, 47] }, { 16: [2, 45] }, { 16: [2, 43] }],
206
- defaultActions: { 5: [2, 1], 6: [2, 2], 85: [2, 63], 86: [2, 64], 119: [2, 55], 120: [2, 77], 121: [2, 56], 122: [2, 57], 123: [2, 58], 145: [2, 67], 146: [2, 53], 147: [2, 54], 155: [2, 65], 156: [2, 66], 157: [2, 61], 158: [2, 47], 159: [2, 45], 160: [2, 43] },
207
- parseError: function(w, k) {
208
- if (k.recoverable)
209
- this.trace(w);
210
- else {
211
- var L = new Error(w);
212
- throw L.hash = k, L;
213
- }
214
- },
215
- parse: function(w) {
216
- var k = this, L = [0], b = [], M = [null], h = [], Et = this.table, d = "", _t = 0, Xt = 0, Te = 2, Jt = 1, be = h.slice.call(arguments, 1), Y = Object.create(this.lexer), pt = { yy: {} };
217
- for (var Ct in this.yy)
218
- Object.prototype.hasOwnProperty.call(this.yy, Ct) && (pt.yy[Ct] = this.yy[Ct]);
219
- Y.setInput(w, pt.yy), pt.yy.lexer = Y, pt.yy.parser = this, typeof Y.yylloc > "u" && (Y.yylloc = {});
220
- var Dt = Y.yylloc;
221
- h.push(Dt);
222
- var Ee = Y.options && Y.options.ranges;
223
- typeof pt.yy.parseError == "function" ? this.parseError = pt.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
224
- function me() {
225
- var lt;
226
- return lt = b.pop() || Y.lex() || Jt, typeof lt != "number" && (lt instanceof Array && (b = lt, lt = b.pop()), lt = k.symbols_[lt] || lt), lt;
227
- }
228
- for (var G, ut, et, Vt, yt = {}, kt, ct, Zt, Pt; ; ) {
229
- if (ut = L[L.length - 1], this.defaultActions[ut] ? et = this.defaultActions[ut] : ((G === null || typeof G > "u") && (G = me()), et = Et[ut] && Et[ut][G]), typeof et > "u" || !et.length || !et[0]) {
230
- var Ot = "";
231
- Pt = [];
232
- for (kt in Et[ut])
233
- this.terminals_[kt] && kt > Te && Pt.push("'" + this.terminals_[kt] + "'");
234
- Y.showPosition ? Ot = "Parse error on line " + (_t + 1) + `:
235
- ` + Y.showPosition() + `
236
- Expecting ` + Pt.join(", ") + ", got '" + (this.terminals_[G] || G) + "'" : Ot = "Parse error on line " + (_t + 1) + ": Unexpected " + (G == Jt ? "end of input" : "'" + (this.terminals_[G] || G) + "'"), this.parseError(Ot, {
237
- text: Y.match,
238
- token: this.terminals_[G] || G,
239
- line: Y.yylineno,
240
- loc: Dt,
241
- expected: Pt
242
- });
243
- }
244
- if (et[0] instanceof Array && et.length > 1)
245
- throw new Error("Parse Error: multiple actions possible at state: " + ut + ", token: " + G);
246
- switch (et[0]) {
247
- case 1:
248
- L.push(G), M.push(Y.yytext), h.push(Y.yylloc), L.push(et[1]), G = null, Xt = Y.yyleng, d = Y.yytext, _t = Y.yylineno, Dt = Y.yylloc;
249
- break;
250
- case 2:
251
- if (ct = this.productions_[et[1]][1], yt.$ = M[M.length - ct], yt._$ = {
252
- first_line: h[h.length - (ct || 1)].first_line,
253
- last_line: h[h.length - 1].last_line,
254
- first_column: h[h.length - (ct || 1)].first_column,
255
- last_column: h[h.length - 1].last_column
256
- }, Ee && (yt._$.range = [
257
- h[h.length - (ct || 1)].range[0],
258
- h[h.length - 1].range[1]
259
- ]), Vt = this.performAction.apply(yt, [
260
- d,
261
- Xt,
262
- _t,
263
- pt.yy,
264
- et[1],
265
- M,
266
- h
267
- ].concat(be)), typeof Vt < "u")
268
- return Vt;
269
- ct && (L = L.slice(0, -1 * ct * 2), M = M.slice(0, -1 * ct), h = h.slice(0, -1 * ct)), L.push(this.productions_[et[1]][0]), M.push(yt.$), h.push(yt._$), Zt = Et[L[L.length - 2]][L[L.length - 1]], L.push(Zt);
270
- break;
271
- case 3:
272
- return !0;
273
- }
274
- }
275
- return !0;
276
- }
277
- }, ye = /* @__PURE__ */ (function() {
278
- var dt = {
279
- EOF: 1,
280
- parseError: function(k, L) {
281
- if (this.yy.parser)
282
- this.yy.parser.parseError(k, L);
283
- else
284
- throw new Error(k);
285
- },
286
- // resets the lexer, sets new input
287
- setInput: function(w, k) {
288
- return this.yy = k || this.yy || {}, this._input = w, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
289
- first_line: 1,
290
- first_column: 0,
291
- last_line: 1,
292
- last_column: 0
293
- }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
294
- },
295
- // consumes and returns one char from the input
296
- input: function() {
297
- var w = this._input[0];
298
- this.yytext += w, this.yyleng++, this.offset++, this.match += w, this.matched += w;
299
- var k = w.match(/(?:\r\n?|\n).*/g);
300
- return k ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), w;
301
- },
302
- // unshifts one char (or a string) into the input
303
- unput: function(w) {
304
- var k = w.length, L = w.split(/(?:\r\n?|\n)/g);
305
- this._input = w + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - k), this.offset -= k;
306
- var b = this.match.split(/(?:\r\n?|\n)/g);
307
- this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), L.length - 1 && (this.yylineno -= L.length - 1);
308
- var M = this.yylloc.range;
309
- return this.yylloc = {
310
- first_line: this.yylloc.first_line,
311
- last_line: this.yylineno + 1,
312
- first_column: this.yylloc.first_column,
313
- last_column: L ? (L.length === b.length ? this.yylloc.first_column : 0) + b[b.length - L.length].length - L[0].length : this.yylloc.first_column - k
314
- }, this.options.ranges && (this.yylloc.range = [M[0], M[0] + this.yyleng - k]), this.yyleng = this.yytext.length, this;
315
- },
316
- // When called from action, caches matched text and appends it on next action
317
- more: function() {
318
- return this._more = !0, this;
319
- },
320
- // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
321
- reject: function() {
322
- if (this.options.backtrack_lexer)
323
- this._backtrack = !0;
324
- else
325
- return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
326
- ` + this.showPosition(), {
327
- text: "",
328
- token: null,
329
- line: this.yylineno
330
- });
331
- return this;
332
- },
333
- // retain first n characters of the match
334
- less: function(w) {
335
- this.unput(this.match.slice(w));
336
- },
337
- // displays already matched input, i.e. for error messages
338
- pastInput: function() {
339
- var w = this.matched.substr(0, this.matched.length - this.match.length);
340
- return (w.length > 20 ? "..." : "") + w.substr(-20).replace(/\n/g, "");
341
- },
342
- // displays upcoming input, i.e. for error messages
343
- upcomingInput: function() {
344
- var w = this.match;
345
- return w.length < 20 && (w += this._input.substr(0, 20 - w.length)), (w.substr(0, 20) + (w.length > 20 ? "..." : "")).replace(/\n/g, "");
346
- },
347
- // displays the character position where the lexing error occurred, i.e. for error messages
348
- showPosition: function() {
349
- var w = this.pastInput(), k = new Array(w.length + 1).join("-");
350
- return w + this.upcomingInput() + `
351
- ` + k + "^";
352
- },
353
- // test the lexed token: return FALSE when not a match, otherwise return token
354
- test_match: function(w, k) {
355
- var L, b, M;
356
- if (this.options.backtrack_lexer && (M = {
357
- yylineno: this.yylineno,
358
- yylloc: {
359
- first_line: this.yylloc.first_line,
360
- last_line: this.last_line,
361
- first_column: this.yylloc.first_column,
362
- last_column: this.yylloc.last_column
363
- },
364
- yytext: this.yytext,
365
- match: this.match,
366
- matches: this.matches,
367
- matched: this.matched,
368
- yyleng: this.yyleng,
369
- offset: this.offset,
370
- _more: this._more,
371
- _input: this._input,
372
- yy: this.yy,
373
- conditionStack: this.conditionStack.slice(0),
374
- done: this.done
375
- }, this.options.ranges && (M.yylloc.range = this.yylloc.range.slice(0))), b = w[0].match(/(?:\r\n?|\n).*/g), b && (this.yylineno += b.length), this.yylloc = {
376
- first_line: this.yylloc.last_line,
377
- last_line: this.yylineno + 1,
378
- first_column: this.yylloc.last_column,
379
- last_column: b ? b[b.length - 1].length - b[b.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + w[0].length
380
- }, this.yytext += w[0], this.match += w[0], this.matches = w, 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(w[0].length), this.matched += w[0], L = this.performAction.call(this, this.yy, this, k, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), L)
381
- return L;
382
- if (this._backtrack) {
383
- for (var h in M)
384
- this[h] = M[h];
385
- return !1;
386
- }
387
- return !1;
388
- },
389
- // return next match in input
390
- next: function() {
391
- if (this.done)
392
- return this.EOF;
393
- this._input || (this.done = !0);
394
- var w, k, L, b;
395
- this._more || (this.yytext = "", this.match = "");
396
- for (var M = this._currentRules(), h = 0; h < M.length; h++)
397
- if (L = this._input.match(this.rules[M[h]]), L && (!k || L[0].length > k[0].length)) {
398
- if (k = L, b = h, this.options.backtrack_lexer) {
399
- if (w = this.test_match(L, M[h]), w !== !1)
400
- return w;
401
- if (this._backtrack) {
402
- k = !1;
403
- continue;
404
- } else
405
- return !1;
406
- } else if (!this.options.flex)
407
- break;
408
- }
409
- return k ? (w = this.test_match(k, M[b]), w !== !1 ? w : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
410
- ` + this.showPosition(), {
411
- text: "",
412
- token: null,
413
- line: this.yylineno
414
- });
415
- },
416
- // return next match that has a token
417
- lex: function() {
418
- var k = this.next();
419
- return k || this.lex();
420
- },
421
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
422
- begin: function(k) {
423
- this.conditionStack.push(k);
424
- },
425
- // pop the previously active lexer condition state off the condition stack
426
- popState: function() {
427
- var k = this.conditionStack.length - 1;
428
- return k > 0 ? this.conditionStack.pop() : this.conditionStack[0];
429
- },
430
- // produce the lexer rule set which is active for the currently active lexer condition state
431
- _currentRules: function() {
432
- return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
433
- },
434
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
435
- topState: function(k) {
436
- return k = this.conditionStack.length - 1 - Math.abs(k || 0), k >= 0 ? this.conditionStack[k] : "INITIAL";
437
- },
438
- // alias for begin(condition)
439
- pushState: function(k) {
440
- this.begin(k);
441
- },
442
- // return the number of states currently on the stack
443
- stateStackSize: function() {
444
- return this.conditionStack.length;
445
- },
446
- options: { "case-insensitive": !0 },
447
- performAction: function(k, L, b, M) {
448
- switch (b) {
449
- case 0:
450
- return 5;
451
- case 1:
452
- break;
453
- case 2:
454
- break;
455
- case 3:
456
- break;
457
- case 4:
458
- break;
459
- case 5:
460
- break;
461
- case 6:
462
- return 19;
463
- case 7:
464
- return this.begin("LINE"), 14;
465
- case 8:
466
- return this.begin("ID"), 50;
467
- case 9:
468
- return this.begin("ID"), 52;
469
- case 10:
470
- return 13;
471
- case 11:
472
- return this.begin("ID"), 53;
473
- case 12:
474
- return L.yytext = L.yytext.trim(), this.begin("ALIAS"), 70;
475
- case 13:
476
- return this.popState(), this.popState(), this.begin("LINE"), 51;
477
- case 14:
478
- return this.popState(), this.popState(), 5;
479
- case 15:
480
- return this.begin("LINE"), 36;
481
- case 16:
482
- return this.begin("LINE"), 37;
483
- case 17:
484
- return this.begin("LINE"), 38;
485
- case 18:
486
- return this.begin("LINE"), 39;
487
- case 19:
488
- return this.begin("LINE"), 49;
489
- case 20:
490
- return this.begin("LINE"), 41;
491
- case 21:
492
- return this.begin("LINE"), 43;
493
- case 22:
494
- return this.begin("LINE"), 48;
495
- case 23:
496
- return this.begin("LINE"), 44;
497
- case 24:
498
- return this.begin("LINE"), 47;
499
- case 25:
500
- return this.begin("LINE"), 46;
501
- case 26:
502
- return this.popState(), 15;
503
- case 27:
504
- return 16;
505
- case 28:
506
- return 65;
507
- case 29:
508
- return 66;
509
- case 30:
510
- return 59;
511
- case 31:
512
- return 60;
513
- case 32:
514
- return 61;
515
- case 33:
516
- return 62;
517
- case 34:
518
- return 57;
519
- case 35:
520
- return 54;
521
- case 36:
522
- return this.begin("ID"), 21;
523
- case 37:
524
- return this.begin("ID"), 23;
525
- case 38:
526
- return 29;
527
- case 39:
528
- return 30;
529
- case 40:
530
- return this.begin("acc_title"), 31;
531
- case 41:
532
- return this.popState(), "acc_title_value";
533
- case 42:
534
- return this.begin("acc_descr"), 33;
535
- case 43:
536
- return this.popState(), "acc_descr_value";
537
- case 44:
538
- this.begin("acc_descr_multiline");
539
- break;
540
- case 45:
541
- this.popState();
542
- break;
543
- case 46:
544
- return "acc_descr_multiline_value";
545
- case 47:
546
- return 6;
547
- case 48:
548
- return 18;
549
- case 49:
550
- return 20;
551
- case 50:
552
- return 64;
553
- case 51:
554
- return 5;
555
- case 52:
556
- return L.yytext = L.yytext.trim(), 70;
557
- case 53:
558
- return 73;
559
- case 54:
560
- return 74;
561
- case 55:
562
- return 71;
563
- case 56:
564
- return 72;
565
- case 57:
566
- return 75;
567
- case 58:
568
- return 76;
569
- case 59:
570
- return 77;
571
- case 60:
572
- return 78;
573
- case 61:
574
- return 79;
575
- case 62:
576
- return 68;
577
- case 63:
578
- return 69;
579
- case 64:
580
- return 5;
581
- case 65:
582
- return "INVALID";
583
- }
584
- },
585
- rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[0-9]+(?=[ \n]+))/i, /^(?:box\b)/i, /^(?:participant\b)/i, /^(?:actor\b)/i, /^(?:create\b)/i, /^(?:destroy\b)/i, /^(?:[^\->:\n,;]+?([\-]*[^\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:as\b)/i, /^(?:(?:))/i, /^(?:loop\b)/i, /^(?:rect\b)/i, /^(?:opt\b)/i, /^(?:alt\b)/i, /^(?:else\b)/i, /^(?:par\b)/i, /^(?:par_over\b)/i, /^(?:and\b)/i, /^(?:critical\b)/i, /^(?:option\b)/i, /^(?:break\b)/i, /^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:links\b)/i, /^(?:link\b)/i, /^(?:properties\b)/i, /^(?:details\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:activate\b)/i, /^(?:deactivate\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:title:\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:sequenceDiagram\b)/i, /^(?:autonumber\b)/i, /^(?:off\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i, /^(?:->>)/i, /^(?:-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?:-[\)])/i, /^(?:--[\)])/i, /^(?::(?:(?:no)?wrap)?[^#\n;]+)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:$)/i, /^(?:.)/i],
586
- conditions: { acc_descr_multiline: { rules: [45, 46], inclusive: !1 }, acc_descr: { rules: [43], inclusive: !1 }, acc_title: { rules: [41], inclusive: !1 }, ID: { rules: [2, 3, 12], inclusive: !1 }, ALIAS: { rules: [2, 3, 13, 14], inclusive: !1 }, LINE: { rules: [2, 3, 26], inclusive: !1 }, INITIAL: { rules: [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 42, 44, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65], inclusive: !0 } }
587
- };
588
- return dt;
589
- })();
590
- Mt.lexer = ye;
591
- function Rt() {
592
- this.yy = {};
593
- }
594
- return Rt.prototype = Mt, Mt.Parser = Rt, new Rt();
595
- })();
596
- Yt.parser = Yt;
597
- const De = Yt;
598
- class Ve {
599
- /**
600
- * @param init - Function that creates the default state.
601
- */
602
- constructor(e) {
603
- this.init = e, this.records = this.init();
604
- }
605
- reset() {
606
- this.records = this.init();
607
- }
608
- }
609
- const E = new Ve(() => ({
610
- prevActor: void 0,
611
- actors: {},
612
- createdActors: {},
613
- destroyedActors: {},
614
- boxes: [],
615
- messages: [],
616
- notes: [],
617
- sequenceNumbersEnabled: !1,
618
- wrapEnabled: void 0,
619
- currentBox: void 0,
620
- lastCreated: void 0,
621
- lastDestroyed: void 0
622
- })), Oe = function(t) {
623
- E.records.boxes.push({
624
- name: t.text,
625
- wrap: t.wrap === void 0 && gt() || !!t.wrap,
626
- fill: t.color,
627
- actorKeys: []
628
- }), E.records.currentBox = E.records.boxes.slice(-1)[0];
629
- }, Ft = function(t, e, o, s) {
630
- let i = E.records.currentBox;
631
- const a = E.records.actors[t];
632
- if (a) {
633
- if (E.records.currentBox && a.box && E.records.currentBox !== a.box)
634
- throw new Error(
635
- "A same participant should only be defined in one Box: " + a.name + " can't be in '" + a.box.name + "' and in '" + E.records.currentBox.name + "' at the same time."
636
- );
637
- if (i = a.box ? a.box : E.records.currentBox, a.box = i, a && e === a.name && o == null)
638
- return;
639
- }
640
- (o == null || o.text == null) && (o = { text: e, wrap: null, type: s }), (s == null || o.text == null) && (o = { text: e, wrap: null, type: s }), E.records.actors[t] = {
641
- box: i,
642
- name: e,
643
- description: o.text,
644
- wrap: o.wrap === void 0 && gt() || !!o.wrap,
645
- prevActor: E.records.prevActor,
646
- links: {},
647
- properties: {},
648
- actorCnt: null,
649
- rectData: null,
650
- type: s || "participant"
651
- }, E.records.prevActor && E.records.actors[E.records.prevActor] && (E.records.actors[E.records.prevActor].nextActor = t), E.records.currentBox && E.records.currentBox.actorKeys.push(t), E.records.prevActor = t;
652
- }, Be = (t) => {
653
- let e, o = 0;
654
- for (e = 0; e < E.records.messages.length; e++)
655
- E.records.messages[e].type === mt.ACTIVE_START && E.records.messages[e].from.actor === t && o++, E.records.messages[e].type === mt.ACTIVE_END && E.records.messages[e].from.actor === t && o--;
656
- return o;
657
- }, Ye = function(t, e, o, s) {
658
- E.records.messages.push({
659
- from: t,
660
- to: e,
661
- message: o.text,
662
- wrap: o.wrap === void 0 && gt() || !!o.wrap,
663
- answer: s
664
- });
665
- }, C = function(t, e, o = { text: void 0, wrap: void 0 }, s, i = !1) {
666
- if (s === mt.ACTIVE_END && Be(t.actor) < 1) {
667
- let c = new Error("Trying to inactivate an inactive participant (" + t.actor + ")");
668
- throw c.hash = {
669
- text: "->>-",
670
- token: "->>-",
671
- line: "1",
672
- loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
673
- expected: ["'ACTIVE_PARTICIPANT'"]
674
- }, c;
675
- }
676
- return E.records.messages.push({
677
- from: t,
678
- to: e,
679
- message: o.text,
680
- wrap: o.wrap === void 0 && gt() || !!o.wrap,
681
- type: s,
682
- activate: i
683
- }), !0;
684
- }, Fe = function() {
685
- return E.records.boxes.length > 0;
686
- }, We = function() {
687
- return E.records.boxes.some((t) => t.name);
688
- }, qe = function() {
689
- return E.records.messages;
690
- }, ze = function() {
691
- return E.records.boxes;
692
- }, He = function() {
693
- return E.records.actors;
694
- }, Ke = function() {
695
- return E.records.createdActors;
696
- }, Ue = function() {
697
- return E.records.destroyedActors;
698
- }, vt = function(t) {
699
- return E.records.actors[t];
700
- }, Ge = function() {
701
- return Object.keys(E.records.actors);
702
- }, Xe = function() {
703
- E.records.sequenceNumbersEnabled = !0;
704
- }, Je = function() {
705
- E.records.sequenceNumbersEnabled = !1;
706
- }, Ze = () => E.records.sequenceNumbersEnabled, Qe = function(t) {
707
- E.records.wrapEnabled = t;
708
- }, gt = () => E.records.wrapEnabled !== void 0 ? E.records.wrapEnabled : st().sequence.wrap, je = function() {
709
- E.reset(), Ae();
710
- }, $e = function(t) {
711
- const e = t.trim(), o = {
712
- text: e.replace(/^:?(?:no)?wrap:/, "").trim(),
713
- wrap: e.match(/^:?wrap:/) !== null ? !0 : e.match(/^:?nowrap:/) !== null ? !1 : void 0
714
- };
715
- return X.debug("parseMessage:", o), o;
716
- }, t0 = function(t) {
717
- const e = t.match(/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/);
718
- let o = e != null && e[1] ? e[1].trim() : "transparent", s = e != null && e[2] ? e[2].trim() : void 0;
719
- if (window && window.CSS)
720
- window.CSS.supports("color", o) || (o = "transparent", s = t.trim());
721
- else {
722
- const i = new Option().style;
723
- i.color = o, i.color !== o && (o = "transparent", s = t.trim());
724
- }
725
- return {
726
- color: o,
727
- text: s !== void 0 ? At(s.replace(/^:?(?:no)?wrap:/, ""), st()) : void 0,
728
- wrap: s !== void 0 ? s.match(/^:?wrap:/) !== null ? !0 : s.match(/^:?nowrap:/) !== null ? !1 : void 0 : void 0
729
- };
730
- }, mt = {
731
- SOLID: 0,
732
- DOTTED: 1,
733
- NOTE: 2,
734
- SOLID_CROSS: 3,
735
- DOTTED_CROSS: 4,
736
- SOLID_OPEN: 5,
737
- DOTTED_OPEN: 6,
738
- LOOP_START: 10,
739
- LOOP_END: 11,
740
- ALT_START: 12,
741
- ALT_ELSE: 13,
742
- ALT_END: 14,
743
- OPT_START: 15,
744
- OPT_END: 16,
745
- ACTIVE_START: 17,
746
- ACTIVE_END: 18,
747
- PAR_START: 19,
748
- PAR_AND: 20,
749
- PAR_END: 21,
750
- RECT_START: 22,
751
- RECT_END: 23,
752
- SOLID_POINT: 24,
753
- DOTTED_POINT: 25,
754
- AUTONUMBER: 26,
755
- CRITICAL_START: 27,
756
- CRITICAL_OPTION: 28,
757
- CRITICAL_END: 29,
758
- BREAK_START: 30,
759
- BREAK_END: 31,
760
- PAR_OVER_START: 32
761
- }, e0 = {
762
- FILLED: 0,
763
- OPEN: 1
764
- }, s0 = {
765
- LEFTOF: 0,
766
- RIGHTOF: 1,
767
- OVER: 2
768
- }, re = function(t, e, o) {
769
- const s = {
770
- actor: t,
771
- placement: e,
772
- message: o.text,
773
- wrap: o.wrap === void 0 && gt() || !!o.wrap
774
- }, i = [].concat(t, t);
775
- E.records.notes.push(s), E.records.messages.push({
776
- from: i[0],
777
- to: i[1],
778
- message: o.text,
779
- wrap: o.wrap === void 0 && gt() || !!o.wrap,
780
- type: mt.NOTE,
781
- placement: e
782
- });
783
- }, ie = function(t, e) {
784
- const o = vt(t);
785
- try {
786
- let s = At(e.text, st());
787
- s = s.replace(/&amp;/g, "&"), s = s.replace(/&equals;/g, "=");
788
- const i = JSON.parse(s);
789
- Ht(o, i);
790
- } catch (s) {
791
- X.error("error while parsing actor link text", s);
792
- }
793
- }, r0 = function(t, e) {
794
- const o = vt(t);
795
- try {
796
- const c = {};
797
- let l = At(e.text, st());
798
- var s = l.indexOf("@");
799
- l = l.replace(/&amp;/g, "&"), l = l.replace(/&equals;/g, "=");
800
- var i = l.slice(0, s - 1).trim(), a = l.slice(s + 1).trim();
801
- c[i] = a, Ht(o, c);
802
- } catch (c) {
803
- X.error("error while parsing actor link text", c);
804
- }
805
- };
806
- function Ht(t, e) {
807
- if (t.links == null)
808
- t.links = e;
809
- else
810
- for (let o in e)
811
- t.links[o] = e[o];
812
- }
813
- const ae = function(t, e) {
814
- const o = vt(t);
815
- try {
816
- let s = At(e.text, st());
817
- const i = JSON.parse(s);
818
- ne(o, i);
819
- } catch (s) {
820
- X.error("error while parsing actor properties text", s);
821
- }
822
- };
823
- function ne(t, e) {
824
- if (t.properties == null)
825
- t.properties = e;
826
- else
827
- for (let o in e)
828
- t.properties[o] = e[o];
829
- }
830
- function i0() {
831
- E.records.currentBox = void 0;
832
- }
833
- const oe = function(t, e) {
834
- const o = vt(t), s = document.getElementById(e.text);
835
- try {
836
- const i = s.innerHTML, a = JSON.parse(i);
837
- a.properties && ne(o, a.properties), a.links && Ht(o, a.links);
838
- } catch (i) {
839
- X.error("error while parsing actor details text", i);
840
- }
841
- }, a0 = function(t, e) {
842
- if (t !== void 0 && t.properties !== void 0)
843
- return t.properties[e];
844
- }, ce = function(t) {
845
- if (Array.isArray(t))
846
- t.forEach(function(e) {
847
- ce(e);
848
- });
849
- else
850
- switch (t.type) {
851
- case "sequenceIndex":
852
- E.records.messages.push({
853
- from: void 0,
854
- to: void 0,
855
- message: {
856
- start: t.sequenceIndex,
857
- step: t.sequenceIndexStep,
858
- visible: t.sequenceVisible
859
- },
860
- wrap: !1,
861
- type: t.signalType
862
- });
863
- break;
864
- case "addParticipant":
865
- Ft(t.actor, t.actor, t.description, t.draw);
866
- break;
867
- case "createParticipant":
868
- if (E.records.actors[t.actor])
869
- throw new Error(
870
- "It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior"
871
- );
872
- E.records.lastCreated = t.actor, Ft(t.actor, t.actor, t.description, t.draw), E.records.createdActors[t.actor] = E.records.messages.length;
873
- break;
874
- case "destroyParticipant":
875
- E.records.lastDestroyed = t.actor, E.records.destroyedActors[t.actor] = E.records.messages.length;
876
- break;
877
- case "activeStart":
878
- C(t.actor, void 0, void 0, t.signalType);
879
- break;
880
- case "activeEnd":
881
- C(t.actor, void 0, void 0, t.signalType);
882
- break;
883
- case "addNote":
884
- re(t.actor, t.placement, t.text);
885
- break;
886
- case "addLinks":
887
- ie(t.actor, t.text);
888
- break;
889
- case "addALink":
890
- r0(t.actor, t.text);
891
- break;
892
- case "addProperties":
893
- ae(t.actor, t.text);
894
- break;
895
- case "addDetails":
896
- oe(t.actor, t.text);
897
- break;
898
- case "addMessage":
899
- if (E.records.lastCreated) {
900
- if (t.to !== E.records.lastCreated)
901
- throw new Error(
902
- "The created participant " + E.records.lastCreated + " does not have an associated creating message after its declaration. Please check the sequence diagram."
903
- );
904
- E.records.lastCreated = void 0;
905
- } else if (E.records.lastDestroyed) {
906
- if (t.to !== E.records.lastDestroyed && t.from !== E.records.lastDestroyed)
907
- throw new Error(
908
- "The destroyed participant " + E.records.lastDestroyed + " does not have an associated destroying message after its declaration. Please check the sequence diagram."
909
- );
910
- E.records.lastDestroyed = void 0;
911
- }
912
- C(t.from, t.to, t.msg, t.signalType, t.activate);
913
- break;
914
- case "boxStart":
915
- Oe(t.boxData);
916
- break;
917
- case "boxEnd":
918
- i0();
919
- break;
920
- case "loopStart":
921
- C(void 0, void 0, t.loopText, t.signalType);
922
- break;
923
- case "loopEnd":
924
- C(void 0, void 0, void 0, t.signalType);
925
- break;
926
- case "rectStart":
927
- C(void 0, void 0, t.color, t.signalType);
928
- break;
929
- case "rectEnd":
930
- C(void 0, void 0, void 0, t.signalType);
931
- break;
932
- case "optStart":
933
- C(void 0, void 0, t.optText, t.signalType);
934
- break;
935
- case "optEnd":
936
- C(void 0, void 0, void 0, t.signalType);
937
- break;
938
- case "altStart":
939
- C(void 0, void 0, t.altText, t.signalType);
940
- break;
941
- case "else":
942
- C(void 0, void 0, t.altText, t.signalType);
943
- break;
944
- case "altEnd":
945
- C(void 0, void 0, void 0, t.signalType);
946
- break;
947
- case "setAccTitle":
948
- $t(t.text);
949
- break;
950
- case "parStart":
951
- C(void 0, void 0, t.parText, t.signalType);
952
- break;
953
- case "and":
954
- C(void 0, void 0, t.parText, t.signalType);
955
- break;
956
- case "parEnd":
957
- C(void 0, void 0, void 0, t.signalType);
958
- break;
959
- case "criticalStart":
960
- C(void 0, void 0, t.criticalText, t.signalType);
961
- break;
962
- case "option":
963
- C(void 0, void 0, t.optionText, t.signalType);
964
- break;
965
- case "criticalEnd":
966
- C(void 0, void 0, void 0, t.signalType);
967
- break;
968
- case "breakStart":
969
- C(void 0, void 0, t.breakText, t.signalType);
970
- break;
971
- case "breakEnd":
972
- C(void 0, void 0, void 0, t.signalType);
973
- break;
974
- }
975
- }, Qt = {
976
- addActor: Ft,
977
- addMessage: Ye,
978
- addSignal: C,
979
- addLinks: ie,
980
- addDetails: oe,
981
- addProperties: ae,
982
- autoWrap: gt,
983
- setWrap: Qe,
984
- enableSequenceNumbers: Xe,
985
- disableSequenceNumbers: Je,
986
- showSequenceNumbers: Ze,
987
- getMessages: qe,
988
- getActors: He,
989
- getCreatedActors: Ke,
990
- getDestroyedActors: Ue,
991
- getActor: vt,
992
- getActorKeys: Ge,
993
- getActorProperty: a0,
994
- getAccTitle: Pe,
995
- getBoxes: ze,
996
- getDiagramTitle: ke,
997
- setDiagramTitle: _e,
998
- getConfig: () => st().sequence,
999
- clear: je,
1000
- parseMessage: $e,
1001
- parseBoxData: t0,
1002
- LINETYPE: mt,
1003
- ARROWTYPE: e0,
1004
- PLACEMENT: s0,
1005
- addNote: re,
1006
- setAccTitle: $t,
1007
- apply: ce,
1008
- setAccDescription: ve,
1009
- getAccDescription: we,
1010
- hasAtLeastOneBox: Fe,
1011
- hasAtLeastOneBoxWithTitle: We
1012
- }, n0 = (t) => `.actor {
1013
- stroke: ${t.actorBorder};
1014
- fill: ${t.actorBkg};
1015
- }
1016
-
1017
- text.actor > tspan {
1018
- fill: ${t.actorTextColor};
1019
- stroke: none;
1020
- }
1021
-
1022
- .actor-line {
1023
- stroke: ${t.actorLineColor};
1024
- }
1025
-
1026
- .messageLine0 {
1027
- stroke-width: 1.5;
1028
- stroke-dasharray: none;
1029
- stroke: ${t.signalColor};
1030
- }
1031
-
1032
- .messageLine1 {
1033
- stroke-width: 1.5;
1034
- stroke-dasharray: 2, 2;
1035
- stroke: ${t.signalColor};
1036
- }
1037
-
1038
- #arrowhead path {
1039
- fill: ${t.signalColor};
1040
- stroke: ${t.signalColor};
1041
- }
1042
-
1043
- .sequenceNumber {
1044
- fill: ${t.sequenceNumberColor};
1045
- }
1046
-
1047
- #sequencenumber {
1048
- fill: ${t.signalColor};
1049
- }
1050
-
1051
- #crosshead path {
1052
- fill: ${t.signalColor};
1053
- stroke: ${t.signalColor};
1054
- }
1055
-
1056
- .messageText {
1057
- fill: ${t.signalTextColor};
1058
- stroke: none;
1059
- }
1060
-
1061
- .labelBox {
1062
- stroke: ${t.labelBoxBorderColor};
1063
- fill: ${t.labelBoxBkgColor};
1064
- }
1065
-
1066
- .labelText, .labelText > tspan {
1067
- fill: ${t.labelTextColor};
1068
- stroke: none;
1069
- }
1070
-
1071
- .loopText, .loopText > tspan {
1072
- fill: ${t.loopTextColor};
1073
- stroke: none;
1074
- }
1075
-
1076
- .loopLine {
1077
- stroke-width: 2px;
1078
- stroke-dasharray: 2, 2;
1079
- stroke: ${t.labelBoxBorderColor};
1080
- fill: ${t.labelBoxBorderColor};
1081
- }
1082
-
1083
- .note {
1084
- //stroke: #decc93;
1085
- stroke: ${t.noteBorderColor};
1086
- fill: ${t.noteBkgColor};
1087
- }
1088
-
1089
- .noteText, .noteText > tspan {
1090
- fill: ${t.noteTextColor};
1091
- stroke: none;
1092
- }
1093
-
1094
- .activation0 {
1095
- fill: ${t.activationBkgColor};
1096
- stroke: ${t.activationBorderColor};
1097
- }
1098
-
1099
- .activation1 {
1100
- fill: ${t.activationBkgColor};
1101
- stroke: ${t.activationBorderColor};
1102
- }
1103
-
1104
- .activation2 {
1105
- fill: ${t.activationBkgColor};
1106
- stroke: ${t.activationBorderColor};
1107
- }
1108
-
1109
- .actorPopupMenu {
1110
- position: absolute;
1111
- }
1112
-
1113
- .actorPopupMenuPanel {
1114
- position: absolute;
1115
- fill: ${t.actorBkg};
1116
- box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
1117
- filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
1118
- }
1119
- .actor-man line {
1120
- stroke: ${t.actorBorder};
1121
- fill: ${t.actorBkg};
1122
- }
1123
- .actor-man circle, line {
1124
- stroke: ${t.actorBorder};
1125
- fill: ${t.actorBkg};
1126
- stroke-width: 2px;
1127
- }
1128
- `, o0 = n0, ft = 36, le = "actor-top", he = "actor-bottom", Kt = function(t, e) {
1129
- return Me(t, e);
1130
- }, c0 = function(t, e, o, s, i) {
1131
- if (e.links === void 0 || e.links === null || Object.keys(e.links).length === 0)
1132
- return { height: 0, width: 0 };
1133
- const a = e.links, c = e.actorCnt, l = e.rectData;
1134
- var p = "none";
1135
- i && (p = "block !important");
1136
- const r = t.append("g");
1137
- r.attr("id", "actor" + c + "_popup"), r.attr("class", "actorPopupMenu"), r.attr("display", p);
1138
- var x = "";
1139
- l.class !== void 0 && (x = " " + l.class);
1140
- let T = l.width > o ? l.width : o;
1141
- const u = r.append("rect");
1142
- if (u.attr("class", "actorPopupMenuPanel" + x), u.attr("x", l.x), u.attr("y", l.height), u.attr("fill", l.fill), u.attr("stroke", l.stroke), u.attr("width", T), u.attr("height", l.height), u.attr("rx", l.rx), u.attr("ry", l.ry), a != null) {
1143
- var g = 20;
1144
- for (let I in a) {
1145
- var m = r.append("a"), _ = se.sanitizeUrl(a[I]);
1146
- m.attr("xlink:href", _), m.attr("target", "_blank"), k0(s)(
1147
- I,
1148
- m,
1149
- l.x + 10,
1150
- l.height + g,
1151
- T,
1152
- 20,
1153
- { class: "actor" },
1154
- s
1155
- ), g += 30;
1156
- }
1157
- }
1158
- return u.attr("height", g), { height: l.height + g, width: T };
1159
- }, l0 = function(t) {
1160
- return "var pu = document.getElementById('" + t + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }";
1161
- }, It = async function(t, e, o = null) {
1162
- let s = t.append("foreignObject");
1163
- const i = await ee(e.text, Bt()), c = s.append("xhtml:div").attr("style", "width: fit-content;").attr("xmlns", "http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();
1164
- if (s.attr("height", Math.round(c.height)).attr("width", Math.round(c.width)), e.class === "noteText") {
1165
- const l = t.node().firstChild;
1166
- l.setAttribute("height", c.height + 2 * e.textMargin);
1167
- const p = l.getBBox();
1168
- s.attr("x", Math.round(p.x + p.width / 2 - c.width / 2)).attr("y", Math.round(p.y + p.height / 2 - c.height / 2));
1169
- } else if (o) {
1170
- let { startx: l, stopx: p, starty: r } = o;
1171
- if (l > p) {
1172
- const x = l;
1173
- l = p, p = x;
1174
- }
1175
- s.attr("x", Math.round(l + Math.abs(l - p) / 2 - c.width / 2)), e.class === "loopText" ? s.attr("y", Math.round(r)) : s.attr("y", Math.round(r - c.height));
1176
- }
1177
- return [s];
1178
- }, bt = function(t, e) {
1179
- let o = 0, s = 0;
1180
- const i = e.text.split(v.lineBreakRegex), [a, c] = te(e.fontSize);
1181
- let l = [], p = 0, r = () => e.y;
1182
- if (e.valign !== void 0 && e.textMargin !== void 0 && e.textMargin > 0)
1183
- switch (e.valign) {
1184
- case "top":
1185
- case "start":
1186
- r = () => Math.round(e.y + e.textMargin);
1187
- break;
1188
- case "middle":
1189
- case "center":
1190
- r = () => Math.round(e.y + (o + s + e.textMargin) / 2);
1191
- break;
1192
- case "bottom":
1193
- case "end":
1194
- r = () => Math.round(
1195
- e.y + (o + s + 2 * e.textMargin) - e.textMargin
1196
- );
1197
- break;
1198
- }
1199
- if (e.anchor !== void 0 && e.textMargin !== void 0 && e.width !== void 0)
1200
- switch (e.anchor) {
1201
- case "left":
1202
- case "start":
1203
- e.x = Math.round(e.x + e.textMargin), e.anchor = "start", e.dominantBaseline = "middle", e.alignmentBaseline = "middle";
1204
- break;
1205
- case "middle":
1206
- case "center":
1207
- e.x = Math.round(e.x + e.width / 2), e.anchor = "middle", e.dominantBaseline = "middle", e.alignmentBaseline = "middle";
1208
- break;
1209
- case "right":
1210
- case "end":
1211
- e.x = Math.round(e.x + e.width - e.textMargin), e.anchor = "end", e.dominantBaseline = "middle", e.alignmentBaseline = "middle";
1212
- break;
1213
- }
1214
- for (let [x, T] of i.entries()) {
1215
- e.textMargin !== void 0 && e.textMargin === 0 && a !== void 0 && (p = x * a);
1216
- const u = t.append("text");
1217
- u.attr("x", e.x), u.attr("y", r()), e.anchor !== void 0 && u.attr("text-anchor", e.anchor).attr("dominant-baseline", e.dominantBaseline).attr("alignment-baseline", e.alignmentBaseline), e.fontFamily !== void 0 && u.style("font-family", e.fontFamily), c !== void 0 && u.style("font-size", c), e.fontWeight !== void 0 && u.style("font-weight", e.fontWeight), e.fill !== void 0 && u.attr("fill", e.fill), e.class !== void 0 && u.attr("class", e.class), e.dy !== void 0 ? u.attr("dy", e.dy) : p !== 0 && u.attr("dy", p);
1218
- const g = T || Ne;
1219
- if (e.tspan) {
1220
- const m = u.append("tspan");
1221
- m.attr("x", e.x), e.fill !== void 0 && m.attr("fill", e.fill), m.text(g);
1222
- } else
1223
- u.text(g);
1224
- e.valign !== void 0 && e.textMargin !== void 0 && e.textMargin > 0 && (s += (u._groups || u)[0][0].getBBox().height, o = s), l.push(u);
1225
- }
1226
- return l;
1227
- }, de = function(t, e) {
1228
- function o(i, a, c, l, p) {
1229
- return i + "," + a + " " + (i + c) + "," + a + " " + (i + c) + "," + (a + l - p) + " " + (i + c - p * 1.2) + "," + (a + l) + " " + i + "," + (a + l);
1230
- }
1231
- const s = t.append("polygon");
1232
- return s.attr("points", o(e.x, e.y, e.width, e.height, 7)), s.attr("class", "labelBox"), e.y = e.y + e.height / 2, bt(t, e), s;
1233
- };
1234
- let at = -1;
1235
- const pe = (t, e, o, s) => {
1236
- t.select && o.forEach((i) => {
1237
- const a = e[i], c = t.select("#actor" + a.actorCnt);
1238
- !s.mirrorActors && a.stopy ? c.attr("y2", a.stopy + a.height / 2) : s.mirrorActors && c.attr("y2", a.stopy);
1239
- });
1240
- }, h0 = async function(t, e, o, s) {
1241
- const i = s ? e.stopy : e.starty, a = e.x + e.width / 2, c = i + 5, l = t.append("g").lower();
1242
- var p = l;
1243
- s || (at++, Object.keys(e.links || {}).length && !o.forceMenus && p.attr("onclick", l0(`actor${at}_popup`)).attr("cursor", "pointer"), p.append("line").attr("id", "actor" + at).attr("x1", a).attr("y1", c).attr("x2", a).attr("y2", 2e3).attr("class", "actor-line").attr("class", "200").attr("stroke-width", "0.5px").attr("stroke", "#999"), p = l.append("g"), e.actorCnt = at, e.links != null && p.attr("id", "root-" + at));
1244
- const r = Nt();
1245
- var x = "actor";
1246
- e.properties != null && e.properties.class ? x = e.properties.class : r.fill = "#eaeaea", s ? x += ` ${he}` : x += ` ${le}`, r.x = e.x, r.y = i, r.width = e.width, r.height = e.height, r.class = x, r.rx = 3, r.ry = 3, r.name = e.name;
1247
- const T = Kt(p, r);
1248
- if (e.rectData = r, e.properties != null && e.properties.icon) {
1249
- const g = e.properties.icon.trim();
1250
- g.charAt(0) === "@" ? Re(p, r.x + r.width - 20, r.y + 10, g.substr(1)) : Ce(p, r.x + r.width - 20, r.y + 10, g);
1251
- }
1252
- await Ut(o, nt(e.description))(
1253
- e.description,
1254
- p,
1255
- r.x,
1256
- r.y,
1257
- r.width,
1258
- r.height,
1259
- { class: "actor" },
1260
- o
1261
- );
1262
- let u = e.height;
1263
- if (T.node) {
1264
- const g = T.node().getBBox();
1265
- e.height = g.height, u = g.height;
1266
- }
1267
- return u;
1268
- }, d0 = async function(t, e, o, s) {
1269
- const i = s ? e.stopy : e.starty, a = e.x + e.width / 2, c = i + 80;
1270
- t.lower(), s || (at++, t.append("line").attr("id", "actor" + at).attr("x1", a).attr("y1", c).attr("x2", a).attr("y2", 2e3).attr("class", "actor-line").attr("class", "200").attr("stroke-width", "0.5px").attr("stroke", "#999"), e.actorCnt = at);
1271
- const l = t.append("g");
1272
- let p = "actor-man";
1273
- s ? p += ` ${he}` : p += ` ${le}`, l.attr("class", p), l.attr("name", e.name);
1274
- const r = Nt();
1275
- r.x = e.x, r.y = i, r.fill = "#eaeaea", r.width = e.width, r.height = e.height, r.class = "actor", r.rx = 3, r.ry = 3, l.append("line").attr("id", "actor-man-torso" + at).attr("x1", a).attr("y1", i + 25).attr("x2", a).attr("y2", i + 45), l.append("line").attr("id", "actor-man-arms" + at).attr("x1", a - ft / 2).attr("y1", i + 33).attr("x2", a + ft / 2).attr("y2", i + 33), l.append("line").attr("x1", a - ft / 2).attr("y1", i + 60).attr("x2", a).attr("y2", i + 45), l.append("line").attr("x1", a).attr("y1", i + 45).attr("x2", a + ft / 2 - 2).attr("y2", i + 60);
1276
- const x = l.append("circle");
1277
- x.attr("cx", e.x + e.width / 2), x.attr("cy", i + 10), x.attr("r", 15), x.attr("width", e.width), x.attr("height", e.height);
1278
- const T = l.node().getBBox();
1279
- return e.height = T.height, await Ut(o, nt(e.description))(
1280
- e.description,
1281
- l,
1282
- r.x,
1283
- r.y + 35,
1284
- r.width,
1285
- r.height,
1286
- { class: "actor" },
1287
- o
1288
- ), e.height;
1289
- }, p0 = async function(t, e, o, s) {
1290
- switch (e.type) {
1291
- case "actor":
1292
- return await d0(t, e, o, s);
1293
- case "participant":
1294
- return await h0(t, e, o, s);
1295
- }
1296
- }, u0 = async function(t, e, o) {
1297
- const i = t.append("g");
1298
- ue(i, e), e.name && await Ut(o)(
1299
- e.name,
1300
- i,
1301
- e.x,
1302
- e.y + (e.textMaxHeight || 0) / 2,
1303
- e.width,
1304
- 0,
1305
- { class: "text" },
1306
- o
1307
- ), i.lower();
1308
- }, f0 = function(t) {
1309
- return t.append("g");
1310
- }, g0 = function(t, e, o, s, i) {
1311
- const a = Nt(), c = e.anchored;
1312
- a.x = e.startx, a.y = e.starty, a.class = "activation" + i % 3, a.width = e.stopx - e.startx, a.height = o - e.starty, Kt(c, a);
1313
- }, x0 = async function(t, e, o, s) {
1314
- const {
1315
- boxMargin: i,
1316
- boxTextMargin: a,
1317
- labelBoxHeight: c,
1318
- labelBoxWidth: l,
1319
- messageFontFamily: p,
1320
- messageFontSize: r,
1321
- messageFontWeight: x
1322
- } = s, T = t.append("g"), u = function(_, I, V, S) {
1323
- return T.append("line").attr("x1", _).attr("y1", I).attr("x2", V).attr("y2", S).attr("class", "loopLine");
1324
- };
1325
- u(e.startx, e.starty, e.stopx, e.starty), u(e.stopx, e.starty, e.stopx, e.stopy), u(e.startx, e.stopy, e.stopx, e.stopy), u(e.startx, e.starty, e.startx, e.stopy), e.sections !== void 0 && e.sections.forEach(function(_) {
1326
- u(e.startx, _.y, e.stopx, _.y).style(
1327
- "stroke-dasharray",
1328
- "3, 3"
1329
- );
1330
- });
1331
- let g = zt();
1332
- g.text = o, g.x = e.startx, g.y = e.starty, g.fontFamily = p, g.fontSize = r, g.fontWeight = x, g.anchor = "middle", g.valign = "middle", g.tspan = !1, g.width = l || 50, g.height = c || 20, g.textMargin = a, g.class = "labelText", de(T, g), g = fe(), g.text = e.title, g.x = e.startx + l / 2 + (e.stopx - e.startx) / 2, g.y = e.starty + i + a, g.anchor = "middle", g.valign = "middle", g.textMargin = a, g.class = "loopText", g.fontFamily = p, g.fontSize = r, g.fontWeight = x, g.wrap = !0;
1333
- let m = nt(g.text) ? await It(T, g, e) : bt(T, g);
1334
- if (e.sectionTitles !== void 0) {
1335
- for (const [_, I] of Object.entries(e.sectionTitles))
1336
- if (I.message) {
1337
- g.text = I.message, g.x = e.startx + (e.stopx - e.startx) / 2, g.y = e.sections[_].y + i + a, g.class = "loopText", g.anchor = "middle", g.valign = "middle", g.tspan = !1, g.fontFamily = p, g.fontSize = r, g.fontWeight = x, g.wrap = e.wrap, nt(g.text) ? (e.starty = e.sections[_].y, await It(T, g, e)) : bt(T, g);
1338
- let V = Math.round(
1339
- m.map((S) => (S._groups || S)[0][0].getBBox().height).reduce((S, O) => S + O)
1340
- );
1341
- e.sections[_].height += V - (i + a);
1342
- }
1343
- }
1344
- return e.height = Math.round(e.stopy - e.starty), T;
1345
- }, ue = function(t, e) {
1346
- Se(t, e);
1347
- }, y0 = function(t) {
1348
- t.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1349
- "d",
1350
- "M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z"
1351
- );
1352
- }, T0 = function(t) {
1353
- t.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1354
- "d",
1355
- "M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z"
1356
- );
1357
- }, b0 = function(t) {
1358
- t.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1359
- "d",
1360
- "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z"
1361
- );
1362
- }, E0 = function(t) {
1363
- t.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 7.9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z");
1364
- }, m0 = function(t) {
1365
- t.append("defs").append("marker").attr("id", "filled-head").attr("refX", 15.5).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
1366
- }, w0 = function(t) {
1367
- t.append("defs").append("marker").attr("id", "sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6);
1368
- }, v0 = function(t) {
1369
- t.append("defs").append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 4).attr("refY", 4.5).append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1pt").attr("d", "M 1,2 L 6,7 M 6,2 L 1,7");
1370
- }, fe = function() {
1371
- return {
1372
- x: 0,
1373
- y: 0,
1374
- fill: void 0,
1375
- anchor: void 0,
1376
- style: "#666",
1377
- width: void 0,
1378
- height: void 0,
1379
- textMargin: 0,
1380
- rx: 0,
1381
- ry: 0,
1382
- tspan: !0,
1383
- valign: void 0
1384
- };
1385
- }, _0 = function() {
1386
- return {
1387
- x: 0,
1388
- y: 0,
1389
- fill: "#EDF2AE",
1390
- stroke: "#666",
1391
- width: 100,
1392
- anchor: "start",
1393
- height: 100,
1394
- rx: 0,
1395
- ry: 0
1396
- };
1397
- }, Ut = /* @__PURE__ */ (function() {
1398
- function t(a, c, l, p, r, x, T) {
1399
- const u = c.append("text").attr("x", l + r / 2).attr("y", p + x / 2 + 5).style("text-anchor", "middle").text(a);
1400
- i(u, T);
1401
- }
1402
- function e(a, c, l, p, r, x, T, u) {
1403
- const { actorFontSize: g, actorFontFamily: m, actorFontWeight: _ } = u, [I, V] = te(g), S = a.split(v.lineBreakRegex);
1404
- for (let O = 0; O < S.length; O++) {
1405
- const R = O * I - I * (S.length - 1) / 2, q = c.append("text").attr("x", l + r / 2).attr("y", p).style("text-anchor", "middle").style("font-size", V).style("font-weight", _).style("font-family", m);
1406
- q.append("tspan").attr("x", l + r / 2).attr("dy", R).text(S[O]), q.attr("y", p + x / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), i(q, T);
1407
- }
1408
- }
1409
- function o(a, c, l, p, r, x, T, u) {
1410
- const g = c.append("switch"), _ = g.append("foreignObject").attr("x", l).attr("y", p).attr("width", r).attr("height", x).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1411
- _.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(a), e(a, g, l, p, r, x, T, u), i(_, T);
1412
- }
1413
- async function s(a, c, l, p, r, x, T, u) {
1414
- const g = await wt(a, Bt()), m = c.append("switch"), I = m.append("foreignObject").attr("x", l + r / 2 - g.width / 2).attr("y", p + x / 2 - g.height / 2).attr("width", g.width).attr("height", g.height).append("xhtml:div").style("height", "100%").style("width", "100%");
1415
- I.append("div").style("text-align", "center").style("vertical-align", "middle").html(await ee(a, Bt())), e(a, m, l, p, r, x, T, u), i(I, T);
1416
- }
1417
- function i(a, c) {
1418
- for (const l in c)
1419
- c.hasOwnProperty(l) && a.attr(l, c[l]);
1420
- }
1421
- return function(a, c = !1) {
1422
- return c ? s : a.textPlacement === "fo" ? o : a.textPlacement === "old" ? t : e;
1423
- };
1424
- })(), k0 = /* @__PURE__ */ (function() {
1425
- function t(i, a, c, l, p, r, x) {
1426
- const T = a.append("text").attr("x", c).attr("y", l).style("text-anchor", "start").text(i);
1427
- s(T, x);
1428
- }
1429
- function e(i, a, c, l, p, r, x, T) {
1430
- const { actorFontSize: u, actorFontFamily: g, actorFontWeight: m } = T, _ = i.split(v.lineBreakRegex);
1431
- for (let I = 0; I < _.length; I++) {
1432
- const V = I * u - u * (_.length - 1) / 2, S = a.append("text").attr("x", c).attr("y", l).style("text-anchor", "start").style("font-size", u).style("font-weight", m).style("font-family", g);
1433
- S.append("tspan").attr("x", c).attr("dy", V).text(_[I]), S.attr("y", l + r / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), s(S, x);
1434
- }
1435
- }
1436
- function o(i, a, c, l, p, r, x, T) {
1437
- const u = a.append("switch"), m = u.append("foreignObject").attr("x", c).attr("y", l).attr("width", p).attr("height", r).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1438
- m.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(i), e(i, u, c, l, p, r, x, T), s(m, x);
1439
- }
1440
- function s(i, a) {
1441
- for (const c in a)
1442
- a.hasOwnProperty(c) && i.attr(c, a[c]);
1443
- }
1444
- return function(i) {
1445
- return i.textPlacement === "fo" ? o : i.textPlacement === "old" ? t : e;
1446
- };
1447
- })(), D = {
1448
- drawRect: Kt,
1449
- drawText: bt,
1450
- drawLabel: de,
1451
- drawActor: p0,
1452
- drawBox: u0,
1453
- drawPopup: c0,
1454
- anchorElement: f0,
1455
- drawActivation: g0,
1456
- drawLoop: x0,
1457
- drawBackgroundRect: ue,
1458
- insertArrowHead: E0,
1459
- insertArrowFilledHead: m0,
1460
- insertSequenceNumber: w0,
1461
- insertArrowCrossHead: v0,
1462
- insertDatabaseIcon: y0,
1463
- insertComputerIcon: T0,
1464
- insertClockIcon: b0,
1465
- getTextObj: fe,
1466
- getNoteRect: _0,
1467
- fixLifeLineHeights: pe,
1468
- sanitizeUrl: se.sanitizeUrl
1469
- };
1470
- let n = {};
1471
- const f = {
1472
- data: {
1473
- startx: void 0,
1474
- stopx: void 0,
1475
- starty: void 0,
1476
- stopy: void 0
1477
- },
1478
- verticalPos: 0,
1479
- sequenceItems: [],
1480
- activations: [],
1481
- models: {
1482
- getHeight: function() {
1483
- return Math.max.apply(
1484
- null,
1485
- this.actors.length === 0 ? [0] : this.actors.map((t) => t.height || 0)
1486
- ) + (this.loops.length === 0 ? 0 : this.loops.map((t) => t.height || 0).reduce((t, e) => t + e)) + (this.messages.length === 0 ? 0 : this.messages.map((t) => t.height || 0).reduce((t, e) => t + e)) + (this.notes.length === 0 ? 0 : this.notes.map((t) => t.height || 0).reduce((t, e) => t + e));
1487
- },
1488
- clear: function() {
1489
- this.actors = [], this.boxes = [], this.loops = [], this.messages = [], this.notes = [];
1490
- },
1491
- addBox: function(t) {
1492
- this.boxes.push(t);
1493
- },
1494
- addActor: function(t) {
1495
- this.actors.push(t);
1496
- },
1497
- addLoop: function(t) {
1498
- this.loops.push(t);
1499
- },
1500
- addMessage: function(t) {
1501
- this.messages.push(t);
1502
- },
1503
- addNote: function(t) {
1504
- this.notes.push(t);
1505
- },
1506
- lastActor: function() {
1507
- return this.actors[this.actors.length - 1];
1508
- },
1509
- lastLoop: function() {
1510
- return this.loops[this.loops.length - 1];
1511
- },
1512
- lastMessage: function() {
1513
- return this.messages[this.messages.length - 1];
1514
- },
1515
- lastNote: function() {
1516
- return this.notes[this.notes.length - 1];
1517
- },
1518
- actors: [],
1519
- boxes: [],
1520
- loops: [],
1521
- messages: [],
1522
- notes: []
1523
- },
1524
- init: function() {
1525
- this.sequenceItems = [], this.activations = [], this.models.clear(), this.data = {
1526
- startx: void 0,
1527
- stopx: void 0,
1528
- starty: void 0,
1529
- stopy: void 0
1530
- }, this.verticalPos = 0, xe(st());
1531
- },
1532
- updateVal: function(t, e, o, s) {
1533
- t[e] === void 0 ? t[e] = o : t[e] = s(o, t[e]);
1534
- },
1535
- updateBounds: function(t, e, o, s) {
1536
- const i = this;
1537
- let a = 0;
1538
- function c(l) {
1539
- return function(r) {
1540
- a++;
1541
- const x = i.sequenceItems.length - a + 1;
1542
- i.updateVal(r, "starty", e - x * n.boxMargin, Math.min), i.updateVal(r, "stopy", s + x * n.boxMargin, Math.max), i.updateVal(f.data, "startx", t - x * n.boxMargin, Math.min), i.updateVal(f.data, "stopx", o + x * n.boxMargin, Math.max), l !== "activation" && (i.updateVal(r, "startx", t - x * n.boxMargin, Math.min), i.updateVal(r, "stopx", o + x * n.boxMargin, Math.max), i.updateVal(f.data, "starty", e - x * n.boxMargin, Math.min), i.updateVal(f.data, "stopy", s + x * n.boxMargin, Math.max));
1543
- };
1544
- }
1545
- this.sequenceItems.forEach(c()), this.activations.forEach(c("activation"));
1546
- },
1547
- insert: function(t, e, o, s) {
1548
- const i = v.getMin(t, o), a = v.getMax(t, o), c = v.getMin(e, s), l = v.getMax(e, s);
1549
- this.updateVal(f.data, "startx", i, Math.min), this.updateVal(f.data, "starty", c, Math.min), this.updateVal(f.data, "stopx", a, Math.max), this.updateVal(f.data, "stopy", l, Math.max), this.updateBounds(i, c, a, l);
1550
- },
1551
- newActivation: function(t, e, o) {
1552
- const s = o[t.from.actor], i = St(t.from.actor).length || 0, a = s.x + s.width / 2 + (i - 1) * n.activationWidth / 2;
1553
- this.activations.push({
1554
- startx: a,
1555
- starty: this.verticalPos + 2,
1556
- stopx: a + n.activationWidth,
1557
- stopy: void 0,
1558
- actor: t.from.actor,
1559
- anchored: D.anchorElement(e)
1560
- });
1561
- },
1562
- endActivation: function(t) {
1563
- const e = this.activations.map(function(o) {
1564
- return o.actor;
1565
- }).lastIndexOf(t.from.actor);
1566
- return this.activations.splice(e, 1)[0];
1567
- },
1568
- createLoop: function(t = { message: void 0, wrap: !1, width: void 0 }, e) {
1569
- return {
1570
- startx: void 0,
1571
- starty: this.verticalPos,
1572
- stopx: void 0,
1573
- stopy: void 0,
1574
- title: t.message,
1575
- wrap: t.wrap,
1576
- width: t.width,
1577
- height: 0,
1578
- fill: e
1579
- };
1580
- },
1581
- newLoop: function(t = { message: void 0, wrap: !1, width: void 0 }, e) {
1582
- this.sequenceItems.push(this.createLoop(t, e));
1583
- },
1584
- endLoop: function() {
1585
- return this.sequenceItems.pop();
1586
- },
1587
- isLoopOverlap: function() {
1588
- return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : !1;
1589
- },
1590
- addSectionToLoop: function(t) {
1591
- const e = this.sequenceItems.pop();
1592
- e.sections = e.sections || [], e.sectionTitles = e.sectionTitles || [], e.sections.push({ y: f.getVerticalPos(), height: 0 }), e.sectionTitles.push(t), this.sequenceItems.push(e);
1593
- },
1594
- saveVerticalPos: function() {
1595
- this.isLoopOverlap() && (this.savedVerticalPos = this.verticalPos);
1596
- },
1597
- resetVerticalPos: function() {
1598
- this.isLoopOverlap() && (this.verticalPos = this.savedVerticalPos);
1599
- },
1600
- bumpVerticalPos: function(t) {
1601
- this.verticalPos = this.verticalPos + t, this.data.stopy = v.getMax(this.data.stopy, this.verticalPos);
1602
- },
1603
- getVerticalPos: function() {
1604
- return this.verticalPos;
1605
- },
1606
- getBounds: function() {
1607
- return { bounds: this.data, models: this.models };
1608
- }
1609
- }, P0 = async function(t, e) {
1610
- f.bumpVerticalPos(n.boxMargin), e.height = n.boxMargin, e.starty = f.getVerticalPos();
1611
- const o = Nt();
1612
- o.x = e.startx, o.y = e.starty, o.width = e.width || n.width, o.class = "note";
1613
- const s = t.append("g"), i = D.drawRect(s, o), a = zt();
1614
- a.x = e.startx, a.y = e.starty, a.width = o.width, a.dy = "1em", a.text = e.message, a.class = "noteText", a.fontFamily = n.noteFontFamily, a.fontSize = n.noteFontSize, a.fontWeight = n.noteFontWeight, a.anchor = n.noteAlign, a.textMargin = n.noteMargin, a.valign = "center";
1615
- const c = nt(a.text) ? await It(s, a) : bt(s, a), l = Math.round(
1616
- c.map((p) => (p._groups || p)[0][0].getBBox().height).reduce((p, r) => p + r)
1617
- );
1618
- i.attr("height", l + 2 * n.noteMargin), e.height += l + 2 * n.noteMargin, f.bumpVerticalPos(l + 2 * n.noteMargin), e.stopy = e.starty + l + 2 * n.noteMargin, e.stopx = e.startx + o.width, f.insert(e.startx, e.starty, e.stopx, e.stopy), f.models.addNote(e);
1619
- }, xt = (t) => ({
1620
- fontFamily: t.messageFontFamily,
1621
- fontSize: t.messageFontSize,
1622
- fontWeight: t.messageFontWeight
1623
- }), Tt = (t) => ({
1624
- fontFamily: t.noteFontFamily,
1625
- fontSize: t.noteFontSize,
1626
- fontWeight: t.noteFontWeight
1627
- }), Wt = (t) => ({
1628
- fontFamily: t.actorFontFamily,
1629
- fontSize: t.actorFontSize,
1630
- fontWeight: t.actorFontWeight
1631
- });
1632
- async function L0(t, e) {
1633
- f.bumpVerticalPos(10);
1634
- const { startx: o, stopx: s, message: i } = e, a = v.splitBreaks(i).length, c = nt(i), l = c ? await wt(i, st()) : B.calculateTextDimensions(i, xt(n));
1635
- if (!c) {
1636
- const T = l.height / a;
1637
- e.height += T, f.bumpVerticalPos(T);
1638
- }
1639
- let p, r = l.height - 10;
1640
- const x = l.width;
1641
- if (o === s) {
1642
- p = f.getVerticalPos() + r, n.rightAngles || (r += n.boxMargin, p = f.getVerticalPos() + r), r += 30;
1643
- const T = v.getMax(x / 2, n.width / 2);
1644
- f.insert(
1645
- o - T,
1646
- f.getVerticalPos() - 10 + r,
1647
- s + T,
1648
- f.getVerticalPos() + 30 + r
1649
- );
1650
- } else
1651
- r += n.boxMargin, p = f.getVerticalPos() + r, f.insert(o, p - 10, s, p);
1652
- return f.bumpVerticalPos(r), e.height += r, e.stopy = e.starty + e.height, f.insert(e.fromBounds, e.starty, e.toBounds, e.stopy), p;
1653
- }
1654
- const I0 = async function(t, e, o, s) {
1655
- const { startx: i, stopx: a, starty: c, message: l, type: p, sequenceIndex: r, sequenceVisible: x } = e, T = B.calculateTextDimensions(l, xt(n)), u = zt();
1656
- u.x = i, u.y = c + 10, u.width = a - i, u.class = "messageText", u.dy = "1em", u.text = l, u.fontFamily = n.messageFontFamily, u.fontSize = n.messageFontSize, u.fontWeight = n.messageFontWeight, u.anchor = n.messageAlign, u.valign = "center", u.textMargin = n.wrapPadding, u.tspan = !1, nt(u.text) ? await It(t, u, { startx: i, stopx: a, starty: o }) : bt(t, u);
1657
- const g = T.width;
1658
- let m;
1659
- i === a ? n.rightAngles ? m = t.append("path").attr(
1660
- "d",
1661
- `M ${i},${o} H ${i + v.getMax(n.width / 2, g / 2)} V ${o + 25} H ${i}`
1662
- ) : m = t.append("path").attr(
1663
- "d",
1664
- "M " + i + "," + o + " C " + (i + 60) + "," + (o - 10) + " " + (i + 60) + "," + (o + 30) + " " + i + "," + (o + 20)
1665
- ) : (m = t.append("line"), m.attr("x1", i), m.attr("y1", o), m.attr("x2", a), m.attr("y2", o)), p === s.db.LINETYPE.DOTTED || p === s.db.LINETYPE.DOTTED_CROSS || p === s.db.LINETYPE.DOTTED_POINT || p === s.db.LINETYPE.DOTTED_OPEN ? (m.style("stroke-dasharray", "3, 3"), m.attr("class", "messageLine1")) : m.attr("class", "messageLine0");
1666
- let _ = "";
1667
- n.arrowMarkerAbsolute && (_ = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, _ = _.replace(/\(/g, "\\("), _ = _.replace(/\)/g, "\\)")), m.attr("stroke-width", 2), m.attr("stroke", "none"), m.style("fill", "none"), (p === s.db.LINETYPE.SOLID || p === s.db.LINETYPE.DOTTED) && m.attr("marker-end", "url(" + _ + "#arrowhead)"), (p === s.db.LINETYPE.SOLID_POINT || p === s.db.LINETYPE.DOTTED_POINT) && m.attr("marker-end", "url(" + _ + "#filled-head)"), (p === s.db.LINETYPE.SOLID_CROSS || p === s.db.LINETYPE.DOTTED_CROSS) && m.attr("marker-end", "url(" + _ + "#crosshead)"), (x || n.showSequenceNumbers) && (m.attr("marker-start", "url(" + _ + "#sequencenumber)"), t.append("text").attr("x", i).attr("y", o + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(r));
1668
- }, A0 = async function(t, e, o, s, i, a, c) {
1669
- let l = 0, p = 0, r, x = 0;
1670
- for (const T of s) {
1671
- const u = e[T], g = u.box;
1672
- r && r != g && (f.models.addBox(r), p += n.boxMargin + r.margin), g && g != r && (g.x = l + p, g.y = i, p += g.margin), u.width = u.width || n.width, u.height = v.getMax(u.height || n.height, n.height), u.margin = u.margin || n.actorMargin, x = v.getMax(x, u.height), o[u.name] && (p += u.width / 2), u.x = l + p, u.starty = f.getVerticalPos(), f.insert(u.x, i, u.x + u.width, u.height), l += u.width + p, u.box && (u.box.width = l + g.margin - u.box.x), p = u.margin, r = u.box, f.models.addActor(u);
1673
- }
1674
- r && f.models.addBox(r), f.bumpVerticalPos(x);
1675
- }, qt = async function(t, e, o, s) {
1676
- if (s) {
1677
- let i = 0;
1678
- f.bumpVerticalPos(n.boxMargin * 2);
1679
- for (const a of o) {
1680
- const c = e[a];
1681
- c.stopy || (c.stopy = f.getVerticalPos());
1682
- const l = await D.drawActor(t, c, n, !0);
1683
- i = v.getMax(i, l);
1684
- }
1685
- f.bumpVerticalPos(i + n.boxMargin);
1686
- } else
1687
- for (const i of o) {
1688
- const a = e[i];
1689
- await D.drawActor(t, a, n, !1);
1690
- }
1691
- }, ge = function(t, e, o, s) {
1692
- let i = 0, a = 0;
1693
- for (const c of o) {
1694
- const l = e[c], p = R0(l), r = D.drawPopup(
1695
- t,
1696
- l,
1697
- p,
1698
- n,
1699
- n.forceMenus,
1700
- s
1701
- );
1702
- r.height > i && (i = r.height), r.width + l.x > a && (a = r.width + l.x);
1703
- }
1704
- return { maxHeight: i, maxWidth: a };
1705
- }, xe = function(t) {
1706
- Ie(n, t), t.fontFamily && (n.actorFontFamily = n.noteFontFamily = n.messageFontFamily = t.fontFamily), t.fontSize && (n.actorFontSize = n.noteFontSize = n.messageFontSize = t.fontSize), t.fontWeight && (n.actorFontWeight = n.noteFontWeight = n.messageFontWeight = t.fontWeight);
1707
- }, St = function(t) {
1708
- return f.activations.filter(function(e) {
1709
- return e.actor === t;
1710
- });
1711
- }, jt = function(t, e) {
1712
- const o = e[t], s = St(t), i = s.reduce(function(c, l) {
1713
- return v.getMin(c, l.startx);
1714
- }, o.x + o.width / 2 - 1), a = s.reduce(function(c, l) {
1715
- return v.getMax(c, l.stopx);
1716
- }, o.x + o.width / 2 + 1);
1717
- return [i, a];
1718
- };
1719
- function it(t, e, o, s, i) {
1720
- f.bumpVerticalPos(o);
1721
- let a = s;
1722
- if (e.id && e.message && t[e.id]) {
1723
- const c = t[e.id].width, l = xt(n);
1724
- e.message = B.wrapLabel(`[${e.message}]`, c - 2 * n.wrapPadding, l), e.width = c, e.wrap = !0;
1725
- const p = B.calculateTextDimensions(e.message, l), r = v.getMax(p.height, n.labelBoxHeight);
1726
- a = s + r, X.debug(`${r} - ${e.message}`);
1727
- }
1728
- i(e), f.bumpVerticalPos(a);
1729
- }
1730
- function N0(t, e, o, s, i, a, c) {
1731
- function l(r, x) {
1732
- r.x < i[t.from].x ? (f.insert(
1733
- e.stopx - x,
1734
- e.starty,
1735
- e.startx,
1736
- e.stopy + r.height / 2 + n.noteMargin
1737
- ), e.stopx = e.stopx + x) : (f.insert(
1738
- e.startx,
1739
- e.starty,
1740
- e.stopx + x,
1741
- e.stopy + r.height / 2 + n.noteMargin
1742
- ), e.stopx = e.stopx - x);
1743
- }
1744
- function p(r, x) {
1745
- r.x < i[t.to].x ? (f.insert(
1746
- e.startx - x,
1747
- e.starty,
1748
- e.stopx,
1749
- e.stopy + r.height / 2 + n.noteMargin
1750
- ), e.startx = e.startx + x) : (f.insert(
1751
- e.stopx,
1752
- e.starty,
1753
- e.startx + x,
1754
- e.stopy + r.height / 2 + n.noteMargin
1755
- ), e.startx = e.startx - x);
1756
- }
1757
- if (a[t.to] == s) {
1758
- const r = i[t.to], x = r.type == "actor" ? ft / 2 + 3 : r.width / 2 + 3;
1759
- l(r, x), r.starty = o - r.height / 2, f.bumpVerticalPos(r.height / 2);
1760
- } else if (c[t.from] == s) {
1761
- const r = i[t.from];
1762
- if (n.mirrorActors) {
1763
- const x = r.type == "actor" ? ft / 2 : r.width / 2;
1764
- p(r, x);
1765
- }
1766
- r.stopy = o - r.height / 2, f.bumpVerticalPos(r.height / 2);
1767
- } else if (c[t.to] == s) {
1768
- const r = i[t.to];
1769
- if (n.mirrorActors) {
1770
- const x = r.type == "actor" ? ft / 2 + 3 : r.width / 2 + 3;
1771
- l(r, x);
1772
- }
1773
- r.stopy = o - r.height / 2, f.bumpVerticalPos(r.height / 2);
1774
- }
1775
- }
1776
- const S0 = async function(t, e, o, s) {
1777
- const { securityLevel: i, sequence: a } = st();
1778
- n = a;
1779
- let c;
1780
- i === "sandbox" && (c = Lt("#i" + e));
1781
- const l = i === "sandbox" ? Lt(c.nodes()[0].contentDocument.body) : Lt("body"), p = i === "sandbox" ? c.nodes()[0].contentDocument : document;
1782
- f.init(), X.debug(s.db);
1783
- const r = i === "sandbox" ? l.select(`[id="${e}"]`) : Lt(`[id="${e}"]`), x = s.db.getActors(), T = s.db.getCreatedActors(), u = s.db.getDestroyedActors(), g = s.db.getBoxes();
1784
- let m = s.db.getActorKeys();
1785
- const _ = s.db.getMessages(), I = s.db.getDiagramTitle(), V = s.db.hasAtLeastOneBox(), S = s.db.hasAtLeastOneBoxWithTitle(), O = await M0(x, _, s);
1786
- if (n.height = await C0(x, O, g), D.insertComputerIcon(r), D.insertDatabaseIcon(r), D.insertClockIcon(r), V && (f.bumpVerticalPos(n.boxMargin), S && f.bumpVerticalPos(g[0].textMaxHeight)), n.hideUnusedParticipants === !0) {
1787
- const y = /* @__PURE__ */ new Set();
1788
- _.forEach((P) => {
1789
- y.add(P.from), y.add(P.to);
1790
- }), m = m.filter((P) => y.has(P));
1791
- }
1792
- await A0(r, x, T, m, 0);
1793
- const R = await O0(_, x, O, s);
1794
- D.insertArrowHead(r), D.insertArrowCrossHead(r), D.insertArrowFilledHead(r), D.insertSequenceNumber(r);
1795
- function q(y, P) {
1796
- const j = f.endActivation(y);
1797
- j.starty + 18 > P && (j.starty = P - 6, P += 12), D.drawActivation(
1798
- r,
1799
- j,
1800
- P,
1801
- n,
1802
- St(y.from.actor).length
1803
- ), f.insert(j.startx, P - 10, j.stopx, P);
1804
- }
1805
- let z = 1, J = 1;
1806
- const $ = [], H = [];
1807
- let K = 0;
1808
- for (const y of _) {
1809
- let P, j, rt;
1810
- switch (y.type) {
1811
- case s.db.LINETYPE.NOTE:
1812
- f.resetVerticalPos(), j = y.noteModel, await P0(r, j);
1813
- break;
1814
- case s.db.LINETYPE.ACTIVE_START:
1815
- f.newActivation(y, r, x);
1816
- break;
1817
- case s.db.LINETYPE.ACTIVE_END:
1818
- q(y, f.getVerticalPos());
1819
- break;
1820
- case s.db.LINETYPE.LOOP_START:
1821
- it(
1822
- R,
1823
- y,
1824
- n.boxMargin,
1825
- n.boxMargin + n.boxTextMargin,
1826
- (A) => f.newLoop(A)
1827
- );
1828
- break;
1829
- case s.db.LINETYPE.LOOP_END:
1830
- P = f.endLoop(), await D.drawLoop(r, P, "loop", n), f.bumpVerticalPos(P.stopy - f.getVerticalPos()), f.models.addLoop(P);
1831
- break;
1832
- case s.db.LINETYPE.RECT_START:
1833
- it(
1834
- R,
1835
- y,
1836
- n.boxMargin,
1837
- n.boxMargin,
1838
- (A) => f.newLoop(void 0, A.message)
1839
- );
1840
- break;
1841
- case s.db.LINETYPE.RECT_END:
1842
- P = f.endLoop(), H.push(P), f.models.addLoop(P), f.bumpVerticalPos(P.stopy - f.getVerticalPos());
1843
- break;
1844
- case s.db.LINETYPE.OPT_START:
1845
- it(
1846
- R,
1847
- y,
1848
- n.boxMargin,
1849
- n.boxMargin + n.boxTextMargin,
1850
- (A) => f.newLoop(A)
1851
- );
1852
- break;
1853
- case s.db.LINETYPE.OPT_END:
1854
- P = f.endLoop(), await D.drawLoop(r, P, "opt", n), f.bumpVerticalPos(P.stopy - f.getVerticalPos()), f.models.addLoop(P);
1855
- break;
1856
- case s.db.LINETYPE.ALT_START:
1857
- it(
1858
- R,
1859
- y,
1860
- n.boxMargin,
1861
- n.boxMargin + n.boxTextMargin,
1862
- (A) => f.newLoop(A)
1863
- );
1864
- break;
1865
- case s.db.LINETYPE.ALT_ELSE:
1866
- it(
1867
- R,
1868
- y,
1869
- n.boxMargin + n.boxTextMargin,
1870
- n.boxMargin,
1871
- (A) => f.addSectionToLoop(A)
1872
- );
1873
- break;
1874
- case s.db.LINETYPE.ALT_END:
1875
- P = f.endLoop(), await D.drawLoop(r, P, "alt", n), f.bumpVerticalPos(P.stopy - f.getVerticalPos()), f.models.addLoop(P);
1876
- break;
1877
- case s.db.LINETYPE.PAR_START:
1878
- case s.db.LINETYPE.PAR_OVER_START:
1879
- it(
1880
- R,
1881
- y,
1882
- n.boxMargin,
1883
- n.boxMargin + n.boxTextMargin,
1884
- (A) => f.newLoop(A)
1885
- ), f.saveVerticalPos();
1886
- break;
1887
- case s.db.LINETYPE.PAR_AND:
1888
- it(
1889
- R,
1890
- y,
1891
- n.boxMargin + n.boxTextMargin,
1892
- n.boxMargin,
1893
- (A) => f.addSectionToLoop(A)
1894
- );
1895
- break;
1896
- case s.db.LINETYPE.PAR_END:
1897
- P = f.endLoop(), await D.drawLoop(r, P, "par", n), f.bumpVerticalPos(P.stopy - f.getVerticalPos()), f.models.addLoop(P);
1898
- break;
1899
- case s.db.LINETYPE.AUTONUMBER:
1900
- z = y.message.start || z, J = y.message.step || J, y.message.visible ? s.db.enableSequenceNumbers() : s.db.disableSequenceNumbers();
1901
- break;
1902
- case s.db.LINETYPE.CRITICAL_START:
1903
- it(
1904
- R,
1905
- y,
1906
- n.boxMargin,
1907
- n.boxMargin + n.boxTextMargin,
1908
- (A) => f.newLoop(A)
1909
- );
1910
- break;
1911
- case s.db.LINETYPE.CRITICAL_OPTION:
1912
- it(
1913
- R,
1914
- y,
1915
- n.boxMargin + n.boxTextMargin,
1916
- n.boxMargin,
1917
- (A) => f.addSectionToLoop(A)
1918
- );
1919
- break;
1920
- case s.db.LINETYPE.CRITICAL_END:
1921
- P = f.endLoop(), await D.drawLoop(r, P, "critical", n), f.bumpVerticalPos(P.stopy - f.getVerticalPos()), f.models.addLoop(P);
1922
- break;
1923
- case s.db.LINETYPE.BREAK_START:
1924
- it(
1925
- R,
1926
- y,
1927
- n.boxMargin,
1928
- n.boxMargin + n.boxTextMargin,
1929
- (A) => f.newLoop(A)
1930
- );
1931
- break;
1932
- case s.db.LINETYPE.BREAK_END:
1933
- P = f.endLoop(), await D.drawLoop(r, P, "break", n), f.bumpVerticalPos(P.stopy - f.getVerticalPos()), f.models.addLoop(P);
1934
- break;
1935
- default:
1936
- try {
1937
- rt = y.msgModel, rt.starty = f.getVerticalPos(), rt.sequenceIndex = z, rt.sequenceVisible = s.db.showSequenceNumbers();
1938
- const A = await L0(r, rt);
1939
- N0(
1940
- y,
1941
- rt,
1942
- A,
1943
- K,
1944
- x,
1945
- T,
1946
- u
1947
- ), $.push({ messageModel: rt, lineStartY: A }), f.models.addMessage(rt);
1948
- } catch (A) {
1949
- X.error("error while drawing message", A);
1950
- }
1951
- }
1952
- [
1953
- s.db.LINETYPE.SOLID_OPEN,
1954
- s.db.LINETYPE.DOTTED_OPEN,
1955
- s.db.LINETYPE.SOLID,
1956
- s.db.LINETYPE.DOTTED,
1957
- s.db.LINETYPE.SOLID_CROSS,
1958
- s.db.LINETYPE.DOTTED_CROSS,
1959
- s.db.LINETYPE.SOLID_POINT,
1960
- s.db.LINETYPE.DOTTED_POINT
1961
- ].includes(y.type) && (z = z + J), K++;
1962
- }
1963
- X.debug("createdActors", T), X.debug("destroyedActors", u), await qt(r, x, m, !1);
1964
- for (const y of $)
1965
- await I0(r, y.messageModel, y.lineStartY, s);
1966
- n.mirrorActors && await qt(r, x, m, !0), H.forEach((y) => D.drawBackgroundRect(r, y)), pe(r, x, m, n);
1967
- for (const y of f.models.boxes)
1968
- y.height = f.getVerticalPos() - y.y, f.insert(y.x, y.y, y.x + y.width, y.height), y.startx = y.x, y.starty = y.y, y.stopx = y.startx + y.width, y.stopy = y.starty + y.height, y.stroke = "rgb(0,0,0, 0.5)", await D.drawBox(r, y, n);
1969
- V && f.bumpVerticalPos(n.boxMargin);
1970
- const F = ge(r, x, m, p), { bounds: W } = f.getBounds();
1971
- let Z = W.stopy - W.starty;
1972
- Z < F.maxHeight && (Z = F.maxHeight);
1973
- let U = Z + 2 * n.diagramMarginY;
1974
- n.mirrorActors && (U = U - n.boxMargin + n.bottomMarginAdj);
1975
- let Q = W.stopx - W.startx;
1976
- Q < F.maxWidth && (Q = F.maxWidth);
1977
- const tt = Q + 2 * n.diagramMarginX;
1978
- I && r.append("text").text(I).attr("x", (W.stopx - W.startx) / 2 - 2 * n.diagramMarginX).attr("y", -25), Le(r, U, tt, n.useMaxWidth);
1979
- const N = I ? 40 : 0;
1980
- r.attr(
1981
- "viewBox",
1982
- W.startx - n.diagramMarginX + " -" + (n.diagramMarginY + N) + " " + tt + " " + (U + N)
1983
- ), X.debug("models:", f.models);
1984
- };
1985
- async function M0(t, e, o) {
1986
- const s = {};
1987
- for (const i of e)
1988
- if (t[i.to] && t[i.from]) {
1989
- const a = t[i.to];
1990
- if (i.placement === o.db.PLACEMENT.LEFTOF && !a.prevActor || i.placement === o.db.PLACEMENT.RIGHTOF && !a.nextActor)
1991
- continue;
1992
- const c = i.placement !== void 0, l = !c, p = c ? Tt(n) : xt(n), r = i.wrap ? B.wrapLabel(i.message, n.width - 2 * n.wrapPadding, p) : i.message, T = (nt(r) ? await wt(i.message, st()) : B.calculateTextDimensions(r, p)).width + 2 * n.wrapPadding;
1993
- l && i.from === a.nextActor ? s[i.to] = v.getMax(
1994
- s[i.to] || 0,
1995
- T
1996
- ) : l && i.from === a.prevActor ? s[i.from] = v.getMax(
1997
- s[i.from] || 0,
1998
- T
1999
- ) : l && i.from === i.to ? (s[i.from] = v.getMax(
2000
- s[i.from] || 0,
2001
- T / 2
2002
- ), s[i.to] = v.getMax(
2003
- s[i.to] || 0,
2004
- T / 2
2005
- )) : i.placement === o.db.PLACEMENT.RIGHTOF ? s[i.from] = v.getMax(
2006
- s[i.from] || 0,
2007
- T
2008
- ) : i.placement === o.db.PLACEMENT.LEFTOF ? s[a.prevActor] = v.getMax(
2009
- s[a.prevActor] || 0,
2010
- T
2011
- ) : i.placement === o.db.PLACEMENT.OVER && (a.prevActor && (s[a.prevActor] = v.getMax(
2012
- s[a.prevActor] || 0,
2013
- T / 2
2014
- )), a.nextActor && (s[i.from] = v.getMax(
2015
- s[i.from] || 0,
2016
- T / 2
2017
- )));
2018
- }
2019
- return X.debug("maxMessageWidthPerActor:", s), s;
2020
- }
2021
- const R0 = function(t) {
2022
- let e = 0;
2023
- const o = Wt(n);
2024
- for (const s in t.links) {
2025
- const a = B.calculateTextDimensions(s, o).width + 2 * n.wrapPadding + 2 * n.boxMargin;
2026
- e < a && (e = a);
2027
- }
2028
- return e;
2029
- };
2030
- async function C0(t, e, o) {
2031
- let s = 0;
2032
- for (const a of Object.keys(t)) {
2033
- const c = t[a];
2034
- c.wrap && (c.description = B.wrapLabel(
2035
- c.description,
2036
- n.width - 2 * n.wrapPadding,
2037
- Wt(n)
2038
- ));
2039
- const l = nt(c.description) ? await wt(c.description, st()) : B.calculateTextDimensions(c.description, Wt(n));
2040
- c.width = c.wrap ? n.width : v.getMax(n.width, l.width + 2 * n.wrapPadding), c.height = c.wrap ? v.getMax(l.height, n.height) : n.height, s = v.getMax(s, c.height);
2041
- }
2042
- for (const a in e) {
2043
- const c = t[a];
2044
- if (!c)
2045
- continue;
2046
- const l = t[c.nextActor];
2047
- if (!l) {
2048
- const T = e[a] + n.actorMargin - c.width / 2;
2049
- c.margin = v.getMax(T, n.actorMargin);
2050
- continue;
2051
- }
2052
- const r = e[a] + n.actorMargin - c.width / 2 - l.width / 2;
2053
- c.margin = v.getMax(r, n.actorMargin);
2054
- }
2055
- let i = 0;
2056
- return o.forEach((a) => {
2057
- const c = xt(n);
2058
- let l = a.actorKeys.reduce((x, T) => x += t[T].width + (t[T].margin || 0), 0);
2059
- l -= 2 * n.boxTextMargin, a.wrap && (a.name = B.wrapLabel(a.name, l - 2 * n.wrapPadding, c));
2060
- const p = B.calculateTextDimensions(a.name, c);
2061
- i = v.getMax(p.height, i);
2062
- const r = v.getMax(l, p.width + 2 * n.wrapPadding);
2063
- if (a.margin = n.boxTextMargin, l < r) {
2064
- const x = (r - l) / 2;
2065
- a.margin += x;
2066
- }
2067
- }), o.forEach((a) => a.textMaxHeight = i), v.getMax(s, n.height);
2068
- }
2069
- const D0 = async function(t, e, o) {
2070
- const s = e[t.from].x, i = e[t.to].x, a = t.wrap && t.message;
2071
- let c = nt(t.message) ? await wt(t.message, st()) : B.calculateTextDimensions(
2072
- a ? B.wrapLabel(t.message, n.width, Tt(n)) : t.message,
2073
- Tt(n)
2074
- );
2075
- const l = {
2076
- width: a ? n.width : v.getMax(n.width, c.width + 2 * n.noteMargin),
2077
- height: 0,
2078
- startx: e[t.from].x,
2079
- stopx: 0,
2080
- starty: 0,
2081
- stopy: 0,
2082
- message: t.message
2083
- };
2084
- return t.placement === o.db.PLACEMENT.RIGHTOF ? (l.width = a ? v.getMax(n.width, c.width) : v.getMax(
2085
- e[t.from].width / 2 + e[t.to].width / 2,
2086
- c.width + 2 * n.noteMargin
2087
- ), l.startx = s + (e[t.from].width + n.actorMargin) / 2) : t.placement === o.db.PLACEMENT.LEFTOF ? (l.width = a ? v.getMax(n.width, c.width + 2 * n.noteMargin) : v.getMax(
2088
- e[t.from].width / 2 + e[t.to].width / 2,
2089
- c.width + 2 * n.noteMargin
2090
- ), l.startx = s - l.width + (e[t.from].width - n.actorMargin) / 2) : t.to === t.from ? (c = B.calculateTextDimensions(
2091
- a ? B.wrapLabel(
2092
- t.message,
2093
- v.getMax(n.width, e[t.from].width),
2094
- Tt(n)
2095
- ) : t.message,
2096
- Tt(n)
2097
- ), l.width = a ? v.getMax(n.width, e[t.from].width) : v.getMax(
2098
- e[t.from].width,
2099
- n.width,
2100
- c.width + 2 * n.noteMargin
2101
- ), l.startx = s + (e[t.from].width - l.width) / 2) : (l.width = Math.abs(s + e[t.from].width / 2 - (i + e[t.to].width / 2)) + n.actorMargin, l.startx = s < i ? s + e[t.from].width / 2 - n.actorMargin / 2 : i + e[t.to].width / 2 - n.actorMargin / 2), a && (l.message = B.wrapLabel(
2102
- t.message,
2103
- l.width - 2 * n.wrapPadding,
2104
- Tt(n)
2105
- )), X.debug(
2106
- `NM:[${l.startx},${l.stopx},${l.starty},${l.stopy}:${l.width},${l.height}=${t.message}]`
2107
- ), l;
2108
- }, V0 = function(t, e, o) {
2109
- if (![
2110
- o.db.LINETYPE.SOLID_OPEN,
2111
- o.db.LINETYPE.DOTTED_OPEN,
2112
- o.db.LINETYPE.SOLID,
2113
- o.db.LINETYPE.DOTTED,
2114
- o.db.LINETYPE.SOLID_CROSS,
2115
- o.db.LINETYPE.DOTTED_CROSS,
2116
- o.db.LINETYPE.SOLID_POINT,
2117
- o.db.LINETYPE.DOTTED_POINT
2118
- ].includes(t.type))
2119
- return {};
2120
- const [s, i] = jt(t.from, e), [a, c] = jt(t.to, e), l = s <= a, p = l ? i : s;
2121
- let r = l ? a : c;
2122
- const x = Math.abs(a - c) > 2, T = (_) => l ? -_ : _;
2123
- t.from === t.to ? r = p : (t.activate && !x && (r += T(n.activationWidth / 2 - 1)), [o.db.LINETYPE.SOLID_OPEN, o.db.LINETYPE.DOTTED_OPEN].includes(t.type) || (r += T(3)));
2124
- const u = [s, i, a, c], g = Math.abs(p - r);
2125
- t.wrap && t.message && (t.message = B.wrapLabel(
2126
- t.message,
2127
- v.getMax(g + 2 * n.wrapPadding, n.width),
2128
- xt(n)
2129
- ));
2130
- const m = B.calculateTextDimensions(t.message, xt(n));
2131
- return {
2132
- width: v.getMax(
2133
- t.wrap ? 0 : m.width + 2 * n.wrapPadding,
2134
- g + 2 * n.wrapPadding,
2135
- n.width
2136
- ),
2137
- height: 0,
2138
- startx: p,
2139
- stopx: r,
2140
- starty: 0,
2141
- stopy: 0,
2142
- message: t.message,
2143
- type: t.type,
2144
- wrap: t.wrap,
2145
- fromBounds: Math.min.apply(null, u),
2146
- toBounds: Math.max.apply(null, u)
2147
- };
2148
- }, O0 = async function(t, e, o, s) {
2149
- const i = {}, a = [];
2150
- let c, l, p;
2151
- for (const r of t) {
2152
- switch (r.id = B.random({ length: 10 }), r.type) {
2153
- case s.db.LINETYPE.LOOP_START:
2154
- case s.db.LINETYPE.ALT_START:
2155
- case s.db.LINETYPE.OPT_START:
2156
- case s.db.LINETYPE.PAR_START:
2157
- case s.db.LINETYPE.PAR_OVER_START:
2158
- case s.db.LINETYPE.CRITICAL_START:
2159
- case s.db.LINETYPE.BREAK_START:
2160
- a.push({
2161
- id: r.id,
2162
- msg: r.message,
2163
- from: Number.MAX_SAFE_INTEGER,
2164
- to: Number.MIN_SAFE_INTEGER,
2165
- width: 0
2166
- });
2167
- break;
2168
- case s.db.LINETYPE.ALT_ELSE:
2169
- case s.db.LINETYPE.PAR_AND:
2170
- case s.db.LINETYPE.CRITICAL_OPTION:
2171
- r.message && (c = a.pop(), i[c.id] = c, i[r.id] = c, a.push(c));
2172
- break;
2173
- case s.db.LINETYPE.LOOP_END:
2174
- case s.db.LINETYPE.ALT_END:
2175
- case s.db.LINETYPE.OPT_END:
2176
- case s.db.LINETYPE.PAR_END:
2177
- case s.db.LINETYPE.CRITICAL_END:
2178
- case s.db.LINETYPE.BREAK_END:
2179
- c = a.pop(), i[c.id] = c;
2180
- break;
2181
- case s.db.LINETYPE.ACTIVE_START:
2182
- {
2183
- const T = e[r.from ? r.from.actor : r.to.actor], u = St(r.from ? r.from.actor : r.to.actor).length, g = T.x + T.width / 2 + (u - 1) * n.activationWidth / 2, m = {
2184
- startx: g,
2185
- stopx: g + n.activationWidth,
2186
- actor: r.from.actor,
2187
- enabled: !0
2188
- };
2189
- f.activations.push(m);
2190
- }
2191
- break;
2192
- case s.db.LINETYPE.ACTIVE_END:
2193
- {
2194
- const T = f.activations.map((u) => u.actor).lastIndexOf(r.from.actor);
2195
- delete f.activations.splice(T, 1)[0];
2196
- }
2197
- break;
2198
- }
2199
- r.placement !== void 0 ? (l = await D0(r, e, s), r.noteModel = l, a.forEach((T) => {
2200
- c = T, c.from = v.getMin(c.from, l.startx), c.to = v.getMax(c.to, l.startx + l.width), c.width = v.getMax(c.width, Math.abs(c.from - c.to)) - n.labelBoxWidth;
2201
- })) : (p = V0(r, e, s), r.msgModel = p, p.startx && p.stopx && a.length > 0 && a.forEach((T) => {
2202
- if (c = T, p.startx === p.stopx) {
2203
- const u = e[r.from], g = e[r.to];
2204
- c.from = v.getMin(
2205
- u.x - p.width / 2,
2206
- u.x - u.width / 2,
2207
- c.from
2208
- ), c.to = v.getMax(
2209
- g.x + p.width / 2,
2210
- g.x + u.width / 2,
2211
- c.to
2212
- ), c.width = v.getMax(c.width, Math.abs(c.to - c.from)) - n.labelBoxWidth;
2213
- } else
2214
- c.from = v.getMin(p.startx, c.from), c.to = v.getMax(p.stopx, c.to), c.width = v.getMax(c.width, p.width) - n.labelBoxWidth;
2215
- }));
2216
- }
2217
- return f.activations = [], X.debug("Loop type widths:", i), i;
2218
- }, B0 = {
2219
- bounds: f,
2220
- drawActors: qt,
2221
- drawActorsPopup: ge,
2222
- setConf: xe,
2223
- draw: S0
2224
- }, q0 = {
2225
- parser: De,
2226
- db: Qt,
2227
- renderer: B0,
2228
- styles: o0,
2229
- init: ({ wrap: t }) => {
2230
- Qt.setWrap(t);
2231
- }
2232
- };
2233
- export {
2234
- q0 as diagram
2235
- };