@inkeep/open-knowledge 0.42.0 → 0.43.0-beta.0

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 (356) hide show
  1. package/dist/{acp-harness-probe-C3Si3Oe6.mjs → acp-harness-probe-BI6bXf3a.mjs} +2 -2
  2. package/dist/assets/skills/discovery/SKILL.md +1 -1
  3. package/dist/assets/skills/project/SKILL.md +2 -2
  4. package/dist/assets/skills/project/references/components-and-visuals.md +4 -0
  5. package/dist/assets/skills/write-skill/SKILL.md +2 -2
  6. package/dist/assets/skills/write-skill/references/pressure-testing.md +1 -1
  7. package/dist/{build-fAc55Z_L.mjs → build-DYQrG4v7.mjs} +1 -1
  8. package/dist/build-DcqN8tua.mjs +1 -0
  9. package/dist/{chunk-TLSUDHID-BOrmK-jg.mjs → chunk-TLSUDHID-B0bd8ZfM.mjs} +2 -2
  10. package/dist/cli.mjs +60 -60
  11. package/dist/config-schema.json +154 -0
  12. package/dist/config.project.schema.json +154 -0
  13. package/dist/constants-BKJ7B5iw.mjs +2 -0
  14. package/dist/{diff-HJF2MPDN-BvwqXcA5.mjs → diff-HJF2MPDN-DhZaF2MX.mjs} +1 -1
  15. package/dist/{flag-coverage-6JEX67RU-D3X0I2ha.mjs → flag-coverage-6JEX67RU-D1byxsyF.mjs} +2 -2
  16. package/dist/fs-traced-B9Czc2nP.mjs +1 -0
  17. package/dist/{fs-traced-Cc6WsRtP.mjs → fs-traced-BmZQL7v9.mjs} +2 -2
  18. package/dist/git-handle-B1uGukUi.mjs +1 -0
  19. package/dist/{git-handle-JgY8Ytwb.mjs → git-handle-bosCq-DO.mjs} +2 -2
  20. package/dist/index.d.mts +37 -13
  21. package/dist/index.mjs +1 -1
  22. package/dist/{init-BRlzdKw6.mjs → init-BUp3cQ_4.mjs} +37 -37
  23. package/dist/init-CIt3KTw5.mjs +1 -0
  24. package/dist/{launch-json-removal-D3bQuZax.mjs → launch-json-removal-CwOqJJze.mjs} +2 -2
  25. package/dist/{lib-CE7ieLC-.mjs → lib-BS_oZ9bm.mjs} +4 -4
  26. package/dist/{libesm-CG75CrN9.mjs → libesm-DzwC_yFw.mjs} +1 -1
  27. package/dist/loader-Bofa7u1n.mjs +1 -0
  28. package/dist/{loader-BiH3mrIJ.mjs → loader-y7Mn8M-Z.mjs} +2 -2
  29. package/dist/md-manager-DPw-b4lt.mjs +2 -0
  30. package/dist/{open-browser-BqBGMi_2.mjs → open-browser-CkLowmAw.mjs} +2 -2
  31. package/dist/parse-worker.mjs +1 -1
  32. package/dist/{preview-DB8FUJNR.mjs → preview-BV8bR51k.mjs} +2 -2
  33. package/dist/preview-CUhu4iSu.mjs +1 -0
  34. package/dist/public/assets/ActivityModeContent-CCFHLlT9.js +1 -0
  35. package/dist/public/assets/AgentDiffPane-CQfhJYfr.js +2 -0
  36. package/dist/public/assets/{AgentThreadClientBinder-D_oI6JYB.js → AgentThreadClientBinder-DZwzRPDa.js} +1 -1
  37. package/dist/public/assets/CodeMirrorPropInput-BqDZpzvH.js +3 -0
  38. package/dist/public/assets/{ConsentDialogBody-BjbzWR8D.js → ConsentDialogBody-CiXNBNFL.js} +1 -1
  39. package/dist/public/assets/DocumentContext-WcIs30H8.js +38 -0
  40. package/dist/public/assets/{EditorModeToggle-v_8_QyqL.js → EditorModeToggle-1xLWvnWd.js} +2 -2
  41. package/dist/public/assets/{EnableSyncConfirmDialog-DGzRLORN.js → EnableSyncConfirmDialog-CPuodmd5.js} +1 -1
  42. package/dist/public/assets/FeedbackForm-DXei5e26.js +1 -0
  43. package/dist/public/assets/GraphPanel-U2ZyS1Aa.js +44 -0
  44. package/dist/public/assets/{LintConfigEditor-P94jXYrX.js → LintConfigEditor-DEUL9rFl.js} +1 -1
  45. package/dist/public/assets/ManagedArtifactProperties-EDghUFni.js +1 -0
  46. package/dist/public/assets/{McpConsentDialogBody-DQKGlIrW.js → McpConsentDialogBody-C8VSVSPz.js} +1 -1
  47. package/dist/public/assets/MermaidDocEditor-BwjUe5g_.js +1 -0
  48. package/dist/public/assets/PropertyPanel-F1tECi8I.js +2 -0
  49. package/dist/public/assets/{RegisteredAgentIcon-8Tcfr3WP.js → RegisteredAgentIcon-C2dU04N7.js} +1 -1
  50. package/dist/public/assets/ReportBugDialogBody-Cz_kN3Qc.js +3 -0
  51. package/dist/public/assets/{SchemaConfigEditor-DgQ8bbvw.js → SchemaConfigEditor-C_t3p7aQ.js} +1 -1
  52. package/dist/public/assets/SettingsDialogBody-_7c5ty2t.js +7 -0
  53. package/dist/public/assets/{ShareBranchSwitchDialog-C5BWlfbq.js → ShareBranchSwitchDialog-Dj6PdkLL.js} +1 -1
  54. package/dist/public/assets/{ShareReceiveDialog-CI2Mloot.js → ShareReceiveDialog-Cmfia-Vl.js} +1 -1
  55. package/dist/public/assets/{ShareReceiveMissDialog-ohgoelQ3.js → ShareReceiveMissDialog-xHTJ1V_2.js} +1 -1
  56. package/dist/public/assets/{SkillEditorActions-B3vkquAC.js → SkillEditorActions-Cw7itVro.js} +1 -1
  57. package/dist/public/assets/SourceEditor-DGpQCfDe.js +1 -0
  58. package/dist/public/assets/{TerminalPanel-BNrFiNj3.js → TerminalPanel-Dfvz7JrY.js} +3 -3
  59. package/dist/public/assets/TerminalSessionsHost-D6vvdN1I.js +2 -0
  60. package/dist/public/assets/{TerminalWindowApp-CT-DB-wX.js → TerminalWindowApp-CfeLvqLD.js} +1 -1
  61. package/dist/public/assets/ThreadView-S_XJwwbZ.js +6 -0
  62. package/dist/public/assets/TimelineDiffPane-DgS-xWyU.js +2 -0
  63. package/dist/public/assets/{abnfDiagram-VRR7QNED-BN6xOaJK.js → abnfDiagram-VRR7QNED-BA0sca5y.js} +1 -1
  64. package/dist/public/assets/{agent-diff-store-CL1zJhM8.js → agent-diff-store-Cn0Zbsuy.js} +1 -1
  65. package/dist/public/assets/{agent-visibility-DboUkSIR.js → agent-visibility-B4n6jrOx.js} +1 -1
  66. package/dist/public/assets/{arc-DXLgvp45.js → arc-DIcYIkPb.js} +1 -1
  67. package/dist/public/assets/architecture-TIHT7OUA-DhKVyAdC.js +1 -0
  68. package/dist/public/assets/{architectureDiagram-ZJ3FMSHR-sAL9H8K0.js → architectureDiagram-ZJ3FMSHR-CyZsfJqr.js} +1 -1
  69. package/dist/public/assets/auth-state-cache-PC5ml3gS.js +11 -0
  70. package/dist/public/assets/awareness-heartbeat.worker-BYkbsKQ2.js +1 -0
  71. package/dist/public/assets/{blockDiagram-677ZJIJ3-CecPiwgF.js → blockDiagram-677ZJIJ3-BL4J4ddi.js} +1 -1
  72. package/dist/public/assets/{c4Diagram-LMCZKHZV-D8mdqYYS.js → c4Diagram-LMCZKHZV-DtpyWL_l.js} +1 -1
  73. package/dist/public/assets/{calendar-DEDeJBdZ.js → calendar-2iQWonjM.js} +1 -1
  74. package/dist/public/assets/channel-D7XYjy4a.js +1 -0
  75. package/dist/public/assets/chunk-2Q5K7J3B-BpVQiBsM.js +1 -0
  76. package/dist/public/assets/{chunk-32BRIVSS-JpxGJ5ji.js → chunk-32BRIVSS-J_rdnOiy.js} +1 -1
  77. package/dist/public/assets/{chunk-52WLFC77-C_iSxcYL.js → chunk-52WLFC77-BOMCKXNP.js} +1 -1
  78. package/dist/public/assets/{chunk-5FCAYU7R-Bq8uZn8B.js → chunk-5FCAYU7R-8Y9BJKC-.js} +1 -1
  79. package/dist/public/assets/{chunk-5HE753X5-Canmf8DQ.js → chunk-5HE753X5-CQEApaqU.js} +1 -1
  80. package/dist/public/assets/{chunk-5JV3BV7I-Dtexaqo4.js → chunk-5JV3BV7I-Wp4ieThX.js} +1 -1
  81. package/dist/public/assets/{chunk-5TONJI2A-QaNyDyr1.js → chunk-5TONJI2A-Dht2oB5p.js} +1 -1
  82. package/dist/public/assets/{chunk-5VM5RSS4-DnRDZx9C.js → chunk-5VM5RSS4-BtUIXst7.js} +1 -1
  83. package/dist/public/assets/{chunk-7BUUIJ7U-CjwBXrEk.js → chunk-7BUUIJ7U-B7ItXXvn.js} +1 -1
  84. package/dist/public/assets/{chunk-BIQX33UG-CwPTWPTQ.js → chunk-BIQX33UG-B4CjyNhu.js} +1 -1
  85. package/dist/public/assets/{chunk-BO2N2NFS-BTXsfKML.js → chunk-BO2N2NFS-DMgXoikU.js} +3 -3
  86. package/dist/public/assets/{chunk-C7G6YPKG-yRQSkwCz.js → chunk-C7G6YPKG-Bhzd4FsL.js} +1 -1
  87. package/dist/public/assets/{chunk-CQNSW5MT-BzGo9Za_.js → chunk-CQNSW5MT-CVrDoms_.js} +1 -1
  88. package/dist/public/assets/{chunk-CYSBUYHQ-CKmnpHug.js → chunk-CYSBUYHQ-N9puYKAt.js} +1 -1
  89. package/dist/public/assets/{chunk-EMLP6XTP-_x7IkQoS.js → chunk-EMLP6XTP-ACA6yW7o.js} +1 -1
  90. package/dist/public/assets/{chunk-EX3LRPZG-Dp9dLoos.js → chunk-EX3LRPZG-BIvLDOrf.js} +1 -1
  91. package/dist/public/assets/{chunk-FWX5IMBZ-DS2bi_oI.js → chunk-FWX5IMBZ-1CESfm5O.js} +2 -2
  92. package/dist/public/assets/{chunk-HOUHSVGY-CiAzcmEO.js → chunk-HOUHSVGY-DTcG17JD.js} +1 -1
  93. package/dist/public/assets/{chunk-ICXQ74PX-COjRz7aI.js → chunk-ICXQ74PX-CDyWyZCQ.js} +1 -1
  94. package/dist/public/assets/{chunk-JG7HCLWE-BIqqOtX1.js → chunk-JG7HCLWE-gt52jYPR.js} +1 -1
  95. package/dist/public/assets/{chunk-JWPE2WC7-DKmcMFEN.js → chunk-JWPE2WC7-BIGkO1cG.js} +1 -1
  96. package/dist/public/assets/{chunk-MOJQB5TN-BJQv3CxF.js → chunk-MOJQB5TN-dX_Ns_6-.js} +1 -1
  97. package/dist/public/assets/{chunk-MOZMSUNE-Cy6wrRA7.js → chunk-MOZMSUNE-DtIvb1II.js} +1 -1
  98. package/dist/public/assets/{chunk-OGEWGWER-C7C3Oiaz.js → chunk-OGEWGWER-BgCGYbch.js} +1 -1
  99. package/dist/public/assets/{chunk-OSBZ3O6U-DmX-gaPq.js → chunk-OSBZ3O6U-BjU8eaT1.js} +1 -1
  100. package/dist/public/assets/{chunk-PUDLZKDR-ZoTPQ917.js → chunk-PUDLZKDR-BtLyPGmD.js} +1 -1
  101. package/dist/public/assets/{chunk-Q4XR5HBZ-sjes-Yon.js → chunk-Q4XR5HBZ-B32WTAPs.js} +1 -1
  102. package/dist/public/assets/{chunk-QBLGF6JB-BiU9LEk8.js → chunk-QBLGF6JB-CprENtRb.js} +1 -1
  103. package/dist/public/assets/{chunk-R7FJI6CG-BAfUnNIm.js → chunk-R7FJI6CG-DCV9Dvbs.js} +1 -1
  104. package/dist/public/assets/{chunk-RYQCIY6F-IRvgwbUs.js → chunk-RYQCIY6F-DAyLri1b.js} +1 -1
  105. package/dist/public/assets/{chunk-U6XO7XAA-2Ds3FX_A.js → chunk-U6XO7XAA-DSdpZQB7.js} +1 -1
  106. package/dist/public/assets/{chunk-V7JOEXUC-Xkrljz-l.js → chunk-V7JOEXUC-9lX7N0EN.js} +1 -1
  107. package/dist/public/assets/chunk-VAUOI2AC-buA1NS7h.js +1 -0
  108. package/dist/public/assets/{chunk-VR4S4FIN-Db6y0lij.js → chunk-VR4S4FIN-CcTJJ1HA.js} +1 -1
  109. package/dist/public/assets/{chunk-WYO6CB5R-WjatCbeP.js → chunk-WYO6CB5R-9yPqK9ib.js} +1 -1
  110. package/dist/public/assets/chunk-XXDRQBXY-Dpdm1nrz.js +1 -0
  111. package/dist/public/assets/{chunk-YOTPTUD7-BDIMzFfd.js → chunk-YOTPTUD7-DBti7bK5.js} +1 -1
  112. package/dist/public/assets/{chunk-ZGVPDNZ5-DKtGLh__.js → chunk-ZGVPDNZ5-5ruaVNfo.js} +1 -1
  113. package/dist/public/assets/{chunk-ZIRB5QZD-JvsKOaWe.js → chunk-ZIRB5QZD-DmY1977n.js} +1 -1
  114. package/dist/public/assets/classDiagram-OUVF2IWQ-BdRcUr99.js +1 -0
  115. package/dist/public/assets/classDiagram-v2-EOCWNBFH-4fffeoHu.js +1 -0
  116. package/dist/public/assets/client-version-BmlQC9U8.js +1 -0
  117. package/dist/public/assets/{config-provider-BvRqIV8_.js → config-provider-GshVNiWq.js} +2 -2
  118. package/dist/public/assets/{cose-bilkent-JH36ORCC-B5xjEHuC.js → cose-bilkent-JH36ORCC-D8nyC_t4.js} +1 -1
  119. package/dist/public/assets/cynefin-VYW2F7L2-BlrdxSfe.js +1 -0
  120. package/dist/public/assets/{cynefinDiagram-TSTJHNR4-BeGFvfoc.js → cynefinDiagram-TSTJHNR4-B4B58YEO.js} +1 -1
  121. package/dist/public/assets/{dagre-CLVncoxl.js → dagre-DjTdhlGF.js} +1 -1
  122. package/dist/public/assets/{dagre-VKFMJZFB-D98i06T_.js → dagre-VKFMJZFB-DQHmtQOE.js} +1 -1
  123. package/dist/public/assets/{diagram-FQU43EPY--u6SeKWp.js → diagram-FQU43EPY-B28ABQG6.js} +1 -1
  124. package/dist/public/assets/{diagram-G47NLZAW-BqkpNwsF.js → diagram-G47NLZAW-1MthGQcj.js} +1 -1
  125. package/dist/public/assets/{diagram-NH7WQ7WH-eeVqGH2O.js → diagram-NH7WQ7WH-B_Fhjw29.js} +1 -1
  126. package/dist/public/assets/{diagram-OA4YK3LP-D_SnUALW.js → diagram-OA4YK3LP-1B7_yz5p.js} +1 -1
  127. package/dist/public/assets/{diagram-WEI45ONY-DKlVw8je.js → diagram-WEI45ONY-DzfuKRxf.js} +1 -1
  128. package/dist/public/assets/{dist-CRnLx168.js → dist-Cgpf3BIr.js} +156 -154
  129. package/dist/public/assets/dist-ChSSPf9y.js +2 -0
  130. package/dist/public/assets/dist-CslAqn54.js +1 -0
  131. package/dist/public/assets/{dist-DQ4RxLMf.js → dist-DL8cni8v.js} +1 -1
  132. package/dist/public/assets/{doc-hash-DaHNz5tZ.js → doc-hash-Bso39bSh.js} +1 -1
  133. package/dist/public/assets/{documents-events-CO5GMB1j.js → documents-events-CtKncdGv.js} +1 -1
  134. package/dist/public/assets/{ebnfDiagram-CCIWWBDH-d0cDPEQB.js → ebnfDiagram-CCIWWBDH-BjazoYYO.js} +1 -1
  135. package/dist/public/assets/{erDiagram-Q63AITRT-BsZ0tL6Z.js → erDiagram-Q63AITRT-DvgiLWl5.js} +1 -1
  136. package/dist/public/assets/eventmodeling-45OFAUF4-D8s6Yevv.js +1 -0
  137. package/dist/public/assets/{file-tree-adapter-CMkAk18U.js → file-tree-adapter-SJF4yRd-.js} +1 -1
  138. package/dist/public/assets/{file-tree-utils-DW5kpGI7.js → file-tree-utils-llNa05uo.js} +1 -1
  139. package/dist/public/assets/flowDiagram-23GEKE2U-hlKdkNzZ.js +1 -0
  140. package/dist/public/assets/{ganttDiagram-NO4QXBWP-DPxkIh3b.js → ganttDiagram-NO4QXBWP-CJgOU-j1.js} +1 -1
  141. package/dist/public/assets/gitGraph-TEB2WS4Q-B-5iqxxO.js +1 -0
  142. package/dist/public/assets/{gitGraphDiagram-IHSO6WYX-vSvxugX5.js → gitGraphDiagram-IHSO6WYX-DYP87cJL.js} +1 -1
  143. package/dist/public/assets/globals-88oPHAs4.css +1 -0
  144. package/dist/public/assets/{globals-CXEWtNVL.js → globals-BzYms-F0.js} +1 -1
  145. package/dist/public/assets/{graphlib-C4UD57Nn.js → graphlib-DYCc0Y9o.js} +1 -1
  146. package/dist/public/assets/{highlighted-body-OFNGDK62-DCKUiY8r.js → highlighted-body-OFNGDK62-C9GzQB8c.js} +1 -1
  147. package/dist/public/assets/index-BVWeqqNi.js +2014 -0
  148. package/dist/public/assets/info-DKCQHKI2-CkzkGEPY.js +1 -0
  149. package/dist/public/assets/{infoDiagram-FWYZ7A6U-Crh0f5aw.js → infoDiagram-FWYZ7A6U-CbZOQ254.js} +1 -1
  150. package/dist/public/assets/{ishikawaDiagram-FXEZZL3T-DBJ4jEKk.js → ishikawaDiagram-FXEZZL3T-CUWPHUOP.js} +1 -1
  151. package/dist/public/assets/{journeyDiagram-5HDEW3XC-CUDo0rzP.js → journeyDiagram-5HDEW3XC-RLUp44OU.js} +1 -1
  152. package/dist/public/assets/{kanban-definition-HUTT4EX6-CJD8Oexf.js → kanban-definition-HUTT4EX6-D4TPhDQW.js} +1 -1
  153. package/dist/public/assets/{line-ClsiHw5g.js → line-KTG0S8eM.js} +1 -1
  154. package/dist/public/assets/{linear-BklRBRnp.js → linear-D6fTctUn.js} +1 -1
  155. package/dist/public/assets/lint-config-client-BYECwWuu.js +1 -0
  156. package/dist/public/assets/{map-CMaVsxPf.js → map-Rw6uJqFR.js} +1 -1
  157. package/dist/public/assets/{markdownlint-rule-browser-BkNWMW9T.js → markdownlint-rule-browser-BR80y6ho.js} +1 -1
  158. package/dist/public/assets/mermaid-GHXKKRXX-WtDC9WMV.js +1 -0
  159. package/dist/public/assets/{mermaid-parser.core-D-rj2UdW.js → mermaid-parser.core-CusxBOjy.js} +2 -2
  160. package/dist/public/assets/{mermaid.core-DZGNq3YZ.js → mermaid.core-okCkIUps.js} +3 -3
  161. package/dist/public/assets/{mindmap-definition-LN4V7U3C-Drk1V3-q.js → mindmap-definition-LN4V7U3C-D-eGlMvq.js} +1 -1
  162. package/dist/public/assets/{navigation-targets-BvMgbXSl.js → navigation-targets-SdStq-nY.js} +1 -1
  163. package/dist/public/assets/{now-Ck_JVNC2.js → now-DRL8tqfF.js} +1 -1
  164. package/dist/public/assets/{open-managed-artifact-tab-uWUnYmu7.js → open-managed-artifact-tab-CgQ5akUh.js} +1 -1
  165. package/dist/public/assets/{ordinal-DrDHGs3t.js → ordinal-DnmHW-WD.js} +1 -1
  166. package/dist/public/assets/overlay-layers-y-dNUWSd.js +1 -0
  167. package/dist/public/assets/packet-7NZHBO7P-DDIvLOTX.js +1 -0
  168. package/dist/public/assets/{pegDiagram-2B236MQR-CM3AjMbx.js → pegDiagram-2B236MQR-Bjnm3xCN.js} +1 -1
  169. package/dist/public/assets/{pending-receive-nav-store-ZP5ClzoO.js → pending-receive-nav-store-DTqMgVXW.js} +1 -1
  170. package/dist/public/assets/pie-RZYD4A2V-DnssmCEa.js +1 -0
  171. package/dist/public/assets/{pieDiagram-ENE6RG2P-D8wIwdwS.js → pieDiagram-ENE6RG2P-BkLpbnFN.js} +1 -1
  172. package/dist/public/assets/{prop-types-CaVq0ILj.js → prop-types-CU-rIGvv.js} +1 -1
  173. package/dist/public/assets/{quadrantDiagram-ABIIQ3AL-h2Dtd1uI.js → quadrantDiagram-ABIIQ3AL-eMGNkhp-.js} +1 -1
  174. package/dist/public/assets/radar-I7S5WNFK-0J5y2_MO.js +1 -0
  175. package/dist/public/assets/railroad-3IZDKUUU-BgsONsxl.js +1 -0
  176. package/dist/public/assets/railroad-abnf-AHOZXSZD-BhBo_9j9.js +1 -0
  177. package/dist/public/assets/railroad-ebnf-EBAXGLYW-B5mHA2IL.js +1 -0
  178. package/dist/public/assets/railroad-peg-LSFZ7HO6-BV4uZ4WL.js +1 -0
  179. package/dist/public/assets/{railroadDiagram-RFXS5EU6-CLc68_Sv.js → railroadDiagram-RFXS5EU6-Cs70gdc4.js} +1 -1
  180. package/dist/public/assets/{receive-store-O26Klsmj.js → receive-store-C5uRDARd.js} +1 -1
  181. package/dist/public/assets/{requirementDiagram-TGXJPOKE-DtJA-6Zq.js → requirementDiagram-TGXJPOKE-yQhnovOU.js} +1 -1
  182. package/dist/public/assets/{sankeyDiagram-HTMAVEWB-Dw4-_oAZ.js → sankeyDiagram-HTMAVEWB-C7R3anws.js} +1 -1
  183. package/dist/public/assets/{selection-context-Cl9EWdbI.js → selection-context-DtzxXWAX.js} +1 -1
  184. package/dist/public/assets/{sequenceDiagram-DBY2YBRQ-B4Af8Tp3.js → sequenceDiagram-DBY2YBRQ-CEdbVotz.js} +1 -1
  185. package/dist/public/assets/{sizeCapture-X5ZJPWSS-B7J9pg7l.js → sizeCapture-X5ZJPWSS-DAh96RVo.js} +1 -1
  186. package/dist/public/assets/skill-actions-PBEWDc_3.js +1 -0
  187. package/dist/public/assets/{skills-api-BxZRuTIF.js → skills-api-Cd3IvPjQ.js} +1 -1
  188. package/dist/public/assets/{src-D9eynQ26.js → src--OxBHrEw.js} +1 -1
  189. package/dist/public/assets/{src-BPnSaHfB.js → src-Dum6a22K.js} +2 -2
  190. package/dist/public/assets/{stateDiagram-2N3HPSRC-L3VR_LMr.js → stateDiagram-2N3HPSRC-q96Dmt4i.js} +1 -1
  191. package/dist/public/assets/stateDiagram-v2-6OUMAXLB-BCNHhMpC.js +1 -0
  192. package/dist/public/assets/{swimlanes-5IMT3BWC-CRfWYpqt.js → swimlanes-5IMT3BWC--g7Ac5Wk.js} +2 -2
  193. package/dist/public/assets/swimlanesDiagram-G3AALYLV-hRuoLGg3.js +8 -0
  194. package/dist/public/assets/{tag-pill-input-D3yKn_j2.js → tag-pill-input-CS-2Qx-_.js} +1 -1
  195. package/dist/public/assets/{target-navigation-intent-DKN8qckv.js → target-navigation-intent-D3w-HLu3.js} +1 -1
  196. package/dist/public/assets/{telemetry-impl-DXiL3sBk.js → telemetry-impl-Z8PmW_aL.js} +2 -2
  197. package/dist/public/assets/{telemetry-startup-Db44p95P.js → telemetry-startup-Cy7C8oSF.js} +1 -1
  198. package/dist/public/assets/{terminal-launch-events-cbz64adZ.js → terminal-launch-events-CTVJjVZG.js} +1 -1
  199. package/dist/public/assets/{terminal-telemetry-B-8TrAWX.js → terminal-telemetry-pdIn1zDv.js} +1 -1
  200. package/dist/public/assets/thread-client-C0O75Kza.js +1 -0
  201. package/dist/public/assets/{timeline-definition-FHXFAJF6-C1Qc7Dba.js → timeline-definition-FHXFAJF6-DqrkK_6w.js} +1 -1
  202. package/dist/public/assets/treeView-QDETBFTQ-N2YNex2I.js +1 -0
  203. package/dist/public/assets/treemap-6X3UGDF4-DkzYKeau.js +1 -0
  204. package/dist/public/assets/{typing-burst-detector-DNp0nd7d.js → typing-burst-detector-BEbZgL9-.js} +2 -2
  205. package/dist/public/assets/{uninstall-B_24eCu8.js → uninstall-BpVYvA3J.js} +1 -1
  206. package/dist/public/assets/use-activity-panel-B8RDBgok.js +1 -0
  207. package/dist/public/assets/use-apply-config-color-theme-A0jx7vnI.js +2 -0
  208. package/dist/public/assets/{use-collab-url-DKVO0F_k.js → use-collab-url-bpUtly6S.js} +1 -1
  209. package/dist/public/assets/{use-live-xterm-theme-DxXMX-ZB.js → use-live-xterm-theme-w8QeNUlq.js} +1 -1
  210. package/dist/public/assets/{use-settings-route-R3f95s9q.js → use-settings-route-CFvCFlXS.js} +1 -1
  211. package/dist/public/assets/{use-terminal-enabled-FmmwhtBs.js → use-terminal-enabled-CuFAAh8J.js} +1 -1
  212. package/dist/public/assets/use-timeline-entry-diff-DlW9hmrR.js +6 -0
  213. package/dist/public/assets/{use-workspace-DQ7VjlT1.js → use-workspace-CNWEPWim.js} +1 -1
  214. package/dist/public/assets/{vennDiagram-L72KCM5P-C4cNDPVl.js → vennDiagram-L72KCM5P-DFSXk11G.js} +1 -1
  215. package/dist/public/assets/wardley-OPB4EBWU-OOiOMSoP.js +1 -0
  216. package/dist/public/assets/{wardleyDiagram-EHGQE667-B2UY3KQf.js → wardleyDiagram-EHGQE667-Bw65HviB.js} +1 -1
  217. package/dist/public/assets/{workspace-paths-CFyvLimb.js → workspace-paths-DQOJHVhV.js} +1 -1
  218. package/dist/public/assets/{xychartDiagram-FW5EYKEG-CMsrwnL2.js → xychartDiagram-FW5EYKEG-CEVfZ0d5.js} +1 -1
  219. package/dist/public/index.html +55 -53
  220. package/dist/public/uninstall.html +5 -5
  221. package/dist/{repair-launch-json-CyzMH3Dg.mjs → repair-launch-json-_2TGq22B.mjs} +2 -2
  222. package/dist/{repair-mcp-configs-Bk1NyiZ4.mjs → repair-mcp-configs-Cf6t84yK.mjs} +2 -2
  223. package/dist/repair-skills-CtpTVpw_.mjs +1 -0
  224. package/dist/{repair-skills-C0Geadpr.mjs → repair-skills-DwQqF8O8.mjs} +2 -2
  225. package/dist/schemas/v0/config.project.schema.json +154 -0
  226. package/dist/server-lock-CZMSbPZ0.mjs +1 -0
  227. package/dist/{server-lock-rqh-yT8R.mjs → server-lock-DpWXnrNF.mjs} +2 -2
  228. package/dist/{sleep-B2L0pvp4.mjs → sleep-DTzPXGtM.mjs} +5 -5
  229. package/dist/src-BFcAqZ_V.mjs +1 -0
  230. package/dist/src-BkP5u3RK.mjs +3269 -0
  231. package/dist/{src-Q2mWJGdH.mjs → src-DY417osM.mjs} +124 -120
  232. package/dist/src-JZ7OJ1TB.mjs +20 -0
  233. package/dist/start-0twfe-vW.mjs +1 -0
  234. package/dist/{start-CNop6WpI.mjs → start-BcTJLNem.mjs} +2 -2
  235. package/dist/{write-project-skill-CG87XS-d.mjs → write-project-skill-cxdqSDsT.mjs} +4 -4
  236. package/package.json +5 -5
  237. package/dist/build-L3kflBeC.mjs +0 -1
  238. package/dist/constants-W4BDL0X1.mjs +0 -2
  239. package/dist/fs-traced-BpCA6YXG.mjs +0 -1
  240. package/dist/git-handle-maG17s4k.mjs +0 -1
  241. package/dist/init-CVeJ6jGy.mjs +0 -1
  242. package/dist/loader-DXTwcp6f.mjs +0 -1
  243. package/dist/md-manager-BHEZ9tjn.mjs +0 -2
  244. package/dist/preview-zru6Ga5A.mjs +0 -1
  245. package/dist/public/assets/ActivityModeContent-Cga3MNl5.js +0 -1
  246. package/dist/public/assets/AgentDiffPane-D51hdGMm.js +0 -2
  247. package/dist/public/assets/CodeMirrorPropInput-C5y2rXYX.js +0 -3
  248. package/dist/public/assets/DocumentContext-9aHVrow4.js +0 -38
  249. package/dist/public/assets/FeedbackForm-C2LaBRN9.js +0 -1
  250. package/dist/public/assets/GraphPanel-Bp-rgKAp.js +0 -44
  251. package/dist/public/assets/ManagedArtifactProperties-RLiPia3Z.js +0 -1
  252. package/dist/public/assets/MermaidDocEditor-LMmhg9P3.js +0 -1
  253. package/dist/public/assets/PropertyPanel-BInrc8Dz.js +0 -2
  254. package/dist/public/assets/ReportBugDialogBody-CN9m_7Kk.js +0 -2
  255. package/dist/public/assets/SettingsDialogBody-BCxbiRlp.js +0 -7
  256. package/dist/public/assets/SourceEditor-DEzHIX3Z.js +0 -1
  257. package/dist/public/assets/TerminalSessionsHost-BApXyKBm.js +0 -2
  258. package/dist/public/assets/ThreadView-B0tKB64Q.js +0 -6
  259. package/dist/public/assets/TimelineDiffPane-ErJoJPn_.js +0 -2
  260. package/dist/public/assets/architecture-TIHT7OUA-D0qm7G-3.js +0 -1
  261. package/dist/public/assets/auth-state-cache-HjMem9G-.js +0 -11
  262. package/dist/public/assets/channel-DA_5WVVG.js +0 -1
  263. package/dist/public/assets/chunk-2Q5K7J3B-CZvundFv.js +0 -1
  264. package/dist/public/assets/chunk-VAUOI2AC-CzpwkaIj.js +0 -1
  265. package/dist/public/assets/chunk-XXDRQBXY-aujsIsPx.js +0 -1
  266. package/dist/public/assets/classDiagram-OUVF2IWQ-DaJYvXbz.js +0 -1
  267. package/dist/public/assets/classDiagram-v2-EOCWNBFH-naGS_xxO.js +0 -1
  268. package/dist/public/assets/client-version-Cx5VddNZ.js +0 -1
  269. package/dist/public/assets/cynefin-VYW2F7L2-BIoIBt-C.js +0 -1
  270. package/dist/public/assets/dist-B1qkpf98.js +0 -2
  271. package/dist/public/assets/eventmodeling-45OFAUF4-DJJWSxES.js +0 -1
  272. package/dist/public/assets/flowDiagram-23GEKE2U-BDvIWhMq.js +0 -1
  273. package/dist/public/assets/gitGraph-TEB2WS4Q-DbaUaLPe.js +0 -1
  274. package/dist/public/assets/globals-GYHxaktb.css +0 -1
  275. package/dist/public/assets/index-BvwEhh3F.js +0 -2014
  276. package/dist/public/assets/info-DKCQHKI2-t_ReTPP2.js +0 -1
  277. package/dist/public/assets/lint-config-client-ClOK3XHG.js +0 -1
  278. package/dist/public/assets/mermaid-GHXKKRXX-Cj1_l2m9.js +0 -1
  279. package/dist/public/assets/packet-7NZHBO7P-DvVA7lgt.js +0 -1
  280. package/dist/public/assets/pie-RZYD4A2V-THg35hJ6.js +0 -1
  281. package/dist/public/assets/radar-I7S5WNFK-Cnae5YqF.js +0 -1
  282. package/dist/public/assets/railroad-3IZDKUUU-z19uKrUP.js +0 -1
  283. package/dist/public/assets/railroad-abnf-AHOZXSZD-BUg9AO49.js +0 -1
  284. package/dist/public/assets/railroad-ebnf-EBAXGLYW-DuBtfJ_K.js +0 -1
  285. package/dist/public/assets/railroad-peg-LSFZ7HO6-BSfcErEJ.js +0 -1
  286. package/dist/public/assets/skill-actions-BOEtYQao.js +0 -1
  287. package/dist/public/assets/stateDiagram-v2-6OUMAXLB-DM5o7mT7.js +0 -1
  288. package/dist/public/assets/swimlanesDiagram-G3AALYLV-BTrTvdTh.js +0 -8
  289. package/dist/public/assets/thread-client-CurKSSA8.js +0 -1
  290. package/dist/public/assets/treeView-QDETBFTQ-nC4bzLZB.js +0 -1
  291. package/dist/public/assets/treemap-6X3UGDF4-D1MGcMAJ.js +0 -1
  292. package/dist/public/assets/use-activity-panel-CcjzkedG.js +0 -1
  293. package/dist/public/assets/use-apply-config-color-theme-CsOxA7Ln.js +0 -2
  294. package/dist/public/assets/use-timeline-entry-diff-CqINluw6.js +0 -6
  295. package/dist/public/assets/wardley-OPB4EBWU-Dt2lEMaH.js +0 -1
  296. package/dist/repair-skills-D19a_XVe.mjs +0 -1
  297. package/dist/server-lock-DUfHjP3M.mjs +0 -1
  298. package/dist/src-CfIUSiib.mjs +0 -22
  299. package/dist/src-DF_K89lg.mjs +0 -1
  300. package/dist/src-phea8qFf.mjs +0 -3265
  301. package/dist/start-C651KlAq.mjs +0 -1
  302. /package/dist/public/assets/{ActivityPanelDiffView-CSOgz1F9.js → ActivityPanelDiffView-B03Wzvap.js} +0 -0
  303. /package/dist/public/assets/{AppMenubar-CXadCCMc.js → AppMenubar-Bisp0k8X.js} +0 -0
  304. /package/dist/public/assets/{BugReportHistoryDialog-B5Yf5rAM.js → BugReportHistoryDialog-Bp4PHyEI.js} +0 -0
  305. /package/dist/public/assets/{__vite-browser-external-T_MG5_bv.js → __vite-browser-external-BckCY-VI.js} +0 -0
  306. /package/dist/public/assets/{agent-presence-CTJkQnoU.js → agent-presence-CEfNcJUY.js} +0 -0
  307. /package/dist/public/assets/{array-BAI_NyvG.js → array-D9gZmznT.js} +0 -0
  308. /package/dist/public/assets/{chunk-KEIR6QF5-BSqm2tNO.js → chunk-KEIR6QF5-zkgbDrf9.js} +0 -0
  309. /package/dist/public/assets/{chunk-Y2CYZVJY-BCLrJxO_.js → chunk-Y2CYZVJY-BAUBUeAF.js} +0 -0
  310. /package/dist/public/assets/{clike-CkWR_Slw.js → clike-ccBqxK3t.js} +0 -0
  311. /package/dist/public/assets/{clipboard-adapter--Ja4oXEM.js → clipboard-adapter-Cxzkvc1d.js} +0 -0
  312. /package/dist/public/assets/{colors-C1oQkVlI.js → colors-BZ7r12jC.js} +0 -0
  313. /package/dist/public/assets/{copilot-BAzfPGty.js → copilot-CjOGWDvv.js} +0 -0
  314. /package/dist/public/assets/{cursor-C1n4GZG0.js → cursor-B8rehP9c.js} +0 -0
  315. /package/dist/public/assets/{cytoscape.esm-ewu4kfMU.js → cytoscape.esm-GtliGICm.js} +0 -0
  316. /package/dist/public/assets/{defaultLocale-C0VJf-tm.js → defaultLocale-CqKPYlUZ.js} +0 -0
  317. /package/dist/public/assets/{diff-BsdYbIgD.js → diff-oW0nWZgn.js} +0 -0
  318. /package/dist/public/assets/{dist-DDqBNQiG.js → dist-B1Jbz0yl.js} +0 -0
  319. /package/dist/public/assets/{dist-d-7NE8aL.js → dist-Cqbn6bM9.js} +0 -0
  320. /package/dist/public/assets/{dist-BF6U-ayK.js → dist-D1zECWv_.js} +0 -0
  321. /package/dist/public/assets/{dist-BocybIB-.js → dist-zCmaEyrL.js} +0 -0
  322. /package/dist/public/assets/{follow-file-DBnmqlyk.js → follow-file-BghdVu5J.js} +0 -0
  323. /package/dist/public/assets/{form-D-z6QdLf.js → form-coxG-8Qw.js} +0 -0
  324. /package/dist/public/assets/{format-BVhfvqw3.js → format-CejNFduS.js} +0 -0
  325. /package/dist/public/assets/{go-D-ZJPtwk.js → go-CCS4kWKN.js} +0 -0
  326. /package/dist/public/assets/{init-BX0_4ZBD.js → init-CMTNTj66.js} +0 -0
  327. /package/dist/public/assets/{isObject-BkQ5hIlp.js → isObject-Ho9jn-6g.js} +0 -0
  328. /package/dist/public/assets/{libesm-CHqp8owk.js → libesm-Db-3Gx3Z.js} +0 -0
  329. /package/dist/public/assets/{lint-plugin-meta-B3N1DKgL.js → lint-plugin-meta-J-wb-uxW.js} +0 -0
  330. /package/dist/public/assets/{lru-string-cache-hwDoWobi.js → lru-string-cache-BZxOuxTi.js} +0 -0
  331. /package/dist/public/assets/{lua-Cx3bDzQk.js → lua-DgAwqJ0D.js} +0 -0
  332. /package/dist/public/assets/{mcp-consent-store-Xk9UA_MB.js → mcp-consent-store-wvrClpLC.js} +0 -0
  333. /package/dist/public/assets/{min-Bd9Lorof.js → min-BQPeeNfF.js} +0 -0
  334. /package/dist/public/assets/{panel-Cyobla0Z.js → panel-C8ZhM4q-.js} +0 -0
  335. /package/dist/public/assets/{panzoom.es-B9Lp3OVt.js → panzoom.es-CxTS7ZPP.js} +0 -0
  336. /package/dist/public/assets/{path-C1_RvjGX.js → path-DoEWlp6O.js} +0 -0
  337. /package/dist/public/assets/{pdf-B7Y_z-D1.js → pdf-Da_O_GF5.js} +0 -0
  338. /package/dist/public/assets/{pdf.worker-B6TdDPWM.js → pdf.worker-Pbs_-93C.js} +0 -0
  339. /package/dist/public/assets/{perl-CV3dlsd7.js → perl-DMwerdcj.js} +0 -0
  340. /package/dist/public/assets/{properties-D1GaCcfv.js → properties-Du1Kuwqc.js} +0 -0
  341. /package/dist/public/assets/{r-CHRF940O.js → r-wSvpRg5h.js} +0 -0
  342. /package/dist/public/assets/{rough.esm-B1nzhEZO.js → rough.esm-esi5HKC4.js} +0 -0
  343. /package/dist/public/assets/{ruby-YzQuyklS.js → ruby-DuM6hMQW.js} +0 -0
  344. /package/dist/public/assets/{schema-fields-view-intent-Dz1ZzVCe.js → schema-fields-view-intent-BeD8vY0v.js} +0 -0
  345. /package/dist/public/assets/{share-metadata-rows-BlaR96La.js → share-metadata-rows-CbXHISQ4.js} +0 -0
  346. /package/dist/public/assets/{shell-BvVJAeXE.js → shell-BZ7mgeL0.js} +0 -0
  347. /package/dist/public/assets/{skeleton-HLkcMp95.js → skeleton-BG12Hmzn.js} +0 -0
  348. /package/dist/public/assets/{sortable.esm-B6whf_t-.js → sortable.esm-C565D25d.js} +0 -0
  349. /package/dist/public/assets/{sql-CECtKdDi.js → sql-BXdRuz6d.js} +0 -0
  350. /package/dist/public/assets/{src-BaTc8y5c.js → src-DNE52RZP.js} +0 -0
  351. /package/dist/public/assets/{swift-DLct3DJs.js → swift-DZwxTp-L.js} +0 -0
  352. /package/dist/public/assets/{textarea-RSYJwPz9.js → textarea-tdCJViKf.js} +0 -0
  353. /package/dist/public/assets/{thread-draft-staging-B4_1TigQ.js → thread-draft-staging-BuvCYJwg.js} +0 -0
  354. /package/dist/public/assets/{toml-Bl-Vp4wG.js → toml-C5KR4pi6.js} +0 -0
  355. /package/dist/public/assets/{use-installed-clis-B_nDAq7A.js → use-installed-clis-UlK7P1aH.js} +0 -0
  356. /package/dist/public/assets/{useLintConfigViewMode-BYm6FwC5.js → useLintConfigViewMode-DKPENttR.js} +0 -0
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./createLucideIcon-DAkhoPjT.js";import{t as s}from"./button-Gol9BgNB.js";import{a as c,c as l,i as u,n as d,o as f,r as p,s as m,t as h}from"./dialog-TkFkuYVg.js";import{a as g,d as _,f as v,i as y,o as b,p as x,u as S}from"./dropdown-menu-xw8WTdb-.js";import{t as C}from"./label-DyipnO5I.js";import{C as w,a as T,f as E,h as D,m as O,n as k,o as A,p as j,r as M,s as N,t as P}from"./agent-visibility-B4n6jrOx.js";import{Bt as F,Dn as I,En as L,I as R,Qt as z,Rt as B,Sn as V,Tn as H,Vt as U,an as W,bn as G,ct as K,hi as q,kt as ee,lt as te,on as ne,rn as J,vn as re,wn as Y,xn as ie,yn as ae}from"./dist-Cgpf3BIr.js";import{t as oe}from"./RegisteredAgentIcon-C2dU04N7.js";import{a as se,d as ce,l as le,n as ue,r as de,t as fe,u as pe}from"./workspace-paths-DQOJHVhV.js";import{t as me}from"./copy-9EDFYcyR.js";import{t as he}from"./folder-open-wLd69QUc.js";import{t as ge}from"./loader-circle-Cg5SU7AZ.js";import{t as _e}from"./refresh-cw-BfeWGCsv.js";import{t as ve}from"./sliders-horizontal-34K0eDW2.js";import{t as ye}from"./trash-2-BUuL4OCw.js";import{n as X}from"./dist-BLAMau9Z.js";import{t as be}from"./input-D0ZW0Opq.js";import{t as xe}from"./dist-q14fBS3T.js";import{i as Se}from"./use-settings-route-CFvCFlXS.js";import{t as Ce}from"./parse-api-error-C_gwkKmG.js";import{c as we,l as Te}from"./documents-events-CtKncdGv.js";import{n as Ee}from"./config-context-gd3BC-iY.js";import{t as De}from"./use-workspace-CNWEPWim.js";import{n as Oe}from"./clipboard-adapter-Cxzkvc1d.js";import{a as ke,d as Ae,f as je,n as Me,s as Ne,t as Pe}from"./skills-api-Cd3IvPjQ.js";var Fe=o(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),Ie=o(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),Le=o(`pencil-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),Re=o(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Z=t(),Q=e(n(),1),$=a();function ze(e){return{async install(t){let n;try{n=await e.buildAndOpen(t?.force?{force:!0}:void 0)}catch(e){return{ok:!1,reason:`bridge-error`,message:e instanceof Error?e.message:String(e)}}return n.ok?{ok:!0,path:n.path}:{ok:!1,reason:n.reason,message:n.message}}}}function Be(e={}){let t=e.fetch??globalThis.fetch,n=`${e.apiOrigin??``}/api/install-skill`;return{async install(e){let r;try{r=await t(n,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?.force?{force:!0}:{})})}catch(e){return{ok:!1,reason:`network-error`,message:e instanceof Error?e.message:String(e)}}if(!r.ok){let e=`HTTP ${r.status}`;try{let t=Ce(await r.json());t&&(e=t)}catch{}return{ok:!1,reason:`http-error`,message:e}}let i;try{i=await r.json()}catch(e){return{ok:!1,reason:`parse-error`,message:e instanceof Error?e.message:`Invalid server response`}}return!i||typeof i.status!=`string`?{ok:!1,reason:`parse-error`,message:`Invalid server response shape`}:i.status===`failed`?{ok:!1,reason:`build-failed`,message:i.buildError??`unknown build failure`}:{ok:!0,path:i.outputPath,handoffWarning:i.handoffError?.message}}}}function Ve(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?ze(e):Be()}var He=`ok:skill:cowork:installed`,Ue=`1`,We=250,Ge=`/api/skill/install-state`;function Ke(e){return`${He}:v${e}`}var qe=new Map;async function Je(e={},t={}){let n=t.force?`__force__`:`__default__`,r=qe.get(n);if(r)return r;let i=Ye(e,t);return qe.set(n,i),i.finally(()=>{qe.get(n)===i&&qe.delete(n)}),i}async function Ye(e,t){let n=e.installer===void 0?Ve():e.installer,r=Xe(e.storage),i=e.fetchSnapshot??Qe,a=e.serverTimeoutMs??We,o=null;if(!t.force){try{o=await $e(i(),a)}catch(e){console.warn(`[cowork-skill] server install-state check failed; falling through:`,e)}if(o){let e=o.targets[`claude-cowork`]??null;if(e&&e.version===o.currentVersion)return{kind:`already-installed`,source:`server`}}}let s=Ke(o?.currentVersion??e.fallbackSkillVersion??Ze());if(!t.force&&r?.getItem(s)===Ue)return{kind:`already-installed`,source:`local`};if(!n)return{kind:`host-unsupported`};let c=await n.install({force:t.force??!1});if(!c.ok)return{kind:`install-failed`,reason:c.reason,message:c.message};try{r?.setItem(s,Ue)}catch(e){console.warn(`[cowork-skill] storage.setItem failed (guard will not persist):`,e)}return{kind:`installed-now`,path:c.path,handoffWarning:c.handoffWarning}}function Xe(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function Ze(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function Qe(){let e;try{e=await fetch(Ge,{method:`GET`,cache:`no-store`})}catch{return null}if(!e.ok)return null;try{let t=await e.json();return typeof t?.currentVersion==`string`?t:null}catch{return null}}async function $e(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function et(e){return Je({},e)}function tt(){return Je({},{force:!0})}async function nt(e,t){let n;try{n=await t(`/api/handoff`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}catch(e){return{ok:!1,reason:`dispatch-error`,detail:e instanceof Error?e.message:String(e)}}return n.status===200?{ok:!0}:n.status===404?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned 404`}:n.status===422?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned ${n.status}`}:{ok:!1,reason:`dispatch-error`,detail:`POST /api/handoff returned ${n.status}`}}async function rt(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return nt({target:`claude-cowork`,url:J({mode:`cowork`},e)},n);case`claude-code`:return nt({target:`claude-code`,url:J({mode:`code`},e)},n);case`codex`:return nt({target:`codex`,url:W(e)},n);case`cursor`:return nt({target:`cursor`,url:ne(e),workspacePath:e.projectDir},n);case`copilot`:return{ok:!1,reason:`invalid-payload`,detail:`copilot is terminal-only; launch via requestTerminalLaunch`};case`opencode`:return{ok:!1,reason:`invalid-payload`,detail:`opencode is terminal-only; launch via requestTerminalLaunch`};case`pi`:return{ok:!1,reason:`invalid-payload`,detail:`pi is terminal-only; launch via requestTerminalLaunch`};case`antigravity`:return{ok:!1,reason:`invalid-payload`,detail:`antigravity is terminal-only; launch via requestTerminalLaunch`};case`openclaw`:return{ok:!1,reason:`invalid-payload`,detail:`openclaw is terminal-only; launch via requestTerminalLaunch`};case`hermes`:return{ok:!1,reason:`invalid-payload`,detail:`hermes is terminal-only; launch via requestTerminalLaunch`};default:{let t=e.target;return{ok:!1,reason:`invalid-payload`,detail:`unknown target: ${String(t)}`}}}}async function it(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.recordHandoff)try{await n.shell.recordHandoff(e)}catch(e){(t.warn??(e=>console.warn(e)))(`[handoff] recordHandoff IPC rejected (telemetry skipped): ${e instanceof Error?e.message:String(e)}`)}}var at=`open-knowledge:agent-thread-launch`;function ot(e,t=typeof window>`u`?new EventTarget:window){t.dispatchEvent(new CustomEvent(at,{detail:e}))}function st(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;n&&typeof n.agentId==`string`&&e(n)};return t.addEventListener(at,n),()=>t.removeEventListener(at,n)}function ct(e){if(!e.docName||!e.workspace)return null;let t=fe(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:{relativePath:t},projectDir:n,docPath:ue(n,t,r)}}function lt(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function ut(e){return e.workspace?.contentDir?{docContext:null,createDescription:e.description,createScenario:e.scenario,createMentions:e.mentions,projectDir:e.workspace.contentDir,docPath:``}:null}function dt(e){return j(e.installUrl).then(()=>void 0)}function ft(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function pt(e){return!e.workspace?.contentDir||!e.skillName?null:{docContext:null,skill:{name:e.skillName,scope:e.scope},projectDir:e.workspace.contentDir,docPath:``}}function mt(e){if(!e.workspace?.contentDir)return null;let{contentDir:t,pathSeparator:n}=e.workspace;if(e.docName){let r=e.docRelativePath??fe(e.docName),i={scope:`doc`,docRelativePath:r,instruction:e.instruction,mentions:e.mentions};return{docContext:null,compose:e.selection===void 0?i:{...i,selection:e.selection},projectDir:t,docPath:ue(t,r,n)}}return e.folderRelativePath?{docContext:null,compose:{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}:{docContext:null,compose:{scope:`project`,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}}function ht(e){return`Opened in ${e}.`}function gt(e,t=1){return t>=3?`Couldn't reach ${e} — please try again later.`:t===2?`Still couldn't reach ${e} — try one more time?`:`Couldn't reach ${e} — try again?`}function _t(e){return e>=3?null:e===2?`Try one more time`:`Retry`}function vt(e,t,n,r,i){let a=i===void 0?{}:{scope:i};return t.ok?{target:e,host:n,outcome:`ok`,ts:r,...a}:{target:e,host:n,outcome:`error`,ts:r,reason:t.reason,...a}}function yt(e,t,n,r){if(e.scope===`doc`){let i={scope:`doc`,docRelativePath:e.docRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r};return e.selection===void 0?i:{...i,selection:e.selection}}return e.scope===`folder`?{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}:{scope:`project`,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}}function bt(e,t,n,r){return e.compose?z(yt(e.compose,t,n,r)):e.selection?Y({...e.selection,target:t,transport:r}):e.skill?H(e.skill.name,e.skill.scope,n):e.ask?re(e.ask.relativePath,e.ask.instruction,n,t,r):q(e.docContext===null?e.folderRelativePath?V(e.folderRelativePath,n,e.instruction,r):e.createDescription===void 0?G(n,e.instruction,r):ae(e.createDescription,n,e.createScenario??`new-project`,e.createMentions??[],r):ie(e.docContext.relativePath,n,e.instruction,r))}function xt(e,t){let n=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||n?`${K} ${bt(e,F[t].handoffTarget,!1,`terminal`)}`:L(e.docContext?.relativePath??null)}function St(e){let t=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||t?`${te} ${bt(e,`claude-code`,!1,`terminal`)}`:I(e.docContext?.relativePath??null)}function Ct(e){let t=e.docContext?.relativePath;return typeof t!=`string`||t===``?null:t.replace(/\.(md|mdx)$/,``)}function wt(e){let t=[e.compose?.instruction,e.selection?.instruction,e.ask?.instruction,e.createDescription,e.instruction];for(let e of t)if(typeof e==`string`&&e.trim()!==``)return e;return null}function Tt(e,t){ot({agentSource:t?.agent?.source??`registry`,agentId:t?.agent?.id??``,prompt:St(e),docName:Ct(e),titleHint:wt(e)})}async function Et(e,t,n,r=1){if(e===`claude-cowork`&&r===1){let e;try{e=await n.ensureCoworkSkillInstalled()}catch(e){let t=e instanceof Error?e.message:String(e);return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-error: ${t}`}}if(e.kind===`installed-now`)return n.toast.success(`OpenKnowledge skill saved. Upload it in Claude Desktop, then click Cowork again.`),{ok:!0};if(e.kind===`install-failed`){let t=e.message??e.reason;return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-failed: ${t}`}}}let i={target:e,projectDir:t.projectDir,docPath:t.docPath,prompt:bt(t,e,n.autoOpen,`url`)},a=await n.dispatchHandoff(i),o=n.isElectronHost()?`electron`:`web`,s=n.now().toISOString(),c=t.compose,l=vt(e,a,o,s,t.selection!=null||c?.scope===`doc`&&c.selection!==void 0?`selection`:void 0);await n.recordHandoff(l);let u=n.getDisplayName(e);if(a.ok)n.toast.success(ht(u));else{let i=_t(r),a=gt(u,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{Et(e,t,n,r+1)}}})}return a}function Dt(e){return O.find(t=>t.id===e)?.displayName??e}function Ot(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function kt(){return{dispatchHandoff:rt,recordHandoff:it,toast:{success:e=>{X.success(e)},error:(e,t)=>{X.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>Ot(),getDisplayName:Dt,ensureCoworkSkillInstalled:et,autoOpen:!0}}function At(){let e=(0,$.c)(2),{merged:t}=Ee(),n=t?.appearance?.preview?.autoOpen??!0,r;return e[0]===n?r=e[1]:(r={dispatch:(e,t)=>Et(e,t,{...kt(),autoOpen:n}),reinstallCoworkSkill:tt},e[0]=n,e[1]=r),r}var jt=[...new Set(O.flatMap(e=>e.schemes))];function Mt(e,t){let n=t.now?.()??Date.now(),r={};for(let t of O){let i=t.schemes[0],a=i===void 0?void 0:e[i];if(!a){r[t.id]={installed:null};continue}r[t.id]={installed:a.installed,...a.displayName===void 0?{}:{displayName:a.displayName},lastChecked:n}}return r}function Nt(e){return Mt({},e)}async function Pt(e){let t=e.schemes??jt,n=await Promise.all(t.map(async t=>{let n=t.replace(/:$/,``);try{return[t,await e.detectProtocol(n)]}catch{return[t,{installed:!1}]}}));return Object.fromEntries(n)}var Ft=Object.fromEntries(jt.map(e=>[e,{installed:!1}]));async function It(e){let t;try{t=await e.fetch(`/api/installed-agents`,{signal:e.signal,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return Ft}if(!t.ok)return Ft;let n;try{n=await t.json()}catch{return Ft}if(typeof n!=`object`||!n||Array.isArray(n))return Ft;let r=n,i={};for(let e of jt)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function Lt(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.installed!==i.installed||n.displayName!==i.displayName)return!1}return!0}function Rt(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Nt({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=Mt(a,{isElectronHost:e.isElectronHost(),now:e.now})};return{probe:async()=>{if(n)return;if(i)return i;if(r!==null&&e.now()-r<t)return;let o=(async()=>{try{let t=await e.probe();if(n)return;let i=!Lt(a,t);a=t,i&&(l(),c()),r=e.now()}catch{}finally{i=null}})();return i=o,o},getTargetStates:()=>o,subscribe:e=>(s.add(e),()=>{s.delete(e)}),cancel:()=>{n=!0,s.clear()}}}function zt(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Bt(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>Pt({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>It({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Vt(){let e=(0,$.c)(5),[t,n]=(0,Q.useState)(Ht),r=(0,Q.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Rt(Bt());r.current=e;let t=e.subscribe(n);e.probe();let i=()=>{e.probe()};return window.addEventListener(`focus`,i),()=>{window.removeEventListener(`focus`,i),t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,Q.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function Ht(){return Nt({isElectronHost:zt(),now:Date.now})}var Ut=(0,Q.createContext)(null);function Wt(e){let t=(0,$.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,Z.jsx)(Ut,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Gt(){return(0,Q.use)(Ut)}function Kt(e){let t=(0,$.c)(48),{itemName:n,isSubmitting:a,onDelete:o,customTitle:h,customDescription:g,customDetail:_,customConfirmLabel:v,customConfirmLabelBusy:y,children:b}=e,{_:x}=i(),S;t[0]!==x||t[1]!==n?(S=n??x({id:`L3CEC1`}),t[0]=x,t[1]=n,t[2]=S):S=t[2];let C=S,w;t[3]!==x||t[4]!==v?(w=v??x({id:`cnGeoo`}),t[3]=x,t[4]=v,t[5]=w):w=t[5];let T=w,E;t[6]!==x||t[7]!==v||t[8]!==y?(E=y??v??x({id:`s3caR3`}),t[6]=x,t[7]=v,t[8]=y,t[9]=E):E=t[9];let D=E,O;t[10]!==x||t[11]!==h||t[12]!==C?(O=h??x({id:`77SdEP`,values:{itemName:C}}),t[10]=x,t[11]=h,t[12]=C,t[13]=O):O=t[13];let k;t[14]===O?k=t[15]:(k=(0,Z.jsx)(l,{children:O}),t[14]=O,t[15]=k);let A;t[16]!==x||t[17]!==g||t[18]!==C?(A=g??x({id:`16D5Zj`,values:{itemName:C}}),t[16]=x,t[17]=g,t[18]=C,t[19]=A):A=t[19];let j;t[20]===A?j=t[21]:(j=(0,Z.jsx)(c,{className:`whitespace-pre-wrap`,children:A}),t[20]=A,t[21]=j);let M;t[22]===_?M=t[23]:(M=_?(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`delete-confirmation-detail`,children:_}):null,t[22]=_,t[23]=M);let N;t[24]!==k||t[25]!==j||t[26]!==M?(N=(0,Z.jsxs)(m,{children:[k,j,M]}),t[24]=k,t[25]=j,t[26]=M,t[27]=N):N=t[27];let P;t[28]===b?P=t[29]:(P=b?(0,Z.jsx)(d,{children:b}):null,t[28]=b,t[29]=P);let F;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsx)(r,{id:`dEgA5A`}),t[30]=F):F=t[30];let I;t[31]===a?I=t[32]:(I=(0,Z.jsx)(p,{asChild:!0,children:(0,Z.jsx)(s,{variant:`outline`,disabled:a,children:F})}),t[31]=a,t[32]=I);let L;t[33]!==T||t[34]!==D||t[35]!==a?(L=a?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ge,{className:`size-4 animate-spin`}),` `,D]}):T,t[33]=T,t[34]=D,t[35]=a,t[36]=L):L=t[36];let R;t[37]!==a||t[38]!==o||t[39]!==L?(R=(0,Z.jsx)(s,{variant:`destructive`,onClick:o,disabled:a,children:L}),t[37]=a,t[38]=o,t[39]=L,t[40]=R):R=t[40];let z;t[41]!==I||t[42]!==R?(z=(0,Z.jsxs)(f,{children:[I,R]}),t[41]=I,t[42]=R,t[43]=z):z=t[43];let B;return t[44]!==P||t[45]!==z||t[46]!==N?(B=(0,Z.jsxs)(u,{children:[N,P,z]}),t[44]=P,t[45]=z,t[46]=N,t[47]=B):B=t[47],B}function qt(e){return e?xe._({id:`wTcjov`}):null}function Jt(e){let t=(0,$.c)(47),{_:n}=i(),a=de(),o=Gt(),s=w(),c=E();if(a)return null;let{input:l,installStates:u,dispatch:d,onBeforeLaunch:f}=e,p=l===null,m,h,C,O,j,I,L,R,z,B,V;if(t[0]!==n||t[1]!==d||t[2]!==l||t[3]!==p||t[4]!==u||t[5]!==f||t[6]!==c||t[7]!==s||t[8]!==o){let e=qt(p),i;t[20]===c?i=t[21]:(i=e=>P(c,e.id),t[20]=c,t[21]=i);let a=D.filter(i),w;t[22]===c?w=t[23]:(w=e=>k(c,e.source,e.id,!0,e.supported),t[22]=c,t[23]=w);let E=s.filter(w),H=o?U.filter(e=>M(c,e,o.installedClis)):[];C=a.length>0,O=o!==null&&H.length>0,j=E.length>0,h=_,t[24]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Z.jsxs)(x,{children:[(0,Z.jsx)(le,{"aria-hidden":`true`}),(0,Z.jsx)(r,{id:`O7_W_a`})]}),t[24]=V):V=t[24],m=v,I=`max-h-80`,L=j?(0,Z.jsxs)(y,{"aria-label":n({id:`vPKX2i`}),children:[(0,Z.jsxs)(b,{className:`flex items-center gap-1.5`,children:[(0,Z.jsx)(r,{id:`RXEbZy`}),(0,Z.jsx)(N,{})]}),E.map(t=>{let i=t.name;return(0,Z.jsxs)(g,{onSelect:()=>{l!==null&&(f?.(),Tt(l,{agent:{source:t.source,id:t.id}}))},disabled:p,"data-testid":`file-tree-open-in-thread-${t.id}`,"aria-label":e?n({id:`gtGQ9S`,values:{agentName:i,hint:e}}):void 0,children:[(0,Z.jsx)(oe,{agentId:t.id,iconUrl:t.iconUrl,className:`size-4`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(r,{id:`5PrrYw`,values:{agentName:i}})}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},`${t.source}:${t.id}`)})]}):null,t[25]!==C||t[26]!==O||t[27]!==j?(R=j&&(O||C)?(0,Z.jsx)(S,{}):null,t[25]=C,t[26]=O,t[27]=j,t[28]=R):R=t[28],z=O?(0,Z.jsxs)(y,{"aria-label":n({id:`ALhMYW`}),children:[(0,Z.jsx)(b,{children:(0,Z.jsx)(r,{id:`ALhMYW`})}),H.map(t=>{let{displayName:r}=F[t];return(0,Z.jsxs)(g,{onSelect:()=>{l!==null&&(f?.(),o.launchInTerminal(l,t))},disabled:p,"data-testid":`file-tree-open-in-terminal-${t}`,"aria-label":n(e?{id:`AIn2Yv`,values:{displayName:r,hint:e}}:{id:`QYfQdv`,values:{displayName:r}}),children:[(0,Z.jsx)(A,{id:T(t),"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:r}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,B=C?(0,Z.jsxs)(Z.Fragment,{children:[O?(0,Z.jsx)(S,{}):null,(0,Z.jsxs)(y,{"aria-label":n({id:`BBqGS9`}),children:[(0,Z.jsx)(b,{children:(0,Z.jsx)(r,{id:`BBqGS9`})}),a.map(t=>{let r=!p,{displayName:i}=t,a=n(e?{id:`1ZpfyB`,values:{displayName:i,hint:e}}:{id:`WqLq6M`,values:{displayName:i}});return(0,Z.jsxs)(g,{disabled:!r,onSelect:()=>{if(l){if(f?.(),u[t.id]?.installed!==!0){dt(t);return}d(t.id,l)}},"data-testid":`file-tree-open-in-${t.id}`,"aria-label":a,children:[(0,Z.jsx)(A,{id:t.id,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null,t[0]=n,t[1]=d,t[2]=l,t[3]=p,t[4]=u,t[5]=f,t[6]=c,t[7]=s,t[8]=o,t[9]=m,t[10]=h,t[11]=C,t[12]=O,t[13]=j,t[14]=I,t[15]=L,t[16]=R,t[17]=z,t[18]=B,t[19]=V}else m=t[9],h=t[10],C=t[11],O=t[12],j=t[13],I=t[14],L=t[15],R=t[16],z=t[17],B=t[18],V=t[19];let H;t[29]!==C||t[30]!==O||t[31]!==j?(H=j||O||C?(0,Z.jsx)(S,{}):null,t[29]=C,t[30]=O,t[31]=j,t[32]=H):H=t[32];let W;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Z.jsx)(ve,{"aria-hidden":`true`}),t[33]=W):W=t[33];let G;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Z.jsxs)(g,{onSelect:Se,"data-testid":`file-tree-open-in-settings`,children:[W,(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(r,{id:`jRAGrQ`})})]}),t[34]=G):G=t[34];let K;t[35]!==m||t[36]!==I||t[37]!==L||t[38]!==R||t[39]!==z||t[40]!==B||t[41]!==H?(K=(0,Z.jsxs)(m,{className:I,children:[L,R,z,B,H,G]}),t[35]=m,t[36]=I,t[37]=L,t[38]=R,t[39]=z,t[40]=B,t[41]=H,t[42]=K):K=t[42];let q;return t[43]!==h||t[44]!==V||t[45]!==K?(q=(0,Z.jsxs)(h,{children:[V,K]}),t[43]=h,t[44]=V,t[45]=K,t[46]=q):q=t[46],q}function Yt(e){let t=(0,$.c)(8),n=e?.enabled??!0,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={status:`idle`},t[0]=r):r=t[0];let[i,a]=(0,Q.useState)(r),[o,s]=(0,Q.useState)(0),c,l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=()=>s($t),t=Te(e),n=we(t=>{t.includes(`files`)&&e()});return()=>{t(),n()}},l=[],t[1]=c,t[2]=l):(c=t[1],l=t[2]),(0,Q.useEffect)(c,l);let u;t[3]===n?u=t[4]:(u=()=>{if(!n)return;let e=!1;return a(Qt),fetch(`/api/skills`).then(Xt).then(t=>{if(e)return;let n=B.safeParse(t);if(!n.success){console.error(`[ok-skills] /api/skills response failed schema validation:`,n.error.issues),a({status:`error`,message:`Server returned an incomplete skills response.`});return}a({status:`ready`,data:n.data.skills})}).catch(t=>{e||a({status:`error`,message:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},t[3]=n,t[4]=u);let d;return t[5]!==n||t[6]!==o?(d=[o,n],t[5]=n,t[6]=o,t[7]=d):d=t[7],(0,Q.useEffect)(u,d),i}async function Xt(e){if(!e.ok){let t=await e.json().catch(Zt);throw Error(Ce(t)??`HTTP ${e.status}`)}return e.json()}function Zt(){return null}function Qt(e){return e.status===`ready`?e:{status:`loading`}}function $t(e){return e+1}function en(e){let t=(0,$.c)(16),{skill:n,onOpenChange:r,onDeleted:a}=e,{_:o}=i(),[s,c]=(0,Q.useState)(!1),l;t[0]!==o||t[1]!==a||t[2]!==r?(l=async function(e){c(!0);let t=await Pe(e.scope,e.name);if(c(!1),!t.ok){let{error:e}=t;X.error(o({id:`AtBdnD`,values:{error:e}}));return}X.success(o({id:`h9QFb9`,values:{0:e.name}})),a(),r(!1)},t[0]=o,t[1]=a,t[2]=r,t[3]=l):l=t[3];let u=l,d=n!==null,f;t[4]!==s||t[5]!==r?(f=e=>{!e&&!s&&r(!1)},t[4]=s,t[5]=r,t[6]=f):f=t[6];let p;t[7]!==o||t[8]!==s||t[9]!==u||t[10]!==n?(p=n?(0,Z.jsx)(Kt,{itemName:o({id:`ExUzM4`,values:{0:n.name}}),isSubmitting:s,onDelete:()=>u(n),customDescription:o({id:`E1Da_b`,values:{0:n.path}})}):null,t[7]=o,t[8]=s,t[9]=u,t[10]=n,t[11]=p):p=t[11];let m;return t[12]!==d||t[13]!==f||t[14]!==p?(m=(0,Z.jsx)(h,{open:d,onOpenChange:f,children:p}),t[12]=d,t[13]=f,t[14]=p,t[15]=m):m=t[15],m}function tn(e){let t=(0,$.c)(68),{skill:n,existingNames:a,onOpenChange:o,onRenamed:d}=e,{_:p}=i(),g=n!==null,_=(0,Q.useId)(),[v,y]=(0,Q.useState)(``),[b,x]=(0,Q.useState)(!1),S;t[0]===n?S=t[1]:(S=()=>{n&&y(n.name)},t[0]=n,t[1]=S);let w=n?.scope,T=n?.name,E;if(t[2]!==w||t[3]!==T?(E=[w,T],t[2]=w,t[3]=T,t[4]=E):E=t[4],(0,Q.useEffect)(S,E),!n)return null;let D,O,k,A;t[5]!==a||t[6]!==v||t[7]!==n.name?(k=v.trim(),A=k===n.name,D=k===``||!ee.test(k),O=!D&&!A&&a.has(k),t[5]=a,t[6]=v,t[7]=n.name,t[8]=D,t[9]=O,t[10]=k,t[11]=A):(D=t[8],O=t[9],k=t[10],A=t[11]);let j=O,M=!D&&!j&&!A&&!b,N;t[12]!==p||t[13]!==M||t[14]!==o||t[15]!==d||t[16]!==n||t[17]!==k?(N=async function(){if(!n||!M)return;x(!0);let e=await Ne({scope:n.scope,fromName:n.name,toName:k});if(x(!1),!e.ok){X.error(p({id:`zKxoPm`,values:{0:n.name,1:e.error}}));return}X.success(p({id:`dUCQo4`,values:{trimmed:k}})),d?.(k),o(!1)},t[12]=p,t[13]=M,t[14]=o,t[15]=d,t[16]=n,t[17]=k,t[18]=N):N=t[18];let P=N,F;t[19]===o?F=t[20]:(F=e=>e?null:o(!1),t[19]=o,t[20]=F);let I;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Z.jsx)(l,{children:(0,Z.jsx)(r,{id:`dw_3cv`})}),t[21]=I):I=t[21];let L;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsxs)(m,{children:[I,(0,Z.jsx)(c,{children:(0,Z.jsx)(r,{id:`R9IDFz`})})]}),t[22]=L):L=t[22];let R;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Z.jsx)(r,{id:`6YtxFj`}),t[23]=R):R=t[23];let z;t[24]===_?z=t[25]:(z=(0,Z.jsx)(C,{htmlFor:_,children:R}),t[24]=_,t[25]=z);let B;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>y(e.target.value),t[26]=B):B=t[26];let V;t[27]===P?V=t[28]:(V=e=>{e.key===`Enter`&&P()},t[27]=P,t[28]=V);let H=D||j,U=D&&k!==``||j?`${_}-error`:void 0,W;t[29]!==_||t[30]!==v||t[31]!==V||t[32]!==H||t[33]!==U?(W=(0,Z.jsx)(be,{id:_,value:v,onChange:B,onKeyDown:V,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,"aria-invalid":H,"aria-describedby":U,className:`font-mono`}),t[29]=_,t[30]=v,t[31]=V,t[32]=H,t[33]=U,t[34]=W):W=t[34];let G;t[35]!==j||t[36]!==_||t[37]!==D||t[38]!==k?(G=D&&k!==``?(0,Z.jsx)(`p`,{id:`${_}-error`,className:`text-xs text-destructive`,children:(0,Z.jsx)(r,{id:`A50vr3`,components:{0:(0,Z.jsx)(`code`,{className:`font-mono`})}})}):j?(0,Z.jsx)(`p`,{id:`${_}-error`,className:`text-xs text-destructive`,children:(0,Z.jsx)(r,{id:`YJ1BTp`})}):null,t[35]=j,t[36]=_,t[37]=D,t[38]=k,t[39]=G):G=t[39];let K;t[40]!==z||t[41]!==W||t[42]!==G?(K=(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[z,W,G]}),t[40]=z,t[41]=W,t[42]=G,t[43]=K):K=t[43];let q;t[44]===o?q=t[45]:(q=()=>o(!1),t[44]=o,t[45]=q);let te;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Z.jsx)(r,{id:`dEgA5A`}),t[46]=te):te=t[46];let ne;t[47]!==b||t[48]!==q?(ne=(0,Z.jsx)(s,{variant:`ghost`,onClick:q,disabled:b,children:te}),t[47]=b,t[48]=q,t[49]=ne):ne=t[49];let J;t[50]===P?J=t[51]:(J=()=>void P(),t[50]=P,t[51]=J);let re=!M,Y;t[52]===b?Y=t[53]:(Y=b?(0,Z.jsx)(r,{id:`tHKQ6j`}):(0,Z.jsx)(r,{id:`2wxgft`}),t[52]=b,t[53]=Y);let ie;t[54]!==J||t[55]!==re||t[56]!==Y?(ie=(0,Z.jsx)(s,{onClick:J,disabled:re,children:Y}),t[54]=J,t[55]=re,t[56]=Y,t[57]=ie):ie=t[57];let ae;t[58]!==ne||t[59]!==ie?(ae=(0,Z.jsxs)(f,{children:[ne,ie]}),t[58]=ne,t[59]=ie,t[60]=ae):ae=t[60];let oe;t[61]!==K||t[62]!==ae?(oe=(0,Z.jsxs)(u,{children:[L,K,ae]}),t[61]=K,t[62]=ae,t[63]=oe):oe=t[63];let se;return t[64]!==g||t[65]!==oe||t[66]!==F?(se=(0,Z.jsx)(h,{open:g,onOpenChange:F,children:oe}),t[64]=g,t[65]=oe,t[66]=F,t[67]=se):se=t[67],se}function nn(e){let t=(0,$.c)(15),{skill:n,onOpenChange:a,onUpdated:o}=e,{_:g}=i(),[_,v]=(0,Q.useState)(!1),y;t[0]!==g||t[1]!==a||t[2]!==o?(y=async function(e){v(!0);let t=await je({scope:e.scope,name:e.name});v(!1);let n=se(e.name);if(!t.ok){X.error(g({id:`FRqZ9v`,values:{0:t.error}}));return}X.success(t.checkpointRef?g({id:`My9uXI`,values:{0:t.version,display:n}}):g({id:`mPneVR`,values:{0:t.version,display:n}})),o(),a(!1)},t[0]=g,t[1]=a,t[2]=o,t[3]=y):y=t[3];let b=y,x=n!==null,S;t[4]!==a||t[5]!==_?(S=e=>{!e&&!_&&a(!1)},t[4]=a,t[5]=_,t[6]=S):S=t[6];let C;t[7]!==b||t[8]!==n||t[9]!==_?(C=n?(0,Z.jsxs)(u,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(m,{children:[(0,Z.jsx)(l,{children:(0,Z.jsx)(r,{id:`iAoh55`,values:{0:se(n.name)}})}),(0,Z.jsx)(c,{children:n.installedVersion?(0,Z.jsx)(r,{id:`47EXvY`,values:{0:n.bundledVersion??``,1:n.installedVersion}}):(0,Z.jsx)(r,{id:`nD7Fx9`,values:{0:n.bundledVersion??``}})})]}),(0,Z.jsx)(d,{}),(0,Z.jsxs)(f,{children:[(0,Z.jsx)(p,{asChild:!0,children:(0,Z.jsx)(s,{variant:`outline`,disabled:_,children:(0,Z.jsx)(r,{id:`dEgA5A`})})}),(0,Z.jsx)(s,{onClick:()=>void b(n),disabled:_,children:_?(0,Z.jsx)(r,{id:`JL3si7`}):(0,Z.jsx)(r,{id:`EkH9pt`})})]})]}):null,t[7]=b,t[8]=n,t[9]=_,t[10]=C):C=t[10];let w;return t[11]!==x||t[12]!==S||t[13]!==C?(w=(0,Z.jsx)(h,{open:x,onOpenChange:S,children:C}),t[11]=x,t[12]=S,t[13]=C,t[14]=w):w=t[14],w}function rn(){let e=(0,$.c)(30),{_:t}=i(),[n,r]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(null),[l,u]=(0,Q.useState)(null),d;e[0]===t?d=e[1]:(d=async function(e,n){u(e.name);let r=await ke({scope:e.scope,name:e.name,...n?{targets:[...n]}:{}});if(u(null),!r.ok)return X.error(t({id:`Mj8R8K`,values:{0:r.error}})),r;let i=an,a=new Set(r.hosts),o=r.hosts.filter(t=>!e.hosts.includes(t)),s=e.hosts.filter(e=>!a.has(e)),c=e=>{let t=r.warningCodes.indexOf(e);return t>=0?r.warnings[t]:void 0},l=c(`no-targets`);if(l)return X.warning(l),r;if(o.length>0){let e=c(`scripts-present`);e&&X.warning(e)}return r.hosts.length===0?X.success(t({id:`0LBDjY`,values:{0:e.name}})):o.length>0&&s.length===0?X.success(t({id:`PPFQ3o`,values:{0:e.name,1:i(o)}})):s.length>0&&o.length===0?X.success(t({id:`OOIVJo`,values:{0:e.name,1:i(s)}})):o.length>0&&s.length>0?X.success(t({id:`OxplNM`,values:{0:e.name,1:i(o),2:i(s)}})):X.success(t({id:`wDgmsr`,values:{0:e.name,1:i(r.hosts)}})),r},e[0]=t,e[1]=d);let f=d,p;e[2]===t?p=e[3]:(p=async function(e){u(e.name);let n=await Ae({scope:e.scope,name:e.name});return u(null),n.ok?X.success(t({id:`0LBDjY`,values:{0:e.name}})):X.error(t({id:`nJq7et`,values:{0:n.error}})),n},e[2]=t,e[3]=p);let m=p,h;e[4]===t?h=e[5]:(h=async function(e,n){let r=await Me({scope:e.scope,name:e.name,existingNames:n});if(!r.ok){X.error(t({id:`UPjaXD`,values:{0:e.name,1:r.error}}));return}X.success(t({id:`0g7rCZ`,values:{0:r.name}}))},e[4]=t,e[5]=h);let g=h,_,v;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{e||r(null)},v=()=>r(null),e[6]=_,e[7]=v):(_=e[6],v=e[7]);let y;e[8]===n?y=e[9]:(y=(0,Z.jsx)(en,{skill:n,onOpenChange:_,onDeleted:v}),e[8]=n,e[9]=y);let b=a?.skill??null,x=a?.existingNames??sn,S,C;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>{e||o(null)},C=()=>o(null),e[10]=S,e[11]=C):(S=e[10],C=e[11]);let w;e[12]!==b||e[13]!==x?(w=(0,Z.jsx)(tn,{skill:b,existingNames:x,onOpenChange:S,onRenamed:C}),e[12]=b,e[13]=x,e[14]=w):w=e[14];let T,E;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>{e||c(null)},E=()=>c(null),e[15]=T,e[16]=E):(T=e[15],E=e[16]);let D;e[17]===s?D=e[18]:(D=(0,Z.jsx)(nn,{skill:s,onOpenChange:T,onUpdated:E}),e[17]=s,e[18]=D);let O;e[19]!==w||e[20]!==D||e[21]!==y?(O=(0,Z.jsxs)(Z.Fragment,{children:[y,w,D]}),e[19]=w,e[20]=D,e[21]=y,e[22]=O):O=e[22];let k=O,A;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(A=(e,t)=>o({skill:e,existingNames:t}),e[23]=A):A=e[23];let j;return e[24]!==k||e[25]!==g||e[26]!==f||e[27]!==l||e[28]!==m?(j={installingName:l,install:f,uninstall:m,duplicate:g,requestDelete:r,requestRename:A,requestUpdate:c,dialogs:k},e[24]=k,e[25]=g,e[26]=f,e[27]=l,e[28]=m,e[29]=j):j=e[29],j}function an(e){return e.map(on).join(`, `)}function on(e){return R[e]??e}var sn=new Set;function cn(e){let t=(0,$.c)(19),{skill:n,onEdit:i,onInstall:a,onUninstall:o,onDelete:s}=e,c,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(pe,{"aria-hidden":!0}),l=(0,Z.jsx)(r,{id:`ePK91l`}),t[0]=c,t[1]=l):(c=t[0],l=t[1]);let u;t[2]===i?u=t[3]:(u=(0,Z.jsxs)(g,{onSelect:i,children:[c,l]}),t[2]=i,t[3]=u);let d;t[4]!==a||t[5]!==n.installed?(d=a&&!n.installed?(0,Z.jsxs)(g,{onSelect:a,children:[(0,Z.jsx)(Fe,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`TKQ7K-`})]}):null,t[4]=a,t[5]=n.installed,t[6]=d):d=t[6];let f;t[7]!==o||t[8]!==n.installed?(f=n.installed?(0,Z.jsxs)(g,{onSelect:o,children:[(0,Z.jsx)(Re,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`fo0VXg`})]}):null,t[7]=o,t[8]=n.installed,t[9]=f):f=t[9];let p,m;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(ye,{"aria-hidden":!0}),m=(0,Z.jsx)(r,{id:`cnGeoo`}),t[10]=p,t[11]=m):(p=t[10],m=t[11]);let h;t[12]===s?h=t[13]:(h=(0,Z.jsxs)(g,{variant:`destructive`,onSelect:s,children:[p,m]}),t[12]=s,t[13]=h);let _;return t[14]!==u||t[15]!==d||t[16]!==f||t[17]!==h?(_=(0,Z.jsxs)(Z.Fragment,{children:[u,d,f,h]}),t[14]=u,t[15]=d,t[16]=f,t[17]=h,t[18]=_):_=t[18],_}function ln(e){let t=(0,$.c)(94),{skill:n,actions:a,existingNames:o}=e,{_:s}=i(),c=De(),l=Vt().states,{dispatch:u}=At(),d=typeof window<`u`?window.okDesktop:void 0,f=n.absolutePath,p;t[0]===s?p=t[1]:(p=async function(e){try{await Oe(e),X.success(s({id:`SXCSQd`}))}catch{X.error(s({id:`cRHuuI`}))}},t[0]=s,t[1]=p);let m=p;if(n.managed){let e,i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(b,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,Z.jsx)(Ie,{className:`size-3`,"aria-hidden":!0}),(0,Z.jsx)(r,{id:`VITWk5`})]}),i=(0,Z.jsx)(S,{}),t[2]=e,t[3]=i):(e=t[2],i=t[3]);let a;t[4]===f?a=t[5]:(a=d&&f?(0,Z.jsxs)(g,{onSelect:()=>void d.shell.showItemInFolder(f),children:[(0,Z.jsx)(he,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`LtSYdi`})]}):null,t[4]=f,t[5]=a);let o;t[6]!==n.name||t[7]!==n.scope||t[8]!==c?(o=pt({skillName:n.name,scope:n.scope,workspace:c}),t[6]=n.name,t[7]=n.scope,t[8]=c,t[9]=o):o=t[9];let s;t[10]!==u||t[11]!==l||t[12]!==o?(s=(0,Z.jsx)(Jt,{input:o,installStates:l,isElectronHost:d!=null,dispatch:u}),t[10]=u,t[11]=l,t[12]=o,t[13]=s):s=t[13];let p;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsxs)(x,{children:[(0,Z.jsx)(me,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`zd00pH`})]}),t[14]=p):p=t[14];let h;t[15]!==f||t[16]!==m?(h=f?(0,Z.jsx)(g,{onSelect:()=>void m(f),children:(0,Z.jsx)(r,{id:`z2funE`})}):null,t[15]=f,t[16]=m,t[17]=h):h=t[17];let y;t[18]!==m||t[19]!==n.path?(y=()=>void m(n.path),t[18]=m,t[19]=n.path,t[20]=y):y=t[20];let C;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(r,{id:`xloBjn`}),t[21]=C):C=t[21];let w;t[22]===y?w=t[23]:(w=(0,Z.jsx)(g,{onSelect:y,children:C}),t[22]=y,t[23]=w);let T;t[24]!==w||t[25]!==h?(T=(0,Z.jsxs)(_,{children:[p,(0,Z.jsxs)(v,{children:[h,w]})]}),t[24]=w,t[25]=h,t[26]=T):T=t[26];let E;return t[27]!==T||t[28]!==a||t[29]!==s?(E=(0,Z.jsxs)(Z.Fragment,{children:[e,i,a,s,T]}),t[27]=T,t[28]=a,t[29]=s,t[30]=E):E=t[30],E}let h;t[31]===f?h=t[32]:(h=d&&f?(0,Z.jsxs)(g,{onSelect:()=>void d.shell.showItemInFolder(f),children:[(0,Z.jsx)(he,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`LtSYdi`})]}):null,t[31]=f,t[32]=h);let y;t[33]!==n.name||t[34]!==n.scope||t[35]!==c?(y=pt({skillName:n.name,scope:n.scope,workspace:c}),t[33]=n.name,t[34]=n.scope,t[35]=c,t[36]=y):y=t[36];let C;t[37]!==u||t[38]!==l||t[39]!==y?(C=(0,Z.jsx)(Jt,{input:y,installStates:l,isElectronHost:d!=null,dispatch:u}),t[37]=u,t[38]=l,t[39]=y,t[40]=C):C=t[40];let w;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsxs)(x,{children:[(0,Z.jsx)(me,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`zd00pH`})]}),t[41]=w):w=t[41];let T;t[42]!==f||t[43]!==m?(T=f?(0,Z.jsx)(g,{onSelect:()=>void m(f),children:(0,Z.jsx)(r,{id:`z2funE`})}):null,t[42]=f,t[43]=m,t[44]=T):T=t[44];let E;t[45]!==m||t[46]!==n.path?(E=()=>void m(n.path),t[45]=m,t[46]=n.path,t[47]=E):E=t[47];let D;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(r,{id:`xloBjn`}),t[48]=D):D=t[48];let O;t[49]===E?O=t[50]:(O=(0,Z.jsx)(g,{onSelect:E,children:D}),t[49]=E,t[50]=O);let k;t[51]!==T||t[52]!==O?(k=(0,Z.jsxs)(_,{children:[w,(0,Z.jsxs)(v,{children:[T,O]})]}),t[51]=T,t[52]=O,t[53]=k):k=t[53];let A;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsx)(S,{}),t[54]=A):A=t[54];let j;t[55]!==a||t[56]!==o||t[57]!==n?(j=()=>void a.duplicate(n,o),t[55]=a,t[56]=o,t[57]=n,t[58]=j):j=t[58];let M,N;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Z.jsx)(ce,{"aria-hidden":!0}),N=(0,Z.jsx)(r,{id:`euc6Ns`}),t[59]=M,t[60]=N):(M=t[59],N=t[60]);let P;t[61]===j?P=t[62]:(P=(0,Z.jsxs)(g,{onSelect:j,children:[M,N]}),t[61]=j,t[62]=P);let F;t[63]!==a||t[64]!==o||t[65]!==n?(F=()=>a.requestRename(n,o),t[63]=a,t[64]=o,t[65]=n,t[66]=F):F=t[66];let I,L;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Z.jsx)(Le,{"aria-hidden":!0}),L=(0,Z.jsx)(r,{id:`2wxgft`}),t[67]=I,t[68]=L):(I=t[67],L=t[68]);let R;t[69]===F?R=t[70]:(R=(0,Z.jsxs)(g,{onSelect:F,children:[I,L]}),t[69]=F,t[70]=R);let z;t[71]!==a||t[72]!==n?(z=n.updateAvailable?(0,Z.jsxs)(g,{onSelect:()=>a.requestUpdate(n),children:[(0,Z.jsx)(_e,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`6g2jsp`})]}):null,t[71]=a,t[72]=n,t[73]=z):z=t[73];let B;t[74]!==a||t[75]!==n?(B=n.installed?(0,Z.jsxs)(g,{onSelect:()=>void a.uninstall(n),children:[(0,Z.jsx)(Re,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`fo0VXg`})]}):(0,Z.jsxs)(g,{onSelect:()=>void a.install(n),children:[(0,Z.jsx)(Fe,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`TKQ7K-`})]}),t[74]=a,t[75]=n,t[76]=B):B=t[76];let V;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Z.jsx)(S,{}),t[77]=V):V=t[77];let H;t[78]!==a||t[79]!==n?(H=()=>a.requestDelete(n),t[78]=a,t[79]=n,t[80]=H):H=t[80];let U,W;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(ye,{"aria-hidden":!0}),W=(0,Z.jsx)(r,{id:`cnGeoo`}),t[81]=U,t[82]=W):(U=t[81],W=t[82]);let G;t[83]===H?G=t[84]:(G=(0,Z.jsxs)(g,{variant:`destructive`,onSelect:H,children:[U,W]}),t[83]=H,t[84]=G);let K;return t[85]!==k||t[86]!==P||t[87]!==R||t[88]!==h||t[89]!==z||t[90]!==B||t[91]!==G||t[92]!==C?(K=(0,Z.jsxs)(Z.Fragment,{children:[h,C,k,A,P,R,z,B,V,G]}),t[85]=k,t[86]=P,t[87]=R,t[88]=h,t[89]=z,t[90]=B,t[91]=G,t[92]=C,t[93]=K):K=t[93],K}export{Fe as C,Ie as S,Dt as _,Jt as a,At as b,Gt as c,ut as d,ft as f,xt as g,pt as h,Yt as i,Vt as l,lt as m,ln as n,Kt as o,ct as p,rn as r,Wt as s,cn as t,mt as u,dt as v,st as x,Tt as y};
@@ -1 +1 @@
1
- import{t as e}from"./parse-api-error-C_gwkKmG.js";import{i as t}from"./documents-events-CO5GMB1j.js";async function n(t){return e(await t.json().catch(()=>null))??`HTTP ${t.status}`}async function r(e){try{let r=await fetch(`/api/skill`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,created:i?.created??!1,warnings:i?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function i(e){try{let r=await fetch(`/api/skill-file`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,created:i?.created??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function a(){try{let e=await fetch(`/api/skills/management`);return e.ok?await e.json():null}catch{return null}}async function o(e){try{return(await fetch(`/api/skills/management`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({manageEditorSkills:e})})).ok?(t(),!0):!1}catch{return!1}}function s(e,t){let n=`${e}-copy`;if(!t.has(n))return n;for(let n=2;n<1e3;n+=1){let r=`${e}-copy-${n}`;if(!t.has(r))return r}return`${e}-copy-${t.size+1}`}async function c(e){try{let t=new URLSearchParams({name:e.name,scope:e.scope}),i=await fetch(`/api/skill?${t.toString()}`);if(!i.ok)return{ok:!1,error:await n(i)};let a=await i.json().catch(()=>null),o=typeof a?.skill?.frontmatter?.description==`string`?a.skill.frontmatter.description:``,c=typeof a?.skill?.body==`string`?a.skill.body:``,l=s(e.name,e.existingNames),u=await r({scope:e.scope,name:l,frontmatter:{name:l,description:o},body:c});return u.ok?{ok:!0,name:l}:{ok:!1,error:u.error}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function l(e){let{name:a,fromScope:o,toScope:s}=e;if(o===s)return{ok:!0,scope:s};try{let e=await fetch(`/api/skill?name=${encodeURIComponent(a)}&scope=${o}`);if(!e.ok)return{ok:!1,error:await n(e)};let c=await e.json().catch(()=>null),l=typeof c?.skill?.frontmatter?.description==`string`?c.skill.frontmatter.description:``,u=typeof c?.skill?.body==`string`?c.skill.body:``,p=await fetch(`/api/skill?name=${encodeURIComponent(a)}&scope=${s}`);if(p.ok)return{ok:!1,error:`A ${s} skill named "${a}" already exists.`};if(p.status!==404)return{ok:!1,error:`Couldn't verify the ${s} destination "${a}" is free (HTTP ${p.status}); aborting before any write so an existing skill can't be overwritten. Retry in a moment.`};let m=await r({scope:s,name:a,frontmatter:{name:a,description:l},body:u});if(!m.ok)return m;let h=await f(o,a);if(!h.ok)return{ok:!1,error:`Copied "${a}" to ${s}, but reading its bundle files failed (${h.error}); the ${o} original is intact. Delete the partial ${s} copy and retry.`};let g=[];for(let e of h.files){if(e.text===null){g.push(e.path);continue}let t=await i({scope:s,name:a,path:e.path,content:e.text});if(!t.ok)return{ok:!1,error:`Copied "${a}" to ${s}, but copying its bundle file "${e.path}" failed (${t.error}); the ${o} original is intact. Delete the partial ${s} copy and retry.`}}let _=await d(o,a);return _.ok?(t(),{ok:!0,scope:s,...g.length>0?{skippedBinaryFiles:g}:{}}):{ok:!1,error:`Copied to ${s}, but couldn't remove the ${o} copy: ${_.error}`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function u(e){try{let r=await fetch(`/api/skill`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,committed:i?.committed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function d(e,r){try{let i=`?name=${encodeURIComponent(r)}&scope=${encodeURIComponent(e)}`,a=await fetch(`/api/skill${i}`,{method:`DELETE`});if(!a.ok)return{ok:!1,error:await n(a)};let o=await a.json().catch(()=>null);return t(),{ok:!0,existed:o?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function f(e,t){try{let r=new URLSearchParams({name:t,scope:e}),i=await fetch(`/api/skill?${r.toString()}`);return i.ok?{ok:!0,files:(await i.json().catch(()=>null))?.skill?.files??[]}:{ok:!1,error:await n(i)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function p(e){try{let t=new URLSearchParams({name:e.name,scope:e.scope,path:e.path}),r=await fetch(`/api/skill-file?${t.toString()}`,{signal:e.signal});if(!r.ok)return{ok:!1,status:r.status,error:await n(r)};let i=await r.json().catch(()=>null);return typeof i?.text==`string`?{ok:!0,text:i.text}:{ok:!1,status:r.status,error:`HTTP ${r.status}`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function m(e,t){return p({...e,signal:t}).then(e=>e.ok?{ok:!0,text:e.text}:{ok:!1,status:e.status})}async function h(e){try{let r=await fetch(`/api/skill/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,hosts:i?.hosts??[],scripts:i?.scripts??!1,warnings:i?.warnings??[],warningCodes:i?.warningCodes??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function g(e){try{let r=await fetch(`/api/skill/uninstall`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,uninstalled:i?.uninstalled??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function _(e){try{let r=await fetch(`/api/skill/update`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,version:i?.version??``,previousVersion:i?.previousVersion,checkpointRef:i?.checkpointRef}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}export{h as a,l as c,g as d,_ as f,a as i,r as l,c as n,m as o,f as r,u as s,d as t,o as u};
1
+ import{t as e}from"./parse-api-error-C_gwkKmG.js";import{i as t}from"./documents-events-CtKncdGv.js";async function n(t){return e(await t.json().catch(()=>null))??`HTTP ${t.status}`}async function r(e){try{let r=await fetch(`/api/skill`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,created:i?.created??!1,warnings:i?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function i(e){try{let r=await fetch(`/api/skill-file`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,created:i?.created??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function a(){try{let e=await fetch(`/api/skills/management`);return e.ok?await e.json():null}catch{return null}}async function o(e){try{return(await fetch(`/api/skills/management`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({manageEditorSkills:e})})).ok?(t(),!0):!1}catch{return!1}}function s(e,t){let n=`${e}-copy`;if(!t.has(n))return n;for(let n=2;n<1e3;n+=1){let r=`${e}-copy-${n}`;if(!t.has(r))return r}return`${e}-copy-${t.size+1}`}async function c(e){try{let t=new URLSearchParams({name:e.name,scope:e.scope}),i=await fetch(`/api/skill?${t.toString()}`);if(!i.ok)return{ok:!1,error:await n(i)};let a=await i.json().catch(()=>null),o=typeof a?.skill?.frontmatter?.description==`string`?a.skill.frontmatter.description:``,c=typeof a?.skill?.body==`string`?a.skill.body:``,l=s(e.name,e.existingNames),u=await r({scope:e.scope,name:l,frontmatter:{name:l,description:o},body:c});return u.ok?{ok:!0,name:l}:{ok:!1,error:u.error}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function l(e){let{name:a,fromScope:o,toScope:s}=e;if(o===s)return{ok:!0,scope:s};try{let e=await fetch(`/api/skill?name=${encodeURIComponent(a)}&scope=${o}`);if(!e.ok)return{ok:!1,error:await n(e)};let c=await e.json().catch(()=>null),l=typeof c?.skill?.frontmatter?.description==`string`?c.skill.frontmatter.description:``,u=typeof c?.skill?.body==`string`?c.skill.body:``,p=await fetch(`/api/skill?name=${encodeURIComponent(a)}&scope=${s}`);if(p.ok)return{ok:!1,error:`A ${s} skill named "${a}" already exists.`};if(p.status!==404)return{ok:!1,error:`Couldn't verify the ${s} destination "${a}" is free (HTTP ${p.status}); aborting before any write so an existing skill can't be overwritten. Retry in a moment.`};let m=await r({scope:s,name:a,frontmatter:{name:a,description:l},body:u});if(!m.ok)return m;let h=await f(o,a);if(!h.ok)return{ok:!1,error:`Copied "${a}" to ${s}, but reading its bundle files failed (${h.error}); the ${o} original is intact. Delete the partial ${s} copy and retry.`};let g=[];for(let e of h.files){if(e.text===null){g.push(e.path);continue}let t=await i({scope:s,name:a,path:e.path,content:e.text});if(!t.ok)return{ok:!1,error:`Copied "${a}" to ${s}, but copying its bundle file "${e.path}" failed (${t.error}); the ${o} original is intact. Delete the partial ${s} copy and retry.`}}let _=await d(o,a);return _.ok?(t(),{ok:!0,scope:s,...g.length>0?{skippedBinaryFiles:g}:{}}):{ok:!1,error:`Copied to ${s}, but couldn't remove the ${o} copy: ${_.error}`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function u(e){try{let r=await fetch(`/api/skill`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,committed:i?.committed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function d(e,r){try{let i=`?name=${encodeURIComponent(r)}&scope=${encodeURIComponent(e)}`,a=await fetch(`/api/skill${i}`,{method:`DELETE`});if(!a.ok)return{ok:!1,error:await n(a)};let o=await a.json().catch(()=>null);return t(),{ok:!0,existed:o?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function f(e,t){try{let r=new URLSearchParams({name:t,scope:e}),i=await fetch(`/api/skill?${r.toString()}`);return i.ok?{ok:!0,files:(await i.json().catch(()=>null))?.skill?.files??[]}:{ok:!1,error:await n(i)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function p(e){try{let t=new URLSearchParams({name:e.name,scope:e.scope,path:e.path}),r=await fetch(`/api/skill-file?${t.toString()}`,{signal:e.signal});if(!r.ok)return{ok:!1,status:r.status,error:await n(r)};let i=await r.json().catch(()=>null);return typeof i?.text==`string`?{ok:!0,text:i.text}:{ok:!1,status:r.status,error:`HTTP ${r.status}`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function m(e,t){return p({...e,signal:t}).then(e=>e.ok?{ok:!0,text:e.text}:{ok:!1,status:e.status})}async function h(e){try{let r=await fetch(`/api/skill/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,hosts:i?.hosts??[],scripts:i?.scripts??!1,warnings:i?.warnings??[],warningCodes:i?.warningCodes??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function g(e){try{let r=await fetch(`/api/skill/uninstall`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,uninstalled:i?.uninstalled??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function _(e){try{let r=await fetch(`/api/skill/update`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok)return{ok:!1,error:await n(r)};let i=await r.json().catch(()=>null);return t(),{ok:!0,version:i?.version??``,previousVersion:i?.previousVersion,checkpointRef:i?.checkpointRef}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}export{h as a,l as c,g as d,_ as f,a as i,r as l,c as n,m as o,f as r,u as s,d as t,o as u};
@@ -1 +1 @@
1
- import{o as e,t}from"./chunk-CYidjpOJ.js";import{n}from"./chunk-Y2CYZVJY-BCLrJxO_.js";import"./src-BaTc8y5c.js";var r=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),i=e(r(),1),a={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},o={trace:n((...e)=>{},`trace`),debug:n((...e)=>{},`debug`),info:n((...e)=>{},`info`),warn:n((...e)=>{},`warn`),error:n((...e)=>{},`error`),fatal:n((...e)=>{},`fatal`)},s=n(function(e=`fatal`){let t=a.fatal;typeof e==`string`?e.toLowerCase()in a&&(t=a[e]):typeof e==`number`&&(t=e),o.trace=()=>{},o.debug=()=>{},o.info=()=>{},o.warn=()=>{},o.error=()=>{},o.fatal=()=>{},t<=a.fatal&&(o.fatal=console.error?console.error.bind(console,c(`FATAL`),`color: orange`):console.log.bind(console,`\x1B[35m`,c(`FATAL`))),t<=a.error&&(o.error=console.error?console.error.bind(console,c(`ERROR`),`color: orange`):console.log.bind(console,`\x1B[31m`,c(`ERROR`))),t<=a.warn&&(o.warn=console.warn?console.warn.bind(console,c(`WARN`),`color: orange`):console.log.bind(console,`\x1B[33m`,c(`WARN`))),t<=a.info&&(o.info=console.info?console.info.bind(console,c(`INFO`),`color: lightblue`):console.log.bind(console,`\x1B[34m`,c(`INFO`))),t<=a.debug&&(o.debug=console.debug?console.debug.bind(console,c(`DEBUG`),`color: lightgreen`):console.log.bind(console,`\x1B[32m`,c(`DEBUG`))),t<=a.trace&&(o.trace=console.debug?console.debug.bind(console,c(`TRACE`),`color: lightgreen`):console.log.bind(console,`\x1B[32m`,c(`TRACE`)))},`setLogLevel`),c=n(e=>`%c${(0,i.default)().format(`ss.SSS`)} : ${e} : `,`format`),{abs:l,max:u,min:d}=Math;[`w`,`e`].map(f),[`n`,`s`].map(f),[`n`,`w`,`e`,`s`,`nw`,`ne`,`sw`,`se`].map(f);function f(e){return{type:e}}export{s as n,r,o as t};
1
+ import{o as e,t}from"./chunk-CYidjpOJ.js";import{n}from"./chunk-Y2CYZVJY-BAUBUeAF.js";import"./src-DNE52RZP.js";var r=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),i=e(r(),1),a={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},o={trace:n((...e)=>{},`trace`),debug:n((...e)=>{},`debug`),info:n((...e)=>{},`info`),warn:n((...e)=>{},`warn`),error:n((...e)=>{},`error`),fatal:n((...e)=>{},`fatal`)},s=n(function(e=`fatal`){let t=a.fatal;typeof e==`string`?e.toLowerCase()in a&&(t=a[e]):typeof e==`number`&&(t=e),o.trace=()=>{},o.debug=()=>{},o.info=()=>{},o.warn=()=>{},o.error=()=>{},o.fatal=()=>{},t<=a.fatal&&(o.fatal=console.error?console.error.bind(console,c(`FATAL`),`color: orange`):console.log.bind(console,`\x1B[35m`,c(`FATAL`))),t<=a.error&&(o.error=console.error?console.error.bind(console,c(`ERROR`),`color: orange`):console.log.bind(console,`\x1B[31m`,c(`ERROR`))),t<=a.warn&&(o.warn=console.warn?console.warn.bind(console,c(`WARN`),`color: orange`):console.log.bind(console,`\x1B[33m`,c(`WARN`))),t<=a.info&&(o.info=console.info?console.info.bind(console,c(`INFO`),`color: lightblue`):console.log.bind(console,`\x1B[34m`,c(`INFO`))),t<=a.debug&&(o.debug=console.debug?console.debug.bind(console,c(`DEBUG`),`color: lightgreen`):console.log.bind(console,`\x1B[32m`,c(`DEBUG`))),t<=a.trace&&(o.trace=console.debug?console.debug.bind(console,c(`TRACE`),`color: lightgreen`):console.log.bind(console,`\x1B[32m`,c(`TRACE`)))},`setLogLevel`),c=n(e=>`%c${(0,i.default)().format(`ss.SSS`)} : ${e} : `,`format`),{abs:l,max:u,min:d}=Math;[`w`,`e`].map(f),[`n`,`s`].map(f),[`n`,`w`,`e`,`s`,`nw`,`ne`,`sw`,`se`].map(f);function f(e){return{type:e}}export{s as n,r,o as t};
@@ -1,2 +1,2 @@
1
- import{V as e}from"./CodeMirrorPropInput-C5y2rXYX.js";import{$ as t,B as n,C as r,N as i,S as a,V as o,et as s,f as c,v as l,y as u,z as d}from"./config-provider-BvRqIV8_.js";import{$ as f,Dt as p,J as m,Mt as h,Q as g,St as _,X as v,kt as y}from"./dist-DNwOaDhC.js";var b=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:i(this.yanchor),yhead:i(this.yhead)}}static fromJSON(t){return new e(a(t.yanchor),a(t.yhead))}},x=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new c(e)}toYPos(e,t=0){return r(this.ytext,e,t)}fromYPos(e){let t=u(a(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new b(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?p.cursor(n.pos,n.assoc):p.range(t.pos,n.pos)}},S=y.define({combine(e){return e[e.length-1]}}),C=_.define(),w=class{constructor(e){this.view=e,this.conf=e.state.facet(S),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[C.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(C)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
2
- `);e!==r&&t.delete(e+n,r-e),s.length>0&&t.insert(e+n,s),n+=s.length-(r-e)})},this.conf)}destroy(){this._ytext.unobserve(this._observer)}},T=g.fromClass(w),E=v.baseTheme({".cm-ySelection":{},".cm-yLineSelection":{padding:0,margin:`0px 2px 0px 4px`},".cm-ySelectionCaret":{position:`relative`,borderLeft:`1px solid black`,borderRight:`1px solid black`,marginLeft:`-1px`,marginRight:`-1px`,boxSizing:`border-box`,display:`inline`},".cm-ySelectionCaretDot":{borderRadius:`50%`,position:`absolute`,width:`.4em`,height:`.4em`,top:`-.2em`,left:`-.2em`,backgroundColor:`inherit`,transition:`transform .3s ease-in-out`,boxSizing:`border-box`},".cm-ySelectionCaret:hover > .cm-ySelectionCaretDot":{transformOrigin:`bottom center`,transform:`scale(0)`},".cm-ySelectionInfo":{position:`absolute`,top:`-1.05em`,left:`-1px`,fontSize:`.75em`,fontFamily:`serif`,fontStyle:`normal`,fontWeight:`normal`,lineHeight:`normal`,userSelect:`none`,color:`white`,paddingLeft:`2px`,paddingRight:`2px`,zIndex:101,transition:`opacity .3s ease-in-out`,backgroundColor:`inherit`,opacity:0,transitionDelay:`0s`,whiteSpace:`nowrap`},".cm-ySelectionCaret:hover > .cm-ySelectionInfo":{opacity:1,transitionDelay:`0s`}}),D=_.define(),O=class extends f{constructor(e,t){super(),this.color=e,this.name=t}toDOM(){return d(`span`,[o(`class`,`cm-ySelectionCaret`),o(`style`,`background-color: ${this.color}; border-color: ${this.color}`)],[n(`⁠`),d(`div`,[o(`class`,`cm-ySelectionCaretDot`)]),n(`⁠`),d(`div`,[o(`class`,`cm-ySelectionInfo`)],[n(this.name)]),n(`⁠`)])}eq(e){return e.color===this.color}compare(e){return e.color===this.color}updateDOM(){return!1}get estimatedHeight(){return-1}ignoreEvent(){return!0}},k=class{constructor(e){this.conf=e.state.facet(S),this._listener=({added:t,updated:n,removed:r},i,a)=>{t.concat(n).concat(r).findIndex(e=>e!==this.conf.awareness.doc.clientID)>=0&&e.dispatch({annotations:[D.of([])]})},this._awareness=this.conf.awareness,this._awareness.on(`change`,this._listener),this.decorations=h.of([])}destroy(){this._awareness.off(`change`,this._listener)}update(e){let n=this.conf.ytext,i=n.doc,o=this.conf.awareness,c=[],d=this.conf.awareness.getLocalState();if(d!=null){let t=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),i=t?e.state.selection.main:null,s=d.cursor==null?null:a(d.cursor.anchor),c=d.cursor==null?null:a(d.cursor.head);if(i!=null){let e=r(n,i.anchor),t=r(n,i.head);(d.cursor==null||!l(s,e)||!l(c,t))&&o.setLocalStateField(`cursor`,{anchor:e,head:t})}else d.cursor!=null&&t&&o.setLocalStateField(`cursor`,null)}o.getStates().forEach((r,a)=>{if(a===o.doc.clientID)return;let l=r.cursor;if(l==null||l.anchor==null||l.head==null)return;let d=u(l.anchor,i),f=u(l.head,i);if(d==null||f==null||d.type!==n||f.type!==n)return;let{color:p=`#30bced`,name:h=`Anonymous`}=r.user||{},g=r.user&&r.user.colorLight||p+`33`,_=s(d.index,f.index),v=t(d.index,f.index),y=e.view.state.doc.lineAt(_),b=e.view.state.doc.lineAt(v);if(y.number===b.number)c.push({from:_,to:v,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})});else{c.push({from:_,to:y.from+y.length,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})}),c.push({from:b.from,to:v,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})});for(let t=y.number+1;t<b.number;t++){let n=e.view.state.doc.line(t).from;c.push({from:n,to:n,value:m.line({attributes:{style:`background-color: ${g}`,class:`cm-yLineSelection`}})})}}c.push({from:f.index,to:f.index,value:m.widget({side:f.index-d.index>0?-1:1,block:!1,widget:new O(p,h)})})}),this.decorations=m.set(c,!0)}},A=g.fromClass(k,{decorations:e=>e.decorations}),j=class{constructor(e){this.undoManager=e}addTrackedOrigin(e){this.undoManager.addTrackedOrigin(e)}removeTrackedOrigin(e){this.undoManager.removeTrackedOrigin(e)}undo(){return this.undoManager.undo()!=null}redo(){return this.undoManager.redo()!=null}},M=y.define({combine(e){return e[e.length-1]}});_.define();var N=class{constructor(t){this.view=t,this.conf=t.state.facet(M),this._undoManager=this.conf.undoManager,this.syncConf=t.state.facet(S),this._beforeChangeSelection=null,this._mux=e(),this._onStackItemAdded=({stackItem:e,changedParentTypes:t})=>{t.has(this.syncConf.ytext)&&this._beforeChangeSelection&&!e.meta.has(this)&&e.meta.set(this,this._beforeChangeSelection)},this._onStackItemPopped=({stackItem:e})=>{let n=e.meta.get(this);if(n){let e=this.syncConf.fromYRange(n);t.dispatch(t.state.update({selection:e,effects:[v.scrollIntoView(e)]})),this._storeSelection()}},this._storeSelection=()=>{this._beforeChangeSelection=this.syncConf.toYRange(this.view.state.selection.main)},this._undoManager.on(`stack-item-added`,this._onStackItemAdded),this._undoManager.on(`stack-item-popped`,this._onStackItemPopped),this._undoManager.addTrackedOrigin(this.syncConf)}update(e){e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(C)!==this.syncConf)&&this._storeSelection()}destroy(){this._undoManager.off(`stack-item-added`,this._onStackItemAdded),this._undoManager.off(`stack-item-popped`,this._onStackItemPopped),this._undoManager.removeTrackedOrigin(this.syncConf)}},P=g.fromClass(N),F=({state:e,dispatch:t})=>e.facet(M).undo()||!0,I=({state:e,dispatch:t})=>e.facet(M).redo()||!0,L=(e,t,{undoManager:n=new c(e)}={})=>{let r=new x(e,t),i=[S.of(r),T];return t&&i.push(E,A),n!==!1&&i.push(M.of(new j(n)),P,v.domEventHandlers({beforeinput(e,t){return e.inputType===`historyUndo`?F(t):e.inputType===`historyRedo`?I(t):!1}})),i};export{L as t};
1
+ import{V as e}from"./CodeMirrorPropInput-BqDZpzvH.js";import{$ as t,B as n,C as r,N as i,S as a,V as o,et as s,f as c,v as l,y as u,z as d}from"./config-provider-GshVNiWq.js";import{$ as f,Dt as p,J as m,Mt as h,Q as g,St as _,X as v,kt as y}from"./dist-DNwOaDhC.js";var b=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:i(this.yanchor),yhead:i(this.yhead)}}static fromJSON(t){return new e(a(t.yanchor),a(t.yhead))}},x=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new c(e)}toYPos(e,t=0){return r(this.ytext,e,t)}fromYPos(e){let t=u(a(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new b(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?p.cursor(n.pos,n.assoc):p.range(t.pos,n.pos)}},S=y.define({combine(e){return e[e.length-1]}}),C=_.define(),w=class{constructor(e){this.view=e,this.conf=e.state.facet(S),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[C.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(C)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
2
+ `);e!==r&&t.delete(e+n,r-e),s.length>0&&t.insert(e+n,s),n+=s.length-(r-e)})},this.conf)}destroy(){this._ytext.unobserve(this._observer)}},T=g.fromClass(w),E=v.baseTheme({".cm-ySelection":{},".cm-yLineSelection":{padding:0,margin:`0px 2px 0px 4px`},".cm-ySelectionCaret":{position:`relative`,borderLeft:`1px solid black`,borderRight:`1px solid black`,marginLeft:`-1px`,marginRight:`-1px`,boxSizing:`border-box`,display:`inline`},".cm-ySelectionCaretDot":{borderRadius:`50%`,position:`absolute`,width:`.4em`,height:`.4em`,top:`-.2em`,left:`-.2em`,backgroundColor:`inherit`,transition:`transform .3s ease-in-out`,boxSizing:`border-box`},".cm-ySelectionCaret:hover > .cm-ySelectionCaretDot":{transformOrigin:`bottom center`,transform:`scale(0)`},".cm-ySelectionInfo":{position:`absolute`,top:`-1.05em`,left:`-1px`,fontSize:`.75em`,fontFamily:`serif`,fontStyle:`normal`,fontWeight:`normal`,lineHeight:`normal`,userSelect:`none`,color:`white`,paddingLeft:`2px`,paddingRight:`2px`,zIndex:101,transition:`opacity .3s ease-in-out`,backgroundColor:`inherit`,opacity:0,transitionDelay:`0s`,whiteSpace:`nowrap`},".cm-ySelectionCaret:hover > .cm-ySelectionInfo":{opacity:1,transitionDelay:`0s`}}),D=_.define(),O=class extends f{constructor(e,t){super(),this.color=e,this.name=t}toDOM(){return d(`span`,[o(`class`,`cm-ySelectionCaret`),o(`style`,`background-color: ${this.color}; border-color: ${this.color}`)],[n(`⁠`),d(`div`,[o(`class`,`cm-ySelectionCaretDot`)]),n(`⁠`),d(`div`,[o(`class`,`cm-ySelectionInfo`)],[n(this.name)]),n(`⁠`)])}eq(e){return e.color===this.color}compare(e){return e.color===this.color}updateDOM(){return!1}get estimatedHeight(){return-1}ignoreEvent(){return!0}},k=class{constructor(e){this.conf=e.state.facet(S),this._listener=({added:t,updated:n,removed:r},i,a)=>{t.concat(n).concat(r).findIndex(e=>e!==this.conf.awareness.doc.clientID)>=0&&e.dispatch({annotations:[D.of([])]})},this._awareness=this.conf.awareness,this._awareness.on(`change`,this._listener),this.decorations=h.of([])}destroy(){this._awareness.off(`change`,this._listener)}update(e){let n=this.conf.ytext,i=n.doc,o=this.conf.awareness,c=[],d=this.conf.awareness.getLocalState();if(d!=null){let t=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),i=t?e.state.selection.main:null,s=d.cursor==null?null:a(d.cursor.anchor),c=d.cursor==null?null:a(d.cursor.head);if(i!=null){let e=r(n,i.anchor),t=r(n,i.head);(d.cursor==null||!l(s,e)||!l(c,t))&&o.setLocalStateField(`cursor`,{anchor:e,head:t})}else d.cursor!=null&&t&&o.setLocalStateField(`cursor`,null)}o.getStates().forEach((r,a)=>{if(a===o.doc.clientID)return;let l=r.cursor;if(l==null||l.anchor==null||l.head==null)return;let d=u(l.anchor,i),f=u(l.head,i);if(d==null||f==null||d.type!==n||f.type!==n)return;let{color:p=`#30bced`,name:h=`Anonymous`}=r.user||{},g=r.user&&r.user.colorLight||p+`33`,_=s(d.index,f.index),v=t(d.index,f.index),y=e.view.state.doc.lineAt(_),b=e.view.state.doc.lineAt(v);if(y.number===b.number)c.push({from:_,to:v,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})});else{c.push({from:_,to:y.from+y.length,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})}),c.push({from:b.from,to:v,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})});for(let t=y.number+1;t<b.number;t++){let n=e.view.state.doc.line(t).from;c.push({from:n,to:n,value:m.line({attributes:{style:`background-color: ${g}`,class:`cm-yLineSelection`}})})}}c.push({from:f.index,to:f.index,value:m.widget({side:f.index-d.index>0?-1:1,block:!1,widget:new O(p,h)})})}),this.decorations=m.set(c,!0)}},A=g.fromClass(k,{decorations:e=>e.decorations}),j=class{constructor(e){this.undoManager=e}addTrackedOrigin(e){this.undoManager.addTrackedOrigin(e)}removeTrackedOrigin(e){this.undoManager.removeTrackedOrigin(e)}undo(){return this.undoManager.undo()!=null}redo(){return this.undoManager.redo()!=null}},M=y.define({combine(e){return e[e.length-1]}});_.define();var N=class{constructor(t){this.view=t,this.conf=t.state.facet(M),this._undoManager=this.conf.undoManager,this.syncConf=t.state.facet(S),this._beforeChangeSelection=null,this._mux=e(),this._onStackItemAdded=({stackItem:e,changedParentTypes:t})=>{t.has(this.syncConf.ytext)&&this._beforeChangeSelection&&!e.meta.has(this)&&e.meta.set(this,this._beforeChangeSelection)},this._onStackItemPopped=({stackItem:e})=>{let n=e.meta.get(this);if(n){let e=this.syncConf.fromYRange(n);t.dispatch(t.state.update({selection:e,effects:[v.scrollIntoView(e)]})),this._storeSelection()}},this._storeSelection=()=>{this._beforeChangeSelection=this.syncConf.toYRange(this.view.state.selection.main)},this._undoManager.on(`stack-item-added`,this._onStackItemAdded),this._undoManager.on(`stack-item-popped`,this._onStackItemPopped),this._undoManager.addTrackedOrigin(this.syncConf)}update(e){e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(C)!==this.syncConf)&&this._storeSelection()}destroy(){this._undoManager.off(`stack-item-added`,this._onStackItemAdded),this._undoManager.off(`stack-item-popped`,this._onStackItemPopped),this._undoManager.removeTrackedOrigin(this.syncConf)}},P=g.fromClass(N),F=({state:e,dispatch:t})=>e.facet(M).undo()||!0,I=({state:e,dispatch:t})=>e.facet(M).redo()||!0,L=[{key:`Mod-z`,run:F,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:I,preventDefault:!0},{key:`Mod-Shift-z`,run:I,preventDefault:!0}],R=(e,t,{undoManager:n=new c(e)}={})=>{let r=new x(e,t),i=[S.of(r),T];return t&&i.push(E,A),n!==!1&&i.push(M.of(new j(n)),P,v.domEventHandlers({beforeinput(e,t){return e.inputType===`historyUndo`?F(t):e.inputType===`historyRedo`?I(t):!1}})),i};export{L as n,R as t};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-BCLrJxO_.js";import{t}from"./src-D9eynQ26.js";import{O as n,c as r,s as i,x as a}from"./chunk-WYO6CB5R-WjatCbeP.js";import{C as o}from"./src-BaTc8y5c.js";import{et as s,g as c}from"./chunk-ICXQ74PX-COjRz7aI.js";import{t as l}from"./line-ClsiHw5g.js";import"./chunk-HOUHSVGY-CiAzcmEO.js";import"./chunk-Q4XR5HBZ-sjes-Yon.js";import"./chunk-7BUUIJ7U-CjwBXrEk.js";import"./chunk-OGEWGWER-C7C3Oiaz.js";import{t as u}from"./graphlib-C4UD57Nn.js";import{t as d}from"./dagre-CLVncoxl.js";import"./chunk-32BRIVSS-JpxGJ5ji.js";import"./chunk-XXDRQBXY-aujsIsPx.js";import"./chunk-VR4S4FIN-Db6y0lij.js";import"./chunk-C7G6YPKG-yRQSkwCz.js";import"./chunk-ZGVPDNZ5-DKtGLh__.js";import"./chunk-52WLFC77-C_iSxcYL.js";import"./chunk-FWX5IMBZ-DS2bi_oI.js";import{i as f,n as p,t as m}from"./chunk-EX3LRPZG-Dp9dLoos.js";var h=e(e=>e.append(`circle`).attr(`class`,`start-state`).attr(`r`,a().state.sizeUnit).attr(`cx`,a().state.padding+a().state.sizeUnit).attr(`cy`,a().state.padding+a().state.sizeUnit),`drawStartState`),g=e(e=>e.append(`line`).style(`stroke`,`grey`).style(`stroke-dasharray`,`3`).attr(`x1`,a().state.textHeight).attr(`class`,`divider`).attr(`x2`,a().state.textHeight*2).attr(`y1`,0).attr(`y2`,0),`drawDivider`),_=e((e,t)=>{let n=e.append(`text`).attr(`x`,2*a().state.padding).attr(`y`,a().state.textHeight+2*a().state.padding).attr(`font-size`,a().state.fontSize).attr(`class`,`state-title`).text(t.id),r=n.node().getBBox();return e.insert(`rect`,`:first-child`).attr(`x`,a().state.padding).attr(`y`,a().state.padding).attr(`width`,r.width+2*a().state.padding).attr(`height`,r.height+2*a().state.padding).attr(`rx`,a().state.radius),n},`drawSimpleState`),v=e((t,n)=>{let r=e(function(e,t,n){let r=e.append(`tspan`).attr(`x`,2*a().state.padding).text(t);n||r.attr(`dy`,a().state.textHeight)},`addTspan`),i=t.append(`text`).attr(`x`,2*a().state.padding).attr(`y`,a().state.textHeight+1.3*a().state.padding).attr(`font-size`,a().state.fontSize).attr(`class`,`state-title`).text(n.descriptions[0]).node().getBBox(),o=i.height,s=t.append(`text`).attr(`x`,a().state.padding).attr(`y`,o+a().state.padding*.4+a().state.dividerMargin+a().state.textHeight).attr(`class`,`state-description`),c=!0,l=!0;n.descriptions.forEach(function(e){c||(r(s,e,l),l=!1),c=!1});let u=t.append(`line`).attr(`x1`,a().state.padding).attr(`y1`,a().state.padding+o+a().state.dividerMargin/2).attr(`y2`,a().state.padding+o+a().state.dividerMargin/2).attr(`class`,`descr-divider`),d=s.node().getBBox(),f=Math.max(d.width,i.width);return u.attr(`x2`,f+3*a().state.padding),t.insert(`rect`,`:first-child`).attr(`x`,a().state.padding).attr(`y`,a().state.padding).attr(`width`,f+2*a().state.padding).attr(`height`,d.height+o+2*a().state.padding).attr(`rx`,a().state.radius),t},`drawDescrState`),y=e((e,t,n)=>{let r=a().state.padding,i=2*a().state.padding,o=e.node().getBBox(),s=o.width,c=o.x,l=e.append(`text`).attr(`x`,0).attr(`y`,a().state.titleShift).attr(`font-size`,a().state.fontSize).attr(`class`,`state-title`).text(t.id),u=l.node().getBBox().width+i,d=Math.max(u,s);d===s&&(d+=i);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-a().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+a().state.textHeight+a().state.titleShift+1).attr(`rx`,`0`),l.attr(`x`,f+r),u<=s&&l.attr(`x`,c+(d-i)/2-u/2+r),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,a().state.titleShift-a().state.textHeight-a().state.padding).attr(`width`,d).attr(`height`,a().state.textHeight*3).attr(`rx`,a().state.radius),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,a().state.titleShift-a().state.textHeight-a().state.padding).attr(`width`,d).attr(`height`,p.height+3+2*a().state.textHeight).attr(`rx`,a().state.radius),e},`addTitleAndBox`),b=e(e=>(e.append(`circle`).attr(`class`,`end-state-outer`).attr(`r`,a().state.sizeUnit+a().state.miniPadding).attr(`cx`,a().state.padding+a().state.sizeUnit+a().state.miniPadding).attr(`cy`,a().state.padding+a().state.sizeUnit+a().state.miniPadding),e.append(`circle`).attr(`class`,`end-state-inner`).attr(`r`,a().state.sizeUnit).attr(`cx`,a().state.padding+a().state.sizeUnit+2).attr(`cy`,a().state.padding+a().state.sizeUnit+2)),`drawEndState`),x=e((e,t)=>{let n=a().state.forkWidth,r=a().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`,a().state.padding).attr(`y`,a().state.padding)},`drawForkJoinState`),S=e((e,t,n,r)=>{let o=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(i.lineBreakRegex),u=1.25*a().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}o+=u,e.attr(`x`,t+a().state.noteMargin),e.attr(`y`,n+o+1.25*a().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:o}},`_drawLongText`),C=e((e,t)=>{t.attr(`class`,`state-note`);let n=t.append(`rect`).attr(`x`,0).attr(`y`,a().state.padding),{textWidth:r,textHeight:i}=S(e,0,0,t.append(`g`));return n.attr(`height`,i+2*a().state.noteMargin),n.attr(`width`,r+a().state.noteMargin*2),n},`drawNote`),w=e(function(e,t){let n=t.id,r={id:n,label:t.id,width:0,height:0},i=e.append(`g`).attr(`id`,n).attr(`class`,`stateGroup`);t.type===`start`&&h(i),t.type===`end`&&b(i),(t.type===`fork`||t.type===`join`)&&x(i,t),t.type===`note`&&C(t.note.text,i),t.type===`divider`&&g(i),t.type===`default`&&t.descriptions.length===0&&_(i,t),t.type===`default`&&t.descriptions.length>0&&v(i,t);let o=i.node().getBBox();return r.width=o.width+2*a().state.padding,r.height=o.height+2*a().state.padding,r},`drawState`),T=0,E=e(function(r,o,u){let d=e(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`);o.points=o.points.filter(e=>!Number.isNaN(e.y));let f=o.points,p=l().x(function(e){return e.x}).y(function(e){return e.y}).curve(s),h=r.append(`path`).attr(`d`,p(f)).attr(`id`,`edge`+T).attr(`class`,`transition`),g=``;if(a().state.arrowMarkerAbsolute&&(g=n(!0)),h.attr(`marker-end`,`url(`+g+`#`+d(m.relationType.DEPENDENCY)+`End)`),u.title!==void 0){let e=r.append(`g`).attr(`class`,`stateLabel`),{x:n,y:s}=c.calcLabelPosition(o.points),l=i.getRows(u.title),d=0,f=[],p=0,m=0;for(let r=0;r<=l.length;r++){let i=e.append(`text`).attr(`text-anchor`,`middle`).text(l[r]).attr(`x`,n).attr(`y`,s+d),a=i.node().getBBox();p=Math.max(p,a.width),m=Math.min(m,a.x),t.info(a.x,n,s+d),d===0&&(d=i.node().getBBox().height,t.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=e.node().getBBox();e.insert(`rect`,`:first-child`).attr(`class`,`box`).attr(`x`,n-p/2-a().state.padding/2).attr(`y`,s-h/2-a().state.padding/2-3.5).attr(`width`,p+a().state.padding).attr(`height`,h+a().state.padding),t.info(g)}T++},`drawEdge`),D,O={},k=e(function(){},`setConf`),A=e(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=e(function(e,n,i,s){D=a().state;let c=a().securityLevel,l;c===`sandbox`&&(l=o(`#i`+n));let u=o(c===`sandbox`?l.nodes()[0].contentDocument.body:`body`),d=c===`sandbox`?l.nodes()[0].contentDocument:document;t.debug(`Rendering diagram `+e);let f=u.select(`[id='${n}']`);A(f),N(s.db.getRootDoc(),f.append(`g`).attr(`id`,n+`-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;r(f,g,h*1.75,D.useMaxWidth),f.attr(`viewBox`,`${m.x-D.padding} ${m.y-D.padding} `+h+` `+g)},`draw`),M=e(e=>e?e.length*D.fontSizeFactor:1,`getLabelWidth`),N=e((e,n,r,a,o,s,c)=>{let l=new u({compound:!0,multigraph:!0}),f,p=!0;for(f=0;f<e.length;f++)if(e[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 i;if(t.doc){let e=n.append(`g`).attr(`id`,t.id).attr(`class`,`stateGroup`);i=N(t.doc,e,t.id,!a,o,s,c);{e=y(e,t,a);let n=e.node().getBBox();i.width=n.width,i.height=n.height+D.padding/2,O[t.id]={y:D.compositTitleSize}}}else i=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(i.id+`-note`,e),l.setNode(i.id,i)):(l.setNode(i.id,i),l.setNode(i.id+`-note`,e)),l.setParent(i.id,i.id+`-group`),l.setParent(i.id+`-note`,i.id+`-group`)}else l.setNode(i.id,i)}t.debug(`Count=`,l.nodeCount(),l);let _=0;h.forEach(function(e){_++,t.debug(`Setting edge`,e),l.setEdge(e.id1,e.id2,{relation:e,width:M(e.title),height:D.labelHeight*i.getRows(e.title).length,labelpos:`c`},`id`+_)}),d(l),t.debug(`Graph after layout`,l.nodes());let v=n.node();l.nodes().forEach(function(e){e!==void 0&&l.node(e)!==void 0?(t.warn(`Node `+e+`: `+JSON.stringify(l.node(e))),o.select(`#`+v.id+` #`+e).attr(`transform`,`translate(`+(l.node(e).x-l.node(e).width/2)+`,`+(l.node(e).y+(O[e]?O[e].y:0)-l.node(e).height/2)+` )`),o.select(`#`+v.id+` #`+e).attr(`data-x-shift`,l.node(e).x-l.node(e).width/2),s.querySelectorAll(`#`+v.id+` #`+e+` .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)})):t.debug(`No Node `+e+`: `+JSON.stringify(l.node(e)))});let b=v.getBBox();l.edges().forEach(function(e){e!==void 0&&l.edge(e)!==void 0&&(t.debug(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(l.edge(e))),E(n,l.edge(e),l.edge(e).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,t.debug(`Doc rendered`,x,l),x},`renderDoc`),P={parser:p,get db(){return new m(1)},renderer:{setConf:k,draw:j},styles:f,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{P as diagram};
1
+ import{n as e}from"./chunk-Y2CYZVJY-BAUBUeAF.js";import{t}from"./src--OxBHrEw.js";import{O as n,c as r,s as i,x as a}from"./chunk-WYO6CB5R-9yPqK9ib.js";import{C as o}from"./src-DNE52RZP.js";import{et as s,g as c}from"./chunk-ICXQ74PX-CDyWyZCQ.js";import{t as l}from"./line-KTG0S8eM.js";import"./chunk-HOUHSVGY-DTcG17JD.js";import"./chunk-Q4XR5HBZ-B32WTAPs.js";import"./chunk-7BUUIJ7U-B7ItXXvn.js";import"./chunk-OGEWGWER-BgCGYbch.js";import{t as u}from"./graphlib-DYCc0Y9o.js";import{t as d}from"./dagre-DjTdhlGF.js";import"./chunk-32BRIVSS-J_rdnOiy.js";import"./chunk-XXDRQBXY-Dpdm1nrz.js";import"./chunk-VR4S4FIN-CcTJJ1HA.js";import"./chunk-C7G6YPKG-Bhzd4FsL.js";import"./chunk-ZGVPDNZ5-5ruaVNfo.js";import"./chunk-52WLFC77-BOMCKXNP.js";import"./chunk-FWX5IMBZ-1CESfm5O.js";import{i as f,n as p,t as m}from"./chunk-EX3LRPZG-BIvLDOrf.js";var h=e(e=>e.append(`circle`).attr(`class`,`start-state`).attr(`r`,a().state.sizeUnit).attr(`cx`,a().state.padding+a().state.sizeUnit).attr(`cy`,a().state.padding+a().state.sizeUnit),`drawStartState`),g=e(e=>e.append(`line`).style(`stroke`,`grey`).style(`stroke-dasharray`,`3`).attr(`x1`,a().state.textHeight).attr(`class`,`divider`).attr(`x2`,a().state.textHeight*2).attr(`y1`,0).attr(`y2`,0),`drawDivider`),_=e((e,t)=>{let n=e.append(`text`).attr(`x`,2*a().state.padding).attr(`y`,a().state.textHeight+2*a().state.padding).attr(`font-size`,a().state.fontSize).attr(`class`,`state-title`).text(t.id),r=n.node().getBBox();return e.insert(`rect`,`:first-child`).attr(`x`,a().state.padding).attr(`y`,a().state.padding).attr(`width`,r.width+2*a().state.padding).attr(`height`,r.height+2*a().state.padding).attr(`rx`,a().state.radius),n},`drawSimpleState`),v=e((t,n)=>{let r=e(function(e,t,n){let r=e.append(`tspan`).attr(`x`,2*a().state.padding).text(t);n||r.attr(`dy`,a().state.textHeight)},`addTspan`),i=t.append(`text`).attr(`x`,2*a().state.padding).attr(`y`,a().state.textHeight+1.3*a().state.padding).attr(`font-size`,a().state.fontSize).attr(`class`,`state-title`).text(n.descriptions[0]).node().getBBox(),o=i.height,s=t.append(`text`).attr(`x`,a().state.padding).attr(`y`,o+a().state.padding*.4+a().state.dividerMargin+a().state.textHeight).attr(`class`,`state-description`),c=!0,l=!0;n.descriptions.forEach(function(e){c||(r(s,e,l),l=!1),c=!1});let u=t.append(`line`).attr(`x1`,a().state.padding).attr(`y1`,a().state.padding+o+a().state.dividerMargin/2).attr(`y2`,a().state.padding+o+a().state.dividerMargin/2).attr(`class`,`descr-divider`),d=s.node().getBBox(),f=Math.max(d.width,i.width);return u.attr(`x2`,f+3*a().state.padding),t.insert(`rect`,`:first-child`).attr(`x`,a().state.padding).attr(`y`,a().state.padding).attr(`width`,f+2*a().state.padding).attr(`height`,d.height+o+2*a().state.padding).attr(`rx`,a().state.radius),t},`drawDescrState`),y=e((e,t,n)=>{let r=a().state.padding,i=2*a().state.padding,o=e.node().getBBox(),s=o.width,c=o.x,l=e.append(`text`).attr(`x`,0).attr(`y`,a().state.titleShift).attr(`font-size`,a().state.fontSize).attr(`class`,`state-title`).text(t.id),u=l.node().getBBox().width+i,d=Math.max(u,s);d===s&&(d+=i);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-a().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+a().state.textHeight+a().state.titleShift+1).attr(`rx`,`0`),l.attr(`x`,f+r),u<=s&&l.attr(`x`,c+(d-i)/2-u/2+r),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,a().state.titleShift-a().state.textHeight-a().state.padding).attr(`width`,d).attr(`height`,a().state.textHeight*3).attr(`rx`,a().state.radius),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,a().state.titleShift-a().state.textHeight-a().state.padding).attr(`width`,d).attr(`height`,p.height+3+2*a().state.textHeight).attr(`rx`,a().state.radius),e},`addTitleAndBox`),b=e(e=>(e.append(`circle`).attr(`class`,`end-state-outer`).attr(`r`,a().state.sizeUnit+a().state.miniPadding).attr(`cx`,a().state.padding+a().state.sizeUnit+a().state.miniPadding).attr(`cy`,a().state.padding+a().state.sizeUnit+a().state.miniPadding),e.append(`circle`).attr(`class`,`end-state-inner`).attr(`r`,a().state.sizeUnit).attr(`cx`,a().state.padding+a().state.sizeUnit+2).attr(`cy`,a().state.padding+a().state.sizeUnit+2)),`drawEndState`),x=e((e,t)=>{let n=a().state.forkWidth,r=a().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`,a().state.padding).attr(`y`,a().state.padding)},`drawForkJoinState`),S=e((e,t,n,r)=>{let o=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(i.lineBreakRegex),u=1.25*a().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}o+=u,e.attr(`x`,t+a().state.noteMargin),e.attr(`y`,n+o+1.25*a().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:o}},`_drawLongText`),C=e((e,t)=>{t.attr(`class`,`state-note`);let n=t.append(`rect`).attr(`x`,0).attr(`y`,a().state.padding),{textWidth:r,textHeight:i}=S(e,0,0,t.append(`g`));return n.attr(`height`,i+2*a().state.noteMargin),n.attr(`width`,r+a().state.noteMargin*2),n},`drawNote`),w=e(function(e,t){let n=t.id,r={id:n,label:t.id,width:0,height:0},i=e.append(`g`).attr(`id`,n).attr(`class`,`stateGroup`);t.type===`start`&&h(i),t.type===`end`&&b(i),(t.type===`fork`||t.type===`join`)&&x(i,t),t.type===`note`&&C(t.note.text,i),t.type===`divider`&&g(i),t.type===`default`&&t.descriptions.length===0&&_(i,t),t.type===`default`&&t.descriptions.length>0&&v(i,t);let o=i.node().getBBox();return r.width=o.width+2*a().state.padding,r.height=o.height+2*a().state.padding,r},`drawState`),T=0,E=e(function(r,o,u){let d=e(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`);o.points=o.points.filter(e=>!Number.isNaN(e.y));let f=o.points,p=l().x(function(e){return e.x}).y(function(e){return e.y}).curve(s),h=r.append(`path`).attr(`d`,p(f)).attr(`id`,`edge`+T).attr(`class`,`transition`),g=``;if(a().state.arrowMarkerAbsolute&&(g=n(!0)),h.attr(`marker-end`,`url(`+g+`#`+d(m.relationType.DEPENDENCY)+`End)`),u.title!==void 0){let e=r.append(`g`).attr(`class`,`stateLabel`),{x:n,y:s}=c.calcLabelPosition(o.points),l=i.getRows(u.title),d=0,f=[],p=0,m=0;for(let r=0;r<=l.length;r++){let i=e.append(`text`).attr(`text-anchor`,`middle`).text(l[r]).attr(`x`,n).attr(`y`,s+d),a=i.node().getBBox();p=Math.max(p,a.width),m=Math.min(m,a.x),t.info(a.x,n,s+d),d===0&&(d=i.node().getBBox().height,t.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=e.node().getBBox();e.insert(`rect`,`:first-child`).attr(`class`,`box`).attr(`x`,n-p/2-a().state.padding/2).attr(`y`,s-h/2-a().state.padding/2-3.5).attr(`width`,p+a().state.padding).attr(`height`,h+a().state.padding),t.info(g)}T++},`drawEdge`),D,O={},k=e(function(){},`setConf`),A=e(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=e(function(e,n,i,s){D=a().state;let c=a().securityLevel,l;c===`sandbox`&&(l=o(`#i`+n));let u=o(c===`sandbox`?l.nodes()[0].contentDocument.body:`body`),d=c===`sandbox`?l.nodes()[0].contentDocument:document;t.debug(`Rendering diagram `+e);let f=u.select(`[id='${n}']`);A(f),N(s.db.getRootDoc(),f.append(`g`).attr(`id`,n+`-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;r(f,g,h*1.75,D.useMaxWidth),f.attr(`viewBox`,`${m.x-D.padding} ${m.y-D.padding} `+h+` `+g)},`draw`),M=e(e=>e?e.length*D.fontSizeFactor:1,`getLabelWidth`),N=e((e,n,r,a,o,s,c)=>{let l=new u({compound:!0,multigraph:!0}),f,p=!0;for(f=0;f<e.length;f++)if(e[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 i;if(t.doc){let e=n.append(`g`).attr(`id`,t.id).attr(`class`,`stateGroup`);i=N(t.doc,e,t.id,!a,o,s,c);{e=y(e,t,a);let n=e.node().getBBox();i.width=n.width,i.height=n.height+D.padding/2,O[t.id]={y:D.compositTitleSize}}}else i=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(i.id+`-note`,e),l.setNode(i.id,i)):(l.setNode(i.id,i),l.setNode(i.id+`-note`,e)),l.setParent(i.id,i.id+`-group`),l.setParent(i.id+`-note`,i.id+`-group`)}else l.setNode(i.id,i)}t.debug(`Count=`,l.nodeCount(),l);let _=0;h.forEach(function(e){_++,t.debug(`Setting edge`,e),l.setEdge(e.id1,e.id2,{relation:e,width:M(e.title),height:D.labelHeight*i.getRows(e.title).length,labelpos:`c`},`id`+_)}),d(l),t.debug(`Graph after layout`,l.nodes());let v=n.node();l.nodes().forEach(function(e){e!==void 0&&l.node(e)!==void 0?(t.warn(`Node `+e+`: `+JSON.stringify(l.node(e))),o.select(`#`+v.id+` #`+e).attr(`transform`,`translate(`+(l.node(e).x-l.node(e).width/2)+`,`+(l.node(e).y+(O[e]?O[e].y:0)-l.node(e).height/2)+` )`),o.select(`#`+v.id+` #`+e).attr(`data-x-shift`,l.node(e).x-l.node(e).width/2),s.querySelectorAll(`#`+v.id+` #`+e+` .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)})):t.debug(`No Node `+e+`: `+JSON.stringify(l.node(e)))});let b=v.getBBox();l.edges().forEach(function(e){e!==void 0&&l.edge(e)!==void 0&&(t.debug(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(l.edge(e))),E(n,l.edge(e),l.edge(e).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,t.debug(`Doc rendered`,x,l),x},`renderDoc`),P={parser:p,get db(){return new m(1)},renderer:{setConf:k,draw:j},styles:f,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{P as diagram};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-Y2CYZVJY-BAUBUeAF.js";import"./src--OxBHrEw.js";import"./chunk-WYO6CB5R-9yPqK9ib.js";import"./chunk-ICXQ74PX-CDyWyZCQ.js";import"./chunk-HOUHSVGY-DTcG17JD.js";import"./chunk-Q4XR5HBZ-B32WTAPs.js";import"./chunk-7BUUIJ7U-B7ItXXvn.js";import"./chunk-OGEWGWER-BgCGYbch.js";import"./chunk-32BRIVSS-J_rdnOiy.js";import"./chunk-XXDRQBXY-Dpdm1nrz.js";import"./chunk-VR4S4FIN-CcTJJ1HA.js";import"./chunk-C7G6YPKG-Bhzd4FsL.js";import"./chunk-ZGVPDNZ5-5ruaVNfo.js";import"./chunk-52WLFC77-BOMCKXNP.js";import"./chunk-FWX5IMBZ-1CESfm5O.js";import{i as t,n,r,t as i}from"./chunk-EX3LRPZG-BIvLDOrf.js";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};