@juki-team/base-ui 1.5.4 → 1.5.13

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 (202) hide show
  1. package/dist/esm/ArrowForwardIcon-DelUFdaJ.js +1 -0
  2. package/dist/esm/{BarChart-4YVL8qrU.js → BarChart-D2X8Qu4u.js} +1 -1
  3. package/dist/esm/{CartesianChart-CaeqB_2y.js → CartesianChart-DYpkf6Ou.js} +1 -1
  4. package/dist/esm/{ChangePasswordModal-OWm3MyKW.js → ChangePasswordModal-yc4D7RMs.js} +1 -1
  5. package/dist/esm/CodeEditor-Dxp5QnTB.js +1 -0
  6. package/dist/esm/{CodeViewer-CZwCWtf1.js → CodeViewer-BSZXIngC.js} +1 -1
  7. package/dist/esm/{Collapse-C6FDlfoR.js → Collapse-D-w5SKss.js} +1 -1
  8. package/dist/esm/{DataGrid-bZJxnNpn.js → DataGrid-BdFgb8IP.js} +1 -1
  9. package/dist/esm/DataViewer-DVVGkDSK.js +1 -0
  10. package/dist/esm/{DrawerView-O8ivFKAG.js → DrawerView-DCRvckZd.js} +1 -1
  11. package/dist/esm/{ExcalidrawButton-Dx-6TOuw.js → ExcalidrawButton-_a-eNbyb.js} +1 -1
  12. package/dist/esm/{GraphvizViewer-AxmRC6e5.js → GraphvizViewer-B2-JVx0t.js} +1 -1
  13. package/dist/esm/{ImageLoaderCropper-B5z4gQda.js → ImageLoaderCropper-wV-hPOjq.js} +1 -1
  14. package/dist/esm/{InputCellPhoneNumber-12U8BtmT.js → InputCellPhoneNumber-Bcl22QsC.js} +1 -1
  15. package/dist/esm/{InputColor-Cpd36Uei.js → InputColor-CHgGjI3f.js} +1 -1
  16. package/dist/esm/{LineChart-Cp3YgIYB.js → LineChart-ByKPkVhP.js} +1 -1
  17. package/dist/esm/{LoaderLayer-Cv80UCdL.js → LoaderLayer-ECtsj85k.js} +1 -1
  18. package/dist/esm/{MdMath-CVxzEaJK.js → MdMath-DljkRDxR.js} +1 -1
  19. package/dist/esm/{MdMathEditor-himmiyoG.js → MdMathEditor-Dvq5oODw.js} +2 -2
  20. package/dist/esm/{Popover-CEc-CYlJ.js → Popover-CX8YffOd.js} +1 -1
  21. package/dist/esm/ReplyIcon-BNYBKbgb.js +1 -0
  22. package/dist/esm/{SettingsIcon-C3sN1TNw.js → SettingsIcon-B9nmP4lD.js} +1 -1
  23. package/dist/esm/{SlideDeck-I221o0di.js → SlideDeck-C0n93gz0.js} +1 -1
  24. package/dist/esm/{TableEyeIcon-BFfTLgKU.js → TableEyeIcon-Mb5aFvN0.js} +1 -1
  25. package/dist/esm/{TableOfContents-DqdT3oFH.js → TableOfContents-BBAEZx6Z.js} +1 -1
  26. package/dist/esm/{Tooltip-DCefNWu7.js → Tooltip-DB0S1ErV.js} +1 -1
  27. package/dist/esm/UserCodeEditor-B1d5gyVE.js +61 -0
  28. package/dist/esm/{VirtualizedRowsFixed-D9Yuhs6Z.js → VirtualizedRowsFixed-ChX4ON0l.js} +1 -1
  29. package/dist/esm/{WorksheetAsSlides-DJJreHkG.js → WorksheetAsSlides-CpiXbUML.js} +1 -1
  30. package/dist/esm/{WorksheetBodies-VeYRksK3.js → WorksheetBodies-CO67-rEz.js} +1 -1
  31. package/dist/esm/{WorksheetContents-CmB2azPo.js → WorksheetContents-ClZpiXB-.js} +1 -1
  32. package/dist/esm/{WorksheetEditor-CwF_HNWx.js → WorksheetEditor-CjAvgOx6.js} +1 -1
  33. package/dist/esm/WorksheetNode-BgNNzY8I.js +1 -0
  34. package/dist/esm/{WorksheetViewer-8nk0Y7Pu.js → WorksheetViewer-DVQitUzi.js} +1 -1
  35. package/dist/esm/{abnfDiagram-WEYOIA3C-DEKNEQ23.js → abnfDiagram-WEYOIA3C-CwJ1V2U1.js} +1 -1
  36. package/dist/esm/{arc-BXMOYbEk.js → arc-COK0VEkT.js} +1 -1
  37. package/dist/esm/{architectureDiagram-ZHVYKT53-D8Cc0szw.js → architectureDiagram-ZHVYKT53-CM6AQFKG.js} +1 -1
  38. package/dist/esm/{basic-setup-DnHlH_GN.js → basic-setup-DtpgwOSH.js} +1 -1
  39. package/dist/esm/{blockDiagram-RJAE7QA3-CVAxF28b.js → blockDiagram-RJAE7QA3-CdSNo9Pe.js} +1 -1
  40. package/dist/esm/{c4Diagram-XDPPPE54-DfOddOsg.js → c4Diagram-XDPPPE54-BhfYKASq.js} +1 -1
  41. package/dist/esm/channel-DWjyymG_.js +1 -0
  42. package/dist/esm/{chunk-2E7WHVMD-DzrxCta9.js → chunk-2E7WHVMD-CVBqw5fR.js} +1 -1
  43. package/dist/esm/{chunk-2Q5K7J3B-BAvN2osA.js → chunk-2Q5K7J3B-CyZYeWxE.js} +1 -1
  44. package/dist/esm/{chunk-4EMNKR2T-WzMQveGn.js → chunk-4EMNKR2T-D1yHHif8.js} +1 -1
  45. package/dist/esm/{chunk-55XCU76K-Co_JK6zS.js → chunk-55XCU76K-CvYWAV_o.js} +1 -1
  46. package/dist/esm/{chunk-5VM5RSS4-2Alz3VU-.js → chunk-5VM5RSS4-CS0kZLYA.js} +1 -1
  47. package/dist/esm/{chunk-JWPE2WC7-BM31szoD.js → chunk-JWPE2WC7-Ct5OBLCL.js} +1 -1
  48. package/dist/esm/{chunk-NQOKRVIF-BvuLXPDI.js → chunk-NQOKRVIF-D0-2mmH4.js} +1 -1
  49. package/dist/esm/{chunk-VQ5W62QI-BM9st1eu.js → chunk-VQ5W62QI-CsGo0PTx.js} +1 -1
  50. package/dist/esm/{chunk-XXDRQBXY-B7eZEtxE.js → chunk-XXDRQBXY-DPPGTM3w.js} +1 -1
  51. package/dist/esm/{chunk-ZCHMQSOR-BfEzwJnw.js → chunk-ZCHMQSOR-Bvjutmxm.js} +1 -1
  52. package/dist/esm/{classDiagram-v2-4MYWR3UA-BBYOuONr.js → classDiagram-v2-4MYWR3UA-J_cOAAHS.js} +1 -1
  53. package/dist/esm/{commons-BHuDJzTw.js → commons-iref2pEJ.js} +1 -1
  54. package/dist/esm/constants.js +1 -1
  55. package/dist/esm/{cose-bilkent-JH36ORCC-BBL1Y3YR.js → cose-bilkent-JH36ORCC-BHzp2aV0.js} +1 -1
  56. package/dist/esm/{cynefinDiagram-WF24UDRP-B6GLAQp-.js → cynefinDiagram-WF24UDRP-B3Y9mCh3.js} +1 -1
  57. package/dist/esm/{dagre-NK4GIZVX-B5sHdjHr.js → dagre-NK4GIZVX-BSfh-C_i.js} +1 -1
  58. package/dist/esm/{diagram-CBK3MWTC-Dcv51W2u.js → diagram-CBK3MWTC-w-BT1S7I.js} +1 -1
  59. package/dist/esm/{diagram-I5XIIV2D-BqonTetl.js → diagram-I5XIIV2D-wMqo87b_.js} +1 -1
  60. package/dist/esm/{diagram-ODIL2UCW-CriVrDQT.js → diagram-ODIL2UCW-DQhUXqDu.js} +1 -1
  61. package/dist/esm/{diagram-PFBEJUXE-B03iAEwx.js → diagram-PFBEJUXE-BlCntZMJ.js} +1 -1
  62. package/dist/esm/{diagram-RJA3I4VV-Dj3xghQ1.js → diagram-RJA3I4VV-Cev21A9i.js} +1 -1
  63. package/dist/esm/{diagram-TYUNFSNR-CcvVCW9_.js → diagram-TYUNFSNR-BiiLNoPs.js} +1 -1
  64. package/dist/esm/{ebnfDiagram-V4P3TTPT-BXu5Kifr.js → ebnfDiagram-V4P3TTPT-BWNnHl88.js} +1 -1
  65. package/dist/esm/{elk-QONTBCTQ-Jkx0FK2o.js → elk-QONTBCTQ-DhvgoeNg.js} +1 -1
  66. package/dist/esm/{erDiagram-KYQIGQAA-BF9vCEaf.js → erDiagram-KYQIGQAA-DkFGw08p.js} +1 -1
  67. package/dist/esm/flowDiagram-IUGLLWBU-B-Bxdnen.js +1 -0
  68. package/dist/esm/{ganttDiagram-R7GPNTJY-CQC15o39.js → ganttDiagram-R7GPNTJY-Bvr90Acy.js} +1 -1
  69. package/dist/esm/{gitGraphDiagram-PDYL7XHY-D_f2t3KD.js → gitGraphDiagram-PDYL7XHY-DHszoB7b.js} +1 -1
  70. package/dist/esm/helpers.js +1 -1
  71. package/dist/esm/{index-_kF3_0-k.js → index-2PTQqTnK.js} +1 -1
  72. package/dist/esm/{index-ID6vqTYe.js → index-6pAHrAuD.js} +1 -1
  73. package/dist/esm/{index-JPCp_Z3V.js → index-70SVfF-m.js} +1 -1
  74. package/dist/esm/{index-D5FWzr0h.js → index-B46RgSF9.js} +1 -1
  75. package/dist/esm/{index-Dz8ISdDG.js → index-B5Soolr4.js} +1 -1
  76. package/dist/esm/{index-CWL6W5WQ.js → index-B9JSZpaA.js} +1 -1
  77. package/dist/esm/{index-C_HL-Da-.js → index-BDQ8194g.js} +1 -1
  78. package/dist/esm/{index-bPHO9OeP.js → index-BNvG4PUn.js} +1 -1
  79. package/dist/esm/{index-CRj4pqRR.js → index-BS7YTgMe.js} +1 -1
  80. package/dist/esm/{index-CAH_9Jug.js → index-Bohl_WFx.js} +1 -1
  81. package/dist/esm/{index-DPe-z7ci.js → index-BpFtavDh.js} +1 -1
  82. package/dist/esm/index-BpcqEzEG.js +1 -0
  83. package/dist/esm/{index-DM4Zc3sU.js → index-CHVYA2P8.js} +1 -1
  84. package/dist/esm/{index-CoVpfkO8.js → index-CHgqN-d9.js} +1 -1
  85. package/dist/esm/{index-2Mitl1QB.js → index-CJtYjUlf.js} +1 -1
  86. package/dist/esm/{index-Dx6l5ueb.js → index-CffiBbeH.js} +1 -1
  87. package/dist/esm/{index-DRSSYmEF.js → index-CiHwAkdd.js} +1 -1
  88. package/dist/esm/{index-C9ua7WYO.js → index-CmWQEzQl.js} +1 -1
  89. package/dist/esm/{index-D5tgPh4d.js → index-D5AIo8KT.js} +1 -1
  90. package/dist/esm/{index-D5WiSbCh.js → index-D6A8P_xS.js} +1 -1
  91. package/dist/esm/{index-CGmB9AM1.js → index-D9BPo-_o.js} +1 -1
  92. package/dist/esm/{index-8mEJamTc.js → index-DBWowQHL.js} +1 -1
  93. package/dist/esm/{index-C4KISU3M.js → index-DDBuqExW.js} +1 -1
  94. package/dist/esm/{index-V9oZCW09.js → index-DjrtJ8R4.js} +1 -1
  95. package/dist/esm/{index-DH4SMqQP.js → index-DkZReaeM.js} +1 -1
  96. package/dist/esm/{index-ChphKFtR.js → index-YYM2ZvZ6.js} +1 -1
  97. package/dist/esm/{index-nUMXMsLO.js → index-mLZqgXD7.js} +1 -1
  98. package/dist/esm/{index-BMPFttUB.js → index-nNMK7HvL.js} +1 -1
  99. package/dist/esm/{index-myBmcWfr.js → index-vxKx70Pe.js} +1 -1
  100. package/dist/esm/{index-CkaLE__v.js → index-wJyG4Gm6.js} +1 -1
  101. package/dist/esm/{infoDiagram-MVDRKAX5-04QJzIoW.js → infoDiagram-MVDRKAX5-D05SjyVf.js} +1 -1
  102. package/dist/esm/{ishikawaDiagram-HPEHV2GE-4pDsX60A.js → ishikawaDiagram-HPEHV2GE-50RQ8Owd.js} +1 -1
  103. package/dist/esm/{journeyDiagram-BOSHW7O7-BJFwx5Hu.js → journeyDiagram-BOSHW7O7-DnHu8DYt.js} +1 -1
  104. package/dist/esm/{kanban-definition-FNSA4HC5-MrsniETV.js → kanban-definition-FNSA4HC5-BF3y0Q5O.js} +1 -1
  105. package/dist/esm/main.js +1 -1
  106. package/dist/esm/{mermaid.core-DBVKQvxW.js → mermaid.core-DRk6tt5W.js} +2 -2
  107. package/dist/esm/{mindmap-definition-6OY57UG3-DnT4Ihuj.js → mindmap-definition-6OY57UG3-D2VvQCn5.js} +1 -1
  108. package/dist/esm/{pegDiagram-ECIUJNBX-C3s5Vuxq.js → pegDiagram-ECIUJNBX-LCa_e2vp.js} +1 -1
  109. package/dist/esm/{pieDiagram-GNMPY74T-CTjQZ9yP.js → pieDiagram-GNMPY74T-BFxRc695.js} +1 -1
  110. package/dist/esm/{quadrantDiagram-D57K4MC3-JTRqBH1z.js → quadrantDiagram-D57K4MC3-m-v5Oved.js} +1 -1
  111. package/dist/esm/{railroadDiagram-Y72NRBL7-DtAwxQ6F.js → railroadDiagram-Y72NRBL7-CGhQNkt2.js} +1 -1
  112. package/dist/esm/{requirementDiagram-EQYSW5RA-CR7SUMC-.js → requirementDiagram-EQYSW5RA-D4TUJX2j.js} +1 -1
  113. package/dist/esm/{sankeyDiagram-SY24JHO5-DbxpJ7pE.js → sankeyDiagram-SY24JHO5-qeunG13D.js} +1 -1
  114. package/dist/esm/{sequenceDiagram-BLEHNHQU-CvZHKbjd.js → sequenceDiagram-BLEHNHQU-Bf8dSGiP.js} +1 -1
  115. package/dist/esm/server.js +1 -1
  116. package/dist/esm/settings-CBGV-lz3.js +1 -0
  117. package/dist/esm/settings.js +1 -1
  118. package/dist/esm/{sizeCapture-INFHLROL-f_GRBQe5.js → sizeCapture-INFHLROL-B0tQoQkY.js} +1 -1
  119. package/dist/esm/{stateDiagram-v2-A6IESKWZ-DxF8GOQW.js → stateDiagram-v2-A6IESKWZ-D-bM5qVN.js} +1 -1
  120. package/dist/esm/{swimlanes-B3ENRKFQ-YbCv2QO2.js → swimlanes-B3ENRKFQ-DR9euVhL.js} +1 -1
  121. package/dist/esm/swimlanesDiagram-AYQRV4AK-D0-BBYnj.js +1 -0
  122. package/dist/esm/{timeline-definition-JXYKGLGB-C1x6bOWf.js → timeline-definition-JXYKGLGB-ChsOD2es.js} +1 -1
  123. package/dist/esm/{types-C3mmJ376.js → types-DsZvEANP.js} +1 -1
  124. package/dist/esm/{usecaseDiagram-WPOLBNNX-QdEejhhn.js → usecaseDiagram-WPOLBNNX-DZFg1Zof.js} +1 -1
  125. package/dist/esm/{vennDiagram-Q3Y3IDCW-B0EVPCrz.js → vennDiagram-Q3Y3IDCW-DAW-dDy7.js} +1 -1
  126. package/dist/esm/{wardleyDiagram-IVAIDKWA-Dlo4JFKg.js → wardleyDiagram-IVAIDKWA-B-gsebc8.js} +1 -1
  127. package/dist/esm/websocket-CdeP8N_S.js +1 -0
  128. package/dist/esm/{xychartDiagram-4URNHDU4-CU8TcG1V.js → xychartDiagram-4URNHDU4-DS3Qm0VA.js} +1 -1
  129. package/dist/module-types/src/components/molecules/_lazy_/CodeEditor/codemirror/types.d.ts +15 -1
  130. package/dist/module-types/src/components/molecules/_lazy_/CodeEditor/types.d.ts +6 -0
  131. package/dist/module-types/src/components/organisms/_layz_/DataViewer/CardList/DataViewerCard.d.ts +6 -2
  132. package/dist/module-types/src/components/organisms/_layz_/DataViewer/CardList/types.d.ts +9 -6
  133. package/dist/module-types/src/components/organisms/_layz_/DataViewer/RowList/TableHead/index.d.ts +2 -2
  134. package/dist/module-types/src/components/organisms/_layz_/DataViewer/RowList/TableRow.d.ts +21 -0
  135. package/dist/module-types/src/components/organisms/_layz_/DataViewer/RowList/ViewContainerRows.d.ts +0 -2
  136. package/dist/module-types/src/components/organisms/_layz_/DataViewer/RowList/columnLayout.d.ts +23 -0
  137. package/dist/module-types/src/components/organisms/_layz_/DataViewer/RowList/useScrollEdges.d.ts +13 -0
  138. package/dist/module-types/src/components/organisms/_layz_/DataViewer/types.d.ts +12 -8
  139. package/dist/module-types/src/components/organisms/_layz_/UserCodeEditor/CodeRunnerEditor/FileTreePanel/FileTreePanel.d.ts +3 -1
  140. package/dist/module-types/src/components/organisms/_layz_/UserCodeEditor/CodeRunnerEditor/FileTreePanel/types.d.ts +8 -2
  141. package/dist/module-types/src/components/organisms/_layz_/UserCodeEditor/CodeRunnerEditor/FirstPane.d.ts +6 -1
  142. package/dist/module-types/src/components/organisms/_layz_/UserCodeEditor/CodeRunnerEditor/Header/RunCodeButton.d.ts +2 -1
  143. package/dist/module-types/src/components/organisms/_layz_/UserCodeEditor/CodeRunnerEditor/Header/index.d.ts +3 -1
  144. package/dist/module-types/src/components/organisms/_layz_/UserCodeEditor/CodeRunnerEditor/TestCases/index.d.ts +3 -1
  145. package/dist/module-types/src/components/organisms/_layz_/UserCodeEditor/CodeRunnerEditor/types.d.ts +21 -2
  146. package/dist/module-types/src/components/organisms/_layz_/UserCodeEditor/types.d.ts +11 -0
  147. package/dist/module-types/src/stores/websocket/topicChannels.d.ts +37 -0
  148. package/package.json +12 -13
  149. package/src/styles/components/atoms/_button.scss +3 -3
  150. package/src/styles/components/atoms/_data-viewer.scss +34 -16
  151. package/src/styles/index.scss +6 -0
  152. package/src/styles/vendor/index.scss +0 -2
  153. package/src/vendor/reveal.js/css/theme/fonts/league-gothic/league-gothic.woff +0 -0
  154. package/src/vendor/reveal.js/css/theme/fonts/source-sans-pro/source-sans-pro-italic.woff +0 -0
  155. package/src/vendor/reveal.js/css/theme/fonts/source-sans-pro/source-sans-pro-regular.woff +0 -0
  156. package/src/vendor/reveal.js/css/theme/fonts/source-sans-pro/source-sans-pro-semibold.woff +0 -0
  157. package/src/vendor/reveal.js/css/theme/fonts/source-sans-pro/source-sans-pro-semibolditalic.woff +0 -0
  158. package/dist/esm/ArrowForwardIcon-1RdVdC78.js +0 -1
  159. package/dist/esm/CodeEditor-B6RhGNP7.js +0 -1
  160. package/dist/esm/DataViewer-CU0QwQQa.js +0 -1
  161. package/dist/esm/ReplyIcon-BlBLARCH.js +0 -1
  162. package/dist/esm/UserCodeEditor-D4O5es0E.js +0 -61
  163. package/dist/esm/WorksheetNode-BTVi2Iol.js +0 -1
  164. package/dist/esm/channel-DaoqdAiW.js +0 -1
  165. package/dist/esm/flowDiagram-IUGLLWBU-DDMbhdom.js +0 -1
  166. package/dist/esm/index-Cso1rXtQ.js +0 -1
  167. package/dist/esm/settings-BONQQsPx.js +0 -1
  168. package/dist/esm/swimlanesDiagram-AYQRV4AK-CuclTt9Y.js +0 -1
  169. package/dist/esm/websocket-B2hJys_Q.js +0 -1
  170. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/component/code-block.d.ts +0 -0
  171. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/component/diff.d.ts +0 -0
  172. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/component/image-block.d.ts +0 -0
  173. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/component/image-inline.d.ts +0 -0
  174. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/component/index.d.ts +0 -0
  175. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/component/link-tooltip.d.ts +0 -0
  176. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/component/list-item-block.d.ts +0 -0
  177. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/component/table-block.d.ts +0 -0
  178. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/core.d.ts +0 -0
  179. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/ctx.d.ts +0 -0
  180. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/exception.d.ts +0 -0
  181. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/plugin/block.d.ts +0 -0
  182. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/plugin/clipboard.d.ts +0 -0
  183. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/plugin/cursor.d.ts +0 -0
  184. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/plugin/diff.d.ts +0 -0
  185. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/plugin/history.d.ts +0 -0
  186. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/plugin/indent.d.ts +0 -0
  187. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/plugin/listener.d.ts +0 -0
  188. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/plugin/slash.d.ts +0 -0
  189. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/plugin/streaming.d.ts +0 -0
  190. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/plugin/tooltip.d.ts +0 -0
  191. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/plugin/trailing.d.ts +0 -0
  192. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/plugin/upload.d.ts +0 -0
  193. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/preset/commonmark.d.ts +0 -0
  194. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/preset/gfm.d.ts +0 -0
  195. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/prose/history.d.ts +0 -0
  196. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/prose/index.d.ts +0 -0
  197. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/prose/inputrules.d.ts +0 -0
  198. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/prose/keymap.d.ts +0 -0
  199. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/prose/model.d.ts +0 -0
  200. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/prose/state.d.ts +0 -0
  201. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/prose/view.d.ts +0 -0
  202. /package/dist/module-types/node_modules/.pnpm/{@milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+view@6.43.15_typescript@6.0.3 → @milkdown+kit@7.23.0_@codemirror+language@6.13.1_@codemirror+state@6.7.6_@codemirror+vi_3301ef378947b358eb17e6850a1dc747}/node_modules/@milkdown/kit/lib/utils.d.ts +0 -0
@@ -1 +1 @@
1
- import{g as t}from"./chunk-XXDRQBXY-B7eZEtxE.js";import{s as e}from"./chunk-VQ5W62QI-BM9st1eu.js";import{_ as s,l as i,c as n,r,t as o,u as a,a as l,b as c,g as h,s as d,v as u,x as p,ag as y,m as g,C as m,k as f,B as S,E as k,F as b,G as T,M as _}from"./mermaid.core-DBVKQvxW.js";import{c as E}from"./chunk-55XCU76K-Co_JK6zS.js";import"./index-Cso1rXtQ.js";import"react/jsx-runtime";import"react";import"./enums.js";import"./commons-BHuDJzTw.js";import"./settings-BONQQsPx.js";import"./constants.js";import"./LoaderLayer-Cv80UCdL.js";import"./websocket-B2hJys_Q.js";import"./index-_kF3_0-k.js";import"motion/react";import"react-dom";import"swr";import"@ably/spaces";import"@ably/spaces/react";import"ably";import"ably/liveobjects";import"ably/react";import"@ably/spaces/dist/mjs/react";import"./string-DPJhNSkw.js";var $=function(){var t=s(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[1,2],i=[1,3],n=[1,4],r=[2,4],o=[1,9],a=[1,11],l=[1,16],c=[1,17],h=[1,18],d=[1,19],u=[1,33],p=[1,20],y=[1,21],g=[1,22],m=[1,23],f=[1,24],S=[1,26],k=[1,27],b=[1,28],T=[1,29],_=[1,30],E=[1,31],$=[1,32],x=[1,35],C=[1,36],v=[1,37],D=[1,38],w=[1,34],I=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],A=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],L=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],N={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"--\x3e":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"--\x3e",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:s(function(t,e,s,i,n,r,o){var a=r.length-1;switch(n){case 3:return i.setRootDoc(r[a]),r[a];case 4:this.$=[];break;case 5:"nl"!=r[a]&&(r[a-1].push(r[a]),this.$=r[a-1]);break;case 6:case 7:case 12:this.$=r[a];break;case 8:this.$="nl";break;case 13:const t=r[a-1];t.description=i.trimColon(r[a]),this.$=t;break;case 14:this.$={stmt:"relation",state1:r[a-2],state2:r[a]};break;case 15:const e=i.trimColon(r[a]);this.$={stmt:"relation",state1:r[a-3],state2:r[a-1],description:e};break;case 19:this.$={stmt:"state",id:r[a-3],type:"default",description:"",doc:r[a-1]};break;case 20:var l=r[a],c=r[a-2].trim();if(r[a].match(":")){var h=r[a].split(":");l=h[0],c=[c,h[1]]}this.$={stmt:"state",id:l,type:"default",description:c};break;case 21:this.$={stmt:"state",id:r[a-3],type:"default",description:r[a-5],doc:r[a-1]};break;case 22:this.$={stmt:"state",id:r[a],type:"fork"};break;case 23:this.$={stmt:"state",id:r[a],type:"join"};break;case 24:this.$={stmt:"state",id:r[a],type:"choice"};break;case 25:this.$={stmt:"state",id:i.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:r[a-1].trim(),note:{position:r[a-2].trim(),text:r[a].trim()}};break;case 29:this.$=r[a].trim(),i.setAccTitle(this.$);break;case 30:case 31:this.$=r[a].trim(),i.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:r[a-3],url:r[a-2],tooltip:r[a-1]};break;case 33:this.$={stmt:"click",id:r[a-3],url:r[a-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:r[a-1].trim(),classes:r[a].trim()};break;case 36:this.$={stmt:"style",id:r[a-1].trim(),styleClass:r[a].trim()};break;case 37:this.$={stmt:"applyClass",id:r[a-1].trim(),styleClass:r[a].trim()};break;case 38:i.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:i.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:i.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:i.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:r[a].trim(),type:"default",description:""};break;case 46:case 47:this.$={stmt:"state",id:r[a-2].trim(),classes:[r[a].trim()],type:"default",description:""}}},"anonymous"),table:[{3:1,4:e,5:i,6:n},{1:[3]},{3:5,4:e,5:i,6:n},{3:6,4:e,5:i,6:n},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:d,24:u,25:p,26:y,27:g,28:m,29:f,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:$,51:x,52:C,53:v,54:D,57:w},t(I,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:d,24:u,25:p,26:y,27:g,28:m,29:f,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:$,51:x,52:C,53:v,54:D,57:w},t(I,[2,7]),t(I,[2,8]),t(I,[2,9]),t(I,[2,10]),t(I,[2,11]),t(I,[2,12],{14:[1,40],15:[1,41]}),t(I,[2,16]),{18:[1,42]},t(I,[2,18],{20:[1,43]}),{23:[1,44]},t(I,[2,22]),t(I,[2,23]),t(I,[2,24]),t(I,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(I,[2,28]),{34:[1,49]},{36:[1,50]},t(I,[2,31]),{13:51,24:u,57:w},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(A,[2,44],{58:[1,56]}),t(A,[2,45],{58:[1,57]}),t(I,[2,38]),t(I,[2,39]),t(I,[2,40]),t(I,[2,41]),t(I,[2,6]),t(I,[2,13]),{13:58,24:u,57:w},t(I,[2,17]),t(L,r,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(I,[2,29]),t(I,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(I,[2,14],{14:[1,71]}),{4:o,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,72],22:d,24:u,25:p,26:y,27:g,28:m,29:f,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:$,51:x,52:C,53:v,54:D,57:w},t(I,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(I,[2,34]),t(I,[2,35]),t(I,[2,36]),t(I,[2,37]),t(A,[2,46]),t(A,[2,47]),t(I,[2,15]),t(I,[2,19]),t(L,r,{7:78}),t(I,[2,26]),t(I,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,81],22:d,24:u,25:p,26:y,27:g,28:m,29:f,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:$,51:x,52:C,53:v,54:D,57:w},t(I,[2,32]),t(I,[2,33]),t(I,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:s(function(t,e){if(!e.recoverable){var s=new Error(t);throw s.hash=e,s}this.trace(t)},"parseError"),parse:s(function(t){var e=this,i=[0],n=[],r=[null],o=[],a=this.table,l="",c=0,h=0,d=o.slice.call(arguments,1),u=Object.create(this.lexer),p={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(p.yy[y]=this.yy[y]);u.setInput(t,p.yy),p.yy.lexer=u,p.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var g=u.yylloc;o.push(g);var m=u.options&&u.options.ranges;function f(){var t;return"number"!=typeof(t=n.pop()||u.lex()||1)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(function(t){i.length=i.length-2*t,r.length=r.length-t,o.length=o.length-t},"popStack"),s(f,"lex");for(var S,k,b,T,_,E,$,x,C={};;){if(k=i[i.length-1],this.defaultActions[k]?b=this.defaultActions[k]:(null==S&&(S=f()),b=a[k]&&a[k][S]),void 0===b||!b.length||!b[0]){var v="";for(_ in x=[],a[k])this.terminals_[_]&&_>2&&x.push("'"+this.terminals_[_]+"'");v=u.showPosition?"Parse error on line "+(c+1)+":\n"+u.showPosition()+"\nExpecting "+x.join(", ")+", got '"+(this.terminals_[S]||S)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==S?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(v,{text:u.match,token:this.terminals_[S]||S,line:u.yylineno,loc:g,expected:x})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+S);switch(b[0]){case 1:i.push(S),r.push(u.yytext),o.push(u.yylloc),i.push(b[1]),S=null,h=u.yyleng,l=u.yytext,c=u.yylineno,g=u.yylloc;break;case 2:if(E=this.productions_[b[1]][1],C.$=r[r.length-E],C._$={first_line:o[o.length-(E||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(E||1)].first_column,last_column:o[o.length-1].last_column},m&&(C._$.range=[o[o.length-(E||1)].range[0],o[o.length-1].range[1]]),void 0!==(T=this.performAction.apply(C,[l,h,c,p.yy,b[1],r,o].concat(d))))return T;E&&(i=i.slice(0,-1*E*2),r=r.slice(0,-1*E),o=o.slice(0,-1*E)),i.push(this.productions_[b[1]][0]),r.push(C.$),o.push(C._$),$=a[i[i.length-2]][i[i.length-1]],i.push($);break;case 3:return!0}}return!0},"parse")},O=function(){return{EOF:1,parseError:s(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:s(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:s(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:s(function(t){this.unput(this.match.slice(t))},"less"),pastInput:s(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:s(function(t,e){var s,i,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var r in n)this[r]=n[r];return!1}return!1},"test_match"),next:s(function(){if(this.done)return this.EOF;var t,e,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length;r++)if((s=this._input.match(this.rules[n[r]]))&&(!e||s[0].length>e[0].length)){if(e=s,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,n[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:s(function(){var t=this.next();return t||this.lex()},"lex"),begin:s(function(t){this.conditionStack.push(t)},"begin"),popState:s(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:s(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:s(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:s(function(t){this.begin(t)},"pushState"),stateStackSize:s(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:s(function(t,e,i,n){function r(){const s=e.yytext.indexOf("%%");if(0===s)return!1;if(s>0){const i=e.yytext.slice(0,s),n=e.yytext.slice(s);n&&t.lexer.unput(n),e.yytext=i}return!0}switch(s(r,"processId"),i){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:case 43:return 51;case 5:case 44:return 52;case 6:case 45:return 53;case 7:case 46:return 54;case 8:case 78:return 5;case 9:case 10:case 11:case 12:case 57:case 63:break;case 13:case 33:return this.pushState("SCALE"),17;case 14:case 34:return 18;case 15:case 21:case 35:case 50:case 54:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 36:this.pushState("STATE");break;case 37:case 40:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),25;case 38:case 41:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),26;case 39:case 42:return this.popState(),e.yytext=e.yytext.slice(0,-10).trim(),27;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:case 65:if(!r())return;return this.popState(),"ID";case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+e.yytext.trim()+'"');case 53:return 19;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 64:return"NOTE_TEXT";case 66:if(!r())return;return this.popState(),this.pushState("NOTE_TEXT"),24;case 67:return this.popState(),e.yytext=e.yytext.substr(2).trim(),31;case 68:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),31;case 69:case 70:return 6;case 71:return 16;case 72:return 57;case 73:if(!r())return;return 24;case 74:return e.yytext=e.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}}}();function R(){this.yy={}}return N.lexer=O,s(R,"Parser"),R.prototype=N,N.Parser=R,new R}();$.parser=$;var x=$,C="state",v="root",D="relation",w="default",I="divider",A="fill:none",L="fill: #333",N="markdown",O="normal",R="rect",B="rectWithTitle",F="divider",j="roundedWithTitle",P="statediagram",Y=`${P}-state`,G="transition",W=`${G} note-edge`,M=`${P}-note`,z=`${P}-cluster`,U=`${P}-cluster-alt`,X="parent",H="note",V="----",K=`${V}${H}`,J=`${V}${X}`,Q=new Map,q=0,Z=0,tt=new Map,et=s((t,e,s,i)=>{if(t===F&&void 0!==s?.id&&tt.has(s.id)){const t=tt.get(s.id);return tt.set(e,t),t}const n=Z++,r=i?void 0:n;return tt.set(e,r),r},"colorSlotFor");function st(t="",e=0,s="",i=V){return`state-${t}${null!==s&&s.length>0?`${i}${s}`:""}-${e}`}s(st,"stateDomId");var it=s((t,e,s,r,o,a,l,c)=>{i.trace("items",e),e.forEach(e=>{switch(e.stmt){case C:case w:lt(t,e,s,r,o,a,l,c);break;case D:{lt(t,e.state1,s,r,o,a,l,c),lt(t,e.state2,s,r,o,a,l,c);const i="neo"===l,h={id:"edge"+q,start:e.state1.id,end:e.state2.id,arrowhead:"normal",arrowTypeEnd:i?"arrow_barb_neo":"arrow_barb",style:A,labelStyle:"",label:g.sanitizeText(e.description??"",n()),arrowheadStyle:L,labelpos:"c",labelType:N,thickness:O,classes:G,look:l};o.push(h),q++}}})},"setupDoc"),nt=s((t,e="TB")=>{let s=e;if(t.doc)for(const e of t.doc)"dir"===e.stmt&&(s=e.value);return s},"getDir");function rt(t,e,s){if(!e.id||"</join></fork>"===e.id||"</choice>"===e.id)return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(t=>{const i=s.get(t);i&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...i.styles])}));const i=t.find(t=>t.id===e.id);i?Object.assign(i,e):t.push(e)}function ot(t){return t?.classes?.join(" ")??""}function at(t){return t?.styles??[]}s(rt,"insertOrUpdateNode"),s(ot,"getClassesFromDbInfo"),s(at,"getStylesFromDbInfo");var lt=s((t,e,s,r,o,a,l,c)=>{const h=e.id,d=s.get(h),u=ot(d),p=at(d),y=n(),m=""!==u.trim()||p.length>0;if(i.info("dataFetcher parsedItem",e,d,p),"root"!==h){let s=R;!0===e.start?s="stateStart":!1===e.start&&(s="stateEnd"),e.type!==w&&(s=e.type),Q.get(h)||Q.set(h,{id:h,shape:s,description:g.sanitizeText(h,y),cssClasses:`${u} ${Y}`,cssStyles:p});const n=Q.get(h);e.description&&(Array.isArray(n.description)?(n.shape=B,n.description.push(e.description)):n.description?.length&&n.description.length>0?(n.shape=B,n.description===h?n.description=[e.description]:n.description=[n.description,e.description]):(n.shape=R,n.description=e.description),n.description=g.sanitizeTextOrArray(n.description,y)),1===n.description?.length&&n.shape===B&&("group"===n.type?n.shape=j:n.shape=R),!n.type&&e.doc&&(i.info("Setting cluster for XCX",h,nt(e)),n.type="group",n.isGroup=!0,n.dir=nt(e),n.shape=e.type===I?F:j,n.colorIndex=et(n.shape,h,t,m),n.cssClasses=`${n.cssClasses} ${z} ${a?U:""}`);const d={labelStyle:"",shape:n.shape,label:n.description,cssClasses:n.cssClasses,cssCompiledStyles:[],cssStyles:n.cssStyles,id:h,dir:n.dir,domId:st(h,q),type:n.type,isGroup:"group"===n.type,colorIndex:n.colorIndex,padding:8,rx:10,ry:10,look:l,labelType:"markdown"};if(d.shape===F&&(d.label=""),t&&"root"!==t.id&&(i.trace("Setting node ",h," to be child of its parent ",t.id),d.parentId=t.id),d.centerLabel=!0,e.note){const t={labelStyle:"",shape:"note",label:e.note.text,labelType:"markdown",cssClasses:M,cssStyles:[],cssCompiledStyles:[],id:h+K+"-"+q,domId:st(h,q,H),type:"node",isGroup:!1,padding:y.flowchart?.padding,look:l,position:e.note.position},s=h+J,i={labelStyle:"",shape:"noteGroup",label:e.note.text,cssClasses:n.cssClasses,cssStyles:[],id:h+J,domId:st(h,q,X),type:"group",isGroup:!0,padding:16,look:l,position:e.note.position};q++,i.id=s,t.parentId=s,rt(r,i,c),rt(r,t,c),rt(r,d,c);let a=h,u=t.id;"left of"===e.note.position&&(a=t.id,u=h),o.push({id:a+"-"+u,start:a,end:u,arrowhead:"none",arrowTypeEnd:"",style:A,labelStyle:"",classes:W,pattern:"dashed",arrowheadStyle:L,labelpos:"c",labelType:N,thickness:O,look:l})}else rt(r,d,c)}e.doc&&(i.trace("Adding nodes children "),it(e,e.doc,s,r,o,!a,l,c))},"dataFetcher"),ct=s(()=>{Q.clear(),q=0,Z=0,tt.clear()},"reset"),ht=s((t,e="TB")=>{if(!t.doc)return e;let s=e;for(const e of t.doc)"dir"===e.stmt&&(s=e.value);return s},"getDir"),dt={getClasses:s(function(t,e){return e.db.getClasses()},"getClasses"),draw:s(async function(s,l,c,h){i.info("REF0:"),i.info("Drawing state diagram (v2)",l);const{securityLevel:d,state:u,layout:p}=n();h.db.extract(h.db.getRootDocV2());const y=h.db.getData(),g=t(l,d);y.type=h.type,y.layoutAlgorithm=r(p),y.nodeSpacing=u?.nodeSpacing||50,y.rankSpacing=u?.rankSpacing||50;"neo"===n().look?y.markers=["barbNeo"]:y.markers=["barb"],y.diagramId=l,await o(y,g);try{("function"==typeof h.db.getLinks?h.db.getLinks():new Map).forEach((t,e)=>{const s="string"==typeof e?e:"string"==typeof e?.id?e.id:"",n=y.nodes.find(t=>t.id===s);if(!s)return void i.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(e));const r=g.node()?.querySelectorAll("g.node, g.rough-node");let o;if(r?.forEach(t=>{const e=t.textContent?.trim();t.id!==n?.domId&&e!==s||(o=t)}),!o)return void i.warn("⚠️ Could not find node matching text:",s);const a=o.parentNode;if(!a)return void i.warn("⚠️ Node has no parent, cannot wrap:",s);const l=document.createElementNS("http://www.w3.org/2000/svg","a"),c=t.url.replace(/^"+|"+$/g,"");if(l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c),l.setAttribute("target","_blank"),t.tooltip){const e=t.tooltip.replace(/^"+|"+$/g,"");l.setAttribute("title",e),o.setAttribute("title",e)}a.replaceChild(l,o),l.appendChild(o),i.info("🔗 Wrapped node in <a> tag for:",s,t.url)})}catch(t){i.error("❌ Error injecting clickable links:",t)}a.insertTitle(g,"statediagramTitleText",u?.titleTopMargin??25,h.db.getDiagramTitle()),e(g,8,P,u?.useMaxWidth??!0)},"draw"),getDir:ht},ut="[*]",pt="start",yt="[*]",gt="end",mt="color",ft="fill",St="bgFill",kt=",",bt=s(()=>new Map,"newClassesList"),Tt=s(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),_t=s(t=>JSON.parse(JSON.stringify(t)),"clone"),Et=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=bt(),this.documents={root:Tt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=l,this.setAccTitle=c,this.getAccDescription=h,this.setAccDescription=d,this.setDiagramTitle=u,this.getDiagramTitle=p,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}static{s(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(t){this.clear(!0);for(const e of Array.isArray(t)?t:t.doc)switch(e.stmt){case C:this.addState(e.id.trim(),e.type,e.doc,e.description,e.note);break;case D:this.addRelation(e.state1,e.state2,e.description);break;case"classDef":this.addStyleClass(e.id.trim(),e.classes);break;case"style":this.handleStyleDef(e);break;case"applyClass":this.setCssClass(e.id.trim(),e.styleClass);break;case"click":this.addLink(e.id,e.url,e.tooltip)}const e=this.getStates(),s=n();ct(),lt(void 0,this.getRootDocV2(),e,this.nodes,this.edges,!0,s.look,this.classes);for(const t of this.nodes)if(Array.isArray(t.label)){if(t.description=t.label.slice(1),t.isGroup&&t.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${t.id}]`);t.label=t.label[0]}}handleStyleDef(t){const e=t.id.trim().split(","),s=t.styleClass.split(",");for(const t of e){let e=this.getState(t);if(!e){const s=t.trim();this.addState(s),e=this.getState(s)}e&&(e.styles=s.map(t=>t.replace(/;/g,"")?.trim()))}}setRootDoc(t){i.info("Setting root doc",t),this.rootDoc=t,1===this.version?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,s){if(e.stmt===D)return this.docTranslator(t,e.state1,!0),void this.docTranslator(t,e.state2,!1);if(e.stmt===C&&(e.id===ut?(e.id=t.id+(s?"_start":"_end"),e.start=s):e.id=e.id.trim()),e.stmt!==v&&e.stmt!==C||!e.doc)return;const i=[];let n=[];for(const t of e.doc)if(t.type===I){const e=_t(t);e.doc=_t(n),i.push(e),n=[]}else n.push(t);if(i.length>0&&n.length>0){const t={stmt:C,id:y(),type:"divider",doc:_t(n)};i.push(_t(t)),e.doc=i}e.doc.forEach(t=>this.docTranslator(e,t,!0))}getRootDocV2(){return this.docTranslator({id:v,stmt:v},{id:v,stmt:v,doc:this.rootDoc},!0),{id:v,doc:this.rootDoc}}addState(t,e=w,s=void 0,r=void 0,o=void 0,a=void 0,l=void 0,c=void 0){const h=t?.trim();if(this.currentDocument.states.has(h)){const t=this.currentDocument.states.get(h);if(!t)throw new Error(`State not found: ${h}`);t.doc||(t.doc=s),t.type||(t.type=e)}else i.info("Adding state ",h,r),this.currentDocument.states.set(h,{stmt:C,id:h,descriptions:[],type:e,doc:s,note:o,classes:[],styles:[],textStyles:[]});if(r){i.info("Setting state description",h,r);(Array.isArray(r)?r:[r]).forEach(t=>this.addDescription(h,t.trim()))}if(o){const t=this.currentDocument.states.get(h);if(!t)throw new Error(`State not found: ${h}`);t.note=o,t.note.text=g.sanitizeText(t.note.text,n())}if(a){i.info("Setting state classes",h,a);(Array.isArray(a)?a:[a]).forEach(t=>this.setCssClass(h,t.trim()))}if(l){i.info("Setting state styles",h,l);(Array.isArray(l)?l:[l]).forEach(t=>this.setStyle(h,t.trim()))}if(c){i.info("Setting state styles",h,l);(Array.isArray(c)?c:[c]).forEach(t=>this.setTextStyle(h,t.trim()))}}clear(t){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Tt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=bt(),t||(this.links=new Map,m())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){i.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,s){this.links.set(t,{url:e,tooltip:s}),i.warn("Adding link",t,e,s)}getLinks(){return this.links}startIdIfNeeded(t=""){return t===ut?(this.startEndCount++,`${pt}${this.startEndCount}`):t}startTypeIfNeeded(t="",e=w){return t===ut?pt:e}endIdIfNeeded(t=""){return t===yt?(this.startEndCount++,`${gt}${this.startEndCount}`):t}endTypeIfNeeded(t="",e=w){return t===yt?gt:e}addRelationObjs(t,e,s=""){const i=this.startIdIfNeeded(t.id.trim()),r=this.startTypeIfNeeded(t.id.trim(),t.type),o=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(i,r,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(o,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:i,id2:o,relationTitle:g.sanitizeText(s,n())})}addRelation(t,e,s){if("object"==typeof t&&"object"==typeof e)this.addRelationObjs(t,e,s);else if("string"==typeof t&&"string"==typeof e){const i=this.startIdIfNeeded(t.trim()),r=this.startTypeIfNeeded(t),o=this.endIdIfNeeded(e.trim()),a=this.endTypeIfNeeded(e);this.addState(i,r),this.addState(o,a),this.currentDocument.relations.push({id1:i,id2:o,relationTitle:s?g.sanitizeText(s,n()):void 0})}}addDescription(t,e){const s=this.currentDocument.states.get(t),i=e.startsWith(":")?e.replace(":","").trim():e;s?.descriptions?.push(g.sanitizeText(i,n()))}cleanupLabel(t){return t.startsWith(":")?t.slice(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});const s=this.classes.get(t);e&&s&&e.split(kt).forEach(t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(mt).exec(t)){const t=e.replace(ft,St).replace(mt,ft);s.textStyles.push(t)}s.styles.push(e)})}getClasses(){return this.classes}setupToolTips(t){const e=E();f(t).select("svg").selectAll("g.node, g.rough-node").on("mouseover",t=>{const s=f(t.currentTarget),i=s.attr("title");if(null===i)return;const n=t.currentTarget?.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.style("left",window.scrollX+n.left+(n.right-n.left)/2+"px").style("top",window.scrollY+n.bottom+"px"),e.html(S.sanitize(i)),s.classed("hover",!0)}).on("mouseout",t=>{e.transition().duration(500).style("opacity",0);f(t.currentTarget).classed("hover",!1)})}setCssClass(t,e){t.split(",").forEach(t=>{let s=this.getState(t);if(!s){const e=t.trim();this.addState(e),s=this.getState(e)}s?.classes?.push(e)})}setStyle(t,e){this.getState(t)?.styles?.push(e)}setTextStyle(t,e){this.getState(t)?.textStyles?.push(e)}bindFunctions(t){this.funs.forEach(e=>{e(t)})}getDirectionStatement(){return this.rootDoc.find(t=>"dir"===t.stmt)}getDirection(){return this.getDirectionStatement()?.value??"TB"}setDirection(t){const e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:"dir",value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){const t=n();for(const e of this.nodes)e.wrappingWidth??=t.state?.wrappingWidth,e.isGroup||(e.minWidth??=t.state?.minNodeWidth);return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:ht(this.getRootDocV2())}}getConfig(){return n().state}},$t=s(t=>{const{theme:e,bkgColorArray:s,borderColorArray:i}=t;if(!k(e,i))return"";const n=b(t.look),r=T(s);let o="";for(let t=0;t<_(i);t++){const e=i[t],a=r?`fill: ${s[t%s.length]};`:"",l=`[data-look="${n}"][data-color-id="color-${t}"]`;o+=`\n\n /* The title strip: \`rect.outer\` spans the whole composite and \`rect.inner\` covers\n the body, so what stays visible of \`outer\` is the band behind the label. */\n ${l}.statediagram-cluster rect.outer {\n stroke: ${e};\n ${a}\n }\n\n ${l}.statediagram-cluster rect.inner {\n stroke: ${e};\n }\n\n /* Concurrency regions. Siblings of one composite share a slot, so a divided composite\n reads as one thing split into parts rather than as several composites. */\n ${l}.statediagram-cluster rect.divider {\n stroke: ${e};\n ${a}\n }\n\n /* handDrawn draws the same container as roughjs shapes rather than plain rects, so it\n needs its own rules. \`roundedWithTitle\` and \`divider\` name those groups \`outer\`,\n \`inner\` and \`divider\` to match the classic branch, which is what lets these\n discriminate -- a bare \`.statediagram-cluster path\` rule reached the body as well and\n tinted the whole composite, losing \`compositeBackground\` and diverging from what\n classic and neo do.\n\n roughjs emits two paths per shape and marks them: the filled shape carries\n \`stroke="none"\` and the sketched outline carries \`fill="none"\`. Splitting on that is\n what keeps \`fill\` off the outline -- a rough outline is open squiggles, not a closed\n region, so filling it produces smears -- and keeps \`stroke\` off the fill shape, which\n would otherwise gain an edge it was drawn without. */\n ${l}.statediagram-cluster .outer path[stroke='none'] {\n ${a}\n }\n\n ${l}.statediagram-cluster .outer path[fill='none'] {\n stroke: ${e};\n }\n\n /* No \`.inner\` rule on purpose. The body shape is left entirely alone under handDrawn,\n where a rect's \`inner\` counterpart cannot be recoloured safely: roughjs draws a\n hachure fill as *stroked* lines, so its fill paths carry \`fill="none"\` exactly like\n the outline and no selector separates them. An \`.inner\` stroke rule therefore\n repainted the hatching of every alt composite in the palette colour instead of\n leaving it on \`altBackground\`. The container still reads as palette-coloured: the\n \`outer\` shape spans the whole composite, so its outline already frames the body. */\n\n /* Regions split the same way, which is why \`divider\` fills solid rather than taking\n roughjs's default hachure -- see the note on that call. Hatched, both of its paths\n carried \`fill="none"\` and these two rules degenerated: the tint matched nothing and\n the border rule repainted the hatching. */\n ${l}.statediagram-cluster .divider path[stroke='none'] {\n ${a}\n }\n\n ${l}.statediagram-cluster .divider path[fill='none'] {\n stroke: ${e};\n }\n `}return o},"genColor"),xt=s(t=>`\n${$t(t)}\ndefs [id$="-barbEnd"] {\n fill: ${t.transitionColor};\n stroke: ${t.transitionColor};\n }\ng.stateGroup text {\n fill: ${t.nodeBorder};\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ${t.textColor};\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ${t.stateLabelColor};\n}\n\ng.stateGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.stateGroup line {\n stroke: ${t.lineColor};\n stroke-width: ${t.strokeWidth||1};\n}\n\n.transition {\n stroke: ${t.transitionColor};\n stroke-width: ${t.strokeWidth||1};\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ${t.background};\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n\n text {\n fill: ${t.noteTextColor};\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ${t.labelBackgroundColor};\n opacity: 0.5;\n}\n.edgeLabel {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n}\n.edgeLabel .label text {\n fill: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n.label div .edgeLabel {\n color: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n\n.stateLabel text {\n fill: ${t.stateLabelColor};\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node .fork-join {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node circle.state-end {\n fill: ${t.innerEndBackground};\n stroke: ${t.background};\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ${t.compositeBackground||t.background};\n // stroke: ${t.background};\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ${t.stateBkg||t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth||1}px;\n}\n.node polygon {\n fill: ${t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};;\n stroke-width: ${t.strokeWidth||1}px;\n}\n[id$="-barbEnd"] {\n fill: ${t.lineColor};\n}\n\n.statediagram-cluster rect {\n fill: ${t.compositeTitleBackground};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth||1}px;\n}\n\n.cluster-label, .nodeLabel {\n color: ${t.stateLabelColor};\n // line-height: 1;\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ${t.stateBorder||t.nodeBorder};\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ${t.compositeBackground||t.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ${t.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n color: ${t.noteTextColor};\n}\n.statediagram .edgeLabel {\n color: red; // ${t.noteTextColor};\n}\n\n[id$="-dependencyStart"], [id$="-dependencyEnd"] {\n fill: ${t.lineColor};\n stroke: ${t.lineColor};\n stroke-width: ${t.strokeWidth||1};\n}\n\n.statediagramTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n\n[data-look="neo"].statediagram-cluster rect {\n fill: ${t.mainBkg};\n stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth??1};\n}\n[data-look="neo"].statediagram-cluster rect.outer {\n rx: ${t.radius}px;\n ry: ${t.radius}px;\n filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"}\n}\n`,"getStyles"),Ct={parser:x,get db(){return new Et(2)},renderer:dt,styles:xt,init:s(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{Ct as diagram};
1
+ import{g as t}from"./chunk-XXDRQBXY-DPPGTM3w.js";import{s as e}from"./chunk-VQ5W62QI-CsGo0PTx.js";import{_ as s,l as i,c as n,r,t as o,u as a,a as l,b as c,g as h,s as d,v as u,x as p,ag as y,m as g,C as m,k as f,B as S,E as k,F as b,G as T,M as _}from"./mermaid.core-DRk6tt5W.js";import{c as E}from"./chunk-55XCU76K-CvYWAV_o.js";import"./index-BpcqEzEG.js";import"react/jsx-runtime";import"react";import"./enums.js";import"./commons-iref2pEJ.js";import"./settings-CBGV-lz3.js";import"./constants.js";import"./LoaderLayer-ECtsj85k.js";import"./websocket-CdeP8N_S.js";import"./index-2PTQqTnK.js";import"motion/react";import"react-dom";import"swr";import"@ably/spaces";import"@ably/spaces/react";import"ably";import"ably/liveobjects";import"ably/react";import"@ably/spaces/dist/mjs/react";import"./string-DPJhNSkw.js";var $=function(){var t=s(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[1,2],i=[1,3],n=[1,4],r=[2,4],o=[1,9],a=[1,11],l=[1,16],c=[1,17],h=[1,18],d=[1,19],u=[1,33],p=[1,20],y=[1,21],g=[1,22],m=[1,23],f=[1,24],S=[1,26],k=[1,27],b=[1,28],T=[1,29],_=[1,30],E=[1,31],$=[1,32],x=[1,35],C=[1,36],v=[1,37],D=[1,38],w=[1,34],I=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],A=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],L=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],N={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"--\x3e":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"--\x3e",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:s(function(t,e,s,i,n,r,o){var a=r.length-1;switch(n){case 3:return i.setRootDoc(r[a]),r[a];case 4:this.$=[];break;case 5:"nl"!=r[a]&&(r[a-1].push(r[a]),this.$=r[a-1]);break;case 6:case 7:case 12:this.$=r[a];break;case 8:this.$="nl";break;case 13:const t=r[a-1];t.description=i.trimColon(r[a]),this.$=t;break;case 14:this.$={stmt:"relation",state1:r[a-2],state2:r[a]};break;case 15:const e=i.trimColon(r[a]);this.$={stmt:"relation",state1:r[a-3],state2:r[a-1],description:e};break;case 19:this.$={stmt:"state",id:r[a-3],type:"default",description:"",doc:r[a-1]};break;case 20:var l=r[a],c=r[a-2].trim();if(r[a].match(":")){var h=r[a].split(":");l=h[0],c=[c,h[1]]}this.$={stmt:"state",id:l,type:"default",description:c};break;case 21:this.$={stmt:"state",id:r[a-3],type:"default",description:r[a-5],doc:r[a-1]};break;case 22:this.$={stmt:"state",id:r[a],type:"fork"};break;case 23:this.$={stmt:"state",id:r[a],type:"join"};break;case 24:this.$={stmt:"state",id:r[a],type:"choice"};break;case 25:this.$={stmt:"state",id:i.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:r[a-1].trim(),note:{position:r[a-2].trim(),text:r[a].trim()}};break;case 29:this.$=r[a].trim(),i.setAccTitle(this.$);break;case 30:case 31:this.$=r[a].trim(),i.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:r[a-3],url:r[a-2],tooltip:r[a-1]};break;case 33:this.$={stmt:"click",id:r[a-3],url:r[a-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:r[a-1].trim(),classes:r[a].trim()};break;case 36:this.$={stmt:"style",id:r[a-1].trim(),styleClass:r[a].trim()};break;case 37:this.$={stmt:"applyClass",id:r[a-1].trim(),styleClass:r[a].trim()};break;case 38:i.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:i.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:i.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:i.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:r[a].trim(),type:"default",description:""};break;case 46:case 47:this.$={stmt:"state",id:r[a-2].trim(),classes:[r[a].trim()],type:"default",description:""}}},"anonymous"),table:[{3:1,4:e,5:i,6:n},{1:[3]},{3:5,4:e,5:i,6:n},{3:6,4:e,5:i,6:n},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:d,24:u,25:p,26:y,27:g,28:m,29:f,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:$,51:x,52:C,53:v,54:D,57:w},t(I,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:d,24:u,25:p,26:y,27:g,28:m,29:f,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:$,51:x,52:C,53:v,54:D,57:w},t(I,[2,7]),t(I,[2,8]),t(I,[2,9]),t(I,[2,10]),t(I,[2,11]),t(I,[2,12],{14:[1,40],15:[1,41]}),t(I,[2,16]),{18:[1,42]},t(I,[2,18],{20:[1,43]}),{23:[1,44]},t(I,[2,22]),t(I,[2,23]),t(I,[2,24]),t(I,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(I,[2,28]),{34:[1,49]},{36:[1,50]},t(I,[2,31]),{13:51,24:u,57:w},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(A,[2,44],{58:[1,56]}),t(A,[2,45],{58:[1,57]}),t(I,[2,38]),t(I,[2,39]),t(I,[2,40]),t(I,[2,41]),t(I,[2,6]),t(I,[2,13]),{13:58,24:u,57:w},t(I,[2,17]),t(L,r,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(I,[2,29]),t(I,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(I,[2,14],{14:[1,71]}),{4:o,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,72],22:d,24:u,25:p,26:y,27:g,28:m,29:f,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:$,51:x,52:C,53:v,54:D,57:w},t(I,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(I,[2,34]),t(I,[2,35]),t(I,[2,36]),t(I,[2,37]),t(A,[2,46]),t(A,[2,47]),t(I,[2,15]),t(I,[2,19]),t(L,r,{7:78}),t(I,[2,26]),t(I,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,81],22:d,24:u,25:p,26:y,27:g,28:m,29:f,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:$,51:x,52:C,53:v,54:D,57:w},t(I,[2,32]),t(I,[2,33]),t(I,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:s(function(t,e){if(!e.recoverable){var s=new Error(t);throw s.hash=e,s}this.trace(t)},"parseError"),parse:s(function(t){var e=this,i=[0],n=[],r=[null],o=[],a=this.table,l="",c=0,h=0,d=o.slice.call(arguments,1),u=Object.create(this.lexer),p={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(p.yy[y]=this.yy[y]);u.setInput(t,p.yy),p.yy.lexer=u,p.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var g=u.yylloc;o.push(g);var m=u.options&&u.options.ranges;function f(){var t;return"number"!=typeof(t=n.pop()||u.lex()||1)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(function(t){i.length=i.length-2*t,r.length=r.length-t,o.length=o.length-t},"popStack"),s(f,"lex");for(var S,k,b,T,_,E,$,x,C={};;){if(k=i[i.length-1],this.defaultActions[k]?b=this.defaultActions[k]:(null==S&&(S=f()),b=a[k]&&a[k][S]),void 0===b||!b.length||!b[0]){var v="";for(_ in x=[],a[k])this.terminals_[_]&&_>2&&x.push("'"+this.terminals_[_]+"'");v=u.showPosition?"Parse error on line "+(c+1)+":\n"+u.showPosition()+"\nExpecting "+x.join(", ")+", got '"+(this.terminals_[S]||S)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==S?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(v,{text:u.match,token:this.terminals_[S]||S,line:u.yylineno,loc:g,expected:x})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+S);switch(b[0]){case 1:i.push(S),r.push(u.yytext),o.push(u.yylloc),i.push(b[1]),S=null,h=u.yyleng,l=u.yytext,c=u.yylineno,g=u.yylloc;break;case 2:if(E=this.productions_[b[1]][1],C.$=r[r.length-E],C._$={first_line:o[o.length-(E||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(E||1)].first_column,last_column:o[o.length-1].last_column},m&&(C._$.range=[o[o.length-(E||1)].range[0],o[o.length-1].range[1]]),void 0!==(T=this.performAction.apply(C,[l,h,c,p.yy,b[1],r,o].concat(d))))return T;E&&(i=i.slice(0,-1*E*2),r=r.slice(0,-1*E),o=o.slice(0,-1*E)),i.push(this.productions_[b[1]][0]),r.push(C.$),o.push(C._$),$=a[i[i.length-2]][i[i.length-1]],i.push($);break;case 3:return!0}}return!0},"parse")},O=function(){return{EOF:1,parseError:s(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:s(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:s(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:s(function(t){this.unput(this.match.slice(t))},"less"),pastInput:s(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:s(function(t,e){var s,i,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var r in n)this[r]=n[r];return!1}return!1},"test_match"),next:s(function(){if(this.done)return this.EOF;var t,e,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length;r++)if((s=this._input.match(this.rules[n[r]]))&&(!e||s[0].length>e[0].length)){if(e=s,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,n[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:s(function(){var t=this.next();return t||this.lex()},"lex"),begin:s(function(t){this.conditionStack.push(t)},"begin"),popState:s(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:s(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:s(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:s(function(t){this.begin(t)},"pushState"),stateStackSize:s(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:s(function(t,e,i,n){function r(){const s=e.yytext.indexOf("%%");if(0===s)return!1;if(s>0){const i=e.yytext.slice(0,s),n=e.yytext.slice(s);n&&t.lexer.unput(n),e.yytext=i}return!0}switch(s(r,"processId"),i){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:case 43:return 51;case 5:case 44:return 52;case 6:case 45:return 53;case 7:case 46:return 54;case 8:case 78:return 5;case 9:case 10:case 11:case 12:case 57:case 63:break;case 13:case 33:return this.pushState("SCALE"),17;case 14:case 34:return 18;case 15:case 21:case 35:case 50:case 54:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 36:this.pushState("STATE");break;case 37:case 40:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),25;case 38:case 41:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),26;case 39:case 42:return this.popState(),e.yytext=e.yytext.slice(0,-10).trim(),27;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:case 65:if(!r())return;return this.popState(),"ID";case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+e.yytext.trim()+'"');case 53:return 19;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 64:return"NOTE_TEXT";case 66:if(!r())return;return this.popState(),this.pushState("NOTE_TEXT"),24;case 67:return this.popState(),e.yytext=e.yytext.substr(2).trim(),31;case 68:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),31;case 69:case 70:return 6;case 71:return 16;case 72:return 57;case 73:if(!r())return;return 24;case 74:return e.yytext=e.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}}}();function R(){this.yy={}}return N.lexer=O,s(R,"Parser"),R.prototype=N,N.Parser=R,new R}();$.parser=$;var x=$,C="state",v="root",D="relation",w="default",I="divider",A="fill:none",L="fill: #333",N="markdown",O="normal",R="rect",B="rectWithTitle",F="divider",j="roundedWithTitle",P="statediagram",Y=`${P}-state`,G="transition",W=`${G} note-edge`,M=`${P}-note`,z=`${P}-cluster`,U=`${P}-cluster-alt`,X="parent",H="note",V="----",K=`${V}${H}`,J=`${V}${X}`,Q=new Map,q=0,Z=0,tt=new Map,et=s((t,e,s,i)=>{if(t===F&&void 0!==s?.id&&tt.has(s.id)){const t=tt.get(s.id);return tt.set(e,t),t}const n=Z++,r=i?void 0:n;return tt.set(e,r),r},"colorSlotFor");function st(t="",e=0,s="",i=V){return`state-${t}${null!==s&&s.length>0?`${i}${s}`:""}-${e}`}s(st,"stateDomId");var it=s((t,e,s,r,o,a,l,c)=>{i.trace("items",e),e.forEach(e=>{switch(e.stmt){case C:case w:lt(t,e,s,r,o,a,l,c);break;case D:{lt(t,e.state1,s,r,o,a,l,c),lt(t,e.state2,s,r,o,a,l,c);const i="neo"===l,h={id:"edge"+q,start:e.state1.id,end:e.state2.id,arrowhead:"normal",arrowTypeEnd:i?"arrow_barb_neo":"arrow_barb",style:A,labelStyle:"",label:g.sanitizeText(e.description??"",n()),arrowheadStyle:L,labelpos:"c",labelType:N,thickness:O,classes:G,look:l};o.push(h),q++}}})},"setupDoc"),nt=s((t,e="TB")=>{let s=e;if(t.doc)for(const e of t.doc)"dir"===e.stmt&&(s=e.value);return s},"getDir");function rt(t,e,s){if(!e.id||"</join></fork>"===e.id||"</choice>"===e.id)return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(t=>{const i=s.get(t);i&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...i.styles])}));const i=t.find(t=>t.id===e.id);i?Object.assign(i,e):t.push(e)}function ot(t){return t?.classes?.join(" ")??""}function at(t){return t?.styles??[]}s(rt,"insertOrUpdateNode"),s(ot,"getClassesFromDbInfo"),s(at,"getStylesFromDbInfo");var lt=s((t,e,s,r,o,a,l,c)=>{const h=e.id,d=s.get(h),u=ot(d),p=at(d),y=n(),m=""!==u.trim()||p.length>0;if(i.info("dataFetcher parsedItem",e,d,p),"root"!==h){let s=R;!0===e.start?s="stateStart":!1===e.start&&(s="stateEnd"),e.type!==w&&(s=e.type),Q.get(h)||Q.set(h,{id:h,shape:s,description:g.sanitizeText(h,y),cssClasses:`${u} ${Y}`,cssStyles:p});const n=Q.get(h);e.description&&(Array.isArray(n.description)?(n.shape=B,n.description.push(e.description)):n.description?.length&&n.description.length>0?(n.shape=B,n.description===h?n.description=[e.description]:n.description=[n.description,e.description]):(n.shape=R,n.description=e.description),n.description=g.sanitizeTextOrArray(n.description,y)),1===n.description?.length&&n.shape===B&&("group"===n.type?n.shape=j:n.shape=R),!n.type&&e.doc&&(i.info("Setting cluster for XCX",h,nt(e)),n.type="group",n.isGroup=!0,n.dir=nt(e),n.shape=e.type===I?F:j,n.colorIndex=et(n.shape,h,t,m),n.cssClasses=`${n.cssClasses} ${z} ${a?U:""}`);const d={labelStyle:"",shape:n.shape,label:n.description,cssClasses:n.cssClasses,cssCompiledStyles:[],cssStyles:n.cssStyles,id:h,dir:n.dir,domId:st(h,q),type:n.type,isGroup:"group"===n.type,colorIndex:n.colorIndex,padding:8,rx:10,ry:10,look:l,labelType:"markdown"};if(d.shape===F&&(d.label=""),t&&"root"!==t.id&&(i.trace("Setting node ",h," to be child of its parent ",t.id),d.parentId=t.id),d.centerLabel=!0,e.note){const t={labelStyle:"",shape:"note",label:e.note.text,labelType:"markdown",cssClasses:M,cssStyles:[],cssCompiledStyles:[],id:h+K+"-"+q,domId:st(h,q,H),type:"node",isGroup:!1,padding:y.flowchart?.padding,look:l,position:e.note.position},s=h+J,i={labelStyle:"",shape:"noteGroup",label:e.note.text,cssClasses:n.cssClasses,cssStyles:[],id:h+J,domId:st(h,q,X),type:"group",isGroup:!0,padding:16,look:l,position:e.note.position};q++,i.id=s,t.parentId=s,rt(r,i,c),rt(r,t,c),rt(r,d,c);let a=h,u=t.id;"left of"===e.note.position&&(a=t.id,u=h),o.push({id:a+"-"+u,start:a,end:u,arrowhead:"none",arrowTypeEnd:"",style:A,labelStyle:"",classes:W,pattern:"dashed",arrowheadStyle:L,labelpos:"c",labelType:N,thickness:O,look:l})}else rt(r,d,c)}e.doc&&(i.trace("Adding nodes children "),it(e,e.doc,s,r,o,!a,l,c))},"dataFetcher"),ct=s(()=>{Q.clear(),q=0,Z=0,tt.clear()},"reset"),ht=s((t,e="TB")=>{if(!t.doc)return e;let s=e;for(const e of t.doc)"dir"===e.stmt&&(s=e.value);return s},"getDir"),dt={getClasses:s(function(t,e){return e.db.getClasses()},"getClasses"),draw:s(async function(s,l,c,h){i.info("REF0:"),i.info("Drawing state diagram (v2)",l);const{securityLevel:d,state:u,layout:p}=n();h.db.extract(h.db.getRootDocV2());const y=h.db.getData(),g=t(l,d);y.type=h.type,y.layoutAlgorithm=r(p),y.nodeSpacing=u?.nodeSpacing||50,y.rankSpacing=u?.rankSpacing||50;"neo"===n().look?y.markers=["barbNeo"]:y.markers=["barb"],y.diagramId=l,await o(y,g);try{("function"==typeof h.db.getLinks?h.db.getLinks():new Map).forEach((t,e)=>{const s="string"==typeof e?e:"string"==typeof e?.id?e.id:"",n=y.nodes.find(t=>t.id===s);if(!s)return void i.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(e));const r=g.node()?.querySelectorAll("g.node, g.rough-node");let o;if(r?.forEach(t=>{const e=t.textContent?.trim();t.id!==n?.domId&&e!==s||(o=t)}),!o)return void i.warn("⚠️ Could not find node matching text:",s);const a=o.parentNode;if(!a)return void i.warn("⚠️ Node has no parent, cannot wrap:",s);const l=document.createElementNS("http://www.w3.org/2000/svg","a"),c=t.url.replace(/^"+|"+$/g,"");if(l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c),l.setAttribute("target","_blank"),t.tooltip){const e=t.tooltip.replace(/^"+|"+$/g,"");l.setAttribute("title",e),o.setAttribute("title",e)}a.replaceChild(l,o),l.appendChild(o),i.info("🔗 Wrapped node in <a> tag for:",s,t.url)})}catch(t){i.error("❌ Error injecting clickable links:",t)}a.insertTitle(g,"statediagramTitleText",u?.titleTopMargin??25,h.db.getDiagramTitle()),e(g,8,P,u?.useMaxWidth??!0)},"draw"),getDir:ht},ut="[*]",pt="start",yt="[*]",gt="end",mt="color",ft="fill",St="bgFill",kt=",",bt=s(()=>new Map,"newClassesList"),Tt=s(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),_t=s(t=>JSON.parse(JSON.stringify(t)),"clone"),Et=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=bt(),this.documents={root:Tt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=l,this.setAccTitle=c,this.getAccDescription=h,this.setAccDescription=d,this.setDiagramTitle=u,this.getDiagramTitle=p,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}static{s(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(t){this.clear(!0);for(const e of Array.isArray(t)?t:t.doc)switch(e.stmt){case C:this.addState(e.id.trim(),e.type,e.doc,e.description,e.note);break;case D:this.addRelation(e.state1,e.state2,e.description);break;case"classDef":this.addStyleClass(e.id.trim(),e.classes);break;case"style":this.handleStyleDef(e);break;case"applyClass":this.setCssClass(e.id.trim(),e.styleClass);break;case"click":this.addLink(e.id,e.url,e.tooltip)}const e=this.getStates(),s=n();ct(),lt(void 0,this.getRootDocV2(),e,this.nodes,this.edges,!0,s.look,this.classes);for(const t of this.nodes)if(Array.isArray(t.label)){if(t.description=t.label.slice(1),t.isGroup&&t.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${t.id}]`);t.label=t.label[0]}}handleStyleDef(t){const e=t.id.trim().split(","),s=t.styleClass.split(",");for(const t of e){let e=this.getState(t);if(!e){const s=t.trim();this.addState(s),e=this.getState(s)}e&&(e.styles=s.map(t=>t.replace(/;/g,"")?.trim()))}}setRootDoc(t){i.info("Setting root doc",t),this.rootDoc=t,1===this.version?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,s){if(e.stmt===D)return this.docTranslator(t,e.state1,!0),void this.docTranslator(t,e.state2,!1);if(e.stmt===C&&(e.id===ut?(e.id=t.id+(s?"_start":"_end"),e.start=s):e.id=e.id.trim()),e.stmt!==v&&e.stmt!==C||!e.doc)return;const i=[];let n=[];for(const t of e.doc)if(t.type===I){const e=_t(t);e.doc=_t(n),i.push(e),n=[]}else n.push(t);if(i.length>0&&n.length>0){const t={stmt:C,id:y(),type:"divider",doc:_t(n)};i.push(_t(t)),e.doc=i}e.doc.forEach(t=>this.docTranslator(e,t,!0))}getRootDocV2(){return this.docTranslator({id:v,stmt:v},{id:v,stmt:v,doc:this.rootDoc},!0),{id:v,doc:this.rootDoc}}addState(t,e=w,s=void 0,r=void 0,o=void 0,a=void 0,l=void 0,c=void 0){const h=t?.trim();if(this.currentDocument.states.has(h)){const t=this.currentDocument.states.get(h);if(!t)throw new Error(`State not found: ${h}`);t.doc||(t.doc=s),t.type||(t.type=e)}else i.info("Adding state ",h,r),this.currentDocument.states.set(h,{stmt:C,id:h,descriptions:[],type:e,doc:s,note:o,classes:[],styles:[],textStyles:[]});if(r){i.info("Setting state description",h,r);(Array.isArray(r)?r:[r]).forEach(t=>this.addDescription(h,t.trim()))}if(o){const t=this.currentDocument.states.get(h);if(!t)throw new Error(`State not found: ${h}`);t.note=o,t.note.text=g.sanitizeText(t.note.text,n())}if(a){i.info("Setting state classes",h,a);(Array.isArray(a)?a:[a]).forEach(t=>this.setCssClass(h,t.trim()))}if(l){i.info("Setting state styles",h,l);(Array.isArray(l)?l:[l]).forEach(t=>this.setStyle(h,t.trim()))}if(c){i.info("Setting state styles",h,l);(Array.isArray(c)?c:[c]).forEach(t=>this.setTextStyle(h,t.trim()))}}clear(t){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Tt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=bt(),t||(this.links=new Map,m())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){i.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,s){this.links.set(t,{url:e,tooltip:s}),i.warn("Adding link",t,e,s)}getLinks(){return this.links}startIdIfNeeded(t=""){return t===ut?(this.startEndCount++,`${pt}${this.startEndCount}`):t}startTypeIfNeeded(t="",e=w){return t===ut?pt:e}endIdIfNeeded(t=""){return t===yt?(this.startEndCount++,`${gt}${this.startEndCount}`):t}endTypeIfNeeded(t="",e=w){return t===yt?gt:e}addRelationObjs(t,e,s=""){const i=this.startIdIfNeeded(t.id.trim()),r=this.startTypeIfNeeded(t.id.trim(),t.type),o=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(i,r,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(o,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:i,id2:o,relationTitle:g.sanitizeText(s,n())})}addRelation(t,e,s){if("object"==typeof t&&"object"==typeof e)this.addRelationObjs(t,e,s);else if("string"==typeof t&&"string"==typeof e){const i=this.startIdIfNeeded(t.trim()),r=this.startTypeIfNeeded(t),o=this.endIdIfNeeded(e.trim()),a=this.endTypeIfNeeded(e);this.addState(i,r),this.addState(o,a),this.currentDocument.relations.push({id1:i,id2:o,relationTitle:s?g.sanitizeText(s,n()):void 0})}}addDescription(t,e){const s=this.currentDocument.states.get(t),i=e.startsWith(":")?e.replace(":","").trim():e;s?.descriptions?.push(g.sanitizeText(i,n()))}cleanupLabel(t){return t.startsWith(":")?t.slice(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});const s=this.classes.get(t);e&&s&&e.split(kt).forEach(t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(mt).exec(t)){const t=e.replace(ft,St).replace(mt,ft);s.textStyles.push(t)}s.styles.push(e)})}getClasses(){return this.classes}setupToolTips(t){const e=E();f(t).select("svg").selectAll("g.node, g.rough-node").on("mouseover",t=>{const s=f(t.currentTarget),i=s.attr("title");if(null===i)return;const n=t.currentTarget?.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.style("left",window.scrollX+n.left+(n.right-n.left)/2+"px").style("top",window.scrollY+n.bottom+"px"),e.html(S.sanitize(i)),s.classed("hover",!0)}).on("mouseout",t=>{e.transition().duration(500).style("opacity",0);f(t.currentTarget).classed("hover",!1)})}setCssClass(t,e){t.split(",").forEach(t=>{let s=this.getState(t);if(!s){const e=t.trim();this.addState(e),s=this.getState(e)}s?.classes?.push(e)})}setStyle(t,e){this.getState(t)?.styles?.push(e)}setTextStyle(t,e){this.getState(t)?.textStyles?.push(e)}bindFunctions(t){this.funs.forEach(e=>{e(t)})}getDirectionStatement(){return this.rootDoc.find(t=>"dir"===t.stmt)}getDirection(){return this.getDirectionStatement()?.value??"TB"}setDirection(t){const e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:"dir",value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){const t=n();for(const e of this.nodes)e.wrappingWidth??=t.state?.wrappingWidth,e.isGroup||(e.minWidth??=t.state?.minNodeWidth);return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:ht(this.getRootDocV2())}}getConfig(){return n().state}},$t=s(t=>{const{theme:e,bkgColorArray:s,borderColorArray:i}=t;if(!k(e,i))return"";const n=b(t.look),r=T(s);let o="";for(let t=0;t<_(i);t++){const e=i[t],a=r?`fill: ${s[t%s.length]};`:"",l=`[data-look="${n}"][data-color-id="color-${t}"]`;o+=`\n\n /* The title strip: \`rect.outer\` spans the whole composite and \`rect.inner\` covers\n the body, so what stays visible of \`outer\` is the band behind the label. */\n ${l}.statediagram-cluster rect.outer {\n stroke: ${e};\n ${a}\n }\n\n ${l}.statediagram-cluster rect.inner {\n stroke: ${e};\n }\n\n /* Concurrency regions. Siblings of one composite share a slot, so a divided composite\n reads as one thing split into parts rather than as several composites. */\n ${l}.statediagram-cluster rect.divider {\n stroke: ${e};\n ${a}\n }\n\n /* handDrawn draws the same container as roughjs shapes rather than plain rects, so it\n needs its own rules. \`roundedWithTitle\` and \`divider\` name those groups \`outer\`,\n \`inner\` and \`divider\` to match the classic branch, which is what lets these\n discriminate -- a bare \`.statediagram-cluster path\` rule reached the body as well and\n tinted the whole composite, losing \`compositeBackground\` and diverging from what\n classic and neo do.\n\n roughjs emits two paths per shape and marks them: the filled shape carries\n \`stroke="none"\` and the sketched outline carries \`fill="none"\`. Splitting on that is\n what keeps \`fill\` off the outline -- a rough outline is open squiggles, not a closed\n region, so filling it produces smears -- and keeps \`stroke\` off the fill shape, which\n would otherwise gain an edge it was drawn without. */\n ${l}.statediagram-cluster .outer path[stroke='none'] {\n ${a}\n }\n\n ${l}.statediagram-cluster .outer path[fill='none'] {\n stroke: ${e};\n }\n\n /* No \`.inner\` rule on purpose. The body shape is left entirely alone under handDrawn,\n where a rect's \`inner\` counterpart cannot be recoloured safely: roughjs draws a\n hachure fill as *stroked* lines, so its fill paths carry \`fill="none"\` exactly like\n the outline and no selector separates them. An \`.inner\` stroke rule therefore\n repainted the hatching of every alt composite in the palette colour instead of\n leaving it on \`altBackground\`. The container still reads as palette-coloured: the\n \`outer\` shape spans the whole composite, so its outline already frames the body. */\n\n /* Regions split the same way, which is why \`divider\` fills solid rather than taking\n roughjs's default hachure -- see the note on that call. Hatched, both of its paths\n carried \`fill="none"\` and these two rules degenerated: the tint matched nothing and\n the border rule repainted the hatching. */\n ${l}.statediagram-cluster .divider path[stroke='none'] {\n ${a}\n }\n\n ${l}.statediagram-cluster .divider path[fill='none'] {\n stroke: ${e};\n }\n `}return o},"genColor"),xt=s(t=>`\n${$t(t)}\ndefs [id$="-barbEnd"] {\n fill: ${t.transitionColor};\n stroke: ${t.transitionColor};\n }\ng.stateGroup text {\n fill: ${t.nodeBorder};\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ${t.textColor};\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ${t.stateLabelColor};\n}\n\ng.stateGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.stateGroup line {\n stroke: ${t.lineColor};\n stroke-width: ${t.strokeWidth||1};\n}\n\n.transition {\n stroke: ${t.transitionColor};\n stroke-width: ${t.strokeWidth||1};\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ${t.background};\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n\n text {\n fill: ${t.noteTextColor};\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ${t.labelBackgroundColor};\n opacity: 0.5;\n}\n.edgeLabel {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n}\n.edgeLabel .label text {\n fill: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n.label div .edgeLabel {\n color: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n\n.stateLabel text {\n fill: ${t.stateLabelColor};\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node .fork-join {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node circle.state-end {\n fill: ${t.innerEndBackground};\n stroke: ${t.background};\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ${t.compositeBackground||t.background};\n // stroke: ${t.background};\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ${t.stateBkg||t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth||1}px;\n}\n.node polygon {\n fill: ${t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};;\n stroke-width: ${t.strokeWidth||1}px;\n}\n[id$="-barbEnd"] {\n fill: ${t.lineColor};\n}\n\n.statediagram-cluster rect {\n fill: ${t.compositeTitleBackground};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth||1}px;\n}\n\n.cluster-label, .nodeLabel {\n color: ${t.stateLabelColor};\n // line-height: 1;\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ${t.stateBorder||t.nodeBorder};\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ${t.compositeBackground||t.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ${t.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n color: ${t.noteTextColor};\n}\n.statediagram .edgeLabel {\n color: red; // ${t.noteTextColor};\n}\n\n[id$="-dependencyStart"], [id$="-dependencyEnd"] {\n fill: ${t.lineColor};\n stroke: ${t.lineColor};\n stroke-width: ${t.strokeWidth||1};\n}\n\n.statediagramTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n\n[data-look="neo"].statediagram-cluster rect {\n fill: ${t.mainBkg};\n stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth??1};\n}\n[data-look="neo"].statediagram-cluster rect.outer {\n rx: ${t.radius}px;\n ry: ${t.radius}px;\n filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"}\n}\n`,"getStyles"),Ct={parser:x,get db(){return new Et(2)},renderer:dt,styles:xt,init:s(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{Ct as diagram};