@inkeep/open-knowledge 0.59.0-beta.1 → 0.59.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/{acp-harness-probe-CiWbxcI-.mjs → acp-harness-probe-BRZF_0dC.mjs} +2 -2
  2. package/dist/cli.mjs +6 -6
  3. package/dist/constants-BvMjJ1WL.mjs +2 -0
  4. package/dist/index.d.mts +14 -0
  5. package/dist/index.mjs +7 -7
  6. package/dist/init-BwsBZ6MB.mjs +1 -0
  7. package/dist/{init-3jheO70m.mjs → init-Cev2-Dt6.mjs} +24 -24
  8. package/dist/{launch-json-removal-CpLIRGzz.mjs → launch-json-removal-sHGeN2zb.mjs} +2 -2
  9. package/dist/loader-J7e4OBoj.mjs +1 -0
  10. package/dist/{loader-BZ93QvlM.mjs → loader-sEXYCat9.mjs} +2 -2
  11. package/dist/preview-BStcisK6.mjs +1 -0
  12. package/dist/{preview-CfZUHqGM.mjs → preview-CCd5hlq8.mjs} +2 -2
  13. package/dist/public/assets/{ActivityModeContent-DBbldt0k.js → ActivityModeContent-D6uA_m7H.js} +1 -1
  14. package/dist/public/assets/{AgentDiffPane-DwjS2yV9.js → AgentDiffPane-D4PWUKcp.js} +1 -1
  15. package/dist/public/assets/{AgentThreadClientBinder-DoFc7NfG.js → AgentThreadClientBinder-q7HjbS_V.js} +1 -1
  16. package/dist/public/assets/{BugReportHistory-Dj4DWBsG.js → BugReportHistory-DnmaPA_t.js} +1 -1
  17. package/dist/public/assets/{BugReportHistoryDialog-DNOoF0sF.js → BugReportHistoryDialog-BjRpH89b.js} +1 -1
  18. package/dist/public/assets/{CodeMirrorPropInput-Bbe8zInO.js → CodeMirrorPropInput-BkFI4cSq.js} +3 -3
  19. package/dist/public/assets/{DiffView-BuSYMH4e.js → DiffView-B-B3fi5F.js} +1 -1
  20. package/dist/public/assets/DocumentContext-HSIpKTjH.js +38 -0
  21. package/dist/public/assets/{EditorModeToggle-K2dlTUFw.js → EditorModeToggle-DmglY6xV.js} +1 -1
  22. package/dist/public/assets/{EnableSyncConfirmDialog-Crl0PHbt.js → EnableSyncConfirmDialog-VRpK89T0.js} +1 -1
  23. package/dist/public/assets/{ExcalidrawDocEditor-C89vengD.js → ExcalidrawDocEditor-C8bpwBA4.js} +1 -1
  24. package/dist/public/assets/FeedbackForm-C9DN3mVr.js +1 -0
  25. package/dist/public/assets/{GraphPanel-BioJjRJE.js → GraphPanel-B_Mg9p1O.js} +1 -1
  26. package/dist/public/assets/{ImportSkillDialog-CTisXGKo.js → ImportSkillDialog-59ssHpH-.js} +1 -1
  27. package/dist/public/assets/{LintConfigEditor-2PX1Y8Gp.js → LintConfigEditor-Bij2fHgM.js} +1 -1
  28. package/dist/public/assets/ManagedArtifactProperties-DkJQ1vVn.js +1 -0
  29. package/dist/public/assets/ManagedArtifactProperties-P2EDJZ3f.js +1 -0
  30. package/dist/public/assets/{MermaidDocEditor-Q13CWidl.js → MermaidDocEditor-C8bhqP4t.js} +1 -1
  31. package/dist/public/assets/{PropertyDisplayRow-DVXahRWZ.js → PropertyDisplayRow-DW6AeN1K.js} +1 -1
  32. package/dist/public/assets/{ReportBugDialogBody-BTwtPNzB.js → ReportBugDialogBody-CVQgnZSP.js} +1 -1
  33. package/dist/public/assets/{SchemaConfigEditor-BzfcQ3Bd.js → SchemaConfigEditor-DNaQmo_3.js} +1 -1
  34. package/dist/public/assets/SessionsHost-D_oypiot.js +2 -0
  35. package/dist/public/assets/{SettingsDialogBody-CBraPHPP.js → SettingsDialogBody-D8qSj91O.js} +4 -4
  36. package/dist/public/assets/{ShareReceiveMissDialog-CjolEfpx.js → ShareReceiveMissDialog-C8yHT5CC.js} +1 -1
  37. package/dist/public/assets/{SkillInstallMenu-CIrDCCxr.js → SkillInstallMenu-DXZKa7ir.js} +2 -2
  38. package/dist/public/assets/{SkillOriginInline-9ArgS7v6.js → SkillOriginInline-B1B3kTSz.js} +1 -1
  39. package/dist/public/assets/{SkillToolbarControls-B9LFwwR_.js → SkillToolbarControls-BsyoVC5Q.js} +1 -1
  40. package/dist/public/assets/{SourceEditor-BwO15VQF.js → SourceEditor-BVVe4FH-.js} +1 -1
  41. package/dist/public/assets/{TerminalPanel-B4u8CA0m.js → TerminalPanel-DkxYnA6s.js} +1 -1
  42. package/dist/public/assets/{TerminalWindowApp-BgTVBGP9.js → TerminalWindowApp-Cjr_tele.js} +1 -1
  43. package/dist/public/assets/{TextDocEditor-DHilRKxH.js → TextDocEditor-m87BSysa.js} +1 -1
  44. package/dist/public/assets/{ThreadView-7sbMEVak.js → ThreadView-a9UBrGPP.js} +1 -1
  45. package/dist/public/assets/{TimelineDiffPane-DBuwXW3c.js → TimelineDiffPane-DyW8LDRD.js} +1 -1
  46. package/dist/public/assets/{agent-diff-store-C3QOPAgw.js → agent-diff-store-D4tFKX4K.js} +1 -1
  47. package/dist/public/assets/{auth-state-cache-DBcpAYj1.js → auth-state-cache-Cfy-VA-P.js} +1 -1
  48. package/dist/public/assets/{cm-theme-Da-a0GOT.js → cm-theme-Bi-g5j8J.js} +1 -1
  49. package/dist/public/assets/{comment-chips-PokDlHuL.js → comment-chips-Ba1WfR06.js} +1 -1
  50. package/dist/public/assets/{config-provider-C7t6oRiN.js → config-provider-Bs9S-Mvn.js} +1 -1
  51. package/dist/public/assets/{dist-BpbQP0nJ.js → dist-8oXszleg.js} +1 -1
  52. package/dist/public/assets/{dist-DJO8o4ls2.js → dist-BJNERzM02.js} +1 -1
  53. package/dist/public/assets/{dist-DAvyu-Pu.js → dist-BLe6Laue.js} +1 -1
  54. package/dist/public/assets/{dist-DV5JQxhA.js → dist-BOvI9R-K.js} +1 -1
  55. package/dist/public/assets/{dist-RIwmEtSi.js → dist-CB_NMgy4.js} +1 -1
  56. package/dist/public/assets/{dist-9jLm2WMy.js → dist-CuMGVsog.js} +1 -1
  57. package/dist/public/assets/{dist-j8YNkBWX.js → dist-CyQvb_hJ.js} +1 -1
  58. package/dist/public/assets/{dist-CrpG6qZF.js → dist-DMk7rHfk.js} +1 -1
  59. package/dist/public/assets/{dist-DtBd-emT.js → dist-DpwTwWzy.js} +1 -1
  60. package/dist/public/assets/{dist-83_CVK0Y.js → dist-RP9GkCTw.js} +1 -1
  61. package/dist/public/assets/{dist-CIfqGNU5.js → dist-THE2PCU5.js} +1 -1
  62. package/dist/public/assets/{dist-CmZSQ_Dr.js → dist-TdeurvvU.js} +1 -1
  63. package/dist/public/assets/{file-tree-adapter-BAEEzFBR.js → file-tree-adapter-Bo3rGytc.js} +1 -1
  64. package/dist/public/assets/{follow-file-4OaGQKr8.js → follow-file-BKlnqkgL.js} +1 -1
  65. package/dist/public/assets/{index-DjHwk3he.js → index-hVkgGI1V.js} +7 -7
  66. package/dist/public/assets/known-skill-dirs-toPil01C.js +1 -0
  67. package/dist/public/assets/{markdownlint-rule-browser-B4O09K7a.js → markdownlint-rule-browser-T68WxSIo.js} +1 -1
  68. package/dist/public/assets/navigation-targets-D6rHX3Pq.js +1 -0
  69. package/dist/public/assets/{pending-receive-nav-store-CUM2yGMy.js → pending-receive-nav-store-CZyI0Y3v.js} +1 -1
  70. package/dist/public/assets/{prop-types-efgXxLQK.js → prop-types-CizsurD0.js} +1 -1
  71. package/dist/public/assets/{selection-context-0QPVSyyM.js → selection-context-CcGgvqKu.js} +1 -1
  72. package/dist/public/assets/skill-actions-Dm7_Q9qA.js +1 -0
  73. package/dist/public/assets/skills-api-DO54o34O.js +1 -0
  74. package/dist/public/assets/{src-C-kGu7U9.js → src-BxKUvqJT.js} +1 -1
  75. package/dist/public/assets/{tag-pill-input-BbNgNG5U.js → tag-pill-input-D2qVy9HA.js} +1 -1
  76. package/dist/public/assets/{target-navigation-intent-CQRrvMAa.js → target-navigation-intent-BqElNT05.js} +1 -1
  77. package/dist/public/assets/{terminal-cli-display-w0URjEKX.js → terminal-cli-display-BTQdEy1j.js} +1 -1
  78. package/dist/public/assets/{terminal-launch-events-CLm4Tujb.js → terminal-launch-events-DNmxO4ft.js} +1 -1
  79. package/dist/public/assets/{terminal-telemetry-Bwit7Ew2.js → terminal-telemetry-BC3JNC05.js} +1 -1
  80. package/dist/public/assets/{text-viewer-languages-BTH8XtqT.js → text-viewer-languages-CF6DiXgT.js} +2 -2
  81. package/dist/public/assets/{typing-burst-detector-BSBim2fh.js → typing-burst-detector-B9Z2sXqG.js} +1 -1
  82. package/dist/public/assets/{uninstall-DjCmbDes.js → uninstall-a5o1Qty-.js} +1 -1
  83. package/dist/public/assets/{use-activity-panel-Dsk5r0Dh.js → use-activity-panel-CVOuigTa.js} +1 -1
  84. package/dist/public/assets/use-open-skill-D7aPRwcl.js +1 -0
  85. package/dist/public/assets/use-popular-skills-0Mbrn7FI.js +1 -0
  86. package/dist/public/assets/use-skill-origin-FTbTIS5Y.js +1 -0
  87. package/dist/public/assets/{use-terminal-enabled-nco9YpDh.js → use-terminal-enabled-50K5tfJr.js} +1 -1
  88. package/dist/public/assets/{use-timeline-entry-diff-C_A3TeSj.js → use-timeline-entry-diff-yvOI8kJw.js} +1 -1
  89. package/dist/public/index.html +49 -49
  90. package/dist/public/uninstall.html +2 -2
  91. package/dist/{repair-launch-json-Dw_5c8F0.mjs → repair-launch-json-BgwkQCzC.mjs} +2 -2
  92. package/dist/{repair-mcp-configs-xmhaYrkC.mjs → repair-mcp-configs-B8rMxvOc.mjs} +2 -2
  93. package/dist/{src-DzdxikwQ.mjs → src-DlY7G7Fh.mjs} +2 -2
  94. package/dist/src-OwWRhjCC.mjs +1 -0
  95. package/dist/{start-CxkA_vzO.mjs → start-B_0dBwHO.mjs} +2 -2
  96. package/dist/start-CvE7iXWH.mjs +1 -0
  97. package/package.json +4 -4
  98. package/dist/constants-CW2Rx-IF.mjs +0 -2
  99. package/dist/init-Dbv25kpt.mjs +0 -1
  100. package/dist/loader-CrvsnWLF.mjs +0 -1
  101. package/dist/preview-uqiPA7dK.mjs +0 -1
  102. package/dist/public/assets/DocumentContext-BC38uC8R.js +0 -38
  103. package/dist/public/assets/FeedbackForm-wyWA05iX.js +0 -1
  104. package/dist/public/assets/ManagedArtifactProperties-BkJurdY8.js +0 -1
  105. package/dist/public/assets/ManagedArtifactProperties-Bmcgejtj.js +0 -1
  106. package/dist/public/assets/SessionsHost-Bn80i4wO.js +0 -2
  107. package/dist/public/assets/navigation-targets-saCskzOA.js +0 -1
  108. package/dist/public/assets/skill-actions-H0gbk5VS.js +0 -1
  109. package/dist/public/assets/skills-api-DriOKSSy.js +0 -1
  110. package/dist/public/assets/use-open-skill-BNgqZmZx.js +0 -1
  111. package/dist/public/assets/use-popular-skills-CfasFpLW.js +0 -1
  112. package/dist/public/assets/use-skill-origin-Bpi6sqBq.js +0 -1
  113. package/dist/public/assets/use-skills-DJ009sMa.js +0 -1
  114. package/dist/src-DczLeXzm.mjs +0 -1
  115. package/dist/start-mpbcgl9V.mjs +0 -1
  116. /package/dist/public/assets/{asset-dispatch-KsnhYIM1.js → asset-dispatch-CdZ_--jl.js} +0 -0
  117. /package/dist/public/assets/{badge-BHNK6NBf.js → badge-BG5JKjNK.js} +0 -0
  118. /package/dist/public/assets/{client-version-Cea4CPxm.js → client-version-C5E9Q07s.js} +0 -0
  119. /package/dist/public/assets/{dist-D9pOpWzq.js → dist-ZfIywMZM.js} +0 -0
  120. /package/dist/public/assets/{external-link-B0bVg1hn.js → external-link-B4qPZwve.js} +0 -0
  121. /package/dist/public/assets/{stex-BUFg5G8g.js → stex-Bh4EH31F.js} +0 -0
  122. /package/dist/public/assets/{use-collab-url-cmMNtL6Q.js → use-collab-url-B7oEo69p.js} +0 -0
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{c as i,i as a,n as o,s,t as c}from"./dialog-HdfR4WGm.js";import{a as l,i as u,n as d,o as f,r as p}from"./pending-receive-nav-store-CUM2yGMy.js";import{t as m}from"./miss-dialog-store-CveL5d4F.js";import{f as h,p as g}from"./doc-paths-BkpejoFL.js";var _=r(),v=e(n(),1),y=t();function b(e){let t=e.split(`/`).filter(Boolean);return t.length>0?t[t.length-1]:e}function x(){let e=(0,_.c)(2),t=(0,v.useSyncExternalStore)(m.subscribe,m.getSnapshot,S);if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=(0,y.jsx)(C,{nav:t},t.path),e[0]=t,e[1]=n),n}function S(){return null}function C(e){let t=(0,_.c)(28),{nav:n}=e,{state:r,refetch:v}=f(n),x;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=function(){m.dismiss()},t[0]=x):x=t[0];let S=x,C;t[1]===n.path?C=t[2]:(C=function(){window.location.hash=g(l(n.path)),S()},t[1]=n.path,t[2]=C);let w=C,T;t[3]===n?T=t[4]:(T=function(e){p.arm(d(n,e)),window.location.hash=n.kind===`folder`?g(e):h(e),S()},t[3]=n,t[4]=T);let E=T,D;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>{e||S()},t[5]=D):D=t[5];let O=r.phase,k=r.phase===`resolved`?r.resolution.verdict:void 0,A;t[6]===n.path?A=t[7]:(A=b(n.path),t[6]=n.path,t[7]=A);let j;t[8]===A?j=t[9]:(j=(0,y.jsx)(s,{children:(0,y.jsx)(i,{className:`truncate`,children:A})}),t[8]=A,t[9]=j);let M=r.phase===`pending`?`flex flex-col items-center justify-center gap-3 py-6 text-center text-sm text-muted-foreground`:`flex flex-col items-center justify-center gap-6 py-2 text-center`,N;t[10]!==n.path||t[11]!==E?(N=()=>E(n.path),t[10]=n.path,t[11]=E,t[12]=N):N=t[12];let P;t[13]!==w||t[14]!==n||t[15]!==E||t[16]!==v||t[17]!==r||t[18]!==N?(P=(0,y.jsx)(u,{nav:n,state:r,onBrowseFolder:w,onOpenRenamed:E,onEnableAutoSync:S,onSyncCompleted:v,onPullApplied:N}),t[13]=w,t[14]=n,t[15]=E,t[16]=v,t[17]=r,t[18]=N,t[19]=P):P=t[19];let F;t[20]!==P||t[21]!==M?(F=(0,y.jsx)(o,{className:M,children:P}),t[20]=P,t[21]=M,t[22]=F):F=t[22];let I;return t[23]!==r.phase||t[24]!==F||t[25]!==k||t[26]!==j?(I=(0,y.jsx)(c,{open:!0,onOpenChange:D,children:(0,y.jsxs)(a,{className:`sm:max-w-md`,"data-testid":`share-receive-miss-dialog`,"data-phase":O,"data-verdict":k,children:[j,F]})}),t[23]=r.phase,t[24]=F,t[25]=k,t[26]=j,t[27]=I):I=t[27],I}export{x as ShareReceiveMissDialog};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{c as i,i as a,n as o,s,t as c}from"./dialog-HdfR4WGm.js";import{a as l,i as u,n as d,o as f,r as p}from"./pending-receive-nav-store-CZyI0Y3v.js";import{t as m}from"./miss-dialog-store-CveL5d4F.js";import{f as h,p as g}from"./doc-paths-BkpejoFL.js";var _=r(),v=e(n(),1),y=t();function b(e){let t=e.split(`/`).filter(Boolean);return t.length>0?t[t.length-1]:e}function x(){let e=(0,_.c)(2),t=(0,v.useSyncExternalStore)(m.subscribe,m.getSnapshot,S);if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=(0,y.jsx)(C,{nav:t},t.path),e[0]=t,e[1]=n),n}function S(){return null}function C(e){let t=(0,_.c)(28),{nav:n}=e,{state:r,refetch:v}=f(n),x;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=function(){m.dismiss()},t[0]=x):x=t[0];let S=x,C;t[1]===n.path?C=t[2]:(C=function(){window.location.hash=g(l(n.path)),S()},t[1]=n.path,t[2]=C);let w=C,T;t[3]===n?T=t[4]:(T=function(e){p.arm(d(n,e)),window.location.hash=n.kind===`folder`?g(e):h(e),S()},t[3]=n,t[4]=T);let E=T,D;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>{e||S()},t[5]=D):D=t[5];let O=r.phase,k=r.phase===`resolved`?r.resolution.verdict:void 0,A;t[6]===n.path?A=t[7]:(A=b(n.path),t[6]=n.path,t[7]=A);let j;t[8]===A?j=t[9]:(j=(0,y.jsx)(s,{children:(0,y.jsx)(i,{className:`truncate`,children:A})}),t[8]=A,t[9]=j);let M=r.phase===`pending`?`flex flex-col items-center justify-center gap-3 py-6 text-center text-sm text-muted-foreground`:`flex flex-col items-center justify-center gap-6 py-2 text-center`,N;t[10]!==n.path||t[11]!==E?(N=()=>E(n.path),t[10]=n.path,t[11]=E,t[12]=N):N=t[12];let P;t[13]!==w||t[14]!==n||t[15]!==E||t[16]!==v||t[17]!==r||t[18]!==N?(P=(0,y.jsx)(u,{nav:n,state:r,onBrowseFolder:w,onOpenRenamed:E,onEnableAutoSync:S,onSyncCompleted:v,onPullApplied:N}),t[13]=w,t[14]=n,t[15]=E,t[16]=v,t[17]=r,t[18]=N,t[19]=P):P=t[19];let F;t[20]!==P||t[21]!==M?(F=(0,y.jsx)(o,{className:M,children:P}),t[20]=P,t[21]=M,t[22]=F):F=t[22];let I;return t[23]!==r.phase||t[24]!==F||t[25]!==k||t[26]!==j?(I=(0,y.jsx)(c,{open:!0,onOpenChange:D,children:(0,y.jsxs)(a,{className:`sm:max-w-md`,"data-testid":`share-receive-miss-dialog`,"data-phase":O,"data-verdict":k,children:[j,F]})}),t[23]=r.phase,t[24]=F,t[25]=k,t[26]=j,t[27]=I):I=t[27],I}export{x as ShareReceiveMissDialog};
@@ -1,8 +1,8 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Mn as n}from"./DocumentContext-BC38uC8R.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./utils-CPqDy6Hr.js";import{t as c}from"./mascot-outline-CtS592mc.js";import{t as l}from"./button-CA0dewJJ.js";import{a as u,r as d}from"./dist-mv8e6dBX.js";import{c as f,o as p}from"./dist-DsLZcVyZ.js";import{i as m,n as h,t as g}from"./tooltip-DHXgxWLL.js";import{_,d as v,f as y,g as b,h as x,l as S,m as C,p as w,u as T,v as E}from"./dialog-HdfR4WGm.js";import{c as D,d as O,f as k,l as A,m as j,o as M,p as N,r as P,u as F,w as I}from"./terminal-cli-display-w0URjEKX.js";import{a as L,d as R,f as z,i as B,n as ee,o as V,p as H,u as U}from"./dropdown-menu-CLgDYkh1.js";import{$r as W,Kt as G,oo as te}from"./dist-DGemBD_J.js";import{n as ne}from"./dist-D81TFAXh.js";import{s as re}from"./documents-events-B2g_1xMi.js";import{t as K}from"./createLucideIcon-Bhw2PmPp.js";import{o as ie}from"./use-open-skill-BNgqZmZx.js";import{t as ae}from"./spinner-BxJv3FRl.js";import{c as q,n as oe,r as J}from"./skill-scope-gUkJkFRO.js";import{A as se,M as ce,S as le,x as ue}from"./skills-api-DriOKSSy.js";import{t as de}from"./use-skills-DJ009sMa.js";var Y=t(),X=e(r(),1),Z=o(),fe=3100,pe=3;function me(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??pe;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var he={0:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},1:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},2:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},3:{count:16,startRadius:11,baseDistance:7,distanceVariance:3,sizeMin:.45,sizeMax:1.2,maxDelay:500,durationMin:1100,durationMax:2400}},ge=[`var(--color-azure-blue)`,`var(--color-sky-blue)`,`var(--color-violet-300)`,`var(--color-orange-light)`,`var(--color-crystal-blue)`,`var(--color-white-cream)`];function _e(e,t={}){let n=t.rng??Math.random,r=t.colors??ge,i=he[e];if(i.count===0||r.length===0)return[];let a=[],o=Math.PI*2/i.count;for(let e=0;e<i.count;e++){let t=e*o+(n()-.5)*o*.7,s=i.baseDistance+(n()-.5)*2*i.distanceVariance,c=i.sizeMin+n()*(i.sizeMax-i.sizeMin),l=n()*i.maxDelay,u=i.durationMin+n()*(i.durationMax-i.durationMin),d=Math.floor(n()*r.length),f=Math.cos(t),p=Math.sin(t);a.push({id:e,dx:f*s,dy:p*s,originDx:f*i.startRadius,originDy:p*i.startRadius,size:c,color:r[d]??`currentColor`,delay:l,duration:u})}return a}var ve=1.8,ye=90,be=16,xe=380,Se=.025,Ce=.1,we=.18,Te=400,Ee=9.2736,De=18.1799,Oe=14.5244,ke={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function Ae(e,t){let{halfWidth:n,apexLift:r}=ke[t];return`M${e-n} ${Oe+.3} Q${e} ${Oe-r}, ${e+n} ${Oe+.3}`}function je(e){let t=1.5,n=.3;return`M${e-t} ${Oe-n} Q${e} ${Oe+1.4}, ${e+t} ${Oe-n}`}var Me=15,Ne=15;function Pe(e){return{fill:e.color,"--fx-tx":`${e.dx}px`,"--fx-ty":`${e.dy}px`,"--fx-delay":`${e.delay}ms`,"--fx-duration":`${e.duration}ms`}}function Fe(e){let t=(0,Z.c)(73),{size:n,className:r,style:i,trackMouse:a,variant:o,celebrateSignal:l,onRage:u}=e,d=n===void 0?48:n,f=a===void 0?!0:a,p=o===void 0?`default`:o,m=l===void 0?0:l,h=(0,X.useRef)(null),g=(0,X.useRef)(null),_=(0,X.useRef)(null),v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v={x:0,y:0},t[0]=v):v=t[0];let y=(0,X.useRef)(v),[b,x]=(0,X.useState)(0),[S,C]=(0,X.useState)(0),[w,T]=(0,X.useState)(0),E;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(E=[],t[1]=E):E=t[1];let[D,O]=(0,X.useState)(E),k=(0,X.useRef)(0),A=(0,X.useRef)(0),j=(0,X.useRef)(void 0),M=p===`sleeping`,N;t[2]!==b||t[3]!==M||t[4]!==u?(N=function(){if(M)return;let e=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),t=A.current===0?1/0:e-A.current;A.current=e;let n=me(b,t),r=b===3&&e-k.current<3100,i=n===3&&r;n===3&&u?.(),x(n),C(Ve),i||(O(_e(n)),n===3&&(k.current=e,T(Be))),clearTimeout(j.current),j.current=setTimeout(()=>{x(0),O([])},fe)},t[2]=b,t[3]=M,t[4]=u,t[5]=N):N=t[5];let P=N,F,I;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>()=>clearTimeout(j.current),I=[],t[6]=F,t[7]=I):(F=t[6],I=t[7]),(0,X.useEffect)(F,I);let L,R;t[8]!==m||t[9]!==M?(L=()=>{m===0||M||(x(3),C(ze),O(_e(3)),k.current=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),T(Re),clearTimeout(j.current),j.current=setTimeout(()=>{x(0),O([])},fe))},R=[m,M],t[8]=m,t[9]=M,t[10]=L,t[11]=R):(L=t[10],R=t[11]),(0,X.useEffect)(L,R);let z,B;t[12]!==M||t[13]!==f?(z=()=>{if(!f||M||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=0,t=0,n=!1,r=0,i=0,a=0,o=0,s=0,c=function(){s===0&&(s=requestAnimationFrame(u))},l=function(r){e=r.clientX,t=r.clientY,n=!0,c()};function u(){s=0;let l=g.current,u=h.current;if(!l||!u){c();return}let d=n;n=!1;let f=l.getBoundingClientRect(),p=f.left+f.width/2,m=f.top+f.height*.48,v=e-p,b=t-m,x=Math.hypot(v,b),S=Math.max(-1,Math.min(1,v/xe)),C=-Math.max(-1,Math.min(1,b/xe))*be,w=S*be,T=0,E=0;if(x>=1){let e=Math.min(x/ye,1)*ve;T=v/x*e,E=b/x*e}let D=Math.abs(C-r)<.01&&Math.abs(w-i)<.01&&Math.abs(T-a)<.01&&Math.abs(E-o)<.01;if(!d&&D)return;c(),r+=(C-r)*Ce,i+=(w-i)*Ce,u.style.transform=`perspective(${Te}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(T-a)*we,o+=(E-o)*we;let O=i*Se,k=-r*Se,A=a+O,j=o+k;y.current.x=A,y.current.y=j,_.current?.setAttribute(`transform`,`translate(${A.toFixed(3)} ${j.toFixed(3)})`)}return document.addEventListener(`mousemove`,l,{passive:!0}),c(),()=>{document.removeEventListener(`mousemove`,l),s!==0&&cancelAnimationFrame(s),s=0,h.current&&(h.current.style.transform=``),y.current={x:0,y:0},_.current?.removeAttribute(`transform`)}},B=[f,M],t[12]=M,t[13]=f,t[14]=z,t[15]=B):(z=t[14],B=t[15]),(0,X.useEffect)(z,B);let ee;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(ee=()=>{let e=_.current;if(!e)return;let{x:t,y:n}=y.current;e.setAttribute(`transform`,`translate(${t.toFixed(3)} ${n.toFixed(3)})`)},t[16]=ee):ee=t[16],(0,X.useLayoutEffect)(ee);let V=b>0,H=V?b:1,U=V?`ok-blob-clicked-${b}`:null,W;t[17]===r?W=t[18]:(W=s(`ok-blob-3d-wrapper`,r),t[17]=r,t[18]=W);let G=M?`cursor-default`:`cursor-pointer`,te=`body-${S}`,ne=M&&`ok-blob-sleeping`,re;t[19]!==U||t[20]!==ne?(re=s(`ok-blob-group`,ne,U),t[19]=U,t[20]=ne,t[21]=re):re=t[21];let K;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Y.jsx)(`path`,{d:c,className:`ok-blob-body`}),t[22]=K):K=t[22];let ie=(V||M)&&`ok-blob-eye-hidden`,ae;t[23]===ie?ae=t[24]:(ae=s(`ok-blob-eye`,ie),t[23]=ie,t[24]=ae);let q;t[25]===ae?q=t[26]:(q=(0,Y.jsx)(`ellipse`,{cx:Ee,cy:Oe,rx:1.2722,ry:1.9083,className:ae}),t[25]=ae,t[26]=q);let oe=(V||M)&&`ok-blob-eye-hidden`,J;t[27]===oe?J=t[28]:(J=s(`ok-blob-eye ok-blob-eye-right`,oe),t[27]=oe,t[28]=J);let se;t[29]===J?se=t[30]:(se=(0,Y.jsx)(`ellipse`,{cx:De,cy:Oe,rx:1.2722,ry:1.9083,className:J}),t[29]=J,t[30]=se);let ce;t[31]===H?ce=t[32]:(ce=Ae(Ee,H),t[31]=H,t[32]=ce);let le=(!V||M)&&`ok-blob-eye-hidden`,ue;t[33]===le?ue=t[34]:(ue=s(`ok-blob-happy-eye`,le),t[33]=le,t[34]=ue);let de;t[35]!==ce||t[36]!==ue?(de=(0,Y.jsx)(`path`,{d:ce,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:ue}),t[35]=ce,t[36]=ue,t[37]=de):de=t[37];let pe;t[38]===H?pe=t[39]:(pe=Ae(De,H),t[38]=H,t[39]=pe);let he=(!V||M)&&`ok-blob-eye-hidden`,ge;t[40]===he?ge=t[41]:(ge=s(`ok-blob-happy-eye`,he),t[40]=he,t[41]=ge);let ke;t[42]!==pe||t[43]!==ge?(ke=(0,Y.jsx)(`path`,{d:pe,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:ge}),t[42]=pe,t[43]=ge,t[44]=ke):ke=t[44];let Me;t[45]===M?Me=t[46]:(Me=M?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{d:je(Ee),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,Y.jsx)(`path`,{d:je(De),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[45]=M,t[46]=Me);let Ne;t[47]!==q||t[48]!==se||t[49]!==de||t[50]!==ke||t[51]!==Me?(Ne=(0,Y.jsxs)(`g`,{ref:_,children:[q,se,de,ke,Me]}),t[47]=q,t[48]=se,t[49]=de,t[50]=ke,t[51]=Me,t[52]=Ne):Ne=t[52];let Pe;t[53]!==te||t[54]!==re||t[55]!==Ne?(Pe=(0,Y.jsxs)(`g`,{className:re,children:[K,Ne]},te),t[53]=te,t[54]=re,t[55]=Ne,t[56]=Pe):Pe=t[56];let Fe;t[57]===M?Fe=t[58]:(Fe=M?(0,Y.jsxs)(`g`,{children:[(0,Y.jsx)(`text`,{x:21,y:7,className:`ok-blob-z ok-blob-z-1`,children:`z`}),(0,Y.jsx)(`text`,{x:26,y:2,className:`ok-blob-z ok-blob-z-2`,children:`z`})]}):null,t[57]=M,t[58]=Fe);let He;t[59]!==w||t[60]!==D?(He=D.length>0&&(0,Y.jsx)(`g`,{"data-slot":`ok-blob-burst`,children:D.map(Ie)},`firework-${w}`),t[59]=w,t[60]=D,t[61]=He):He=t[61];let Ue;t[62]!==P||t[63]!==d||t[64]!==G||t[65]!==Pe||t[66]!==Fe||t[67]!==He?(Ue=(0,Y.jsxs)(`svg`,{ref:g,width:d,height:d,viewBox:`0 0 30 30`,fill:`none`,overflow:`visible`,xmlns:`http://www.w3.org/2000/svg`,className:G,"aria-hidden":`true`,onClick:P,onMouseDown:Le,children:[Pe,Fe,He]}),t[62]=P,t[63]=d,t[64]=G,t[65]=Pe,t[66]=Fe,t[67]=He,t[68]=Ue):Ue=t[68];let We;return t[69]!==i||t[70]!==W||t[71]!==Ue?(We=(0,Y.jsx)(`span`,{ref:h,className:W,style:i,children:Ue}),t[69]=i,t[70]=W,t[71]=Ue,t[72]=We):We=t[72],We}function Ie(e){return(0,Y.jsx)(`circle`,{cx:Me+e.originDx,cy:Ne+e.originDy,r:e.size,className:`ok-blob-firework`,style:Pe(e)},e.id)}function Le(e){return e.preventDefault()}function Re(e){return e+1}function ze(e){return e+1}function Be(e){return e+1}function Ve(e){return e+1}var He=`AlertDialog`,[Ue,We]=f(He,[E]),Q=E(),Ge=e=>{let{__scopeAlertDialog:t,...n}=e,r=Q(t);return(0,Y.jsx)(C,{...r,...n,modal:!0})};Ge.displayName=He;var Ke=`AlertDialogTrigger`,qe=X.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Q(n);return(0,Y.jsx)(b,{...i,...r,ref:t})});qe.displayName=Ke;var Je=`AlertDialogPortal`,Ye=e=>{let{__scopeAlertDialog:t,...n}=e,r=Q(t);return(0,Y.jsx)(w,{...r,...n})};Ye.displayName=Je;var Xe=`AlertDialogOverlay`,Ze=X.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Q(n);return(0,Y.jsx)(y,{...i,...r,ref:t})});Ze.displayName=Xe;var Qe=`AlertDialogContent`,[$e,et]=Ue(Qe),tt=d(`AlertDialogContent`),nt=X.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=Q(n),o=X.useRef(null),s=u(t,o),c=X.useRef(null);return(0,Y.jsx)(_,{contentName:Qe,titleName:rt,docsSlug:`alert-dialog`,children:(0,Y.jsx)($e,{scope:n,cancelRef:c,children:(0,Y.jsxs)(T,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:p(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,Y.jsx)(tt,{children:r}),(0,Y.jsx)(dt,{contentRef:o})]})})})});nt.displayName=Qe;var rt=`AlertDialogTitle`,it=X.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Q(n);return(0,Y.jsx)(x,{...i,...r,ref:t})});it.displayName=rt;var at=`AlertDialogDescription`,ot=X.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Q(n);return(0,Y.jsx)(v,{...i,...r,ref:t})});ot.displayName=at;var st=`AlertDialogAction`,ct=X.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Q(n);return(0,Y.jsx)(S,{...i,...r,ref:t})});ct.displayName=st;var lt=`AlertDialogCancel`,ut=X.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=et(lt,n),a=Q(n),o=u(t,i);return(0,Y.jsx)(S,{...a,...r,ref:o})});ut.displayName=lt;var dt=({contentRef:e})=>{let t=`\`${Qe}\` requires a description for the component to be accessible for screen reader users.
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Mn as n}from"./DocumentContext-HSIpKTjH.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./utils-CPqDy6Hr.js";import{t as c}from"./mascot-outline-CtS592mc.js";import{t as l}from"./button-CA0dewJJ.js";import{a as u,r as d}from"./dist-mv8e6dBX.js";import{c as f,o as p}from"./dist-DsLZcVyZ.js";import{i as m,n as h,t as g}from"./tooltip-DHXgxWLL.js";import{_,d as v,f as y,g as b,h as x,l as S,m as C,p as w,u as T,v as E}from"./dialog-HdfR4WGm.js";import{c as D,d as O,f as k,l as A,m as j,o as M,p as N,r as P,u as F,w as I}from"./terminal-cli-display-BTQdEy1j.js";import{a as L,d as R,f as z,i as B,n as ee,o as V,p as H,u as U}from"./dropdown-menu-CLgDYkh1.js";import{$r as W,Kt as G,oo as te}from"./dist-DGemBD_J.js";import{n as ne}from"./dist-D81TFAXh.js";import{s as re}from"./documents-events-B2g_1xMi.js";import{t as K}from"./createLucideIcon-Bhw2PmPp.js";import{o as ie}from"./use-open-skill-D7aPRwcl.js";import{t as ae}from"./spinner-BxJv3FRl.js";import{c as q,n as oe,r as J}from"./skill-scope-gUkJkFRO.js";import{A as se,F as ce,M as le,S as ue,x as de}from"./skills-api-DO54o34O.js";var Y=t(),X=e(r(),1),Z=o(),fe=3100,pe=3;function me(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??pe;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var he={0:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},1:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},2:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},3:{count:16,startRadius:11,baseDistance:7,distanceVariance:3,sizeMin:.45,sizeMax:1.2,maxDelay:500,durationMin:1100,durationMax:2400}},ge=[`var(--color-azure-blue)`,`var(--color-sky-blue)`,`var(--color-violet-300)`,`var(--color-orange-light)`,`var(--color-crystal-blue)`,`var(--color-white-cream)`];function _e(e,t={}){let n=t.rng??Math.random,r=t.colors??ge,i=he[e];if(i.count===0||r.length===0)return[];let a=[],o=Math.PI*2/i.count;for(let e=0;e<i.count;e++){let t=e*o+(n()-.5)*o*.7,s=i.baseDistance+(n()-.5)*2*i.distanceVariance,c=i.sizeMin+n()*(i.sizeMax-i.sizeMin),l=n()*i.maxDelay,u=i.durationMin+n()*(i.durationMax-i.durationMin),d=Math.floor(n()*r.length),f=Math.cos(t),p=Math.sin(t);a.push({id:e,dx:f*s,dy:p*s,originDx:f*i.startRadius,originDy:p*i.startRadius,size:c,color:r[d]??`currentColor`,delay:l,duration:u})}return a}var ve=1.8,ye=90,be=16,xe=380,Se=.025,Ce=.1,we=.18,Te=400,Ee=9.2736,De=18.1799,Oe=14.5244,ke={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function Ae(e,t){let{halfWidth:n,apexLift:r}=ke[t];return`M${e-n} ${Oe+.3} Q${e} ${Oe-r}, ${e+n} ${Oe+.3}`}function je(e){let t=1.5,n=.3;return`M${e-t} ${Oe-n} Q${e} ${Oe+1.4}, ${e+t} ${Oe-n}`}var Me=15,Ne=15;function Pe(e){return{fill:e.color,"--fx-tx":`${e.dx}px`,"--fx-ty":`${e.dy}px`,"--fx-delay":`${e.delay}ms`,"--fx-duration":`${e.duration}ms`}}function Fe(e){let t=(0,Z.c)(73),{size:n,className:r,style:i,trackMouse:a,variant:o,celebrateSignal:l,onRage:u}=e,d=n===void 0?48:n,f=a===void 0?!0:a,p=o===void 0?`default`:o,m=l===void 0?0:l,h=(0,X.useRef)(null),g=(0,X.useRef)(null),_=(0,X.useRef)(null),v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v={x:0,y:0},t[0]=v):v=t[0];let y=(0,X.useRef)(v),[b,x]=(0,X.useState)(0),[S,C]=(0,X.useState)(0),[w,T]=(0,X.useState)(0),E;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(E=[],t[1]=E):E=t[1];let[D,O]=(0,X.useState)(E),k=(0,X.useRef)(0),A=(0,X.useRef)(0),j=(0,X.useRef)(void 0),M=p===`sleeping`,N;t[2]!==b||t[3]!==M||t[4]!==u?(N=function(){if(M)return;let e=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),t=A.current===0?1/0:e-A.current;A.current=e;let n=me(b,t),r=b===3&&e-k.current<3100,i=n===3&&r;n===3&&u?.(),x(n),C(Ve),i||(O(_e(n)),n===3&&(k.current=e,T(Be))),clearTimeout(j.current),j.current=setTimeout(()=>{x(0),O([])},fe)},t[2]=b,t[3]=M,t[4]=u,t[5]=N):N=t[5];let P=N,F,I;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>()=>clearTimeout(j.current),I=[],t[6]=F,t[7]=I):(F=t[6],I=t[7]),(0,X.useEffect)(F,I);let L,R;t[8]!==m||t[9]!==M?(L=()=>{m===0||M||(x(3),C(ze),O(_e(3)),k.current=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),T(Re),clearTimeout(j.current),j.current=setTimeout(()=>{x(0),O([])},fe))},R=[m,M],t[8]=m,t[9]=M,t[10]=L,t[11]=R):(L=t[10],R=t[11]),(0,X.useEffect)(L,R);let z,B;t[12]!==M||t[13]!==f?(z=()=>{if(!f||M||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=0,t=0,n=!1,r=0,i=0,a=0,o=0,s=0,c=function(){s===0&&(s=requestAnimationFrame(u))},l=function(r){e=r.clientX,t=r.clientY,n=!0,c()};function u(){s=0;let l=g.current,u=h.current;if(!l||!u){c();return}let d=n;n=!1;let f=l.getBoundingClientRect(),p=f.left+f.width/2,m=f.top+f.height*.48,v=e-p,b=t-m,x=Math.hypot(v,b),S=Math.max(-1,Math.min(1,v/xe)),C=-Math.max(-1,Math.min(1,b/xe))*be,w=S*be,T=0,E=0;if(x>=1){let e=Math.min(x/ye,1)*ve;T=v/x*e,E=b/x*e}let D=Math.abs(C-r)<.01&&Math.abs(w-i)<.01&&Math.abs(T-a)<.01&&Math.abs(E-o)<.01;if(!d&&D)return;c(),r+=(C-r)*Ce,i+=(w-i)*Ce,u.style.transform=`perspective(${Te}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(T-a)*we,o+=(E-o)*we;let O=i*Se,k=-r*Se,A=a+O,j=o+k;y.current.x=A,y.current.y=j,_.current?.setAttribute(`transform`,`translate(${A.toFixed(3)} ${j.toFixed(3)})`)}return document.addEventListener(`mousemove`,l,{passive:!0}),c(),()=>{document.removeEventListener(`mousemove`,l),s!==0&&cancelAnimationFrame(s),s=0,h.current&&(h.current.style.transform=``),y.current={x:0,y:0},_.current?.removeAttribute(`transform`)}},B=[f,M],t[12]=M,t[13]=f,t[14]=z,t[15]=B):(z=t[14],B=t[15]),(0,X.useEffect)(z,B);let ee;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(ee=()=>{let e=_.current;if(!e)return;let{x:t,y:n}=y.current;e.setAttribute(`transform`,`translate(${t.toFixed(3)} ${n.toFixed(3)})`)},t[16]=ee):ee=t[16],(0,X.useLayoutEffect)(ee);let V=b>0,H=V?b:1,U=V?`ok-blob-clicked-${b}`:null,W;t[17]===r?W=t[18]:(W=s(`ok-blob-3d-wrapper`,r),t[17]=r,t[18]=W);let G=M?`cursor-default`:`cursor-pointer`,te=`body-${S}`,ne=M&&`ok-blob-sleeping`,re;t[19]!==U||t[20]!==ne?(re=s(`ok-blob-group`,ne,U),t[19]=U,t[20]=ne,t[21]=re):re=t[21];let K;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Y.jsx)(`path`,{d:c,className:`ok-blob-body`}),t[22]=K):K=t[22];let ie=(V||M)&&`ok-blob-eye-hidden`,ae;t[23]===ie?ae=t[24]:(ae=s(`ok-blob-eye`,ie),t[23]=ie,t[24]=ae);let q;t[25]===ae?q=t[26]:(q=(0,Y.jsx)(`ellipse`,{cx:Ee,cy:Oe,rx:1.2722,ry:1.9083,className:ae}),t[25]=ae,t[26]=q);let oe=(V||M)&&`ok-blob-eye-hidden`,J;t[27]===oe?J=t[28]:(J=s(`ok-blob-eye ok-blob-eye-right`,oe),t[27]=oe,t[28]=J);let se;t[29]===J?se=t[30]:(se=(0,Y.jsx)(`ellipse`,{cx:De,cy:Oe,rx:1.2722,ry:1.9083,className:J}),t[29]=J,t[30]=se);let ce;t[31]===H?ce=t[32]:(ce=Ae(Ee,H),t[31]=H,t[32]=ce);let le=(!V||M)&&`ok-blob-eye-hidden`,ue;t[33]===le?ue=t[34]:(ue=s(`ok-blob-happy-eye`,le),t[33]=le,t[34]=ue);let de;t[35]!==ce||t[36]!==ue?(de=(0,Y.jsx)(`path`,{d:ce,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:ue}),t[35]=ce,t[36]=ue,t[37]=de):de=t[37];let pe;t[38]===H?pe=t[39]:(pe=Ae(De,H),t[38]=H,t[39]=pe);let he=(!V||M)&&`ok-blob-eye-hidden`,ge;t[40]===he?ge=t[41]:(ge=s(`ok-blob-happy-eye`,he),t[40]=he,t[41]=ge);let ke;t[42]!==pe||t[43]!==ge?(ke=(0,Y.jsx)(`path`,{d:pe,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:ge}),t[42]=pe,t[43]=ge,t[44]=ke):ke=t[44];let Me;t[45]===M?Me=t[46]:(Me=M?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{d:je(Ee),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,Y.jsx)(`path`,{d:je(De),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[45]=M,t[46]=Me);let Ne;t[47]!==q||t[48]!==se||t[49]!==de||t[50]!==ke||t[51]!==Me?(Ne=(0,Y.jsxs)(`g`,{ref:_,children:[q,se,de,ke,Me]}),t[47]=q,t[48]=se,t[49]=de,t[50]=ke,t[51]=Me,t[52]=Ne):Ne=t[52];let Pe;t[53]!==te||t[54]!==re||t[55]!==Ne?(Pe=(0,Y.jsxs)(`g`,{className:re,children:[K,Ne]},te),t[53]=te,t[54]=re,t[55]=Ne,t[56]=Pe):Pe=t[56];let Fe;t[57]===M?Fe=t[58]:(Fe=M?(0,Y.jsxs)(`g`,{children:[(0,Y.jsx)(`text`,{x:21,y:7,className:`ok-blob-z ok-blob-z-1`,children:`z`}),(0,Y.jsx)(`text`,{x:26,y:2,className:`ok-blob-z ok-blob-z-2`,children:`z`})]}):null,t[57]=M,t[58]=Fe);let He;t[59]!==w||t[60]!==D?(He=D.length>0&&(0,Y.jsx)(`g`,{"data-slot":`ok-blob-burst`,children:D.map(Ie)},`firework-${w}`),t[59]=w,t[60]=D,t[61]=He):He=t[61];let Ue;t[62]!==P||t[63]!==d||t[64]!==G||t[65]!==Pe||t[66]!==Fe||t[67]!==He?(Ue=(0,Y.jsxs)(`svg`,{ref:g,width:d,height:d,viewBox:`0 0 30 30`,fill:`none`,overflow:`visible`,xmlns:`http://www.w3.org/2000/svg`,className:G,"aria-hidden":`true`,onClick:P,onMouseDown:Le,children:[Pe,Fe,He]}),t[62]=P,t[63]=d,t[64]=G,t[65]=Pe,t[66]=Fe,t[67]=He,t[68]=Ue):Ue=t[68];let We;return t[69]!==i||t[70]!==W||t[71]!==Ue?(We=(0,Y.jsx)(`span`,{ref:h,className:W,style:i,children:Ue}),t[69]=i,t[70]=W,t[71]=Ue,t[72]=We):We=t[72],We}function Ie(e){return(0,Y.jsx)(`circle`,{cx:Me+e.originDx,cy:Ne+e.originDy,r:e.size,className:`ok-blob-firework`,style:Pe(e)},e.id)}function Le(e){return e.preventDefault()}function Re(e){return e+1}function ze(e){return e+1}function Be(e){return e+1}function Ve(e){return e+1}var He=`AlertDialog`,[Ue,We]=f(He,[E]),Q=E(),Ge=e=>{let{__scopeAlertDialog:t,...n}=e,r=Q(t);return(0,Y.jsx)(C,{...r,...n,modal:!0})};Ge.displayName=He;var Ke=`AlertDialogTrigger`,qe=X.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Q(n);return(0,Y.jsx)(b,{...i,...r,ref:t})});qe.displayName=Ke;var Je=`AlertDialogPortal`,Ye=e=>{let{__scopeAlertDialog:t,...n}=e,r=Q(t);return(0,Y.jsx)(w,{...r,...n})};Ye.displayName=Je;var Xe=`AlertDialogOverlay`,Ze=X.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Q(n);return(0,Y.jsx)(y,{...i,...r,ref:t})});Ze.displayName=Xe;var Qe=`AlertDialogContent`,[$e,et]=Ue(Qe),tt=d(`AlertDialogContent`),nt=X.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=Q(n),o=X.useRef(null),s=u(t,o),c=X.useRef(null);return(0,Y.jsx)(_,{contentName:Qe,titleName:rt,docsSlug:`alert-dialog`,children:(0,Y.jsx)($e,{scope:n,cancelRef:c,children:(0,Y.jsxs)(T,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:p(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,Y.jsx)(tt,{children:r}),(0,Y.jsx)(dt,{contentRef:o})]})})})});nt.displayName=Qe;var rt=`AlertDialogTitle`,it=X.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Q(n);return(0,Y.jsx)(x,{...i,...r,ref:t})});it.displayName=rt;var at=`AlertDialogDescription`,ot=X.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Q(n);return(0,Y.jsx)(v,{...i,...r,ref:t})});ot.displayName=at;var st=`AlertDialogAction`,ct=X.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Q(n);return(0,Y.jsx)(S,{...i,...r,ref:t})});ct.displayName=st;var lt=`AlertDialogCancel`,ut=X.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=et(lt,n),a=Q(n),o=u(t,i);return(0,Y.jsx)(S,{...a,...r,ref:o})});ut.displayName=lt;var dt=({contentRef:e})=>{let t=`\`${Qe}\` requires a description for the component to be accessible for screen reader users.
2
2
 
3
3
  You can add a description to the \`${Qe}\` by passing a \`${at}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
4
4
 
5
5
  Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Qe}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
6
6
 
7
- For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return X.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},ft=Ge,pt=Ye,mt=Ze,ht=nt,gt=ct,_t=ut,vt=it,yt=ot,bt=K(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),xt=K(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),St=K(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Ct=[...new Set(I.flatMap(e=>e.schemes))];function wt(e,t){let n=t.now?.()??Date.now(),r={};for(let t of I){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 Tt(e){return wt({},e)}async function Et(e){let t=e.schemes??Ct,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 Dt=Object.fromEntries(Ct.map(e=>[e,{installed:!1}]));async function Ot(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 Dt}if(!t.ok)return Dt;let n;try{n=await t.json()}catch{return Dt}if(typeof n!=`object`||!n||Array.isArray(n))return Dt;let r=n,i={};for(let e of Ct)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function kt(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 At(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Tt({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=wt(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=!kt(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 jt(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Mt(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>Et({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>Ot({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Nt(){let e=(0,Z.c)(5),[t,n]=(0,X.useState)(Pt),r=(0,X.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=At(Mt());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,X.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 Pt(){return Tt({isElectronHost:jt(),now:Date.now})}var Ft=(0,X.createContext)(null);function It(e){let t=(0,Z.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,Y.jsx)(Ft,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Lt(){return(0,X.use)(Ft)}function Rt(e){let t=(0,Z.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,Y.jsx)(ft,{"data-slot":`alert-dialog`,...n}),t[2]=n,t[3]=r),r}function zt(e){let t=(0,Z.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,Y.jsx)(pt,{"data-slot":`alert-dialog-portal`,...n}),t[2]=n,t[3]=r),r}function Bt(e){let t=(0,Z.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=s(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs [-webkit-app-region:no-drag] data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(mt,{"data-slot":`alert-dialog-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Vt(e){let t=(0,Z.c)(9),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]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Y.jsx)(Bt,{}),t[3]=i):i=t[3];let a;t[4]===n?a=t[5]:(a=s(`fixed top-1/2 left-1/2 z-50 flex w-full max-w-[calc(100%-2rem)] max-h-[calc(100dvh-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col gap-6 overflow-hidden rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm [-webkit-app-region:no-drag] 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`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a?(o=(0,Y.jsxs)(zt,{children:[i,(0,Y.jsx)(ht,{"data-slot":`alert-dialog-content`,className:a,...r})]}),t[6]=r,t[7]=a,t[8]=o):o=t[8],o}function Ht(e){let t=(0,Z.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=s(`flex shrink-0 flex-col gap-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ut(e){let t=(0,Z.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=s(`-mx-6 min-h-0 flex-1 overflow-y-auto px-6 subtle-scrollbar scroll-fade-mask`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`div`,{"data-slot":`alert-dialog-body`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Wt(e){let t=(0,Z.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=s(`-mx-6 -mb-6 flex shrink-0 flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 px-6 py-4 sm:flex-row sm:justify-end`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Gt(e){let t=(0,Z.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=s(`font-heading text-base leading-none font-medium`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(vt,{"data-slot":`alert-dialog-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Kt(e){let t=(0,Z.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=s(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(yt,{"data-slot":`alert-dialog-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function qt(e){let t=(0,Z.c)(14),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:i,size:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`outline`:i,c=a===void 0?`default`:a,u;t[5]===n?u=t[6]:(u=s(`font-mono uppercase`,n),t[5]=n,t[6]=u);let d;t[7]!==r||t[8]!==u?(d=(0,Y.jsx)(_t,{"data-slot":`alert-dialog-cancel`,className:u,...r}),t[7]=r,t[8]=u,t[9]=d):d=t[9];let f;return t[10]!==c||t[11]!==d||t[12]!==o?(f=(0,Y.jsx)(l,{variant:o,size:c,asChild:!0,children:d}),t[10]=c,t[11]=d,t[12]=o,t[13]=f):f=t[13],f}function Jt(e){let t=(0,Z.c)(14),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:i,size:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`default`:i,c=a===void 0?`default`:a,u;t[5]===n?u=t[6]:(u=s(n),t[5]=n,t[6]=u);let d;t[7]!==r||t[8]!==u?(d=(0,Y.jsx)(gt,{"data-slot":`alert-dialog-action`,className:u,...r}),t[7]=r,t[8]=u,t[9]=d):d=t[9];let f;return t[10]!==c||t[11]!==d||t[12]!==o?(f=(0,Y.jsx)(l,{variant:o,size:c,asChild:!0,children:d}),t[10]=c,t[11]=d,t[12]=o,t[13]=f):f=t[13],f}function Yt(e){let t=(0,Z.c)(48),{itemName:n,isSubmitting:r,onDelete:o,customTitle:s,customDescription:c,customDetail:u,customConfirmLabel:d,customConfirmLabelBusy:f,children:p}=e,{_:m}=a(),h;t[0]!==m||t[1]!==n?(h=n??m({id:`L3CEC1`}),t[0]=m,t[1]=n,t[2]=h):h=t[2];let g=h,_;t[3]!==m||t[4]!==d?(_=d??m({id:`cnGeoo`}),t[3]=m,t[4]=d,t[5]=_):_=t[5];let v=_,y;t[6]!==m||t[7]!==d||t[8]!==f?(y=f??d??m({id:`s3caR3`}),t[6]=m,t[7]=d,t[8]=f,t[9]=y):y=t[9];let b=y,x;t[10]!==m||t[11]!==s||t[12]!==g?(x=s??m({id:`77SdEP`,values:{itemName:g}}),t[10]=m,t[11]=s,t[12]=g,t[13]=x):x=t[13];let S;t[14]===x?S=t[15]:(S=(0,Y.jsx)(Gt,{children:x}),t[14]=x,t[15]=S);let C;t[16]!==m||t[17]!==c||t[18]!==g?(C=c??m({id:`16D5Zj`,values:{itemName:g}}),t[16]=m,t[17]=c,t[18]=g,t[19]=C):C=t[19];let w;t[20]===C?w=t[21]:(w=(0,Y.jsx)(Kt,{className:`whitespace-pre-wrap`,children:C}),t[20]=C,t[21]=w);let T;t[22]===u?T=t[23]:(T=u?(0,Y.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`delete-confirmation-detail`,children:u}):null,t[22]=u,t[23]=T);let E;t[24]!==S||t[25]!==w||t[26]!==T?(E=(0,Y.jsxs)(Ht,{children:[S,w,T]}),t[24]=S,t[25]=w,t[26]=T,t[27]=E):E=t[27];let D;t[28]===p?D=t[29]:(D=p?(0,Y.jsx)(Ut,{children:p}):null,t[28]=p,t[29]=D);let O;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Y.jsx)(i,{id:`dEgA5A`}),t[30]=O):O=t[30];let k;t[31]===r?k=t[32]:(k=(0,Y.jsx)(qt,{disabled:r,children:O}),t[31]=r,t[32]=k);let A;t[33]!==v||t[34]!==b||t[35]!==r?(A=r?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(ae,{"aria-hidden":`true`,className:`size-4`}),` `,b]}):v,t[33]=v,t[34]=b,t[35]=r,t[36]=A):A=t[36];let j;t[37]!==r||t[38]!==o||t[39]!==A?(j=(0,Y.jsx)(l,{variant:`destructive`,onClick:o,disabled:r,children:A}),t[37]=r,t[38]=o,t[39]=A,t[40]=j):j=t[40];let M;t[41]!==k||t[42]!==j?(M=(0,Y.jsxs)(Wt,{children:[k,j]}),t[41]=k,t[42]=j,t[43]=M):M=t[43];let N;return t[44]!==D||t[45]!==M||t[46]!==E?(N=(0,Y.jsxs)(Vt,{children:[E,D,M]}),t[44]=D,t[45]=M,t[46]=E,t[47]=N):N=t[47],N}function Xt(e){return e===`agents`||e===`.agents`||e.startsWith(`.agents/`)?`.agents`:e.includes(`/`)?e:te[e]??e}function Zt(e){return e===`claude`?`claude-code`:e}function Qt(e){let t=(0,Z.c)(18),r,i;if(t[0]===e?(r=t[1],i=t[2]):({host:r,...i}=e,t[0]=e,t[1]=r,t[2]=i),r===`agents`){let e;return t[3]===i?e=t[4]:(e=(0,Y.jsx)(n,{...i}),t[3]=i,t[4]=e),e}if(r.includes(`/`)){if(r===`.agents`||r.startsWith(`.agents/`)){let e;return t[5]===i?e=t[6]:(e=(0,Y.jsx)(n,{...i}),t[5]=i,t[6]=e),e}if(r===`.ok`||r.startsWith(`.ok/`)){let e;if(t[7]!==i){let{className:n,...r}=i;e=r,t[7]=i,t[8]=e}else e=t[8];let n=e,r;return t[9]===n?r=t[10]:(r=(0,Y.jsx)(Fe,{size:14,...n}),t[9]=n,t[10]=r),r}let e;return t[11]===i?e=t[12]:(e=(0,Y.jsx)(ie,{...i}),t[11]=i,t[12]=e),e}let a;t[13]===r?a=t[14]:(a=Zt(r),t[13]=r,t[14]=a);let o;return t[15]!==i||t[16]!==a?(o=(0,Y.jsx)(P,{...i,id:a}),t[15]=i,t[16]=a,t[17]=o):o=t[17],o}function $t(e){let t=(0,Z.c)(14),{hosts:n,className:r,iconClassName:i}=e,a,o,c;if(t[0]!==r||t[1]!==n||t[2]!==i){let e=n.slice(0,2),l=n.slice(2);t[6]===r?a=t[7]:(a=s(`flex items-center gap-1`,r),t[6]=r,t[7]=a);let u;t[8]===i?u=t[9]:(u=e=>(0,Y.jsxs)(g,{children:[(0,Y.jsx)(m,{asChild:!0,children:(0,Y.jsx)(`span`,{className:`flex shrink-0 items-center`,children:(0,Y.jsx)(Qt,{host:e,className:s(`size-3.5 shrink-0`,i),"aria-label":Xt(e)})})}),(0,Y.jsx)(h,{children:Xt(e)})]},e),t[8]=i,t[9]=u),o=e.map(u),c=l.length>0?(0,Y.jsxs)(g,{children:[(0,Y.jsx)(m,{asChild:!0,children:(0,Y.jsxs)(`span`,{className:`ml-0.5 cursor-default`,children:[`+`,l.length]})}),(0,Y.jsx)(h,{children:l.map(Xt).join(`, `)})]}):null,t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=c}else a=t[3],o=t[4],c=t[5];let l;return t[10]!==a||t[11]!==o||t[12]!==c?(l=(0,Y.jsxs)(`span`,{className:a,children:[o,c]}),t[10]=a,t[11]=o,t[12]=c,t[13]=l):l=t[13],l}function en(e){let t=(0,Z.c)(6),{testId:n,title:r}=e,a;t[0]===r?a=t[1]:(a=r===void 0?{}:{title:r},t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(i,{id:`YjiZAs`}),t[2]=o):o=t[2];let s;return t[3]!==a||t[4]!==n?(s=(0,Y.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide`,"data-testid":n,...a,children:o}),t[3]=a,t[4]=n,t[5]=s):s=t[5],s}function tn(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(D,{...r}):(0,Y.jsx)(B,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function nn(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(A,{...r}):(0,Y.jsx)(L,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function rn(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(M,{...r}):(0,Y.jsx)(ee,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function an(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(F,{...r}):(0,Y.jsx)(V,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function on(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(O,{...r}):(0,Y.jsx)(U,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function sn(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(k,{...r}):(0,Y.jsx)(R,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function cn(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(N,{...r}):(0,Y.jsx)(z,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ln(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(j,{...r}):(0,Y.jsx)(H,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var un=Object.freeze({hosts:null,source:null}),dn=new Map,fn=new Map;function pn(e,t){return`${e}:${t}`}function mn(e){return dn.get(e)??un}function hn(e,t){let n=fn.get(e)??new Set;return fn.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&fn.delete(e)}}function gn(e,t){let n=mn(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?dn.delete(e):dn.set(e,r);for(let t of fn.get(e)??[])t()}}var _n=G.options,vn=`.agents/`;function yn({skill:e,allSkills:t,hostSet:n,sourceHostOverlay:r,linkMode:i}){let a=t=>e?`${q(t,e.scope)}/${e.name}`:null,o=e!==void 0&&((e.hosts??[]).includes(`agents`)||t?.some(e=>e.hosts.includes(`agents`)||e.path.startsWith(vn))),s=e?.hostAliases??(e&&t!==null?Object.assign({},...t.filter(t=>t.scope===e.scope).map(e=>e.hostAliases??{})):{}),c=e?.installableEditors??(e&&t!==null?t.find(t=>t.scope===e.scope)?.installableEditors:void 0),l=c?new Set(c):null,u=(o?[..._n,`agents`]:_n).filter(e=>!(e in s)).filter(e=>e===`agents`||l===null||l.has(e)||n.has(e)),d=new Set(u.map(e=>a(e))),f=e?.scope===`global`?`~/`:``,p=e?.path?.includes(`/`)?`${f}${e.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,m=p!==null&&!d.has(p)?p:null,h=m===null?r??e?.hosts?.[0]:void 0,g=new Set(e?.conflictHosts??[]),_=new Set(e?.driftPaths??[]),v=new Set(e?.symlinkedHosts??[]),y=[...[...n].filter(e=>e!==h&&!(e in s)&&!g.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:a(e)??e,mode:v.has(e)?`link`:`copy`})),...(e?.customPlacements??[]).map(e=>({target:J(e),display:`${f}${e.path}`,mode:e.mode}))],b=y.map(e=>e.mode),x=b.filter(e=>e===`link`).length,S=b.length===0?i?`link`:`copy`:x*2>=b.length?`link`:`copy`,C=new Map((e?.customPlacements??[]).map(e=>[J(e),e])),w=new Set(C.keys());if(t!==null&&e){for(let n of t)if(n.scope===e.scope)for(let e of n.customPlacements??[]){let t=J(e);t!==``&&w.add(t)}}return{pathFor:a,aliases:s,rows:u,sourceRow:m,sourceHost:h,conflicted:g,drifted:_,linked:v,expectedMode:S,convertible:y,customRootRows:e===void 0?[]:[...w].sort().map(t=>({root:t,display:`${f}${t}/${e.name}`,placed:C.get(t)??null})).filter(e=>!d.has(e.display)&&e.display!==p&&!(e.root in s))}}var bn=`min-w-[24rem]`;function xn(e,t){let n=(0,Z.c)(45),r=t.installingName===e.name,i=(0,X.useRef)(e),[a,o]=(0,X.useState)(!1),s=(0,X.useRef)(!1),c,l;n[0]===r?(c=n[1],l=n[2]):(c=()=>{s.current&&!r&&o(!0),s.current=r},l=[r],n[0]=r,n[1]=c,n[2]=l),(0,X.useEffect)(c,l);let u,d;n[3]===e?(u=n[4],d=n[5]):(u=()=>{e!==i.current&&(i.current=e,o(!1))},d=[e],n[3]=e,n[4]=u,n[5]=d),(0,X.useEffect)(u,d);let f=r||a,p;n[6]!==e.name||n[7]!==e.scope?(p=pn(e.scope,e.name),n[6]=e.name,n[7]=e.scope,n[8]=p):p=n[8];let m=p,h,g;n[9]===m?(h=n[10],g=n[11]):(h=e=>hn(m,e),g=()=>mn(m),n[9]=m,n[10]=h,n[11]=g);let _=(0,X.useSyncExternalStore)(h,g),v=_.hosts,y=_.source,b,x;n[12]!==y||n[13]!==m||n[14]!==e.hosts?(b=()=>{y!==null&&e.hosts[0]===y&&gn(m,{source:null})},x=[e.hosts,y,m],n[12]=y,n[13]=m,n[14]=e.hosts,n[15]=b,n[16]=x):(b=n[15],x=n[16]),(0,X.useEffect)(b,x);let S=e.linkMode===!0,C=v??e.hosts,w;n[17]===C?w=n[18]:(w=new Set(C),n[17]=C,n[18]=w);let T=w,E=v?v.length>0:e.installed,D=(0,X.useRef)(e.hosts),O,k;n[19]!==v||n[20]!==e.hosts?(O=()=>{v===null&&(D.current=e.hosts)},k=[v,e.hosts],n[19]=v,n[20]=e.hosts,n[21]=O,n[22]=k):(O=n[21],k=n[22]),(0,X.useEffect)(O,k);let A;n[23]===e.hosts?A=n[24]:(A=[...e.hosts].sort().join(`,`),n[23]=e.hosts,n[24]=A);let j=A,M,N;n[25]!==m||n[26]!==j?(M=()=>{let e=mn(m).hosts;e&&[...e].sort().join(`,`)===j&&gn(m,{hosts:null})},N=[j,m],n[25]=m,n[26]=j,n[27]=M,n[28]=N):(M=n[27],N=n[28]),(0,X.useEffect)(M,N);let P=(0,X.useRef)(null),F=(0,X.useRef)(null),I,L;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{P.current&&clearTimeout(P.current),F.current?.(),F.current=null},L=[],n[29]=I,n[30]=L):(I=n[29],L=n[30]),(0,X.useEffect)(I,L);let R;n[31]!==t||n[32]!==m||n[33]!==e?(R=function(n,r){D.current=n,gn(m,{hosts:n}),P.current&&clearTimeout(P.current);let i=async()=>{F.current=null,P.current=null;let r=await t.install(e,n.filter(W));if(!r.ok){gn(m,{hosts:null});return}D.current=[...r.hosts],gn(m,{hosts:[...r.hosts]})};r?(F.current=()=>void i(),P.current=setTimeout(()=>void i(),350)):(F.current=null,i())},n[31]=t,n[32]=m,n[33]=e,n[34]=R):R=n[34];let z=R,B;return n[35]!==t||n[36]!==z||n[37]!==T||n[38]!==E||n[39]!==f||n[40]!==y||n[41]!==m||n[42]!==S||n[43]!==e?(B={hostSet:T,installed:E,installing:f,toggleEditor(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),z([...n],!0)},installAll(){let t=D.current.filter(wn),n=e.installableEditors??_n,r=_n.filter(e=>n.includes(e)||D.current.includes(e));z([...t,...r],!1)},linkMode:S,sourceHost:y??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>ue({scope:e.scope,name:e.name,dir:n,mode:r})).then(Cn)},unplaceAt(n){t.runLocationWrite(e,()=>ce({scope:e.scope,name:e.name,path:n})).then(Sn)},setSource(n){gn(m,{source:n}),t.runLocationWrite(e,()=>se({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(gn(m,{source:null}),ne.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=z,n[37]=T,n[38]=E,n[39]=f,n[40]=y,n[41]=m,n[42]=S,n[43]=e,n[44]=B):B=n[44],B}function Sn(e){e.ok||ne.error(e.error)}function Cn(e){e.ok||ne.error(e.error)}function wn(e){return!_n.includes(e)}function $(e){let t=(0,Z.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,Y.jsx)(m,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,Y.jsx)(h,{side:`right`,className:`max-w-xs`,children:n}),t[2]=n,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Y.jsxs)(g,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Tn(e){let t=(0,Z.c)(77),{toggles:n,skill:r,onResolveFork:o,onRunStart:s,menuKind:c}=e,u=c===void 0?`dropdown`:c,{_:d}=a(),{hostSet:f,toggleEditor:p,installAll:m}=n,h=de(),g,_,v,y,b,x,S,C,w,T;if(t[0]!==d||t[1]!==h.data||t[2]!==h.status||t[3]!==f||t[4]!==m||t[5]!==u||t[6]!==o||t[7]!==s||t[8]!==r||t[9]!==p||t[10]!==n){let{pathFor:e,aliases:a,rows:c,sourceRow:E,sourceHost:D,conflicted:O,drifted:k,linked:A,expectedMode:j,convertible:M,customRootRows:N}=yn({skill:r,allSkills:h.status===`ready`?h.data:null,hostSet:f,sourceHostOverlay:n.sourceHost,linkMode:n.linkMode});b=c,x=E,y=j,_=M,v=N;let P=e=>oe(a,e),F=Mn,I=e=>{let t=P(e);return t.length===0?!0:window.confirm(d({id:`Uobeu9`,values:{0:t.map(F).join(`, `),rootRel:e}}))},L;t[21]!==d||t[22]!==r?(L=(e,t)=>{let n=e.includes(`/`)?e:q(e,r?.scope??`project`);return(0,Y.jsx)($,{hint:d({id:`0dslv8`,values:{0:F(e),1:F(e),2:r?.name??``,poolRootRel:t,subRoot:n}}),children:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":d({id:`G6Lrs_`,values:{0:F(e)}}),onClick:i=>{i.preventDefault(),i.stopPropagation(),window.confirm(d({id:`iiqOKM`,values:{0:F(e),1:r.name,2:F(e),subRoot:n,poolRootRel:t}}))&&le({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?re():ne.error(d({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,Y.jsx)(Qt,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[21]=d,t[22]=r,t[23]=L):L=t[23];let R=L;g=n.installing;let z=jn,B;t[24]!==d||t[25]!==s||t[26]!==n?(B=(e,t,r)=>{let a=r===`link`?`copy`:`link`;return(0,Y.jsx)($,{hint:d(r===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 font-normal text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:r=>{r.preventDefault(),r.stopPropagation(),window.confirm(d(a===`link`?{id:`m0eHej`,values:{display:t}}:{id:`HbcQYf`,values:{display:t}}))&&(s?.(),n.convertLocation?.(e,a))},"data-testid":`skill-convert-${e}`,children:r===`link`?(0,Y.jsx)(i,{id:`uUCrBv`}):(0,Y.jsx)(i,{id:`iaPtht`})})})},t[24]=d,t[25]=s,t[26]=n,t[27]=B):B=t[27];let ee=B,V;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Y.jsx)(i,{id:`npcziF`}),t[28]=V):V=t[28];let H;t[29]===d?H=t[30]:(H=d({id:`6f_UX4`}),t[29]=d,t[30]=H);let U;t[31]===m?U=t[32]:(U=()=>m(),t[31]=m,t[32]=U);let W;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Y.jsx)(i,{id:`N40H-G`}),t[33]=W):W=t[33];let G;t[34]!==g||t[35]!==U?(G=(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:g,onClick:U,"data-testid":`skill-install-all`,children:W}),t[34]=g,t[35]=U,t[36]=G):G=t[36];let K;t[37]!==H||t[38]!==G?(K=(0,Y.jsx)($,{hint:H,children:G}),t[37]=H,t[38]=G,t[39]=K):K=t[39],t[40]!==u||t[41]!==K?(S=(0,Y.jsxs)(an,{menuKind:u,className:`flex items-center justify-between gap-2`,children:[V,K]}),t[40]=u,t[41]=K,t[42]=S):S=t[42],C=x===null?null:(0,Y.jsx)($,{hint:d({id:`pXB6SL`}),children:(0,Y.jsxs)(rn,{menuKind:u,disabled:g,checked:!0,onSelect:An,"data-testid":`skill-source-row`,children:[(0,Y.jsx)(ie,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:x}),(()=>{let e=z(x).split(`/`).slice(0,-1).join(`/`),t=P(e);return t.length>0?(0,Y.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-source`,children:t.map(t=>R(t,e))}):null})(),(0,Y.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,Y.jsx)(i,{id:`tiFPjk`})})]})]})}),w=b.map(t=>{let a=e(t),s=t===`agents`?`.agents`:te[t],c=z(a).split(`/`).slice(0,-1).join(`/`),m=P(c);return(0,Y.jsx)($,{hint:O.has(t)?d({id:`8HvJlU`,values:{0:a??s}}):t===D?a?d({id:`ssk6rl`,values:{path:a}}):s:f.has(t)?d(a?{id:`9ieZhu`,values:{path:a}}:{id:`n3T3EE`,values:{label:s}}):d(a?y===`link`?{id:`1LtA5r`,values:{path:a}}:{id:`opPbzN`,values:{path:a}}:{id:`Pp0Vgd`,values:{label:s}}),children:(0,Y.jsxs)(rn,{menuKind:u,disabled:g,checked:f.has(t),onCheckedChange:e=>{O.has(t)||e===!0&&!I(c)||p(t,e===!0)},onSelect:kn,className:`group`,"data-testid":`skill-install-editor-${t}`,children:[(0,Y.jsx)(Qt,{host:t,"aria-hidden":!0,className:`size-4`}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:a??s}),m.length>0?(0,Y.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${t}`,children:m.map(e=>R(e,c))}):null,O.has(t)?(0,Y.jsx)($,{hint:d({id:`_O7dJS`}),children:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:e=>{e.preventDefault(),o?.(t)},"data-testid":`skill-fork-chip-${t}`,children:(0,Y.jsx)(i,{id:`jng7Ko`})})}):t===D?(0,Y.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,Y.jsx)(i,{id:`tiFPjk`})}):f.has(t)&&r?.hosts?(0,Y.jsxs)(Y.Fragment,{children:[!g&&(A.has(t)?`link`:`copy`)!==y?ee(t,a??s,A.has(t)?`link`:`copy`):null,(0,Y.jsx)($,{hint:d({id:`nBgzKO`}),children:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:e=>{e.preventDefault(),e.stopPropagation(),n.setSource?.(t)},"data-testid":`skill-set-source-${t}`,children:(0,Y.jsx)(i,{id:`VNNRfN`})})})]}):null,!g&&k.has(z(a))?(0,Y.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,Y.jsx)(en,{testId:`skill-drift-${t}`})}):null]})]})},t)}),T=v.map(e=>(0,Y.jsx)($,{hint:e.placed===null?d(y===`link`?{id:`ybWWR2`,values:{0:e.display}}:{id:`fDjZxw`,values:{0:e.display}}):d({id:`C0cll5`,values:{0:e.display}}),children:(0,Y.jsxs)(rn,{menuKind:u,disabled:g,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!I(e.root))return;n.placeAt(e.root,y)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:On,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,Y.jsx)(Qt,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,Y.jsx)(ie,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.display}),P(e.root).length>0?(0,Y.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-custom-${e.root}`,children:P(e.root).map(t=>R(t,e.root))}):null,!g&&e.placed!==null&&k.has(e.placed.path)?(0,Y.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,Y.jsx)(en,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,Y.jsxs)(Y.Fragment,{children:[!g&&e.placed.mode!==y?ee(e.root,e.display,e.placed.mode):null,(0,Y.jsx)($,{hint:d({id:`nBgzKO`}),children:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.setSource?.(e.root)},"data-testid":`skill-set-source-custom-${e.root}`,children:(0,Y.jsx)(i,{id:`VNNRfN`})})})]})]})]})},e.root)),t[0]=d,t[1]=h.data,t[2]=h.status,t[3]=f,t[4]=m,t[5]=u,t[6]=o,t[7]=s,t[8]=r,t[9]=p,t[10]=n,t[11]=g,t[12]=_,t[13]=v,t[14]=y,t[15]=b,t[16]=x,t[17]=S,t[18]=C,t[19]=w,t[20]=T}else g=t[11],_=t[12],v=t[13],y=t[14],b=t[15],x=t[16],S=t[17],C=t[18],w=t[19],T=t[20];let E;t[43]!==v||t[44]!==b.length||t[45]!==x?(E=b.length===0&&v.length===0&&x===null?(0,Y.jsx)(`div`,{className:`px-2 py-1.5 text-[11px] text-muted-foreground leading-snug`,"data-testid":`skill-install-no-destinations`,children:(0,Y.jsx)(i,{id:`MOAoFO`})}):null,t[43]=v,t[44]=b.length,t[45]=x,t[46]=E):E=t[46];let D;t[47]!==d||t[48]!==g||t[49]!==_||t[50]!==y||t[51]!==s||t[52]!==n?(D=_.length>0&&n.convertLocations?(0,Y.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-1 pb-1.5`,children:[(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-auto whitespace-normal p-0 text-left font-normal text-[11px] text-muted-foreground leading-snug hover:bg-transparent hover:text-foreground`,onClick:e=>{e.preventDefault();let t=y===`link`?`copy`:`link`,r=_.filter(e=>e.mode!==t);if(r.length===0)return;let i=d(t===`copy`?{id:`iOAsF1`}:{id:`MS8lMS`}),a=d(t===`copy`?{id:`gZiT5e`}:{id:`PhIa-X`}),o=r.map(Dn).join(`
7
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return X.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},ft=Ge,pt=Ye,mt=Ze,ht=nt,gt=ct,_t=ut,vt=it,yt=ot,bt=K(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),xt=K(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),St=K(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Ct=[...new Set(I.flatMap(e=>e.schemes))];function wt(e,t){let n=t.now?.()??Date.now(),r={};for(let t of I){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 Tt(e){return wt({},e)}async function Et(e){let t=e.schemes??Ct,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 Dt=Object.fromEntries(Ct.map(e=>[e,{installed:!1}]));async function Ot(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 Dt}if(!t.ok)return Dt;let n;try{n=await t.json()}catch{return Dt}if(typeof n!=`object`||!n||Array.isArray(n))return Dt;let r=n,i={};for(let e of Ct)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function kt(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 At(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Tt({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=wt(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=!kt(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 jt(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Mt(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>Et({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>Ot({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Nt(){let e=(0,Z.c)(5),[t,n]=(0,X.useState)(Pt),r=(0,X.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=At(Mt());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,X.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 Pt(){return Tt({isElectronHost:jt(),now:Date.now})}var Ft=(0,X.createContext)(null);function It(e){let t=(0,Z.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,Y.jsx)(Ft,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Lt(){return(0,X.use)(Ft)}function Rt(e){let t=(0,Z.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,Y.jsx)(ft,{"data-slot":`alert-dialog`,...n}),t[2]=n,t[3]=r),r}function zt(e){let t=(0,Z.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,Y.jsx)(pt,{"data-slot":`alert-dialog-portal`,...n}),t[2]=n,t[3]=r),r}function Bt(e){let t=(0,Z.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=s(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs [-webkit-app-region:no-drag] data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(mt,{"data-slot":`alert-dialog-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Vt(e){let t=(0,Z.c)(9),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]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Y.jsx)(Bt,{}),t[3]=i):i=t[3];let a;t[4]===n?a=t[5]:(a=s(`fixed top-1/2 left-1/2 z-50 flex w-full max-w-[calc(100%-2rem)] max-h-[calc(100dvh-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col gap-6 overflow-hidden rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm [-webkit-app-region:no-drag] 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`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a?(o=(0,Y.jsxs)(zt,{children:[i,(0,Y.jsx)(ht,{"data-slot":`alert-dialog-content`,className:a,...r})]}),t[6]=r,t[7]=a,t[8]=o):o=t[8],o}function Ht(e){let t=(0,Z.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=s(`flex shrink-0 flex-col gap-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ut(e){let t=(0,Z.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=s(`-mx-6 min-h-0 flex-1 overflow-y-auto px-6 subtle-scrollbar scroll-fade-mask`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`div`,{"data-slot":`alert-dialog-body`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Wt(e){let t=(0,Z.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=s(`-mx-6 -mb-6 flex shrink-0 flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 px-6 py-4 sm:flex-row sm:justify-end`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Gt(e){let t=(0,Z.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=s(`font-heading text-base leading-none font-medium`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(vt,{"data-slot":`alert-dialog-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Kt(e){let t=(0,Z.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=s(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(yt,{"data-slot":`alert-dialog-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function qt(e){let t=(0,Z.c)(14),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:i,size:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`outline`:i,c=a===void 0?`default`:a,u;t[5]===n?u=t[6]:(u=s(`font-mono uppercase`,n),t[5]=n,t[6]=u);let d;t[7]!==r||t[8]!==u?(d=(0,Y.jsx)(_t,{"data-slot":`alert-dialog-cancel`,className:u,...r}),t[7]=r,t[8]=u,t[9]=d):d=t[9];let f;return t[10]!==c||t[11]!==d||t[12]!==o?(f=(0,Y.jsx)(l,{variant:o,size:c,asChild:!0,children:d}),t[10]=c,t[11]=d,t[12]=o,t[13]=f):f=t[13],f}function Jt(e){let t=(0,Z.c)(14),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:i,size:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`default`:i,c=a===void 0?`default`:a,u;t[5]===n?u=t[6]:(u=s(n),t[5]=n,t[6]=u);let d;t[7]!==r||t[8]!==u?(d=(0,Y.jsx)(gt,{"data-slot":`alert-dialog-action`,className:u,...r}),t[7]=r,t[8]=u,t[9]=d):d=t[9];let f;return t[10]!==c||t[11]!==d||t[12]!==o?(f=(0,Y.jsx)(l,{variant:o,size:c,asChild:!0,children:d}),t[10]=c,t[11]=d,t[12]=o,t[13]=f):f=t[13],f}function Yt(e){let t=(0,Z.c)(48),{itemName:n,isSubmitting:r,onDelete:o,customTitle:s,customDescription:c,customDetail:u,customConfirmLabel:d,customConfirmLabelBusy:f,children:p}=e,{_:m}=a(),h;t[0]!==m||t[1]!==n?(h=n??m({id:`L3CEC1`}),t[0]=m,t[1]=n,t[2]=h):h=t[2];let g=h,_;t[3]!==m||t[4]!==d?(_=d??m({id:`cnGeoo`}),t[3]=m,t[4]=d,t[5]=_):_=t[5];let v=_,y;t[6]!==m||t[7]!==d||t[8]!==f?(y=f??d??m({id:`s3caR3`}),t[6]=m,t[7]=d,t[8]=f,t[9]=y):y=t[9];let b=y,x;t[10]!==m||t[11]!==s||t[12]!==g?(x=s??m({id:`77SdEP`,values:{itemName:g}}),t[10]=m,t[11]=s,t[12]=g,t[13]=x):x=t[13];let S;t[14]===x?S=t[15]:(S=(0,Y.jsx)(Gt,{children:x}),t[14]=x,t[15]=S);let C;t[16]!==m||t[17]!==c||t[18]!==g?(C=c??m({id:`16D5Zj`,values:{itemName:g}}),t[16]=m,t[17]=c,t[18]=g,t[19]=C):C=t[19];let w;t[20]===C?w=t[21]:(w=(0,Y.jsx)(Kt,{className:`whitespace-pre-wrap`,children:C}),t[20]=C,t[21]=w);let T;t[22]===u?T=t[23]:(T=u?(0,Y.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`delete-confirmation-detail`,children:u}):null,t[22]=u,t[23]=T);let E;t[24]!==S||t[25]!==w||t[26]!==T?(E=(0,Y.jsxs)(Ht,{children:[S,w,T]}),t[24]=S,t[25]=w,t[26]=T,t[27]=E):E=t[27];let D;t[28]===p?D=t[29]:(D=p?(0,Y.jsx)(Ut,{children:p}):null,t[28]=p,t[29]=D);let O;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Y.jsx)(i,{id:`dEgA5A`}),t[30]=O):O=t[30];let k;t[31]===r?k=t[32]:(k=(0,Y.jsx)(qt,{disabled:r,children:O}),t[31]=r,t[32]=k);let A;t[33]!==v||t[34]!==b||t[35]!==r?(A=r?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(ae,{"aria-hidden":`true`,className:`size-4`}),` `,b]}):v,t[33]=v,t[34]=b,t[35]=r,t[36]=A):A=t[36];let j;t[37]!==r||t[38]!==o||t[39]!==A?(j=(0,Y.jsx)(l,{variant:`destructive`,onClick:o,disabled:r,children:A}),t[37]=r,t[38]=o,t[39]=A,t[40]=j):j=t[40];let M;t[41]!==k||t[42]!==j?(M=(0,Y.jsxs)(Wt,{children:[k,j]}),t[41]=k,t[42]=j,t[43]=M):M=t[43];let N;return t[44]!==D||t[45]!==M||t[46]!==E?(N=(0,Y.jsxs)(Vt,{children:[E,D,M]}),t[44]=D,t[45]=M,t[46]=E,t[47]=N):N=t[47],N}function Xt(e){return e===`agents`||e===`.agents`||e.startsWith(`.agents/`)?`.agents`:e.includes(`/`)?e:te[e]??e}function Zt(e){return e===`claude`?`claude-code`:e}function Qt(e){let t=(0,Z.c)(18),r,i;if(t[0]===e?(r=t[1],i=t[2]):({host:r,...i}=e,t[0]=e,t[1]=r,t[2]=i),r===`agents`){let e;return t[3]===i?e=t[4]:(e=(0,Y.jsx)(n,{...i}),t[3]=i,t[4]=e),e}if(r.includes(`/`)){if(r===`.agents`||r.startsWith(`.agents/`)){let e;return t[5]===i?e=t[6]:(e=(0,Y.jsx)(n,{...i}),t[5]=i,t[6]=e),e}if(r===`.ok`||r.startsWith(`.ok/`)){let e;if(t[7]!==i){let{className:n,...r}=i;e=r,t[7]=i,t[8]=e}else e=t[8];let n=e,r;return t[9]===n?r=t[10]:(r=(0,Y.jsx)(Fe,{size:14,...n}),t[9]=n,t[10]=r),r}let e;return t[11]===i?e=t[12]:(e=(0,Y.jsx)(ie,{...i}),t[11]=i,t[12]=e),e}let a;t[13]===r?a=t[14]:(a=Zt(r),t[13]=r,t[14]=a);let o;return t[15]!==i||t[16]!==a?(o=(0,Y.jsx)(P,{...i,id:a}),t[15]=i,t[16]=a,t[17]=o):o=t[17],o}function $t(e){let t=(0,Z.c)(14),{hosts:n,className:r,iconClassName:i}=e,a,o,c;if(t[0]!==r||t[1]!==n||t[2]!==i){let e=n.slice(0,2),l=n.slice(2);t[6]===r?a=t[7]:(a=s(`flex items-center gap-1`,r),t[6]=r,t[7]=a);let u;t[8]===i?u=t[9]:(u=e=>(0,Y.jsxs)(g,{children:[(0,Y.jsx)(m,{asChild:!0,children:(0,Y.jsx)(`span`,{className:`flex shrink-0 items-center`,children:(0,Y.jsx)(Qt,{host:e,className:s(`size-3.5 shrink-0`,i),"aria-label":Xt(e)})})}),(0,Y.jsx)(h,{children:Xt(e)})]},e),t[8]=i,t[9]=u),o=e.map(u),c=l.length>0?(0,Y.jsxs)(g,{children:[(0,Y.jsx)(m,{asChild:!0,children:(0,Y.jsxs)(`span`,{className:`ml-0.5 cursor-default`,children:[`+`,l.length]})}),(0,Y.jsx)(h,{children:l.map(Xt).join(`, `)})]}):null,t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=c}else a=t[3],o=t[4],c=t[5];let l;return t[10]!==a||t[11]!==o||t[12]!==c?(l=(0,Y.jsxs)(`span`,{className:a,children:[o,c]}),t[10]=a,t[11]=o,t[12]=c,t[13]=l):l=t[13],l}function en(e){let t=(0,Z.c)(6),{testId:n,title:r}=e,a;t[0]===r?a=t[1]:(a=r===void 0?{}:{title:r},t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(i,{id:`YjiZAs`}),t[2]=o):o=t[2];let s;return t[3]!==a||t[4]!==n?(s=(0,Y.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide`,"data-testid":n,...a,children:o}),t[3]=a,t[4]=n,t[5]=s):s=t[5],s}function tn(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(D,{...r}):(0,Y.jsx)(B,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function nn(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(A,{...r}):(0,Y.jsx)(L,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function rn(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(M,{...r}):(0,Y.jsx)(ee,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function an(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(F,{...r}):(0,Y.jsx)(V,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function on(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(O,{...r}):(0,Y.jsx)(U,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function sn(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(k,{...r}):(0,Y.jsx)(R,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function cn(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(N,{...r}):(0,Y.jsx)(z,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ln(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,Y.jsx)(j,{...r}):(0,Y.jsx)(H,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var un=Object.freeze({hosts:null,source:null}),dn=new Map,fn=new Map;function pn(e,t){return`${e}:${t}`}function mn(e){return dn.get(e)??un}function hn(e,t){let n=fn.get(e)??new Set;return fn.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&fn.delete(e)}}function gn(e,t){let n=mn(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?dn.delete(e):dn.set(e,r);for(let t of fn.get(e)??[])t()}}var _n=G.options,vn=`.agents/`;function yn({skill:e,allSkills:t,hostSet:n,sourceHostOverlay:r,linkMode:i}){let a=t=>e?`${q(t,e.scope)}/${e.name}`:null,o=e!==void 0&&((e.hosts??[]).includes(`agents`)||t?.some(e=>e.hosts.includes(`agents`)||e.path.startsWith(vn))),s=e?.hostAliases??(e&&t!==null?Object.assign({},...t.filter(t=>t.scope===e.scope).map(e=>e.hostAliases??{})):{}),c=e?.installableEditors??(e&&t!==null?t.find(t=>t.scope===e.scope)?.installableEditors:void 0),l=c?new Set(c):null,u=(o?[..._n,`agents`]:_n).filter(e=>!(e in s)).filter(e=>e===`agents`||l===null||l.has(e)||n.has(e)),d=new Set(u.map(e=>a(e))),f=e?.scope===`global`?`~/`:``,p=e?.path?.includes(`/`)?`${f}${e.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,m=p!==null&&!d.has(p)?p:null,h=m===null?r??e?.hosts?.[0]:void 0,g=new Set(e?.conflictHosts??[]),_=new Set(e?.driftPaths??[]),v=new Set(e?.symlinkedHosts??[]),y=[...[...n].filter(e=>e!==h&&!(e in s)&&!g.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:a(e)??e,mode:v.has(e)?`link`:`copy`})),...(e?.customPlacements??[]).map(e=>({target:J(e),display:`${f}${e.path}`,mode:e.mode}))],b=y.map(e=>e.mode),x=b.filter(e=>e===`link`).length,S=b.length===0?i?`link`:`copy`:x*2>=b.length?`link`:`copy`,C=new Map((e?.customPlacements??[]).map(e=>[J(e),e])),w=new Set(C.keys());if(t!==null&&e){for(let n of t)if(n.scope===e.scope)for(let e of n.customPlacements??[]){let t=J(e);t!==``&&w.add(t)}}return{pathFor:a,aliases:s,rows:u,sourceRow:m,sourceHost:h,conflicted:g,drifted:_,linked:v,expectedMode:S,convertible:y,customRootRows:e===void 0?[]:[...w].sort().map(t=>({root:t,display:`${f}${t}/${e.name}`,placed:C.get(t)??null})).filter(e=>!d.has(e.display)&&e.display!==p&&!(e.root in s))}}var bn=`min-w-[24rem]`;function xn(e,t){let n=(0,Z.c)(45),r=t.installingName===e.name,i=(0,X.useRef)(e),[a,o]=(0,X.useState)(!1),s=(0,X.useRef)(!1),c,l;n[0]===r?(c=n[1],l=n[2]):(c=()=>{s.current&&!r&&o(!0),s.current=r},l=[r],n[0]=r,n[1]=c,n[2]=l),(0,X.useEffect)(c,l);let u,d;n[3]===e?(u=n[4],d=n[5]):(u=()=>{e!==i.current&&(i.current=e,o(!1))},d=[e],n[3]=e,n[4]=u,n[5]=d),(0,X.useEffect)(u,d);let f=r||a,p;n[6]!==e.name||n[7]!==e.scope?(p=pn(e.scope,e.name),n[6]=e.name,n[7]=e.scope,n[8]=p):p=n[8];let m=p,h,g;n[9]===m?(h=n[10],g=n[11]):(h=e=>hn(m,e),g=()=>mn(m),n[9]=m,n[10]=h,n[11]=g);let _=(0,X.useSyncExternalStore)(h,g),v=_.hosts,y=_.source,b,x;n[12]!==y||n[13]!==m||n[14]!==e.hosts?(b=()=>{y!==null&&e.hosts[0]===y&&gn(m,{source:null})},x=[e.hosts,y,m],n[12]=y,n[13]=m,n[14]=e.hosts,n[15]=b,n[16]=x):(b=n[15],x=n[16]),(0,X.useEffect)(b,x);let S=e.linkMode===!0,C=v??e.hosts,w;n[17]===C?w=n[18]:(w=new Set(C),n[17]=C,n[18]=w);let T=w,E=v?v.length>0:e.installed,D=(0,X.useRef)(e.hosts),O,k;n[19]!==v||n[20]!==e.hosts?(O=()=>{v===null&&(D.current=e.hosts)},k=[v,e.hosts],n[19]=v,n[20]=e.hosts,n[21]=O,n[22]=k):(O=n[21],k=n[22]),(0,X.useEffect)(O,k);let A;n[23]===e.hosts?A=n[24]:(A=[...e.hosts].sort().join(`,`),n[23]=e.hosts,n[24]=A);let j=A,M,N;n[25]!==m||n[26]!==j?(M=()=>{let e=mn(m).hosts;e&&[...e].sort().join(`,`)===j&&gn(m,{hosts:null})},N=[j,m],n[25]=m,n[26]=j,n[27]=M,n[28]=N):(M=n[27],N=n[28]),(0,X.useEffect)(M,N);let P=(0,X.useRef)(null),F=(0,X.useRef)(null),I,L;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{P.current&&clearTimeout(P.current),F.current?.(),F.current=null},L=[],n[29]=I,n[30]=L):(I=n[29],L=n[30]),(0,X.useEffect)(I,L);let R;n[31]!==t||n[32]!==m||n[33]!==e?(R=function(n,r){D.current=n,gn(m,{hosts:n}),P.current&&clearTimeout(P.current);let i=async()=>{F.current=null,P.current=null;let r=await t.install(e,n.filter(W));if(!r.ok){gn(m,{hosts:null});return}D.current=[...r.hosts],gn(m,{hosts:[...r.hosts]})};r?(F.current=()=>void i(),P.current=setTimeout(()=>void i(),350)):(F.current=null,i())},n[31]=t,n[32]=m,n[33]=e,n[34]=R):R=n[34];let z=R,B;return n[35]!==t||n[36]!==z||n[37]!==T||n[38]!==E||n[39]!==f||n[40]!==y||n[41]!==m||n[42]!==S||n[43]!==e?(B={hostSet:T,installed:E,installing:f,toggleEditor(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),z([...n],!0)},installAll(){let t=D.current.filter(wn),n=e.installableEditors??_n,r=_n.filter(e=>n.includes(e)||D.current.includes(e));z([...t,...r],!1)},linkMode:S,sourceHost:y??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>de({scope:e.scope,name:e.name,dir:n,mode:r})).then(Cn)},unplaceAt(n){t.runLocationWrite(e,()=>le({scope:e.scope,name:e.name,path:n})).then(Sn)},setSource(n){gn(m,{source:n}),t.runLocationWrite(e,()=>se({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(gn(m,{source:null}),ne.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=z,n[37]=T,n[38]=E,n[39]=f,n[40]=y,n[41]=m,n[42]=S,n[43]=e,n[44]=B):B=n[44],B}function Sn(e){e.ok||ne.error(e.error)}function Cn(e){e.ok||ne.error(e.error)}function wn(e){return!_n.includes(e)}function $(e){let t=(0,Z.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,Y.jsx)(m,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,Y.jsx)(h,{side:`right`,className:`max-w-xs`,children:n}),t[2]=n,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Y.jsxs)(g,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Tn(e){let t=(0,Z.c)(77),{toggles:n,skill:r,onResolveFork:o,onRunStart:s,menuKind:c}=e,u=c===void 0?`dropdown`:c,{_:d}=a(),{hostSet:f,toggleEditor:p,installAll:m}=n,h=ce(),g,_,v,y,b,x,S,C,w,T;if(t[0]!==d||t[1]!==h.data||t[2]!==h.status||t[3]!==f||t[4]!==m||t[5]!==u||t[6]!==o||t[7]!==s||t[8]!==r||t[9]!==p||t[10]!==n){let{pathFor:e,aliases:a,rows:c,sourceRow:E,sourceHost:D,conflicted:O,drifted:k,linked:A,expectedMode:j,convertible:M,customRootRows:N}=yn({skill:r,allSkills:h.status===`ready`?h.data:null,hostSet:f,sourceHostOverlay:n.sourceHost,linkMode:n.linkMode});b=c,x=E,y=j,_=M,v=N;let P=e=>oe(a,e),F=Mn,I=e=>{let t=P(e);return t.length===0?!0:window.confirm(d({id:`Uobeu9`,values:{0:t.map(F).join(`, `),rootRel:e}}))},L;t[21]!==d||t[22]!==r?(L=(e,t)=>{let n=e.includes(`/`)?e:q(e,r?.scope??`project`);return(0,Y.jsx)($,{hint:d({id:`0dslv8`,values:{0:F(e),1:F(e),2:r?.name??``,poolRootRel:t,subRoot:n}}),children:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":d({id:`G6Lrs_`,values:{0:F(e)}}),onClick:i=>{i.preventDefault(),i.stopPropagation(),window.confirm(d({id:`iiqOKM`,values:{0:F(e),1:r.name,2:F(e),subRoot:n,poolRootRel:t}}))&&ue({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?re():ne.error(d({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,Y.jsx)(Qt,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[21]=d,t[22]=r,t[23]=L):L=t[23];let R=L;g=n.installing;let z=jn,B;t[24]!==d||t[25]!==s||t[26]!==n?(B=(e,t,r)=>{let a=r===`link`?`copy`:`link`;return(0,Y.jsx)($,{hint:d(r===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 font-normal text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:r=>{r.preventDefault(),r.stopPropagation(),window.confirm(d(a===`link`?{id:`m0eHej`,values:{display:t}}:{id:`HbcQYf`,values:{display:t}}))&&(s?.(),n.convertLocation?.(e,a))},"data-testid":`skill-convert-${e}`,children:r===`link`?(0,Y.jsx)(i,{id:`uUCrBv`}):(0,Y.jsx)(i,{id:`iaPtht`})})})},t[24]=d,t[25]=s,t[26]=n,t[27]=B):B=t[27];let ee=B,V;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Y.jsx)(i,{id:`npcziF`}),t[28]=V):V=t[28];let H;t[29]===d?H=t[30]:(H=d({id:`6f_UX4`}),t[29]=d,t[30]=H);let U;t[31]===m?U=t[32]:(U=()=>m(),t[31]=m,t[32]=U);let W;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Y.jsx)(i,{id:`N40H-G`}),t[33]=W):W=t[33];let G;t[34]!==g||t[35]!==U?(G=(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:g,onClick:U,"data-testid":`skill-install-all`,children:W}),t[34]=g,t[35]=U,t[36]=G):G=t[36];let K;t[37]!==H||t[38]!==G?(K=(0,Y.jsx)($,{hint:H,children:G}),t[37]=H,t[38]=G,t[39]=K):K=t[39],t[40]!==u||t[41]!==K?(S=(0,Y.jsxs)(an,{menuKind:u,className:`flex items-center justify-between gap-2`,children:[V,K]}),t[40]=u,t[41]=K,t[42]=S):S=t[42],C=x===null?null:(0,Y.jsx)($,{hint:d({id:`pXB6SL`}),children:(0,Y.jsxs)(rn,{menuKind:u,disabled:g,checked:!0,onSelect:An,"data-testid":`skill-source-row`,children:[(0,Y.jsx)(ie,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:x}),(()=>{let e=z(x).split(`/`).slice(0,-1).join(`/`),t=P(e);return t.length>0?(0,Y.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-source`,children:t.map(t=>R(t,e))}):null})(),(0,Y.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,Y.jsx)(i,{id:`tiFPjk`})})]})]})}),w=b.map(t=>{let a=e(t),s=t===`agents`?`.agents`:te[t],c=z(a).split(`/`).slice(0,-1).join(`/`),m=P(c);return(0,Y.jsx)($,{hint:O.has(t)?d({id:`8HvJlU`,values:{0:a??s}}):t===D?a?d({id:`ssk6rl`,values:{path:a}}):s:f.has(t)?d(a?{id:`9ieZhu`,values:{path:a}}:{id:`n3T3EE`,values:{label:s}}):d(a?y===`link`?{id:`1LtA5r`,values:{path:a}}:{id:`opPbzN`,values:{path:a}}:{id:`Pp0Vgd`,values:{label:s}}),children:(0,Y.jsxs)(rn,{menuKind:u,disabled:g,checked:f.has(t),onCheckedChange:e=>{O.has(t)||e===!0&&!I(c)||p(t,e===!0)},onSelect:kn,className:`group`,"data-testid":`skill-install-editor-${t}`,children:[(0,Y.jsx)(Qt,{host:t,"aria-hidden":!0,className:`size-4`}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:a??s}),m.length>0?(0,Y.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${t}`,children:m.map(e=>R(e,c))}):null,O.has(t)?(0,Y.jsx)($,{hint:d({id:`_O7dJS`}),children:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:e=>{e.preventDefault(),o?.(t)},"data-testid":`skill-fork-chip-${t}`,children:(0,Y.jsx)(i,{id:`jng7Ko`})})}):t===D?(0,Y.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,Y.jsx)(i,{id:`tiFPjk`})}):f.has(t)&&r?.hosts?(0,Y.jsxs)(Y.Fragment,{children:[!g&&(A.has(t)?`link`:`copy`)!==y?ee(t,a??s,A.has(t)?`link`:`copy`):null,(0,Y.jsx)($,{hint:d({id:`nBgzKO`}),children:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:e=>{e.preventDefault(),e.stopPropagation(),n.setSource?.(t)},"data-testid":`skill-set-source-${t}`,children:(0,Y.jsx)(i,{id:`VNNRfN`})})})]}):null,!g&&k.has(z(a))?(0,Y.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,Y.jsx)(en,{testId:`skill-drift-${t}`})}):null]})]})},t)}),T=v.map(e=>(0,Y.jsx)($,{hint:e.placed===null?d(y===`link`?{id:`ybWWR2`,values:{0:e.display}}:{id:`fDjZxw`,values:{0:e.display}}):d({id:`C0cll5`,values:{0:e.display}}),children:(0,Y.jsxs)(rn,{menuKind:u,disabled:g,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!I(e.root))return;n.placeAt(e.root,y)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:On,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,Y.jsx)(Qt,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,Y.jsx)(ie,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.display}),P(e.root).length>0?(0,Y.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-custom-${e.root}`,children:P(e.root).map(t=>R(t,e.root))}):null,!g&&e.placed!==null&&k.has(e.placed.path)?(0,Y.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,Y.jsx)(en,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,Y.jsxs)(Y.Fragment,{children:[!g&&e.placed.mode!==y?ee(e.root,e.display,e.placed.mode):null,(0,Y.jsx)($,{hint:d({id:`nBgzKO`}),children:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.setSource?.(e.root)},"data-testid":`skill-set-source-custom-${e.root}`,children:(0,Y.jsx)(i,{id:`VNNRfN`})})})]})]})]})},e.root)),t[0]=d,t[1]=h.data,t[2]=h.status,t[3]=f,t[4]=m,t[5]=u,t[6]=o,t[7]=s,t[8]=r,t[9]=p,t[10]=n,t[11]=g,t[12]=_,t[13]=v,t[14]=y,t[15]=b,t[16]=x,t[17]=S,t[18]=C,t[19]=w,t[20]=T}else g=t[11],_=t[12],v=t[13],y=t[14],b=t[15],x=t[16],S=t[17],C=t[18],w=t[19],T=t[20];let E;t[43]!==v||t[44]!==b.length||t[45]!==x?(E=b.length===0&&v.length===0&&x===null?(0,Y.jsx)(`div`,{className:`px-2 py-1.5 text-[11px] text-muted-foreground leading-snug`,"data-testid":`skill-install-no-destinations`,children:(0,Y.jsx)(i,{id:`MOAoFO`})}):null,t[43]=v,t[44]=b.length,t[45]=x,t[46]=E):E=t[46];let D;t[47]!==d||t[48]!==g||t[49]!==_||t[50]!==y||t[51]!==s||t[52]!==n?(D=_.length>0&&n.convertLocations?(0,Y.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-1 pb-1.5`,children:[(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-auto whitespace-normal p-0 text-left font-normal text-[11px] text-muted-foreground leading-snug hover:bg-transparent hover:text-foreground`,onClick:e=>{e.preventDefault();let t=y===`link`?`copy`:`link`,r=_.filter(e=>e.mode!==t);if(r.length===0)return;let i=d(t===`copy`?{id:`iOAsF1`}:{id:`MS8lMS`}),a=d(t===`copy`?{id:`gZiT5e`}:{id:`PhIa-X`}),o=r.map(Dn).join(`
8
8
  `);window.confirm(`${i}\n\n${a}\n\n${o}\n\n${d({id:`Cu6GXQ`})}`)&&(s?.(),n.convertLocations?.(r.map(e=>({target:e.target,mode:t}))))},disabled:g,"data-testid":`skill-convert-all`,children:y===`link`?(0,Y.jsx)(i,{id:`rcJmK8`}):(0,Y.jsx)(i,{id:`LBv_TR`})}),(0,Y.jsx)($,{hint:d({id:`0J6nhG`}),children:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,"aria-label":d({id:`qJSo0_`}),className:`size-4 shrink-0 rounded-full border border-border/60 p-0 font-normal text-[9px] text-muted-foreground hover:border-foreground/40 hover:bg-transparent hover:text-foreground`,onClick:En,"data-testid":`skill-convert-all-help`,children:`?`})})]}):null,t[47]=d,t[48]=g,t[49]=_,t[50]=y,t[51]=s,t[52]=n,t[53]=D):D=t[53];let O;t[54]===u?O=t[55]:(O=(0,Y.jsx)(on,{menuKind:u}),t[54]=u,t[55]=O);let k;t[56]===d?k=t[57]:(k=d({id:`5ymuTA`}),t[56]=d,t[57]=k);let A;t[58]===r?.scope?A=t[59]:(A=()=>{window.location.hash=r?.scope===`global`?`#settings/user-skills`:`#settings/skills`},t[58]=r?.scope,t[59]=A);let j,M;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Y.jsx)(St,{"aria-hidden":!0}),M=(0,Y.jsx)(i,{id:`ZBF9fn`}),t[60]=j,t[61]=M):(j=t[60],M=t[61]);let N;t[62]!==u||t[63]!==A?(N=(0,Y.jsxs)(nn,{menuKind:u,onSelect:A,children:[j,M]}),t[62]=u,t[63]=A,t[64]=N):N=t[64];let P;t[65]!==N||t[66]!==k?(P=(0,Y.jsx)($,{hint:k,children:N}),t[65]=N,t[66]=k,t[67]=P):P=t[67];let F;return t[68]!==P||t[69]!==S||t[70]!==C||t[71]!==w||t[72]!==T||t[73]!==E||t[74]!==D||t[75]!==O?(F=(0,Y.jsxs)(Y.Fragment,{children:[S,C,w,T,E,D,O,P]}),t[68]=P,t[69]=S,t[70]=C,t[71]=w,t[72]=T,t[73]=E,t[74]=D,t[75]=O,t[76]=F):F=t[76],F}function En(e){return e.preventDefault()}function Dn(e){return e.display}function On(e){return e.preventDefault()}function kn(e){return e.preventDefault()}function An(e){return e.preventDefault()}function jn(e){return(e??``).replace(/^~\//,``)}function Mn(e){return e===`agents`?`.agents`:te[e]??e}export{bt as A,Ht as C,Nt as D,Lt as E,St as O,Wt as S,It as T,Jt as _,tn as a,Vt as b,sn as c,en as d,Qt as f,Rt as g,Yt as h,_n as i,Fe as j,xt as k,cn as l,Xt as m,Tn as n,nn as o,$t as p,xn as r,on as s,bn as t,ln as u,Ut as v,Gt as w,Kt as x,qt as y};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-CA0dewJJ.js";import{i as s,n as c,t as l}from"./tooltip-DHXgxWLL.js";import{a as u,c as d,i as f,n as p,o as m,s as h,t as g}from"./dialog-HdfR4WGm.js";import{t as _}from"./switch-CXMMdHyn.js";import{t as v}from"./arrow-up-right-CGe6dTck.js";import{t as y}from"./spinner-BxJv3FRl.js";import{t as b}from"./refresh-cw-CcQnr_fh.js";import{t as x}from"./undo-2-DAbhEXY-.js";import{t as S}from"./use-skill-origin-Bpi6sqBq.js";import{t as C}from"./DiffView-BuSYMH4e.js";var w=e(n(),1),T=a(),E=t();function D(e){let t=(0,T.c)(31),{open:n,onOpenChange:i,skillName:a,localBody:s,upstreamBody:c,applying:l,onTakeUpstream:_}=e,v;t[0]===a?v=t[1]:(v=(0,E.jsx)(d,{children:(0,E.jsx)(r,{id:`EPKVES`,values:{skillName:a}})}),t[0]=a,t[1]=v);let y;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,E.jsx)(u,{children:(0,E.jsx)(r,{id:`kKw0H3`})}),t[2]=y):y=t[2];let b;t[3]===v?b=t[4]:(b=(0,E.jsxs)(h,{children:[v,y]}),t[3]=v,t[4]=b);let x;t[5]!==s||t[6]!==c?(x=(0,E.jsx)(p,{className:`min-h-0 flex-1 overflow-auto`,children:(0,E.jsx)(C,{oldContent:s,newContent:c,layout:`unified`})}),t[5]=s,t[6]=c,t[7]=x):x=t[7];let S;t[8]===i?S=t[9]:(S=()=>i(!1),t[8]=i,t[9]=S);let w;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,E.jsx)(r,{id:`Tq3pcs`}),t[10]=w):w=t[10];let D;t[11]!==l||t[12]!==S?(D=(0,E.jsx)(o,{variant:`outline`,onClick:S,disabled:l,children:w}),t[11]=l,t[12]=S,t[13]=D):D=t[13];let O;t[14]===l?O=t[15]:(O=l?(0,E.jsx)(r,{id:`JL3si7`}):(0,E.jsx)(r,{id:`qkqG0b`}),t[14]=l,t[15]=O);let k;t[16]!==l||t[17]!==_||t[18]!==O?(k=(0,E.jsx)(o,{onClick:_,disabled:l,children:O}),t[16]=l,t[17]=_,t[18]=O,t[19]=k):k=t[19];let A;t[20]!==D||t[21]!==k?(A=(0,E.jsxs)(m,{children:[D,k]}),t[20]=D,t[21]=k,t[22]=A):A=t[22];let j;t[23]!==A||t[24]!==b||t[25]!==x?(j=(0,E.jsxs)(f,{className:`flex max-h-[85vh] max-w-3xl flex-col`,children:[b,x,A]}),t[23]=A,t[24]=b,t[25]=x,t[26]=j):j=t[26];let M;return t[27]!==i||t[28]!==n||t[29]!==j?(M=(0,E.jsx)(g,{open:n,onOpenChange:i,children:j}),t[27]=i,t[28]=n,t[29]=j,t[30]=M):M=t[30],M}function O(e){let t=(0,T.c)(48),{scope:n,name:a}=e,{_:u}=i(),d;t[0]!==a||t[1]!==n?(d={scope:n,name:a},t[0]=a,t[1]=n,t[2]=d):d=t[2];let{origin:f,github:p,displaySource:m,importedTitle:h,canReimport:g,updateAvailable:C,modified:O,autoUpdate:k,gitTracked:A,setAutoUpdate:j,revertable:M,reimport:N,reimporting:P,previewUpdate:F,revert:I,reverting:L}=S(d),[R,z]=(0,w.useState)(null),B;t[3]!==O||t[4]!==F||t[5]!==N?(B=async function(){if(O){let e=await F();e&&z(e);return}await N()},t[3]=O,t[4]=F,t[5]=N,t[6]=B):B=t[6];let V=B,H;t[7]===N?H=t[8]:(H=async function(){await N(),z(null)},t[7]=N,t[8]=H);let U=H;if(!f)return null;let W;t[9]!==m||t[10]!==p||t[11]!==h?(W=p?(0,E.jsxs)(`a`,{href:p,target:`_blank`,rel:`noreferrer`,title:h??void 0,className:`hidden min-w-0 max-w-48 items-center gap-1 hover:text-foreground @xl/toolbar:flex`,children:[(0,E.jsx)(`span`,{className:`truncate`,children:m}),(0,E.jsx)(v,{className:`size-3 shrink-0`,"aria-hidden":!0})]}):(0,E.jsx)(`span`,{title:h??void 0,className:`hidden min-w-0 max-w-48 truncate @xl/toolbar:inline`,children:m}),t[9]=m,t[10]=p,t[11]=h,t[12]=W):W=t[12];let G;t[13]!==u||t[14]!==k||t[15]!==g||t[16]!==A||t[17]!==j?(G=g?(0,E.jsxs)(l,{children:[(0,E.jsx)(s,{asChild:!0,children:(0,E.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1`,children:[(0,E.jsx)(`label`,{htmlFor:`skill-auto-update-switch`,className:`hidden cursor-pointer @xl/toolbar:inline`,children:(0,E.jsx)(r,{id:`2M0JF6`})}),(0,E.jsx)(_,{id:`skill-auto-update-switch`,checked:k&&!A,disabled:A,onCheckedChange:e=>void j(e===!0),"aria-label":u({id:`o9fPtM`}),className:`scale-75`})]})}),(0,E.jsx)(c,{side:`bottom`,children:A?(0,E.jsx)(r,{id:`vy_VIN`}):k?(0,E.jsx)(r,{id:`vGQxBT`}):(0,E.jsx)(r,{id:`9p_QBN`})})]}):null,t[13]=u,t[14]=k,t[15]=g,t[16]=A,t[17]=j,t[18]=G):G=t[18];let K;t[19]===O?K=t[20]:(K=O?(0,E.jsxs)(l,{children:[(0,E.jsx)(s,{asChild:!0,children:(0,E.jsx)(`span`,{className:`shrink-0 rounded-sm bg-amber-500/15 px-1.5 py-0.5 font-medium text-[11px] text-amber-700 dark:text-amber-400`,children:(0,E.jsx)(r,{id:`tgWuMB`})})}),(0,E.jsx)(c,{side:`bottom`,children:(0,E.jsx)(r,{id:`s0Iold`})})]}):null,t[19]=O,t[20]=K);let q;t[21]!==u||t[22]!==g||t[23]!==O||t[24]!==P||t[25]!==I||t[26]!==M||t[27]!==L?(q=O&&g&&M?(0,E.jsxs)(l,{children:[(0,E.jsx)(o,{variant:`ghost`,size:`sm`,onClick:()=>void I(),disabled:L||P,"aria-label":u({id:`VxLvKE`}),className:`shrink-0 gap-1 text-muted-foreground px-2 text-xs hover:text-foreground`,asChild:!0,children:(0,E.jsxs)(s,{children:[L?(0,E.jsx)(y,{icon:x,className:`size-3`,"aria-hidden":!0}):(0,E.jsx)(x,{className:`size-3`,"aria-hidden":!0}),(0,E.jsx)(`span`,{className:`hidden @xl/toolbar:inline`,children:L?(0,E.jsx)(r,{id:`fIJtam`}):(0,E.jsx)(r,{id:`jJdwCB`})})]})}),(0,E.jsx)(c,{side:`bottom`,children:(0,E.jsx)(r,{id:`XSb9HS`})})]}):null,t[21]=u,t[22]=g,t[23]=O,t[24]=P,t[25]=I,t[26]=M,t[27]=L,t[28]=q):q=t[28];let J;t[29]!==u||t[30]!==g||t[31]!==V||t[32]!==P||t[33]!==L||t[34]!==C?(J=g&&C?(0,E.jsxs)(l,{children:[(0,E.jsx)(o,{variant:`ghost`,size:`sm`,onClick:()=>void V(),disabled:P||L,"aria-label":u({id:`GidGkh`}),className:`shrink-0 gap-1 text-muted-foreground px-2 text-xs hover:text-foreground`,asChild:!0,children:(0,E.jsxs)(s,{children:[P?(0,E.jsx)(y,{icon:b,className:`size-3`,"aria-hidden":!0}):(0,E.jsx)(b,{className:`size-3`,"aria-hidden":!0}),(0,E.jsx)(`span`,{className:`hidden @xl/toolbar:inline`,children:P?(0,E.jsx)(r,{id:`JL3si7`}):(0,E.jsx)(r,{id:`EkH9pt`})})]})}),(0,E.jsx)(c,{side:`bottom`,children:(0,E.jsx)(r,{id:`GidGkh`})})]}):null,t[29]=u,t[30]=g,t[31]=V,t[32]=P,t[33]=L,t[34]=C,t[35]=J):J=t[35];let Y;t[36]!==R||t[37]!==a||t[38]!==U||t[39]!==P?(Y=R?(0,E.jsx)(D,{open:!0,onOpenChange:e=>{e||z(null)},skillName:a,localBody:R.localBody,upstreamBody:R.upstreamBody,applying:P,onTakeUpstream:()=>void U()}):null,t[36]=R,t[37]=a,t[38]=U,t[39]=P,t[40]=Y):Y=t[40];let X;return t[41]!==W||t[42]!==G||t[43]!==K||t[44]!==q||t[45]!==J||t[46]!==Y?(X=(0,E.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-muted-foreground text-xs`,children:[W,G,K,q,J,Y]}),t[41]=W,t[42]=G,t[43]=K,t[44]=q,t[45]=J,t[46]=Y,t[47]=X):X=t[47],X}export{O as SkillOriginInline};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-CA0dewJJ.js";import{i as s,n as c,t as l}from"./tooltip-DHXgxWLL.js";import{a as u,c as d,i as f,n as p,o as m,s as h,t as g}from"./dialog-HdfR4WGm.js";import{t as _}from"./switch-CXMMdHyn.js";import{t as v}from"./arrow-up-right-CGe6dTck.js";import{t as y}from"./spinner-BxJv3FRl.js";import{t as b}from"./refresh-cw-CcQnr_fh.js";import{t as x}from"./undo-2-DAbhEXY-.js";import{t as S}from"./use-skill-origin-FTbTIS5Y.js";import{t as C}from"./DiffView-B-B3fi5F.js";var w=e(n(),1),T=a(),E=t();function D(e){let t=(0,T.c)(31),{open:n,onOpenChange:i,skillName:a,localBody:s,upstreamBody:c,applying:l,onTakeUpstream:_}=e,v;t[0]===a?v=t[1]:(v=(0,E.jsx)(d,{children:(0,E.jsx)(r,{id:`EPKVES`,values:{skillName:a}})}),t[0]=a,t[1]=v);let y;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,E.jsx)(u,{children:(0,E.jsx)(r,{id:`kKw0H3`})}),t[2]=y):y=t[2];let b;t[3]===v?b=t[4]:(b=(0,E.jsxs)(h,{children:[v,y]}),t[3]=v,t[4]=b);let x;t[5]!==s||t[6]!==c?(x=(0,E.jsx)(p,{className:`min-h-0 flex-1 overflow-auto`,children:(0,E.jsx)(C,{oldContent:s,newContent:c,layout:`unified`})}),t[5]=s,t[6]=c,t[7]=x):x=t[7];let S;t[8]===i?S=t[9]:(S=()=>i(!1),t[8]=i,t[9]=S);let w;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,E.jsx)(r,{id:`Tq3pcs`}),t[10]=w):w=t[10];let D;t[11]!==l||t[12]!==S?(D=(0,E.jsx)(o,{variant:`outline`,onClick:S,disabled:l,children:w}),t[11]=l,t[12]=S,t[13]=D):D=t[13];let O;t[14]===l?O=t[15]:(O=l?(0,E.jsx)(r,{id:`JL3si7`}):(0,E.jsx)(r,{id:`qkqG0b`}),t[14]=l,t[15]=O);let k;t[16]!==l||t[17]!==_||t[18]!==O?(k=(0,E.jsx)(o,{onClick:_,disabled:l,children:O}),t[16]=l,t[17]=_,t[18]=O,t[19]=k):k=t[19];let A;t[20]!==D||t[21]!==k?(A=(0,E.jsxs)(m,{children:[D,k]}),t[20]=D,t[21]=k,t[22]=A):A=t[22];let j;t[23]!==A||t[24]!==b||t[25]!==x?(j=(0,E.jsxs)(f,{className:`flex max-h-[85vh] max-w-3xl flex-col`,children:[b,x,A]}),t[23]=A,t[24]=b,t[25]=x,t[26]=j):j=t[26];let M;return t[27]!==i||t[28]!==n||t[29]!==j?(M=(0,E.jsx)(g,{open:n,onOpenChange:i,children:j}),t[27]=i,t[28]=n,t[29]=j,t[30]=M):M=t[30],M}function O(e){let t=(0,T.c)(48),{scope:n,name:a}=e,{_:u}=i(),d;t[0]!==a||t[1]!==n?(d={scope:n,name:a},t[0]=a,t[1]=n,t[2]=d):d=t[2];let{origin:f,github:p,displaySource:m,importedTitle:h,canReimport:g,updateAvailable:C,modified:O,autoUpdate:k,gitTracked:A,setAutoUpdate:j,revertable:M,reimport:N,reimporting:P,previewUpdate:F,revert:I,reverting:L}=S(d),[R,z]=(0,w.useState)(null),B;t[3]!==O||t[4]!==F||t[5]!==N?(B=async function(){if(O){let e=await F();e&&z(e);return}await N()},t[3]=O,t[4]=F,t[5]=N,t[6]=B):B=t[6];let V=B,H;t[7]===N?H=t[8]:(H=async function(){await N(),z(null)},t[7]=N,t[8]=H);let U=H;if(!f)return null;let W;t[9]!==m||t[10]!==p||t[11]!==h?(W=p?(0,E.jsxs)(`a`,{href:p,target:`_blank`,rel:`noreferrer`,title:h??void 0,className:`hidden min-w-0 max-w-48 items-center gap-1 hover:text-foreground @xl/toolbar:flex`,children:[(0,E.jsx)(`span`,{className:`truncate`,children:m}),(0,E.jsx)(v,{className:`size-3 shrink-0`,"aria-hidden":!0})]}):(0,E.jsx)(`span`,{title:h??void 0,className:`hidden min-w-0 max-w-48 truncate @xl/toolbar:inline`,children:m}),t[9]=m,t[10]=p,t[11]=h,t[12]=W):W=t[12];let G;t[13]!==u||t[14]!==k||t[15]!==g||t[16]!==A||t[17]!==j?(G=g?(0,E.jsxs)(l,{children:[(0,E.jsx)(s,{asChild:!0,children:(0,E.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1`,children:[(0,E.jsx)(`label`,{htmlFor:`skill-auto-update-switch`,className:`hidden cursor-pointer @xl/toolbar:inline`,children:(0,E.jsx)(r,{id:`2M0JF6`})}),(0,E.jsx)(_,{id:`skill-auto-update-switch`,checked:k&&!A,disabled:A,onCheckedChange:e=>void j(e===!0),"aria-label":u({id:`o9fPtM`}),className:`scale-75`})]})}),(0,E.jsx)(c,{side:`bottom`,children:A?(0,E.jsx)(r,{id:`vy_VIN`}):k?(0,E.jsx)(r,{id:`vGQxBT`}):(0,E.jsx)(r,{id:`9p_QBN`})})]}):null,t[13]=u,t[14]=k,t[15]=g,t[16]=A,t[17]=j,t[18]=G):G=t[18];let K;t[19]===O?K=t[20]:(K=O?(0,E.jsxs)(l,{children:[(0,E.jsx)(s,{asChild:!0,children:(0,E.jsx)(`span`,{className:`shrink-0 rounded-sm bg-amber-500/15 px-1.5 py-0.5 font-medium text-[11px] text-amber-700 dark:text-amber-400`,children:(0,E.jsx)(r,{id:`tgWuMB`})})}),(0,E.jsx)(c,{side:`bottom`,children:(0,E.jsx)(r,{id:`s0Iold`})})]}):null,t[19]=O,t[20]=K);let q;t[21]!==u||t[22]!==g||t[23]!==O||t[24]!==P||t[25]!==I||t[26]!==M||t[27]!==L?(q=O&&g&&M?(0,E.jsxs)(l,{children:[(0,E.jsx)(o,{variant:`ghost`,size:`sm`,onClick:()=>void I(),disabled:L||P,"aria-label":u({id:`VxLvKE`}),className:`shrink-0 gap-1 text-muted-foreground px-2 text-xs hover:text-foreground`,asChild:!0,children:(0,E.jsxs)(s,{children:[L?(0,E.jsx)(y,{icon:x,className:`size-3`,"aria-hidden":!0}):(0,E.jsx)(x,{className:`size-3`,"aria-hidden":!0}),(0,E.jsx)(`span`,{className:`hidden @xl/toolbar:inline`,children:L?(0,E.jsx)(r,{id:`fIJtam`}):(0,E.jsx)(r,{id:`jJdwCB`})})]})}),(0,E.jsx)(c,{side:`bottom`,children:(0,E.jsx)(r,{id:`XSb9HS`})})]}):null,t[21]=u,t[22]=g,t[23]=O,t[24]=P,t[25]=I,t[26]=M,t[27]=L,t[28]=q):q=t[28];let J;t[29]!==u||t[30]!==g||t[31]!==V||t[32]!==P||t[33]!==L||t[34]!==C?(J=g&&C?(0,E.jsxs)(l,{children:[(0,E.jsx)(o,{variant:`ghost`,size:`sm`,onClick:()=>void V(),disabled:P||L,"aria-label":u({id:`GidGkh`}),className:`shrink-0 gap-1 text-muted-foreground px-2 text-xs hover:text-foreground`,asChild:!0,children:(0,E.jsxs)(s,{children:[P?(0,E.jsx)(y,{icon:b,className:`size-3`,"aria-hidden":!0}):(0,E.jsx)(b,{className:`size-3`,"aria-hidden":!0}),(0,E.jsx)(`span`,{className:`hidden @xl/toolbar:inline`,children:P?(0,E.jsx)(r,{id:`JL3si7`}):(0,E.jsx)(r,{id:`EkH9pt`})})]})}),(0,E.jsx)(c,{side:`bottom`,children:(0,E.jsx)(r,{id:`GidGkh`})})]}):null,t[29]=u,t[30]=g,t[31]=V,t[32]=P,t[33]=L,t[34]=C,t[35]=J):J=t[35];let Y;t[36]!==R||t[37]!==a||t[38]!==U||t[39]!==P?(Y=R?(0,E.jsx)(D,{open:!0,onOpenChange:e=>{e||z(null)},skillName:a,localBody:R.localBody,upstreamBody:R.upstreamBody,applying:P,onTakeUpstream:()=>void U()}):null,t[36]=R,t[37]=a,t[38]=U,t[39]=P,t[40]=Y):Y=t[40];let X;return t[41]!==W||t[42]!==G||t[43]!==K||t[44]!==q||t[45]!==J||t[46]!==Y?(X=(0,E.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-muted-foreground text-xs`,children:[W,G,K,q,J,Y]}),t[41]=W,t[42]=G,t[43]=K,t[44]=q,t[45]=J,t[46]=Y,t[47]=X):X=t[47],X}export{O as SkillOriginInline};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{A as s,k as c,n as l,p as u,r as d,t as f}from"./SkillInstallMenu-CIrDCCxr.js";import{t as p}from"./button-CA0dewJJ.js";import{a as m,c as h,l as g,m as _,o as v,r as y,t as ee,u as b}from"./dropdown-menu-CLgDYkh1.js";import{a as x,i as S,n as C,o as w,r as T,s as E,t as D}from"./select-CguJodwX.js";import{a as O,i as k,u as A}from"./skill-actions-H0gbk5VS.js";import{t as j}from"./chevron-down-DabHDQTe.js";import{t as M}from"./list-plus-CT84Vd_h.js";import{f as N,i as P,t as F}from"./skill-scope-gUkJkFRO.js";import{t as I}from"./use-skills-DJ009sMa.js";var L=a(),R=e(n(),1),z=t();function B(e){let t=(0,L.c)(52),{scope:n,name:a}=e,{_:s}=i(),m=I(),h=k(),g;t[0]!==a||t[1]!==n||t[2]!==m.data||t[3]!==m.status?(g=m.status===`ready`?m.data.find(e=>e.scope===n&&e.name===a):void 0,t[0]=a,t[1]=n,t[2]=m.data,t[3]=m.status,t[4]=g):g=t[4];let v=g,b;t[5]!==v||t[6]!==a||t[7]!==n?(b=v??{scope:n,name:a,path:a,description:``,installed:!1,hosts:[]},t[5]=v,t[6]=a,t[7]=n,t[8]=b):b=t[8];let x=b,[S,C]=(0,R.useState)(!1),w=d(x,h),{installed:T,installing:E,hostSet:D}=w,O=v===void 0&&!T,A;t[9]!==v||t[10]!==D?(A=v?P(v,[...D]):[],t[9]=v,t[10]=D,t[11]=A):A=t[11];let M=A,N;t[12]!==h||t[13]!==x?(N=()=>h.requestFileCreate(x),t[12]=h,t[13]=x,t[14]=N):N=t[14];let F;t[15]===s?F=t[16]:(F=s({id:`leF0i_`}),t[15]=s,t[16]=F);let B;t[17]===s?B=t[18]:(B=s({id:`leF0i_`}),t[17]=s,t[18]=B);let V;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,z.jsx)(c,{className:`size-4`,"aria-hidden":!0}),t[19]=V):V=t[19];let H;t[20]!==N||t[21]!==F||t[22]!==B?(H=(0,z.jsx)(p,{variant:`outline`,size:`icon-sm`,className:`shrink-0 text-muted-foreground`,onClick:N,title:F,"aria-label":B,"data-testid":`skill-editor-new-file`,children:V}),t[20]=N,t[21]=F,t[22]=B,t[23]=H):H=t[23];let U=O?`resolving`:`installed`,W=O?`border-border bg-muted/50 text-muted-foreground`:`border-primary/50 bg-primary/5 text-primary hover:bg-primary/10 hover:text-primary aria-expanded:bg-primary/10 aria-expanded:text-primary`,G;t[24]===W?G=t[25]:(G=o(`h-7 shrink-0 gap-1 rounded-lg border px-2 font-normal text-xs shadow-xs font-mono uppercase`,W),t[24]=W,t[25]=G);let K;t[26]!==M||t[27]!==E||t[28]!==O?(K=E?(0,z.jsx)(r,{id:`b4itZn`}):O?(0,z.jsx)(r,{id:`iKvAeG`}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(r,{id:`eQkgKV`}),(0,z.jsx)(u,{hosts:M,className:`text-muted-foreground`})]}),t[26]=M,t[27]=E,t[28]=O,t[29]=K):K=t[29];let q;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,z.jsx)(j,{className:`size-4 shrink-0 opacity-50`,"aria-hidden":!0}),t[30]=q):q=t[30];let J;t[31]!==E||t[32]!==G||t[33]!==K||t[34]!==U?(J=(0,z.jsx)(_,{asChild:!0,children:(0,z.jsxs)(p,{variant:`outline`,size:`sm`,disabled:E,"data-testid":`skill-install-menu-trigger`,"data-state":U,className:G,children:[K,q]})}),t[31]=E,t[32]=G,t[33]=K,t[34]=U,t[35]=J):J=t[35];let Y;t[36]!==h||t[37]!==x?(Y=e=>h.requestForkResolve(x,e),t[36]=h,t[37]=x,t[38]=Y):Y=t[38];let X;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(X=()=>C(!1),t[39]=X):X=t[39];let Z;t[40]!==x||t[41]!==Y||t[42]!==w?(Z=(0,z.jsx)(y,{align:`end`,className:f,children:(0,z.jsx)(l,{toggles:w,skill:x,onResolveFork:Y,onRunStart:X})}),t[40]=x,t[41]=Y,t[42]=w,t[43]=Z):Z=t[43];let Q;t[44]!==S||t[45]!==J||t[46]!==Z?(Q=(0,z.jsxs)(ee,{open:S,onOpenChange:C,children:[J,Z]}),t[44]=S,t[45]=J,t[46]=Z,t[47]=Q):Q=t[47];let $;return t[48]!==h.dialogs||t[49]!==Q||t[50]!==H?($=(0,z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[H,Q,h.dialogs]}),t[48]=h.dialogs,t[49]=Q,t[50]=H,t[51]=$):$=t[51],$}function V(e){let t=(0,L.c)(21),{value:n,onRequestMove:a,disabled:s,triggerClassName:c}=e,{_:l}=i(),u=N(),d;t[0]===a?d=t[1]:(d=e=>a(e),t[0]=a,t[1]=d);let f;t[2]===l?f=t[3]:(f=l({id:`oCHfGC`}),t[2]=l,t[3]=f);let p;t[4]===c?p=t[5]:(p=o(`w-auto gap-1 text-xs font-mono uppercase`,c),t[4]=c,t[5]=p);let m;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,z.jsx)(E,{}),t[6]=m):m=t[6];let h;t[7]!==f||t[8]!==p?(h=(0,z.jsx)(w,{size:`sm`,"aria-label":f,"data-testid":`skill-level-select`,className:p,children:m}),t[7]=f,t[8]=p,t[9]=h):h=t[9];let g;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,z.jsx)(x,{children:(0,z.jsx)(r,{id:`oCHfGC`})}),t[10]=g):g=t[10];let _;t[11]===u?_=t[12]:(_=F.map(e=>(0,z.jsx)(S,{value:e,children:u[e]},e)),t[11]=u,t[12]=_);let v;t[13]===_?v=t[14]:(v=(0,z.jsx)(C,{align:`end`,children:(0,z.jsxs)(T,{children:[g,_]})}),t[13]=_,t[14]=v);let y;return t[15]!==s||t[16]!==d||t[17]!==h||t[18]!==v||t[19]!==n?(y=(0,z.jsxs)(D,{value:n,onValueChange:d,disabled:s,children:[h,v]}),t[15]=s,t[16]=d,t[17]=h,t[18]=v,t[19]=n,t[20]=y):y=t[20],y}function H(e){let t=(0,L.c)(12),{scope:n,name:r}=e,[i,a]=(0,R.useState)(null),o;t[0]===n?o=t[1]:(o=e=>{e!==n&&a(e)},t[0]=n,t[1]=o);let s;t[2]!==r||t[3]!==i||t[4]!==n?(s=i?{scope:n,name:r,toScope:i}:null,t[2]=r,t[3]=i,t[4]=n,t[5]=s):s=t[5];let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>!e&&a(null),t[6]=c):c=t[6];let l;t[7]===s?l=t[8]:(l=(0,z.jsx)(O,{target:s,onOpenChange:c}),t[7]=s,t[8]=l);let u;return t[9]!==o||t[10]!==l?(u={requestMove:o,dialog:l},t[9]=o,t[10]=l,t[11]=u):u=t[11],u}function U(e){let t=(0,L.c)(45),{scope:n,name:a,showAddPropertyButton:o,onAddProperty:c,problemCount:l,problemMessages:u}=e,{_:d}=i(),f=N(),x;t[0]!==a||t[1]!==n?(x={scope:n,name:a},t[0]=a,t[1]=n,t[2]=x):x=t[2];let S=H(x),C;t[3]!==S.requestMove||t[4]!==n?(C=(0,z.jsx)(V,{value:n,onRequestMove:S.requestMove,triggerClassName:`hidden @xl/toolbar:flex`}),t[3]=S.requestMove,t[4]=n,t[5]=C):C=t[5];let w;t[6]!==a||t[7]!==n?(w=(0,z.jsx)(B,{scope:n,name:a}),t[6]=a,t[7]=n,t[8]=w):w=t[8];let T;t[9]!==C||t[10]!==w?(T=(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[C,w]}),t[9]=C,t[10]=w,t[11]=T):T=t[11];let E;t[12]!==c||t[13]!==l||t[14]!==u||t[15]!==o?(E=o?(0,z.jsx)(A,{onAddProperty:c,problemCount:l,problemMessages:u,className:`hidden @xl/toolbar:inline-flex`}):null,t[12]=c,t[13]=l,t[14]=u,t[15]=o,t[16]=E):E=t[16];let D;t[17]===d?D=t[18]:(D=d({id:`Yzs3QX`}),t[17]=d,t[18]=D);let O;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,z.jsx)(s,{className:`size-4`,"aria-hidden":!0}),t[19]=O):O=t[19];let k;t[20]===D?k=t[21]:(k=(0,z.jsx)(_,{asChild:!0,children:(0,z.jsx)(p,{variant:`ghost`,size:`icon`,"aria-label":D,"data-testid":`skill-toolbar-overflow`,className:`@xl/toolbar:hidden`,children:O})}),t[20]=D,t[21]=k);let j;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,z.jsx)(v,{children:(0,z.jsx)(r,{id:`oCHfGC`})}),t[22]=j):j=t[22];let P;t[23]===S?P=t[24]:(P=e=>S.requestMove(e),t[23]=S,t[24]=P);let I;t[25]===f?I=t[26]:(I=F.map(e=>(0,z.jsx)(g,{value:e,children:f[e]},e)),t[25]=f,t[26]=I);let R;t[27]!==n||t[28]!==P||t[29]!==I?(R=(0,z.jsx)(h,{value:n,onValueChange:P,children:I}),t[27]=n,t[28]=P,t[29]=I,t[30]=R):R=t[30];let U;t[31]!==c||t[32]!==o?(U=o?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(b,{}),(0,z.jsxs)(m,{onSelect:c,children:[(0,z.jsx)(M,{}),(0,z.jsx)(r,{id:`81H_23`})]})]}):null,t[31]=c,t[32]=o,t[33]=U):U=t[33];let W;t[34]!==R||t[35]!==U?(W=(0,z.jsxs)(y,{align:`end`,className:`min-w-44`,children:[j,R,U]}),t[34]=R,t[35]=U,t[36]=W):W=t[36];let G;t[37]!==W||t[38]!==k?(G=(0,z.jsxs)(ee,{children:[k,W]}),t[37]=W,t[38]=k,t[39]=G):G=t[39];let K;return t[40]!==S.dialog||t[41]!==G||t[42]!==T||t[43]!==E?(K=(0,z.jsxs)(z.Fragment,{children:[T,E,G,S.dialog]}),t[40]=S.dialog,t[41]=G,t[42]=T,t[43]=E,t[44]=K):K=t[44],K}export{U as SkillToolbarControls};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{A as s,k as c,n as l,p as u,r as d,t as f}from"./SkillInstallMenu-DXZKa7ir.js";import{t as p}from"./button-CA0dewJJ.js";import{a as m,c as h,l as g,m as _,o as v,r as y,t as ee,u as b}from"./dropdown-menu-CLgDYkh1.js";import{a as x,i as S,n as C,o as w,r as T,s as E,t as D}from"./select-CguJodwX.js";import{a as O,i as k,u as A}from"./skill-actions-Dm7_Q9qA.js";import{t as j}from"./chevron-down-DabHDQTe.js";import{t as M}from"./list-plus-CT84Vd_h.js";import{f as N,i as P,t as F}from"./skill-scope-gUkJkFRO.js";import{F as I}from"./skills-api-DO54o34O.js";var L=a(),R=e(n(),1),z=t();function B(e){let t=(0,L.c)(52),{scope:n,name:a}=e,{_:s}=i(),m=I(),h=k(),g;t[0]!==a||t[1]!==n||t[2]!==m.data||t[3]!==m.status?(g=m.status===`ready`?m.data.find(e=>e.scope===n&&e.name===a):void 0,t[0]=a,t[1]=n,t[2]=m.data,t[3]=m.status,t[4]=g):g=t[4];let v=g,b;t[5]!==v||t[6]!==a||t[7]!==n?(b=v??{scope:n,name:a,path:a,description:``,installed:!1,hosts:[]},t[5]=v,t[6]=a,t[7]=n,t[8]=b):b=t[8];let x=b,[S,C]=(0,R.useState)(!1),w=d(x,h),{installed:T,installing:E,hostSet:D}=w,O=v===void 0&&!T,A;t[9]!==v||t[10]!==D?(A=v?P(v,[...D]):[],t[9]=v,t[10]=D,t[11]=A):A=t[11];let M=A,N;t[12]!==h||t[13]!==x?(N=()=>h.requestFileCreate(x),t[12]=h,t[13]=x,t[14]=N):N=t[14];let F;t[15]===s?F=t[16]:(F=s({id:`leF0i_`}),t[15]=s,t[16]=F);let B;t[17]===s?B=t[18]:(B=s({id:`leF0i_`}),t[17]=s,t[18]=B);let V;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,z.jsx)(c,{className:`size-4`,"aria-hidden":!0}),t[19]=V):V=t[19];let H;t[20]!==N||t[21]!==F||t[22]!==B?(H=(0,z.jsx)(p,{variant:`outline`,size:`icon-sm`,className:`shrink-0 text-muted-foreground`,onClick:N,title:F,"aria-label":B,"data-testid":`skill-editor-new-file`,children:V}),t[20]=N,t[21]=F,t[22]=B,t[23]=H):H=t[23];let U=O?`resolving`:`installed`,W=O?`border-border bg-muted/50 text-muted-foreground`:`border-primary/50 bg-primary/5 text-primary hover:bg-primary/10 hover:text-primary aria-expanded:bg-primary/10 aria-expanded:text-primary`,G;t[24]===W?G=t[25]:(G=o(`h-7 shrink-0 gap-1 rounded-lg border px-2 font-normal text-xs shadow-xs font-mono uppercase`,W),t[24]=W,t[25]=G);let K;t[26]!==M||t[27]!==E||t[28]!==O?(K=E?(0,z.jsx)(r,{id:`b4itZn`}):O?(0,z.jsx)(r,{id:`iKvAeG`}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(r,{id:`eQkgKV`}),(0,z.jsx)(u,{hosts:M,className:`text-muted-foreground`})]}),t[26]=M,t[27]=E,t[28]=O,t[29]=K):K=t[29];let q;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,z.jsx)(j,{className:`size-4 shrink-0 opacity-50`,"aria-hidden":!0}),t[30]=q):q=t[30];let J;t[31]!==E||t[32]!==G||t[33]!==K||t[34]!==U?(J=(0,z.jsx)(_,{asChild:!0,children:(0,z.jsxs)(p,{variant:`outline`,size:`sm`,disabled:E,"data-testid":`skill-install-menu-trigger`,"data-state":U,className:G,children:[K,q]})}),t[31]=E,t[32]=G,t[33]=K,t[34]=U,t[35]=J):J=t[35];let Y;t[36]!==h||t[37]!==x?(Y=e=>h.requestForkResolve(x,e),t[36]=h,t[37]=x,t[38]=Y):Y=t[38];let X;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(X=()=>C(!1),t[39]=X):X=t[39];let Z;t[40]!==x||t[41]!==Y||t[42]!==w?(Z=(0,z.jsx)(y,{align:`end`,className:f,children:(0,z.jsx)(l,{toggles:w,skill:x,onResolveFork:Y,onRunStart:X})}),t[40]=x,t[41]=Y,t[42]=w,t[43]=Z):Z=t[43];let Q;t[44]!==S||t[45]!==J||t[46]!==Z?(Q=(0,z.jsxs)(ee,{open:S,onOpenChange:C,children:[J,Z]}),t[44]=S,t[45]=J,t[46]=Z,t[47]=Q):Q=t[47];let $;return t[48]!==h.dialogs||t[49]!==Q||t[50]!==H?($=(0,z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[H,Q,h.dialogs]}),t[48]=h.dialogs,t[49]=Q,t[50]=H,t[51]=$):$=t[51],$}function V(e){let t=(0,L.c)(21),{value:n,onRequestMove:a,disabled:s,triggerClassName:c}=e,{_:l}=i(),u=N(),d;t[0]===a?d=t[1]:(d=e=>a(e),t[0]=a,t[1]=d);let f;t[2]===l?f=t[3]:(f=l({id:`oCHfGC`}),t[2]=l,t[3]=f);let p;t[4]===c?p=t[5]:(p=o(`w-auto gap-1 text-xs font-mono uppercase`,c),t[4]=c,t[5]=p);let m;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,z.jsx)(E,{}),t[6]=m):m=t[6];let h;t[7]!==f||t[8]!==p?(h=(0,z.jsx)(w,{size:`sm`,"aria-label":f,"data-testid":`skill-level-select`,className:p,children:m}),t[7]=f,t[8]=p,t[9]=h):h=t[9];let g;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,z.jsx)(x,{children:(0,z.jsx)(r,{id:`oCHfGC`})}),t[10]=g):g=t[10];let _;t[11]===u?_=t[12]:(_=F.map(e=>(0,z.jsx)(S,{value:e,children:u[e]},e)),t[11]=u,t[12]=_);let v;t[13]===_?v=t[14]:(v=(0,z.jsx)(C,{align:`end`,children:(0,z.jsxs)(T,{children:[g,_]})}),t[13]=_,t[14]=v);let y;return t[15]!==s||t[16]!==d||t[17]!==h||t[18]!==v||t[19]!==n?(y=(0,z.jsxs)(D,{value:n,onValueChange:d,disabled:s,children:[h,v]}),t[15]=s,t[16]=d,t[17]=h,t[18]=v,t[19]=n,t[20]=y):y=t[20],y}function H(e){let t=(0,L.c)(12),{scope:n,name:r}=e,[i,a]=(0,R.useState)(null),o;t[0]===n?o=t[1]:(o=e=>{e!==n&&a(e)},t[0]=n,t[1]=o);let s;t[2]!==r||t[3]!==i||t[4]!==n?(s=i?{scope:n,name:r,toScope:i}:null,t[2]=r,t[3]=i,t[4]=n,t[5]=s):s=t[5];let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>!e&&a(null),t[6]=c):c=t[6];let l;t[7]===s?l=t[8]:(l=(0,z.jsx)(O,{target:s,onOpenChange:c}),t[7]=s,t[8]=l);let u;return t[9]!==o||t[10]!==l?(u={requestMove:o,dialog:l},t[9]=o,t[10]=l,t[11]=u):u=t[11],u}function U(e){let t=(0,L.c)(45),{scope:n,name:a,showAddPropertyButton:o,onAddProperty:c,problemCount:l,problemMessages:u}=e,{_:d}=i(),f=N(),x;t[0]!==a||t[1]!==n?(x={scope:n,name:a},t[0]=a,t[1]=n,t[2]=x):x=t[2];let S=H(x),C;t[3]!==S.requestMove||t[4]!==n?(C=(0,z.jsx)(V,{value:n,onRequestMove:S.requestMove,triggerClassName:`hidden @xl/toolbar:flex`}),t[3]=S.requestMove,t[4]=n,t[5]=C):C=t[5];let w;t[6]!==a||t[7]!==n?(w=(0,z.jsx)(B,{scope:n,name:a}),t[6]=a,t[7]=n,t[8]=w):w=t[8];let T;t[9]!==C||t[10]!==w?(T=(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[C,w]}),t[9]=C,t[10]=w,t[11]=T):T=t[11];let E;t[12]!==c||t[13]!==l||t[14]!==u||t[15]!==o?(E=o?(0,z.jsx)(A,{onAddProperty:c,problemCount:l,problemMessages:u,className:`hidden @xl/toolbar:inline-flex`}):null,t[12]=c,t[13]=l,t[14]=u,t[15]=o,t[16]=E):E=t[16];let D;t[17]===d?D=t[18]:(D=d({id:`Yzs3QX`}),t[17]=d,t[18]=D);let O;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,z.jsx)(s,{className:`size-4`,"aria-hidden":!0}),t[19]=O):O=t[19];let k;t[20]===D?k=t[21]:(k=(0,z.jsx)(_,{asChild:!0,children:(0,z.jsx)(p,{variant:`ghost`,size:`icon`,"aria-label":D,"data-testid":`skill-toolbar-overflow`,className:`@xl/toolbar:hidden`,children:O})}),t[20]=D,t[21]=k);let j;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,z.jsx)(v,{children:(0,z.jsx)(r,{id:`oCHfGC`})}),t[22]=j):j=t[22];let P;t[23]===S?P=t[24]:(P=e=>S.requestMove(e),t[23]=S,t[24]=P);let I;t[25]===f?I=t[26]:(I=F.map(e=>(0,z.jsx)(g,{value:e,children:f[e]},e)),t[25]=f,t[26]=I);let R;t[27]!==n||t[28]!==P||t[29]!==I?(R=(0,z.jsx)(h,{value:n,onValueChange:P,children:I}),t[27]=n,t[28]=P,t[29]=I,t[30]=R):R=t[30];let U;t[31]!==c||t[32]!==o?(U=o?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(b,{}),(0,z.jsxs)(m,{onSelect:c,children:[(0,z.jsx)(M,{}),(0,z.jsx)(r,{id:`81H_23`})]})]}):null,t[31]=c,t[32]=o,t[33]=U):U=t[33];let W;t[34]!==R||t[35]!==U?(W=(0,z.jsxs)(y,{align:`end`,className:`min-w-44`,children:[j,R,U]}),t[34]=R,t[35]=U,t[36]=W):W=t[36];let G;t[37]!==W||t[38]!==k?(G=(0,z.jsxs)(ee,{children:[k,W]}),t[37]=W,t[38]=k,t[39]=G):G=t[39];let K;return t[40]!==S.dialog||t[41]!==G||t[42]!==T||t[43]!==E?(K=(0,z.jsxs)(z.Fragment,{children:[T,E,G,S.dialog]}),t[40]=S.dialog,t[41]=G,t[42]=T,t[43]=E,t[44]=K):K=t[44],K}export{U as SkillToolbarControls};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{B as n,Dt as r,H as i,U as a,W as o,ct as s,dn as c,ft as l,j as u,kt as d,on as ee,ot as te,pt as f}from"./DocumentContext-BC38uC8R.js";import{t as p}from"./react-f2sANaYj.js";import{n as m}from"./dist-PQ5KMVDh.js";import{t as h}from"./compiler-runtime-BfE3aGVn.js";import{A as g,O as ne,S as _,a as re,i as ie,o as ae}from"./CodeMirrorPropInput-Bbe8zInO.js";import{Do as v,Gi as oe,T as se,_o as y,do as b,ni as x}from"./dist-DGemBD_J.js";import{h as ce}from"./use-apply-config-color-theme-DZRctrdg.js";import{H as S,L as le,M as ue,O as de,P as fe,S as C,d as w,f as pe,i as me,j as he,l as ge,r as _e,t as ve,w as T}from"./typing-burst-detector-BSBim2fh.js";import{f as E,g as D}from"./doc-paths-BkpejoFL.js";import{J as O}from"./navigation-targets-saCskzOA.js";import"./config-provider-C7t6oRiN.js";import{$ as k,D as A,Dt as j,F as M,It as N,Lt as P,Ot as F,Pt as I,Y as L,Z as R,b as z,ct as B,ft as V,g as H,gt as U,ht as ye,it as W,kt as be,l as G,lt as K,nt as q,pt as J,rt as Y,ut as X,v as xe}from"./dist-D9pOpWzq.js";import{a as Se,n as Ce}from"./cm-theme-Da-a0GOT.js";import{i as we,n as Te,o as Ee,r as De}from"./dist-BpbQP0nJ.js";import{o as Oe,r as ke}from"./selection-context-0QPVSyyM.js";import{l as Ae}from"./lint-config-client-sK38eqbj.js";import{a as je,i as Me,n as Ne,o as Pe,r as Fe,s as Ie,t as Le}from"./dist-DtBd-emT.js";import{n as Re,t as ze}from"./src-C-kGu7U9.js";var Z=e(p(),1),Be=h();function Ve(){let e=o();return e===null?null:new Set(e.keys())}function He(e,t,r){let i=[],a=M(e);if(r!=null){let n=[];for(let{from:e,to:r}of t)a.iterate({from:e,to:r,enter(e){if(e.name===`InlineCode`||e.name===`FencedCode`)return n.push({from:e.from,to:e.to}),!1}});let o=(e,t)=>n.some(n=>e>=n.from&&t<=n.to);for(let{from:n,to:a}of t){let t=e.doc.sliceString(n,a);y.lastIndex=0;for(let e=y.exec(t);e!==null;e=y.exec(t)){let t=e[2];if(!v(t))continue;let a=n+(e.index??0)+e[1].length,s=a+t.length+1;o(a,s)||i.push(L.mark({class:r.has(t)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":t}}).range(a,s))}}}for(let{from:o,to:s}of t)a.iterate({from:o,to:s,enter(t){if(t.name!==`InlineCode`)return;let a=e.doc.sliceString(t.from,t.to),o=a.length-a.replace(/^`+/,``).length,s=a.length-a.replace(/`+$/,``).length,c=a.slice(o,a.length-s),l=/^\/([a-z0-9][a-z0-9-]{1,63})$/.exec(c)?.[1];if(l!==void 0&&v(l)&&r!=null)return i.push(L.mark({class:r.has(l)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":l}}).range(t.from+o,t.to-s)),!1;let u=n.exec(c);if(u)return i.push(L.mark({class:`cm-skill-path-link`,attributes:{"data-skill-path":u[1]}}).range(t.from+o,t.to-s)),!1}});return i.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),L.set(i)}function Ue(e){let t=a(e);return t===null?[]:[k.fromClass(class{decorations;constructor(e){this.decorations=He(e.state,e.visibleRanges,Ve())}update(e){(e.docChanged||e.viewportChanged||M(e.startState)!==M(e.state))&&(this.decorations=He(e.view.state,e.view.visibleRanges,Ve()))}},{decorations:e=>e.decorations}),R.domEventHandlers({mousedown(n){let r=n.target?.closest?.(`[data-skill-ref]`),a=r instanceof HTMLElement?r.dataset.skillRef:void 0;if(a!==void 0){n.preventDefault();let e=o()?.get(a);return window.location.hash=e===void 0?D():E(O({scope:e.scope,name:a,path:e.path})),!0}let s=n.target?.closest?.(`.cm-skill-path-link`),c=s instanceof HTMLElement?s.dataset.skillPath:void 0;return c===void 0?!1:(n.preventDefault(),window.location.hash=i(t,e,c),!0)}})]}var We=L.line({attributes:{dir:`auto`}});function Ge(e){let t=new I;for(let n of e.visibleRanges)for(let r=n.from;r<=n.to;){let n=e.state.doc.lineAt(r);t.add(n.from,n.from,We),r=n.to+1}return t.finish()}var Ke=k.fromClass(class{decorations;constructor(e){this.decorations=Ge(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=Ge(e.view))}},{decorations:e=>e.decorations}),qe=[R.perLineTextDirection.of(!0),Ke],Je=new Set([`Link`,`Image`,`HTMLTag`,`HTMLBlock`]),Ye=`cm-lint-local-target`;function Xe(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function Ze(e,t){let n=H(e,t+1,100);if(n){let e=n.resolveInner(t,1);for(;e;){if(Je.has(e.name))return{from:e.from,to:e.to};e=e.parent}}return{from:t,to:t}}function Qe(e){return e===`error`?`error`:e===`info`?`info`:`warning`}function $e(e,t){let n=e.doc,r=[];for(let i of t){if(i.source!==`links`)continue;let t=Ze(e,Xe(n,i.range.start));r.push({from:t.from,to:Math.max(t.to,t.from),severity:Qe(i.severity),message:T(i),source:`${i.source}/${i.code}`,markClass:Ye})}return r}var et=N.define();function tt(e){let t={findings:[]};return[Me(e=>ne()?$e(e.state,t.findings):[],{delay:300,needsRefresh:e=>e.transactions.some(e=>e.effects.some(e=>e.is(et)))}),k.define(n=>{let r=e=>{t.findings=e,n.dispatch({effects:et.of(null)}),Le(n)},i=C(e,e=>{e.status===`loaded`&&r(e.findings)}),a=g(()=>r(t.findings));return{destroy(){i(),a()}}})]}function nt(e,t){return e.enabled?[Ne(),Me(async n=>rt(n.state.doc,await x(n.state.doc.toString(),e,t)),{delay:600})]:[]}function Q(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function rt(e,t){let n=[];for(let r of t){let t=Q(e,r.range.start),i=Q(e,r.range.end),a={from:t,to:Math.max(i,t),severity:r.severity,message:r.message,source:`${r.source}/${r.code}`},o=it(r);o&&(a.actions=[o]),n.push(a)}return n}function it(e){let t=e.fixes;return!t||t.length===0?null:{name:`Fix`,apply(e){let n=e.state.doc;e.dispatch({changes:t.map(e=>({from:Q(n,e.range.start),to:Q(n,e.range.end),insert:e.newText})),userEvent:`input.complete`})}}}var at=[J(),K(),X(),xe(),Y(),W(),be.allowMultipleSelections.of(!0),A(),G(),De(),Te(),U(),q(),B(),je(),V.of([...we,...Ce,...Ie,...z,...Ee,...Fe])],ot=L.mark({class:`cm-link-ref-broken`}),st=/^\s{0,3}\[([^\]]+)\]:\s/,ct=/\[([^\]]*)\]\[([^\]]*)\]/g,lt=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function $(e,t){let n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i];if(e<a.from)r=i-1;else if(e>=a.to)n=i+1;else return!0}return!1}function ut(e){let t=[];return M(e).iterate({enter(e){if(lt.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function dt(e){let t=new Set,n=[],r=e.doc,i=ut(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if($(n.from,i))continue;let a=st.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!$(t.from,i)&&!st.test(t.text))for(ct.lastIndex=0;;){let e=ct.exec(t.text);if(!e)break;let r=t.from+e.index;if($(r,i))continue;let a=e[2]||e[1];n.push({from:r,to:r+e[0].length,label:a.toLowerCase()})}}let a=[];for(let e of n)t.has(e.label)||a.push(ot.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),L.set(a)}var ft=P.define({create(e){return dt(e)},update(e,t){return t.docChanged?dt(t.state):e},provide:e=>R.decorations.from(e)}),pt=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,mt=L.mark({class:`cm-del`}),ht=L.line({class:`cm-table-header`,attributes:{style:`--list-hang: 2ch`}}),gt=L.line({class:`cm-table-row`,attributes:{style:`--list-hang: 2ch`}});function _t(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function vt(e){if(e.doc.lines<2)return null;let t=e.doc.line(1);if(!b.test(t.text))return null;for(let n=2;n<=e.doc.lines;n++){let r=e.doc.line(n);if(b.test(r.text))return{from:t.from,to:r.to}}return null}function yt(e,t){let n=[],r=M(e),i=vt(e),a=e=>i!==null&&e>=i.from&&e<=i.to;for(let{from:i,to:o}of t)r.iterate({from:i,to:o,enter(t){if(!a(t.from)){if(t.name===`Strikethrough`){let e=t.from,r=t.to,i=t.node.cursor();if(i.firstChild())do i.name===`StrikethroughMark`&&(i.from===t.from?e=i.to:r=i.from);while(i.nextSibling());return e<r&&n.push(mt.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=pt.exec(r.text),a=i?i[1].length:2,o=L.line({class:`cm-list-item`,attributes:{style:`--list-hang: ${a}ch`}});n.push(o.range(r.from));return}if(t.name===`FencedCode`){let r=e.doc.lineAt(t.from),i=e.doc.lineAt(t.to);for(let t=r.number+1;t<i.number;t++){let r=e.doc.line(t),i=_t(r.text),a=L.line({class:`cm-fenced-code-line`,attributes:{style:`--line-indent: ${i}`}});n.push(a.range(r.from))}return!1}if(t.name===`TableHeader`){let r=e.doc.lineAt(t.from);return n.push(ht.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(gt.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(gt.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),L.set(n)}var bt=class{decorations;constructor(e){this.decorations=yt(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||M(e.startState)!==M(e.state))&&(this.decorations=yt(e.view.state,e.view.visibleRanges))}},xt=k.fromClass(bt,{decorations:e=>e.decorations});function St(){return[xt,ft]}var Ct=t(),wt=N.define();function Tt(e,t,n){let r=w(e.state.doc)[t.index];r&&c(n,()=>{e.dispatch({selection:F.cursor(r.from),effects:R.scrollIntoView(r.from,{y:`start`})}),e.focus()})}function Et(e,t,n,r){requestAnimationFrame(()=>{if(!n())return;let i=e.state.doc,a=Math.min(t.offset,i.length);c(r,()=>{e.dispatch({selection:F.cursor(a),effects:R.scrollIntoView(a,{y:`center`})}),e.focus()})})}function Dt(e,t,n){let r=e.state.doc,i=Math.min(Math.max(t.line,1),r.lines),a=r.line(i),o=Math.min(a.from+Math.max(0,t.column-1),a.to);c(n,()=>{e.dispatch({selection:F.cursor(o),effects:R.scrollIntoView(o,{y:`start`})}),e.focus()})}function Ot(e){let t=(0,Be.c)(50),{docName:n,ytext:i,provider:a,placeholder:o,isSourceModeActive:c}=e,p=(0,Z.useRef)(null),h=(0,Z.useRef)(null),[g,ne]=(0,Z.useState)(null);if(g)throw g;let{resolvedTheme:_}=m(),{merged:v}=ce(),y=(0,Z.useRef)(c),b=v?.editor?.wordWrap??!0,{data:x}=Ae(n),S;t[0]!==x?.effective||t[1]!==v?(S=x?.effective??(v?.contentRules?oe(v.contentRules):se),t[0]=x?.effective,t[1]=v,t[2]=S):S=t[2];let C=S,w;t[3]===C?w=t[4]:(w=JSON.stringify(C),t[3]=C,t[4]=w);let T=w,E,D;t[5]===c?(E=t[6],D=t[7]):(E=()=>{y.current=c},D=[c],t[5]=c,t[6]=E,t[7]=D),(0,Z.useEffect)(E,D);let O=(0,Z.useRef)(null),k;t[8]!==n||t[9]!==C||t[10]!==o||t[11]!==a||t[12]!==_||t[13]!==b||t[14]!==i?(k=()=>{let e=p.current;if(!e)return;let t=a.configuration.name??``,c,m=At;try{c=l({docName:t,container:e,sizeStats:{viewCount:0,bytes:i.length},factory:e=>{let r=null,c=u({ydoc:a.document,ytext:i,docName:t}),l=new j,d=new j,f=new j,p=new j,h=new R({state:be.create({doc:i.toString(),extensions:[at,qe,Pe({scrollToMatch:e=>ee(t)?R.scrollIntoView(e,{y:`start`}):wt.of(null)}),V.of([Se]),ze(i,a.awareness),V.of(Re),...ie({themeCompartment:l,resolvedTheme:_,ydoc:a.document,wordWrapCompartment:d,wordWrap:b,currentDocName:t}),St(),Ue(t),le(),p.of(nt(C,n)),tt(n),c,R.updateListener.of(e=>{te(e)&&s(t)}),R.updateListener.of(e=>{!e.selectionSet&&!e.docChanged||(r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,_e(t,`source`,me(e.view)),ke(t,`source`,Oe(e.view,t))},120))}),f.of(ye(o??``)),R.theme({"&":{height:`100%`}}),R.scrollMargins.of(kt)]}),parent:e});_e(t,`source`,me(h)),ke(t,`source`,Oe(h,t));let g=h.contentDOM;return g.addEventListener(`keydown`,m),g.addEventListener(`paste`,m),g.addEventListener(`drop`,m),g.addEventListener(`cut`,m),{view:h,ydoc:a.document,ytext:i,provider:a,themeCompartment:l,wordWrapCompartment:d,placeholderCompartment:f,lintCompartment:p}}}),O.current=c,h.current=c.view,r(n,c.view),ve()&&c.view.focus()}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),O.current=null,h.current=null,ne(t instanceof Error?t:Error(String(t)))}return()=>{let e=O.current;e&&(f(e),d(n,e.view)),O.current=null,h.current=null}},t[8]=n,t[9]=C,t[10]=o,t[11]=a,t[12]=_,t[13]=b,t[14]=i,t[15]=k):k=t[15];let A;t[16]!==a||t[17]!==i?(A=[i,a],t[16]=a,t[17]=i,t[18]=A):A=t[18],(0,Z.useEffect)(k,A);let M,N;t[19]===n?(M=t[20],N=t[21]):(M=()=>{},N=[n],t[19]=n,t[20]=M,t[21]=N),(0,Z.useEffect)(M,N);let P,F;t[22]===_?(P=t[23],F=t[24]):(F=()=>{let e=O.current;e&&e.view.dispatch({effects:e.themeCompartment.reconfigure(_===`dark`?re:ae)})},P=[_],t[22]=_,t[23]=P,t[24]=F),(0,Z.useEffect)(F,P);let I,L;t[25]===b?(I=t[26],L=t[27]):(I=()=>{let e=O.current;e&&e.view.dispatch({effects:e.wordWrapCompartment.reconfigure(b?R.lineWrapping:[])})},L=[b],t[25]=b,t[26]=I,t[27]=L),(0,Z.useEffect)(I,L);let z,B;t[28]===o?(z=t[29],B=t[30]):(z=()=>{let e=O.current;e&&e.view.dispatch({effects:e.placeholderCompartment.reconfigure(ye(o??``))})},B=[o],t[28]=o,t[29]=z,t[30]=B),(0,Z.useEffect)(z,B);let H;t[31]!==n||t[32]!==C?(H=()=>{let e=O.current;e&&e.view.dispatch({effects:e.lintCompartment.reconfigure(nt(C,n))})},t[31]=n,t[32]=C,t[33]=H):H=t[33];let U;t[34]===T?U=t[35]:(U=[T],t[34]=T,t[35]=U),(0,Z.useEffect)(H,U);let W,G;t[36]!==n||t[37]!==c?(W=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==n||t.mode!==`source`||!c)return;let r=h.current;r&&(Tt(r,t,n),he(n))};return window.addEventListener(ge,e),()=>window.removeEventListener(ge,e)},G=[n,c],t[36]=n,t[37]=c,t[38]=W,t[39]=G):(W=t[38],G=t[39]),(0,Z.useEffect)(W,G);let K,q;t[40]!==n||t[41]!==c?(K=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==n||!c)return;let r=h.current;r&&(Dt(r,t,n),he(n))};return window.addEventListener(pe,e),()=>window.removeEventListener(pe,e)},q=[n,c],t[40]=n,t[41]=c,t[42]=K,t[43]=q):(K=t[42],q=t[43]),(0,Z.useEffect)(K,q);let J,Y;t[44]!==n||t[45]!==c||t[46]!==a?(J=()=>{if(!c)return;let e=h.current;if(!e)return;let t=fe(n);if(!t)return;if(t.kind!==`selection-offset`){ue(n),t.kind===`outline`?Tt(e,t.detail,n):t.kind===`lint`?Dt(e,t.detail,n):t.kind===`raw-mdx`&&Et(e,t.detail,()=>y.current,n);return}let r=!1,i=null;return queueMicrotask(()=>{if(r)return;let t=fe(n);t?.kind===`selection-offset`&&(i=de({view:e,docName:n,navigation:t,ydoc:a.document,transition:{from:`wysiwyg`,to:`source`}}),i&&ue(n))}),()=>{r=!0,i?.cancel(`mode-flip`)}},Y=[n,c,a],t[44]=n,t[45]=c,t[46]=a,t[47]=J,t[48]=Y):(J=t[47],Y=t[48]),(0,Z.useEffect)(J,Y);let X;return t[49]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,Ct.jsx)(`div`,{ref:p,className:`source-editor h-full pb-3`}),t[49]=X):X=t[49],X}function kt(){return{top:S()}}function At(){return _()}export{Ot as SourceEditor,Et as applyRawMdxNavigation};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{B as n,Dt as r,H as i,U as a,W as o,ct as s,dn as c,ft as l,j as u,kt as d,on as ee,ot as te,pt as f}from"./DocumentContext-HSIpKTjH.js";import{t as p}from"./react-f2sANaYj.js";import{n as m}from"./dist-PQ5KMVDh.js";import{t as h}from"./compiler-runtime-BfE3aGVn.js";import{A as g,O as ne,S as _,a as re,i as ie,o as ae}from"./CodeMirrorPropInput-BkFI4cSq.js";import{Do as v,Gi as oe,T as se,_o as y,do as b,ni as x}from"./dist-DGemBD_J.js";import{h as ce}from"./use-apply-config-color-theme-DZRctrdg.js";import{H as S,L as le,M as ue,O as de,P as fe,S as C,d as w,f as pe,i as me,j as he,l as ge,r as _e,t as ve,w as T}from"./typing-burst-detector-B9Z2sXqG.js";import{f as E,g as D}from"./doc-paths-BkpejoFL.js";import{J as O}from"./navigation-targets-D6rHX3Pq.js";import"./config-provider-Bs9S-Mvn.js";import{$ as k,D as A,Dt as j,F as M,It as N,Lt as P,Ot as F,Pt as I,Y as L,Z as R,b as z,ct as B,ft as V,g as H,gt as U,ht as ye,it as W,kt as be,l as G,lt as K,nt as q,pt as J,rt as Y,ut as X,v as xe}from"./dist-ZfIywMZM.js";import{a as Se,n as Ce}from"./cm-theme-Bi-g5j8J.js";import{i as we,n as Te,o as Ee,r as De}from"./dist-8oXszleg.js";import{o as Oe,r as ke}from"./selection-context-CcGgvqKu.js";import{l as Ae}from"./lint-config-client-sK38eqbj.js";import{a as je,i as Me,n as Ne,o as Pe,r as Fe,s as Ie,t as Le}from"./dist-DpwTwWzy.js";import{n as Re,t as ze}from"./src-BxKUvqJT.js";var Z=e(p(),1),Be=h();function Ve(){let e=o();return e===null?null:new Set(e.keys())}function He(e,t,r){let i=[],a=M(e);if(r!=null){let n=[];for(let{from:e,to:r}of t)a.iterate({from:e,to:r,enter(e){if(e.name===`InlineCode`||e.name===`FencedCode`)return n.push({from:e.from,to:e.to}),!1}});let o=(e,t)=>n.some(n=>e>=n.from&&t<=n.to);for(let{from:n,to:a}of t){let t=e.doc.sliceString(n,a);y.lastIndex=0;for(let e=y.exec(t);e!==null;e=y.exec(t)){let t=e[2];if(!v(t))continue;let a=n+(e.index??0)+e[1].length,s=a+t.length+1;o(a,s)||i.push(L.mark({class:r.has(t)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":t}}).range(a,s))}}}for(let{from:o,to:s}of t)a.iterate({from:o,to:s,enter(t){if(t.name!==`InlineCode`)return;let a=e.doc.sliceString(t.from,t.to),o=a.length-a.replace(/^`+/,``).length,s=a.length-a.replace(/`+$/,``).length,c=a.slice(o,a.length-s),l=/^\/([a-z0-9][a-z0-9-]{1,63})$/.exec(c)?.[1];if(l!==void 0&&v(l)&&r!=null)return i.push(L.mark({class:r.has(l)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":l}}).range(t.from+o,t.to-s)),!1;let u=n.exec(c);if(u)return i.push(L.mark({class:`cm-skill-path-link`,attributes:{"data-skill-path":u[1]}}).range(t.from+o,t.to-s)),!1}});return i.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),L.set(i)}function Ue(e){let t=a(e);return t===null?[]:[k.fromClass(class{decorations;constructor(e){this.decorations=He(e.state,e.visibleRanges,Ve())}update(e){(e.docChanged||e.viewportChanged||M(e.startState)!==M(e.state))&&(this.decorations=He(e.view.state,e.view.visibleRanges,Ve()))}},{decorations:e=>e.decorations}),R.domEventHandlers({mousedown(n){let r=n.target?.closest?.(`[data-skill-ref]`),a=r instanceof HTMLElement?r.dataset.skillRef:void 0;if(a!==void 0){n.preventDefault();let e=o()?.get(a);return window.location.hash=e===void 0?D():E(O({scope:e.scope,name:a,path:e.path})),!0}let s=n.target?.closest?.(`.cm-skill-path-link`),c=s instanceof HTMLElement?s.dataset.skillPath:void 0;return c===void 0?!1:(n.preventDefault(),window.location.hash=i(t,e,c),!0)}})]}var We=L.line({attributes:{dir:`auto`}});function Ge(e){let t=new I;for(let n of e.visibleRanges)for(let r=n.from;r<=n.to;){let n=e.state.doc.lineAt(r);t.add(n.from,n.from,We),r=n.to+1}return t.finish()}var Ke=k.fromClass(class{decorations;constructor(e){this.decorations=Ge(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=Ge(e.view))}},{decorations:e=>e.decorations}),qe=[R.perLineTextDirection.of(!0),Ke],Je=new Set([`Link`,`Image`,`HTMLTag`,`HTMLBlock`]),Ye=`cm-lint-local-target`;function Xe(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function Ze(e,t){let n=H(e,t+1,100);if(n){let e=n.resolveInner(t,1);for(;e;){if(Je.has(e.name))return{from:e.from,to:e.to};e=e.parent}}return{from:t,to:t}}function Qe(e){return e===`error`?`error`:e===`info`?`info`:`warning`}function $e(e,t){let n=e.doc,r=[];for(let i of t){if(i.source!==`links`)continue;let t=Ze(e,Xe(n,i.range.start));r.push({from:t.from,to:Math.max(t.to,t.from),severity:Qe(i.severity),message:T(i),source:`${i.source}/${i.code}`,markClass:Ye})}return r}var et=N.define();function tt(e){let t={findings:[]};return[Me(e=>ne()?$e(e.state,t.findings):[],{delay:300,needsRefresh:e=>e.transactions.some(e=>e.effects.some(e=>e.is(et)))}),k.define(n=>{let r=e=>{t.findings=e,n.dispatch({effects:et.of(null)}),Le(n)},i=C(e,e=>{e.status===`loaded`&&r(e.findings)}),a=g(()=>r(t.findings));return{destroy(){i(),a()}}})]}function nt(e,t){return e.enabled?[Ne(),Me(async n=>rt(n.state.doc,await x(n.state.doc.toString(),e,t)),{delay:600})]:[]}function Q(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function rt(e,t){let n=[];for(let r of t){let t=Q(e,r.range.start),i=Q(e,r.range.end),a={from:t,to:Math.max(i,t),severity:r.severity,message:r.message,source:`${r.source}/${r.code}`},o=it(r);o&&(a.actions=[o]),n.push(a)}return n}function it(e){let t=e.fixes;return!t||t.length===0?null:{name:`Fix`,apply(e){let n=e.state.doc;e.dispatch({changes:t.map(e=>({from:Q(n,e.range.start),to:Q(n,e.range.end),insert:e.newText})),userEvent:`input.complete`})}}}var at=[J(),K(),X(),xe(),Y(),W(),be.allowMultipleSelections.of(!0),A(),G(),De(),Te(),U(),q(),B(),je(),V.of([...we,...Ce,...Ie,...z,...Ee,...Fe])],ot=L.mark({class:`cm-link-ref-broken`}),st=/^\s{0,3}\[([^\]]+)\]:\s/,ct=/\[([^\]]*)\]\[([^\]]*)\]/g,lt=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function $(e,t){let n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i];if(e<a.from)r=i-1;else if(e>=a.to)n=i+1;else return!0}return!1}function ut(e){let t=[];return M(e).iterate({enter(e){if(lt.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function dt(e){let t=new Set,n=[],r=e.doc,i=ut(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if($(n.from,i))continue;let a=st.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!$(t.from,i)&&!st.test(t.text))for(ct.lastIndex=0;;){let e=ct.exec(t.text);if(!e)break;let r=t.from+e.index;if($(r,i))continue;let a=e[2]||e[1];n.push({from:r,to:r+e[0].length,label:a.toLowerCase()})}}let a=[];for(let e of n)t.has(e.label)||a.push(ot.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),L.set(a)}var ft=P.define({create(e){return dt(e)},update(e,t){return t.docChanged?dt(t.state):e},provide:e=>R.decorations.from(e)}),pt=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,mt=L.mark({class:`cm-del`}),ht=L.line({class:`cm-table-header`,attributes:{style:`--list-hang: 2ch`}}),gt=L.line({class:`cm-table-row`,attributes:{style:`--list-hang: 2ch`}});function _t(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function vt(e){if(e.doc.lines<2)return null;let t=e.doc.line(1);if(!b.test(t.text))return null;for(let n=2;n<=e.doc.lines;n++){let r=e.doc.line(n);if(b.test(r.text))return{from:t.from,to:r.to}}return null}function yt(e,t){let n=[],r=M(e),i=vt(e),a=e=>i!==null&&e>=i.from&&e<=i.to;for(let{from:i,to:o}of t)r.iterate({from:i,to:o,enter(t){if(!a(t.from)){if(t.name===`Strikethrough`){let e=t.from,r=t.to,i=t.node.cursor();if(i.firstChild())do i.name===`StrikethroughMark`&&(i.from===t.from?e=i.to:r=i.from);while(i.nextSibling());return e<r&&n.push(mt.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=pt.exec(r.text),a=i?i[1].length:2,o=L.line({class:`cm-list-item`,attributes:{style:`--list-hang: ${a}ch`}});n.push(o.range(r.from));return}if(t.name===`FencedCode`){let r=e.doc.lineAt(t.from),i=e.doc.lineAt(t.to);for(let t=r.number+1;t<i.number;t++){let r=e.doc.line(t),i=_t(r.text),a=L.line({class:`cm-fenced-code-line`,attributes:{style:`--line-indent: ${i}`}});n.push(a.range(r.from))}return!1}if(t.name===`TableHeader`){let r=e.doc.lineAt(t.from);return n.push(ht.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(gt.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(gt.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),L.set(n)}var bt=class{decorations;constructor(e){this.decorations=yt(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||M(e.startState)!==M(e.state))&&(this.decorations=yt(e.view.state,e.view.visibleRanges))}},xt=k.fromClass(bt,{decorations:e=>e.decorations});function St(){return[xt,ft]}var Ct=t(),wt=N.define();function Tt(e,t,n){let r=w(e.state.doc)[t.index];r&&c(n,()=>{e.dispatch({selection:F.cursor(r.from),effects:R.scrollIntoView(r.from,{y:`start`})}),e.focus()})}function Et(e,t,n,r){requestAnimationFrame(()=>{if(!n())return;let i=e.state.doc,a=Math.min(t.offset,i.length);c(r,()=>{e.dispatch({selection:F.cursor(a),effects:R.scrollIntoView(a,{y:`center`})}),e.focus()})})}function Dt(e,t,n){let r=e.state.doc,i=Math.min(Math.max(t.line,1),r.lines),a=r.line(i),o=Math.min(a.from+Math.max(0,t.column-1),a.to);c(n,()=>{e.dispatch({selection:F.cursor(o),effects:R.scrollIntoView(o,{y:`start`})}),e.focus()})}function Ot(e){let t=(0,Be.c)(50),{docName:n,ytext:i,provider:a,placeholder:o,isSourceModeActive:c}=e,p=(0,Z.useRef)(null),h=(0,Z.useRef)(null),[g,ne]=(0,Z.useState)(null);if(g)throw g;let{resolvedTheme:_}=m(),{merged:v}=ce(),y=(0,Z.useRef)(c),b=v?.editor?.wordWrap??!0,{data:x}=Ae(n),S;t[0]!==x?.effective||t[1]!==v?(S=x?.effective??(v?.contentRules?oe(v.contentRules):se),t[0]=x?.effective,t[1]=v,t[2]=S):S=t[2];let C=S,w;t[3]===C?w=t[4]:(w=JSON.stringify(C),t[3]=C,t[4]=w);let T=w,E,D;t[5]===c?(E=t[6],D=t[7]):(E=()=>{y.current=c},D=[c],t[5]=c,t[6]=E,t[7]=D),(0,Z.useEffect)(E,D);let O=(0,Z.useRef)(null),k;t[8]!==n||t[9]!==C||t[10]!==o||t[11]!==a||t[12]!==_||t[13]!==b||t[14]!==i?(k=()=>{let e=p.current;if(!e)return;let t=a.configuration.name??``,c,m=At;try{c=l({docName:t,container:e,sizeStats:{viewCount:0,bytes:i.length},factory:e=>{let r=null,c=u({ydoc:a.document,ytext:i,docName:t}),l=new j,d=new j,f=new j,p=new j,h=new R({state:be.create({doc:i.toString(),extensions:[at,qe,Pe({scrollToMatch:e=>ee(t)?R.scrollIntoView(e,{y:`start`}):wt.of(null)}),V.of([Se]),ze(i,a.awareness),V.of(Re),...ie({themeCompartment:l,resolvedTheme:_,ydoc:a.document,wordWrapCompartment:d,wordWrap:b,currentDocName:t}),St(),Ue(t),le(),p.of(nt(C,n)),tt(n),c,R.updateListener.of(e=>{te(e)&&s(t)}),R.updateListener.of(e=>{!e.selectionSet&&!e.docChanged||(r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,_e(t,`source`,me(e.view)),ke(t,`source`,Oe(e.view,t))},120))}),f.of(ye(o??``)),R.theme({"&":{height:`100%`}}),R.scrollMargins.of(kt)]}),parent:e});_e(t,`source`,me(h)),ke(t,`source`,Oe(h,t));let g=h.contentDOM;return g.addEventListener(`keydown`,m),g.addEventListener(`paste`,m),g.addEventListener(`drop`,m),g.addEventListener(`cut`,m),{view:h,ydoc:a.document,ytext:i,provider:a,themeCompartment:l,wordWrapCompartment:d,placeholderCompartment:f,lintCompartment:p}}}),O.current=c,h.current=c.view,r(n,c.view),ve()&&c.view.focus()}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),O.current=null,h.current=null,ne(t instanceof Error?t:Error(String(t)))}return()=>{let e=O.current;e&&(f(e),d(n,e.view)),O.current=null,h.current=null}},t[8]=n,t[9]=C,t[10]=o,t[11]=a,t[12]=_,t[13]=b,t[14]=i,t[15]=k):k=t[15];let A;t[16]!==a||t[17]!==i?(A=[i,a],t[16]=a,t[17]=i,t[18]=A):A=t[18],(0,Z.useEffect)(k,A);let M,N;t[19]===n?(M=t[20],N=t[21]):(M=()=>{},N=[n],t[19]=n,t[20]=M,t[21]=N),(0,Z.useEffect)(M,N);let P,F;t[22]===_?(P=t[23],F=t[24]):(F=()=>{let e=O.current;e&&e.view.dispatch({effects:e.themeCompartment.reconfigure(_===`dark`?re:ae)})},P=[_],t[22]=_,t[23]=P,t[24]=F),(0,Z.useEffect)(F,P);let I,L;t[25]===b?(I=t[26],L=t[27]):(I=()=>{let e=O.current;e&&e.view.dispatch({effects:e.wordWrapCompartment.reconfigure(b?R.lineWrapping:[])})},L=[b],t[25]=b,t[26]=I,t[27]=L),(0,Z.useEffect)(I,L);let z,B;t[28]===o?(z=t[29],B=t[30]):(z=()=>{let e=O.current;e&&e.view.dispatch({effects:e.placeholderCompartment.reconfigure(ye(o??``))})},B=[o],t[28]=o,t[29]=z,t[30]=B),(0,Z.useEffect)(z,B);let H;t[31]!==n||t[32]!==C?(H=()=>{let e=O.current;e&&e.view.dispatch({effects:e.lintCompartment.reconfigure(nt(C,n))})},t[31]=n,t[32]=C,t[33]=H):H=t[33];let U;t[34]===T?U=t[35]:(U=[T],t[34]=T,t[35]=U),(0,Z.useEffect)(H,U);let W,G;t[36]!==n||t[37]!==c?(W=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==n||t.mode!==`source`||!c)return;let r=h.current;r&&(Tt(r,t,n),he(n))};return window.addEventListener(ge,e),()=>window.removeEventListener(ge,e)},G=[n,c],t[36]=n,t[37]=c,t[38]=W,t[39]=G):(W=t[38],G=t[39]),(0,Z.useEffect)(W,G);let K,q;t[40]!==n||t[41]!==c?(K=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==n||!c)return;let r=h.current;r&&(Dt(r,t,n),he(n))};return window.addEventListener(pe,e),()=>window.removeEventListener(pe,e)},q=[n,c],t[40]=n,t[41]=c,t[42]=K,t[43]=q):(K=t[42],q=t[43]),(0,Z.useEffect)(K,q);let J,Y;t[44]!==n||t[45]!==c||t[46]!==a?(J=()=>{if(!c)return;let e=h.current;if(!e)return;let t=fe(n);if(!t)return;if(t.kind!==`selection-offset`){ue(n),t.kind===`outline`?Tt(e,t.detail,n):t.kind===`lint`?Dt(e,t.detail,n):t.kind===`raw-mdx`&&Et(e,t.detail,()=>y.current,n);return}let r=!1,i=null;return queueMicrotask(()=>{if(r)return;let t=fe(n);t?.kind===`selection-offset`&&(i=de({view:e,docName:n,navigation:t,ydoc:a.document,transition:{from:`wysiwyg`,to:`source`}}),i&&ue(n))}),()=>{r=!0,i?.cancel(`mode-flip`)}},Y=[n,c,a],t[44]=n,t[45]=c,t[46]=a,t[47]=J,t[48]=Y):(J=t[47],Y=t[48]),(0,Z.useEffect)(J,Y);let X;return t[49]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,Ct.jsx)(`div`,{ref:p,className:`source-editor h-full pb-3`}),t[49]=X):X=t[49],X}function kt(){return{top:S()}}function At(){return _()}export{Ot as SourceEditor,Et as applyRawMdxNavigation};
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{t as s}from"./button-CA0dewJJ.js";import{Bi as c,Tn as l,Vi as u,Xt as d,yn as f}from"./dist-DGemBD_J.js";import{n as p}from"./dist-D81TFAXh.js";import{m}from"./use-apply-config-color-theme-DZRctrdg.js";import{t as h}from"./x-DddVxTPq.js";import{f as g,p as _,u as v}from"./doc-paths-BkpejoFL.js";import{X as y}from"./navigation-targets-saCskzOA.js";import{f as b,h as x}from"./file-tree-adapter-BAEEzFBR.js";import{t as ee}from"./use-live-xterm-theme-C1EtEd_i.js";import{r as te}from"./terminal-command-events-CwHEMoPz.js";var S=a(),C=2,w=1,T=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(C,Math.floor(u/e.css.cell.width)),rows:Math.max(w,Math.floor(l/e.css.cell.height))}}},E=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],D=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],O;function ne(e,t){let n=0,r=t.length-1,i;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e<t[i][0])r=i-1;else return!0;return!1}var re=class{constructor(){if(this.version=`6`,!O){O=new Uint8Array(65536),O.fill(1),O[0]=0,O.fill(0,1,32),O.fill(0,127,160),O.fill(2,4352,4448),O[9001]=2,O[9002]=2,O.fill(2,11904,42192),O[12351]=1,O.fill(2,44032,55204),O.fill(2,63744,64256),O.fill(2,65040,65050),O.fill(2,65072,65136),O.fill(2,65280,65377),O.fill(2,65504,65511);for(let e=0;e<E.length;++e)O.fill(0,E[e][0],E[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?O[e]:ne(e,D)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let e=Ze.extractWidth(t);e===0?r=!1:e>n&&(n=e)}return Ze.createPropertyValue(0,n,r)}},k=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?M.isErrorNoTelemetry(e)?new M(e.message+`
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{t as s}from"./button-CA0dewJJ.js";import{Bi as c,Tn as l,Vi as u,Xt as d,yn as f}from"./dist-DGemBD_J.js";import{n as p}from"./dist-D81TFAXh.js";import{m}from"./use-apply-config-color-theme-DZRctrdg.js";import{t as h}from"./x-DddVxTPq.js";import{f as g,p as _,u as v}from"./doc-paths-BkpejoFL.js";import{X as y}from"./navigation-targets-D6rHX3Pq.js";import{f as b,h as x}from"./file-tree-adapter-Bo3rGytc.js";import{t as ee}from"./use-live-xterm-theme-C1EtEd_i.js";import{r as te}from"./terminal-command-events-CwHEMoPz.js";var S=a(),C=2,w=1,T=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(C,Math.floor(u/e.css.cell.width)),rows:Math.max(w,Math.floor(l/e.css.cell.height))}}},E=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],D=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],O;function ne(e,t){let n=0,r=t.length-1,i;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e<t[i][0])r=i-1;else return!0;return!1}var re=class{constructor(){if(this.version=`6`,!O){O=new Uint8Array(65536),O.fill(1),O[0]=0,O.fill(0,1,32),O.fill(0,127,160),O.fill(2,4352,4448),O[9001]=2,O[9002]=2,O.fill(2,11904,42192),O[12351]=1,O.fill(2,44032,55204),O.fill(2,63744,64256),O.fill(2,65040,65050),O.fill(2,65072,65136),O.fill(2,65280,65377),O.fill(2,65504,65511);for(let e=0;e<E.length;++e)O.fill(0,E[e][0],E[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?O[e]:ne(e,D)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let e=Ze.extractWidth(t);e===0?r=!1:e>n&&(n=e)}return Ze.createPropertyValue(0,n,r)}},k=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?M.isErrorNoTelemetry(e)?new M(e.message+`
2
2
 
3
3
  `+e.stack):Error(e.message+`
4
4
 
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r}from"./dist-PQ5KMVDh.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{t as a}from"./config-provider-C7t6oRiN.js";import{t as o}from"./use-installed-clis-DZ3aSVtd.js";import{t as s}from"./use-live-xterm-theme-C1EtEd_i.js";import{SessionsHost as c}from"./SessionsHost-Bn80i4wO.js";var l=i(),u=e(n(),1),d=t();function f(e){let t=(0,l.c)(5),{bridge:n}=e,r=n.config.collabUrl?n.config.collabUrl:null,i;t[0]===n?i=t[1]:(i=(0,d.jsx)(p,{bridge:n}),t[0]=n,t[1]=i);let o;return t[2]!==r||t[3]!==i?(o=(0,d.jsx)(a,{collabUrl:r,children:i}),t[2]=r,t[3]=i,t[4]=o):o=t[4],o}function p(e){let t=(0,l.c)(9),{bridge:n}=e,{resolvedTheme:i}=r(),a=s(i),f=o(),[p,g]=(0,u.useState)(null),_;t[0]===a.background?_=t[1]:(_=(0,d.jsx)(`div`,{ref:g,className:`flex h-screen min-h-0 flex-col`,style:{backgroundColor:a.background}}),t[0]=a.background,t[1]=_);let v;t[2]!==n||t[3]!==p||t[4]!==f?(v=(0,d.jsx)(c,{bridge:n,surface:`terminal-window`,terminalCapable:!0,visible:!0,onVisibleChange:h,installedClis:f,container:p,isShowing:!0,onRequestEditorFocus:m}),t[2]=n,t[3]=p,t[4]=f,t[5]=v):v=t[5];let y;return t[6]!==_||t[7]!==v?(y=(0,d.jsxs)(d.Fragment,{children:[_,v]}),t[6]=_,t[7]=v,t[8]=y):y=t[8],y}function m(){}function h(e){e||window.close()}export{f as TerminalWindowApp};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r}from"./dist-PQ5KMVDh.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{t as a}from"./config-provider-Bs9S-Mvn.js";import{t as o}from"./use-installed-clis-DZ3aSVtd.js";import{t as s}from"./use-live-xterm-theme-C1EtEd_i.js";import{SessionsHost as c}from"./SessionsHost-D_oypiot.js";var l=i(),u=e(n(),1),d=t();function f(e){let t=(0,l.c)(5),{bridge:n}=e,r=n.config.collabUrl?n.config.collabUrl:null,i;t[0]===n?i=t[1]:(i=(0,d.jsx)(p,{bridge:n}),t[0]=n,t[1]=i);let o;return t[2]!==r||t[3]!==i?(o=(0,d.jsx)(a,{collabUrl:r,children:i}),t[2]=r,t[3]=i,t[4]=o):o=t[4],o}function p(e){let t=(0,l.c)(9),{bridge:n}=e,{resolvedTheme:i}=r(),a=s(i),f=o(),[p,g]=(0,u.useState)(null),_;t[0]===a.background?_=t[1]:(_=(0,d.jsx)(`div`,{ref:g,className:`flex h-screen min-h-0 flex-col`,style:{backgroundColor:a.background}}),t[0]=a.background,t[1]=_);let v;t[2]!==n||t[3]!==p||t[4]!==f?(v=(0,d.jsx)(c,{bridge:n,surface:`terminal-window`,terminalCapable:!0,visible:!0,onVisibleChange:h,installedClis:f,container:p,isShowing:!0,onRequestEditorFocus:m}),t[2]=n,t[3]=p,t[4]=f,t[5]=v):v=t[5];let y;return t[6]!==_||t[7]!==v?(y=(0,d.jsxs)(d.Fragment,{children:[_,v]}),t[6]=_,t[7]=v,t[8]=y):y=t[8],y}function m(){}function h(e){e||window.close()}export{f as TerminalWindowApp};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{n as o}from"./CodeMirrorPropInput-Bbe8zInO.js";import{ns as s,ps as c,ur as l}from"./dist-DGemBD_J.js";import{g as u}from"./config-provider-C7t6oRiN.js";import{Dt as d,P as f,Z as p,kt as m}from"./dist-D9pOpWzq.js";import{t as h}from"./cm-theme-Da-a0GOT.js";import{t as g}from"./dist-DV5JQxhA.js";import{t as _}from"./text-viewer-languages-BTH8XtqT.js";import{t as v}from"./src-C-kGu7U9.js";var y=a(),b=e(n(),1),x=t(),S=h({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),C=h({dark:!1,background:`var(--background)`,gutterBackground:`var(--muted)`});function w(e){let t=(0,y.c)(19),{docName:n,provider:a}=e,{_:h}=r(),w=n.slice(n.lastIndexOf(`/`)+1),T=(0,b.useRef)(null),{resolvedTheme:E}=i(),D;t[0]===a.document?D=t[1]:(D=a.document.getText(`source`),t[0]=a.document,t[1]=D);let O=D,k;t[2]===O?k=t[3]:(k=()=>new u(O),t[2]=O,t[3]=k);let[A]=(0,b.useState)(k),j;t[4]!==n||t[5]!==a.awareness||t[6]!==E||t[7]!==A||t[8]!==O?(j=()=>{let e=T.current;if(!e)return;let t=E===`dark`?S:C,r=new d,i=new d,u=(s[l(n)]??c(l(n)))!==null&&l(n)!==``,h=new p({state:m.create({doc:O.toString(),extensions:[g,v(O,a.awareness,{undoManager:A}),r.of([]),f(o),i.of(u?[]:p.lineWrapping),p.theme({"&":{height:`100%`}}),t]}),parent:e}),y=!1,b=l(n)||null;return b&&_(b,s[b]??c(b)).then(e=>{y||!e||h.dispatch({effects:r.reconfigure(e)})}),()=>{y=!0,h.destroy()}},t[4]=n,t[5]=a.awareness,t[6]=E,t[7]=A,t[8]=O,t[9]=j):j=t[9];let M;t[10]!==n||t[11]!==a||t[12]!==E||t[13]!==A||t[14]!==O?(M=[O,a,E,n,A],t[10]=n,t[11]=a,t[12]=E,t[13]=A,t[14]=O,t[15]=M):M=t[15],(0,b.useEffect)(j,M);let N=h({id:`xAlHfe`,values:{basename:w}}),P;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,x.jsx)(`div`,{ref:T,className:`min-h-0 flex-1 overflow-auto`}),t[16]=P):P=t[16];let F;return t[17]===N?F=t[18]:(F=(0,x.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":N,"data-text-doc-editor":``,children:P}),t[17]=N,t[18]=F),F}export{w as TextDocEditor};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{n as o}from"./CodeMirrorPropInput-BkFI4cSq.js";import{ns as s,ps as c,ur as l}from"./dist-DGemBD_J.js";import{g as u}from"./config-provider-Bs9S-Mvn.js";import{Dt as d,P as f,Z as p,kt as m}from"./dist-ZfIywMZM.js";import{t as h}from"./cm-theme-Bi-g5j8J.js";import{t as g}from"./dist-BOvI9R-K.js";import{t as _}from"./text-viewer-languages-CF6DiXgT.js";import{t as v}from"./src-BxKUvqJT.js";var y=a(),b=e(n(),1),x=t(),S=h({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),C=h({dark:!1,background:`var(--background)`,gutterBackground:`var(--muted)`});function w(e){let t=(0,y.c)(19),{docName:n,provider:a}=e,{_:h}=r(),w=n.slice(n.lastIndexOf(`/`)+1),T=(0,b.useRef)(null),{resolvedTheme:E}=i(),D;t[0]===a.document?D=t[1]:(D=a.document.getText(`source`),t[0]=a.document,t[1]=D);let O=D,k;t[2]===O?k=t[3]:(k=()=>new u(O),t[2]=O,t[3]=k);let[A]=(0,b.useState)(k),j;t[4]!==n||t[5]!==a.awareness||t[6]!==E||t[7]!==A||t[8]!==O?(j=()=>{let e=T.current;if(!e)return;let t=E===`dark`?S:C,r=new d,i=new d,u=(s[l(n)]??c(l(n)))!==null&&l(n)!==``,h=new p({state:m.create({doc:O.toString(),extensions:[g,v(O,a.awareness,{undoManager:A}),r.of([]),f(o),i.of(u?[]:p.lineWrapping),p.theme({"&":{height:`100%`}}),t]}),parent:e}),y=!1,b=l(n)||null;return b&&_(b,s[b]??c(b)).then(e=>{y||!e||h.dispatch({effects:r.reconfigure(e)})}),()=>{y=!0,h.destroy()}},t[4]=n,t[5]=a.awareness,t[6]=E,t[7]=A,t[8]=O,t[9]=j):j=t[9];let M;t[10]!==n||t[11]!==a||t[12]!==E||t[13]!==A||t[14]!==O?(M=[O,a,E,n,A],t[10]=n,t[11]=a,t[12]=E,t[13]=A,t[14]=O,t[15]=M):M=t[15],(0,b.useEffect)(j,M);let N=h({id:`xAlHfe`,values:{basename:w}}),P;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,x.jsx)(`div`,{ref:T,className:`min-h-0 flex-1 overflow-auto`}),t[16]=P):P=t[16];let F;return t[17]===N?F=t[18]:(F=(0,x.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":N,"data-text-doc-editor":``,children:P}),t[17]=N,t[18]=F),F}export{w as TextDocEditor};