@inkeep/open-knowledge 0.25.0-beta.10 → 0.25.0-beta.3

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 (360) hide show
  1. package/dist/alias-JE7RI5QX-DmHh8yog.mjs +1 -0
  2. package/dist/{architectureDiagram-Q4EWVU46-Dwlx8W7J.mjs → architectureDiagram-Q4EWVU46-C9cSuC8m.mjs} +2 -2
  3. package/dist/assets/skills/discovery/SKILL.md +1 -1
  4. package/dist/assets/skills/project/SKILL.md +1 -1
  5. package/dist/awk2-POPGKRAI-C7696e-z.mjs +1 -0
  6. package/dist/base64-4YMZCVJ5-BIHNwDj2.mjs +1 -0
  7. package/dist/basename-AA2KJYZQ-Dcz4Ls85.mjs +1 -0
  8. package/dist/bash-IJWYRKFO-DgruzS3i.mjs +1 -0
  9. package/dist/{blockDiagram-DXYQGD6D-D_l7RLVS.mjs → blockDiagram-DXYQGD6D-Dr7L7QsL.mjs} +2 -2
  10. package/dist/{build-CCNlCFyu.mjs → build-CN003PPg.mjs} +1 -1
  11. package/dist/build-Ca40rJCO.mjs +1 -0
  12. package/dist/{c4Diagram-AHTNJAMY-QadWjRVL.mjs → c4Diagram-AHTNJAMY-CPm6kKNR.mjs} +2 -2
  13. package/dist/cat-RDUMLXKC-BJJIS9lB.mjs +1 -0
  14. package/dist/channel-DE79NHCf.mjs +2 -0
  15. package/dist/chmod-SYMGL4JA-C1Ie7s0s.mjs +1 -0
  16. package/dist/{chokidar-D1eNAlbX.mjs → chokidar-oNPiNLWX.mjs} +3 -3
  17. package/dist/{chunk-24IMIIXA-BoP5OA93.mjs → chunk-24IMIIXA-DaS5XS55.mjs} +2 -2
  18. package/dist/{chunk-336JU56O-5giJrfiv.mjs → chunk-336JU56O-KTMEs5Wk.mjs} +2 -2
  19. package/dist/{chunk-3THT3N7L-CBWmNncQ.mjs → chunk-3THT3N7L-B1WzJUh4.mjs} +1 -1
  20. package/dist/{chunk-426QAEUC-BGn1TCpd.mjs → chunk-426QAEUC-DUpKwtVu.mjs} +2 -2
  21. package/dist/{chunk-44UOCSGV-B6GSHp1s.mjs → chunk-44UOCSGV-BZ6LfyW2.mjs} +1 -1
  22. package/dist/{chunk-4TB4RGXK-DWREoP49.mjs → chunk-4TB4RGXK-Ct6WjPoY.mjs} +2 -2
  23. package/dist/{chunk-5FUZZQ4R-DFR5eSi-.mjs → chunk-5FUZZQ4R-Bf6nbyQG.mjs} +2 -2
  24. package/dist/{chunk-5PVQY5BW-C5V4E1lO.mjs → chunk-5PVQY5BW-DUXm3tDu.mjs} +2 -2
  25. package/dist/{chunk-5QMZ5MUS-_0tQyQsf.mjs → chunk-5QMZ5MUS-BwpNU33k.mjs} +2 -2
  26. package/dist/{chunk-62RKD26F-K5NW6_Si.mjs → chunk-62RKD26F-DebCAz0V.mjs} +2 -2
  27. package/dist/{chunk-A4JSPFCI-BA544Kdp.mjs → chunk-A4JSPFCI-CQJoYugB.mjs} +2 -2
  28. package/dist/{chunk-A5O5YHGN-Kbs3GRxW.mjs → chunk-A5O5YHGN-DApqA6Ow.mjs} +2 -2
  29. package/dist/{chunk-BBXLRYSX-OVlWa2B-.mjs → chunk-BBXLRYSX-XWD4jM9A.mjs} +2 -2
  30. package/dist/{chunk-BRGMQKJV-DtyxDw61.mjs → chunk-BRGMQKJV-CZUkYGAZ.mjs} +3 -3
  31. package/dist/{chunk-CR5AFCPT-BD_awIEP.mjs → chunk-CR5AFCPT-DN7EAdus.mjs} +2 -2
  32. package/dist/{chunk-CWQS3NFK-DNm_iIwd.mjs → chunk-CWQS3NFK-BkE4vqrf.mjs} +1 -1
  33. package/dist/{chunk-D6CWQ5DW-CaV8X9is.mjs → chunk-D6CWQ5DW-CF9bBHyK.mjs} +2 -2
  34. package/dist/{chunk-DXB73IDG-Bx-Ikbnu.mjs → chunk-DXB73IDG-F_tmy-Lz.mjs} +1 -1
  35. package/dist/{chunk-EDXVE4YY-B_wA-KGy.mjs → chunk-EDXVE4YY-CI4s3JHP.mjs} +2 -2
  36. package/dist/{chunk-ENJZ2VHE-DwiyImt2.mjs → chunk-ENJZ2VHE-CQwjtY5A.mjs} +2 -2
  37. package/dist/{chunk-F55TLFGB-AEzanSfe.mjs → chunk-F55TLFGB-BZSRX-Vi.mjs} +2 -2
  38. package/dist/{chunk-FEIOJCZD-D6YUa1Xl.mjs → chunk-FEIOJCZD-NzTooVTc.mjs} +2 -2
  39. package/dist/{chunk-GFQRA5P5-DigWkxW2.mjs → chunk-GFQRA5P5-DbAN9IDm.mjs} +1 -1
  40. package/dist/{chunk-GOV5EKKI-x0jEbztj.mjs → chunk-GOV5EKKI-CDGzZWfT.mjs} +2 -2
  41. package/dist/{chunk-HWBSOZZR-DaPTwPxK.mjs → chunk-HWBSOZZR-DQTTl_pa.mjs} +3 -3
  42. package/dist/{chunk-I57KEIP3-DpiJySG6.mjs → chunk-I57KEIP3-DSoF8c_0.mjs} +2 -2
  43. package/dist/{chunk-ICPOFSXX-D0MVsm4H.mjs → chunk-ICPOFSXX-C--tVIY5.mjs} +2 -2
  44. package/dist/{chunk-IPJHKYVM-DlQCOz2c.mjs → chunk-IPJHKYVM-CUKythEA.mjs} +1 -1
  45. package/dist/{chunk-J642UCRS-C1PS8Hwf.mjs → chunk-J642UCRS-HjD8qpZD.mjs} +2 -2
  46. package/dist/{chunk-LPQPILI2-GOcK96AE.mjs → chunk-LPQPILI2-OoVL_l9j.mjs} +2 -2
  47. package/dist/{chunk-MDDMCKUK-CuQlmIio.mjs → chunk-MDDMCKUK-ChL1CU4m.mjs} +2 -2
  48. package/dist/{chunk-MIZPJHVH-Bo1j-3C3.mjs → chunk-MIZPJHVH-BD7tHmLL.mjs} +2 -2
  49. package/dist/{chunk-MLXIYONF-DRuy-_4a.mjs → chunk-MLXIYONF-CV7WHBm-.mjs} +2 -2
  50. package/dist/{chunk-NAERJDUW-0UrOIQ6q.mjs → chunk-NAERJDUW-Cyg2DAzO.mjs} +2 -2
  51. package/dist/{chunk-NUYSJFDK-BvwS54ju.mjs → chunk-NUYSJFDK-BH2DjyxF.mjs} +2 -2
  52. package/dist/{chunk-NYQYO467-KfHLMnUW.mjs → chunk-NYQYO467-CY88QCuT.mjs} +2 -2
  53. package/dist/{chunk-OARHFVLG-Csb_cJVS.mjs → chunk-OARHFVLG-dXiYYC4o.mjs} +2 -2
  54. package/dist/{chunk-OCLXQMOG-CCPg8vjW.mjs → chunk-OCLXQMOG-DOkdFgyf.mjs} +2 -2
  55. package/dist/{chunk-OCS6LSEM-DkbaohJu.mjs → chunk-OCS6LSEM-Bcx6uxmm.mjs} +2 -2
  56. package/dist/{chunk-OJDRYQWQ-LGuZyK6R.mjs → chunk-OJDRYQWQ-CmrD0Dg2.mjs} +1 -1
  57. package/dist/{chunk-OL3S66CO-CBdL6pp1.mjs → chunk-OL3S66CO-CWEDi2F_.mjs} +2 -2
  58. package/dist/{chunk-OYMX7WX6-BrOfVMt8.mjs → chunk-OYMX7WX6-Dvg98Zb-.mjs} +2 -2
  59. package/dist/{chunk-PBXLG62G-C7MEQojr.mjs → chunk-PBXLG62G-CpvczNyQ.mjs} +2 -2
  60. package/dist/{chunk-R6VWJ2ZL-XKIhMSUi.mjs → chunk-R6VWJ2ZL-BVeTwIsz.mjs} +1 -1
  61. package/dist/{chunk-SYMJJMQ4-DUF5hY-A.mjs → chunk-SYMJJMQ4-jdmKoBFb.mjs} +2 -2
  62. package/dist/{chunk-T56QNPHK-B6DfVzfs.mjs → chunk-T56QNPHK-DmDxJbbD.mjs} +2 -2
  63. package/dist/{chunk-TLSUDHID-SuIGgADo.mjs → chunk-TLSUDHID-CSDR438C.mjs} +2 -2
  64. package/dist/{chunk-TOMNU26N-Dw9Enq1O.mjs → chunk-TOMNU26N-CrDa7MpH.mjs} +2 -2
  65. package/dist/{chunk-U2HBQHQK-DB1SzWgs.mjs → chunk-U2HBQHQK-C1Q2DiEX.mjs} +2 -2
  66. package/dist/{chunk-UNYNJIFU-HSzsM3a6.mjs → chunk-UNYNJIFU-CZ2Mla0s.mjs} +3 -3
  67. package/dist/{chunk-VLGZJRPG-CHtdu0KZ.mjs → chunk-VLGZJRPG-DpYP_EVp.mjs} +2 -2
  68. package/dist/{chunk-X2U36JSP-CqOGcGN3.mjs → chunk-X2U36JSP-BiF0R9ys.mjs} +2 -2
  69. package/dist/{chunk-XHM67O4N-2lBQUjKO.mjs → chunk-XHM67O4N-D3pxE_Og.mjs} +1 -1
  70. package/dist/{chunk-XORM457F-CJbQLVgU.mjs → chunk-XORM457F-BuPOSqOe.mjs} +2 -2
  71. package/dist/{chunk-YCFVLTST-CKzPj8PR.mjs → chunk-YCFVLTST-DsF45PbT.mjs} +2 -2
  72. package/dist/{chunk-YFG2CMIF-DBRGs_rZ.mjs → chunk-YFG2CMIF-DjdwxBNc.mjs} +2 -2
  73. package/dist/{chunk-YNYSPYQ5-DHter9G3.mjs → chunk-YNYSPYQ5-gU4-j5DO.mjs} +1 -1
  74. package/dist/{chunk-YS3AZT3J-DwQ3GyQR.mjs → chunk-YS3AZT3J-CB0wWPLc.mjs} +2 -2
  75. package/dist/{chunk-YTNYSM6T-DcovOiF_.mjs → chunk-YTNYSM6T-DpkSVTln.mjs} +2 -2
  76. package/dist/{chunk-YZCP3GAM-CkC6DoBJ.mjs → chunk-YZCP3GAM-DRdMIQsB.mjs} +2 -2
  77. package/dist/{chunk-Z6LRHWXI-BLaYoFnT.mjs → chunk-Z6LRHWXI-EsbeaQ3V.mjs} +2 -2
  78. package/dist/{chunk-ZZ45TVLE-CXznFlWR.mjs → chunk-ZZ45TVLE-DwKS4e_N.mjs} +2 -2
  79. package/dist/classDiagram-6PBFFD2Q-BrpY9pLd.mjs +2 -0
  80. package/dist/classDiagram-v2-HSJHXN6E-DDV6mz7Y.mjs +2 -0
  81. package/dist/clear-5CZ5X4YR-CHSnzs8i.mjs +1 -0
  82. package/dist/cli.mjs +59 -71
  83. package/dist/clone-BD_JFVST.mjs +2 -0
  84. package/dist/column-WLPMMSTS-DTBoovzp.mjs +1 -0
  85. package/dist/comm-5SLSESQG-DT3SY7zS.mjs +1 -0
  86. package/dist/constants-B43V8fIN.mjs +2 -0
  87. package/dist/cp-XOYR4ABJ-Bs6Rpbb2.mjs +1 -0
  88. package/dist/{curl-47BFPSFW-ClMENMWY.mjs → curl-47BFPSFW-xgS5bDTx.mjs} +2 -2
  89. package/dist/cut-OPC3VAGB-Bm1HBn07.mjs +1 -0
  90. package/dist/{dagre-KV5264BT-C5SrnhX7.mjs → dagre-KV5264BT-Ci7CcQr4.mjs} +2 -2
  91. package/dist/{dagre-LJG-5J7U.mjs → dagre-L3rg9n9q.mjs} +2 -2
  92. package/dist/date-DD7FVA2V-Dv3os04S.mjs +1 -0
  93. package/dist/{diagram-5BDNPKRD-biBuhEzo.mjs → diagram-5BDNPKRD-BM3C88Zx.mjs} +2 -2
  94. package/dist/{diagram-G4DWMVQ6-CHhS5h96.mjs → diagram-G4DWMVQ6-Dt1Kt-mj.mjs} +2 -2
  95. package/dist/{diagram-MMDJMWI5-BgulNwvp.mjs → diagram-MMDJMWI5-DomPsk0L.mjs} +2 -2
  96. package/dist/{diagram-TYMM5635-DpmgERPD.mjs → diagram-TYMM5635-eOfCqwhs.mjs} +2 -2
  97. package/dist/diff-HJF2MPDN-Di-oK2tx.mjs +1 -0
  98. package/dist/dirname-LEMTZZFS-D-u8wJ0b.mjs +1 -0
  99. package/dist/{dist-H-OAf-7x.mjs → dist-CMJUtzX1.mjs} +1 -1
  100. package/dist/{dist-DyW0okj3.mjs → dist-CWHBXHzy.mjs} +16 -16
  101. package/dist/du-WO2ENHXQ-CO_jR0w6.mjs +1 -0
  102. package/dist/echo-O45JWWI2-RBT2dq5Y.mjs +1 -0
  103. package/dist/env-5EPCWSXR-DSwwgRF5.mjs +1 -0
  104. package/dist/{erDiagram-SMLLAGMA-BNISHenz.mjs → erDiagram-SMLLAGMA-CPcwhEue.mjs} +2 -2
  105. package/dist/{esm-CsQUg9js.mjs → esm-BLMtE3s6.mjs} +1 -1
  106. package/dist/{esm-BQ4-CT8p.mjs → esm-BS2W3Uzl.mjs} +1 -1
  107. package/dist/expand-DTNXU4LQ-CtzV8vlq.mjs +1 -0
  108. package/dist/expansion-ENLSRCXJ-CNi8PTVy.mjs +1 -0
  109. package/dist/expr-5T3UU5KE-BOXtVHu2.mjs +1 -0
  110. package/dist/file-ZIGAJ4YS-Bt-1Wusv.mjs +1 -0
  111. package/dist/find-TPUOAIUQ-CJd25AiD.mjs +1 -0
  112. package/dist/{flag-coverage-QT4N2Z44-BlPYKPtd.mjs → flag-coverage-QT4N2Z44-hqAAghSo.mjs} +2 -2
  113. package/dist/{flowDiagram-DWJPFMVM-CFu645eN.mjs → flowDiagram-DWJPFMVM-WnIxEgSt.mjs} +2 -2
  114. package/dist/fold-LDSORVYE-DZ2L21IZ.mjs +1 -0
  115. package/dist/{ganttDiagram-T4ZO3ILL-DhKUbpmR.mjs → ganttDiagram-T4ZO3ILL-BJEuIZ2X.mjs} +2 -2
  116. package/dist/{getMachineId-bsd-DC8LkcdK.mjs → getMachineId-bsd-B7ue3N1o.mjs} +2 -2
  117. package/dist/{getMachineId-bsd-Bt-frlcx.mjs → getMachineId-bsd-DYQqYqxN.mjs} +2 -2
  118. package/dist/{getMachineId-bsd-DFsE-K5i.mjs → getMachineId-bsd-ucL-2FoT.mjs} +2 -2
  119. package/dist/{getMachineId-darwin-B9GQUU0e.mjs → getMachineId-darwin-BNCkZc-0.mjs} +2 -2
  120. package/dist/{getMachineId-darwin-DMNBrKWp.mjs → getMachineId-darwin-CSTYV_Bd.mjs} +2 -2
  121. package/dist/{getMachineId-darwin-DRxpszyZ.mjs → getMachineId-darwin-DWmBOUuk.mjs} +2 -2
  122. package/dist/{getMachineId-linux-D9dNX75P.mjs → getMachineId-linux-BaNp1ZEm.mjs} +2 -2
  123. package/dist/{getMachineId-linux-DOv7iOg-.mjs → getMachineId-linux-Bv6oOXxT.mjs} +2 -2
  124. package/dist/{getMachineId-linux-B5vQV4C7.mjs → getMachineId-linux-tTgUzx-Z.mjs} +2 -2
  125. package/dist/{getMachineId-unsupported-D6sWFm_K.mjs → getMachineId-unsupported-Kf9p6LJQ.mjs} +2 -2
  126. package/dist/{getMachineId-unsupported-DdAD6gRb.mjs → getMachineId-unsupported-fh_7WYkB.mjs} +2 -2
  127. package/dist/{getMachineId-unsupported-BQ6KY9w-.mjs → getMachineId-unsupported-iDvWGFBk.mjs} +2 -2
  128. package/dist/{getMachineId-win-BZsHRo32.mjs → getMachineId-win-Bo1_B38N.mjs} +2 -2
  129. package/dist/{getMachineId-win-CpDtoa22.mjs → getMachineId-win-DHmdubaR.mjs} +2 -2
  130. package/dist/{getMachineId-win-BMQSc3Xj.mjs → getMachineId-win-DQ2s9Z1n.mjs} +2 -2
  131. package/dist/{gh-detect-Ck0zE5NU.mjs → gh-detect-BIaONQmT.mjs} +3 -3
  132. package/dist/{git-handle-DY9lXoT3-CfssnuIB.mjs → git-handle-DY9lXoT3-Cmzgvwd8.mjs} +4 -4
  133. package/dist/git-handle-DdgvPBh6-Dv4DjLoy.mjs +1 -0
  134. package/dist/{gitGraphDiagram-UUTBAWPF-Cwemn6Ch.mjs → gitGraphDiagram-UUTBAWPF-BqA8KMTw.mjs} +2 -2
  135. package/dist/{graphlib-5CpUx0Yq.mjs → graphlib-BI4uS4Lx.mjs} +2 -2
  136. package/dist/grep-3AIAIJVR-CzG01gPs.mjs +1 -0
  137. package/dist/gzip-AQXSGOVS-B_BV2fa3.mjs +1 -0
  138. package/dist/head-HT2B6D2J-CjBr6WQ1.mjs +1 -0
  139. package/dist/help-VVWX7SA5-C4HsVKec.mjs +1 -0
  140. package/dist/history-J4QRNGRO-1CYG7cs0.mjs +1 -0
  141. package/dist/hostname-BK6HG2DE-BLS00ZWn.mjs +1 -0
  142. package/dist/html-to-markdown-TFCECAGV-5Fopg2Q5.mjs +1 -0
  143. package/dist/index.d.mts +1 -40
  144. package/dist/index.mjs +1 -1
  145. package/dist/{infoDiagram-42DDH7IO-D0XeM9Mm.mjs → infoDiagram-42DDH7IO-0lM1lRCH.mjs} +2 -2
  146. package/dist/init-CTGKTybp.mjs +1 -0
  147. package/dist/init-VRZmGeiJ.mjs +317 -0
  148. package/dist/{ishikawaDiagram-UXIWVN3A-vTBTHzHj.mjs → ishikawaDiagram-UXIWVN3A-j-jlqjJX.mjs} +2 -2
  149. package/dist/join-GG2LDHE5-C_A2RnwJ.mjs +1 -0
  150. package/dist/{journeyDiagram-VCZTEJTY-Dq1fLo6N.mjs → journeyDiagram-VCZTEJTY-BDX_OcrR.mjs} +2 -2
  151. package/dist/jq-ODXZBPLY-hdWY1RUY.mjs +1 -0
  152. package/dist/{js-exec-M6UR76J5-ZESSNIAK.mjs → js-exec-M6UR76J5-Cu6NIWHE.mjs} +2 -2
  153. package/dist/{kanban-definition-6JOO6SKY-B03_bODj.mjs → kanban-definition-6JOO6SKY-C5XJUD3U.mjs} +2 -2
  154. package/dist/{katex-Bif7Db7V.mjs → katex-DEJL_MaU.mjs} +1 -1
  155. package/dist/{lib-CCQO9uWA.mjs → lib-CItGM3rN.mjs} +2 -2
  156. package/dist/{libesm-_Wi8iuGI.mjs → libesm-Ob3yvbRV.mjs} +1 -1
  157. package/dist/{line-C62ka-l9.mjs → line-C6RZPh4T.mjs} +2 -2
  158. package/dist/ln-4TRFBYAT-CMm4PFgi.mjs +1 -0
  159. package/dist/loader-CU_qX_as.mjs +1 -0
  160. package/dist/{loader-Z9weMUfL.mjs → loader-Ccwo98t7.mjs} +3 -3
  161. package/dist/ls-KSXFZCWH-Beyjypib.mjs +1 -0
  162. package/dist/{lzma-BSEvzrCT.mjs → lzma-DBkyKSY9.mjs} +2 -2
  163. package/dist/md5sum-INMIK4DX-C2RH1Ljb.mjs +1 -0
  164. package/dist/{mermaid.core-LrO0u_wA.mjs → mermaid.core-CcmmzbTt.mjs} +3 -3
  165. package/dist/{mindmap-definition-QFDTVHPH-b0aFdJAS.mjs → mindmap-definition-QFDTVHPH-WLdthwDy.mjs} +2 -2
  166. package/dist/mkdir-TDEMSB6C-BeLs_C7x.mjs +1 -0
  167. package/dist/mv-Z6MORUFL-BDAoI0Wd.mjs +1 -0
  168. package/dist/nl-U5YJDM32-SP99R3HJ.mjs +1 -0
  169. package/dist/od-VJEF2UR5-BR0Ho1t5.mjs +1 -0
  170. package/dist/paste-7N6AFSDS-Bz3kd4hU.mjs +1 -0
  171. package/dist/{pieDiagram-DEJITSTG-C77h8TOO.mjs → pieDiagram-DEJITSTG-7oeIAT-R.mjs} +2 -2
  172. package/dist/preview-CekBtuZU.mjs +1 -0
  173. package/dist/{preview-DlyUih8P.mjs → preview-DTcYw4sX.mjs} +2 -2
  174. package/dist/printf-CX64KX2P-GrZNCK4M.mjs +1 -0
  175. package/dist/public/assets/{ActivityModeContent-QvRIx_do.js → ActivityModeContent-CNxdYTCc.js} +1 -1
  176. package/dist/public/assets/{DocumentContext-zL3ZbwDo.js → DocumentContext-bNGvFuJS.js} +1 -1
  177. package/dist/public/assets/{GraphPanel-DiyMfzQg.js → GraphPanel-D5yxV_ez.js} +1 -1
  178. package/dist/public/assets/{ManagedArtifactProperties-OxkUY14x.js → ManagedArtifactProperties-CRYWYGK4.js} +1 -1
  179. package/dist/public/assets/McpConsentDialogBody-Dr_AIi2H.js +1 -0
  180. package/dist/public/assets/{PropertyPanel-D9A27c2E.js → PropertyPanel-DgbQo3wG.js} +1 -1
  181. package/dist/public/assets/{SettingsDialogBody-cotnwVMw.js → SettingsDialogBody-CU-nEwde.js} +1 -1
  182. package/dist/public/assets/{SkillEditorActions-BsGotb40.js → SkillEditorActions-Bfh-iuK_.js} +1 -1
  183. package/dist/public/assets/{SourceEditor-BZ3cbLjs.js → SourceEditor-CAUoNOTU.js} +1 -1
  184. package/dist/public/assets/{TerminalPanel-XlICQw5o.js → TerminalPanel-Ds-ev2-D.js} +1 -1
  185. package/dist/public/assets/{config-validation-events-yB2QWKKJ.js → config-validation-events-DiOTHiAz.js} +1 -1
  186. package/dist/public/assets/{dist-BRGUidv4.js → dist-GmorMgHF.js} +6 -8
  187. package/dist/public/assets/{documents-events-DA8Q5ICz.js → documents-events-CSQluyCM.js} +1 -1
  188. package/dist/public/assets/{file-tree-adapter-CP3Xa3us.js → file-tree-adapter-TDYabCI-.js} +1 -1
  189. package/dist/public/assets/{index-CzFOYplh.js → index-BeB8EEj0.js} +93 -93
  190. package/dist/public/assets/index-hY8weMMg.css +1 -0
  191. package/dist/public/assets/{keyboard-shortcuts-DOkzBlgc.js → keyboard-shortcuts-CZysvuV8.js} +1 -1
  192. package/dist/public/assets/{navigation-targets-DNRja8Z0.js → navigation-targets-CXdtVjj4.js} +1 -1
  193. package/dist/public/assets/{open-managed-artifact-tab-DBkxdYp_.js → open-managed-artifact-tab-CvsZjaW-.js} +1 -1
  194. package/dist/public/assets/{prop-types-C-aZftyS.js → prop-types-C_2IQGCC.js} +1 -1
  195. package/dist/public/assets/{selection-context-vh0MmCBb.js → selection-context-B6kAEK37.js} +1 -1
  196. package/dist/public/assets/{skill-actions-Sc4IN52j.js → skill-actions-CPoGr_7b.js} +1 -1
  197. package/dist/public/assets/{skills-api-ts3L80AV.js → skills-api-mcV6MiPo.js} +1 -1
  198. package/dist/public/assets/{target-navigation-intent-CIKQ1Hj-.js → target-navigation-intent-C4nLupIH.js} +1 -1
  199. package/dist/public/assets/{typing-burst-detector-BT98lJOb.js → typing-burst-detector-DEl5qeGr.js} +1 -1
  200. package/dist/public/index.html +17 -17
  201. package/dist/pwd-D4OZ7N27-DDRhZsId.mjs +1 -0
  202. package/dist/{python3-AUFTPCU6-B7_jrPM3.mjs → python3-AUFTPCU6-DmPp1QHj.mjs} +2 -2
  203. package/dist/{quadrantDiagram-34T5L4WZ-CLL-GTlz.mjs → quadrantDiagram-34T5L4WZ-DWVBhb1E.mjs} +2 -2
  204. package/dist/readlink-MI4GCHJF-mNeJ3km7.mjs +1 -0
  205. package/dist/{repair-launch-json-DgKo_ct3.mjs → repair-launch-json-CQi2Gb_O.mjs} +2 -2
  206. package/dist/repair-mcp-configs-C_aVjx-w.mjs +2 -0
  207. package/dist/repair-skills-BFe09bLm.mjs +1 -0
  208. package/dist/repair-skills-xrYOvyVd.mjs +3 -0
  209. package/dist/{requirementDiagram-MS252O5E-JIzm76n0.mjs → requirementDiagram-MS252O5E-Bneel37I.mjs} +2 -2
  210. package/dist/rev-XOSYPP45-KAKdorsx.mjs +1 -0
  211. package/dist/rg-FOQSCCX3-BWOdKDEd.mjs +1 -0
  212. package/dist/rm-RTZG23RL-D4Xj3X_m.mjs +1 -0
  213. package/dist/rmdir-XTQXT7RK-Bx-u3U5l.mjs +1 -0
  214. package/dist/{sankeyDiagram-XADWPNL6-Bpk8eTPe.mjs → sankeyDiagram-XADWPNL6-4f2f9-uf.mjs} +2 -2
  215. package/dist/sed-VFTTATXJ-DmL_7Y-J.mjs +1 -0
  216. package/dist/seq-RN5ZUASB-DeaNEJEM.mjs +1 -0
  217. package/dist/{sequenceDiagram-FGHM5R23-CHCigzvZ.mjs → sequenceDiagram-FGHM5R23-B1K4VtLp.mjs} +2 -2
  218. package/dist/server-lock-8Lv6A-Xa-B4jggKdG.mjs +1 -0
  219. package/dist/{server-lock-CN2YHwpP-BYuwTc93.mjs → server-lock-CN2YHwpP-Cwa4llpq.mjs} +73 -73
  220. package/dist/sha1sum-VJPNLNU6-DYUNX0rt.mjs +1 -0
  221. package/dist/sha256sum-PI32XWXY-BwDMGEnF.mjs +1 -0
  222. package/dist/sleep-VZFPZFWA-D3IG7CwN.mjs +1 -0
  223. package/dist/sort-DCNRDA7U-BfL8J8kf.mjs +1 -0
  224. package/dist/split-SITCSYCZ-Q5NIWguo.mjs +1 -0
  225. package/dist/sqlite3-56UMWEY3-DA8bw7DG.mjs +1 -0
  226. package/dist/src-B4ueRPSp.mjs +3 -0
  227. package/dist/start-2TGfkITh.mjs +3 -0
  228. package/dist/start-DzdUFQz6.mjs +1 -0
  229. package/dist/stat-BT5A227F-CYFqsI8W.mjs +1 -0
  230. package/dist/{stateDiagram-FHFEXIEX-CiIJxbDV.mjs → stateDiagram-FHFEXIEX-BREbMXiC.mjs} +2 -2
  231. package/dist/stateDiagram-v2-QKLJ7IA2-DQeH2s3K.mjs +2 -0
  232. package/dist/strings-7PLOGTPD-BLW4mXRs.mjs +1 -0
  233. package/dist/tac-SJGXQ4T2-BGR2Dq7O.mjs +1 -0
  234. package/dist/tail-S5ULNTJU-BOBd42y5.mjs +1 -0
  235. package/dist/tar-ANUBEFJY-DCUS8bvA.mjs +1 -0
  236. package/dist/tee-O7VXZDCO-Bg8MXC_K.mjs +1 -0
  237. package/dist/time-DEUO3QV2-CxVP9vXG.mjs +1 -0
  238. package/dist/{timeline-definition-GMOUNBTQ-BBhlpYO9.mjs → timeline-definition-GMOUNBTQ-Bd7XEw7o.mjs} +2 -2
  239. package/dist/timeout-VRKMCG72-CVG2Q30a.mjs +1 -0
  240. package/dist/touch-DX2IJOQ4-DmEja_Fu.mjs +1 -0
  241. package/dist/tr-2HXZRDSW-DWcyuCoi.mjs +1 -0
  242. package/dist/tree-LYXBS7DC-CFaeUWGI.mjs +1 -0
  243. package/dist/true-WHJNXCHG-CJH22fVg.mjs +1 -0
  244. package/dist/unexpand-RGTMIGZM-Uj1QzdPV.mjs +1 -0
  245. package/dist/uniq-SUNANL47-MRCnRrGo.mjs +1 -0
  246. package/dist/{vennDiagram-DHZGUBPP-CATweP9B.mjs → vennDiagram-DHZGUBPP-Bk-INjRY.mjs} +2 -2
  247. package/dist/{wardleyDiagram-NUSXRM2D-3qxY3I6a.mjs → wardleyDiagram-NUSXRM2D-DOD6wQla.mjs} +2 -2
  248. package/dist/wc-TQB3VNOX-JPk1lni-.mjs +1 -0
  249. package/dist/which-XZHEH76L-Cl63MOrV.mjs +1 -0
  250. package/dist/whoami-DGKU3D2X-CB3itqHE.mjs +1 -0
  251. package/dist/{wrapper-CGw3ogaz.mjs → wrapper-BZO_sIci.mjs} +1 -1
  252. package/dist/write-project-skill-CRxX-42S.mjs +12 -0
  253. package/dist/xan-BXDXYEIB-ZPqGVO90.mjs +1 -0
  254. package/dist/xan-view-ECQUO7AJ-C-WHEJiv.mjs +1 -0
  255. package/dist/xargs-I6EZUCYF-BvcSF5Y7.mjs +1 -0
  256. package/dist/{xychartDiagram-5P7HB3ND-BAWpa2N2.mjs → xychartDiagram-5P7HB3ND-B4AGYFQs.mjs} +2 -2
  257. package/dist/yazl-CQSNnbvt.mjs +1 -0
  258. package/dist/{yazl-DgCFuIuD.mjs → yazl-Docqgl6q.mjs} +1 -1
  259. package/dist/yq-MJMAR36V-_D_zdU3z.mjs +1 -0
  260. package/package.json +1 -1
  261. package/dist/alias-JE7RI5QX-DxvTrQH3.mjs +0 -1
  262. package/dist/awk2-POPGKRAI-6Q9HKhoL.mjs +0 -1
  263. package/dist/base64-4YMZCVJ5-bqN_UBX0.mjs +0 -1
  264. package/dist/basename-AA2KJYZQ-GWPOMupJ.mjs +0 -1
  265. package/dist/bash-IJWYRKFO-C7Yi9aK0.mjs +0 -1
  266. package/dist/build-gfyDk62R.mjs +0 -1
  267. package/dist/cat-RDUMLXKC-Cqi4_PjZ.mjs +0 -1
  268. package/dist/channel-Dq8ADXfq.mjs +0 -2
  269. package/dist/chmod-SYMGL4JA-C_dD-tNl.mjs +0 -1
  270. package/dist/classDiagram-6PBFFD2Q-cIblqhKe.mjs +0 -2
  271. package/dist/classDiagram-v2-HSJHXN6E-CnZ_g-6O.mjs +0 -2
  272. package/dist/clear-5CZ5X4YR-C4DTv-gF.mjs +0 -1
  273. package/dist/clone-s6xjJkoz.mjs +0 -2
  274. package/dist/column-WLPMMSTS-Bg1ZsVDm.mjs +0 -1
  275. package/dist/comm-5SLSESQG-CTh1BUfn.mjs +0 -1
  276. package/dist/constants-m4f9Gwpu.mjs +0 -2
  277. package/dist/cp-XOYR4ABJ-VqiK1WcH.mjs +0 -1
  278. package/dist/cut-OPC3VAGB-BDAM8WY8.mjs +0 -1
  279. package/dist/date-DD7FVA2V-nDqDn5ZQ.mjs +0 -1
  280. package/dist/diff-HJF2MPDN-DSY9AfjL.mjs +0 -1
  281. package/dist/dirname-LEMTZZFS-VsUIxZwx.mjs +0 -1
  282. package/dist/du-WO2ENHXQ-Cq3dzRFU.mjs +0 -1
  283. package/dist/echo-O45JWWI2-B99ElfBo.mjs +0 -1
  284. package/dist/env-5EPCWSXR-CsaomJHQ.mjs +0 -1
  285. package/dist/expand-DTNXU4LQ-Bp3M0RnL.mjs +0 -1
  286. package/dist/expansion-ENLSRCXJ-C5xjxYTl.mjs +0 -1
  287. package/dist/expr-5T3UU5KE-DrJUreFq.mjs +0 -1
  288. package/dist/file-ZIGAJ4YS-D07ChhI1.mjs +0 -1
  289. package/dist/find-TPUOAIUQ-ZPOxwUwf.mjs +0 -1
  290. package/dist/fold-LDSORVYE-Bx5XDGgK.mjs +0 -1
  291. package/dist/git-handle-DdgvPBh6-C80s8fFN.mjs +0 -1
  292. package/dist/grep-3AIAIJVR-Bh6KBg6d.mjs +0 -1
  293. package/dist/gzip-AQXSGOVS-BtiMTiZG.mjs +0 -1
  294. package/dist/head-HT2B6D2J-DSAed845.mjs +0 -1
  295. package/dist/help-VVWX7SA5-DCBusWam.mjs +0 -1
  296. package/dist/history-J4QRNGRO-BwBOMO5i.mjs +0 -1
  297. package/dist/hostname-BK6HG2DE-_qJ9gN13.mjs +0 -1
  298. package/dist/html-to-markdown-TFCECAGV-D7XdAo13.mjs +0 -1
  299. package/dist/init-BbVUxVGS.mjs +0 -321
  300. package/dist/init-Cxp98ROz.mjs +0 -1
  301. package/dist/join-GG2LDHE5-BMnXfCXQ.mjs +0 -1
  302. package/dist/jq-ODXZBPLY-D3tmTL1R.mjs +0 -1
  303. package/dist/ln-4TRFBYAT-Byit-TLI.mjs +0 -1
  304. package/dist/loader-UdRFiBKU.mjs +0 -1
  305. package/dist/ls-KSXFZCWH-CNZ_hN8P.mjs +0 -1
  306. package/dist/md5sum-INMIK4DX-pTX2tfQd.mjs +0 -1
  307. package/dist/mkdir-TDEMSB6C-Bl16kSBR.mjs +0 -1
  308. package/dist/mv-Z6MORUFL-D9pw6nb9.mjs +0 -1
  309. package/dist/nl-U5YJDM32-Bs_nMrMg.mjs +0 -1
  310. package/dist/od-VJEF2UR5-DwpkPMHp.mjs +0 -1
  311. package/dist/paste-7N6AFSDS-C8EyimeA.mjs +0 -1
  312. package/dist/preview-BUIvO8U0.mjs +0 -1
  313. package/dist/printf-CX64KX2P-2Mks7IIT.mjs +0 -1
  314. package/dist/public/assets/McpConsentDialogBody-ByCv3Eox.js +0 -1
  315. package/dist/public/assets/index-CG7gf_6X.css +0 -1
  316. package/dist/pwd-D4OZ7N27-m5fzqroZ.mjs +0 -1
  317. package/dist/readlink-MI4GCHJF-BMheCA1U.mjs +0 -1
  318. package/dist/repair-mcp-configs-DUZFjiWh.mjs +0 -2
  319. package/dist/repair-skills-BGQinwio.mjs +0 -3
  320. package/dist/repair-skills-BQP8U0AN.mjs +0 -1
  321. package/dist/rev-XOSYPP45-4azlKYu4.mjs +0 -1
  322. package/dist/rg-FOQSCCX3-ViKChHv5.mjs +0 -1
  323. package/dist/rm-RTZG23RL-F9g7gQHU.mjs +0 -1
  324. package/dist/rmdir-XTQXT7RK-CFMuhNvO.mjs +0 -1
  325. package/dist/sed-VFTTATXJ-BfHBQ11q.mjs +0 -1
  326. package/dist/seq-RN5ZUASB-BaUQfYSh.mjs +0 -1
  327. package/dist/server-lock-8Lv6A-Xa-xTK-ENFB.mjs +0 -1
  328. package/dist/sha1sum-VJPNLNU6-NRAU83Yg.mjs +0 -1
  329. package/dist/sha256sum-PI32XWXY-Cfe-w5CY.mjs +0 -1
  330. package/dist/sleep-VZFPZFWA-BgSOeH2N.mjs +0 -1
  331. package/dist/sort-DCNRDA7U-DqMg1dll.mjs +0 -1
  332. package/dist/split-SITCSYCZ-DqhMcIGL.mjs +0 -1
  333. package/dist/sqlite3-56UMWEY3-DNmhrHQv.mjs +0 -1
  334. package/dist/src-B8E2dBvX.mjs +0 -3
  335. package/dist/start-BbTUyYTc.mjs +0 -3
  336. package/dist/start-BoQjiYiU.mjs +0 -1
  337. package/dist/stat-BT5A227F-DOG39Ce5.mjs +0 -1
  338. package/dist/stateDiagram-v2-QKLJ7IA2-CTdt2FVd.mjs +0 -2
  339. package/dist/strings-7PLOGTPD-l9kho9ff.mjs +0 -1
  340. package/dist/tac-SJGXQ4T2-DMDGVNTy.mjs +0 -1
  341. package/dist/tail-S5ULNTJU-knoYRbXD.mjs +0 -1
  342. package/dist/tar-ANUBEFJY-Db9qg5B2.mjs +0 -1
  343. package/dist/tee-O7VXZDCO-BgHEibOy.mjs +0 -1
  344. package/dist/time-DEUO3QV2-CXWA3kJ0.mjs +0 -1
  345. package/dist/timeout-VRKMCG72-aaC7r4sX.mjs +0 -1
  346. package/dist/touch-DX2IJOQ4-DGiKr2c0.mjs +0 -1
  347. package/dist/tr-2HXZRDSW-BDNDgux2.mjs +0 -1
  348. package/dist/tree-LYXBS7DC-BK2c44-E.mjs +0 -1
  349. package/dist/true-WHJNXCHG-B6CZ-ZF1.mjs +0 -1
  350. package/dist/unexpand-RGTMIGZM-BWFllY1p.mjs +0 -1
  351. package/dist/uniq-SUNANL47-CiXMC2Qh.mjs +0 -1
  352. package/dist/wc-TQB3VNOX-Bof613yN.mjs +0 -1
  353. package/dist/which-XZHEH76L-DfnqWxtA.mjs +0 -1
  354. package/dist/whoami-DGKU3D2X-DhtD1OhF.mjs +0 -1
  355. package/dist/write-project-skill-DzjtpVMW.mjs +0 -36
  356. package/dist/xan-BXDXYEIB-I8yansvE.mjs +0 -1
  357. package/dist/xan-view-ECQUO7AJ-DJhdCPf3.mjs +0 -1
  358. package/dist/xargs-I6EZUCYF-CdKFilDT.mjs +0 -1
  359. package/dist/yazl-Clfc09F-.mjs +0 -1
  360. package/dist/yq-MJMAR36V-BXyMiYfX.mjs +0 -1
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import{t as e}from"./chunk-XKQRETAK-BC2HZ_y9.mjs";export{e as sha1sumCommand};
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import{t as e}from"./chunk-5V6VZH6T-ByuVaPWr.mjs";export{e as sha256sumCommand};
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import"./chunk-5QMZ5MUS-BwpNU33k.mjs";import"./chunk-A5O5YHGN-DApqA6Ow.mjs";import{n as e}from"./chunk-GOV5EKKI-CDGzZWfT.mjs";export{e as sleepCommand};
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import{n as e}from"./chunk-KMEYNNUA-Qk0eg7gN.mjs";export{e as sortCommand};
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import{n as e}from"./chunk-MYE6AGBJ-DwzjGrc0.mjs";export{e as split};
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import"./chunk-5QMZ5MUS-BwpNU33k.mjs";import"./chunk-A5O5YHGN-DApqA6Ow.mjs";import"./chunk-24IMIIXA-DaS5XS55.mjs";import{t as e}from"./chunk-HWBSOZZR-DQTTl_pa.mjs";export{e as sqlite3Command};
@@ -0,0 +1,3 @@
1
+ import{s as e}from"./chunk-C94x7I9S.mjs";import{t}from"./esm-BLMtE3s6.mjs";import{c as n,l as r,s as i}from"./server-lock-CN2YHwpP-Cwa4llpq.mjs";import"./gh-detect-BIaONQmT.mjs";import{Mr as a,Nr as o,Tn as s,pn as c,ri as l,xn as u}from"./dist-CWHBXHzy.mjs";import{v as d,y as f}from"./init-VRZmGeiJ.mjs";import{n as p,o as ee}from"./write-project-skill-CRxX-42S.mjs";import"./loader-Ccwo98t7.mjs";import{c as m}from"./colors-8SzMRIVy.mjs";import"./preview-DTcYw4sX.mjs";import{dirname as h,isAbsolute as g,join as _,relative as v,resolve as y}from"node:path";import{existsSync as te,readFileSync as ne,statSync as b}from"node:fs";import{hostname as x}from"node:os";import{readFile as S,realpath as C}from"node:fs/promises";function w(e,t,a={}){let o=r(e,t);if(!te(o))return{status:`missing`,lockPath:o};let s;try{s=JSON.parse(ne(o,`utf-8`))}catch{return{status:`corrupt`,lockPath:o}}if(!s||typeof s!=`object`||!n(s.pid))return{status:`corrupt`,lockPath:o};let c=s;if(!(a.isAlive??i)(c.pid))return{status:`dead-pid`,lockPath:o,lock:c};let l=a.host??x();return c.hostname===l?{status:`alive`,lockPath:o,lock:c}:{status:`foreign-host`,lockPath:o,lock:c}}function T(e){return e.replace(/:\d+$/,``)}function E(e){let t=e.trim();if(!t)return null;{let e=/^https?:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`https`,hostname:T(e[1]),owner:e[2],name:e[3]}}{let e=/^ssh:\/\/(?:[\w.-]+@)?([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`ssh`,hostname:T(e[1]),owner:e[2],name:e[3]}}{let e=/^git:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:T(e[1]),owner:e[2],name:e[3]}}{let e=/^(?:[\w.-]+@)?([\w.-]+):([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e?.[1].includes(`.`)||e&&t.startsWith(`git@`))return{protocol:`ssh`,hostname:e[1],owner:e[2],name:e[3]}}{let e=/^git:([\w.-]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:e[1],owner:e[2],name:e[3]}}if(!t.includes(`://`)&&!t.includes(`@`)&&!t.startsWith(`/`)){let e=/^([\w.-]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e)return{protocol:`https`,hostname:`github.com`,owner:e[1],name:e[2]}}return null}function D(e){let t;try{t=new URL(e)}catch{return null}if(t.hostname!==`github.com`&&t.hostname!==`www.github.com`)return null;let n=t.pathname.split(`/`).filter(e=>e.length>0);if(n.length<5||n[2]!==`blob`)return null;let r,i,a,o;try{r=decodeURIComponent(n[0]),i=decodeURIComponent(n[1]),a=decodeURIComponent(n[3]),o=n.slice(4).map(e=>decodeURIComponent(e))}catch{return null}return!r||!i||!a||o.length===0||o.some(e=>e.length===0)?null:{owner:r,repo:i,branch:a,path:o.join(`/`)}}function O(e){let t;try{t=new URL(e)}catch{return null}if(t.hostname!==`github.com`&&t.hostname!==`www.github.com`)return null;let n=t.pathname.split(`/`);if(n.length<5||n[0]!==``||n[3]!==`tree`)return null;let r=n.slice(5);r.length===1&&r[0]===``&&r.pop();let i,a,o,s;try{i=decodeURIComponent(n[1]),a=decodeURIComponent(n[2]),o=decodeURIComponent(n[4]),s=r.map(e=>decodeURIComponent(e))}catch{return null}return!i||!a||!o||s.some(e=>e.length===0)?null:{owner:i,repo:a,branch:o,path:s.join(`/`)}}function re(e){let t=D(e);if(t)return{kind:`doc`,...t};let n=O(e);return n?{kind:`folder`,...n}:null}var k=e(m(),1);function A(e){return e==null?!1:e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function j(e,t=Date.now()){let n=new Date(e).getTime();if(Number.isNaN(n))return`—`;let r=t-n,i=Math.floor(r/1e3);if(i<60)return`${i}s`;let a=Math.floor(i/60);if(a<60)return`${a}m ago`;let o=Math.floor(a/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function M(e,t,n,r,i,a){if(t.status===`missing`||t.status===`corrupt`)return null;let o=t.lock,s=null;if(n.status!==`missing`&&n.status!==`corrupt`){let e=n.lock;s={port:e.port,status:n.status,pid:e.pid,startedAt:e.startedAt,usage:a}}return{directory:o.worktreeRoot,server:{port:o.port,status:t.status,pid:o.pid,startedAt:o.startedAt,usage:i},ui:s,hostname:o.hostname,lockPath:t.lockPath,binary:r==null?null:u(r),command:r,isDesktop:A(r)}}function N(e){return e.ui==null?!1:e.ui.status===`alive`||e.ui.status===`foreign-host`}function P(e){let t=e.server.status;return t===`alive`||t===`foreign-host`?e.isDesktop?`desktop`:t===`alive`?`running`:`foreign`:t===`dead-pid`&&N(e)?`ui-orphan`:`stale`}const F=new Set([`running`,`desktop`,`foreign`,`ui-orphan`]);function I(e){switch(e){case`running`:return k.default.green(e);case`desktop`:return k.default.blue(e);case`foreign`:return k.default.cyan(e);case`ui-orphan`:return k.default.magenta(e);case`stale`:return k.default.yellow(e)}}function L(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function R(e){return`${L(e.server.usage)} | ${L(e.ui?.usage??null)}`}function z(e){return`${e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null||e.ui.status===`dead-pid`?`—`:String(e.ui.port)}`}function B(e){if(e.length===0)return`No open-knowledge servers found.`;let t=[`DIRECTORY`,`PORTS (API/UI)`,`CPU/MEM (API | UI)`,`STATUS`,`PID`,`STARTED`,`BINARY`],n=e.map(e=>{let t=P(e),n=t===`ui-orphan`&&e.ui!=null?e.ui.pid:e.server.pid;return[e.directory,z(e),R(e),t,String(n),j(e.server.startedAt),e.binary??`—`]}),r=t.length,i=t.map(e=>e.length);for(let e of n)for(let t=0;t<r;t++)i[t]=Math.max(i[t]??0,(e[t]??``).length);let a=t.map((e,t)=>e.padEnd(i[t]??0)).join(` `).trimEnd(),o=e.map((e,t)=>{let a=n[t]??[],o=[];for(let t=0;t<r;t++){let n=(a[t]??``).padEnd(i[t]??0);if(t===3){let r=a[t]??``;n=I(P(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),s=k.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
2
+ `)}async function V(e={}){let t=e.discover??c,n=e.inspect??w,r=e.log??(e=>console.log(e)),i=e.resolveCommand??a,s=e.resolveUsage??o,l=await t(),u=[];for(let e of l){let t=n(e,`server`),r=n(e,`ui`),a=M(e,t,r,t.status===`missing`||t.status===`corrupt`?null:i(t.lock.pid),t.status===`missing`||t.status===`corrupt`?null:s(t.lock.pid),r.status===`missing`||r.status===`corrupt`?null:s(r.lock.pid));a!=null&&u.push(a)}if(e.json){let e=u.map(e=>({...e,displayStatus:P(e)}));r(JSON.stringify(e,null,2));return}r(B(e.all?u:u.filter(e=>F.has(P(e)))))}function H(){return new t(`ps`).description(`List all running open-knowledge servers`).argument(`[modifier]`,`"all" to include stale (dead-pid) entries`).option(`--all`,`Include stale (dead-pid) entries (foreign-host shows by default)`).option(`--json`,`Emit structured JSON (always includes all statuses)`).action(async(e,t)=>{await V({all:t.all===!0||e===`all`,json:t.json===!0})})}const U=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`]);function W(e,t,n=s){if(e!==void 0&&!U.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let G=null;function K(e){G=e}function q(){return G??process.cwd()}function J(e,t,n={}){let r=n.isAlive??i,a=[];for(let[n,i]of[[`server`,e],[`ui`,t]])(i.status===`alive`||i.status===`foreign-host`&&r(i.lock.pid))&&a.push({name:n,pid:i.lock.pid,port:i.lock.port});return{targets:a}}function Y(e){let t=e.inspect??(t=>w(e.lockDir,t)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=J(t(`server`),t(`ui`),{isAlive:e.isAlive});if(a.targets.length===0)return r(`No running open-knowledge processes.`),{stopped:[],failed:[],hadTargets:!1};let o=[],s=[];for(let e of a.targets)try{n(e.pid,`SIGTERM`),o.push(e)}catch(t){s.push({target:e,error:t instanceof Error?t.message:String(t)})}return o.length>0&&r(`Stopped: ${o.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),s.length>0&&i(`Failed to stop: ${s.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:o,failed:s,hadTargets:!0}}function X(e,t){return e.status===`alive`?!0:e.status===`foreign-host`?t(e.lock.pid):!1}async function ie(e,t=i){let n=await c(),r=null;for(let i of n){let n=w(i,`server`),a=w(i,`ui`);if(X(n,t)&&n.lock.port===e||X(a,t)&&a.lock.port===e)return i;r===null&&(X(n,t)&&n.lock.pid===e||X(a,t)&&a.lock.pid===e)&&(r=i)}return r}function Z(e){let t=Y({lockDir:e});return t.failed.length>0&&(process.exitCode=1),t}function ae(e){return new t(`stop`).description(`Stop open-knowledge server(s). With no argument: stops the server for the current directory. Pass a port number, a directory path, or "all" to target globally.`).argument(`[target...]`,`port number, directory path (spaces OK), or "all"`).action(async t=>{let n=t.length===0?void 0:t.join(` `);if(n===void 0){e();let t=Y({lockDir:l(process.cwd()),log:()=>{}});if(t.hadTargets){if(t.stopped.length>0){let e=t.stopped.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `);console.log(`Stopped: ${e}`)}t.failed.length>0&&(process.exitCode=1)}else await V({});return}if(n===`all`){let e=await c();if(e.length===0){console.log(`No running open-knowledge servers found.`);return}let t=0;for(let n of e){let e=w(n,`server`),r=w(n,`ui`);!X(e,i)&&!X(r,i)||(Z(n),t++)}t===0&&console.log(`No running open-knowledge servers found.`);return}if(/^\d+$/.test(n)){let e=Number.parseInt(n,10),t=await ie(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}Z(t);return}Z(l(y(q(),n)))})}function oe(e){return{event:`mcp-config-decline`,scope:e.scope,surface:e.surface,editorId:e.editorId,reason:e.reason}}async function se(e,t){let n,r;try{n=await C(y(e)),r=await C(y(h(e)))}catch{return{kind:`not-git`}}if(!Q(n,r))return{kind:`symlink-escape`};let i=_(n,`.git`),a;try{a=b(i)}catch{return{kind:`not-git`}}let o;if(a.isDirectory()){let e;try{e=await C(i)}catch{return{kind:`not-git`}}if(!Q(e,n))return{kind:`symlink-escape`};o=e}else if(a.isFile()){let e;try{e=await S(i,`utf-8`)}catch{return{kind:`not-git`}}let t=/^gitdir:\s*(.+)$/m.exec(e.trim());if(!t)return{kind:`not-git`};let r=t[1].trim(),a=g(r)?r:y(n,r);try{o=await C(a)}catch{return{kind:`not-git`}}}else return{kind:`not-git`};let s=_(await ce(o),`config`),c;try{c=await S(s,`utf-8`)}catch{return{kind:`not-git`}}let l=$(c);if(l===null)return{kind:`no-origin`};let u=E(l);if(u===null||u.hostname!==`github.com`)return{kind:`non-github`};let d=u.owner.toLowerCase()===t.owner.toLowerCase(),f=u.name.toLowerCase()===t.repo.toLowerCase();return!d||!f?{kind:`wrong-repo`,actualOwner:u.owner,actualRepo:u.name}:{kind:`ok`,gitRemoteUrl:`https://github.com/${u.owner}/${u.name}.git`}}async function ce(e){let t;try{t=(await S(_(e,`commondir`),`utf-8`)).trim()}catch{return e}if(t.length===0)return e;let n=g(t)?t:y(e,t);try{return await C(n)}catch{return n}}function Q(e,t){if(e===t)return!0;let n=v(t,e);return n.length>0&&!n.startsWith(`..`)&&!g(n)}function le(e){let t=e.indexOf(`#`),n=e.indexOf(`;`),r=-1;return t>=0&&n>=0?r=Math.min(t,n):t>=0?r=t:n>=0&&(r=n),(r===-1?e:e.slice(0,r)).trim()}function $(e){let t=!1;for(let n of e.split(/\r?\n/)){let e=le(n);if(e.length===0)continue;if(e.startsWith(`[`)){t=/^\[\s*remote\s+["']origin["']\s*\]$/.test(e);continue}if(!t)continue;let r=/^url\s*=\s*(.+)$/.exec(e);if(r)return ue(r[1])}return null}function ue(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):t}const de=[{id:`mcp-config`,write(e,t,n){let r=e.projectConfigPath?.(t);if(!r)return{integration:`mcp-config`,editorId:e.id,action:`skipped-unsupported`};try{let i=f(e,t,n,void 0,r);return i.action===`written`||i.action===`overwritten`?{integration:`mcp-config`,editorId:e.id,action:i.action,path:i.configPath}:i.action===`failed`?{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:i.error??`unknown failure`}:i.action===`declined`?{integration:`mcp-config`,editorId:e.id,action:`declined`,path:i.configPath,...i.declineReason===void 0?{}:{reason:i.declineReason}}:{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:`unexpected project-scope action: ${i.action}`}}catch(t){return{integration:`mcp-config`,editorId:e.id,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}},{id:`project-skill`,write(e,t,n){try{let n=p(e,t);return{integration:`project-skill`,editorId:e.id,action:n.action,...n.path?{path:n.path}:{},...n.error?{error:n.error}:{}}}catch(t){return{integration:`project-skill`,editorId:e.id,action:`failed`,error:t instanceof Error?t.message:String(t)}}}}];function fe(e,t,n={},r=de){let i=[];for(let a of t){let t=ee[a];for(let a of r)i.push(a.write(t,e,n))}return i}function pe(e,t,n={}){return{integrations:fe(e,t,n),claudeLaunchJson:t.includes(`claude`)?d(e,n):void 0}}export{ae as a,H as c,O as d,E as f,Y as i,D as l,se as n,K as o,w as p,oe as r,W as s,pe as t,re as u};
3
+ //# sourceMappingURL=src-B4ueRPSp.mjs.map
@@ -0,0 +1,3 @@
1
+ import{n as e,t}from"./esm-BLMtE3s6.mjs";import{Dn as n,dt as r}from"./server-lock-CN2YHwpP-Cwa4llpq.mjs";import{i,t as a}from"./gh-detect-BIaONQmT.mjs";import{cr as o,jr as s,xr as c}from"./dist-CWHBXHzy.mjs";import{n as l}from"./constants-B43V8fIN.mjs";import{spawn as u}from"node:child_process";import{basename as d,dirname as f,join as p}from"node:path";import{closeSync as m,existsSync as h,mkdirSync as g,openSync as _,statSync as v}from"node:fs";import{homedir as y}from"node:os";import{rm as b}from"node:fs/promises";import{setTimeout as x}from"node:timers/promises";const S=`OpenKnowledge.app`,C=`/Applications/${S}`;function w(){return{platform:process.platform,env:process.env,execPath:process.execPath,isTTY:process.stdout.isTTY,statSync:e=>{try{return v(e,{throwIfNoEntry:!1})??null}catch{return null}}}}function T(e){if(e.env.ELECTRON_RUN_AS_NODE===`1`){let t=/(.+?\.app)\/Contents\/MacOS\//.exec(e.execPath);if(t?.[1])return t[1]}if(E(e,C))return C;let t=p(e.homeDir??y(),`Applications`,S);return E(e,t)?t:null}function E(e,t){try{let n=p(t,`Contents`,`MacOS`,`OpenKnowledge`),r=e.statSync(n);return r&&typeof r.isFile==`function`?r.isFile():!1}catch{return!1}}function D(e){if(e.env.OK_FORCE_BROWSER===`1`)return{available:!1,reason:`force-browser`};if(e.platform!==`darwin`)return{available:!1,reason:`darwin-only`};let t;try{t=T(e)}catch{return{available:!1,reason:`stat-error`}}return t?e.env.OK_FORCE_DESKTOP===`1`?{available:!0,reason:`available`,bundlePath:t}:e.isTTY!==!0||e.env.SSH_CONNECTION||e.env.SSH_TTY?{available:!1,reason:`headless`,bundlePath:t}:{available:!0,reason:`available`,bundlePath:t}:{available:!1,reason:`no-bundle`}}function O(e){(e.log??(e=>console.error(e)))("Launching OpenKnowledge desktop (use `ok start` for the browser server, or `OK_FORCE_BROWSER=1` to always skip)");let t={...process.env};delete t.ELECTRON_RUN_AS_NODE,e.spawn(`open`,[`-b`,`com.inkeep.open-knowledge`],{detached:!0,stdio:`ignore`,env:t}).unref()}function k(e=`no-bundle`){switch(e){case`no-bundle`:return`Desktop app not found at ${C}. Install via DMG, or omit --mode for browser mode.`;case`darwin-only`:return`Desktop app is macOS-only on this release. Use --mode=browser, or omit --mode for the server fallback.`;case`headless`:return`Desktop launch is gated in headless contexts (CI, SSH, non-TTY stdout). Set OK_FORCE_DESKTOP=1 to override, or use --mode=browser.`;case`force-browser`:return`OK_FORCE_BROWSER=1 is set — desktop dispatch is disabled. Unset it to use --mode=app.`;case`stat-error`:return`Failed to inspect desktop bundle at ${C} (filesystem error). Check permissions or use --mode=browser.`;case`available`:return`Desktop app appears available at ${C} but launch dispatch did not fire (caller bug).`}}function A(e){return p(f(e),`..`,`Frameworks`,`OpenKnowledge Server.app`,`Contents`,`MacOS`,`OpenKnowledge Helper`)}const j=/\/[^/]+\.app\/Contents\/MacOS\/[^/]+$/;function M(e){if(e.platform!==`darwin`||!j.test(e.execPath))return null;let t=A(e.execPath);return e.exists(t)?t:null}function N(e={}){let t=e.execPath??process.execPath,n=e.platform??process.platform,r=e.argv??process.argv,i=e.exists??h,a=r[1];return a?{command:M({execPath:t,platform:n,exists:i})??t,prefixArgs:[a]}:(console.warn(`[self-spawn] process.argv[1] is empty — falling back to \`npx -y @inkeep/open-knowledge@latest\`. This re-introduces the registry-fetch surface that re-exec was fixing. Observed argv: ${JSON.stringify(r)}`),{command:`npx`,prefixArgs:[`-y`,`@inkeep/open-knowledge@latest`]})}function P(e,t){return e.host??t.HOST??`127.0.0.1`}function F(e){let t=d(e).replace(/[^\x20-\x7E]/g,``).trim().slice(0,64);return`open-knowledge-server ${t.length>0?t:`unknown`}`}var I=class extends Error{cwd;constructor(e){super("This directory isn't set up yet. Run `ok init` first, then `ok start` again."),this.name=`OkDirMissingError`,this.cwd=e}};function L(e){return e.uiLock?e.isAlive(e.uiLock.pid)?{action:`skip`,reason:`alive`,pid:e.uiLock.pid,port:e.uiLock.port}:{action:`spawn`,reason:`stale`,stalePid:e.uiLock.pid}:{action:`spawn`,reason:`absent`}}function R(e){h(e.lockDir)||g(e.lockDir,{recursive:!0});let t=_(p(e.lockDir,n),`w`),r=e.spawn??u,{PORT:i,...a}=process.env,o=N();try{let n=r(o.command,[...o.prefixArgs,...e.args??[`ui`]],{detached:!0,stdio:[`ignore`,`ignore`,t],cwd:e.cwd,env:{...a,ELECTRON_RUN_AS_NODE:`1`}});return n.unref(),n}finally{try{m(t)}catch{}}}function z(e,t,n){return e??(n===void 0?t:void 0)}function B(e,t){return e!==void 0&&t!==null&&t.port>0}function V(e,t,n){return e??(t!=null&&!n?1:0)}async function H(e){let t=e.spawn??u,n=N(),{PORT:r,...i}=process.env,a=t(n.command,[...n.prefixArgs,`ui`,`--port`,String(e.uiPort)],{cwd:e.cwd,stdio:`inherit`,env:{...i,ELECTRON_RUN_AS_NODE:`1`}}),o=!1,s=e=>{o=!0;try{a.kill(e)}catch{}},c=()=>s(`SIGINT`),l=()=>s(`SIGTERM`);process.once(`SIGINT`,c),process.once(`SIGTERM`,l),await new Promise(e=>{a.on(`exit`,(t,n)=>{process.exitCode=V(t,n,o),e()}),a.on(`error`,t=>{console.error(`[start] connect fallback: failed to spawn ok ui — ${t instanceof Error?t.message:String(t)}`),process.exitCode=1,e()})}),process.removeListener(`SIGINT`,c),process.removeListener(`SIGTERM`,l)}async function U(e){let t=e.now()+e.timeoutMs;for(;e.now()<t;){let t=e.readUiLock();if(t&&t.port>0)return t.port;await e.sleep(e.pollIntervalMs)}let n=e.readUiLock();return n&&n.port>0?n.port:null}const W=r;function G(e,t,n=e=>b(e,{recursive:!0,force:!0})){return async()=>{try{await e()}finally{try{await n(t)}catch(e){process.stderr.write(`[start] ephemeral temp dir reap failed for ${t}: ${e instanceof Error?e.message:String(e)}\n`)}}}}function K(e){let t=e.sigtermGraceMs??W,n=e.sigtermPollIntervalMs??200,r=e.sleep??(e=>x(e));return async()=>{try{let i=e.readUiLock();if(i&&e.isAlive(i.pid))try{e.killPid(i.pid,`SIGTERM`),e.log?.info({pid:i.pid,port:i.port},`idle-shutdown: SIGTERM UI sibling`);let a=Date.now()+t;for(;Date.now()<a&&e.isAlive(i.pid);)await r(n);if(e.isAlive(i.pid))try{e.killPid(i.pid,`SIGKILL`),e.log?.warn({pid:i.pid,graceMs:t},`idle-shutdown: SIGTERM grace expired — escalated to SIGKILL`)}catch(t){e.log?.error({pid:i.pid,err:t instanceof Error?t.message:String(t)},`idle-shutdown: SIGKILL failed`)}}catch(t){e.log?.warn({pid:i.pid,err:t instanceof Error?t.message:String(t)},`idle-shutdown: failed to SIGTERM UI sibling`)}}catch(t){e.log?.warn({err:t instanceof Error?t.message:String(t)},`idle-shutdown: UI lookup failed; proceeding with destroy`)}await e.destroy()}}async function q(e){let{config:t,cwd:n,host:r}=e,l=e.skipAutoInit??!1,u=e.skipUiAutoSpawn??!1,d=e.idleThresholdMs??18e5,{existsSync:f,mkdirSync:p}=await import(`node:fs`),{basename:m,dirname:h}=await import(`node:path`),{bootServer:g,getLogger:_,isProcessAlive:v,readUiLock:y,resolveContentDir:b}=await import(`./dist-CMJUtzX1.mjs`),S=e.log??_(`start`),C=e.singleFile!==void 0,w=e.projectDir??n,T=C?s(e.singleFile).canonicalFilePath:void 0,E=T?h(T):void 0,D=T?m(T):void 0;if(!C){if(!l&&!o(n))throw new I(n);let t=process.env.OK_RECLAIM_DISABLE??null,r=e=>{let t=typeof e.event==`string`?e.event:``;(t.endsWith(`-failed`)||t.endsWith(`-error`)||t.endsWith(`-missing`))&&S.warn({event:e},`[start] reclaim sweep reported a problem`)};try{(e.repairMcpConfigsFn??(await import(`./repair-mcp-configs-C_aVjx-w.mjs`)).repairMcpConfigs)({projectDir:n,reclaimDisableEnv:t,logger:r})}catch(e){S.warn({err:e},`[start] mcp-config repair sweep failed; continuing`)}try{(e.repairLaunchJsonFn??(await import(`./repair-launch-json-CQi2Gb_O.mjs`)).repairLaunchJson)({projectDir:n,reclaimDisableEnv:t,logger:r})}catch(e){S.warn({err:e},`[start] launch.json repair sweep failed; continuing`)}try{await(e.repairSkillsFn??(await import(`./repair-skills-BFe09bLm.mjs`)).repairSkills)({projectDir:n,reclaimDisableEnv:t,logger:r})}catch(e){S.warn({err:e},`[start] skill repair sweep failed; continuing`)}}let O=E??b(t,n);!C&&!f(O)&&(p(O,{recursive:!0}),S.info({contentDir:O},`Created content directory`));let k=null,A=async({lockDir:t})=>{if(k=L({uiLock:y(t),isAlive:v}),k.action===`spawn`&&!u)try{let r=e.uiPort===void 0?void 0:[`ui`,`--port`,String(e.uiPort)];R({lockDir:t,cwd:n,spawn:e.spawn,args:r}),S.info({reason:k.reason,uiPort:e.uiPort},`[start] auto-spawned ok ui sibling`)}catch(e){console.warn(`[start] failed to auto-spawn ok ui: ${e instanceof Error?e.message:String(e)}`)}else k.action===`skip`&&S.info({port:k.port,pid:k.pid},`UI already running at port ${k.port}`)},j=e.reactShellDistDir===void 0,M=i(),N=c(),P=await g({config:t,contentDir:O,projectDir:C?w:n,contentRoot:C?void 0:t.content.dir,port:e.port,host:r,quiet:!1,detectGh:a,tokenStore:M,embeddingsKeyStore:N,...C?{ephemeral:!0,singleDocRelPath:D,gitEnabled:!1,gitPreflight:()=>({ok:!0,version:`0.0.0`,resolvedPath:`git`,source:`PATH`})}:{},localOpCliArgs:[process.execPath,process.argv[1]],attachUiSibling:j,idleShutdownMs:d,skipAutoInit:!0,...j?{spawnUiSiblingFn:A}:{},idleShutdownHandler:e=>{let t=K({readUiLock:()=>y(P.lockDir),isAlive:v,killPid:(e,t)=>{process.kill(e,t)},destroy:e,log:S});return C?G(t,w):t},log:S,...e.serveContentAssets?{serveContentAssets:!0}:{},...e.reactShellDistDir?{reactShellDistDir:e.reactShellDistDir}:{}});k||={action:`skip`,reason:`alive`,pid:0,port:0};let F=k,z=null;if(F.action===`skip`)z=F.port>0?F.port:null;else if(!u){let t=e.uiBindTimeoutMs??3e3;z=await U({readUiLock:()=>y(P.lockDir),now:Date.now,sleep:e=>x(e),timeoutMs:t,pollIntervalMs:50}),z===null&&S.warn({timeoutMs:t},`[start] ok ui did not bind within timeout — banner falls back to API URL`)}return{httpServer:P.httpServer,destroy:P.destroy,lockDir:P.lockDir,contentDir:O,port:P.port,ready:P.ready,degraded:P.degraded,uiSpawnDecision:k,resolvedUiPort:z}}function J(t){if(t===`browser`||t===`app`)return t;throw new e(`--mode must be 'browser' or 'app'`)}function ee(t){let n=Number.parseInt(t,10);if(Number.isNaN(n)||n<1||n>65535)throw new e(`--ui-port must be a port number between 1 and 65535`);return n}function Y(e){return e.OK_CONSOLE_LEVEL!==void 0||e.LOG_LEVEL!==void 0?null:`warn`}function X(e){let t=[`Stopping OpenKnowledge…`,`Saving pending changes and releasing the server lock — this can take a few seconds.`];return e===`SIGINT`&&t.push(`Press Ctrl+C again to force quit.`),t}async function Z(e,t){let n=Y(process.env);n!==null&&(process.env.OK_CONSOLE_LEVEL=n);let{renderBanner:r}=await import(`./banner-BxCFCyu8.mjs`),{accent:i,dim:a,error:o,warning:s}=await import(`./colors-CmkIIbww.mjs`),c=process.cwd(),u=e;process.title=F(c);let d=P(t,process.env),f=t.port===void 0?void 0:Number(t.port),p=process.env.PORT?Number(process.env.PORT):void 0,m=t.uiPort===void 0?void 0:Number(t.uiPort),h=z(f,p,m);if(m!==void 0){let{readServerLock:e,resolveLockDir:t}=await import(`./dist-CMJUtzX1.mjs`);if(B(m,e(t(c)))){await H({cwd:c,uiPort:m});return}}let g;try{g=await q({config:u,cwd:c,host:d,port:h,...m===void 0?{}:{uiPort:m},...t.serveContentAssets?{serveContentAssets:!0}:{},...t.reactShellDistDir?{reactShellDistDir:t.reactShellDistDir}:{},...t.singleFile?{singleFile:t.singleFile}:{},...t.projectDir?{projectDir:t.projectDir}:{}})}catch(e){e instanceof I&&(console.error(o(e.message)),process.exit(1));let t=await import(`./dist-CMJUtzX1.mjs`);if((e instanceof t.GitNotAvailableError||e instanceof t.GitTooOldError)&&process.exit(78),(e instanceof t.SingleFileNotFoundError||e instanceof t.SingleFileNotAFileError||e instanceof t.SingleFileNotMarkdownError)&&(console.error(o(e.message)),process.exit(1)),m!==void 0&&Q(e,t)){await H({cwd:c,uiPort:m});return}let n=$(e,c,t);n!==null&&(console.error(o(n)),process.exit(1)),console.error(`${o(`Failed to start:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exit(1)}let _=!1,v=async e=>{if(_)return;_=!0;let[t,...n]=X(e);console.log(i(`\n${t}`));for(let e of n)console.log(a(` ${e}`));try{await g.destroy()}catch(e){console.error(`${o(`destroy() failed:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exitCode=1}process.exit(process.exitCode??0)};process.once(`SIGINT`,()=>{v(`SIGINT`)}),process.once(`SIGTERM`,()=>{v(`SIGTERM`)});let y=`http://${d}:${g.port}`,b=d===`0.0.0.0`||d===`::`?`http://0.0.0.0:${g.port}`:void 0,x=g.resolvedUiPort,S=x!==null&&x>0?`http://${d}:${x}`:y;console.log(r({name:`open-knowledge`,version:l,localUrl:S,apiUrl:S===y?void 0:y,networkUrl:b,nextSteps:[`Open the Editor URL in your browser to start editing.`]}));let C={"shadow-repo":`Version history and branch-switch safety unavailable`,"file-watcher":`External file changes will not sync to the editor`,"head-watcher":`Git branch switches may cause document inconsistency`};g.ready.then(async()=>{if(g.degraded.length>0){console.log();for(let e of g.degraded){let t=C[e]??`${e} (check server logs for details)`;console.warn(` ${s(`⚠`)} ${s(e)}: ${a(t)}`)}console.log()}if(t.open){let{openBrowser:e}=await import(`./open-browser-DHTbHSqx.mjs`);e(S)}}).catch(e=>{console.error(` ${o(`Server initialization failed:`)} ${e instanceof Error?e.message:String(e)}`)})}function Q(e,t){let n=t.ServerLockCollisionError;return n!==void 0&&e instanceof n}function $(e,t,n){let r=n.ServerLockCollisionError;if(r===void 0||!(e instanceof r))return null;try{let e=p(t,`.ok`),r=n.readServerLock(e);return r?r.kind===`interactive`?`OpenKnowledge desktop is currently running on this project. Quit it or use --cwd to point elsewhere.`:r.kind===`mcp-spawned`?"An MCP-spawned server holds this lock; it should release on idle-shutdown (~30 min). Or run `ok stop`.":"OpenKnowledge server is already running on this project — check `ok status` or `ok stop`.":"OpenKnowledge server is already running on this project — check `ok status` or `ok stop`."}catch{return null}}function te(e){return new t(`start`).description(`Start the knowledge base collab server`).option(`-p, --port <port>`,`Server port`,void 0).option(`--ui-port <port>`,`Pin the ok ui sibling to <port> and connect (not exit) if a server already runs here — the worktree-preview recipe path`,ee).option(`-H, --host <host>`,`Server host`,void 0).option(`--open`,`Open browser after start`).option(`--mode <mode>`,`Force dispatch mode: 'browser' or 'app'`,J).option(`--serve-content-assets`,`Serve content assets from this server`).option(`--react-shell-dist-dir <path>`,`Serve React shell from <path> (suppresses ok ui sibling)`).option(`--single-file <path>`,`No-project ephemeral single-file mode: scope the server to one markdown file (git + MCP off)`).option(`--project-dir <dir>`,`Throwaway project root for --single-file (where ephemeral .ok/ state lives)`).action(async t=>{let n=e();if(t.mode===`app`){t.open&&(process.stderr.write(`error: option '--mode=app' cannot be combined with '--open' (--open opens a browser tab against the local server, which app mode does not boot)
2
+ `),process.exit(2));let e=[];if(t.port!==void 0&&e.push(`--port`),t.uiPort!==void 0&&e.push(`--ui-port`),t.host!==void 0&&e.push(`--host`),e.length>0){let t=process.env.OK_LOG_LEVEL??`info`;(t===`debug`||t===`trace`)&&console.error(`--mode=app: ignoring ${e.join(`, `)}`)}let n=D(w());if(n.available){O({spawn:u});return}console.error(k(n.reason)),process.exit(1)}await Z(n,t)})}export{O as C,D as S,te as _,V as a,N as b,F as c,z as d,P as f,R as g,B as h,K as i,X as l,Z as m,U as n,H as o,Y as p,q as r,L as s,I as t,Q as u,$ as v,w as x,G as y};
3
+ //# sourceMappingURL=start-2TGfkITh.mjs.map
@@ -0,0 +1 @@
1
+ import{_ as e,f as t,r as n}from"./start-2TGfkITh.mjs";export{n as bootStartServer,t as resolveHost,e as startCommand};
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import{t as e}from"./chunk-5QVNJEHU-BV0xuiYW.mjs";export{e as statCommand};
@@ -1,2 +1,2 @@
1
- import{T as e,p as t,w as n}from"./src-BkCVz_TJ.mjs";import{D as r,b as i,c as a,s as o}from"./chunk-ICPOFSXX-D0MVsm4H.mjs";import{H as s,h as c}from"./chunk-5PVQY5BW-C5V4E1lO.mjs";import{t as l}from"./line-C62ka-l9.mjs";import"./chunk-U2HBQHQK-DB1SzWgs.mjs";import"./chunk-BSJP7CBP-BG3yJGkJ.mjs";import"./chunk-ZZ45TVLE-CXznFlWR.mjs";import{t as u}from"./graphlib-5CpUx0Yq.mjs";import{t as d}from"./dagre-LJG-5J7U.mjs";import"./chunk-55IACEB6-Cmyc0XwJ.mjs";import"./chunk-EDXVE4YY-B_wA-KGy.mjs";import"./chunk-X2U36JSP-CqOGcGN3.mjs";import"./chunk-5FUZZQ4R-DFR5eSi-.mjs";import"./chunk-ENJZ2VHE-DwiyImt2.mjs";import"./chunk-336JU56O-5giJrfiv.mjs";import{i as f,n as p,t as m}from"./chunk-OYMX7WX6-BrOfVMt8.mjs";var h=n(e=>e.append(`circle`).attr(`class`,`start-state`).attr(`r`,i().state.sizeUnit).attr(`cx`,i().state.padding+i().state.sizeUnit).attr(`cy`,i().state.padding+i().state.sizeUnit),`drawStartState`),g=n(e=>e.append(`line`).style(`stroke`,`grey`).style(`stroke-dasharray`,`3`).attr(`x1`,i().state.textHeight).attr(`class`,`divider`).attr(`x2`,i().state.textHeight*2).attr(`y1`,0).attr(`y2`,0),`drawDivider`),_=n((e,t)=>{let n=e.append(`text`).attr(`x`,2*i().state.padding).attr(`y`,i().state.textHeight+2*i().state.padding).attr(`font-size`,i().state.fontSize).attr(`class`,`state-title`).text(t.id),r=n.node().getBBox();return e.insert(`rect`,`:first-child`).attr(`x`,i().state.padding).attr(`y`,i().state.padding).attr(`width`,r.width+2*i().state.padding).attr(`height`,r.height+2*i().state.padding).attr(`rx`,i().state.radius),n},`drawSimpleState`),v=n((e,t)=>{let r=n(function(e,t,n){let r=e.append(`tspan`).attr(`x`,2*i().state.padding).text(t);n||r.attr(`dy`,i().state.textHeight)},`addTspan`),a=e.append(`text`).attr(`x`,2*i().state.padding).attr(`y`,i().state.textHeight+1.3*i().state.padding).attr(`font-size`,i().state.fontSize).attr(`class`,`state-title`).text(t.descriptions[0]).node().getBBox(),o=a.height,s=e.append(`text`).attr(`x`,i().state.padding).attr(`y`,o+i().state.padding*.4+i().state.dividerMargin+i().state.textHeight).attr(`class`,`state-description`),c=!0,l=!0;t.descriptions.forEach(function(e){c||(r(s,e,l),l=!1),c=!1});let u=e.append(`line`).attr(`x1`,i().state.padding).attr(`y1`,i().state.padding+o+i().state.dividerMargin/2).attr(`y2`,i().state.padding+o+i().state.dividerMargin/2).attr(`class`,`descr-divider`),d=s.node().getBBox(),f=Math.max(d.width,a.width);return u.attr(`x2`,f+3*i().state.padding),e.insert(`rect`,`:first-child`).attr(`x`,i().state.padding).attr(`y`,i().state.padding).attr(`width`,f+2*i().state.padding).attr(`height`,d.height+o+2*i().state.padding).attr(`rx`,i().state.radius),e},`drawDescrState`),y=n((e,t,n)=>{let r=i().state.padding,a=2*i().state.padding,o=e.node().getBBox(),s=o.width,c=o.x,l=e.append(`text`).attr(`x`,0).attr(`y`,i().state.titleShift).attr(`font-size`,i().state.fontSize).attr(`class`,`state-title`).text(t.id),u=l.node().getBBox().width+a,d=Math.max(u,s);d===s&&(d+=a);let f,p=e.node().getBBox();t.doc,f=c-r,u>s&&(f=(s-d)/2+r),Math.abs(c-p.x)<r&&u>s&&(f=c-(u-s)/2);let m=1-i().state.textHeight;return e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,m).attr(`class`,n?`alt-composit`:`composit`).attr(`width`,d).attr(`height`,p.height+i().state.textHeight+i().state.titleShift+1).attr(`rx`,`0`),l.attr(`x`,f+r),u<=s&&l.attr(`x`,c+(d-a)/2-u/2+r),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,i().state.titleShift-i().state.textHeight-i().state.padding).attr(`width`,d).attr(`height`,i().state.textHeight*3).attr(`rx`,i().state.radius),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,i().state.titleShift-i().state.textHeight-i().state.padding).attr(`width`,d).attr(`height`,p.height+3+2*i().state.textHeight).attr(`rx`,i().state.radius),e},`addTitleAndBox`),b=n(e=>(e.append(`circle`).attr(`class`,`end-state-outer`).attr(`r`,i().state.sizeUnit+i().state.miniPadding).attr(`cx`,i().state.padding+i().state.sizeUnit+i().state.miniPadding).attr(`cy`,i().state.padding+i().state.sizeUnit+i().state.miniPadding),e.append(`circle`).attr(`class`,`end-state-inner`).attr(`r`,i().state.sizeUnit).attr(`cx`,i().state.padding+i().state.sizeUnit+2).attr(`cy`,i().state.padding+i().state.sizeUnit+2)),`drawEndState`),x=n((e,t)=>{let n=i().state.forkWidth,r=i().state.forkHeight;if(t.parentId){let e=n;n=r,r=e}return e.append(`rect`).style(`stroke`,`black`).style(`fill`,`black`).attr(`width`,n).attr(`height`,r).attr(`x`,i().state.padding).attr(`y`,i().state.padding)},`drawForkJoinState`),S=n((e,t,n,r)=>{let a=0,s=r.append(`text`);s.style(`text-anchor`,`start`),s.attr(`class`,`noteText`);let c=e.replace(/\r\n/g,`<br/>`);c=c.replace(/\n/g,`<br/>`);let l=c.split(o.lineBreakRegex),u=1.25*i().state.noteMargin;for(let e of l){let r=e.trim();if(r.length>0){let e=s.append(`tspan`);if(e.text(r),u===0){let t=e.node().getBBox();u+=t.height}a+=u,e.attr(`x`,t+i().state.noteMargin),e.attr(`y`,n+a+1.25*i().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:a}},`_drawLongText`),C=n((e,t)=>{t.attr(`class`,`state-note`);let n=t.append(`rect`).attr(`x`,0).attr(`y`,i().state.padding),{textWidth:r,textHeight:a}=S(e,0,0,t.append(`g`));return n.attr(`height`,a+2*i().state.noteMargin),n.attr(`width`,r+i().state.noteMargin*2),n},`drawNote`),w=n(function(e,t){let n=t.id,r={id:n,label:t.id,width:0,height:0},a=e.append(`g`).attr(`id`,n).attr(`class`,`stateGroup`);t.type===`start`&&h(a),t.type===`end`&&b(a),(t.type===`fork`||t.type===`join`)&&x(a,t),t.type===`note`&&C(t.note.text,a),t.type===`divider`&&g(a),t.type===`default`&&t.descriptions.length===0&&_(a,t),t.type===`default`&&t.descriptions.length>0&&v(a,t);let o=a.node().getBBox();return r.width=o.width+2*i().state.padding,r.height=o.height+2*i().state.padding,r},`drawState`),T=0,E=n(function(t,a,u){let d=n(function(e){switch(e){case m.relationType.AGGREGATION:return`aggregation`;case m.relationType.EXTENSION:return`extension`;case m.relationType.COMPOSITION:return`composition`;case m.relationType.DEPENDENCY:return`dependency`}},`getRelationType`);a.points=a.points.filter(e=>!Number.isNaN(e.y));let f=a.points,p=l().x(function(e){return e.x}).y(function(e){return e.y}).curve(s),h=t.append(`path`).attr(`d`,p(f)).attr(`id`,`edge`+T).attr(`class`,`transition`),g=``;if(i().state.arrowMarkerAbsolute&&(g=r(!0)),h.attr(`marker-end`,`url(`+g+`#`+d(m.relationType.DEPENDENCY)+`End)`),u.title!==void 0){let n=t.append(`g`).attr(`class`,`stateLabel`),{x:r,y:s}=c.calcLabelPosition(a.points),l=o.getRows(u.title),d=0,f=[],p=0,m=0;for(let t=0;t<=l.length;t++){let i=n.append(`text`).attr(`text-anchor`,`middle`).text(l[t]).attr(`x`,r).attr(`y`,s+d),a=i.node().getBBox();p=Math.max(p,a.width),m=Math.min(m,a.x),e.info(a.x,r,s+d),d===0&&(d=i.node().getBBox().height,e.info(`Title height`,d,s)),f.push(i)}let h=d*l.length;if(l.length>1){let e=(l.length-1)*d*.5;f.forEach((t,n)=>t.attr(`y`,s+n*d-e)),h=d*l.length}let g=n.node().getBBox();n.insert(`rect`,`:first-child`).attr(`class`,`box`).attr(`x`,r-p/2-i().state.padding/2).attr(`y`,s-h/2-i().state.padding/2-3.5).attr(`width`,p+i().state.padding).attr(`height`,h+i().state.padding),e.info(g)}T++},`drawEdge`),D,O={},k=n(function(){},`setConf`),A=n(function(e){e.append(`defs`).append(`marker`).attr(`id`,`dependencyEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`insertMarkers`),j=n(function(n,r,o,s){D=i().state;let c=i().securityLevel,l;c===`sandbox`&&(l=t(`#i`+r));let u=t(c===`sandbox`?l.nodes()[0].contentDocument.body:`body`),d=c===`sandbox`?l.nodes()[0].contentDocument:document;e.debug(`Rendering diagram `+n);let f=u.select(`[id='${r}']`);A(f),N(s.db.getRootDoc(),f.append(`g`).attr(`id`,r+`-root`),void 0,!1,u,d,s);let p=D.padding,m=f.node().getBBox(),h=m.width+p*2,g=m.height+p*2;a(f,g,h*1.75,D.useMaxWidth),f.attr(`viewBox`,`${m.x-D.padding} ${m.y-D.padding} `+h+` `+g)},`draw`),M=n(e=>e?e.length*D.fontSizeFactor:1,`getLabelWidth`),N=n((t,n,r,i,a,s,c)=>{let l=new u({compound:!0,multigraph:!0}),f,p=!0;for(f=0;f<t.length;f++)if(t[f].stmt===`relation`){p=!1;break}r?l.setGraph({rankdir:`LR`,multigraph:!0,compound:!0,ranker:`tight-tree`,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,isMultiGraph:!0}):l.setGraph({rankdir:`TB`,multigraph:!0,compound:!0,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,ranker:`tight-tree`,isMultiGraph:!0}),l.setDefaultEdgeLabel(function(){return{}});let m=c.db.getStates(),h=c.db.getRelations(),g=Object.keys(m);for(let e of g){let t=m[e];r&&(t.parentId=r);let o;if(t.doc){let e=n.append(`g`).attr(`id`,t.id).attr(`class`,`stateGroup`);o=N(t.doc,e,t.id,!i,a,s,c);{e=y(e,t,i);let n=e.node().getBBox();o.width=n.width,o.height=n.height+D.padding/2,O[t.id]={y:D.compositTitleSize}}}else o=w(n,t,l);if(t.note){let e=w(n,{descriptions:[],id:t.id+`-note`,note:t.note,type:`note`},l);t.note.position===`left of`?(l.setNode(o.id+`-note`,e),l.setNode(o.id,o)):(l.setNode(o.id,o),l.setNode(o.id+`-note`,e)),l.setParent(o.id,o.id+`-group`),l.setParent(o.id+`-note`,o.id+`-group`)}else l.setNode(o.id,o)}e.debug(`Count=`,l.nodeCount(),l);let _=0;h.forEach(function(t){_++,e.debug(`Setting edge`,t),l.setEdge(t.id1,t.id2,{relation:t,width:M(t.title),height:D.labelHeight*o.getRows(t.title).length,labelpos:`c`},`id`+_)}),d(l),e.debug(`Graph after layout`,l.nodes());let v=n.node();l.nodes().forEach(function(t){t!==void 0&&l.node(t)!==void 0?(e.warn(`Node `+t+`: `+JSON.stringify(l.node(t))),a.select(`#`+v.id+` #`+t).attr(`transform`,`translate(`+(l.node(t).x-l.node(t).width/2)+`,`+(l.node(t).y+(O[t]?O[t].y:0)-l.node(t).height/2)+` )`),a.select(`#`+v.id+` #`+t).attr(`data-x-shift`,l.node(t).x-l.node(t).width/2),s.querySelectorAll(`#`+v.id+` #`+t+` .divider`).forEach(e=>{let t=e.parentElement,n=0,r=0;t&&(t.parentElement&&(n=t.parentElement.getBBox().width),r=parseInt(t.getAttribute(`data-x-shift`),10),Number.isNaN(r)&&(r=0)),e.setAttribute(`x1`,0-r+8),e.setAttribute(`x2`,n-r-8)})):e.debug(`No Node `+t+`: `+JSON.stringify(l.node(t)))});let b=v.getBBox();l.edges().forEach(function(t){t!==void 0&&l.edge(t)!==void 0&&(e.debug(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(l.edge(t))),E(n,l.edge(t),l.edge(t).relation))}),b=v.getBBox();let x={id:r||`root`,label:r||`root`,width:0,height:0};return x.width=b.width+2*D.padding,x.height=b.height+2*D.padding,e.debug(`Doc rendered`,x,l),x},`renderDoc`),P={parser:p,get db(){return new m(1)},renderer:{setConf:k,draw:j},styles:f,init:n(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{P as diagram};
2
- //# sourceMappingURL=stateDiagram-FHFEXIEX-CiIJxbDV.mjs.map
1
+ import{T as e,p as t,w as n}from"./src-BkCVz_TJ.mjs";import{D as r,b as i,c as a,s as o}from"./chunk-ICPOFSXX-C--tVIY5.mjs";import{H as s,h as c}from"./chunk-5PVQY5BW-DUXm3tDu.mjs";import{t as l}from"./line-C6RZPh4T.mjs";import"./chunk-U2HBQHQK-C1Q2DiEX.mjs";import"./chunk-BSJP7CBP-BG3yJGkJ.mjs";import"./chunk-ZZ45TVLE-DwKS4e_N.mjs";import{t as u}from"./graphlib-BI4uS4Lx.mjs";import{t as d}from"./dagre-L3rg9n9q.mjs";import"./chunk-55IACEB6-Cmyc0XwJ.mjs";import"./chunk-EDXVE4YY-CI4s3JHP.mjs";import"./chunk-X2U36JSP-BiF0R9ys.mjs";import"./chunk-5FUZZQ4R-Bf6nbyQG.mjs";import"./chunk-ENJZ2VHE-CQwjtY5A.mjs";import"./chunk-336JU56O-KTMEs5Wk.mjs";import{i as f,n as p,t as m}from"./chunk-OYMX7WX6-Dvg98Zb-.mjs";var h=n(e=>e.append(`circle`).attr(`class`,`start-state`).attr(`r`,i().state.sizeUnit).attr(`cx`,i().state.padding+i().state.sizeUnit).attr(`cy`,i().state.padding+i().state.sizeUnit),`drawStartState`),g=n(e=>e.append(`line`).style(`stroke`,`grey`).style(`stroke-dasharray`,`3`).attr(`x1`,i().state.textHeight).attr(`class`,`divider`).attr(`x2`,i().state.textHeight*2).attr(`y1`,0).attr(`y2`,0),`drawDivider`),_=n((e,t)=>{let n=e.append(`text`).attr(`x`,2*i().state.padding).attr(`y`,i().state.textHeight+2*i().state.padding).attr(`font-size`,i().state.fontSize).attr(`class`,`state-title`).text(t.id),r=n.node().getBBox();return e.insert(`rect`,`:first-child`).attr(`x`,i().state.padding).attr(`y`,i().state.padding).attr(`width`,r.width+2*i().state.padding).attr(`height`,r.height+2*i().state.padding).attr(`rx`,i().state.radius),n},`drawSimpleState`),v=n((e,t)=>{let r=n(function(e,t,n){let r=e.append(`tspan`).attr(`x`,2*i().state.padding).text(t);n||r.attr(`dy`,i().state.textHeight)},`addTspan`),a=e.append(`text`).attr(`x`,2*i().state.padding).attr(`y`,i().state.textHeight+1.3*i().state.padding).attr(`font-size`,i().state.fontSize).attr(`class`,`state-title`).text(t.descriptions[0]).node().getBBox(),o=a.height,s=e.append(`text`).attr(`x`,i().state.padding).attr(`y`,o+i().state.padding*.4+i().state.dividerMargin+i().state.textHeight).attr(`class`,`state-description`),c=!0,l=!0;t.descriptions.forEach(function(e){c||(r(s,e,l),l=!1),c=!1});let u=e.append(`line`).attr(`x1`,i().state.padding).attr(`y1`,i().state.padding+o+i().state.dividerMargin/2).attr(`y2`,i().state.padding+o+i().state.dividerMargin/2).attr(`class`,`descr-divider`),d=s.node().getBBox(),f=Math.max(d.width,a.width);return u.attr(`x2`,f+3*i().state.padding),e.insert(`rect`,`:first-child`).attr(`x`,i().state.padding).attr(`y`,i().state.padding).attr(`width`,f+2*i().state.padding).attr(`height`,d.height+o+2*i().state.padding).attr(`rx`,i().state.radius),e},`drawDescrState`),y=n((e,t,n)=>{let r=i().state.padding,a=2*i().state.padding,o=e.node().getBBox(),s=o.width,c=o.x,l=e.append(`text`).attr(`x`,0).attr(`y`,i().state.titleShift).attr(`font-size`,i().state.fontSize).attr(`class`,`state-title`).text(t.id),u=l.node().getBBox().width+a,d=Math.max(u,s);d===s&&(d+=a);let f,p=e.node().getBBox();t.doc,f=c-r,u>s&&(f=(s-d)/2+r),Math.abs(c-p.x)<r&&u>s&&(f=c-(u-s)/2);let m=1-i().state.textHeight;return e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,m).attr(`class`,n?`alt-composit`:`composit`).attr(`width`,d).attr(`height`,p.height+i().state.textHeight+i().state.titleShift+1).attr(`rx`,`0`),l.attr(`x`,f+r),u<=s&&l.attr(`x`,c+(d-a)/2-u/2+r),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,i().state.titleShift-i().state.textHeight-i().state.padding).attr(`width`,d).attr(`height`,i().state.textHeight*3).attr(`rx`,i().state.radius),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,i().state.titleShift-i().state.textHeight-i().state.padding).attr(`width`,d).attr(`height`,p.height+3+2*i().state.textHeight).attr(`rx`,i().state.radius),e},`addTitleAndBox`),b=n(e=>(e.append(`circle`).attr(`class`,`end-state-outer`).attr(`r`,i().state.sizeUnit+i().state.miniPadding).attr(`cx`,i().state.padding+i().state.sizeUnit+i().state.miniPadding).attr(`cy`,i().state.padding+i().state.sizeUnit+i().state.miniPadding),e.append(`circle`).attr(`class`,`end-state-inner`).attr(`r`,i().state.sizeUnit).attr(`cx`,i().state.padding+i().state.sizeUnit+2).attr(`cy`,i().state.padding+i().state.sizeUnit+2)),`drawEndState`),x=n((e,t)=>{let n=i().state.forkWidth,r=i().state.forkHeight;if(t.parentId){let e=n;n=r,r=e}return e.append(`rect`).style(`stroke`,`black`).style(`fill`,`black`).attr(`width`,n).attr(`height`,r).attr(`x`,i().state.padding).attr(`y`,i().state.padding)},`drawForkJoinState`),S=n((e,t,n,r)=>{let a=0,s=r.append(`text`);s.style(`text-anchor`,`start`),s.attr(`class`,`noteText`);let c=e.replace(/\r\n/g,`<br/>`);c=c.replace(/\n/g,`<br/>`);let l=c.split(o.lineBreakRegex),u=1.25*i().state.noteMargin;for(let e of l){let r=e.trim();if(r.length>0){let e=s.append(`tspan`);if(e.text(r),u===0){let t=e.node().getBBox();u+=t.height}a+=u,e.attr(`x`,t+i().state.noteMargin),e.attr(`y`,n+a+1.25*i().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:a}},`_drawLongText`),C=n((e,t)=>{t.attr(`class`,`state-note`);let n=t.append(`rect`).attr(`x`,0).attr(`y`,i().state.padding),{textWidth:r,textHeight:a}=S(e,0,0,t.append(`g`));return n.attr(`height`,a+2*i().state.noteMargin),n.attr(`width`,r+i().state.noteMargin*2),n},`drawNote`),w=n(function(e,t){let n=t.id,r={id:n,label:t.id,width:0,height:0},a=e.append(`g`).attr(`id`,n).attr(`class`,`stateGroup`);t.type===`start`&&h(a),t.type===`end`&&b(a),(t.type===`fork`||t.type===`join`)&&x(a,t),t.type===`note`&&C(t.note.text,a),t.type===`divider`&&g(a),t.type===`default`&&t.descriptions.length===0&&_(a,t),t.type===`default`&&t.descriptions.length>0&&v(a,t);let o=a.node().getBBox();return r.width=o.width+2*i().state.padding,r.height=o.height+2*i().state.padding,r},`drawState`),T=0,E=n(function(t,a,u){let d=n(function(e){switch(e){case m.relationType.AGGREGATION:return`aggregation`;case m.relationType.EXTENSION:return`extension`;case m.relationType.COMPOSITION:return`composition`;case m.relationType.DEPENDENCY:return`dependency`}},`getRelationType`);a.points=a.points.filter(e=>!Number.isNaN(e.y));let f=a.points,p=l().x(function(e){return e.x}).y(function(e){return e.y}).curve(s),h=t.append(`path`).attr(`d`,p(f)).attr(`id`,`edge`+T).attr(`class`,`transition`),g=``;if(i().state.arrowMarkerAbsolute&&(g=r(!0)),h.attr(`marker-end`,`url(`+g+`#`+d(m.relationType.DEPENDENCY)+`End)`),u.title!==void 0){let n=t.append(`g`).attr(`class`,`stateLabel`),{x:r,y:s}=c.calcLabelPosition(a.points),l=o.getRows(u.title),d=0,f=[],p=0,m=0;for(let t=0;t<=l.length;t++){let i=n.append(`text`).attr(`text-anchor`,`middle`).text(l[t]).attr(`x`,r).attr(`y`,s+d),a=i.node().getBBox();p=Math.max(p,a.width),m=Math.min(m,a.x),e.info(a.x,r,s+d),d===0&&(d=i.node().getBBox().height,e.info(`Title height`,d,s)),f.push(i)}let h=d*l.length;if(l.length>1){let e=(l.length-1)*d*.5;f.forEach((t,n)=>t.attr(`y`,s+n*d-e)),h=d*l.length}let g=n.node().getBBox();n.insert(`rect`,`:first-child`).attr(`class`,`box`).attr(`x`,r-p/2-i().state.padding/2).attr(`y`,s-h/2-i().state.padding/2-3.5).attr(`width`,p+i().state.padding).attr(`height`,h+i().state.padding),e.info(g)}T++},`drawEdge`),D,O={},k=n(function(){},`setConf`),A=n(function(e){e.append(`defs`).append(`marker`).attr(`id`,`dependencyEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`insertMarkers`),j=n(function(n,r,o,s){D=i().state;let c=i().securityLevel,l;c===`sandbox`&&(l=t(`#i`+r));let u=t(c===`sandbox`?l.nodes()[0].contentDocument.body:`body`),d=c===`sandbox`?l.nodes()[0].contentDocument:document;e.debug(`Rendering diagram `+n);let f=u.select(`[id='${r}']`);A(f),N(s.db.getRootDoc(),f.append(`g`).attr(`id`,r+`-root`),void 0,!1,u,d,s);let p=D.padding,m=f.node().getBBox(),h=m.width+p*2,g=m.height+p*2;a(f,g,h*1.75,D.useMaxWidth),f.attr(`viewBox`,`${m.x-D.padding} ${m.y-D.padding} `+h+` `+g)},`draw`),M=n(e=>e?e.length*D.fontSizeFactor:1,`getLabelWidth`),N=n((t,n,r,i,a,s,c)=>{let l=new u({compound:!0,multigraph:!0}),f,p=!0;for(f=0;f<t.length;f++)if(t[f].stmt===`relation`){p=!1;break}r?l.setGraph({rankdir:`LR`,multigraph:!0,compound:!0,ranker:`tight-tree`,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,isMultiGraph:!0}):l.setGraph({rankdir:`TB`,multigraph:!0,compound:!0,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,ranker:`tight-tree`,isMultiGraph:!0}),l.setDefaultEdgeLabel(function(){return{}});let m=c.db.getStates(),h=c.db.getRelations(),g=Object.keys(m);for(let e of g){let t=m[e];r&&(t.parentId=r);let o;if(t.doc){let e=n.append(`g`).attr(`id`,t.id).attr(`class`,`stateGroup`);o=N(t.doc,e,t.id,!i,a,s,c);{e=y(e,t,i);let n=e.node().getBBox();o.width=n.width,o.height=n.height+D.padding/2,O[t.id]={y:D.compositTitleSize}}}else o=w(n,t,l);if(t.note){let e=w(n,{descriptions:[],id:t.id+`-note`,note:t.note,type:`note`},l);t.note.position===`left of`?(l.setNode(o.id+`-note`,e),l.setNode(o.id,o)):(l.setNode(o.id,o),l.setNode(o.id+`-note`,e)),l.setParent(o.id,o.id+`-group`),l.setParent(o.id+`-note`,o.id+`-group`)}else l.setNode(o.id,o)}e.debug(`Count=`,l.nodeCount(),l);let _=0;h.forEach(function(t){_++,e.debug(`Setting edge`,t),l.setEdge(t.id1,t.id2,{relation:t,width:M(t.title),height:D.labelHeight*o.getRows(t.title).length,labelpos:`c`},`id`+_)}),d(l),e.debug(`Graph after layout`,l.nodes());let v=n.node();l.nodes().forEach(function(t){t!==void 0&&l.node(t)!==void 0?(e.warn(`Node `+t+`: `+JSON.stringify(l.node(t))),a.select(`#`+v.id+` #`+t).attr(`transform`,`translate(`+(l.node(t).x-l.node(t).width/2)+`,`+(l.node(t).y+(O[t]?O[t].y:0)-l.node(t).height/2)+` )`),a.select(`#`+v.id+` #`+t).attr(`data-x-shift`,l.node(t).x-l.node(t).width/2),s.querySelectorAll(`#`+v.id+` #`+t+` .divider`).forEach(e=>{let t=e.parentElement,n=0,r=0;t&&(t.parentElement&&(n=t.parentElement.getBBox().width),r=parseInt(t.getAttribute(`data-x-shift`),10),Number.isNaN(r)&&(r=0)),e.setAttribute(`x1`,0-r+8),e.setAttribute(`x2`,n-r-8)})):e.debug(`No Node `+t+`: `+JSON.stringify(l.node(t)))});let b=v.getBBox();l.edges().forEach(function(t){t!==void 0&&l.edge(t)!==void 0&&(e.debug(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(l.edge(t))),E(n,l.edge(t),l.edge(t).relation))}),b=v.getBBox();let x={id:r||`root`,label:r||`root`,width:0,height:0};return x.width=b.width+2*D.padding,x.height=b.height+2*D.padding,e.debug(`Doc rendered`,x,l),x},`renderDoc`),P={parser:p,get db(){return new m(1)},renderer:{setConf:k,draw:j},styles:f,init:n(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{P as diagram};
2
+ //# sourceMappingURL=stateDiagram-FHFEXIEX-BREbMXiC.mjs.map
@@ -0,0 +1,2 @@
1
+ import{w as e}from"./src-BkCVz_TJ.mjs";import"./chunk-ICPOFSXX-C--tVIY5.mjs";import"./chunk-5PVQY5BW-DUXm3tDu.mjs";import"./chunk-U2HBQHQK-C1Q2DiEX.mjs";import"./chunk-BSJP7CBP-BG3yJGkJ.mjs";import"./chunk-ZZ45TVLE-DwKS4e_N.mjs";import"./chunk-55IACEB6-Cmyc0XwJ.mjs";import"./chunk-EDXVE4YY-CI4s3JHP.mjs";import"./chunk-X2U36JSP-BiF0R9ys.mjs";import"./chunk-5FUZZQ4R-Bf6nbyQG.mjs";import"./chunk-ENJZ2VHE-CQwjtY5A.mjs";import"./chunk-336JU56O-KTMEs5Wk.mjs";import{i as t,n,r,t as i}from"./chunk-OYMX7WX6-Dvg98Zb-.mjs";var a={parser:n,get db(){return new i(2)},renderer:r,styles:t,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
2
+ //# sourceMappingURL=stateDiagram-v2-QKLJ7IA2-DQeH2s3K.mjs.map
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import{n as e}from"./chunk-VYOJP4TV-DN1CSkP5.mjs";export{e as strings};
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import{n as e}from"./chunk-MHTUABJP-Dk5ocjFo.mjs";export{e as tac};
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import{n as e}from"./chunk-DCAAORBQ-BUMlCZ4-.mjs";export{e as tailCommand};
@@ -0,0 +1 @@
1
+ import"./chunk-YNYSPYQ5-gU4-j5DO.mjs";import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import"./chunk-5QMZ5MUS-BwpNU33k.mjs";import{n as e}from"./chunk-BRGMQKJV-CZUkYGAZ.mjs";export{e as tarCommand};
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import{n as e}from"./chunk-55VFSPNA-RFvY6zq0.mjs";export{e as teeCommand};
@@ -0,0 +1 @@
1
+ import"./chunk-CWQS3NFK-BkE4vqrf.mjs";import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import{n as e}from"./chunk-Z6LRHWXI-EsbeaQ3V.mjs";export{e as timeCommand};
@@ -1,4 +1,4 @@
1
- import{C as e,T as t,p as n,w as r}from"./src-BkCVz_TJ.mjs";import{$ as i,K as a,Q as o,a as s,b as c,o as l,tt as u,y as d}from"./chunk-ICPOFSXX-D0MVsm4H.mjs";import{t as f}from"./arc-Doj9VrmJ.mjs";import{f as p}from"./chunk-5PVQY5BW-C5V4E1lO.mjs";import{t as m}from"./chunk-426QAEUC-BGn1TCpd.mjs";var h=(function(){var e=r(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],a=[1,14],o=[1,15],s=[1,16],c=[1,19],l=[1,20],u={trace:r(function(){},`trace`),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:`error`,6:`EOF`,7:`timeline`,8:`timeline_lr`,9:`timeline_td`,11:`SPACE`,13:`NEWLINE`,14:`title`,15:`acc_title`,16:`acc_title_value`,17:`acc_descr`,18:`acc_descr_value`,19:`acc_descr_multiline_value`,20:`section`,23:`period`,24:`event`},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:r(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 3:r.setDirection(`LR`);break;case 4:r.setDirection(`TD`);break;case 5:this.$=[];break;case 6:a[s-1].push(a[s]),this.$=a[s-1];break;case 7:case 8:this.$=a[s];break;case 9:case 10:this.$=[];break;case 11:r.getCommonDb().setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 12:this.$=a[s].trim(),r.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=a[s].trim(),r.getCommonDb().setAccDescription(this.$);break;case 15:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 18:r.addTask(a[s],0,``),this.$=a[s];break;case 19:r.addEvent(a[s].substr(2)),this.$=a[s];break}},`anonymous`),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:a,19:o,20:s,21:17,22:18,23:c,24:l},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:a,19:o,20:s,21:17,22:18,23:c,24:l},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:r(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:r(function(e){var t=this,n=[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(e,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){n.length-=2*e,a.length-=e,o.length-=e}r(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=t.symbols_[e]||e),e}r(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=n[n.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{C as e,T as t,p as n,w as r}from"./src-BkCVz_TJ.mjs";import{$ as i,K as a,Q as o,a as s,b as c,o as l,tt as u,y as d}from"./chunk-ICPOFSXX-C--tVIY5.mjs";import{t as f}from"./arc-Doj9VrmJ.mjs";import{f as p}from"./chunk-5PVQY5BW-DUXm3tDu.mjs";import{t as m}from"./chunk-426QAEUC-DUpKwtVu.mjs";var h=(function(){var e=r(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],a=[1,14],o=[1,15],s=[1,16],c=[1,19],l=[1,20],u={trace:r(function(){},`trace`),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:`error`,6:`EOF`,7:`timeline`,8:`timeline_lr`,9:`timeline_td`,11:`SPACE`,13:`NEWLINE`,14:`title`,15:`acc_title`,16:`acc_title_value`,17:`acc_descr`,18:`acc_descr_value`,19:`acc_descr_multiline_value`,20:`section`,23:`period`,24:`event`},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:r(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 3:r.setDirection(`LR`);break;case 4:r.setDirection(`TD`);break;case 5:this.$=[];break;case 6:a[s-1].push(a[s]),this.$=a[s-1];break;case 7:case 8:this.$=a[s];break;case 9:case 10:this.$=[];break;case 11:r.getCommonDb().setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 12:this.$=a[s].trim(),r.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=a[s].trim(),r.getCommonDb().setAccDescription(this.$);break;case 15:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 18:r.addTask(a[s],0,``),this.$=a[s];break;case 19:r.addEvent(a[s].substr(2)),this.$=a[s];break}},`anonymous`),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:a,19:o,20:s,21:17,22:18,23:c,24:l},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:a,19:o,20:s,21:17,22:18,23:c,24:l},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:r(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:r(function(e){var t=this,n=[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(e,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){n.length-=2*e,a.length-=e,o.length-=e}r(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=t.symbols_[e]||e),e}r(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=n[n.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:n.push(S),a.push(h.yytext),o.push(h.yylloc),n.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&&(n=n.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),n.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0},`parse`)};u.lexer=(function(){return{EOF:1,parseError:r(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:r(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:r(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:r(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:r(function(){return this._more=!0,this},`more`),reject:r(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:r(function(e){this.unput(this.match.slice(e))},`less`),pastInput:r(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:r(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:r(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
@@ -118,4 +118,4 @@ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on l
118
118
  filter: brightness(120%);
119
119
  }
120
120
  `},`getStyles`)};export{Se as diagram};
121
- //# sourceMappingURL=timeline-definition-GMOUNBTQ-BBhlpYO9.mjs.map
121
+ //# sourceMappingURL=timeline-definition-GMOUNBTQ-Bd7XEw7o.mjs.map
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import"./chunk-5QMZ5MUS-BwpNU33k.mjs";import"./chunk-A5O5YHGN-DApqA6Ow.mjs";import{n as e}from"./chunk-YTNYSM6T-DpkSVTln.mjs";export{e as timeoutCommand};
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import{t as e}from"./chunk-OCLXQMOG-DOkdFgyf.mjs";export{e as touchCommand};
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import{n as e}from"./chunk-62RKD26F-DebCAz0V.mjs";export{e as trCommand};
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import{n as e}from"./chunk-XVDPCNWR-CkzIJQaO.mjs";export{e as treeCommand};
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import{i as e,t}from"./chunk-R6QSAL5T-RaNW7MSS.mjs";export{e as falseCommand,t as trueCommand};
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import{n as e}from"./chunk-PYSFUGCK-B_Gv8rUn.mjs";export{e as unexpand};
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import{t as e}from"./chunk-WKFATFPP-CoPg2OGf.mjs";export{e as uniqCommand};
@@ -1,4 +1,4 @@
1
- import{s as e}from"./chunk-C94x7I9S.mjs";import{p as t,w as n}from"./src-BkCVz_TJ.mjs";import{$ as r,B as i,C as a,Q as o,V as s,W as c,_ as l,a as u,c as d,d as f,et as p,tt as m,v as h,y as g}from"./chunk-ICPOFSXX-D0MVsm4H.mjs";import{r as _}from"./chunk-5PVQY5BW-C5V4E1lO.mjs";import{t as v}from"./chunk-426QAEUC-BGn1TCpd.mjs";import{t as y}from"./rough.cjs-C-63phNL.mjs";const b=(e,t)=>p(e,`a`,-t),x=1e-10;function S(e,t){let n=w(e),r=n.filter(t=>C(t,e)),i=0,a=0,o=[];if(r.length>1){let t=k(r);for(let e=0;e<r.length;++e){let n=r[e];n.angle=Math.atan2(n.x-t.x,n.y-t.y)}r.sort((e,t)=>t.angle-e.angle);let n=r[r.length-1];for(let t=0;t<r.length;++t){let s=r[t];a+=(n.x+s.x)*(s.y-n.y);let c={x:(s.x+n.x)/2,y:(s.y+n.y)/2},l=null;for(let t=0;t<s.parentIndex.length;++t)if(n.parentIndex.includes(s.parentIndex[t])){let r=e[s.parentIndex[t]],i=Math.atan2(s.x-r.x,s.y-r.y),a=Math.atan2(n.x-r.x,n.y-r.y),o=a-i;o<0&&(o+=2*Math.PI);let u=a-o/2,d=E(c,{x:r.x+r.radius*Math.sin(u),y:r.y+r.radius*Math.cos(u)});d>r.radius*2&&(d=r.radius*2),(l==null||l.width>d)&&(l={circle:r,width:d,p1:s,p2:n,large:d>r.radius,sweep:!0})}l!=null&&(o.push(l),i+=T(l.circle.radius,l.width),n=s)}}else{let t=e[0];for(let n=1;n<e.length;++n)e[n].radius<t.radius&&(t=e[n]);let n=!1;for(let r=0;r<e.length;++r)if(E(e[r],t)>Math.abs(t.radius-e[r].radius)){n=!0;break}n?i=a=0:(i=t.radius*t.radius*Math.PI,o.push({circle:t,p1:{x:t.x,y:t.y+t.radius},p2:{x:t.x-x,y:t.y+t.radius},width:t.radius*2,large:!0,sweep:!0}))}return a/=2,t&&(t.area=i+a,t.arcArea=i,t.polygonArea=a,t.arcs=o,t.innerPoints=r,t.intersectionPoints=n),i+a}function C(e,t){return t.every(t=>E(e,t)<t.radius+x)}function w(e){let t=[];for(let n=0;n<e.length;++n)for(let r=n+1;r<e.length;++r){let i=O(e[n],e[r]);for(let e of i)e.parentIndex=[n,r],t.push(e)}return t}function T(e,t){return e*e*Math.acos(1-t/e)-(e-t)*Math.sqrt(t*(2*e-t))}function E(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))}function D(e,t,n){if(n>=e+t)return 0;if(n<=Math.abs(e-t))return Math.PI*Math.min(e,t)*Math.min(e,t);let r=e-(n*n-t*t+e*e)/(2*n),i=t-(n*n-e*e+t*t)/(2*n);return T(e,r)+T(t,i)}function O(e,t){let n=E(e,t),r=e.radius,i=t.radius;if(n>=r+i||n<=Math.abs(r-i))return[];let a=(r*r-i*i+n*n)/(2*n),o=Math.sqrt(r*r-a*a),s=e.x+a*(t.x-e.x)/n,c=e.y+a*(t.y-e.y)/n,l=-(t.y-e.y)*(o/n),u=-(t.x-e.x)*(o/n);return[{x:s+l,y:c-u},{x:s-l,y:c+u}]}function k(e){let t={x:0,y:0};for(let n of e)t.x+=n.x,t.y+=n.y;return t.x/=e.length,t.y/=e.length,t}function A(e,t,n,r){r||={};let i=r.maxIterations||100,a=r.tolerance||1e-10,o=e(t),s=e(n),c=n-t;if(o*s>0)throw`Initial bisect points must have opposite signs`;if(o===0)return t;if(s===0)return n;for(let n=0;n<i;++n){c/=2;let n=t+c,r=e(n);if(r*o>=0&&(t=n),Math.abs(c)<a||r===0)return n}return t+c}function j(e){let t=Array(e);for(let n=0;n<e;++n)t[n]=0;return t}function M(e,t){return j(e).map(()=>j(t))}function N(e,t){let n=0;for(let r=0;r<e.length;++r)n+=e[r]*t[r];return n}function P(e){return Math.sqrt(N(e,e))}function F(e,t,n){for(let r=0;r<t.length;++r)e[r]=t[r]*n}function I(e,t,n,r,i){for(let a=0;a<e.length;++a)e[a]=t*n[a]+r*i[a]}function L(e,t,n){n||={};let r=n.maxIterations||t.length*200,i=n.nonZeroDelta||1.05,a=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,s=n.minErrorDelta||1e-5,c=n.rho===void 0?1:n.rho,l=n.chi===void 0?2:n.chi,u=n.psi===void 0?-.5:n.psi,d=n.sigma===void 0?.5:n.sigma,f,p=t.length,m=Array(p+1);m[0]=t,m[0].fx=e(t),m[0].id=0;for(let n=0;n<p;++n){let r=t.slice();r[n]=r[n]?r[n]*i:a,m[n+1]=r,m[n+1].fx=e(r),m[n+1].id=n+1}function h(e){for(let t=0;t<e.length;t++)m[p][t]=e[t];m[p].fx=e.fx}let g=(e,t)=>e.fx-t.fx,_=t.slice(),v=t.slice(),y=t.slice(),b=t.slice();for(let t=0;t<r;++t){if(m.sort(g),n.history){let e=m.map(e=>{let t=e.slice();return t.fx=e.fx,t.id=e.id,t});e.sort((e,t)=>e.id-t.id),n.history.push({x:m[0].slice(),fx:m[0].fx,simplex:e})}f=0;for(let e=0;e<p;++e)f=Math.max(f,Math.abs(m[0][e]-m[1][e]));if(Math.abs(m[0].fx-m[p].fx)<o&&f<s)break;for(let e=0;e<p;++e){_[e]=0;for(let t=0;t<p;++t)_[e]+=m[t][e];_[e]/=p}let t=m[p];if(I(v,1+c,_,-c,t),v.fx=e(v),v.fx<m[0].fx)I(b,1+l,_,-l,t),b.fx=e(b),b.fx<v.fx?h(b):h(v);else if(v.fx>=m[p-1].fx){let n=!1;if(v.fx>t.fx?(I(y,1+u,_,-u,t),y.fx=e(y),y.fx<t.fx?h(y):n=!0):(I(y,1-u*c,_,u*c,t),y.fx=e(y),y.fx<v.fx?h(y):n=!0),n){if(d>=1)break;for(let t=1;t<m.length;++t)I(m[t],1-d,m[0],d,m[t]),m[t].fx=e(m[t])}}else h(v)}return m.sort(g),{fx:m[0].fx,x:m[0]}}function R(e,t,n,r,i,a,o){let s=n.fx,c=N(n.fxprime,t),l=s,u=s,d=c,f=0;i||=1,a||=1e-6,o||=.1;function p(u,f,p){for(let m=0;m<16;++m)if(i=(u+f)/2,I(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=N(r.fxprime,t),l>s+a*i*c||l>=p)f=i;else{if(Math.abs(d)<=-o*c)return i;d*(f-u)>=0&&(f=u),u=i,p=l}return 0}for(let m=0;m<10;++m){if(I(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=N(r.fxprime,t),l>s+a*i*c||m&&l>=u)return p(f,i,u);if(Math.abs(d)<=-o*c)return i;if(d>=0)return p(i,f,l);u=l,f=i,i*=2}return i}function ee(e,t,n){let r={x:t.slice(),fx:0,fxprime:t.slice()},i={x:t.slice(),fx:0,fxprime:t.slice()},a=t.slice(),o,s,c=1,l;n||={},l=n.maxIterations||t.length*20,r.fx=e(r.x,r.fxprime),o=r.fxprime.slice(),F(o,r.fxprime,-1);for(let t=0;t<l;++t){if(c=R(e,o,r,i,c),n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),!c)F(o,r.fxprime,-1);else{I(a,1,i.fxprime,-1,r.fxprime);let e=N(r.fxprime,r.fxprime),t=Math.max(0,N(a,i.fxprime)/e);I(o,t,o,-1,i.fxprime),s=r,r=i,i=s}if(P(r.fxprime)<=1e-5)break}return n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),r}function te(e,t={}){t.maxIterations=t.maxIterations||500;let n=t.initialLayout||oe,r=t.lossFunction||B,i=re(e,t),a=n(i,t),o=Object.keys(a),s=[];for(let e of o)s.push(a[e].x),s.push(a[e].y);let c=L(e=>{let t={};for(let n=0;n<o.length;++n){let r=o[n];t[r]={x:e[2*n],y:e[2*n+1],radius:a[r].radius}}return r(t,i)},s,t).x;for(let e=0;e<o.length;++e){let t=o[e];a[t].x=c[2*e],a[t].y=c[2*e+1]}return a}const ne=1e-10;function z(e,t,n){return Math.min(e,t)*Math.min(e,t)*Math.PI<=n+ne?Math.abs(e-t):A(r=>D(e,t,r)-n,0,e+t)}function re(e,t={}){let n=t.distinct,r=e.map(e=>Object.assign({},e));function i(e){return e.join(`;`)}if(n){let e=new Map;for(let t of r)for(let n=0;n<t.sets.length;n++){let r=String(t.sets[n]);e.set(r,t.size+(e.get(r)||0));for(let i=n+1;i<t.sets.length;i++){let n=String(t.sets[i]),a=`${r};${n}`,o=`${n};${r}`;e.set(a,t.size+(e.get(a)||0)),e.set(o,t.size+(e.get(o)||0))}}for(let t of r)t.sets.length<3&&(t.size=e.get(i(t.sets)))}let a=[],o=new Set;for(let e of r)if(e.sets.length===1)a.push(e.sets[0]);else if(e.sets.length===2){let t=e.sets[0],n=e.sets[1];o.add(i(e.sets)),o.add(i([n,t]))}a.sort((e,t)=>e===t?0:e<t?-1:1);for(let e=0;e<a.length;++e){let t=a[e];for(let n=e+1;n<a.length;++n){let e=a[n];o.has(i([t,e]))||r.push({sets:[t,e],size:0})}}return r}function ie(e,t,n){let r=M(t.length,t.length),i=M(t.length,t.length);return e.filter(e=>e.sets.length===2).forEach(e=>{let a=n[e.sets[0]],o=n[e.sets[1]],s=z(Math.sqrt(t[a].size/Math.PI),Math.sqrt(t[o].size/Math.PI),e.size);r[a][o]=r[o][a]=s;let c=0;e.size+1e-10>=Math.min(t[a].size,t[o].size)?c=1:e.size<=1e-10&&(c=-1),i[a][o]=i[o][a]=c}),{distances:r,constraints:i}}function ae(e,t,n,r){for(let e=0;e<t.length;++e)t[e]=0;let i=0;for(let a=0;a<n.length;++a){let o=e[2*a],s=e[2*a+1];for(let c=a+1;c<n.length;++c){let l=e[2*c],u=e[2*c+1],d=n[a][c],f=r[a][c],p=(l-o)*(l-o)+(u-s)*(u-s),m=Math.sqrt(p),h=p-d*d;f>0&&m<=d||f<0&&m>=d||(i+=2*h*h,t[2*a]+=4*h*(o-l),t[2*a+1]+=4*h*(s-u),t[2*c]+=4*h*(l-o),t[2*c+1]+=4*h*(u-s))}}return i}function oe(e,t={}){let n=ce(e,t),r=t.lossFunction||B;if(e.length>=8){let i=se(e,t),a=r(i,e),o=r(n,e);a+1e-8<o&&(n=i)}return n}function se(e,t={}){let n=t.restarts||10,r=[],i={};for(let t of e)t.sets.length===1&&(i[t.sets[0]]=r.length,r.push(t));let{distances:a,constraints:o}=ie(e,r,i),s=P(a.map(P))/a.length;a=a.map(e=>e.map(e=>e/s));let c=(e,t)=>ae(e,t,a,o),l=null;for(let e=0;e<n;++e){let e=ee(c,j(a.length*2).map(Math.random),t);(!l||e.fx<l.fx)&&(l=e)}let u=l.x,d={};for(let e=0;e<r.length;++e){let t=r[e];d[t.sets[0]]={x:u[2*e]*s,y:u[2*e+1]*s,radius:Math.sqrt(t.size/Math.PI)}}if(t.history)for(let e of t.history)F(e.x,s);return d}function ce(e,t){let n=t&&t.lossFunction?t.lossFunction:B,r={},i={};for(let t of e)if(t.sets.length===1){let e=t.sets[0];r[e]={x:1e10,y:1e10,rowid:r.length,size:t.size,radius:Math.sqrt(t.size/Math.PI)},i[e]=[]}e=e.filter(e=>e.sets.length===2);for(let t of e){let e=t.weight==null?1:t.weight,n=t.sets[0],a=t.sets[1];t.size+ne>=Math.min(r[n].size,r[a].size)&&(e=0),i[n].push({set:a,size:t.size,weight:e}),i[a].push({set:n,size:t.size,weight:e})}let a=[];Object.keys(i).forEach(e=>{let t=0;for(let n=0;n<i[e].length;++n)t+=i[e][n].size*i[e][n].weight;a.push({set:e,size:t})});function o(e,t){return t.size-e.size}a.sort(o);let s={};function c(e){return e.set in s}function l(e,t){r[t].x=e.x,r[t].y=e.y,s[t]=!0}l({x:0,y:0},a[0].set);for(let t=1;t<a.length;++t){let s=a[t].set,d=i[s].filter(c),f=r[s];if(d.sort(o),d.length===0)throw`ERROR: missing pairwise overlap information`;let p=[];for(var u=0;u<d.length;++u){let e=r[d[u].set],t=z(f.radius,e.radius,d[u].size);p.push({x:e.x+t,y:e.y}),p.push({x:e.x-t,y:e.y}),p.push({y:e.y+t,x:e.x}),p.push({y:e.y-t,x:e.x});for(let n=u+1;n<d.length;++n){let i=r[d[n].set],a=z(f.radius,i.radius,d[n].size),o=O({x:e.x,y:e.y,radius:t},{x:i.x,y:i.y,radius:a});p.push(...o)}}let m=1e50,h=p[0];for(let t of p){r[s].x=t.x,r[s].y=t.y;let i=n(r,e);i<m&&(m=i,h=t)}l(h,s)}return r}function B(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=D(n.radius,i.radius,E(n,i))}else t=S(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight;n+=i*(t-r.size)*(t-r.size)}return n}function le(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=D(n.radius,i.radius,E(n,i))}else t=S(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight,a=Math.log((t+1)/(r.size+1));n+=i*a*a}return n}function ue(e,t,n){if(n==null?e.sort((e,t)=>t.radius-e.radius):e.sort(n),e.length>0){let t=e[0].x,n=e[0].y;for(let r of e)r.x-=t,r.y-=n}if(e.length===2&&E(e[0],e[1])<Math.abs(e[1].radius-e[0].radius)&&(e[1].x=e[0].x+e[0].radius-e[1].radius-1e-10,e[1].y=e[0].y),e.length>1){let n=Math.atan2(e[1].x,e[1].y)-t,r=Math.cos(n),i=Math.sin(n);for(let t of e){let e=t.x,n=t.y;t.x=r*e-i*n,t.y=i*e+r*n}}if(e.length>2){let n=Math.atan2(e[2].x,e[2].y)-t;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){let t=e[1].y/(1e-10+e[1].x);for(let n of e){var r=(n.x+t*n.y)/(1+t*t);n.x=2*r-n.x,n.y=2*r*t-n.y}}}}function de(e){e.forEach(e=>{e.parent=e});function t(e){return e.parent!==e&&(e.parent=t(e.parent)),e.parent}function n(e,n){let r=t(e);r.parent=t(n)}for(let t=0;t<e.length;++t)for(let r=t+1;r<e.length;++r){let i=e[t].radius+e[r].radius;E(e[t],e[r])+1e-10<i&&n(e[r],e[t])}let r=new Map;for(let n=0;n<e.length;++n){let i=t(e[n]).parent.setid;r.has(i)||r.set(i,[]),r.get(i).push(e[n])}return e.forEach(e=>{delete e.parent}),Array.from(r.values())}function V(e){let t=t=>({max:e.reduce((e,n)=>Math.max(e,n[t]+n.radius),-1/0),min:e.reduce((e,n)=>Math.min(e,n[t]-n.radius),1/0)});return{xRange:t(`x`),yRange:t(`y`)}}function fe(e,t,n){t??=Math.PI/2;let r=he(e).map(e=>Object.assign({},e)),i=de(r);for(let e of i){ue(e,t,n);let r=V(e);e.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),e.bounds=r}i.sort((e,t)=>t.size-e.size),r=i[0];let a=r.bounds,o=(a.xRange.max-a.xRange.min)/50;function s(e,t,n){if(!e)return;let i=e.bounds,s,c;if(t)s=a.xRange.max-i.xRange.min+o;else{s=a.xRange.max-i.xRange.max;let e=(i.xRange.max-i.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;e<0&&(s+=e)}if(n)c=a.yRange.max-i.yRange.min+o;else{c=a.yRange.max-i.yRange.max;let e=(i.yRange.max-i.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;e<0&&(c+=e)}for(let t of e)t.x+=s,t.y+=c,r.push(t)}let c=1;for(;c<i.length;)s(i[c],!0,!1),s(i[c+1],!1,!0),s(i[c+2],!0,!0),c+=3,a=V(r);return me(r)}function pe(e,t,n,r,i){let a=he(e);t-=2*r,n-=2*r;let{xRange:o,yRange:s}=V(a);if(o.max===o.min||s.max===s.min)return console.log(`not scaling solution: zero size detected`),e;let c,l;if(i){let e=Math.sqrt(i/Math.PI)*2;c=t/e,l=n/e}else c=t/(o.max-o.min),l=n/(s.max-s.min);let u=Math.min(l,c),d=(t-(o.max-o.min)*u)/2,f=(n-(s.max-s.min)*u)/2;return me(a.map(e=>({radius:u*e.radius,x:r+d+(e.x-o.min)*u,y:r+f+(e.y-s.min)*u,setid:e.setid})))}function me(e){let t={};for(let n of e)t[n.setid]=n;return t}function he(e){return Object.keys(e).map(t=>Object.assign(e[t],{setid:t}))}function ge(e={}){let t=!1,n=600,r=350,i=15,a=1e3,o=Math.PI/2,s=!0,c=null,l=!0,u=!0,d=null,f=null,p=!1,m=null,h=e&&e.symmetricalTextCentre?e.symmetricalTextCentre:!1,g={},_=e&&e.colourScheme?e.colourScheme:e&&e.colorScheme?e.colorScheme:[`#1f77b4`,`#ff7f0e`,`#2ca02c`,`#d62728`,`#9467bd`,`#8c564b`,`#e377c2`,`#7f7f7f`,`#bcbd22`,`#17becf`],v=0,y=function(e){if(e in g)return g[e];var t=g[e]=_[v];return v+=1,v>=_.length&&(v=0),t},b=te,x=B;function S(g){let _=g.datum(),v=new Set;_.forEach(e=>{e.size==0&&e.sets.length==1&&v.add(e.sets[0])}),_=_.filter(e=>!e.sets.some(e=>v.has(e)));let S={},C={};if(_.length>0){let e=b(_,{lossFunction:x,distinct:p});s&&(e=fe(e,o,f)),S=pe(e,n,r,i,c),C=ye(S,_,h)}let w={};_.forEach(e=>{e.label&&(w[e.sets]=e.label)});function T(e){if(e.sets in w)return w[e.sets];if(e.sets.length==1)return``+e.sets[0]}g.selectAll(`svg`).data([S]).enter().append(`svg`);let E=g.select(`svg`);t?E.attr(`viewBox`,`0 0 ${n} ${r}`):E.attr(`width`,n).attr(`height`,r);let D={},O=!1;E.selectAll(`.venn-area path`).each(function(e){let t=this.getAttribute(`d`);e.sets.length==1&&t&&!p&&(O=!0,D[e.sets[0]]=xe(t))});function k(e){return t=>we(e.sets.map(e=>{let i=D[e],a=S[e];return i||={x:n/2,y:r/2,radius:1},a||={x:n/2,y:r/2,radius:1},{x:i.x*(1-t)+a.x*t,y:i.y*(1-t)+a.y*t,radius:i.radius*(1-t)+a.radius*t}}),m)}let A=E.selectAll(`.venn-area`).data(_,e=>e.sets),j=A.enter().append(`g`).attr(`class`,e=>`venn-area venn-${e.sets.length==1?`circle`:`intersection`}${e.colour||e.color?` venn-coloured`:``}`).attr(`data-venn-sets`,e=>e.sets.join(`_`)),M=j.append(`path`),N=j.append(`text`).attr(`class`,`label`).text(e=>T(e)).attr(`text-anchor`,`middle`).attr(`dy`,`.35em`).attr(`x`,n/2).attr(`y`,r/2);u&&(M.style(`fill-opacity`,`0`).filter(e=>e.sets.length==1).style(`fill`,e=>e.colour?e.colour:e.color?e.color:y(e.sets)).style(`fill-opacity`,`.25`),N.style(`fill`,t=>t.colour||t.color?`#FFF`:e.textFill?e.textFill:t.sets.length==1?y(t.sets):`#444`));function P(e){return typeof e.transition==`function`?e.transition(`venn`).duration(a):e}let F=g;O&&typeof F.transition==`function`?(F=P(g),F.selectAll(`path`).attrTween(`d`,k)):F.selectAll(`path`).attr(`d`,e=>we(e.sets.map(e=>S[e])),m);let I=F.selectAll(`text`).filter(e=>e.sets in C).text(e=>T(e)).attr(`x`,e=>Math.floor(C[e.sets].x)).attr(`y`,e=>Math.floor(C[e.sets].y));l&&(O?`on`in I?I.on(`end`,H(S,T)):I.each(`end`,H(S,T)):I.each(H(S,T)));let L=P(A.exit()).remove();typeof A.transition==`function`&&L.selectAll(`path`).attrTween(`d`,k);let R=L.selectAll(`text`).attr(`x`,n/2).attr(`y`,r/2);return d!==null&&(N.style(`font-size`,`0px`),I.style(`font-size`,d),R.style(`font-size`,`0px`)),{circles:S,textCentres:C,nodes:A,enter:j,update:F,exit:L}}return S.wrap=function(e){return arguments.length?(l=e,S):l},S.useViewBox=function(){return t=!0,S},S.width=function(e){return arguments.length?(n=e,S):n},S.height=function(e){return arguments.length?(r=e,S):r},S.padding=function(e){return arguments.length?(i=e,S):i},S.distinct=function(e){return arguments.length?(p=e,S):p},S.colours=function(e){return arguments.length?(y=e,S):y},S.colors=function(e){return arguments.length?(y=e,S):y},S.fontSize=function(e){return arguments.length?(d=e,S):d},S.round=function(e){return arguments.length?(m=e,S):m},S.duration=function(e){return arguments.length?(a=e,S):a},S.layoutFunction=function(e){return arguments.length?(b=e,S):b},S.normalize=function(e){return arguments.length?(s=e,S):s},S.scaleToFit=function(e){return arguments.length?(c=e,S):c},S.styled=function(e){return arguments.length?(u=e,S):u},S.orientation=function(e){return arguments.length?(o=e,S):o},S.orientationOrder=function(e){return arguments.length?(f=e,S):f},S.lossFunction=function(e){return arguments.length?(x=e===`default`?B:e===`logRatio`?le:e,S):x},S}function H(e,t){return function(n){let r=this,i=e[n.sets[0]].radius||50,a=t(n)||``,o=a.split(/\s+/).reverse(),s=(a.length+o.length)/3,c=o.pop(),l=[c],u=0,d=1.1;r.textContent=null;let f=[];function p(e){let t=r.ownerDocument.createElementNS(r.namespaceURI,`tspan`);return t.textContent=e,f.push(t),r.append(t),t}let m=p(c);for(;c=o.pop(),c;){l.push(c);let e=l.join(` `);m.textContent=e,e.length>s&&m.getComputedTextLength()>i&&(l.pop(),m.textContent=l.join(` `),l=[c],m=p(c),u++)}let h=.35-u*d/2,g=r.getAttribute(`x`),_=r.getAttribute(`y`);f.forEach((e,t)=>{e.setAttribute(`x`,g),e.setAttribute(`y`,_),e.setAttribute(`dy`,`${h+t*d}em`)})}}function U(e,t,n){let r=t[0].radius-E(t[0],e);for(let n=1;n<t.length;++n){let i=t[n].radius-E(t[n],e);i<=r&&(r=i)}for(let t=0;t<n.length;++t){let i=E(n[t],e)-n[t].radius;i<=r&&(r=i)}return r}function _e(e,t,n){let r=[];for(let t of e)r.push({x:t.x,y:t.y}),r.push({x:t.x+t.radius/2,y:t.y}),r.push({x:t.x-t.radius/2,y:t.y}),r.push({x:t.x,y:t.y+t.radius/2}),r.push({x:t.x,y:t.y-t.radius/2});let i=r[0],a=U(r[0],e,t);for(let n=1;n<r.length;++n){let o=U(r[n],e,t);o>=a&&(i=r[n],a=o)}let o=L(n=>-1*U({x:n[0],y:n[1]},e,t),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,s={x:n?0:o[0],y:o[1]},c=!0;for(let t of e)if(E(s,t)>t.radius){c=!1;break}for(let e of t)if(E(s,e)<e.radius){c=!1;break}if(c)return s;if(e.length==1)return{x:e[0].x,y:e[0].y};let l={};return S(e,l),l.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:l.arcs.length==1?{x:l.arcs[0].circle.x,y:l.arcs[0].circle.y}:t.length?_e(e,[]):k(l.arcs.map(e=>e.p1))}function ve(e){let t={},n=Object.keys(e);for(let e of n)t[e]=[];for(let r=0;r<n.length;r++){let i=n[r],a=e[i];for(let o=r+1;o<n.length;++o){let r=n[o],s=e[r],c=E(a,s);c+s.radius<=a.radius+1e-10?t[r].push(i):c+a.radius<=s.radius+1e-10&&t[i].push(r)}}return t}function ye(e,t,n){let r={},i=ve(e);for(let a=0;a<t.length;++a){let o=t[a].sets,s={},c={};for(let e=0;e<o.length;++e){s[o[e]]=!0;let t=i[o[e]];for(let e=0;e<t.length;++e)c[t[e]]=!0}let l=[],u=[];for(let t in e)t in s?l.push(e[t]):t in c||u.push(e[t]);let d=_e(l,u,n);r[o]=d,d.disjoint&&t[a].size>0&&console.log(`WARNING: area `+o+` not represented on screen`)}return r}function be(e,t,n){let r=[];return r.push(`
1
+ import{s as e}from"./chunk-C94x7I9S.mjs";import{p as t,w as n}from"./src-BkCVz_TJ.mjs";import{$ as r,B as i,C as a,Q as o,V as s,W as c,_ as l,a as u,c as d,d as f,et as p,tt as m,v as h,y as g}from"./chunk-ICPOFSXX-C--tVIY5.mjs";import{r as _}from"./chunk-5PVQY5BW-DUXm3tDu.mjs";import{t as v}from"./chunk-426QAEUC-DUpKwtVu.mjs";import{t as y}from"./rough.cjs-C-63phNL.mjs";const b=(e,t)=>p(e,`a`,-t),x=1e-10;function S(e,t){let n=w(e),r=n.filter(t=>C(t,e)),i=0,a=0,o=[];if(r.length>1){let t=k(r);for(let e=0;e<r.length;++e){let n=r[e];n.angle=Math.atan2(n.x-t.x,n.y-t.y)}r.sort((e,t)=>t.angle-e.angle);let n=r[r.length-1];for(let t=0;t<r.length;++t){let s=r[t];a+=(n.x+s.x)*(s.y-n.y);let c={x:(s.x+n.x)/2,y:(s.y+n.y)/2},l=null;for(let t=0;t<s.parentIndex.length;++t)if(n.parentIndex.includes(s.parentIndex[t])){let r=e[s.parentIndex[t]],i=Math.atan2(s.x-r.x,s.y-r.y),a=Math.atan2(n.x-r.x,n.y-r.y),o=a-i;o<0&&(o+=2*Math.PI);let u=a-o/2,d=E(c,{x:r.x+r.radius*Math.sin(u),y:r.y+r.radius*Math.cos(u)});d>r.radius*2&&(d=r.radius*2),(l==null||l.width>d)&&(l={circle:r,width:d,p1:s,p2:n,large:d>r.radius,sweep:!0})}l!=null&&(o.push(l),i+=T(l.circle.radius,l.width),n=s)}}else{let t=e[0];for(let n=1;n<e.length;++n)e[n].radius<t.radius&&(t=e[n]);let n=!1;for(let r=0;r<e.length;++r)if(E(e[r],t)>Math.abs(t.radius-e[r].radius)){n=!0;break}n?i=a=0:(i=t.radius*t.radius*Math.PI,o.push({circle:t,p1:{x:t.x,y:t.y+t.radius},p2:{x:t.x-x,y:t.y+t.radius},width:t.radius*2,large:!0,sweep:!0}))}return a/=2,t&&(t.area=i+a,t.arcArea=i,t.polygonArea=a,t.arcs=o,t.innerPoints=r,t.intersectionPoints=n),i+a}function C(e,t){return t.every(t=>E(e,t)<t.radius+x)}function w(e){let t=[];for(let n=0;n<e.length;++n)for(let r=n+1;r<e.length;++r){let i=O(e[n],e[r]);for(let e of i)e.parentIndex=[n,r],t.push(e)}return t}function T(e,t){return e*e*Math.acos(1-t/e)-(e-t)*Math.sqrt(t*(2*e-t))}function E(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))}function D(e,t,n){if(n>=e+t)return 0;if(n<=Math.abs(e-t))return Math.PI*Math.min(e,t)*Math.min(e,t);let r=e-(n*n-t*t+e*e)/(2*n),i=t-(n*n-e*e+t*t)/(2*n);return T(e,r)+T(t,i)}function O(e,t){let n=E(e,t),r=e.radius,i=t.radius;if(n>=r+i||n<=Math.abs(r-i))return[];let a=(r*r-i*i+n*n)/(2*n),o=Math.sqrt(r*r-a*a),s=e.x+a*(t.x-e.x)/n,c=e.y+a*(t.y-e.y)/n,l=-(t.y-e.y)*(o/n),u=-(t.x-e.x)*(o/n);return[{x:s+l,y:c-u},{x:s-l,y:c+u}]}function k(e){let t={x:0,y:0};for(let n of e)t.x+=n.x,t.y+=n.y;return t.x/=e.length,t.y/=e.length,t}function A(e,t,n,r){r||={};let i=r.maxIterations||100,a=r.tolerance||1e-10,o=e(t),s=e(n),c=n-t;if(o*s>0)throw`Initial bisect points must have opposite signs`;if(o===0)return t;if(s===0)return n;for(let n=0;n<i;++n){c/=2;let n=t+c,r=e(n);if(r*o>=0&&(t=n),Math.abs(c)<a||r===0)return n}return t+c}function j(e){let t=Array(e);for(let n=0;n<e;++n)t[n]=0;return t}function M(e,t){return j(e).map(()=>j(t))}function N(e,t){let n=0;for(let r=0;r<e.length;++r)n+=e[r]*t[r];return n}function P(e){return Math.sqrt(N(e,e))}function F(e,t,n){for(let r=0;r<t.length;++r)e[r]=t[r]*n}function I(e,t,n,r,i){for(let a=0;a<e.length;++a)e[a]=t*n[a]+r*i[a]}function L(e,t,n){n||={};let r=n.maxIterations||t.length*200,i=n.nonZeroDelta||1.05,a=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,s=n.minErrorDelta||1e-5,c=n.rho===void 0?1:n.rho,l=n.chi===void 0?2:n.chi,u=n.psi===void 0?-.5:n.psi,d=n.sigma===void 0?.5:n.sigma,f,p=t.length,m=Array(p+1);m[0]=t,m[0].fx=e(t),m[0].id=0;for(let n=0;n<p;++n){let r=t.slice();r[n]=r[n]?r[n]*i:a,m[n+1]=r,m[n+1].fx=e(r),m[n+1].id=n+1}function h(e){for(let t=0;t<e.length;t++)m[p][t]=e[t];m[p].fx=e.fx}let g=(e,t)=>e.fx-t.fx,_=t.slice(),v=t.slice(),y=t.slice(),b=t.slice();for(let t=0;t<r;++t){if(m.sort(g),n.history){let e=m.map(e=>{let t=e.slice();return t.fx=e.fx,t.id=e.id,t});e.sort((e,t)=>e.id-t.id),n.history.push({x:m[0].slice(),fx:m[0].fx,simplex:e})}f=0;for(let e=0;e<p;++e)f=Math.max(f,Math.abs(m[0][e]-m[1][e]));if(Math.abs(m[0].fx-m[p].fx)<o&&f<s)break;for(let e=0;e<p;++e){_[e]=0;for(let t=0;t<p;++t)_[e]+=m[t][e];_[e]/=p}let t=m[p];if(I(v,1+c,_,-c,t),v.fx=e(v),v.fx<m[0].fx)I(b,1+l,_,-l,t),b.fx=e(b),b.fx<v.fx?h(b):h(v);else if(v.fx>=m[p-1].fx){let n=!1;if(v.fx>t.fx?(I(y,1+u,_,-u,t),y.fx=e(y),y.fx<t.fx?h(y):n=!0):(I(y,1-u*c,_,u*c,t),y.fx=e(y),y.fx<v.fx?h(y):n=!0),n){if(d>=1)break;for(let t=1;t<m.length;++t)I(m[t],1-d,m[0],d,m[t]),m[t].fx=e(m[t])}}else h(v)}return m.sort(g),{fx:m[0].fx,x:m[0]}}function R(e,t,n,r,i,a,o){let s=n.fx,c=N(n.fxprime,t),l=s,u=s,d=c,f=0;i||=1,a||=1e-6,o||=.1;function p(u,f,p){for(let m=0;m<16;++m)if(i=(u+f)/2,I(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=N(r.fxprime,t),l>s+a*i*c||l>=p)f=i;else{if(Math.abs(d)<=-o*c)return i;d*(f-u)>=0&&(f=u),u=i,p=l}return 0}for(let m=0;m<10;++m){if(I(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=N(r.fxprime,t),l>s+a*i*c||m&&l>=u)return p(f,i,u);if(Math.abs(d)<=-o*c)return i;if(d>=0)return p(i,f,l);u=l,f=i,i*=2}return i}function ee(e,t,n){let r={x:t.slice(),fx:0,fxprime:t.slice()},i={x:t.slice(),fx:0,fxprime:t.slice()},a=t.slice(),o,s,c=1,l;n||={},l=n.maxIterations||t.length*20,r.fx=e(r.x,r.fxprime),o=r.fxprime.slice(),F(o,r.fxprime,-1);for(let t=0;t<l;++t){if(c=R(e,o,r,i,c),n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),!c)F(o,r.fxprime,-1);else{I(a,1,i.fxprime,-1,r.fxprime);let e=N(r.fxprime,r.fxprime),t=Math.max(0,N(a,i.fxprime)/e);I(o,t,o,-1,i.fxprime),s=r,r=i,i=s}if(P(r.fxprime)<=1e-5)break}return n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),r}function te(e,t={}){t.maxIterations=t.maxIterations||500;let n=t.initialLayout||oe,r=t.lossFunction||B,i=re(e,t),a=n(i,t),o=Object.keys(a),s=[];for(let e of o)s.push(a[e].x),s.push(a[e].y);let c=L(e=>{let t={};for(let n=0;n<o.length;++n){let r=o[n];t[r]={x:e[2*n],y:e[2*n+1],radius:a[r].radius}}return r(t,i)},s,t).x;for(let e=0;e<o.length;++e){let t=o[e];a[t].x=c[2*e],a[t].y=c[2*e+1]}return a}const ne=1e-10;function z(e,t,n){return Math.min(e,t)*Math.min(e,t)*Math.PI<=n+ne?Math.abs(e-t):A(r=>D(e,t,r)-n,0,e+t)}function re(e,t={}){let n=t.distinct,r=e.map(e=>Object.assign({},e));function i(e){return e.join(`;`)}if(n){let e=new Map;for(let t of r)for(let n=0;n<t.sets.length;n++){let r=String(t.sets[n]);e.set(r,t.size+(e.get(r)||0));for(let i=n+1;i<t.sets.length;i++){let n=String(t.sets[i]),a=`${r};${n}`,o=`${n};${r}`;e.set(a,t.size+(e.get(a)||0)),e.set(o,t.size+(e.get(o)||0))}}for(let t of r)t.sets.length<3&&(t.size=e.get(i(t.sets)))}let a=[],o=new Set;for(let e of r)if(e.sets.length===1)a.push(e.sets[0]);else if(e.sets.length===2){let t=e.sets[0],n=e.sets[1];o.add(i(e.sets)),o.add(i([n,t]))}a.sort((e,t)=>e===t?0:e<t?-1:1);for(let e=0;e<a.length;++e){let t=a[e];for(let n=e+1;n<a.length;++n){let e=a[n];o.has(i([t,e]))||r.push({sets:[t,e],size:0})}}return r}function ie(e,t,n){let r=M(t.length,t.length),i=M(t.length,t.length);return e.filter(e=>e.sets.length===2).forEach(e=>{let a=n[e.sets[0]],o=n[e.sets[1]],s=z(Math.sqrt(t[a].size/Math.PI),Math.sqrt(t[o].size/Math.PI),e.size);r[a][o]=r[o][a]=s;let c=0;e.size+1e-10>=Math.min(t[a].size,t[o].size)?c=1:e.size<=1e-10&&(c=-1),i[a][o]=i[o][a]=c}),{distances:r,constraints:i}}function ae(e,t,n,r){for(let e=0;e<t.length;++e)t[e]=0;let i=0;for(let a=0;a<n.length;++a){let o=e[2*a],s=e[2*a+1];for(let c=a+1;c<n.length;++c){let l=e[2*c],u=e[2*c+1],d=n[a][c],f=r[a][c],p=(l-o)*(l-o)+(u-s)*(u-s),m=Math.sqrt(p),h=p-d*d;f>0&&m<=d||f<0&&m>=d||(i+=2*h*h,t[2*a]+=4*h*(o-l),t[2*a+1]+=4*h*(s-u),t[2*c]+=4*h*(l-o),t[2*c+1]+=4*h*(u-s))}}return i}function oe(e,t={}){let n=ce(e,t),r=t.lossFunction||B;if(e.length>=8){let i=se(e,t),a=r(i,e),o=r(n,e);a+1e-8<o&&(n=i)}return n}function se(e,t={}){let n=t.restarts||10,r=[],i={};for(let t of e)t.sets.length===1&&(i[t.sets[0]]=r.length,r.push(t));let{distances:a,constraints:o}=ie(e,r,i),s=P(a.map(P))/a.length;a=a.map(e=>e.map(e=>e/s));let c=(e,t)=>ae(e,t,a,o),l=null;for(let e=0;e<n;++e){let e=ee(c,j(a.length*2).map(Math.random),t);(!l||e.fx<l.fx)&&(l=e)}let u=l.x,d={};for(let e=0;e<r.length;++e){let t=r[e];d[t.sets[0]]={x:u[2*e]*s,y:u[2*e+1]*s,radius:Math.sqrt(t.size/Math.PI)}}if(t.history)for(let e of t.history)F(e.x,s);return d}function ce(e,t){let n=t&&t.lossFunction?t.lossFunction:B,r={},i={};for(let t of e)if(t.sets.length===1){let e=t.sets[0];r[e]={x:1e10,y:1e10,rowid:r.length,size:t.size,radius:Math.sqrt(t.size/Math.PI)},i[e]=[]}e=e.filter(e=>e.sets.length===2);for(let t of e){let e=t.weight==null?1:t.weight,n=t.sets[0],a=t.sets[1];t.size+ne>=Math.min(r[n].size,r[a].size)&&(e=0),i[n].push({set:a,size:t.size,weight:e}),i[a].push({set:n,size:t.size,weight:e})}let a=[];Object.keys(i).forEach(e=>{let t=0;for(let n=0;n<i[e].length;++n)t+=i[e][n].size*i[e][n].weight;a.push({set:e,size:t})});function o(e,t){return t.size-e.size}a.sort(o);let s={};function c(e){return e.set in s}function l(e,t){r[t].x=e.x,r[t].y=e.y,s[t]=!0}l({x:0,y:0},a[0].set);for(let t=1;t<a.length;++t){let s=a[t].set,d=i[s].filter(c),f=r[s];if(d.sort(o),d.length===0)throw`ERROR: missing pairwise overlap information`;let p=[];for(var u=0;u<d.length;++u){let e=r[d[u].set],t=z(f.radius,e.radius,d[u].size);p.push({x:e.x+t,y:e.y}),p.push({x:e.x-t,y:e.y}),p.push({y:e.y+t,x:e.x}),p.push({y:e.y-t,x:e.x});for(let n=u+1;n<d.length;++n){let i=r[d[n].set],a=z(f.radius,i.radius,d[n].size),o=O({x:e.x,y:e.y,radius:t},{x:i.x,y:i.y,radius:a});p.push(...o)}}let m=1e50,h=p[0];for(let t of p){r[s].x=t.x,r[s].y=t.y;let i=n(r,e);i<m&&(m=i,h=t)}l(h,s)}return r}function B(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=D(n.radius,i.radius,E(n,i))}else t=S(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight;n+=i*(t-r.size)*(t-r.size)}return n}function le(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=D(n.radius,i.radius,E(n,i))}else t=S(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight,a=Math.log((t+1)/(r.size+1));n+=i*a*a}return n}function ue(e,t,n){if(n==null?e.sort((e,t)=>t.radius-e.radius):e.sort(n),e.length>0){let t=e[0].x,n=e[0].y;for(let r of e)r.x-=t,r.y-=n}if(e.length===2&&E(e[0],e[1])<Math.abs(e[1].radius-e[0].radius)&&(e[1].x=e[0].x+e[0].radius-e[1].radius-1e-10,e[1].y=e[0].y),e.length>1){let n=Math.atan2(e[1].x,e[1].y)-t,r=Math.cos(n),i=Math.sin(n);for(let t of e){let e=t.x,n=t.y;t.x=r*e-i*n,t.y=i*e+r*n}}if(e.length>2){let n=Math.atan2(e[2].x,e[2].y)-t;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){let t=e[1].y/(1e-10+e[1].x);for(let n of e){var r=(n.x+t*n.y)/(1+t*t);n.x=2*r-n.x,n.y=2*r*t-n.y}}}}function de(e){e.forEach(e=>{e.parent=e});function t(e){return e.parent!==e&&(e.parent=t(e.parent)),e.parent}function n(e,n){let r=t(e);r.parent=t(n)}for(let t=0;t<e.length;++t)for(let r=t+1;r<e.length;++r){let i=e[t].radius+e[r].radius;E(e[t],e[r])+1e-10<i&&n(e[r],e[t])}let r=new Map;for(let n=0;n<e.length;++n){let i=t(e[n]).parent.setid;r.has(i)||r.set(i,[]),r.get(i).push(e[n])}return e.forEach(e=>{delete e.parent}),Array.from(r.values())}function V(e){let t=t=>({max:e.reduce((e,n)=>Math.max(e,n[t]+n.radius),-1/0),min:e.reduce((e,n)=>Math.min(e,n[t]-n.radius),1/0)});return{xRange:t(`x`),yRange:t(`y`)}}function fe(e,t,n){t??=Math.PI/2;let r=he(e).map(e=>Object.assign({},e)),i=de(r);for(let e of i){ue(e,t,n);let r=V(e);e.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),e.bounds=r}i.sort((e,t)=>t.size-e.size),r=i[0];let a=r.bounds,o=(a.xRange.max-a.xRange.min)/50;function s(e,t,n){if(!e)return;let i=e.bounds,s,c;if(t)s=a.xRange.max-i.xRange.min+o;else{s=a.xRange.max-i.xRange.max;let e=(i.xRange.max-i.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;e<0&&(s+=e)}if(n)c=a.yRange.max-i.yRange.min+o;else{c=a.yRange.max-i.yRange.max;let e=(i.yRange.max-i.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;e<0&&(c+=e)}for(let t of e)t.x+=s,t.y+=c,r.push(t)}let c=1;for(;c<i.length;)s(i[c],!0,!1),s(i[c+1],!1,!0),s(i[c+2],!0,!0),c+=3,a=V(r);return me(r)}function pe(e,t,n,r,i){let a=he(e);t-=2*r,n-=2*r;let{xRange:o,yRange:s}=V(a);if(o.max===o.min||s.max===s.min)return console.log(`not scaling solution: zero size detected`),e;let c,l;if(i){let e=Math.sqrt(i/Math.PI)*2;c=t/e,l=n/e}else c=t/(o.max-o.min),l=n/(s.max-s.min);let u=Math.min(l,c),d=(t-(o.max-o.min)*u)/2,f=(n-(s.max-s.min)*u)/2;return me(a.map(e=>({radius:u*e.radius,x:r+d+(e.x-o.min)*u,y:r+f+(e.y-s.min)*u,setid:e.setid})))}function me(e){let t={};for(let n of e)t[n.setid]=n;return t}function he(e){return Object.keys(e).map(t=>Object.assign(e[t],{setid:t}))}function ge(e={}){let t=!1,n=600,r=350,i=15,a=1e3,o=Math.PI/2,s=!0,c=null,l=!0,u=!0,d=null,f=null,p=!1,m=null,h=e&&e.symmetricalTextCentre?e.symmetricalTextCentre:!1,g={},_=e&&e.colourScheme?e.colourScheme:e&&e.colorScheme?e.colorScheme:[`#1f77b4`,`#ff7f0e`,`#2ca02c`,`#d62728`,`#9467bd`,`#8c564b`,`#e377c2`,`#7f7f7f`,`#bcbd22`,`#17becf`],v=0,y=function(e){if(e in g)return g[e];var t=g[e]=_[v];return v+=1,v>=_.length&&(v=0),t},b=te,x=B;function S(g){let _=g.datum(),v=new Set;_.forEach(e=>{e.size==0&&e.sets.length==1&&v.add(e.sets[0])}),_=_.filter(e=>!e.sets.some(e=>v.has(e)));let S={},C={};if(_.length>0){let e=b(_,{lossFunction:x,distinct:p});s&&(e=fe(e,o,f)),S=pe(e,n,r,i,c),C=ye(S,_,h)}let w={};_.forEach(e=>{e.label&&(w[e.sets]=e.label)});function T(e){if(e.sets in w)return w[e.sets];if(e.sets.length==1)return``+e.sets[0]}g.selectAll(`svg`).data([S]).enter().append(`svg`);let E=g.select(`svg`);t?E.attr(`viewBox`,`0 0 ${n} ${r}`):E.attr(`width`,n).attr(`height`,r);let D={},O=!1;E.selectAll(`.venn-area path`).each(function(e){let t=this.getAttribute(`d`);e.sets.length==1&&t&&!p&&(O=!0,D[e.sets[0]]=xe(t))});function k(e){return t=>we(e.sets.map(e=>{let i=D[e],a=S[e];return i||={x:n/2,y:r/2,radius:1},a||={x:n/2,y:r/2,radius:1},{x:i.x*(1-t)+a.x*t,y:i.y*(1-t)+a.y*t,radius:i.radius*(1-t)+a.radius*t}}),m)}let A=E.selectAll(`.venn-area`).data(_,e=>e.sets),j=A.enter().append(`g`).attr(`class`,e=>`venn-area venn-${e.sets.length==1?`circle`:`intersection`}${e.colour||e.color?` venn-coloured`:``}`).attr(`data-venn-sets`,e=>e.sets.join(`_`)),M=j.append(`path`),N=j.append(`text`).attr(`class`,`label`).text(e=>T(e)).attr(`text-anchor`,`middle`).attr(`dy`,`.35em`).attr(`x`,n/2).attr(`y`,r/2);u&&(M.style(`fill-opacity`,`0`).filter(e=>e.sets.length==1).style(`fill`,e=>e.colour?e.colour:e.color?e.color:y(e.sets)).style(`fill-opacity`,`.25`),N.style(`fill`,t=>t.colour||t.color?`#FFF`:e.textFill?e.textFill:t.sets.length==1?y(t.sets):`#444`));function P(e){return typeof e.transition==`function`?e.transition(`venn`).duration(a):e}let F=g;O&&typeof F.transition==`function`?(F=P(g),F.selectAll(`path`).attrTween(`d`,k)):F.selectAll(`path`).attr(`d`,e=>we(e.sets.map(e=>S[e])),m);let I=F.selectAll(`text`).filter(e=>e.sets in C).text(e=>T(e)).attr(`x`,e=>Math.floor(C[e.sets].x)).attr(`y`,e=>Math.floor(C[e.sets].y));l&&(O?`on`in I?I.on(`end`,H(S,T)):I.each(`end`,H(S,T)):I.each(H(S,T)));let L=P(A.exit()).remove();typeof A.transition==`function`&&L.selectAll(`path`).attrTween(`d`,k);let R=L.selectAll(`text`).attr(`x`,n/2).attr(`y`,r/2);return d!==null&&(N.style(`font-size`,`0px`),I.style(`font-size`,d),R.style(`font-size`,`0px`)),{circles:S,textCentres:C,nodes:A,enter:j,update:F,exit:L}}return S.wrap=function(e){return arguments.length?(l=e,S):l},S.useViewBox=function(){return t=!0,S},S.width=function(e){return arguments.length?(n=e,S):n},S.height=function(e){return arguments.length?(r=e,S):r},S.padding=function(e){return arguments.length?(i=e,S):i},S.distinct=function(e){return arguments.length?(p=e,S):p},S.colours=function(e){return arguments.length?(y=e,S):y},S.colors=function(e){return arguments.length?(y=e,S):y},S.fontSize=function(e){return arguments.length?(d=e,S):d},S.round=function(e){return arguments.length?(m=e,S):m},S.duration=function(e){return arguments.length?(a=e,S):a},S.layoutFunction=function(e){return arguments.length?(b=e,S):b},S.normalize=function(e){return arguments.length?(s=e,S):s},S.scaleToFit=function(e){return arguments.length?(c=e,S):c},S.styled=function(e){return arguments.length?(u=e,S):u},S.orientation=function(e){return arguments.length?(o=e,S):o},S.orientationOrder=function(e){return arguments.length?(f=e,S):f},S.lossFunction=function(e){return arguments.length?(x=e===`default`?B:e===`logRatio`?le:e,S):x},S}function H(e,t){return function(n){let r=this,i=e[n.sets[0]].radius||50,a=t(n)||``,o=a.split(/\s+/).reverse(),s=(a.length+o.length)/3,c=o.pop(),l=[c],u=0,d=1.1;r.textContent=null;let f=[];function p(e){let t=r.ownerDocument.createElementNS(r.namespaceURI,`tspan`);return t.textContent=e,f.push(t),r.append(t),t}let m=p(c);for(;c=o.pop(),c;){l.push(c);let e=l.join(` `);m.textContent=e,e.length>s&&m.getComputedTextLength()>i&&(l.pop(),m.textContent=l.join(` `),l=[c],m=p(c),u++)}let h=.35-u*d/2,g=r.getAttribute(`x`),_=r.getAttribute(`y`);f.forEach((e,t)=>{e.setAttribute(`x`,g),e.setAttribute(`y`,_),e.setAttribute(`dy`,`${h+t*d}em`)})}}function U(e,t,n){let r=t[0].radius-E(t[0],e);for(let n=1;n<t.length;++n){let i=t[n].radius-E(t[n],e);i<=r&&(r=i)}for(let t=0;t<n.length;++t){let i=E(n[t],e)-n[t].radius;i<=r&&(r=i)}return r}function _e(e,t,n){let r=[];for(let t of e)r.push({x:t.x,y:t.y}),r.push({x:t.x+t.radius/2,y:t.y}),r.push({x:t.x-t.radius/2,y:t.y}),r.push({x:t.x,y:t.y+t.radius/2}),r.push({x:t.x,y:t.y-t.radius/2});let i=r[0],a=U(r[0],e,t);for(let n=1;n<r.length;++n){let o=U(r[n],e,t);o>=a&&(i=r[n],a=o)}let o=L(n=>-1*U({x:n[0],y:n[1]},e,t),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,s={x:n?0:o[0],y:o[1]},c=!0;for(let t of e)if(E(s,t)>t.radius){c=!1;break}for(let e of t)if(E(s,e)<e.radius){c=!1;break}if(c)return s;if(e.length==1)return{x:e[0].x,y:e[0].y};let l={};return S(e,l),l.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:l.arcs.length==1?{x:l.arcs[0].circle.x,y:l.arcs[0].circle.y}:t.length?_e(e,[]):k(l.arcs.map(e=>e.p1))}function ve(e){let t={},n=Object.keys(e);for(let e of n)t[e]=[];for(let r=0;r<n.length;r++){let i=n[r],a=e[i];for(let o=r+1;o<n.length;++o){let r=n[o],s=e[r],c=E(a,s);c+s.radius<=a.radius+1e-10?t[r].push(i):c+a.radius<=s.radius+1e-10&&t[i].push(r)}}return t}function ye(e,t,n){let r={},i=ve(e);for(let a=0;a<t.length;++a){let o=t[a].sets,s={},c={};for(let e=0;e<o.length;++e){s[o[e]]=!0;let t=i[o[e]];for(let e=0;e<t.length;++e)c[t[e]]=!0}let l=[],u=[];for(let t in e)t in s?l.push(e[t]):t in c||u.push(e[t]);let d=_e(l,u,n);r[o]=d,d.disjoint&&t[a].size>0&&console.log(`WARNING: area `+o+` not represented on screen`)}return r}function be(e,t,n){let r=[];return r.push(`
2
2
  M`,e,t),r.push(`
3
3
  m`,-n,0),r.push(`
4
4
  a`,n,n,0,1,0,n*2,0),r.push(`
@@ -32,4 +32,4 @@ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on l
32
32
  color: ${e.vennSetTextColor};
33
33
  }
34
34
  `,`getStyles`);function Ue(e){let t=new Map;for(let n of e){let e=n.targets.join(`|`),r=t.get(e);r?Object.assign(r,n.styles):t.set(e,{...n.styles})}return t}n(Ue,`buildStyleByKey`);var We=n((e,n,i,a)=>{let s=a.db,c=s.getConfig?.(),{themeVariables:l,look:u,handDrawnSeed:f}=g(),p=u===`handDrawn`,h=[l.venn1,l.venn2,l.venn3,l.venn4,l.venn5,l.venn6,l.venn7,l.venn8].filter(Boolean),_=s.getDiagramTitle?.(),y=s.getSubsetData(),x=s.getTextData(),S=Ue(s.getStyleData()),C=c?.width??800,w=c?.height??450,T=C/1600,E=_?48*T:0,D=l.primaryTextColor??l.textColor,O=v(n);O.attr(`viewBox`,`0 0 ${C} ${w}`),_&&O.append(`text`).text(_).attr(`class`,`venn-title`).attr(`font-size`,`${32*T}px`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).attr(`x`,`50%`).attr(`y`,32*T).style(`fill`,l.vennTitleTextColor||l.titleColor);let k=t(document.createElement(`div`)),A=ge().width(C).height(w-E);k.datum(y).call(A);let j=p?Ee.default.svg(k.select(`svg`).node()):void 0,M=Te(y,{width:C,height:w-E,padding:c?.padding??15}),N=new Map;for(let e of M){let t=$([...e.data.sets].sort());N.set(t,e)}x.length>0&&Ge(c,N,k,x,T,S);let P=m(l.background||`#f4f4f4`);k.selectAll(`.venn-circle`).each(function(e,n){let i=t(this),a=$([...e.sets].sort()),s=S.get(a),c=s?.fill||h[n%h.length]||l.primaryColor;i.classed(`venn-set-${n%8}`,!0);let u=s?.[`fill-opacity`]??.1,d=s?.stroke||c,m=s?.[`stroke-width`]||`${5*T}`;if(p&&j){let e=N.get(a);if(e&&e.circles.length>0){let t=e.circles[0],r=j.circle(t.x,t.y,t.radius*2,{roughness:.7,seed:f,fill:b(c,.7),fillStyle:`hachure`,fillWeight:2,hachureGap:8,hachureAngle:-41+n*60,stroke:d,strokeWidth:parseFloat(String(m))});i.select(`path`).remove(),i.node()?.insertBefore(r,i.select(`text`).node())}}else i.select(`path`).style(`fill`,c).style(`fill-opacity`,u).style(`stroke`,d).style(`stroke-width`,m).style(`stroke-opacity`,.95);let g=s?.color||(P?r(c,30):o(c,30));i.select(`text`).style(`font-size`,`${48*T}px`).style(`fill`,g)}),p&&j?k.selectAll(`.venn-intersection`).each(function(e){let n=t(this),r=$([...e.sets].sort()),i=S.get(r),a=i?.fill;if(a){let e=n.select(`path`),t=e.attr(`d`);if(t){let n=j.path(t,{roughness:.7,seed:f,fill:b(a,.3),fillStyle:`cross-hatch`,fillWeight:2,hachureGap:6,hachureAngle:60,stroke:`none`}),r=e.node();r?.parentNode?.insertBefore(n,r),e.remove()}}else n.select(`path`).style(`fill-opacity`,0);n.select(`text`).style(`font-size`,`${48*T}px`).style(`fill`,i?.color??l.vennSetTextColor??D)}):(k.selectAll(`.venn-intersection text`).style(`font-size`,`${48*T}px`).style(`fill`,e=>{let t=$([...e.sets].sort());return S.get(t)?.color??l.vennSetTextColor??D}),k.selectAll(`.venn-intersection path`).style(`fill-opacity`,e=>{let t=$([...e.sets].sort());return S.get(t)?.fill?1:0}).style(`fill`,e=>{let t=$([...e.sets].sort());return S.get(t)?.fill??`transparent`}));let F=O.append(`g`).attr(`transform`,`translate(0, ${E})`),I=k.select(`svg`).node();if(I&&`childNodes`in I)for(let e of[...I.childNodes])F.node()?.appendChild(e);d(O,w,C,c?.useMaxWidth??!0)},`draw`);function $(e){return e.join(`|`)}n($,`stableSetsKey`);function Ge(e,t,n,r,i,a){let o=e?.useDebugLayout??!1,s=n.select(`svg`).append(`g`).attr(`class`,`venn-text-nodes`),c=new Map;for(let e of r){let t=$(e.sets),n=c.get(t);n?n.push(e):c.set(t,[e])}for(let[e,n]of c.entries()){let r=t.get(e);if(!r?.text)continue;let c=r.text.x,l=r.text.y,u=Math.min(...r.circles.map(e=>e.radius)),d=Math.min(...r.circles.map(e=>e.radius-Math.hypot(c-e.x,l-e.y))),f=Number.isFinite(d)?Math.max(0,d):0;f===0&&Number.isFinite(u)&&(f=u*.6);let p=s.append(`g`).attr(`class`,`venn-text-area`).attr(`font-size`,`${40*i}px`);o&&p.append(`circle`).attr(`class`,`venn-text-debug-circle`).attr(`cx`,c).attr(`cy`,l).attr(`r`,f).attr(`fill`,`none`).attr(`stroke`,`purple`).attr(`stroke-width`,1.5*i).attr(`stroke-dasharray`,`${6*i} ${4*i}`);let m=Math.max(80*i,f*2*.95),h=Math.max(60*i,f*2*.95),g=(r.data.label&&r.data.label.length>0?Math.min(32*i,f*.25):0)+(n.length<=2?30*i:0),_=c-m/2,v=l-h/2+g,y=Math.max(1,Math.ceil(Math.sqrt(n.length))),b=Math.max(1,Math.ceil(n.length/y)),x=m/y,S=h/b;for(let[e,t]of n.entries()){let n=e%y,r=Math.floor(e/y),s=_+x*(n+.5),c=v+S*(r+.5);o&&p.append(`rect`).attr(`class`,`venn-text-debug-cell`).attr(`x`,_+x*n).attr(`y`,v+S*r).attr(`width`,x).attr(`height`,S).attr(`fill`,`none`).attr(`stroke`,`teal`).attr(`stroke-width`,1*i).attr(`stroke-dasharray`,`${4*i} ${3*i}`);let l=x*.9,u=S*.9,d=p.append(`foreignObject`).attr(`class`,`venn-text-node-fo`).attr(`width`,l).attr(`height`,u).attr(`x`,s-l/2).attr(`y`,c-u/2).attr(`overflow`,`visible`),f=a.get(t.id)?.color,m=d.append(`xhtml:span`).attr(`class`,`venn-text-node`).style(`display`,`flex`).style(`width`,`100%`).style(`height`,`100%`).style(`white-space`,`normal`).style(`align-items`,`center`).style(`justify-content`,`center`).style(`text-align`,`center`).style(`overflow-wrap`,`normal`).style(`word-break`,`normal`).text(t.label??t.id);f&&m.style(`color`,f)}}}n(Ge,`renderTextNodes`);var Ke={parser:De,db:Ve,renderer:{draw:We},styles:He};export{Ke as diagram};
35
- //# sourceMappingURL=vennDiagram-DHZGUBPP-CATweP9B.mjs.map
35
+ //# sourceMappingURL=vennDiagram-DHZGUBPP-Bk-INjRY.mjs.map
@@ -1,4 +1,4 @@
1
- import{T as e,w as t}from"./src-BkCVz_TJ.mjs";import{B as n,C as r,L as i,V as a,W as o,_ as s,a as c,b as l,c as u,v as d}from"./chunk-ICPOFSXX-D0MVsm4H.mjs";import{t as f}from"./chunk-426QAEUC-BGn1TCpd.mjs";import{t as p}from"./chunk-4BX2VUAB-DM-mXRDw.mjs";import{t as m}from"./mermaid-parser.core-Cx4njenA.mjs";var h=t((e,t)=>{let n=e<=1?e*100:e;if(n<0||n>100)throw Error(`${t} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return n},`toPercent`),g=t((e,t,n)=>({x:h(t,`${n} evolution`),y:h(e,`${n} visibility`)}),`toCoordinates`),_=t(e=>{if(e){if(e===`+<>`)return`bidirectional`;if(e===`+<`)return`backward`;if(e===`+>`)return`forward`}},`getFlowFromPort`),v=t(e=>{if(!e?.startsWith(`+`))return{};let t=/^\+'([^']*)'/.exec(e)?.[1];return e.includes(`<>`)?{flow:`bidirectional`,label:t}:e.includes(`<`)?{flow:`backward`,label:t}:e.includes(`>`)?{flow:`forward`,label:t}:{label:t}},`extractFlowFromArrow`),y=t((e,t)=>{if(p(e,t),e.size&&t.setSize(e.size.width,e.size.height),e.evolution){let n=e.evolution.stages.map(e=>e.secondName?`${e.name.trim()} / ${e.secondName.trim()}`:e.name.trim()),r=e.evolution.stages.filter(e=>e.boundary!==void 0).map(e=>e.boundary);t.updateAxes({stages:n,stageBoundaries:r})}if(e.anchors.forEach(e=>{let n=g(e.visibility,e.evolution,`Anchor "${e.name}"`);t.addNode(e.name,e.name,n.x,n.y,`anchor`)}),e.components.forEach(e=>{let n=g(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,i=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,a=e.decorator?.strategy;t.addNode(e.name,e.name,n.x,n.y,`component`,r,i,e.inertia,a)}),e.notes.forEach(e=>{let n=g(e.visibility,e.evolution,`Note "${e.text}"`);t.addNote(e.text,n.x,n.y)}),e.pipelines.forEach(e=>{let n=t.getNode(e.parent);if(!n||typeof n.y!=`number`)throw Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);let r=n.y;t.startPipeline(e.parent),e.components.forEach(n=>{let i=`${e.parent}_${n.name}`,a=n.label?(n.label.negX?-1:1)*n.label.offsetX:void 0,o=n.label?(n.label.negY?-1:1)*n.label.offsetY:void 0,s=h(n.evolution,`Pipeline component "${n.name}" evolution`);t.addNode(i,n.name,s,r,`pipeline-component`,a,o),t.addPipelineComponent(e.parent,i)})}),e.links.forEach(e=>{let n=!!e.arrow&&(e.arrow.includes(`-.->`)||e.arrow.includes(`.-.`)),r=_(e.fromPort)??_(e.toPort),{flow:i,label:a}=v(e.arrow);!r&&i&&(r=i);let o=e.linkLabel,s=a??o;t.addLink(e.from,e.to,n,s,r)}),e.evolves.forEach(e=>{let n=t.getNode(e.component);if(n?.y!==void 0){let r=h(e.target,`Evolve target for "${e.component}"`);t.addTrend(e.component,r,n.y)}}),e.annotations.length>0){let n=e.annotations[0],r=g(n.x,n.y,`Annotations box`);t.setAnnotationsBox(r.x,r.y)}e.annotation.forEach(e=>{let n=g(e.x,e.y,`Annotation ${e.number}`);t.addAnnotation(e.number,[{x:n.x,y:n.y}],e.text)}),e.accelerators.forEach(e=>{let n=g(e.x,e.y,`Accelerator "${e.name}"`);t.addAccelerator(e.name,n.x,n.y)}),e.deaccelerators.forEach(e=>{let n=g(e.x,e.y,`Deaccelerator "${e.name}"`);t.addDeaccelerator(e.name,n.x,n.y)})},`populateDb`),b={parser:{yy:void 0},parse:t(async t=>{let n=await m(`wardley`,t);e.debug(n);let r=b.parser?.yy;if(!r||typeof r.addNode!=`function`)throw Error(`parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);y(n,r)},`parse`)},x=new class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{t(this,`WardleyBuilder`)}addNode(e){let t=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...t,...e,className:e.className??t.className,labelOffsetX:e.labelOffsetX??t.labelOffsetX,labelOffsetY:e.labelOffsetY??t.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});let t=this.nodes.get(e);t&&(t.isPipelineParent=!0)}addPipelineComponent(e,t){let n=this.pipelines.get(e);n&&n.componentIds.push(t);let r=this.nodes.get(t);r&&(r.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,t){this.annotationsBox={x:e,y:t}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,t){this.size={width:e,height:t}}getNode(e){return this.nodes.get(e)}build(){let e=[];for(let t of this.nodes.values()){if(typeof t.x!=`number`||typeof t.y!=`number`)throw Error(`Node "${t.label}" is missing coordinates`);e.push(t)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}};function S(e){let t=l();return i(e.trim(),t)}t(S,`textSanitizer`);function C(){return l()[`wardley-beta`]}t(C,`getConfig`);function w(e,t,n,r,i,a,o,s,c){x.addNode({id:e,label:S(t),x:n,y:r,className:i,labelOffsetX:a,labelOffsetY:o,inertia:s,sourceStrategy:c})}t(w,`addNode`);function T(e,t,n=!1,r,i){x.addLink({source:e,target:t,dashed:n,label:r,flow:i})}t(T,`addLink`);function E(e,t,n){x.addTrend({nodeId:e,targetX:t,targetY:n})}t(E,`addTrend`);function D(e,t,n){x.addAnnotation({number:e,coordinates:t,text:n?S(n):void 0})}t(D,`addAnnotation`);function O(e,t,n){x.addNote({text:S(e),x:t,y:n})}t(O,`addNote`);function k(e,t,n){x.addAccelerator({name:S(e),x:t,y:n})}t(k,`addAccelerator`);function A(e,t,n){x.addDeaccelerator({name:S(e),x:t,y:n})}t(A,`addDeaccelerator`);function j(e,t){x.setAnnotationsBox(e,t)}t(j,`setAnnotationsBox`);function M(e,t){x.setSize(e,t)}t(M,`setSize`);function N(e){x.startPipeline(e)}t(N,`startPipeline`);function P(e,t){x.addPipelineComponent(e,t)}t(P,`addPipelineComponent`);function F(e){let t={};e.xLabel&&(t.xLabel=S(e.xLabel)),e.yLabel&&(t.yLabel=S(e.yLabel)),e.stages&&(t.stages=e.stages.map(e=>S(e))),e.stageBoundaries&&(t.stageBoundaries=e.stageBoundaries),x.setAxes(t)}t(F,`updateAxes`);function I(e){return x.getNode(e)}t(I,`getNode`);function L(){return x.build()}t(L,`getWardleyData`);function R(){x.clear(),c()}t(R,`clear`);var z={getConfig:C,addNode:w,addLink:T,addTrend:E,addAnnotation:D,addNote:O,addAccelerator:k,addDeaccelerator:A,setAnnotationsBox:j,setSize:M,startPipeline:N,addPipelineComponent:P,updateAxes:F,getNode:I,getWardleyData:L,clear:R,setAccTitle:a,getAccTitle:d,setDiagramTitle:o,getDiagramTitle:r,getAccDescription:s,setAccDescription:n},B=[`Genesis`,`Custom Built`,`Product`,`Commodity`],V=t(()=>{let{themeVariables:e}=l();return{backgroundColor:e.wardley?.backgroundColor??e.background??`#fff`,axisColor:e.wardley?.axisColor??`#000`,axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??`#222`,gridColor:e.wardley?.gridColor??`rgba(100, 100, 100, 0.2)`,componentFill:e.wardley?.componentFill??`#fff`,componentStroke:e.wardley?.componentStroke??`#000`,componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??`#222`,linkStroke:e.wardley?.linkStroke??`#000`,evolutionStroke:e.wardley?.evolutionStroke??`#dc3545`,annotationStroke:e.wardley?.annotationStroke??`#000`,annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??`#222`,annotationFill:e.wardley?.annotationFill??e.background??`#fff`}},`getTheme`),H=t(()=>{let e=l()[`wardley-beta`];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},`getConfigValues`),U={parser:b,db:z,renderer:{draw:t((n,r,i,a)=>{e.debug(`Rendering Wardley map
1
+ import{T as e,w as t}from"./src-BkCVz_TJ.mjs";import{B as n,C as r,L as i,V as a,W as o,_ as s,a as c,b as l,c as u,v as d}from"./chunk-ICPOFSXX-C--tVIY5.mjs";import{t as f}from"./chunk-426QAEUC-DUpKwtVu.mjs";import{t as p}from"./chunk-4BX2VUAB-DM-mXRDw.mjs";import{t as m}from"./mermaid-parser.core-Cx4njenA.mjs";var h=t((e,t)=>{let n=e<=1?e*100:e;if(n<0||n>100)throw Error(`${t} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return n},`toPercent`),g=t((e,t,n)=>({x:h(t,`${n} evolution`),y:h(e,`${n} visibility`)}),`toCoordinates`),_=t(e=>{if(e){if(e===`+<>`)return`bidirectional`;if(e===`+<`)return`backward`;if(e===`+>`)return`forward`}},`getFlowFromPort`),v=t(e=>{if(!e?.startsWith(`+`))return{};let t=/^\+'([^']*)'/.exec(e)?.[1];return e.includes(`<>`)?{flow:`bidirectional`,label:t}:e.includes(`<`)?{flow:`backward`,label:t}:e.includes(`>`)?{flow:`forward`,label:t}:{label:t}},`extractFlowFromArrow`),y=t((e,t)=>{if(p(e,t),e.size&&t.setSize(e.size.width,e.size.height),e.evolution){let n=e.evolution.stages.map(e=>e.secondName?`${e.name.trim()} / ${e.secondName.trim()}`:e.name.trim()),r=e.evolution.stages.filter(e=>e.boundary!==void 0).map(e=>e.boundary);t.updateAxes({stages:n,stageBoundaries:r})}if(e.anchors.forEach(e=>{let n=g(e.visibility,e.evolution,`Anchor "${e.name}"`);t.addNode(e.name,e.name,n.x,n.y,`anchor`)}),e.components.forEach(e=>{let n=g(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,i=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,a=e.decorator?.strategy;t.addNode(e.name,e.name,n.x,n.y,`component`,r,i,e.inertia,a)}),e.notes.forEach(e=>{let n=g(e.visibility,e.evolution,`Note "${e.text}"`);t.addNote(e.text,n.x,n.y)}),e.pipelines.forEach(e=>{let n=t.getNode(e.parent);if(!n||typeof n.y!=`number`)throw Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);let r=n.y;t.startPipeline(e.parent),e.components.forEach(n=>{let i=`${e.parent}_${n.name}`,a=n.label?(n.label.negX?-1:1)*n.label.offsetX:void 0,o=n.label?(n.label.negY?-1:1)*n.label.offsetY:void 0,s=h(n.evolution,`Pipeline component "${n.name}" evolution`);t.addNode(i,n.name,s,r,`pipeline-component`,a,o),t.addPipelineComponent(e.parent,i)})}),e.links.forEach(e=>{let n=!!e.arrow&&(e.arrow.includes(`-.->`)||e.arrow.includes(`.-.`)),r=_(e.fromPort)??_(e.toPort),{flow:i,label:a}=v(e.arrow);!r&&i&&(r=i);let o=e.linkLabel,s=a??o;t.addLink(e.from,e.to,n,s,r)}),e.evolves.forEach(e=>{let n=t.getNode(e.component);if(n?.y!==void 0){let r=h(e.target,`Evolve target for "${e.component}"`);t.addTrend(e.component,r,n.y)}}),e.annotations.length>0){let n=e.annotations[0],r=g(n.x,n.y,`Annotations box`);t.setAnnotationsBox(r.x,r.y)}e.annotation.forEach(e=>{let n=g(e.x,e.y,`Annotation ${e.number}`);t.addAnnotation(e.number,[{x:n.x,y:n.y}],e.text)}),e.accelerators.forEach(e=>{let n=g(e.x,e.y,`Accelerator "${e.name}"`);t.addAccelerator(e.name,n.x,n.y)}),e.deaccelerators.forEach(e=>{let n=g(e.x,e.y,`Deaccelerator "${e.name}"`);t.addDeaccelerator(e.name,n.x,n.y)})},`populateDb`),b={parser:{yy:void 0},parse:t(async t=>{let n=await m(`wardley`,t);e.debug(n);let r=b.parser?.yy;if(!r||typeof r.addNode!=`function`)throw Error(`parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);y(n,r)},`parse`)},x=new class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{t(this,`WardleyBuilder`)}addNode(e){let t=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...t,...e,className:e.className??t.className,labelOffsetX:e.labelOffsetX??t.labelOffsetX,labelOffsetY:e.labelOffsetY??t.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});let t=this.nodes.get(e);t&&(t.isPipelineParent=!0)}addPipelineComponent(e,t){let n=this.pipelines.get(e);n&&n.componentIds.push(t);let r=this.nodes.get(t);r&&(r.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,t){this.annotationsBox={x:e,y:t}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,t){this.size={width:e,height:t}}getNode(e){return this.nodes.get(e)}build(){let e=[];for(let t of this.nodes.values()){if(typeof t.x!=`number`||typeof t.y!=`number`)throw Error(`Node "${t.label}" is missing coordinates`);e.push(t)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}};function S(e){let t=l();return i(e.trim(),t)}t(S,`textSanitizer`);function C(){return l()[`wardley-beta`]}t(C,`getConfig`);function w(e,t,n,r,i,a,o,s,c){x.addNode({id:e,label:S(t),x:n,y:r,className:i,labelOffsetX:a,labelOffsetY:o,inertia:s,sourceStrategy:c})}t(w,`addNode`);function T(e,t,n=!1,r,i){x.addLink({source:e,target:t,dashed:n,label:r,flow:i})}t(T,`addLink`);function E(e,t,n){x.addTrend({nodeId:e,targetX:t,targetY:n})}t(E,`addTrend`);function D(e,t,n){x.addAnnotation({number:e,coordinates:t,text:n?S(n):void 0})}t(D,`addAnnotation`);function O(e,t,n){x.addNote({text:S(e),x:t,y:n})}t(O,`addNote`);function k(e,t,n){x.addAccelerator({name:S(e),x:t,y:n})}t(k,`addAccelerator`);function A(e,t,n){x.addDeaccelerator({name:S(e),x:t,y:n})}t(A,`addDeaccelerator`);function j(e,t){x.setAnnotationsBox(e,t)}t(j,`setAnnotationsBox`);function M(e,t){x.setSize(e,t)}t(M,`setSize`);function N(e){x.startPipeline(e)}t(N,`startPipeline`);function P(e,t){x.addPipelineComponent(e,t)}t(P,`addPipelineComponent`);function F(e){let t={};e.xLabel&&(t.xLabel=S(e.xLabel)),e.yLabel&&(t.yLabel=S(e.yLabel)),e.stages&&(t.stages=e.stages.map(e=>S(e))),e.stageBoundaries&&(t.stageBoundaries=e.stageBoundaries),x.setAxes(t)}t(F,`updateAxes`);function I(e){return x.getNode(e)}t(I,`getNode`);function L(){return x.build()}t(L,`getWardleyData`);function R(){x.clear(),c()}t(R,`clear`);var z={getConfig:C,addNode:w,addLink:T,addTrend:E,addAnnotation:D,addNote:O,addAccelerator:k,addDeaccelerator:A,setAnnotationsBox:j,setSize:M,startPipeline:N,addPipelineComponent:P,updateAxes:F,getNode:I,getWardleyData:L,clear:R,setAccTitle:a,getAccTitle:d,setDiagramTitle:o,getDiagramTitle:r,getAccDescription:s,setAccDescription:n},B=[`Genesis`,`Custom Built`,`Product`,`Commodity`],V=t(()=>{let{themeVariables:e}=l();return{backgroundColor:e.wardley?.backgroundColor??e.background??`#fff`,axisColor:e.wardley?.axisColor??`#000`,axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??`#222`,gridColor:e.wardley?.gridColor??`rgba(100, 100, 100, 0.2)`,componentFill:e.wardley?.componentFill??`#fff`,componentStroke:e.wardley?.componentStroke??`#000`,componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??`#222`,linkStroke:e.wardley?.linkStroke??`#000`,evolutionStroke:e.wardley?.evolutionStroke??`#dc3545`,annotationStroke:e.wardley?.annotationStroke??`#000`,annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??`#222`,annotationFill:e.wardley?.annotationFill??e.background??`#fff`}},`getTheme`),H=t(()=>{let e=l()[`wardley-beta`];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},`getConfigValues`),U={parser:b,db:z,renderer:{draw:t((n,r,i,a)=>{e.debug(`Rendering Wardley map
2
2
  `+n);let o=H(),s=V(),c=o.nodeRadius*1.6,l=a.db,d=l.getWardleyData(),p=l.getDiagramTitle(),m=d.size?.width??o.width,h=d.size?.height??o.height,g=f(r);g.selectAll(`*`).remove(),u(g,h,m,o.useMaxWidth),g.attr(`viewBox`,`0 0 ${m} ${h}`);let _=g.append(`g`).attr(`class`,`wardley-map`),v=g.append(`defs`);v.append(`marker`).attr(`id`,`arrow-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,9).attr(`refY`,5).attr(`markerWidth`,6).attr(`markerHeight`,6).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`fill`,s.evolutionStroke).attr(`stroke`,`none`),v.append(`marker`).attr(`id`,`link-arrow-end-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,9).attr(`refY`,5).attr(`markerWidth`,5).attr(`markerHeight`,5).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`fill`,s.linkStroke).attr(`stroke`,`none`),v.append(`marker`).attr(`id`,`link-arrow-start-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,1).attr(`refY`,5).attr(`markerWidth`,5).attr(`markerHeight`,5).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 10 0 L 0 5 L 10 10 z`).attr(`fill`,s.linkStroke).attr(`stroke`,`none`),_.append(`rect`).attr(`class`,`wardley-background`).attr(`width`,m).attr(`height`,h).attr(`fill`,s.backgroundColor);let y=m-o.padding*2,b=h-o.padding*2;p&&_.append(`text`).attr(`class`,`wardley-title`).attr(`x`,m/2).attr(`y`,o.padding/2).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize*1.05).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(p);let x=t(e=>o.padding+e/100*y,`projectX`),S=t(e=>h-o.padding-e/100*b,`projectY`),C=_.append(`g`).attr(`class`,`wardley-axes`);C.append(`line`).attr(`x1`,o.padding).attr(`x2`,m-o.padding).attr(`y1`,h-o.padding).attr(`y2`,h-o.padding).attr(`stroke`,s.axisColor).attr(`stroke-width`,1),C.append(`line`).attr(`x1`,o.padding).attr(`x2`,o.padding).attr(`y1`,o.padding).attr(`y2`,h-o.padding).attr(`stroke`,s.axisColor).attr(`stroke-width`,1);let w=d.axes.xLabel??`Evolution`,T=d.axes.yLabel??`Visibility`;C.append(`text`).attr(`class`,`wardley-axis-label wardley-axis-label-x`).attr(`x`,o.padding+y/2).attr(`y`,h-o.padding/4).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).text(w),C.append(`text`).attr(`class`,`wardley-axis-label wardley-axis-label-y`).attr(`x`,o.padding/3).attr(`y`,o.padding+b/2).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).attr(`transform`,`rotate(-90 ${o.padding/3} ${o.padding+b/2})`).text(T);let E=d.axes.stages&&d.axes.stages.length>0?d.axes.stages:B;if(E.length>0){let e=_.append(`g`).attr(`class`,`wardley-stages`),t=d.axes.stageBoundaries,n=[];if(t&&t.length===E.length){let e=0;t.forEach(t=>{n.push({start:e,end:t}),e=t})}else{let e=1/E.length;E.forEach((t,r)=>{n.push({start:r*e,end:(r+1)*e})})}E.forEach((t,r)=>{let i=n[r],a=o.padding+i.start*y,c=(a+(o.padding+i.end*y))/2;r>0&&e.append(`line`).attr(`x1`,a).attr(`x2`,a).attr(`y1`,o.padding).attr(`y2`,h-o.padding).attr(`stroke`,`#000`).attr(`stroke-width`,1).attr(`stroke-dasharray`,`5 5`).attr(`opacity`,.8),e.append(`text`).attr(`class`,`wardley-stage-label`).attr(`x`,c).attr(`y`,h-o.padding/1.5).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize-2).attr(`text-anchor`,`middle`).text(t)})}if(o.showGrid){let e=_.append(`g`).attr(`class`,`wardley-grid`);for(let t=1;t<4;t++){let n=t/4,r=o.padding+y*n;e.append(`line`).attr(`x1`,r).attr(`x2`,r).attr(`y1`,o.padding).attr(`y2`,h-o.padding).attr(`stroke`,s.gridColor).attr(`stroke-dasharray`,`2 6`),e.append(`line`).attr(`x1`,o.padding).attr(`x2`,m-o.padding).attr(`y1`,h-o.padding-b*n).attr(`y2`,h-o.padding-b*n).attr(`stroke`,s.gridColor).attr(`stroke-dasharray`,`2 6`)}}let D=new Map;if(d.nodes.forEach(e=>{D.set(e.id,{x:x(e.x),y:S(e.y),node:e})}),d.pipelines.length>0){let e=_.append(`g`).attr(`class`,`wardley-pipelines`),t=_.append(`g`).attr(`class`,`wardley-pipeline-links`);d.pipelines.forEach(n=>{if(n.componentIds.length===0)return;let r=n.componentIds.map(e=>({id:e,pos:D.get(e),node:d.nodes.find(t=>t.id===e)})).filter(e=>e.pos&&e.node).sort((e,t)=>e.node.x-t.node.x);for(let e=0;e<r.length-1;e++){let n=r[e],i=r[e+1];t.append(`line`).attr(`class`,`wardley-pipeline-evolution-link`).attr(`x1`,n.pos.x).attr(`y1`,n.pos.y).attr(`x2`,i.pos.x).attr(`y2`,i.pos.y).attr(`stroke`,s.linkStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,`4 4`)}let i=1/0,a=-1/0,l=0;if(n.componentIds.forEach(e=>{let t=D.get(e);t&&(i=Math.min(i,t.x),a=Math.max(a,t.x),l=t.y)}),i!==1/0&&a!==-1/0){let t=o.nodeRadius*4,r=l-t/2,u=D.get(n.nodeId);u&&(u.x=(i+a)/2,u.y=r-c/6),e.append(`rect`).attr(`class`,`wardley-pipeline-box`).attr(`x`,i-15).attr(`y`,r).attr(`width`,a-i+30).attr(`height`,t).attr(`fill`,`none`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`rx`,4).attr(`ry`,4)}})}let O=_.append(`g`).attr(`class`,`wardley-links`),k=new Map;d.pipelines.forEach(e=>{k.set(e.nodeId,new Set(e.componentIds))});let A=d.links.filter(e=>!(!D.has(e.source)||!D.has(e.target)||k.get(e.target)?.has(e.source)));O.selectAll(`line`).data(A).enter().append(`line`).attr(`class`,e=>`wardley-link${e.dashed?` wardley-link--dashed`:``}`).attr(`x1`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.source).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=n.x-t.x,a=n.y-t.y,s=Math.sqrt(i*i+a*a);return t.x+i/s*r}).attr(`y1`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.source).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=n.x-t.x,a=n.y-t.y,s=Math.sqrt(i*i+a*a);return t.y+a/s*r}).attr(`x2`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.target).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=t.x-n.x,a=t.y-n.y,s=Math.sqrt(i*i+a*a);return n.x+i/s*r}).attr(`y2`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.target).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=t.x-n.x,a=t.y-n.y,s=Math.sqrt(i*i+a*a);return n.y+a/s*r}).attr(`stroke`,s.linkStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,e=>e.dashed?`6 6`:null).attr(`marker-end`,e=>e.flow===`forward`||e.flow===`bidirectional`?`url(#link-arrow-end-${r})`:null).attr(`marker-start`,e=>e.flow===`backward`||e.flow===`bidirectional`?`url(#link-arrow-start-${r})`:null),O.selectAll(`text`).data(A.filter(e=>e.label)).enter().append(`text`).attr(`class`,`wardley-link-label`).attr(`x`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.x+n.x)/2,i=n.y-t.y,a=n.x-t.x;return r+i/Math.sqrt(a*a+i*i)*8}).attr(`y`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.y+n.y)/2,i=n.x-t.x,a=n.y-t.y,o=Math.sqrt(i*i+a*a);return r+-i/o*8}).attr(`fill`,s.axisTextColor).attr(`font-size`,o.labelFontSize).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).attr(`transform`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.x+n.x)/2,i=(t.y+n.y)/2,a=n.x-t.x,o=n.y-t.y,s=Math.sqrt(a*a+o*o),c=o/s,l=-a/s,u=r+c*8,d=i+l*8,f=Math.atan2(o,a)*180/Math.PI;return(f>90||f<-90)&&(f+=180),`rotate(${f} ${u} ${d})`}).text(e=>e.label);let j=_.append(`g`).attr(`class`,`wardley-trends`),M=d.trends.map(e=>{let t=D.get(e.nodeId);if(!t)return null;let n=x(e.targetX),r=S(e.targetY),i=n-t.x,a=r-t.y,s=Math.sqrt(i*i+a*a),c=o.nodeRadius+2;return{origin:t,targetX:n,targetY:r,adjustedX2:s>c?n-i/s*c:n,adjustedY2:s>c?r-a/s*c:r}}).filter(e=>e!==null);j.selectAll(`line`).data(M).enter().append(`line`).attr(`class`,`wardley-trend`).attr(`x1`,e=>e.origin.x).attr(`y1`,e=>e.origin.y).attr(`x2`,e=>e.adjustedX2).attr(`y2`,e=>e.adjustedY2).attr(`stroke`,s.evolutionStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,`4 4`).attr(`marker-end`,`url(#arrow-${r})`);let N=_.append(`g`).attr(`class`,`wardley-nodes`).selectAll(`g`).data(d.nodes).enter().append(`g`).attr(`class`,e=>[`wardley-node`,e.className?`wardley-node--${e.className}`:``].filter(Boolean).join(` `));N.filter(e=>e.sourceStrategy===`outsource`).append(`circle`).attr(`class`,`wardley-outsource-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#666`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.sourceStrategy===`buy`).append(`circle`).attr(`class`,`wardley-buy-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#ccc`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.sourceStrategy===`build`).append(`circle`).attr(`class`,`wardley-build-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#eee`).attr(`stroke`,`#000`).attr(`stroke-width`,1);let P=N.filter(e=>e.sourceStrategy===`market`);P.append(`circle`).attr(`class`,`wardley-market-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>!e.isPipelineParent&&e.sourceStrategy!==`market`&&e.className!==`anchor`).append(`circle`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius).attr(`fill`,s.componentFill).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1);let F=o.nodeRadius*.7,I=o.nodeRadius*1.2;if(P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x).attr(`y1`,e=>D.get(e.id).y-I).attr(`x2`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`y2`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`y1`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`x2`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`y2`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`y1`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`x2`,e=>D.get(e.id).x).attr(`y2`,e=>D.get(e.id).y-I).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y-I).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`cy`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`cy`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),N.filter(e=>e.isPipelineParent===!0).append(`rect`).attr(`x`,e=>D.get(e.id).x-c/2).attr(`y`,e=>D.get(e.id).y-c/2).attr(`width`,c).attr(`height`,c).attr(`fill`,s.componentFill).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.inertia===!0).append(`line`).attr(`class`,`wardley-inertia`).attr(`x1`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c/2+15:o.nodeRadius+15;return e.sourceStrategy&&(n+=o.nodeRadius+10),t.x+n}).attr(`y1`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c:o.nodeRadius*2;return t.y-n/2}).attr(`x2`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c/2+15:o.nodeRadius+15;return e.sourceStrategy&&(n+=o.nodeRadius+10),t.x+n}).attr(`y2`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c:o.nodeRadius*2;return t.y+n/2}).attr(`stroke`,s.componentStroke).attr(`stroke-width`,6),N.append(`text`).attr(`x`,e=>{let t=D.get(e.id);if(e.className===`anchor`)return e.labelOffsetX===void 0?t.x:t.x+e.labelOffsetX;let n=o.nodeLabelOffset;e.sourceStrategy&&e.labelOffsetX===void 0&&(n+=10);let r=e.labelOffsetX??n;return t.x+r}).attr(`y`,e=>{let t=D.get(e.id);if(e.className===`anchor`)return e.labelOffsetY===void 0?t.y-3:t.y+e.labelOffsetY;let n=-o.nodeLabelOffset;e.sourceStrategy&&e.labelOffsetY===void 0&&(n-=10);let r=e.labelOffsetY??n;return t.y+r}).attr(`class`,`wardley-node-label`).attr(`fill`,e=>e.className===`evolved`?s.evolutionStroke:e.className===`anchor`?`#000`:s.componentLabelColor).attr(`font-size`,o.labelFontSize).attr(`font-weight`,e=>e.className===`anchor`?`bold`:`normal`).attr(`text-anchor`,e=>e.className===`anchor`?`middle`:`start`).attr(`dominant-baseline`,e=>e.className===`anchor`?`middle`:`auto`).text(e=>e.label),d.annotations.length>0){let e=_.append(`g`).attr(`class`,`wardley-annotations`);if(d.annotations.forEach(t=>{let n=t.coordinates.map(e=>({x:x(e.x),y:S(e.y)}));if(n.length>1)for(let t=0;t<n.length-1;t++)e.append(`line`).attr(`class`,`wardley-annotation-line`).attr(`x1`,n[t].x).attr(`y1`,n[t].y).attr(`x2`,n[t+1].x).attr(`y2`,n[t+1].y).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`stroke-dasharray`,`4 4`);n.forEach(n=>{let r=e.append(`g`).attr(`class`,`wardley-annotation`);r.append(`circle`).attr(`cx`,n.x).attr(`cy`,n.y).attr(`r`,10).attr(`fill`,`white`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5),r.append(`text`).attr(`x`,n.x).attr(`y`,n.y).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`central`).attr(`font-size`,10).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.number)})}),d.annotationsBox){let t=x(d.annotationsBox.x),n=S(d.annotationsBox.y),r=e.append(`g`).attr(`class`,`wardley-annotations-box`),i=[...d.annotations].filter(e=>e.text).sort((e,t)=>e.number-t.number),a=[];if(i.forEach((e,i)=>{let o=r.append(`text`).attr(`x`,t+10).attr(`y`,n+10+(i+1)*16).attr(`font-size`,11).attr(`fill`,s.axisTextColor).attr(`text-anchor`,`start`).attr(`dominant-baseline`,`middle`).text(`${e.number}. ${e.text}`);a.push(o)}),a.length>0){let e=0,c=0;a.forEach(t=>{let n=t.node(),r=n.getComputedTextLength();e=Math.max(e,r);let i=n.getBBox();c=Math.max(c,i.height)});let l=e+20+105,u=i.length*16+20+c/2,d=o.padding,f=m-o.padding-l,p=o.padding,g=h-o.padding-u;t=Math.max(d,Math.min(t,f)),n=Math.max(p,Math.min(n,g)),a.forEach((e,r)=>{e.attr(`x`,t+10).attr(`y`,n+10+(r+1)*16)}),r.insert(`rect`,`text`).attr(`x`,t).attr(`y`,n).attr(`width`,l).attr(`height`,u).attr(`fill`,`white`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`rx`,4).attr(`ry`,4)}}}if(d.notes.length>0){let e=_.append(`g`).attr(`class`,`wardley-notes`);d.notes.forEach(t=>{let n=x(t.x),r=S(t.y);e.append(`text`).attr(`x`,n).attr(`y`,r).attr(`text-anchor`,`start`).attr(`font-size`,11).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.text)})}if(d.accelerators.length>0){let e=_.append(`g`).attr(`class`,`wardley-accelerators`);d.accelerators.forEach(t=>{let n=x(t.x),r=S(t.y),i=`
3
3
  M ${n} ${r-30/2}
4
4
  L ${n+60-20} ${r-30/2}
@@ -18,4 +18,4 @@ import{T as e,w as t}from"./src-BkCVz_TJ.mjs";import{B as n,C as r,L as i,V as a
18
18
  L ${n+60} ${r+30/2}
19
19
  Z
20
20
  `;e.append(`path`).attr(`d`,i).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),e.append(`text`).attr(`x`,n+60/2).attr(`y`,r+30/2+15).attr(`text-anchor`,`middle`).attr(`font-size`,10).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.name)})}},`draw`)},styles:t(()=>``,`styles`)};export{U as diagram};
21
- //# sourceMappingURL=wardleyDiagram-NUSXRM2D-3qxY3I6a.mjs.map
21
+ //# sourceMappingURL=wardleyDiagram-NUSXRM2D-DOD6wQla.mjs.map
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import{t as e}from"./chunk-GXVXFKBA-D0BDCtkE.mjs";export{e as wcCommand};
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import{t as e}from"./chunk-A65PWWJC-GGt9898w.mjs";export{e as whichCommand};
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import{t as e}from"./chunk-HJQJAYMS-BS_JF11O.mjs";export{e as whoami};
@@ -4,4 +4,4 @@ import{a as e,s as t,t as n}from"./chunk-C94x7I9S.mjs";var r=n(((e,t)=>{let n=[`
4
4
  `)+`\r
5
5
  \r
6
6
  `+n)}function w(e,t,n,r,i,a){if(e.listenerCount(`wsClientError`)){let r=Error(i);Error.captureStackTrace(r,w),e.emit(`wsClientError`,r,n,t)}else C(n,r,i,a)}}));p(),d(),o(),c(),l(),m();var g=t(f(),1),_=t(h(),1),v=g.default;export{v as n,_ as t};
7
- //# sourceMappingURL=wrapper-CGw3ogaz.mjs.map
7
+ //# sourceMappingURL=wrapper-BZO_sIci.mjs.map
@@ -0,0 +1,12 @@
1
+ import{Mt as e,bt as t,tn as n,v as r}from"./server-lock-CN2YHwpP-Cwa4llpq.mjs";import{$r as i}from"./dist-CWHBXHzy.mjs";import{basename as a,dirname as o,isAbsolute as s,join as c,posix as l,relative as u,resolve as d,sep as f,win32 as p}from"node:path";import{cpSync as m,existsSync as h,lstatSync as g,mkdirSync as _,realpathSync as v,rmSync as y}from"node:fs";import{homedir as b}from"node:os";const x=r,S=t,C=e,w=`node`,T={MCP_DEBUG:`1`,OK_LOG_FILE:`/tmp/ok-mcp.log`},E=`# ok-mcp-v1`,D=`# ok-mcp-v1
2
+ USER_BUNDLE="$HOME/Applications/OpenKnowledge.app/Contents/Resources/cli/bin/ok.sh"
3
+ [ -f "$USER_BUNDLE" ] && [ -x "$USER_BUNDLE" ] && exec "$USER_BUNDLE" mcp
4
+ BUNDLE="/Applications/OpenKnowledge.app/Contents/Resources/cli/bin/ok.sh"
5
+ [ -f "$BUNDLE" ] && [ -x "$BUNDLE" ] && exec "$BUNDLE" mcp
6
+ command -v npx >/dev/null 2>&1 && exec npx -y @inkeep/open-knowledge@latest mcp
7
+ for d in "$HOME/.nvm/versions/node"/*/bin "$HOME/.fnm/node-versions"/*/installation/bin "$HOME/.asdf/installs/nodejs"/*/bin /opt/homebrew/bin /usr/local/bin "$HOME/.local/bin" "$HOME/.volta/bin"; do
8
+ [ -f "$d/npx" ] && [ -x "$d/npx" ] && exec "$d/npx" -y @inkeep/open-knowledge@latest mcp
9
+ done
10
+ echo "OpenKnowledge: install OK Desktop or Node.js 24+, then restart your editor" >&2
11
+ exit 127`;function O(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.command===`/bin/sh`){if(!Array.isArray(t.args)||t.args[0]!==`-l`||t.args[1]!==`-c`)return!1;let e=t.args[2];return typeof e==`string`&&e.includes(`# ok-mcp-v1`)}if(t.type===`local`&&Array.isArray(t.command)){if(t.command[0]!==`/bin/sh`||t.command[1]!==`-l`||t.command[2]!==`-c`)return!1;let e=t.command[3];return typeof e==`string`&&e.includes(`# ok-mcp-v1`)}return!1}function k(e=process.argv[1]){if(!e)throw Error(`Cannot infer the local CLI entry for --dev-mcp because process.argv[1] is empty.`);let t=d(e);if(a(t)===`cli.mjs`&&a(o(t))===`dist`)return t;let n=t.split(f),r=n.lastIndexOf(`packages`);if(r===-1||n[r+1]!==`cli`)throw Error(`Cannot infer the repo root for --dev-mcp from ${t}. Run the local CLI from this repo so the built dist path can be derived.`);let i=n.slice(0,r);return c(i.length===0?f:i.join(f),`packages`,`cli`,`dist`,`cli.mjs`)}function A(e={}){return e.mode===`dev`?{command:w,args:[k(),`mcp`],env:{...T}}:{command:`/bin/sh`,args:[`-l`,`-c`,D]}}function j(e={}){return e.mode===`dev`?{type:`local`,enabled:!0,command:[w,k(),`mcp`],environment:{...T}}:{type:`local`,enabled:!0,command:[`/bin/sh`,`-l`,`-c`,D]}}function M(e){if(typeof e!=`object`||!e)return!1;let t=e;if(Object.keys(t).length!==2)return!1;let n=A({mode:`published`}),r=n.args;return t.command!==n.command||!Array.isArray(r)||!Array.isArray(t.args)||t.args.length!==r.length?!1:t.args.every((e,t)=>e===r[t])}function N(e){return e===`win32`?p:l}function P(e={}){let t=e.platformName??process.platform,n=e.home??b();return N(t).join(n,`.claude.json`)}function F(e={}){let t=e.platformName??process.platform,n=e.home??b(),r=e.env??process.env;if(t===`darwin`)return l.join(n,`Library`,`Application Support`,`Claude`,`claude_desktop_config.json`);if(t===`win32`){let e=r.APPDATA??p.join(n,`AppData`,`Roaming`);return p.join(e,`Claude`,`claude_desktop_config.json`)}throw Error(`Claude Desktop is not available on ${t}. Supported: macOS, Windows.`)}function I(e={}){let t=e.platformName??process.platform,n=e.home??b();return N(t).join(n,`.cursor`,`mcp.json`)}function L(e={}){let t=e.platformName??process.platform,n=e.home??b();return(e.env??process.env).CODEX_HOME??N(t).join(n,`.codex`)}function R(e={}){return N(e.platformName??process.platform).join(L(e),`config.toml`)}function z(e={}){let t=e.platformName??process.platform,n=e.home??b(),r=e.env??process.env,i=N(t);if(t===`win32`){let e=r.APPDATA??i.join(n,`AppData`,`Roaming`);return i.join(e,`opencode`)}let a=r.XDG_CONFIG_HOME??i.join(n,`.config`);return i.join(a,`opencode`)}function B(e={}){return N(e.platformName??process.platform).join(z(e),`opencode.json`)}function V(e={}){let t=e.platformName??process.platform,n=e.home??b();return N(t).join(n,`.openclaw`,`openclaw.json`)}const H={claude:{id:`claude`,label:S.claude,configPath:(e,t)=>P({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>n,buildEntry:(e,t)=>A(t),scope:`global`,detectPath:(e,t)=>c(t??b(),`.claude`),projectConfigPath:e=>c(e,`.mcp.json`),projectSkillPath:e=>c(e,`.claude`,`skills`,`open-knowledge`,`SKILL.md`)},"claude-desktop":{id:`claude-desktop`,label:S[`claude-desktop`],configPath:(e,t)=>F({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>n,buildEntry:(e,t)=>A(t),scope:`global`,detectPath:(e,t)=>o(F({home:t}))},cursor:{id:`cursor`,label:S.cursor,configPath:(e,t)=>I({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>n,buildEntry:(e,t)=>A(t),scope:`global`,detectPath:(e,t)=>o(I({home:t})),projectConfigPath:e=>c(e,`.cursor`,`mcp.json`),projectSkillPath:e=>c(e,`.cursor`,`skills`,`open-knowledge`,`SKILL.md`)},codex:{id:`codex`,label:S.codex,configPath:(e,t)=>R({home:t}),format:`toml`,topLevelKey:`mcp_servers`,serverName:()=>n,buildEntry:(e,t)=>A(t),scope:`global`,detectPath:(e,t)=>o(R({home:t})),projectConfigPath:e=>c(e,`.codex`,`config.toml`),projectSkillPath:e=>c(e,`.codex`,`skills`,`open-knowledge`,`SKILL.md`)},opencode:{id:`opencode`,label:S.opencode,configPath:(e,t)=>B({home:t}),format:`json`,topLevelKey:`mcp`,serverName:()=>n,buildEntry:(e,t)=>j(t),scope:`global`,detectPath:(e,t)=>o(B({home:t})),projectConfigPath:e=>c(e,`opencode.json`),projectSkillPath:e=>c(e,`.opencode`,`skills`,`open-knowledge`,`SKILL.md`)},openclaw:{id:`openclaw`,label:S.openclaw,configPath:(e,t)=>V({home:t}),format:`json`,topLevelKey:`mcp`,serverMapSubKey:`servers`,serverName:()=>n,buildEntry:(e,t)=>A(t),scope:`global`,detectPath:(e,t)=>c(t??b(),`.openclaw`),offerOnlyWhenDetected:!0}};function U(e){let t=e.filter(e=>!Object.hasOwn(H,e));if(t.length>0)throw Error(`Unknown editor(s): ${t.join(`, `)}. Valid options: ${x.join(`, `)}`);return e.map(e=>H[e])}function W(e,t){let n;try{n=v(t)}catch{n=d(t)}let r;try{r=g(e)}catch(e){if(e.code!==`ENOENT`)throw e}if(r?.isSymbolicLink())throw Error(`Refusing to write through a symbolic link at ${e}. Remove the symlink and re-run project setup.`);let i=o(e);for(;i.length>1&&i!==f;){let t;try{t=v(i)}catch(e){if(e.code===`ENOENT`){i=o(i);continue}throw e}let r=u(n,t);if(r===``||!r.startsWith(`..`)&&!s(r))return;throw Error(`Refusing to write at ${e}: ancestor ${i} resolves to ${t}, which is outside the project directory ${n}. A symbolic link in the path likely escapes the project. Remove the symlink and re-run project setup.`)}}function G(e,t){let n=e.projectSkillPath?.(t);if(!n)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};try{let r=i(`project`,{checkDesktop:!0}),a=o(n);W(a,t);let s=h(n)?`overwritten`:`written`;return y(a,{recursive:!0,force:!0}),_(o(a),{recursive:!0}),m(r,a,{recursive:!0}),{editorId:e.id,label:e.label,action:s,path:n}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:n,error:t instanceof Error?t.message:String(t)}}}export{S as a,A as c,k as d,U as f,E as i,O as l,G as n,H as o,x as r,C as s,W as t,M as u};
12
+ //# sourceMappingURL=write-project-skill-CRxX-42S.mjs.map
@@ -0,0 +1 @@
1
+ import"./chunk-YNYSPYQ5-gU4-j5DO.mjs";import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import"./chunk-5QMZ5MUS-BwpNU33k.mjs";import"./chunk-24IMIIXA-DaS5XS55.mjs";import"./chunk-SYMJJMQ4-jdmKoBFb.mjs";import"./chunk-7TSDKFEO-CMVuiOdP.mjs";import"./chunk-BBXLRYSX-XWD4jM9A.mjs";import"./chunk-F55TLFGB-BZSRX-Vi.mjs";import{n as e}from"./chunk-UNYNJIFU-CZ2Mla0s.mjs";export{e as xanCommand};
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import"./chunk-SYMJJMQ4-jdmKoBFb.mjs";import{c as e}from"./chunk-F55TLFGB-BZSRX-Vi.mjs";export{e as cmdView};
@@ -0,0 +1 @@
1
+ import"./chunk-DXB73IDG-F_tmy-Lz.mjs";import{n as e}from"./chunk-TOMNU26N-CrDa7MpH.mjs";export{e as xargsCommand};