@copilotkitnext/react 0.0.22-alpha.7 → 0.0.22-alpha.8

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