@inkeep/open-knowledge 0.33.0-beta.10 → 0.33.0-beta.12

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 (209) hide show
  1. package/dist/THIRD_PARTY_NOTICES.md +17 -0
  2. package/dist/assets/skills/discovery/SKILL.md +1 -1
  3. package/dist/assets/skills/project/SKILL.md +1 -1
  4. package/dist/cli.mjs +7 -7
  5. package/dist/constants-Du8u6Zyt.mjs +2 -0
  6. package/dist/{dist-BB07_fNU.mjs → dist-BMyrGBZn.mjs} +84 -84
  7. package/dist/{dist-DH3x1SI7.mjs → dist-Bj-IFbrR.mjs} +1 -1
  8. package/dist/{dist-C_-7dTgR.mjs → dist-CEtcH0vI.mjs} +4 -4
  9. package/dist/{gh-detect-C0TUrJxp.mjs → gh-detect-sL7HpFVB.mjs} +2 -2
  10. package/dist/git-handle-CetHWc5A-CCbjN4Hu.mjs +1 -0
  11. package/dist/{git-handle-dKyep_oZ-vn8B9Tc8.mjs → git-handle-dKyep_oZ-CznvucoT.mjs} +2 -2
  12. package/dist/index.mjs +1 -1
  13. package/dist/init-BaS5ETTA.mjs +1 -0
  14. package/dist/{init-CXlRbgEZ.mjs → init-Drw9_yCG.mjs} +3 -3
  15. package/dist/{launch-json-removal-6s0g2-Dm.mjs → launch-json-removal-B8oFsyah.mjs} +2 -2
  16. package/dist/loader-CTrckFGk.mjs +1 -0
  17. package/dist/{loader-DZ60wqGI.mjs → loader-CzYcbQ3O.mjs} +2 -2
  18. package/dist/{open-browser-9FuRJjpP.mjs → open-browser-rD7Gowl3.mjs} +2 -2
  19. package/dist/{preview-Ch5Z_ly3.mjs → preview-BpBxrtN2.mjs} +2 -2
  20. package/dist/preview-D9sbI422.mjs +1 -0
  21. package/dist/public/assets/{ActivityModeContent-jsCTPiun.js → ActivityModeContent-CEFx8x5P.js} +2 -2
  22. package/dist/public/assets/CodeMirrorPropInput-UpR7oTg9.js +3 -0
  23. package/dist/public/assets/{DocumentContext-CNzSFsI-.js → DocumentContext-DOMYoeSz.js} +2 -2
  24. package/dist/public/assets/{EnableSyncConfirmDialog-D_NbuJ59.js → EnableSyncConfirmDialog-xICuJ5D3.js} +1 -1
  25. package/dist/public/assets/{GraphPanel-BrqHgLjs.js → GraphPanel-BIzs9Pju.js} +1 -1
  26. package/dist/public/assets/{ManagedArtifactProperties-DqTT5fPT.js → ManagedArtifactProperties-t5um4NeA.js} +1 -1
  27. package/dist/public/assets/{McpConsentDialogBody-BrfdQb16.js → McpConsentDialogBody-BTaPbOEF.js} +1 -1
  28. package/dist/public/assets/{MermaidDocEditor-B_dNhePY.js → MermaidDocEditor-FHNKcrel.js} +1 -1
  29. package/dist/public/assets/{PropertyPanel-Dkz1gPoU.js → PropertyPanel-DxOROLS3.js} +2 -2
  30. package/dist/public/assets/{ReportBugDialogBody-CCKV6nZY.js → ReportBugDialogBody-_0hjy_-n.js} +1 -1
  31. package/dist/public/assets/{SettingsDialogBody-BxTayjY8.js → SettingsDialogBody-b5R3mGQ3.js} +1 -1
  32. package/dist/public/assets/{ShareBranchSwitchDialog-BhekOXUp.js → ShareBranchSwitchDialog-GVWNgbjI.js} +1 -1
  33. package/dist/public/assets/{ShareReceiveDialog-o5dNBk6Q.js → ShareReceiveDialog-BNbOnN3D.js} +1 -1
  34. package/dist/public/assets/{ShareReceiveMissDialog-UODMw9si.js → ShareReceiveMissDialog-OwcJGpZh.js} +1 -1
  35. package/dist/public/assets/{SkillEditorActions-euGEb-E6.js → SkillEditorActions-BLOb7UbR.js} +1 -1
  36. package/dist/public/assets/{SourceEditor-CORtf1FY.js → SourceEditor-D3-sRgzm.js} +1 -1
  37. package/dist/public/assets/{TerminalPanel-g64JYtbc.js → TerminalPanel-CMMfPOBP.js} +1 -1
  38. package/dist/public/assets/{_baseFor-By1DbjM-.js → _baseFor-BN36PaKb.js} +1 -1
  39. package/dist/public/assets/{agent-presence-D3uA1hrz.js → agent-presence-Chx4jPSV.js} +1 -1
  40. package/dist/public/assets/{arc-LFJxyEZO.js → arc-BzdTW5mc.js} +1 -1
  41. package/dist/public/assets/architecture-YZFGNWBL-C9EzBynr.js +1 -0
  42. package/dist/public/assets/{architectureDiagram-Q4EWVU46-CcJR-wyi.js → architectureDiagram-Q4EWVU46-PoAxHoeb.js} +1 -1
  43. package/dist/public/assets/{auth-state-cache-DCv4Whjc.js → auth-state-cache-DJPsVl8D.js} +1 -1
  44. package/dist/public/assets/{blockDiagram-DXYQGD6D-BG78-atN.js → blockDiagram-DXYQGD6D-Cj0PUTPk.js} +1 -1
  45. package/dist/public/assets/{c4Diagram-AHTNJAMY--HudfPqc.js → c4Diagram-AHTNJAMY-DFtUYNYe.js} +1 -1
  46. package/dist/public/assets/channel-1647Teii.js +1 -0
  47. package/dist/public/assets/{chunk-2KRD3SAO-C7QyxGwa.js → chunk-2KRD3SAO-D-Ez44Ds.js} +1 -1
  48. package/dist/public/assets/{chunk-336JU56O-DFEiQdL3.js → chunk-336JU56O-DHb7NgDk.js} +2 -2
  49. package/dist/public/assets/chunk-426QAEUC-BOfOOezm.js +1 -0
  50. package/dist/public/assets/{chunk-4BX2VUAB-D0jcVJQX.js → chunk-4BX2VUAB-B1nZWDyG.js} +1 -1
  51. package/dist/public/assets/{chunk-4TB4RGXK-Ch5kNY23.js → chunk-4TB4RGXK-C3qz5gBh.js} +1 -1
  52. package/dist/public/assets/chunk-55IACEB6--gETN8Fg.js +1 -0
  53. package/dist/public/assets/{chunk-5FUZZQ4R-Bnr_Foe2.js → chunk-5FUZZQ4R-CiLbimSt.js} +1 -1
  54. package/dist/public/assets/{chunk-5PVQY5BW-BwH_ti4z.js → chunk-5PVQY5BW-c5z1iYCm.js} +1 -1
  55. package/dist/public/assets/{chunk-67CJDMHE-lFVSBvCx.js → chunk-67CJDMHE-BKKdEQ6d.js} +1 -1
  56. package/dist/public/assets/{chunk-7N4EOEYR-IBdqZW_V.js → chunk-7N4EOEYR-DCac1dMN.js} +1 -1
  57. package/dist/public/assets/{chunk-AA7GKIK3-IcIC5C16.js → chunk-AA7GKIK3-W4aSkfMu.js} +1 -1
  58. package/dist/public/assets/{chunk-BSJP7CBP-SKdXejJy.js → chunk-BSJP7CBP-O-pJBrr0.js} +1 -1
  59. package/dist/public/assets/{chunk-CIAEETIT-BAjIePcN.js → chunk-CIAEETIT-yZNsjIEN.js} +1 -1
  60. package/dist/public/assets/{chunk-EDXVE4YY-CR8P_5d9.js → chunk-EDXVE4YY-BG01O3ZU.js} +1 -1
  61. package/dist/public/assets/{chunk-ENJZ2VHE-Dk4r_2N4.js → chunk-ENJZ2VHE-CWfe3b4S.js} +1 -1
  62. package/dist/public/assets/{chunk-FMBD7UC4-BOsmCNHV.js → chunk-FMBD7UC4-DBRqk2AP.js} +1 -1
  63. package/dist/public/assets/{chunk-FOC6F5B3-CwOTyOky.js → chunk-FOC6F5B3-CRjAm-Wn.js} +1 -1
  64. package/dist/public/assets/{chunk-ICPOFSXX-DrWPpdBM.js → chunk-ICPOFSXX-Lfk6ZyEQ.js} +1 -1
  65. package/dist/public/assets/{chunk-K5T4RW27-7pvl8sqA.js → chunk-K5T4RW27-D396yCSx.js} +1 -1
  66. package/dist/public/assets/{chunk-KGLVRYIC-Bk6rsD6p.js → chunk-KGLVRYIC-BacohCDd.js} +1 -1
  67. package/dist/public/assets/{chunk-LIHQZDEY--LKdQRPz.js → chunk-LIHQZDEY-0ceC9bqP.js} +1 -1
  68. package/dist/public/assets/{chunk-ORNJ4GCN-_GbocDrH.js → chunk-ORNJ4GCN-B93rNuDV.js} +1 -1
  69. package/dist/public/assets/{chunk-OYMX7WX6-DLBaLIww.js → chunk-OYMX7WX6-0g2DkYQG.js} +1 -1
  70. package/dist/public/assets/chunk-QZHKN3VN-BrvzhZbf.js +1 -0
  71. package/dist/public/assets/{chunk-U2HBQHQK-Bx1RHKxc.js → chunk-U2HBQHQK-u9S8o95F.js} +1 -1
  72. package/dist/public/assets/{chunk-X2U36JSP-CSuA8p4I.js → chunk-X2U36JSP-SSsGg9yt.js} +1 -1
  73. package/dist/public/assets/{chunk-XPW4576I-C22VyCuW.js → chunk-XPW4576I-HqP_b0tj.js} +1 -1
  74. package/dist/public/assets/{chunk-YZCP3GAM-CiRF2C0i.js → chunk-YZCP3GAM-C5DYVTut.js} +1 -1
  75. package/dist/public/assets/{chunk-ZZ45TVLE-003_vpT6.js → chunk-ZZ45TVLE-DhQl-h1P.js} +1 -1
  76. package/dist/public/assets/classDiagram-6PBFFD2Q-DltmIg-f.js +1 -0
  77. package/dist/public/assets/classDiagram-v2-HSJHXN6E-DkSuvznv.js +1 -0
  78. package/dist/public/assets/clone-CiIcLVVj.js +1 -0
  79. package/dist/public/assets/{config-provider-DVy-GqC5.js → config-provider-KuReg1Su.js} +1 -1
  80. package/dist/public/assets/{cose-bilkent-S5V4N54A-DQ5Siec0.js → cose-bilkent-S5V4N54A-D2yDcxAe.js} +1 -1
  81. package/dist/public/assets/{dagre-DR5ja0OL.js → dagre-Dh9JoQ-I.js} +1 -1
  82. package/dist/public/assets/{dagre-KV5264BT-CJm6fnkv.js → dagre-KV5264BT-BXlaMVnI.js} +1 -1
  83. package/dist/public/assets/{diagram-5BDNPKRD-Dnn69K8Q.js → diagram-5BDNPKRD-BU4fdZyF.js} +1 -1
  84. package/dist/public/assets/{diagram-G4DWMVQ6-BXiJQBpp.js → diagram-G4DWMVQ6-DL0ElEZ8.js} +1 -1
  85. package/dist/public/assets/{diagram-MMDJMWI5-DfbtJEnB.js → diagram-MMDJMWI5-CO-iFATe.js} +1 -1
  86. package/dist/public/assets/{diagram-TYMM5635-Lnyn_1jE.js → diagram-TYMM5635-BOuCmoT1.js} +1 -1
  87. package/dist/public/assets/dist-7hPoK5kq.js +14 -0
  88. package/dist/public/assets/{dist-DkRtDyLN.js → dist-CT-B-J5Q.js} +157 -157
  89. package/dist/public/assets/dist-CiO2pCFe.js +113 -0
  90. package/dist/public/assets/{dist-Dl_HewkW.js → dist-bX_tv16F.js} +1 -1
  91. package/dist/public/assets/{doc-hash-BDRwCcvB.js → doc-hash-DXoWttRg.js} +1 -1
  92. package/dist/public/assets/{documents-events-CJpJUM_N.js → documents-events-LQncK2wX.js} +1 -1
  93. package/dist/public/assets/{erDiagram-SMLLAGMA-DS214ktF.js → erDiagram-SMLLAGMA-DYS86ST2.js} +1 -1
  94. package/dist/public/assets/{file-tree-adapter-_1h6_EGw.js → file-tree-adapter-BQYcSapJ.js} +1 -1
  95. package/dist/public/assets/{flatten-DBJpRj_e.js → flatten-D-PHkoFv.js} +1 -1
  96. package/dist/public/assets/{flowDiagram-DWJPFMVM-DjwWCA6l.js → flowDiagram-DWJPFMVM-BXf4brRY.js} +1 -1
  97. package/dist/public/assets/{ganttDiagram-T4ZO3ILL-zKt7Tn8U.js → ganttDiagram-T4ZO3ILL-Dy7EaUeg.js} +1 -1
  98. package/dist/public/assets/gitGraph-7Q5UKJZL-Be-pOzZK.js +1 -0
  99. package/dist/public/assets/{gitGraphDiagram-UUTBAWPF-CShvvMF6.js → gitGraphDiagram-UUTBAWPF-BH8Puwv8.js} +1 -1
  100. package/dist/public/assets/{graphlib-DQCymKKc.js → graphlib-BOOJ5alb.js} +1 -1
  101. package/dist/public/assets/{index-Dyz0LlrR.css → index-BHjAks6q.css} +1 -1
  102. package/dist/public/assets/{index-FValh7LC.js → index-DPRykTCF.js} +9 -9
  103. package/dist/public/assets/info-OMHHGYJF-DGWZi34u.js +1 -0
  104. package/dist/public/assets/{infoDiagram-42DDH7IO-CsKXEeyi.js → infoDiagram-42DDH7IO-DYm-edSE.js} +1 -1
  105. package/dist/public/assets/{isEmpty-CghTYbpA.js → isEmpty-CdB340Tp.js} +1 -1
  106. package/dist/public/assets/isSymbol-Csv9XVWz.js +1 -0
  107. package/dist/public/assets/{ishikawaDiagram-UXIWVN3A-CLrnG4Iz.js → ishikawaDiagram-UXIWVN3A-BRkg0HEM.js} +1 -1
  108. package/dist/public/assets/{journeyDiagram-VCZTEJTY-CaGJmz11.js → journeyDiagram-VCZTEJTY-CQPQ8s-M.js} +1 -1
  109. package/dist/public/assets/{kanban-definition-6JOO6SKY-OaJ2Seta.js → kanban-definition-6JOO6SKY-CAhdDZ1X.js} +1 -1
  110. package/dist/public/assets/{line-SlejRdhx.js → line-BkKfTxWN.js} +1 -1
  111. package/dist/public/assets/{linear-Awk0wGSP.js → linear-i4222SVn.js} +1 -1
  112. package/dist/public/assets/{lint-config-client-CX_cssoL.js → lint-config-client-CPfTUQwz.js} +1 -1
  113. package/dist/public/assets/{mermaid-parser.core-wPx7o9bi.js → mermaid-parser.core-BheXl3qv.js} +2 -2
  114. package/dist/public/assets/{mermaid.core-lWTqofm4.js → mermaid.core-CU9cIkfK.js} +3 -3
  115. package/dist/public/assets/{mindmap-definition-QFDTVHPH-RMlKiO4z.js → mindmap-definition-QFDTVHPH-7VHrM-L6.js} +1 -1
  116. package/dist/public/assets/{navigation-targets-S-8o5DE_.js → navigation-targets-Di2LrUzi.js} +1 -1
  117. package/dist/public/assets/{now-DCGRBsdR.js → now-DhU1PfIc.js} +1 -1
  118. package/dist/public/assets/{open-managed-artifact-tab-tiXawScj.js → open-managed-artifact-tab-BsxAVXIl.js} +1 -1
  119. package/dist/public/assets/{ordinal-DAW48Uby.js → ordinal-CEBhmkvU.js} +1 -1
  120. package/dist/public/assets/packet-4T2RLAQJ-Bp8WHmdZ.js +1 -0
  121. package/dist/public/assets/{pending-receive-nav-store-BUhyCKTL.js → pending-receive-nav-store-C4A5tBrQ.js} +1 -1
  122. package/dist/public/assets/pie-ZZUOXDRM-BjXdL2iW.js +1 -0
  123. package/dist/public/assets/{pieDiagram-DEJITSTG-DMaUTora.js → pieDiagram-DEJITSTG-kNn_P3VI.js} +1 -1
  124. package/dist/public/assets/{prop-types-Cr0Uib4q.js → prop-types-DKB4fsAz.js} +1 -1
  125. package/dist/public/assets/{quadrantDiagram-34T5L4WZ-C9vvzMyD.js → quadrantDiagram-34T5L4WZ-DmdqIQtf.js} +1 -1
  126. package/dist/public/assets/radar-PYXPWWZC-CMdbFxI4.js +1 -0
  127. package/dist/public/assets/{receive-store-DYDEnyEg.js → receive-store-hfHGAKke.js} +1 -1
  128. package/dist/public/assets/{reduce-Bq13EGKJ.js → reduce-CyUHMkZH.js} +1 -1
  129. package/dist/public/assets/{requirementDiagram-MS252O5E-Crw6NVWY.js → requirementDiagram-MS252O5E-C8buLrT8.js} +1 -1
  130. package/dist/public/assets/{sankeyDiagram-XADWPNL6-aQ9OstGV.js → sankeyDiagram-XADWPNL6-C5qK0vs9.js} +1 -1
  131. package/dist/public/assets/{selection-context-BjmeTT0v.js → selection-context-BFD7VG6y.js} +1 -1
  132. package/dist/public/assets/{sequenceDiagram-FGHM5R23-DokF5Yf9.js → sequenceDiagram-FGHM5R23-CiryxpC_.js} +1 -1
  133. package/dist/public/assets/{skill-actions-32qU2dgG.js → skill-actions-Bmtxu6Rs.js} +1 -1
  134. package/dist/public/assets/{skills-api-UJqRM51N.js → skills-api-BlUwavOZ.js} +1 -1
  135. package/dist/public/assets/{src-CBkac3Ms.js → src-36-mu31r.js} +1 -1
  136. package/dist/public/assets/{src-BViYu1Wd.js → src-MPCDFn03.js} +1 -1
  137. package/dist/public/assets/{stateDiagram-FHFEXIEX-DnZpH1Ap.js → stateDiagram-FHFEXIEX-CO0MRhCj.js} +1 -1
  138. package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-DZCMP8H1.js +1 -0
  139. package/dist/public/assets/{target-navigation-intent-BFsJN8Kr.js → target-navigation-intent-Cib_JfkK.js} +1 -1
  140. package/dist/public/assets/{telemetry-impl-CeO1833o.js → telemetry-impl-BV_N19BU.js} +2 -2
  141. package/dist/public/assets/{telemetry-startup-DCPtDyw3.js → telemetry-startup-D3gOFgap.js} +1 -1
  142. package/dist/public/assets/{timeline-definition-GMOUNBTQ-VkpOXKnC.js → timeline-definition-GMOUNBTQ-BWVPg9X_.js} +1 -1
  143. package/dist/public/assets/treeView-SZITEDCU-C74OMGIg.js +1 -0
  144. package/dist/public/assets/treemap-W4RFUUIX-zNzWeD_O.js +1 -0
  145. package/dist/public/assets/{typing-burst-detector-CekoPsaO.js → typing-burst-detector-oZRL3fBI.js} +1 -1
  146. package/dist/public/assets/{use-apply-config-color-theme-CUJwxTbn.js → use-apply-config-color-theme-yfrulrGN.js} +1 -1
  147. package/dist/public/assets/{vennDiagram-DHZGUBPP-D2QdJc9C.js → vennDiagram-DHZGUBPP-CnCUMlYY.js} +1 -1
  148. package/dist/public/assets/wardley-RL74JXVD-D-y-IcPO.js +1 -0
  149. package/dist/public/assets/{wardleyDiagram-NUSXRM2D-CGqNzxMF.js → wardleyDiagram-NUSXRM2D-DPyvwfAB.js} +1 -1
  150. package/dist/public/assets/{workspace-paths-r1tSwfOd.js → workspace-paths-CVM2SZtg.js} +1 -1
  151. package/dist/public/assets/{xychartDiagram-5P7HB3ND-CZRqt4SH.js → xychartDiagram-5P7HB3ND-DxjRhLyv.js} +1 -1
  152. package/dist/public/index.html +27 -27
  153. package/dist/{repair-launch-json-B8-siIVG.mjs → repair-launch-json-BpFQRn--.mjs} +2 -2
  154. package/dist/{repair-mcp-configs-iuxXR-U-.mjs → repair-mcp-configs-BmoP2IO5.mjs} +2 -2
  155. package/dist/{repair-skills-DTChn2Mf.mjs → repair-skills-B-Uw3Y15.mjs} +2 -2
  156. package/dist/repair-skills-CiJ8bkfY.mjs +1 -0
  157. package/dist/server-lock-GuuouVft-DB5FLxfz.mjs +1 -0
  158. package/dist/{server-lock-iLcBw_q0-DWu5z2Sp.mjs → server-lock-iLcBw_q0-CR90BywR.mjs} +2 -2
  159. package/dist/{src-4JZrrUEE.mjs → src-5ctwT_gp.mjs} +2 -2
  160. package/dist/{start-DX8hoO29.mjs → start-0-0AeaP9.mjs} +2 -2
  161. package/dist/start-D3pe9gOU.mjs +1 -0
  162. package/dist/{write-project-skill-BwRqNV9s.mjs → write-project-skill-DzC3sd_Y.mjs} +2 -2
  163. package/package.json +1 -1
  164. package/dist/constants-p-XvThBy.mjs +0 -2
  165. package/dist/git-handle-CetHWc5A-6X5OgagE.mjs +0 -1
  166. package/dist/init-CNb23nGn.mjs +0 -1
  167. package/dist/loader-GV9JFQfo.mjs +0 -1
  168. package/dist/preview-DZuLRNVg.mjs +0 -1
  169. package/dist/public/assets/CodeMirrorPropInput-cmSiPzan.js +0 -3
  170. package/dist/public/assets/architecture-YZFGNWBL-w5qzzPrp.js +0 -1
  171. package/dist/public/assets/channel-D5XfHPw9.js +0 -1
  172. package/dist/public/assets/chunk-426QAEUC-CNG9cIod.js +0 -1
  173. package/dist/public/assets/chunk-55IACEB6-DTK73H5l.js +0 -1
  174. package/dist/public/assets/chunk-QZHKN3VN-BJigOKbg.js +0 -1
  175. package/dist/public/assets/classDiagram-6PBFFD2Q-CrFuzLbj.js +0 -1
  176. package/dist/public/assets/classDiagram-v2-HSJHXN6E-RivRzFvs.js +0 -1
  177. package/dist/public/assets/clone-DksSZsT9.js +0 -1
  178. package/dist/public/assets/gitGraph-7Q5UKJZL-CCAiW1Jw.js +0 -1
  179. package/dist/public/assets/info-OMHHGYJF-DwgoYKrG.js +0 -1
  180. package/dist/public/assets/isSymbol-B1eMZgHp.js +0 -1
  181. package/dist/public/assets/packet-4T2RLAQJ-DAnRNAIs.js +0 -1
  182. package/dist/public/assets/pie-ZZUOXDRM-DZsYFc8Z.js +0 -1
  183. package/dist/public/assets/radar-PYXPWWZC-CDgDbft8.js +0 -1
  184. package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-D3Q1GueM.js +0 -1
  185. package/dist/public/assets/treeView-SZITEDCU-BQ6FwaqK.js +0 -1
  186. package/dist/public/assets/treemap-W4RFUUIX-WDhsYc_w.js +0 -1
  187. package/dist/public/assets/wardley-RL74JXVD-CUF15gYf.js +0 -1
  188. package/dist/repair-skills-CZkLkOIF.mjs +0 -1
  189. package/dist/server-lock-GuuouVft-BjWZinGq.mjs +0 -1
  190. package/dist/start-B9AbQt7f.mjs +0 -1
  191. /package/dist/public/assets/{ActivityPanelDiffView-D3tFIws1.js → ActivityPanelDiffView-CG_Honte.js} +0 -0
  192. /package/dist/public/assets/{ConsentDialogBody-iSJGqfW_.js → ConsentDialogBody-Dv9b5VXu.js} +0 -0
  193. /package/dist/public/assets/{__vite-browser-external-BGqYBZHq.js → __vite-browser-external-DJl9O08R.js} +0 -0
  194. /package/dist/public/assets/{array-DIhPH4qn.js → array-B8vJmP02.js} +0 -0
  195. /package/dist/public/assets/{calendar-C4eWxynX.js → calendar-D5I5yGb3.js} +0 -0
  196. /package/dist/public/assets/{colors-Cgzz_QdT.js → colors-BueFi2wa.js} +0 -0
  197. /package/dist/public/assets/{cytoscape.esm-DdkrBNsF.js → cytoscape.esm-OZ6hI980.js} +0 -0
  198. /package/dist/public/assets/{defaultLocale-C3MNi6_U.js → defaultLocale-C5PFB6dK.js} +0 -0
  199. /package/dist/public/assets/{dist-fptQVG6X.js → dist-CbLk670G.js} +0 -0
  200. /package/dist/public/assets/{init-DhDswxt9.js → init-JsSowIXJ.js} +0 -0
  201. /package/dist/public/assets/{isObjectLike-Dr_zHfrf.js → isObjectLike-7SolmAND.js} +0 -0
  202. /package/dist/public/assets/{min-CbV9N5TI.js → min-CkuuQGnu.js} +0 -0
  203. /package/dist/public/assets/{panzoom.es-CUbt2ABB.js → panzoom.es-B-pFe-0v.js} +0 -0
  204. /package/dist/public/assets/{path-BTT5t8UO.js → path-BKrQerJ7.js} +0 -0
  205. /package/dist/public/assets/{pdf-DUTubR-l.js → pdf-Bma40VK5.js} +0 -0
  206. /package/dist/public/assets/{pdf.worker-BnPDdfCT.js → pdf.worker-Chx-lTE6.js} +0 -0
  207. /package/dist/public/assets/{rough.esm-COePkIn5.js → rough.esm-C_GPLqmq.js} +0 -0
  208. /package/dist/public/assets/{share-metadata-rows-z85jCRiH.js → share-metadata-rows-uIsVZKIO.js} +0 -0
  209. /package/dist/public/assets/{src-CSQC3Qr9.js → src-D68V8cNU.js} +0 -0
@@ -0,0 +1,113 @@
1
+ import{MESSAGE_OPS as e,PARTICIPANT_TYPES as t}from"./dist-7hPoK5kq.js";function n(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function r(e,t){let r=new Map,i=new Map,a=new Map,o=[],s=[...e.querySelectorAll(`g.node`)],c=new Set;for(let e of t.nodes){let t=RegExp(`[-_]${n(e.id)}[-_]\\d+$`),i=s.find(e=>!c.has(e)&&t.test(e.id));i&&(r.set(e.entityId,i),c.add(i),i.setAttribute(`data-mw-entity`,e.entityId))}let l=t.nodes.filter(e=>!r.has(e.entityId)),u=s.filter(e=>!c.has(e));if(l.length===u.length)l.forEach((e,t)=>{r.set(e.entityId,u[t]),u[t].setAttribute(`data-mw-entity`,e.entityId)});else for(let e of l)o.push(e.entityId);let d=[...e.querySelectorAll(`.edgePaths > path, path.flowchart-link`)],f=new Set;for(let e of t.edges){let t=RegExp(`^L[-_]${n(e.source)}[-_]${n(e.target)}[-_]\\d+`),r=d.find(e=>!f.has(e)&&t.test(e.id));r&&(i.set(e.entityId,r),f.add(r),r.setAttribute(`data-mw-entity`,e.entityId))}let p=t.edges.filter(e=>!i.has(e.entityId)),m=d.filter(e=>!f.has(e));if(p.length===m.length)p.forEach((e,t)=>{i.set(e.entityId,m[t]),m[t].setAttribute(`data-mw-entity`,e.entityId)});else for(let e of p)o.push(e.entityId);for(let n of t.subgraphs){let t=[...e.querySelectorAll(`g.cluster`)].find(e=>e.id===n.id||e.id.includes(n.id)||e.querySelector(`.cluster-label`)?.textContent?.trim()===(n.title??n.id));t&&!t.hasAttribute(`data-mw-entity`)&&(t.setAttribute(`data-mw-entity`,n.entityId),r.set(n.entityId,t))}let h=[...e.querySelectorAll(`.edgeLabels > .edgeLabel`)];if(h.length===t.edges.length)t.edges.forEach((e,t)=>{a.set(e.entityId,h[t]),h[t].setAttribute(`data-mw-entity`,e.entityId)});else{let e=t.edges.filter(e=>e.label!==null&&e.label!==``);h.length===e.length&&e.forEach((e,t)=>{a.set(e.entityId,h[t]),h[t].setAttribute(`data-mw-entity`,e.entityId)})}return{nodes:r,edges:i,edgeLabels:a,failed:o}}function i(e,t){let r=new Map,i=new Map,a=new Map,o=[],s=[...e.querySelectorAll(`g.node`)].filter(e=>!/root_start|root_end/.test(e.id)),c=new Set;for(let e of t.states){let t=RegExp(`[-_]${n(e.id)}[-_]\\d+$`),i=s.find(e=>!c.has(e)&&t.test(e.id));i&&(r.set(e.entityId,i),c.add(i),i.setAttribute(`data-mw-entity`,e.entityId))}let l=t.states.filter(e=>!r.has(e.entityId)),u=s.filter(e=>!c.has(e));if(l.length===u.length)l.forEach((e,t)=>{r.set(e.entityId,u[t]),u[t].setAttribute(`data-mw-entity`,e.entityId)});else for(let e of l)o.push(e.entityId);for(let n of t.states.filter(e=>e.isComposite)){let t=[...e.querySelectorAll(`g.cluster`)].find(e=>e.id.includes(n.id)||e.querySelector(`.cluster-label, .label-container + *`)?.textContent?.trim()===n.label);t&&!t.hasAttribute(`data-mw-entity`)&&(t.setAttribute(`data-mw-entity`,n.entityId),r.set(n.entityId,t))}let d=[...e.querySelectorAll(`.edgePaths > path, path.transition`)];if(d.length===t.transitions.length)t.transitions.forEach((e,t)=>{i.set(e.entityId,d[t]),d[t].setAttribute(`data-mw-entity`,e.entityId)});else for(let e of t.transitions)o.push(e.entityId);let f=[...e.querySelectorAll(`.edgeLabels > .edgeLabel`)];if(f.length===t.transitions.length)t.transitions.forEach((e,t)=>{a.set(e.entityId,f[t]),f[t].setAttribute(`data-mw-entity`,e.entityId)});else{let e=t.transitions.filter(e=>e.label);f.length===e.length&&e.forEach((e,t)=>{a.set(e.entityId,f[t]),f[t].setAttribute(`data-mw-entity`,e.entityId)})}return{nodes:r,edges:i,edgeLabels:a,failed:o}}function a(e,t){let r=new Map,i=new Map,a=new Map,o=[],s=[...e.querySelectorAll(`g.node`)],c=new Set;for(let e of t.classes){let t=RegExp(`[-_]${n(e.id)}[-_]\\d+$`),i=s.find(e=>!c.has(e)&&t.test(e.id));i&&(r.set(e.entityId,i),c.add(i),i.setAttribute(`data-mw-entity`,e.entityId))}let l=t.classes.filter(e=>!r.has(e.entityId)),u=s.filter(e=>!c.has(e));if(l.length===u.length)l.forEach((e,t)=>{r.set(e.entityId,u[t]),u[t].setAttribute(`data-mw-entity`,e.entityId)});else for(let e of l)o.push(e.entityId);for(let e of t.classes){let t=r.get(e.entityId);if(!t)continue;let n=[...t.querySelectorAll(`.nodeLabel`)],i=e.members.filter(e=>!e.text.includes(`(`)),a=e.members.filter(e=>e.text.includes(`(`));[...i,...a].forEach((t,r)=>{let i=n[r+1];i&&(i.setAttribute(`data-mw-member-class`,e.id),i.setAttribute(`data-mw-member-line`,String(t.lineIndex)))})}let d=[...e.querySelectorAll(`.edgePaths > path, path.relation`)];if(d.length===t.relations.length)t.relations.forEach((e,t)=>{i.set(e.entityId,d[t]),d[t].setAttribute(`data-mw-entity`,e.entityId)});else for(let e of t.relations)o.push(e.entityId);let f=[...e.querySelectorAll(`.edgeLabels > .edgeLabel`)];return f.length===t.relations.length&&t.relations.forEach((e,t)=>{a.set(e.entityId,f[t]),f[t].setAttribute(`data-mw-entity`,e.entityId)}),{nodes:r,edges:i,edgeLabels:a,failed:o}}function o(e,t){let r=new Map,i=new Map,a=new Map,o=[],s=[...e.querySelectorAll(`g[id*="entity"], g.node`)],c=new Set;for(let e of t.entities){let t=RegExp(`entity-${n(e.id)}-|[-_]${n(e.id)}[-_]\\d+$`),i=s.find(e=>!c.has(e)&&t.test(e.id));i&&(r.set(e.entityId,i),c.add(i),i.setAttribute(`data-mw-entity`,e.entityId))}let l=t.entities.filter(e=>!r.has(e.entityId)),u=s.filter(e=>!c.has(e));if(l.length&&l.length===u.length)l.forEach((e,t)=>{r.set(e.entityId,u[t]),u[t].setAttribute(`data-mw-entity`,e.entityId)});else for(let e of l)o.push(e.entityId);for(let e of t.entities){let t=r.get(e.entityId);if(!t||!e.attributes.length)continue;let n=[...t.querySelectorAll(`.nodeLabel`)];e.attributes.forEach((t,r)=>{for(let i=0;i<4;i++){let a=n[1+r*4+i];a&&(a.setAttribute(`data-mw-attr-entity`,e.id),a.setAttribute(`data-mw-attr-line`,String(t.lineIndex)))}})}let d=[...e.querySelectorAll(`path.relationshipLine, .er.relationshipLine, .edgePaths > path`)];if(d.length===t.relations.length)t.relations.forEach((e,t)=>{i.set(e.entityId,d[t]),d[t].setAttribute(`data-mw-entity`,e.entityId)});else for(let e of t.relations)o.push(e.entityId);let f=[...e.querySelectorAll(`.relationshipLabel, .er.relationshipLabel, .edgeLabels > .edgeLabel`)];return f.length===t.relations.length&&t.relations.forEach((e,t)=>{a.set(e.entityId,f[t]),f[t].setAttribute(`data-mw-entity`,e.entityId)}),{nodes:r,edges:i,edgeLabels:a,failed:o}}function s(e,t){let n=new Map,r=new Map,i=new Map,a=[],o=[...e.querySelectorAll(`.pieCircle`)];[...e.querySelectorAll(`g.legend`)].forEach((e,r)=>{let i=e.querySelector(`text`)?.textContent?.trim()??``,a=t.slices.find(e=>e.label===i||i.startsWith(`${e.label} `));if(!a)return;let s=o[r];s&&!n.has(a.entityId)&&(n.set(a.entityId,s),s.setAttribute(`data-mw-entity`,a.entityId),e.setAttribute(`data-mw-entity`,a.entityId))});for(let e of t.slices)n.has(e.entityId)||a.push(e.entityId);return{nodes:n,edges:r,edgeLabels:i,failed:a}}function c(e,t){let n=new Map,r=new Map,i=new Map,a=[],o=[...e.querySelectorAll(`rect.task`)],s=[...e.querySelectorAll(`text.taskText`)];if(o.length===t.tasks.length)t.tasks.forEach((e,t)=>{n.set(e.entityId,o[t]),o[t].setAttribute(`data-mw-entity`,e.entityId),s[t]?.setAttribute(`data-mw-entity`,e.entityId)});else for(let e of t.tasks)a.push(e.entityId);return{nodes:n,edges:r,edgeLabels:i,failed:a}}function l(e,t){let n=new Map,r=new Map,i=new Map,a=[],o=[...e.querySelectorAll(`text, span, p, div`)].filter(e=>e.children.length===0||e.tagName===`text`),s=new Set;for(let r of t.items){if(!r.matchText){a.push(r.entityId);continue}let t=r.matchText.trim(),i=o.find(e=>!s.has(e)&&e.textContent?.trim()===t)??o.find(e=>!s.has(e)&&(e.textContent?.trim().startsWith(t)??!1));if(!i){a.push(r.entityId);continue}s.add(i);let c=i,l=i.closest(`g`)??i.parentElement;l&&l!==e&&(l.textContent?.trim().length??0)<=t.length+24&&(c=l),c.setAttribute(`data-mw-entity`,r.entityId),c!==i&&i.setAttribute(`data-mw-entity`,r.entityId);for(let e of new Set([c,i])){let t=e.style;t&&(t.pointerEvents=`auto`)}n.set(r.entityId,c)}return{nodes:n,edges:r,edgeLabels:i,failed:a}}function u(e,t){let n=new Map,r=new Map,i=new Map,a=new Map,o=[];for(let r of t.participants){let t=[...e.querySelectorAll(`[name="${CSS.escape(r.id)}"]`)];if(t.length){n.set(r.entityId,t);for(let e of t)e.setAttribute(`data-mw-entity`,r.entityId);for(let e of t){let t=e.parentElement;t&&t.tagName===`g`&&t.setAttribute(`data-mw-entity`,r.entityId)}}else o.push(r.entityId)}let s=[...e.querySelectorAll(`line.actor-line, .actor-line`)];for(let e of t.participants){let t=n.get(e.entityId);if(!t?.length)continue;let i=t[0].getBoundingClientRect(),a=i.left+i.width/2,o=null,c=1/0;for(let e of s){let t=e.getBoundingClientRect(),n=Math.abs(t.left+t.width/2-a);n<c&&(c=n,o=e)}o&&c<40&&r.set(e.entityId,o)}let c=t.events.filter(e=>e.kind===`message`),l=[...e.querySelectorAll(`text.messageText`)],u=[...e.querySelectorAll(`.messageLine0, .messageLine1`)];c.forEach((e,t)=>{let n=u[t],r=l[t];n?(i.set(e.entityId,n),n.setAttribute(`data-mw-entity`,e.entityId)):o.push(e.entityId),r&&(a.set(e.entityId,r),r.setAttribute(`data-mw-entity`,e.entityId))});let d=t.events.filter(e=>e.kind===`note`),f=[...e.querySelectorAll(`.note`)],p=[...e.querySelectorAll(`.noteText`)];return d.forEach((e,t)=>{let n=f[t],r=p[t];if(n){i.set(e.entityId,n),n.setAttribute(`data-mw-entity`,e.entityId);let t=n.parentElement;t&&t.tagName===`g`&&t.setAttribute(`data-mw-entity`,e.entityId)}else o.push(e.entityId);r&&(a.set(e.entityId,r),r.setAttribute(`data-mw-entity`,e.entityId))}),{participants:n,lifelines:r,events:i,eventTexts:a,failed:o}}var d=e=>`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${e}</svg>`,f={trash:d(`<path d="M3 6h18"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"/><path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/><line x1="10" x2="10" y1="11" y2="17"/><line x1="14" x2="14" y1="11" y2="17"/>`),pencil:d(`<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/><path d="m15 5 4 4"/>`),palette:d(`<circle cx="13.5" cy="6.5" r=".5" fill="currentColor"/><circle cx="17.5" cy="10.5" r=".5" fill="currentColor"/><circle cx="8.5" cy="7.5" r=".5" fill="currentColor"/><circle cx="6.5" cy="12.5" r=".5" fill="currentColor"/><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z"/>`),copy:d(`<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>`),shapes:d(`<path d="M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z"/><rect x="3" y="14" width="7" height="7" rx="1"/><circle cx="17.5" cy="17.5" r="3.5"/>`),arrowRight:d(`<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>`),arrowLeftRight:d(`<path d="M8 3 4 7l4 4"/><path d="M4 7h16"/><path d="m16 21 4-4-4-4"/><path d="M20 17H4"/>`),arrowLeftToLine:d(`<path d="M3 19V5"/><path d="m13 6-6 6 6 6"/><path d="M7 12h14"/>`),arrowRightToLine:d(`<path d="M17 12H3"/><path d="m11 18 6-6-6-6"/><path d="M21 5v14"/>`),square:d(`<rect width="18" height="18" x="3" y="3" rx="2"/>`),stickyNote:d(`<path d="M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11l5-5V5a2 2 0 0 0-2-2Z"/><path d="M15 21v-4a2 2 0 0 1 2-2h4"/>`),frame:d(`<line x1="22" x2="2" y1="6" y2="6"/><line x1="22" x2="2" y1="18" y2="18"/><line x1="6" x2="6" y1="2" y2="22"/><line x1="18" x2="18" y1="2" y2="22"/>`),group:d(`<path d="M3 7V5a2 2 0 0 1 2-2h2"/><path d="M17 3h2a2 2 0 0 1 2 2v2"/><path d="M21 17v2a2 2 0 0 1-2 2h-2"/><path d="M7 21H5a2 2 0 0 1-2-2v-2"/><rect width="7" height="5" x="7" y="7" rx="1"/><rect width="7" height="5" x="10" y="12" rx="1"/>`),listPlus:d(`<path d="M11 12H3"/><path d="M16 6H3"/><path d="M16 18H3"/><path d="M18 9v6"/><path d="M21 12h-6"/>`),braces:d(`<path d="M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"/><path d="M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"/>`),hash:d(`<line x1="4" x2="20" y1="9" y2="9"/><line x1="4" x2="20" y1="15" y2="15"/><line x1="10" x2="8" y1="3" y2="21"/><line x1="16" x2="14" y1="3" y2="21"/>`),calendar:d(`<path d="M8 2v4"/><path d="M16 2v4"/><rect width="18" height="18" x="3" y="4" rx="2"/><path d="M3 10h18"/>`),user:d(`<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>`),minus:d(`<path d="M5 12h14"/>`),ellipsis:d(`<circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/>`),chevronDown:d(`<path d="m6 9 6 6 6-6"/>`)},p=class{host;el=null;panelEl=null;constructor(e){this.host=e}get isOpen(){return this.el!==null}show(e,t){this.hide();let n=document.createElement(`div`);n.className=`mw-popover`,n.addEventListener(`pointerdown`,e=>e.stopPropagation());for(let e of t){let t=document.createElement(`button`);if(t.type=`button`,t.className=`mw-popover-btn`+(e.active?` active`:``)+(e.danger?` danger`:``),t.title=e.title,e.icon?t.innerHTML=e.icon:(t.classList.add(`text`),t.textContent=e.glyph??``),e.panel){t.classList.add(`has-panel`);let e=document.createElement(`span`);e.className=`mw-caret`,e.innerHTML=f.chevronDown,t.appendChild(e)}t.addEventListener(`click`,t=>{t.stopPropagation(),e.panel?this.togglePanel(e.panel):(this.hide(),e.onClick?.())}),n.appendChild(t)}n.style.left=`${e.left+e.width/2}px`,n.style.top=`${Math.max(e.top-8,34)}px`,this.host.appendChild(n),this.el=n}togglePanel(e){if(this.panelEl){this.panelEl.remove(),this.panelEl=null;return}let t=document.createElement(`div`);t.className=`mw-popover-panel`;let n=document.createElement(`div`);n.className=`mw-popover-panel-title`,n.textContent=e.title,t.appendChild(n);let r=e.sections??[{items:e.items??[]}];for(let e of r){if(e.title){let n=document.createElement(`div`);n.className=`mw-popover-section-title`,n.textContent=e.title,t.appendChild(n)}let n=document.createElement(`div`);n.className=`mw-popover-grid`,n.style.gridTemplateColumns=`repeat(${e.columns??3}, 1fr)`;for(let t of e.items){let e=document.createElement(`button`);if(e.type=`button`,e.className=`mw-popover-cell`+(t.selected?` selected`:``)+(t.swatch?` swatch`:``),e.title=t.title,t.swatch){let n=document.createElement(`span`);n.className=`mw-swatch-dot`,t.swatch===`none`?n.classList.add(`none`):n.style.background=t.swatch,e.appendChild(n)}else e.textContent=t.glyph??``;e.addEventListener(`click`,e=>{e.stopPropagation(),this.hide(),t.onClick()}),n.appendChild(e)}t.appendChild(n)}this.el.appendChild(t),this.panelEl=t;let i=this.host.getBoundingClientRect().top;t.getBoundingClientRect().top<i+2&&t.classList.add(`below`)}hide(){this.el?.remove(),this.el=null,this.panelEl=null}},m=`
2
+ .mw-popover {
3
+ position: absolute; z-index: 20; transform: translate(-50%, -100%);
4
+ display: flex; align-items: center; gap: 2px; padding: 4px;
5
+ background: var(--mw-chrome-bg, #0a0a0a); border: 1px solid var(--mw-chrome-border, #333);
6
+ border-radius: 8px; box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 8px 30px rgba(0,0,0,0.45);
7
+ font: 13px/1 -apple-system, "Geist", "Inter", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
8
+ }
9
+ .mw-popover-btn {
10
+ border: none; background: none; border-radius: 6px; cursor: pointer;
11
+ height: 28px; min-width: 28px; padding: 0 6px;
12
+ display: inline-flex; align-items: center; justify-content: center; gap: 3px;
13
+ color: var(--mw-chrome-dim, #a1a1a1); line-height: 1;
14
+ transition: background 0.12s, color 0.12s;
15
+ }
16
+ .mw-popover-btn svg { width: 15px; height: 15px; flex: none; }
17
+ .mw-popover-btn.text { font-size: 11.5px; font-weight: 500; letter-spacing: 0.01em; }
18
+ .mw-popover-btn .mw-caret { display: inline-flex; opacity: 0.55; margin-left: -1px; }
19
+ .mw-popover-btn .mw-caret svg { width: 9px; height: 9px; }
20
+ .mw-popover-btn:hover { background: var(--mw-chrome-hover, #1f1f1f); color: var(--mw-chrome-fg, #ededed); }
21
+ .mw-popover-btn.active { background: var(--mw-accent, #0070f3); color: #fff; }
22
+ .mw-popover-btn.danger:hover { background: rgba(255, 68, 68, 0.12); color: #ff4444; }
23
+ .mw-popover-panel {
24
+ position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
25
+ background: var(--mw-chrome-bg, #0a0a0a); border: 1px solid var(--mw-chrome-border, #333);
26
+ border-radius: 8px; box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 8px 30px rgba(0,0,0,0.45);
27
+ padding: 6px; min-width: 140px;
28
+ }
29
+ .mw-popover-panel.below { bottom: auto; top: calc(100% + 6px); }
30
+ .mw-popover-panel-title {
31
+ font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.07em;
32
+ color: var(--mw-chrome-dim, #666); padding: 3px 5px 7px; white-space: nowrap;
33
+ }
34
+ .mw-popover-section-title {
35
+ font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em;
36
+ color: var(--mw-chrome-dim, #666); padding: 6px 5px 4px; white-space: nowrap;
37
+ }
38
+ .mw-popover-grid { display: grid; gap: 2px; }
39
+ .mw-popover-cell {
40
+ border: 1px solid transparent; background: none; border-radius: 6px; padding: 7px 8px;
41
+ cursor: pointer; font-size: 12px; color: var(--mw-chrome-dim, #a1a1a1); white-space: nowrap;
42
+ transition: background 0.12s, color 0.12s;
43
+ }
44
+ .mw-popover-cell:hover { background: var(--mw-chrome-hover, #1f1f1f); color: var(--mw-chrome-fg, #ededed); }
45
+ .mw-popover-cell.selected {
46
+ border-color: var(--mw-accent, #0070f3); color: var(--mw-chrome-fg, #ededed);
47
+ background: color-mix(in srgb, var(--mw-accent, #0070f3) 12%, transparent);
48
+ }
49
+ .mw-popover-cell.swatch { padding: 5px; display: flex; align-items: center; justify-content: center; }
50
+ .mw-swatch-dot { width: 15px; height: 15px; border-radius: 99px; display: block; border: 1px solid rgba(255,255,255,0.18); }
51
+ .mw-swatch-dot.none {
52
+ background: linear-gradient(to top left, transparent 45%, #ff4444 46%, #ff4444 54%, transparent 55%);
53
+ border: 1px solid var(--mw-chrome-dim, #666);
54
+ }
55
+ .mw-lifeline-plus {
56
+ position: absolute; z-index: 15; transform: translate(-50%, -50%);
57
+ width: 18px; height: 18px; border-radius: 99px; border: none; cursor: pointer;
58
+ background: var(--mw-accent, #0070f3); color: #fff; font-size: 13px; line-height: 1;
59
+ display: flex; align-items: center; justify-content: center;
60
+ box-shadow: 0 2px 8px rgba(0,0,0,0.5);
61
+ transition: transform 0.12s;
62
+ }
63
+ .mw-lifeline-plus:hover { transform: translate(-50%, -50%) scale(1.15); }
64
+ .mw-plus-menu {
65
+ position: absolute; z-index: 21; transform: translate(-50%, 4px);
66
+ background: var(--mw-chrome-bg, #0a0a0a); border: 1px solid var(--mw-chrome-border, #333);
67
+ border-radius: 8px; box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 8px 30px rgba(0,0,0,0.45); padding: 4px;
68
+ display: flex; flex-direction: column; min-width: 150px;
69
+ font: 13px/1.2 -apple-system, "Geist", "Inter", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
70
+ }
71
+ .mw-plus-menu button {
72
+ border: none; background: none; text-align: left; border-radius: 6px; padding: 7px 10px;
73
+ cursor: pointer; color: var(--mw-chrome-dim, #a1a1a1); font-size: 12.5px;
74
+ transition: background 0.12s, color 0.12s;
75
+ }
76
+ .mw-plus-menu button:hover { background: var(--mw-chrome-hover, #1f1f1f); color: var(--mw-chrome-fg, #ededed); }
77
+ `,h=[`#ef4444`,`#f97316`,`#eab308`,`#22c55e`,`#06b6d4`,`#6366f1`,`#d946ef`,`#64748b`],g=`
78
+ .mw-canvas { position: relative; overflow: auto; outline: none; }
79
+ .mw-canvas .mw-svg-host { user-select: none; -webkit-user-select: none; }
80
+ .mw-canvas .mw-svg-host { min-height: 100%; display: flex; align-items: flex-start; justify-content: center; padding: 16px; box-sizing: border-box; }
81
+ .mw-canvas svg { max-width: 100%; height: auto; }
82
+ .mw-canvas [data-mw-entity] { cursor: pointer; }
83
+ .mw-canvas.mw-readonly [data-mw-entity] { cursor: default; }
84
+ .mw-canvas.mw-tool-connect [data-mw-entity^="node:"] { cursor: crosshair; }
85
+ .mw-canvas [data-mw-entity]:hover { filter: drop-shadow(0 0 3px var(--mw-accent, #6366f1)); }
86
+ .mw-canvas .mw-selected { filter: drop-shadow(0 0 2px var(--mw-accent, #6366f1)) drop-shadow(0 0 5px var(--mw-accent, #6366f1)) !important; }
87
+ .mw-canvas .mw-ghost-edge { stroke: var(--mw-accent, #6366f1); stroke-width: 2; stroke-dasharray: 6 4; fill: none; pointer-events: none; }
88
+ .mw-canvas .mw-connect-source { filter: drop-shadow(0 0 5px var(--mw-accent, #6366f1)) !important; }
89
+ .mw-inplace-editor {
90
+ position: absolute; z-index: 10; white-space: pre; outline: none;
91
+ padding: 1px 3px; margin: -1px -3px; border-radius: 3px;
92
+ caret-color: var(--mw-accent, #6366f1);
93
+ box-shadow: 0 1.5px 0 0 var(--mw-accent, #6366f1);
94
+ background: color-mix(in srgb, var(--mw-editor-bg, #fff) 35%, transparent);
95
+ }
96
+ .mw-error-badge {
97
+ position: absolute; top: 8px; right: 8px; z-index: 5;
98
+ font: 500 11px/1.4 ui-sans-serif, system-ui, sans-serif;
99
+ background: #dc2626; color: #fff; border-radius: 6px; padding: 3px 8px;
100
+ max-width: 60%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
101
+ }
102
+ .mw-drop-indicator {
103
+ position: absolute; left: 6%; right: 6%; height: 2.5px; z-index: 14;
104
+ background: var(--mw-accent, #6366f1); border-radius: 2px; pointer-events: none;
105
+ box-shadow: 0 0 6px var(--mw-accent, #6366f1);
106
+ }
107
+ .mw-canvas [contenteditable="true"] {
108
+ outline: 1.5px solid var(--mw-accent, #6366f1); outline-offset: 2px; border-radius: 3px;
109
+ cursor: text; white-space: pre-wrap; min-width: 8px;
110
+ }
111
+ `,_=!1,v=0,y=class{editor;container;mermaid;mermaidConfig;svgHost;overlayHost;errorBadge;correlation=null;seqCorrelation=null;popover;plusButtons=[];plusMenu=null;hoveredLifeline=null;svg=null;tool=`select`;readOnly;debounceMs;defaultEdge;hooks;renderTimer=null;lastRenderedCode=``;disposers=[];listeners=new Map;connectSource=null;suppressNextClick=!1;ghostPath=null;dragEvent=null;dragStartY=0;dragging=!1;dropIndicator=null;dropSlots=[];inlineInput=null;inlineHidden=null;pendingEditEntity=null;inPlaceSession=null;lastError=null;renderSeq=0;constructor(e){if(this.editor=e.editor,this.container=e.container,this.mermaid=e.mermaid,this.readOnly=e.readOnly??!1,this.debounceMs=e.debounceMs??200,this.defaultEdge=e.defaultEdge??{},this.hooks=e.hooks??{},this.mermaidConfig={startOnLoad:!1,...e.mermaidConfig},!_){let e=document.createElement(`style`);e.setAttribute(`data-mw`,``),e.textContent=g+m,document.head.appendChild(e),_=!0}this.container.classList.add(`mw-canvas`),this.container.tabIndex=0,e.accentColor&&this.container.style.setProperty(`--mw-accent`,e.accentColor),this.readOnly&&this.container.classList.add(`mw-readonly`),this.svgHost=document.createElement(`div`),this.svgHost.className=`mw-svg-host`,this.overlayHost=document.createElement(`div`),this.errorBadge=document.createElement(`div`),this.errorBadge.className=`mw-error-badge`,this.errorBadge.style.display=`none`,this.container.append(this.svgHost,this.overlayHost,this.errorBadge),this.popover=new p(this.overlayHost),this.mermaid.initialize(this.mermaidConfig),this.disposers.push(this.editor.on(`change`,()=>this.scheduleRender()),this.editor.on(`selectionChange`,()=>this.applySelectionStyles()));let t=e=>this.onKeyDown(e);this.container.addEventListener(`keydown`,t),this.disposers.push(()=>this.container.removeEventListener(`keydown`,t)),this.render()}on(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>this.listeners.get(e).delete(t)}emit(e,t){this.listeners.get(e)?.forEach(e=>e(t))}get currentTool(){return this.tool}get renderError(){return this.lastError}setTool(e){this.tool=e,this.container.classList.toggle(`mw-tool-connect`,e===`connect`),this.cancelConnect(),this.emit(`toolChange`,e)}setReadOnly(e){this.readOnly=e,this.container.classList.toggle(`mw-readonly`,e),this.closeInlineEditor(!1),this.cancelConnect(),this.clearLifelineUi(),this.updatePopover()}setHooks(e){this.hooks=e}setAccentColor(e){this.container.style.setProperty(`--mw-accent`,e)}setMermaidConfig(e){this.mermaidConfig={...this.mermaidConfig,...e},this.mermaid.initialize(this.mermaidConfig),this.lastRenderedCode=``,this.render()}addNode(e=`rect`,t=`New node`){if(this.readOnly)return;let n=this.editor.dispatch({type:`addNode`,shape:e,label:t})?.created?.[0];n&&(this.pendingEditEntity=n)}scheduleRender(){this.renderTimer&&clearTimeout(this.renderTimer),this.renderTimer=setTimeout(()=>void this.render(),this.debounceMs)}async render(){let e=this.editor.code;if(e===this.lastRenderedCode){this.lastError&&(this.lastError=null,this.errorBadge.style.display=`none`,this.editor.setDiagnostics([]),this.emit(`render`,{ok:!0}));return}let t=++this.renderSeq,n=`mw-render-${++v}`;try{let{svg:r}=await this.mermaid.render(n,e);if(t!==this.renderSeq)return;if(this.lastRenderedCode=e,this.lastError=null,this.errorBadge.style.display=`none`,this.svgHost.innerHTML=r,this.svg=this.svgHost.querySelector(`svg`),this.svg&&(this.svg.style.maxWidth=`100%`,this.bindSvg()),this.editor.setDiagnostics([]),this.emit(`render`,{ok:!0}),this.inPlaceSession)this.resumeInPlaceSession();else if(this.pendingEditEntity){let e=this.pendingEditEntity;this.pendingEditEntity=null,this.editor.entityExists(e)&&this.editEntityLabel(e)}}catch(e){if(t!==this.renderSeq)return;document.getElementById(`d${n}`)?.remove(),document.getElementById(n)?.remove();let r=e instanceof Error?e.message.split(`
112
+ `)[0]:String(e);this.lastError=r,this.errorBadge.textContent=`render error: ${r}`,this.errorBadge.style.display=`block`;let i={message:r,span:null,severity:`error`,source:`mermaid`};this.editor.setDiagnostics([i]),this.emit(`render`,{ok:!1,error:r})}}bindSvg(){let e=this.svg;if(!e)return;let{flowchart:t,sequence:n,state:d,classGraph:f,er:p}=this.editor.result;this.correlation=t?r(e,t):d?i(e,d):f?a(e,f):p?o(e,p):this.editor.result.pie?s(e,this.editor.result.pie):this.editor.result.gantt?c(e,this.editor.result.gantt):this.editor.result.lineItems?l(e,this.editor.result.lineItems):null,this.seqCorrelation=n?u(e,n):null,this.clearLifelineUi(),e.addEventListener(`click`,e=>this.onSvgClick(e)),e.addEventListener(`dblclick`,e=>this.onSvgDblClick(e)),e.addEventListener(`pointerdown`,e=>this.onSvgPointerDown(e)),e.addEventListener(`pointermove`,e=>this.onSvgPointerMove(e)),e.addEventListener(`pointerup`,e=>this.onSvgPointerUp(e)),this.seqCorrelation&&(e.addEventListener(`pointermove`,e=>this.onLifelineHover(e)),e.addEventListener(`pointerleave`,()=>this.scheduleLifelineClear())),this.applySelectionStyles()}entityFromEvent(e){return this.entityHitFromEvent(e)?.id??null}entityHitFromEvent(e){let t=e.target;for(;t&&t!==this.svg;){let e=t.getAttribute?.(`data-mw-entity`);if(e)return{id:e,el:t};t=t.parentElement}return null}topmostEntityElement(e){let t=null,n=1/0;return this.svg?.querySelectorAll(`[data-mw-entity="${CSS.escape(e)}"]`).forEach(e=>{let r=e.getBoundingClientRect().top;r<n&&(n=r,t=e)}),t}onSvgClick(e){if(this.suppressNextClick){this.suppressNextClick=!1;return}if(this.inlineInput||this.inPlaceSession)return;let t=this.entityFromEvent(e);if(t){if(this.hooks.onEntityClick?.(t,e),e.shiftKey||e.metaKey||e.ctrlKey){let e=this.editor.selection.includes(t)?this.editor.selection.filter(e=>e!==t):[...this.editor.selection,t];this.editor.setSelection(e,`canvas`)}else this.editor.setSelection([t],`canvas`);this.container.focus({preventScroll:!0})}else this.editor.clearSelection(`canvas`)}onSvgDblClick(e){if(this.readOnly)return;let t=e.target.closest?.(`[data-mw-member-line]`);if(t&&this.editor.result.classGraph){let n=t.getAttribute(`data-mw-member-class`),r=Number(t.getAttribute(`data-mw-member-line`)),i=this.editor.result.classGraph.classById.get(n)?.members.find(e=>e.lineIndex===r);if(i){e.preventDefault(),this.popover.hide(),this.editInPlace(`member:${n}:${r}`,t,`.nodeLabel`,i.text,e=>this.editor.dispatch({type:`cl.setMemberText`,id:n,memberLine:r,text:e},`canvas`),{live:!1});return}}let n=e.target.closest?.(`[data-mw-attr-line]`);if(n&&this.editor.result.er){let t=n.getAttribute(`data-mw-attr-entity`),r=Number(n.getAttribute(`data-mw-attr-line`)),i=this.editor.result.er.entityById.get(t)?.attributes.find(e=>e.lineIndex===r);if(i){e.preventDefault(),this.popover.hide(),this.openOverlayEditor(n,i.text,e=>this.editor.dispatch({type:`er.setAttributeText`,id:t,attrLine:r,text:e},`canvas`));return}}let r=this.entityHitFromEvent(e);r&&(e.preventDefault(),!this.hooks.onEntityDoubleClick?.(r.id)&&this.editEntityLabel(r.id,r.el))}onSvgPointerDown(e){if(this.readOnly)return;let t=this.entityFromEvent(e),n=t?.startsWith(`node:`)||t?.startsWith(`participant:`)||t?.startsWith(`state:`)||t?.startsWith(`class:`)||t?.startsWith(`entity:`),r=this.tool===`connect`||e.altKey;if(n&&r&&t){e.preventDefault(),this.connectSource=t,this.svg?.setPointerCapture?.(e.pointerId),this.entityElement(t)?.classList.add(`mw-connect-source`),this.emit(`connectPreview`,{source:t});return}t?.startsWith(`event:`)&&this.editor.result.sequence&&e.detail<=1&&(this.dragEvent=t,this.dragStartY=e.clientY,this.dragging=!1)}entityElement(e){return this.svg?.querySelector(`[data-mw-entity="${CSS.escape(e)}"]`)??null}onSvgPointerMove(e){if(this.dragEvent&&this.svg){if(!this.dragging&&Math.abs(e.clientY-this.dragStartY)>8&&(this.dragging=!0,this.svg.setPointerCapture?.(e.pointerId),this.computeDropSlots(),this.popover.hide()),this.dragging){let t=this.container.getBoundingClientRect(),n=e.clientY-t.top+this.container.scrollTop,r=this.nearestSlot(n);r&&this.showDropIndicator(r.y)}return}if(!this.connectSource||!this.svg)return;let t=this.entityCenter(this.connectSource),n=this.clientToSvg(e.clientX,e.clientY);!t||!n||(this.ghostPath||(this.ghostPath=document.createElementNS(`http://www.w3.org/2000/svg`,`line`),this.ghostPath.classList.add(`mw-ghost-edge`),this.svg.appendChild(this.ghostPath)),this.ghostPath.setAttribute(`x1`,String(t.x)),this.ghostPath.setAttribute(`y1`,String(t.y)),this.ghostPath.setAttribute(`x2`,String(n.x)),this.ghostPath.setAttribute(`y2`,String(n.y)))}onSvgPointerUp(e){if(this.dragEvent){let t=this.dragEvent,n=this.dragging;if(this.dragEvent=null,this.dragging=!1,this.dropIndicator?.remove(),this.dropIndicator=null,n){this.suppressNextClick=!0;let n=this.container.getBoundingClientRect(),r=this.nearestSlot(e.clientY-n.top+this.container.scrollTop);r&&this.editor.dispatch({type:`seq.moveEvent`,eventId:t,afterEvent:r.afterEvent})}return}if(!this.connectSource)return;let t=this.connectSource,n=t.startsWith(`node:`)?`node:`:t.startsWith(`state:`)?`state:`:t.startsWith(`class:`)?`class:`:t.startsWith(`entity:`)?`entity:`:`participant:`,r=document.elementFromPoint(e.clientX,e.clientY),i=null,a=r;for(;a&&a!==this.container;){let e=a.getAttribute?.(`data-mw-entity`);if(e?.startsWith(n)){i=e;break}a=a.parentElement}this.cancelConnect(),this.suppressNextClick=!0,i&&i!==t&&n===`node:`?this.editor.dispatch({type:`connect`,source:t.slice(5),target:i.slice(5),line:this.defaultEdge.line,arrowEnd:this.defaultEdge.arrowEnd}):i&&i!==t&&n===`participant:`?this.editor.dispatch({type:`seq.addMessage`,source:t.slice(12),target:i.slice(12),text:`message`}):i&&i!==t&&n===`state:`?this.editor.dispatch({type:`st.connect`,source:t.slice(6),target:i.slice(6)}):i&&i!==t&&n===`class:`?this.editor.dispatch({type:`cl.connect`,source:t.slice(6),target:i.slice(6)}):i&&i!==t&&n===`entity:`?this.editor.dispatch({type:`er.connect`,source:t.slice(7),target:i.slice(7)}):(this.editor.setSelection([t],`canvas`),this.container.focus({preventScroll:!0}))}cancelConnect(){this.connectSource&&this.entityElement(this.connectSource)?.classList.remove(`mw-connect-source`),this.connectSource=null,this.ghostPath?.remove(),this.ghostPath=null,this.emit(`connectPreview`,{source:null})}editEntityLabel(e,t){if(this.readOnly)return;let{flowchart:n,sequence:r}=this.editor.result;this.closeInlineEditor(!1),this.popover.hide();let i=t&&t.getAttribute(`data-mw-entity`)===e?t:null,a=null,o=``,s=()=>{};if(n&&e.startsWith(`node:`)){let t=n.nodeById.get(e.slice(5));if(!t||(o=t.label,a=this.correlation?.nodes.get(e)??null,s=e=>this.editor.dispatch({type:`renameNode`,id:t.id,label:e},`canvas`),a&&this.editInPlace(e,a,`.nodeLabel`,o,s)))return}else if(n&&e.startsWith(`edge:`)){let t=n.edges.find(t=>t.entityId===e);if(!t||(o=t.label??``,a=this.correlation?.edgeLabels.get(e)??this.correlation?.edges.get(e)??null,s=t=>this.editor.dispatch({type:`setEdgeLabel`,edgeId:e,label:t},`canvas`),t.label&&a&&this.editInPlace(e,a,`.edgeLabel`,o,s)))return}else if(n&&e.startsWith(`subgraph:`)){let t=n.subgraphs.find(t=>t.entityId===e);if(!t)return;o=t.title??t.id,a=this.correlation?.nodes.get(e)?.querySelector(`.cluster-label`)??i??this.correlation?.nodes.get(e)??this.svg?.querySelector(`#${CSS.escape(t.id)}`)??null,s=e=>this.editor.dispatch({type:`renameSubgraph`,id:t.id,title:e},`canvas`)}else if(this.editor.result.state&&e.startsWith(`state:`)){let t=this.editor.result.state.stateById.get(e.slice(6));if(!t||(o=t.label,a=this.correlation?.nodes.get(e)??null,s=e=>this.editor.dispatch({type:`st.setStateLabel`,id:t.id,label:e},`canvas`),a&&this.editInPlace(e,a,`.nodeLabel`,o,s)))return}else if(this.editor.result.state&&e.startsWith(`trans:`)){let t=this.editor.result.state.transitions.find(t=>t.entityId===e);if(!t||(o=t.label??``,a=this.correlation?.edgeLabels.get(e)??this.correlation?.edges.get(e)??null,s=t=>this.editor.dispatch({type:`st.setTransitionLabel`,transId:e,label:t},`canvas`),t.label&&a&&this.editInPlace(e,a,`.edgeLabel`,o,s)))return}else if(this.editor.result.classGraph&&e.startsWith(`class:`)){let t=this.editor.result.classGraph.classById.get(e.slice(6));if(!t)return;o=t.id,a=i??this.correlation?.nodes.get(e)??null,s=e=>this.editor.dispatch({type:`cl.renameClass`,id:t.id,name:e},`canvas`)}else if(this.editor.result.classGraph&&e.startsWith(`rel:`)){let t=this.editor.result.classGraph.relations.find(t=>t.entityId===e);if(!t)return;o=t.label??``,a=this.correlation?.edgeLabels.get(e)??this.correlation?.edges.get(e)??null,s=t=>this.editor.dispatch({type:`cl.setRelationLabel`,relId:e,label:t},`canvas`)}else if(this.editor.result.er&&e.startsWith(`entity:`)){let t=this.editor.result.er.entityById.get(e.slice(7));if(!t)return;o=t.id,a=i??this.correlation?.nodes.get(e)??null,s=e=>this.editor.dispatch({type:`er.renameEntity`,id:t.id,name:e},`canvas`)}else if(this.editor.result.er&&e.startsWith(`erel:`)){let t=this.editor.result.er.relations.find(t=>t.entityId===e);if(!t)return;o=t.label,a=this.correlation?.edgeLabels.get(e)??this.correlation?.edges.get(e)??null,s=t=>this.editor.dispatch({type:`er.setRelationLabel`,relId:e,label:t},`canvas`)}else if(this.editor.result.pie&&e.startsWith(`slice:`)){let t=this.editor.result.pie.slices.find(t=>t.entityId===e);if(!t)return;o=String(t.value),a=i??this.entityElement(e),s=t=>{let n=Number(t);Number.isFinite(n)&&this.editor.dispatch({type:`pie.setValue`,sliceId:e,value:n},`canvas`)}}else if(this.editor.result.gantt&&e.startsWith(`task:`)){let t=this.editor.result.gantt.tasks.find(t=>t.entityId===e);if(!t)return;o=t.name,a=i??this.entityElement(e),s=t=>this.editor.dispatch({type:`gantt.setTaskName`,taskId:e,name:t},`canvas`)}else if(this.editor.result.lineItems&&e.startsWith(`item:`)){let t=this.editor.result.lineItems.items.find(t=>t.entityId===e);if(!t)return;o=t.text,a=i??this.entityElement(e),s=t=>this.editor.dispatch({type:`li.setLine`,itemId:e,text:t},`canvas`)}else if(r&&e.startsWith(`participant:`)){let t=r.participantById.get(e.slice(12));if(!t)return;o=t.label,a=i??this.topmostEntityElement(e),s=e=>this.editor.dispatch({type:`seq.renameParticipant`,id:t.id,name:e},`canvas`)}else if(r&&e.startsWith(`event:`)){let t=r.events.find(t=>t.entityId===e);if(!t)return;o=t.stmt.text,a=this.seqCorrelation?.eventTexts.get(e)??i??this.entityElement(e),s=t=>this.editor.dispatch({type:`seq.setEventText`,eventId:e,text:t},`canvas`)}a&&this.openOverlayEditor(a,o,s)}editInPlace(e,t,n,r,i,a={}){let o=t.matches?.(n)?t.querySelector(`p`)??t:t.querySelector(`${n} p`)??t.querySelector(n);if(!o||!(o instanceof HTMLElement))return!1;let s=this.inPlaceSession?.entityId===e;s||(this.inPlaceSession={entityId:e,labelSelector:n,original:r,lastCommitted:r,caretOffset:-1,commitValue:i,liveTimer:null});let c=this.inPlaceSession;o.setAttribute(`contenteditable`,`true`),o.focus();let l=window.getSelection(),u=document.createRange();if(s&&c.caretOffset>=0&&o.firstChild){let e=o.firstChild,t=e.textContent?.length??0;u.setStart(e,Math.min(c.caretOffset,t)),u.collapse(!0)}else u.selectNodeContents(o);l?.removeAllRanges(),l?.addRange(u);let d=()=>{let e=window.getSelection();e&&e.anchorNode&&o.contains(e.anchorNode)&&(c.caretOffset=e.anchorOffset)},f=()=>{if(this.inPlaceSession!==c)return;let e=(o.textContent??``).trim();!e||e===c.lastCommitted||(d(),c.lastCommitted=e,c.commitValue(e))},p=e=>{if(this.inPlaceSession!==c)return;this.inPlaceSession=null,c.liveTimer&&clearTimeout(c.liveTimer),o.removeAttribute(`contenteditable`),o.removeEventListener(`keydown`,h),o.removeEventListener(`blur`,g),o.removeEventListener(`input`,m);let t=(o.textContent??``).trim();e?t&&t!==c.lastCommitted?c.commitValue(t):t||(o.textContent=c.lastCommitted):c.lastCommitted===c.original?o.textContent=c.original:c.commitValue(c.original),this.updatePopover()},m=()=>{a.live!==!1&&(c.liveTimer&&clearTimeout(c.liveTimer),c.liveTimer=setTimeout(f,450))},h=e=>{e.stopPropagation(),e.key===`Enter`?(e.preventDefault(),p(!0)):e.key===`Escape`&&p(!1)},g=()=>{setTimeout(()=>{this.inPlaceSession===c&&o.isConnected&&document.activeElement!==o&&p(!0)},60)};return o.addEventListener(`keydown`,h),o.addEventListener(`blur`,g),o.addEventListener(`input`,m),!0}resumeInPlaceSession(){let e=this.inPlaceSession;if(!e)return;if(!this.editor.entityExists(e.entityId)){this.inPlaceSession=null;return}let t=(e.entityId.startsWith(`edge:`)?this.correlation?.edgeLabels.get(e.entityId):null)??this.entityElement(e.entityId);if(!t){this.inPlaceSession=null;return}this.editInPlace(e.entityId,t,e.labelSelector,e.lastCommitted,e.commitValue)}findTextTarget(e,t){let n=e=>(e.tagName===`text`||e.tagName===`SPAN`||e.tagName===`P`||e.tagName===`DIV`||e.tagName===`tspan`)&&(e.children.length===0||e.tagName===`text`)&&(e.textContent?.trim().length??0)>0;if(n(e))return e;let r=[...e.querySelectorAll(`text, tspan, span, p, div`)].filter(n);return!r.length&&e.parentElement&&(r=[...e.parentElement.querySelectorAll(`text, tspan, span, p, div`)].filter(n)),r.find(e=>e.textContent?.trim()===t.trim())??r.find(e=>t.trim().startsWith(e.textContent?.trim()??`\0`))??r[0]??e}openOverlayEditor(e,t,n){e=this.findTextTarget(e,t);let r=this.hostRect(e),i=e.querySelector(`tspan`)??e,a=window.getComputedStyle(i),o=document.createElement(`div`);o.className=`mw-inplace-editor`,o.contentEditable=`true`,o.spellcheck=!1,o.textContent=t,o.style.left=`${r.left+r.width/2}px`,o.style.top=`${r.top}px`,o.style.transform=`translateX(-50%)`,o.style.textAlign=`center`,o.style.minWidth=`${Math.max(24,r.width)}px`,o.style.lineHeight=`${Math.max(r.height,12)}px`,o.style.fontStyle=a.fontStyle,o.style.fontWeight=a.fontWeight,o.style.fontSize=a.fontSize,o.style.fontFamily=a.fontFamily;let s=a.fill&&a.fill!==`none`&&i instanceof SVGElement?a.fill:a.color;o.style.color=s||`inherit`,this.overlayHost.appendChild(o),this.inlineInput=o;let c=e,l=c.style?.visibility??``;c.style&&(c.style.visibility=`hidden`),this.inlineHidden={el:c,prevVisibility:l},o.focus();let u=document.createRange();u.selectNodeContents(o);let d=window.getSelection();d?.removeAllRanges(),d?.addRange(u);let f=()=>{let e=(o.textContent??``).trim();this.closeInlineEditor(!1),e!==t&&n(e)};o.addEventListener(`keydown`,e=>{e.stopPropagation(),e.key===`Enter`&&(e.preventDefault(),f()),e.key===`Escape`&&this.closeInlineEditor(!1)}),o.addEventListener(`blur`,f)}closeInlineEditor(e){if(this.inlineHidden&&=(this.inlineHidden.el.style&&(this.inlineHidden.el.style.visibility=this.inlineHidden.prevVisibility),null),this.inlineInput){let t=this.inlineInput;this.inlineInput=null,t.remove(),e&&this.container.focus({preventScroll:!0})}}onKeyDown(e){if(!this.inlineInput){if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`z`){e.preventDefault(),e.shiftKey?this.editor.redo():this.editor.undo();return}if(!this.readOnly){if((e.key===`Delete`||e.key===`Backspace`)&&this.editor.selection.length){e.preventDefault(),this.editor.deleteEntities(this.editor.selection,`canvas`);return}if(e.key===`Escape`){this.cancelConnect(),this.editor.clearSelection(`canvas`);return}e.key===`Enter`&&this.editor.selection.length===1&&(e.preventDefault(),this.editEntityLabel(this.editor.selection[0]))}}}applySelectionStyles(){if(this.svg){this.svg.querySelectorAll(`.mw-selected`).forEach(e=>e.classList.remove(`mw-selected`));for(let e of this.editor.selection)this.svg.querySelectorAll(`[data-mw-entity="${CSS.escape(e)}"]`).forEach(e=>{e.classList.add(`mw-selected`)});this.updatePopover()}}hostRect(e){let t=e.getBoundingClientRect(),n=this.container.getBoundingClientRect();return{left:t.left-n.left+this.container.scrollLeft,top:t.top-n.top+this.container.scrollTop,width:t.width,height:t.height}}updatePopover(){if(this.popover.hide(),this.readOnly||this.inlineInput||this.inPlaceSession)return;let e=this.editor.selection;if(e.length!==1||!this.svg)return;let t=e[0],n=null,r=1/0;if(this.svg.querySelectorAll(`[data-mw-entity="${CSS.escape(t)}"]`).forEach(e=>{let t=e.getBoundingClientRect().top;t<r&&(r=t,n=e)}),!n)return;let i=this.actionsFor(t);i.length&&this.popover.show(this.hostRect(n),i)}colorSection(e,t){return{title:e,columns:5,items:[...h.map(n=>({swatch:n,title:`${e}: ${n}`,onClick:()=>t(n)})),{swatch:`none`,title:`${e}: default`,onClick:()=>t(null)}]}}actionsFor(n){let{flowchart:r,sequence:i}=this.editor.result,a={icon:f.trash,title:`Delete`,danger:!0,onClick:()=>this.editor.deleteEntities([n])},o={icon:f.pencil,title:`Edit text`,onClick:()=>this.editEntityLabel(n)};if(r&&n.startsWith(`node:`)){let e=r.nodeById.get(n.slice(5));return e?[{icon:f.shapes,title:`Node shape`,panel:{title:`Node shape`,items:[{s:`rect`,g:`▭`,t:`Rectangle`},{s:`round`,g:`▢`,t:`Rounded`},{s:`stadium`,g:`⬭`,t:`Stadium`},{s:`diamond`,g:`◇`,t:`Diamond`},{s:`hexagon`,g:`⬡`,t:`Hexagon`},{s:`circle`,g:`◯`,t:`Circle`},{s:`cylinder`,g:`⛁`,t:`Cylinder`},{s:`subroutine`,g:`⧉`,t:`Subroutine`}].map(t=>({glyph:t.g,title:t.t,selected:e.shape===t.s,onClick:()=>this.editor.dispatch({type:`setNodeShape`,id:e.id,shape:t.s})}))}},{icon:f.palette,title:`Colors`,panel:{title:`Colors`,sections:[`fill`,`stroke`,`color`].map(t=>this.colorSection(t===`fill`?`Fill`:t===`stroke`?`Border`:`Text`,n=>this.editor.dispatch({type:`setNodeColor`,id:e.id,prop:t,value:n})))}},{icon:f.copy,title:`Duplicate`,onClick:()=>this.editor.dispatch({type:`duplicateNode`,id:e.id})},o,a]:[]}if(r&&n.startsWith(`subgraph:`))return[{icon:f.pencil,title:`Rename subgraph`,onClick:()=>this.editEntityLabel(n)}];if(r&&n.startsWith(`edge:`)){let e=r.edges.find(e=>e.entityId===n);return e?[{icon:f.arrowRight,title:`Edge type`,panel:{title:`Edge type`,items:[{line:`solid`,arrowEnd:`arrow`,g:`—▶`,t:`solid arrow`},{line:`dotted`,arrowEnd:`arrow`,g:`⋯▶`,t:`dotted arrow`},{line:`thick`,arrowEnd:`arrow`,g:`═▶`,t:`thick arrow`},{line:`solid`,arrowEnd:`open`,g:`——`,t:`solid open`},{line:`dotted`,arrowEnd:`open`,g:`⋯⋯`,t:`dotted open`},{line:`thick`,arrowEnd:`open`,g:`══`,t:`thick open`},{line:`solid`,arrowEnd:`cross`,g:`—✕`,t:`solid cross`},{line:`solid`,arrowEnd:`circle`,g:`—●`,t:`solid circle`}].map(t=>({glyph:t.g,title:t.t,selected:e.seg.line===t.line&&e.seg.arrowEnd===t.arrowEnd,onClick:()=>this.editor.dispatch({type:`setEdgeStyle`,edgeId:n,line:t.line,arrowEnd:t.arrowEnd})}))}},{icon:f.palette,title:`Edge color`,panel:{title:`Edge color`,sections:[this.colorSection(`Stroke`,e=>this.editor.dispatch({type:`setEdgeColor`,edgeId:n,value:e}))]}},{icon:f.arrowLeftRight,title:`Reverse direction`,onClick:()=>this.editor.dispatch({type:`reverseEdge`,edgeId:n})},o,a]:[]}if(this.editor.result.state&&n.startsWith(`state:`)){let e=this.editor.result.state.stateById.get(n.slice(6));return e?e.isComposite?[o]:[{icon:f.square,title:`State type`,panel:{title:`State type`,items:[{t:`state`,g:`▢`},{t:`choice`,g:`◇`},{t:`fork`,g:`⑃`},{t:`join`,g:`⑂`}].map(t=>({glyph:t.g,title:t.t,selected:(e.stereotype??`state`)===t.t,onClick:()=>this.editor.dispatch({type:`st.setStateType`,id:e.id,stype:t.t})}))}},{icon:f.stickyNote,title:`Add note`,panel:{title:`Note`,items:[`left`,`right`].map(t=>({glyph:t===`left`?`◧`:`◨`,title:`Note ${t}`,onClick:()=>this.editor.dispatch({type:`st.addStateNote`,id:e.id,side:t})}))}},{icon:f.frame,title:`Move to composite`,onClick:()=>this.editor.dispatch({type:`st.moveToComposite`,id:e.id})},o,a]:[]}if(this.editor.result.state&&n.startsWith(`trans:`))return[{icon:f.arrowLeftRight,title:`Reverse direction`,onClick:()=>this.editor.dispatch({type:`st.reverseTransition`,transId:n})},o,a];if(this.editor.result.classGraph&&n.startsWith(`class:`)){let e=this.editor.result.classGraph.classById.get(n.slice(6));return e?[{icon:f.listPlus,title:`Add member`,onClick:()=>{this.editor.dispatch({type:`cl.addMember`,id:e.id,text:`+attribute`})}},{icon:f.braces,title:`Annotation`,panel:{title:`Annotation`,items:[...[`interface`,`abstract`,`service`,`enumeration`].map(t=>({glyph:t,title:`<<${t}>>`,onClick:()=>this.editor.dispatch({type:`cl.setAnnotation`,id:e.id,annotation:t})})),{glyph:`none`,title:`Remove annotation`,onClick:()=>this.editor.dispatch({type:`cl.setAnnotation`,id:e.id,annotation:null})}]}},{icon:f.stickyNote,title:`Add note`,onClick:()=>this.editor.dispatch({type:`cl.addNoteFor`,id:e.id})},{icon:f.pencil,title:`Rename class`,onClick:()=>this.editEntityLabel(n)},a]:[]}if(this.editor.result.classGraph&&n.startsWith(`rel:`)){let e=this.editor.result.classGraph.relations.find(e=>e.entityId===n);return e?[{icon:f.arrowRight,title:`Relation type`,panel:{title:`Relation type`,items:[{op:`<|--`,g:`◁—`,t:`inheritance`},{op:`*--`,g:`◆—`,t:`composition`},{op:`o--`,g:`◇—`,t:`aggregation`},{op:`-->`,g:`—▶`,t:`association`},{op:`--`,g:`——`,t:`link (solid)`},{op:`..>`,g:`⋯▶`,t:`dependency`},{op:`..|>`,g:`⋯▷`,t:`realization`},{op:`..`,g:`⋯⋯`,t:`link (dashed)`}].map(t=>({glyph:t.g,title:t.t,selected:e.stmt.op===t.op,onClick:()=>this.editor.dispatch({type:`cl.setRelationType`,relId:n,op:t.op})}))}},{icon:f.arrowLeftRight,title:`Reverse direction`,onClick:()=>this.editor.dispatch({type:`cl.reverseRelation`,relId:n})},{glyph:`1:1`,title:`Cardinality (e.g. 1, 0..1, 1..*, *)`,onClick:()=>{let t=this.entityElement(n);if(!t)return;this.popover.hide();let r=`${e.stmt.sourceCard??``}:${e.stmt.targetCard??``}`;this.openOverlayEditor(t,r,t=>{let[r=``,i=``]=t.split(`:`);this.editor.dispatch({type:`cl.setCardinality`,relId:n,side:`source`,value:r.trim()||null},`canvas`);let a=this.editor.result.classGraph?.relations.find(t=>t.lineIndex===e.lineIndex&&t.source===e.source&&t.target===e.target);a&&this.editor.dispatch({type:`cl.setCardinality`,relId:a.entityId,side:`target`,value:i.trim()||null},`canvas`)})}},o,a]:[]}if(this.editor.result.er&&n.startsWith(`entity:`)){let e=this.editor.result.er.entityById.get(n.slice(7));return e?[{icon:f.listPlus,title:`Add attribute`,onClick:()=>this.editor.dispatch({type:`er.addAttribute`,id:e.id})},{icon:f.pencil,title:`Rename entity`,onClick:()=>this.editEntityLabel(n)},a]:[]}if(this.editor.result.er&&n.startsWith(`erel:`)){let e=this.editor.result.er.relations.find(e=>e.entityId===n);if(!e)return[];let t=[{c:`zero-or-one`,g:`0..1`},{c:`exactly-one`,g:`1`},{c:`zero-or-more`,g:`0..*`},{c:`one-or-more`,g:`1..*`}],r=r=>({icon:r===`left`?f.arrowLeftToLine:f.arrowRightToLine,title:`${r===`left`?`Source`:`Target`} cardinality`,panel:{title:`${r===`left`?e.source:e.target} cardinality`,items:t.map(e=>({glyph:e.g,title:e.c,onClick:()=>this.editor.dispatch({type:`er.setCardinality`,relId:n,side:r,card:e.c})}))}});return[r(`left`),r(`right`),{icon:e.stmt.line===`--`?f.minus:f.ellipsis,title:e.stmt.line===`--`?`Make non-identifying (dashed)`:`Make identifying (solid)`,onClick:()=>this.editor.dispatch({type:`er.setIdentifying`,relId:n,identifying:e.stmt.line!==`--`})},o,a]}if(this.editor.result.pie&&n.startsWith(`slice:`)){let e=this.editor.result.pie.slices.find(e=>e.entityId===n);return e?[{icon:f.hash,title:`Edit value`,onClick:()=>this.editEntityLabel(n)},{icon:f.pencil,title:`Edit label`,onClick:()=>{let t=this.entityElement(n);t&&(this.popover.hide(),this.openOverlayEditor(t,e.label,e=>this.editor.dispatch({type:`pie.setLabel`,sliceId:n,label:e},`canvas`)))}},a]:[]}if(this.editor.result.gantt&&n.startsWith(`task:`)){let e=this.editor.result.gantt.tasks.find(e=>e.entityId===n);return e?[{icon:f.pencil,title:`Rename task`,onClick:()=>this.editEntityLabel(n)},{icon:f.calendar,title:`Edit schedule (id, start, duration)`,onClick:()=>{let t=this.entityElement(n);t&&(this.popover.hide(),this.openOverlayEditor(t,e.meta,e=>this.editor.dispatch({type:`gantt.setTaskMeta`,taskId:n,meta:e},`canvas`)))}},a]:[]}if(this.editor.result.lineItems&&n.startsWith(`item:`))return[{icon:f.pencil,title:`Edit line`,onClick:()=>this.editEntityLabel(n)},a];if(i&&n.startsWith(`participant:`)){let e=i.participantById.get(n.slice(12));if(!e)return[];let r={participant:`▭`,actor:`웃`,boundary:`⊢○`,control:`◉`,entity:`◯`,database:`⛁`,collections:`⧉`,queue:`▤`};return[{icon:f.user,title:`Participant type`,panel:{title:`Participant type`,items:t.map(t=>({glyph:r[t],title:t,selected:e.ptype===t,onClick:()=>this.editor.dispatch({type:`seq.setParticipantType`,id:e.id,ptype:t})}))}},{icon:f.pencil,title:`Rename`,onClick:()=>this.editEntityLabel(n)},a]}if(i&&n.startsWith(`event:`)){let t=i.events.find(e=>e.entityId===n);if(!t)return[];if(t.kind===`message`){let r={"->":`——`,"->>":`—▶`,"-->":`⋯⋯`,"-->>":`⋯▶`,"-x":`—✕`,"--x":`⋯✕`,"-)":`—⟩`,"--)":`⋯⟩`};return[{icon:f.arrowRight,title:`Message type`,panel:{title:`Message type`,items:e.map(e=>({glyph:r[e.op],title:e.label,selected:t.stmt.op===e.op,onClick:()=>this.editor.dispatch({type:`seq.setMessageOp`,eventId:n,op:e.op})}))}},{icon:f.arrowLeftRight,title:`Reverse direction`,onClick:()=>this.editor.dispatch({type:`seq.reverseMessage`,eventId:n})},{icon:f.group,title:`Wrap in fragment`,panel:{title:`Fragment`,items:[`loop`,`alt`,`opt`,`par`,`critical`,`break`,`rect`].map(e=>({glyph:e,title:`Wrap in ${e}`,onClick:()=>this.editor.dispatch({type:`seq.wrapInFragment`,eventId:n,kind:e})}))}},o,a]}return[o,a]}return[]}computeDropSlots(){let e=this.editor.result.sequence;if(this.dropSlots=[],!e||!this.seqCorrelation)return;let t=e.events.map(e=>{let t=this.seqCorrelation.events.get(e.entityId);if(!t)return null;let n=this.hostRect(t);return{ev:e,y:n.top+n.height/2}}).filter(e=>e!==null);if(t.length){this.dropSlots.push({y:t[0].y-24,afterEvent:null});for(let e=1;e<t.length;e++)this.dropSlots.push({y:(t[e-1].y+t[e].y)/2,afterEvent:t[e-1].ev.entityId});this.dropSlots.push({y:t[t.length-1].y+24,afterEvent:t[t.length-1].ev.entityId})}}nearestSlot(e){let t=null,n=1/0;for(let r of this.dropSlots){let i=Math.abs(r.y-e);i<n&&(n=i,t=r)}return t}showDropIndicator(e){this.dropIndicator||(this.dropIndicator=document.createElement(`div`),this.dropIndicator.className=`mw-drop-indicator`,this.overlayHost.appendChild(this.dropIndicator)),this.dropIndicator.style.top=`${e}px`}plusHovered=!1;lifelineClearTimer=null;onLifelineHover(e){if(this.readOnly||!this.seqCorrelation||this.connectSource||!this.editor.result.sequence)return;let t=null;for(let[n,r]of this.seqCorrelation.lifelines){let i=r.getBoundingClientRect(),a=i.left+i.width/2;if(Math.abs(e.clientX-a)<=16&&e.clientY>=i.top-8&&e.clientY<=i.bottom+8){t=n;break}}t!==this.hoveredLifeline&&(t?this.showLifelinePlus(t):this.scheduleLifelineClear())}showLifelinePlus(e){this.clearLifelineUi();let t=this.editor.result.sequence,n=this.seqCorrelation?.lifelines.get(e);if(!t||!n)return;this.hoveredLifeline=e;let r=e.slice(12),i=this.hostRect(n),a=i.left+i.width/2,o=[],s=t.events.map(e=>{let t=this.seqCorrelation?.events.get(e.entityId);if(!t)return null;let n=this.hostRect(t);return{ev:e,y:n.top+n.height/2}}).filter(e=>e!==null);if(s.length===0)o.push({y:i.top+i.height/2,afterEvent:null});else{o.push({y:(i.top+s[0].y)/2,afterEvent:null});for(let e=1;e<s.length;e++)o.push({y:(s[e-1].y+s[e].y)/2,afterEvent:s[e-1].ev.entityId});o.push({y:(s[s.length-1].y+i.top+i.height)/2,afterEvent:s[s.length-1].ev.entityId})}for(let e of o){let t=document.createElement(`button`);t.type=`button`,t.className=`mw-lifeline-plus`,t.textContent=`+`,t.title=`Insert here (self message / note)`,t.style.left=`${a}px`,t.style.top=`${e.y}px`,t.addEventListener(`pointerenter`,()=>{this.plusHovered=!0}),t.addEventListener(`pointerleave`,()=>{this.plusHovered=!1,this.scheduleLifelineClear()}),t.addEventListener(`click`,n=>{n.stopPropagation(),this.openPlusMenu(t,r,e.afterEvent)}),this.overlayHost.appendChild(t),this.plusButtons.push(t)}}openPlusMenu(e,t,n){this.plusMenu?.remove();let r=document.createElement(`div`);r.className=`mw-plus-menu`,r.style.left=e.style.left,r.style.top=`${parseFloat(e.style.top)+12}px`,r.addEventListener(`pointerdown`,e=>e.stopPropagation());let i=(e,t)=>{let n=document.createElement(`button`);n.type=`button`,n.textContent=e,n.addEventListener(`click`,e=>{e.stopPropagation(),this.clearLifelineUi(),t()}),r.appendChild(n)};i(`↩ Self message`,()=>{let e=this.editor.dispatch({type:`seq.addMessage`,source:t,target:t,text:`message`,afterEvent:n},`canvas`);e?.created?.[0]&&(this.pendingEditEntity=e.created[0])});let a=(e,r)=>i(e,()=>{let e=this.editor.dispatch({type:`seq.addNote`,participant:t,placement:r,text:`note`,afterEvent:n},`canvas`);e?.created?.[0]&&(this.pendingEditEntity=e.created[0])});a(`▭ Note over`,`over`),a(`▭ Note left`,`left of`),a(`▭ Note right`,`right of`),this.overlayHost.appendChild(r),this.plusMenu=r}scheduleLifelineClear(){this.lifelineClearTimer&&clearTimeout(this.lifelineClearTimer),this.lifelineClearTimer=setTimeout(()=>{!this.plusHovered&&!this.plusMenu&&this.clearLifelineUi()},400)}clearLifelineUi(){this.plusButtons.forEach(e=>e.remove()),this.plusButtons=[],this.plusMenu?.remove(),this.plusMenu=null,this.hoveredLifeline=null,this.plusHovered=!1}clientToSvg(e,t){if(!this.svg)return null;let n=this.svg.getScreenCTM();if(!n)return null;let r=new DOMPoint(e,t).matrixTransform(n.inverse());return{x:r.x,y:r.y}}entityCenter(e){let t=this.entityElement(e);if(!t)return null;let n=t.getBoundingClientRect();return this.clientToSvg(n.left+n.width/2,n.top+n.height/2)}async validate(){try{return await this.mermaid.parse(this.editor.code),!0}catch(e){let t=e instanceof Error?e.message.split(`
113
+ `)[0]:String(e);return this.editor.setDiagnostics([{message:t,span:null,severity:`error`,source:`mermaid`}]),!1}}destroy(){this.renderTimer&&clearTimeout(this.renderTimer),this.lifelineClearTimer&&clearTimeout(this.lifelineClearTimer),this.disposers.forEach(e=>e()),this.closeInlineEditor(!1),this.cancelConnect(),this.clearLifelineUi(),this.popover.hide(),this.container.classList.remove(`mw-canvas`,`mw-tool-connect`,`mw-readonly`),this.svgHost.remove(),this.overlayHost.remove(),this.errorBadge.remove()}};export{y as MermaidCanvasView,p as Popover,r as correlateFlowchart,u as correlateSequence};
@@ -1,2 +1,2 @@
1
- import{M as e,N as t,j as n}from"./CodeMirrorPropInput-cmSiPzan.js";import{$ as r,At as i,Bt as a,Dt as o,E as s,Et as c,Ft as l,Ht as u,J as d,Mt as f,N as p,Ot as m,Pt as h,Q as ee,Rt as te,Ut as ne,X as g,_ as re,_t as _,ct as ie,dt as ae,et as oe,f as se,gt as ce,ht as le,l as ue,lt as de,mt as fe,nt as pe,ot as me,rt as v,st as he,tt as ge,ut as _e,wt as y,y as ve,yt as b,zt as ye}from"./dist-CdtMC9tO.js";import{i as be,n as xe,o as Se,r as Ce}from"./dist-zn0VptDw.js";var we=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,x=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(we(e)):we,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return te(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=ne(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=ye(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n;;e++){let a=r.charCodeAt(e),o=this.match(a,i,this.bufferPos+this.bufferStart);if(e==r.length-1){if(o)return this.value=o,this;break}i==n&&e<t.length&&t.charCodeAt(e)==a&&i++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let i=this.matches[t],a=!1;this.query.charCodeAt(i)==e&&(i==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,a=!0)),a||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}};typeof Symbol<`u`&&(x.prototype[Symbol.iterator]=function(){return this});var Te={from:-1,to:-1,match:/.*/.exec(``)},S=`gm`+(/x/.unicode==null?``:`u`),Ee=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=Te,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new De(e,t,n,r,i);this.re=new RegExp(t,S+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter(),this.curLineStart=e.lineAt(r).from,this.matchPos=T(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=T(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},C=new WeakMap,w=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=C.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return C.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),C.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},De=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=Te,this.matchPos=T(e,r),this.re=new RegExp(t,S+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=w.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=T(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=w.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(Ee.prototype[Symbol.iterator]=De.prototype[Symbol.iterator]=function(){return this});function Oe(e){try{return new RegExp(e,S),!0}catch{return!1}}function T(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var ke=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=ce(e,{label:t.phrase(`Go to line`),input:{type:`text`,name:`line`,value:n},focus:!0,submitLabel:t.phrase(`go`)});return i.then(n=>{let i=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!i){e.dispatch({effects:r});return}let a=t.doc.lineAt(t.selection.main.head),[,o,s,l,u]=i,d=l?+l.slice(1):0,f=s?+s:a.number;if(s&&u){let e=f/100;o&&(e=e*(o==`-`?-1:1)+a.number/t.doc.lines),f=Math.round(t.doc.lines*e)}else s&&o&&(f=f*(o==`-`?-1:1)+a.number);let p=t.doc.line(Math.max(1,Math.min(t.doc.lines,f))),m=c.cursor(p.from+Math.max(0,Math.min(d,p.length)));e.dispatch({effects:[r,g.scrollIntoView(m.from,{y:`center`})],selection:m})}),!0},Ae={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},E=m.define({combine(e){return a(e,Ae,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function je(e){let t=[Le,Ie];return e&&t.push(E.of(e)),t}var Me=d.mark({class:`cm-selectionMatch`}),Ne=d.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function Pe(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=y.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=y.Word)}function Fe(e,t,n,r){return e(t.sliceDoc(n,n+1))==y.Word&&e(t.sliceDoc(r-1,r))==y.Word}var Ie=ee.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(E),{state:n}=e,r=n.selection;if(r.ranges.length>1)return d.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return d.none;let e=n.wordAt(i.head);if(!e)return d.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return d.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(Pe(o,n,i.from,i.to)&&Fe(o,n,i.from,i.to)))return d.none}else if(a=n.sliceDoc(i.from,i.to),!a)return d.none}let s=[];for(let r of e.visibleRanges){let e=new x(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||Pe(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(Ne.range(r,a)):(r>=i.to||a<=i.from)&&s.push(Me.range(r,a)),s.length>t.maxMatches))return d.none}}return d.set(s)}},{decorations:e=>e.decorations}),Le=g.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),Re=({state:e,dispatch:t})=>{let{selection:n}=e,r=c.create(n.ranges.map(t=>e.wordAt(t.head)||c.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function ze(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new x(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new x(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var Be=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return Re({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=ze(e,r);return i?(t(e.update({selection:e.selection.addRange(c.range(i.from,i.to),!1),effects:g.scrollIntoView(i.to)})),!0):!1},D=m.define({combine(e){return a(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new ct(e),scrollToMatch:e=>g.scrollIntoView(e)})}});function Ve(e){return e?[D.of(e),G]:G}var He=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||Oe(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
1
+ import{M as e,N as t,j as n}from"./CodeMirrorPropInput-UpR7oTg9.js";import{$ as r,At as i,Bt as a,Dt as o,E as s,Et as c,Ft as l,Ht as u,J as d,Mt as f,N as p,Ot as m,Pt as h,Q as ee,Rt as te,Ut as ne,X as g,_ as re,_t as _,ct as ie,dt as ae,et as oe,f as se,gt as ce,ht as le,l as ue,lt as de,mt as fe,nt as pe,ot as me,rt as v,st as he,tt as ge,ut as _e,wt as y,y as ve,yt as b,zt as ye}from"./dist-CdtMC9tO.js";import{i as be,n as xe,o as Se,r as Ce}from"./dist-zn0VptDw.js";var we=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,x=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(we(e)):we,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return te(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=ne(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=ye(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n;;e++){let a=r.charCodeAt(e),o=this.match(a,i,this.bufferPos+this.bufferStart);if(e==r.length-1){if(o)return this.value=o,this;break}i==n&&e<t.length&&t.charCodeAt(e)==a&&i++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let i=this.matches[t],a=!1;this.query.charCodeAt(i)==e&&(i==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,a=!0)),a||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}};typeof Symbol<`u`&&(x.prototype[Symbol.iterator]=function(){return this});var Te={from:-1,to:-1,match:/.*/.exec(``)},S=`gm`+(/x/.unicode==null?``:`u`),Ee=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=Te,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new De(e,t,n,r,i);this.re=new RegExp(t,S+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter(),this.curLineStart=e.lineAt(r).from,this.matchPos=T(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=T(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},C=new WeakMap,w=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=C.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return C.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),C.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},De=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=Te,this.matchPos=T(e,r),this.re=new RegExp(t,S+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=w.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=T(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=w.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(Ee.prototype[Symbol.iterator]=De.prototype[Symbol.iterator]=function(){return this});function Oe(e){try{return new RegExp(e,S),!0}catch{return!1}}function T(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var ke=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=ce(e,{label:t.phrase(`Go to line`),input:{type:`text`,name:`line`,value:n},focus:!0,submitLabel:t.phrase(`go`)});return i.then(n=>{let i=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!i){e.dispatch({effects:r});return}let a=t.doc.lineAt(t.selection.main.head),[,o,s,l,u]=i,d=l?+l.slice(1):0,f=s?+s:a.number;if(s&&u){let e=f/100;o&&(e=e*(o==`-`?-1:1)+a.number/t.doc.lines),f=Math.round(t.doc.lines*e)}else s&&o&&(f=f*(o==`-`?-1:1)+a.number);let p=t.doc.line(Math.max(1,Math.min(t.doc.lines,f))),m=c.cursor(p.from+Math.max(0,Math.min(d,p.length)));e.dispatch({effects:[r,g.scrollIntoView(m.from,{y:`center`})],selection:m})}),!0},Ae={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},E=m.define({combine(e){return a(e,Ae,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function je(e){let t=[Le,Ie];return e&&t.push(E.of(e)),t}var Me=d.mark({class:`cm-selectionMatch`}),Ne=d.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function Pe(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=y.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=y.Word)}function Fe(e,t,n,r){return e(t.sliceDoc(n,n+1))==y.Word&&e(t.sliceDoc(r-1,r))==y.Word}var Ie=ee.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(E),{state:n}=e,r=n.selection;if(r.ranges.length>1)return d.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return d.none;let e=n.wordAt(i.head);if(!e)return d.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return d.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(Pe(o,n,i.from,i.to)&&Fe(o,n,i.from,i.to)))return d.none}else if(a=n.sliceDoc(i.from,i.to),!a)return d.none}let s=[];for(let r of e.visibleRanges){let e=new x(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||Pe(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(Ne.range(r,a)):(r>=i.to||a<=i.from)&&s.push(Me.range(r,a)),s.length>t.maxMatches))return d.none}}return d.set(s)}},{decorations:e=>e.decorations}),Le=g.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),Re=({state:e,dispatch:t})=>{let{selection:n}=e,r=c.create(n.ranges.map(t=>e.wordAt(t.head)||c.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function ze(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new x(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new x(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var Be=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return Re({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=ze(e,r);return i?(t(e.update({selection:e.selection.addRange(c.range(i.from,i.to),!1),effects:g.scrollIntoView(i.to)})),!0):!1},D=m.define({combine(e){return a(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new ct(e),scrollToMatch:e=>g.scrollIntoView(e)})}});function Ve(e){return e?[D.of(e),G]:G}var He=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||Oe(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
2
2
  `:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Ye(this):new Ke(this)}getCursor(e,t=0,n){let r=e.doc?e:o.create({doc:e});return n??=r.doc.length,this.regexp?k(this,r,t,n):O(this,r,t,n)}},Ue=class{constructor(e){this.spec=e}};function We(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function O(e,t,n,r){let i;return e.wholeWord&&(i=Ge(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=We(e.test,t,i)),new x(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function Ge(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(A(i,n-a))!=y.Word||t(j(i,n-a))!=y.Word)&&(t(j(i,r-a))!=y.Word||t(A(i,r-a))!=y.Word))}var Ke=class extends Ue{constructor(e){super(e)}nextMatch(e,t,n){let r=O(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=O(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=O(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=O(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=O(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function qe(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function k(e,t,n,r){let i;return e.wholeWord&&(i=Je(t.charCategorizer(t.selection.main.head))),e.test&&(i=qe(e.test,t,i)),new Ee(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function A(e,t){return e.slice(u(e,t,!1),t)}function j(e,t){return e.slice(t,u(e,t))}function Je(e){return(t,n,r)=>!r[0].length||(e(A(r.input,r.index))!=y.Word||e(j(r.input,r.index))!=y.Word)&&(e(j(r.input,r.index+r[0].length))!=y.Word||e(A(r.input,r.index+r[0].length))!=y.Word)}var Ye=class extends Ue{nextMatch(e,t,n){let r=k(this.spec,e,n,e.doc.length).next();return r.done&&(r=k(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=k(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=k(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=k(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},M=h.define(),N=h.define(),P=l.define({create(e){return new F(B(e).create(),null)},update(e,t){for(let n of t.effects)n.is(M)?e=new F(n.value.create(),e.panel):n.is(N)&&(e=new F(e.query,n.value?z:null));return e},provide:e=>_.from(e,e=>e.panel)}),F=class{constructor(e,t){this.query=e,this.panel=t}},Xe=d.mark({class:`cm-searchMatch`}),Ze=d.mark({class:`cm-searchMatch cm-searchMatch-selected`}),Qe=ee.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(P))}update(e){let t=e.state.field(P);(t!=e.startState.field(P)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return d.none;let{view:n}=this,r=new f;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?Ze:Xe)})}return r.finish()}},{decorations:e=>e.decorations});function I(e){return t=>{let n=t.state.field(P,!1);return n&&n.query.spec.valid?e(t,n):at(t)}}var L=I((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=c.single(r.from,r.to),a=e.state.facet(D);return e.dispatch({selection:i,effects:[W(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),it(e),!0}),R=I((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=c.single(i.from,i.to),o=e.state.facet(D);return e.dispatch({selection:a,effects:[W(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),it(e),!0}),$e=I((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:c.create(n.map(e=>c.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),et=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new x(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(c.range(t.value.from,t.value.to))}return t(e.update({selection:c.create(a,o),userEvent:`select.search.matches`})),!0},tt=I((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],l,u,d=[];o.from==r&&o.to==i&&(u=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:u}),o=t.nextMatch(n,o.from,o.to),d.push(g.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`)));let f=e.state.changes(s);return o&&(l=c.single(o.from,o.to).map(f),d.push(W(e,o)),d.push(n.facet(D).scrollToMatch(l.main,e))),e.dispatch({changes:f,selection:l,effects:d,userEvent:`input.replace`}),!0}),nt=I((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}});if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:g.announce.of(r),userEvent:`input.replace.all`}),!0});function z(e){return e.state.facet(D).createPanel(e)}function B(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(D);return new He({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function rt(e){let t=v(e,z);return t&&t.dom.querySelector(`[main-field]`)}function it(e){let t=rt(e);t&&t==e.root.activeElement&&t.select()}var at=e=>{let t=e.state.field(P,!1);if(t&&t.panel){let n=rt(e);if(n&&n!=e.root.activeElement){let r=B(e.state,t.query.spec);r.valid&&e.dispatch({effects:M.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[N.of(!0),t?M.of(B(e.state,t.query.spec)):h.appendConfig.of(G)]});return!0},ot=e=>{let t=e.state.field(P,!1);if(!t||!t.panel)return!1;let n=v(e,z);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:N.of(!1)}),!0},st=[{key:`Mod-f`,run:at,scope:`editor search-panel`},{key:`F3`,run:L,shift:R,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:L,shift:R,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:ot,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:et},{key:`Mod-Alt-g`,run:ke},{key:`Mod-d`,run:Be,preventDefault:!0}],ct=class{constructor(e){this.view=e;let t=this.query=e.state.field(P).query.spec;this.commit=this.commit.bind(this),this.searchField=b(`input`,{value:t.search,placeholder:V(e,`Find`),"aria-label":V(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=b(`input`,{value:t.replace,placeholder:V(e,`Replace`),"aria-label":V(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=b(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=b(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=b(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return b(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=b(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>L(e),[V(e,`next`)]),n(`prev`,()=>R(e),[V(e,`previous`)]),n(`select`,()=>$e(e),[V(e,`all`)]),b(`label`,null,[this.caseField,V(e,`match case`)]),b(`label`,null,[this.reField,V(e,`regexp`)]),b(`label`,null,[this.wordField,V(e,`by word`)]),...e.state.readOnly?[]:[b(`br`),this.replaceField,n(`replace`,()=>tt(e),[V(e,`replace`)]),n(`replaceAll`,()=>nt(e),[V(e,`replace all`)])],b(`button`,{name:`close`,onclick:()=>ot(e),"aria-label":V(e,`close`),type:`button`},[`×`])])}commit(){let e=new He({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:M.of(e)}))}keydown(e){le(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?R:L)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),tt(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(M)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(D).top}};function V(e,t){return e.state.phrase(t)}var H=30,U=/[\s\.,:;?!]/;function W(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-H),o=Math.min(i,n+H),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<H;e++)if(!U.test(s[e+1])&&U.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-H;e--)if(!U.test(s[e-1])&&U.test(s[e])){s=s.slice(0,e);break}}return g.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var lt=g.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),G=[P,i.low(Qe),lt],ut=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},K=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(Z).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new f,s=[],c=0,l=r.doc.iter(),u=0,p=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>p)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,p);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==p))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=Ot(s);if(i)o.add(n,n,d.widget({widget:new Ct(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,d.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==p)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let m=o.finish();return new e(m,n,q(m))}};function q(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new ut(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new ut(r.from,n,r.diagnostic)}),r}function dt(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(Z).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(J))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function ft(e,t){return e.field(X,!1)?t:t.concat(h.appendConfig.of(kt))}var J=h.define(),Y=h.define(),pt=h.define(),X=l.define({create(){return new K(d.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=q(n,e.selected.diagnostic,i)||q(n,null,i)}!n.size&&i&&t.state.facet(Z).autoPanel&&(i=null),e=new K(n,i,r)}for(let n of t.effects)if(n.is(J)){let r=t.state.facet(Z).autoPanel?n.value.length?Q.open:null:e.panel;e=K.init(n.value,r,t.state)}else n.is(Y)?e=new K(e.diagnostics,n.value?Q.open:null,e.selected):n.is(pt)&&(e=new K(e.diagnostics,e.panel,n.value));return e},provide:e=>[_.from(e,e=>e.panel),g.decorations.from(e,e=>e.diagnostics)]}),mt=d.mark({class:`cm-lintRange cm-lintRange-active`});function ht(e,t,n){let{diagnostics:r}=e.state.field(X),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(Z).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:e.state.doc.lineAt(a).to<o,create(){return{dom:gt(e,i)}}}:null}function gt(e,t){return b(`ul`,{class:`cm-tooltip-lint`},t.map(t=>St(e,t,!1)))}var _t=e=>{let t=e.state.field(X,!1);(!t||!t.panel)&&e.dispatch({effects:ft(e.state,[Y.of(!0)])});let n=v(e,Q.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},vt=e=>{let t=e.state.field(X,!1);return!t||!t.panel?!1:(e.dispatch({effects:Y.of(!1)}),!0)},yt=[{key:`Mod-Shift-m`,run:_t,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(X,!1);if(!t)return!1;let n=e.state.selection.main,r=q(t.diagnostics,null,n.to+1);return!r&&(r=q(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)}}],Z=m.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...a(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:bt,tooltipFilter:bt,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function bt(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function xt(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function St(e,t,n){let r=n?xt(t.actions):[];return b(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},b(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=q(e.state.field(X).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),b(`u`,s.slice(c,c+1)),s.slice(c+1)];return b(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&b(`div`,{class:`cm-diagnosticSource`},t.source))}var Ct=class extends r{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return b(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},wt=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=St(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},Q=class e{constructor(e){this.view=e,this.items=[],this.list=b(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)vt(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=xt(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=q(this.view.state.field(X).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=b(`div`,{class:`cm-panel-lint`},this.list,b(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>vt(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(X).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(X),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new wt(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new wt(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=q(this.view.state.field(X).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:pt.of(t)})}static open(t){return new e(t)}};function Tt(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function $(e){return Tt(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var Et=g.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:$(`#d11`)},".cm-lintRange-warning":{backgroundImage:$(`orange`)},".cm-lintRange-info":{backgroundImage:$(`#999`)},".cm-lintRange-hint":{backgroundImage:$(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function Dt(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function Ot(e){let t=`hint`,n=1;for(let r of e){let e=Dt(r.severity);e>n&&(n=e,t=r.severity)}return t}var kt=[X,g.decorations.compute([X],e=>{let{selected:t,panel:n}=e.field(X);return!t||!n||t.from==t.to?d.none:d.set([mt.range(t.from,t.to)])}),de(ht,{hideOn:dt}),Et],At=[ae(),he(),ie(),e(),re(),ge(),pe(),o.allowMultipleSelections.of(!0),s(),p(se,{fallback:!0}),ue(),Ce(),xe(),fe(),oe(),me(),je(),_e.of([...be,...n,...st,...t,...ve,...Se,...yt])];ie(),e(),ge(),p(se,{fallback:!0}),_e.of([...n,...t]);export{Ve as n,At as t};
@@ -1 +1 @@
1
- import{$ as e}from"./dist-DkRtDyLN.js";var t=/\.(md|mdx)$/i;function n(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``)}function r(e){return n(e).replace(t,``)}function i(e){let r=n(e);return r?t.test(r)?r:`${r}.md`:`untitled.md`}function a(e){let t=r(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}function o(t){return e.includes(t)}function s(e){if(e.startsWith(h)||e.startsWith(y)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=g(t),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function c(e){if(e.startsWith(h)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`#`);if(n<0)return null;let r=t.slice(n+1);if(!r)return null;try{return decodeURIComponent(r)}catch{return r}}function l(e,t){let n=`#/${e}`;return t?`${n}#${encodeURIComponent(t)}`:n}function u(e){if(window.location.hash===e)return;let{pathname:t,search:n}=window.location;window.history.replaceState(null,``,`${t}${n}${e}`)}function d(e){return e.endsWith(`.mdx`)?e.slice(0,-4):e.endsWith(`.md`)?e.slice(0,-3):e}function f(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}#${encodeURIComponent(t)}`:r}function p(e,t,n){if(e===`folder`)return f(t);let r=`#/${encodeURIComponent(t)}`;return n==null||n===``?r:`${r}?branch=${encodeURIComponent(n)}`}function m(e){if(e===`#/`)return!0;if(!e.startsWith(`#/`))return!1;let t=e.slice(2);return t.length>0&&t[0]===`?`}var h=`#/__asset__/`;function g(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function _(e){if(!e.startsWith(h))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function v(e){return`${h}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}var y=`#/__skill-file__/`;function b(e){return`${y}${[e.scope,e.name].map(encodeURIComponent).join(`/`)}/${e.path.split(`/`).map(encodeURIComponent).join(`/`)}`}function x(e){if(!e.startsWith(y))return null;let t=e.slice(17);if(!t)return null;let n;try{n=t.split(`/`).map(decodeURIComponent)}catch{return null}if(n.length<3)return null;let[r,i,...a]=n,s=a.join(`/`);return!r||!i||!s||!o(r)?null:{scope:r,name:i,path:s}}export{d as a,f as c,u as d,x as f,r as h,p as i,b as l,i as m,_ as n,v as o,a as p,s as r,l as s,c as t,m as u};
1
+ import{$ as e}from"./dist-CT-B-J5Q.js";var t=/\.(md|mdx)$/i;function n(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``)}function r(e){return n(e).replace(t,``)}function i(e){let r=n(e);return r?t.test(r)?r:`${r}.md`:`untitled.md`}function a(e){let t=r(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}function o(t){return e.includes(t)}function s(e){if(e.startsWith(h)||e.startsWith(y)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=g(t),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function c(e){if(e.startsWith(h)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`#`);if(n<0)return null;let r=t.slice(n+1);if(!r)return null;try{return decodeURIComponent(r)}catch{return r}}function l(e,t){let n=`#/${e}`;return t?`${n}#${encodeURIComponent(t)}`:n}function u(e){if(window.location.hash===e)return;let{pathname:t,search:n}=window.location;window.history.replaceState(null,``,`${t}${n}${e}`)}function d(e){return e.endsWith(`.mdx`)?e.slice(0,-4):e.endsWith(`.md`)?e.slice(0,-3):e}function f(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}#${encodeURIComponent(t)}`:r}function p(e,t,n){if(e===`folder`)return f(t);let r=`#/${encodeURIComponent(t)}`;return n==null||n===``?r:`${r}?branch=${encodeURIComponent(n)}`}function m(e){if(e===`#/`)return!0;if(!e.startsWith(`#/`))return!1;let t=e.slice(2);return t.length>0&&t[0]===`?`}var h=`#/__asset__/`;function g(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function _(e){if(!e.startsWith(h))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function v(e){return`${h}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}var y=`#/__skill-file__/`;function b(e){return`${y}${[e.scope,e.name].map(encodeURIComponent).join(`/`)}/${e.path.split(`/`).map(encodeURIComponent).join(`/`)}`}function x(e){if(!e.startsWith(y))return null;let t=e.slice(17);if(!t)return null;let n;try{n=t.split(`/`).map(decodeURIComponent)}catch{return null}if(n.length<3)return null;let[r,i,...a]=n,s=a.join(`/`);return!r||!i||!s||!o(r)?null:{scope:r,name:i,path:s}}export{d as a,f as c,u as d,x as f,r as h,p as i,b as l,i as m,_ as n,v as o,a as p,s as r,l as s,c as t,m as u};
@@ -1 +1 @@
1
- import{O as e}from"./dist-DkRtDyLN.js";var t=`open-knowledge:documents-changed`,n=new Set(e.options);function r(e){return e===void 0||!Array.isArray(e)?[`files`]:[...new Set(e.filter(e=>n.has(e)))]}function i(e=[`files`]){window.dispatchEvent(new CustomEvent(t,{detail:{channels:r(e)}}))}function a(e){let n=t=>{e(r(t instanceof CustomEvent?t.detail?.channels:void 0))};return window.addEventListener(t,n),()=>window.removeEventListener(t,n)}var o=`open-knowledge:branch-changed`;function s(e){window.dispatchEvent(new CustomEvent(o,{detail:{branch:e}}))}function c(e){let t=t=>{if(!(t instanceof CustomEvent))return;let n=t.detail;e(n?.branch??null)};return window.addEventListener(o,t),()=>window.removeEventListener(o,t)}var l=`open-knowledge:templates-changed`;function u(){window.dispatchEvent(new CustomEvent(l))}function d(e){let t=()=>e();return window.addEventListener(l,t),()=>window.removeEventListener(l,t)}var f=`open-knowledge:skills-changed`;function p(){window.dispatchEvent(new CustomEvent(f))}function m(e){let t=()=>e();return window.addEventListener(f,t),()=>window.removeEventListener(f,t)}export{c as a,d as c,u as i,i as n,a as o,p as r,m as s,s as t};
1
+ import{O as e}from"./dist-CT-B-J5Q.js";var t=`open-knowledge:documents-changed`,n=new Set(e.options);function r(e){return e===void 0||!Array.isArray(e)?[`files`]:[...new Set(e.filter(e=>n.has(e)))]}function i(e=[`files`]){window.dispatchEvent(new CustomEvent(t,{detail:{channels:r(e)}}))}function a(e){let n=t=>{e(r(t instanceof CustomEvent?t.detail?.channels:void 0))};return window.addEventListener(t,n),()=>window.removeEventListener(t,n)}var o=`open-knowledge:branch-changed`;function s(e){window.dispatchEvent(new CustomEvent(o,{detail:{branch:e}}))}function c(e){let t=t=>{if(!(t instanceof CustomEvent))return;let n=t.detail;e(n?.branch??null)};return window.addEventListener(o,t),()=>window.removeEventListener(o,t)}var l=`open-knowledge:templates-changed`;function u(){window.dispatchEvent(new CustomEvent(l))}function d(e){let t=()=>e();return window.addEventListener(l,t),()=>window.removeEventListener(l,t)}var f=`open-knowledge:skills-changed`;function p(){window.dispatchEvent(new CustomEvent(f))}function m(e){let t=()=>e();return window.addEventListener(f,t),()=>window.removeEventListener(f,t)}export{c as a,d as c,u as i,i as n,a as o,p as r,m as s,s as t};
@@ -1,4 +1,4 @@
1
- import{n as e,r as t,t as n}from"./src-BViYu1Wd.js";import{B as r,C as i,V as a,W as o,_ as s,a as c,b as l,nt as u,v as d}from"./chunk-ICPOFSXX-DrWPpdBM.js";import{t as f}from"./channel-D5XfHPw9.js";import{C as p}from"./src-CSQC3Qr9.js";import{h as m,s as h}from"./chunk-5PVQY5BW-BwH_ti4z.js";import"./chunk-U2HBQHQK-Bx1RHKxc.js";import"./chunk-BSJP7CBP-SKdXejJy.js";import"./chunk-ZZ45TVLE-003_vpT6.js";import{t as g}from"./chunk-55IACEB6-DTK73H5l.js";import{t as _}from"./chunk-EDXVE4YY-CR8P_5d9.js";import"./chunk-X2U36JSP-CSuA8p4I.js";import"./chunk-5FUZZQ4R-Bnr_Foe2.js";import"./chunk-ENJZ2VHE-Dk4r_2N4.js";import{r as v,t as y}from"./chunk-336JU56O-DFEiQdL3.js";var b=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],r=[1,10],i=[1,11],a=[1,12],o=[1,13],s=[1,23],c=[1,24],l=[1,25],u=[1,26],d=[1,27],f=[1,19],p=[1,28],m=[1,29],h=[1,20],g=[1,18],_=[1,21],v=[1,22],y=[1,36],b=[1,37],x=[1,38],S=[1,39],C=[1,40],w=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,65,66,67,68,69],T=[1,45],E=[1,46],D=[1,55],O=[40,48,50,51,52,70,71],k=[1,66],A=[1,64],j=[1,61],M=[1,65],N=[1,67],P=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,65,66,67,68,69],F=[65,66,67,68,69],I=[1,84],L=[1,83],R=[1,81],z=[1,82],B=[6,10,42,47],V=[6,10,13,41,42,47,48,49],H=[1,92],U=[1,91],W=[1,90],G=[19,58],K=[1,101],q=[1,100],J=[19,58,60,62],Y={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,attributeKeyType:59,",":60,ATTRIBUTE_KEY:61,COMMENT:62,cardinality:63,relType:64,ZERO_OR_ONE:65,ZERO_OR_MORE:66,ONE_OR_MORE:67,ONLY_ONE:68,MD_PARENT:69,NON_IDENTIFYING:70,IDENTIFYING:71,WORD:72,$accept:0,$end:1},terminals_:{2:`error`,4:`ER_DIAGRAM`,6:`EOF`,8:`SPACE`,10:`NEWLINE`,13:`COLON`,15:`STYLE_SEPARATOR`,17:`BLOCK_START`,19:`BLOCK_STOP`,20:`SQS`,21:`SQE`,22:`title`,23:`title_value`,24:`acc_title`,25:`acc_title_value`,26:`acc_descr`,27:`acc_descr_value`,28:`acc_descr_multiline_value`,33:`direction_tb`,34:`direction_bt`,35:`direction_rl`,36:`direction_lr`,37:`CLASSDEF`,40:`UNICODE_TEXT`,41:`STYLE_TEXT`,42:`COMMA`,43:`CLASS`,44:`STYLE`,47:`SEMI`,48:`NUM`,49:`BRKT`,50:`ENTITY_NAME`,51:`DECIMAL_NUM`,52:`ENTITY_ONE`,58:`ATTRIBUTE_WORD`,60:`,`,61:`ATTRIBUTE_KEY`,62:`COMMENT`,65:`ZERO_OR_ONE`,66:`ZERO_OR_MORE`,67:`ONE_OR_MORE`,68:`ONLY_ONE`,69:`MD_PARENT`,70:`NON_IDENTIFYING`,71:`IDENTIFYING`,72:`WORD`},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[55,1],[56,1],[56,3],[59,1],[57,1],[12,3],[63,1],[63,1],[63,1],[63,1],[63,1],[64,1],[64,1],[14,1],[14,1],[14,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:break;case 2:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(a[s-4]),r.addEntity(a[s-2]),r.addRelationship(a[s-4],a[s],a[s-2],a[s-3]);break;case 9:r.addEntity(a[s-8]),r.addEntity(a[s-4]),r.addRelationship(a[s-8],a[s],a[s-4],a[s-5]),r.setClass([a[s-8]],a[s-6]),r.setClass([a[s-4]],a[s-2]);break;case 10:r.addEntity(a[s-6]),r.addEntity(a[s-2]),r.addRelationship(a[s-6],a[s],a[s-2],a[s-3]),r.setClass([a[s-6]],a[s-4]);break;case 11:r.addEntity(a[s-6]),r.addEntity(a[s-4]),r.addRelationship(a[s-6],a[s],a[s-4],a[s-5]),r.setClass([a[s-4]],a[s-2]);break;case 12:r.addEntity(a[s-3]),r.addAttributes(a[s-3],a[s-1]);break;case 13:r.addEntity(a[s-5]),r.addAttributes(a[s-5],a[s-1]),r.setClass([a[s-5]],a[s-3]);break;case 14:r.addEntity(a[s-2]);break;case 15:r.addEntity(a[s-4]),r.setClass([a[s-4]],a[s-2]);break;case 16:r.addEntity(a[s]);break;case 17:r.addEntity(a[s-2]),r.setClass([a[s-2]],a[s]);break;case 18:r.addEntity(a[s-6],a[s-4]),r.addAttributes(a[s-6],a[s-1]);break;case 19:r.addEntity(a[s-8],a[s-6]),r.addAttributes(a[s-8],a[s-1]),r.setClass([a[s-8]],a[s-3]);break;case 20:r.addEntity(a[s-5],a[s-3]);break;case 21:r.addEntity(a[s-7],a[s-5]),r.setClass([a[s-7]],a[s-2]);break;case 22:r.addEntity(a[s-3],a[s-1]);break;case 23:r.addEntity(a[s-5],a[s-3]),r.setClass([a[s-5]],a[s]);break;case 24:case 25:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection(`TB`);break;case 33:r.setDirection(`BT`);break;case 34:r.setDirection(`RL`);break;case 35:r.setDirection(`LR`);break;case 36:this.$=a[s-3],r.addClass(a[s-2],a[s-1]);break;case 37:case 38:case 59:case 67:this.$=[a[s]];break;case 39:case 40:this.$=a[s-2].concat([a[s]]);break;case 41:this.$=a[s-2],r.setClass(a[s-1],a[s]);break;case 42:this.$=a[s-3],r.addCssStyles(a[s-2],a[s-1]);break;case 43:this.$=[a[s]];break;case 44:a[s-2].push(a[s]),this.$=a[s-2];break;case 46:this.$=a[s-1]+a[s];break;case 54:case 79:case 80:this.$=a[s].replace(/"/g,``);break;case 55:case 56:case 57:case 58:case 81:this.$=a[s];break;case 60:a[s].push(a[s-1]),this.$=a[s];break;case 61:this.$={type:a[s-1],name:a[s]};break;case 62:this.$={type:a[s-2],name:a[s-1],keys:a[s]};break;case 63:this.$={type:a[s-2],name:a[s-1],comment:a[s]};break;case 64:this.$={type:a[s-3],name:a[s-2],keys:a[s-1],comment:a[s]};break;case 65:case 66:case 69:this.$=a[s];break;case 68:a[s-2].push(a[s]),this.$=a[s-2];break;case 70:this.$=a[s].replace(/"/g,``);break;case 71:this.$={cardA:a[s],relType:a[s-1],cardB:a[s-2]};break;case 72:this.$=r.Cardinality.ZERO_OR_ONE;break;case 73:this.$=r.Cardinality.ZERO_OR_MORE;break;case 74:this.$=r.Cardinality.ONE_OR_MORE;break;case 75:this.$=r.Cardinality.ONLY_ONE;break;case 76:this.$=r.Cardinality.MD_PARENT;break;case 77:this.$=r.Identification.NON_IDENTIFYING;break;case 78:this.$=r.Identification.IDENTIFYING;break}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},t(n,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:r,24:i,26:a,28:o,29:14,30:15,31:16,32:17,33:s,34:c,35:l,36:u,37:d,40:f,43:p,44:m,48:h,50:g,51:_,52:v},t(n,[2,7],{1:[2,1]}),t(n,[2,3]),{9:30,11:9,22:r,24:i,26:a,28:o,29:14,30:15,31:16,32:17,33:s,34:c,35:l,36:u,37:d,40:f,43:p,44:m,48:h,50:g,51:_,52:v},t(n,[2,5]),t(n,[2,6]),t(n,[2,16],{12:31,63:35,15:[1,32],17:[1,33],20:[1,34],65:y,66:b,67:x,68:S,69:C}),{23:[1,41]},{25:[1,42]},{27:[1,43]},t(n,[2,27]),t(n,[2,28]),t(n,[2,29]),t(n,[2,30]),t(n,[2,31]),t(w,[2,54]),t(w,[2,55]),t(w,[2,56]),t(w,[2,57]),t(w,[2,58]),t(n,[2,32]),t(n,[2,33]),t(n,[2,34]),t(n,[2,35]),{16:44,40:T,41:E},{16:47,40:T,41:E},{16:48,40:T,41:E},t(n,[2,4]),{11:49,40:f,48:h,50:g,51:_,52:v},{16:50,40:T,41:E},{18:51,19:[1,52],53:53,54:54,58:D},{11:56,40:f,48:h,50:g,51:_,52:v},{64:57,70:[1,58],71:[1,59]},t(O,[2,72]),t(O,[2,73]),t(O,[2,74]),t(O,[2,75]),t(O,[2,76]),t(n,[2,24]),t(n,[2,25]),t(n,[2,26]),{13:k,38:60,41:A,42:j,45:62,46:63,48:M,49:N},t(P,[2,37]),t(P,[2,38]),{16:68,40:T,41:E,42:j},{13:k,38:69,41:A,42:j,45:62,46:63,48:M,49:N},{13:[1,70],15:[1,71]},t(n,[2,17],{63:35,12:72,17:[1,73],42:j,65:y,66:b,67:x,68:S,69:C}),{19:[1,74]},t(n,[2,14]),{18:75,19:[2,59],53:53,54:54,58:D},{55:76,58:[1,77]},{58:[2,65]},{21:[1,78]},{63:79,65:y,66:b,67:x,68:S,69:C},t(F,[2,77]),t(F,[2,78]),{6:I,10:L,39:80,42:R,47:z},{40:[1,85],41:[1,86]},t(B,[2,43],{46:87,13:k,41:A,48:M,49:N}),t(V,[2,45]),t(V,[2,50]),t(V,[2,51]),t(V,[2,52]),t(V,[2,53]),t(n,[2,41],{42:j}),{6:I,10:L,39:88,42:R,47:z},{14:89,40:H,50:U,72:W},{16:93,40:T,41:E},{11:94,40:f,48:h,50:g,51:_,52:v},{18:95,19:[1,96],53:53,54:54,58:D},t(n,[2,12]),{19:[2,60]},t(G,[2,61],{56:97,57:98,59:99,61:K,62:q}),t([19,58,61,62],[2,66]),t(n,[2,22],{15:[1,103],17:[1,102]}),t([40,48,50,51,52],[2,71]),t(n,[2,36]),{13:k,41:A,45:104,46:63,48:M,49:N},t(n,[2,47]),t(n,[2,48]),t(n,[2,49]),t(P,[2,39]),t(P,[2,40]),t(V,[2,46]),t(n,[2,42]),t(n,[2,8]),t(n,[2,79]),t(n,[2,80]),t(n,[2,81]),{13:[1,105],42:j},{13:[1,107],15:[1,106]},{19:[1,108]},t(n,[2,15]),t(G,[2,62],{57:109,60:[1,110],62:q}),t(G,[2,63]),t(J,[2,67]),t(G,[2,70]),t(J,[2,69]),{18:111,19:[1,112],53:53,54:54,58:D},{16:113,40:T,41:E},t(B,[2,44],{46:87,13:k,41:A,48:M,49:N}),{14:114,40:H,50:U,72:W},{16:115,40:T,41:E},{14:116,40:H,50:U,72:W},t(n,[2,13]),t(G,[2,64]),{59:117,61:K},{19:[1,118]},t(n,[2,20]),t(n,[2,23],{17:[1,119],42:j}),t(n,[2,11]),{13:[1,120],42:j},t(n,[2,10]),t(J,[2,68]),t(n,[2,18]),{18:121,19:[1,122],53:53,54:54,58:D},{14:123,40:H,50:U,72:W},{19:[1,124]},t(n,[2,21]),t(n,[2,9]),t(n,[2,19])],defaultActions:{55:[2,65],75:[2,60]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{n as e,r as t,t as n}from"./src-MPCDFn03.js";import{B as r,C as i,V as a,W as o,_ as s,a as c,b as l,nt as u,v as d}from"./chunk-ICPOFSXX-Lfk6ZyEQ.js";import{t as f}from"./channel-1647Teii.js";import{C as p}from"./src-D68V8cNU.js";import{h as m,s as h}from"./chunk-5PVQY5BW-c5z1iYCm.js";import"./chunk-U2HBQHQK-u9S8o95F.js";import"./chunk-BSJP7CBP-O-pJBrr0.js";import"./chunk-ZZ45TVLE-DhQl-h1P.js";import{t as g}from"./chunk-55IACEB6--gETN8Fg.js";import{t as _}from"./chunk-EDXVE4YY-BG01O3ZU.js";import"./chunk-X2U36JSP-SSsGg9yt.js";import"./chunk-5FUZZQ4R-CiLbimSt.js";import"./chunk-ENJZ2VHE-CWfe3b4S.js";import{r as v,t as y}from"./chunk-336JU56O-DHb7NgDk.js";var b=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],r=[1,10],i=[1,11],a=[1,12],o=[1,13],s=[1,23],c=[1,24],l=[1,25],u=[1,26],d=[1,27],f=[1,19],p=[1,28],m=[1,29],h=[1,20],g=[1,18],_=[1,21],v=[1,22],y=[1,36],b=[1,37],x=[1,38],S=[1,39],C=[1,40],w=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,65,66,67,68,69],T=[1,45],E=[1,46],D=[1,55],O=[40,48,50,51,52,70,71],k=[1,66],A=[1,64],j=[1,61],M=[1,65],N=[1,67],P=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,65,66,67,68,69],F=[65,66,67,68,69],I=[1,84],L=[1,83],R=[1,81],z=[1,82],B=[6,10,42,47],V=[6,10,13,41,42,47,48,49],H=[1,92],U=[1,91],W=[1,90],G=[19,58],K=[1,101],q=[1,100],J=[19,58,60,62],Y={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,attributeKeyType:59,",":60,ATTRIBUTE_KEY:61,COMMENT:62,cardinality:63,relType:64,ZERO_OR_ONE:65,ZERO_OR_MORE:66,ONE_OR_MORE:67,ONLY_ONE:68,MD_PARENT:69,NON_IDENTIFYING:70,IDENTIFYING:71,WORD:72,$accept:0,$end:1},terminals_:{2:`error`,4:`ER_DIAGRAM`,6:`EOF`,8:`SPACE`,10:`NEWLINE`,13:`COLON`,15:`STYLE_SEPARATOR`,17:`BLOCK_START`,19:`BLOCK_STOP`,20:`SQS`,21:`SQE`,22:`title`,23:`title_value`,24:`acc_title`,25:`acc_title_value`,26:`acc_descr`,27:`acc_descr_value`,28:`acc_descr_multiline_value`,33:`direction_tb`,34:`direction_bt`,35:`direction_rl`,36:`direction_lr`,37:`CLASSDEF`,40:`UNICODE_TEXT`,41:`STYLE_TEXT`,42:`COMMA`,43:`CLASS`,44:`STYLE`,47:`SEMI`,48:`NUM`,49:`BRKT`,50:`ENTITY_NAME`,51:`DECIMAL_NUM`,52:`ENTITY_ONE`,58:`ATTRIBUTE_WORD`,60:`,`,61:`ATTRIBUTE_KEY`,62:`COMMENT`,65:`ZERO_OR_ONE`,66:`ZERO_OR_MORE`,67:`ONE_OR_MORE`,68:`ONLY_ONE`,69:`MD_PARENT`,70:`NON_IDENTIFYING`,71:`IDENTIFYING`,72:`WORD`},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[55,1],[56,1],[56,3],[59,1],[57,1],[12,3],[63,1],[63,1],[63,1],[63,1],[63,1],[64,1],[64,1],[14,1],[14,1],[14,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:break;case 2:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(a[s-4]),r.addEntity(a[s-2]),r.addRelationship(a[s-4],a[s],a[s-2],a[s-3]);break;case 9:r.addEntity(a[s-8]),r.addEntity(a[s-4]),r.addRelationship(a[s-8],a[s],a[s-4],a[s-5]),r.setClass([a[s-8]],a[s-6]),r.setClass([a[s-4]],a[s-2]);break;case 10:r.addEntity(a[s-6]),r.addEntity(a[s-2]),r.addRelationship(a[s-6],a[s],a[s-2],a[s-3]),r.setClass([a[s-6]],a[s-4]);break;case 11:r.addEntity(a[s-6]),r.addEntity(a[s-4]),r.addRelationship(a[s-6],a[s],a[s-4],a[s-5]),r.setClass([a[s-4]],a[s-2]);break;case 12:r.addEntity(a[s-3]),r.addAttributes(a[s-3],a[s-1]);break;case 13:r.addEntity(a[s-5]),r.addAttributes(a[s-5],a[s-1]),r.setClass([a[s-5]],a[s-3]);break;case 14:r.addEntity(a[s-2]);break;case 15:r.addEntity(a[s-4]),r.setClass([a[s-4]],a[s-2]);break;case 16:r.addEntity(a[s]);break;case 17:r.addEntity(a[s-2]),r.setClass([a[s-2]],a[s]);break;case 18:r.addEntity(a[s-6],a[s-4]),r.addAttributes(a[s-6],a[s-1]);break;case 19:r.addEntity(a[s-8],a[s-6]),r.addAttributes(a[s-8],a[s-1]),r.setClass([a[s-8]],a[s-3]);break;case 20:r.addEntity(a[s-5],a[s-3]);break;case 21:r.addEntity(a[s-7],a[s-5]),r.setClass([a[s-7]],a[s-2]);break;case 22:r.addEntity(a[s-3],a[s-1]);break;case 23:r.addEntity(a[s-5],a[s-3]),r.setClass([a[s-5]],a[s]);break;case 24:case 25:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection(`TB`);break;case 33:r.setDirection(`BT`);break;case 34:r.setDirection(`RL`);break;case 35:r.setDirection(`LR`);break;case 36:this.$=a[s-3],r.addClass(a[s-2],a[s-1]);break;case 37:case 38:case 59:case 67:this.$=[a[s]];break;case 39:case 40:this.$=a[s-2].concat([a[s]]);break;case 41:this.$=a[s-2],r.setClass(a[s-1],a[s]);break;case 42:this.$=a[s-3],r.addCssStyles(a[s-2],a[s-1]);break;case 43:this.$=[a[s]];break;case 44:a[s-2].push(a[s]),this.$=a[s-2];break;case 46:this.$=a[s-1]+a[s];break;case 54:case 79:case 80:this.$=a[s].replace(/"/g,``);break;case 55:case 56:case 57:case 58:case 81:this.$=a[s];break;case 60:a[s].push(a[s-1]),this.$=a[s];break;case 61:this.$={type:a[s-1],name:a[s]};break;case 62:this.$={type:a[s-2],name:a[s-1],keys:a[s]};break;case 63:this.$={type:a[s-2],name:a[s-1],comment:a[s]};break;case 64:this.$={type:a[s-3],name:a[s-2],keys:a[s-1],comment:a[s]};break;case 65:case 66:case 69:this.$=a[s];break;case 68:a[s-2].push(a[s]),this.$=a[s-2];break;case 70:this.$=a[s].replace(/"/g,``);break;case 71:this.$={cardA:a[s],relType:a[s-1],cardB:a[s-2]};break;case 72:this.$=r.Cardinality.ZERO_OR_ONE;break;case 73:this.$=r.Cardinality.ZERO_OR_MORE;break;case 74:this.$=r.Cardinality.ONE_OR_MORE;break;case 75:this.$=r.Cardinality.ONLY_ONE;break;case 76:this.$=r.Cardinality.MD_PARENT;break;case 77:this.$=r.Identification.NON_IDENTIFYING;break;case 78:this.$=r.Identification.IDENTIFYING;break}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},t(n,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:r,24:i,26:a,28:o,29:14,30:15,31:16,32:17,33:s,34:c,35:l,36:u,37:d,40:f,43:p,44:m,48:h,50:g,51:_,52:v},t(n,[2,7],{1:[2,1]}),t(n,[2,3]),{9:30,11:9,22:r,24:i,26:a,28:o,29:14,30:15,31:16,32:17,33:s,34:c,35:l,36:u,37:d,40:f,43:p,44:m,48:h,50:g,51:_,52:v},t(n,[2,5]),t(n,[2,6]),t(n,[2,16],{12:31,63:35,15:[1,32],17:[1,33],20:[1,34],65:y,66:b,67:x,68:S,69:C}),{23:[1,41]},{25:[1,42]},{27:[1,43]},t(n,[2,27]),t(n,[2,28]),t(n,[2,29]),t(n,[2,30]),t(n,[2,31]),t(w,[2,54]),t(w,[2,55]),t(w,[2,56]),t(w,[2,57]),t(w,[2,58]),t(n,[2,32]),t(n,[2,33]),t(n,[2,34]),t(n,[2,35]),{16:44,40:T,41:E},{16:47,40:T,41:E},{16:48,40:T,41:E},t(n,[2,4]),{11:49,40:f,48:h,50:g,51:_,52:v},{16:50,40:T,41:E},{18:51,19:[1,52],53:53,54:54,58:D},{11:56,40:f,48:h,50:g,51:_,52:v},{64:57,70:[1,58],71:[1,59]},t(O,[2,72]),t(O,[2,73]),t(O,[2,74]),t(O,[2,75]),t(O,[2,76]),t(n,[2,24]),t(n,[2,25]),t(n,[2,26]),{13:k,38:60,41:A,42:j,45:62,46:63,48:M,49:N},t(P,[2,37]),t(P,[2,38]),{16:68,40:T,41:E,42:j},{13:k,38:69,41:A,42:j,45:62,46:63,48:M,49:N},{13:[1,70],15:[1,71]},t(n,[2,17],{63:35,12:72,17:[1,73],42:j,65:y,66:b,67:x,68:S,69:C}),{19:[1,74]},t(n,[2,14]),{18:75,19:[2,59],53:53,54:54,58:D},{55:76,58:[1,77]},{58:[2,65]},{21:[1,78]},{63:79,65:y,66:b,67:x,68:S,69:C},t(F,[2,77]),t(F,[2,78]),{6:I,10:L,39:80,42:R,47:z},{40:[1,85],41:[1,86]},t(B,[2,43],{46:87,13:k,41:A,48:M,49:N}),t(V,[2,45]),t(V,[2,50]),t(V,[2,51]),t(V,[2,52]),t(V,[2,53]),t(n,[2,41],{42:j}),{6:I,10:L,39:88,42:R,47:z},{14:89,40:H,50:U,72:W},{16:93,40:T,41:E},{11:94,40:f,48:h,50:g,51:_,52:v},{18:95,19:[1,96],53:53,54:54,58:D},t(n,[2,12]),{19:[2,60]},t(G,[2,61],{56:97,57:98,59:99,61:K,62:q}),t([19,58,61,62],[2,66]),t(n,[2,22],{15:[1,103],17:[1,102]}),t([40,48,50,51,52],[2,71]),t(n,[2,36]),{13:k,41:A,45:104,46:63,48:M,49:N},t(n,[2,47]),t(n,[2,48]),t(n,[2,49]),t(P,[2,39]),t(P,[2,40]),t(V,[2,46]),t(n,[2,42]),t(n,[2,8]),t(n,[2,79]),t(n,[2,80]),t(n,[2,81]),{13:[1,105],42:j},{13:[1,107],15:[1,106]},{19:[1,108]},t(n,[2,15]),t(G,[2,62],{57:109,60:[1,110],62:q}),t(G,[2,63]),t(J,[2,67]),t(G,[2,70]),t(J,[2,69]),{18:111,19:[1,112],53:53,54:54,58:D},{16:113,40:T,41:E},t(B,[2,44],{46:87,13:k,41:A,48:M,49:N}),{14:114,40:H,50:U,72:W},{16:115,40:T,41:E},{14:116,40:H,50:U,72:W},t(n,[2,13]),t(G,[2,64]),{59:117,61:K},{19:[1,118]},t(n,[2,20]),t(n,[2,23],{17:[1,119],42:j}),t(n,[2,11]),{13:[1,120],42:j},t(n,[2,10]),t(J,[2,68]),t(n,[2,18]),{18:121,19:[1,122],53:53,54:54,58:D},{14:123,40:H,50:U,72:W},{19:[1,124]},t(n,[2,21]),t(n,[2,9]),t(n,[2,19])],defaultActions:{55:[2,65],75:[2,60]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};Y.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.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),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{s as e}from"./chunk-Bj-mKKzh.js";import{n as t,t as n}from"./compiler-runtime-B6sxACDP.js";import{la as r,ua as i}from"./dist-DkRtDyLN.js";import{t as a}from"./file-tree-rename-validation-DgUQ0I0S.js";import{b as o,i as s,x as c,y as l}from"./navigation-targets-S-8o5DE_.js";import{c as u,o as ee,s as d}from"./doc-hash-BDRwCcvB.js";import{t as f}from"./use-apply-config-color-theme-CUJwxTbn.js";var p=e(t(),1),m=n(),h=`application/x-open-knowledge-sidebar-item+json`,g={image:!0,video:!0,audio:!0,pdf:!0,text:!0,mermaid:!0};function _(e){return JSON.stringify(e)}function v(e){return e.kind===`folder`?{target:{kind:`folder`,target:e.folderPath,folderPath:e.folderPath},hash:u(e.folderPath)}:e.kind===`asset`?{target:{kind:`asset`,target:e.assetPath,assetPath:e.assetPath,mediaKind:e.mediaKind},hash:ee(e.assetPath)}:{target:s(e.docName,e.size)??{kind:`doc`,target:e.docName,docName:e.docName},hash:d(e.docName)}}function y(e){if(!e||!Array.from(e.types).includes(`application/x-open-knowledge-sidebar-item+json`))return null;let t=e.getData(h);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!b(n)||n.v!==1||typeof n.kind!=`string`)return null;if(n.kind===`doc`){if(typeof n.docName!=`string`||n.docName.length===0)return null;let e=n.size;return e!==null&&typeof e!=`number`?null:{v:1,kind:`doc`,docName:n.docName,size:e}}if(n.kind===`folder`)return typeof n.folderPath==`string`?{v:1,kind:`folder`,folderPath:n.folderPath}:null;if(n.kind===`asset`){if(typeof n.assetPath!=`string`||n.assetPath.length===0)return null;let e=n.mediaKind;return e!==null&&!x(e)?null:{v:1,kind:`asset`,assetPath:n.assetPath,mediaKind:e}}return null}function b(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function x(e){return typeof e==`string`&&Object.hasOwn(g,e)}var S={background:`#171717`,foreground:`#e5e5e5`,cursor:`#e5e5e5`,cursorAccent:`#171717`,selectionBackground:`#3a3d41`,black:`#000000`,red:`#cd3131`,green:`#0dbc79`,yellow:`#e5e510`,blue:`#2472c8`,magenta:`#bc3fbc`,cyan:`#11a8cd`,white:`#e5e5e5`,brightBlack:`#666666`,brightRed:`#f14c4c`,brightGreen:`#23d18b`,brightYellow:`#f5f543`,brightBlue:`#3b8eea`,brightMagenta:`#d670d6`,brightCyan:`#29b8db`,brightWhite:`#ffffff`},C={background:`#ffffff`,foreground:`#262626`,cursor:`#262626`,cursorAccent:`#ffffff`,selectionBackground:`#add6ff`,black:`#000000`,red:`#cd3131`,green:`#00bc00`,yellow:`#949800`,blue:`#0451a5`,magenta:`#bc05bc`,cyan:`#0598bc`,white:`#555555`,brightBlack:`#666666`,brightRed:`#cd3131`,brightGreen:`#14ce14`,brightYellow:`#b5ba00`,brightBlue:`#0451a5`,brightMagenta:`#bc05bc`,brightCyan:`#0598bc`,brightWhite:`#a5a5a5`};function w(e){return e===`dark`?S:C}function te(e){try{let t=document.createElement(`span`);t.style.display=`none`,t.style.backgroundColor=`var(${e})`,document.body.appendChild(t);try{let e=getComputedStyle(t).backgroundColor;return!e||e===`rgba(0, 0, 0, 0)`||e===`transparent`||e.includes(`var(`)?null:e}finally{t.remove()}}catch{return null}}function T(e,t=te){let n=w(e),r=t(`--background`)??n.background,i=t(`--foreground`)??n.foreground;return{...n,background:r,foreground:i,cursor:i,cursorAccent:r,selectionBackground:t(`--selection-soft`)??n.selectionBackground}}function ne(e,t){let n=new Set([...Object.keys(e),...Object.keys(t)]);for(let r of n)if(e[r]!==t[r])return!1;return!0}function E(e){let t=(0,m.c)(5),n;t[0]===e?n=t[1]:(n=()=>T(e),t[0]=e,t[1]=n);let[r,i]=(0,p.useState)(n),a,o;return t[2]===e?(a=t[3],o=t[4]):(a=()=>{let t=()=>{let t=T(e);i(e=>ne(e,t)?e:t)};t();let n=new MutationObserver(t);return n.observe(document.documentElement,{attributes:!0,attributeFilter:[f,`class`]}),n.observe(document.head,{childList:!0,subtree:!0,characterData:!0}),()=>n.disconnect()},o=[e],t[2]=e,t[3]=a,t[4]=o),(0,p.useEffect)(a,o),r}var D=`.md`,O=/\.(md|mdx)$/i;function k(e,t=D){return O.test(e)||r(e)?e:`${e}${t}`}function A(e){return $(e).replace(O,``)}function j(e,t){let n=$(e),r=t.find(e=>o(e)&&M(e)===n);if(r)return r.docName;let i=A(n);return t.find(e=>{let t=M(e);return t!==n&&O.test(t)&&A(t)===i})&&O.test(n)?n:i}function M(e){return c(e)?F(e.path):l(e)?e.path:k(e.docName,e.docExt)}function N(e){let t=$(e).match(O);return t?`.${t[1].toLowerCase()}`:void 0}function P(e){return $(e)}function F(e){let t=$(e.trim());return t?`${t}/`:``}function I(e){return e.endsWith(`/`)?P(e):A(e)}function L(e){return e.map(M)}function R(e){return[...e].sort().join(`\0`)}function z(e){return R(L(e))}function B(e,t={}){let n=new Set;for(let r of e){let e=(c(r)||l(r)?r.path:r.docName).split(`/`).filter(Boolean);if(!t.includeOkFolders&&e.includes(`.ok`))continue;if(c(r)){let e=F(r.path);e&&n.add(e)}let i=c(r)?e.length:e.length-1;for(let t=1;t<=i;t++)n.add(`${e.slice(0,t).join(`/`)}/`)}return[...n].sort()}function V(e){if(!e)return[];let t=$(e.replace(O,``)).split(`/`).filter(Boolean),n=[],r=e.endsWith(`/`)?t.length:t.length-1;for(let e=1;e<=r;e++)n.push(`${t.slice(0,e).join(`/`)}/`);return n}function re(e,t,n){let r=N(e);if(r)return r;let i=n.find(e=>o(e)&&e.docName===t);return i?i.docExt??D:Q(e).includes(`.`)?void 0:D}function H(e,t){let n=e.lastIndexOf(`/`),r=n===-1?``:e.slice(0,n+1),i=n===-1?e:e.slice(n+1),a=t.filter(e=>{if(!l(e)||!e.path.startsWith(r))return!1;let t=e.path.slice(r.length);return!t.includes(`/`)&&t.startsWith(`${i}.`)});return a.length===1?a[0].path:null}function U(e,t,n){if(N(e))return null;let r=n.find(e=>l(e)&&e.path===t);return r?r.path:Q(e).includes(`.`)?t:H(t,n)}function W(e,t){let n=e.kind===`directory`,r=n?P(e.path):j(e.path,t);if(n)return{kind:`folder`,name:$(Q(e.path)).replace(O,``),path:r,treePath:K(e.path,!0)};let i=U(e.path,r,t);if(i)return{kind:`asset`,name:$(Q(i)),path:i,treePath:i};let a=re(e.path,r,t);return{kind:`file`,name:$(Q(e.path)).replace(O,``),path:r,treePath:K(e.path,!1),docExt:a}}function G(e){return e.kind===`directory`?P(e.path):e.path}function K(e,t){return t?F(e):O.test(e)?e:`${e}${D}`}function q(e,t,n){let r=F(t),i=new Set(n);for(let t=0;t<100;t++){let n=t===0?``:` ${t+1}`;if(e===`file`){let e=`${r}Untitled${n}${D}`;if(!i.has(e))return{addPath:e,renamePath:e};continue}let a=`${r}New Folder${n}/`;if(!i.has(a))return{addPath:a,renamePath:a}}throw Error(`Could not allocate a unique tree placeholder`)}function J(e,t){return e===`file`?K(t,!1):`${P(t)}/index${D}`}function Y(e,t){return t.kind===`root`||t.directoryPath==null?Q(e):`${t.directoryPath}${Q(e)}`}function X(e,t){if(t)return P(F(e));let n=A(e),r=n.lastIndexOf(`/`);return r===-1?``:n.slice(0,r)}function Z(e,t){let n=P(F(e));return n?`${n}/${t}`:t}function ie(e,t,n){e.append(`parentDocName`,Z(t,n)),e.append(`placement`,`parent-dir`)}function ae(e,t){return(t.path??Z(e,t.src)).replace(/^\/+/,``)}function oe(e){let t=e.dataTransfer?.types;if(!t)return!1;let n=Array.from(t);return n.includes(`Files`)&&!n.includes(`application/x-open-knowledge-sidebar-item+json`)}function se(e){return Array.from(e.dataTransfer?.files??[]).filter(e=>e.name.length>0||e.size>0)}function ce(e,t){let n=a(e).toLowerCase();if(n===``)return null;let r=new Date().toISOString();if(n===`.md`||n===`.mdx`)return{kind:`document`,docName:A(e),docExt:n,modified:r,size:t.size};let o=n.startsWith(`.`)?n.slice(1):n;return{kind:`asset`,path:e,assetExt:o,mediaKind:i(o),modified:r,size:t.size}}function Q(e){let t=$(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function $(e){return e.endsWith(`/`)?e.slice(0,-1):e}export{_ as A,R as C,h as D,E,v as O,W as S,ae as T,G as _,J as a,A as b,L as c,M as d,se as f,X as g,K as h,Y as i,y as k,z as l,oe as m,B as n,q as o,F as p,V as r,k as s,ie as t,ce as u,H as v,I as w,j as x,P as y};
1
+ import{s as e}from"./chunk-Bj-mKKzh.js";import{n as t,t as n}from"./compiler-runtime-B6sxACDP.js";import{la as r,ua as i}from"./dist-CT-B-J5Q.js";import{t as a}from"./file-tree-rename-validation-DgUQ0I0S.js";import{b as o,i as s,x as c,y as l}from"./navigation-targets-Di2LrUzi.js";import{c as u,o as ee,s as d}from"./doc-hash-DXoWttRg.js";import{t as f}from"./use-apply-config-color-theme-yfrulrGN.js";var p=e(t(),1),m=n(),h=`application/x-open-knowledge-sidebar-item+json`,g={image:!0,video:!0,audio:!0,pdf:!0,text:!0,mermaid:!0};function _(e){return JSON.stringify(e)}function v(e){return e.kind===`folder`?{target:{kind:`folder`,target:e.folderPath,folderPath:e.folderPath},hash:u(e.folderPath)}:e.kind===`asset`?{target:{kind:`asset`,target:e.assetPath,assetPath:e.assetPath,mediaKind:e.mediaKind},hash:ee(e.assetPath)}:{target:s(e.docName,e.size)??{kind:`doc`,target:e.docName,docName:e.docName},hash:d(e.docName)}}function y(e){if(!e||!Array.from(e.types).includes(`application/x-open-knowledge-sidebar-item+json`))return null;let t=e.getData(h);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!b(n)||n.v!==1||typeof n.kind!=`string`)return null;if(n.kind===`doc`){if(typeof n.docName!=`string`||n.docName.length===0)return null;let e=n.size;return e!==null&&typeof e!=`number`?null:{v:1,kind:`doc`,docName:n.docName,size:e}}if(n.kind===`folder`)return typeof n.folderPath==`string`?{v:1,kind:`folder`,folderPath:n.folderPath}:null;if(n.kind===`asset`){if(typeof n.assetPath!=`string`||n.assetPath.length===0)return null;let e=n.mediaKind;return e!==null&&!x(e)?null:{v:1,kind:`asset`,assetPath:n.assetPath,mediaKind:e}}return null}function b(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function x(e){return typeof e==`string`&&Object.hasOwn(g,e)}var S={background:`#171717`,foreground:`#e5e5e5`,cursor:`#e5e5e5`,cursorAccent:`#171717`,selectionBackground:`#3a3d41`,black:`#000000`,red:`#cd3131`,green:`#0dbc79`,yellow:`#e5e510`,blue:`#2472c8`,magenta:`#bc3fbc`,cyan:`#11a8cd`,white:`#e5e5e5`,brightBlack:`#666666`,brightRed:`#f14c4c`,brightGreen:`#23d18b`,brightYellow:`#f5f543`,brightBlue:`#3b8eea`,brightMagenta:`#d670d6`,brightCyan:`#29b8db`,brightWhite:`#ffffff`},C={background:`#ffffff`,foreground:`#262626`,cursor:`#262626`,cursorAccent:`#ffffff`,selectionBackground:`#add6ff`,black:`#000000`,red:`#cd3131`,green:`#00bc00`,yellow:`#949800`,blue:`#0451a5`,magenta:`#bc05bc`,cyan:`#0598bc`,white:`#555555`,brightBlack:`#666666`,brightRed:`#cd3131`,brightGreen:`#14ce14`,brightYellow:`#b5ba00`,brightBlue:`#0451a5`,brightMagenta:`#bc05bc`,brightCyan:`#0598bc`,brightWhite:`#a5a5a5`};function w(e){return e===`dark`?S:C}function te(e){try{let t=document.createElement(`span`);t.style.display=`none`,t.style.backgroundColor=`var(${e})`,document.body.appendChild(t);try{let e=getComputedStyle(t).backgroundColor;return!e||e===`rgba(0, 0, 0, 0)`||e===`transparent`||e.includes(`var(`)?null:e}finally{t.remove()}}catch{return null}}function T(e,t=te){let n=w(e),r=t(`--background`)??n.background,i=t(`--foreground`)??n.foreground;return{...n,background:r,foreground:i,cursor:i,cursorAccent:r,selectionBackground:t(`--selection-soft`)??n.selectionBackground}}function ne(e,t){let n=new Set([...Object.keys(e),...Object.keys(t)]);for(let r of n)if(e[r]!==t[r])return!1;return!0}function E(e){let t=(0,m.c)(5),n;t[0]===e?n=t[1]:(n=()=>T(e),t[0]=e,t[1]=n);let[r,i]=(0,p.useState)(n),a,o;return t[2]===e?(a=t[3],o=t[4]):(a=()=>{let t=()=>{let t=T(e);i(e=>ne(e,t)?e:t)};t();let n=new MutationObserver(t);return n.observe(document.documentElement,{attributes:!0,attributeFilter:[f,`class`]}),n.observe(document.head,{childList:!0,subtree:!0,characterData:!0}),()=>n.disconnect()},o=[e],t[2]=e,t[3]=a,t[4]=o),(0,p.useEffect)(a,o),r}var D=`.md`,O=/\.(md|mdx)$/i;function k(e,t=D){return O.test(e)||r(e)?e:`${e}${t}`}function A(e){return $(e).replace(O,``)}function j(e,t){let n=$(e),r=t.find(e=>o(e)&&M(e)===n);if(r)return r.docName;let i=A(n);return t.find(e=>{let t=M(e);return t!==n&&O.test(t)&&A(t)===i})&&O.test(n)?n:i}function M(e){return c(e)?F(e.path):l(e)?e.path:k(e.docName,e.docExt)}function N(e){let t=$(e).match(O);return t?`.${t[1].toLowerCase()}`:void 0}function P(e){return $(e)}function F(e){let t=$(e.trim());return t?`${t}/`:``}function I(e){return e.endsWith(`/`)?P(e):A(e)}function L(e){return e.map(M)}function R(e){return[...e].sort().join(`\0`)}function z(e){return R(L(e))}function B(e,t={}){let n=new Set;for(let r of e){let e=(c(r)||l(r)?r.path:r.docName).split(`/`).filter(Boolean);if(!t.includeOkFolders&&e.includes(`.ok`))continue;if(c(r)){let e=F(r.path);e&&n.add(e)}let i=c(r)?e.length:e.length-1;for(let t=1;t<=i;t++)n.add(`${e.slice(0,t).join(`/`)}/`)}return[...n].sort()}function V(e){if(!e)return[];let t=$(e.replace(O,``)).split(`/`).filter(Boolean),n=[],r=e.endsWith(`/`)?t.length:t.length-1;for(let e=1;e<=r;e++)n.push(`${t.slice(0,e).join(`/`)}/`);return n}function re(e,t,n){let r=N(e);if(r)return r;let i=n.find(e=>o(e)&&e.docName===t);return i?i.docExt??D:Q(e).includes(`.`)?void 0:D}function H(e,t){let n=e.lastIndexOf(`/`),r=n===-1?``:e.slice(0,n+1),i=n===-1?e:e.slice(n+1),a=t.filter(e=>{if(!l(e)||!e.path.startsWith(r))return!1;let t=e.path.slice(r.length);return!t.includes(`/`)&&t.startsWith(`${i}.`)});return a.length===1?a[0].path:null}function U(e,t,n){if(N(e))return null;let r=n.find(e=>l(e)&&e.path===t);return r?r.path:Q(e).includes(`.`)?t:H(t,n)}function W(e,t){let n=e.kind===`directory`,r=n?P(e.path):j(e.path,t);if(n)return{kind:`folder`,name:$(Q(e.path)).replace(O,``),path:r,treePath:K(e.path,!0)};let i=U(e.path,r,t);if(i)return{kind:`asset`,name:$(Q(i)),path:i,treePath:i};let a=re(e.path,r,t);return{kind:`file`,name:$(Q(e.path)).replace(O,``),path:r,treePath:K(e.path,!1),docExt:a}}function G(e){return e.kind===`directory`?P(e.path):e.path}function K(e,t){return t?F(e):O.test(e)?e:`${e}${D}`}function q(e,t,n){let r=F(t),i=new Set(n);for(let t=0;t<100;t++){let n=t===0?``:` ${t+1}`;if(e===`file`){let e=`${r}Untitled${n}${D}`;if(!i.has(e))return{addPath:e,renamePath:e};continue}let a=`${r}New Folder${n}/`;if(!i.has(a))return{addPath:a,renamePath:a}}throw Error(`Could not allocate a unique tree placeholder`)}function J(e,t){return e===`file`?K(t,!1):`${P(t)}/index${D}`}function Y(e,t){return t.kind===`root`||t.directoryPath==null?Q(e):`${t.directoryPath}${Q(e)}`}function X(e,t){if(t)return P(F(e));let n=A(e),r=n.lastIndexOf(`/`);return r===-1?``:n.slice(0,r)}function Z(e,t){let n=P(F(e));return n?`${n}/${t}`:t}function ie(e,t,n){e.append(`parentDocName`,Z(t,n)),e.append(`placement`,`parent-dir`)}function ae(e,t){return(t.path??Z(e,t.src)).replace(/^\/+/,``)}function oe(e){let t=e.dataTransfer?.types;if(!t)return!1;let n=Array.from(t);return n.includes(`Files`)&&!n.includes(`application/x-open-knowledge-sidebar-item+json`)}function se(e){return Array.from(e.dataTransfer?.files??[]).filter(e=>e.name.length>0||e.size>0)}function ce(e,t){let n=a(e).toLowerCase();if(n===``)return null;let r=new Date().toISOString();if(n===`.md`||n===`.mdx`)return{kind:`document`,docName:A(e),docExt:n,modified:r,size:t.size};let o=n.startsWith(`.`)?n.slice(1):n;return{kind:`asset`,path:e,assetExt:o,mediaKind:i(o),modified:r,size:t.size}}function Q(e){let t=$(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function $(e){return e.endsWith(`/`)?e.slice(0,-1):e}export{_ as A,R as C,h as D,E,v as O,W as S,ae as T,G as _,J as a,A as b,L as c,M as d,se as f,X as g,K as h,Y as i,y as k,z as l,oe as m,B as n,q as o,F as p,V as r,k as s,ie as t,ce as u,H as v,I as w,j as x,P as y};
@@ -1 +1 @@
1
- import{T as e,d as t,l as n,s as r}from"./reduce-Bq13EGKJ.js";import{h as i,i as a,n as o}from"./_baseFor-By1DbjM-.js";import{t as s}from"./isSymbol-B1eMZgHp.js";function c(e,t){var r=-1,i=a(e)?Array(e.length):[];return n(e,function(e,n,a){i[++r]=t(e,n,a)}),i}function l(n,r){return(i(n)?e:c)(n,t(r,3))}function u(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],o=t(a);if(o!=null&&(c===void 0?o===o&&!s(o):n(o,c)))var c=o,l=a}return l}function d(e,t){return e<t}function f(e){return e&&e.length?u(e,o,d):void 0}function p(e){return e!=null&&e.length?r(e,1):[]}export{l as a,u as i,f as n,c as o,d as r,p as t};
1
+ import{T as e,d as t,l as n,s as r}from"./reduce-CyUHMkZH.js";import{h as i,i as a,n as o}from"./_baseFor-BN36PaKb.js";import{t as s}from"./isSymbol-Csv9XVWz.js";function c(e,t){var r=-1,i=a(e)?Array(e.length):[];return n(e,function(e,n,a){i[++r]=t(e,n,a)}),i}function l(n,r){return(i(n)?e:c)(n,t(r,3))}function u(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],o=t(a);if(o!=null&&(c===void 0?o===o&&!s(o):n(o,c)))var c=o,l=a}return l}function d(e,t){return e<t}function f(e){return e&&e.length?u(e,o,d):void 0}function p(e){return e!=null&&e.length?r(e,1):[]}export{l as a,u as i,f as n,c as o,d as r,p as t};
@@ -1,4 +1,4 @@
1
- import{n as e,r as t}from"./src-BViYu1Wd.js";import{B as n,C as r,U as i,V as a,W as o,Z as s,_ as c,a as l,b as u,nt as d,s as f,u as p,v as ee}from"./chunk-ICPOFSXX-DrWPpdBM.js";import{t as m}from"./channel-D5XfHPw9.js";import{C as h}from"./src-CSQC3Qr9.js";import{h as g,s as _}from"./chunk-5PVQY5BW-BwH_ti4z.js";import"./chunk-U2HBQHQK-Bx1RHKxc.js";import{t as te}from"./chunk-FMBD7UC4-BOsmCNHV.js";import"./chunk-BSJP7CBP-SKdXejJy.js";import"./chunk-ZZ45TVLE-003_vpT6.js";import{t as ne}from"./chunk-YZCP3GAM-CiRF2C0i.js";import{t as re}from"./chunk-55IACEB6-DTK73H5l.js";import{t as v}from"./chunk-EDXVE4YY-CR8P_5d9.js";import"./chunk-X2U36JSP-CSuA8p4I.js";import{o as y}from"./chunk-5FUZZQ4R-Bnr_Foe2.js";import"./chunk-ENJZ2VHE-Dk4r_2N4.js";import{r as b,t as x}from"./chunk-336JU56O-DFEiQdL3.js";import{n as S,t as C}from"./chunk-XPW4576I-C22VyCuW.js";var w=`flowchart-`,T=class{constructor(){this.vertexCounter=0,this.config=u(),this.diagramId=``,this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=a,this.setAccDescription=n,this.setDiagramTitle=o,this.getAccTitle=ee,this.getAccDescription=c,this.getDiagramTitle=r,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen(`gen-2`)}static{e(this,`FlowDB`)}sanitizeText(e){return f.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case`markdown`:case`string`:case`text`:return e;default:return`markdown`}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let t of this.vertices.values())if(t.id===e)return this.diagramId?`${this.diagramId}-${t.domId}`:t.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,n,r,i,a,o,s={},c){if(!e||e.trim().length===0)return;let l;if(c!==void 0){let e;e=c.includes(`
1
+ import{n as e,r as t}from"./src-MPCDFn03.js";import{B as n,C as r,U as i,V as a,W as o,Z as s,_ as c,a as l,b as u,nt as d,s as f,u as p,v as ee}from"./chunk-ICPOFSXX-Lfk6ZyEQ.js";import{t as m}from"./channel-1647Teii.js";import{C as h}from"./src-D68V8cNU.js";import{h as g,s as _}from"./chunk-5PVQY5BW-c5z1iYCm.js";import"./chunk-U2HBQHQK-u9S8o95F.js";import{t as te}from"./chunk-FMBD7UC4-DBRqk2AP.js";import"./chunk-BSJP7CBP-O-pJBrr0.js";import"./chunk-ZZ45TVLE-DhQl-h1P.js";import{t as ne}from"./chunk-YZCP3GAM-C5DYVTut.js";import{t as re}from"./chunk-55IACEB6--gETN8Fg.js";import{t as v}from"./chunk-EDXVE4YY-BG01O3ZU.js";import"./chunk-X2U36JSP-SSsGg9yt.js";import{o as y}from"./chunk-5FUZZQ4R-CiLbimSt.js";import"./chunk-ENJZ2VHE-CWfe3b4S.js";import{r as b,t as x}from"./chunk-336JU56O-DHb7NgDk.js";import{n as S,t as C}from"./chunk-XPW4576I-HqP_b0tj.js";var w=`flowchart-`,T=class{constructor(){this.vertexCounter=0,this.config=u(),this.diagramId=``,this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=a,this.setAccDescription=n,this.setDiagramTitle=o,this.getAccTitle=ee,this.getAccDescription=c,this.getDiagramTitle=r,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen(`gen-2`)}static{e(this,`FlowDB`)}sanitizeText(e){return f.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case`markdown`:case`string`:case`text`:return e;default:return`markdown`}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let t of this.vertices.values())if(t.id===e)return this.diagramId?`${this.diagramId}-${t.domId}`:t.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,n,r,i,a,o,s={},c){if(!e||e.trim().length===0)return;let l;if(c!==void 0){let e;e=c.includes(`
2
2
  `)?c+`
3
3
  `:`{
4
4
  `+c+`