@spteck/react-controls-v2 2.0.18 → 2.2.1

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