collabmd 0.1.49 → 0.1.52

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 (750) hide show
  1. package/README.md +11 -660
  2. package/bin/collabmd.js +36 -20
  3. package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-BEz2BKN1.js +1 -0
  4. package/dist/client/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  5. package/dist/client/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  6. package/dist/client/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  7. package/dist/client/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  8. package/dist/client/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  9. package/dist/client/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  10. package/dist/client/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  11. package/dist/client/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  12. package/dist/client/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  13. package/dist/client/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  14. package/dist/client/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  15. package/dist/client/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  16. package/dist/client/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  17. package/dist/client/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  18. package/dist/client/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  19. package/dist/client/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  20. package/dist/client/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  21. package/dist/client/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  22. package/dist/client/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  23. package/dist/client/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  24. package/dist/client/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  25. package/dist/client/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  26. package/dist/client/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  27. package/dist/client/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  28. package/dist/client/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  29. package/dist/client/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  30. package/dist/client/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  31. package/dist/client/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  32. package/dist/client/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  33. package/dist/client/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  34. package/dist/client/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  35. package/dist/client/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  36. package/dist/client/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  37. package/dist/client/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  38. package/dist/client/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  39. package/dist/client/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  40. package/dist/client/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  41. package/dist/client/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  42. package/dist/client/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  43. package/dist/client/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  44. package/dist/client/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  45. package/dist/client/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  46. package/dist/client/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  47. package/dist/client/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  48. package/dist/client/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  49. package/dist/client/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  50. package/dist/client/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  51. package/dist/client/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  52. package/dist/client/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  53. package/dist/client/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  54. package/dist/client/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  55. package/dist/client/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  56. package/dist/client/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  57. package/dist/client/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  58. package/dist/client/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  59. package/dist/client/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  60. package/dist/client/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  61. package/dist/client/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  62. package/dist/client/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  63. package/dist/client/assets/Middleware-DUgFSleI.js +1 -0
  64. package/dist/client/assets/_basePickBy-QJXUw_pr.js +1 -0
  65. package/dist/client/assets/_baseUniq-DR4vVjyC.js +1 -0
  66. package/dist/client/assets/abnfDiagram-O67JEVCF-Dwt6a0Ds.js +1 -0
  67. package/dist/client/assets/abnfDiagram-VCTEODGH-DxNxad6-.js +1 -0
  68. package/dist/client/assets/ar-SA-5WIASEJP-Di7OimCN.js +10 -0
  69. package/dist/client/assets/architecture-7GRP2DOG-BBwRXFv3.js +1 -0
  70. package/dist/client/assets/architecture-7GRP2DOG-DJVtYNt-.js +1 -0
  71. package/dist/client/assets/architectureDiagram-5GKGNRK7-C1uvg5id.js +36 -0
  72. package/dist/client/assets/architectureDiagram-NJMV4G6O-D5CGiX3G.js +36 -0
  73. package/dist/client/assets/az-AZ-V5EUQD6C-C19OGTT_.js +1 -0
  74. package/dist/client/assets/{babel-CY5KOv-I.js → babel-Bi_28hhi.js} +1 -1
  75. package/dist/client/assets/band-D-Cum8PO.js +1 -0
  76. package/dist/client/assets/bg-BG-EXASCMTR-BIt0xWyb.js +5 -0
  77. package/dist/client/assets/blockDiagram-BEXU5L5S-BgTM0var.js +140 -0
  78. package/dist/client/assets/blockDiagram-I7D4REHJ-B2YonsoG.js +129 -0
  79. package/dist/client/assets/bn-BD-U4SYNFCO-CdNaPy4Q.js +3 -0
  80. package/dist/client/assets/bn-IN-HKDJIITE-CdNaPy4Q.js +3 -0
  81. package/dist/client/assets/{browser-BKLM0ThC-IxjwuOIz-BBqQnUEb.js → browser-BKLM0ThC-IxjwuOIz-C0mP17s1.js} +1 -1
  82. package/dist/client/assets/{browser-utils-DbXSMI-6.js → browser-utils-vlHL9goC.js} +1 -1
  83. package/dist/client/assets/{c4Diagram-7LVT6UL2-yD2poxqw.js → c4Diagram-7LVT6UL2-r4IwomZm.js} +2 -2
  84. package/dist/client/assets/c4Diagram-YGBWAQC7-_xZPrNkB.js +38 -0
  85. package/dist/client/assets/ca-ES-2KGUU5XB-C9t-c0cH.js +8 -0
  86. package/dist/client/assets/channel-CgcHBnmr.js +1 -0
  87. package/dist/client/assets/chunk-2E4U76K2-CIQUuV9n.js +1 -0
  88. package/dist/client/assets/chunk-2Q5K7J3B-BMFG3ur0.js +1 -0
  89. package/dist/client/assets/{chunk-2ZTRR5NV-C2qZJila.js → chunk-2ZTRR5NV-CnDP55cn.js} +1 -1
  90. package/dist/client/assets/chunk-2ZTRR5NV-DcPRfelM.js +2 -0
  91. package/dist/client/assets/chunk-3FUC2YCW-8tZlhTGX.js +1 -0
  92. package/dist/client/assets/{chunk-3Z5EZCMW-DMniOlPd.js → chunk-3Z5EZCMW-BAnA6eQ7.js} +1 -1
  93. package/dist/client/assets/chunk-3Z5EZCMW-Yx4Q5AcN.js +1 -0
  94. package/dist/client/assets/chunk-4HAMMTFA-q0ldNVvr.js +62 -0
  95. package/dist/client/assets/chunk-4SOEAONT-C3fufoVl.js +40 -0
  96. package/dist/client/assets/chunk-5DYCD2WN-BKWCKnK-.js +1 -0
  97. package/dist/client/assets/{chunk-5V3GS4D5-i-ZDOEnP.js → chunk-5V3GS4D5-B5uC2oxu.js} +1 -1
  98. package/dist/client/assets/chunk-5V3GS4D5-BR7kgIgJ.js +1 -0
  99. package/dist/client/assets/chunk-5VM5RSS4-hE9rU_bl.js +15 -0
  100. package/dist/client/assets/chunk-6AEJRKK7-DTVZj5bY.js +1 -0
  101. package/dist/client/assets/{chunk-6AZGARVD-BB6FqMl-.js → chunk-6AZGARVD--pTGpDnx.js} +1 -1
  102. package/dist/client/assets/chunk-6AZGARVD-CnZDr4Cj.js +1 -0
  103. package/dist/client/assets/{chunk-6EIED4P4-DdUJkP0f.js → chunk-6EIED4P4-Bp8dpTvX.js} +1 -1
  104. package/dist/client/assets/chunk-6EIED4P4-DBVWq7Tz.js +1 -0
  105. package/dist/client/assets/{chunk-6K3QC6MW-CqVsVn-y.js → chunk-6K3QC6MW-DGVRzL6v.js} +1 -1
  106. package/dist/client/assets/chunk-6K3QC6MW-JnuvEGV4.js +1 -0
  107. package/dist/client/assets/{chunk-6TQVIW2G-DKlLbNIP.js → chunk-6TQVIW2G-BSj0l_pu.js} +1 -1
  108. package/dist/client/assets/chunk-6TQVIW2G-DgBX-Pv0.js +1 -0
  109. package/dist/client/assets/chunk-742MDFTN-D1nh6vNv.js +1 -0
  110. package/dist/client/assets/{chunk-747NJXEK-BFkZPlab.js → chunk-747NJXEK-BjqqAsS9.js} +1 -1
  111. package/dist/client/assets/chunk-747NJXEK-Cur1aosP.js +2 -0
  112. package/dist/client/assets/chunk-75Z2AOVW-DitkSoSG.js +2 -0
  113. package/dist/client/assets/chunk-7INBJB4K-CDmiHbaX.js +62 -0
  114. package/dist/client/assets/chunk-7M6MHVWA-BDakkknV.js +213 -0
  115. package/dist/client/assets/chunk-7PRAP22T-9uTvtc_-.js +1 -0
  116. package/dist/client/assets/{chunk-CLGD4ZFX-BMeArk03.js → chunk-CLGD4ZFX-BfYJtJm1.js} +1 -1
  117. package/dist/client/assets/chunk-DU6HZSFF-CWlP1Dk_.js +125 -0
  118. package/dist/client/assets/chunk-DUW6YSOI-Dgx8z5s3.js +1 -0
  119. package/dist/client/assets/chunk-DYU5D34O-DN0WQZBm.js +1 -0
  120. package/dist/client/assets/{chunk-F27PBJKO-D4xNct1r.js → chunk-F27PBJKO-DPcsPcEs.js} +1 -1
  121. package/dist/client/assets/{chunk-FOHPRMQF-DHwB1DNv.js → chunk-FOHPRMQF-Dmmo5Kak.js} +9 -9
  122. package/dist/client/assets/chunk-FOHPRMQF-DzxwRta7.js +161 -0
  123. package/dist/client/assets/chunk-GMAD6QVW-Bgk8qnty.js +8 -0
  124. package/dist/client/assets/chunk-GNY47TPC-CTrH5O5R.js +1 -0
  125. package/dist/client/assets/{chunk-SVP7TREG-DB485R5x.js → chunk-GTNCS2PH-ChgkzEIi.js} +1 -1
  126. package/dist/client/assets/chunk-GVQU2GXP-CQ8cl-Uu.js +1 -0
  127. package/dist/client/assets/chunk-GWA4HPMP-CGmv2yIq.js +1 -0
  128. package/dist/client/assets/{chunk-I5DQTOEV-Hm2LfiYI.js → chunk-I5DQTOEV-B98XA8VK.js} +1 -1
  129. package/dist/client/assets/chunk-I5DQTOEV-aBZooNp1.js +1 -0
  130. package/dist/client/assets/{chunk-ICYGCRZG-749o-pGJ.js → chunk-ICYGCRZG-D97UeqJs.js} +1 -1
  131. package/dist/client/assets/chunk-ICYGCRZG-odvlDZyA.js +1 -0
  132. package/dist/client/assets/{chunk-IH6LHLGP-CC6I9F3i.js → chunk-IH6LHLGP-BNevEHZK.js} +1 -1
  133. package/dist/client/assets/chunk-IH6LHLGP-CvXe34hB.js +1 -0
  134. package/dist/client/assets/{chunk-IMKFNOWR-D8jEuU3Q.js → chunk-IMKFNOWR-CBqxfpcP.js} +2 -2
  135. package/dist/client/assets/chunk-J5ZVWO5B-oDCd-gWO.js +1 -0
  136. package/dist/client/assets/chunk-JWPE2WC7-GDilnS5Y.js +1 -0
  137. package/dist/client/assets/{chunk-KI3K4JFJ-Rma-0k_M.js → chunk-KI3K4JFJ-D5XCPRZv.js} +1 -1
  138. package/dist/client/assets/chunk-KI3K4JFJ-FTtDwx3-.js +1 -0
  139. package/dist/client/assets/chunk-L3NEJ4N5-BflzkdTI.js +1 -0
  140. package/dist/client/assets/{chunk-LNGE3PJU-DWpGwHrW.js → chunk-LNGE3PJU-5-SxdO55.js} +1 -1
  141. package/dist/client/assets/chunk-LNGE3PJU-5nWSl6jJ.js +34 -0
  142. package/dist/client/assets/chunk-MBY4JIJT-DTJ4UcAm.js +8 -0
  143. package/dist/client/assets/chunk-NETBCI7D-CmUwDWUZ.js +1 -0
  144. package/dist/client/assets/chunk-O7XYJQB3-D0_ZY2za.js +126 -0
  145. package/dist/client/assets/chunk-OSK3NFVY-DqeKV_pg.js +10 -0
  146. package/dist/client/assets/{chunk-OUJLGHUK-D0j2JRSg.js → chunk-OUJLGHUK-75UXlPjl.js} +1 -1
  147. package/dist/client/assets/chunk-OUJLGHUK-DA95-S9B.js +2 -0
  148. package/dist/client/assets/{chunk-P2QGCYS3-Oag_FdCq.js → chunk-P2QGCYS3-BA--DhpW.js} +1 -1
  149. package/dist/client/assets/chunk-POPQ4Y6H-V_NEc45n.js +1 -0
  150. package/dist/client/assets/chunk-PWAF6VOD-D_kLse-N.js +1 -0
  151. package/dist/client/assets/{chunk-FLYJHZSQ-Be7lKF17.js → chunk-RUX4WMZV-BGnd3s_C.js} +4 -4
  152. package/dist/client/assets/{chunk-SHT3W25Y-BiQGljao.js → chunk-SHT3W25Y-YM3S-A_M.js} +5 -5
  153. package/dist/client/assets/chunk-SVP7TREG-DdNhDOmW.js +88 -0
  154. package/dist/client/assets/{chunk-TICWLB2K-8rAVvoS3.js → chunk-TICWLB2K-BGGgCr4x.js} +3 -3
  155. package/dist/client/assets/chunk-TLUHSLCS-DCZhIDYA.js +1 -0
  156. package/dist/client/assets/chunk-UA2S7LBM-DicYDjDM.js +1 -0
  157. package/dist/client/assets/{chunk-UY3FDG6J-CnmaAkG5.js → chunk-UY3FDG6J-DqSM_0FB.js} +1 -1
  158. package/dist/client/assets/chunk-UY3FDG6J-QT-rkt0y.js +1 -0
  159. package/dist/client/assets/chunk-WEXAMYUT-DDlVNp8J.js +1 -0
  160. package/dist/client/assets/chunk-X3CZISLH-BixgQztF.js +1 -0
  161. package/dist/client/assets/chunk-X3CZISLH-DwWpRaN8.js +1 -0
  162. package/dist/client/assets/{chunk-XHIXRSVI-BFQ6B8BE.js → chunk-XHIXRSVI-BSN7JlfK.js} +1 -1
  163. package/dist/client/assets/chunk-XHIXRSVI-DN_fEwws.js +1 -0
  164. package/dist/client/assets/chunk-XXDRQBXY-C7hQHDmQ.js +1 -0
  165. package/dist/client/assets/{chunk-XXDRQBXY-BvKO0v-W.js → chunk-XXDRQBXY-CdRN9Akd.js} +1 -1
  166. package/dist/client/assets/chunk-Y2CYZVJY-BbRBGnmc.js +1 -0
  167. package/dist/client/assets/chunk-Z7XXMR3K-P4Vaq8hD.js +10 -0
  168. package/dist/client/assets/chunk-ZIGJFQKS-b8OUHKK5.js +2 -0
  169. package/dist/client/assets/classDiagram-ZZMXUADV-QLbh_Nkf.js +1 -0
  170. package/dist/client/assets/classDiagram-v2-NBCMYWYE-3TQORq33.js +217 -0
  171. package/dist/client/assets/classDiagram-v2-VYDZK3BY-QLbh_Nkf.js +1 -0
  172. package/dist/client/assets/clone-C1hp9FUh.js +1 -0
  173. package/dist/client/assets/comment-markdown-renderer-Bxi_JRSR.js +1 -0
  174. package/dist/client/assets/comment-thread-store-CHvy8GF8.js +1 -0
  175. package/dist/client/assets/comment-threads-nJhK1yfc.js +4 -0
  176. package/dist/client/assets/cose-bilkent-JH36ORCC-Czr0rwGr.js +1 -0
  177. package/dist/client/assets/cose-bilkent-JH36ORCC-DLmEf9HS.js +1 -0
  178. package/dist/client/assets/cs-CZ-VUCGPRML-BfCoYAgj.js +7 -0
  179. package/dist/client/assets/cynefin-OW5HDTMX-CF3N9j1_.js +1 -0
  180. package/dist/client/assets/cynefin-OW5HDTMX-e-Quc9Yl.js +1 -0
  181. package/dist/client/assets/cynefinDiagram-5FMLGOSQ-DTnLZaO7.js +62 -0
  182. package/dist/client/assets/cynefinDiagram-VND7K2PF-DwfMZ3vk.js +62 -0
  183. package/dist/client/assets/cytoscape-cose-bilkent-NdTYBUiT.js +1 -0
  184. package/dist/client/assets/cytoscape-fcose-DE9_QRG_.js +1 -0
  185. package/dist/client/assets/cytoscape.esm-EK2DW5Qr.js +321 -0
  186. package/dist/client/assets/da-DK-NNDP2IVP-DBw9ZNTR.js +2 -0
  187. package/dist/client/assets/dagre-6A5THRUB-DewyAGK6.js +4 -0
  188. package/dist/client/assets/dagre-D7FiCLLP.js +1 -0
  189. package/dist/client/assets/{dagre-GXQ25YYZ-Cr67wLpQ.js → dagre-GXQ25YYZ-Vtyx08Qh.js} +2 -2
  190. package/dist/client/assets/de-CH-I7RAVIZN-DYW18Vsr.js +11 -0
  191. package/dist/client/assets/de-DE-WBQ3DQLR-DYW18Vsr.js +11 -0
  192. package/dist/client/assets/deferred-collab-D4cxEdad.css +1 -0
  193. package/dist/client/assets/deferred-git-BHKtkFYi.css +1 -0
  194. package/dist/client/assets/deferred-preview-BAXYgf4T.css +1 -0
  195. package/dist/client/assets/diagram-22UHCM2B-DbZirFfl.js +200 -0
  196. package/dist/client/assets/diagram-3UASUU5V-DmhdYv6_.js +24 -0
  197. package/dist/client/assets/diagram-ATOU4E4O-B5uX-jVO.js +3 -0
  198. package/dist/client/assets/diagram-CDSNMT55-D_qyS11R.js +30 -0
  199. package/dist/client/assets/diagram-MLGK6HIB-DIBG6Ivu.js +24 -0
  200. package/dist/client/assets/diagram-MPIPVDR6-D9XsALDV.js +41 -0
  201. package/dist/client/assets/{diagram-S7CK7UJ4-DywERe__.js → diagram-S7CK7UJ4-CGTzfo2f.js} +3 -3
  202. package/dist/client/assets/diagram-UQ7AKVKN-CWZS8QtB.js +41 -0
  203. package/dist/client/assets/{diagram-VSXAHHWV-0H1a61Bn.js → diagram-VSXAHHWV-DaO1nOZF.js} +3 -3
  204. package/dist/client/assets/diagram-VX7I27RA-B54P6Cyf.js +24 -0
  205. package/dist/client/assets/diagram-Z3DM3KII-Cl2EXiXp.js +24 -0
  206. package/dist/client/assets/direct-engine-DdrQKpgq-4QysbH_V.js +5 -0
  207. package/dist/client/assets/dist-B7fBbwrO.js +1 -0
  208. package/dist/client/assets/{dist-DGEbEfw4.js → dist-BVCNc-Es.js} +1 -1
  209. package/dist/client/assets/dist-BYBF4LtZ.js +1 -0
  210. package/dist/client/assets/{dist-TW8iFRyW.js → dist-B_1hMrc6.js} +1 -1
  211. package/dist/client/assets/{dist-DVy5woUy.js → dist-BfpAc922.js} +1 -1
  212. package/dist/client/assets/dist-BnVaoRgZ.js +1 -0
  213. package/dist/client/assets/dist-Bog8M5U3.js +13 -0
  214. package/dist/client/assets/{dist-jVU5Be5P.js → dist-CAG5sIOj.js} +1 -1
  215. package/dist/client/assets/{dist-LQ4kDCKz.js → dist-CKf7LlAo.js} +1 -1
  216. package/dist/client/assets/{dist-BeajGMhO.js → dist-CUsXdnU4.js} +1 -1
  217. package/dist/client/assets/{dist-Tw-Fxpeb.js → dist-CXOUa90Q.js} +1 -1
  218. package/dist/client/assets/dist-CYMCikZo.js +1 -0
  219. package/dist/client/assets/dist-CYfPeupF.js +1 -0
  220. package/dist/client/assets/dist-Ch6Sr9KF.js +28 -0
  221. package/dist/client/assets/dist-Ck-B8onw.js +2 -0
  222. package/dist/client/assets/dist-CrkYYcOU.js +1 -0
  223. package/dist/client/assets/{dist-D5wCC32z.js → dist-CsQTfQFi.js} +1 -1
  224. package/dist/client/assets/dist-Cu5Ze2cs.js +6 -0
  225. package/dist/client/assets/{dist-C5NgpdG5.js → dist-CvVoyTRF.js} +1 -1
  226. package/dist/client/assets/{dist-GvvCNBe4.js → dist-D4kDR0g8.js} +1 -1
  227. package/dist/client/assets/dist-D8LnhZzy.js +1 -0
  228. package/dist/client/assets/{dist-D3fehAZ2.js → dist-DGa-2MNX.js} +2 -2
  229. package/dist/client/assets/dist-DI6c02Da.js +39 -0
  230. package/dist/client/assets/{dist-BPHLJ09L.js → dist-DNONgI1P.js} +2 -2
  231. package/dist/client/assets/{dist-C0G3AaXG.js → dist-DVBYH83t.js} +1 -1
  232. package/dist/client/assets/dist-DX6qtdxv.js +1 -0
  233. package/dist/client/assets/{dist-DzNmC81X.js → dist-Da-jLrCf.js} +1 -1
  234. package/dist/client/assets/dist-DofvCYzJ.js +1 -0
  235. package/dist/client/assets/{dist-CdmKGRGr.js → dist-Dx37MHWs.js} +1 -1
  236. package/dist/client/assets/dist-GTGhtpyW.js +9 -0
  237. package/dist/client/assets/{dist-BK9QvQrc.js → dist-W0FoeIxk.js} +9 -9
  238. package/dist/client/assets/{dist-mj2Ht75J.js → dist-Y6zYRI-A.js} +1 -1
  239. package/dist/client/assets/{dist-netZOQtD.js → dist-jVKfryIL.js} +1 -1
  240. package/dist/client/assets/{dist-DuH3ZrHo.js → dist-zHDLm1oE.js} +1 -1
  241. package/dist/client/assets/document-formatter-gO8qM2qY.js +1 -0
  242. package/dist/client/assets/drawioEditor-DCkWweiy.js +9 -0
  243. package/dist/client/assets/duration-BiuFXtXd.js +1 -0
  244. package/dist/client/assets/ebnfDiagram-PWID7BFC-PfC84FyI.js +1 -0
  245. package/dist/client/assets/ebnfDiagram-ZINNZB2B-DYvm_QtE.js +1 -0
  246. package/dist/client/assets/editor-session-DxRyr4EM.js +14 -0
  247. package/dist/client/assets/el-GR-TYQHVGXW-Dx82YYAS.js +7 -0
  248. package/dist/client/assets/elk-276RUBZZ-B8LB3Pac.js +27 -0
  249. package/dist/client/assets/embedded-editor-base-elU0Avik.css +1 -0
  250. package/dist/client/assets/{embedpdf-DA4bA119-BPqZxwjc.js → embedpdf-DA4bA119-DsoNiPlQ.js} +4 -5
  251. package/dist/client/assets/{embedpdf-BmE13ZZ0.js → embedpdf-DyOonRvx.js} +1 -1
  252. package/dist/client/assets/{en-SJ2YIMFF-CJBL3nkq.js → en-GNC3RJIS-CEy_oGTd.js} +1 -1
  253. package/dist/client/assets/erDiagram-OPXOYQCR-o8GRv8A_.js +99 -0
  254. package/dist/client/assets/{erDiagram-RLTQ6QDP-CbrDdd5P.js → erDiagram-RLTQ6QDP-C9cJl5NB.js} +2 -2
  255. package/dist/client/assets/es-ES-JEUOREKJ-Rx0NUQDl.js +12 -0
  256. package/dist/client/assets/esm-BzZ1JFVo.js +65 -0
  257. package/dist/client/assets/{estree-CuT_pB8K.js → estree-DCT3Jm65.js} +4 -4
  258. package/dist/client/assets/eu-ES-SO5DEEAN-CDYm-BcK.js +8 -0
  259. package/dist/client/assets/eventmodeling-NTZA5JFV-CDy1bN6j.js +1 -0
  260. package/dist/client/assets/eventmodeling-NTZA5JFV-Dxtv5D-P.js +1 -0
  261. package/dist/client/assets/excalidraw-element-link-CGZ5934B.js +7 -0
  262. package/dist/client/assets/{excalidrawEditor-BbSbI80a.css → excalidrawEditor-BCTFp_CV.css} +1 -1
  263. package/dist/client/assets/excalidrawEditor-BVfSxjSO.js +9 -0
  264. package/dist/client/assets/export-page-BCo_e15t.js +46 -0
  265. package/dist/client/assets/exportDocument-Ba-n1X4U.css +1 -0
  266. package/dist/client/assets/exportDocument-DP6oE_or.js +2 -0
  267. package/dist/client/assets/fa-IR-I4JNTJHK-CFtHZqoT.js +9 -0
  268. package/dist/client/assets/fi-FI-REAEF6HQ-BIpjJqIb.js +6 -0
  269. package/dist/client/assets/file-search-3hYF4cYa.js +1 -0
  270. package/dist/client/assets/flowDiagram-HODETNUW-Bq4470NR.js +1 -0
  271. package/dist/client/assets/flowDiagram-KWPJA3E3-DQG9qGiU.js +1 -0
  272. package/dist/client/assets/forth-D6RzAl64.js +1 -0
  273. package/dist/client/assets/fr-FR-SUCL7J6B-DGAKE8jH.js +12 -0
  274. package/dist/client/assets/ganttDiagram-EL5Y4UJY-x40PW0Ah.js +292 -0
  275. package/dist/client/assets/ganttDiagram-FUAMR5RP-BQpsI7gQ.js +292 -0
  276. package/dist/client/assets/gitGraph-4MIJSDKK-B-rpDYbz.js +1 -0
  277. package/dist/client/assets/gitGraph-4MIJSDKK-ZaBIE4Lb.js +1 -0
  278. package/dist/client/assets/gitGraphDiagram-WWUBYQGX-ahsNaZsp.js +106 -0
  279. package/dist/client/assets/gitGraphDiagram-X574FWY7-wbs_2m9f.js +106 -0
  280. package/dist/client/assets/gl-ES-KHCSOGVH-DWKh0CMu.js +6 -0
  281. package/dist/client/assets/graphlib-C9Tl7QrK.js +1 -0
  282. package/dist/client/assets/he-IL-JYXVXV2Q-zqbcM-4g.js +9 -0
  283. package/dist/client/assets/hi-IN-BU52H3BO-CY8v6eG9.js +3 -0
  284. package/dist/client/assets/highlight-theme-CzNkO-IJ.js +1 -0
  285. package/dist/client/assets/{html-Cdnr2qzU.js → html-CBXMuS97.js} +2 -2
  286. package/dist/client/assets/html-DTuc_pxj.js +1 -0
  287. package/dist/client/assets/hu-HU-OWADXDQ3-CEl6Udfh.js +3 -0
  288. package/dist/client/assets/id-ID-2WY7E4VX-CCAeQpPr.js +8 -0
  289. package/dist/client/assets/image-EJJKRVD3-BQfi5nWJ.js +1 -0
  290. package/dist/client/assets/{image-blob-reduce.esm-Dj7YBvMv.js → image-blob-reduce.esm-BFq-Mx5V.js} +2 -2
  291. package/dist/client/assets/index-BxAuGDoN.css +1 -0
  292. package/dist/client/assets/index-uw9O0z1c.js +1112 -0
  293. package/dist/client/assets/info-A6RAGUB7-BcGxhjED.js +1 -0
  294. package/dist/client/assets/info-A6RAGUB7-BlutK7BT.js +1 -0
  295. package/dist/client/assets/infoDiagram-27XIBGKW-MrZyptIy.js +2 -0
  296. package/dist/client/assets/infoDiagram-VRGFBTTK-KkUjDRAQ.js +2 -0
  297. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-BMPC6hfp.js → ishikawaDiagram-5VMMS53U-Bnt9yM0O.js} +2 -2
  298. package/dist/client/assets/ishikawaDiagram-OU5B5YK6-Di9BcpOY.js +70 -0
  299. package/dist/client/assets/it-IT-INVHSAJF-DytAgndh.js +12 -0
  300. package/dist/client/assets/ja-JP-JBNTKYP4-BflWlGhw.js +12 -0
  301. package/dist/client/assets/javascript-B9I2pbsP.js +1 -0
  302. package/dist/client/assets/javascript-DctB8BJo.js +1 -0
  303. package/dist/client/assets/{journeyDiagram-3NMN7TZE-B1sApUmM.js → journeyDiagram-3NMN7TZE-Bl0abK1r.js} +1 -1
  304. package/dist/client/assets/journeyDiagram-ZHPQQLJL-J-sGrs9e.js +139 -0
  305. package/dist/client/assets/jsx-runtime-DKj5X9O4.js +1 -0
  306. package/dist/client/assets/kaa-TC3VIB7V-B-xtZfy0.js +1 -0
  307. package/dist/client/assets/kab-KAB-UOUDSQKM-BmO0O4Y4.js +4 -0
  308. package/dist/client/assets/kanban-definition-PNTS6WVX-5ZDV_yIa.js +89 -0
  309. package/dist/client/assets/{kanban-definition-UXKFOSKX-C9yP4td1.js → kanban-definition-UXKFOSKX-DMgUfNt0.js} +10 -10
  310. package/dist/client/assets/{katex-CXMH3UgJ.js → katex-9NBMfU68.js} +2 -2
  311. package/dist/client/assets/katex-ZlcWpGUi.js +257 -0
  312. package/dist/client/assets/kk-KZ-P5H2X7YS-CSQFB8IN.js +1 -0
  313. package/dist/client/assets/{km-KH-PCWDKPHP-DSmy5shj.js → km-KH-IHMV2US7-BxrjuEzr.js} +4 -4
  314. package/dist/client/assets/ko-KR-ZTMANIDF-BnNRXd5J.js +5 -0
  315. package/dist/client/assets/ku-TR-GPJTRB5G-BZM7f2aT.js +6 -0
  316. package/dist/client/assets/line-DEbP8Ok6.js +1 -0
  317. package/dist/client/assets/linear-DExL6ILt.js +1 -0
  318. package/dist/client/assets/lobby-presence-Cz5jGOPg.js +1 -0
  319. package/dist/client/assets/lt-LT-V3XDOK3P-MVQBOHmF.js +3 -0
  320. package/dist/client/assets/{lua-CL1SqxuB.js → lua-zbJo2mq3.js} +1 -1
  321. package/dist/client/assets/lv-LV-DVQ3FADO-CrenwAhS.js +4 -0
  322. package/dist/client/assets/{markdown-CByV-4CU.js → markdown-Bo71X2X2.js} +8 -8
  323. package/dist/client/assets/markdown-it-DpvIRaVq.js +13 -0
  324. package/dist/client/assets/markdown-math-CyyBVuDO.js +517 -0
  325. package/dist/client/assets/merge-CALoRt3l.js +1 -0
  326. package/dist/client/assets/mermaid-parser.core-Bpogunsh.js +3 -0
  327. package/dist/client/assets/mermaid-parser.core-DBy--Jc0.js +3 -0
  328. package/dist/client/assets/mermaid.core-BeOUPE3Q.js +10 -0
  329. package/dist/client/assets/mindmap-definition-NLK3R4M7-ByVb-0vj.js +96 -0
  330. package/dist/client/assets/{mindmap-definition-YA3MSWOX-BUQHcYbK.js → mindmap-definition-YA3MSWOX-DBZN5_GH.js} +29 -29
  331. package/dist/client/assets/mr-IN-VZ6HH5FE-B-PHPglH.js +9 -0
  332. package/dist/client/assets/my-MM-XYKWHRK6-Be5sYp5q.js +1 -0
  333. package/dist/client/assets/nb-NO-UNO2GGZJ-BvSKGdja.js +8 -0
  334. package/dist/client/assets/{nginx-BMaDbqW3.js → nginx-8H7HVH4w.js} +1 -1
  335. package/dist/client/assets/nl-NL-76EFHT4P-C2yNx1Cj.js +13 -0
  336. package/dist/client/assets/nn-NO-CFKD7ABE-4NsqlDRP.js +4 -0
  337. package/dist/client/assets/oc-FR-YBJTCJ3J-B4OTQsWW.js +4 -0
  338. package/dist/client/assets/pa-IN-SNOXSMRV-CKj_sOG7.js +4 -0
  339. package/dist/client/assets/packet-AYTQ26CC-CqpSjTWl.js +1 -0
  340. package/dist/client/assets/packet-AYTQ26CC-DvbY8dI6.js +1 -0
  341. package/dist/client/assets/pegDiagram-GJSIUBJH-aost1sSO.js +1 -0
  342. package/dist/client/assets/pegDiagram-XKGWAZYB-DRo8CZu3.js +1 -0
  343. package/dist/client/assets/percentages-LWOC67ZH-VhvllE7L.js +1 -0
  344. package/dist/client/assets/{pica-xkWDouSg.js → pica-BPrp-GK1.js} +1 -1
  345. package/dist/client/assets/pie-DzWLGKAD.js +1 -0
  346. package/dist/client/assets/pie-WAS4IAKB-Bg2eCNl5.js +1 -0
  347. package/dist/client/assets/pie-WAS4IAKB-DWSm9SSD.js +1 -0
  348. package/dist/client/assets/pieDiagram-5QR66LMP-BICdpEuz.js +39 -0
  349. package/dist/client/assets/pieDiagram-E7YTZNPT-CZThaHsc.js +39 -0
  350. package/dist/client/assets/pl-PL-BSY6YFZ3-CFuzA6L0.js +12 -0
  351. package/dist/client/assets/preload-helper-BAlEavIC.js +1 -0
  352. package/dist/client/assets/preview-render-compiler-ktU0SXxY.js +43 -0
  353. package/dist/client/assets/preview-render-profile-D652PAjA.js +1 -0
  354. package/dist/client/assets/preview-render-worker-BI2bFVqM.js +575 -0
  355. package/dist/client/assets/prod-DU-0VfI7.js +145 -0
  356. package/dist/client/assets/prod-cXUNdmYV.js +1 -0
  357. package/dist/client/assets/pt-BR-CZDV62R3-CkPMtyNx.js +10 -0
  358. package/dist/client/assets/pt-PT-JO57XJJW-CBSnfGtF.js +12 -0
  359. package/dist/client/assets/{pug-Wky5Dnfy.js → pug-CqqUmdG7.js} +1 -1
  360. package/dist/client/assets/purify.es-go7v6Te-.js +3 -0
  361. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-DwexhEhd.js → quadrantDiagram-AXDQQJYC-C5iowkl_.js} +3 -3
  362. package/dist/client/assets/quadrantDiagram-O4NWA36T-Bgx5bF97.js +7 -0
  363. package/dist/client/assets/quick-switcher-De4PjZFC.css +1 -0
  364. package/dist/client/assets/quick-switcher-controller-DSlOwOsU.js +1 -0
  365. package/dist/client/assets/radar-RG4KPBEZ-BfNQUEQy.js +1 -0
  366. package/dist/client/assets/radar-RG4KPBEZ-DxExotg6.js +1 -0
  367. package/dist/client/assets/railroad-74A4TZTK-BaQ6U6eJ.js +1 -0
  368. package/dist/client/assets/railroad-74A4TZTK-FfHmeIQk.js +1 -0
  369. package/dist/client/assets/railroad-abnf-HS5TGJTU-BJ3KZw7J.js +1 -0
  370. package/dist/client/assets/railroad-abnf-HS5TGJTU-CLkdDRsJ.js +1 -0
  371. package/dist/client/assets/railroad-ebnf-LZEXJU2U-B162zvcG.js +1 -0
  372. package/dist/client/assets/railroad-ebnf-LZEXJU2U-DA0sEq7w.js +1 -0
  373. package/dist/client/assets/railroad-peg-WCYAUIDC-CGs5GeJ5.js +1 -0
  374. package/dist/client/assets/railroad-peg-WCYAUIDC-DCmlICzO.js +1 -0
  375. package/dist/client/assets/railroadDiagram-O6MQD6OU-BTt_rKjT.js +1 -0
  376. package/dist/client/assets/railroadDiagram-XR7U4H2S-DbVoNgSz.js +1 -0
  377. package/dist/client/assets/{requirementDiagram-BXWQKSXE-C4cKwiIw.js → requirementDiagram-BXWQKSXE-BkvazG7r.js} +1 -1
  378. package/dist/client/assets/requirementDiagram-PLB6GJNP-BT0j9C40.js +84 -0
  379. package/dist/client/assets/ro-RO-UZ5ICYYN-BOuntc_r.js +12 -0
  380. package/dist/client/assets/room-DX7lIfnu.js +1 -0
  381. package/dist/client/assets/ru-RU-AN7JPREC-D-ow3SNR.js +10 -0
  382. package/dist/client/assets/runtime-config-BFVdhnJu.js +1 -0
  383. package/dist/client/assets/runtime-paths-Cn0snt_9.js +1 -0
  384. package/dist/client/assets/sankeyDiagram-IPEJSGJF-X1BCUIrf.js +40 -0
  385. package/dist/client/assets/sankeyDiagram-P5KCCOFB-C_IemB9h.js +40 -0
  386. package/dist/client/assets/sankeyLinkHorizontal-usjP1-Cg.js +1 -0
  387. package/dist/client/assets/sequenceDiagram-PO4LG4MO-B-2QfXhV.js +169 -0
  388. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-BX6jqJFD.js → sequenceDiagram-WJ2MYXX4-CxFBgLGd.js} +3 -3
  389. package/dist/client/assets/si-LK-7CBLD6QQ-c91EepX0.js +1 -0
  390. package/dist/client/assets/{sieve-BAxa3IjF.js → sieve-tLWDfEkZ.js} +1 -1
  391. package/dist/client/assets/sizeCapture-INFHLROL-B0uUizjq.js +1 -1
  392. package/dist/client/assets/sizeCapture-INFHLROL-DrzwYt5z.js +1 -0
  393. package/dist/client/assets/sk-SK-SWR6DKBI-D5vFMIL6.js +7 -0
  394. package/dist/client/assets/sl-SI-QY5KCFGA-RZhwMpQL.js +8 -0
  395. package/dist/client/assets/solr-B78wSQJQ.js +1 -0
  396. package/dist/client/assets/src-XiVvaevx.js +1 -0
  397. package/dist/client/assets/stateDiagram-D77RDMKH-BaSQ6Owj.js +1 -0
  398. package/dist/client/assets/stateDiagram-v2-GCMORJYK-CsVcfwVp.js +291 -0
  399. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-CLlwrdvU.js +1 -0
  400. package/dist/client/assets/sv-SE-O3OFCY3J-DnS86_7q.js +12 -0
  401. package/dist/client/assets/swimlanes-2SLR337P-CnYTVqRX.js +1 -0
  402. package/dist/client/assets/swimlanes-42K2YHIH-CALFEmiS.js +1 -0
  403. package/dist/client/assets/swimlanesDiagram-TC7HE7FX-Bh4tmz27.js +8 -0
  404. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-xhehUG9e.js +8 -0
  405. package/dist/client/assets/ta-IN-V6NHHU6Z-D5jy7_AE.js +6 -0
  406. package/dist/client/assets/th-TH-WLSZUSBX-DHehoYR2.js +1 -0
  407. package/dist/client/assets/{timeline-definition-24CTP7MA-BA-lVH6P.js → timeline-definition-24CTP7MA-zse-5Dbm.js} +5 -5
  408. package/dist/client/assets/timeline-definition-EJHVYXUP-BhqPlKkN.js +120 -0
  409. package/dist/client/assets/tr-TR-GUFYG22B-ClVaf8h1.js +4 -0
  410. package/dist/client/assets/treeView-Q6P3EWNA-BvHOzbu9.js +1 -0
  411. package/dist/client/assets/treeView-Q6P3EWNA-Cccy0ngL.js +1 -0
  412. package/dist/client/assets/treemap-CxZTjHiH.js +1 -0
  413. package/dist/client/assets/treemap-WGGIJYW6-oety7paS.js +1 -0
  414. package/dist/client/assets/treemap-WGGIJYW6-sMRCjCtX.js +1 -0
  415. package/dist/client/assets/uk-UA-K6SV5NFQ-BLTTtyNB.js +6 -0
  416. package/dist/client/assets/usecaseDiagram-POWQR4AR-DR2LHQYs.js +328 -0
  417. package/dist/client/assets/uz-UZ-TVKTZO2G-Bm02Eg3D.js +1 -0
  418. package/dist/client/assets/v4-DDdyfk2q.js +1 -0
  419. package/dist/client/assets/vault-api-client-BQxLVPeF.js +7 -0
  420. package/dist/client/assets/vault-paths-BT-6nztu.js +1 -0
  421. package/dist/client/assets/vault-utils-Bct69Xw2.js +1 -0
  422. package/dist/client/assets/venn.esm-C5rDfA9t.js +7 -0
  423. package/dist/client/assets/vennDiagram-4TSXK5OY-DgHr6cJD.js +28 -0
  424. package/dist/client/assets/vennDiagram-UO4OBE2U-BRwLn2Q1.js +28 -0
  425. package/dist/client/assets/{verilog-7LoJAqYT.js → verilog-CjI9Y6RI.js} +1 -1
  426. package/dist/client/assets/vi-VN-7FKFXJNO-CL3WPhmG.js +7 -0
  427. package/dist/client/assets/wardley-WFR3VGLG-BdwDpX_I.js +1 -0
  428. package/dist/client/assets/wardley-WFR3VGLG-Y7xty_3m.js +1 -0
  429. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-C2oY-YbF.js → wardleyDiagram-VM6X3IG4-9A60XZis.js} +3 -3
  430. package/dist/client/assets/wardleyDiagram-VNRHLVJA-B_tMcVFG.js +78 -0
  431. package/dist/client/assets/wiki-link-resolver-Dch88erO.js +1 -0
  432. package/dist/client/assets/{worker-engine-m0rlHn8R-S8mpn_O0.js → worker-engine-m0rlHn8R-5h66k403.js} +1 -1
  433. package/dist/client/assets/workspace-change-CVA9dVmy.js +1 -0
  434. package/dist/client/assets/workspace-sync-client-C2pdaQUN.js +1 -0
  435. package/dist/client/assets/xychartDiagram-PMCCYNJV-fRpZ1MA5.js +7 -0
  436. package/dist/client/assets/xychartDiagram-S5SC5T6Z-D00iy-wB.js +7 -0
  437. package/dist/client/assets/{yaml-9ltHPDNO.js → yaml-BcZaqAz8.js} +1 -1
  438. package/dist/client/assets/yjs-B41tM6Sz.js +4 -0
  439. package/dist/client/assets/yjs-provider-reset-guard-DpntzUDR.js +1 -0
  440. package/dist/client/assets/zh-CN-AOKVLNNK-DGidDH2b.js +11 -0
  441. package/dist/client/assets/zh-HK-CDKPF5DC-CRcNR3rk.js +1 -0
  442. package/dist/client/assets/zh-TW-ZVGYESGW-C7Qji1y6.js +13 -0
  443. package/dist/client/drawio-editor.html +9 -9
  444. package/dist/client/excalidraw-editor.html +43 -38
  445. package/dist/client/export-document.html +6 -7
  446. package/dist/client/index.html +49 -38
  447. package/package.json +23 -26
  448. package/src/client/app/drawio-editor.html +2 -1
  449. package/src/client/app/excalidraw-editor.html +2 -1
  450. package/src/client/app/export-document-entry.js +1 -0
  451. package/src/client/app/export-document.html +2 -1
  452. package/src/client/app/index.html +47 -16
  453. package/src/client/app/main-entry.js +1 -19
  454. package/src/client/application/app-shell/comments-feature.js +6 -0
  455. package/src/client/application/app-shell/ui-feature-shell.js +156 -59
  456. package/src/client/application/app-shell/ui-feature-tab-activity.js +8 -3
  457. package/src/client/application/app-shell-elements.js +7 -0
  458. package/src/client/application/diagram-preview-hydrator.js +7 -0
  459. package/src/client/application/highlight-theme.js +16 -0
  460. package/src/client/application/mermaid-preview-hydrator.js +89 -3
  461. package/src/client/application/preview-diagram-utils.js +1 -0
  462. package/src/client/application/preview-render-compiler.js +45 -20
  463. package/src/client/application/preview-render-executor.js +4 -27
  464. package/src/client/application/preview-render-profile.js +8 -12
  465. package/src/client/application/preview-renderer.js +27 -7
  466. package/src/client/application/workspace-coordinator.js +20 -21
  467. package/src/client/bootstrap/collabmd-app-shell.js +87 -42
  468. package/src/client/bootstrap/lazy-collab-clients.js +90 -0
  469. package/src/client/browser-utils.js +1 -1
  470. package/src/client/domain/excalidraw-scene-reconcile.js +5 -2
  471. package/src/client/domain/excalidraw-scene.js +0 -11
  472. package/src/client/domain/file-search.js +1 -0
  473. package/src/client/domain/hash-routes.js +5 -0
  474. package/src/client/domain/highlight-runtime.js +74 -0
  475. package/src/client/domain/lobby-chat.js +2 -0
  476. package/src/client/domain/markdown-math.js +14 -0
  477. package/src/client/domain/runtime-paths.js +56 -7
  478. package/src/client/domain/vault-utils.js +11 -0
  479. package/src/client/excalidraw-editor.js +20 -4
  480. package/src/client/export/export-host.js +3 -7
  481. package/src/client/export/export-pipeline.js +208 -21
  482. package/src/client/infrastructure/auth-client.js +1 -2
  483. package/src/client/infrastructure/browser-preferences-port.js +24 -0
  484. package/src/client/infrastructure/editor-session.js +20 -0
  485. package/src/client/infrastructure/editor-view-adapter.js +51 -15
  486. package/src/client/infrastructure/excalidraw-room-client.js +11 -46
  487. package/src/client/infrastructure/git-api-client.js +5 -0
  488. package/src/client/infrastructure/hosted-api-client.js +60 -0
  489. package/src/client/infrastructure/lobby-presence.js +2 -2
  490. package/src/client/infrastructure/runtime-config.js +3 -1
  491. package/src/client/infrastructure/tab-activity-lock.js +8 -4
  492. package/src/client/infrastructure/webmcp-tool-registry.js +27 -6
  493. package/src/client/presentation/bases-preview-controller.js +2 -1
  494. package/src/client/presentation/comment-markdown-renderer.js +4 -14
  495. package/src/client/presentation/comment-overview-controller.js +1 -2
  496. package/src/client/presentation/comment-ui/comment-ui-shared.js +5 -2
  497. package/src/client/presentation/comment-ui-controller.js +21 -30
  498. package/src/client/presentation/create-menu-presenter.js +16 -18
  499. package/src/client/presentation/drawio-embed-controller.js +55 -7
  500. package/src/client/presentation/excalidraw-embed-controller.js +11 -3
  501. package/src/client/presentation/file-explorer-controller.js +4 -0
  502. package/src/client/presentation/file-explorer-view.js +304 -176
  503. package/src/client/presentation/file-history-view-controller.js +6 -0
  504. package/src/client/presentation/git-diff-view-controller.js +3 -2
  505. package/src/client/presentation/git-panel-controller.js +7 -6
  506. package/src/client/presentation/hosted-workspace-gate-controller.js +180 -0
  507. package/src/client/presentation/image-lightbox-controller.js +7 -6
  508. package/src/client/presentation/layout-controller.js +10 -1
  509. package/src/client/presentation/outline-controller.js +0 -86
  510. package/src/client/presentation/quick-switcher-controller.js +50 -13
  511. package/src/client/presentation/scroll-sync-controller.js +69 -21
  512. package/src/client/presentation/team-settings-controller.js +228 -0
  513. package/src/client/styles/components/navigation.css +2 -2
  514. package/src/client/styles/deferred-collab.css +6 -0
  515. package/src/client/styles/deferred-git.css +7 -0
  516. package/src/client/styles/deferred-preview.css +7 -0
  517. package/src/client/styles/features/diagram-preview.css +1 -15
  518. package/src/client/styles/features/outline.css +4 -2
  519. package/src/client/styles/features/preview-markdown.css +29 -15
  520. package/src/client/styles/features/team-settings.css +162 -0
  521. package/src/client/styles/foundation/themes.css +56 -271
  522. package/src/client/styles/foundation/tokens.css +2 -2
  523. package/src/client/styles/layout/editor-page.css +0 -14
  524. package/src/client/styles/layout/overlays.css +16 -0
  525. package/src/client/styles/layout/responsive.css +5 -5
  526. package/src/client/styles/layout/shell.css +26 -1
  527. package/src/client/styles/layout/sidebar.css +95 -3
  528. package/src/client/styles/style.css +3 -19
  529. package/src/client/styles/surfaces/landing-page.css +260 -0
  530. package/src/domain/agent-tool-definitions.js +182 -74
  531. package/src/domain/collabmd-content-capabilities.js +62 -7
  532. package/src/domain/collaboration-protocol.js +2 -0
  533. package/src/domain/excalidraw-agent-scene.js +108 -6
  534. package/src/domain/excalidraw-agent-verification.js +95 -1
  535. package/src/domain/excalidraw-room-codec.js +12 -1
  536. package/src/domain/literal-text-search.js +13 -0
  537. package/src/domain/markdown-outline.js +35 -0
  538. package/src/server/application/agent-connection-service.js +6 -2
  539. package/src/server/application/agent-content-service.js +250 -114
  540. package/src/server/auth/create-auth-service.js +40 -12
  541. package/src/server/auth/session-cookie.js +49 -38
  542. package/src/server/config/env.js +97 -6
  543. package/src/server/create-app-server.js +23 -153
  544. package/src/server/domain/backlink-index.js +1 -11
  545. package/src/server/domain/bases/base-query-results.js +7 -3
  546. package/src/server/domain/bases/base-query-service.js +2 -7
  547. package/src/server/domain/collaboration/collaboration-room.js +54 -16
  548. package/src/server/domain/docx-exporter.js +256 -2
  549. package/src/server/domain/hosted-workspace-contract.js +7 -0
  550. package/src/server/domain/hosted-workspace.js +39 -63
  551. package/src/server/domain/ripgrep-search-service.js +97 -34
  552. package/src/server/infrastructure/git/diff-service.js +15 -11
  553. package/src/server/infrastructure/git/git-service.js +4 -0
  554. package/src/server/infrastructure/git/image-mime.js +4 -3
  555. package/src/server/infrastructure/git/local-exclude.js +13 -1
  556. package/src/server/infrastructure/git/status-service.js +10 -6
  557. package/src/server/infrastructure/http/create-agent-api-handler.js +1 -1
  558. package/src/server/infrastructure/http/create-git-api-query-handler.js +25 -0
  559. package/src/server/infrastructure/http/create-hosted-api-handler.js +5 -0
  560. package/src/server/infrastructure/http/create-request-handler.js +95 -26
  561. package/src/server/infrastructure/http/create-static-handler.js +3 -0
  562. package/src/server/infrastructure/http/create-vault-api-query-handler.js +28 -55
  563. package/src/server/infrastructure/http/http-response.js +2 -0
  564. package/src/server/infrastructure/mcp/create-agent-mcp-handler.js +2 -1
  565. package/src/server/infrastructure/persistence/hosted-metadata-store.js +42 -5
  566. package/src/server/infrastructure/persistence/path-utils.js +23 -3
  567. package/src/server/infrastructure/persistence/pull-backup-store.js +52 -42
  568. package/src/server/infrastructure/persistence/sidecar-store.js +19 -9
  569. package/src/server/infrastructure/persistence/vault-file-store.js +57 -171
  570. package/src/server/infrastructure/plantuml/plantuml-renderer.js +33 -0
  571. package/src/server/infrastructure/structurizr/structurizr-workspace-service.js +24 -10
  572. package/src/server/infrastructure/websocket/attach-collaboration-gateway.js +55 -25
  573. package/src/server/infrastructure/websocket/client-socket-session.js +32 -4
  574. package/src/server/infrastructure/workspace/file-system-sync-service.js +4 -2
  575. package/src/server/shared/agent-tool-rate-limiter.js +7 -0
  576. package/src/server/startup/git-remote-bootstrap.js +56 -49
  577. package/src/server/vault-registry.js +251 -0
  578. package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-C-nmgL5g.js +0 -1
  579. package/dist/client/assets/abnfDiagram-VCTEODGH-CdVZqicp.js +0 -1
  580. package/dist/client/assets/ar-SA-PQUY64WN-xjXgbW6d.js +0 -10
  581. package/dist/client/assets/architecture-7GRP2DOG-BMOPAkUC.js +0 -1
  582. package/dist/client/assets/architectureDiagram-5GKGNRK7-wUo0bXif.js +0 -36
  583. package/dist/client/assets/az-AZ-OXJXL76K-4JkO4Pca.js +0 -1
  584. package/dist/client/assets/base-CaIEJUF9.css +0 -1
  585. package/dist/client/assets/bg-BG-W2GKIJDF-DnkH_o81.js +0 -5
  586. package/dist/client/assets/blockDiagram-I7D4REHJ-BRSK3m49.js +0 -129
  587. package/dist/client/assets/bn-BD-TGL7M4PJ-CG4JkmtP.js +0 -3
  588. package/dist/client/assets/bn-IN-BKETKYEH-CG4JkmtP.js +0 -3
  589. package/dist/client/assets/ca-ES-LD5SCRVV-U6_TVMX9.js +0 -8
  590. package/dist/client/assets/channel-Fa4GS_-F.js +0 -1
  591. package/dist/client/assets/chunk-2E4U76K2-BPnTT-J3.js +0 -2
  592. package/dist/client/assets/chunk-4HAMMTFA-DStbIfJ1.js +0 -62
  593. package/dist/client/assets/chunk-75Z2AOVW-C5pGd3W9.js +0 -2
  594. package/dist/client/assets/chunk-7XWMRXBY-CfMzEq80.js +0 -1
  595. package/dist/client/assets/chunk-DU6HZSFF-Zkp69c6c.js +0 -127
  596. package/dist/client/assets/chunk-GMAD6QVW-NZ6WpDb8.js +0 -72
  597. package/dist/client/assets/chunk-GVQU2GXP-D8SDprfX.js +0 -1
  598. package/dist/client/assets/chunk-L3NEJ4N5-aijKP-eh.js +0 -1
  599. package/dist/client/assets/chunk-OSK3NFVY-CCbLQAMa.js +0 -10
  600. package/dist/client/assets/chunk-POPQ4Y6H-CYnpIgXT.js +0 -1
  601. package/dist/client/assets/chunk-PWAF6VOD-JSNrcBmP.js +0 -1
  602. package/dist/client/assets/chunk-RM4UPSZO-DOWllDY8.js +0 -41
  603. package/dist/client/assets/chunk-TLUHSLCS-DTY5v0aj.js +0 -2
  604. package/dist/client/assets/classDiagram-ZZMXUADV-BsQWoR3Q.js +0 -1
  605. package/dist/client/assets/classDiagram-v2-VYDZK3BY-BsQWoR3Q.js +0 -1
  606. package/dist/client/assets/comment-thread-store-CX98zR6q.js +0 -1
  607. package/dist/client/assets/comment-threads-BnRwo5B9.js +0 -4
  608. package/dist/client/assets/cose-bilkent-JH36ORCC-Cm_QF_yb.js +0 -1
  609. package/dist/client/assets/cs-CZ-OFPU5DBV-BmFAIhqX.js +0 -7
  610. package/dist/client/assets/cynefin-OW5HDTMX-7tP7QfM3.js +0 -1
  611. package/dist/client/assets/cynefinDiagram-5FMLGOSQ-rTz9RhFH.js +0 -62
  612. package/dist/client/assets/cytoscape.esm-B-NFISlW.js +0 -321
  613. package/dist/client/assets/da-DK-FRDJFYWF-H387Jw8B.js +0 -2
  614. package/dist/client/assets/dagre-PrKaheQc.js +0 -1
  615. package/dist/client/assets/de-CH-ZG7H3QK3-C_groygo.js +0 -11
  616. package/dist/client/assets/de-DE-SIJYH4IH-C_groygo.js +0 -11
  617. package/dist/client/assets/diagram-UQ7AKVKN-CNYlXtu4.js +0 -41
  618. package/dist/client/assets/diagram-VX7I27RA-CsJbsx5F.js +0 -24
  619. package/dist/client/assets/diagram-Z3DM3KII-D0mLxEgI.js +0 -24
  620. package/dist/client/assets/direct-engine-DdrQKpgq-CtKfQzCt.js +0 -5
  621. package/dist/client/assets/dist--hk9I5HQ.js +0 -1
  622. package/dist/client/assets/dist-B1XEa-Zs.js +0 -1
  623. package/dist/client/assets/dist-BJ1bJs33.js +0 -1
  624. package/dist/client/assets/dist-Bd1JucQF.js +0 -1
  625. package/dist/client/assets/dist-ByrG2qBA.js +0 -1
  626. package/dist/client/assets/dist-CKS_-are.js +0 -1
  627. package/dist/client/assets/dist-D37Hyu3h.js +0 -9
  628. package/dist/client/assets/dist-Dl_tpDSr.js +0 -1
  629. package/dist/client/assets/dist-Dm4w5UId.js +0 -1
  630. package/dist/client/assets/dist-DpYDHR9p.js +0 -6
  631. package/dist/client/assets/dist-JaU3aRlD.js +0 -19
  632. package/dist/client/assets/dist-RKBTaQMb.js +0 -13
  633. package/dist/client/assets/dist-eBx8q6Sy.js +0 -1
  634. package/dist/client/assets/document-formatter-rDDjRfZ2.js +0 -2
  635. package/dist/client/assets/drawioEditor-JubEEha7.js +0 -9
  636. package/dist/client/assets/ebnfDiagram-PWID7BFC-HeTxHpCU.js +0 -1
  637. package/dist/client/assets/editor-session-Bk6oIvSr.js +0 -54
  638. package/dist/client/assets/el-GR-IEE2CGI2-BkT6YT54.js +0 -7
  639. package/dist/client/assets/embedded-editor-base-BlCgz6mw.css +0 -1
  640. package/dist/client/assets/es-Bfdp096f.js +0 -22
  641. package/dist/client/assets/es-ES-TVVPWKV5-CpPKJXTM.js +0 -12
  642. package/dist/client/assets/eu-ES-CGBMFQDT-Bu3N2493.js +0 -8
  643. package/dist/client/assets/eventmodeling-NTZA5JFV-BR2FzK4R.js +0 -1
  644. package/dist/client/assets/excalidraw-element-link-YLIaTnVF.js +0 -7
  645. package/dist/client/assets/excalidrawEditor-dBMbRX_S.js +0 -9
  646. package/dist/client/assets/export-page-CRRQ2NEl.js +0 -57
  647. package/dist/client/assets/exportDocument-BlQRd9_m.js +0 -2
  648. package/dist/client/assets/exportDocument-CNSbjZwu.css +0 -1
  649. package/dist/client/assets/fa-IR-IE6XAPR4-BEvLCORD.js +0 -9
  650. package/dist/client/assets/fi-FI-P7TKNHRM-DI0q8iSX.js +0 -6
  651. package/dist/client/assets/file-icon-svg-Y_kpF957.js +0 -1
  652. package/dist/client/assets/file-search-DDLyyLDU.js +0 -1
  653. package/dist/client/assets/flowDiagram-HODETNUW-D5Gy0wmg.js +0 -1
  654. package/dist/client/assets/forth-Cezjo90N.js +0 -1
  655. package/dist/client/assets/fr-FR-QI2XZNT7-y8kXd8LA.js +0 -12
  656. package/dist/client/assets/ganttDiagram-EL5Y4UJY-BHgOYiZz.js +0 -292
  657. package/dist/client/assets/gitGraph-4MIJSDKK-DYlXv_yJ.js +0 -1
  658. package/dist/client/assets/gitGraphDiagram-WWUBYQGX-Dl__X3Sk.js +0 -106
  659. package/dist/client/assets/gl-ES-TLYCNOZZ-Br-Fhff-.js +0 -6
  660. package/dist/client/assets/graphlib-DS17s2tU.js +0 -1
  661. package/dist/client/assets/he-IL-ZX43XLGP-qKQq6V9X.js +0 -9
  662. package/dist/client/assets/hi-IN-UTYRMTUF-DOUcwrDO.js +0 -3
  663. package/dist/client/assets/hu-HU-AJOSEBW6-FqTyvHlD.js +0 -3
  664. package/dist/client/assets/id-ID-ETLTVG6C-CQqh3CLS.js +0 -8
  665. package/dist/client/assets/image-ZVKINSPA-DgzW5zAy.js +0 -1
  666. package/dist/client/assets/index-D3RER1SZ.js +0 -1023
  667. package/dist/client/assets/index-DREVKl_K.css +0 -1
  668. package/dist/client/assets/info-A6RAGUB7-BlU-8_xu.js +0 -1
  669. package/dist/client/assets/infoDiagram-27XIBGKW-DBpoANC9.js +0 -2
  670. package/dist/client/assets/it-IT-B4B6TP6L-V-yK3SZz.js +0 -12
  671. package/dist/client/assets/ja-JP-IYKVURR5-BQKBXRpX.js +0 -12
  672. package/dist/client/assets/javascript-BWjar7HY.js +0 -1
  673. package/dist/client/assets/javascript-D-FtdkNC.js +0 -1
  674. package/dist/client/assets/jsx-runtime-BpzPEenQ.js +0 -1
  675. package/dist/client/assets/kaa-SE2BUIKX-CZ5kfwPg.js +0 -1
  676. package/dist/client/assets/kab-KAB-Y3GLKXLR-Do7GWfuN.js +0 -4
  677. package/dist/client/assets/kk-KZ-ABWUFVOH-BpqVciQz.js +0 -1
  678. package/dist/client/assets/ko-KR-7JQDXKGM-N42lep78.js +0 -5
  679. package/dist/client/assets/ku-TR-NAH2Q5B7-K8LLl9fk.js +0 -6
  680. package/dist/client/assets/line-BFl3ujec.js +0 -1
  681. package/dist/client/assets/linear-n-3HSMUF.js +0 -1
  682. package/dist/client/assets/lt-LT-VQFYRSNQ-BmOd0ALn.js +0 -3
  683. package/dist/client/assets/lv-LV-T62VSYUM-B22WdPhp.js +0 -4
  684. package/dist/client/assets/mermaid-parser.core-Bl0efOMt.js +0 -4
  685. package/dist/client/assets/mermaid.core-BrY09czX.js +0 -11
  686. package/dist/client/assets/mermaid.core-DfcNfOTv.js +0 -1
  687. package/dist/client/assets/modulepreload-polyfill-P2Xu9kJm.js +0 -1
  688. package/dist/client/assets/mr-IN-V4FHLCJE-XX069tpm.js +0 -9
  689. package/dist/client/assets/my-MM-E3SQ6E54-cst_-5SB.js +0 -1
  690. package/dist/client/assets/nb-NO-MLNOFN5H-Bu2URWko.js +0 -8
  691. package/dist/client/assets/nl-NL-D5L3ZV4M-BqrV0btt.js +0 -13
  692. package/dist/client/assets/nn-NO-NNHDGPKB-DK-xZaWM.js +0 -4
  693. package/dist/client/assets/oc-FR-DWCRF55G-BZ5Po5R6.js +0 -4
  694. package/dist/client/assets/pa-IN-3JSAY44M-BZQSjKrS.js +0 -4
  695. package/dist/client/assets/packet-AYTQ26CC-BSJEH9Lb.js +0 -1
  696. package/dist/client/assets/pegDiagram-XKGWAZYB-Bi2Iml7Z.js +0 -1
  697. package/dist/client/assets/percentages-ETZPVQEE-DFxFqXgH.js +0 -1
  698. package/dist/client/assets/pie-WAS4IAKB-qxv01Y8W.js +0 -1
  699. package/dist/client/assets/pieDiagram-E7YTZNPT-_gYXnMoi.js +0 -39
  700. package/dist/client/assets/pl-PL-ACURYKP3-qcEOSfCk.js +0 -12
  701. package/dist/client/assets/preload-helper-HclGiUj8.js +0 -1
  702. package/dist/client/assets/preview-render-compiler-CfxJYldJ.js +0 -41
  703. package/dist/client/assets/preview-render-compiler-Cu8_i9iS.js +0 -1
  704. package/dist/client/assets/preview-render-worker-c4Yi93qW.js +0 -66
  705. package/dist/client/assets/prod-BiJL30sl.js +0 -1
  706. package/dist/client/assets/prod-qAk7rHa4.js +0 -177
  707. package/dist/client/assets/pt-BR-LOX7MLGD-DLueHSyZ.js +0 -10
  708. package/dist/client/assets/pt-PT-CZ2U2RFQ-BJ-GAEm6.js +0 -12
  709. package/dist/client/assets/quick-switcher-controller-BoIK_wuG.js +0 -1
  710. package/dist/client/assets/radar-RG4KPBEZ-B6h6pWOs.js +0 -1
  711. package/dist/client/assets/railroad-74A4TZTK-CGtTWdGc.js +0 -1
  712. package/dist/client/assets/railroad-abnf-HS5TGJTU-Cq7y22IA.js +0 -1
  713. package/dist/client/assets/railroad-ebnf-LZEXJU2U-V0aQVv9m.js +0 -1
  714. package/dist/client/assets/railroad-peg-WCYAUIDC-BQiIsX_p.js +0 -1
  715. package/dist/client/assets/railroadDiagram-O6MQD6OU-BVA5UbMu.js +0 -1
  716. package/dist/client/assets/ro-RO-2HECL2X6-CJUvKAf0.js +0 -12
  717. package/dist/client/assets/ru-RU-HAYNXO46-BWSlvTrt.js +0 -10
  718. package/dist/client/assets/runtime-config-DcmnGcXU.js +0 -1
  719. package/dist/client/assets/sankeyDiagram-P5KCCOFB-B5HHkRT2.js +0 -40
  720. package/dist/client/assets/si-LK-W5KNS4H6-DGGCsn7k.js +0 -1
  721. package/dist/client/assets/sk-SK-7K2CFGDV-CY4uTYgQ.js +0 -7
  722. package/dist/client/assets/sl-SI-OXV2QZWW-2-weqaBY.js +0 -6
  723. package/dist/client/assets/solr-BBopId9w.js +0 -1
  724. package/dist/client/assets/src-oBChb5qS.js +0 -1
  725. package/dist/client/assets/stateDiagram-D77RDMKH-CmqxyRGx.js +0 -1
  726. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-zoLLQVyh.js +0 -1
  727. package/dist/client/assets/sv-SE-JTOBZRGL-9-IUtVkO.js +0 -12
  728. package/dist/client/assets/swimlanes-42K2YHIH-Bmgb9Zld.js +0 -1
  729. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DS-KQN37.js +0 -8
  730. package/dist/client/assets/ta-IN-KFAVKXGT-gHO6Q_DH.js +0 -6
  731. package/dist/client/assets/th-TH-VDMSCPDL-BvJuw6PJ.js +0 -1
  732. package/dist/client/assets/tr-TR-CEZ6GX45-CG6UU3Su.js +0 -4
  733. package/dist/client/assets/treeView-Q6P3EWNA-BTTYcvrF.js +0 -1
  734. package/dist/client/assets/treemap-WGGIJYW6-Cg7tyfH8.js +0 -1
  735. package/dist/client/assets/uk-UA-Q3H3OXQC-CSuIg_DY.js +0 -6
  736. package/dist/client/assets/uz-UZ-NGCSWWPX-mom7rxSP.js +0 -1
  737. package/dist/client/assets/vault-api-client-iZLhMJKe.js +0 -6
  738. package/dist/client/assets/vennDiagram-4TSXK5OY-DNdUC_Xj.js +0 -34
  739. package/dist/client/assets/vi-VN-P3NDEVPS-BB0Fu9ck.js +0 -7
  740. package/dist/client/assets/wardley-WFR3VGLG-C6N1rULY.js +0 -1
  741. package/dist/client/assets/wiki-link-resolver-DFIwErjc.js +0 -1
  742. package/dist/client/assets/xychartDiagram-S5SC5T6Z-CoIR8CBX.js +0 -7
  743. package/dist/client/assets/yjs-provider-reset-guard-9ul1qF6k.js +0 -4
  744. package/dist/client/assets/zh-CN-SS3O57GA-Bj8wsiMe.js +0 -11
  745. package/dist/client/assets/zh-HK-LWJT3VCF-DOTquTCh.js +0 -1
  746. package/dist/client/assets/zh-TW-VJXC72RT-B48PRo-l.js +0 -13
  747. package/integrations/pi/index.ts +0 -94
  748. package/src/server/domain/collaboration/protocol.js +0 -6
  749. /package/dist/client/assets/{vault-api-client-C3mlS_4N.css → auth-gate-C3mlS_4N.css} +0 -0
  750. /package/dist/client/assets/{base-BYODPHdS.js → github.min-DBihDoic.js} +0 -0
@@ -0,0 +1,328 @@
1
+ import{p as e}from"./src-XiVvaevx.js";import{A as t,G as n,H as r,I as i,K as a,O as o,Q as s,V as c,Z as l,a as u,at as d,b as f,c as p,ct as m,d as h,dt as g,f as _,ft as ee,h as v,i as y,it as b,lt as te,n as x,o as S,ot as ne,q as re,r as ie,s as ae,st as oe,t as se,u as ce,x as le,y as ue}from"./_baseUniq-DR4vVjyC.js";import{C as de,_ as fe,b as pe,c as C,f as me,h as w,i as T,l as he,n as E,o as ge,r as D,s as _e,t as ve,v as ye,x as be,y as xe}from"./_basePickBy-QJXUw_pr.js";import{n as O}from"./chunk-Y2CYZVJY-BbRBGnmc.js";import{t as Se}from"./chunk-X3CZISLH-DwWpRaN8.js";import{H as Ce,U as we,a as Te,b as Ee,f as De,q as Oe,v as ke,w as Ae,x as je,y as Me,z as Ne}from"./chunk-O7XYJQB3-D0_ZY2za.js";import"./chunk-742MDFTN-D1nh6vNv.js";import{g as Pe}from"./chunk-ZIGJFQKS-b8OUHKK5.js";import{i as Fe}from"./chunk-MBY4JIJT-DTJ4UcAm.js";import"./chunk-7PRAP22T-9uTvtc_-.js";import{a as Ie,i as Le,o as Re,r as ze}from"./chunk-J5ZVWO5B-oDCd-gWO.js";import"./chunk-7INBJB4K-CDmiHbaX.js";import"./chunk-5DYCD2WN-BKWCKnK-.js";import"./chunk-Z7XXMR3K-P4Vaq8hD.js";import{t as Be}from"./chunk-XXDRQBXY-C7hQHDmQ.js";import{t as Ve}from"./chunk-WEXAMYUT-DDlVNp8J.js";import"./chunk-UA2S7LBM-DicYDjDM.js";import{r as He,t as Ue}from"./chunk-GNY47TPC-CTrH5O5R.js";var We=Object.prototype.hasOwnProperty,k=fe(function(e,t){if(n(t)||a(t)){xe(t,i(t),e);return}for(var r in t)We.call(t,r)&&pe(e,r,t[r])});function Ge(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}var Ke=4;function A(e){return he(e,Ke)}function qe(e){for(var t=-1,n=e==null?0:e.length,r=0,i=[];++t<n;){var a=e[t];a&&(i[r++]=a)}return i}function Je(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}function Ye(e,t,n,r){return _(e,function(e,i,a){t(r,e,n(e),a)}),r}function Xe(e,t){return function(n,r){var i=m(n)?Je:Ye,a=t?t():{};return i(n,e,v(r,2),a)}}var Ze=200;function Qe(e,t,n,i){var a=-1,o=l,s=!0,c=e.length,u=[],d=t.length;if(!c)return u;n&&(t=te(t,r(n))),i?(o=ce,s=!1):t.length>=Ze&&(o=ue,s=!1,t=new le(t));outer:for(;++a<c;){var f=e[a],p=n==null?f:n(f);if(f=i||f!==0?f:0,s&&p===p){for(var m=d;m--;)if(t[m]===p)continue outer;u.push(f)}else o(t,p,i)||u.push(f)}return u}var $e=re(function(e,n){return h(e)?Qe(e,t(n,1,h,!0)):[]});function j(e,t,n){var r=e==null?0:e.length;return r?(t=n||t===void 0?1:de(t),Ge(e,t<0?0:t,r)):[]}function et(e,t,n){var r=e==null?0:e.length;return r?(t=n||t===void 0?1:de(t),t=r-t,Ge(e,0,t<0?0:t)):[]}function tt(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function nt(e,t){var n=!0;return _(e,function(e,r,i){return n=!!t(e,r,i),n}),n}function rt(e,t,n){var r=m(e)?tt:nt;return n&&ye(e,t,n)&&(t=void 0),r(e,v(t,3))}function it(e){return e&&e.length?e[0]:void 0}function M(e,n){return t(T(e,n),1)}var at=Object.prototype.hasOwnProperty,ot=Xe(function(e,t,n){at.call(e,n)?e[n].push(t):be(e,n,[t])}),st=Math.max;function N(e,t,n,r){e=a(e)?e:u(e),n=n&&!r?de(n):0;var i=e.length;return n<0&&(n=st(i+n,0)),E(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&s(e,t,n)>-1}var ct=Math.max;function lt(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:de(n);return i<0&&(i=ct(r+i,0)),s(e,t,i)}var ut=`[object RegExp]`;function dt(e){return g(e)&&ee(e)==ut}var ft=c&&c.isRegExp,pt=ft?r(ft):dt,mt=`Expected a function`;function ht(e){if(typeof e!=`function`)throw TypeError(mt);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function gt(e,t){if(e==null)return{};var n=te(me(e),function(e){return[e]});return t=v(t),ve(e,n,function(e,n){return t(e,n[0])})}function _t(e,t){return(m(e)?o:ae)(e,ht(v(t,3)))}function vt(e,t){var n;return _(e,function(e,r,i){return n=t(e,r,i),!n}),!!n}function yt(e,t,n){var r=m(e)?f:vt;return n&&ye(e,t,n)&&(t=void 0),r(e,v(t,3))}function bt(e){return e&&e.length?se(e):[]}function xt(e){console&&console.error&&console.error(`Error: ${e}`)}function St(e){console&&console.warn&&console.warn(`Warning: ${e}`)}function Ct(e){let t=new Date().getTime(),n=e();return{time:new Date().getTime()-t,value:n}}function wt(e){function t(){}t.prototype=e;let n=new t;function r(){return typeof n.bar}return r(),r(),e}function Tt(e){return Et(e)?e.LABEL:e.name}function Et(e){return E(e.LABEL)&&e.LABEL!==``}var Dt=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),p(this.definition,t=>{t.accept(e)})}},P=class extends Dt{constructor(e){super([]),this.idx=1,k(this,gt(e,e=>e!==void 0))}set definition(e){}get definition(){return this.referencedRule===void 0?[]:this.referencedRule.definition}accept(e){e.visit(this)}},Ot=class extends Dt{constructor(e){super(e.definition),this.orgText=``,k(this,gt(e,e=>e!==void 0))}},F=class extends Dt{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,k(this,gt(e,e=>e!==void 0))}},I=class extends Dt{constructor(e){super(e.definition),this.idx=1,k(this,gt(e,e=>e!==void 0))}},kt=class extends Dt{constructor(e){super(e.definition),this.idx=1,k(this,gt(e,e=>e!==void 0))}},At=class extends Dt{constructor(e){super(e.definition),this.idx=1,k(this,gt(e,e=>e!==void 0))}},L=class extends Dt{constructor(e){super(e.definition),this.idx=1,k(this,gt(e,e=>e!==void 0))}},jt=class extends Dt{constructor(e){super(e.definition),this.idx=1,k(this,gt(e,e=>e!==void 0))}},Mt=class extends Dt{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,k(this,gt(e,e=>e!==void 0))}},R=class{constructor(e){this.idx=1,k(this,gt(e,e=>e!==void 0))}accept(e){e.visit(this)}};function Nt(e){return T(e,Pt)}function Pt(e){function t(e){return T(e,Pt)}if(e instanceof P){let t={type:`NonTerminal`,name:e.nonTerminalName,idx:e.idx};return E(e.label)&&(t.label=e.label),t}if(e instanceof F)return{type:`Alternative`,definition:t(e.definition)};if(e instanceof I)return{type:`Option`,idx:e.idx,definition:t(e.definition)};if(e instanceof kt)return{type:`RepetitionMandatory`,idx:e.idx,definition:t(e.definition)};if(e instanceof At)return{type:`RepetitionMandatoryWithSeparator`,idx:e.idx,separator:Pt(new R({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof jt)return{type:`RepetitionWithSeparator`,idx:e.idx,separator:Pt(new R({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof L)return{type:`Repetition`,idx:e.idx,definition:t(e.definition)};if(e instanceof Mt)return{type:`Alternation`,idx:e.idx,definition:t(e.definition)};if(e instanceof R){let t={type:`Terminal`,name:e.terminalType.name,label:Tt(e.terminalType),idx:e.idx};E(e.label)&&(t.terminalLabel=e.label);let n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=pt(n)?n.source:n),t}if(e instanceof Ot)return{type:`Rule`,name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error(`non exhaustive match`)}var Ft=class{visit(e){let t=e;switch(t.constructor){case P:return this.visitNonTerminal(t);case F:return this.visitAlternative(t);case I:return this.visitOption(t);case kt:return this.visitRepetitionMandatory(t);case At:return this.visitRepetitionMandatoryWithSeparator(t);case jt:return this.visitRepetitionWithSeparator(t);case L:return this.visitRepetition(t);case Mt:return this.visitAlternation(t);case R:return this.visitTerminal(t);case Ot:return this.visitRule(t);default:throw Error(`non exhaustive match`)}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function It(e){return e instanceof F||e instanceof I||e instanceof L||e instanceof kt||e instanceof At||e instanceof jt||e instanceof R||e instanceof Ot}function Lt(e,t=[]){return e instanceof I||e instanceof L||e instanceof jt?!0:e instanceof Mt?yt(e.definition,e=>Lt(e,t)):e instanceof P&&N(t,e)?!1:e instanceof Dt&&(e instanceof P&&t.push(e),rt(e.definition,e=>Lt(e,t)))}function Rt(e){return e instanceof Mt}function zt(e){if(e instanceof P)return`SUBRULE`;if(e instanceof I)return`OPTION`;if(e instanceof Mt)return`OR`;if(e instanceof kt)return`AT_LEAST_ONE`;if(e instanceof At)return`AT_LEAST_ONE_SEP`;if(e instanceof jt)return`MANY_SEP`;if(e instanceof L)return`MANY`;if(e instanceof R)return`CONSUME`;throw Error(`non exhaustive match`)}var Bt=class{walk(e,t=[]){p(e.definition,(n,r)=>{let i=j(e.definition,r+1);if(n instanceof P)this.walkProdRef(n,i,t);else if(n instanceof R)this.walkTerminal(n,i,t);else if(n instanceof F)this.walkFlat(n,i,t);else if(n instanceof I)this.walkOption(n,i,t);else if(n instanceof kt)this.walkAtLeastOne(n,i,t);else if(n instanceof At)this.walkAtLeastOneSep(n,i,t);else if(n instanceof jt)this.walkManySep(n,i,t);else if(n instanceof L)this.walkMany(n,i,t);else if(n instanceof Mt)this.walkOr(n,i,t);else throw Error(`non exhaustive match`)})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){let r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){let r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){let r=[new I({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){let r=Vt(e,t,n);this.walk(e,r)}walkMany(e,t,n){let r=[new I({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){let r=Vt(e,t,n);this.walk(e,r)}walkOr(e,t,n){let r=t.concat(n);p(e.definition,e=>{let t=new F({definition:[e]});this.walk(t,r)})}};function Vt(e,t,n){return[new I({definition:[new R({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function Ht(e){if(e instanceof P)return Ht(e.referencedRule);if(e instanceof R)return Gt(e);if(It(e))return Ut(e);if(Rt(e))return Wt(e);throw Error(`non exhaustive match`)}function Ut(e){let t=[],n=e.definition,r=0,i=n.length>r,a,o=!0;for(;i&&o;)a=n[r],o=Lt(a),t=t.concat(Ht(a)),r+=1,i=n.length>r;return bt(t)}function Wt(e){let t=T(e.definition,e=>Ht(e));return bt(w(t))}function Gt(e){return[e.terminalType]}var Kt=`_~IN~_`,qt=class extends Bt{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){let r=Yt(e.referencedRule,e.idx)+this.topProd.name,i=Ht(new F({definition:t.concat(n)}));this.follows[r]=i}};function Jt(e){let t={};return p(e,e=>{let n=new qt(e).startWalking();k(t,n)}),t}function Yt(e,t){return e.name+t+Kt}function z(e){return e.charCodeAt(0)}function Xt(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function Zt(e,t){if(e[t]===!0)throw`duplicate flag `+t;e[t],e[t]=!0}function Qt(e){if(e===void 0)throw Error(`Internal Error - Should never get here!`);return!0}function $t(){throw Error(`Internal Error - Should never get here!`)}function en(e){return e.type===`Character`}var tn=[];for(let e=z(`0`);e<=z(`9`);e++)tn.push(e);var nn=[z(`_`)].concat(tn);for(let e=z(`a`);e<=z(`z`);e++)nn.push(e);for(let e=z(`A`);e<=z(`Z`);e++)nn.push(e);var rn=[z(` `),z(`\f`),z(`
2
+ `),z(`\r`),z(` `),z(`\v`),z(` `),z(`\xA0`),z(` `),z(` `),z(` `),z(` `),z(` `),z(` `),z(` `),z(` `),z(` `),z(` `),z(` `),z(` `),z(`\u2028`),z(`\u2029`),z(` `),z(` `),z(` `),z(``)],an=/[0-9a-fA-F]/,on=/[0-9]/,sn=/[1-9]/,cn=class{constructor(){this.idx=0,this.input=``,this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar(`/`);let t=this.disjunction();this.consumeChar(`/`);let n={type:`Flags`,loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case`g`:Zt(n,`global`);break;case`i`:Zt(n,`ignoreCase`);break;case`m`:Zt(n,`multiLine`);break;case`u`:Zt(n,`unicode`);break;case`y`:Zt(n,`sticky`)}if(this.idx!==this.input.length)throw Error(`Redundant input: `+this.input.substring(this.idx));return{type:`Pattern`,flags:n,value:t,loc:this.loc(0)}}disjunction(){let e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()===`|`;)this.consumeChar(`|`),e.push(this.alternative());return{type:`Disjunction`,value:e,loc:this.loc(t)}}alternative(){let e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:`Alternative`,value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case`^`:return{type:`StartAnchor`,loc:this.loc(e)};case`$`:return{type:`EndAnchor`,loc:this.loc(e)};case`\\`:switch(this.popChar()){case`b`:return{type:`WordBoundary`,loc:this.loc(e)};case`B`:return{type:`NonWordBoundary`,loc:this.loc(e)}}throw Error(`Invalid Assertion Escape`);case`(`:this.consumeChar(`?`);let t;switch(this.popChar()){case`=`:t=`Lookahead`;break;case`!`:t=`NegativeLookahead`;break;case`<`:switch(this.popChar()){case`=`:t=`Lookbehind`;break;case`!`:t=`NegativeLookbehind`}}Qt(t);let n=this.disjunction();return this.consumeChar(`)`),{type:t,value:n,loc:this.loc(e)}}return $t()}quantifier(e=!1){let t,n=this.idx;switch(this.popChar()){case`*`:t={atLeast:0,atMost:1/0};break;case`+`:t={atLeast:1,atMost:1/0};break;case`?`:t={atLeast:0,atMost:1};break;case`{`:let n=this.integerIncludingZero();switch(this.popChar()){case`}`:t={atLeast:n,atMost:n};break;case`,`:let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar(`}`)}if(e===!0&&t===void 0)return;Qt(t)}if((e!==!0||t!==void 0)&&Qt(t))return this.peekChar(0)===`?`?(this.consumeChar(`?`),t.greedy=!1):t.greedy=!0,t.type=`Quantifier`,t.loc=this.loc(n),t}atom(){let e,t=this.idx;switch(this.peekChar()){case`.`:e=this.dotAll();break;case`\\`:e=this.atomEscape();break;case`[`:e=this.characterClass();break;case`(`:e=this.group()}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Qt(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):$t()}dotAll(){return this.consumeChar(`.`),{type:`Set`,complement:!0,value:[z(`
3
+ `),z(`\r`),z(`\u2028`),z(`\u2029`)]}}atomEscape(){switch(this.consumeChar(`\\`),this.peekChar()){case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:return this.decimalEscapeAtom();case`d`:case`D`:case`s`:case`S`:case`w`:case`W`:return this.characterClassEscape();case`f`:case`n`:case`r`:case`t`:case`v`:return this.controlEscapeAtom();case`c`:return this.controlLetterEscapeAtom();case`0`:return this.nulCharacterAtom();case`x`:return this.hexEscapeSequenceAtom();case`u`:return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:`GroupBackReference`,value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case`d`:e=tn;break;case`D`:e=tn,t=!0;break;case`s`:e=rn;break;case`S`:e=rn,t=!0;break;case`w`:e=nn;break;case`W`:e=nn,t=!0}return Qt(e)?{type:`Set`,value:e,complement:t}:$t()}controlEscapeAtom(){let e;switch(this.popChar()){case`f`:e=z(`\f`);break;case`n`:e=z(`
4
+ `);break;case`r`:e=z(`\r`);break;case`t`:e=z(` `);break;case`v`:e=z(`\v`)}return Qt(e)?{type:`Character`,value:e}:$t()}controlLetterEscapeAtom(){this.consumeChar(`c`);let e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error(`Invalid `);return{type:`Character`,value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar(`0`),{type:`Character`,value:z(`\0`)}}hexEscapeSequenceAtom(){return this.consumeChar(`x`),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar(`u`),this.parseHexDigits(4)}identityEscapeAtom(){return{type:`Character`,value:z(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case`
5
+ `:case`\r`:case`\u2028`:case`\u2029`:case`\\`:case`]`:throw Error(`TBD`);default:return{type:`Character`,value:z(this.popChar())}}}characterClass(){let e=[],t=!1;for(this.consumeChar(`[`),this.peekChar(0)===`^`&&(this.consumeChar(`^`),t=!0);this.isClassAtom();){let t=this.classAtom();if(t.type,en(t)&&this.isRangeDash()){this.consumeChar(`-`);let n=this.classAtom();if(n.type,en(n)){if(n.value<t.value)throw Error(`Range out of order in character class`);e.push({from:t.value,to:n.value})}else Xt(t.value,e),e.push(z(`-`)),Xt(n.value,e)}else Xt(t.value,e)}return this.consumeChar(`]`),{type:`Set`,complement:t,value:e}}classAtom(){switch(this.peekChar()){case`]`:case`
6
+ `:case`\r`:case`\u2028`:case`\u2029`:throw Error(`TBD`);case`\\`:return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar(`\\`),this.peekChar()){case`b`:return this.consumeChar(`b`),{type:`Character`,value:z(`\b`)};case`d`:case`D`:case`s`:case`S`:case`w`:case`W`:return this.characterClassEscape();case`f`:case`n`:case`r`:case`t`:case`v`:return this.controlEscapeAtom();case`c`:return this.controlLetterEscapeAtom();case`0`:return this.nulCharacterAtom();case`x`:return this.hexEscapeSequenceAtom();case`u`:return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar(`(`),this.peekChar(0)){case`?`:this.consumeChar(`?`),this.consumeChar(`:`),e=!1;break;default:this.groupIdx++}let t=this.disjunction();this.consumeChar(`)`);let n={type:`Group`,capturing:e,value:t};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(sn.test(e)===!1)throw Error(`Expecting a positive integer`);for(;on.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(on.test(e)===!1)throw Error(`Expecting an integer`);for(;on.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`
7
+ `:case`\r`:case`\u2028`:case`\u2029`:case`^`:case`$`:case`\\`:case`.`:case`*`:case`+`:case`?`:case`(`:case`)`:case`[`:case`|`:throw Error(`TBD`);default:return{type:`Character`,value:z(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case`g`:case`i`:case`m`:case`u`:case`y`:return!0;default:return!1}}isRangeDash(){return this.peekChar()===`-`&&this.isClassAtom(1)}isDigit(){return on.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case`]`:case`
8
+ `:case`\r`:case`\u2028`:case`\u2029`:return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case`.`:case`\\`:case`[`:case`(`:return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case`^`:case`$`:return!0;case`\\`:switch(this.peekChar(1)){case`b`:case`B`:return!0;default:return!1}case`(`:return this.peekChar(1)===`?`&&(this.peekChar(2)===`=`||this.peekChar(2)===`!`||this.peekChar(2)===`<`&&(this.peekChar(3)===`=`||this.peekChar(3)===`!`));default:return!1}}isQuantifier(){let e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case`^`:case`$`:case`\\`:case`.`:case`*`:case`+`:case`?`:case`(`:case`)`:case`[`:case`|`:case`/`:case`
9
+ `:case`\r`:case`\u2028`:case`\u2029`:return!1;default:return!0}}parseHexDigits(e){let t=``;for(let n=0;n<e;n++){let e=this.popChar();if(an.test(e)===!1)throw Error(`Expecting a HexDecimal digits`);t+=e}return{type:`Character`,value:parseInt(t,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){let e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error(`Expected: '`+e+`' but found: '`+this.input[this.idx]+`' at offset: `+this.idx);if(this.idx>=this.input.length)throw Error(`Unexpected end of input`);this.idx++}loc(e){return{begin:e,end:this.idx}}},ln=class{visitChildren(e){for(let t in e){let n=e[t];e.hasOwnProperty(t)&&(n.type===void 0?Array.isArray(n)&&n.forEach(e=>{this.visit(e)},this):this.visit(n))}}visit(e){switch(e.type){case`Pattern`:this.visitPattern(e);break;case`Flags`:this.visitFlags(e);break;case`Disjunction`:this.visitDisjunction(e);break;case`Alternative`:this.visitAlternative(e);break;case`StartAnchor`:this.visitStartAnchor(e);break;case`EndAnchor`:this.visitEndAnchor(e);break;case`WordBoundary`:this.visitWordBoundary(e);break;case`NonWordBoundary`:this.visitNonWordBoundary(e);break;case`Lookahead`:this.visitLookahead(e);break;case`NegativeLookahead`:this.visitNegativeLookahead(e);break;case`Lookbehind`:this.visitLookbehind(e);break;case`NegativeLookbehind`:this.visitNegativeLookbehind(e);break;case`Character`:this.visitCharacter(e);break;case`Set`:this.visitSet(e);break;case`Group`:this.visitGroup(e);break;case`GroupBackReference`:this.visitGroupBackReference(e);break;case`Quantifier`:this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},un={},dn=new cn;function fn(e){let t=e.toString();if(un.hasOwnProperty(t))return un[t];{let e=dn.pattern(t);return un[t]=e,e}}function pn(){un={}}var mn=`Complement Sets are not supported for first char optimization`,hn=`Unable to use "first char" lexer optimizations:
10
+ `;function gn(e,t=!1){try{let t=fn(e);return _n(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===mn)t&&St(`${hn}\tUnable to optimize: < ${e.toString()} >\n Complement Sets cannot be automatically optimized.
11
+ This will disable the lexer's first char optimizations.
12
+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n=``;t&&(n=`
13
+ This will disable the lexer's first char optimizations.
14
+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),xt(`${hn}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function _n(e,t,n){switch(e.type){case`Disjunction`:for(let r=0;r<e.value.length;r++)_n(e.value[r],t,n);break;case`Alternative`:let r=e.value;for(let e=0;e<r.length;e++){let i=r[e];switch(i.type){case`EndAnchor`:case`GroupBackReference`:case`Lookahead`:case`NegativeLookahead`:case`Lookbehind`:case`NegativeLookbehind`:case`StartAnchor`:case`WordBoundary`:case`NonWordBoundary`:continue}let a=i;switch(a.type){case`Character`:vn(a.value,t,n);break;case`Set`:if(a.complement===!0)throw Error(mn);p(a.value,e=>{if(typeof e==`number`)vn(e,t,n);else{let r=e;if(n===!0)for(let e=r.from;e<=r.to;e++)vn(e,t,n);else{for(let e=r.from;e<=r.to&&e<256;e++)vn(e,t,n);if(r.to>=256){let e=r.from>=256?r.from:256,n=r.to,i=nr(e),a=nr(n);for(let e=i;e<=a;e++)t[e]=e}}}});break;case`Group`:_n(a.value,t,n);break;default:throw Error(`Non Exhaustive Match`)}let o=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type===`Group`&&xn(a)===!1||a.type!==`Group`&&o===!1)break}break;default:throw Error(`non exhaustive match!`)}return u(t)}function vn(e,t,n){let r=nr(e);t[r]=r,n===!0&&yn(e,t)}function yn(e,t){let n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){let e=nr(r.charCodeAt(0));t[e]=e}else{let e=n.toLowerCase();if(e!==n){let n=nr(e.charCodeAt(0));t[n]=n}}}function bn(e,t){return ge(e.value,e=>{if(typeof e==`number`)return N(t,e);{let n=e;return ge(t,e=>n.from<=e&&e<=n.to)!==void 0}})}function xn(e){let t=e.quantifier;return t&&t.atLeast===0?!0:e.value?m(e.value)?rt(e.value,xn):xn(e.value):!1}var Sn=class extends ln{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case`Lookahead`:this.visitLookahead(e);return;case`NegativeLookahead`:this.visitNegativeLookahead(e);return;case`Lookbehind`:this.visitLookbehind(e);return;case`NegativeLookbehind`:this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){N(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?bn(e,this.targetCharCodes)===void 0&&(this.found=!0):bn(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function Cn(e,t){if(t instanceof RegExp){let n=fn(t),r=new Sn(e);return r.visit(n),r.found}return ge(t,t=>N(e,t.charCodeAt(0)))!==void 0}var wn=`PATTERN`,Tn=`defaultMode`;function En(e,t){t=C(t,{debug:!1,safeMode:!1,positionTracking:`full`,lineTerminatorCharacters:[`\r`,`
15
+ `],tracer:(e,t)=>t()});let n=t.tracer;n(`initCharCodeToOptimizedIndexMap`,()=>{rr()});let r;n(`Reject Lexer.NA`,()=>{r=_t(e,e=>e[wn]===V.NA)});let i=!1,a;n(`Transform Patterns`,()=>{i=!1,a=T(r,e=>{let t=e[wn];if(pt(t)){let e=t.source;return e.length===1&&e!==`^`&&e!==`$`&&e!==`.`&&!t.ignoreCase?e:e.length===2&&e[0]===`\\`&&!N([`d`,`D`,`s`,`S`,`t`,`r`,`n`,`t`,`0`,`c`,`b`,`B`,`f`,`v`,`w`,`W`],e[1])?e[1]:Wn(t)}if(d(t))return i=!0,{exec:t};if(typeof t==`object`)return i=!0,t;if(typeof t==`string`){if(t.length===1)return t;{let e=t.replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`);return Wn(new RegExp(e))}}throw Error(`non exhaustive match`)})});let o,s,c,l,u;n(`misc mapping`,()=>{o=T(r,e=>e.tokenTypeIdx),s=T(r,e=>{let t=e.GROUP;if(t!==V.SKIPPED){if(E(t))return t;if(ie(t))return!1;throw Error(`non exhaustive match`)}}),c=T(r,e=>{let t=e.LONGER_ALT;if(t)return m(t)?T(t,e=>lt(r,e)):[lt(r,t)]}),l=T(r,e=>e.PUSH_MODE),u=T(r,e=>D(e,`POP_MODE`))});let f;n(`Line Terminator Handling`,()=>{let e=$n(t.lineTerminatorCharacters);f=T(r,e=>!1),t.positionTracking!==`onlyOffset`&&(f=T(r,t=>D(t,`LINE_BREAKS`)?!!t.LINE_BREAKS:Zn(t,e)===!1&&Cn(e,t.PATTERN)))});let h,g,_,ee;n(`Misc Mapping #2`,()=>{h=T(r,Jn),g=T(a,Yn),_=x(r,(e,t)=>{let n=t.GROUP;return E(n)&&n!==V.SKIPPED&&(e[n]=[]),e},{}),ee=T(a,(e,t)=>({pattern:a[t],longerAlt:c[t],canLineTerminator:f[t],isCustom:h[t],short:g[t],group:s[t],push:l[t],pop:u[t],tokenTypeIdx:o[t],tokenType:r[t]}))});let v=!0,b=[];return t.safeMode||n(`First Char Optimization`,()=>{b=x(r,(e,n,r)=>{if(typeof n.PATTERN==`string`)er(e,nr(n.PATTERN.charCodeAt(0)),ee[r]);else if(m(n.START_CHARS_HINT)){let t;p(n.START_CHARS_HINT,n=>{let i=nr(typeof n==`string`?n.charCodeAt(0):n);t!==i&&(t=i,er(e,i,ee[r]))})}else if(pt(n.PATTERN)){if(n.PATTERN.unicode)v=!1,t.ensureOptimizations&&xt(`${hn}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n The regexp unicode flag is not currently supported by the regexp-to-ast library.
16
+ This will disable the lexer's first char optimizations.
17
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let i=gn(n.PATTERN,t.ensureOptimizations);y(i)&&(v=!1),p(i,t=>{er(e,t,ee[r])})}}else t.ensureOptimizations&&xt(`${hn}\tTokenType: <${n.name}> is using a custom token pattern without providing <start_chars_hint> parameter.\n This will disable the lexer's first char optimizations.
18
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),v=!1;return e},[])}),{emptyGroups:_,patternIdxToConfig:ee,charCodeToPatternIdxToConfig:b,hasCustom:i,canBeOptimized:v}}function Dn(e,t){let n=[],r=kn(e);n=n.concat(r.errors);let i=An(r.valid),a=i.valid;return n=n.concat(i.errors),n=n.concat(On(a)),n=n.concat(Rn(a)),n=n.concat(zn(a,t)),n=n.concat(Bn(a)),n}function On(e){let t=[],n=S(e,e=>pt(e[wn]));return t=t.concat(Mn(n)),t=t.concat(Fn(n)),t=t.concat(In(n)),t=t.concat(Ln(n)),t=t.concat(Nn(n)),t}function kn(e){let t=S(e,e=>!D(e,wn));return{errors:T(t,e=>({message:`Token Type: ->`+e.name+`<- missing static 'PATTERN' property`,type:B.MISSING_PATTERN,tokenTypes:[e]})),valid:$e(e,t)}}function An(e){let t=S(e,e=>{let t=e[wn];return!pt(t)&&!d(t)&&!D(t,`exec`)&&!E(t)});return{errors:T(t,e=>({message:`Token Type: ->`+e.name+`<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.`,type:B.INVALID_PATTERN,tokenTypes:[e]})),valid:$e(e,t)}}var jn=/[^\\][$]/;function Mn(e){class t extends ln{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}let n=S(e,e=>{let n=e.PATTERN;try{let e=fn(n),r=new t;return r.visit(e),r.found}catch{return jn.test(n.source)}});return T(n,e=>({message:`Unexpected RegExp Anchor Error:
19
+ Token Type: ->`+e.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
20
+ See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:B.EOI_ANCHOR_FOUND,tokenTypes:[e]}))}function Nn(e){let t=S(e,e=>e.PATTERN.test(``));return T(t,e=>({message:`Token Type: ->`+e.name+`<- static 'PATTERN' must not match an empty string`,type:B.EMPTY_MATCH_PATTERN,tokenTypes:[e]}))}var Pn=/[^\\[][\^]|^\^/;function Fn(e){class t extends ln{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}let n=S(e,e=>{let n=e.PATTERN;try{let e=fn(n),r=new t;return r.visit(e),r.found}catch{return Pn.test(n.source)}});return T(n,e=>({message:`Unexpected RegExp Anchor Error:
21
+ Token Type: ->`+e.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
22
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:B.SOI_ANCHOR_FOUND,tokenTypes:[e]}))}function In(e){let t=S(e,e=>{let t=e[wn];return t instanceof RegExp&&(t.multiline||t.global)});return T(t,e=>({message:`Token Type: ->`+e.name+`<- static 'PATTERN' may NOT contain global('g') or multiline('m')`,type:B.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}))}function Ln(e){let t=[],n=T(e,n=>x(e,(e,r)=>n.PATTERN.source===r.PATTERN.source&&!N(t,r)&&r.PATTERN!==V.NA?(t.push(r),e.push(r),e):e,[]));n=qe(n);let r=S(n,e=>e.length>1);return T(r,e=>{let t=T(e,e=>e.name);return{message:`The same RegExp pattern ->${it(e).PATTERN}<-has been used in all of the following Token Types: ${t.join(`, `)} <-`,type:B.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}function Rn(e){let t=S(e,e=>{if(!D(e,`GROUP`))return!1;let t=e.GROUP;return t!==V.SKIPPED&&t!==V.NA&&!E(t)});return T(t,e=>({message:`Token Type: ->`+e.name+`<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String`,type:B.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}))}function zn(e,t){let n=S(e,e=>e.PUSH_MODE!==void 0&&!N(t,e.PUSH_MODE));return T(n,e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:B.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}))}function Bn(e){let t=[],n=x(e,(e,t,n)=>{let r=t.PATTERN;return r===V.NA||(E(r)?e.push({str:r,idx:n,tokenType:t}):pt(r)&&Hn(r)&&e.push({str:r.source,idx:n,tokenType:t})),e},[]);return p(e,(e,r)=>{p(n,({str:n,idx:i,tokenType:a})=>{if(r<i&&Vn(n,e.PATTERN)){let n=`Token: ->${a.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:B.UNREACHABLE_PATTERN,tokenTypes:[e,a]})}})}),t}function Vn(e,t){if(pt(t)){if(Un(t))return!1;let n=t.exec(e);return n!==null&&n.index===0}if(d(t))return t(e,0,[],{});if(D(t,`exec`))return t.exec(e,0,[],{});if(typeof t==`string`)return t===e;throw Error(`non exhaustive match`)}function Hn(e){return ge([`.`,`\\`,`[`,`]`,`|`,`^`,`$`,`(`,`)`,`?`,`*`,`+`,`{`],t=>e.source.indexOf(t)!==-1)===void 0}function Un(e){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(e.source)}function Wn(e){let t=e.ignoreCase?`iy`:`y`;return RegExp(`${e.source}`,t)}function Gn(e,t,n){let r=[];return D(e,`defaultMode`)||r.push({message:`A MultiMode Lexer cannot be initialized without a <defaultMode> property in its definition
23
+ `,type:B.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),D(e,`modes`)||r.push({message:`A MultiMode Lexer cannot be initialized without a <modes> property in its definition
24
+ `,type:B.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),D(e,`modes`)&&D(e,`defaultMode`)&&!D(e.modes,e.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${Tn}: <${e.defaultMode}>which does not exist\n`,type:B.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),D(e,`modes`)&&p(e.modes,(e,t)=>{p(e,(n,i)=>{if(ie(n))r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${t}> at index: <${i}>\n`,type:B.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(D(n,`LONGER_ALT`)){let i=m(n.LONGER_ALT)?n.LONGER_ALT:[n.LONGER_ALT];p(i,i=>{!ie(i)&&!N(e,i)&&r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${n.name}> outside of mode <${t}>\n`,type:B.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),r}function Kn(e,t,n){let r=[],i=!1,a=_t(qe(w(u(e.modes))),e=>e[wn]===V.NA),o=$n(n);return t&&p(a,e=>{let t=Zn(e,o);if(t!==!1){let n={message:Qn(e,t),type:t.issue,tokenType:e};r.push(n)}else D(e,`LINE_BREAKS`)?e.LINE_BREAKS===!0&&(i=!0):Cn(o,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:`Warning: No LINE_BREAKS Found.
25
+ This Lexer has been defined to track line and column information,
26
+ But none of the Token Types can be identified as matching a line terminator.
27
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
28
+ for details.`,type:B.NO_LINE_BREAKS_FLAGS}),r}function qn(e){let t={},n=i(e);return p(n,n=>{let r=e[n];if(m(r))t[n]=[];else throw Error(`non exhaustive match`)}),t}function Jn(e){let t=e.PATTERN;if(pt(t))return!1;if(d(t)||D(t,`exec`))return!0;if(E(t))return!1;throw Error(`non exhaustive match`)}function Yn(e){return E(e)&&e.length===1?e.charCodeAt(0):!1}var Xn={test:function(e){let t=e.length;for(let n=this.lastIndex;n<t;n++){let t=e.charCodeAt(n);if(t===10)return this.lastIndex=n+1,!0;if(t===13)return this.lastIndex=e.charCodeAt(n+1)===10?n+2:n+1,!0}return!1},lastIndex:0};function Zn(e,t){if(D(e,`LINE_BREAKS`))return!1;if(pt(e.PATTERN)){try{Cn(t,e.PATTERN)}catch(e){return{issue:B.IDENTIFY_TERMINATOR,errMsg:e.message}}return!1}if(E(e.PATTERN))return!1;if(Jn(e))return{issue:B.CUSTOM_LINE_BREAK};throw Error(`non exhaustive match`)}function Qn(e,t){if(t.issue===B.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
29
+ \tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===B.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
30
+ \tThe problem is in the <${e.name}> Token Type\n For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error(`non exhaustive match`)}function $n(e){return T(e,e=>E(e)?e.charCodeAt(0):e)}function er(e,t,n){e[t]===void 0?e[t]=[n]:e[t].push(n)}var tr=[];function nr(e){return e<256?e:tr[e]}function rr(){if(y(tr)){tr=Array(65536);for(let e=0;e<65536;e++)tr[e]=e>255?255+~~(e/255):e}}function ir(e,t){let n=e.tokenTypeIdx;return n===t.tokenTypeIdx||t.isParent===!0&&t.categoryMatchesMap[n]===!0}function ar(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}var or=1,sr={};function cr(e){let t=lr(e);ur(t),fr(t),dr(t),p(t,e=>{e.isParent=e.categoryMatches.length>0})}function lr(e){let t=A(e),n=e,r=!0;for(;r;){n=qe(w(T(n,e=>e.CATEGORIES)));let e=$e(n,t);t=t.concat(e),y(e)?r=!1:n=e}return t}function ur(e){p(e,e=>{mr(e)||(sr[or]=e,e.tokenTypeIdx=or++),hr(e)&&!m(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),hr(e)||(e.CATEGORIES=[]),gr(e)||(e.categoryMatches=[]),_r(e)||(e.categoryMatchesMap={})})}function dr(e){p(e,e=>{e.categoryMatches=[],p(e.categoryMatchesMap,(t,n)=>{e.categoryMatches.push(sr[n].tokenTypeIdx)})})}function fr(e){p(e,e=>{pr([],e)})}function pr(e,t){p(e,e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0}),p(t.CATEGORIES,n=>{let r=e.concat(t);N(r,n)||pr(r,n)})}function mr(e){return D(e,`tokenTypeIdx`)}function hr(e){return D(e,`CATEGORIES`)}function gr(e){return D(e,`categoryMatches`)}function _r(e){return D(e,`categoryMatchesMap`)}function vr(e){return D(e,`tokenTypeIdx`)}var yr={buildUnableToPopLexerModeMessage(e){return`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(e,t,n,r,i,a){return`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`}},B;(function(e){e[e.MISSING_PATTERN=0]=`MISSING_PATTERN`,e[e.INVALID_PATTERN=1]=`INVALID_PATTERN`,e[e.EOI_ANCHOR_FOUND=2]=`EOI_ANCHOR_FOUND`,e[e.UNSUPPORTED_FLAGS_FOUND=3]=`UNSUPPORTED_FLAGS_FOUND`,e[e.DUPLICATE_PATTERNS_FOUND=4]=`DUPLICATE_PATTERNS_FOUND`,e[e.INVALID_GROUP_TYPE_FOUND=5]=`INVALID_GROUP_TYPE_FOUND`,e[e.PUSH_MODE_DOES_NOT_EXIST=6]=`PUSH_MODE_DOES_NOT_EXIST`,e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]=`MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE`,e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]=`MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY`,e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]=`MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST`,e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]=`LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED`,e[e.SOI_ANCHOR_FOUND=11]=`SOI_ANCHOR_FOUND`,e[e.EMPTY_MATCH_PATTERN=12]=`EMPTY_MATCH_PATTERN`,e[e.NO_LINE_BREAKS_FLAGS=13]=`NO_LINE_BREAKS_FLAGS`,e[e.UNREACHABLE_PATTERN=14]=`UNREACHABLE_PATTERN`,e[e.IDENTIFY_TERMINATOR=15]=`IDENTIFY_TERMINATOR`,e[e.CUSTOM_LINE_BREAK=16]=`CUSTOM_LINE_BREAK`,e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]=`MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE`})(B||={});var br={deferDefinitionErrorsHandling:!1,positionTracking:`full`,lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
31
+ `,`\r`],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:yr,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(br);var V=class{constructor(e,t=br){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let n=Array(this.traceInitIndent+1).join(` `);this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);let{time:r,value:i}=Ct(t),a=r>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${n}<-- <${e}> time: ${r}ms`),this.traceInitIndent--,i}return t()},typeof t==`boolean`)throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
32
+ a boolean 2nd argument is no longer supported`);this.config=k({},br,t);let n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n==`number`&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT(`Lexer Constructor`,()=>{let n,r=!0;this.TRACE_INIT(`Lexer Config handling`,()=>{if(this.config.lineTerminatorsPattern===br.lineTerminatorsPattern)this.config.lineTerminatorsPattern=Xn;else if(this.config.lineTerminatorCharacters===br.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
33
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(t.safeMode&&t.ensureOptimizations)throw Error(`"safeMode" and "ensureOptimizations" flags are mutually exclusive.`);this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),m(e)?n={modes:{defaultMode:A(e)},defaultMode:Tn}:(r=!1,n=A(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT(`performRuntimeChecks`,()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Gn(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT(`performWarningRuntimeChecks`,()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Kn(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},p(n.modes,(e,t)=>{n.modes[t]=_t(e,e=>ie(e))});let a=i(n.modes);if(p(n.modes,(e,n)=>{this.TRACE_INIT(`Mode: <${n}> processing`,()=>{if(this.modes.push(n),this.config.skipValidations===!1&&this.TRACE_INIT(`validatePatterns`,()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Dn(e,a))}),y(this.lexerDefinitionErrors)){cr(e);let r;this.TRACE_INIT(`analyzeTokenTypes`,()=>{r=En(e,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[n]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[n]=r.charCodeToPatternIdxToConfig,this.emptyGroups=k({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[n]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,!y(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let e=T(this.lexerDefinitionErrors,e=>e.message).join(`-----------------------
34
+ `);throw Error(`Errors detected in definition of Lexer:
35
+ `+e)}p(this.lexerDefinitionWarning,e=>{St(e.message)}),this.TRACE_INIT(`Choosing sub-methods implementations`,()=>{if(r&&(this.handleModes=b),this.trackStartLines===!1&&(this.computeNewColumn=ne),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=b),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT(`Failed Optimization Warnings`,()=>{let e=x(this.canModeBeOptimized,(e,t,n)=>(t===!1&&e.push(n),e),[]);if(t.ensureOptimizations&&!y(e))throw Error(`Lexer Modes: < ${e.join(`, `)} > cannot be optimized.\n Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
36
+ Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT(`clearRegExpParserCache`,()=>{pn()}),this.TRACE_INIT(`toFastProperties`,()=>{wt(this)})})}tokenize(e,t=this.defaultMode){if(!y(this.lexerDefinitionErrors)){let e=T(this.lexerDefinitionErrors,e=>e.message).join(`-----------------------
37
+ `);throw Error(`Unable to Tokenize because Errors detected in definition of Lexer:
38
+ `+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_=e,ee=_.length,v=0,y=0,b=this.hasCustom?0:Math.floor(e.length/10),te=Array(b),x=[],S=this.trackStartLines?1:void 0,ne=this.trackStartLines?1:void 0,re=qn(this.emptyGroups),ie=this.trackStartLines,ae=this.config.lineTerminatorsPattern,oe=0,se=[],ce=[],le=[],ue=[];Object.freeze(ue);let de=!1,fe=e=>{if(le.length===1&&e.tokenType.PUSH_MODE===void 0){let t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);x.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{le.pop();let e=_e(le);se=this.patternIdxToConfig[e],ce=this.charCodeToPatternIdxToConfig[e],oe=se.length;let t=this.canModeBeOptimized[e]&&this.config.safeMode===!1;de=!!(ce&&t)}};function pe(e){le.push(e),ce=this.charCodeToPatternIdxToConfig[e],se=this.patternIdxToConfig[e],oe=se.length,oe=se.length;let t=this.canModeBeOptimized[e]&&this.config.safeMode===!1;de=!!(ce&&t)}pe.call(this,t);let C,me=this.config.recoveryEnabled;for(;v<ee;){s=null,u=-1;let t=_.charCodeAt(v),b;if(de){let e=nr(t),n=ce[e];b=n===void 0?ue:n}else b=se;let w=b.length;for(n=0;n<w;n++){C=b[n];let r=C.pattern;c=null;let d=C.short;if(d===!1?C.isCustom===!0?(g=r.exec(_,v,te,re),g===null?s=null:(s=g[0],u=s.length,g.payload!==void 0&&(c=g.payload))):(r.lastIndex=v,u=this.matchLength(r,e,v)):t===d&&(u=1,s=r),u!==-1){if(o=C.longerAlt,o!==void 0){s=e.substring(v,v+u);let t=o.length;for(i=0;i<t;i++){let t=se[o[i]],n=t.pattern;if(l=null,t.isCustom===!0?(g=n.exec(_,v,te,re),g===null?a=null:(a=g[0],g.payload!==void 0&&(l=g.payload))):(n.lastIndex=v,a=this.match(n,e,v)),a&&a.length>s.length){s=a,u=a.length,c=l,C=t;break}}}break}}if(u!==-1){if(d=C.group,d!==void 0&&(s=s===null?e.substring(v,v+u):s,f=C.tokenTypeIdx,p=this.createTokenInstance(s,v,f,C.tokenType,S,ne,u),this.handlePayload(p,c),d===!1?y=this.addToken(te,y,p):re[d].push(p)),ie===!0&&C.canLineTerminator===!0){let t=0,n,r;ae.lastIndex=0;do s=s===null?e.substring(v,v+u):s,n=ae.test(s),n===!0&&(r=ae.lastIndex-1,t++);while(n===!0);t===0?ne=this.computeNewColumn(ne,u):(S+=t,ne=u-r,this.updateTokenEndLineColumnLocation(p,d,r,t,S,ne,u))}else ne=this.computeNewColumn(ne,u);v+=u,this.handleModes(C,fe,pe,p)}else{let t=v,n=S,i=ne,a=me===!1;for(;a===!1&&v<ee;)for(v++,r=0;r<oe;r++){let t=se[r],n=t.pattern,i=t.short;if(i===!1?t.isCustom===!0?a=n.exec(_,v,te,re)!==null:(n.lastIndex=v,a=n.exec(e)!==null):_.charCodeAt(v)===i&&(a=!0),a===!0)break}if(m=v-t,ne=this.computeNewColumn(ne,m),h=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(_,t,m,n,i,_e(le)),x.push({offset:t,line:n,column:i,length:m,message:h}),me===!1)break}}return this.hasCustom||(te.length=y),{tokens:te,groups:re,errors:x}}handleModes(e,t,n,r){if(e.pop===!0){let i=e.push;t(r),i!==void 0&&n.call(this,i)}else e.push!==void 0&&n.call(this,e.push)}updateTokenEndLineColumnLocation(e,t,n,r,i,a,o){let s,c;t!==void 0&&(s=n===o-1,c=s?-1:0,(r!==1||s!==!0)&&(e.endLine=i+c,e.endColumn=a-1+-c))}computeNewColumn(e,t){return e+t}createOffsetOnlyToken(e,t,n,r){return{image:e,startOffset:t,tokenTypeIdx:n,tokenType:r}}createStartOnlyToken(e,t,n,r,i,a){return{image:e,startOffset:t,startLine:i,startColumn:a,tokenTypeIdx:n,tokenType:r}}createFullToken(e,t,n,r,i,a,o){return{image:e,startOffset:t,endOffset:t+o-1,startLine:i,endLine:i,startColumn:a,endColumn:a+o-1,tokenTypeIdx:n,tokenType:r}}addTokenUsingPush(e,t,n){return e.push(n),t}addTokenUsingMemberAccess(e,t,n){return e[t]=n,t++,t}handlePayloadNoCustom(e,t){}handlePayloadWithCustom(e,t){t!==null&&(e.payload=t)}match(e,t,n){return e.test(t)===!0?t.substring(n,e.lastIndex):null}matchLength(e,t,n){return e.test(t)===!0?e.lastIndex-n:-1}};V.SKIPPED=`This marks a skipped Token pattern, this means each token identified by it will be consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.`,V.NA=/NOT_APPLICABLE/;function xr(e){return Sr(e)?e.LABEL:e.name}function Sr(e){return E(e.LABEL)&&e.LABEL!==``}var Cr=`parent`,wr=`categories`,Tr=`label`,Er=`group`,Dr=`push_mode`,Or=`pop_mode`,kr=`longer_alt`,Ar=`line_breaks`,jr=`start_chars_hint`;function H(e){return Mr(e)}function Mr(e){let t=e.pattern,n={};if(n.name=e.name,ie(t)||(n.PATTERN=t),D(e,Cr))throw`The parent property is no longer supported.
39
+ See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return D(e,wr)&&(n.CATEGORIES=e[wr]),cr([n]),D(e,Tr)&&(n.LABEL=e[Tr]),D(e,Er)&&(n.GROUP=e[Er]),D(e,Or)&&(n.POP_MODE=e[Or]),D(e,Dr)&&(n.PUSH_MODE=e[Dr]),D(e,kr)&&(n.LONGER_ALT=e[kr]),D(e,Ar)&&(n.LINE_BREAKS=e[Ar]),D(e,jr)&&(n.START_CHARS_HINT=e[jr]),n}var Nr=H({name:`EOF`,pattern:V.NA});cr([Nr]);function Pr(e,t,n,r,i,a,o,s){return{image:t,startOffset:n,endOffset:r,startLine:i,endLine:a,startColumn:o,endColumn:s,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}function Fr(e,t){return ir(e,t)}var Ir={buildMismatchTokenMessage({expected:e,actual:t,previous:n,ruleName:r}){return`Expecting ${Sr(e)?`--> ${xr(e)} <--`:`token of type --> ${e.name} <--`} but found --> '${t.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:e,ruleName:t}){return`Redundant input, expecting EOF but found: `+e.image},buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){let a=`
40
+ but found: '`+it(t).image+`'`;if(r)return`Expecting: `+r+a;{let t=x(e,(e,t)=>e.concat(t),[]),n=T(t,e=>`[${T(e,e=>xr(e)).join(`, `)}]`);return`Expecting: one of these possible Token sequences:\n${T(n,(e,t)=>` ${t+1}. ${e}`).join(`
41
+ `)}`+a}},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){let i=`
42
+ but found: '`+it(t).image+`'`;return n?`Expecting: `+n+i:`Expecting: expecting at least one iteration which starts with one of these possible Token sequences::\n <${T(e,e=>`[${T(e,e=>xr(e)).join(`,`)}]`).join(` ,`)}>`+i}};Object.freeze(Ir);var Lr={buildRuleNotFoundError(e,t){return`Invalid grammar, reference to a rule which is not defined: ->`+t.nonTerminalName+`<-
43
+ inside top level rule: ->`+e.name+`<-`}},Rr={buildDuplicateFoundError(e,t){function n(e){return e instanceof R?e.terminalType.name:e instanceof P?e.nonTerminalName:``}let r=e.name,i=it(t),a=i.idx,o=zt(i),s=n(i),c=`->${o}${a>0?a:``}<- ${s?`with argument: ->${s}<-`:``}
44
+ appears more than once (${t.length} times) in the top level rule: ->${r}<-.
45
+ For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
46
+ `;return c=c.replace(/[ \t]+/g,` `),c=c.replace(/\s\s+/g,`
47
+ `),c},buildNamespaceConflictError(e){return`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(e){let t=T(e.prefixPath,e=>xr(e)).join(`, `),n=e.alternation.idx===0?``:e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(` ,`)}> due to common lookahead prefix\nin <OR${n}> inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){let t=e.alternation.idx===0?``:e.alternation.idx,n=e.prefixPath.length===0,r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(` ,`)}> in <OR${t}> inside <${e.topLevelRule.name}> Rule,\n`;if(n)r+=`These alternatives are all empty (match no tokens), making them indistinguishable.
48
+ Only the last alternative may be empty.
49
+ `;else{let t=T(e.prefixPath,e=>xr(e)).join(`, `);r+=`<${t}> may appears as a prefix path in all these alternatives.\n`}return r+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
50
+ For Further details.`,r},buildEmptyRepetitionError(e){let t=zt(e.repetition);return e.repetition.idx!==0&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError(e){return`deprecated`},buildEmptyAlternationError(e){return`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in <OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`},buildTooManyAlternativesError(e){return`An Alternation cannot have more than 256 alternatives:\n<OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(e){let t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${`${t} --> ${T(e.leftRecursionPath,e=>e.name).concat([t]).join(` --> `)}`}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(e){return`deprecated`},buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof Ot?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};function zr(e,t){let n=new Br(e,t);return n.resolveRefs(),n.errors}var Br=class extends Ft{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){p(u(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{let t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:W.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},Vr=class extends Bt{constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName=``,this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error(`The path does not start with the walker's top Rule!`);return this.ruleStack=A(this.path.ruleStack).reverse(),this.occurrenceStack=A(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){y(this.ruleStack)?(this.nextProductionName=``,this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},Hr=class extends Vr{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName=``,this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let e=new F({definition:t.concat(n)});this.possibleTokTypes=Ht(e),this.found=!0}}},Ur=class extends Bt{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},Wr=class extends Ur{walkMany(e,t,n){if(e.idx===this.occurrence){let e=it(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof R&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}},Gr=class extends Ur{walkManySep(e,t,n){if(e.idx===this.occurrence){let e=it(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof R&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}},Kr=class extends Ur{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){let e=it(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof R&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}},qr=class extends Ur{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){let e=it(t.concat(n));this.result.isEndOfRule=e===void 0,e instanceof R&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}};function Jr(e,t,n=[]){n=A(n);let r=[],i=0;function a(t){return t.concat(j(e,i+1))}function o(e){let i=Jr(a(e),t,n);return r.concat(i)}for(;n.length<t&&i<e.length;){let t=e[i];if(t instanceof F||t instanceof P)return o(t.definition);if(t instanceof I)r=o(t.definition);else if(t instanceof kt)return o(t.definition.concat([new L({definition:t.definition})]));else if(t instanceof At)return o([new F({definition:t.definition}),new L({definition:[new R({terminalType:t.separator})].concat(t.definition)})]);else if(t instanceof jt)r=o(t.definition.concat([new L({definition:[new R({terminalType:t.separator})].concat(t.definition)})]));else if(t instanceof L)r=o(t.definition.concat([new L({definition:t.definition})]));else if(t instanceof Mt)return p(t.definition,e=>{y(e.definition)===!1&&(r=o(e.definition))}),r;else if(t instanceof R)n.push(t.terminalType);else throw Error(`non exhaustive match`);i++}return r.push({partialPath:n,suffixDef:j(e,i)}),r}function Yr(e,t,n,r){let i=`EXIT_NONE_TERMINAL`,a=[i],o=`EXIT_ALTERNATIVE`,s=!1,c=t.length,l=c-r-1,u=[],d=[];for(d.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!y(d);){let e=d.pop();if(e===o){s&&_e(d).idx<=l&&d.pop();continue}let r=e.def,f=e.idx,p=e.ruleStack,m=e.occurrenceStack;if(y(r))continue;let h=r[0];if(h===i){let e={idx:f,def:j(r),ruleStack:et(p),occurrenceStack:et(m)};d.push(e)}else if(h instanceof R){if(f<c-1){let e=f+1,i=t[e];if(n(i,h.terminalType)){let t={idx:e,def:j(r),ruleStack:p,occurrenceStack:m};d.push(t)}}else if(f===c-1)u.push({nextTokenType:h.terminalType,nextTokenOccurrence:h.idx,ruleStack:p,occurrenceStack:m}),s=!0;else throw Error(`non exhaustive match`)}else if(h instanceof P){let e=A(p);e.push(h.nonTerminalName);let t=A(m);t.push(h.idx);let n={idx:f,def:h.definition.concat(a,j(r)),ruleStack:e,occurrenceStack:t};d.push(n)}else if(h instanceof I){let e={idx:f,def:j(r),ruleStack:p,occurrenceStack:m};d.push(e),d.push(o);let t={idx:f,def:h.definition.concat(j(r)),ruleStack:p,occurrenceStack:m};d.push(t)}else if(h instanceof kt){let e=new L({definition:h.definition,idx:h.idx}),t={idx:f,def:h.definition.concat([e],j(r)),ruleStack:p,occurrenceStack:m};d.push(t)}else if(h instanceof At){let e=new L({definition:[new R({terminalType:h.separator})].concat(h.definition),idx:h.idx}),t={idx:f,def:h.definition.concat([e],j(r)),ruleStack:p,occurrenceStack:m};d.push(t)}else if(h instanceof jt){let e={idx:f,def:j(r),ruleStack:p,occurrenceStack:m};d.push(e),d.push(o);let t=new L({definition:[new R({terminalType:h.separator})].concat(h.definition),idx:h.idx}),n={idx:f,def:h.definition.concat([t],j(r)),ruleStack:p,occurrenceStack:m};d.push(n)}else if(h instanceof L){let e={idx:f,def:j(r),ruleStack:p,occurrenceStack:m};d.push(e),d.push(o);let t=new L({definition:h.definition,idx:h.idx}),n={idx:f,def:h.definition.concat([t],j(r)),ruleStack:p,occurrenceStack:m};d.push(n)}else if(h instanceof Mt)for(let e=h.definition.length-1;e>=0;e--){let t={idx:f,def:h.definition[e].definition.concat(j(r)),ruleStack:p,occurrenceStack:m};d.push(t),d.push(o)}else if(h instanceof F)d.push({idx:f,def:h.definition.concat(j(r)),ruleStack:p,occurrenceStack:m});else if(h instanceof Ot)d.push(Xr(h,f,p,m));else throw Error(`non exhaustive match`)}return u}function Xr(e,t,n,r){let i=A(n);i.push(e.name);let a=A(r);return a.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:a}}var U;(function(e){e[e.OPTION=0]=`OPTION`,e[e.REPETITION=1]=`REPETITION`,e[e.REPETITION_MANDATORY=2]=`REPETITION_MANDATORY`,e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]=`REPETITION_MANDATORY_WITH_SEPARATOR`,e[e.REPETITION_WITH_SEPARATOR=4]=`REPETITION_WITH_SEPARATOR`,e[e.ALTERNATION=5]=`ALTERNATION`})(U||={});function Zr(e){if(e instanceof I||e===`Option`)return U.OPTION;if(e instanceof L||e===`Repetition`)return U.REPETITION;if(e instanceof kt||e===`RepetitionMandatory`)return U.REPETITION_MANDATORY;if(e instanceof At||e===`RepetitionMandatoryWithSeparator`)return U.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof jt||e===`RepetitionWithSeparator`)return U.REPETITION_WITH_SEPARATOR;if(e instanceof Mt||e===`Alternation`)return U.ALTERNATION;throw Error(`non exhaustive match`)}function Qr(e,t,n,r,i,a){let o=ci(e,t,n);return a(o,r,fi(o)?ar:ir,i)}function $r(e,t,n,r,i,a){let o=li(e,t,i,n),s=fi(o)?ar:ir;return a(o[0],s,r)}function ei(e,t,n,r){let i=e.length,a=rt(e,e=>rt(e,e=>e.length===1));if(t)return function(t){let r=T(t,e=>e.GATE);for(let t=0;t<i;t++){let i=e[t],a=i.length,o=r[t];if(o===void 0||o.call(this)!==!1)nextPath:for(let e=0;e<a;e++){let r=i[e],a=r.length;for(let e=0;e<a;e++)if(n(this.LA(e+1),r[e])===!1)continue nextPath;return t}}};if(a&&!r){let t=T(e,e=>w(e)),n=x(t,(e,t,n)=>(p(t,t=>{D(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=n),p(t.categoryMatches,t=>{D(e,t)||(e[t]=n)})}),e),{});return function(){let e=this.LA(1);return n[e.tokenTypeIdx]}}return function(){for(let t=0;t<i;t++){let r=e[t],i=r.length;nextPath:for(let e=0;e<i;e++){let i=r[e],a=i.length;for(let e=0;e<a;e++)if(n(this.LA(e+1),i[e])===!1)continue nextPath;return t}}}}function ti(e,t,n){let r=rt(e,e=>e.length===1),i=e.length;if(r&&!n){let t=w(e);if(t.length===1&&y(t[0].categoryMatches)){let e=t[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===e}}{let e=x(t,(e,t,n)=>(e[t.tokenTypeIdx]=!0,p(t.categoryMatches,t=>{e[t]=!0}),e),[]);return function(){let t=this.LA(1);return e[t.tokenTypeIdx]===!0}}}return function(){nextPath:for(let n=0;n<i;n++){let r=e[n],i=r.length;for(let e=0;e<i;e++)if(t(this.LA(e+1),r[e])===!1)continue nextPath;return!0}return!1}}var ni=class extends Bt{constructor(e,t,n){super(),this.topProd=e,this.targetOccurrence=t,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,t,n,r){return e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.restDef=n.concat(r),!0)}walkOption(e,t,n){this.checkIsTarget(e,U.OPTION,t,n)||super.walkOption(e,t,n)}walkAtLeastOne(e,t,n){this.checkIsTarget(e,U.REPETITION_MANDATORY,t,n)||super.walkOption(e,t,n)}walkAtLeastOneSep(e,t,n){this.checkIsTarget(e,U.REPETITION_MANDATORY_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}walkMany(e,t,n){this.checkIsTarget(e,U.REPETITION,t,n)||super.walkOption(e,t,n)}walkManySep(e,t,n){this.checkIsTarget(e,U.REPETITION_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}},ri=class extends Ft{constructor(e,t,n){super(),this.targetOccurrence=e,this.targetProdType=t,this.targetRef=n,this.result=[]}checkIsTarget(e,t){e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,U.OPTION)}visitRepetition(e){this.checkIsTarget(e,U.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,U.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,U.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,U.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,U.ALTERNATION)}};function ii(e){let t=Array(e);for(let n=0;n<e;n++)t[n]=[];return t}function ai(e){let t=[``];for(let n=0;n<e.length;n++){let r=e[n],i=[];for(let e=0;e<t.length;e++){let n=t[e];i.push(n+`_`+r.tokenTypeIdx);for(let e=0;e<r.categoryMatches.length;e++){let t=`_`+r.categoryMatches[e];i.push(n+t)}}t=i}return t}function oi(e,t,n){for(let r=0;r<e.length;r++){if(r===n)continue;let i=e[r];for(let e=0;e<t.length;e++)if(i[t[e]]===!0)return!1}return!0}function si(e,t){let n=T(e,e=>Jr([e],1)),r=ii(n.length),i=T(n,e=>{let t={};return p(e,e=>{let n=ai(e.partialPath);p(n,e=>{t[e]=!0})}),t}),a=n;for(let e=1;e<=t;e++){let n=a;a=ii(n.length);for(let o=0;o<n.length;o++){let s=n[o];for(let n=0;n<s.length;n++){let c=s[n].partialPath,l=s[n].suffixDef,u=ai(c);if(oi(i,u,o)||y(l)||c.length===t){let e=r[o];if(ui(e,c)===!1){e.push(c);for(let e=0;e<u.length;e++){let t=u[e];i[o][t]=!0}}}else{let t=Jr(l,e+1,c);a[o]=a[o].concat(t),p(t,e=>{let t=ai(e.partialPath);p(t,e=>{i[o][e]=!0})})}}}}return r}function ci(e,t,n,r){let i=new ri(e,U.ALTERNATION,r);return t.accept(i),si(i.result,n)}function li(e,t,n,r){let i=new ri(e,n);t.accept(i);let a=i.result,o=new ni(t,e,n).startWalking();return si([new F({definition:a}),new F({definition:o})],r)}function ui(e,t){compareOtherPath:for(let n=0;n<e.length;n++){let r=e[n];if(r.length===t.length){for(let e=0;e<r.length;e++){let n=t[e],i=r[e];if(n!==i&&i.categoryMatchesMap[n.tokenTypeIdx]===void 0)continue compareOtherPath}return!0}}return!1}function di(e,t){return e.length<t.length&&rt(e,(e,n)=>{let r=t[n];return e===r||r.categoryMatchesMap[e.tokenTypeIdx]})}function fi(e){return rt(e,e=>rt(e,e=>rt(e,e=>y(e.categoryMatches))))}function pi(e){let t=e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName});return T(t,e=>Object.assign({type:W.CUSTOM_LOOKAHEAD_VALIDATION},e))}function mi(e,t,n,r){let i=M(e,e=>hi(e,n)),a=ji(e,t,n),o=M(e,e=>Di(e,n)),s=M(e,t=>yi(t,e,r,n));return i.concat(a,o,s)}function hi(e,t){let n=new vi;e.accept(n);let r=n.allProductions,i=gt(ot(r,gi),e=>e.length>1);return T(u(i),n=>{let r=it(n),i=t.buildDuplicateFoundError(e,n),a=zt(r),o={message:i,type:W.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:a,occurrence:r.idx},s=_i(r);return s&&(o.parameter=s),o})}function gi(e){return`${zt(e)}_#_${e.idx}_#_${_i(e)}`}function _i(e){return e instanceof R?e.terminalType.name:e instanceof P?e.nonTerminalName:``}var vi=class extends Ft{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function yi(e,t,n,r){let i=[];if(x(t,(t,n)=>n.name===e.name?t+1:t,0)>1){let t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:W.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}function bi(e,t,n){let r=[],i;return N(t,e)||(i=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:W.INVALID_RULE_OVERRIDE,ruleName:e})),r}function xi(e,t,n,r=[]){let i=[],a=Si(t.definition);if(y(a))return[];{let t=e.name;N(a,e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:W.LEFT_RECURSION,ruleName:t});let o=M($e(a,r.concat([e])),t=>{let i=A(r);return i.push(t),xi(e,t,n,i)});return i.concat(o)}}function Si(e){let t=[];if(y(e))return t;let n=it(e);if(n instanceof P)t.push(n.referencedRule);else if(n instanceof F||n instanceof I||n instanceof kt||n instanceof At||n instanceof jt||n instanceof L)t=t.concat(Si(n.definition));else if(n instanceof Mt)t=w(T(n.definition,e=>Si(e.definition)));else if(!(n instanceof R))throw Error(`non exhaustive match`);let r=Lt(n),i=e.length>1;if(r&&i){let n=j(e);return t.concat(Si(n))}return t}var Ci=class extends Ft{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function wi(e,t){let n=new Ci;e.accept(n);let r=n.alternations;return M(r,n=>M(et(n.definition),(r,i)=>{let a=Yr([r],[],ir,1);return y(a)?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:W.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]}))}function Ti(e,t,n){let r=new Ci;e.accept(r);let i=r.alternations;return i=_t(i,e=>e.ignoreAmbiguities===!0),M(i,r=>{let i=r.idx,a=ci(i,e,r.maxLookahead||t,r),o=ki(a,r,e,n),s=Ai(a,r,e,n);return o.concat(s)})}var Ei=class extends Ft{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function Di(e,t){let n=new Ci;e.accept(n);let r=n.alternations;return M(r,n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:W.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[])}function Oi(e,t,n){let r=[];return p(e,e=>{let i=new Ei;e.accept(i);let a=i.allProductions;p(a,i=>{let a=Zr(i),o=i.maxLookahead||t,s=i.idx,c=li(s,e,a,o)[0];if(y(w(c))){let t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:W.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}function ki(e,t,n,r){let i=[],a=x(e,(n,r,a)=>(t.definition[a].ignoreAmbiguities===!0||p(r,r=>{let o=[a];p(e,(e,n)=>{a!==n&&ui(e,r)&&t.definition[n].ignoreAmbiguities!==!0&&o.push(n)}),o.length>1&&!ui(i,r)&&(i.push(r),n.push({alts:o,path:r}))}),n),[]);return T(a,e=>{let i=T(e.alts,e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:W.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}})}function Ai(e,t,n,r){let i=x(e,(e,t,n)=>{let r=T(t,e=>({idx:n,path:e}));return e.concat(r)},[]);return qe(M(i,e=>{if(t.definition[e.idx].ignoreAmbiguities===!0)return[];let a=e.idx,o=e.path,s=S(i,e=>t.definition[e.idx].ignoreAmbiguities!==!0&&e.idx<a&&di(e.path,o));return T(s,e=>{let i=[e.idx+1,a+1],o=t.idx===0?``:t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:W.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}})}))}function ji(e,t,n){let r=[],i=T(t,e=>e.name);return p(e,e=>{let t=e.name;if(N(i,t)){let i=n.buildNamespaceConflictError(e);r.push({message:i,type:W.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}function Mi(e){let t=C(e,{errMsgProvider:Lr}),n={};return p(e.rules,e=>{n[e.name]=e}),zr(n,t.errMsgProvider)}function Ni(e){return e=C(e,{errMsgProvider:Rr}),mi(e.rules,e.tokenTypes,e.errMsgProvider,e.grammarName)}var Pi=`MismatchedTokenException`,Fi=`NoViableAltException`,Ii=`EarlyExitException`,Li=`NotAllInputParsedException`,Ri=[Pi,Fi,Ii,Li];Object.freeze(Ri);function zi(e){return N(Ri,e.name)}var Bi=class extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},Vi=class extends Bi{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Pi}},Hi=class extends Bi{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Fi}},Ui=class extends Bi{constructor(e,t){super(e,t),this.name=Li}},Wi=class extends Bi{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=Ii}},Gi={},Ki=`InRuleRecoveryException`,qi=class extends Error{constructor(e){super(e),this.name=Ki}},Ji=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=D(e,`recoveryEnabled`)?e.recoveryEnabled:Ia.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Yi)}getTokenToInsert(e){let t=Pr(e,``,NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){let i=this.findReSyncTokenType(),a=this.exportLexerState(),o=[],s=!1,c=this.LA(1),l=this.LA(1),u=()=>{let e=this.LA(0),t=new Vi(this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:c,previous:e,ruleName:this.getCurrRuleFullName()}),c,this.LA(0));t.resyncedTokens=et(o),this.SAVE_ERROR(t)};for(;!s;)if(this.tokenMatcher(l,r)){u();return}else if(n.call(this)){u(),e.apply(this,t);return}else this.tokenMatcher(l,i)?s=!0:(l=this.SKIP_TOKEN(),this.addToResyncTokens(l,o));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,t,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))}getFollowsForInRuleRecovery(e,t){let n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new qi(`sad sad panda`)}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e)||y(t))return!1;let n=this.LA(1);return ge(t,e=>this.tokenMatcher(n,e))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let t=this.getCurrFollowKey();return N(this.getFollowSetFromFollowKey(t),e)}findReSyncTokenType(){let e=this.flattenFollowSet(),t=this.LA(1),n=2;for(;;){let r=ge(e,e=>Fr(t,e));if(r!==void 0)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Gi;let e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return T(e,(n,r)=>r===0?Gi:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:t[r],inRule:this.shortRuleNameToFullName(e[r-1])})}flattenFollowSet(){let e=T(this.buildFullFollowKeyStack(),e=>this.getFollowSetFromFollowKey(e));return w(e)}getFollowSetFromFollowKey(e){if(e===Gi)return[Nr];let t=e.ruleName+e.idxInCallingRule+Kt+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,Nr)||t.push(e),t}reSyncTo(e){let t=[],n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return et(t)}attemptInRepetitionRecovery(e,t,n,r,i,a,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:A(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return T(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function Yi(e,t,n,r,i,a,o){let s=this.getKeyForAutomaticLookahead(r,i),c=this.firstAfterRepMap[s];if(c===void 0){let e=this.getCurrRuleFullName(),t=this.getGAstProductions()[e];c=new a(t,i).startWalking(),this.firstAfterRepMap[s]=c}let l=c.token,u=c.occurrence,d=c.isEndOfRule;this.RULE_STACK.length===1&&d&&l===void 0&&(l=Nr,u=1),l!==void 0&&u!==void 0&&this.shouldInRepetitionRecoveryBeTried(l,u,o)&&this.tryInRepetitionRecovery(e,t,n,l)}var Xi=1024,Zi=1280,Qi=1536;function $i(e,t,n){return n|t|e}var ea=class{constructor(e){this.maxLookahead=e?.maxLookahead??Ia.maxLookahead}validate(e){let t=this.validateNoLeftRecursion(e.rules);if(y(t)){let n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return M(e,e=>xi(e,e,Rr))}validateEmptyOrAlternatives(e){return M(e,e=>wi(e,Rr))}validateAmbiguousAlternationAlternatives(e,t){return M(e,e=>Ti(e,t,Rr))}validateSomeNonEmptyLookaheadPath(e,t){return Oi(e,t,Rr)}buildLookaheadForAlternation(e){return Qr(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,ei)}buildLookaheadForOptional(e){return $r(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Zr(e.prodType),ti)}},ta=class{initLooksAhead(e){this.dynamicTokensEnabled=D(e,`dynamicTokensEnabled`)?e.dynamicTokensEnabled:Ia.dynamicTokensEnabled,this.maxLookahead=D(e,`maxLookahead`)?e.maxLookahead:Ia.maxLookahead,this.lookaheadStrategy=D(e,`lookaheadStrategy`)?e.lookaheadStrategy:new ea({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){p(e,e=>{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{let{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:o}=ra(e);p(t,t=>{let n=t.idx===0?``:t.idx;this.TRACE_INIT(`${zt(t)}${n}`,()=>{let n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),r=$i(this.fullRuleNameToShort[e.name],256,t.idx);this.setLaFuncCache(r,n)})}),p(n,t=>{this.computeLookaheadFunc(e,t.idx,768,`Repetition`,t.maxLookahead,zt(t))}),p(r,t=>{this.computeLookaheadFunc(e,t.idx,512,`Option`,t.maxLookahead,zt(t))}),p(i,t=>{this.computeLookaheadFunc(e,t.idx,Xi,`RepetitionMandatory`,t.maxLookahead,zt(t))}),p(a,t=>{this.computeLookaheadFunc(e,t.idx,Qi,`RepetitionMandatoryWithSeparator`,t.maxLookahead,zt(t))}),p(o,t=>{this.computeLookaheadFunc(e,t.idx,Zi,`RepetitionWithSeparator`,t.maxLookahead,zt(t))})})})}computeLookaheadFunc(e,t,n,r,i,a){this.TRACE_INIT(`${a}${t===0?``:t}`,()=>{let a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r}),o=$i(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(o,a)})}getKeyForAutomaticLookahead(e,t){return $i(this.getLastExplicitRuleShortName(),e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}},na=new class extends Ft{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function ra(e){na.reset(),e.accept(na);let t=na.dslMethods;return na.reset(),t}function ia(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset)}function aa(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.startColumn=t.startColumn,e.startLine=t.startLine,e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine)}function oa(e,t,n){e.children[n]===void 0?e.children[n]=[t]:e.children[n].push(t)}function sa(e,t,n){e.children[t]===void 0?e.children[t]=[n]:e.children[t].push(n)}var ca=`name`;function la(e,t){Object.defineProperty(e,ca,{enumerable:!1,configurable:!0,writable:!1,value:t})}function ua(e,t){let n=i(e),r=n.length;for(let i=0;i<r;i++){let r=e[n[i]],a=r.length;for(let e=0;e<a;e++){let n=r[e];n.tokenTypeIdx===void 0&&this[n.name](n.children,t)}}}function da(e,t){let n=function(){};return la(n,e+`BaseSemantics`),n.prototype={visit:function(e,t){if(m(e)&&(e=e[0]),!ie(e))return this[e.name](e.children,t)},validateVisitor:function(){let e=ma(this,t);if(!y(e)){let t=T(e,e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join(`
51
+
52
+ `).replace(/\n/g,`
53
+ `)}`)}}},n.prototype.constructor=n,n._RULE_NAMES=t,n}function fa(e,t,n){let r=function(){};la(r,e+`BaseSemanticsWithDefaults`);let i=Object.create(n.prototype);return p(t,e=>{i[e]=ua}),r.prototype=i,r.prototype.constructor=r,r}var pa;(function(e){e[e.REDUNDANT_METHOD=0]=`REDUNDANT_METHOD`,e[e.MISSING_METHOD=1]=`MISSING_METHOD`})(pa||={});function ma(e,t){return ha(e,t)}function ha(e,t){let n=S(t,t=>d(e[t])===!1);return qe(T(n,t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:pa.MISSING_METHOD,methodName:t})))}var ga=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=D(e,`nodeLocationTracking`)?e.nodeLocationTracking:Ia.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=b,this.cstFinallyStateUpdate=b,this.cstPostTerminal=b,this.cstPostNonTerminal=b,this.cstPostRule=b;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=aa,this.setNodeLocationFromNode=aa,this.cstPostRule=b,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=b,this.setNodeLocationFromNode=b,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=ia,this.setNodeLocationFromNode=ia,this.cstPostRule=b,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=b,this.setNodeLocationFromNode=b,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=b,this.setNodeLocationFromNode=b,this.cstPostRule=b,this.setInitialNodeLocation=b;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){let t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){let t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let t=this.LA(0),n=e.location;n.startOffset<=t.startOffset?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){let t=this.LA(0),n=e.location;n.startOffset<=t.startOffset?n.endOffset=t.endOffset:n.startOffset=NaN}cstPostTerminal(e,t){let n=this.CST_STACK[this.CST_STACK.length-1];oa(n,t,e),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){let n=this.CST_STACK[this.CST_STACK.length-1];sa(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(ie(this.baseCstVisitorConstructor)){let e=da(this.className,i(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(ie(this.baseCstVisitorWithDefaultsConstructor)){let e=fa(this.className,i(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){let e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}},_a=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error(`Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.`);this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Fa}LA(e){let t=this.currIdx+e;return t<0||this.tokVectorLength<=t?Fa:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}},va=class{ACTION(e){return e.call(this)}consume(e,t,n){return this.consumeInternal(t,e,n)}subrule(e,t,n){return this.subruleInternal(t,e,n)}option(e,t){return this.optionInternal(t,e)}or(e,t){return this.orInternal(t,e)}many(e,t){return this.manyInternal(e,t)}atLeastOne(e,t){return this.atLeastOneInternal(e,t)}CONSUME(e,t){return this.consumeInternal(e,0,t)}CONSUME1(e,t){return this.consumeInternal(e,1,t)}CONSUME2(e,t){return this.consumeInternal(e,2,t)}CONSUME3(e,t){return this.consumeInternal(e,3,t)}CONSUME4(e,t){return this.consumeInternal(e,4,t)}CONSUME5(e,t){return this.consumeInternal(e,5,t)}CONSUME6(e,t){return this.consumeInternal(e,6,t)}CONSUME7(e,t){return this.consumeInternal(e,7,t)}CONSUME8(e,t){return this.consumeInternal(e,8,t)}CONSUME9(e,t){return this.consumeInternal(e,9,t)}SUBRULE(e,t){return this.subruleInternal(e,0,t)}SUBRULE1(e,t){return this.subruleInternal(e,1,t)}SUBRULE2(e,t){return this.subruleInternal(e,2,t)}SUBRULE3(e,t){return this.subruleInternal(e,3,t)}SUBRULE4(e,t){return this.subruleInternal(e,4,t)}SUBRULE5(e,t){return this.subruleInternal(e,5,t)}SUBRULE6(e,t){return this.subruleInternal(e,6,t)}SUBRULE7(e,t){return this.subruleInternal(e,7,t)}SUBRULE8(e,t){return this.subruleInternal(e,8,t)}SUBRULE9(e,t){return this.subruleInternal(e,9,t)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,t,n=La){if(N(this.definedRulesNames,e)){let t={message:Rr.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:W.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(t)}this.definedRulesNames.push(e);let r=this.defineRule(e,t,n);return this[e]=r,r}OVERRIDE_RULE(e,t,n=La){let r=bi(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);let i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return e.apply(this,t),!0}catch(e){if(zi(e))return!1;throw e}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Nt(u(this.gastProductionsCache))}},ya=class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=ar,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},D(t,`serializedGrammar`))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
54
+ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
55
+ For Further details.`);if(m(e)){if(y(e))throw Error(`A Token Vocabulary cannot be empty.
56
+ Note that the first argument for the parser constructor
57
+ is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset==`number`)throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
58
+ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
59
+ For Further details.`)}if(m(e))this.tokensMap=x(e,(e,t)=>(e[t.name]=t,e),{});else if(D(e,`modes`)&&rt(w(u(e.modes)),vr)){let t=bt(w(u(e.modes)));this.tokensMap=x(t,(e,t)=>(e[t.name]=t,e),{})}else if(oe(e))this.tokensMap=A(e);else throw Error(`<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition`);this.tokensMap.EOF=Nr;let n=rt(D(e,`modes`)?w(u(e.modes)):u(e),e=>y(e.categoryMatches));this.tokenMatcher=n?ar:ir,cr(u(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let r=D(n,`resyncEnabled`)?n.resyncEnabled:La.resyncEnabled,i=D(n,`recoveryValueFunc`)?n.recoveryValueFunc:La.recoveryValueFunc,a=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a;let o;return o=this.outputCst===!0?function(...n){try{this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,n);let r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}}:function(...n){try{return this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,n)}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(o,{ruleName:e,originalGrammarAction:t})}invokeRuleCatch(e,t,n){let r=this.RULE_STACK.length===1,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(zi(e)){let t=e;if(i){let r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){let e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return n(e)}if(this.outputCst){let e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(r)return this.moveToTerminatedState(),n(e);throw t}throw e}optionInternal(e,t){let n=this.getKeyForAutomaticLookahead(512,t);return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r=this.getLaFuncFromCache(n),i;if(typeof e!=`function`){i=e.DEF;let t=e.GATE;if(t!==void 0){let e=r;r=()=>t.call(this)&&e.call(this)}}else i=e;if(r.call(this)===!0)return i.call(this)}atLeastOneInternal(e,t){let n=this.getKeyForAutomaticLookahead(Xi,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r=this.getLaFuncFromCache(n),i;if(typeof t!=`function`){i=t.DEF;let e=t.GATE;if(e!==void 0){let t=r;r=()=>e.call(this)&&t.call(this)}}else i=t;if(r.call(this)===!0){let e=this.doSingleRepetition(i);for(;r.call(this)===!0&&e===!0;)e=this.doSingleRepetition(i)}else throw this.raiseEarlyExitException(e,U.REPETITION_MANDATORY,t.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],r,Xi,e,Kr)}atLeastOneSepFirstInternal(e,t){let n=this.getKeyForAutomaticLookahead(Qi,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){let r=t.DEF,i=t.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){r.call(this);let t=()=>this.tokenMatcher(this.LA(1),i);for(;this.tokenMatcher(this.LA(1),i)===!0;)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,qr],t,Qi,e,qr)}else throw this.raiseEarlyExitException(e,U.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG)}manyInternal(e,t){let n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r=this.getLaFuncFromCache(n),i;if(typeof t!=`function`){i=t.DEF;let e=t.GATE;if(e!==void 0){let t=r;r=()=>e.call(this)&&t.call(this)}}else i=t;let a=!0;for(;r.call(this)===!0&&a===!0;)a=this.doSingleRepetition(i);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],r,768,e,Wr,a)}manySepFirstInternal(e,t){let n=this.getKeyForAutomaticLookahead(Zi,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){let r=t.DEF,i=t.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){r.call(this);let t=()=>this.tokenMatcher(this.LA(1),i);for(;this.tokenMatcher(this.LA(1),i)===!0;)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Gr],t,Zi,e,Gr)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,Qi,e,i)}doSingleRepetition(e){let t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){let n=this.getKeyForAutomaticLookahead(256,t),r=m(e)?e:e.DEF,i=this.getLaFuncFromCache(n).call(this,r);if(i!==void 0)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){let e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Ui(t,e))}}subruleInternal(e,t,n){let r;try{let i=n===void 0?void 0:n.ARGS;return this.subruleIdx=t,r=e.apply(this,i),this.cstPostNonTerminal(r,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),r}catch(t){throw this.subruleInternalError(t,n,e.ruleName)}}subruleInternalError(e,t,n){throw zi(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,t!==void 0&&t.LABEL!==void 0?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{let t=this.LA(1);this.tokenMatcher(t,e)===!0?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r,i=this.LA(0);throw r=n!==void 0&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Vi(r,t,i))}consumeInternalRecovery(e,t,n){if(this.recoveryEnabled&&n.name===`MismatchedTokenException`&&!this.isBackTracking()){let r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===`InRuleRecoveryException`?n:e}}throw n}saveRecogState(){let e=this.errors,t=A(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Nr)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},ba=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=D(e,`errorMessageProvider`)?e.errorMessageProvider:Ia.errorMessageProvider}SAVE_ERROR(e){if(zi(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:A(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error(`Trying to save an Error which is not a RecognitionException`)}get errors(){return A(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){let r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],a=li(e,i,t,this.maxLookahead)[0],o=[];for(let e=1;e<=this.maxLookahead;e++)o.push(this.LA(e));let s=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:o,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new Wi(s,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){let n=this.getCurrRuleFullName(),r=this.getGAstProductions()[n],i=ci(e,r,this.maxLookahead),a=[];for(let e=1;e<=this.maxLookahead;e++)a.push(this.LA(e));let o=this.LA(0),s=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:i,actual:a,previous:o,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Hi(s,this.LA(1),o))}},xa=class{initContentAssist(){}computeContentAssist(e,t){let n=this.gastProductionsCache[e];if(ie(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return Yr([n],t,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){let t=it(e.ruleStack),n=this.getGAstProductions()[t];return new Hr(n,e).startWalking()}},Sa={description:`This Object indicates the Parser is during Recording Phase`};Object.freeze(Sa);var Ca=!0,wa=255,Ta=H({name:`RECORDING_PHASE_TOKEN`,pattern:V.NA});cr([Ta]);var Ea=Pr(Ta,`This IToken indicates the Parser is in Recording Phase
60
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(Ea);var Da={name:`This CSTNode indicates the Parser is in Recording Phase
61
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Oa=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT(`Enable Recording`,()=>{for(let e=0;e<10;e++){let t=e>0?e:``;this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT(`Deleting Recording methods`,()=>{let e=this;for(let t=0;t<10;t++){let n=t>0?t:``;delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return Fa}topLevelRuleRecord(e,t){try{let n=new Ot({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(e.KNOWN_RECORDER_ERROR!==!0)try{e.message+=`
62
+ This error was thrown during the "grammar recording phase" For more info see:
63
+ https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw e}throw e}}optionInternalRecord(e,t){return ka.call(this,I,e,t)}atLeastOneInternalRecord(e,t){ka.call(this,kt,t,e)}atLeastOneSepFirstInternalRecord(e,t){ka.call(this,At,t,e,Ca)}manyInternalRecord(e,t){ka.call(this,L,t,e)}manySepFirstInternalRecord(e,t){ka.call(this,jt,t,e,Ca)}orInternalRecord(e,t){return Aa.call(this,e,t)}subruleInternalRecord(e,t,n){if(Ma(t),!e||D(e,`ruleName`)===!1){let n=Error(`<SUBRULE${ja(t)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}let r=_e(this.recordingProdStack),i=e.ruleName,a=new P({idx:t,nonTerminalName:i,label:n?.LABEL,referencedRule:void 0});return r.definition.push(a),this.outputCst?Da:Sa}consumeInternalRecord(e,t,n){if(Ma(t),!mr(e)){let n=Error(`<CONSUME${ja(t)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}let r=_e(this.recordingProdStack),i=new R({idx:t,terminalType:e,label:n?.LABEL});return r.definition.push(i),Ea}};function ka(e,t,n,r=!1){Ma(n);let i=_e(this.recordingProdStack),a=d(t)?t:t.DEF,o=new e({definition:[],idx:n});return r&&(o.separator=t.SEP),D(t,`MAX_LOOKAHEAD`)&&(o.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(o),a.call(this),i.definition.push(o),this.recordingProdStack.pop(),Sa}function Aa(e,t){Ma(t);let n=_e(this.recordingProdStack),r=m(e)===!1,i=r===!1?e:e.DEF,a=new Mt({definition:[],idx:t,ignoreAmbiguities:r&&e.IGNORE_AMBIGUITIES===!0});return D(e,`MAX_LOOKAHEAD`)&&(a.maxLookahead=e.MAX_LOOKAHEAD),a.hasPredicates=yt(i,e=>d(e.GATE)),n.definition.push(a),p(i,e=>{let t=new F({definition:[]});a.definition.push(t),D(e,`IGNORE_AMBIGUITIES`)?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:D(e,`GATE`)&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()}),Sa}function ja(e){return e===0?``:`${e}`}function Ma(e){if(e<0||e>wa){let t=Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${wa+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}var Na=class{initPerformanceTracer(e){if(D(e,`traceInitPerf`)){let t=e.traceInitPerf,n=typeof t==`number`;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=Ia.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(this.traceInitPerf===!0){this.traceInitIndent++;let n=Array(this.traceInitIndent+1).join(` `);this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);let{time:r,value:i}=Ct(t),a=r>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${n}<-- <${e}> time: ${r}ms`),this.traceInitIndent--,i}return t()}};function Pa(e,t){t.forEach(t=>{let n=t.prototype;Object.getOwnPropertyNames(n).forEach(r=>{if(r===`constructor`)return;let i=Object.getOwnPropertyDescriptor(n,r);i&&(i.get||i.set)?Object.defineProperty(e.prototype,r,i):e.prototype[r]=t.prototype[r]})})}var Fa=Pr(Nr,``,NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Fa);var Ia=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Ir,nodeLocationTracking:`none`,traceInitPerf:!1,skipValidations:!1}),La=Object.freeze({recoveryValueFunc:()=>void 0,resyncEnabled:!0}),W;(function(e){e[e.INVALID_RULE_NAME=0]=`INVALID_RULE_NAME`,e[e.DUPLICATE_RULE_NAME=1]=`DUPLICATE_RULE_NAME`,e[e.INVALID_RULE_OVERRIDE=2]=`INVALID_RULE_OVERRIDE`,e[e.DUPLICATE_PRODUCTIONS=3]=`DUPLICATE_PRODUCTIONS`,e[e.UNRESOLVED_SUBRULE_REF=4]=`UNRESOLVED_SUBRULE_REF`,e[e.LEFT_RECURSION=5]=`LEFT_RECURSION`,e[e.NONE_LAST_EMPTY_ALT=6]=`NONE_LAST_EMPTY_ALT`,e[e.AMBIGUOUS_ALTS=7]=`AMBIGUOUS_ALTS`,e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]=`CONFLICT_TOKENS_RULES_NAMESPACE`,e[e.INVALID_TOKEN_NAME=9]=`INVALID_TOKEN_NAME`,e[e.NO_NON_EMPTY_LOOKAHEAD=10]=`NO_NON_EMPTY_LOOKAHEAD`,e[e.AMBIGUOUS_PREFIX_ALTS=11]=`AMBIGUOUS_PREFIX_ALTS`,e[e.TOO_MANY_ALTS=12]=`TOO_MANY_ALTS`,e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]=`CUSTOM_LOOKAHEAD_VALIDATION`})(W||={});var Ra=class e{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT(`performSelfAnalysis`,()=>{let t;this.selfAnalysisDone=!0;let n=this.className;this.TRACE_INIT(`toFastProps`,()=>{wt(this)}),this.TRACE_INIT(`Grammar Recording`,()=>{try{this.enableRecording(),p(this.definedRulesNames,e=>{let t=this[e].originalGrammarAction,n;this.TRACE_INIT(`${e} Rule`,()=>{n=this.topLevelRuleRecord(e,t)}),this.gastProductionsCache[e]=n})}finally{this.disableRecording()}});let r=[];if(this.TRACE_INIT(`Grammar Resolving`,()=>{r=Mi({rules:u(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)}),this.TRACE_INIT(`Grammar Validations`,()=>{if(y(r)&&this.skipValidations===!1){let e=Ni({rules:u(this.gastProductionsCache),tokenTypes:u(this.tokensMap),errMsgProvider:Rr,grammarName:n}),t=pi({lookaheadStrategy:this.lookaheadStrategy,rules:u(this.gastProductionsCache),tokenTypes:u(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(e,t)}}),y(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT(`computeAllProdsFollows`,()=>{let e=Jt(u(this.gastProductionsCache));this.resyncFollows=e}),this.TRACE_INIT(`ComputeLookaheadFunctions`,()=>{var e,t;(t=(e=this.lookaheadStrategy).initialize)==null||t.call(e,{rules:u(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(u(this.gastProductionsCache))})),!e.DEFER_DEFINITION_ERRORS_HANDLING&&!y(this.definitionErrors))throw t=T(this.definitionErrors,e=>e.message),Error(`Parser Definition Errors detected:\n ${t.join(`
64
+ -------------------------------
65
+ `)}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initContentAssist(),n.initGastRecorder(t),n.initPerformanceTracer(t),D(t,`ignoredIssues`))throw Error(`The <ignoredIssues> IParserConfig property has been deprecated.
66
+ Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
67
+ See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
68
+ For further details.`);this.skipValidations=D(t,`skipValidations`)?t.skipValidations:Ia.skipValidations}};Ra.DEFER_DEFINITION_ERRORS_HANDLING=!1,Pa(Ra,[Ji,ta,ga,_a,ya,va,ba,xa,Oa,Na]);var za=class extends Ra{constructor(e,t=Ia){let n=A(t);n.outputCst=!0,super(e,n)}};function Ba(e,t){let n=e.lexer.tokenize(t);if(n.errors.length>0){let r=n.errors[0],i=Number.isFinite(r.offset)?r.offset:t.length,a=i+(Number.isFinite(r.length)?r.length:0);throw Error(`Error lexing ${e.diagramType} diagram: ${r.message} at line ${r.line??1}, column ${r.column??1} [${i},${a})`)}e.parser.input=n.tokens;let r=e.entry();if(e.parser.errors.length>0)throw Error(`Error parsing ${e.diagramType} diagram: ${e.parser.errors[0].message}`);e.visit(r)}O(Ba,`runChevrotainParse`);var G={SOLID_ARROW:0,BACK_ARROW:1,LINE_SOLID:2,CIRCLE_ARROW:3,CROSS_ARROW:4,CIRCLE_ARROW_REVERSED:5,CROSS_ARROW_REVERSED:6},Va=`LR`,Ha=De.usecase,Ua=O(()=>({actors:new Map,useCases:new Map,systemBoundaries:new Map,relationships:[],notes:new Map,jsonNodes:new Map,classDefs:new Map,symbols:new Map,direction:Va,relationshipCounter:0,noteCounter:0,accTitle:``,accDescription:``,ast:void 0,config:structuredClone(Ha)}),`createModel`),Wa=O(e=>{if(!(e.actors instanceof Map)||!(e.useCases instanceof Map)||!(e.systemBoundaries instanceof Map)||!Array.isArray(e.relationships)||!(e.notes instanceof Map)||!(e.jsonNodes instanceof Map)||!(e.classDefs instanceof Map)||!(e.symbols instanceof Map)||![`TB`,`TD`,`BT`,`RL`,`LR`].includes(e.direction)||!Number.isSafeInteger(e.relationshipCounter)||e.relationshipCounter<0||!Number.isSafeInteger(e.noteCounter)||e.noteCounter<0||typeof e.accTitle!=`string`||typeof e.accDescription!=`string`||!e.config)throw Error(`Cannot commit an incomplete usecase model`)},`assertCompleteModel`),K=Ua(),Ga=O(()=>structuredClone(K.config),`getConfig`),Ka=O(()=>K.ast,`getAST`),qa=O(e=>{let t=structuredClone(e);Wa(t);let n=Me(),r=ke();try{we(t.accTitle),Ce(t.accDescription),K=t}catch(e){throw we(n),Ce(r),e}},`commit`),Ja=O(()=>{K=Ua(),Te()},`clear`),Ya=O(()=>K.actors,`getActors`),Xa=O(e=>K.actors.get(e),`getActor`),Za=O(()=>K.useCases,`getUseCases`),Qa=O(e=>K.useCases.get(e),`getUseCase`),$a=O(()=>K.systemBoundaries,`getSystemBoundaries`),eo=O(e=>K.systemBoundaries.get(e),`getSystemBoundary`),to=O(()=>K.relationships,`getRelationships`),no=O(()=>K.notes,`getNotes`),ro=O(e=>K.notes.get(e),`getNote`),io=O(()=>K.jsonNodes,`getJsonNodes`),ao=O(e=>K.jsonNodes.get(e),`getJsonNode`),oo=O(()=>K.classDefs,`getClassDefs`),so=O(e=>K.classDefs.get(e),`getClassDef`),co=O(()=>K.direction,`getDirection`),lo=O(e=>{let t=new Map;for(let n of[`default`,...e]){let e=K.classDefs.get(n);if(e)for(let n of e.styles){let e=n.trim(),r=e.indexOf(`:`),i=(r===-1?e:e.slice(0,r)).trim();i&&t.set(i,e)}}return[...t.values()]},`getCompiledStyles`),uo=O(e=>e.replaceAll(`~`,`~0`).replaceAll(`/`,`~1`),`escapeJsonPointerPart`),fo=O(e=>typeof e==`string`?e:e===null?`null`:String(e),`displayJsonScalar`),po=O((e,t,n=e=>e)=>{let r=[],i=O((e,t,i)=>{r.push({key:n(e),accessibleKey:n(t),value:n(i)})},`append`),a=O((e,n,r)=>{if(Array.isArray(e)){if(e.length===0){i(n,n,`[]`);return}if(e.every(e=>e===null||[`string`,`number`,`boolean`].includes(typeof e))){for(let[t,r]of e.entries())i(t===0?n:``,n,fo(r));return}for(let[t,i]of e.entries())a(i,`${n}[${t}]`,`${r}/${t}`);return}if(typeof e==`object`&&e){let o=e,s=t[r]??Object.keys(o);if(s.length===0){i(n,n,`{}`);return}for(let e of s){let t=n?`${n}.${e}`:e;a(o[e],t,`${r}/${uo(e)}`)}return}i(n,n,fo(e))},`visit`);return a(e,``,``),r},`flattenJsonRows`),mo=O(e=>{switch(e.type){case`hollow`:return`usecaseActorHollow`;case`awesome`:return`usecaseActorAwesome`;case`icon`:return`usecaseActorIcon`;case`normal`:return`usecaseActor`}},`actorShape`),ho=O(e=>e.shape===`ellipse`?e.business?`usecaseBusiness`:`usecaseEllipse`:e.shape,`useCaseShape`),go=O(e=>{switch(e){case G.SOLID_ARROW:return{arrowTypeStart:`none`,arrowTypeEnd:`arrow_point`};case G.BACK_ARROW:return{arrowTypeStart:`arrow_point`,arrowTypeEnd:`none`};case G.CIRCLE_ARROW:return{arrowTypeStart:`none`,arrowTypeEnd:`arrow_circle`};case G.CROSS_ARROW:return{arrowTypeStart:`none`,arrowTypeEnd:`arrow_cross`};case G.CIRCLE_ARROW_REVERSED:return{arrowTypeStart:`arrow_circle`,arrowTypeEnd:`none`};case G.CROSS_ARROW_REVERSED:return{arrowTypeStart:`arrow_cross`,arrowTypeEnd:`none`};case G.LINE_SOLID:return{arrowTypeStart:`none`,arrowTypeEnd:`none`}}},`associationMarkers`),_o=O(e=>{switch(e.type){case`include`:case`extend`:return{arrowTypeStart:`none`,arrowTypeEnd:`arrow_point`,pattern:`dotted`,label:e.type,labelType:`text`};case`generalization`:return{arrowTypeStart:`none`,arrowTypeEnd:`extension`,pattern:`solid`};case`association`:return{...go(e.arrowType),pattern:`solid`,...e.label?{label:e.label}:{},...e.labelType?{labelType:e.labelType}:{}}}},`relationshipVisuals`),vo=O(e=>e.animate||e.animation?[`edge-animation-${e.animation??`fast`}`]:[],`animationClasses`),yo=O((...e)=>e.filter(e=>!!e).join(` `),`classNames`),bo={getConfig:Ga,createModel:Ua,commit:qa,getAST:Ka,clear:Ja,setDiagramTitle:Oe,getDiagramTitle:Ae,setAccTitle:we,getAccTitle:Me,setAccDescription:Ce,getAccDescription:ke,getActors:Ya,getActor:Xa,getUseCases:Za,getUseCase:Qa,getSystemBoundaries:$a,getSystemBoundary:eo,getRelationships:to,getNotes:no,getNote:ro,getJsonNodes:io,getJsonNode:ao,getClassDefs:oo,getClassDef:so,getDirection:co,getData:O(()=>{let e=je(),t={...K.config,...e.usecase},n=O(t=>Ne(t,e),`sanitize`),r=O(e=>n(K.actors.get(e)?.label??K.useCases.get(e)?.label??K.jsonNodes.get(e)?.id??K.notes.get(e)?.label??e),`endpointLabel`),i=[],a=[],o=0,s=0;for(let t of K.actors.values())i.push({id:t.id,label:n(t.label),labelType:t.labelType,shape:mo(t),isGroup:!1,padding:10,look:e.look,colorIndex:o++,cssClasses:yo(`default`,`usecase-actor`,`usecase-actor-${t.type}`,t.business&&`usecase-business`,...t.classes),cssStyles:[...t.styles],cssCompiledStyles:lo(t.classes),actorType:t.type,business:t.business,...t.icon?{icon:t.icon}:{},...t.stereotype?{stereotype:n(t.stereotype)}:{},...t.parentId?{parentId:t.parentId}:{}});for(let t of K.useCases.values())i.push({id:t.id,label:n(t.label),labelType:t.labelType,shape:ho(t),isGroup:!1,padding:t.shape===`ellipse`?20:10,look:e.look,colorIndex:o++,cssClasses:yo(`default`,`usecase-element`,`usecase-${t.shape}`,t.business&&`usecase-business`,...t.classes),cssStyles:[...t.styles],cssCompiledStyles:lo(t.classes),business:t.business,...t.stereotype?{stereotype:n(t.stereotype)}:{},...t.parentId?{parentId:t.parentId}:{}});for(let t of K.notes.values())i.push({id:t.id,label:n(t.label),labelType:t.labelType,shape:`note`,isGroup:!1,padding:10,look:e.look,cssClasses:`default usecase-note`,cssStyles:[],cssCompiledStyles:lo([]),noteTarget:t.target,noteTargetLabel:n(K.actors.get(t.target)?.label??K.useCases.get(t.target)?.label??K.jsonNodes.get(t.target)?.id??t.target)});for(let t of K.jsonNodes.values())i.push({id:t.id,label:n(t.id),labelType:`text`,shape:`usecaseJsonTable`,isGroup:!1,padding:10,look:e.look,cssClasses:yo(`default`,`usecase-json-table`,...t.classes),cssStyles:[...t.styles],cssCompiledStyles:lo(t.classes),jsonRows:po(t.value,t.propertyOrder,n)});for(let t of K.systemBoundaries.values())i.push({id:t.id,label:n(t.label),labelType:t.labelType,shape:`usecaseSystemBoundary`,isGroup:!0,padding:20,look:e.look,colorIndex:s++,cssClasses:yo(`default`,`system-boundary`,`system-boundary-${t.type}`,...t.classes),cssStyles:[...t.styles],cssCompiledStyles:lo(t.classes),boundaryType:t.type});for(let t of K.relationships){let{label:i,...o}=_o(t);a.push({id:t.id,start:t.source,end:t.target,source:t.source,target:t.target,sourceLabel:r(t.source),targetLabel:r(t.target),type:`edge`,relationshipType:t.type,internal:!1,...o,...i===void 0?{}:{label:n(i)},labelpos:`c`,classes:yo(`default`,`relationship`,`relationship-${t.type}`,...t.classes,...vo(t)),style:[...t.styles],cssCompiledStyles:lo(t.classes),animate:t.animate,...t.animation?{animation:t.animation}:{},look:e.look,thickness:`normal`,minlen:t.minlen,isUserDefinedId:t.explicitId})}for(let t of K.notes.values())a.push({id:`${t.id}-edge`,start:t.id,end:t.target,source:t.id,target:t.target,type:`edge`,relationshipType:`note`,sourceLabel:r(t.id),targetLabel:r(t.target),internal:!0,pattern:`dotted`,arrowTypeStart:`none`,arrowTypeEnd:`none`,labelpos:`c`,classes:`default relationship relationship-note`,style:[],cssCompiledStyles:lo([]),animate:!1,look:e.look,thickness:`normal`,minlen:1,isUserDefinedId:!1});for(let e of i)e.wrappingWidth??=t.wrappingWidth,!e.isGroup&&!e.shape.startsWith(`usecaseActor`)&&(e.minWidth??=t.minNodeWidth),(e.shape===`usecaseEllipse`||e.shape===`usecaseBusiness`)&&(e.spreadPorts=!0);return{nodes:i,edges:a,config:e,type:`usecase`,layoutAlgorithm:`dagre`,direction:co(),nodeSpacing:t.nodeSpacing,rankSpacing:t.rankSpacing,actorFontSize:t.actorFontSize,actorFontFamily:t.actorFontFamily,actorFontWeight:t.actorFontWeight,usecaseFontSize:t.usecaseFontSize,usecaseFontFamily:t.usecaseFontFamily,usecaseFontWeight:t.usecaseFontWeight,diagramPadding:t.diagramPadding,useMaxWidth:t.useMaxWidth,markers:[`point`,`circle`,`cross`,`extension`]}},`getData`)};function xo(e,t,n){let r=[n];return r.index=t,r.input=e,r}O(xo,`customMatch`);var So=O((e,t)=>{if(e[t]!==`"`||e[t+1]!=="`")return null;for(let n=t+2;n<e.length-1;n++)if(e[n]==="`"&&e[n+1]===`"`)return xo(e,t,e.slice(t,n+2));return null},`matchMarkdownString`),Co=O((e,t)=>{if(e[t]!==`%`||e[t+1]!==`%`)return null;for(let n=t-1;n>=0;n--){let t=e[n];if(t===`
69
+ `||t===`\r`)break;if(t!==` `&&t!==` `)return null}let n=t+2;for(;n<e.length&&e[n]!==`
70
+ `&&e[n]!==`\r`;)n++;return xo(e,t,e.slice(t,n))},`matchComment`),wo=O((e,t)=>{for(let n=t-1;n>=0;n--){let t=e[n];if(t===`
71
+ `||t===`\r`)return!0;if(t!==` `&&t!==` `)return!1}return!0},`isIndentedLineStart`),To=O((e,t,n)=>{if(!wo(e,t))return null;let r=n.exec(e.slice(t));return r?xo(e,t,r[0]):null},`matchAccessibilityLine`),Eo=O((e,t)=>{if(!wo(e,t))return null;let n=/^accDescr[\t ]*{/.exec(e.slice(t));if(!n)return null;let r=e.indexOf(`}`,t+n[0].length);return r===-1?null:xo(e,t,e.slice(t,r+1))},`matchAccDescrBlock`),Do=O((e,t)=>{if(e[t]!==`{`)return null;let n=0,r=!1,i=!1;for(let a=t;a<e.length;a++){let o=e[a];if(r){i?i=!1:o===`\\`?i=!0:o===`"`&&(r=!1);continue}if(o===`"`)r=!0;else if(o===`{`)n++;else if(o===`}`&&--n===0)return xo(e,t,e.slice(t,a+1))}return null},`matchJsonObject`),Oo=O((e,t)=>{let n=e.indexOf(`>>`,t);if(n===-1||/[\n\r]/.test(e.slice(t,n)))return null;let r=e.slice(t,n);return r.trim()?xo(e,t,r):null},`matchStereotypeText`),q=H({name:`LABEL_TEXT`,pattern:V.NA}),ko=H({name:`WORD`,pattern:V.NA,categories:q}),Ao=H({name:`NUMBER`,pattern:/(?:\d+\.\d+|\d+|\.\d+)(?:[A-Za-z]+)?/,categories:q}),J=H({name:`IDENTIFIER`,pattern:/\w+/,longer_alt:Ao,categories:ko}),jo=H({name:`HWS`,pattern:/[\t ]+/,group:V.SKIPPED}),Mo=H({name:`MARKDOWN_STRING`,pattern:So,start_chars_hint:[`"`],line_breaks:!0}),No=H({name:`UNCLOSED_MARKDOWN_STRING`,pattern:/"`[^]*/,line_breaks:!0}),Po=H({name:`COMMENT`,pattern:Co,start_chars_hint:[`%`],line_breaks:!1}),Fo=H({name:`NEWLINE`,pattern:/\r\n|\n|\r/,line_breaks:!0}),Io=H({name:`ACC_DESCR_BLOCK`,pattern:Eo,start_chars_hint:[`a`],line_breaks:!0}),Lo=/^accTitle[\t ]*:[^\n\r]*/,Ro=/^accDescr[\t ]*:[^\n\r]*/,zo=H({name:`ACC_TITLE_LINE`,pattern:O((e,t)=>To(e,t,Lo),`pattern`),start_chars_hint:[`a`],line_breaks:!1}),Bo=H({name:`ACC_DESCR_LINE`,pattern:O((e,t)=>To(e,t,Ro),`pattern`),start_chars_hint:[`a`],line_breaks:!1}),Vo=H({name:`JSON_DECLARATION_START`,pattern:/json[\t ]+\w+[\t ]*@[\t ]*(?={)/,push_mode:`jsonBody`}),Ho=H({name:`JSON_OBJECT_LITERAL`,pattern:Do,start_chars_hint:[`{`],line_breaks:!0,pop_mode:!0}),Uo=H({name:`UNCLOSED_JSON_OBJECT_LITERAL`,pattern:/{[^]*/,line_breaks:!0,pop_mode:!0}),Y=O((e,t)=>H({name:e,pattern:t,longer_alt:J,categories:ko}),`keyword`),Wo=Y(`USECASE`,/usecase-beta/),Go=Y(`ACTOR`,/actor/),Ko=Y(`SYSTEM_BOUNDARY`,/systemBoundary/),qo=Y(`END`,/end/),Jo=Y(`DIRECTION`,/direction/),Yo=Y(`TD`,/TD/),Xo=Y(`TB`,/TB/),Zo=Y(`BT`,/BT/),Qo=Y(`LR`,/LR/),$o=Y(`RL`,/RL/),es=Y(`NOTE`,/note/),ts=Y(`FOR`,/for/),ns=Y(`JSON`,/json/),rs=Y(`CLASS_DEF`,/classDef/),is=Y(`CLASS`,/class/),as=Y(`STYLE`,/style/),os=Y(`INCLUDE`,/include/i),ss=Y(`EXTEND`,/extend/i),cs=Y(`TRUE`,/true/),ls=Y(`FALSE`,/false/),us=H({name:`GENERALIZATION`,pattern:/--\|>/}),ds=H({name:`DEPENDENCY_ARROW`,pattern:/\.\.>/}),fs=H({name:`STEREOTYPE_START`,pattern:/<</,push_mode:`stereotype`}),ps=H({name:`STEREOTYPE_END`,pattern:/>>/,pop_mode:!0}),ms=H({name:`STEREOTYPE_TEXT`,pattern:Oo,line_breaks:!1}),hs=H({name:`UNCLOSED_STEREOTYPE_TEXT`,pattern:/[^\n\r]+/,line_breaks:!1,pop_mode:!0}),gs=H({name:`CLASS_SEPARATOR`,pattern:/:::/}),_s=H({name:`FORWARD_SOLID`,pattern:/--+>/}),vs=H({name:`BACKWARD_SOLID`,pattern:/<--+/}),ys=H({name:`FORWARD_CIRCLE`,pattern:/--o/}),bs=H({name:`BACKWARD_CIRCLE`,pattern:/o--/}),xs=H({name:`FORWARD_CROSS`,pattern:/--x/}),Ss=H({name:`BACKWARD_CROSS`,pattern:/x--/}),X=H({name:`MARKERLESS_SOLID`,pattern:/--+/}),Cs=H({name:`METADATA_START`,pattern:/@{/}),ws=H({name:`AT`,pattern:/@/,categories:q}),Ts=H({name:`LBRACE`,pattern:/{/}),Es=H({name:`RBRACE`,pattern:/}/}),Ds=H({name:`LBRACKET`,pattern:/\[/}),Os=H({name:`RBRACKET`,pattern:/]/}),ks=H({name:`LPAREN`,pattern:/\(/}),As=H({name:`RPAREN`,pattern:/\)/}),js=H({name:`COMMA`,pattern:/,/,categories:q}),Ms=H({name:`COLON`,pattern:/:/,categories:q}),Ns=H({name:`HASH_COLOR`,pattern:/#[\dA-Fa-f]+/,categories:q}),Z=H({name:`PLAIN_STRING`,pattern:/"[^\n\r"]*"|'[^\n\r']*'/}),Ps=H({name:`CSS_IDENTIFIER`,pattern:/--[A-Z_a-z][\w-]*|[A-Z_a-z]\w*(?:-\w+)+/,categories:q}),Fs=H({name:`CSS_ESCAPED_COMMA`,pattern:/\\,/,categories:q}),Is=H({name:`DASH`,pattern:/-/,categories:q}),Ls=H({name:`DOT`,pattern:/\./,categories:q}),Rs=H({name:`PERCENT`,pattern:/%/,categories:q}),zs=H({name:`CSS_PUNCTUATION`,pattern:/[!#$&*+/=?^_|~]/,categories:q}),Bs=[q,ko,jo,Mo,No,Po,Fo,Io,zo,Bo,Vo,Wo,Go,Ko,qo,Jo,Yo,Xo,Zo,Qo,$o,es,ts,ns,rs,is,as,os,ss,cs,ls,us,ds,fs,gs,_s,vs,ys,bs,xs,Ss,X,Cs,ws,Ts,Es,Ds,Os,ks,As,js,Ms,Ns,Z,Ps,J,Ao,Fs,Is,Ls,Rs,zs,H({name:`LABEL_PUNCTUATION`,pattern:/[;<>\\`]/,categories:q}),H({name:`LABEL_SYMBOL`,pattern:/[^\t\n\r !-~]+/,categories:q})],Vs={defaultMode:`defaultMode`,modes:{defaultMode:[...Bs],jsonBody:[Ho,Uo],stereotype:[ps,ms,hs]}},Hs=[...Bs,Ho,Uo,ps,ms,hs],Us=new V(Vs),Ws=O(e=>Fr(e,q)||e.tokenType===Z||e.tokenType===Mo,`isLabelToken`),Gs={allowmixing:!0,newpage:!0,package:!0,rectangle:!0,skinparam:!0},Ks=new class extends za{static{O(this,`UsecaseParser`)}constructor(){super(Hs,{nodeLocationTracking:`full`}),this.RULE(`start`,()=>{this.CONSUME(Wo),this.SUBRULE(this.lineEnd),this.MANY(()=>this.SUBRULE(this.line))}),this.RULE(`line`,()=>{this.OR([{ALT:O(()=>this.SUBRULE(this.blankLine),`ALT`)},{ALT:O(()=>this.SUBRULE(this.commentLine),`ALT`)},{GATE:O(()=>this.isStatementStart(),`GATE`),ALT:O(()=>this.SUBRULE(this.statement),`ALT`)}])}),this.RULE(`statement`,()=>{this.OR([{ALT:O(()=>this.SUBRULE(this.accTitleStatement),`ALT`)},{ALT:O(()=>this.SUBRULE(this.accDescrStatement),`ALT`)},{ALT:O(()=>this.SUBRULE(this.directionStatement),`ALT`)},{ALT:O(()=>this.SUBRULE(this.actorStatement),`ALT`)},{ALT:O(()=>this.SUBRULE(this.systemBoundaryStatement),`ALT`)},{ALT:O(()=>this.SUBRULE(this.noteStatement),`ALT`)},{ALT:O(()=>this.SUBRULE(this.jsonStatement),`ALT`)},{ALT:O(()=>this.SUBRULE(this.classDefStatement),`ALT`)},{ALT:O(()=>this.SUBRULE(this.classStatement),`ALT`)},{ALT:O(()=>this.SUBRULE(this.styleStatement),`ALT`)},{GATE:O(()=>this.isMetadataAssignment(),`GATE`),ALT:O(()=>this.SUBRULE(this.metadataAssignmentStatement),`ALT`)},{GATE:O(()=>!this.isForbiddenPlantUmlStatement(),`GATE`),ALT:O(()=>this.SUBRULE(this.entityStatement),`ALT`)}])}),this.RULE(`lineEnd`,()=>{this.OR([{ALT:O(()=>this.CONSUME(Fo),`ALT`)},{ALT:O(()=>this.CONSUME(Nr),`ALT`)}])}),this.RULE(`blankLine`,()=>{this.CONSUME(Fo)}),this.RULE(`commentLine`,()=>{this.CONSUME(Po),this.SUBRULE(this.lineEnd)}),this.RULE(`accTitleStatement`,()=>{this.CONSUME(zo),this.SUBRULE(this.lineEnd)}),this.RULE(`accDescrStatement`,()=>{this.OR([{ALT:O(()=>this.CONSUME(Bo),`ALT`)},{ALT:O(()=>this.CONSUME(Io),`ALT`)}]),this.SUBRULE(this.lineEnd)}),this.RULE(`actorStatement`,()=>{this.CONSUME(Go),this.SUBRULE(this.actorItem),this.OPTION(()=>{this.OR([{ALT:O(()=>this.AT_LEAST_ONE(()=>{this.CONSUME(js),this.SUBRULE2(this.actorItem)}),`ALT`)},{ALT:O(()=>this.SUBRULE(this.relationTail),`ALT`)}])}),this.SUBRULE(this.lineEnd)}),this.RULE(`actorItem`,()=>{this.SUBRULE(this.actorName),this.OPTION(()=>this.SUBRULE(this.metadata)),this.OPTION2(()=>this.SUBRULE(this.stereotype)),this.OPTION3(()=>this.SUBRULE(this.classSuffix))}),this.RULE(`actorName`,()=>{this.OR([{ALT:O(()=>{this.CONSUME(J),this.OPTION(()=>{this.CONSUME(ks),this.SUBRULE(this.nodeLabel),this.CONSUME(As)})},`ALT`)},{ALT:O(()=>this.CONSUME(Z),`ALT`)},{ALT:O(()=>this.CONSUME(Mo),`ALT`)}])}),this.RULE(`actorDeclarationOnly`,()=>{this.CONSUME(Go),this.SUBRULE(this.actorItem),this.MANY(()=>{this.CONSUME(js),this.SUBRULE2(this.actorItem)}),this.SUBRULE(this.lineEnd)}),this.RULE(`entityStatement`,()=>{this.SUBRULE(this.entityName),this.OPTION(()=>this.SUBRULE(this.relationTail)),this.SUBRULE(this.lineEnd)}),this.RULE(`entityName`,()=>{this.OR([{ALT:O(()=>{this.CONSUME(J),this.OPTION(()=>{this.OR2([{ALT:O(()=>{this.CONSUME(ks),this.SUBRULE(this.nodeLabel),this.CONSUME(As)},`ALT`)},{ALT:O(()=>{this.CONSUME(Ds),this.SUBRULE2(this.nodeLabel),this.CONSUME(Os)},`ALT`)}])})},`ALT`)},{ALT:O(()=>this.CONSUME(Z),`ALT`)},{ALT:O(()=>this.CONSUME(Mo),`ALT`)}]),this.OPTION2(()=>this.SUBRULE(this.useCaseMetadata)),this.OPTION3(()=>this.SUBRULE(this.stereotype)),this.OPTION4(()=>this.SUBRULE(this.classSuffix))}),this.RULE(`nodeLabel`,()=>{this.OR([{ALT:O(()=>this.CONSUME(Z),`ALT`)},{ALT:O(()=>this.CONSUME(Mo),`ALT`)},{ALT:O(()=>this.AT_LEAST_ONE(()=>this.CONSUME(q)),`ALT`)}])}),this.RULE(`useCaseMetadata`,()=>{this.SUBRULE(this.metadata)}),this.RULE(`relationTail`,()=>{this.OPTION({GATE:O(()=>this.LA(1).tokenType===J&&this.LA(2).tokenType===ws,`GATE`),DEF:O(()=>{this.CONSUME(J),this.CONSUME(ws)},`DEF`)}),this.SUBRULE(this.arrow),this.SUBRULE(this.entityName)}),this.RULE(`arrow`,()=>{this.OR([{ALT:O(()=>this.SUBRULE(this.semanticRelation),`ALT`)},{ALT:O(()=>this.SUBRULE(this.forwardSolidOperator),`ALT`)},{ALT:O(()=>this.SUBRULE(this.backwardSolidOperator),`ALT`)},{ALT:O(()=>this.SUBRULE(this.markerlessSolidOperator),`ALT`)},{ALT:O(()=>this.SUBRULE(this.forwardCircleOperator),`ALT`)},{ALT:O(()=>this.SUBRULE(this.backwardCircleOperator),`ALT`)},{ALT:O(()=>this.SUBRULE(this.forwardCrossOperator),`ALT`)},{ALT:O(()=>this.SUBRULE(this.backwardCrossOperator),`ALT`)}])}),this.RULE(`forwardSolidOperator`,()=>{this.CONSUME(_s)}),this.RULE(`backwardSolidOperator`,()=>{this.CONSUME(vs),this.OPTION({GATE:O(()=>this.LA(0).image===`<--`&&this.hasLabeledRight([X]),`GATE`),DEF:O(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(X)},`DEF`)})}),this.RULE(`markerlessSolidOperator`,()=>{this.CONSUME(X),this.OPTION({GATE:O(()=>this.LA(0).image===`--`&&this.hasLabeledRight([_s,X,ys,xs]),`GATE`),DEF:O(()=>{this.SUBRULE(this.edgeLabel),this.OR([{ALT:O(()=>this.CONSUME(_s),`ALT`)},{ALT:O(()=>this.CONSUME2(X),`ALT`)},{ALT:O(()=>this.CONSUME(ys),`ALT`)},{ALT:O(()=>this.CONSUME(xs),`ALT`)}])},`DEF`)})}),this.RULE(`forwardCircleOperator`,()=>{this.CONSUME(ys)}),this.RULE(`backwardCircleOperator`,()=>{this.CONSUME(bs),this.OPTION({GATE:O(()=>this.hasLabeledRight([X]),`GATE`),DEF:O(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(X)},`DEF`)})}),this.RULE(`forwardCrossOperator`,()=>{this.CONSUME(xs)}),this.RULE(`backwardCrossOperator`,()=>{this.CONSUME(Ss),this.OPTION({GATE:O(()=>this.hasLabeledRight([X]),`GATE`),DEF:O(()=>{this.SUBRULE(this.edgeLabel),this.CONSUME(X)},`DEF`)})}),this.RULE(`edgeLabel`,()=>{this.OR([{ALT:O(()=>this.CONSUME(Z),`ALT`)},{ALT:O(()=>this.CONSUME(Mo),`ALT`)},{ALT:O(()=>this.AT_LEAST_ONE(()=>this.CONSUME(q)),`ALT`)}])}),this.RULE(`semanticRelation`,()=>{this.OR([{ALT:O(()=>{this.CONSUME(ds),this.CONSUME(Ms),this.OR2([{ALT:O(()=>this.CONSUME(os),`ALT`)},{ALT:O(()=>this.CONSUME(ss),`ALT`)}])},`ALT`)},{ALT:O(()=>this.CONSUME(us),`ALT`)}])}),this.RULE(`metadata`,()=>{this.CONSUME(Cs),this.MANY(()=>this.CONSUME(Fo)),this.OPTION(()=>{this.SUBRULE(this.metadataProperty),this.MANY2(()=>{this.SUBRULE(this.metadataSeparator),this.SUBRULE2(this.metadataProperty)}),this.OPTION2(()=>this.CONSUME(js)),this.MANY3(()=>this.CONSUME2(Fo))}),this.CONSUME(Es)}),this.RULE(`metadataProperty`,()=>{this.OR([{ALT:O(()=>this.CONSUME(J),`ALT`)},{ALT:O(()=>this.CONSUME(Z),`ALT`)}]),this.CONSUME(Ms),this.OR2([{ALT:O(()=>this.CONSUME2(J),`ALT`)},{ALT:O(()=>this.CONSUME2(Z),`ALT`)},{ALT:O(()=>this.CONSUME(cs),`ALT`)},{ALT:O(()=>this.CONSUME(ls),`ALT`)}])}),this.RULE(`metadataSeparator`,()=>{this.OR([{ALT:O(()=>{this.CONSUME(js),this.MANY(()=>this.CONSUME(Fo))},`ALT`)},{ALT:O(()=>{this.AT_LEAST_ONE(()=>this.CONSUME2(Fo)),this.OPTION(()=>this.CONSUME2(js)),this.MANY2(()=>this.CONSUME3(Fo))},`ALT`)}])}),this.RULE(`systemBoundaryStatement`,()=>{this.CONSUME(Ko),this.SUBRULE(this.systemBoundaryName),this.OPTION(()=>this.SUBRULE(this.metadata)),this.OPTION2(()=>this.SUBRULE(this.classSuffix)),this.SUBRULE(this.lineEnd),this.SUBRULE(this.systemBoundaryContent),this.CONSUME(qo),this.SUBRULE2(this.lineEnd)}),this.RULE(`systemBoundaryName`,()=>{this.OR([{ALT:O(()=>{this.CONSUME(J),this.OPTION(()=>{this.OR2([{ALT:O(()=>{this.CONSUME(ks),this.SUBRULE(this.nodeLabel),this.CONSUME(As)},`ALT`)},{ALT:O(()=>{this.CONSUME(Ds),this.SUBRULE2(this.nodeLabel),this.CONSUME(Os)},`ALT`)}])})},`ALT`)},{ALT:O(()=>this.CONSUME(Z),`ALT`)},{ALT:O(()=>this.CONSUME(Mo),`ALT`)}])}),this.RULE(`systemBoundaryContent`,()=>{this.MANY(()=>{this.OR([{ALT:O(()=>this.SUBRULE(this.blankLine),`ALT`)},{ALT:O(()=>this.SUBRULE(this.commentLine),`ALT`)},{ALT:O(()=>this.SUBRULE(this.boundaryElement),`ALT`)}])})}),this.RULE(`boundaryElement`,()=>{this.OR([{ALT:O(()=>this.SUBRULE(this.actorDeclarationOnly),`ALT`)},{ALT:O(()=>{this.SUBRULE(this.entityName),this.SUBRULE(this.lineEnd)},`ALT`)}])}),this.RULE(`metadataAssignmentStatement`,()=>{this.SUBRULE(this.metadataAssignmentTarget),this.SUBRULE(this.metadata),this.SUBRULE(this.lineEnd)}),this.RULE(`metadataAssignmentTarget`,()=>{this.OR([{ALT:O(()=>this.CONSUME(J),`ALT`)},{ALT:O(()=>this.CONSUME(Z),`ALT`)},{ALT:O(()=>this.CONSUME(Mo),`ALT`)}])}),this.RULE(`noteStatement`,()=>{this.CONSUME(es),this.CONSUME(ts),this.CONSUME(J),this.SUBRULE(this.nodeLabel),this.SUBRULE(this.lineEnd)}),this.RULE(`stereotype`,()=>{this.CONSUME(fs),this.CONSUME(ms),this.CONSUME(ps)}),this.RULE(`classSuffix`,()=>{this.CONSUME(gs),this.CONSUME(J),this.MANY(()=>{this.CONSUME(js),this.CONSUME2(J)})}),this.RULE(`jsonStatement`,()=>{this.CONSUME(Vo),this.CONSUME(Ho),this.OPTION(()=>this.SUBRULE(this.classSuffix)),this.SUBRULE(this.lineEnd)}),this.RULE(`directionStatement`,()=>{this.CONSUME(Jo),this.OR([{ALT:O(()=>this.CONSUME(Yo),`ALT`)},{ALT:O(()=>this.CONSUME(Xo),`ALT`)},{ALT:O(()=>this.CONSUME(Zo),`ALT`)},{ALT:O(()=>this.CONSUME(Qo),`ALT`)},{ALT:O(()=>this.CONSUME($o),`ALT`)}]),this.SUBRULE(this.lineEnd)}),this.RULE(`classDefStatement`,()=>{this.CONSUME(rs),this.CONSUME(J),this.MANY(()=>{this.CONSUME(js),this.CONSUME2(J)}),this.SUBRULE(this.styles),this.SUBRULE(this.lineEnd)}),this.RULE(`classStatement`,()=>{this.CONSUME(is),this.CONSUME(J),this.MANY(()=>{this.CONSUME(js),this.CONSUME2(J)}),this.CONSUME3(J),this.MANY2(()=>{this.CONSUME2(js),this.CONSUME4(J)}),this.SUBRULE(this.lineEnd)}),this.RULE(`styleStatement`,()=>{this.CONSUME(as),this.CONSUME(J),this.SUBRULE(this.styles),this.SUBRULE(this.lineEnd)}),this.RULE(`styles`,()=>{this.SUBRULE(this.styleValue),this.MANY(()=>{this.CONSUME(js),this.SUBRULE2(this.styleValue)})}),this.RULE(`styleValue`,()=>{this.OR([{ALT:O(()=>this.CONSUME(ko),`ALT`)},{ALT:O(()=>this.CONSUME(Ps),`ALT`)},{ALT:O(()=>{this.CONSUME(X),this.CONSUME2(ko)},`ALT`)}]),this.CONSUME(Ms),this.AT_LEAST_ONE(()=>this.SUBRULE(this.styleComponent))}),this.RULE(`styleComponent`,()=>{this.OR([{ALT:O(()=>this.CONSUME(ko),`ALT`)},{ALT:O(()=>this.CONSUME(Z),`ALT`)},{ALT:O(()=>this.CONSUME(Ao),`ALT`)},{ALT:O(()=>this.CONSUME(Ns),`ALT`)},{ALT:O(()=>this.CONSUME(Ps),`ALT`)},{ALT:O(()=>this.CONSUME(Fs),`ALT`)},{ALT:O(()=>this.CONSUME(Is),`ALT`)},{ALT:O(()=>this.CONSUME(Ls),`ALT`)},{ALT:O(()=>this.CONSUME(Rs),`ALT`)},{ALT:O(()=>this.CONSUME(zs),`ALT`)},{ALT:O(()=>this.CONSUME(Ms),`ALT`)},{ALT:O(()=>this.CONSUME(ks),`ALT`)},{ALT:O(()=>this.CONSUME(As),`ALT`)},{ALT:O(()=>this.CONSUME(Ds),`ALT`)},{ALT:O(()=>this.CONSUME(Os),`ALT`)},{ALT:O(()=>this.CONSUME(Ts),`ALT`)},{ALT:O(()=>this.CONSUME(Es),`ALT`)},{ALT:O(()=>this.CONSUME(ws),`ALT`)},{ALT:O(()=>this.CONSUME(X),`ALT`)}])}),this.performSelfAnalysis()}isMetadataAssignment(){let e=this.LA(1).tokenType;return(e===J||e===Z||e===Mo)&&this.LA(2).tokenType===Cs}isStatementStart(){let e=this.LA(1).tokenType;return e!==Nr&&e!==Fo&&e!==Po}isForbiddenPlantUmlStatement(){return this.LA(1).tokenType===J&&Gs[this.LA(1).image.toLowerCase()]===!0}hasLabeledRight(e){if(!Ws(this.LA(1)))return!1;for(let t=2;;t++){let n=this.LA(t);if(e.includes(n.tokenType))return!0;if(!Ws(n))return!1}}},qs=class extends Error{constructor(e,t,n){super(`${e} (line ${t}, column ${n})`),this.line=t,this.column=n,this.name=`UsecaseJsonError`}static{O(this,`UsecaseJsonError`)}},Js=O((e,t,n,r)=>{let i=n,a=r,o=Math.min(Math.max(t,0),e.length);for(let t=0;t<o;t++){let n=e[t];n===`\r`?(i++,a=1):n===`
72
+ `?(t===0||e[t-1]!==`\r`)&&(i++,a=1):a++}return{line:i,column:a}},`locationAtOffset`),Ys=O((e,t,n,r)=>{let i=/\bposition (\d+)\b/u.exec(e);if(i)return Js(t,Number.parseInt(i[1],10),n,r);let a=/\bline (\d+) column (\d+)\b/u.exec(e);if(a){let e=Number.parseInt(a[1],10),t=Number.parseInt(a[2],10);return{line:n+e-1,column:e===1?r+t-1:t}}if(/unexpected end|end of json input/iu.test(e))return Js(t,t.length,n,r)},`locationFromErrorMessage`),Q=class extends Error{constructor(e){super(`Invalid JSON token`),this.offset=e}static{O(this,`JsonWalkError`)}},Xs=class{constructor(e){this.text=e,this.offset=0,this.propertyOrder={}}static{O(this,`PropertyOrderCollector`)}collect(){if(this.skipWhitespace(),this.collectValue(``),this.skipWhitespace(),this.offset!==this.text.length)throw new Q(this.offset);return this.propertyOrder}collectValue(e){this.skipWhitespace();let t=this.text[this.offset];if(t===`{`)this.collectObject(e);else if(t===`[`)this.collectArray(e);else if(t===`"`)this.readString(!1);else if(t===`t`)this.consumeLiteral(`true`);else if(t===`f`)this.consumeLiteral(`false`);else if(t===`n`)this.consumeLiteral(`null`);else if(t===`-`||t>=`0`&&t<=`9`)this.consumeNumber();else throw new Q(this.offset)}collectObject(e){this.offset++;let t=[],n=new Set;if(this.propertyOrder[e]=t,this.skipWhitespace(),this.text[this.offset]===`}`){this.offset++;return}for(;this.offset<this.text.length;){if(this.text[this.offset]!==`"`)throw new Q(this.offset);let r=this.readString(!0),i=`${e}/${r.replaceAll(`~`,`~0`).replaceAll(`/`,`~1`)}`;if(n.has(r)?this.deletePointerSubtree(i):(n.add(r),t.push(r)),this.skipWhitespace(),this.text[this.offset]!==`:`)throw new Q(this.offset);if(this.offset++,this.collectValue(i),this.skipWhitespace(),this.text[this.offset]===`}`){this.offset++;return}if(this.text[this.offset]!==`,`)throw new Q(this.offset);this.offset++,this.skipWhitespace()}throw new Q(this.offset)}collectArray(e){if(this.offset++,this.skipWhitespace(),this.text[this.offset]===`]`){this.offset++;return}let t=0;for(;this.offset<this.text.length;){if(this.collectValue(`${e}/${t}`),t++,this.skipWhitespace(),this.text[this.offset]===`]`){this.offset++;return}if(this.text[this.offset]!==`,`)throw new Q(this.offset);this.offset++,this.skipWhitespace()}throw new Q(this.offset)}readString(e){this.offset++;let t=``;for(;this.offset<this.text.length;){let n=this.offset,r=this.text[this.offset++];if(r===`"`)return t;if(r.charCodeAt(0)<32)throw new Q(n);if(r!==`\\`){e&&(t+=r);continue}let i=this.offset,a=this.text[this.offset++];switch(a){case`"`:case`\\`:case`/`:e&&(t+=a);break;case`b`:e&&(t+=`\b`);break;case`f`:e&&(t+=`\f`);break;case`n`:e&&(t+=`
73
+ `);break;case`r`:e&&(t+=`\r`);break;case`t`:e&&(t+=` `);break;case`u`:{let n=this.text.slice(this.offset,this.offset+4);if(!/^[\dA-Fa-f]{4}$/u.test(n))throw new Q(this.offset);e&&(t+=String.fromCharCode(Number.parseInt(n,16))),this.offset+=4;break}default:throw new Q(i)}}throw new Q(this.offset)}consumeLiteral(e){let t=0;for(let n of e){if(this.text[this.offset+t]!==n)throw new Q(this.offset+t);t++}this.offset+=e.length}consumeNumber(){if(this.text[this.offset]===`-`&&this.offset++,this.text[this.offset]===`0`)this.offset++;else if(this.text[this.offset]>=`1`&&this.text[this.offset]<=`9`)for(;this.text[this.offset]>=`0`&&this.text[this.offset]<=`9`;)this.offset++;else throw new Q(this.offset);if(this.text[this.offset]===`.`){if(this.offset++,this.text[this.offset]<`0`||this.text[this.offset]>`9`)throw new Q(this.offset);for(;this.text[this.offset]>=`0`&&this.text[this.offset]<=`9`;)this.offset++}if(this.text[this.offset]===`e`||this.text[this.offset]===`E`){if(this.offset++,(this.text[this.offset]===`+`||this.text[this.offset]===`-`)&&this.offset++,this.text[this.offset]<`0`||this.text[this.offset]>`9`)throw new Q(this.offset);for(;this.text[this.offset]>=`0`&&this.text[this.offset]<=`9`;)this.offset++}}skipWhitespace(){for(;this.offset<this.text.length;){let e=this.text[this.offset];if(e!==` `&&e!==` `&&e!==`
74
+ `&&e!==`\r`)return;this.offset++}}deletePointerSubtree(e){let t=`${e}/`;for(let n of Object.keys(this.propertyOrder))(n===e||n.startsWith(t))&&delete this.propertyOrder[n]}};function Zs(e,t,n){let r;try{r=JSON.parse(e)}catch(r){let i=r instanceof Error?r.message:String(r),a=Ys(i,e,t,n);if(!a){let r=0;try{new Xs(e).collect()}catch(e){e instanceof Q&&(r=e.offset)}a=Js(e,r,t,n)}throw new qs(`Invalid JSON: ${i}`,a.line,a.column)}if(typeof r!=`object`||!r||Array.isArray(r))throw new qs(`JSON value must have an object root`,t,n);return{value:r,propertyOrder:new Xs(e).collect()}}O(Zs,`parseOrderedJsonObject`);var Qs=O(e=>({shape:e.type===`normal`?`actor`:e.type===`hollow`?`actor-hollow`:e.type===`awesome`?`actor-awesome`:`actor-icon`,...e.label===e.id?{}:{label:e.label},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:`actor`,actorType:e.type,business:e.business,labelType:e.labelType,...e.icon?{icon:e.icon}:{},...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{}}}),`actorNode`),$s=O(e=>({shape:e.shape,...e.label===e.id?{}:{label:e.label},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:`usecase`,useCaseShape:e.shape,business:e.business,labelType:e.labelType,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{}}}),`useCaseNode`),ec=O(e=>({label:e.label,shape:`note`,attrs:{kind:`note`,target:e.target,labelType:e.labelType}}),`noteNode`),tc=O(e=>({label:e.id,shape:`json-table`,...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:`json`,value:e.value,propertyOrder:e.propertyOrder,labelType:`text`}}),`jsonNode`),nc=O(e=>({id:e.id,source:e.source,target:e.target,...e.label?{label:e.label}:{},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{relationshipType:e.type,arrowType:e.arrowType,minlen:e.minlen,explicitId:e.explicitId,animate:e.animate,...e.animation?{animation:e.animation}:{},...e.labelType?{labelType:e.labelType}:{}}}),`relationshipEdge`),rc=O(e=>({id:`${e.id}-edge`,source:e.id,target:e.target,attrs:{relationshipType:`note`,arrowType:G.LINE_SOLID,pattern:`dotted`,minlen:1,explicitId:!1,animate:!1,internal:!0}}),`noteEdge`),ic=O((e,t,n,r)=>{let i={};for(let t of e.getActors().values())i[t.id]=Qs(t);for(let t of e.getUseCases().values())i[t.id]=$s(t);for(let t of e.getNotes().values())i[t.id]=ec(t);for(let t of e.getJsonNodes().values())i[t.id]=tc(t);let a={};for(let t of e.getSystemBoundaries().values())a[t.id]={...t.label===t.id?{}:{title:t.label},nodes:[...t.members],...t.classes.length?{classes:[...t.classes]}:{},...t.styles.length?{styles:[...t.styles]}:{},attrs:{kind:`systemBoundary`,boundaryType:t.type,labelType:t.labelType}};let o={};for(let t of e.getClassDefs().values())o[t.id]={styles:[...t.styles]};let s=e.getDirection();return{version:1,diagramType:`usecase`,source:t,header:{keyword:`usecase`,direction:s===`TD`?`TB`:s,span:n},...e.getAccTitle()?{accTitle:e.getAccTitle()}:{},...e.getAccDescription()?{accDescr:e.getAccDescription()}:{},nodes:i,edges:[...e.getRelationships().map(nc),...[...e.getNotes().values()].map(rc)],groups:a,classDefs:o,statements:r}},`buildUsecaseGraphAST`),$=O(e=>`line ${e.line}, column ${e.column} [${e.span[0]},${e.span[1]})`,`locationText`),ac=O(e=>e===void 0?``:` (label "${e}")`,`labelSuffix`),oc=O(e=>e.generated?e.label:void 0,`generatedFrom`),sc=O((e,t)=>{for(let n of t)e.includes(n)||e.push(n)},`pushUnique`),cc=class{constructor(e){this.db=e,this.source=``,this.statements=[],this.elements=[],this.boundaries=[],this.jsonDrafts=[],this.relationshipDrafts=[],this.noteDrafts=[],this.metadataAssignments=[],this.classAssignments=[],this.styleAssignments=[],this.classDefinitions=[],this.directions=[],this.model=e.createModel()}static{O(this,`UsecaseModelBuilder`)}reset(e){this.model=this.db.createModel(),this.source=e,this.statements=[],this.elements.length=0,this.boundaries.length=0,this.jsonDrafts.length=0,this.relationshipDrafts.length=0,this.noteDrafts.length=0,this.metadataAssignments.length=0,this.classAssignments.length=0,this.styleAssignments.length=0,this.classDefinitions.length=0,this.directions.length=0}addElement(e){this.elements.push(e)}addBoundary(e){this.boundaries.push(e)}addJson(e){this.jsonDrafts.push(e)}addRelationship(e){this.relationshipDrafts.push(e)}addNote(e){this.noteDrafts.push(e)}addMetadataAssignment(e,t,n,r){this.metadataAssignments.push({target:e,targetLocation:t,metadata:n,statement:r})}addClassDef(e,t){this.classDefinitions.push({ids:e,styles:t})}addClassAssignment(e,t){this.classAssignments.push({targets:e,classes:t})}addStyleAssignment(e,t,n){this.styleAssignments.push({target:e,location:t,styles:n})}setDirection(e){this.directions.push(e===`TD`?`TB`:e)}setAccTitle(e){this.model.accTitle=e}setAccDescription(e){this.model.accDescription=e}setStatements(e){this.statements=e}getActors(){return this.model.actors}getUseCases(){return this.model.useCases}getSystemBoundaries(){return this.model.systemBoundaries}getRelationships(){return this.model.relationships}getNotes(){return this.model.notes}getJsonNodes(){return this.model.jsonNodes}getClassDefs(){return this.model.classDefs}getDirection(){return this.model.direction}getAccTitle(){return this.model.accTitle}getAccDescription(){return this.model.accDescription}finalize(e){let t=new Map,n=new Map,r=new Map,i=new Map;for(let e of this.relationshipDrafts)this.recordFirst(i,e.source.id,e.source.location.span[0]),this.recordFirst(i,e.target.id,e.target.location.span[0]);for(let e of this.elements)this.recordFirst(i,e.id,e.location.span[0]);for(let e of this.boundaries)this.recordFirst(i,e.id,e.location.span[0]);for(let e of this.jsonDrafts)this.recordFirst(i,e.id,e.location.span[0]);let a=[...this.elements.map(e=>({offset:e.location.span[0],type:`element`,value:e})),...this.boundaries.map(e=>({offset:e.location.span[0],type:`boundary`,value:e})),...this.jsonDrafts.map(e=>({offset:e.location.span[0],type:`json`,value:e})),...this.relationshipDrafts.filter(e=>e.explicitId).map(e=>({offset:e.explicitIdLocation.span[0],type:`edge`,value:e}))].sort((e,t)=>e.offset-t.offset);for(let e of a)e.type===`element`?this.collectElement(e.value,t,n):e.type===`boundary`?this.collectBoundary(e.value,t,r):e.type===`json`?this.registerUnique(t,e.value.id,`json`,e.value.location,!1):this.registerUnique(t,e.value.explicitId,`edge`,e.value.explicitIdLocation,!1);this.materializeElements(n,i),this.materializeBoundaries(r,i),this.materializeJson(i);let o=this.materializeRelationships(t,n,i);this.reorderElements(n,i),this.applyMetadataAssignments(t,n,r,o),this.validateAndRefreshElements(n),this.refreshBoundaries(r,n),this.materializeNotes(t),this.applyClassDefinitions(),this.applyClassesAndStyles(t,o),this.model.direction=this.directions.at(-1)??this.model.direction,this.model.symbols=new Map([...t].map(([e,t])=>[e,t.kind]));let s=ic(this,this.source,e,this.statements);return this.model.ast=s,this.db.commit(this.model),s}collectElement(e,t,n){let r=t.get(e.id),i=oc({generated:e.generated,label:e.label.text});r&&r.kind!==e.kind&&this.conflict(`ID '${e.id}' is declared as both ${r.kind} and ${e.kind}`,e.location,r.location,i,oc(r)),r&&(r.generated||e.generated)&&this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,r.location,i,oc(r));let a=n.get(e.id);if(!a){let r={kind:e.kind,id:e.id,label:e.label,location:e.location,generated:e.generated,classes:[...e.classes],...e.parentId?{parentId:e.parentId,parentLocation:e.parentLocation}:{},...e.shape?{shape:e.shape}:{},...e.stereotype?{stereotype:e.stereotype,stereotypeLocation:e.location}:{}};this.applyDeclarationMetadata(r,e.metadata),n.set(e.id,r),t.set(e.id,{kind:e.kind,location:e.location,generated:e.generated,label:e.label.text});return}(a.label.text!==e.label.text||a.label.type!==e.label.type)&&this.conflict(`ID '${e.id}' has conflicting labels`,e.location,a.location),e.shape&&a.shape&&e.shape!==a.shape&&this.conflict(`Use case '${e.id}' has conflicting shapes`,e.location,a.location),e.parentId&&a.parentId&&e.parentId!==a.parentId&&this.conflict(`Element '${e.id}' belongs to more than one system boundary`,e.parentLocation??e.location,a.parentLocation??a.location),e.stereotype&&a.stereotype&&e.stereotype!==a.stereotype&&this.conflict(`Element '${e.id}' has conflicting stereotypes`,e.location,a.stereotypeLocation??a.location),a.shape??=e.shape,a.parentId??=e.parentId,a.parentLocation??=e.parentLocation,a.stereotype??=e.stereotype,a.stereotypeLocation??=e.stereotype?e.location:void 0,sc(a.classes,e.classes),this.applyDeclarationMetadata(a,e.metadata)}collectBoundary(e,t,n){let r=t.get(e.id),i=oc({generated:e.generated,label:e.label.text});r&&r.kind!==`boundary`&&this.conflict(`ID '${e.id}' is declared as both ${r.kind} and boundary`,e.location,r.location,i,oc(r)),r&&(r.generated||e.generated)&&this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,r.location,i,oc(r));let a=n.get(e.id);if(a){(a.label.text!==e.label.text||a.label.type!==e.label.type)&&this.conflict(`Boundary '${e.id}' has conflicting titles`,e.location,a.location),sc(a.classes,e.classes);return}n.set(e.id,{id:e.id,label:e.label,location:e.location,generated:e.generated,classes:[...e.classes],styles:[],members:[]}),t.set(e.id,{kind:`boundary`,location:e.location,generated:e.generated,label:e.label.text})}materializeElements(e,t){for(let n of[...e.values()].sort((e,n)=>(t.get(e.id)??0)-(t.get(n.id)??0)))this.setElementModel(n)}materializeBoundaries(e,t){for(let n of[...e.values()].sort((e,n)=>(t.get(e.id)??0)-(t.get(n.id)??0)))this.model.systemBoundaries.set(n.id,{id:n.id,label:n.label.text,labelType:n.label.type,type:n.type??`rect`,members:[],classes:[...n.classes],styles:[...n.styles]})}materializeJson(e){for(let t of[...this.jsonDrafts].sort((t,n)=>(e.get(t.id)??0)-(e.get(n.id)??0)))this.model.jsonNodes.set(t.id,{id:t.id,value:t.value,propertyOrder:t.propertyOrder,classes:[...t.classes],styles:[]})}materializeRelationships(e,t,n){let r=new Map,i=0;for(let a of this.relationshipDrafts){let o=this.resolveEndpoint(a.source,e,t,n),s=this.resolveEndpoint(a.target,e,t,n);this.validateRelationship(a,o,s,e);let c=a.explicitId??`edge-${i++}`,l={id:c,explicitId:!!a.explicitId,source:a.source.id,target:a.target.id,type:a.type,arrowType:a.arrowType,...a.label?{label:a.label.text,labelType:a.label.type}:{},minlen:a.minlen,classes:[],styles:[],animate:!1};this.model.relationships.push(l),r.set(c,{draft:a,relationship:l})}return this.model.relationshipCounter=i,r}resolveEndpoint(e,t,n,r){if(e.classesOnReference&&!e.declaration)throw Error(`Relationship endpoint '${e.id}' uses ::: without declaring the node at ${$(e.location)}`);let i=t.get(e.id);return i?i.kind:(n.set(e.id,{kind:`usecase`,id:e.id,label:e.label,location:e.location,generated:e.generated,shape:`ellipse`,classes:[]}),t.set(e.id,{kind:`usecase`,location:e.location,generated:e.generated,label:e.label.text}),this.recordFirst(r,e.id,e.location.span[0]),`usecase`)}reorderElements(e,t){let n=new Map(this.model.actors),r=new Map(this.model.useCases);this.model.actors.clear(),this.model.useCases.clear();for(let i of[...e.values()].sort((e,n)=>(t.get(e.id)??0)-(t.get(n.id)??0))){!n.has(i.id)&&!r.has(i.id)&&this.setElementModel(i);let e=n.get(i.id)??this.model.actors.get(i.id),t=r.get(i.id)??this.model.useCases.get(i.id);e?this.model.actors.set(i.id,e):t&&this.model.useCases.set(i.id,t)}}applyMetadataAssignments(e,t,n,r){for(let i of this.metadataAssignments){let a=e.get(i.target);if(!a){let e=this.inferMetadataKind(i.metadata);throw Error(`Metadata target '${i.target}' is unresolved${e?` (metadata implies ${e})`:``} at ${$(i.targetLocation)}`)}if(a.kind===`actor`||a.kind===`usecase`)this.applyStandaloneElementMetadata(t.get(i.target),i.metadata);else if(a.kind===`boundary`){let e=n.get(i.target);for(let t of i.metadata.properties)(t.key!==`type`||t.value!==`rect`&&t.value!==`package`)&&this.invalidMetadata(i.target,a.kind,t),e.type=t.value}else if(a.kind===`edge`){let e=r.get(i.target);if(!e)throw Error(`Metadata target '${i.target}' is not an explicit edge at ${$(i.targetLocation)}`);i.statement.kind=`edgeMetadata`,i.statement.edges=[{id:i.target,span:i.statement.span,idSpan:i.targetLocation.span,...i.statement.metadata?{metadata:i.statement.metadata}:{}}],delete i.statement.nodes;for(let t of i.metadata.properties)t.key===`animate`&&typeof t.value==`boolean`?e.relationship.animate=t.value:t.key===`animation`&&(t.value===`fast`||t.value===`slow`)?(e.relationship.animation=t.value,e.relationship.animate=!0):this.invalidMetadata(i.target,a.kind,t)}else for(let e of i.metadata.properties)this.invalidMetadata(i.target,a.kind,e)}for(let{relationship:e}of r.values())e.animation&&(e.animate=!0)}applyStandaloneElementMetadata(e,t){for(let n of t.properties)e.kind===`actor`?this.applyActorProperty(e,n,!0):n.key===`business`&&typeof n.value==`boolean`?e.business=n.value:this.invalidMetadata(e.id,e.kind,n)}applyDeclarationMetadata(e,t){if(t)for(let n of t.properties)e.kind===`actor`?this.applyActorProperty(e,n,!1):n.key===`business`&&typeof n.value==`boolean`?(e.business!==void 0&&e.business!==n.value&&this.conflict(`Use case '${e.id}' has conflicting business metadata`,n.location,e.location),e.business=n.value):this.invalidMetadata(e.id,e.kind,n)}applyActorProperty(e,t,n){t.key===`type`&&(t.value===`normal`||t.value===`hollow`||t.value===`awesome`)?(!n&&e.actorType!==void 0&&e.actorType!==t.value&&this.conflict(`Actor '${e.id}' has conflicting type metadata`,t.location,e.location),e.actorType=t.value):t.key===`icon`&&typeof t.value==`string`?(!n&&e.icon!==void 0&&e.icon!==t.value&&this.conflict(`Actor '${e.id}' has conflicting icon metadata`,t.location,e.location),e.icon=t.value):t.key===`business`&&typeof t.value==`boolean`?(!n&&e.business!==void 0&&e.business!==t.value&&this.conflict(`Actor '${e.id}' has conflicting business metadata`,t.location,e.location),e.business=t.value):this.invalidMetadata(e.id,e.kind,t)}validateAndRefreshElements(e){for(let t of e.values()){let e=t.icon?`icon`:t.actorType??`normal`;if(t.kind===`actor`){if(t.icon&&t.actorType&&t.actorType!==`normal`)throw Error(`Actor '${t.id}' cannot combine icon with type '${t.actorType}' at ${$(t.location)}`);if(t.business&&(e===`icon`||e===`awesome`))throw Error(`Business actor '${t.id}' must use normal or hollow geometry at ${$(t.location)}`)}else if((t.shape??`ellipse`)===`rect`&&t.business)throw Error(`Rectangular use case '${t.id}' cannot be a business use case at ${$(t.location)}`);this.setElementModel(t)}}refreshBoundaries(e,t){for(let t of e.values())t.members.length=0;for(let t of[...this.elements].sort((e,t)=>e.location.span[0]-t.location.span[0])){if(!t.parentId)continue;let n=e.get(t.parentId);if(!n)throw Error(`Parent boundary '${t.parentId}' for '${t.id}' is unresolved at ${$(t.parentLocation??t.location)}`);n.members.includes(t.id)||n.members.push(t.id)}for(let n of t.values())if(n.parentId&&!e.has(n.parentId))throw Error(`Parent boundary '${n.parentId}' for '${n.id}' is unresolved at ${$(n.parentLocation??n.location)}`);for(let t of e.values()){let e=this.model.systemBoundaries.get(t.id);e.type=t.type??`rect`,e.members=[...t.members],e.classes=[...t.classes],e.styles=[...t.styles]}}materializeNotes(e){let t=0;for(let n of this.noteDrafts){let r=e.get(n.target);if(!r)throw Error(`Note target '${n.target}' is unresolved at ${$(n.targetLocation)}`);r.kind!==`actor`&&r.kind!==`usecase`&&this.conflict(`Note target '${n.target}' must be an actor or use case, not ${r.kind}`,n.targetLocation,r.location);let i=`note-${t++}`;this.model.notes.set(i,{id:i,target:n.target,label:n.label.text,labelType:n.label.type})}this.model.noteCounter=t}applyClassDefinitions(){for(let e of this.classDefinitions)for(let t of e.ids)this.model.classDefs.set(t,{id:t,styles:[...e.styles]})}applyClassesAndStyles(e,t){for(let n of this.classAssignments)for(let r of n.targets)sc(this.getStylable(r.id,e,t,r.location).classes,n.classes);for(let n of this.styleAssignments)this.getStylable(n.target,e,t,n.location).styles.push(...n.styles)}getStylable(e,t,n,r){let i=t.get(e)?.kind,a=i===`actor`?this.model.actors.get(e):i===`usecase`?this.model.useCases.get(e):i===`boundary`?this.model.systemBoundaries.get(e):i===`json`?this.model.jsonNodes.get(e):i===`edge`?n.get(e)?.relationship:void 0;if(!a)throw Error(`Class/style target '${e}' is unresolved or anonymous at ${$(r)}`);return a}validateRelationship(e,t,n,r){let i=O(e=>e===`actor`||e===`usecase`||e===`json`,`allowed`);if(i(t)||this.conflict(`Relationship source '${e.source.id}' cannot be ${t}`,e.source.location,r.get(e.source.id).location),i(n)||this.conflict(`Relationship target '${e.target.id}' cannot be ${n}`,e.target.location,r.get(e.target.id).location),(e.type===`include`||e.type===`extend`)&&(t!==`usecase`||n!==`usecase`))throw Error(`${e.type} relationship requires use-case endpoints at ${$(e.location)}`);if(e.type===`generalization`&&(t!==`actor`&&t!==`usecase`||t!==n))throw Error(`Generalization requires actor-to-actor or use-case-to-use-case endpoints at ${$(e.location)}`);if(e.type===`association`&&(t===`json`||n===`json`)&&![0,1,2].includes(e.arrowType))throw Error(`JSON relationship '${e.source.id}' to '${e.target.id}' permits only point, reversed-point, or markerless solid association at ${$(e.location)}`)}setElementModel(e){if(e.kind===`actor`){let t=e.icon?`icon`:e.actorType??`normal`;this.model.useCases.delete(e.id),this.model.actors.set(e.id,{id:e.id,label:e.label.text,labelType:e.label.type,type:t,...e.icon?{icon:e.icon}:{},business:e.business??!1,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{},classes:[...e.classes],styles:this.model.actors.get(e.id)?.styles??[]})}else this.model.actors.delete(e.id),this.model.useCases.set(e.id,{id:e.id,label:e.label.text,labelType:e.label.type,shape:e.shape??`ellipse`,business:e.business??!1,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{},classes:[...e.classes],styles:this.model.useCases.get(e.id)?.styles??[]})}inferMetadataKind(e){let t=new Set([`actor`,`usecase`,`boundary`,`edge`]);for(let n of e.properties)if(n.key===`icon`)t.clear(),t.add(`actor`);else if(n.key===`animate`||n.key===`animation`)t.clear(),t.add(`edge`);else if(n.key===`type`)t.clear(),n.value===`rect`||n.value===`package`?t.add(`boundary`):(n.value===`normal`||n.value===`hollow`||n.value===`awesome`)&&t.add(`actor`);else if(n.key===`business`)t.delete(`boundary`),t.delete(`edge`);else return;return t.size===1?[...t][0]:void 0}invalidMetadata(e,t,n){throw Error(`Metadata property '${n.key}' is invalid for ${t} '${e}' at ${$(n.location)}`)}registerUnique(e,t,n,r,i){let a=e.get(t);a&&this.conflict(`ID '${t}' is declared more than once (${a.kind} and ${n})`,r,a.location,void 0,oc(a)),e.set(t,{kind:n,location:r,generated:i})}recordFirst(e,t,n){let r=e.get(t);(r===void 0||n<r)&&e.set(t,n)}conflict(e,t,n,r,i){throw Error(`${e} at ${$(t)}${ac(r)}; previous declaration at ${$(n)}${ac(i)}`)}},lc=Ks.getBaseCstVisitorConstructor(),uc=new class extends lc{constructor(){super(),this.builder=new cc(bo),this.source=``,this.anonymousEdge=0,this.anonymousNote=0,this.validateVisitor()}static{O(this,`UsecaseVisitor`)}build(e,t){this.source=t,this.parentBoundary=void 0,this.anonymousEdge=0,this.anonymousNote=0,this.builder.reset(t),this.visit(e)}start(e){let t=this.tokens(e,`USECASE`)[0],n=[];for(let t of this.nodes(e,`line`))n.push(this.visit(t));this.builder.setStatements(n),this.builder.finalize(this.tokenSpan(t))}line(e){let t=this.firstNode(e,`blankLine`,`commentLine`,`statement`);return this.wrap(t,this.visit(t))}statement(e){return this.visit(this.firstNode(e,`accTitleStatement`,`accDescrStatement`,`directionStatement`,`actorStatement`,`systemBoundaryStatement`,`noteStatement`,`jsonStatement`,`classDefStatement`,`classStatement`,`styleStatement`,`metadataAssignmentStatement`,`entityStatement`))}lineEnd(e){}blankLine(e){return{kind:`blank`,span:this.tokenSpan(this.tokens(e,`NEWLINE`)[0])}}commentLine(e){return{kind:`comment`,span:this.tokenSpan(this.tokens(e,`COMMENT`)[0])}}accTitleStatement(e){let t=this.tokens(e,`ACC_TITLE_LINE`)[0].image;return this.builder.setAccTitle(t.slice(t.indexOf(`:`)+1).trim()),{kind:`accTitle`,span:[0,0]}}accDescrStatement(e){let t=this.tokens(e,`ACC_DESCR_LINE`)[0],n=this.tokens(e,`ACC_DESCR_BLOCK`)[0],r=t?t.image.slice(t.image.indexOf(`:`)+1).trim():n.image.slice(n.image.indexOf(`{`)+1,n.image.lastIndexOf(`}`)).trim();return this.builder.setAccDescription(r),{kind:`accDescr`,span:[0,0]}}actorStatement(e){let t=this.nodes(e,`actorItem`),n=t.map(e=>this.visit(e)),r=this.nodes(e,`relationTail`)[0],i=n.map((e,n)=>this.actorOccurrence(t[n],e,!0));for(let e of n)this.builder.addElement(this.actorDraft(e));if(!r)return{kind:`node`,span:[0,0],nodes:i};let a=this.visit(r);a.target.explicitDeclaration&&this.builder.addElement(this.entityDraft(a.target));let o=this.relationshipDraft(n[0],a,this.nodeLocation(r));this.builder.addRelationship(o);let s=o.explicitId??`edge-${this.anonymousEdge++}`;return i.push(this.entityOccurrence(this.nodes(r.children,`entityName`)[0],a.target,a.target.explicitDeclaration)),{kind:`edge`,span:[0,0],nodes:i,edges:[{id:s,span:[0,0],...o.explicitIdLocation?{idSpan:o.explicitIdLocation.span}:{},...o.label?{labelSpan:o.label.span}:{}}]}}actorItem(e){let t=this.visit(this.nodes(e,`actorName`)[0]),n=this.nodes(e,`metadata`)[0],r=this.nodes(e,`stereotype`)[0],i=this.nodes(e,`classSuffix`)[0],a=i?this.visit(i):{classes:[],spans:[]};return{...t,...n?{metadata:this.visit(n)}:{},...r?{stereotype:this.visit(r)}:{},classes:a.classes,classSpans:a.spans}}actorName(e){let t=this.tokens(e,`IDENTIFIER`)[0],n=this.tokens(e,`PLAIN_STRING`)[0]??this.tokens(e,`MARKDOWN_STRING`)[0];if(t){let n=this.nodes(e,`nodeLabel`)[0],r=n?this.visit(n):this.tokenLabel(t);return{id:t.image,label:r,location:this.tokenLocation(t),generated:!1,classes:[],classSpans:[]}}let r=this.tokenLabel(n);return{id:this.generateId(r.text),label:r,location:this.tokenLocation(n),generated:!0,classes:[],classSpans:[]}}actorDeclarationOnly(e){let t=this.nodes(e,`actorItem`),n=t.map(e=>this.visit(e));for(let e of n)this.builder.addElement(this.actorDraft(e));return{kind:`node`,span:[0,0],nodes:n.map((e,n)=>this.actorOccurrence(t[n],e,!0))}}entityStatement(e){let t=this.nodes(e,`entityName`),n=this.visit(t[0]),r=this.nodes(e,`relationTail`)[0];if(!r)return n.explicitDeclaration=!0,n.shape??=`ellipse`,this.builder.addElement(this.entityDraft(n)),{kind:`node`,span:[0,0],nodes:[this.entityOccurrence(t[0],n,!0)]};n.explicitDeclaration&&this.builder.addElement(this.entityDraft(n));let i=this.visit(r);i.target.explicitDeclaration&&this.builder.addElement(this.entityDraft(i.target));let a={source:this.endpoint(n),target:this.endpoint(i.target),location:this.nodeLocation(r),...i.explicitId?{explicitId:i.explicitId,explicitIdLocation:i.explicitIdLocation}:{},...i.arrow};this.builder.addRelationship(a);let o=a.explicitId??`edge-${this.anonymousEdge++}`;return{kind:`edge`,span:[0,0],nodes:[this.entityOccurrence(t[0],n,n.explicitDeclaration),this.entityOccurrence(this.nodes(r.children,`entityName`)[0],i.target,i.target.explicitDeclaration)],edges:[{id:o,span:[0,0],...a.explicitIdLocation?{idSpan:a.explicitIdLocation.span}:{},...a.label?{labelSpan:a.label.span}:{}}]}}entityName(e){let t=this.tokens(e,`IDENTIFIER`)[0],n=this.tokens(e,`PLAIN_STRING`)[0]??this.tokens(e,`MARKDOWN_STRING`)[0],r=this.nodes(e,`nodeLabel`)[0],i=this.nodes(e,`useCaseMetadata`)[0],a=this.nodes(e,`stereotype`)[0],o=this.nodes(e,`classSuffix`)[0],s=o?this.visit(o):{classes:[],spans:[]};if(t){let n=r?this.visit(r):this.tokenLabel(t),o=r?this.tokens(e,`LBRACKET`).length?`rect`:`ellipse`:void 0;return{id:t.image,label:n,location:this.tokenLocation(t),generated:!1,...o?{shape:o}:{},...i?{metadata:this.visit(i)}:{},...a?{stereotype:this.visit(a)}:{},classes:s.classes,classSpans:s.spans,explicitDeclaration:!!(o||i||a)}}let c=this.tokenLabel(n);return{id:this.generateId(c.text),label:c,location:this.tokenLocation(n),generated:!0,...i?{metadata:this.visit(i)}:{},...a?{stereotype:this.visit(a)}:{},classes:s.classes,classSpans:s.spans,explicitDeclaration:!!(i||a)}}nodeLabel(e){let t=this.allTokens(e);if(t.length===1&&(t[0].tokenType.name===`PLAIN_STRING`||t[0].tokenType.name===`MARKDOWN_STRING`))return this.tokenLabel(t[0]);let n=[t[0].startOffset,(t.at(-1).endOffset??t.at(-1).startOffset)+1];return{text:this.source.slice(n[0],n[1]),type:`text`,span:n}}useCaseMetadata(e){return this.visit(this.nodes(e,`metadata`)[0])}relationTail(e){let t=this.tokens(e,`IDENTIFIER`)[0];return{...t?{explicitId:t.image,explicitIdLocation:this.tokenLocation(t)}:{},arrow:this.visit(this.nodes(e,`arrow`)[0]),target:this.visit(this.nodes(e,`entityName`)[0])}}arrow(e){return this.visit(this.firstNode(e,`semanticRelation`,`forwardSolidOperator`,`backwardSolidOperator`,`markerlessSolidOperator`,`forwardCircleOperator`,`backwardCircleOperator`,`forwardCrossOperator`,`backwardCrossOperator`))}edgeLabel(e){return this.nodeLabel(e)}semanticRelation(e){if(this.tokens(e,`GENERALIZATION`).length)return{type:`generalization`,arrowType:G.SOLID_ARROW,minlen:1};let t=this.tokens(e,`INCLUDE`).length?`include`:`extend`,n=this.tokens(e,t===`include`?`INCLUDE`:`EXTEND`)[0];return{type:t,arrowType:G.SOLID_ARROW,label:{text:t,type:`text`,span:this.tokenSpan(n)},minlen:1}}metadata(e){return{properties:this.nodes(e,`metadataProperty`).map(e=>this.visit(e)),location:this.ctxLocation(e)}}metadataProperty(e){let t=this.allTokens(e).filter(e=>e.tokenType.name!==`COLON`),n=t[0],r=t[1],i=r.tokenType.name===`TRUE`||r.tokenType.name!==`FALSE`&&this.decodePlain(r),a=[n.startOffset,(r.endOffset??r.startOffset)+1];return{key:this.decodePlain(n),value:i,span:a,keySpan:this.contentSpan(n),valueSpan:this.contentSpan(r),location:this.tokenLocation(n)}}metadataSeparator(e){}systemBoundaryStatement(e){let t=this.visit(this.nodes(e,`systemBoundaryName`)[0]),n=this.nodes(e,`classSuffix`)[0],r=n?this.visit(n):{classes:[],spans:[]};t.classes=r.classes,this.builder.addBoundary(t);let i=this.parentBoundary;this.parentBoundary={id:t.id,location:t.location};let a=this.nodes(e,`systemBoundaryContent`)[0],o=a?this.visit(a):[];this.parentBoundary=i;let s=this.tokens(e,`END`)[0],c=this.nodes(e,`metadata`)[0],l=c?this.visit(c):void 0,u={kind:`group`,span:[0,0],group:t.id,idSpan:t.location.span,titleSpan:t.label.span,endSpan:this.tokenSpan(s),classSpans:r.spans,...l?{metadata:l.properties.map(({key:e,span:t,keySpan:n,valueSpan:r})=>({key:e,span:t,keySpan:n,valueSpan:r}))}:{},...o.length?{children:o}:{}};return l&&this.builder.addMetadataAssignment(t.id,t.location,l,u),u}systemBoundaryName(e){let t=this.tokens(e,`IDENTIFIER`)[0];if(t){let n=this.nodes(e,`nodeLabel`)[0];return{id:t.image,label:n?this.visit(n):this.tokenLabel(t),location:this.tokenLocation(t),generated:!1,classes:[]}}let n=this.tokens(e,`PLAIN_STRING`)[0]??this.tokens(e,`MARKDOWN_STRING`)[0],r=this.tokenLabel(n);return{id:this.generateId(r.text),label:r,location:this.tokenLocation(n),generated:!0,classes:[]}}systemBoundaryContent(e){return[...this.nodes(e,`blankLine`),...this.nodes(e,`commentLine`),...this.nodes(e,`boundaryElement`)].sort((e,t)=>(e.location?.startOffset??0)-(t.location?.startOffset??0)).map(e=>this.wrap(e,this.visit(e)))}boundaryElement(e){let t=this.nodes(e,`actorDeclarationOnly`)[0];if(t)return this.visit(t);let n=this.nodes(e,`entityName`)[0],r=this.visit(n);return r.explicitDeclaration=!0,r.shape??=`ellipse`,this.builder.addElement(this.entityDraft(r)),{kind:`node`,span:[0,0],nodes:[this.entityOccurrence(n,r,!0)]}}metadataAssignmentStatement(e){let t=this.visit(this.nodes(e,`metadataAssignmentTarget`)[0]),n=this.visit(this.nodes(e,`metadata`)[0]),r={kind:`metadata`,span:[0,0],nodes:[{id:t.id,span:t.location.span,idSpan:t.location.span}],metadata:n.properties.map(({key:e,span:t,keySpan:n,valueSpan:r})=>({key:e,span:t,keySpan:n,valueSpan:r}))};return this.builder.addMetadataAssignment(t.id,t.location,n,r),r}metadataAssignmentTarget(e){let t=this.allTokens(e)[0],n=this.tokenLabel(t);return{id:t.tokenType.name===`IDENTIFIER`?t.image:this.generateId(n.text),location:this.tokenLocation(t)}}noteStatement(e){let t=this.tokens(e,`IDENTIFIER`)[0],n=this.visit(this.nodes(e,`nodeLabel`)[0]);return this.builder.addNote({target:t.image,targetLocation:this.tokenLocation(t),label:n,location:this.ctxLocation(e)}),{kind:`note`,span:[0,0],ref:`note-${this.anonymousNote++}`,refSpan:n.span,nodes:[{id:t.image,span:this.tokenSpan(t),idSpan:this.tokenSpan(t)}]}}stereotype(e){let t=this.tokens(e,`STEREOTYPE_TEXT`)[0];return{value:t.image.trim(),span:this.tokenSpan(t)}}classSuffix(e){let t=this.tokens(e,`IDENTIFIER`);return{classes:t.map(e=>e.image),spans:t.map(e=>this.tokenSpan(e))}}jsonStatement(e){let t=this.tokens(e,`JSON_DECLARATION_START`)[0],n=this.tokens(e,`JSON_OBJECT_LITERAL`)[0],r=/^json[\t ]+(\w+)/.exec(t.image),i=r[1],a=r[0].length-i.length,o={span:[t.startOffset+a,t.startOffset+a+i.length],line:t.startLine??1,column:(t.startColumn??1)+a},s=Zs(n.image,n.startLine??1,n.startColumn??1),c=this.nodes(e,`classSuffix`)[0],l=c?this.visit(c):{classes:[],spans:[]},u={id:i,value:s.value,propertyOrder:s.propertyOrder,location:o,classes:l.classes};return this.builder.addJson(u),{kind:`json`,span:[0,0],nodes:[{id:i,span:o.span,idSpan:o.span,defines:!0,classSpans:l.spans}],classSpans:l.spans}}directionStatement(e){let t=this.allTokens(e).find(e=>[`TD`,`TB`,`BT`,`RL`,`LR`].includes(e.tokenType.name));return this.builder.setDirection(t.image),{kind:`direction`,span:[0,0]}}classDefStatement(e){let t=this.tokens(e,`IDENTIFIER`),n=this.visit(this.nodes(e,`styles`)[0]);return this.builder.addClassDef(t.map(e=>e.image),n),{kind:`classDef`,span:[0,0],ref:t[0].image,refSpan:this.tokenSpan(t[0])}}classStatement(e){let t=this.tokens(e,`IDENTIFIER`),n=1;for(;n<t.length&&this.source.slice((t[n-1].endOffset??t[n-1].startOffset)+1,t[n].startOffset).includes(`,`);n++);let r=t.slice(0,n).map(e=>({id:e.image,location:this.tokenLocation(e)})),i=t.slice(n).map(e=>e.image);return this.builder.addClassAssignment(r,i),{kind:`classAssign`,span:[0,0],ref:i[0],refSpan:this.tokenSpan(t[n]),nodes:r.map(({id:e,location:t})=>({id:e,span:t.span,idSpan:t.span}))}}styleStatement(e){let t=this.tokens(e,`IDENTIFIER`)[0],n=this.visit(this.nodes(e,`styles`)[0]);return this.builder.addStyleAssignment(t.image,this.tokenLocation(t),n),{kind:`style`,span:[0,0],nodes:[{id:t.image,span:this.tokenSpan(t),idSpan:this.tokenSpan(t)}]}}styles(e){return this.nodes(e,`styleValue`).map(e=>this.visit(e))}styleValue(e){let t=this.allTokens(e),n=[t[0].startOffset,(t.at(-1).endOffset??t.at(-1).startOffset)+1];return this.source.slice(n[0],n[1]).replaceAll(`\\,`,`,`)}styleComponent(e){return this.allTokens(e).map(e=>e.image).join(``)}forwardSolidOperator(e){let t=this.tokens(e,`FORWARD_SOLID`)[0];return{type:`association`,arrowType:G.SOLID_ARROW,minlen:this.solidMinlen(t)}}backwardSolidOperator(e){let t=this.tokens(e,`BACKWARD_SOLID`)[0],n=this.nodes(e,`edgeLabel`)[0],r=n?this.tokens(e,`MARKERLESS_SOLID`).at(-1):t;return{type:`association`,arrowType:G.BACK_ARROW,minlen:this.solidMinlen(r),...n?{label:this.visit(n)}:{}}}markerlessSolidOperator(e){let t=this.nodes(e,`edgeLabel`)[0],n=this.allTokens(e);if(!t)return{type:`association`,arrowType:G.LINE_SOLID,minlen:this.solidMinlen(this.tokens(e,`MARKERLESS_SOLID`)[0])};let r=n.at(-1),i=r.tokenType.name===`FORWARD_SOLID`?G.SOLID_ARROW:r.tokenType.name===`FORWARD_CIRCLE`?G.CIRCLE_ARROW:r.tokenType.name===`FORWARD_CROSS`?G.CROSS_ARROW:G.LINE_SOLID;return{type:`association`,arrowType:i,label:this.visit(t),minlen:i===G.SOLID_ARROW||i===G.LINE_SOLID?this.solidMinlen(r):1}}forwardCircleOperator(e){return{type:`association`,arrowType:G.CIRCLE_ARROW,minlen:1}}backwardCircleOperator(e){let t=this.nodes(e,`edgeLabel`)[0];return{type:`association`,arrowType:G.CIRCLE_ARROW_REVERSED,minlen:1,...t?{label:this.visit(t)}:{}}}forwardCrossOperator(e){return{type:`association`,arrowType:G.CROSS_ARROW,minlen:1}}backwardCrossOperator(e){let t=this.nodes(e,`edgeLabel`)[0];return{type:`association`,arrowType:G.CROSS_ARROW_REVERSED,minlen:1,...t?{label:this.visit(t)}:{}}}actorDraft(e){return{id:e.id,kind:`actor`,label:e.label,location:e.location,generated:e.generated,...this.parentBoundary?{parentId:this.parentBoundary.id,parentLocation:this.parentBoundary.location}:{},...e.metadata?{metadata:e.metadata}:{},...e.stereotype?{stereotype:e.stereotype.value,stereotypeSpan:e.stereotype.span}:{},classes:e.classes}}entityDraft(e){return{id:e.id,kind:`usecase`,label:e.label,location:e.location,generated:e.generated,...this.parentBoundary?{parentId:this.parentBoundary.id,parentLocation:this.parentBoundary.location}:{},...e.shape?{shape:e.shape}:{},...e.metadata?{metadata:e.metadata}:{},...e.stereotype?{stereotype:e.stereotype.value,stereotypeSpan:e.stereotype.span}:{},classes:e.classes}}endpoint(e,t=e.explicitDeclaration??!0){return{id:e.id,label:e.label,location:e.location,generated:e.generated,declaration:t,classesOnReference:e.classes.length>0}}relationshipDraft(e,t,n){return{source:this.endpoint(e,!0),target:this.endpoint(t.target),location:n,...t.explicitId?{explicitId:t.explicitId,explicitIdLocation:t.explicitIdLocation}:{},...t.arrow}}actorOccurrence(e,t,n){return{id:t.id,span:this.nodeSpan(e),idSpan:t.location.span,labelSpan:t.label.span,...n?{defines:!0}:{},...t.stereotype?{stereotypeSpan:t.stereotype.span}:{},...t.metadata?{metadata:t.metadata.properties.map(({key:e,span:t,keySpan:n,valueSpan:r})=>({key:e,span:t,keySpan:n,valueSpan:r}))}:{},...t.classSpans.length?{classSpans:t.classSpans}:{}}}entityOccurrence(e,t,n){return this.actorOccurrence(e,t,n)}wrap(e,t){if(t.kind===`blank`||t.kind===`comment`)return t;t.span=this.nodeSpan(e);for(let e of t.edges??[])e.span=t.span;return t}tokenLabel(e){let t=e.tokenType.name===`MARKDOWN_STRING`?`markdown`:`text`,n=t===`markdown`?2:+(e.tokenType.name===`PLAIN_STRING`),r=this.tokenSpan(e,n);return{text:this.source.slice(r[0],r[1]),type:t,span:r}}decodePlain(e){return e.tokenType.name===`PLAIN_STRING`?e.image.slice(1,-1):e.image}contentSpan(e){return this.tokenSpan(e,e.tokenType.name===`PLAIN_STRING`?1:e.tokenType.name===`MARKDOWN_STRING`?2:0)}generateId(e){return e.replace(/\W/g,`_`)}solidMinlen(e){return Math.max(1,(e.image.match(/-/g)?.length??2)-1)}nodeLocation(e){let t=this.allTokens(e.children)[0];return{span:this.nodeSpan(e),line:t.startLine??1,column:t.startColumn??1}}ctxLocation(e){let t=this.allTokens(e).filter(e=>e.tokenType.name!==`NEWLINE`&&e.tokenType.name!==`EOF`),n=t[0],r=t.at(-1);return{span:[n.startOffset,Math.min(this.source.length,(r.endOffset??r.startOffset+r.image.length-1)+1)],line:n.startLine??1,column:n.startColumn??1}}tokenLocation(e){let t=e.tokenType.name===`PLAIN_STRING`?1:e.tokenType.name===`MARKDOWN_STRING`?2:0;return{span:this.tokenSpan(e,t),line:e.startLine??1,column:(e.startColumn??1)+t}}nodeSpan(e){let t=this.allTokens(e.children).filter(e=>e.tokenType.name!==`NEWLINE`&&e.tokenType.name!==`EOF`),n=t[0],r=t.at(-1);if(!n||!r)throw Error(`Usecase CST node has no source token`);return[n.startOffset,Math.min(this.source.length,(r.endOffset??r.startOffset+r.image.length-1)+1)]}tokenSpan(e,t=0){return[e.startOffset+t,Math.min(this.source.length,(e.endOffset??e.startOffset+e.image.length-1)+1-t)]}nodes(e,t){return(e[t]??[]).filter(e=>`children`in e)}tokens(e,t){return(e[t]??[]).filter(e=>`tokenTypeIdx`in e)}firstNode(e,...t){for(let n of t){let t=this.nodes(e,n)[0];if(t)return t}throw Error(`Usecase CST is missing one of: ${t.join(`, `)}`)}allTokens(e){let t=[];for(let n of Object.values(e))for(let e of n)`tokenTypeIdx`in e?t.push(e):t.push(...this.allTokens(e.children));return t.sort((e,t)=>e.startOffset-t.startOffset)}},dc={parse:O(async e=>{bo.clear(),Ks.input=[];try{Ba({diagramType:`usecase`,lexer:Us,parser:Ks,entry:O(()=>Ks.start(),`entry`),visit:O(t=>uc.build(t,e),`visit`)},e)}catch(t){bo.clear();let n=Ks.errors[0];if(n){let{token:r}=n,i=Number.isFinite(r.startOffset)?r.startOffset:e.length,a=typeof r.endOffset==`number`&&Number.isFinite(r.endOffset)?r.endOffset+1:i,o=r.startLine??e.slice(0,i).split(/\r\n|\r|\n/).length,s=Math.max(e.lastIndexOf(`
75
+ `,i-1),e.lastIndexOf(`\r`,i-1)),c=r.startColumn??i-s,l=t instanceof Error?t.message:String(t);throw Error(`${l} at line ${o}, column ${c} [${i},${a})`)}throw t}},`parse`)},fc=[`point`,`circle`,`cross`,`extension`],pc={usecaseActor:!0,usecaseActorHollow:!0,usecaseActorAwesome:!0,usecaseActorIcon:!0},mc=O((e,t)=>{let[n,r]=[e,t].map(e=>e.replace(/[^\w-]+/g,`_`).replace(/^_+|_+$/g,``)||`element`);return`usecase-${n}-${r}`},`usecaseDomId`),hc=O(e=>`usecase-${e.replace(/[^\w-]+/g,`_`).replace(/^_+|_+$/g,``)||`element`}`,`usecaseNodeDomId`),gc=O((e,t)=>t===`markdown`?Fe(e).map(e=>e.map(e=>e.content).join(` `)).join(`
76
+ `):e,`getAccessibleLabel`),_c=O(e=>{let t=gc(e.label??e.id,e.labelType);if(pc[e.shape]){let n=e.actorType&&e.actorType!==`normal`?`${e.actorType} `:``;return`${e.business?`business `:``}${n}actor ${t}${e.stereotype?`, stereotype ${e.stereotype}`:``}`}if(e.shape===`note`)return`Note for ${e.noteTargetLabel??e.noteTarget??``}: ${t}`;if(e.shape===`usecaseJsonTable`){let n=(e.jsonRows??[]).map(e=>`${e.accessibleKey}: ${e.value}`).join(`; `);return n?`${t}: ${n}`:t}let n=e.stereotype?`, stereotype ${e.stereotype}`:``;return`${e.business?`business `:``}use case ${t}${n}`},`getUsecaseNodeAccessibleName`),vc=O(e=>`${e.boundaryType} system boundary ${gc(e.label??e.id,e.labelType)}`,`getUsecaseBoundaryAccessibleName`),yc=O(e=>e.relationshipType===`note`?``:`${e.relationshipType===`association`&&e.label?`association ${gc(e.label,e.labelType)}`:e.relationshipType} from ${e.sourceLabel} to ${e.targetLabel}`,`getUsecaseEdgeAccessibleName`),bc=O(e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),`escapePlainLabel`),xc=O(e=>e.replace(/([*[\\\]_`])/g,`\\$1`),`escapeMarkdownMarkers`),Sc=O((e,t)=>{e.diagramId=t,e.markers=[...fc];for(let t of e.nodes){let e=t;if(e.domId=hc(t.id),t.label!==void 0&&t.labelType===`text`&&(t.label=bc(t.label)),t.stereotype&&=bc(t.stereotype),!t.isGroup&&t.shape===`usecaseJsonTable`&&(t.jsonRows=t.jsonRows?.map(e=>({...e,key:bc(e.key),value:bc(e.value)}))),!t.isGroup&&(t.shape===`usecaseEllipse`||t.shape===`rect`)&&t.stereotype){let n=t.label??bc(t.id);t.label=`\xAB${xc(t.stereotype)}\xBB<br/>${t.labelType===`text`?xc(n):n}`,t.labelType=`markdown`,e.hasFoldedStereotype=!0,delete t.stereotype}}for(let t of e.edges)t.label!==void 0&&t.labelType===`text`&&(t.label=bc(t.label));return e},`prepareUsecaseLayoutData`),Cc=O((t,n,r)=>{for(let e of n.nodes){let i=typeof e.domId==`string`?e.domId:mc(n.diagramId,e.id),a=t.select(`#${i}`),o=e.isGroup?`boundary`:pc[e.shape]?`actor`:e.shape===`note`?`note`:e.shape===`usecaseJsonTable`?`json`:`usecase`,s=r.nodes.get(e.id)??e.id;if(a.attr(`data-usecase-id`,e.id).attr(`data-usecase-kind`,o).attr(`role`,`img`).attr(`aria-label`,s),!e.isGroup&&(e.shape===`usecaseEllipse`||e.shape===`rect`)&&`hasFoldedStereotype`in e&&e.hasFoldedStereotype===!0){let e=a.node(),t=e?.querySelector(`.nodeLabel`),n=t?.querySelector(`p`)??t,r=n?.firstChild;if(n&&r?.nodeType===3){let e=n.ownerDocument.createElement(`span`);e.className=`usecase-stereotype`,n.insertBefore(e,r),e.appendChild(r)}else e?.querySelector(`.label tspan tspan, .label tspan`)?.classList.add(`usecase-stereotype`)}}let i=new Map(n.edges.map(e=>[e.id,e]));t.selectAll(`path[data-et="edge"]`).each(function(){let t=i.get(this.getAttribute(`data-id`)??``);if(!t)return;let a=e(this);a.attr(`id`,mc(n.diagramId,t.id)).attr(`data-usecase-id`,t.id).attr(`data-usecase-kind`,t.internal?`note-connector`:`relationship`),t.internal?a.attr(`aria-hidden`,`true`):a.attr(`role`,`img`).attr(`aria-label`,r.edges.get(t.id)??t.id)})},`annotateUsecaseElements`),wc=O((e,t)=>{e.style(`--mermaid-usecase-actor-font-size`,`${t.actorFontSize}px`).style(`--mermaid-usecase-actor-font-family`,t.actorFontFamily).style(`--mermaid-usecase-actor-font-weight`,t.actorFontWeight).style(`--mermaid-usecase-font-size`,`${t.usecaseFontSize}px`).style(`--mermaid-usecase-font-family`,t.usecaseFontFamily).style(`--mermaid-usecase-font-weight`,t.usecaseFontWeight)},`applyUsecaseFonts`),Tc={draw:O(async(e,t,n,r)=>{Se.info(`Drawing usecase diagram (unified)`,t);let{layout:i}=je(),a=r.db,o=a.getData(),s=new Map(o.nodes.map(e=>[e.id,gc(e.label??e.id,e.labelType)])),c={nodes:new Map(o.nodes.map(e=>[e.id,e.isGroup?vc(e):_c(e.shape===`note`?{...e,noteTargetLabel:s.get(e.noteTarget??``)}:e)])),edges:new Map(o.edges.map(e=>[e.id,yc({...e,sourceLabel:s.get(e.source)??e.sourceLabel,targetLabel:s.get(e.target)??e.targetLabel})]))},l=Be(t,o.config.securityLevel);o.layoutAlgorithm=Ue(i),Sc(o,t),wc(l,o),await He(o,l),Cc(l,o,c);let u=o.diagramPadding;Pe.insertTitle(l,`usecaseDiagramTitleText`,0,a.getDiagramTitle?.()??``),Ve(l,u,`usecaseDiagram`,o.useMaxWidth),wc(l,o)},`draw`)},Ec=O(e=>({actorBkg:e.usecaseActorBkg??e.actorBkg??e.mainBkg,actorBorder:e.usecaseActorBorder??e.actorBorder??e.primaryColor,bkg:e.usecaseBkg??e.mainBkg,border:e.usecaseBorder??e.nodeBorder??e.primaryColor,boundaryBkg:e.usecaseBoundaryBkg??e.clusterBkg,boundaryBorder:e.usecaseBoundaryBorder??e.clusterBorder,includeLine:e.usecaseIncludeLine??e.lineColor,extendLine:e.usecaseExtendLine??e.lineColor}),`roleColors`),Dc=O(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!Le(t,r))return``;let i=Ee().usecase?.colorScheme===`rotate`,a=Re(e.look),o=a===`handDrawn`,s=ze(n),c=``;for(let e=0;e<Ie(r);e++){let t=r[e],l=s?`fill: ${n[e%n.length]};`:``,u=`[data-look="${a}"][data-color-id="color-${e}"]`;c+=`
77
+
78
+ & ${u}.system-boundary rect.boundary-body,
79
+ & ${u}.system-boundary rect.boundary-tab,
80
+ & ${u}.system-boundary .boundary-body path,
81
+ & ${u}.system-boundary .boundary-tab path {
82
+ stroke: ${t};
83
+ ${l}
84
+ }
85
+ `,i&&(c+=`
86
+
87
+ /* Use case bodies -- \`.usecase-element\` covers the ellipse form, the \`[Rect]\` form and
88
+ the business variant.
89
+
90
+ Element selectors only, never a bare \`path\`. Under the handDrawn look roughjs draws
91
+ the body as a *pair* of paths, an outline stroked in the border colour and a hachure
92
+ fill stroked in the background colour, with no class to tell them apart. Stroking
93
+ both repaints the fill lines as border colour and the shape collapses into a solid
94
+ block -- which is what \`.usecase-element path\` did. So handDrawn bodies keep the
95
+ theme's uniform colours, exactly as handDrawn flowchart nodes do. */
96
+ & ${u}.usecase-element ellipse,
97
+ & ${u}.usecase-element rect {
98
+ stroke: ${t};
99
+ ${l}
100
+ }
101
+
102
+ /* The business marker is a single classed path, so it can be reached safely by name --
103
+ without it the marker keeps the uniform border beside a palette-coloured body. No
104
+ \`fill\`: the marker is drawn with \`fill="none"\` and has to stay that way. */
105
+ & ${u}.usecase-element .usecase-business-marker {
106
+ stroke: ${t};
107
+ }
108
+
109
+ /* Actor glyphs, mirroring the uniform rule further down. The fill goes on the glyph
110
+ group, never on its children, so the hollow variant's own \`fill="none"\` keeps
111
+ winning and a hollow actor stays hollow. Same reason as above for not descending
112
+ into the handDrawn paths. */
113
+ & ${u}.usecase-actor .usecase-actor-shape,
114
+ & ${u}.usecase-actor .usecase-actor-hollow,
115
+ & ${u}.usecase-actor .usecase-actor-awesome,
116
+ & ${u}.usecase-actor .usecase-actor-icon {
117
+ stroke: ${t};
118
+ ${l}
119
+ }
120
+ ${o?``:`
121
+ /* The group rule above reaches the glyph by inheritance, which the neo look breaks: it
122
+ ships a \`[data-look="neo"].node path { stroke }\` rule that hits the glyph's own paths,
123
+ and a value set directly on the child always beats one inherited from the parent,
124
+ whatever the parent rule's specificity. So name the children too.
125
+
126
+ Emitted for every look *except* handDrawn, where roughjs draws the glyph as an
127
+ outline path plus a hachure fill path stroked in the fill colour, indistinguishable
128
+ in CSS -- stroking both turns a hollow actor into a solid disc. Deliberately no
129
+ \`fill\` either way, so the hollow variant's own \`fill="none"\` keeps winning. */
130
+ & ${u}.usecase-actor .usecase-actor-glyph path,
131
+ & ${u}.usecase-actor .usecase-actor-glyph circle {
132
+ stroke: ${t};
133
+ }
134
+ `}
135
+ `)}return c},`genColor`),Oc={parser:dc,db:bo,renderer:Tc,styles:O(e=>{let t=Ec(e),n=Re(e.look)===`handDrawn`;return`
136
+ ${Dc(e)}
137
+ & .usecase-actor {
138
+ color: ${e.actorTextColor??e.primaryTextColor};
139
+ }
140
+
141
+ & .usecase-actor-shape,
142
+ & .usecase-actor-hollow,
143
+ & .usecase-actor-awesome,
144
+ & .usecase-actor-icon {
145
+ fill: ${t.actorBkg};
146
+ stroke: ${t.actorBorder};
147
+ stroke-width: 2px;
148
+ }
149
+ ${n?``:`
150
+ /* The rule above colours the glyph group and lets its children inherit, which the neo
151
+ look breaks: it ships a \`[data-look="neo"].node path { stroke }\` rule that lands on
152
+ the glyph's own paths, and a value set directly on a child always beats one inherited
153
+ from its parent, whatever the parent rule's specificity. Since neo is the default look,
154
+ without this every actor renders in the node border colour rather than the actor
155
+ colour the rule above asks for.
156
+
157
+ \`.node\` is in the selector to outrank that neo rule rather than tie with it: both
158
+ would otherwise be one attribute plus one class plus one element, leaving the winner to
159
+ depend on which stylesheet is concatenated last.
160
+
161
+ Stroke only: the hollow variant's own \`fill="none"\` has to keep winning. */
162
+ & .node.usecase-actor .usecase-actor-glyph path,
163
+ & .node.usecase-actor .usecase-actor-glyph circle {
164
+ stroke: ${t.actorBorder};
165
+ }
166
+ `}
167
+ & .usecase-actor .nodeLabel,
168
+ & .actor-label {
169
+ color: ${e.actorTextColor??e.primaryTextColor};
170
+ fill: ${e.actorTextColor??e.primaryTextColor};
171
+ font-family: var(--mermaid-usecase-actor-font-family, ${e.fontFamily});
172
+ font-size: var(--mermaid-usecase-actor-font-size, 14px);
173
+ font-weight: var(--mermaid-usecase-actor-font-weight, normal);
174
+ }
175
+
176
+ & .usecase-element ellipse,
177
+ & .usecase-element rect,
178
+ & .usecase-business ellipse,
179
+ & .usecase-business rect {
180
+ fill: ${t.bkg};
181
+ stroke: ${t.border};
182
+ stroke-width: 2px;
183
+ }
184
+ ${n?``:`
185
+ /* The same interception the actor glyph hits, one element down: neo ships
186
+ \`[data-look="neo"].node rect { stroke: nodeBorder }\`, which outranks the plain
187
+ \`.usecase-element rect\` above, so a use case written in the \`[Rect]\` form kept the node
188
+ border colour while its ellipse siblings took the role colour. An \`<ellipse>\` has no
189
+ equivalent neo rule and is already correct; restating it here costs nothing and means
190
+ the two forms cannot drift apart again.
191
+
192
+ Qualified with \`[data-look]\` *and* \`.node\` to land strictly above that rule rather than
193
+ tie with it -- on a tie the later stylesheet would win, which is how neo took this in
194
+ the first place. Skipped under handDrawn, where roughjs draws paths and neither element
195
+ exists. */
196
+ & [data-look="${Re(e.look)}"].node.usecase-element ellipse,
197
+ & [data-look="${Re(e.look)}"].node.usecase-element rect {
198
+ fill: ${t.bkg};
199
+ stroke: ${t.border};
200
+ }
201
+
202
+ /* The business marker is a \`<path>\`, so it loses to \`[data-look="neo"].node path\` the same
203
+ way. No \`fill\`: the marker is drawn with \`fill="none"\` and has to stay that way. */
204
+ & [data-look="${Re(e.look)}"].node.usecase-element .usecase-business-marker {
205
+ stroke: ${t.border};
206
+ }
207
+ `}
208
+ & .usecase-element .nodeLabel,
209
+ & .usecase-label {
210
+ color: ${e.primaryTextColor};
211
+ fill: ${e.primaryTextColor};
212
+ font-family: var(--mermaid-usecase-font-family, ${e.fontFamily});
213
+ font-size: var(--mermaid-usecase-font-size, 12px);
214
+ font-weight: var(--mermaid-usecase-font-weight, normal);
215
+ }
216
+
217
+ & .usecase-stereotype,
218
+ & .usecase-business-marker {
219
+ color: ${e.primaryTextColor};
220
+ fill: ${e.primaryTextColor};
221
+ stroke: ${t.border};
222
+ }
223
+
224
+ & .system-boundary rect.boundary-body,
225
+ & .system-boundary rect.boundary-tab,
226
+ & .system-boundary-package-tab {
227
+ fill: ${t.boundaryBkg};
228
+ stroke: ${t.boundaryBorder};
229
+ stroke-width: 1px;
230
+ }
231
+
232
+ & .system-boundary-title text {
233
+ fill: ${e.titleColor??e.primaryTextColor};
234
+ }
235
+
236
+ /* Only the span, never the <p> inside it: the renderer puts a user-supplied
237
+ 'color' on the span, and that has to stay inheritable by its children. */
238
+ & .system-boundary-title span {
239
+ color: ${e.titleColor??e.primaryTextColor};
240
+ }
241
+
242
+ & .usecase-note {
243
+ fill: ${e.noteBkgColor};
244
+ stroke: ${e.noteBorderColor};
245
+ color: ${e.noteTextColor};
246
+ }
247
+
248
+ & .usecase-note .nodeLabel {
249
+ color: ${e.noteTextColor};
250
+ fill: ${e.noteTextColor};
251
+ }
252
+
253
+ & .usecase-json-table,
254
+ & .usecase-json-table rect,
255
+ & .usecase-json-cell {
256
+ fill: ${e.mainBkg};
257
+ stroke: ${e.nodeBorder??e.primaryColor};
258
+ }
259
+
260
+ & .usecase-json-title,
261
+ & .usecase-json-key,
262
+ & .usecase-json-value {
263
+ color: ${e.primaryTextColor};
264
+ fill: ${e.primaryTextColor};
265
+ }
266
+
267
+ & .relationship {
268
+ fill: none;
269
+ stroke: ${e.lineColor};
270
+ }
271
+
272
+ & .relationship-include,
273
+ & .relationship-extend,
274
+ & .relationship-note {
275
+ stroke-dasharray: 3;
276
+ }
277
+
278
+ /* Include and extend are both dashed, which is a weak distinction at small sizes. The
279
+ tokens default to \`lineColor\`, so a theme that does not set them is unchanged. */
280
+ & .relationship-include {
281
+ stroke: ${t.includeLine};
282
+ }
283
+
284
+ & .relationship-extend {
285
+ stroke: ${t.extendLine};
286
+ }
287
+
288
+ & .relationship.edge-animation-fast,
289
+ & .relationship.edge-animation-slow {
290
+ stroke-linecap: round;
291
+ }
292
+
293
+ & .edgeLabel,
294
+ & .edgeLabel p {
295
+ background-color: ${e.edgeLabelBackground};
296
+ }
297
+
298
+ & .labelBkg {
299
+ background-color: ${e.edgeLabelBackground};
300
+ padding: 0 2px;
301
+ }
302
+
303
+ & .edgeLabel .label rect {
304
+ fill: ${e.edgeLabelBackground};
305
+ }
306
+
307
+ & .relationship-label,
308
+ & .edgeLabel {
309
+ color: ${e.primaryTextColor};
310
+ fill: ${e.primaryTextColor};
311
+ font-family: ${e.fontFamily};
312
+ font-size: 10px;
313
+ font-weight: normal;
314
+ }
315
+
316
+ & .marker,
317
+ & .marker.point,
318
+ & .marker.circle,
319
+ & .marker.cross {
320
+ fill: ${e.lineColor};
321
+ stroke: ${e.lineColor};
322
+ }
323
+
324
+ & .marker.extension {
325
+ fill: ${e.mainBkg};
326
+ stroke: ${e.lineColor};
327
+ }
328
+ `},`getStyles`)};export{Oc as diagram};