@inkeep/open-knowledge 0.25.0-beta.6 → 0.25.0-beta.8

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 (56) hide show
  1. package/dist/assets/skills/discovery/SKILL.md +1 -1
  2. package/dist/assets/skills/project/SKILL.md +1 -1
  3. package/dist/cli.mjs +6 -6
  4. package/dist/constants-6L3bwbSM.mjs +2 -0
  5. package/dist/{dist-CMJUtzX1.mjs → dist-7R982DBB.mjs} +1 -1
  6. package/dist/{dist-CWHBXHzy.mjs → dist-B1-OZ0zK.mjs} +4 -4
  7. package/dist/index.d.mts +1 -0
  8. package/dist/index.mjs +1 -1
  9. package/dist/init-CGNl62xW.mjs +1 -0
  10. package/dist/{init-DvnBfvsT.mjs → init-D998mblu.mjs} +5 -5
  11. package/dist/loader-BfDp4sqJ.mjs +1 -0
  12. package/dist/{loader-DTIVnIQS.mjs → loader-CoLeuXs-.mjs} +2 -2
  13. package/dist/preview-CnOFDDeV.mjs +1 -0
  14. package/dist/{preview-CnShDa2p.mjs → preview-DWBYV32d.mjs} +2 -2
  15. package/dist/public/assets/{ActivityModeContent-CNxdYTCc.js → ActivityModeContent-QvRIx_do.js} +1 -1
  16. package/dist/public/assets/{DocumentContext-bNGvFuJS.js → DocumentContext-zL3ZbwDo.js} +1 -1
  17. package/dist/public/assets/{GraphPanel-D5yxV_ez.js → GraphPanel-DiyMfzQg.js} +1 -1
  18. package/dist/public/assets/{ManagedArtifactProperties-CRYWYGK4.js → ManagedArtifactProperties-OxkUY14x.js} +1 -1
  19. package/dist/public/assets/{PropertyPanel-DgbQo3wG.js → PropertyPanel-D9A27c2E.js} +1 -1
  20. package/dist/public/assets/{SettingsDialogBody-CU-nEwde.js → SettingsDialogBody-cotnwVMw.js} +1 -1
  21. package/dist/public/assets/{SkillEditorActions-Bfh-iuK_.js → SkillEditorActions-BsGotb40.js} +1 -1
  22. package/dist/public/assets/{SourceEditor-CAUoNOTU.js → SourceEditor-BZ3cbLjs.js} +1 -1
  23. package/dist/public/assets/{TerminalPanel-Ds-ev2-D.js → TerminalPanel-XlICQw5o.js} +1 -1
  24. package/dist/public/assets/{config-validation-events-DiOTHiAz.js → config-validation-events-yB2QWKKJ.js} +1 -1
  25. package/dist/public/assets/{dist-GmorMgHF.js → dist-BRGUidv4.js} +8 -6
  26. package/dist/public/assets/{documents-events-CSQluyCM.js → documents-events-DA8Q5ICz.js} +1 -1
  27. package/dist/public/assets/{file-tree-adapter-TDYabCI-.js → file-tree-adapter-CP3Xa3us.js} +1 -1
  28. package/dist/public/assets/{index-BCPjnywU.js → index-CoukPsjj.js} +5 -5
  29. package/dist/public/assets/{keyboard-shortcuts-CZysvuV8.js → keyboard-shortcuts-DOkzBlgc.js} +1 -1
  30. package/dist/public/assets/{navigation-targets-CXdtVjj4.js → navigation-targets-DNRja8Z0.js} +1 -1
  31. package/dist/public/assets/{open-managed-artifact-tab-CvsZjaW-.js → open-managed-artifact-tab-DBkxdYp_.js} +1 -1
  32. package/dist/public/assets/{prop-types-C_2IQGCC.js → prop-types-C-aZftyS.js} +1 -1
  33. package/dist/public/assets/{selection-context-B6kAEK37.js → selection-context-vh0MmCBb.js} +1 -1
  34. package/dist/public/assets/{skill-actions-CPoGr_7b.js → skill-actions-Sc4IN52j.js} +1 -1
  35. package/dist/public/assets/{skills-api-mcV6MiPo.js → skills-api-ts3L80AV.js} +1 -1
  36. package/dist/public/assets/{target-navigation-intent-C4nLupIH.js → target-navigation-intent-CIKQ1Hj-.js} +1 -1
  37. package/dist/public/assets/{typing-burst-detector-DEl5qeGr.js → typing-burst-detector-BT98lJOb.js} +1 -1
  38. package/dist/public/index.html +16 -16
  39. package/dist/{repair-launch-json-DpU0i0eM.mjs → repair-launch-json-DiMbidtg.mjs} +2 -2
  40. package/dist/repair-mcp-configs-dTwbVEwq.mjs +2 -0
  41. package/dist/repair-skills-BvhYVWdw.mjs +3 -0
  42. package/dist/repair-skills-qkZ_LTHD.mjs +1 -0
  43. package/dist/{src-BQi1rIBd.mjs → src-CeXDKSSn.mjs} +2 -2
  44. package/dist/{start-RS2gu3vK.mjs → start-BqOu87VR.mjs} +2 -2
  45. package/dist/start-ByfafCut.mjs +1 -0
  46. package/dist/write-project-skill-CAgr6zKv.mjs +36 -0
  47. package/package.json +1 -1
  48. package/dist/constants-D3-jp47D.mjs +0 -2
  49. package/dist/init-BPc0rfg_.mjs +0 -1
  50. package/dist/loader-Scpsv3B1.mjs +0 -1
  51. package/dist/preview-OyZSYy4k.mjs +0 -1
  52. package/dist/repair-mcp-configs-DioIDpS1.mjs +0 -2
  53. package/dist/repair-skills-BFe09bLm.mjs +0 -1
  54. package/dist/repair-skills-xrYOvyVd.mjs +0 -3
  55. package/dist/start-B2g--lvD.mjs +0 -1
  56. package/dist/write-project-skill-CRxX-42S.mjs +0 -12
@@ -1 +1 @@
1
- import{ei as e}from"./dist-GmorMgHF.js";var t={general:{id:`Weq9zb`},workspace:{id:`pmUArF`},search:{id:`A1taO8`},wysiwyg:{id:`ur2XSb`},source:{id:`tiWX6q`},navigation:{id:`LXfNU-`}},n=Object.keys(t),r=[{id:`command-palette`,category:`general`,title:{id:`ZjtgI-`},description:{id:`PZt1uN`},scope:{id:`2GT3Hf`},bindings:[{mac:`⌘ K`,windowsLinux:`Ctrl K`,match:{key:`k`,mod:!0,allowExtraModifiers:!0}}]},{id:`settings`,category:`general`,title:{id:`Tz0i8g`},description:{id:`6m_7We`},scope:{id:`zL0LPh`},bindings:[{mac:`⌘ ,`,windowsLinux:`Ctrl ,`,match:{key:`,`,anyMod:!0}}]},{id:`new-item`,category:`general`,title:{id:`HdkSiO`},description:{id:`KkEAud`},scope:{id:`zL0LPh`},bindings:[{mac:`⌘ N`,windowsLinux:`Ctrl N`,match:{key:`n`,mod:!0}},{mac:`⌥⌘ N`,windowsLinux:`Ctrl Alt N`,match:{key:`n`,anyMod:!0,altKey:!0,allowExtraModifiers:!0}}]},{id:`new-folder`,category:`general`,title:{id:`96G6Re`},description:{id:`3cOo2C`},scope:{id:`cZI5AL`},bindings:[{mac:`⇧⌘ N`,windowsLinux:`Ctrl Shift N`}]},{id:`toggle-files-sidebar`,category:`general`,title:{id:`rtdR4v`},description:{id:`EbZT7P`},scope:{id:`2GT3Hf`},bindings:[{mac:`⌥⌘ S`,windowsLinux:`Ctrl Alt S`,match:{code:`KeyS`,anyMod:!0,altKey:!0,allowExtraModifiers:!0}}]},{id:`toggle-document-panel`,category:`general`,title:{id:`lkYioO`},description:{id:`It9ARY`},scope:{id:`2GT3Hf`},bindings:[{mac:`⌥⌘ B`,windowsLinux:`Ctrl Alt B`,match:{code:`KeyB`,anyMod:!0,altKey:!0,allowExtraModifiers:!0}}]},{id:`toggle-terminal-panel`,category:`general`,title:{id:`dPOFid`},description:{id:`fBaTkM`},scope:{id:`cZI5AL`},bindings:[{mac:`⌘ J`,windowsLinux:`Ctrl J`,match:{key:`j`,mod:!0}}]},{id:`open-ask-ai`,category:`general`,title:{id:`xWEvuo`},description:{id:`5OTgC7`},scope:{id:`cZI5AL`},bindings:[{mac:`⌘ L`,windowsLinux:`Ctrl L`,match:{key:`l`,mod:!0}}]},{id:`open-folder`,category:`workspace`,title:{id:`PVUn_c`},description:{id:`VYd_YA`},scope:{id:`cZI5AL`},bindings:[{mac:`⌘ O`,windowsLinux:`Ctrl O`}]},{id:`switch-project`,category:`workspace`,title:{id:`xaDWAI`},description:{id:`oS1YpJ`},scope:{id:`cZI5AL`},bindings:[{mac:`⇧⌘ P`,windowsLinux:`Ctrl Shift P`}]},{id:`file-tree-duplicate`,category:`workspace`,title:{id:`ot5BRK`},description:{id:`mxY24F`},scope:{id:`vbK_ZG`},bindings:[{mac:`⌘ D`,windowsLinux:`Ctrl D`}]},{id:`file-tree-select-all`,category:`workspace`,title:{id:`1d1F11`},description:{id:`4v2Yyz`},scope:{id:`vbK_ZG`},bindings:[{mac:`⌘ A`,windowsLinux:`Ctrl A`}]},{id:`find`,category:`search`,title:{id:`KujtjC`},description:{id:`8OGgNM`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ F`,windowsLinux:`Ctrl F`,match:{key:`f`,mod:!0,allowShiftKey:!0}}]},{id:`replace`,category:`search`,title:{id:`fqSfXY`},description:{id:`wT4iQr`},scope:{id:`ur2XSb`},bindings:[{mac:`⌥⌘ F`,windowsLinux:`Ctrl H`,match:{mac:{key:`f`,mod:!0,altKey:!0},windowsLinux:{key:`h`,mod:!0}}}]},{id:`find-next`,category:`search`,title:{id:`v7lbnC`},description:{id:`PR9FSv`},scope:{id:`EqtBXb`},bindings:[{mac:`⌘ G`,windowsLinux:`Ctrl G`,match:{key:`g`,mod:!0}},{mac:`F3`,windowsLinux:`F3`,match:{key:`F3`}}]},{id:`find-previous`,category:`search`,title:{id:`PB4upl`},description:{id:`PgzIpb`},scope:{id:`EqtBXb`},bindings:[{mac:`⇧⌘ G`,windowsLinux:`Ctrl Shift G`,match:{key:`g`,mod:!0,shiftKey:!0}},{mac:`Shift F3`,windowsLinux:`Shift F3`,match:{key:`F3`,shiftKey:!0}}]},{id:`find-field-navigation`,category:`search`,title:{id:`yMgL_E`},description:{id:`5ALjdr`},scope:{id:`BgV29F`},bindings:[{mac:`Enter / Shift Enter`,windowsLinux:`Enter / Shift Enter`}]},{id:`replace-current-from-field`,category:`search`,title:{id:`LDuM35`},description:{id:`EZVxVz`},scope:{id:`rZVMkf`},bindings:[{mac:`Enter`,windowsLinux:`Enter`}]},{id:`format-bold`,category:`wysiwyg`,title:{id:`KmydK6`},description:{id:`fbdLmk`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ B`,windowsLinux:`Ctrl B`}]},{id:`format-italic`,category:`wysiwyg`,title:{id:`pzutoc`},description:{id:`TLIO3j`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ I`,windowsLinux:`Ctrl I`}]},{id:`format-underline`,category:`wysiwyg`,title:{id:`YyXtnN`},description:{id:`Okd2Xv`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ U`,windowsLinux:`Ctrl U`}]},{id:`format-strike`,category:`wysiwyg`,title:{id:`WhOsNE`},description:{id:`HCn0Ay`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ X`,windowsLinux:`Ctrl Shift X`}]},{id:`format-inline-code`,category:`wysiwyg`,title:{id:`OX2Neh`},description:{id:`mo22UP`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ E`,windowsLinux:`Ctrl E`}]},{id:`format-highlight`,category:`wysiwyg`,title:{id:`gtEbeW`},description:{id:`Eji13z`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ H`,windowsLinux:`Ctrl Shift H`}]},{id:`edit-with-ai`,category:`general`,title:{id:`G4-bgo`},description:{id:`a3H_MR`},scope:{id:`C62P6b`},bindings:[{mac:`⇧⌘ I`,windowsLinux:`Ctrl Shift I`,match:{key:`i`,mod:!0,shiftKey:!0}}]},{id:`history-undo-redo`,category:`wysiwyg`,title:{id:`i9OyGp`},description:{id:`lbkOif`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ Z`,windowsLinux:`Ctrl Z`},{mac:`⇧⌘ Z / ⌘ Y`,windowsLinux:`Ctrl Shift Z / Ctrl Y`}]},{id:`heading-paragraph`,category:`wysiwyg`,title:{id:`bkQRMh`},description:{id:`rgPqOw`},scope:{id:`ur2XSb`},bindings:[{mac:`⌥⌘ 0`,windowsLinux:`Ctrl Alt 0`}]},{id:`heading-levels`,category:`wysiwyg`,title:{id:`q_z77Z`},description:{id:`8Jm2EP`},scope:{id:`ur2XSb`},bindings:[{mac:`⌥⌘ 1-6`,windowsLinux:`Ctrl Alt 1-6`}]},{id:`list-bullet`,category:`wysiwyg`,title:{id:`ijLc3m`},description:{id:`By-7Pn`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ 8`,windowsLinux:`Ctrl Shift 8`}]},{id:`list-ordered`,category:`wysiwyg`,title:{id:`iSQTsg`},description:{id:`ou1hFW`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ 7`,windowsLinux:`Ctrl Shift 7`}]},{id:`list-task`,category:`wysiwyg`,title:{id:`E1_c72`},description:{id:`-slrNR`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ 9`,windowsLinux:`Ctrl Shift 9`}]},{id:`code-block`,category:`wysiwyg`,title:{id:`4A3Yzu`},description:{id:`pTPqMK`},scope:{id:`ur2XSb`},bindings:[{mac:`⌥⌘ C`,windowsLinux:`Ctrl Alt C`}]},{id:`hard-break`,category:`wysiwyg`,title:{id:`-3ois8`},description:{id:`vDXqVv`},scope:{id:`ur2XSb`},bindings:[{mac:`Shift Enter`,windowsLinux:`Shift Enter`},{mac:`⌘ Enter`,windowsLinux:`Ctrl Enter`}]},{id:`move-block`,category:`wysiwyg`,title:{id:`f1XQyZ`},description:{id:`zQBg2C`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ ↑`,windowsLinux:`Ctrl Shift ↑`},{mac:`⇧⌘ ↓`,windowsLinux:`Ctrl Shift ↓`}]},{id:`list-indent`,category:`wysiwyg`,title:{id:`G0YZ-I`},description:{id:`5GKMSz`},scope:{id:`ynIa4S`},bindings:[{mac:`Tab`,windowsLinux:`Tab`},{mac:`Shift Tab`,windowsLinux:`Shift Tab`}]},{id:`list-split-item`,category:`wysiwyg`,title:{id:`neRy3o`},description:{id:`NpC29w`},scope:{id:`ynIa4S`},bindings:[{mac:`Enter`,windowsLinux:`Enter`}]},{id:`table-cell-navigation`,category:`wysiwyg`,title:{id:`K8-WWn`},description:{id:`4NC2Ym`},scope:{id:`l1aQKz`},bindings:[{mac:`Tab`,windowsLinux:`Tab`},{mac:`Shift Tab`,windowsLinux:`Shift Tab`}]},{id:`table-delete-selection`,category:`wysiwyg`,title:{id:`881Uwh`},description:{id:`YEP3X2`},scope:{id:`99eR72`},bindings:[{mac:`Backspace / Delete`,windowsLinux:`Backspace / Delete`},{mac:`⌘ Backspace / ⌘ Delete`,windowsLinux:`Ctrl Backspace / Ctrl Delete`}]},{id:`delete-atom`,category:`wysiwyg`,title:{id:`636K3K`},description:{id:`oXKEsy`},scope:{id:`ur2XSb`},bindings:[{mac:`Backspace`,windowsLinux:`Backspace`},{mac:`Delete`,windowsLinux:`Delete`}]},{id:`slash-menu`,category:`navigation`,title:{id:`shNd9t`},description:{id:`8PmoQF`},scope:{id:`ur2XSb`},bindings:[{mac:`/`,windowsLinux:`/`}]},{id:`suggestion-navigation`,category:`navigation`,title:{id:`riqekz`},description:{id:`OiHJdA`},scope:{id:`y5FUYi`},bindings:[{mac:`↑ / ↓`,windowsLinux:`↑ / ↓`},{mac:`Enter / Tab`,windowsLinux:`Enter / Tab`},{mac:`Esc`,windowsLinux:`Esc`}]},{id:`component-navigation`,category:`navigation`,title:{id:`rwrPbS`},description:{id:`0s8-e8`},scope:{id:`ur2XSb`},bindings:[{mac:`↑ / ↓ / ← / →`,windowsLinux:`↑ / ↓ / ← / →`},{mac:`Enter / Esc`,windowsLinux:`Enter / Esc`}]},{id:`source-indent`,category:`source`,title:{id:`fwhX-N`},description:{id:`skf5Ix`},scope:{id:`tiWX6q`},bindings:[{mac:`Tab`,windowsLinux:`Tab`},{mac:`Shift Tab`,windowsLinux:`Shift Tab`}]},{id:`source-navigation`,category:`source`,title:{id:`qSKu2v`},description:{id:`gITz7o`},scope:{id:`tiWX6q`},bindings:[{mac:`Arrow keys / Option Arrow / Command Arrow`,windowsLinux:`Arrow keys / Ctrl Arrow / Home / End`},{mac:`Page Up / Page Down`,windowsLinux:`Page Up / Page Down`},{mac:`Shift with movement keys`,windowsLinux:`Shift with movement keys`}]},{id:`source-editing`,category:`source`,title:{id:`pFagOn`},description:{id:`MGb89P`},scope:{id:`tiWX6q`},bindings:[{mac:`Enter / Shift Enter / ⌘ Enter`,windowsLinux:`Enter / Shift Enter / Ctrl Enter`},{mac:`Backspace / Delete`,windowsLinux:`Backspace / Delete`},{mac:`⌥ Backspace / ⌥ Delete`,windowsLinux:`Ctrl Backspace / Ctrl Delete`},{mac:`⌥ ↑ / ⌥ ↓`,windowsLinux:`Alt ↑ / Alt ↓`},{mac:`⇧⌥ ↑ / ⇧⌥ ↓`,windowsLinux:`Shift Alt ↑ / Shift Alt ↓`},{mac:`⇧⌘ K`,windowsLinux:`Ctrl Shift K`}]},{id:`source-history`,category:`source`,title:{id:`4Sxexw`},description:{id:`r2huLx`},scope:{id:`tiWX6q`},bindings:[{mac:`⌘ Z`,windowsLinux:`Ctrl Z`},{mac:`⇧⌘ Z`,windowsLinux:`Ctrl Y / Ctrl Shift Z`},{mac:`⌘ U / ⇧⌘ U`,windowsLinux:`Ctrl U / Alt U`}]},{id:`source-select-all`,category:`source`,title:{id:`a-cKXz`},description:{id:`UTNVyS`},scope:{id:`tiWX6q`},bindings:[{mac:`⌘ A`,windowsLinux:`Ctrl A`}]},{id:`source-multi-cursor`,category:`source`,title:{id:`mg0YGL`},description:{id:`lWNpNB`},scope:{id:`tiWX6q`},bindings:[{mac:`⌥⌘ ↑ / ⌥⌘ ↓`,windowsLinux:`Ctrl Alt ↑ / Ctrl Alt ↓`},{mac:`⇧⌘ L`,windowsLinux:`Ctrl Shift L`}]},{id:`source-search`,category:`source`,title:{id:`7OhaRy`},description:{id:`mwMF9u`},scope:{id:`tiWX6q`},bindings:[{mac:`⌘ F`,windowsLinux:`Ctrl F`}]},{id:`source-toggle-comment`,category:`source`,title:{id:`RfaEio`},description:{id:`MrwYIK`},scope:{id:`tiWX6q`},bindings:[{mac:`⌘ /`,windowsLinux:`Ctrl /`},{mac:`Shift Alt A`,windowsLinux:`Shift Alt A`}]},{id:`source-select-next-occurrence`,category:`source`,title:{id:`hY8pka`},description:{id:`XnlF3W`},scope:{id:`tiWX6q`},bindings:[{mac:`⌘ D`,windowsLinux:`Ctrl D`}]},{id:`source-goto-line`,category:`source`,title:{id:`7FamGZ`},description:{id:`yHikCO`},scope:{id:`tiWX6q`},bindings:[{mac:`⌥⌘ G`,windowsLinux:`Ctrl Alt G`}]},{id:`source-find-results`,category:`source`,title:{id:`rJVoVX`},description:{id:`TwYboS`},scope:{id:`qyLmWw`},bindings:[{mac:`⌘ G / ⇧⌘ G`,windowsLinux:`Ctrl G / Ctrl Shift G`},{mac:`F3 / Shift F3`,windowsLinux:`F3 / Shift F3`},{mac:`Esc`,windowsLinux:`Esc`}]},{id:`source-folding`,category:`source`,title:{id:`bcjYUA`},description:{id:`VZGh8G`},scope:{id:`tiWX6q`},bindings:[{mac:`⌥⌘ [ / ⌥⌘ ]`,windowsLinux:`Ctrl Shift [ / Ctrl Shift ]`},{mac:`Ctrl Alt [ / Ctrl Alt ]`,windowsLinux:`Ctrl Alt [ / Ctrl Alt ]`}]},{id:`source-completion`,category:`source`,title:{id:`VuxVSP`},description:{id:`Ehkru0`},scope:{id:`tiWX6q`},bindings:[{mac:`Ctrl Space`,windowsLinux:`Ctrl Space`},{mac:"⌥ ` / ⌥ I",windowsLinux:`Ctrl Space`},{mac:`↑ / ↓ / Page Up / Page Down`,windowsLinux:`↑ / ↓ / Page Up / Page Down`},{mac:`Enter / Esc`,windowsLinux:`Enter / Esc`}]},{id:`source-tab-focus-mode`,category:`source`,title:{id:`eG8Jsg`},description:{id:`qRZh7J`},scope:{id:`tiWX6q`},bindings:[{mac:`Shift Alt M`,windowsLinux:`Ctrl M`}]},{id:`source-lint-panel`,category:`source`,title:{id:`yvG-l1`},description:{id:`kCqCyf`},scope:{id:`tiWX6q`},bindings:[{mac:`⇧⌘ M`,windowsLinux:`Ctrl Shift M`}]},{id:`source-next-diagnostic`,category:`source`,title:{id:`M1OfV9`},description:{id:`ExPiRQ`},scope:{id:`tiWX6q`},bindings:[{mac:`F8`,windowsLinux:`F8`}]}];function i(e){let t=r.find(t=>t.id===e);if(!t)throw Error(`Unknown keyboard shortcut: ${e}`);return t}function a(){return e()?`mac`:`windowsLinux`}var o=[[/⌘/g,` Command `],[/⌥/g,` Option `],[/⇧/g,` Shift `],[/⌃/g,` Control `],[/↑/g,` Up Arrow `],[/↓/g,` Down Arrow `],[/←/g,` Left Arrow `],[/→/g,` Right Arrow `],[/\[/g,` Left Bracket `],[/\]/g,` Right Bracket `],[/,/g,` Comma `],[/\bCtrl\b/g,` Control `]];function s(e){return e.split(` / `).map(e=>o.reduce((e,[t,n])=>e.replace(t,n),e).replaceAll(/\s+/g,` `).trim()).join(` or `)}function c(e,t=a()){return t===`mac`?e.mac:e.windowsLinux}function l(e,t=a()){return s(c(e,t))}function u(e,t=a()){return c(i(e).bindings[0],t)}function d(e,t=a()){return l(i(e).bindings[0],t)}function f(e){if(!e||typeof e!=`object`)return!1;if(`isContentEditable`in e&&e.isContentEditable===!0)return!0;if(!(`tagName`in e))return!1;let t=String(e.tagName).toUpperCase();return t===`INPUT`||t===`TEXTAREA`}function p(e,t,n=a()){return i(t).bindings.some(t=>{let r=m(t.match,n);return r?g(e,r,n):!1})}function m(e,t){return e?h(e)?e:e[t]??null:null}function h(e){return`key`in e||`code`in e}function g(e,t,n){if(t.key&&e.key.toLowerCase()!==t.key.toLowerCase()||t.code&&e.code!==t.code)return!1;let r=t.mod?n===`mac`:!1,i=t.mod?n===`windowsLinux`:!1,a=t.altKey??!1,o=t.shiftKey??!1;return t.allowExtraModifiers?!(t.anyMod&&!e.metaKey&&!e.ctrlKey||r&&!e.metaKey||i&&!e.ctrlKey||a&&!e.altKey||o&&!e.shiftKey):(t.anyMod?e.metaKey||e.ctrlKey:e.metaKey===r&&e.ctrlKey===i)&&e.altKey===a&&(t.allowShiftKey||!!e.shiftKey===o)}export{c as a,f as c,u as i,p as l,t as n,d as o,n as r,s,r as t};
1
+ import{ei as e}from"./dist-BRGUidv4.js";var t={general:{id:`Weq9zb`},workspace:{id:`pmUArF`},search:{id:`A1taO8`},wysiwyg:{id:`ur2XSb`},source:{id:`tiWX6q`},navigation:{id:`LXfNU-`}},n=Object.keys(t),r=[{id:`command-palette`,category:`general`,title:{id:`ZjtgI-`},description:{id:`PZt1uN`},scope:{id:`2GT3Hf`},bindings:[{mac:`⌘ K`,windowsLinux:`Ctrl K`,match:{key:`k`,mod:!0,allowExtraModifiers:!0}}]},{id:`settings`,category:`general`,title:{id:`Tz0i8g`},description:{id:`6m_7We`},scope:{id:`zL0LPh`},bindings:[{mac:`⌘ ,`,windowsLinux:`Ctrl ,`,match:{key:`,`,anyMod:!0}}]},{id:`new-item`,category:`general`,title:{id:`HdkSiO`},description:{id:`KkEAud`},scope:{id:`zL0LPh`},bindings:[{mac:`⌘ N`,windowsLinux:`Ctrl N`,match:{key:`n`,mod:!0}},{mac:`⌥⌘ N`,windowsLinux:`Ctrl Alt N`,match:{key:`n`,anyMod:!0,altKey:!0,allowExtraModifiers:!0}}]},{id:`new-folder`,category:`general`,title:{id:`96G6Re`},description:{id:`3cOo2C`},scope:{id:`cZI5AL`},bindings:[{mac:`⇧⌘ N`,windowsLinux:`Ctrl Shift N`}]},{id:`toggle-files-sidebar`,category:`general`,title:{id:`rtdR4v`},description:{id:`EbZT7P`},scope:{id:`2GT3Hf`},bindings:[{mac:`⌥⌘ S`,windowsLinux:`Ctrl Alt S`,match:{code:`KeyS`,anyMod:!0,altKey:!0,allowExtraModifiers:!0}}]},{id:`toggle-document-panel`,category:`general`,title:{id:`lkYioO`},description:{id:`It9ARY`},scope:{id:`2GT3Hf`},bindings:[{mac:`⌥⌘ B`,windowsLinux:`Ctrl Alt B`,match:{code:`KeyB`,anyMod:!0,altKey:!0,allowExtraModifiers:!0}}]},{id:`toggle-terminal-panel`,category:`general`,title:{id:`dPOFid`},description:{id:`fBaTkM`},scope:{id:`cZI5AL`},bindings:[{mac:`⌘ J`,windowsLinux:`Ctrl J`,match:{key:`j`,mod:!0}}]},{id:`open-ask-ai`,category:`general`,title:{id:`xWEvuo`},description:{id:`5OTgC7`},scope:{id:`cZI5AL`},bindings:[{mac:`⌘ L`,windowsLinux:`Ctrl L`,match:{key:`l`,mod:!0}}]},{id:`open-folder`,category:`workspace`,title:{id:`PVUn_c`},description:{id:`VYd_YA`},scope:{id:`cZI5AL`},bindings:[{mac:`⌘ O`,windowsLinux:`Ctrl O`}]},{id:`switch-project`,category:`workspace`,title:{id:`xaDWAI`},description:{id:`oS1YpJ`},scope:{id:`cZI5AL`},bindings:[{mac:`⇧⌘ P`,windowsLinux:`Ctrl Shift P`}]},{id:`file-tree-duplicate`,category:`workspace`,title:{id:`ot5BRK`},description:{id:`mxY24F`},scope:{id:`vbK_ZG`},bindings:[{mac:`⌘ D`,windowsLinux:`Ctrl D`}]},{id:`file-tree-select-all`,category:`workspace`,title:{id:`1d1F11`},description:{id:`4v2Yyz`},scope:{id:`vbK_ZG`},bindings:[{mac:`⌘ A`,windowsLinux:`Ctrl A`}]},{id:`find`,category:`search`,title:{id:`KujtjC`},description:{id:`8OGgNM`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ F`,windowsLinux:`Ctrl F`,match:{key:`f`,mod:!0,allowShiftKey:!0}}]},{id:`replace`,category:`search`,title:{id:`fqSfXY`},description:{id:`wT4iQr`},scope:{id:`ur2XSb`},bindings:[{mac:`⌥⌘ F`,windowsLinux:`Ctrl H`,match:{mac:{key:`f`,mod:!0,altKey:!0},windowsLinux:{key:`h`,mod:!0}}}]},{id:`find-next`,category:`search`,title:{id:`v7lbnC`},description:{id:`PR9FSv`},scope:{id:`EqtBXb`},bindings:[{mac:`⌘ G`,windowsLinux:`Ctrl G`,match:{key:`g`,mod:!0}},{mac:`F3`,windowsLinux:`F3`,match:{key:`F3`}}]},{id:`find-previous`,category:`search`,title:{id:`PB4upl`},description:{id:`PgzIpb`},scope:{id:`EqtBXb`},bindings:[{mac:`⇧⌘ G`,windowsLinux:`Ctrl Shift G`,match:{key:`g`,mod:!0,shiftKey:!0}},{mac:`Shift F3`,windowsLinux:`Shift F3`,match:{key:`F3`,shiftKey:!0}}]},{id:`find-field-navigation`,category:`search`,title:{id:`yMgL_E`},description:{id:`5ALjdr`},scope:{id:`BgV29F`},bindings:[{mac:`Enter / Shift Enter`,windowsLinux:`Enter / Shift Enter`}]},{id:`replace-current-from-field`,category:`search`,title:{id:`LDuM35`},description:{id:`EZVxVz`},scope:{id:`rZVMkf`},bindings:[{mac:`Enter`,windowsLinux:`Enter`}]},{id:`format-bold`,category:`wysiwyg`,title:{id:`KmydK6`},description:{id:`fbdLmk`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ B`,windowsLinux:`Ctrl B`}]},{id:`format-italic`,category:`wysiwyg`,title:{id:`pzutoc`},description:{id:`TLIO3j`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ I`,windowsLinux:`Ctrl I`}]},{id:`format-underline`,category:`wysiwyg`,title:{id:`YyXtnN`},description:{id:`Okd2Xv`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ U`,windowsLinux:`Ctrl U`}]},{id:`format-strike`,category:`wysiwyg`,title:{id:`WhOsNE`},description:{id:`HCn0Ay`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ X`,windowsLinux:`Ctrl Shift X`}]},{id:`format-inline-code`,category:`wysiwyg`,title:{id:`OX2Neh`},description:{id:`mo22UP`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ E`,windowsLinux:`Ctrl E`}]},{id:`format-highlight`,category:`wysiwyg`,title:{id:`gtEbeW`},description:{id:`Eji13z`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ H`,windowsLinux:`Ctrl Shift H`}]},{id:`edit-with-ai`,category:`general`,title:{id:`G4-bgo`},description:{id:`a3H_MR`},scope:{id:`C62P6b`},bindings:[{mac:`⇧⌘ I`,windowsLinux:`Ctrl Shift I`,match:{key:`i`,mod:!0,shiftKey:!0}}]},{id:`history-undo-redo`,category:`wysiwyg`,title:{id:`i9OyGp`},description:{id:`lbkOif`},scope:{id:`ur2XSb`},bindings:[{mac:`⌘ Z`,windowsLinux:`Ctrl Z`},{mac:`⇧⌘ Z / ⌘ Y`,windowsLinux:`Ctrl Shift Z / Ctrl Y`}]},{id:`heading-paragraph`,category:`wysiwyg`,title:{id:`bkQRMh`},description:{id:`rgPqOw`},scope:{id:`ur2XSb`},bindings:[{mac:`⌥⌘ 0`,windowsLinux:`Ctrl Alt 0`}]},{id:`heading-levels`,category:`wysiwyg`,title:{id:`q_z77Z`},description:{id:`8Jm2EP`},scope:{id:`ur2XSb`},bindings:[{mac:`⌥⌘ 1-6`,windowsLinux:`Ctrl Alt 1-6`}]},{id:`list-bullet`,category:`wysiwyg`,title:{id:`ijLc3m`},description:{id:`By-7Pn`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ 8`,windowsLinux:`Ctrl Shift 8`}]},{id:`list-ordered`,category:`wysiwyg`,title:{id:`iSQTsg`},description:{id:`ou1hFW`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ 7`,windowsLinux:`Ctrl Shift 7`}]},{id:`list-task`,category:`wysiwyg`,title:{id:`E1_c72`},description:{id:`-slrNR`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ 9`,windowsLinux:`Ctrl Shift 9`}]},{id:`code-block`,category:`wysiwyg`,title:{id:`4A3Yzu`},description:{id:`pTPqMK`},scope:{id:`ur2XSb`},bindings:[{mac:`⌥⌘ C`,windowsLinux:`Ctrl Alt C`}]},{id:`hard-break`,category:`wysiwyg`,title:{id:`-3ois8`},description:{id:`vDXqVv`},scope:{id:`ur2XSb`},bindings:[{mac:`Shift Enter`,windowsLinux:`Shift Enter`},{mac:`⌘ Enter`,windowsLinux:`Ctrl Enter`}]},{id:`move-block`,category:`wysiwyg`,title:{id:`f1XQyZ`},description:{id:`zQBg2C`},scope:{id:`ur2XSb`},bindings:[{mac:`⇧⌘ ↑`,windowsLinux:`Ctrl Shift ↑`},{mac:`⇧⌘ ↓`,windowsLinux:`Ctrl Shift ↓`}]},{id:`list-indent`,category:`wysiwyg`,title:{id:`G0YZ-I`},description:{id:`5GKMSz`},scope:{id:`ynIa4S`},bindings:[{mac:`Tab`,windowsLinux:`Tab`},{mac:`Shift Tab`,windowsLinux:`Shift Tab`}]},{id:`list-split-item`,category:`wysiwyg`,title:{id:`neRy3o`},description:{id:`NpC29w`},scope:{id:`ynIa4S`},bindings:[{mac:`Enter`,windowsLinux:`Enter`}]},{id:`table-cell-navigation`,category:`wysiwyg`,title:{id:`K8-WWn`},description:{id:`4NC2Ym`},scope:{id:`l1aQKz`},bindings:[{mac:`Tab`,windowsLinux:`Tab`},{mac:`Shift Tab`,windowsLinux:`Shift Tab`}]},{id:`table-delete-selection`,category:`wysiwyg`,title:{id:`881Uwh`},description:{id:`YEP3X2`},scope:{id:`99eR72`},bindings:[{mac:`Backspace / Delete`,windowsLinux:`Backspace / Delete`},{mac:`⌘ Backspace / ⌘ Delete`,windowsLinux:`Ctrl Backspace / Ctrl Delete`}]},{id:`delete-atom`,category:`wysiwyg`,title:{id:`636K3K`},description:{id:`oXKEsy`},scope:{id:`ur2XSb`},bindings:[{mac:`Backspace`,windowsLinux:`Backspace`},{mac:`Delete`,windowsLinux:`Delete`}]},{id:`slash-menu`,category:`navigation`,title:{id:`shNd9t`},description:{id:`8PmoQF`},scope:{id:`ur2XSb`},bindings:[{mac:`/`,windowsLinux:`/`}]},{id:`suggestion-navigation`,category:`navigation`,title:{id:`riqekz`},description:{id:`OiHJdA`},scope:{id:`y5FUYi`},bindings:[{mac:`↑ / ↓`,windowsLinux:`↑ / ↓`},{mac:`Enter / Tab`,windowsLinux:`Enter / Tab`},{mac:`Esc`,windowsLinux:`Esc`}]},{id:`component-navigation`,category:`navigation`,title:{id:`rwrPbS`},description:{id:`0s8-e8`},scope:{id:`ur2XSb`},bindings:[{mac:`↑ / ↓ / ← / →`,windowsLinux:`↑ / ↓ / ← / →`},{mac:`Enter / Esc`,windowsLinux:`Enter / Esc`}]},{id:`source-indent`,category:`source`,title:{id:`fwhX-N`},description:{id:`skf5Ix`},scope:{id:`tiWX6q`},bindings:[{mac:`Tab`,windowsLinux:`Tab`},{mac:`Shift Tab`,windowsLinux:`Shift Tab`}]},{id:`source-navigation`,category:`source`,title:{id:`qSKu2v`},description:{id:`gITz7o`},scope:{id:`tiWX6q`},bindings:[{mac:`Arrow keys / Option Arrow / Command Arrow`,windowsLinux:`Arrow keys / Ctrl Arrow / Home / End`},{mac:`Page Up / Page Down`,windowsLinux:`Page Up / Page Down`},{mac:`Shift with movement keys`,windowsLinux:`Shift with movement keys`}]},{id:`source-editing`,category:`source`,title:{id:`pFagOn`},description:{id:`MGb89P`},scope:{id:`tiWX6q`},bindings:[{mac:`Enter / Shift Enter / ⌘ Enter`,windowsLinux:`Enter / Shift Enter / Ctrl Enter`},{mac:`Backspace / Delete`,windowsLinux:`Backspace / Delete`},{mac:`⌥ Backspace / ⌥ Delete`,windowsLinux:`Ctrl Backspace / Ctrl Delete`},{mac:`⌥ ↑ / ⌥ ↓`,windowsLinux:`Alt ↑ / Alt ↓`},{mac:`⇧⌥ ↑ / ⇧⌥ ↓`,windowsLinux:`Shift Alt ↑ / Shift Alt ↓`},{mac:`⇧⌘ K`,windowsLinux:`Ctrl Shift K`}]},{id:`source-history`,category:`source`,title:{id:`4Sxexw`},description:{id:`r2huLx`},scope:{id:`tiWX6q`},bindings:[{mac:`⌘ Z`,windowsLinux:`Ctrl Z`},{mac:`⇧⌘ Z`,windowsLinux:`Ctrl Y / Ctrl Shift Z`},{mac:`⌘ U / ⇧⌘ U`,windowsLinux:`Ctrl U / Alt U`}]},{id:`source-select-all`,category:`source`,title:{id:`a-cKXz`},description:{id:`UTNVyS`},scope:{id:`tiWX6q`},bindings:[{mac:`⌘ A`,windowsLinux:`Ctrl A`}]},{id:`source-multi-cursor`,category:`source`,title:{id:`mg0YGL`},description:{id:`lWNpNB`},scope:{id:`tiWX6q`},bindings:[{mac:`⌥⌘ ↑ / ⌥⌘ ↓`,windowsLinux:`Ctrl Alt ↑ / Ctrl Alt ↓`},{mac:`⇧⌘ L`,windowsLinux:`Ctrl Shift L`}]},{id:`source-search`,category:`source`,title:{id:`7OhaRy`},description:{id:`mwMF9u`},scope:{id:`tiWX6q`},bindings:[{mac:`⌘ F`,windowsLinux:`Ctrl F`}]},{id:`source-toggle-comment`,category:`source`,title:{id:`RfaEio`},description:{id:`MrwYIK`},scope:{id:`tiWX6q`},bindings:[{mac:`⌘ /`,windowsLinux:`Ctrl /`},{mac:`Shift Alt A`,windowsLinux:`Shift Alt A`}]},{id:`source-select-next-occurrence`,category:`source`,title:{id:`hY8pka`},description:{id:`XnlF3W`},scope:{id:`tiWX6q`},bindings:[{mac:`⌘ D`,windowsLinux:`Ctrl D`}]},{id:`source-goto-line`,category:`source`,title:{id:`7FamGZ`},description:{id:`yHikCO`},scope:{id:`tiWX6q`},bindings:[{mac:`⌥⌘ G`,windowsLinux:`Ctrl Alt G`}]},{id:`source-find-results`,category:`source`,title:{id:`rJVoVX`},description:{id:`TwYboS`},scope:{id:`qyLmWw`},bindings:[{mac:`⌘ G / ⇧⌘ G`,windowsLinux:`Ctrl G / Ctrl Shift G`},{mac:`F3 / Shift F3`,windowsLinux:`F3 / Shift F3`},{mac:`Esc`,windowsLinux:`Esc`}]},{id:`source-folding`,category:`source`,title:{id:`bcjYUA`},description:{id:`VZGh8G`},scope:{id:`tiWX6q`},bindings:[{mac:`⌥⌘ [ / ⌥⌘ ]`,windowsLinux:`Ctrl Shift [ / Ctrl Shift ]`},{mac:`Ctrl Alt [ / Ctrl Alt ]`,windowsLinux:`Ctrl Alt [ / Ctrl Alt ]`}]},{id:`source-completion`,category:`source`,title:{id:`VuxVSP`},description:{id:`Ehkru0`},scope:{id:`tiWX6q`},bindings:[{mac:`Ctrl Space`,windowsLinux:`Ctrl Space`},{mac:"⌥ ` / ⌥ I",windowsLinux:`Ctrl Space`},{mac:`↑ / ↓ / Page Up / Page Down`,windowsLinux:`↑ / ↓ / Page Up / Page Down`},{mac:`Enter / Esc`,windowsLinux:`Enter / Esc`}]},{id:`source-tab-focus-mode`,category:`source`,title:{id:`eG8Jsg`},description:{id:`qRZh7J`},scope:{id:`tiWX6q`},bindings:[{mac:`Shift Alt M`,windowsLinux:`Ctrl M`}]},{id:`source-lint-panel`,category:`source`,title:{id:`yvG-l1`},description:{id:`kCqCyf`},scope:{id:`tiWX6q`},bindings:[{mac:`⇧⌘ M`,windowsLinux:`Ctrl Shift M`}]},{id:`source-next-diagnostic`,category:`source`,title:{id:`M1OfV9`},description:{id:`ExPiRQ`},scope:{id:`tiWX6q`},bindings:[{mac:`F8`,windowsLinux:`F8`}]}];function i(e){let t=r.find(t=>t.id===e);if(!t)throw Error(`Unknown keyboard shortcut: ${e}`);return t}function a(){return e()?`mac`:`windowsLinux`}var o=[[/⌘/g,` Command `],[/⌥/g,` Option `],[/⇧/g,` Shift `],[/⌃/g,` Control `],[/↑/g,` Up Arrow `],[/↓/g,` Down Arrow `],[/←/g,` Left Arrow `],[/→/g,` Right Arrow `],[/\[/g,` Left Bracket `],[/\]/g,` Right Bracket `],[/,/g,` Comma `],[/\bCtrl\b/g,` Control `]];function s(e){return e.split(` / `).map(e=>o.reduce((e,[t,n])=>e.replace(t,n),e).replaceAll(/\s+/g,` `).trim()).join(` or `)}function c(e,t=a()){return t===`mac`?e.mac:e.windowsLinux}function l(e,t=a()){return s(c(e,t))}function u(e,t=a()){return c(i(e).bindings[0],t)}function d(e,t=a()){return l(i(e).bindings[0],t)}function f(e){if(!e||typeof e!=`object`)return!1;if(`isContentEditable`in e&&e.isContentEditable===!0)return!0;if(!(`tagName`in e))return!1;let t=String(e.tagName).toUpperCase();return t===`INPUT`||t===`TEXTAREA`}function p(e,t,n=a()){return i(t).bindings.some(t=>{let r=m(t.match,n);return r?g(e,r,n):!1})}function m(e,t){return e?h(e)?e:e[t]??null:null}function h(e){return`key`in e||`code`in e}function g(e,t,n){if(t.key&&e.key.toLowerCase()!==t.key.toLowerCase()||t.code&&e.code!==t.code)return!1;let r=t.mod?n===`mac`:!1,i=t.mod?n===`windowsLinux`:!1,a=t.altKey??!1,o=t.shiftKey??!1;return t.allowExtraModifiers?!(t.anyMod&&!e.metaKey&&!e.ctrlKey||r&&!e.metaKey||i&&!e.ctrlKey||a&&!e.altKey||o&&!e.shiftKey):(t.anyMod?e.metaKey||e.ctrlKey:e.metaKey===r&&e.ctrlKey===i)&&e.altKey===a&&(t.allowShiftKey||!!e.shiftKey===o)}export{c as a,f as c,u as i,p as l,t as n,d as o,n as r,s,r as t};
@@ -1 +1 @@
1
- import{C as e,G as t,Hn as n,Wn as r,Xn as i,dr as a,ir as o,or as s,wr as c,zn as l}from"./dist-GmorMgHF.js";function u(e){return t.includes(e)}function d(e){if(e.startsWith(y)||e.startsWith(C)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=b(t),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function f(e){if(e.startsWith(y)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`#`);if(n<0)return null;let r=t.slice(n+1);if(!r)return null;try{return decodeURIComponent(r)}catch{return r}}function p(e,t){let n=`#/${e}`;return t?`${n}#${encodeURIComponent(t)}`:n}function m(e){if(window.location.hash===e)return;let{pathname:t,search:n}=window.location;window.history.replaceState(null,``,`${t}${n}${e}`)}function h(e){return e.endsWith(`.mdx`)?e.slice(0,-4):e.endsWith(`.md`)?e.slice(0,-3):e}function g(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}#${encodeURIComponent(t)}`:r}function _(e,t,n){if(e===`folder`)return g(t);let r=`#/${encodeURIComponent(t)}`;return n==null||n===``?r:`${r}?branch=${encodeURIComponent(n)}`}function v(e){if(e===`#/`)return!0;if(!e.startsWith(`#/`))return!1;let t=e.slice(2);return t.length>0&&t[0]===`?`}var y=`#/__asset__/`;function b(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function x(e){if(!e.startsWith(y))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function S(e){return`${y}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}var C=`#/__skill-file__/`;function w(e){return`${C}${[e.scope,e.name].map(encodeURIComponent).join(`/`)}/${e.path.split(`/`).map(encodeURIComponent).join(`/`)}`}function T(e){if(!e.startsWith(C))return null;let t=e.slice(17);if(!t)return null;let n;try{n=t.split(`/`).map(decodeURIComponent)}catch{return null}if(n.length<3)return null;let[r,i,...a]=n,o=a.join(`/`);return!r||!i||!o||!u(r)?null:{scope:r,name:i,path:o}}function E(e){return e.kind===`asset`}function D(e){return e.kind===`document`}function O(e){return e.kind===`folder`}function k(e){let t=[],n=0;for(let r of e)switch(r.kind){case`document`:if(r.docName===void 0){n+=1;break}t.push({kind:`document`,docName:r.docName,docExt:r.docExt,size:r.size,modified:r.modified,isSymlink:r.isSymlink,canonicalDocName:r.canonicalDocName,targetPath:r.targetPath});break;case`asset`:if(r.path===void 0||r.assetExt===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt,mediaKind:r.mediaKind??null,size:r.size,modified:r.modified,referencedBy:r.referencedBy});break;case`file`:if(r.path===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt??A(r.path),mediaKind:null,size:r.size,modified:r.modified,referencedBy:[]});break;case`folder`:if(r.path===void 0){n+=1;break}t.push({kind:`folder`,path:r.path,size:r.size,modified:r.modified,hasChildren:r.hasChildren,isSymlink:r.isSymlink,targetPath:r.targetPath});break;default:r.kind;break}return n>0&&console.warn(`[file-tree-utils] dropped ${n} listing entries missing variant identity fields`),t}function A(e){let t=e.includes(`/`)?e.split(`/`).pop()??e:e,n=t.lastIndexOf(`.`);return n>0&&n<t.length-1?t.slice(n+1).toLowerCase():t.startsWith(`.`)&&t.length>1?t.slice(1).toLowerCase():`file`}function j(e){if(!e)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=1;e<t.length;e++)n.push(t.slice(0,e).join(`/`));return n}function M(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function N(e,t=!1){return e.filter(e=>{let r=e.docName??e.path??``;return r===``?!1:t?!0:!n(r)})}function P(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\.mdx?$/i,``)}function F(e){let t=P(e);return t?`${t}.md`:`untitled.md`}function I(e){let t=P(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}function L(e){let t=e.trim();return{normalizedTarget:P(t).replace(/\/+$/g,``),expectsFolder:/\/+$/.test(t)}}function R(e){let t=new Set;for(let n of e)for(let e of j(n))t.add(e);return t}function z(e,t){if(!t)return;let n=c(e);if(n)return t.get(n)}function B(e,t){if(!t||e.includes(`/`))return;let n=c(e);if(n)return t.get(n)}function V(e,t){if(r(e)){let t=o(e);if(t?.kind===`reference`){let e=`references/${t.rel}.md`;return{kind:`skill-file`,target:`global/${t.name}/${e}`,scope:`global`,name:t.name,path:e}}let n=s(e);if(n?.kind===`skill`&&n.scope===`project`){let e=a(n.name);return{kind:`doc`,target:e,docName:e}}return{kind:`doc`,target:e,docName:e}}let n=i(e);if(n)return{kind:`doc`,target:n,docName:n};let{normalizedTarget:c,expectsFolder:l}=L(e);if(!c)return{kind:`missing`,target:c};if(!l&&t.pages.has(c))return{kind:`doc`,target:c,docName:c};if(!l){let e=z(c,t.pagesBySlug);if(e)return{kind:`doc`,target:e,docName:e}}let u=`${c}/index`;if(t.pages.has(u))return{kind:`folder-index`,target:c,folderPath:c,docName:u,noteKind:`canonical-index`};let d=c.split(`/`).pop(),f=d?`${c}/${d}`:null;if(f&&t.pages.has(f))return{kind:`folder-index`,target:c,folderPath:c,docName:f,noteKind:`legacy-folder-note`};if(!l){let e=B(c,t.pagesByBasename);if(e)return{kind:`doc`,target:e,docName:e}}return(t.folderPaths??R(t.pages)).has(c)?{kind:`folder`,target:c,folderPath:c}:{kind:`missing`,target:c}}function H(e){return e.kind===`folder-index`?{kind:`folder`,target:e.folderPath,folderPath:e.folderPath}:e}function U(t,n,r=e){return typeof n!=`number`||!l(n,r)?null:{kind:`large-file`,target:t,docName:t,size:n,limit:r}}function W(t,n,r=e){return t.kind!==`doc`&&t.kind!==`folder-index`?t:U(t.docName,n.get(t.docName)?.size,r)??t}function G(e){switch(e.kind){case`doc`:case`folder-index`:case`large-file`:return e.docName;case`missing`:return e.target;case`asset`:case`skill-file`:case`folder`:return null}}export{p as C,m as D,v as E,T as O,S,w as T,f as _,V as a,_ as b,F as c,N as d,E as f,k as g,A as h,U as i,P as l,O as m,G as n,W as o,D as p,H as r,I as s,R as t,M as u,x as v,g as w,h as x,d as y};
1
+ import{C as e,G as t,Hn as n,Wn as r,Xn as i,dr as a,ir as o,or as s,wr as c,zn as l}from"./dist-BRGUidv4.js";function u(e){return t.includes(e)}function d(e){if(e.startsWith(y)||e.startsWith(C)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=b(t),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function f(e){if(e.startsWith(y)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`#`);if(n<0)return null;let r=t.slice(n+1);if(!r)return null;try{return decodeURIComponent(r)}catch{return r}}function p(e,t){let n=`#/${e}`;return t?`${n}#${encodeURIComponent(t)}`:n}function m(e){if(window.location.hash===e)return;let{pathname:t,search:n}=window.location;window.history.replaceState(null,``,`${t}${n}${e}`)}function h(e){return e.endsWith(`.mdx`)?e.slice(0,-4):e.endsWith(`.md`)?e.slice(0,-3):e}function g(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}#${encodeURIComponent(t)}`:r}function _(e,t,n){if(e===`folder`)return g(t);let r=`#/${encodeURIComponent(t)}`;return n==null||n===``?r:`${r}?branch=${encodeURIComponent(n)}`}function v(e){if(e===`#/`)return!0;if(!e.startsWith(`#/`))return!1;let t=e.slice(2);return t.length>0&&t[0]===`?`}var y=`#/__asset__/`;function b(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function x(e){if(!e.startsWith(y))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function S(e){return`${y}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}var C=`#/__skill-file__/`;function w(e){return`${C}${[e.scope,e.name].map(encodeURIComponent).join(`/`)}/${e.path.split(`/`).map(encodeURIComponent).join(`/`)}`}function T(e){if(!e.startsWith(C))return null;let t=e.slice(17);if(!t)return null;let n;try{n=t.split(`/`).map(decodeURIComponent)}catch{return null}if(n.length<3)return null;let[r,i,...a]=n,o=a.join(`/`);return!r||!i||!o||!u(r)?null:{scope:r,name:i,path:o}}function E(e){return e.kind===`asset`}function D(e){return e.kind===`document`}function O(e){return e.kind===`folder`}function k(e){let t=[],n=0;for(let r of e)switch(r.kind){case`document`:if(r.docName===void 0){n+=1;break}t.push({kind:`document`,docName:r.docName,docExt:r.docExt,size:r.size,modified:r.modified,isSymlink:r.isSymlink,canonicalDocName:r.canonicalDocName,targetPath:r.targetPath});break;case`asset`:if(r.path===void 0||r.assetExt===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt,mediaKind:r.mediaKind??null,size:r.size,modified:r.modified,referencedBy:r.referencedBy});break;case`file`:if(r.path===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt??A(r.path),mediaKind:null,size:r.size,modified:r.modified,referencedBy:[]});break;case`folder`:if(r.path===void 0){n+=1;break}t.push({kind:`folder`,path:r.path,size:r.size,modified:r.modified,hasChildren:r.hasChildren,isSymlink:r.isSymlink,targetPath:r.targetPath});break;default:r.kind;break}return n>0&&console.warn(`[file-tree-utils] dropped ${n} listing entries missing variant identity fields`),t}function A(e){let t=e.includes(`/`)?e.split(`/`).pop()??e:e,n=t.lastIndexOf(`.`);return n>0&&n<t.length-1?t.slice(n+1).toLowerCase():t.startsWith(`.`)&&t.length>1?t.slice(1).toLowerCase():`file`}function j(e){if(!e)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=1;e<t.length;e++)n.push(t.slice(0,e).join(`/`));return n}function M(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function N(e,t=!1){return e.filter(e=>{let r=e.docName??e.path??``;return r===``?!1:t?!0:!n(r)})}function P(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\.mdx?$/i,``)}function F(e){let t=P(e);return t?`${t}.md`:`untitled.md`}function I(e){let t=P(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}function L(e){let t=e.trim();return{normalizedTarget:P(t).replace(/\/+$/g,``),expectsFolder:/\/+$/.test(t)}}function R(e){let t=new Set;for(let n of e)for(let e of j(n))t.add(e);return t}function z(e,t){if(!t)return;let n=c(e);if(n)return t.get(n)}function B(e,t){if(!t||e.includes(`/`))return;let n=c(e);if(n)return t.get(n)}function V(e,t){if(r(e)){let t=o(e);if(t?.kind===`reference`){let e=`references/${t.rel}.md`;return{kind:`skill-file`,target:`global/${t.name}/${e}`,scope:`global`,name:t.name,path:e}}let n=s(e);if(n?.kind===`skill`&&n.scope===`project`){let e=a(n.name);return{kind:`doc`,target:e,docName:e}}return{kind:`doc`,target:e,docName:e}}let n=i(e);if(n)return{kind:`doc`,target:n,docName:n};let{normalizedTarget:c,expectsFolder:l}=L(e);if(!c)return{kind:`missing`,target:c};if(!l&&t.pages.has(c))return{kind:`doc`,target:c,docName:c};if(!l){let e=z(c,t.pagesBySlug);if(e)return{kind:`doc`,target:e,docName:e}}let u=`${c}/index`;if(t.pages.has(u))return{kind:`folder-index`,target:c,folderPath:c,docName:u,noteKind:`canonical-index`};let d=c.split(`/`).pop(),f=d?`${c}/${d}`:null;if(f&&t.pages.has(f))return{kind:`folder-index`,target:c,folderPath:c,docName:f,noteKind:`legacy-folder-note`};if(!l){let e=B(c,t.pagesByBasename);if(e)return{kind:`doc`,target:e,docName:e}}return(t.folderPaths??R(t.pages)).has(c)?{kind:`folder`,target:c,folderPath:c}:{kind:`missing`,target:c}}function H(e){return e.kind===`folder-index`?{kind:`folder`,target:e.folderPath,folderPath:e.folderPath}:e}function U(t,n,r=e){return typeof n!=`number`||!l(n,r)?null:{kind:`large-file`,target:t,docName:t,size:n,limit:r}}function W(t,n,r=e){return t.kind!==`doc`&&t.kind!==`folder-index`?t:U(t.docName,n.get(t.docName)?.size,r)??t}function G(e){switch(e.kind){case`doc`:case`folder-index`:case`large-file`:return e.docName;case`missing`:return e.target;case`asset`:case`skill-file`:case`folder`:return null}}export{p as C,m as D,v as E,T as O,S,w as T,f as _,V as a,_ as b,F as c,N as d,E as f,k as g,A as h,U as i,P as l,O as m,G as n,W as o,D as p,H as r,I as s,R as t,M as u,x as v,g as w,h as x,d as y};
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-CFjPhJqf.js";import{n as t}from"./compiler-runtime-CVnuRdak.js";import{t as n}from"./react-dom-C-oc-P2K.js";import{u as r}from"./button-DGf25ccp.js";import{i,l as a}from"./documents-events-CSQluyCM.js";import{C as o}from"./navigation-targets-CXdtVjj4.js";var s=r(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),c=e(n()),l=e(t());function u(){var e=[...arguments];return(0,l.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var d=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function f(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function p(e){return`nodeType`in e}function m(e){return e?f(e)?e:p(e)?e.ownerDocument?.defaultView??window:window:window}function h(e){let{Document:t}=m(e);return e instanceof t}function g(e){return f(e)?!1:e instanceof m(e).HTMLElement}function _(e){return e instanceof m(e).SVGElement}function v(e){return e?f(e)?e.document:p(e)?h(e)?e:g(e)||_(e)?e.ownerDocument:document:document:document}var y=d?l.useLayoutEffect:l.useEffect;function b(e){let t=(0,l.useRef)(e);return y(()=>{t.current=e}),(0,l.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function x(){let e=(0,l.useRef)(null);return[(0,l.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,l.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function S(e,t){t===void 0&&(t=[e]);let n=(0,l.useRef)(e);return y(()=>{n.current!==e&&(n.current=e)},t),n}function C(e,t){let n=(0,l.useRef)();return(0,l.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function w(e){let t=b(e),n=(0,l.useRef)(null);return[n,(0,l.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function T(e){let t=(0,l.useRef)();return(0,l.useEffect)(()=>{t.current=e},[e]),t.current}var E={};function ee(e,t){return(0,l.useMemo)(()=>{if(t)return t;let n=E[e]==null?0:E[e]+1;return E[e]=n,e+`-`+n},[e,t])}function D(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var O=D(1),k=D(-1);function A(e){return`clientX`in e&&`clientY`in e}function te(e){if(!e)return!1;let{KeyboardEvent:t}=m(e.target);return t&&e instanceof t}function ne(e){if(!e)return!1;let{TouchEvent:t}=m(e.target);return t&&e instanceof t}function re(e){if(ne(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return A(e)?{x:e.clientX,y:e.clientY}:null}var j=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[j.Translate.toString(e),j.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),ie=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function M(e){return e.matches(ie)?e:e.querySelector(ie)}var ae={display:`none`};function oe(e){let{id:t,value:n}=e;return l.createElement(`div`,{id:t,style:ae},n)}function N(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return l.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function P(){let[e,t]=(0,l.useState)(``);return{announce:(0,l.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var F=(0,l.createContext)(null);function I(e){let t=(0,l.useContext)(F);(0,l.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function se(){let[e]=(0,l.useState)(()=>new Set),t=(0,l.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,l.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var ce={draggable:`
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{n as t}from"./compiler-runtime-CVnuRdak.js";import{t as n}from"./react-dom-C-oc-P2K.js";import{u as r}from"./button-DGf25ccp.js";import{i,l as a}from"./documents-events-DA8Q5ICz.js";import{C as o}from"./navigation-targets-DNRja8Z0.js";var s=r(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),c=e(n()),l=e(t());function u(){var e=[...arguments];return(0,l.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var d=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function f(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function p(e){return`nodeType`in e}function m(e){return e?f(e)?e:p(e)?e.ownerDocument?.defaultView??window:window:window}function h(e){let{Document:t}=m(e);return e instanceof t}function g(e){return f(e)?!1:e instanceof m(e).HTMLElement}function _(e){return e instanceof m(e).SVGElement}function v(e){return e?f(e)?e.document:p(e)?h(e)?e:g(e)||_(e)?e.ownerDocument:document:document:document}var y=d?l.useLayoutEffect:l.useEffect;function b(e){let t=(0,l.useRef)(e);return y(()=>{t.current=e}),(0,l.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function x(){let e=(0,l.useRef)(null);return[(0,l.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,l.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function S(e,t){t===void 0&&(t=[e]);let n=(0,l.useRef)(e);return y(()=>{n.current!==e&&(n.current=e)},t),n}function C(e,t){let n=(0,l.useRef)();return(0,l.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function w(e){let t=b(e),n=(0,l.useRef)(null);return[n,(0,l.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function T(e){let t=(0,l.useRef)();return(0,l.useEffect)(()=>{t.current=e},[e]),t.current}var E={};function ee(e,t){return(0,l.useMemo)(()=>{if(t)return t;let n=E[e]==null?0:E[e]+1;return E[e]=n,e+`-`+n},[e,t])}function D(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var O=D(1),k=D(-1);function A(e){return`clientX`in e&&`clientY`in e}function te(e){if(!e)return!1;let{KeyboardEvent:t}=m(e.target);return t&&e instanceof t}function ne(e){if(!e)return!1;let{TouchEvent:t}=m(e.target);return t&&e instanceof t}function re(e){if(ne(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return A(e)?{x:e.clientX,y:e.clientY}:null}var j=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[j.Translate.toString(e),j.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),ie=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function M(e){return e.matches(ie)?e:e.querySelector(ie)}var ae={display:`none`};function oe(e){let{id:t,value:n}=e;return l.createElement(`div`,{id:t,style:ae},n)}function N(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return l.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function P(){let[e,t]=(0,l.useState)(``);return{announce:(0,l.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var F=(0,l.createContext)(null);function I(e){let t=(0,l.useContext)(F);(0,l.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function se(){let[e]=(0,l.useState)(()=>new Set),t=(0,l.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,l.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var ce={draggable:`
2
2
  To pick up a draggable item, press the space bar.
3
3
  While dragging, use the arrow keys to move the item.
4
4
  Press space again to drop the item in its new position, or press escape to cancel.
@@ -1 +1 @@
1
- import{o as e,t}from"./chunk-CFjPhJqf.js";import{n,r,t as i}from"./compiler-runtime-CVnuRdak.js";import{wr as a}from"./dist-GmorMgHF.js";import{u as o}from"./button-DGf25ccp.js";import{l as s,o as ee}from"./documents-events-CSQluyCM.js";import{t as te}from"./navigation-targets-CXdtVjj4.js";import{r as ne}from"./startup-marks-CWTDb1CP.js";var c=o(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),l=o(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),u=o(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),d=e(n(),1),re=i(),f=null,p=new Set;function m(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function h(e,t){return e===null?!1:e===t?!0:m(e.pages,t.pages)&&m(e.folderPaths,t.folderPaths)&&m(e.assetPaths??new Set,t.assetPaths??new Set)&&m(e.filePaths??new Set,t.filePaths??new Set)&&g(e.pageIcons,t.pageIcons)}function g(e,t){if(e===t)return!0;let n=e?.size??0;if(n!==(t?.size??0))return!1;if(n===0)return!0;for(let[n,r]of e)if(t.get(n)!==r)return!1;return!0}function ie(e,t){let n=new Map;for(let r of e){let e=t(r);e&&!n.has(e)&&n.set(e,r)}return n}function ae(e,t){let n=new Map,r=[...e].sort((e,t)=>e.localeCompare(t));for(let e of r){let r=e.lastIndexOf(`/`),i=t(r===-1?e:e.slice(r+1));i&&!n.has(i)&&n.set(i,e)}return n}function oe(e){let t=new Map;for(let[n,r]of e){let e=r.icon;typeof e==`string`&&e.trim()!==``&&t.set(n,e)}return t}function _(){return f}function se(e){if(!h(f,e)){f=e;for(let t of Array.from(p))try{t(e)}catch(e){console.error(`[page-list-cache] subscriber threw:`,e)}}}function v(e){if(p.add(e),f!==null)try{e(f)}catch(e){console.error(`[page-list-cache] subscriber threw on replay:`,e)}return()=>{p.delete(e)}}var y=null;function b(){if(y)return y;let e=(async()=>{let e=await fetch(`/api/documents`),t=await e.json().catch(e=>(console.warn(`[documents-fetch] /api/documents response was not valid JSON:`,e),null));return{ok:e.ok,status:e.status,body:t}})();return y=e,e.then(()=>{y===e&&(y=null)},()=>{y===e&&(y=null)}),e}var ce=r(),x=(0,d.createContext)(null);function le(e,t){if(t.size===0)return new Set(e);let n=new Set(e);for(let e of t)n.add(e);return n}function ue(e,t){if(e.size===0)return new Set;let n=new Set;for(let r of e)t.has(r)||n.add(r);return n}function de(e,t){let n=new Map(e);for(let e of t)n.has(e)||n.set(e,e);return n}async function fe(){let e=await fetch(`/api/pages`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(s(t)??`/api/pages responded with ${e.status}`)}let t=await e.json();return Array.isArray(t.pages)?t.pages:[]}async function pe(){let{ok:e,status:t,body:n}=await b();if(!e)throw Error(s(n)??`/api/documents responded with ${t}`);let r=n??{};return Array.isArray(r.documents)?{assetPaths:r.documents.filter(e=>e.kind===`asset`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path),folderPaths:r.documents.filter(e=>e.kind===`folder`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path),filePaths:r.documents.filter(e=>e.kind===`file`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path)}:{assetPaths:[],folderPaths:[],filePaths:[]}}function S(e){console.error(`[PageListContext] Failed to load pages:`,e)}function C(e){console.warn(`[PageListContext] Failed to load referenced assets:`,e)}function w(e){let t=(0,re.c)(54),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Set,t[0]=r):r=t[0];let[i,o]=(0,d.useState)(r),s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=new Map,t[1]=s):s=t[1];let[c,l]=(0,d.useState)(s),u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=new Map,t[2]=u):u=t[2];let[f,p]=(0,d.useState)(u),m;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(m=new Set,t[3]=m):m=t[3];let[h,g]=(0,d.useState)(m),_;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(_=new Set,t[4]=_):_=t[4];let[v,y]=(0,d.useState)(_),b;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(b=new Set,t[5]=b):b=t[5];let[C,w]=(0,d.useState)(b),E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=new Set,t[6]=E):E=t[6];let[D,O]=(0,d.useState)(E),[k,A]=(0,d.useState)(!0),[j,M]=(0,d.useState)(null),N=(0,d.useRef)(0),P;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(P=function(){let e=N.current+=1;Promise.all([fe(),pe().catch(T)]).then(t=>{let[n,r]=t;if(e!==N.current)return;let i=new Set(n.map(ge));o(i),l(new Map(n.map(he))),p(new Map(n.map(me))),g(new Set(r.assetPaths)),y(new Set(r.folderPaths)),w(new Set(r.filePaths)),O(e=>ue(e,i)),M(null),ne()}).catch(t=>{e===N.current&&(S(t),M(t instanceof Error?t.message:`Failed to load pages`))}).finally(()=>{e===N.current&&A(!1)})},t[7]=P):P=t[7];let F=P,I;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(I=function(e){O(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n}),M(null)},t[8]=I):I=t[8];let _e=I,L,R;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>{F();let e=()=>{document.visibilityState===`visible`&&F()};window.addEventListener(`focus`,e),window.addEventListener(`visibilitychange`,e);let t=ee(e=>{e.includes(`files`)&&F()});return()=>{window.removeEventListener(`focus`,e),window.removeEventListener(`visibilitychange`,e),t()}},R=[],t[9]=L,t[10]=R):(L=t[9],R=t[10]),(0,d.useEffect)(L,R);let z,B,V,H,U,W,G,K;if(t[11]!==D||t[12]!==h||t[13]!==C||t[14]!==v||t[15]!==f||t[16]!==c||t[17]!==i){W=le(i,D);let e;t[26]!==D||t[27]!==c?(e=de(c,D),t[26]=D,t[27]=c,t[28]=e):e=t[28],U=e,H=f,z=h,B=C,V=new Set([...te(W),...v]),G=ie(W,a),K=ae(W,a),t[11]=D,t[12]=h,t[13]=C,t[14]=v,t[15]=f,t[16]=c,t[17]=i,t[18]=z,t[19]=B,t[20]=V,t[21]=H,t[22]=U,t[23]=W,t[24]=G,t[25]=K}else z=t[18],B=t[19],V=t[20],H=t[21],U=t[22],W=t[23],G=t[24],K=t[25];let q=K,J;t[29]===f?J=t[30]:(J=oe(f),t[29]=f,t[30]=J);let Y=J,X,Z;t[31]!==z||t[32]!==B||t[33]!==V||t[34]!==Y||t[35]!==W||t[36]!==q||t[37]!==G?(X=()=>{se({pages:W,folderPaths:V,pagesBySlug:G,pagesByBasename:q,assetPaths:z,filePaths:B,pageIcons:Y})},Z=[W,V,G,q,z,B,Y],t[31]=z,t[32]=B,t[33]=V,t[34]=Y,t[35]=W,t[36]=q,t[37]=G,t[38]=X,t[39]=Z):(X=t[38],Z=t[39]),(0,d.useEffect)(X,Z);let Q;t[40]!==z||t[41]!==j||t[42]!==B||t[43]!==V||t[44]!==k||t[45]!==H||t[46]!==U||t[47]!==W||t[48]!==q||t[49]!==G?(Q={pages:W,pagesBySlug:G,pagesByBasename:q,pageTitles:U,pageMeta:H,folderPaths:V,assetPaths:z,filePaths:B,loading:k,error:j,refetch:F,addPage:_e},t[40]=z,t[41]=j,t[42]=B,t[43]=V,t[44]=k,t[45]=H,t[46]=U,t[47]=W,t[48]=q,t[49]=G,t[50]=Q):Q=t[50];let $;return t[51]!==n||t[52]!==Q?($=(0,ce.jsx)(x,{value:Q,children:n}),t[51]=n,t[52]=Q,t[53]=$):$=t[53],$}function me(e){return[e.docName,{size:e.size,modified:e.modified,docExt:e.docExt,icon:e.icon}]}function he(e){return[e.docName,e.title]}function ge(e){return e.docName}function T(e){return C(e),{assetPaths:[],folderPaths:[],filePaths:[]}}function E(){let e=(0,d.use)(x);if(!e)throw Error(`usePageList must be used within <PageListProvider />`);return e}function D(){return(0,d.use)(x)}var O=t(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),k=t(((e,t)=>{var n=O();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),A=t(((e,t)=>{t.exports=k()()}));export{b as a,u as c,E as i,l,w as n,_ as o,D as r,v as s,A as t,c as u};
1
+ import{o as e,t}from"./chunk-CFjPhJqf.js";import{n,r,t as i}from"./compiler-runtime-CVnuRdak.js";import{wr as a}from"./dist-BRGUidv4.js";import{u as o}from"./button-DGf25ccp.js";import{l as s,o as ee}from"./documents-events-DA8Q5ICz.js";import{t as te}from"./navigation-targets-DNRja8Z0.js";import{r as ne}from"./startup-marks-CWTDb1CP.js";var c=o(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),l=o(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),u=o(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),d=e(n(),1),re=i(),f=null,p=new Set;function m(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function h(e,t){return e===null?!1:e===t?!0:m(e.pages,t.pages)&&m(e.folderPaths,t.folderPaths)&&m(e.assetPaths??new Set,t.assetPaths??new Set)&&m(e.filePaths??new Set,t.filePaths??new Set)&&g(e.pageIcons,t.pageIcons)}function g(e,t){if(e===t)return!0;let n=e?.size??0;if(n!==(t?.size??0))return!1;if(n===0)return!0;for(let[n,r]of e)if(t.get(n)!==r)return!1;return!0}function ie(e,t){let n=new Map;for(let r of e){let e=t(r);e&&!n.has(e)&&n.set(e,r)}return n}function ae(e,t){let n=new Map,r=[...e].sort((e,t)=>e.localeCompare(t));for(let e of r){let r=e.lastIndexOf(`/`),i=t(r===-1?e:e.slice(r+1));i&&!n.has(i)&&n.set(i,e)}return n}function oe(e){let t=new Map;for(let[n,r]of e){let e=r.icon;typeof e==`string`&&e.trim()!==``&&t.set(n,e)}return t}function _(){return f}function se(e){if(!h(f,e)){f=e;for(let t of Array.from(p))try{t(e)}catch(e){console.error(`[page-list-cache] subscriber threw:`,e)}}}function v(e){if(p.add(e),f!==null)try{e(f)}catch(e){console.error(`[page-list-cache] subscriber threw on replay:`,e)}return()=>{p.delete(e)}}var y=null;function b(){if(y)return y;let e=(async()=>{let e=await fetch(`/api/documents`),t=await e.json().catch(e=>(console.warn(`[documents-fetch] /api/documents response was not valid JSON:`,e),null));return{ok:e.ok,status:e.status,body:t}})();return y=e,e.then(()=>{y===e&&(y=null)},()=>{y===e&&(y=null)}),e}var ce=r(),x=(0,d.createContext)(null);function le(e,t){if(t.size===0)return new Set(e);let n=new Set(e);for(let e of t)n.add(e);return n}function ue(e,t){if(e.size===0)return new Set;let n=new Set;for(let r of e)t.has(r)||n.add(r);return n}function de(e,t){let n=new Map(e);for(let e of t)n.has(e)||n.set(e,e);return n}async function fe(){let e=await fetch(`/api/pages`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(s(t)??`/api/pages responded with ${e.status}`)}let t=await e.json();return Array.isArray(t.pages)?t.pages:[]}async function pe(){let{ok:e,status:t,body:n}=await b();if(!e)throw Error(s(n)??`/api/documents responded with ${t}`);let r=n??{};return Array.isArray(r.documents)?{assetPaths:r.documents.filter(e=>e.kind===`asset`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path),folderPaths:r.documents.filter(e=>e.kind===`folder`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path),filePaths:r.documents.filter(e=>e.kind===`file`&&typeof e.path==`string`&&e.path.length>0).map(e=>e.path)}:{assetPaths:[],folderPaths:[],filePaths:[]}}function S(e){console.error(`[PageListContext] Failed to load pages:`,e)}function C(e){console.warn(`[PageListContext] Failed to load referenced assets:`,e)}function w(e){let t=(0,re.c)(54),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Set,t[0]=r):r=t[0];let[i,o]=(0,d.useState)(r),s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=new Map,t[1]=s):s=t[1];let[c,l]=(0,d.useState)(s),u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=new Map,t[2]=u):u=t[2];let[f,p]=(0,d.useState)(u),m;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(m=new Set,t[3]=m):m=t[3];let[h,g]=(0,d.useState)(m),_;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(_=new Set,t[4]=_):_=t[4];let[v,y]=(0,d.useState)(_),b;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(b=new Set,t[5]=b):b=t[5];let[C,w]=(0,d.useState)(b),E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=new Set,t[6]=E):E=t[6];let[D,O]=(0,d.useState)(E),[k,A]=(0,d.useState)(!0),[j,M]=(0,d.useState)(null),N=(0,d.useRef)(0),P;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(P=function(){let e=N.current+=1;Promise.all([fe(),pe().catch(T)]).then(t=>{let[n,r]=t;if(e!==N.current)return;let i=new Set(n.map(ge));o(i),l(new Map(n.map(he))),p(new Map(n.map(me))),g(new Set(r.assetPaths)),y(new Set(r.folderPaths)),w(new Set(r.filePaths)),O(e=>ue(e,i)),M(null),ne()}).catch(t=>{e===N.current&&(S(t),M(t instanceof Error?t.message:`Failed to load pages`))}).finally(()=>{e===N.current&&A(!1)})},t[7]=P):P=t[7];let F=P,I;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(I=function(e){O(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n}),M(null)},t[8]=I):I=t[8];let _e=I,L,R;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>{F();let e=()=>{document.visibilityState===`visible`&&F()};window.addEventListener(`focus`,e),window.addEventListener(`visibilitychange`,e);let t=ee(e=>{e.includes(`files`)&&F()});return()=>{window.removeEventListener(`focus`,e),window.removeEventListener(`visibilitychange`,e),t()}},R=[],t[9]=L,t[10]=R):(L=t[9],R=t[10]),(0,d.useEffect)(L,R);let z,B,V,H,U,W,G,K;if(t[11]!==D||t[12]!==h||t[13]!==C||t[14]!==v||t[15]!==f||t[16]!==c||t[17]!==i){W=le(i,D);let e;t[26]!==D||t[27]!==c?(e=de(c,D),t[26]=D,t[27]=c,t[28]=e):e=t[28],U=e,H=f,z=h,B=C,V=new Set([...te(W),...v]),G=ie(W,a),K=ae(W,a),t[11]=D,t[12]=h,t[13]=C,t[14]=v,t[15]=f,t[16]=c,t[17]=i,t[18]=z,t[19]=B,t[20]=V,t[21]=H,t[22]=U,t[23]=W,t[24]=G,t[25]=K}else z=t[18],B=t[19],V=t[20],H=t[21],U=t[22],W=t[23],G=t[24],K=t[25];let q=K,J;t[29]===f?J=t[30]:(J=oe(f),t[29]=f,t[30]=J);let Y=J,X,Z;t[31]!==z||t[32]!==B||t[33]!==V||t[34]!==Y||t[35]!==W||t[36]!==q||t[37]!==G?(X=()=>{se({pages:W,folderPaths:V,pagesBySlug:G,pagesByBasename:q,assetPaths:z,filePaths:B,pageIcons:Y})},Z=[W,V,G,q,z,B,Y],t[31]=z,t[32]=B,t[33]=V,t[34]=Y,t[35]=W,t[36]=q,t[37]=G,t[38]=X,t[39]=Z):(X=t[38],Z=t[39]),(0,d.useEffect)(X,Z);let Q;t[40]!==z||t[41]!==j||t[42]!==B||t[43]!==V||t[44]!==k||t[45]!==H||t[46]!==U||t[47]!==W||t[48]!==q||t[49]!==G?(Q={pages:W,pagesBySlug:G,pagesByBasename:q,pageTitles:U,pageMeta:H,folderPaths:V,assetPaths:z,filePaths:B,loading:k,error:j,refetch:F,addPage:_e},t[40]=z,t[41]=j,t[42]=B,t[43]=V,t[44]=k,t[45]=H,t[46]=U,t[47]=W,t[48]=q,t[49]=G,t[50]=Q):Q=t[50];let $;return t[51]!==n||t[52]!==Q?($=(0,ce.jsx)(x,{value:Q,children:n}),t[51]=n,t[52]=Q,t[53]=$):$=t[53],$}function me(e){return[e.docName,{size:e.size,modified:e.modified,docExt:e.docExt,icon:e.icon}]}function he(e){return[e.docName,e.title]}function ge(e){return e.docName}function T(e){return C(e),{assetPaths:[],folderPaths:[],filePaths:[]}}function E(){let e=(0,d.use)(x);if(!e)throw Error(`usePageList must be used within <PageListProvider />`);return e}function D(){return(0,d.use)(x)}var O=t(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),k=t(((e,t)=>{var n=O();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),A=t(((e,t)=>{t.exports=k()()}));export{b as a,u as c,E as i,l,w as n,_ as o,D as r,v as s,A as t,c as u};
@@ -1,4 +1,4 @@
1
- import{nt as e,st as t}from"./DocumentContext-bNGvFuJS.js";function n(n){let r=e(n.state.selection.content(),n.state.schema);return t().serialize(r).trim()}function r(e){return e.lineCount===1&&e.charLen<100?{kind:`inline`,markdown:e.markdown}:e.surface===`source`&&e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?{kind:`lines`,startLine:e.sourceLineStart,endLine:e.sourceLineEnd}:{kind:`anchor`,markdown:e.markdown}}function i(e,t){return e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?`${t} (${e.sourceLineStart===e.sourceLineEnd?`${e.sourceLineStart}`:`${e.sourceLineStart}-${e.sourceLineEnd}`})`:e.lineCount>1?`${t} (${e.lineCount} lines)`:`${t} (selection)`}function a(e){let t=e.replace(/\r\n/g,`
1
+ import{nt as e,st as t}from"./DocumentContext-zL3ZbwDo.js";function n(n){let r=e(n.state.selection.content(),n.state.schema);return t().serialize(r).trim()}function r(e){return e.lineCount===1&&e.charLen<100?{kind:`inline`,markdown:e.markdown}:e.surface===`source`&&e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?{kind:`lines`,startLine:e.sourceLineStart,endLine:e.sourceLineEnd}:{kind:`anchor`,markdown:e.markdown}}function i(e,t){return e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?`${t} (${e.sourceLineStart===e.sourceLineEnd?`${e.sourceLineStart}`:`${e.sourceLineStart}-${e.sourceLineEnd}`})`:e.lineCount>1?`${t} (${e.lineCount} lines)`:`${t} (selection)`}function a(e){let t=e.replace(/\r\n/g,`
2
2
  `).split(`
3
3
  `),n=[],r=!1;for(let e of t){let t=e.trim();if(/^(```|~~~)/.test(t)){r||n.push(`code`),r=!r;continue}if(r||t===``)continue;if(/^\|.*\|?$/.test(t)&&t.includes(`|`)){n[n.length-1]!==`table`&&n.push(`table`);continue}if(/^<\/?[A-Za-z]/.test(t)){n[n.length-1]!==`component`&&n.push(`component`);continue}let i=t.match(/^#{1,6}\s+(.*)$/);if(i){n.push(i[1]??``);continue}let a=t.match(/^[-*+]\s+(.*)$/);if(a){n.push(`• ${a[1]??``}`);continue}let o=t.match(/^\d+\.\s+(.*)$/);if(o){n.push(`• ${o[1]??``}`);continue}let s=t.match(/^>\s?(.*)$/);if(s){n.push(s[1]??``);continue}n.push(t)}return n.join(` `).replace(/\s+/g,` `).trim()}var o=new Map,s=new Set,c=(e,t)=>`${t}:${e}`;function l(){for(let e of s)e()}function u(e,t){return e.markdown===t.markdown&&e.sourceLineStart===t.sourceLineStart&&e.sourceLineEnd===t.sourceLineEnd}function d(e,t,n){let r=c(e,t);if(n===null){o.delete(r)&&l();return}let i=o.get(r);i&&u(i,n)||(o.set(r,n),l())}function f(e,t){return e===null?null:o.get(c(e,t))??null}function p(e){return s.add(e),()=>{s.delete(e)}}function m(e,t){if(e.state.selection.empty)return null;let r=n(e);return r.trim()?{surface:`wysiwyg`,docName:t,markdown:r,charLen:r.trim().length,lineCount:(r.match(/\n/g)?.length??0)+1}:null}function h(e,t){return e.trim()?{surface:`frontmatter`,docName:t,markdown:e,charLen:e.trim().length,lineCount:(e.match(/\n/g)?.length??0)+1}:null}function g(e,t){let n=[],r=1/0,i=-1;for(let t of e.state.selection.ranges)t.empty||(n.push(e.state.sliceDoc(t.from,t.to)),r=Math.min(r,t.from),i=Math.max(i,t.to));if(n.length===0)return null;let a=n.join(`
4
4
  `);if(!a.trim())return null;let o=e.state.doc.lineAt(r).number,s=e.state.doc.lineAt(i).number;return{surface:`source`,docName:t,markdown:a,charLen:a.trim().length,lineCount:s-o+1,sourceLineStart:o,sourceLineEnd:s}}export{h as a,r as c,i,p as l,a as n,g as o,d as r,m as s,f as t,n as u};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{n as i,r as a}from"./dist-CQw2y-s3.js";import{$t as o,Bt as s,Ct as c,J as l,Ki as u,Lt as d,Mt as f,Or as p,Qt as m,Zt as h,dn as g,en as _,ft as v,in as y,jt as b,k as x,n as S,nn as C,rn as w,t as T,tn as E,wt as D,xt as O,zt as k}from"./dist-GmorMgHF.js";import{l as A,t as j,u as M}from"./button-DGf25ccp.js";import{a as N,c as P,i as F,n as I,o as L,r as R,s as z,t as B}from"./dialog-CIq9aQLf.js";import{d as V,f as ee,i as te,l as H,m as ne,n as re,p as ie,u as ae}from"./config-context-DhhN0rlf.js";import{a as U,i as W,n as oe,t as G}from"./cursor-CpjEfgnv.js";import{n as K}from"./dist-KBKQayVB.js";import{l as q,o as J,s as Y,u as se}from"./documents-events-CSQluyCM.js";import{C as ce,S as le,_ as X,a as ue,d as de,f as fe,g as pe,n as me,s as he,t as ge,v as _e,w as ve,x as ye}from"./skills-api-mcV6MiPo.js";import{t as be}from"./label-DyT4OD9H.js";import{t as xe}from"./input-DkQ8Zmzd.js";var Se=M(`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`}]]),Ce=M(`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`}]]),we=M(`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`}]]),Te=M(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Z=r(),Q=e(t(),1);function Ee(){let[e]=(0,Q.useState)(De);return e}function De(){return g()!=null}var Oe=[{id:`claude-cowork`,displayName:`Claude Cowork`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,tagline:`Conversational pairing in Claude Desktop's Cowork tab.`},{id:`claude-code`,displayName:`Claude`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,tagline:`Agentic coding in Claude Desktop's Code tab.`},{id:`codex`,displayName:`Codex`,appBrandName:`Codex Desktop`,schemes:[`codex:`],installUrl:`https://openai.com/codex`,tagline:`OpenAI's coding agent, terminal-native.`},{id:`cursor`,displayName:`Cursor`,schemes:[`cursor:`],installUrl:`https://cursor.com/`,tagline:`AI-first VS Code fork with multi-file edits.`},{id:`opencode`,displayName:`OpenCode`,schemes:[],installUrl:`https://opencode.ai`,tagline:`Open-source terminal coding agent; bring any local model.`}],ke=Oe.filter(e=>e.id!==`claude-cowork`&&e.id!==`opencode`),$=n();function Ae(){let e=(0,Z.c)(3),[t,n]=(0,Q.useState)(Ne),r,i;return e[0]===t?(r=e[1],i=e[2]):(r=()=>{if(t!==null||window.okDesktop)return;let e=!0;return fetch(`/api/workspace`).then(async t=>{let r=await t.json().catch(Me);if(!e||!t.ok)return;let i=b.safeParse(r);i.success&&n({contentDir:i.data.contentDir,pathSeparator:i.data.pathSeparator})}).catch(je),()=>{e=!1}},i=[t],e[0]=t,e[1]=r,e[2]=i),(0,Q.useEffect)(r,i),t}function je(e){console.warn(`[useWorkspace] /api/workspace fetch failed:`,e)}function Me(){return null}function Ne(){return Pe()}function Pe(e=typeof window>`u`?void 0:window){if(!e)return null;let t=e.okDesktop;return t?{contentDir:t.config.projectPath,pathSeparator:t.platform===`win32`?`\\`:`/`}:null}function Fe(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 Ie(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=q(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 Le(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?Fe(e):Ie()}var Re=`ok:skill:cowork:installed`,ze=`1`,Be=250,Ve=`/api/skill/install-state`;function He(e){return`${Re}:v${e}`}var Ue=new Map;async function We(e={},t={}){let n=t.force?`__force__`:`__default__`,r=Ue.get(n);if(r)return r;let i=Ge(e,t);return Ue.set(n,i),i.finally(()=>{Ue.get(n)===i&&Ue.delete(n)}),i}async function Ge(e,t){let n=e.installer===void 0?Le():e.installer,r=Ke(e.storage),i=e.fetchSnapshot??Je,a=e.serverTimeoutMs??Be,o=null;if(!t.force){try{o=await Ye(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=He(o?.currentVersion??e.fallbackSkillVersion??qe());if(!t.force&&r?.getItem(s)===ze)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,ze)}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 Ke(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function qe(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function Je(){let e;try{e=await fetch(Ve,{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 Ye(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function Xe(e){return We({},e)}function Ze(){return We({},{force:!0})}async function Qe(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 $e(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return Qe({target:`claude-cowork`,url:d({mode:`cowork`},e)},n);case`claude-code`:return Qe({target:`claude-code`,url:d({mode:`code`},e)},n);case`codex`:return Qe({target:`codex`,url:k(e)},n);case`cursor`:return Qe({target:`cursor`,url:s(e),workspacePath:e.projectDir},n);case`opencode`:return{ok:!1,reason:`invalid-payload`,detail:`opencode is terminal-only; launch via requestTerminalLaunch`};default:{let t=e.target;return{ok:!1,reason:`invalid-payload`,detail:`unknown target: ${String(t)}`}}}}async function et(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.openExternal)try{return await n.shell.openExternal(e),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:tt(e)}}let r=t.doc??(typeof document<`u`?document:void 0);if(!r)return{ok:!1,reason:`dispatch-error`,detail:`no DOM available`};try{let t=r.createElement(`a`);return t.href=e,t.rel=`noopener noreferrer`,/^https?:/i.test(e)&&(t.target=`_blank`),r.body.appendChild(t),t.click(),t.remove(),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:tt(e)}}}function tt(e){if(e instanceof Error)return e.message;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}async function nt(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)}`)}}function rt(e,t,n){let r=n===`\\`?t.replaceAll(`/`,`\\`):t;return`${e.endsWith(n)?e.slice(0,-1):e}${n}${r}`}function it(e){return`${e}.md`}function at(e){if(!e.docName||!e.workspace)return null;let t=it(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:{relativePath:t},projectDir:n,docPath:rt(n,t,r)}}function ot(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function st(e){return e.workspace?.contentDir?{docContext:null,createDescription:e.description,createScenario:e.scenario,createMentions:e.mentions,projectDir:e.workspace.contentDir,docPath:``}:null}function ct(e){return et(e.installUrl).then(()=>void 0)}function lt(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function ut(e){return!e.workspace?.contentDir||!e.skillName?null:{docContext:null,skill:{name:e.skillName,scope:e.scope},projectDir:e.workspace.contentDir,docPath:``}}function dt(e){if(!e.workspace?.contentDir)return null;let{contentDir:t,pathSeparator:n}=e.workspace;if(e.docName){let r=it(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:rt(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 ft(e){return`Opened in ${e}.`}function pt(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 mt(e){return e>=3?null:e===2?`Try one more time`:`Retry`}function ht(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 gt(e,t,n){if(e.scope===`doc`){let r={scope:`doc`,docRelativePath:e.docRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n};return e.selection===void 0?r:{...r,selection:e.selection}}return e.scope===`folder`?{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n}:{scope:`project`,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n}}function _t(e,t,n){return e.compose?f(gt(e.compose,t,n)):e.selection?C({...e.selection,target:t}):e.skill?w(e.skill.name,e.skill.scope,n):e.ask?h(e.ask.relativePath,e.ask.instruction,n,t):p(e.docContext===null?e.folderRelativePath?E(e.folderRelativePath,n,e.instruction):e.createDescription===void 0?o(n,e.instruction):m(e.createDescription,n,e.createScenario??`new-project`,e.createMentions??[]):_(e.docContext.relativePath,n,e.instruction))}function vt(e,t){let n=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||n?`${l} ${_t(e,c[t].handoffTarget,!1)}`:y(e.docContext?.relativePath??null)}async function yt(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:_t(t,e,n.autoOpen)},a=await n.dispatchHandoff(i),o=n.isElectronHost()?`electron`:`web`,s=n.now().toISOString(),c=t.compose,l=ht(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(ft(u));else{let i=mt(r),a=pt(u,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{yt(e,t,n,r+1)}}})}return a}function bt(e){return Oe.find(t=>t.id===e)?.displayName??e}function xt(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function St(){return{dispatchHandoff:$e,recordHandoff:nt,toast:{success:e=>{K.success(e)},error:(e,t)=>{K.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>xt(),getDisplayName:bt,ensureCoworkSkillInstalled:Xe,autoOpen:!0}}function Ct(){let e=(0,Z.c)(2),{merged:t}=re(),n=t?.appearance?.preview?.autoOpen??!0,r;return e[0]===n?r=e[1]:(r={dispatch:(e,t)=>yt(e,t,{...St(),autoOpen:n}),reinstallCoworkSkill:Ze},e[0]=n,e[1]=r),r}var wt=[...new Set(Oe.flatMap(e=>e.schemes))];function Tt(e,t){let n=t.now?.()??Date.now(),r={};for(let t of Oe){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 Et(e){return Tt({},e)}async function Dt(e){let t=e.schemes??wt,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 Ot=Object.fromEntries(wt.map(e=>[e,{installed:!1}]));async function kt(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 Ot}if(!t.ok)return Ot;let n;try{n=await t.json()}catch{return Ot}if(typeof n!=`object`||!n||Array.isArray(n))return Ot;let r=n,i={};for(let e of wt)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function At(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 jt(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Et({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=Tt(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=!At(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 Mt(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Nt(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>Dt({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>kt({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Pt(){let e=(0,Z.c)(5),[t,n]=(0,Q.useState)(Ft),r=(0,Q.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=jt(Nt());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 Ft(){return Et({isElectronHost:Mt(),now:Date.now})}function It(e){return!(e instanceof Error)||e.name!==`NotAllowedError`?!1:/permission denied|permissions policy/i.test(e.message)}function Lt(e){let t=globalThis.document;if(!t?.body||typeof t.createElement!=`function`||typeof t.execCommand!=`function`)return!1;let n=t.createElement(`textarea`);n.value=e,n.style.position=`fixed`,n.style.opacity=`0`,n.style.pointerEvents=`none`,n.setAttribute(`readonly`,``),t.body.appendChild(n);try{return n.focus(),n.select(),t.execCommand(`copy`)}catch{return!1}finally{n.remove()}}async function Rt(e){let t=globalThis.okDesktop?.clipboard;if(t&&typeof t.writeText==`function`){await t.writeText(e);return}let n=globalThis.navigator?.clipboard;if(n&&typeof n.writeText==`function`)try{await n.writeText(e);return}catch(t){if(Lt(e))return;throw t}if(!Lt(e))throw Error(`clipboard API unavailable`)}function zt(e){let t=(0,Z.c)(5),n,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`title`,{children:`OpenCode icon`}),r=(0,$.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M384 416H128V96H384V416ZM320 160H192V352H320V160Z`}),i=(0,$.jsx)(`path`,{fill:`currentColor`,fillOpacity:.55,d:`M320 224V352H192V224H320Z`}),t[0]=n,t[1]=r,t[2]=i):(n=t[0],r=t[1],i=t[2]);let a;return t[3]===e?a=t[4]:(a=(0,$.jsxs)(`svg`,{role:`img`,"aria-label":`OpenCode icon`,xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,fill:`none`,viewBox:`0 0 512 512`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}var Bt={"claude-cowork":`claude`,"claude-code":`claude`,codex:`openai`,cursor:`cursor`,opencode:`opencode`};function Vt(e){let t=(0,Z.c)(27),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({id:r,style:a,className:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let{resolvedTheme:o}=u(),s=Bt[r],c=s?(o===`dark`?S[s]:void 0)??T[s]:void 0,l;t[5]!==c||t[6]!==a?(l=c?{...a,"--ok-brand-color":c}:a,t[5]=c,t[6]=a,t[7]=l):l=t[7];let d=l,f=c&&`[&_*]:![color:var(--ok-brand-color)]`,p;t[8]!==n||t[9]!==f?(p=A(f,n),t[8]=n,t[9]=f,t[10]=p):p=t[10];let m=p;if(r===`claude-cowork`||r===`claude-code`){let e;return t[11]!==m||t[12]!==d||t[13]!==i?(e=(0,$.jsx)(W,{style:d,className:m,...i}),t[11]=m,t[12]=d,t[13]=i,t[14]=e):e=t[14],e}if(r===`codex`){let e;return t[15]!==m||t[16]!==d||t[17]!==i?(e=(0,$.jsx)(oe,{style:d,className:m,...i}),t[15]=m,t[16]=d,t[17]=i,t[18]=e):e=t[18],e}if(r===`cursor`){let e;return t[19]!==m||t[20]!==d||t[21]!==i?(e=(0,$.jsx)(G,{style:d,className:m,...i}),t[19]=m,t[20]=d,t[21]=i,t[22]=e):e=t[22],e}if(r===`opencode`){let e;return t[23]!==m||t[24]!==d||t[25]!==i?(e=(0,$.jsx)(zt,{style:d,className:m,...i}),t[23]=m,t[24]=d,t[25]=i,t[26]=e):e=t[26],e}return null}var Ht=(0,Q.createContext)(null);function Ut(e){let t=(0,Z.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,$.jsx)(Ht,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Wt(){return(0,Q.use)(Ht)}var Gt=D;function Kt(e){return c[e].handoffTarget}function qt(e){let t=(0,Z.c)(48),{itemName:n,isSubmitting:r,onDelete:o,customTitle:s,customDescription:c,customDetail:l,customConfirmLabel:u,customConfirmLabelBusy:d,children:f}=e,{_:p}=a(),m;t[0]!==p||t[1]!==n?(m=n??p({id:`L3CEC1`}),t[0]=p,t[1]=n,t[2]=m):m=t[2];let h=m,g;t[3]!==p||t[4]!==u?(g=u??p({id:`cnGeoo`}),t[3]=p,t[4]=u,t[5]=g):g=t[5];let _=g,v;t[6]!==p||t[7]!==u||t[8]!==d?(v=d??u??p({id:`s3caR3`}),t[6]=p,t[7]=u,t[8]=d,t[9]=v):v=t[9];let y=v,b;t[10]!==p||t[11]!==s||t[12]!==h?(b=s??p({id:`77SdEP`,values:{itemName:h}}),t[10]=p,t[11]=s,t[12]=h,t[13]=b):b=t[13];let x;t[14]===b?x=t[15]:(x=(0,$.jsx)(P,{children:b}),t[14]=b,t[15]=x);let S;t[16]!==p||t[17]!==c||t[18]!==h?(S=c??p({id:`16D5Zj`,values:{itemName:h}}),t[16]=p,t[17]=c,t[18]=h,t[19]=S):S=t[19];let C;t[20]===S?C=t[21]:(C=(0,$.jsx)(N,{className:`whitespace-pre-wrap`,children:S}),t[20]=S,t[21]=C);let w;t[22]===l?w=t[23]:(w=l?(0,$.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`delete-confirmation-detail`,children:l}):null,t[22]=l,t[23]=w);let T;t[24]!==x||t[25]!==C||t[26]!==w?(T=(0,$.jsxs)(z,{children:[x,C,w]}),t[24]=x,t[25]=C,t[26]=w,t[27]=T):T=t[27];let E;t[28]===f?E=t[29]:(E=f?(0,$.jsx)(I,{children:f}):null,t[28]=f,t[29]=E);let D;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(i,{id:`dEgA5A`}),t[30]=D):D=t[30];let O;t[31]===r?O=t[32]:(O=(0,$.jsx)(R,{asChild:!0,children:(0,$.jsx)(j,{variant:`outline`,disabled:r,children:D})}),t[31]=r,t[32]=O);let k;t[33]!==_||t[34]!==y||t[35]!==r?(k=r?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(V,{className:`size-4 animate-spin`}),` `,y]}):_,t[33]=_,t[34]=y,t[35]=r,t[36]=k):k=t[36];let A;t[37]!==r||t[38]!==o||t[39]!==k?(A=(0,$.jsx)(j,{variant:`destructive`,onClick:o,disabled:r,children:k}),t[37]=r,t[38]=o,t[39]=k,t[40]=A):A=t[40];let M;t[41]!==O||t[42]!==A?(M=(0,$.jsxs)(L,{children:[O,A]}),t[41]=O,t[42]=A,t[43]=M):M=t[43];let B;return t[44]!==E||t[45]!==M||t[46]!==T?(B=(0,$.jsxs)(F,{children:[T,E,M]}),t[44]=E,t[45]=M,t[46]=T,t[47]=B):B=t[47],B}function Jt(e){return e?se._({id:`wTcjov`}):null}function Yt(e){let t=(0,Z.c)(30),{_:n}=a(),r=Ee(),o=Wt();if(r)return null;let{input:s,installStates:l,dispatch:u}=e,d=s===null,f,p,m,h,g,_,v;if(t[0]!==n||t[1]!==u||t[2]!==s||t[3]!==d||t[4]!==l||t[5]!==o){let e=Jt(d),r;t[13]===l?r=t[14]:(r=e=>l[e.id]?.installed===!0,t[13]=l,t[14]=r);let a=ke.filter(r),y;t[15]===l?y=t[16]:(y=ke.some(e=>l[e.id]?.installed==null),t[15]=l,t[16]=y),m=y;let b=a.length>0,x=o!==null;h=!b&&!x,p=le,t[17]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsxs)(ve,{children:[(0,$.jsx)(U,{"aria-hidden":`true`}),(0,$.jsx)(i,{id:`O7_W_a`})]}),t[17]=v):v=t[17],f=ce,g=x?(0,$.jsxs)(pe,{"aria-label":n({id:`ALhMYW`}),children:[(0,$.jsx)(_e,{children:(0,$.jsx)(i,{id:`ALhMYW`})}),Gt.map(t=>{let{displayName:r}=c[t];return(0,$.jsxs)(X,{onSelect:()=>{s!==null&&o.launchInTerminal(s,t)},disabled:d,"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,$.jsx)(Vt,{id:Kt(t),"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`flex-1`,children:r}),e?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,_=b?(0,$.jsxs)($.Fragment,{children:[x?(0,$.jsx)(ye,{}):null,(0,$.jsxs)(pe,{"aria-label":n({id:`BBqGS9`}),children:[(0,$.jsx)(_e,{children:(0,$.jsx)(i,{id:`BBqGS9`})}),a.map(t=>{let r=!d,{displayName:i}=t,a=n(e?{id:`1ZpfyB`,values:{displayName:i,hint:e}}:{id:`WqLq6M`,values:{displayName:i}});return(0,$.jsxs)(X,{disabled:!r,onSelect:()=>{s&&u(t.id,s)},"data-testid":`file-tree-open-in-${t.id}`,"aria-label":a,children:[(0,$.jsx)(Vt,{id:t.id,"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null,t[0]=n,t[1]=u,t[2]=s,t[3]=d,t[4]=l,t[5]=o,t[6]=f,t[7]=p,t[8]=m,t[9]=h,t[10]=g,t[11]=_,t[12]=v}else f=t[6],p=t[7],m=t[8],h=t[9],g=t[10],_=t[11],v=t[12];let y;t[18]!==m||t[19]!==h?(y=h?(0,$.jsx)(X,{disabled:!0,"data-testid":`file-tree-open-in-empty`,children:m?(0,$.jsx)(i,{id:`EcR0fl`}):(0,$.jsx)(i,{id:`l6OXqI`})}):null,t[18]=m,t[19]=h,t[20]=y):y=t[20];let b;t[21]!==f||t[22]!==g||t[23]!==_||t[24]!==y?(b=(0,$.jsxs)(f,{children:[g,_,y]}),t[21]=f,t[22]=g,t[23]=_,t[24]=y,t[25]=b):b=t[25];let x;return t[26]!==p||t[27]!==v||t[28]!==b?(x=(0,$.jsxs)(p,{children:[v,b]}),t[26]=p,t[27]=v,t[28]=b,t[29]=x):x=t[29],x}function Xt(e){let t=(0,Z.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(en),t=Y(e),n=J(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($t),fetch(`/api/skills`).then(Zt).then(t=>{if(e)return;let n=O.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 Zt(e){if(!e.ok){let t=await e.json().catch(Qt);throw Error(q(t)??`HTTP ${e.status}`)}return e.json()}function Qt(){return null}function $t(e){return e.status===`ready`?e:{status:`loading`}}function en(e){return e+1}function tn(e){let t=(0,Z.c)(16),{skill:n,onOpenChange:r,onDeleted:i}=e,{_:o}=a(),[s,c]=(0,Q.useState)(!1),l;t[0]!==o||t[1]!==i||t[2]!==r?(l=async function(e){c(!0);let t=await ge(e.scope,e.name);if(c(!1),!t.ok){let{error:e}=t;K.error(o({id:`AtBdnD`,values:{error:e}}));return}K.success(o({id:`h9QFb9`,values:{0:e.name}})),i(),r(!1)},t[0]=o,t[1]=i,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,$.jsx)(qt,{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,$.jsx)(B,{open:d,onOpenChange:f,children:p}),t[12]=d,t[13]=f,t[14]=p,t[15]=m):m=t[15],m}function nn(e){let t=(0,Z.c)(68),{skill:n,existingNames:r,onOpenChange:o,onRenamed:s}=e,{_:c}=a(),l=n!==null,u=(0,Q.useId)(),[d,f]=(0,Q.useState)(``),[p,m]=(0,Q.useState)(!1),h;t[0]===n?h=t[1]:(h=()=>{n&&f(n.name)},t[0]=n,t[1]=h);let g=n?.scope,_=n?.name,y;if(t[2]!==g||t[3]!==_?(y=[g,_],t[2]=g,t[3]=_,t[4]=y):y=t[4],(0,Q.useEffect)(h,y),!n)return null;let b,x,S,C;t[5]!==r||t[6]!==d||t[7]!==n.name?(S=d.trim(),C=S===n.name,b=S===``||!v.test(S),x=!b&&!C&&r.has(S),t[5]=r,t[6]=d,t[7]=n.name,t[8]=b,t[9]=x,t[10]=S,t[11]=C):(b=t[8],x=t[9],S=t[10],C=t[11]);let w=x,T=!b&&!w&&!C&&!p,E;t[12]!==c||t[13]!==T||t[14]!==o||t[15]!==s||t[16]!==n||t[17]!==S?(E=async function(){if(!n||!T)return;m(!0);let e=await he({scope:n.scope,fromName:n.name,toName:S});if(m(!1),!e.ok){K.error(c({id:`zKxoPm`,values:{0:n.name,1:e.error}}));return}K.success(c({id:`dUCQo4`,values:{trimmed:S}})),s?.(S),o(!1)},t[12]=c,t[13]=T,t[14]=o,t[15]=s,t[16]=n,t[17]=S,t[18]=E):E=t[18];let D=E,O;t[19]===o?O=t[20]:(O=e=>e?null:o(!1),t[19]=o,t[20]=O);let k;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(P,{children:(0,$.jsx)(i,{id:`dw_3cv`})}),t[21]=k):k=t[21];let A;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsxs)(z,{children:[k,(0,$.jsx)(N,{children:(0,$.jsx)(i,{id:`R9IDFz`})})]}),t[22]=A):A=t[22];let M;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(i,{id:`6YtxFj`}),t[23]=M):M=t[23];let I;t[24]===u?I=t[25]:(I=(0,$.jsx)(be,{htmlFor:u,children:M}),t[24]=u,t[25]=I);let R;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>f(e.target.value),t[26]=R):R=t[26];let V;t[27]===D?V=t[28]:(V=e=>{e.key===`Enter`&&D()},t[27]=D,t[28]=V);let ee=b||w,te=b&&S!==``||w?`${u}-error`:void 0,H;t[29]!==u||t[30]!==d||t[31]!==V||t[32]!==ee||t[33]!==te?(H=(0,$.jsx)(xe,{id:u,value:d,onChange:R,onKeyDown:V,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,"aria-invalid":ee,"aria-describedby":te,className:`font-mono`}),t[29]=u,t[30]=d,t[31]=V,t[32]=ee,t[33]=te,t[34]=H):H=t[34];let ne;t[35]!==w||t[36]!==u||t[37]!==b||t[38]!==S?(ne=b&&S!==``?(0,$.jsx)(`p`,{id:`${u}-error`,className:`text-xs text-destructive`,children:(0,$.jsx)(i,{id:`A50vr3`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}})}):w?(0,$.jsx)(`p`,{id:`${u}-error`,className:`text-xs text-destructive`,children:(0,$.jsx)(i,{id:`YJ1BTp`})}):null,t[35]=w,t[36]=u,t[37]=b,t[38]=S,t[39]=ne):ne=t[39];let re;t[40]!==I||t[41]!==H||t[42]!==ne?(re=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[I,H,ne]}),t[40]=I,t[41]=H,t[42]=ne,t[43]=re):re=t[43];let ie;t[44]===o?ie=t[45]:(ie=()=>o(!1),t[44]=o,t[45]=ie);let ae;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsx)(i,{id:`dEgA5A`}),t[46]=ae):ae=t[46];let U;t[47]!==p||t[48]!==ie?(U=(0,$.jsx)(j,{variant:`ghost`,onClick:ie,disabled:p,children:ae}),t[47]=p,t[48]=ie,t[49]=U):U=t[49];let W;t[50]===D?W=t[51]:(W=()=>void D(),t[50]=D,t[51]=W);let oe=!T,G;t[52]===p?G=t[53]:(G=p?(0,$.jsx)(i,{id:`tHKQ6j`}):(0,$.jsx)(i,{id:`2wxgft`}),t[52]=p,t[53]=G);let q;t[54]!==W||t[55]!==oe||t[56]!==G?(q=(0,$.jsx)(j,{onClick:W,disabled:oe,children:G}),t[54]=W,t[55]=oe,t[56]=G,t[57]=q):q=t[57];let J;t[58]!==U||t[59]!==q?(J=(0,$.jsxs)(L,{children:[U,q]}),t[58]=U,t[59]=q,t[60]=J):J=t[60];let Y;t[61]!==re||t[62]!==J?(Y=(0,$.jsxs)(F,{children:[A,re,J]}),t[61]=re,t[62]=J,t[63]=Y):Y=t[63];let se;return t[64]!==l||t[65]!==Y||t[66]!==O?(se=(0,$.jsx)(B,{open:l,onOpenChange:O,children:Y}),t[64]=l,t[65]=Y,t[66]=O,t[67]=se):se=t[67],se}function rn(e){let t=(0,Z.c)(15),{skill:n,onOpenChange:r,onUpdated:o}=e,{_:s}=a(),[c,l]=(0,Q.useState)(!1),u;t[0]!==s||t[1]!==r||t[2]!==o?(u=async function(e){l(!0);let t=await fe({scope:e.scope,name:e.name});l(!1);let n=te(e.name);if(!t.ok){K.error(s({id:`FRqZ9v`,values:{0:t.error}}));return}K.success(t.checkpointRef?s({id:`My9uXI`,values:{0:t.version,display:n}}):s({id:`mPneVR`,values:{0:t.version,display:n}})),o(),r(!1)},t[0]=s,t[1]=r,t[2]=o,t[3]=u):u=t[3];let d=u,f=n!==null,p;t[4]!==r||t[5]!==c?(p=e=>{!e&&!c&&r(!1)},t[4]=r,t[5]=c,t[6]=p):p=t[6];let m;t[7]!==d||t[8]!==n||t[9]!==c?(m=n?(0,$.jsxs)(F,{className:`sm:max-w-lg`,children:[(0,$.jsxs)(z,{children:[(0,$.jsx)(P,{children:(0,$.jsx)(i,{id:`iAoh55`,values:{0:te(n.name)}})}),(0,$.jsx)(N,{children:n.installedVersion?(0,$.jsx)(i,{id:`47EXvY`,values:{0:n.bundledVersion??``,1:n.installedVersion}}):(0,$.jsx)(i,{id:`nD7Fx9`,values:{0:n.bundledVersion??``}})})]}),(0,$.jsx)(I,{}),(0,$.jsxs)(L,{children:[(0,$.jsx)(R,{asChild:!0,children:(0,$.jsx)(j,{variant:`outline`,disabled:c,children:(0,$.jsx)(i,{id:`dEgA5A`})})}),(0,$.jsx)(j,{onClick:()=>void d(n),disabled:c,children:c?(0,$.jsx)(i,{id:`JL3si7`}):(0,$.jsx)(i,{id:`EkH9pt`})})]})]}):null,t[7]=d,t[8]=n,t[9]=c,t[10]=m):m=t[10];let h;return t[11]!==f||t[12]!==p||t[13]!==m?(h=(0,$.jsx)(B,{open:f,onOpenChange:p,children:m}),t[11]=f,t[12]=p,t[13]=m,t[14]=h):h=t[14],h}function an(){let e=(0,Z.c)(30),{_:t}=a(),[n,r]=(0,Q.useState)(null),[i,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 ue({scope:e.scope,name:e.name,...n?{targets:[...n]}:{}});if(u(null),!r.ok)return K.error(t({id:`Mj8R8K`,values:{0:r.error}})),r;let i=on,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 K.warning(l),r;if(o.length>0){let e=c(`scripts-present`);e&&K.warning(e)}return r.hosts.length===0?K.success(t({id:`0LBDjY`,values:{0:e.name}})):o.length>0&&s.length===0?K.success(t({id:`PPFQ3o`,values:{0:e.name,1:i(o)}})):s.length>0&&o.length===0?K.success(t({id:`OOIVJo`,values:{0:e.name,1:i(s)}})):o.length>0&&s.length>0?K.success(t({id:`OxplNM`,values:{0:e.name,1:i(o),2:i(s)}})):K.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 de({scope:e.scope,name:e.name});return u(null),n.ok?K.success(t({id:`0LBDjY`,values:{0:e.name}})):K.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){K.error(t({id:`UPjaXD`,values:{0:e.name,1:r.error}}));return}K.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,$.jsx)(tn,{skill:n,onOpenChange:_,onDeleted:v}),e[8]=n,e[9]=y);let b=i?.skill??null,x=i?.existingNames??cn,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,$.jsx)(nn,{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,$.jsx)(rn,{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,$.jsxs)($.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 on(e){return e.map(sn).join(`, `)}function sn(e){return x[e]??e}var cn=new Set;function ln(e){let t=(0,Z.c)(19),{skill:n,onEdit:r,onInstall:a,onUninstall:o,onDelete:s}=e,c,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(ae,{"aria-hidden":!0}),l=(0,$.jsx)(i,{id:`ePK91l`}),t[0]=c,t[1]=l):(c=t[0],l=t[1]);let u;t[2]===r?u=t[3]:(u=(0,$.jsxs)(X,{onSelect:r,children:[c,l]}),t[2]=r,t[3]=u);let d;t[4]!==a||t[5]!==n.installed?(d=a&&!n.installed?(0,$.jsxs)(X,{onSelect:a,children:[(0,$.jsx)(Se,{"aria-hidden":!0}),(0,$.jsx)(i,{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,$.jsxs)(X,{onSelect:o,children:[(0,$.jsx)(we,{"aria-hidden":!0}),(0,$.jsx)(i,{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,$.jsx)(H,{"aria-hidden":!0}),m=(0,$.jsx)(i,{id:`cnGeoo`}),t[10]=p,t[11]=m):(p=t[10],m=t[11]);let h;t[12]===s?h=t[13]:(h=(0,$.jsxs)(X,{variant:`destructive`,onSelect:s,children:[p,m]}),t[12]=s,t[13]=h);let g;return t[14]!==u||t[15]!==d||t[16]!==f||t[17]!==h?(g=(0,$.jsxs)($.Fragment,{children:[u,d,f,h]}),t[14]=u,t[15]=d,t[16]=f,t[17]=h,t[18]=g):g=t[18],g}function un(e){let t=(0,Z.c)(65),{skill:n,actions:r,existingNames:o}=e,{_:s}=a(),c=Ae(),l=Pt().states,{dispatch:u}=Ct(),d=typeof window<`u`?window.okDesktop:void 0,f=n.absolutePath,p;t[0]===s?p=t[1]:(p=async function(e){try{await Rt(e),K.success(s({id:`SXCSQd`}))}catch{K.error(s({id:`cRHuuI`}))}},t[0]=s,t[1]=p);let m=p,h;t[2]===f?h=t[3]:(h=d&&f?(0,$.jsxs)(X,{onSelect:()=>void d.shell.showItemInFolder(f),children:[(0,$.jsx)(ee,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`LtSYdi`})]}):null,t[2]=f,t[3]=h);let g;t[4]!==n.name||t[5]!==n.scope||t[6]!==c?(g=ut({skillName:n.name,scope:n.scope,workspace:c}),t[4]=n.name,t[5]=n.scope,t[6]=c,t[7]=g):g=t[7];let _;t[8]!==u||t[9]!==l||t[10]!==g?(_=(0,$.jsx)(Yt,{input:g,installStates:l,isElectronHost:d!=null,dispatch:u}),t[8]=u,t[9]=l,t[10]=g,t[11]=_):_=t[11];let v;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsxs)(ve,{children:[(0,$.jsx)(ie,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`zd00pH`})]}),t[12]=v):v=t[12];let y;t[13]!==f||t[14]!==m?(y=f?(0,$.jsx)(X,{onSelect:()=>void m(f),children:(0,$.jsx)(i,{id:`z2funE`})}):null,t[13]=f,t[14]=m,t[15]=y):y=t[15];let b;t[16]!==m||t[17]!==n.path?(b=()=>void m(n.path),t[16]=m,t[17]=n.path,t[18]=b):b=t[18];let x;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(i,{id:`xloBjn`}),t[19]=x):x=t[19];let S;t[20]===b?S=t[21]:(S=(0,$.jsx)(X,{onSelect:b,children:x}),t[20]=b,t[21]=S);let C;t[22]!==y||t[23]!==S?(C=(0,$.jsxs)(le,{children:[v,(0,$.jsxs)(ce,{children:[y,S]})]}),t[22]=y,t[23]=S,t[24]=C):C=t[24];let w;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(ye,{}),t[25]=w):w=t[25];let T;t[26]!==r||t[27]!==o||t[28]!==n?(T=()=>void r.duplicate(n,o),t[26]=r,t[27]=o,t[28]=n,t[29]=T):T=t[29];let E,D;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(ne,{"aria-hidden":!0}),D=(0,$.jsx)(i,{id:`euc6Ns`}),t[30]=E,t[31]=D):(E=t[30],D=t[31]);let O;t[32]===T?O=t[33]:(O=(0,$.jsxs)(X,{onSelect:T,children:[E,D]}),t[32]=T,t[33]=O);let k;t[34]!==r||t[35]!==o||t[36]!==n?(k=()=>r.requestRename(n,o),t[34]=r,t[35]=o,t[36]=n,t[37]=k):k=t[37];let A,j;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(Ce,{"aria-hidden":!0}),j=(0,$.jsx)(i,{id:`2wxgft`}),t[38]=A,t[39]=j):(A=t[38],j=t[39]);let M;t[40]===k?M=t[41]:(M=(0,$.jsxs)(X,{onSelect:k,children:[A,j]}),t[40]=k,t[41]=M);let N;t[42]!==r||t[43]!==n?(N=n.updateAvailable?(0,$.jsxs)(X,{onSelect:()=>r.requestUpdate(n),children:[(0,$.jsx)(Te,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`6g2jsp`})]}):null,t[42]=r,t[43]=n,t[44]=N):N=t[44];let P;t[45]!==r||t[46]!==n?(P=n.installed?(0,$.jsxs)(X,{onSelect:()=>void r.uninstall(n),children:[(0,$.jsx)(we,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`fo0VXg`})]}):(0,$.jsxs)(X,{onSelect:()=>void r.install(n),children:[(0,$.jsx)(Se,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`TKQ7K-`})]}),t[45]=r,t[46]=n,t[47]=P):P=t[47];let F;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(ye,{}),t[48]=F):F=t[48];let I;t[49]!==r||t[50]!==n?(I=()=>r.requestDelete(n),t[49]=r,t[50]=n,t[51]=I):I=t[51];let L,R;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,$.jsx)(H,{"aria-hidden":!0}),R=(0,$.jsx)(i,{id:`cnGeoo`}),t[52]=L,t[53]=R):(L=t[52],R=t[53]);let z;t[54]===I?z=t[55]:(z=(0,$.jsxs)(X,{variant:`destructive`,onSelect:I,children:[L,R]}),t[54]=I,t[55]=z);let B;return t[56]!==C||t[57]!==O||t[58]!==M||t[59]!==h||t[60]!==N||t[61]!==P||t[62]!==z||t[63]!==_?(B=(0,$.jsxs)($.Fragment,{children:[h,_,C,w,O,M,N,P,F,z]}),t[56]=C,t[57]=O,t[58]=M,t[59]=h,t[60]=N,t[61]=P,t[62]=z,t[63]=_,t[64]=B):B=t[64],B}export{Te as A,ct as C,Ae as D,rt as E,ke as O,bt as S,it as T,lt as _,Yt as a,ut as b,Kt as c,Vt as d,It as f,st as g,dt as h,Xt as i,Se as j,Ee as k,Ut as l,Pt as m,un as n,qt as o,Rt as p,an as r,Gt as s,ln as t,Wt as u,at as v,Ct as w,vt as x,ot as y};
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{n as i,r as a}from"./dist-CQw2y-s3.js";import{$t as o,Bt as s,Ct as c,J as l,Ki as u,Lt as d,Mt as f,Or as p,Qt as m,Zt as h,dn as g,en as _,ft as v,in as y,jt as b,k as x,n as S,nn as C,rn as w,t as T,tn as E,wt as D,xt as O,zt as k}from"./dist-BRGUidv4.js";import{l as A,t as j,u as M}from"./button-DGf25ccp.js";import{a as N,c as P,i as F,n as I,o as L,r as R,s as z,t as B}from"./dialog-CIq9aQLf.js";import{d as V,f as ee,i as te,l as H,m as ne,n as re,p as ie,u as ae}from"./config-context-DhhN0rlf.js";import{a as U,i as W,n as oe,t as G}from"./cursor-CpjEfgnv.js";import{n as K}from"./dist-KBKQayVB.js";import{l as q,o as J,s as Y,u as se}from"./documents-events-DA8Q5ICz.js";import{C as ce,S as le,_ as X,a as ue,d as de,f as fe,g as pe,n as me,s as he,t as ge,v as _e,w as ve,x as ye}from"./skills-api-ts3L80AV.js";import{t as be}from"./label-DyT4OD9H.js";import{t as xe}from"./input-DkQ8Zmzd.js";var Se=M(`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`}]]),Ce=M(`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`}]]),we=M(`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`}]]),Te=M(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Z=r(),Q=e(t(),1);function Ee(){let[e]=(0,Q.useState)(De);return e}function De(){return g()!=null}var Oe=[{id:`claude-cowork`,displayName:`Claude Cowork`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,tagline:`Conversational pairing in Claude Desktop's Cowork tab.`},{id:`claude-code`,displayName:`Claude`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,tagline:`Agentic coding in Claude Desktop's Code tab.`},{id:`codex`,displayName:`Codex`,appBrandName:`Codex Desktop`,schemes:[`codex:`],installUrl:`https://openai.com/codex`,tagline:`OpenAI's coding agent, terminal-native.`},{id:`cursor`,displayName:`Cursor`,schemes:[`cursor:`],installUrl:`https://cursor.com/`,tagline:`AI-first VS Code fork with multi-file edits.`},{id:`opencode`,displayName:`OpenCode`,schemes:[],installUrl:`https://opencode.ai`,tagline:`Open-source terminal coding agent; bring any local model.`}],ke=Oe.filter(e=>e.id!==`claude-cowork`&&e.id!==`opencode`),$=n();function Ae(){let e=(0,Z.c)(3),[t,n]=(0,Q.useState)(Ne),r,i;return e[0]===t?(r=e[1],i=e[2]):(r=()=>{if(t!==null||window.okDesktop)return;let e=!0;return fetch(`/api/workspace`).then(async t=>{let r=await t.json().catch(Me);if(!e||!t.ok)return;let i=b.safeParse(r);i.success&&n({contentDir:i.data.contentDir,pathSeparator:i.data.pathSeparator})}).catch(je),()=>{e=!1}},i=[t],e[0]=t,e[1]=r,e[2]=i),(0,Q.useEffect)(r,i),t}function je(e){console.warn(`[useWorkspace] /api/workspace fetch failed:`,e)}function Me(){return null}function Ne(){return Pe()}function Pe(e=typeof window>`u`?void 0:window){if(!e)return null;let t=e.okDesktop;return t?{contentDir:t.config.projectPath,pathSeparator:t.platform===`win32`?`\\`:`/`}:null}function Fe(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 Ie(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=q(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 Le(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?Fe(e):Ie()}var Re=`ok:skill:cowork:installed`,ze=`1`,Be=250,Ve=`/api/skill/install-state`;function He(e){return`${Re}:v${e}`}var Ue=new Map;async function We(e={},t={}){let n=t.force?`__force__`:`__default__`,r=Ue.get(n);if(r)return r;let i=Ge(e,t);return Ue.set(n,i),i.finally(()=>{Ue.get(n)===i&&Ue.delete(n)}),i}async function Ge(e,t){let n=e.installer===void 0?Le():e.installer,r=Ke(e.storage),i=e.fetchSnapshot??Je,a=e.serverTimeoutMs??Be,o=null;if(!t.force){try{o=await Ye(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=He(o?.currentVersion??e.fallbackSkillVersion??qe());if(!t.force&&r?.getItem(s)===ze)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,ze)}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 Ke(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function qe(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function Je(){let e;try{e=await fetch(Ve,{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 Ye(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function Xe(e){return We({},e)}function Ze(){return We({},{force:!0})}async function Qe(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 $e(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return Qe({target:`claude-cowork`,url:d({mode:`cowork`},e)},n);case`claude-code`:return Qe({target:`claude-code`,url:d({mode:`code`},e)},n);case`codex`:return Qe({target:`codex`,url:k(e)},n);case`cursor`:return Qe({target:`cursor`,url:s(e),workspacePath:e.projectDir},n);case`opencode`:return{ok:!1,reason:`invalid-payload`,detail:`opencode is terminal-only; launch via requestTerminalLaunch`};default:{let t=e.target;return{ok:!1,reason:`invalid-payload`,detail:`unknown target: ${String(t)}`}}}}async function et(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.openExternal)try{return await n.shell.openExternal(e),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:tt(e)}}let r=t.doc??(typeof document<`u`?document:void 0);if(!r)return{ok:!1,reason:`dispatch-error`,detail:`no DOM available`};try{let t=r.createElement(`a`);return t.href=e,t.rel=`noopener noreferrer`,/^https?:/i.test(e)&&(t.target=`_blank`),r.body.appendChild(t),t.click(),t.remove(),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:tt(e)}}}function tt(e){if(e instanceof Error)return e.message;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}async function nt(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)}`)}}function rt(e,t,n){let r=n===`\\`?t.replaceAll(`/`,`\\`):t;return`${e.endsWith(n)?e.slice(0,-1):e}${n}${r}`}function it(e){return`${e}.md`}function at(e){if(!e.docName||!e.workspace)return null;let t=it(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:{relativePath:t},projectDir:n,docPath:rt(n,t,r)}}function ot(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function st(e){return e.workspace?.contentDir?{docContext:null,createDescription:e.description,createScenario:e.scenario,createMentions:e.mentions,projectDir:e.workspace.contentDir,docPath:``}:null}function ct(e){return et(e.installUrl).then(()=>void 0)}function lt(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function ut(e){return!e.workspace?.contentDir||!e.skillName?null:{docContext:null,skill:{name:e.skillName,scope:e.scope},projectDir:e.workspace.contentDir,docPath:``}}function dt(e){if(!e.workspace?.contentDir)return null;let{contentDir:t,pathSeparator:n}=e.workspace;if(e.docName){let r=it(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:rt(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 ft(e){return`Opened in ${e}.`}function pt(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 mt(e){return e>=3?null:e===2?`Try one more time`:`Retry`}function ht(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 gt(e,t,n){if(e.scope===`doc`){let r={scope:`doc`,docRelativePath:e.docRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n};return e.selection===void 0?r:{...r,selection:e.selection}}return e.scope===`folder`?{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n}:{scope:`project`,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n}}function _t(e,t,n){return e.compose?f(gt(e.compose,t,n)):e.selection?C({...e.selection,target:t}):e.skill?w(e.skill.name,e.skill.scope,n):e.ask?h(e.ask.relativePath,e.ask.instruction,n,t):p(e.docContext===null?e.folderRelativePath?E(e.folderRelativePath,n,e.instruction):e.createDescription===void 0?o(n,e.instruction):m(e.createDescription,n,e.createScenario??`new-project`,e.createMentions??[]):_(e.docContext.relativePath,n,e.instruction))}function vt(e,t){let n=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||n?`${l} ${_t(e,c[t].handoffTarget,!1)}`:y(e.docContext?.relativePath??null)}async function yt(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:_t(t,e,n.autoOpen)},a=await n.dispatchHandoff(i),o=n.isElectronHost()?`electron`:`web`,s=n.now().toISOString(),c=t.compose,l=ht(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(ft(u));else{let i=mt(r),a=pt(u,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{yt(e,t,n,r+1)}}})}return a}function bt(e){return Oe.find(t=>t.id===e)?.displayName??e}function xt(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function St(){return{dispatchHandoff:$e,recordHandoff:nt,toast:{success:e=>{K.success(e)},error:(e,t)=>{K.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>xt(),getDisplayName:bt,ensureCoworkSkillInstalled:Xe,autoOpen:!0}}function Ct(){let e=(0,Z.c)(2),{merged:t}=re(),n=t?.appearance?.preview?.autoOpen??!0,r;return e[0]===n?r=e[1]:(r={dispatch:(e,t)=>yt(e,t,{...St(),autoOpen:n}),reinstallCoworkSkill:Ze},e[0]=n,e[1]=r),r}var wt=[...new Set(Oe.flatMap(e=>e.schemes))];function Tt(e,t){let n=t.now?.()??Date.now(),r={};for(let t of Oe){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 Et(e){return Tt({},e)}async function Dt(e){let t=e.schemes??wt,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 Ot=Object.fromEntries(wt.map(e=>[e,{installed:!1}]));async function kt(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 Ot}if(!t.ok)return Ot;let n;try{n=await t.json()}catch{return Ot}if(typeof n!=`object`||!n||Array.isArray(n))return Ot;let r=n,i={};for(let e of wt)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function At(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 jt(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Et({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=Tt(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=!At(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 Mt(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Nt(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>Dt({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>kt({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Pt(){let e=(0,Z.c)(5),[t,n]=(0,Q.useState)(Ft),r=(0,Q.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=jt(Nt());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 Ft(){return Et({isElectronHost:Mt(),now:Date.now})}function It(e){return!(e instanceof Error)||e.name!==`NotAllowedError`?!1:/permission denied|permissions policy/i.test(e.message)}function Lt(e){let t=globalThis.document;if(!t?.body||typeof t.createElement!=`function`||typeof t.execCommand!=`function`)return!1;let n=t.createElement(`textarea`);n.value=e,n.style.position=`fixed`,n.style.opacity=`0`,n.style.pointerEvents=`none`,n.setAttribute(`readonly`,``),t.body.appendChild(n);try{return n.focus(),n.select(),t.execCommand(`copy`)}catch{return!1}finally{n.remove()}}async function Rt(e){let t=globalThis.okDesktop?.clipboard;if(t&&typeof t.writeText==`function`){await t.writeText(e);return}let n=globalThis.navigator?.clipboard;if(n&&typeof n.writeText==`function`)try{await n.writeText(e);return}catch(t){if(Lt(e))return;throw t}if(!Lt(e))throw Error(`clipboard API unavailable`)}function zt(e){let t=(0,Z.c)(5),n,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`title`,{children:`OpenCode icon`}),r=(0,$.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M384 416H128V96H384V416ZM320 160H192V352H320V160Z`}),i=(0,$.jsx)(`path`,{fill:`currentColor`,fillOpacity:.55,d:`M320 224V352H192V224H320Z`}),t[0]=n,t[1]=r,t[2]=i):(n=t[0],r=t[1],i=t[2]);let a;return t[3]===e?a=t[4]:(a=(0,$.jsxs)(`svg`,{role:`img`,"aria-label":`OpenCode icon`,xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,fill:`none`,viewBox:`0 0 512 512`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}var Bt={"claude-cowork":`claude`,"claude-code":`claude`,codex:`openai`,cursor:`cursor`,opencode:`opencode`};function Vt(e){let t=(0,Z.c)(27),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({id:r,style:a,className:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let{resolvedTheme:o}=u(),s=Bt[r],c=s?(o===`dark`?S[s]:void 0)??T[s]:void 0,l;t[5]!==c||t[6]!==a?(l=c?{...a,"--ok-brand-color":c}:a,t[5]=c,t[6]=a,t[7]=l):l=t[7];let d=l,f=c&&`[&_*]:![color:var(--ok-brand-color)]`,p;t[8]!==n||t[9]!==f?(p=A(f,n),t[8]=n,t[9]=f,t[10]=p):p=t[10];let m=p;if(r===`claude-cowork`||r===`claude-code`){let e;return t[11]!==m||t[12]!==d||t[13]!==i?(e=(0,$.jsx)(W,{style:d,className:m,...i}),t[11]=m,t[12]=d,t[13]=i,t[14]=e):e=t[14],e}if(r===`codex`){let e;return t[15]!==m||t[16]!==d||t[17]!==i?(e=(0,$.jsx)(oe,{style:d,className:m,...i}),t[15]=m,t[16]=d,t[17]=i,t[18]=e):e=t[18],e}if(r===`cursor`){let e;return t[19]!==m||t[20]!==d||t[21]!==i?(e=(0,$.jsx)(G,{style:d,className:m,...i}),t[19]=m,t[20]=d,t[21]=i,t[22]=e):e=t[22],e}if(r===`opencode`){let e;return t[23]!==m||t[24]!==d||t[25]!==i?(e=(0,$.jsx)(zt,{style:d,className:m,...i}),t[23]=m,t[24]=d,t[25]=i,t[26]=e):e=t[26],e}return null}var Ht=(0,Q.createContext)(null);function Ut(e){let t=(0,Z.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,$.jsx)(Ht,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Wt(){return(0,Q.use)(Ht)}var Gt=D;function Kt(e){return c[e].handoffTarget}function qt(e){let t=(0,Z.c)(48),{itemName:n,isSubmitting:r,onDelete:o,customTitle:s,customDescription:c,customDetail:l,customConfirmLabel:u,customConfirmLabelBusy:d,children:f}=e,{_:p}=a(),m;t[0]!==p||t[1]!==n?(m=n??p({id:`L3CEC1`}),t[0]=p,t[1]=n,t[2]=m):m=t[2];let h=m,g;t[3]!==p||t[4]!==u?(g=u??p({id:`cnGeoo`}),t[3]=p,t[4]=u,t[5]=g):g=t[5];let _=g,v;t[6]!==p||t[7]!==u||t[8]!==d?(v=d??u??p({id:`s3caR3`}),t[6]=p,t[7]=u,t[8]=d,t[9]=v):v=t[9];let y=v,b;t[10]!==p||t[11]!==s||t[12]!==h?(b=s??p({id:`77SdEP`,values:{itemName:h}}),t[10]=p,t[11]=s,t[12]=h,t[13]=b):b=t[13];let x;t[14]===b?x=t[15]:(x=(0,$.jsx)(P,{children:b}),t[14]=b,t[15]=x);let S;t[16]!==p||t[17]!==c||t[18]!==h?(S=c??p({id:`16D5Zj`,values:{itemName:h}}),t[16]=p,t[17]=c,t[18]=h,t[19]=S):S=t[19];let C;t[20]===S?C=t[21]:(C=(0,$.jsx)(N,{className:`whitespace-pre-wrap`,children:S}),t[20]=S,t[21]=C);let w;t[22]===l?w=t[23]:(w=l?(0,$.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`delete-confirmation-detail`,children:l}):null,t[22]=l,t[23]=w);let T;t[24]!==x||t[25]!==C||t[26]!==w?(T=(0,$.jsxs)(z,{children:[x,C,w]}),t[24]=x,t[25]=C,t[26]=w,t[27]=T):T=t[27];let E;t[28]===f?E=t[29]:(E=f?(0,$.jsx)(I,{children:f}):null,t[28]=f,t[29]=E);let D;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(i,{id:`dEgA5A`}),t[30]=D):D=t[30];let O;t[31]===r?O=t[32]:(O=(0,$.jsx)(R,{asChild:!0,children:(0,$.jsx)(j,{variant:`outline`,disabled:r,children:D})}),t[31]=r,t[32]=O);let k;t[33]!==_||t[34]!==y||t[35]!==r?(k=r?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(V,{className:`size-4 animate-spin`}),` `,y]}):_,t[33]=_,t[34]=y,t[35]=r,t[36]=k):k=t[36];let A;t[37]!==r||t[38]!==o||t[39]!==k?(A=(0,$.jsx)(j,{variant:`destructive`,onClick:o,disabled:r,children:k}),t[37]=r,t[38]=o,t[39]=k,t[40]=A):A=t[40];let M;t[41]!==O||t[42]!==A?(M=(0,$.jsxs)(L,{children:[O,A]}),t[41]=O,t[42]=A,t[43]=M):M=t[43];let B;return t[44]!==E||t[45]!==M||t[46]!==T?(B=(0,$.jsxs)(F,{children:[T,E,M]}),t[44]=E,t[45]=M,t[46]=T,t[47]=B):B=t[47],B}function Jt(e){return e?se._({id:`wTcjov`}):null}function Yt(e){let t=(0,Z.c)(30),{_:n}=a(),r=Ee(),o=Wt();if(r)return null;let{input:s,installStates:l,dispatch:u}=e,d=s===null,f,p,m,h,g,_,v;if(t[0]!==n||t[1]!==u||t[2]!==s||t[3]!==d||t[4]!==l||t[5]!==o){let e=Jt(d),r;t[13]===l?r=t[14]:(r=e=>l[e.id]?.installed===!0,t[13]=l,t[14]=r);let a=ke.filter(r),y;t[15]===l?y=t[16]:(y=ke.some(e=>l[e.id]?.installed==null),t[15]=l,t[16]=y),m=y;let b=a.length>0,x=o!==null;h=!b&&!x,p=le,t[17]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsxs)(ve,{children:[(0,$.jsx)(U,{"aria-hidden":`true`}),(0,$.jsx)(i,{id:`O7_W_a`})]}),t[17]=v):v=t[17],f=ce,g=x?(0,$.jsxs)(pe,{"aria-label":n({id:`ALhMYW`}),children:[(0,$.jsx)(_e,{children:(0,$.jsx)(i,{id:`ALhMYW`})}),Gt.map(t=>{let{displayName:r}=c[t];return(0,$.jsxs)(X,{onSelect:()=>{s!==null&&o.launchInTerminal(s,t)},disabled:d,"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,$.jsx)(Vt,{id:Kt(t),"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`flex-1`,children:r}),e?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,_=b?(0,$.jsxs)($.Fragment,{children:[x?(0,$.jsx)(ye,{}):null,(0,$.jsxs)(pe,{"aria-label":n({id:`BBqGS9`}),children:[(0,$.jsx)(_e,{children:(0,$.jsx)(i,{id:`BBqGS9`})}),a.map(t=>{let r=!d,{displayName:i}=t,a=n(e?{id:`1ZpfyB`,values:{displayName:i,hint:e}}:{id:`WqLq6M`,values:{displayName:i}});return(0,$.jsxs)(X,{disabled:!r,onSelect:()=>{s&&u(t.id,s)},"data-testid":`file-tree-open-in-${t.id}`,"aria-label":a,children:[(0,$.jsx)(Vt,{id:t.id,"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null,t[0]=n,t[1]=u,t[2]=s,t[3]=d,t[4]=l,t[5]=o,t[6]=f,t[7]=p,t[8]=m,t[9]=h,t[10]=g,t[11]=_,t[12]=v}else f=t[6],p=t[7],m=t[8],h=t[9],g=t[10],_=t[11],v=t[12];let y;t[18]!==m||t[19]!==h?(y=h?(0,$.jsx)(X,{disabled:!0,"data-testid":`file-tree-open-in-empty`,children:m?(0,$.jsx)(i,{id:`EcR0fl`}):(0,$.jsx)(i,{id:`l6OXqI`})}):null,t[18]=m,t[19]=h,t[20]=y):y=t[20];let b;t[21]!==f||t[22]!==g||t[23]!==_||t[24]!==y?(b=(0,$.jsxs)(f,{children:[g,_,y]}),t[21]=f,t[22]=g,t[23]=_,t[24]=y,t[25]=b):b=t[25];let x;return t[26]!==p||t[27]!==v||t[28]!==b?(x=(0,$.jsxs)(p,{children:[v,b]}),t[26]=p,t[27]=v,t[28]=b,t[29]=x):x=t[29],x}function Xt(e){let t=(0,Z.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(en),t=Y(e),n=J(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($t),fetch(`/api/skills`).then(Zt).then(t=>{if(e)return;let n=O.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 Zt(e){if(!e.ok){let t=await e.json().catch(Qt);throw Error(q(t)??`HTTP ${e.status}`)}return e.json()}function Qt(){return null}function $t(e){return e.status===`ready`?e:{status:`loading`}}function en(e){return e+1}function tn(e){let t=(0,Z.c)(16),{skill:n,onOpenChange:r,onDeleted:i}=e,{_:o}=a(),[s,c]=(0,Q.useState)(!1),l;t[0]!==o||t[1]!==i||t[2]!==r?(l=async function(e){c(!0);let t=await ge(e.scope,e.name);if(c(!1),!t.ok){let{error:e}=t;K.error(o({id:`AtBdnD`,values:{error:e}}));return}K.success(o({id:`h9QFb9`,values:{0:e.name}})),i(),r(!1)},t[0]=o,t[1]=i,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,$.jsx)(qt,{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,$.jsx)(B,{open:d,onOpenChange:f,children:p}),t[12]=d,t[13]=f,t[14]=p,t[15]=m):m=t[15],m}function nn(e){let t=(0,Z.c)(68),{skill:n,existingNames:r,onOpenChange:o,onRenamed:s}=e,{_:c}=a(),l=n!==null,u=(0,Q.useId)(),[d,f]=(0,Q.useState)(``),[p,m]=(0,Q.useState)(!1),h;t[0]===n?h=t[1]:(h=()=>{n&&f(n.name)},t[0]=n,t[1]=h);let g=n?.scope,_=n?.name,y;if(t[2]!==g||t[3]!==_?(y=[g,_],t[2]=g,t[3]=_,t[4]=y):y=t[4],(0,Q.useEffect)(h,y),!n)return null;let b,x,S,C;t[5]!==r||t[6]!==d||t[7]!==n.name?(S=d.trim(),C=S===n.name,b=S===``||!v.test(S),x=!b&&!C&&r.has(S),t[5]=r,t[6]=d,t[7]=n.name,t[8]=b,t[9]=x,t[10]=S,t[11]=C):(b=t[8],x=t[9],S=t[10],C=t[11]);let w=x,T=!b&&!w&&!C&&!p,E;t[12]!==c||t[13]!==T||t[14]!==o||t[15]!==s||t[16]!==n||t[17]!==S?(E=async function(){if(!n||!T)return;m(!0);let e=await he({scope:n.scope,fromName:n.name,toName:S});if(m(!1),!e.ok){K.error(c({id:`zKxoPm`,values:{0:n.name,1:e.error}}));return}K.success(c({id:`dUCQo4`,values:{trimmed:S}})),s?.(S),o(!1)},t[12]=c,t[13]=T,t[14]=o,t[15]=s,t[16]=n,t[17]=S,t[18]=E):E=t[18];let D=E,O;t[19]===o?O=t[20]:(O=e=>e?null:o(!1),t[19]=o,t[20]=O);let k;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(P,{children:(0,$.jsx)(i,{id:`dw_3cv`})}),t[21]=k):k=t[21];let A;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsxs)(z,{children:[k,(0,$.jsx)(N,{children:(0,$.jsx)(i,{id:`R9IDFz`})})]}),t[22]=A):A=t[22];let M;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(i,{id:`6YtxFj`}),t[23]=M):M=t[23];let I;t[24]===u?I=t[25]:(I=(0,$.jsx)(be,{htmlFor:u,children:M}),t[24]=u,t[25]=I);let R;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>f(e.target.value),t[26]=R):R=t[26];let V;t[27]===D?V=t[28]:(V=e=>{e.key===`Enter`&&D()},t[27]=D,t[28]=V);let ee=b||w,te=b&&S!==``||w?`${u}-error`:void 0,H;t[29]!==u||t[30]!==d||t[31]!==V||t[32]!==ee||t[33]!==te?(H=(0,$.jsx)(xe,{id:u,value:d,onChange:R,onKeyDown:V,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,"aria-invalid":ee,"aria-describedby":te,className:`font-mono`}),t[29]=u,t[30]=d,t[31]=V,t[32]=ee,t[33]=te,t[34]=H):H=t[34];let ne;t[35]!==w||t[36]!==u||t[37]!==b||t[38]!==S?(ne=b&&S!==``?(0,$.jsx)(`p`,{id:`${u}-error`,className:`text-xs text-destructive`,children:(0,$.jsx)(i,{id:`A50vr3`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}})}):w?(0,$.jsx)(`p`,{id:`${u}-error`,className:`text-xs text-destructive`,children:(0,$.jsx)(i,{id:`YJ1BTp`})}):null,t[35]=w,t[36]=u,t[37]=b,t[38]=S,t[39]=ne):ne=t[39];let re;t[40]!==I||t[41]!==H||t[42]!==ne?(re=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[I,H,ne]}),t[40]=I,t[41]=H,t[42]=ne,t[43]=re):re=t[43];let ie;t[44]===o?ie=t[45]:(ie=()=>o(!1),t[44]=o,t[45]=ie);let ae;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsx)(i,{id:`dEgA5A`}),t[46]=ae):ae=t[46];let U;t[47]!==p||t[48]!==ie?(U=(0,$.jsx)(j,{variant:`ghost`,onClick:ie,disabled:p,children:ae}),t[47]=p,t[48]=ie,t[49]=U):U=t[49];let W;t[50]===D?W=t[51]:(W=()=>void D(),t[50]=D,t[51]=W);let oe=!T,G;t[52]===p?G=t[53]:(G=p?(0,$.jsx)(i,{id:`tHKQ6j`}):(0,$.jsx)(i,{id:`2wxgft`}),t[52]=p,t[53]=G);let q;t[54]!==W||t[55]!==oe||t[56]!==G?(q=(0,$.jsx)(j,{onClick:W,disabled:oe,children:G}),t[54]=W,t[55]=oe,t[56]=G,t[57]=q):q=t[57];let J;t[58]!==U||t[59]!==q?(J=(0,$.jsxs)(L,{children:[U,q]}),t[58]=U,t[59]=q,t[60]=J):J=t[60];let Y;t[61]!==re||t[62]!==J?(Y=(0,$.jsxs)(F,{children:[A,re,J]}),t[61]=re,t[62]=J,t[63]=Y):Y=t[63];let se;return t[64]!==l||t[65]!==Y||t[66]!==O?(se=(0,$.jsx)(B,{open:l,onOpenChange:O,children:Y}),t[64]=l,t[65]=Y,t[66]=O,t[67]=se):se=t[67],se}function rn(e){let t=(0,Z.c)(15),{skill:n,onOpenChange:r,onUpdated:o}=e,{_:s}=a(),[c,l]=(0,Q.useState)(!1),u;t[0]!==s||t[1]!==r||t[2]!==o?(u=async function(e){l(!0);let t=await fe({scope:e.scope,name:e.name});l(!1);let n=te(e.name);if(!t.ok){K.error(s({id:`FRqZ9v`,values:{0:t.error}}));return}K.success(t.checkpointRef?s({id:`My9uXI`,values:{0:t.version,display:n}}):s({id:`mPneVR`,values:{0:t.version,display:n}})),o(),r(!1)},t[0]=s,t[1]=r,t[2]=o,t[3]=u):u=t[3];let d=u,f=n!==null,p;t[4]!==r||t[5]!==c?(p=e=>{!e&&!c&&r(!1)},t[4]=r,t[5]=c,t[6]=p):p=t[6];let m;t[7]!==d||t[8]!==n||t[9]!==c?(m=n?(0,$.jsxs)(F,{className:`sm:max-w-lg`,children:[(0,$.jsxs)(z,{children:[(0,$.jsx)(P,{children:(0,$.jsx)(i,{id:`iAoh55`,values:{0:te(n.name)}})}),(0,$.jsx)(N,{children:n.installedVersion?(0,$.jsx)(i,{id:`47EXvY`,values:{0:n.bundledVersion??``,1:n.installedVersion}}):(0,$.jsx)(i,{id:`nD7Fx9`,values:{0:n.bundledVersion??``}})})]}),(0,$.jsx)(I,{}),(0,$.jsxs)(L,{children:[(0,$.jsx)(R,{asChild:!0,children:(0,$.jsx)(j,{variant:`outline`,disabled:c,children:(0,$.jsx)(i,{id:`dEgA5A`})})}),(0,$.jsx)(j,{onClick:()=>void d(n),disabled:c,children:c?(0,$.jsx)(i,{id:`JL3si7`}):(0,$.jsx)(i,{id:`EkH9pt`})})]})]}):null,t[7]=d,t[8]=n,t[9]=c,t[10]=m):m=t[10];let h;return t[11]!==f||t[12]!==p||t[13]!==m?(h=(0,$.jsx)(B,{open:f,onOpenChange:p,children:m}),t[11]=f,t[12]=p,t[13]=m,t[14]=h):h=t[14],h}function an(){let e=(0,Z.c)(30),{_:t}=a(),[n,r]=(0,Q.useState)(null),[i,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 ue({scope:e.scope,name:e.name,...n?{targets:[...n]}:{}});if(u(null),!r.ok)return K.error(t({id:`Mj8R8K`,values:{0:r.error}})),r;let i=on,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 K.warning(l),r;if(o.length>0){let e=c(`scripts-present`);e&&K.warning(e)}return r.hosts.length===0?K.success(t({id:`0LBDjY`,values:{0:e.name}})):o.length>0&&s.length===0?K.success(t({id:`PPFQ3o`,values:{0:e.name,1:i(o)}})):s.length>0&&o.length===0?K.success(t({id:`OOIVJo`,values:{0:e.name,1:i(s)}})):o.length>0&&s.length>0?K.success(t({id:`OxplNM`,values:{0:e.name,1:i(o),2:i(s)}})):K.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 de({scope:e.scope,name:e.name});return u(null),n.ok?K.success(t({id:`0LBDjY`,values:{0:e.name}})):K.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){K.error(t({id:`UPjaXD`,values:{0:e.name,1:r.error}}));return}K.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,$.jsx)(tn,{skill:n,onOpenChange:_,onDeleted:v}),e[8]=n,e[9]=y);let b=i?.skill??null,x=i?.existingNames??cn,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,$.jsx)(nn,{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,$.jsx)(rn,{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,$.jsxs)($.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 on(e){return e.map(sn).join(`, `)}function sn(e){return x[e]??e}var cn=new Set;function ln(e){let t=(0,Z.c)(19),{skill:n,onEdit:r,onInstall:a,onUninstall:o,onDelete:s}=e,c,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(ae,{"aria-hidden":!0}),l=(0,$.jsx)(i,{id:`ePK91l`}),t[0]=c,t[1]=l):(c=t[0],l=t[1]);let u;t[2]===r?u=t[3]:(u=(0,$.jsxs)(X,{onSelect:r,children:[c,l]}),t[2]=r,t[3]=u);let d;t[4]!==a||t[5]!==n.installed?(d=a&&!n.installed?(0,$.jsxs)(X,{onSelect:a,children:[(0,$.jsx)(Se,{"aria-hidden":!0}),(0,$.jsx)(i,{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,$.jsxs)(X,{onSelect:o,children:[(0,$.jsx)(we,{"aria-hidden":!0}),(0,$.jsx)(i,{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,$.jsx)(H,{"aria-hidden":!0}),m=(0,$.jsx)(i,{id:`cnGeoo`}),t[10]=p,t[11]=m):(p=t[10],m=t[11]);let h;t[12]===s?h=t[13]:(h=(0,$.jsxs)(X,{variant:`destructive`,onSelect:s,children:[p,m]}),t[12]=s,t[13]=h);let g;return t[14]!==u||t[15]!==d||t[16]!==f||t[17]!==h?(g=(0,$.jsxs)($.Fragment,{children:[u,d,f,h]}),t[14]=u,t[15]=d,t[16]=f,t[17]=h,t[18]=g):g=t[18],g}function un(e){let t=(0,Z.c)(65),{skill:n,actions:r,existingNames:o}=e,{_:s}=a(),c=Ae(),l=Pt().states,{dispatch:u}=Ct(),d=typeof window<`u`?window.okDesktop:void 0,f=n.absolutePath,p;t[0]===s?p=t[1]:(p=async function(e){try{await Rt(e),K.success(s({id:`SXCSQd`}))}catch{K.error(s({id:`cRHuuI`}))}},t[0]=s,t[1]=p);let m=p,h;t[2]===f?h=t[3]:(h=d&&f?(0,$.jsxs)(X,{onSelect:()=>void d.shell.showItemInFolder(f),children:[(0,$.jsx)(ee,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`LtSYdi`})]}):null,t[2]=f,t[3]=h);let g;t[4]!==n.name||t[5]!==n.scope||t[6]!==c?(g=ut({skillName:n.name,scope:n.scope,workspace:c}),t[4]=n.name,t[5]=n.scope,t[6]=c,t[7]=g):g=t[7];let _;t[8]!==u||t[9]!==l||t[10]!==g?(_=(0,$.jsx)(Yt,{input:g,installStates:l,isElectronHost:d!=null,dispatch:u}),t[8]=u,t[9]=l,t[10]=g,t[11]=_):_=t[11];let v;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsxs)(ve,{children:[(0,$.jsx)(ie,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`zd00pH`})]}),t[12]=v):v=t[12];let y;t[13]!==f||t[14]!==m?(y=f?(0,$.jsx)(X,{onSelect:()=>void m(f),children:(0,$.jsx)(i,{id:`z2funE`})}):null,t[13]=f,t[14]=m,t[15]=y):y=t[15];let b;t[16]!==m||t[17]!==n.path?(b=()=>void m(n.path),t[16]=m,t[17]=n.path,t[18]=b):b=t[18];let x;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(i,{id:`xloBjn`}),t[19]=x):x=t[19];let S;t[20]===b?S=t[21]:(S=(0,$.jsx)(X,{onSelect:b,children:x}),t[20]=b,t[21]=S);let C;t[22]!==y||t[23]!==S?(C=(0,$.jsxs)(le,{children:[v,(0,$.jsxs)(ce,{children:[y,S]})]}),t[22]=y,t[23]=S,t[24]=C):C=t[24];let w;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(ye,{}),t[25]=w):w=t[25];let T;t[26]!==r||t[27]!==o||t[28]!==n?(T=()=>void r.duplicate(n,o),t[26]=r,t[27]=o,t[28]=n,t[29]=T):T=t[29];let E,D;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(ne,{"aria-hidden":!0}),D=(0,$.jsx)(i,{id:`euc6Ns`}),t[30]=E,t[31]=D):(E=t[30],D=t[31]);let O;t[32]===T?O=t[33]:(O=(0,$.jsxs)(X,{onSelect:T,children:[E,D]}),t[32]=T,t[33]=O);let k;t[34]!==r||t[35]!==o||t[36]!==n?(k=()=>r.requestRename(n,o),t[34]=r,t[35]=o,t[36]=n,t[37]=k):k=t[37];let A,j;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(Ce,{"aria-hidden":!0}),j=(0,$.jsx)(i,{id:`2wxgft`}),t[38]=A,t[39]=j):(A=t[38],j=t[39]);let M;t[40]===k?M=t[41]:(M=(0,$.jsxs)(X,{onSelect:k,children:[A,j]}),t[40]=k,t[41]=M);let N;t[42]!==r||t[43]!==n?(N=n.updateAvailable?(0,$.jsxs)(X,{onSelect:()=>r.requestUpdate(n),children:[(0,$.jsx)(Te,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`6g2jsp`})]}):null,t[42]=r,t[43]=n,t[44]=N):N=t[44];let P;t[45]!==r||t[46]!==n?(P=n.installed?(0,$.jsxs)(X,{onSelect:()=>void r.uninstall(n),children:[(0,$.jsx)(we,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`fo0VXg`})]}):(0,$.jsxs)(X,{onSelect:()=>void r.install(n),children:[(0,$.jsx)(Se,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`TKQ7K-`})]}),t[45]=r,t[46]=n,t[47]=P):P=t[47];let F;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(ye,{}),t[48]=F):F=t[48];let I;t[49]!==r||t[50]!==n?(I=()=>r.requestDelete(n),t[49]=r,t[50]=n,t[51]=I):I=t[51];let L,R;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,$.jsx)(H,{"aria-hidden":!0}),R=(0,$.jsx)(i,{id:`cnGeoo`}),t[52]=L,t[53]=R):(L=t[52],R=t[53]);let z;t[54]===I?z=t[55]:(z=(0,$.jsxs)(X,{variant:`destructive`,onSelect:I,children:[L,R]}),t[54]=I,t[55]=z);let B;return t[56]!==C||t[57]!==O||t[58]!==M||t[59]!==h||t[60]!==N||t[61]!==P||t[62]!==z||t[63]!==_?(B=(0,$.jsxs)($.Fragment,{children:[h,_,C,w,O,M,N,P,F,z]}),t[56]=C,t[57]=O,t[58]=M,t[59]=h,t[60]=N,t[61]=P,t[62]=z,t[63]=_,t[64]=B):B=t[64],B}export{Te as A,ct as C,Ae as D,rt as E,ke as O,bt as S,it as T,lt as _,Yt as a,ut as b,Kt as c,Vt as d,It as f,st as g,dt as h,Xt as i,Se as j,Ee as k,Ut as l,Pt as m,un as n,qt as o,Rt as p,an as r,Gt as s,ln as t,Wt as u,at as v,Ct as w,vt as x,ot as y};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{i,l as a,o,s}from"./button-DGf25ccp.js";import{_ as c,g as l,h as u,m as d,p as f}from"./dialog-CIq9aQLf.js";import{t as p}from"./chevron-right-jyIhGBkw.js";import{l as m,r as h}from"./documents-events-CSQluyCM.js";import{a as g,d as _,f as v,i as y,l as b,n as x,o as S,p as ee,r as te,s as ne}from"./dist-BXd_K33i.js";import{_ as re,a as ie,g as ae,i as C,n as oe,r as se,t as w}from"./dist-ICp_3rWY.js";import{n as ce,r as T,t as le}from"./dist-AQSp7Qij.js";var E=e(t(),1),D=n(),O=[`Enter`,` `],ue=[`ArrowDown`,`PageUp`,`Home`],de=[`ArrowUp`,`PageDown`,`End`],fe=[...ue,...de],k={ltr:[...O,`ArrowRight`],rtl:[...O,`ArrowLeft`]},pe={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},A=`Menu`,[j,me,M]=re(A),[N,P]=_(A,[M,ie,T]),F=ie(),he=T(),[ge,I]=N(A),[_e,L]=N(A),ve=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=F(t),[c,l]=E.useState(null),u=E.useRef(!1),d=y(a),f=ae(i);return E.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,D.jsx)(C,{...s,children:(0,D.jsx)(ge,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,D.jsx)(_e,{scope:t,onClose:E.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};ve.displayName=A;var ye=`MenuAnchor`,be=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=F(n);return(0,D.jsx)(w,{...i,...r,ref:t})});be.displayName=ye;var xe=`MenuPortal`,[Se,Ce]=N(xe,{forceMount:void 0}),we=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=I(xe,t);return(0,D.jsx)(Se,{scope:t,forceMount:n,children:(0,D.jsx)(S,{present:n||a.open,children:(0,D.jsx)(x,{asChild:!0,container:i,children:r})})})};we.displayName=xe;var R=`MenuContent`,[Te,z]=N(R),Ee=E.forwardRef((e,t)=>{let n=Ce(R,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=I(R,e.__scopeMenu),o=L(R,e.__scopeMenu);return(0,D.jsx)(j.Provider,{scope:e.__scopeMenu,children:(0,D.jsx)(S,{present:r||a.open,children:(0,D.jsx)(j.Slot,{scope:e.__scopeMenu,children:o.modal?(0,D.jsx)(De,{...i,ref:t}):(0,D.jsx)(Oe,{...i,ref:t})})})})}),De=E.forwardRef((e,t)=>{let n=I(R,e.__scopeMenu),r=E.useRef(null),i=s(t,r);return E.useEffect(()=>{let e=r.current;if(e)return f(e)},[]),(0,D.jsx)(B,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:b(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Oe=E.forwardRef((e,t)=>{let n=I(R,e.__scopeMenu);return(0,D.jsx)(B,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),ke=i(`MenuContent.ScrollLock`),B=E.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEntryFocus:f,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:g,onDismiss:_,disableOutsideScroll:v,...y}=e,x=I(R,n),S=L(R,n),ee=F(n),ne=he(n),re=me(n),[ie,ae]=E.useState(null),C=E.useRef(null),oe=s(t,C,x.onContentChange),w=E.useRef(0),T=E.useRef(``),le=E.useRef(0),O=E.useRef(null),ue=E.useRef(`right`),k=E.useRef(0),pe=v?d:E.Fragment,A=v?{as:ke,allowPinchZoom:!0}:void 0,j=e=>{let t=T.current+e,n=re().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=at(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){T.current=t,window.clearTimeout(w.current),t!==``&&(w.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};E.useEffect(()=>()=>window.clearTimeout(w.current),[]),u();let M=E.useCallback(e=>ue.current===O.current?.side&&st(e,O.current?.area),[]);return(0,D.jsx)(Te,{scope:n,searchRef:T,onItemEnter:E.useCallback(e=>{M(e)&&e.preventDefault()},[M]),onItemLeave:E.useCallback(e=>{M(e)||(C.current?.focus(),ae(null))},[M]),onTriggerLeave:E.useCallback(e=>{M(e)&&e.preventDefault()},[M]),pointerGraceTimerRef:le,onPointerGraceIntentChange:E.useCallback(e=>{O.current=e},[]),children:(0,D.jsx)(pe,{...A,children:(0,D.jsx)(l,{asChild:!0,trapped:i,onMountAutoFocus:b(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,D.jsx)(te,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:g,onDismiss:_,children:(0,D.jsx)(ce,{asChild:!0,...ne,dir:S.dir,orientation:`vertical`,loop:r,currentTabStopId:ie,onCurrentTabStopIdChange:ae,onEntryFocus:b(f,e=>{S.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,D.jsx)(se,{role:`menu`,"aria-orientation":`vertical`,"data-state":nt(x.open),"data-radix-menu-content":``,dir:S.dir,...ee,...y,ref:oe,style:{outline:`none`,...y.style},onKeyDown:b(y.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&j(e.key));let i=C.current;if(e.target!==i||!fe.includes(e.key))return;e.preventDefault();let a=re().filter(e=>!e.disabled).map(e=>e.ref.current);de.includes(e.key)&&a.reverse(),rt(a)}),onBlur:b(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(w.current),T.current=``)}),onPointerMove:b(e.onPointerMove,Y(e=>{let t=e.target,n=k.current!==e.clientX;e.currentTarget.contains(t)&&n&&(ue.current=e.clientX>k.current?`right`:`left`,k.current=e.clientX)}))})})})})})})});Ee.displayName=R;var Ae=`MenuGroup`,V=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,D.jsx)(v.div,{role:`group`,...r,ref:t})});V.displayName=Ae;var je=`MenuLabel`,Me=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,D.jsx)(v.div,{...r,ref:t})});Me.displayName=je;var H=`MenuItem`,Ne=`menu.itemSelect`,U=E.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=E.useRef(null),o=L(H,e.__scopeMenu),c=z(H,e.__scopeMenu),l=s(t,a),u=E.useRef(!1),d=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Ne,{bubbles:!0,cancelable:!0});e.addEventListener(Ne,e=>r?.(e),{once:!0}),ee(e,t),t.defaultPrevented?u.current=!1:o.onClose()}};return(0,D.jsx)(Pe,{...i,ref:l,disabled:n,onClick:b(e.onClick,d),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:b(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:b(e.onKeyDown,e=>{let t=c.searchRef.current!==``;n||t&&e.key===` `||O.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});U.displayName=H;var Pe=E.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=z(H,n),c=he(n),l=E.useRef(null),u=s(t,l),[d,f]=E.useState(!1),[p,m]=E.useState(``);return E.useEffect(()=>{let e=l.current;e&&m((e.textContent??``).trim())},[a.children]),(0,D.jsx)(j.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:(0,D.jsx)(le,{asChild:!0,...c,focusable:!r,children:(0,D.jsx)(v.div,{role:`menuitem`,"data-highlighted":d?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:u,onPointerMove:b(e.onPointerMove,Y(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:b(e.onPointerLeave,Y(e=>o.onItemLeave(e))),onFocus:b(e.onFocus,()=>f(!0)),onBlur:b(e.onBlur,()=>f(!1))})})})}),Fe=`MenuCheckboxItem`,Ie=E.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,D.jsx)(Ue,{scope:e.__scopeMenu,checked:n,children:(0,D.jsx)(U,{role:`menuitemcheckbox`,"aria-checked":q(n)?`mixed`:n,...i,ref:t,"data-state":J(n),onSelect:b(i.onSelect,()=>r?.(q(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ie.displayName=Fe;var Le=`MenuRadioGroup`,[Re,ze]=N(Le,{value:void 0,onValueChange:()=>{}}),Be=E.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=y(r);return(0,D.jsx)(Re,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,D.jsx)(V,{...i,ref:t})})});Be.displayName=Le;var Ve=`MenuRadioItem`,He=E.forwardRef((e,t)=>{let{value:n,...r}=e,i=ze(Ve,e.__scopeMenu),a=n===i.value;return(0,D.jsx)(Ue,{scope:e.__scopeMenu,checked:a,children:(0,D.jsx)(U,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":J(a),onSelect:b(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});He.displayName=Ve;var W=`MenuItemIndicator`,[Ue,We]=N(W,{checked:!1}),Ge=E.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=We(W,n);return(0,D.jsx)(S,{present:r||q(a.checked)||a.checked===!0,children:(0,D.jsx)(v.span,{...i,ref:t,"data-state":J(a.checked)})})});Ge.displayName=W;var Ke=`MenuSeparator`,qe=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,D.jsx)(v.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});qe.displayName=Ke;var Je=`MenuArrow`,Ye=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=F(n);return(0,D.jsx)(oe,{...i,...r,ref:t})});Ye.displayName=Je;var G=`MenuSub`,[Xe,Ze]=N(G),Qe=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=I(G,t),o=F(t),[s,c]=E.useState(null),[l,u]=E.useState(null),d=y(i);return E.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,D.jsx)(C,{...o,children:(0,D.jsx)(ge,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,D.jsx)(Xe,{scope:t,contentId:g(),triggerId:g(),trigger:s,onTriggerChange:c,children:n})})})};Qe.displayName=G;var K=`MenuSubTrigger`,$e=E.forwardRef((e,t)=>{let n=I(K,e.__scopeMenu),r=L(K,e.__scopeMenu),i=Ze(K,e.__scopeMenu),a=z(K,e.__scopeMenu),s=E.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=a,u={__scopeMenu:e.__scopeMenu},d=E.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return E.useEffect(()=>d,[d]),E.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),l(null)}},[c,l]),(0,D.jsx)(be,{asChild:!0,...u,children:(0,D.jsx)(Pe,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":nt(n.open),...e,ref:o(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:b(e.onPointerMove,Y(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(a.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:b(e.onPointerLeave,Y(e=>{d();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,s=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:s,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:s,y:t.bottom}],side:r}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:b(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||k[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});$e.displayName=K;var et=`MenuSubContent`,tt=E.forwardRef((e,t)=>{let n=Ce(R,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=I(R,e.__scopeMenu),o=L(R,e.__scopeMenu),c=Ze(et,e.__scopeMenu),l=E.useRef(null),u=s(t,l);return(0,D.jsx)(j.Provider,{scope:e.__scopeMenu,children:(0,D.jsx)(S,{present:r||a.open,children:(0,D.jsx)(j.Slot,{scope:e.__scopeMenu,children:(0,D.jsx)(B,{id:c.contentId,"aria-labelledby":c.triggerId,...i,ref:u,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:b(e.onFocusOutside,e=>{e.target!==c.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:b(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:b(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=pe[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});tt.displayName=et;function nt(e){return e?`open`:`closed`}function q(e){return e===`indeterminate`}function J(e){return q(e)?`indeterminate`:e?`checked`:`unchecked`}function rt(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function it(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function at(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=it(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function ot(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function st(e,t){return t?ot({x:e.clientX,y:e.clientY},t):!1}function Y(e){return t=>t.pointerType===`mouse`?e(t):void 0}var ct=ve,lt=be,ut=we,dt=Ee,ft=V,pt=Me,mt=U,ht=Ie,gt=Be,_t=He,vt=Ge,yt=qe,bt=Ye,xt=Qe,St=$e,Ct=tt,X=`DropdownMenu`,[wt,Tt]=_(X,[P]),Z=P(),[Et,Dt]=wt(X),Ot=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Z(t),l=E.useRef(null),[u,d]=ne({prop:i,defaultProp:a??!1,onChange:o,caller:X});return(0,D.jsx)(Et,{scope:t,triggerId:g(),triggerRef:l,contentId:g(),open:u,onOpenChange:d,onOpenToggle:E.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,D.jsx)(ct,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Ot.displayName=X;var kt=`DropdownMenuTrigger`,At=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Dt(kt,n),s=Z(n);return(0,D.jsx)(lt,{asChild:!0,...s,children:(0,D.jsx)(v.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:o(t,a.triggerRef),onPointerDown:b(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:b(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});At.displayName=kt;var jt=`DropdownMenuPortal`,Mt=e=>{let{__scopeDropdownMenu:t,...n}=e,r=Z(t);return(0,D.jsx)(ut,{...r,...n})};Mt.displayName=jt;var Nt=`DropdownMenuContent`,Pt=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Dt(Nt,n),a=Z(n),o=E.useRef(!1);return(0,D.jsx)(dt,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:b(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:b(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Pt.displayName=Nt;var Ft=`DropdownMenuGroup`,It=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,D.jsx)(ft,{...i,...r,ref:t})});It.displayName=Ft;var Lt=`DropdownMenuLabel`,Rt=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,D.jsx)(pt,{...i,...r,ref:t})});Rt.displayName=Lt;var zt=`DropdownMenuItem`,Bt=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,D.jsx)(mt,{...i,...r,ref:t})});Bt.displayName=zt;var Vt=`DropdownMenuCheckboxItem`,Ht=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,D.jsx)(ht,{...i,...r,ref:t})});Ht.displayName=Vt;var Ut=`DropdownMenuRadioGroup`,Wt=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,D.jsx)(gt,{...i,...r,ref:t})});Wt.displayName=Ut;var Gt=`DropdownMenuRadioItem`,Kt=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,D.jsx)(_t,{...i,...r,ref:t})});Kt.displayName=Gt;var qt=`DropdownMenuItemIndicator`,Jt=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,D.jsx)(vt,{...i,...r,ref:t})});Jt.displayName=qt;var Yt=`DropdownMenuSeparator`,Xt=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,D.jsx)(yt,{...i,...r,ref:t})});Xt.displayName=Yt;var Zt=`DropdownMenuArrow`,Qt=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,D.jsx)(bt,{...i,...r,ref:t})});Qt.displayName=Zt;var $t=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=Z(t),[s,c]=ne({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,D.jsx)(xt,{...o,open:s,onOpenChange:c,children:n})},en=`DropdownMenuSubTrigger`,tn=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,D.jsx)(St,{...i,...r,ref:t})});tn.displayName=en;var nn=`DropdownMenuSubContent`,rn=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,D.jsx)(Ct,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});rn.displayName=nn;var an=Ot,on=At,sn=Mt,cn=Pt,ln=It,un=Rt,dn=Bt,fn=Ht,pn=Wt,mn=Kt,hn=Jt,gn=Xt,_n=$t,vn=tn,yn=rn,Q=r();function bn(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,D.jsx)(an,{"data-slot":`dropdown-menu`,...n}),t[2]=n,t[3]=r),r}function xn(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,D.jsx)(on,{"data-slot":`dropdown-menu-trigger`,...n}),t[2]=n,t[3]=r),r}function Sn(e){let t=(0,Q.c)(12),n,r,i,o;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4]):({className:n,align:i,sideOffset:o,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o);let s=i===void 0?`start`:i,c=o===void 0?4:o,l;t[5]===n?l=t[6]:(l=a(`z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 data-[state=closed]:overflow-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0 subtle-scrollbar`,n),t[5]=n,t[6]=l);let u;return t[7]!==s||t[8]!==r||t[9]!==c||t[10]!==l?(u=(0,D.jsx)(sn,{children:(0,D.jsx)(cn,{"data-slot":`dropdown-menu-content`,sideOffset:c,align:s,className:l,...r})}),t[7]=s,t[8]=r,t[9]=c,t[10]=l,t[11]=u):u=t[11],u}function Cn(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,D.jsx)(ln,{"data-slot":`dropdown-menu-group`,...n}),t[2]=n,t[3]=r),r}function wn(e){let t=(0,Q.c)(12),n,r,i,o;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4]):({className:n,inset:r,variant:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o);let s=o===void 0?`default`:o,c;t[5]===n?c=t[6]:(c=a(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,n),t[5]=n,t[6]=c);let l;return t[7]!==r||t[8]!==i||t[9]!==c||t[10]!==s?(l=(0,D.jsx)(dn,{"data-slot":`dropdown-menu-item`,"data-inset":r,"data-variant":s,className:c,...i}),t[7]=r,t[8]=i,t[9]=c,t[10]=s,t[11]=l):l=t[11],l}function Tn(e){let t=(0,Q.c)(15),n,r,i,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4],s=t[5]):({className:i,children:r,checked:n,inset:o,...s}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s);let l;t[6]===i?l=t[7]:(l=a(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,i),t[6]=i,t[7]=l);let u;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,D.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:(0,D.jsx)(hn,{children:(0,D.jsx)(c,{})})}),t[8]=u):u=t[8];let d;return t[9]!==n||t[10]!==r||t[11]!==o||t[12]!==s||t[13]!==l?(d=(0,D.jsxs)(fn,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":o,className:l,checked:n,...s,children:[u,r]}),t[9]=n,t[10]=r,t[11]=o,t[12]=s,t[13]=l,t[14]=d):d=t[14],d}function En(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,D.jsx)(pn,{"data-slot":`dropdown-menu-radio-group`,...n}),t[2]=n,t[3]=r),r}function Dn(e){let t=(0,Q.c)(13),n,r,i,o;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4]):({className:r,children:n,inset:i,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o);let s;t[5]===r?s=t[6]:(s=a(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=s);let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,D.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-radio-item-indicator`,children:(0,D.jsx)(hn,{children:(0,D.jsx)(c,{})})}),t[7]=l):l=t[7];let u;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(u=(0,D.jsxs)(mn,{"data-slot":`dropdown-menu-radio-item`,"data-inset":i,className:s,...o,children:[l,n]}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=u):u=t[12],u}function On(e){let t=(0,Q.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,inset:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let o;t[4]===n?o=t[5]:(o=a(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==i||t[8]!==o?(s=(0,D.jsx)(un,{"data-slot":`dropdown-menu-label`,"data-inset":r,className:o,...i}),t[6]=r,t[7]=i,t[8]=o,t[9]=s):s=t[9],s}function kn(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`-mx-1 my-1 h-px bg-border`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,D.jsx)(gn,{"data-slot":`dropdown-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}function An(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,D.jsx)(_n,{"data-slot":`dropdown-menu-sub`,...n}),t[2]=n,t[3]=r),r}function jn(e){let t=(0,Q.c)(13),n,r,i,o;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4]):({className:r,inset:i,children:n,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o);let s;t[5]===r?s=t[6]:(s=a(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,D.jsx)(p,{className:`ml-auto`}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(l=(0,D.jsxs)(vn,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":i,className:s,...o,children:[n,c]}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=l):l=t[12],l}function Mn(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[96px] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 data-[state=closed]:overflow-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0 subtle-scrollbar`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,D.jsx)(yn,{"data-slot":`dropdown-menu-sub-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}async function $(e){return m(await e.json().catch(()=>null))??`HTTP ${e.status}`}async function Nn(e){try{let t=await fetch(`/api/skill`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await $(t)};let n=await t.json().catch(()=>null);return h(),{ok:!0,created:n?.created??!1,warnings:n?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function Pn(e){try{let t=await fetch(`/api/skill-file`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await $(t)};let n=await t.json().catch(()=>null);return h(),{ok:!0,created:n?.created??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function Fn(){try{let e=await fetch(`/api/skills/management`);return e.ok?await e.json():null}catch{return null}}async function In(e){try{return(await fetch(`/api/skills/management`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({manageEditorSkills:e})})).ok?(h(),!0):!1}catch{return!1}}function Ln(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 Rn(e){try{let t=new URLSearchParams({name:e.name,scope:e.scope}),n=await fetch(`/api/skill?${t.toString()}`);if(!n.ok)return{ok:!1,error:await $(n)};let r=await n.json().catch(()=>null),i=typeof r?.skill?.frontmatter?.description==`string`?r.skill.frontmatter.description:``,a=typeof r?.skill?.body==`string`?r.skill.body:``,o=Ln(e.name,e.existingNames),s=await Nn({scope:e.scope,name:o,frontmatter:{name:o,description:i},body:a});return s.ok?{ok:!0,name:o}:{ok:!1,error:s.error}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function zn(e){let{name:t,fromScope:n,toScope:r}=e;if(n===r)return{ok:!0,scope:r};try{let e=await fetch(`/api/skill?name=${encodeURIComponent(t)}&scope=${n}`);if(!e.ok)return{ok:!1,error:await $(e)};let i=await e.json().catch(()=>null),a=typeof i?.skill?.frontmatter?.description==`string`?i.skill.frontmatter.description:``,o=typeof i?.skill?.body==`string`?i.skill.body:``,s=await fetch(`/api/skill?name=${encodeURIComponent(t)}&scope=${r}`);if(s.ok)return{ok:!1,error:`A ${r} skill named "${t}" already exists.`};if(s.status!==404)return{ok:!1,error:`Couldn't verify the ${r} destination "${t}" is free (HTTP ${s.status}); aborting before any write so an existing skill can't be overwritten. Retry in a moment.`};let c=await Nn({scope:r,name:t,frontmatter:{name:t,description:a},body:o});if(!c.ok)return c;let l=await Hn(n,t);if(!l.ok)return{ok:!1,error:`Copied "${t}" to ${r}, but reading its bundle files failed (${l.error}); the ${n} original is intact. Delete the partial ${r} copy and retry.`};let u=[];for(let e of l.files){if(e.text===null){u.push(e.path);continue}let i=await Pn({scope:r,name:t,path:e.path,content:e.text});if(!i.ok)return{ok:!1,error:`Copied "${t}" to ${r}, but copying its bundle file "${e.path}" failed (${i.error}); the ${n} original is intact. Delete the partial ${r} copy and retry.`}}let d=await Vn(n,t);return d.ok?(h(),{ok:!0,scope:r,...u.length>0?{skippedBinaryFiles:u}:{}}):{ok:!1,error:`Copied to ${r}, but couldn't remove the ${n} copy: ${d.error}`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function Bn(e){try{let t=await fetch(`/api/skill`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await $(t)};let n=await t.json().catch(()=>null);return h(),{ok:!0,committed:n?.committed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function Vn(e,t){try{let n=`?name=${encodeURIComponent(t)}&scope=${encodeURIComponent(e)}`,r=await fetch(`/api/skill${n}`,{method:`DELETE`});if(!r.ok)return{ok:!1,error:await $(r)};let i=await r.json().catch(()=>null);return h(),{ok:!0,existed:i?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function Hn(e,t){try{let n=new URLSearchParams({name:t,scope:e}),r=await fetch(`/api/skill?${n.toString()}`);return r.ok?{ok:!0,files:(await r.json().catch(()=>null))?.skill?.files??[]}:{ok:!1,error:await $(r)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function Un(e){try{let t=new URLSearchParams({name:e.name,scope:e.scope,path:e.path}),n=await fetch(`/api/skill-file?${t.toString()}`,{signal:e.signal});if(!n.ok)return{ok:!1,status:n.status,error:await $(n)};let r=await n.json().catch(()=>null);return typeof r?.text==`string`?{ok:!0,text:r.text}:{ok:!1,status:n.status,error:`HTTP ${n.status}`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function Wn(e,t){return Un({...e,signal:t}).then(e=>e.ok?{ok:!0,text:e.text}:{ok:!1,status:e.status})}async function Gn(e){try{let t=await fetch(`/api/skill/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await $(t)};let n=await t.json().catch(()=>null);return h(),{ok:!0,hosts:n?.hosts??[],scripts:n?.scripts??!1,warnings:n?.warnings??[],warningCodes:n?.warningCodes??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function Kn(e){try{let t=await fetch(`/api/skill/uninstall`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await $(t)};let n=await t.json().catch(()=>null);return h(),{ok:!0,uninstalled:n?.uninstalled??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function qn(e){try{let t=await fetch(`/api/skill/update`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await $(t)};let n=await t.json().catch(()=>null);return h(),{ok:!0,version:n?.version??``,previousVersion:n?.previousVersion,checkpointRef:n?.checkpointRef}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}export{ft as A,Ct as B,Mn as C,bt as D,lt as E,gt as F,P as H,_t as I,ct as L,vt as M,pt as N,ht as O,ut as P,yt as R,An as S,xn as T,St as V,wn as _,Gn as a,Dn as b,zn as c,Kn as d,qn as f,Cn as g,Sn as h,Fn as i,mt as j,dt as k,Nn as l,Tn as m,Rn as n,Wn as o,bn as p,Hn as r,Bn as s,Vn as t,In as u,On as v,jn as w,kn as x,En as y,xt as z};
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{i,l as a,o,s}from"./button-DGf25ccp.js";import{_ as c,g as l,h as u,m as d,p as f}from"./dialog-CIq9aQLf.js";import{t as p}from"./chevron-right-jyIhGBkw.js";import{l as m,r as h}from"./documents-events-DA8Q5ICz.js";import{a as g,d as _,f as v,i as y,l as b,n as x,o as S,p as ee,r as te,s as ne}from"./dist-BXd_K33i.js";import{_ as re,a as ie,g as ae,i as C,n as oe,r as se,t as w}from"./dist-ICp_3rWY.js";import{n as ce,r as T,t as le}from"./dist-AQSp7Qij.js";var E=e(t(),1),D=n(),O=[`Enter`,` `],ue=[`ArrowDown`,`PageUp`,`Home`],de=[`ArrowUp`,`PageDown`,`End`],fe=[...ue,...de],k={ltr:[...O,`ArrowRight`],rtl:[...O,`ArrowLeft`]},pe={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},A=`Menu`,[j,me,M]=re(A),[N,P]=_(A,[M,ie,T]),F=ie(),he=T(),[ge,I]=N(A),[_e,L]=N(A),ve=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=F(t),[c,l]=E.useState(null),u=E.useRef(!1),d=y(a),f=ae(i);return E.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,D.jsx)(C,{...s,children:(0,D.jsx)(ge,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,D.jsx)(_e,{scope:t,onClose:E.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};ve.displayName=A;var ye=`MenuAnchor`,be=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=F(n);return(0,D.jsx)(w,{...i,...r,ref:t})});be.displayName=ye;var xe=`MenuPortal`,[Se,Ce]=N(xe,{forceMount:void 0}),we=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=I(xe,t);return(0,D.jsx)(Se,{scope:t,forceMount:n,children:(0,D.jsx)(S,{present:n||a.open,children:(0,D.jsx)(x,{asChild:!0,container:i,children:r})})})};we.displayName=xe;var R=`MenuContent`,[Te,z]=N(R),Ee=E.forwardRef((e,t)=>{let n=Ce(R,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=I(R,e.__scopeMenu),o=L(R,e.__scopeMenu);return(0,D.jsx)(j.Provider,{scope:e.__scopeMenu,children:(0,D.jsx)(S,{present:r||a.open,children:(0,D.jsx)(j.Slot,{scope:e.__scopeMenu,children:o.modal?(0,D.jsx)(De,{...i,ref:t}):(0,D.jsx)(Oe,{...i,ref:t})})})})}),De=E.forwardRef((e,t)=>{let n=I(R,e.__scopeMenu),r=E.useRef(null),i=s(t,r);return E.useEffect(()=>{let e=r.current;if(e)return f(e)},[]),(0,D.jsx)(B,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:b(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Oe=E.forwardRef((e,t)=>{let n=I(R,e.__scopeMenu);return(0,D.jsx)(B,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),ke=i(`MenuContent.ScrollLock`),B=E.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEntryFocus:f,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:g,onDismiss:_,disableOutsideScroll:v,...y}=e,x=I(R,n),S=L(R,n),ee=F(n),ne=he(n),re=me(n),[ie,ae]=E.useState(null),C=E.useRef(null),oe=s(t,C,x.onContentChange),w=E.useRef(0),T=E.useRef(``),le=E.useRef(0),O=E.useRef(null),ue=E.useRef(`right`),k=E.useRef(0),pe=v?d:E.Fragment,A=v?{as:ke,allowPinchZoom:!0}:void 0,j=e=>{let t=T.current+e,n=re().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=at(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){T.current=t,window.clearTimeout(w.current),t!==``&&(w.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};E.useEffect(()=>()=>window.clearTimeout(w.current),[]),u();let M=E.useCallback(e=>ue.current===O.current?.side&&st(e,O.current?.area),[]);return(0,D.jsx)(Te,{scope:n,searchRef:T,onItemEnter:E.useCallback(e=>{M(e)&&e.preventDefault()},[M]),onItemLeave:E.useCallback(e=>{M(e)||(C.current?.focus(),ae(null))},[M]),onTriggerLeave:E.useCallback(e=>{M(e)&&e.preventDefault()},[M]),pointerGraceTimerRef:le,onPointerGraceIntentChange:E.useCallback(e=>{O.current=e},[]),children:(0,D.jsx)(pe,{...A,children:(0,D.jsx)(l,{asChild:!0,trapped:i,onMountAutoFocus:b(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,D.jsx)(te,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:g,onDismiss:_,children:(0,D.jsx)(ce,{asChild:!0,...ne,dir:S.dir,orientation:`vertical`,loop:r,currentTabStopId:ie,onCurrentTabStopIdChange:ae,onEntryFocus:b(f,e=>{S.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,D.jsx)(se,{role:`menu`,"aria-orientation":`vertical`,"data-state":nt(x.open),"data-radix-menu-content":``,dir:S.dir,...ee,...y,ref:oe,style:{outline:`none`,...y.style},onKeyDown:b(y.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&j(e.key));let i=C.current;if(e.target!==i||!fe.includes(e.key))return;e.preventDefault();let a=re().filter(e=>!e.disabled).map(e=>e.ref.current);de.includes(e.key)&&a.reverse(),rt(a)}),onBlur:b(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(w.current),T.current=``)}),onPointerMove:b(e.onPointerMove,Y(e=>{let t=e.target,n=k.current!==e.clientX;e.currentTarget.contains(t)&&n&&(ue.current=e.clientX>k.current?`right`:`left`,k.current=e.clientX)}))})})})})})})});Ee.displayName=R;var Ae=`MenuGroup`,V=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,D.jsx)(v.div,{role:`group`,...r,ref:t})});V.displayName=Ae;var je=`MenuLabel`,Me=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,D.jsx)(v.div,{...r,ref:t})});Me.displayName=je;var H=`MenuItem`,Ne=`menu.itemSelect`,U=E.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=E.useRef(null),o=L(H,e.__scopeMenu),c=z(H,e.__scopeMenu),l=s(t,a),u=E.useRef(!1),d=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Ne,{bubbles:!0,cancelable:!0});e.addEventListener(Ne,e=>r?.(e),{once:!0}),ee(e,t),t.defaultPrevented?u.current=!1:o.onClose()}};return(0,D.jsx)(Pe,{...i,ref:l,disabled:n,onClick:b(e.onClick,d),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:b(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:b(e.onKeyDown,e=>{let t=c.searchRef.current!==``;n||t&&e.key===` `||O.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});U.displayName=H;var Pe=E.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=z(H,n),c=he(n),l=E.useRef(null),u=s(t,l),[d,f]=E.useState(!1),[p,m]=E.useState(``);return E.useEffect(()=>{let e=l.current;e&&m((e.textContent??``).trim())},[a.children]),(0,D.jsx)(j.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:(0,D.jsx)(le,{asChild:!0,...c,focusable:!r,children:(0,D.jsx)(v.div,{role:`menuitem`,"data-highlighted":d?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:u,onPointerMove:b(e.onPointerMove,Y(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:b(e.onPointerLeave,Y(e=>o.onItemLeave(e))),onFocus:b(e.onFocus,()=>f(!0)),onBlur:b(e.onBlur,()=>f(!1))})})})}),Fe=`MenuCheckboxItem`,Ie=E.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,D.jsx)(Ue,{scope:e.__scopeMenu,checked:n,children:(0,D.jsx)(U,{role:`menuitemcheckbox`,"aria-checked":q(n)?`mixed`:n,...i,ref:t,"data-state":J(n),onSelect:b(i.onSelect,()=>r?.(q(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ie.displayName=Fe;var Le=`MenuRadioGroup`,[Re,ze]=N(Le,{value:void 0,onValueChange:()=>{}}),Be=E.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=y(r);return(0,D.jsx)(Re,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,D.jsx)(V,{...i,ref:t})})});Be.displayName=Le;var Ve=`MenuRadioItem`,He=E.forwardRef((e,t)=>{let{value:n,...r}=e,i=ze(Ve,e.__scopeMenu),a=n===i.value;return(0,D.jsx)(Ue,{scope:e.__scopeMenu,checked:a,children:(0,D.jsx)(U,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":J(a),onSelect:b(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});He.displayName=Ve;var W=`MenuItemIndicator`,[Ue,We]=N(W,{checked:!1}),Ge=E.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=We(W,n);return(0,D.jsx)(S,{present:r||q(a.checked)||a.checked===!0,children:(0,D.jsx)(v.span,{...i,ref:t,"data-state":J(a.checked)})})});Ge.displayName=W;var Ke=`MenuSeparator`,qe=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,D.jsx)(v.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});qe.displayName=Ke;var Je=`MenuArrow`,Ye=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=F(n);return(0,D.jsx)(oe,{...i,...r,ref:t})});Ye.displayName=Je;var G=`MenuSub`,[Xe,Ze]=N(G),Qe=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=I(G,t),o=F(t),[s,c]=E.useState(null),[l,u]=E.useState(null),d=y(i);return E.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,D.jsx)(C,{...o,children:(0,D.jsx)(ge,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,D.jsx)(Xe,{scope:t,contentId:g(),triggerId:g(),trigger:s,onTriggerChange:c,children:n})})})};Qe.displayName=G;var K=`MenuSubTrigger`,$e=E.forwardRef((e,t)=>{let n=I(K,e.__scopeMenu),r=L(K,e.__scopeMenu),i=Ze(K,e.__scopeMenu),a=z(K,e.__scopeMenu),s=E.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=a,u={__scopeMenu:e.__scopeMenu},d=E.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return E.useEffect(()=>d,[d]),E.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),l(null)}},[c,l]),(0,D.jsx)(be,{asChild:!0,...u,children:(0,D.jsx)(Pe,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":nt(n.open),...e,ref:o(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:b(e.onPointerMove,Y(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(a.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:b(e.onPointerLeave,Y(e=>{d();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,s=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:s,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:s,y:t.bottom}],side:r}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:b(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||k[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});$e.displayName=K;var et=`MenuSubContent`,tt=E.forwardRef((e,t)=>{let n=Ce(R,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=I(R,e.__scopeMenu),o=L(R,e.__scopeMenu),c=Ze(et,e.__scopeMenu),l=E.useRef(null),u=s(t,l);return(0,D.jsx)(j.Provider,{scope:e.__scopeMenu,children:(0,D.jsx)(S,{present:r||a.open,children:(0,D.jsx)(j.Slot,{scope:e.__scopeMenu,children:(0,D.jsx)(B,{id:c.contentId,"aria-labelledby":c.triggerId,...i,ref:u,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:b(e.onFocusOutside,e=>{e.target!==c.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:b(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:b(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=pe[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});tt.displayName=et;function nt(e){return e?`open`:`closed`}function q(e){return e===`indeterminate`}function J(e){return q(e)?`indeterminate`:e?`checked`:`unchecked`}function rt(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function it(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function at(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=it(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function ot(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function st(e,t){return t?ot({x:e.clientX,y:e.clientY},t):!1}function Y(e){return t=>t.pointerType===`mouse`?e(t):void 0}var ct=ve,lt=be,ut=we,dt=Ee,ft=V,pt=Me,mt=U,ht=Ie,gt=Be,_t=He,vt=Ge,yt=qe,bt=Ye,xt=Qe,St=$e,Ct=tt,X=`DropdownMenu`,[wt,Tt]=_(X,[P]),Z=P(),[Et,Dt]=wt(X),Ot=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Z(t),l=E.useRef(null),[u,d]=ne({prop:i,defaultProp:a??!1,onChange:o,caller:X});return(0,D.jsx)(Et,{scope:t,triggerId:g(),triggerRef:l,contentId:g(),open:u,onOpenChange:d,onOpenToggle:E.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,D.jsx)(ct,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Ot.displayName=X;var kt=`DropdownMenuTrigger`,At=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Dt(kt,n),s=Z(n);return(0,D.jsx)(lt,{asChild:!0,...s,children:(0,D.jsx)(v.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:o(t,a.triggerRef),onPointerDown:b(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:b(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});At.displayName=kt;var jt=`DropdownMenuPortal`,Mt=e=>{let{__scopeDropdownMenu:t,...n}=e,r=Z(t);return(0,D.jsx)(ut,{...r,...n})};Mt.displayName=jt;var Nt=`DropdownMenuContent`,Pt=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Dt(Nt,n),a=Z(n),o=E.useRef(!1);return(0,D.jsx)(dt,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:b(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:b(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Pt.displayName=Nt;var Ft=`DropdownMenuGroup`,It=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,D.jsx)(ft,{...i,...r,ref:t})});It.displayName=Ft;var Lt=`DropdownMenuLabel`,Rt=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,D.jsx)(pt,{...i,...r,ref:t})});Rt.displayName=Lt;var zt=`DropdownMenuItem`,Bt=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,D.jsx)(mt,{...i,...r,ref:t})});Bt.displayName=zt;var Vt=`DropdownMenuCheckboxItem`,Ht=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,D.jsx)(ht,{...i,...r,ref:t})});Ht.displayName=Vt;var Ut=`DropdownMenuRadioGroup`,Wt=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,D.jsx)(gt,{...i,...r,ref:t})});Wt.displayName=Ut;var Gt=`DropdownMenuRadioItem`,Kt=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,D.jsx)(_t,{...i,...r,ref:t})});Kt.displayName=Gt;var qt=`DropdownMenuItemIndicator`,Jt=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,D.jsx)(vt,{...i,...r,ref:t})});Jt.displayName=qt;var Yt=`DropdownMenuSeparator`,Xt=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,D.jsx)(yt,{...i,...r,ref:t})});Xt.displayName=Yt;var Zt=`DropdownMenuArrow`,Qt=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,D.jsx)(bt,{...i,...r,ref:t})});Qt.displayName=Zt;var $t=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=Z(t),[s,c]=ne({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,D.jsx)(xt,{...o,open:s,onOpenChange:c,children:n})},en=`DropdownMenuSubTrigger`,tn=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,D.jsx)(St,{...i,...r,ref:t})});tn.displayName=en;var nn=`DropdownMenuSubContent`,rn=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,D.jsx)(Ct,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});rn.displayName=nn;var an=Ot,on=At,sn=Mt,cn=Pt,ln=It,un=Rt,dn=Bt,fn=Ht,pn=Wt,mn=Kt,hn=Jt,gn=Xt,_n=$t,vn=tn,yn=rn,Q=r();function bn(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,D.jsx)(an,{"data-slot":`dropdown-menu`,...n}),t[2]=n,t[3]=r),r}function xn(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,D.jsx)(on,{"data-slot":`dropdown-menu-trigger`,...n}),t[2]=n,t[3]=r),r}function Sn(e){let t=(0,Q.c)(12),n,r,i,o;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4]):({className:n,align:i,sideOffset:o,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o);let s=i===void 0?`start`:i,c=o===void 0?4:o,l;t[5]===n?l=t[6]:(l=a(`z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 data-[state=closed]:overflow-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0 subtle-scrollbar`,n),t[5]=n,t[6]=l);let u;return t[7]!==s||t[8]!==r||t[9]!==c||t[10]!==l?(u=(0,D.jsx)(sn,{children:(0,D.jsx)(cn,{"data-slot":`dropdown-menu-content`,sideOffset:c,align:s,className:l,...r})}),t[7]=s,t[8]=r,t[9]=c,t[10]=l,t[11]=u):u=t[11],u}function Cn(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,D.jsx)(ln,{"data-slot":`dropdown-menu-group`,...n}),t[2]=n,t[3]=r),r}function wn(e){let t=(0,Q.c)(12),n,r,i,o;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4]):({className:n,inset:r,variant:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o);let s=o===void 0?`default`:o,c;t[5]===n?c=t[6]:(c=a(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,n),t[5]=n,t[6]=c);let l;return t[7]!==r||t[8]!==i||t[9]!==c||t[10]!==s?(l=(0,D.jsx)(dn,{"data-slot":`dropdown-menu-item`,"data-inset":r,"data-variant":s,className:c,...i}),t[7]=r,t[8]=i,t[9]=c,t[10]=s,t[11]=l):l=t[11],l}function Tn(e){let t=(0,Q.c)(15),n,r,i,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4],s=t[5]):({className:i,children:r,checked:n,inset:o,...s}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s);let l;t[6]===i?l=t[7]:(l=a(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,i),t[6]=i,t[7]=l);let u;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,D.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:(0,D.jsx)(hn,{children:(0,D.jsx)(c,{})})}),t[8]=u):u=t[8];let d;return t[9]!==n||t[10]!==r||t[11]!==o||t[12]!==s||t[13]!==l?(d=(0,D.jsxs)(fn,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":o,className:l,checked:n,...s,children:[u,r]}),t[9]=n,t[10]=r,t[11]=o,t[12]=s,t[13]=l,t[14]=d):d=t[14],d}function En(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,D.jsx)(pn,{"data-slot":`dropdown-menu-radio-group`,...n}),t[2]=n,t[3]=r),r}function Dn(e){let t=(0,Q.c)(13),n,r,i,o;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4]):({className:r,children:n,inset:i,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o);let s;t[5]===r?s=t[6]:(s=a(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=s);let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,D.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-radio-item-indicator`,children:(0,D.jsx)(hn,{children:(0,D.jsx)(c,{})})}),t[7]=l):l=t[7];let u;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(u=(0,D.jsxs)(mn,{"data-slot":`dropdown-menu-radio-item`,"data-inset":i,className:s,...o,children:[l,n]}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=u):u=t[12],u}function On(e){let t=(0,Q.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,inset:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let o;t[4]===n?o=t[5]:(o=a(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==i||t[8]!==o?(s=(0,D.jsx)(un,{"data-slot":`dropdown-menu-label`,"data-inset":r,className:o,...i}),t[6]=r,t[7]=i,t[8]=o,t[9]=s):s=t[9],s}function kn(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`-mx-1 my-1 h-px bg-border`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,D.jsx)(gn,{"data-slot":`dropdown-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}function An(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,D.jsx)(_n,{"data-slot":`dropdown-menu-sub`,...n}),t[2]=n,t[3]=r),r}function jn(e){let t=(0,Q.c)(13),n,r,i,o;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4]):({className:r,inset:i,children:n,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o);let s;t[5]===r?s=t[6]:(s=a(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,D.jsx)(p,{className:`ml-auto`}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(l=(0,D.jsxs)(vn,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":i,className:s,...o,children:[n,c]}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=l):l=t[12],l}function Mn(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[96px] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 data-[state=closed]:overflow-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0 subtle-scrollbar`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,D.jsx)(yn,{"data-slot":`dropdown-menu-sub-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}async function $(e){return m(await e.json().catch(()=>null))??`HTTP ${e.status}`}async function Nn(e){try{let t=await fetch(`/api/skill`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await $(t)};let n=await t.json().catch(()=>null);return h(),{ok:!0,created:n?.created??!1,warnings:n?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function Pn(e){try{let t=await fetch(`/api/skill-file`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await $(t)};let n=await t.json().catch(()=>null);return h(),{ok:!0,created:n?.created??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function Fn(){try{let e=await fetch(`/api/skills/management`);return e.ok?await e.json():null}catch{return null}}async function In(e){try{return(await fetch(`/api/skills/management`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({manageEditorSkills:e})})).ok?(h(),!0):!1}catch{return!1}}function Ln(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 Rn(e){try{let t=new URLSearchParams({name:e.name,scope:e.scope}),n=await fetch(`/api/skill?${t.toString()}`);if(!n.ok)return{ok:!1,error:await $(n)};let r=await n.json().catch(()=>null),i=typeof r?.skill?.frontmatter?.description==`string`?r.skill.frontmatter.description:``,a=typeof r?.skill?.body==`string`?r.skill.body:``,o=Ln(e.name,e.existingNames),s=await Nn({scope:e.scope,name:o,frontmatter:{name:o,description:i},body:a});return s.ok?{ok:!0,name:o}:{ok:!1,error:s.error}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function zn(e){let{name:t,fromScope:n,toScope:r}=e;if(n===r)return{ok:!0,scope:r};try{let e=await fetch(`/api/skill?name=${encodeURIComponent(t)}&scope=${n}`);if(!e.ok)return{ok:!1,error:await $(e)};let i=await e.json().catch(()=>null),a=typeof i?.skill?.frontmatter?.description==`string`?i.skill.frontmatter.description:``,o=typeof i?.skill?.body==`string`?i.skill.body:``,s=await fetch(`/api/skill?name=${encodeURIComponent(t)}&scope=${r}`);if(s.ok)return{ok:!1,error:`A ${r} skill named "${t}" already exists.`};if(s.status!==404)return{ok:!1,error:`Couldn't verify the ${r} destination "${t}" is free (HTTP ${s.status}); aborting before any write so an existing skill can't be overwritten. Retry in a moment.`};let c=await Nn({scope:r,name:t,frontmatter:{name:t,description:a},body:o});if(!c.ok)return c;let l=await Hn(n,t);if(!l.ok)return{ok:!1,error:`Copied "${t}" to ${r}, but reading its bundle files failed (${l.error}); the ${n} original is intact. Delete the partial ${r} copy and retry.`};let u=[];for(let e of l.files){if(e.text===null){u.push(e.path);continue}let i=await Pn({scope:r,name:t,path:e.path,content:e.text});if(!i.ok)return{ok:!1,error:`Copied "${t}" to ${r}, but copying its bundle file "${e.path}" failed (${i.error}); the ${n} original is intact. Delete the partial ${r} copy and retry.`}}let d=await Vn(n,t);return d.ok?(h(),{ok:!0,scope:r,...u.length>0?{skippedBinaryFiles:u}:{}}):{ok:!1,error:`Copied to ${r}, but couldn't remove the ${n} copy: ${d.error}`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function Bn(e){try{let t=await fetch(`/api/skill`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await $(t)};let n=await t.json().catch(()=>null);return h(),{ok:!0,committed:n?.committed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function Vn(e,t){try{let n=`?name=${encodeURIComponent(t)}&scope=${encodeURIComponent(e)}`,r=await fetch(`/api/skill${n}`,{method:`DELETE`});if(!r.ok)return{ok:!1,error:await $(r)};let i=await r.json().catch(()=>null);return h(),{ok:!0,existed:i?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function Hn(e,t){try{let n=new URLSearchParams({name:t,scope:e}),r=await fetch(`/api/skill?${n.toString()}`);return r.ok?{ok:!0,files:(await r.json().catch(()=>null))?.skill?.files??[]}:{ok:!1,error:await $(r)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function Un(e){try{let t=new URLSearchParams({name:e.name,scope:e.scope,path:e.path}),n=await fetch(`/api/skill-file?${t.toString()}`,{signal:e.signal});if(!n.ok)return{ok:!1,status:n.status,error:await $(n)};let r=await n.json().catch(()=>null);return typeof r?.text==`string`?{ok:!0,text:r.text}:{ok:!1,status:n.status,error:`HTTP ${n.status}`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function Wn(e,t){return Un({...e,signal:t}).then(e=>e.ok?{ok:!0,text:e.text}:{ok:!1,status:e.status})}async function Gn(e){try{let t=await fetch(`/api/skill/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await $(t)};let n=await t.json().catch(()=>null);return h(),{ok:!0,hosts:n?.hosts??[],scripts:n?.scripts??!1,warnings:n?.warnings??[],warningCodes:n?.warningCodes??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function Kn(e){try{let t=await fetch(`/api/skill/uninstall`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await $(t)};let n=await t.json().catch(()=>null);return h(),{ok:!0,uninstalled:n?.uninstalled??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function qn(e){try{let t=await fetch(`/api/skill/update`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await $(t)};let n=await t.json().catch(()=>null);return h(),{ok:!0,version:n?.version??``,previousVersion:n?.previousVersion,checkpointRef:n?.checkpointRef}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}export{ft as A,Ct as B,Mn as C,bt as D,lt as E,gt as F,P as H,_t as I,ct as L,vt as M,pt as N,ht as O,ut as P,yt as R,An as S,xn as T,St as V,wn as _,Gn as a,Dn as b,zn as c,Kn as d,qn as f,Cn as g,Sn as h,Fn as i,mt as j,dt as k,Nn as l,Tn as m,Rn as n,Wn as o,bn as p,Hn as r,Bn as s,Vn as t,In as u,On as v,jn as w,kn as x,En as y,xt as z};
@@ -1 +1 @@
1
- import{T as e,a as t}from"./navigation-targets-CXdtVjj4.js";function n(e){switch(e.kind){case`doc`:case`large-file`:return`doc`;case`skill-file`:return`doc`;case`folder`:case`folder-index`:return`folder`;case`missing`:case`asset`:return`missing`}}function r(r,i){let a=t(r,i);return{resolvedTarget:a,hashDocName:a.target,hash:a.kind===`skill-file`?e({scope:a.scope,name:a.name,path:a.path}):null,displayState:n(a)}}export{r as t};
1
+ import{T as e,a as t}from"./navigation-targets-DNRja8Z0.js";function n(e){switch(e.kind){case`doc`:case`large-file`:return`doc`;case`skill-file`:return`doc`;case`folder`:case`folder-index`:return`folder`;case`missing`:case`asset`:return`missing`}}function r(r,i){let a=t(r,i);return{resolvedTarget:a,hashDocName:a.target,hash:a.kind===`skill-file`?e({scope:a.scope,name:a.name,path:a.path}):null,displayState:n(a)}}export{r as t};