@inkeep/open-knowledge 0.69.0-beta.5 → 0.69.0-beta.7

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 (142) hide show
  1. package/dist/cli.mjs +6 -6
  2. package/dist/constants-C5-rmp-Q.mjs +1 -0
  3. package/dist/index.mjs +1 -1
  4. package/dist/{init-Dir125F-.mjs → init-Br1nquCJ.mjs} +2 -2
  5. package/dist/init-CwCxvu8j.mjs +1 -0
  6. package/dist/{launch-json-removal-Cag08tw4.mjs → launch-json-removal-CFVaE9au.mjs} +1 -1
  7. package/dist/loader-CfFOPRwM.mjs +1 -0
  8. package/dist/{loader-Bi3IQ4W8.mjs → loader-pVUf6n0-.mjs} +1 -1
  9. package/dist/native/native-config.darwin-arm64.node +0 -0
  10. package/dist/native/native-config.darwin-x64.node +0 -0
  11. package/dist/native/native-config.linux-arm64-gnu.node +0 -0
  12. package/dist/native/native-config.linux-arm64-musl.node +0 -0
  13. package/dist/native/native-config.linux-x64-musl.node +0 -0
  14. package/dist/native/native-config.win32-arm64-msvc.node +0 -0
  15. package/dist/native/native-config.win32-x64-msvc.node +0 -0
  16. package/dist/preview-DYsEDl7O.mjs +1 -0
  17. package/dist/{preview-CdAH75He.mjs → preview-KIC1lYDh.mjs} +1 -1
  18. package/dist/public/assets/{ActivityModeContent-Dzlz-p9w.js → ActivityModeContent-CximtPXo.js} +1 -1
  19. package/dist/public/assets/AddPropertiesButton-CLAxY4Kp.js +2 -0
  20. package/dist/public/assets/{AgentDiffPane-Badnd0z5.js → AgentDiffPane-CZ6Irl2N.js} +1 -1
  21. package/dist/public/assets/{AppMenubar-JLeMOJpz.js → AppMenubar-Ba248X6T.js} +1 -1
  22. package/dist/public/assets/{BugReportHistory-YsKDA8Wg.js → BugReportHistory-CW96wvko.js} +1 -1
  23. package/dist/public/assets/{BugReportHistoryDialog-Cm-lMz2-.js → BugReportHistoryDialog-fg844kz-.js} +1 -1
  24. package/dist/public/assets/{CodeMirrorPropInput-CvenaDDl.js → CodeMirrorPropInput-DyT36_0H.js} +1 -1
  25. package/dist/public/assets/{ConsentDialogBody-Lw_SJixc.js → ConsentDialogBody-DLKYsBGr.js} +1 -1
  26. package/dist/public/assets/{DiffViewBoundary-DuQPEMcv.js → DiffViewBoundary-BsDs3Cr8.js} +1 -1
  27. package/dist/public/assets/{DocumentContext-BWfYIGn-.js → DocumentContext-DS_dUWBr.js} +1 -1
  28. package/dist/public/assets/{EditorModeToggle-B8xOZgYr.js → EditorModeToggle-Nq_bPbVL.js} +1 -1
  29. package/dist/public/assets/{EnableSyncConfirmDialog-7Bq4UalT.js → EnableSyncConfirmDialog-N-3Oe5uz.js} +1 -1
  30. package/dist/public/assets/{ExcalidrawDocEditor-qHB2EWCE.js → ExcalidrawDocEditor-C-NOBDVO.js} +1 -1
  31. package/dist/public/assets/FeedbackForm-D6gBXHih.js +1 -0
  32. package/dist/public/assets/{ImportSkillDialog-DNsoaSWE.js → ImportSkillDialog-BASlWroD.js} +1 -1
  33. package/dist/public/assets/{LintConfigEditor-Eajj_ona.js → LintConfigEditor-BL1ZjbK7.js} +1 -1
  34. package/dist/public/assets/ManagedArtifactProperties-1Jje2JUZ.js +1 -0
  35. package/dist/public/assets/{ManagedArtifactProperties-xmkjmIcU.js → ManagedArtifactProperties-E5_ddR_p.js} +1 -1
  36. package/dist/public/assets/{MermaidDocEditor-DbApv8jA.js → MermaidDocEditor-DE4hSQJD.js} +1 -1
  37. package/dist/public/assets/{PropertyDisplayRow-BZXUua7I.js → PropertyDisplayRow-B3v_6w4O.js} +2 -2
  38. package/dist/public/assets/{ReportBugDialogBody-C275Hr72.js → ReportBugDialogBody-Dzr6g2wD.js} +1 -1
  39. package/dist/public/assets/{ReportBugMenuTrigger-Ilx23iFu.js → ReportBugMenuTrigger-UUESg7vh.js} +2 -2
  40. package/dist/public/assets/{SchemaConfigEditor-DQcwju-H.js → SchemaConfigEditor-DlZbi0BH.js} +1 -1
  41. package/dist/public/assets/{SessionsHost-CqTpS39k.js → SessionsHost-Df5IVb6O.js} +2 -2
  42. package/dist/public/assets/SettingsDialogBody-BOCtv6zl.js +12 -0
  43. package/dist/public/assets/{ShareReceiveMissDialog-BNUxcUmo.js → ShareReceiveMissDialog-CrjCM6hU.js} +1 -1
  44. package/dist/public/assets/{SkillEditBanner-DxF5MrWn.js → SkillEditBanner-BPuqCq4o.js} +1 -1
  45. package/dist/public/assets/{SkillInstallMenu-BSeeI8R-.js → SkillInstallMenu-CVK9zId1.js} +1 -1
  46. package/dist/public/assets/{SkillOriginInline-B00Qx11t.js → SkillOriginInline-BvwZtzy0.js} +1 -1
  47. package/dist/public/assets/{SkillToolbarControls-CJLv0nyi.js → SkillToolbarControls-CMvIOhEL.js} +1 -1
  48. package/dist/public/assets/{SourceEditor-ByNnsvQe.js → SourceEditor-C74huF53.js} +1 -1
  49. package/dist/public/assets/{TerminalPanel-CzywxJp9.js → TerminalPanel-ADMpIanl.js} +1 -1
  50. package/dist/public/assets/{TerminalWindowApp-GeA2j10-.js → TerminalWindowApp-BusqUG6y.js} +1 -1
  51. package/dist/public/assets/{TextDocEditor-B7AzPtXW.js → TextDocEditor-LT7YyAwm.js} +1 -1
  52. package/dist/public/assets/ThreadView-CMGgpD7W.js +15 -0
  53. package/dist/public/assets/{TimelineDiffPane-BKQeyrX6.js → TimelineDiffPane-Bv8dQirf.js} +1 -1
  54. package/dist/public/assets/{agent-diff-store-C92NIPau.js → agent-diff-store-Cle15UKh.js} +1 -1
  55. package/dist/public/assets/{auth-state-cache-CXXOQdcM.js → auth-state-cache-qvH-oSfq.js} +1 -1
  56. package/dist/public/assets/{calendar-Cbe0GikB.js → calendar-OZUWiDsT.js} +1 -1
  57. package/dist/public/assets/{comment-chips-CdrJy7oX.js → comment-chips-vgbpHTuL.js} +1 -1
  58. package/dist/public/assets/{config-provider-DlzcUiYU.js → config-provider-Ck1DNDm7.js} +3 -3
  59. package/dist/public/assets/{dist-yFrmqHNO2.js → dist-D_m2fuwc2.js} +1 -1
  60. package/dist/public/assets/{doc-undo-manager-B2S3p7Kh.js → doc-undo-manager-VvINx_vq.js} +1 -1
  61. package/dist/public/assets/globals-DVivVCS3.css +1 -0
  62. package/dist/public/assets/i18n-LLIw89QS.js +1 -0
  63. package/dist/public/assets/index-B0DFp5A1.js +2205 -0
  64. package/dist/public/assets/{input-group-BChLCb-V.js → input-group-cb7RyEsm.js} +1 -1
  65. package/dist/public/assets/launch-agent-thread-Big-LvLD.js +1 -0
  66. package/dist/public/assets/{markdownlint-rule-browser-CMXE3hvX.js → markdownlint-rule-browser-B_7f1Awf.js} +1 -1
  67. package/dist/public/assets/messages-BjR7N346.js +1 -0
  68. package/dist/public/assets/messages-Bms9ZCX3.js +1 -0
  69. package/dist/public/assets/messages-BvsAGBeC.js +1 -0
  70. package/dist/public/assets/messages-Bx4IehS7.js +1 -0
  71. package/dist/public/assets/messages-C3zAHKSk.js +1 -0
  72. package/dist/public/assets/messages-CR_I7Cp3.js +1 -0
  73. package/dist/public/assets/messages-CUzLexij.js +1 -0
  74. package/dist/public/assets/messages-CX2LIRPQ.js +1 -0
  75. package/dist/public/assets/messages-DGVl_E7x.js +1 -0
  76. package/dist/public/assets/messages-GcLNaJaR.js +1 -0
  77. package/dist/public/assets/messages-c4jjA_8H.js +1 -0
  78. package/dist/public/assets/messages-zMV5QHq9.js +1 -0
  79. package/dist/public/assets/{pending-receive-nav-store-CJEI5S0U.js → pending-receive-nav-store-X1voDf8F.js} +1 -1
  80. package/dist/public/assets/progress-tXfeh49A.js +9 -0
  81. package/dist/public/assets/{selection-context-DJ_FIiJx.js → selection-context-VgoGxndZ.js} +1 -1
  82. package/dist/public/assets/{src-BuzwpJZ-.js → src-_s2f2_6g.js} +1 -1
  83. package/dist/public/assets/{terminal-launch-events-4mFI7_nd.js → terminal-launch-events-9VXuYbO-.js} +1 -1
  84. package/dist/public/assets/{typing-burst-detector-CyxGjpoW.js → typing-burst-detector-BIDnBCHc.js} +1 -1
  85. package/dist/public/assets/{uninstall-BY4ebvpt.js → uninstall-B_ZW49Bk.js} +1 -1
  86. package/dist/public/assets/{use-activity-panel-114XoWfq.js → use-activity-panel-0Kzpvkwn.js} +1 -1
  87. package/dist/public/assets/{use-open-skill-DhmFoS02.js → use-open-skill-CCmJFvMI.js} +1 -1
  88. package/dist/public/assets/{use-terminal-enabled-CqCHYTWh.js → use-terminal-enabled-BlfoUmdn.js} +1 -1
  89. package/dist/public/assets/{use-timeline-entry-diff-BY6jlhQ-.js → use-timeline-entry-diff-BUFMqeVp.js} +1 -1
  90. package/dist/public/index.html +40 -40
  91. package/dist/public/uninstall.html +6 -6
  92. package/dist/{registry-probes-DjyB1UXR.mjs → registry-probes-BWiHDStQ.mjs} +1 -1
  93. package/dist/{repair-launch-json-C4xKPQnT.mjs → repair-launch-json-y0Clfrcn.mjs} +1 -1
  94. package/dist/{repair-mcp-configs-D0p5PIEd.mjs → repair-mcp-configs-C44vgGl0.mjs} +1 -1
  95. package/dist/{src-DloZjtzc.mjs → src-C6R123ru.mjs} +1 -1
  96. package/dist/src-DkqeddhF.mjs +1 -0
  97. package/dist/start-BVxY0h4z.mjs +1 -0
  98. package/dist/{start-BuUQgI9a.mjs → start-D4PaXwo3.mjs} +2 -2
  99. package/package.json +5 -5
  100. package/dist/constants-CDJe2LeZ.mjs +0 -1
  101. package/dist/init-KxZzkxxa.mjs +0 -1
  102. package/dist/loader-DDHdV7iu.mjs +0 -1
  103. package/dist/preview-DA2iUYSX.mjs +0 -1
  104. package/dist/public/assets/AddPropertiesButton-BzvWvVbw.js +0 -2
  105. package/dist/public/assets/FeedbackForm-BRzK37KA.js +0 -1
  106. package/dist/public/assets/ManagedArtifactProperties-yRhiyBSE.js +0 -1
  107. package/dist/public/assets/SettingsDialogBody-CRTA_WKg.js +0 -12
  108. package/dist/public/assets/ThreadView-DUeOwoIP.js +0 -15
  109. package/dist/public/assets/globals-B99HAAhi.css +0 -1
  110. package/dist/public/assets/i18n-CRmWQMdd.js +0 -1
  111. package/dist/public/assets/index-vsKy3-tS.js +0 -2205
  112. package/dist/public/assets/launch-agent-thread-BKH-E3vQ.js +0 -1
  113. package/dist/public/assets/messages-B38DJ0BE.js +0 -1
  114. package/dist/public/assets/messages-Bgvh8HRb.js +0 -1
  115. package/dist/public/assets/messages-CH1lsr37.js +0 -1
  116. package/dist/public/assets/messages-CNGJq0Dc.js +0 -1
  117. package/dist/public/assets/messages-CR93thHz.js +0 -1
  118. package/dist/public/assets/messages-DEhJAmUT.js +0 -1
  119. package/dist/public/assets/messages-DVuZbxPa.js +0 -1
  120. package/dist/public/assets/messages-DY1HEckj.js +0 -1
  121. package/dist/public/assets/messages-DjKZXzIl.js +0 -1
  122. package/dist/public/assets/messages-DlTvWI3w.js +0 -1
  123. package/dist/public/assets/messages-DtvnLxcb.js +0 -1
  124. package/dist/public/assets/messages-cfb_wks8.js +0 -1
  125. package/dist/public/assets/progress-C3Z1B6MH.js +0 -9
  126. package/dist/src-C9ZPKdwo.mjs +0 -1
  127. package/dist/start-DI5DJ5KK.mjs +0 -1
  128. /package/dist/public/assets/{SkillCostValue-09FxLC0z.js → SkillCostValue-ZQq6hE5u.js} +0 -0
  129. /package/dist/public/assets/{SkillModeBanner-Ddqm42dL.js → SkillModeBanner-Dddk2HFX.js} +0 -0
  130. /package/dist/public/assets/{dist-BauSyrbN2.js → dist-zWrmTYco2.js} +0 -0
  131. /package/dist/public/assets/{file-tree-adapter-Co9sJppq.js → file-tree-adapter-VUzkO2kv.js} +0 -0
  132. /package/dist/public/assets/{format-CAWQmn3-.js → format-BSkuL3XD.js} +0 -0
  133. /package/dist/public/assets/{globals-DENhm9Ae.js → globals-2sss1K50.js} +0 -0
  134. /package/dist/public/assets/{lint-config-client-B61iX5QY.js → lint-config-client-D2qMETc6.js} +0 -0
  135. /package/dist/public/assets/{platform-labels-B5GR8Z3W.js → platform-labels-B3xX8Yyl.js} +0 -0
  136. /package/dist/public/assets/{skeleton-CuYI7n5h.js → skeleton-DIDidh7_.js} +0 -0
  137. /package/dist/public/assets/{sortable.esm-CicQhqQB.js → sortable.esm-HCgNojue.js} +0 -0
  138. /package/dist/public/assets/{text-viewer-languages-C-SOVufZ.js → text-viewer-languages-CSz-0bs7.js} +0 -0
  139. /package/dist/public/assets/{textarea-CcZScuQl.js → textarea-Cqj1jsXK.js} +0 -0
  140. /package/dist/public/assets/{timeline-diff-store-CtUeIujA.js → timeline-diff-store-hP7gGEyc.js} +0 -0
  141. /package/dist/public/assets/{use-conflicts-2jTGKNOt.js → use-conflicts-CMLH1ChX.js} +0 -0
  142. /package/dist/public/assets/{use-skill-origin-FAiHzQpH.js → use-skill-origin-CBguK4Xh.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-BYTIciug.js";import{a as l,i as u,n as d,o as f,r as p}from"./pending-receive-nav-store-CJEI5S0U.js";import{t as m}from"./miss-dialog-store-CNJRdTPE.js";import{l as h,u as g}from"./doc-hash-CH3Kq7TA.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-BYTIciug.js";import{a as l,i as u,n as d,o as f,r as p}from"./pending-receive-nav-store-X1voDf8F.js";import{t as m}from"./miss-dialog-store-CNJRdTPE.js";import{l as h,u as g}from"./doc-hash-CH3Kq7TA.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 +1 @@
1
- import{t as e}from"./jsx-runtime-BUgB2tll.js";import{n as t}from"./dist-Nvb76hAm.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{t as r}from"./square-pen-zPTA2xeB.js";import{s as i}from"./skill-scope-B1qEIboE.js";import{t as a}from"./SkillModeBanner-Ddqm42dL.js";var o=n(),s=e();function c(e){let n=(0,o.c)(7),{name:c}=e,l;n[0]===c?l=n[1]:(l=i(c),n[0]=c,n[1]=l);let u;n[2]===l?u=n[3]:(u=(0,s.jsx)(`strong`,{className:`font-medium text-foreground`,children:l}),n[2]=l,n[3]=u);let d=u,f;n[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,s.jsx)(r,{className:`size-4`,"aria-hidden":!0}),n[4]=f):f=n[4];let p;return n[5]===d?p=n[6]:(p=(0,s.jsx)(a,{icon:f,children:(0,s.jsx)(t,{id:`i-wHEp`,values:{boldName:d}})}),n[5]=d,n[6]=p),p}export{c as SkillEditBanner};
1
+ import{t as e}from"./jsx-runtime-BUgB2tll.js";import{n as t}from"./dist-Nvb76hAm.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{t as r}from"./square-pen-zPTA2xeB.js";import{s as i}from"./skill-scope-B1qEIboE.js";import{t as a}from"./SkillModeBanner-Dddk2HFX.js";var o=n(),s=e();function c(e){let n=(0,o.c)(7),{name:c}=e,l;n[0]===c?l=n[1]:(l=i(c),n[0]=c,n[1]=l);let u;n[2]===l?u=n[3]:(u=(0,s.jsx)(`strong`,{className:`font-medium text-foreground`,children:l}),n[2]=l,n[3]=u);let d=u,f;n[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,s.jsx)(r,{className:`size-4`,"aria-hidden":!0}),n[4]=f):f=n[4];let p;return n[5]===d?p=n[6]:(p=(0,s.jsx)(a,{icon:f,children:(0,s.jsx)(t,{id:`i-wHEp`,values:{boldName:d}})}),n[5]=d,n[6]=p),p}export{c as SkillEditBanner};
@@ -1,2 +1,2 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{nr as n}from"./DocumentContext-BWfYIGn-.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{r as c}from"./clipboard-adapter-815RzzoI.js";import{t as l}from"./button-Cym3gapE.js";import{i as u,n as d,t as f}from"./tooltip-DttaCTqz.js";import{a as p,c as m,i as h,l as g,o as _,r as v,s as y}from"./alert-dialog-Btd1iU_X.js";import"./RegisteredAgentIcon-DU5Zkepy.js";import{$t as b,Sc as x,Xs as S,Zt as C,si as w}from"./dist-CGNkoXKB.js";import{n as T}from"./dist-CJhtNlOm2.js";import{c as E}from"./documents-events-kUbk4KBT.js";import{a as D,c as O,d as k,f as A,l as j,p as M,r as N,s as P,u as F}from"./terminal-cli-display-BrLCqbMd.js";import{t as I}from"./createLucideIcon-B6ULg5PN.js";import{a as L,d as R,f as z,i as B,n as V,o as H,p as U,u as ee}from"./dropdown-menu--ZF4igWe.js";import{c as W}from"./use-open-skill-DhmFoS02.js";import{t as te}from"./spinner-Bp2_BYkl.js";import{i as ne,l as re,n as ie,r as G}from"./skill-scope-B1qEIboE.js";import{N as K,S as ae,j as q,x as oe}from"./skills-api-NyR-fZMK.js";import{t as J}from"./use-skills-CI07Z3HF.js";var Y=t(),X=e(r(),1),Z=o(),se=3100,ce=3;function le(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??ce;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var ue={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}},de=[`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 fe(e,t={}){let n=t.rng??Math.random,r=t.colors??de,i=ue[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 pe=1.8,me=90,he=16,ge=380,_e=.025,ve=.1,ye=.18,be=400,xe=9.2736,Se=18.1799,Ce=14.5244,we={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function Te(e,t){let{halfWidth:n,apexLift:r}=we[t];return`M${e-n} ${Ce+.3} Q${e} ${Ce-r}, ${e+n} ${Ce+.3}`}function Ee(e){let t=1.5,n=.3;return`M${e-t} ${Ce-n} Q${e} ${Ce+1.4}, ${e+t} ${Ce-n}`}var De=15,Oe=15;function ke(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 Ae(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=le(b,t),r=b===3&&e-k.current<3100,i=n===3&&r;n===3&&u?.(),x(n),C(Ie),i||(O(fe(n)),n===3&&(k.current=e,T(Fe))),clearTimeout(j.current),j.current=setTimeout(()=>{x(0),O([])},se)},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(Pe),O(fe(3)),k.current=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),T(Ne),clearTimeout(j.current),j.current=setTimeout(()=>{x(0),O([])},se))},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/ge)),C=-Math.max(-1,Math.min(1,b/ge))*he,w=S*he,T=0,E=0;if(x>=1){let e=Math.min(x/me,1)*pe;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)*ve,i+=(w-i)*ve,u.style.transform=`perspective(${be}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(T-a)*ye,o+=(E-o)*ye;let O=i*_e,k=-r*_e,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 V;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>{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]=V):V=t[16],(0,X.useLayoutEffect)(V);let H=b>0,U=H?b:1,ee=H?`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 te=M?`cursor-default`:`cursor-pointer`,ne=`body-${S}`,re=M&&`ok-blob-sleeping`,ie;t[19]!==ee||t[20]!==re?(ie=s(`ok-blob-group`,re,ee),t[19]=ee,t[20]=re,t[21]=ie):ie=t[21];let G;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Y.jsx)(`path`,{d:c,className:`ok-blob-body`}),t[22]=G):G=t[22];let K=(H||M)&&`ok-blob-eye-hidden`,ae;t[23]===K?ae=t[24]:(ae=s(`ok-blob-eye`,K),t[23]=K,t[24]=ae);let q;t[25]===ae?q=t[26]:(q=(0,Y.jsx)(`ellipse`,{cx:xe,cy:Ce,rx:1.2722,ry:1.9083,className:ae}),t[25]=ae,t[26]=q);let oe=(H||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 ce;t[29]===J?ce=t[30]:(ce=(0,Y.jsx)(`ellipse`,{cx:Se,cy:Ce,rx:1.2722,ry:1.9083,className:J}),t[29]=J,t[30]=ce);let ue;t[31]===U?ue=t[32]:(ue=Te(xe,U),t[31]=U,t[32]=ue);let de=(!H||M)&&`ok-blob-eye-hidden`,we;t[33]===de?we=t[34]:(we=s(`ok-blob-happy-eye`,de),t[33]=de,t[34]=we);let De;t[35]!==ue||t[36]!==we?(De=(0,Y.jsx)(`path`,{d:ue,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:we}),t[35]=ue,t[36]=we,t[37]=De):De=t[37];let Oe;t[38]===U?Oe=t[39]:(Oe=Te(Se,U),t[38]=U,t[39]=Oe);let ke=(!H||M)&&`ok-blob-eye-hidden`,Ae;t[40]===ke?Ae=t[41]:(Ae=s(`ok-blob-happy-eye`,ke),t[40]=ke,t[41]=Ae);let Le;t[42]!==Oe||t[43]!==Ae?(Le=(0,Y.jsx)(`path`,{d:Oe,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:Ae}),t[42]=Oe,t[43]=Ae,t[44]=Le):Le=t[44];let Re;t[45]===M?Re=t[46]:(Re=M?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{d:Ee(xe),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,Y.jsx)(`path`,{d:Ee(Se),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[45]=M,t[46]=Re);let ze;t[47]!==q||t[48]!==ce||t[49]!==De||t[50]!==Le||t[51]!==Re?(ze=(0,Y.jsxs)(`g`,{ref:_,children:[q,ce,De,Le,Re]}),t[47]=q,t[48]=ce,t[49]=De,t[50]=Le,t[51]=Re,t[52]=ze):ze=t[52];let Q;t[53]!==ne||t[54]!==ie||t[55]!==ze?(Q=(0,Y.jsxs)(`g`,{className:ie,children:[G,ze]},ne),t[53]=ne,t[54]=ie,t[55]=ze,t[56]=Q):Q=t[56];let Be;t[57]===M?Be=t[58]:(Be=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]=Be);let Ve;t[59]!==w||t[60]!==D?(Ve=D.length>0&&(0,Y.jsx)(`g`,{"data-slot":`ok-blob-burst`,children:D.map(je)},`firework-${w}`),t[59]=w,t[60]=D,t[61]=Ve):Ve=t[61];let He;t[62]!==P||t[63]!==d||t[64]!==te||t[65]!==Q||t[66]!==Be||t[67]!==Ve?(He=(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:te,"aria-hidden":`true`,onClick:P,onMouseDown:Me,children:[Q,Be,Ve]}),t[62]=P,t[63]=d,t[64]=te,t[65]=Q,t[66]=Be,t[67]=Ve,t[68]=He):He=t[68];let Ue;return t[69]!==i||t[70]!==W||t[71]!==He?(Ue=(0,Y.jsx)(`span`,{ref:h,className:W,style:i,children:He}),t[69]=i,t[70]=W,t[71]=He,t[72]=Ue):Ue=t[72],Ue}function je(e){return(0,Y.jsx)(`circle`,{cx:De+e.originDx,cy:Oe+e.originDy,r:e.size,className:`ok-blob-firework`,style:ke(e)},e.id)}function Me(e){return e.preventDefault()}function Ne(e){return e+1}function Pe(e){return e+1}function Fe(e){return e+1}function Ie(e){return e+1}var Le=I(`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`}]]),Re=I(`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`}]]),ze=I(`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`}]]),Q=[...new Set(S.flatMap(e=>e.schemes))];function Be(e,t){let n=t.now?.()??Date.now(),r={};for(let t of S){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 Ve(e){return Be({},e)}async function He(e){let t=e.schemes??Q,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 Ue=Object.fromEntries(Q.map(e=>[e,{installed:!1}]));async function We(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 Ue}if(!t.ok)return Ue;let n;try{n=await t.json()}catch{return Ue}if(typeof n!=`object`||!n||Array.isArray(n))return Ue;let r=n,i={};for(let e of Q)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function Ge(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 Ke(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Ve({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=Be(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=!Ge(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 qe(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Je(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>He({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>We({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Ye(){let e=(0,Z.c)(5),[t,n]=(0,X.useState)(Xe),r=(0,X.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Ke(Je());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 Xe(){return Ve({isElectronHost:qe(),now:Date.now})}var Ze=(0,X.createContext)(null);function Qe(e){let t=(0,Z.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,Y.jsx)(Ze,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function $e(){return(0,X.use)(Ze)}function et(e){let t=(0,Z.c)(48),{itemName:n,isSubmitting:r,onDelete:o,customTitle:s,customDescription:c,customDetail:u,customConfirmLabel:d,customConfirmLabelBusy:f,children:b}=e,{_:x}=a(),S;t[0]!==x||t[1]!==n?(S=n??x({id:`L3CEC1`}),t[0]=x,t[1]=n,t[2]=S):S=t[2];let C=S,w;t[3]!==x||t[4]!==d?(w=d??x({id:`cnGeoo`}),t[3]=x,t[4]=d,t[5]=w):w=t[5];let T=w,E;t[6]!==x||t[7]!==d||t[8]!==f?(E=f??d??x({id:`s3caR3`}),t[6]=x,t[7]=d,t[8]=f,t[9]=E):E=t[9];let D=E,O;t[10]!==x||t[11]!==s||t[12]!==C?(O=s??x({id:`77SdEP`,values:{itemName:C}}),t[10]=x,t[11]=s,t[12]=C,t[13]=O):O=t[13];let k;t[14]===O?k=t[15]:(k=(0,Y.jsx)(g,{children:O}),t[14]=O,t[15]=k);let A;t[16]!==x||t[17]!==c||t[18]!==C?(A=c??x({id:`16D5Zj`,values:{itemName:C}}),t[16]=x,t[17]=c,t[18]=C,t[19]=A):A=t[19];let j;t[20]===A?j=t[21]:(j=(0,Y.jsx)(_,{className:`whitespace-pre-wrap`,children:A}),t[20]=A,t[21]=j);let M;t[22]===u?M=t[23]:(M=u?(0,Y.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`delete-confirmation-detail`,children:u}):null,t[22]=u,t[23]=M);let N;t[24]!==k||t[25]!==j||t[26]!==M?(N=(0,Y.jsxs)(m,{children:[k,j,M]}),t[24]=k,t[25]=j,t[26]=M,t[27]=N):N=t[27];let P;t[28]===b?P=t[29]:(P=b?(0,Y.jsx)(v,{children:b}):null,t[28]=b,t[29]=P);let F;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Y.jsx)(i,{id:`dEgA5A`}),t[30]=F):F=t[30];let I;t[31]===r?I=t[32]:(I=(0,Y.jsx)(h,{disabled:r,children:F}),t[31]=r,t[32]=I);let L;t[33]!==T||t[34]!==D||t[35]!==r?(L=r?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(te,{"aria-hidden":`true`,className:`size-4`}),` `,D]}):T,t[33]=T,t[34]=D,t[35]=r,t[36]=L):L=t[36];let R;t[37]!==r||t[38]!==o||t[39]!==L?(R=(0,Y.jsx)(l,{variant:`destructive`,onClick:o,disabled:r,children:L}),t[37]=r,t[38]=o,t[39]=L,t[40]=R):R=t[40];let z;t[41]!==I||t[42]!==R?(z=(0,Y.jsxs)(y,{children:[I,R]}),t[41]=I,t[42]=R,t[43]=z):z=t[43];let B;return t[44]!==P||t[45]!==z||t[46]!==N?(B=(0,Y.jsxs)(p,{children:[N,P,z]}),t[44]=P,t[45]=z,t[46]=N,t[47]=B):B=t[47],B}function tt(e){let t=(0,Z.c)(5),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[{x:1.9,y:0,w:15.15},{x:8,y:4.22,w:15.15},{x:4.35,y:8.44,w:15.3},{x:0,y:12.66,w:15.15},{x:4.35,y:16.88,w:15.3},{x:14.1,y:21.1,w:9.9}],t[0]=n):n=t[0];let r=n,i,a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Y.jsx)(`title`,{children:`LM Studio icon`}),a=r.map(nt),t[1]=i,t[2]=a):(i=t[1],a=t[2]);let o;return t[3]===e?o=t[4]:(o=(0,Y.jsxs)(`svg`,{role:`img`,"aria-label":`LM Studio icon`,xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,fill:`currentColor`,viewBox:`0 0 24 24`,...e,children:[i,a]}),t[3]=e,t[4]=o),o}function nt(e){return(0,Y.jsx)(`rect`,{x:e.x,y:e.y,width:e.w,height:2.9,rx:1.45},e.y)}function rt(e){return e===`agents`||e===`.agents`||e.startsWith(`.agents/`)?`.agents`:e.includes(`/`)?e:x[e]??e}function it(e){return e===`claude`?`claude-code`:e}function at(e){let t=(0,Z.c)(20),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===`lm-studio`){let e;return t[5]===i?e=t[6]:(e=(0,Y.jsx)(tt,{...i}),t[5]=i,t[6]=e),e}if(r.includes(`/`)){if(r===`.agents`||r.startsWith(`.agents/`)){let e;return t[7]===i?e=t[8]:(e=(0,Y.jsx)(n,{...i}),t[7]=i,t[8]=e),e}if(r===`.ok`||r.startsWith(`.ok/`)){let e;if(t[9]!==i){let{className:n,...r}=i;e=r,t[9]=i,t[10]=e}else e=t[10];let n=e,r;return t[11]===n?r=t[12]:(r=(0,Y.jsx)(Ae,{size:14,...n}),t[11]=n,t[12]=r),r}let e;return t[13]===i?e=t[14]:(e=(0,Y.jsx)(W,{...i}),t[13]=i,t[14]=e),e}let a;t[15]===r?a=t[16]:(a=it(r),t[15]=r,t[16]=a);let o;return t[17]!==i||t[18]!==a?(o=(0,Y.jsx)(N,{...i,id:a}),t[17]=i,t[18]=a,t[19]=o):o=t[19],o}function ot(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 p;t[8]===i?p=t[9]:(p=e=>(0,Y.jsxs)(f,{children:[(0,Y.jsx)(u,{asChild:!0,children:(0,Y.jsx)(`span`,{className:`flex shrink-0 items-center`,children:(0,Y.jsx)(at,{host:e,className:s(`size-3.5 shrink-0`,i),"aria-label":rt(e)})})}),(0,Y.jsx)(d,{children:rt(e)})]},e),t[8]=i,t[9]=p),o=e.map(p),c=l.length>0?(0,Y.jsxs)(f,{children:[(0,Y.jsx)(u,{asChild:!0,children:(0,Y.jsxs)(`span`,{className:`ml-0.5 cursor-default`,children:[`+`,l.length]})}),(0,Y.jsx)(d,{children:l.map(rt).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 st(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 ct(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)(P,{...r}):(0,Y.jsx)(B,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function lt(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)(L,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ut(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)(V,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function dt(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}function ft(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)(ee,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function pt(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 mt(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)(z,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ht(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)(U,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var gt=Object.freeze({hosts:null,source:null}),_t=new Map,vt=new Map;function yt(e,t){return`${e}:${t}`}function bt(e){return _t.get(e)??gt}function xt(e,t){let n=vt.get(e)??new Set;return vt.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&vt.delete(e)}}function St(e,t){let n=bt(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?_t.delete(e):_t.set(e,r);for(let t of vt.get(e)??[])t()}}var Ct=C.options,wt=b.options,Tt=`.agents/`;function Et({skill:e,allSkills:t,hostSet:n,sourceHostOverlay:r,linkMode:i}){let a=t=>e?`${re(t,e.scope)}/${e.name}`:null,o=e?.hubOffered??(e&&t!==null?t.find(t=>t.scope===e.scope)?.hubOffered:void 0),s=e!==void 0&&(o===!0||(e.hosts??[]).includes(`agents`)||t?.some(t=>t.scope===e.scope&&(t.hosts.includes(`agents`)||t.path.startsWith(Tt)))),c=e?.hostAliases??(e&&t!==null?Object.assign({},...t.filter(t=>t.scope===e.scope).map(e=>e.hostAliases??{})):{}),l=e?.installableEditors??(e&&t!==null?t.find(t=>t.scope===e.scope)?.installableEditors:void 0),u=l?new Set(l):null,d=e?.scope===`global`?wt:Ct,f=(s?[...d,`agents`]:d).filter(e=>!(e in c)).filter(e=>e===`agents`||u===null||u.has(e)||n.has(e)),p=new Set(f.map(e=>a(e))),m=e?.scope===`global`?`~/`:``,h=e?.path?.includes(`/`)?`${m}${e.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,g=h!==null&&!p.has(h)?h:null,_=g===null?r??e?.hosts?.[0]:void 0,v=new Set(e?.conflictHosts??[]),y=new Set(e?.driftPaths??[]),b=new Set(e?.symlinkedHosts??[]),x=[...[...n].filter(e=>e!==_&&!(e in c)&&!v.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:a(e)??e,mode:b.has(e)?`link`:`copy`})),...(e?.customPlacements??[]).map(e=>({target:G(e),display:`${m}${e.path}`,mode:e.mode}))],S=x.map(e=>e.mode),C=S.filter(e=>e===`link`).length,w=S.length===0?i?`link`:`copy`:C*2>=S.length?`link`:`copy`,T=new Map((e?.customPlacements??[]).map(e=>[G(e),e])),E=new Set(T.keys());if(t!==null&&e){for(let n of t)if(n.scope===e.scope)for(let e of n.customPlacements??[]){let t=G(e);t!==``&&E.add(t)}}return{pathFor:a,aliases:c,rows:f,sourceRow:g,sourceHost:_,conflicted:v,drifted:y,linked:b,expectedMode:w,convertible:x,customRootRows:e===void 0?[]:[...E].sort().map(t=>({root:t,display:`${m}${t}/${e.name}`,placed:T.get(t)??null})).filter(e=>!p.has(e.display)&&e.display!==h&&!(e.root in c))}}var Dt=`min-w-[24rem]`;function Ot(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=yt(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=>xt(m,e),g=()=>bt(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&&St(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,E;n[17]===C?E=n[18]:(E=new Set(C),n[17]=C,n[18]=E);let D=E,O=v?v.length>0:e.installed,k=(0,X.useRef)(e.hosts),A,j;n[19]!==v||n[20]!==e.hosts?(A=()=>{v===null&&(k.current=e.hosts)},j=[v,e.hosts],n[19]=v,n[20]=e.hosts,n[21]=A,n[22]=j):(A=n[21],j=n[22]),(0,X.useEffect)(A,j);let M;n[23]===e.hosts?M=n[24]:(M=[...e.hosts].sort().join(`,`),n[23]=e.hosts,n[24]=M);let N=M,P,F;n[25]!==m||n[26]!==N?(P=()=>{let e=bt(m).hosts;e&&[...e].sort().join(`,`)===N&&St(m,{hosts:null})},F=[N,m],n[25]=m,n[26]=N,n[27]=P,n[28]=F):(P=n[27],F=n[28]),(0,X.useEffect)(P,F);let I=(0,X.useRef)(null),L=(0,X.useRef)(null),R,z;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>()=>{I.current&&clearTimeout(I.current),L.current?.(),L.current=null},z=[],n[29]=R,n[30]=z):(R=n[29],z=n[30]),(0,X.useEffect)(R,z);let B;n[31]!==t||n[32]!==m||n[33]!==e?(B=function(n,r){k.current=n,St(m,{hosts:n}),I.current&&clearTimeout(I.current);let i=async()=>{L.current=null,I.current=null;let r=await t.install(e,n.filter(w));if(!r.ok){St(m,{hosts:null});return}k.current=[...r.hosts],St(m,{hosts:[...r.hosts]})};r?(L.current=()=>void i(),I.current=setTimeout(()=>void i(),350)):(L.current=null,i())},n[31]=t,n[32]=m,n[33]=e,n[34]=B):B=n[34];let V=B,H;return n[35]!==t||n[36]!==V||n[37]!==D||n[38]!==O||n[39]!==f||n[40]!==y||n[41]!==m||n[42]!==S||n[43]!==e?(H={hostSet:D,installed:O,installing:f,toggleEditor(e,t){let n=new Set(k.current);t?n.add(e):n.delete(e),V([...n],!0)},installAll(){let t=e.scope===`global`?wt:Ct,n=k.current.filter(e=>!t.includes(e)),r=e.installableEditors??t,i=t.filter(e=>r.includes(e)||k.current.includes(e));V([...n,...i],!1)},linkMode:S,sourceHost:y??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>oe({scope:e.scope,name:e.name,dir:n,mode:r})).then(At)},unplaceAt(n){t.runLocationWrite(e,()=>K({scope:e.scope,name:e.name,path:n})).then(kt)},setSource(n){St(m,{source:n}),t.runLocationWrite(e,()=>q({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(St(m,{source:null}),T.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=V,n[37]=D,n[38]=O,n[39]=f,n[40]=y,n[41]=m,n[42]=S,n[43]=e,n[44]=H):H=n[44],H}function kt(e){e.ok||T.error(e.error)}function At(e){e.ok||T.error(e.error)}function $(e){let t=(0,Z.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,Y.jsx)(u,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,Y.jsx)(d,{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)(f,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function jt(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=J(),g,_,v,y,b,S,C,w,D,O;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:k,sourceHost:A,conflicted:j,drifted:M,linked:N,expectedMode:P,convertible:F,customRootRows:I}=Et({skill:r,allSkills:h.status===`ready`?h.data:null,hostSet:f,sourceHostOverlay:n.sourceHost,linkMode:n.linkMode});b=c,S=k,y=P,_=F,v=I;let L=e=>ie(a,e),R=Rt,z=e=>{let t=L(e);return t.length===0?!0:window.confirm(d({id:`Uobeu9`,values:{0:t.map(R).join(`, `),rootRel:e}}))},B;t[21]!==d||t[22]!==r?(B=(e,t)=>{let n=e.includes(`/`)?e:re(e,r?.scope??`project`);return(0,Y.jsx)($,{hint:d({id:`0dslv8`,values:{0:R(e),1:R(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:R(e)}}),onClick:i=>{i.preventDefault(),i.stopPropagation(),window.confirm(d({id:`iiqOKM`,values:{0:R(e),1:r.name,2:R(e),subRoot:n,poolRootRel:t}}))&&ae({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?E():T.error(d({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,Y.jsx)(at,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[21]=d,t[22]=r,t[23]=B):B=t[23];let V=B;g=n.installing;let H=ne(r),U=Lt,ee;t[24]!==d||t[25]!==s||t[26]!==n?(ee=(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]=ee):ee=t[27];let te=ee,G;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Y.jsx)(i,{id:`npcziF`}),t[28]=G):G=t[28];let K;t[29]===d?K=t[30]:(K=d({id:`6f_UX4`}),t[29]=d,t[30]=K);let q;t[31]===m?q=t[32]:(q=()=>m(),t[31]=m,t[32]=q);let oe;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,Y.jsx)(i,{id:`N40H-G`}),t[33]=oe):oe=t[33];let J;t[34]!==g||t[35]!==q?(J=(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:q,"data-testid":`skill-install-all`,children:oe}),t[34]=g,t[35]=q,t[36]=J):J=t[36];let X;t[37]!==K||t[38]!==J?(X=(0,Y.jsx)($,{hint:K,children:J}),t[37]=K,t[38]=J,t[39]=X):X=t[39],t[40]!==u||t[41]!==X?(C=(0,Y.jsxs)(dt,{menuKind:u,className:`flex items-center justify-between gap-2`,children:[G,X]}),t[40]=u,t[41]=X,t[42]=C):C=t[42],w=S===null?null:(0,Y.jsx)($,{hint:d({id:`pXB6SL`}),children:(0,Y.jsxs)(ut,{menuKind:u,disabled:g,checked:!0,onSelect:It,"data-testid":`skill-source-row`,children:[(0,Y.jsx)(W,{"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:S}),(()=>{let e=U(S).split(`/`).slice(0,-1).join(`/`),t=L(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=>V(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`})})]})]})}),D=b.map(t=>{let a=e(t),s=t===`agents`?`.agents`:x[t],c=U(a).split(`/`).slice(0,-1).join(`/`),m=L(c);return(0,Y.jsx)($,{hint:j.has(t)?d({id:`8HvJlU`,values:{0:a??s}}):t===A?a?d({id:`ssk6rl`,values:{path:a}}):s:f.has(t)?d(a?{id:`9ieZhu`,values:{path:a}}:{id:`n3T3EE`,values:{label:s}}):H?.editor===t?d({id:`_3S4Ql`,values:{0:r?.name??``,1:H.plugin,2:a??s,label:s}}):d(a?A===void 0?{id:`xk133d`,values:{path:a}}:y===`link`?{id:`1LtA5r`,values:{path:a}}:{id:`opPbzN`,values:{path:a}}:{id:`Pp0Vgd`,values:{label:s}}),children:(0,Y.jsxs)(ut,{menuKind:u,disabled:g,checked:f.has(t),onCheckedChange:e=>{j.has(t)||e===!0&&!z(c)||p(t,e===!0)},onSelect:Ft,className:`group`,"data-testid":`skill-install-editor-${t}`,children:[(0,Y.jsx)(at,{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=>V(e,c))}):null,H?.editor===t&&!f.has(t)?(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`,"data-testid":`skill-row-plugin-covered-${t}`,children:(0,Y.jsx)(i,{id:`scRzTw`})}):null,j.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===A?(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&&(N.has(t)?`link`:`copy`)!==y?te(t,a??s,N.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&&M.has(U(a))?(0,Y.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,Y.jsx)(st,{testId:`skill-drift-${t}`})}):null]})]})},t)}),O=v.map(e=>{let t=e.display;return(0,Y.jsx)($,{hint:e.placed===null?d(A===void 0?{id:`xk133d`,values:{path:t}}:y===`link`?{id:`1LtA5r`,values:{path:t}}:{id:`opPbzN`,values:{path:t}}):d({id:`9ieZhu`,values:{path:t}}),children:(0,Y.jsxs)(ut,{menuKind:u,disabled:g,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!z(e.root))return;n.placeAt(e.root,y)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:Pt,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,Y.jsx)(at,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,Y.jsx)(W,{"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}),L(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:L(e.root).map(t=>V(t,e.root))}):null,!g&&e.placed!==null&&M.has(e.placed.path)?(0,Y.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,Y.jsx)(st,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,Y.jsxs)(Y.Fragment,{children:[!g&&e.placed.mode!==y?te(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]=S,t[17]=C,t[18]=w,t[19]=D,t[20]=O}else g=t[11],_=t[12],v=t[13],y=t[14],b=t[15],S=t[16],C=t[17],w=t[18],D=t[19],O=t[20];let k;t[43]!==v||t[44]!==b.length||t[45]!==S?(k=b.length===0&&v.length===0&&S===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]=S,t[46]=k):k=t[46];let A;t[47]!==d||t[48]!==g||t[49]!==_||t[50]!==y||t[51]!==s||t[52]!==n?(A=_.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(Nt).join(`
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{nr as n}from"./DocumentContext-DS_dUWBr.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{r as c}from"./clipboard-adapter-815RzzoI.js";import{t as l}from"./button-Cym3gapE.js";import{i as u,n as d,t as f}from"./tooltip-DttaCTqz.js";import{a as p,c as m,i as h,l as g,o as _,r as v,s as y}from"./alert-dialog-Btd1iU_X.js";import"./RegisteredAgentIcon-DU5Zkepy.js";import{$t as b,Sc as x,Xs as S,Zt as C,si as w}from"./dist-CGNkoXKB.js";import{n as T}from"./dist-CJhtNlOm2.js";import{c as E}from"./documents-events-kUbk4KBT.js";import{a as D,c as O,d as k,f as A,l as j,p as M,r as N,s as P,u as F}from"./terminal-cli-display-BrLCqbMd.js";import{t as I}from"./createLucideIcon-B6ULg5PN.js";import{a as L,d as R,f as z,i as B,n as V,o as H,p as U,u as ee}from"./dropdown-menu--ZF4igWe.js";import{c as W}from"./use-open-skill-CCmJFvMI.js";import{t as te}from"./spinner-Bp2_BYkl.js";import{i as ne,l as re,n as ie,r as G}from"./skill-scope-B1qEIboE.js";import{N as K,S as ae,j as q,x as oe}from"./skills-api-NyR-fZMK.js";import{t as J}from"./use-skills-CI07Z3HF.js";var Y=t(),X=e(r(),1),Z=o(),se=3100,ce=3;function le(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??ce;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var ue={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}},de=[`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 fe(e,t={}){let n=t.rng??Math.random,r=t.colors??de,i=ue[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 pe=1.8,me=90,he=16,ge=380,_e=.025,ve=.1,ye=.18,be=400,xe=9.2736,Se=18.1799,Ce=14.5244,we={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function Te(e,t){let{halfWidth:n,apexLift:r}=we[t];return`M${e-n} ${Ce+.3} Q${e} ${Ce-r}, ${e+n} ${Ce+.3}`}function Ee(e){let t=1.5,n=.3;return`M${e-t} ${Ce-n} Q${e} ${Ce+1.4}, ${e+t} ${Ce-n}`}var De=15,Oe=15;function ke(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 Ae(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=le(b,t),r=b===3&&e-k.current<3100,i=n===3&&r;n===3&&u?.(),x(n),C(Ie),i||(O(fe(n)),n===3&&(k.current=e,T(Fe))),clearTimeout(j.current),j.current=setTimeout(()=>{x(0),O([])},se)},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(Pe),O(fe(3)),k.current=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),T(Ne),clearTimeout(j.current),j.current=setTimeout(()=>{x(0),O([])},se))},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/ge)),C=-Math.max(-1,Math.min(1,b/ge))*he,w=S*he,T=0,E=0;if(x>=1){let e=Math.min(x/me,1)*pe;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)*ve,i+=(w-i)*ve,u.style.transform=`perspective(${be}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(T-a)*ye,o+=(E-o)*ye;let O=i*_e,k=-r*_e,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 V;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>{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]=V):V=t[16],(0,X.useLayoutEffect)(V);let H=b>0,U=H?b:1,ee=H?`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 te=M?`cursor-default`:`cursor-pointer`,ne=`body-${S}`,re=M&&`ok-blob-sleeping`,ie;t[19]!==ee||t[20]!==re?(ie=s(`ok-blob-group`,re,ee),t[19]=ee,t[20]=re,t[21]=ie):ie=t[21];let G;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Y.jsx)(`path`,{d:c,className:`ok-blob-body`}),t[22]=G):G=t[22];let K=(H||M)&&`ok-blob-eye-hidden`,ae;t[23]===K?ae=t[24]:(ae=s(`ok-blob-eye`,K),t[23]=K,t[24]=ae);let q;t[25]===ae?q=t[26]:(q=(0,Y.jsx)(`ellipse`,{cx:xe,cy:Ce,rx:1.2722,ry:1.9083,className:ae}),t[25]=ae,t[26]=q);let oe=(H||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 ce;t[29]===J?ce=t[30]:(ce=(0,Y.jsx)(`ellipse`,{cx:Se,cy:Ce,rx:1.2722,ry:1.9083,className:J}),t[29]=J,t[30]=ce);let ue;t[31]===U?ue=t[32]:(ue=Te(xe,U),t[31]=U,t[32]=ue);let de=(!H||M)&&`ok-blob-eye-hidden`,we;t[33]===de?we=t[34]:(we=s(`ok-blob-happy-eye`,de),t[33]=de,t[34]=we);let De;t[35]!==ue||t[36]!==we?(De=(0,Y.jsx)(`path`,{d:ue,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:we}),t[35]=ue,t[36]=we,t[37]=De):De=t[37];let Oe;t[38]===U?Oe=t[39]:(Oe=Te(Se,U),t[38]=U,t[39]=Oe);let ke=(!H||M)&&`ok-blob-eye-hidden`,Ae;t[40]===ke?Ae=t[41]:(Ae=s(`ok-blob-happy-eye`,ke),t[40]=ke,t[41]=Ae);let Le;t[42]!==Oe||t[43]!==Ae?(Le=(0,Y.jsx)(`path`,{d:Oe,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:Ae}),t[42]=Oe,t[43]=Ae,t[44]=Le):Le=t[44];let Re;t[45]===M?Re=t[46]:(Re=M?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{d:Ee(xe),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,Y.jsx)(`path`,{d:Ee(Se),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[45]=M,t[46]=Re);let ze;t[47]!==q||t[48]!==ce||t[49]!==De||t[50]!==Le||t[51]!==Re?(ze=(0,Y.jsxs)(`g`,{ref:_,children:[q,ce,De,Le,Re]}),t[47]=q,t[48]=ce,t[49]=De,t[50]=Le,t[51]=Re,t[52]=ze):ze=t[52];let Q;t[53]!==ne||t[54]!==ie||t[55]!==ze?(Q=(0,Y.jsxs)(`g`,{className:ie,children:[G,ze]},ne),t[53]=ne,t[54]=ie,t[55]=ze,t[56]=Q):Q=t[56];let Be;t[57]===M?Be=t[58]:(Be=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]=Be);let Ve;t[59]!==w||t[60]!==D?(Ve=D.length>0&&(0,Y.jsx)(`g`,{"data-slot":`ok-blob-burst`,children:D.map(je)},`firework-${w}`),t[59]=w,t[60]=D,t[61]=Ve):Ve=t[61];let He;t[62]!==P||t[63]!==d||t[64]!==te||t[65]!==Q||t[66]!==Be||t[67]!==Ve?(He=(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:te,"aria-hidden":`true`,onClick:P,onMouseDown:Me,children:[Q,Be,Ve]}),t[62]=P,t[63]=d,t[64]=te,t[65]=Q,t[66]=Be,t[67]=Ve,t[68]=He):He=t[68];let Ue;return t[69]!==i||t[70]!==W||t[71]!==He?(Ue=(0,Y.jsx)(`span`,{ref:h,className:W,style:i,children:He}),t[69]=i,t[70]=W,t[71]=He,t[72]=Ue):Ue=t[72],Ue}function je(e){return(0,Y.jsx)(`circle`,{cx:De+e.originDx,cy:Oe+e.originDy,r:e.size,className:`ok-blob-firework`,style:ke(e)},e.id)}function Me(e){return e.preventDefault()}function Ne(e){return e+1}function Pe(e){return e+1}function Fe(e){return e+1}function Ie(e){return e+1}var Le=I(`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`}]]),Re=I(`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`}]]),ze=I(`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`}]]),Q=[...new Set(S.flatMap(e=>e.schemes))];function Be(e,t){let n=t.now?.()??Date.now(),r={};for(let t of S){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 Ve(e){return Be({},e)}async function He(e){let t=e.schemes??Q,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 Ue=Object.fromEntries(Q.map(e=>[e,{installed:!1}]));async function We(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 Ue}if(!t.ok)return Ue;let n;try{n=await t.json()}catch{return Ue}if(typeof n!=`object`||!n||Array.isArray(n))return Ue;let r=n,i={};for(let e of Q)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function Ge(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 Ke(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Ve({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=Be(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=!Ge(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 qe(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Je(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>He({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>We({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Ye(){let e=(0,Z.c)(5),[t,n]=(0,X.useState)(Xe),r=(0,X.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Ke(Je());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 Xe(){return Ve({isElectronHost:qe(),now:Date.now})}var Ze=(0,X.createContext)(null);function Qe(e){let t=(0,Z.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,Y.jsx)(Ze,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function $e(){return(0,X.use)(Ze)}function et(e){let t=(0,Z.c)(48),{itemName:n,isSubmitting:r,onDelete:o,customTitle:s,customDescription:c,customDetail:u,customConfirmLabel:d,customConfirmLabelBusy:f,children:b}=e,{_:x}=a(),S;t[0]!==x||t[1]!==n?(S=n??x({id:`L3CEC1`}),t[0]=x,t[1]=n,t[2]=S):S=t[2];let C=S,w;t[3]!==x||t[4]!==d?(w=d??x({id:`cnGeoo`}),t[3]=x,t[4]=d,t[5]=w):w=t[5];let T=w,E;t[6]!==x||t[7]!==d||t[8]!==f?(E=f??d??x({id:`s3caR3`}),t[6]=x,t[7]=d,t[8]=f,t[9]=E):E=t[9];let D=E,O;t[10]!==x||t[11]!==s||t[12]!==C?(O=s??x({id:`77SdEP`,values:{itemName:C}}),t[10]=x,t[11]=s,t[12]=C,t[13]=O):O=t[13];let k;t[14]===O?k=t[15]:(k=(0,Y.jsx)(g,{children:O}),t[14]=O,t[15]=k);let A;t[16]!==x||t[17]!==c||t[18]!==C?(A=c??x({id:`16D5Zj`,values:{itemName:C}}),t[16]=x,t[17]=c,t[18]=C,t[19]=A):A=t[19];let j;t[20]===A?j=t[21]:(j=(0,Y.jsx)(_,{className:`whitespace-pre-wrap`,children:A}),t[20]=A,t[21]=j);let M;t[22]===u?M=t[23]:(M=u?(0,Y.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`delete-confirmation-detail`,children:u}):null,t[22]=u,t[23]=M);let N;t[24]!==k||t[25]!==j||t[26]!==M?(N=(0,Y.jsxs)(m,{children:[k,j,M]}),t[24]=k,t[25]=j,t[26]=M,t[27]=N):N=t[27];let P;t[28]===b?P=t[29]:(P=b?(0,Y.jsx)(v,{children:b}):null,t[28]=b,t[29]=P);let F;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Y.jsx)(i,{id:`dEgA5A`}),t[30]=F):F=t[30];let I;t[31]===r?I=t[32]:(I=(0,Y.jsx)(h,{disabled:r,children:F}),t[31]=r,t[32]=I);let L;t[33]!==T||t[34]!==D||t[35]!==r?(L=r?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(te,{"aria-hidden":`true`,className:`size-4`}),` `,D]}):T,t[33]=T,t[34]=D,t[35]=r,t[36]=L):L=t[36];let R;t[37]!==r||t[38]!==o||t[39]!==L?(R=(0,Y.jsx)(l,{variant:`destructive`,onClick:o,disabled:r,children:L}),t[37]=r,t[38]=o,t[39]=L,t[40]=R):R=t[40];let z;t[41]!==I||t[42]!==R?(z=(0,Y.jsxs)(y,{children:[I,R]}),t[41]=I,t[42]=R,t[43]=z):z=t[43];let B;return t[44]!==P||t[45]!==z||t[46]!==N?(B=(0,Y.jsxs)(p,{children:[N,P,z]}),t[44]=P,t[45]=z,t[46]=N,t[47]=B):B=t[47],B}function tt(e){let t=(0,Z.c)(5),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[{x:1.9,y:0,w:15.15},{x:8,y:4.22,w:15.15},{x:4.35,y:8.44,w:15.3},{x:0,y:12.66,w:15.15},{x:4.35,y:16.88,w:15.3},{x:14.1,y:21.1,w:9.9}],t[0]=n):n=t[0];let r=n,i,a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Y.jsx)(`title`,{children:`LM Studio icon`}),a=r.map(nt),t[1]=i,t[2]=a):(i=t[1],a=t[2]);let o;return t[3]===e?o=t[4]:(o=(0,Y.jsxs)(`svg`,{role:`img`,"aria-label":`LM Studio icon`,xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,fill:`currentColor`,viewBox:`0 0 24 24`,...e,children:[i,a]}),t[3]=e,t[4]=o),o}function nt(e){return(0,Y.jsx)(`rect`,{x:e.x,y:e.y,width:e.w,height:2.9,rx:1.45},e.y)}function rt(e){return e===`agents`||e===`.agents`||e.startsWith(`.agents/`)?`.agents`:e.includes(`/`)?e:x[e]??e}function it(e){return e===`claude`?`claude-code`:e}function at(e){let t=(0,Z.c)(20),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===`lm-studio`){let e;return t[5]===i?e=t[6]:(e=(0,Y.jsx)(tt,{...i}),t[5]=i,t[6]=e),e}if(r.includes(`/`)){if(r===`.agents`||r.startsWith(`.agents/`)){let e;return t[7]===i?e=t[8]:(e=(0,Y.jsx)(n,{...i}),t[7]=i,t[8]=e),e}if(r===`.ok`||r.startsWith(`.ok/`)){let e;if(t[9]!==i){let{className:n,...r}=i;e=r,t[9]=i,t[10]=e}else e=t[10];let n=e,r;return t[11]===n?r=t[12]:(r=(0,Y.jsx)(Ae,{size:14,...n}),t[11]=n,t[12]=r),r}let e;return t[13]===i?e=t[14]:(e=(0,Y.jsx)(W,{...i}),t[13]=i,t[14]=e),e}let a;t[15]===r?a=t[16]:(a=it(r),t[15]=r,t[16]=a);let o;return t[17]!==i||t[18]!==a?(o=(0,Y.jsx)(N,{...i,id:a}),t[17]=i,t[18]=a,t[19]=o):o=t[19],o}function ot(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 p;t[8]===i?p=t[9]:(p=e=>(0,Y.jsxs)(f,{children:[(0,Y.jsx)(u,{asChild:!0,children:(0,Y.jsx)(`span`,{className:`flex shrink-0 items-center`,children:(0,Y.jsx)(at,{host:e,className:s(`size-3.5 shrink-0`,i),"aria-label":rt(e)})})}),(0,Y.jsx)(d,{children:rt(e)})]},e),t[8]=i,t[9]=p),o=e.map(p),c=l.length>0?(0,Y.jsxs)(f,{children:[(0,Y.jsx)(u,{asChild:!0,children:(0,Y.jsxs)(`span`,{className:`ml-0.5 cursor-default`,children:[`+`,l.length]})}),(0,Y.jsx)(d,{children:l.map(rt).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 st(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 ct(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)(P,{...r}):(0,Y.jsx)(B,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function lt(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)(L,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ut(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)(V,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function dt(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}function ft(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)(ee,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function pt(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 mt(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)(z,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ht(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)(U,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var gt=Object.freeze({hosts:null,source:null}),_t=new Map,vt=new Map;function yt(e,t){return`${e}:${t}`}function bt(e){return _t.get(e)??gt}function xt(e,t){let n=vt.get(e)??new Set;return vt.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&vt.delete(e)}}function St(e,t){let n=bt(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?_t.delete(e):_t.set(e,r);for(let t of vt.get(e)??[])t()}}var Ct=C.options,wt=b.options,Tt=`.agents/`;function Et({skill:e,allSkills:t,hostSet:n,sourceHostOverlay:r,linkMode:i}){let a=t=>e?`${re(t,e.scope)}/${e.name}`:null,o=e?.hubOffered??(e&&t!==null?t.find(t=>t.scope===e.scope)?.hubOffered:void 0),s=e!==void 0&&(o===!0||(e.hosts??[]).includes(`agents`)||t?.some(t=>t.scope===e.scope&&(t.hosts.includes(`agents`)||t.path.startsWith(Tt)))),c=e?.hostAliases??(e&&t!==null?Object.assign({},...t.filter(t=>t.scope===e.scope).map(e=>e.hostAliases??{})):{}),l=e?.installableEditors??(e&&t!==null?t.find(t=>t.scope===e.scope)?.installableEditors:void 0),u=l?new Set(l):null,d=e?.scope===`global`?wt:Ct,f=(s?[...d,`agents`]:d).filter(e=>!(e in c)).filter(e=>e===`agents`||u===null||u.has(e)||n.has(e)),p=new Set(f.map(e=>a(e))),m=e?.scope===`global`?`~/`:``,h=e?.path?.includes(`/`)?`${m}${e.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,g=h!==null&&!p.has(h)?h:null,_=g===null?r??e?.hosts?.[0]:void 0,v=new Set(e?.conflictHosts??[]),y=new Set(e?.driftPaths??[]),b=new Set(e?.symlinkedHosts??[]),x=[...[...n].filter(e=>e!==_&&!(e in c)&&!v.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:a(e)??e,mode:b.has(e)?`link`:`copy`})),...(e?.customPlacements??[]).map(e=>({target:G(e),display:`${m}${e.path}`,mode:e.mode}))],S=x.map(e=>e.mode),C=S.filter(e=>e===`link`).length,w=S.length===0?i?`link`:`copy`:C*2>=S.length?`link`:`copy`,T=new Map((e?.customPlacements??[]).map(e=>[G(e),e])),E=new Set(T.keys());if(t!==null&&e){for(let n of t)if(n.scope===e.scope)for(let e of n.customPlacements??[]){let t=G(e);t!==``&&E.add(t)}}return{pathFor:a,aliases:c,rows:f,sourceRow:g,sourceHost:_,conflicted:v,drifted:y,linked:b,expectedMode:w,convertible:x,customRootRows:e===void 0?[]:[...E].sort().map(t=>({root:t,display:`${m}${t}/${e.name}`,placed:T.get(t)??null})).filter(e=>!p.has(e.display)&&e.display!==h&&!(e.root in c))}}var Dt=`min-w-[24rem]`;function Ot(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=yt(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=>xt(m,e),g=()=>bt(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&&St(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,E;n[17]===C?E=n[18]:(E=new Set(C),n[17]=C,n[18]=E);let D=E,O=v?v.length>0:e.installed,k=(0,X.useRef)(e.hosts),A,j;n[19]!==v||n[20]!==e.hosts?(A=()=>{v===null&&(k.current=e.hosts)},j=[v,e.hosts],n[19]=v,n[20]=e.hosts,n[21]=A,n[22]=j):(A=n[21],j=n[22]),(0,X.useEffect)(A,j);let M;n[23]===e.hosts?M=n[24]:(M=[...e.hosts].sort().join(`,`),n[23]=e.hosts,n[24]=M);let N=M,P,F;n[25]!==m||n[26]!==N?(P=()=>{let e=bt(m).hosts;e&&[...e].sort().join(`,`)===N&&St(m,{hosts:null})},F=[N,m],n[25]=m,n[26]=N,n[27]=P,n[28]=F):(P=n[27],F=n[28]),(0,X.useEffect)(P,F);let I=(0,X.useRef)(null),L=(0,X.useRef)(null),R,z;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>()=>{I.current&&clearTimeout(I.current),L.current?.(),L.current=null},z=[],n[29]=R,n[30]=z):(R=n[29],z=n[30]),(0,X.useEffect)(R,z);let B;n[31]!==t||n[32]!==m||n[33]!==e?(B=function(n,r){k.current=n,St(m,{hosts:n}),I.current&&clearTimeout(I.current);let i=async()=>{L.current=null,I.current=null;let r=await t.install(e,n.filter(w));if(!r.ok){St(m,{hosts:null});return}k.current=[...r.hosts],St(m,{hosts:[...r.hosts]})};r?(L.current=()=>void i(),I.current=setTimeout(()=>void i(),350)):(L.current=null,i())},n[31]=t,n[32]=m,n[33]=e,n[34]=B):B=n[34];let V=B,H;return n[35]!==t||n[36]!==V||n[37]!==D||n[38]!==O||n[39]!==f||n[40]!==y||n[41]!==m||n[42]!==S||n[43]!==e?(H={hostSet:D,installed:O,installing:f,toggleEditor(e,t){let n=new Set(k.current);t?n.add(e):n.delete(e),V([...n],!0)},installAll(){let t=e.scope===`global`?wt:Ct,n=k.current.filter(e=>!t.includes(e)),r=e.installableEditors??t,i=t.filter(e=>r.includes(e)||k.current.includes(e));V([...n,...i],!1)},linkMode:S,sourceHost:y??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>oe({scope:e.scope,name:e.name,dir:n,mode:r})).then(At)},unplaceAt(n){t.runLocationWrite(e,()=>K({scope:e.scope,name:e.name,path:n})).then(kt)},setSource(n){St(m,{source:n}),t.runLocationWrite(e,()=>q({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(St(m,{source:null}),T.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=V,n[37]=D,n[38]=O,n[39]=f,n[40]=y,n[41]=m,n[42]=S,n[43]=e,n[44]=H):H=n[44],H}function kt(e){e.ok||T.error(e.error)}function At(e){e.ok||T.error(e.error)}function $(e){let t=(0,Z.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,Y.jsx)(u,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,Y.jsx)(d,{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)(f,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function jt(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=J(),g,_,v,y,b,S,C,w,D,O;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:k,sourceHost:A,conflicted:j,drifted:M,linked:N,expectedMode:P,convertible:F,customRootRows:I}=Et({skill:r,allSkills:h.status===`ready`?h.data:null,hostSet:f,sourceHostOverlay:n.sourceHost,linkMode:n.linkMode});b=c,S=k,y=P,_=F,v=I;let L=e=>ie(a,e),R=Rt,z=e=>{let t=L(e);return t.length===0?!0:window.confirm(d({id:`Uobeu9`,values:{0:t.map(R).join(`, `),rootRel:e}}))},B;t[21]!==d||t[22]!==r?(B=(e,t)=>{let n=e.includes(`/`)?e:re(e,r?.scope??`project`);return(0,Y.jsx)($,{hint:d({id:`0dslv8`,values:{0:R(e),1:R(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:R(e)}}),onClick:i=>{i.preventDefault(),i.stopPropagation(),window.confirm(d({id:`iiqOKM`,values:{0:R(e),1:r.name,2:R(e),subRoot:n,poolRootRel:t}}))&&ae({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?E():T.error(d({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,Y.jsx)(at,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[21]=d,t[22]=r,t[23]=B):B=t[23];let V=B;g=n.installing;let H=ne(r),U=Lt,ee;t[24]!==d||t[25]!==s||t[26]!==n?(ee=(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]=ee):ee=t[27];let te=ee,G;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Y.jsx)(i,{id:`npcziF`}),t[28]=G):G=t[28];let K;t[29]===d?K=t[30]:(K=d({id:`6f_UX4`}),t[29]=d,t[30]=K);let q;t[31]===m?q=t[32]:(q=()=>m(),t[31]=m,t[32]=q);let oe;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,Y.jsx)(i,{id:`N40H-G`}),t[33]=oe):oe=t[33];let J;t[34]!==g||t[35]!==q?(J=(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:q,"data-testid":`skill-install-all`,children:oe}),t[34]=g,t[35]=q,t[36]=J):J=t[36];let X;t[37]!==K||t[38]!==J?(X=(0,Y.jsx)($,{hint:K,children:J}),t[37]=K,t[38]=J,t[39]=X):X=t[39],t[40]!==u||t[41]!==X?(C=(0,Y.jsxs)(dt,{menuKind:u,className:`flex items-center justify-between gap-2`,children:[G,X]}),t[40]=u,t[41]=X,t[42]=C):C=t[42],w=S===null?null:(0,Y.jsx)($,{hint:d({id:`pXB6SL`}),children:(0,Y.jsxs)(ut,{menuKind:u,disabled:g,checked:!0,onSelect:It,"data-testid":`skill-source-row`,children:[(0,Y.jsx)(W,{"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:S}),(()=>{let e=U(S).split(`/`).slice(0,-1).join(`/`),t=L(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=>V(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`})})]})]})}),D=b.map(t=>{let a=e(t),s=t===`agents`?`.agents`:x[t],c=U(a).split(`/`).slice(0,-1).join(`/`),m=L(c);return(0,Y.jsx)($,{hint:j.has(t)?d({id:`8HvJlU`,values:{0:a??s}}):t===A?a?d({id:`ssk6rl`,values:{path:a}}):s:f.has(t)?d(a?{id:`9ieZhu`,values:{path:a}}:{id:`n3T3EE`,values:{label:s}}):H?.editor===t?d({id:`_3S4Ql`,values:{0:r?.name??``,1:H.plugin,2:a??s,label:s}}):d(a?A===void 0?{id:`xk133d`,values:{path:a}}:y===`link`?{id:`1LtA5r`,values:{path:a}}:{id:`opPbzN`,values:{path:a}}:{id:`Pp0Vgd`,values:{label:s}}),children:(0,Y.jsxs)(ut,{menuKind:u,disabled:g,checked:f.has(t),onCheckedChange:e=>{j.has(t)||e===!0&&!z(c)||p(t,e===!0)},onSelect:Ft,className:`group`,"data-testid":`skill-install-editor-${t}`,children:[(0,Y.jsx)(at,{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=>V(e,c))}):null,H?.editor===t&&!f.has(t)?(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`,"data-testid":`skill-row-plugin-covered-${t}`,children:(0,Y.jsx)(i,{id:`scRzTw`})}):null,j.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===A?(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&&(N.has(t)?`link`:`copy`)!==y?te(t,a??s,N.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&&M.has(U(a))?(0,Y.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,Y.jsx)(st,{testId:`skill-drift-${t}`})}):null]})]})},t)}),O=v.map(e=>{let t=e.display;return(0,Y.jsx)($,{hint:e.placed===null?d(A===void 0?{id:`xk133d`,values:{path:t}}:y===`link`?{id:`1LtA5r`,values:{path:t}}:{id:`opPbzN`,values:{path:t}}):d({id:`9ieZhu`,values:{path:t}}),children:(0,Y.jsxs)(ut,{menuKind:u,disabled:g,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!z(e.root))return;n.placeAt(e.root,y)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:Pt,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,Y.jsx)(at,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,Y.jsx)(W,{"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}),L(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:L(e.root).map(t=>V(t,e.root))}):null,!g&&e.placed!==null&&M.has(e.placed.path)?(0,Y.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,Y.jsx)(st,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,Y.jsxs)(Y.Fragment,{children:[!g&&e.placed.mode!==y?te(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]=S,t[17]=C,t[18]=w,t[19]=D,t[20]=O}else g=t[11],_=t[12],v=t[13],y=t[14],b=t[15],S=t[16],C=t[17],w=t[18],D=t[19],O=t[20];let k;t[43]!==v||t[44]!==b.length||t[45]!==S?(k=b.length===0&&v.length===0&&S===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]=S,t[46]=k):k=t[46];let A;t[47]!==d||t[48]!==g||t[49]!==_||t[50]!==y||t[51]!==s||t[52]!==n?(A=_.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(Nt).join(`
2
2
  `);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:Mt,"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]=A):A=t[53];let j;t[54]===u?j=t[55]:(j=(0,Y.jsx)(ft,{menuKind:u}),t[54]=u,t[55]=j);let M;t[56]===d?M=t[57]:(M=d({id:`5ymuTA`}),t[56]=d,t[57]=M);let N;t[58]===r?.scope?N=t[59]:(N=()=>{window.location.hash=r?.scope===`global`?`#settings/user-skills`:`#settings/skills`},t[58]=r?.scope,t[59]=N);let P,F;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Y.jsx)(ze,{"aria-hidden":!0}),F=(0,Y.jsx)(i,{id:`ZBF9fn`}),t[60]=P,t[61]=F):(P=t[60],F=t[61]);let I;t[62]!==u||t[63]!==N?(I=(0,Y.jsxs)(lt,{menuKind:u,onSelect:N,children:[P,F]}),t[62]=u,t[63]=N,t[64]=I):I=t[64];let L;t[65]!==I||t[66]!==M?(L=(0,Y.jsx)($,{hint:M,children:I}),t[65]=I,t[66]=M,t[67]=L):L=t[67];let R;return t[68]!==L||t[69]!==C||t[70]!==w||t[71]!==D||t[72]!==O||t[73]!==k||t[74]!==A||t[75]!==j?(R=(0,Y.jsxs)(Y.Fragment,{children:[C,w,D,O,k,A,j,L]}),t[68]=L,t[69]=C,t[70]=w,t[71]=D,t[72]=O,t[73]=k,t[74]=A,t[75]=j,t[76]=R):R=t[76],R}function Mt(e){return e.preventDefault()}function Nt(e){return e.display}function Pt(e){return e.preventDefault()}function Ft(e){return e.preventDefault()}function It(e){return e.preventDefault()}function Lt(e){return(e??``).replace(/^~\//,``)}function Rt(e){return e===`agents`?`.agents`:x[e]??e}export{Le as C,Re as S,et as _,Ct as a,Ye as b,dt as c,mt as d,ht as f,rt as g,ot as h,wt as i,ft as l,at as m,jt as n,ct as o,st as p,Ot as r,lt as s,Dt as t,pt as u,Qe as v,Ae as w,ze as x,$e as y};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./SkillUpdateConflictDialog-Bm3xVcNZ.js","./dist-Nvb76hAm.js","./chunk-CYidjpOJ.js","./jsx-runtime-BUgB2tll.js","./react-f2sANaYj.js","./pierre-theme-DTYwy-r_.js","./preload-helper-Chd9yIcd.js","./engine-compile-CUzRCtim.js","./lib-DmueaA5E.js","./html-void-elements-zEl0KGqf.js","./ok-syntax-theme-DjG_XKfz.js","./MultiFileDiff-CWf97riI.js","./dialog-BYTIciug.js","./dist-BcvirUWL.js","./dist-BHv-mziD.js","./react-dom-DPxgxlDT.js","./dist-DRO03ovd.js","./es2015-B9_uRFGw.js","./button-Cym3gapE.js","./bundle-mjs-SHeFpKGC.js","./compiler-runtime-BfE3aGVn.js","./utils-CPqDy6Hr.js","./x-CnGRb1ER.js","./createLucideIcon-B6ULg5PN.js"])))=>i.map(i=>d[i]);
2
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.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"./button-Cym3gapE.js";import{i as c,n as l,t as u}from"./tooltip-DttaCTqz.js";import{t as d}from"./switch-iwBsEWej.js";import{t as f}from"./arrow-up-right-B3B9a7te.js";import{t as p}from"./spinner-Bp2_BYkl.js";import{t as m}from"./refresh-cw-DgTHxKWl.js";import{t as h}from"./undo-2-Dg2S1Iz5.js";import{t as g}from"./use-skill-origin-FAiHzQpH.js";var _=o(),v=e(r(),1),y=n(),b=(0,v.lazy)(async()=>({default:(await t(()=>import(`./SkillUpdateConflictDialog-Bm3xVcNZ.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]),import.meta.url)).SkillUpdateConflictDialog}));function x(e){let t=(0,_.c)(48),{scope:n,name:r}=e,{_:o}=a(),x;t[0]!==r||t[1]!==n?(x={scope:n,name:r},t[0]=r,t[1]=n,t[2]=x):x=t[2];let{origin:S,github:C,displaySource:w,importedTitle:T,canReimport:E,updateAvailable:D,modified:O,autoUpdate:k,gitTracked:A,setAutoUpdate:j,revertable:M,reimport:N,reimporting:P,previewUpdate:F,revert:I,reverting:L}=g(x),[R,z]=(0,v.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(!S)return null;let W;t[9]!==w||t[10]!==C||t[11]!==T?(W=C?(0,y.jsxs)(`a`,{href:C,target:`_blank`,rel:`noreferrer`,title:T??void 0,className:`hidden min-w-0 max-w-48 items-center gap-1 hover:text-foreground @xl/toolbar:flex`,children:[(0,y.jsx)(`span`,{className:`truncate`,children:w}),(0,y.jsx)(f,{className:`size-3 shrink-0`,"aria-hidden":!0})]}):(0,y.jsx)(`span`,{title:T??void 0,className:`hidden min-w-0 max-w-48 truncate @xl/toolbar:inline`,children:w}),t[9]=w,t[10]=C,t[11]=T,t[12]=W):W=t[12];let G;t[13]!==o||t[14]!==k||t[15]!==E||t[16]!==A||t[17]!==j?(G=E?(0,y.jsxs)(u,{children:[(0,y.jsx)(c,{asChild:!0,children:(0,y.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1`,children:[(0,y.jsx)(`label`,{htmlFor:`skill-auto-update-switch`,className:`hidden cursor-pointer @xl/toolbar:inline`,children:(0,y.jsx)(i,{id:`2M0JF6`})}),(0,y.jsx)(d,{id:`skill-auto-update-switch`,checked:k&&!A,disabled:A,onCheckedChange:e=>void j(e===!0),"aria-label":o({id:`o9fPtM`}),className:`scale-75`})]})}),(0,y.jsx)(l,{side:`bottom`,children:A?(0,y.jsx)(i,{id:`vy_VIN`}):k?(0,y.jsx)(i,{id:`vGQxBT`}):(0,y.jsx)(i,{id:`9p_QBN`})})]}):null,t[13]=o,t[14]=k,t[15]=E,t[16]=A,t[17]=j,t[18]=G):G=t[18];let K;t[19]===O?K=t[20]:(K=O?(0,y.jsxs)(u,{children:[(0,y.jsx)(c,{asChild:!0,children:(0,y.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,y.jsx)(i,{id:`tgWuMB`})})}),(0,y.jsx)(l,{side:`bottom`,children:(0,y.jsx)(i,{id:`s0Iold`})})]}):null,t[19]=O,t[20]=K);let q;t[21]!==o||t[22]!==E||t[23]!==O||t[24]!==P||t[25]!==I||t[26]!==M||t[27]!==L?(q=O&&E&&M?(0,y.jsxs)(u,{children:[(0,y.jsx)(s,{variant:`ghost`,size:`sm`,onClick:()=>void I(),disabled:L||P,"aria-label":o({id:`VxLvKE`}),className:`shrink-0 gap-1 text-muted-foreground px-2 text-xs hover:text-foreground`,asChild:!0,children:(0,y.jsxs)(c,{children:[L?(0,y.jsx)(p,{icon:h,className:`size-3`,"aria-hidden":!0}):(0,y.jsx)(h,{className:`size-3`,"aria-hidden":!0}),(0,y.jsx)(`span`,{className:`hidden @xl/toolbar:inline`,children:L?(0,y.jsx)(i,{id:`fIJtam`}):(0,y.jsx)(i,{id:`jJdwCB`})})]})}),(0,y.jsx)(l,{side:`bottom`,children:(0,y.jsx)(i,{id:`XSb9HS`})})]}):null,t[21]=o,t[22]=E,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]!==o||t[30]!==E||t[31]!==V||t[32]!==P||t[33]!==L||t[34]!==D?(J=E&&D?(0,y.jsxs)(u,{children:[(0,y.jsx)(s,{variant:`ghost`,size:`sm`,onClick:()=>void V(),disabled:P||L,"aria-label":o({id:`GidGkh`}),className:`shrink-0 gap-1 text-muted-foreground px-2 text-xs hover:text-foreground`,asChild:!0,children:(0,y.jsxs)(c,{children:[P?(0,y.jsx)(p,{icon:m,className:`size-3`,"aria-hidden":!0}):(0,y.jsx)(m,{className:`size-3`,"aria-hidden":!0}),(0,y.jsx)(`span`,{className:`hidden @xl/toolbar:inline`,children:P?(0,y.jsx)(i,{id:`JL3si7`}):(0,y.jsx)(i,{id:`EkH9pt`})})]})}),(0,y.jsx)(l,{side:`bottom`,children:(0,y.jsx)(i,{id:`GidGkh`})})]}):null,t[29]=o,t[30]=E,t[31]=V,t[32]=P,t[33]=L,t[34]=D,t[35]=J):J=t[35];let Y;t[36]!==R||t[37]!==r||t[38]!==U||t[39]!==P?(Y=R?(0,y.jsx)(v.Suspense,{fallback:null,children:(0,y.jsx)(b,{open:!0,onOpenChange:e=>{e||z(null)},skillName:r,localBody:R.localBody,upstreamBody:R.upstreamBody,applying:P,onTakeUpstream:()=>void U()})}):null,t[36]=R,t[37]=r,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,y.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{x as SkillOriginInline};
2
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.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"./button-Cym3gapE.js";import{i as c,n as l,t as u}from"./tooltip-DttaCTqz.js";import{t as d}from"./switch-iwBsEWej.js";import{t as f}from"./arrow-up-right-B3B9a7te.js";import{t as p}from"./spinner-Bp2_BYkl.js";import{t as m}from"./refresh-cw-DgTHxKWl.js";import{t as h}from"./undo-2-Dg2S1Iz5.js";import{t as g}from"./use-skill-origin-CBguK4Xh.js";var _=o(),v=e(r(),1),y=n(),b=(0,v.lazy)(async()=>({default:(await t(()=>import(`./SkillUpdateConflictDialog-Bm3xVcNZ.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]),import.meta.url)).SkillUpdateConflictDialog}));function x(e){let t=(0,_.c)(48),{scope:n,name:r}=e,{_:o}=a(),x;t[0]!==r||t[1]!==n?(x={scope:n,name:r},t[0]=r,t[1]=n,t[2]=x):x=t[2];let{origin:S,github:C,displaySource:w,importedTitle:T,canReimport:E,updateAvailable:D,modified:O,autoUpdate:k,gitTracked:A,setAutoUpdate:j,revertable:M,reimport:N,reimporting:P,previewUpdate:F,revert:I,reverting:L}=g(x),[R,z]=(0,v.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(!S)return null;let W;t[9]!==w||t[10]!==C||t[11]!==T?(W=C?(0,y.jsxs)(`a`,{href:C,target:`_blank`,rel:`noreferrer`,title:T??void 0,className:`hidden min-w-0 max-w-48 items-center gap-1 hover:text-foreground @xl/toolbar:flex`,children:[(0,y.jsx)(`span`,{className:`truncate`,children:w}),(0,y.jsx)(f,{className:`size-3 shrink-0`,"aria-hidden":!0})]}):(0,y.jsx)(`span`,{title:T??void 0,className:`hidden min-w-0 max-w-48 truncate @xl/toolbar:inline`,children:w}),t[9]=w,t[10]=C,t[11]=T,t[12]=W):W=t[12];let G;t[13]!==o||t[14]!==k||t[15]!==E||t[16]!==A||t[17]!==j?(G=E?(0,y.jsxs)(u,{children:[(0,y.jsx)(c,{asChild:!0,children:(0,y.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1`,children:[(0,y.jsx)(`label`,{htmlFor:`skill-auto-update-switch`,className:`hidden cursor-pointer @xl/toolbar:inline`,children:(0,y.jsx)(i,{id:`2M0JF6`})}),(0,y.jsx)(d,{id:`skill-auto-update-switch`,checked:k&&!A,disabled:A,onCheckedChange:e=>void j(e===!0),"aria-label":o({id:`o9fPtM`}),className:`scale-75`})]})}),(0,y.jsx)(l,{side:`bottom`,children:A?(0,y.jsx)(i,{id:`vy_VIN`}):k?(0,y.jsx)(i,{id:`vGQxBT`}):(0,y.jsx)(i,{id:`9p_QBN`})})]}):null,t[13]=o,t[14]=k,t[15]=E,t[16]=A,t[17]=j,t[18]=G):G=t[18];let K;t[19]===O?K=t[20]:(K=O?(0,y.jsxs)(u,{children:[(0,y.jsx)(c,{asChild:!0,children:(0,y.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,y.jsx)(i,{id:`tgWuMB`})})}),(0,y.jsx)(l,{side:`bottom`,children:(0,y.jsx)(i,{id:`s0Iold`})})]}):null,t[19]=O,t[20]=K);let q;t[21]!==o||t[22]!==E||t[23]!==O||t[24]!==P||t[25]!==I||t[26]!==M||t[27]!==L?(q=O&&E&&M?(0,y.jsxs)(u,{children:[(0,y.jsx)(s,{variant:`ghost`,size:`sm`,onClick:()=>void I(),disabled:L||P,"aria-label":o({id:`VxLvKE`}),className:`shrink-0 gap-1 text-muted-foreground px-2 text-xs hover:text-foreground`,asChild:!0,children:(0,y.jsxs)(c,{children:[L?(0,y.jsx)(p,{icon:h,className:`size-3`,"aria-hidden":!0}):(0,y.jsx)(h,{className:`size-3`,"aria-hidden":!0}),(0,y.jsx)(`span`,{className:`hidden @xl/toolbar:inline`,children:L?(0,y.jsx)(i,{id:`fIJtam`}):(0,y.jsx)(i,{id:`jJdwCB`})})]})}),(0,y.jsx)(l,{side:`bottom`,children:(0,y.jsx)(i,{id:`XSb9HS`})})]}):null,t[21]=o,t[22]=E,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]!==o||t[30]!==E||t[31]!==V||t[32]!==P||t[33]!==L||t[34]!==D?(J=E&&D?(0,y.jsxs)(u,{children:[(0,y.jsx)(s,{variant:`ghost`,size:`sm`,onClick:()=>void V(),disabled:P||L,"aria-label":o({id:`GidGkh`}),className:`shrink-0 gap-1 text-muted-foreground px-2 text-xs hover:text-foreground`,asChild:!0,children:(0,y.jsxs)(c,{children:[P?(0,y.jsx)(p,{icon:m,className:`size-3`,"aria-hidden":!0}):(0,y.jsx)(m,{className:`size-3`,"aria-hidden":!0}),(0,y.jsx)(`span`,{className:`hidden @xl/toolbar:inline`,children:P?(0,y.jsx)(i,{id:`JL3si7`}):(0,y.jsx)(i,{id:`EkH9pt`})})]})}),(0,y.jsx)(l,{side:`bottom`,children:(0,y.jsx)(i,{id:`GidGkh`})})]}):null,t[29]=o,t[30]=E,t[31]=V,t[32]=P,t[33]=L,t[34]=D,t[35]=J):J=t[35];let Y;t[36]!==R||t[37]!==r||t[38]!==U||t[39]!==P?(Y=R?(0,y.jsx)(v.Suspense,{fallback:null,children:(0,y.jsx)(b,{open:!0,onOpenChange:e=>{e||z(null)},skillName:r,localBody:R.localBody,upstreamBody:R.upstreamBody,applying:P,onTakeUpstream:()=>void U()})}):null,t[36]=R,t[37]=r,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,y.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{x 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{C as s}from"./SkillInstallMenu-BSeeI8R-.js";import{t as c}from"./button-Cym3gapE.js";import{a as l,i as u,n as d,o as f,r as p,s as m,t as h}from"./select-BKzcW_PB.js";import{l as g,n as _,r as v,t as y}from"./AddPropertiesButton-BzvWvVbw.js";import{a as b,m as x,r as S,t as C,u as w}from"./dropdown-menu--ZF4igWe.js";import{t as T}from"./list-plus-BmoxCvSM.js";import{p as E,t as D}from"./skill-scope-B1qEIboE.js";var O=a(),k=t();function A(e){let t=(0,O.c)(21),{value:n,onRequestMove:a,disabled:s,triggerClassName:c}=e,{_:g}=i(),_=E(),v;t[0]===a?v=t[1]:(v=e=>a(e),t[0]=a,t[1]=v);let y;t[2]===g?y=t[3]:(y=g({id:`oCHfGC`}),t[2]=g,t[3]=y);let b;t[4]===c?b=t[5]:(b=o(`w-auto gap-1 text-xs font-mono uppercase`,c),t[4]=c,t[5]=b);let x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,k.jsx)(m,{}),t[6]=x):x=t[6];let S;t[7]!==y||t[8]!==b?(S=(0,k.jsx)(f,{size:`sm`,"aria-label":y,"data-testid":`skill-level-select`,className:b,children:x}),t[7]=y,t[8]=b,t[9]=S):S=t[9];let C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,k.jsx)(l,{children:(0,k.jsx)(r,{id:`oCHfGC`})}),t[10]=C):C=t[10];let w;t[11]===_?w=t[12]:(w=D.map(e=>(0,k.jsx)(u,{value:e,children:_[e]},e)),t[11]=_,t[12]=w);let T;t[13]===w?T=t[14]:(T=(0,k.jsx)(d,{align:`end`,children:(0,k.jsxs)(p,{children:[C,w]})}),t[13]=w,t[14]=T);let A;return t[15]!==s||t[16]!==v||t[17]!==S||t[18]!==T||t[19]!==n?(A=(0,k.jsxs)(h,{value:n,onValueChange:v,disabled:s,children:[S,T]}),t[15]=s,t[16]=v,t[17]=S,t[18]=T,t[19]=n,t[20]=A):A=t[20],A}var j=e(n(),1);function M(e){let t=(0,O.c)(12),{scope:n,name:r}=e,[i,a]=(0,j.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,k.jsx)(g,{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 N(e){let t=(0,O.c)(41),{scope:n,name:a,showAddPropertyButton:o,onAddProperty:l,problemCount:u,problemMessages:d}=e,{_:f}=i(),p;t[0]!==a||t[1]!==n?(p={scope:n,name:a},t[0]=a,t[1]=n,t[2]=p):p=t[2];let m=M(p),h;t[3]!==m.requestMove||t[4]!==n?(h=(0,k.jsx)(A,{value:n,onRequestMove:m.requestMove,triggerClassName:`hidden @xl/toolbar:flex`}),t[3]=m.requestMove,t[4]=n,t[5]=h):h=t[5];let g;t[6]!==a||t[7]!==n?(g=(0,k.jsx)(v,{scope:n,name:a}),t[6]=a,t[7]=n,t[8]=g):g=t[8];let E;t[9]!==h||t[10]!==g?(E=(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[h,g]}),t[9]=h,t[10]=g,t[11]=E):E=t[11];let D;t[12]!==l||t[13]!==u||t[14]!==d||t[15]!==o?(D=o?(0,k.jsx)(y,{onAddProperty:l,problemCount:u,problemMessages:d,className:`hidden @xl/toolbar:inline-flex`}):null,t[12]=l,t[13]=u,t[14]=d,t[15]=o,t[16]=D):D=t[16];let j;t[17]===f?j=t[18]:(j=f({id:`Yzs3QX`}),t[17]=f,t[18]=j);let N;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,k.jsx)(s,{className:`size-4`,"aria-hidden":!0}),t[19]=N):N=t[19];let P;t[20]===j?P=t[21]:(P=(0,k.jsx)(x,{asChild:!0,children:(0,k.jsx)(c,{variant:`ghost`,size:`icon`,"aria-label":j,"data-testid":`skill-toolbar-overflow`,className:`@xl/toolbar:hidden`,children:N})}),t[20]=j,t[21]=P);let F;t[22]===m?F=t[23]:(F=e=>m.requestMove(e),t[22]=m,t[23]=F);let I;t[24]!==n||t[25]!==F?(I=(0,k.jsx)(_,{value:n,onSelect:F}),t[24]=n,t[25]=F,t[26]=I):I=t[26];let L;t[27]!==l||t[28]!==o?(L=o?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(w,{}),(0,k.jsxs)(b,{onSelect:l,children:[(0,k.jsx)(T,{}),(0,k.jsx)(r,{id:`81H_23`})]})]}):null,t[27]=l,t[28]=o,t[29]=L):L=t[29];let R;t[30]!==I||t[31]!==L?(R=(0,k.jsxs)(S,{align:`end`,className:`min-w-44`,children:[I,L]}),t[30]=I,t[31]=L,t[32]=R):R=t[32];let z;t[33]!==R||t[34]!==P?(z=(0,k.jsxs)(C,{children:[P,R]}),t[33]=R,t[34]=P,t[35]=z):z=t[35];let B;return t[36]!==m.dialog||t[37]!==z||t[38]!==E||t[39]!==D?(B=(0,k.jsxs)(k.Fragment,{children:[E,D,z,m.dialog]}),t[36]=m.dialog,t[37]=z,t[38]=E,t[39]=D,t[40]=B):B=t[40],B}export{N 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{C as s}from"./SkillInstallMenu-CVK9zId1.js";import{t as c}from"./button-Cym3gapE.js";import{a as l,i as u,n as d,o as f,r as p,s as m,t as h}from"./select-BKzcW_PB.js";import{l as g,n as _,r as v,t as y}from"./AddPropertiesButton-CLAxY4Kp.js";import{a as b,m as x,r as S,t as C,u as w}from"./dropdown-menu--ZF4igWe.js";import{t as T}from"./list-plus-BmoxCvSM.js";import{p as E,t as D}from"./skill-scope-B1qEIboE.js";var O=a(),k=t();function A(e){let t=(0,O.c)(21),{value:n,onRequestMove:a,disabled:s,triggerClassName:c}=e,{_:g}=i(),_=E(),v;t[0]===a?v=t[1]:(v=e=>a(e),t[0]=a,t[1]=v);let y;t[2]===g?y=t[3]:(y=g({id:`oCHfGC`}),t[2]=g,t[3]=y);let b;t[4]===c?b=t[5]:(b=o(`w-auto gap-1 text-xs font-mono uppercase`,c),t[4]=c,t[5]=b);let x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,k.jsx)(m,{}),t[6]=x):x=t[6];let S;t[7]!==y||t[8]!==b?(S=(0,k.jsx)(f,{size:`sm`,"aria-label":y,"data-testid":`skill-level-select`,className:b,children:x}),t[7]=y,t[8]=b,t[9]=S):S=t[9];let C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,k.jsx)(l,{children:(0,k.jsx)(r,{id:`oCHfGC`})}),t[10]=C):C=t[10];let w;t[11]===_?w=t[12]:(w=D.map(e=>(0,k.jsx)(u,{value:e,children:_[e]},e)),t[11]=_,t[12]=w);let T;t[13]===w?T=t[14]:(T=(0,k.jsx)(d,{align:`end`,children:(0,k.jsxs)(p,{children:[C,w]})}),t[13]=w,t[14]=T);let A;return t[15]!==s||t[16]!==v||t[17]!==S||t[18]!==T||t[19]!==n?(A=(0,k.jsxs)(h,{value:n,onValueChange:v,disabled:s,children:[S,T]}),t[15]=s,t[16]=v,t[17]=S,t[18]=T,t[19]=n,t[20]=A):A=t[20],A}var j=e(n(),1);function M(e){let t=(0,O.c)(12),{scope:n,name:r}=e,[i,a]=(0,j.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,k.jsx)(g,{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 N(e){let t=(0,O.c)(41),{scope:n,name:a,showAddPropertyButton:o,onAddProperty:l,problemCount:u,problemMessages:d}=e,{_:f}=i(),p;t[0]!==a||t[1]!==n?(p={scope:n,name:a},t[0]=a,t[1]=n,t[2]=p):p=t[2];let m=M(p),h;t[3]!==m.requestMove||t[4]!==n?(h=(0,k.jsx)(A,{value:n,onRequestMove:m.requestMove,triggerClassName:`hidden @xl/toolbar:flex`}),t[3]=m.requestMove,t[4]=n,t[5]=h):h=t[5];let g;t[6]!==a||t[7]!==n?(g=(0,k.jsx)(v,{scope:n,name:a}),t[6]=a,t[7]=n,t[8]=g):g=t[8];let E;t[9]!==h||t[10]!==g?(E=(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[h,g]}),t[9]=h,t[10]=g,t[11]=E):E=t[11];let D;t[12]!==l||t[13]!==u||t[14]!==d||t[15]!==o?(D=o?(0,k.jsx)(y,{onAddProperty:l,problemCount:u,problemMessages:d,className:`hidden @xl/toolbar:inline-flex`}):null,t[12]=l,t[13]=u,t[14]=d,t[15]=o,t[16]=D):D=t[16];let j;t[17]===f?j=t[18]:(j=f({id:`Yzs3QX`}),t[17]=f,t[18]=j);let N;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,k.jsx)(s,{className:`size-4`,"aria-hidden":!0}),t[19]=N):N=t[19];let P;t[20]===j?P=t[21]:(P=(0,k.jsx)(x,{asChild:!0,children:(0,k.jsx)(c,{variant:`ghost`,size:`icon`,"aria-label":j,"data-testid":`skill-toolbar-overflow`,className:`@xl/toolbar:hidden`,children:N})}),t[20]=j,t[21]=P);let F;t[22]===m?F=t[23]:(F=e=>m.requestMove(e),t[22]=m,t[23]=F);let I;t[24]!==n||t[25]!==F?(I=(0,k.jsx)(_,{value:n,onSelect:F}),t[24]=n,t[25]=F,t[26]=I):I=t[26];let L;t[27]!==l||t[28]!==o?(L=o?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(w,{}),(0,k.jsxs)(b,{onSelect:l,children:[(0,k.jsx)(T,{}),(0,k.jsx)(r,{id:`81H_23`})]})]}):null,t[27]=l,t[28]=o,t[29]=L):L=t[29];let R;t[30]!==I||t[31]!==L?(R=(0,k.jsxs)(S,{align:`end`,className:`min-w-44`,children:[I,L]}),t[30]=I,t[31]=L,t[32]=R):R=t[32];let z;t[33]!==R||t[34]!==P?(z=(0,k.jsxs)(C,{children:[P,R]}),t[33]=R,t[34]=P,t[35]=z):z=t[35];let B;return t[36]!==m.dialog||t[37]!==z||t[38]!==E||t[39]!==D?(B=(0,k.jsxs)(k.Fragment,{children:[E,D,z,m.dialog]}),t[36]=m.dialog,t[37]=z,t[38]=E,t[39]=D,t[40]=B):B=t[40],B}export{N as SkillToolbarControls};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Lt as n,Nn as r,On as i,U as a,_n as o,bt as s,lt as c,mt as l,nn as u,rn as d,st as f,ut as p,yn as m,yt as h,zt as ee}from"./DocumentContext-BWfYIGn-.js";import{t as g}from"./react-f2sANaYj.js";import{n as _}from"./dist-PQ5KMVDh.js";import{t as v}from"./compiler-runtime-BfE3aGVn.js";import{O as y,gs as b,js as x,ta as te,ui as S,xs as C}from"./dist-CGNkoXKB.js";import{i as ne}from"./use-apply-config-theme-DpLdjUDN.js";import{E as w,F as re,I as ie,M as ae,O as T,R as oe,V as se,d as ce,g as le,i as ue,m as E,r as de,t as fe,u as pe}from"./typing-burst-detector-CyxGjpoW.js";import{P as D,S as O,Y as k,Z as A,a as me,i as he,o as ge}from"./CodeMirrorPropInput-CvenaDDl.js";import{a as j,s as _e}from"./startup-marks-D0gyAKgY.js";import{g as ve}from"./config-provider-DlzcUiYU.js";import{$ as M,At as N,Ct as P,E as F,J as I,K as L,Mt as R,N as z,Nt as B,Tt as ye,X as V,at as H,b as U,et as W,ft as be,g as G,l as K,lt as q,ot as J,pt as Y,st as X,tt as Z,ut as xe,v as Se,wt as Ce}from"./dist-DlsJ2gMP.js";import{i as we,t as Te}from"./dist-Baby7q1O.js";import{i as Ee,n as De,o as Oe,r as ke}from"./dist-CQP6rPA_.js";import{o as Ae,r as je}from"./selection-context-DJ_FIiJx.js";import{l as Me}from"./lint-config-client-B61iX5QY.js";import{a as Ne,i as Pe,n as Fe,o as Ie,r as Le,s as Re,t as ze}from"./dist-BauSyrbN2.js";import{n as Be,t as Ve}from"./src-BuzwpJZ-.js";var Q=e(g(),1),He=v();function Ue(){let e=h();return e===null?null:new Set(e.keys())}function We(e,t,n){let r=[],i=z(e);if(n!=null){let a=[];for(let{from:e,to:n}of t)i.iterate({from:e,to:n,enter(e){if(e.name===`InlineCode`||e.name===`FencedCode`)return a.push({from:e.from,to:e.to}),!1}});let o=(e,t)=>a.some(n=>e>=n.from&&t<=n.to);for(let{from:i,to:a}of t){let t=e.doc.sliceString(i,a);C.lastIndex=0;for(let e=C.exec(t);e!==null;e=C.exec(t)){let t=e[2];if(!x(t))continue;let a=i+(e.index??0)+e[1].length,s=a+t.length+1;o(a,s)||r.push(L.mark({class:n.has(t)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":t}}).range(a,s))}}}for(let{from:a,to:o}of t)i.iterate({from:a,to:o,enter(t){if(t.name!==`InlineCode`)return;let i=e.doc.sliceString(t.from,t.to),a=i.length-i.replace(/^`+/,``).length,o=i.length-i.replace(/`+$/,``).length,s=i.slice(a,i.length-o),c=/^\/([a-z0-9][a-z0-9-]{1,63})$/.exec(s)?.[1];if(c!==void 0&&x(c)&&n!=null)return r.push(L.mark({class:n.has(c)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":c}}).range(t.from+a,t.to-o)),!1;let l=f.exec(s);if(l)return r.push(L.mark({class:`cm-skill-path-link`,attributes:{"data-skill-path":l[1]}}).range(t.from+a,t.to-o)),!1}});return r.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),L.set(r)}function Ge(e){let t=p(e);return t===null?[]:[V.fromClass(class{decorations;constructor(e){this.decorations=We(e.state,e.visibleRanges,Ue())}update(e){(e.docChanged||e.viewportChanged||z(e.startState)!==z(e.state))&&(this.decorations=We(e.view.state,e.view.visibleRanges,Ue()))}},{decorations:e=>e.decorations}),I.domEventHandlers({mousedown(n){let r=n.target?.closest?.(`[data-skill-ref]`),i=r instanceof HTMLElement?r.dataset.skillRef:void 0;if(i!==void 0){n.preventDefault();let e=h()?.get(i);return e===void 0?l():window.location.hash=s(i,e),!0}let a=n.target?.closest?.(`.cm-skill-path-link`),o=a instanceof HTMLElement?a.dataset.skillPath:void 0;return o===void 0?!1:(n.preventDefault(),window.location.hash=c(t,e,o),!0)}})]}var Ke=L.line({attributes:{dir:`auto`}});function qe(e){let t=new N;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,Ke),r=n.to+1}return t.finish()}var Je=V.fromClass(class{decorations;constructor(e){this.decorations=qe(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=qe(e.view))}},{decorations:e=>e.decorations}),Ye=[I.perLineTextDirection.of(!0),Je],Xe=new Set([`Link`,`Image`,`HTMLTag`,`HTMLBlock`]),Ze=`cm-lint-local-target`;function Qe(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 $e(e,t){let n=G(e,t+1,100);if(n){let e=n.resolveInner(t,1);for(;e;){if(Xe.has(e.name))return{from:e.from,to:e.to};e=e.parent}}return{from:t,to:t}}function et(e){return e===`error`?`error`:e===`info`?`info`:`warning`}function tt(e,t){let n=e.doc,r=[];for(let i of t){if(i.source!==`links`)continue;let t=$e(e,Qe(n,i.range.start));r.push({from:t.from,to:Math.max(t.to,t.from),severity:et(i.severity),message:T(i),source:`${i.source}/${i.code}`,markClass:Ze})}return r}var nt=R.define();function rt(e){let t={findings:[]};return[Pe(e=>k()?tt(e.state,t.findings):[],{delay:300,needsRefresh:e=>e.transactions.some(e=>e.effects.some(e=>e.is(nt)))}),V.define(n=>{let r=e=>{t.findings=e,n.dispatch({effects:nt.of(null)}),ze(n)},i=w(e,e=>{e.status===`loaded`&&r(e.findings)}),a=A(()=>r(t.findings));return{destroy(){i(),a()}}})]}function it(e,t){return e.enabled?[Fe(),Pe(async n=>at(n.state.doc,await S(n.state.doc.toString(),e,t)),{delay:600})]:[]}function $(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 at(e,t){let n=[];for(let r of t){let t=$(e,r.range.start),i=$(e,r.range.end),a={from:t,to:Math.max(i,t),severity:r.severity,message:r.message,source:`${r.source}/${r.code}`},o=ot(r);o&&(a.actions=[o]),n.push(a)}return n}function ot(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:$(n,e.range.start),to:$(n,e.range.end),insert:e.newText})),userEvent:`input.complete`})}}}var st=[xe(),J(),X(),Se(),W(),Z(),ye.allowMultipleSelections.of(!0),F(),K(),ke(),De(),Y(),M(),H(),Ne(),q.of([...Ee,...Te,...Re,...U,...Oe,...Le])],ct=L.mark({class:`cm-link-ref-broken`}),lt=/^\s{0,3}\[([^\]]+)\]:\s/,ut=/\[([^\]]*)\]\[([^\]]*)\]/g,dt=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function ft(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 pt(e){let t=[];return z(e).iterate({enter(e){if(dt.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function mt(e){let t=new Set,n=[],r=e.doc,i=pt(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if(ft(n.from,i))continue;let a=lt.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!ft(t.from,i)&&!lt.test(t.text))for(ut.lastIndex=0;;){let e=ut.exec(t.text);if(!e)break;let r=t.from+e.index;if(ft(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(ct.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),L.set(a)}var ht=B.define({create(e){return mt(e)},update(e,t){return t.docChanged?mt(t.state):e},provide:e=>I.decorations.from(e)}),gt=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,_t=L.mark({class:`cm-del`}),vt=L.line({class:`cm-table-header`,attributes:{style:`--list-hang: 2ch`}}),yt=L.line({class:`cm-table-row`,attributes:{style:`--list-hang: 2ch`}});function bt(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function xt(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 St(e,t){let n=[],r=z(e),i=xt(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(_t.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=gt.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=bt(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(vt.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(yt.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(yt.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),L.set(n)}var Ct=class{decorations;constructor(e){this.decorations=St(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||z(e.startState)!==z(e.state))&&(this.decorations=St(e.view.state,e.view.visibleRanges))}},wt=V.fromClass(Ct,{decorations:e=>e.decorations});function Tt(){return[wt,ht]}function Et(e,t){let n=e.trackedOrigins;return n.has(t)?!0:t?n.has(t.constructor):!1}function Dt(e){let{docName:t,ytext:n,undoManager:r}=e,i=!1,a=!1,o=!1,s=(e,t)=>{i||Et(r,t.origin)||(a=!0)};return n.observe(s),{setSourceModeActive(e){if(!o&&e!==i){if(!e){i=!1,r.stopCapturing();return}a&&(r.clear(),j(`ok/source-undo/flip-clear`,{docName:t})),a=!1,i=!0}},destroy(){o||(o=!0,n.unobserve(s))}}}var Ot=new WeakMap;function kt(e){return V.define(t=>{let n=Dt(e);return Ot.set(t,n),{destroy(){n.destroy()}}})}function At(e,t){let n=Ot.get(e);if(!n)throw Error(`createSourceUndoFlipExtension is not installed on this EditorView`);n.setSourceModeActive(t)}var jt=t(),Mt=R.define();function Nt(e,t){try{At(t.view,!1)}finally{try{d(t)}finally{m(e,t.view)}}}function Pt(e,t,n){let i=E(e.state.doc),a=i[t.index],o={docName:n,mode:`source`,index:t.index,sourceHeadingCount:i.length};if(!a){_e(pe,{...o,outcome:`no-target`});return}let s=r(n,`outline`,()=>{e.dispatch({selection:Ce.cursor(a.from),effects:I.scrollIntoView(a.from,{y:`start`})}),e.focus()});_e(pe,{...o,outcome:s?`scrolled`:`declined`,targetLine:e.state.doc.lineAt(a.from).number})}function Ft(e,t,n,i){requestAnimationFrame(()=>{if(!n())return;let a=e.state.doc,o=Math.min(t.offset,a.length);r(i,`raw-mdx`,()=>{e.dispatch({selection:Ce.cursor(o),effects:I.scrollIntoView(o,{y:`center`})}),e.focus()})})}function It(e,t,n){let i=e.state.doc,a=Math.min(Math.max(t.line,1),i.lines),o=i.line(a),s=Math.min(o.from+Math.max(0,t.column-1),o.to);return r(n,`problems-row`,()=>{e.dispatch({selection:Ce.cursor(s),effects:I.scrollIntoView(s,{y:`start`})}),e.focus()})}function Lt(e){let t=(0,He.c)(51),{docName:r,ytext:s,provider:c,placeholder:l,isSourceModeActive:d}=e,f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),[m,h]=(0,Q.useState)(null);if(m)throw m;let{resolvedTheme:g}=_(),{merged:v}=ne(),b=(0,Q.useRef)(d),x=v?.editor?.wordWrap??!0,{data:S}=Me(r),C;t[0]!==S?.effective||t[1]!==v?(C=S?.effective??(v?.contentRules?te(v.contentRules):y),t[0]=S?.effective,t[1]=v,t[2]=C):C=t[2];let w=C,T;t[3]===w?T=t[4]:(T=JSON.stringify(w),t[3]=w,t[4]=T);let E=T,D=(0,Q.useRef)(null),O;t[5]!==r||t[6]!==d||t[7]!==w||t[8]!==l||t[9]!==c||t[10]!==g||t[11]!==x||t[12]!==s?(O=()=>{let e=f.current;if(!e)return;let t=c.configuration.name??``,m,_=zt;try{m=u({docName:t,container:e,sizeStats:{viewCount:0,bytes:s.length},factory:e=>{let o=null,u=new ve(s);try{let d=a({ydoc:c.document,ytext:s,docName:t}),f=new P,p=new P,m=new P,h=new P,v=new I({state:ye.create({doc:s.toString(),extensions:[st,Ye,Ie({scrollToMatch:e=>i(t,`find-match`)?I.scrollIntoView(e,{y:`start`}):Mt.of(null)}),q.of([we]),Ve(s,c.awareness,{undoManager:u}),q.of(Be),kt({docName:t,ytext:s,undoManager:u}),...he({themeCompartment:f,resolvedTheme:g,ydoc:c.document,wordWrapCompartment:p,wordWrap:x,currentDocName:t}),Tt(),Ge(t),se(),h.of(it(w,r)),rt(r),d,I.updateListener.of(e=>{n(e)&&ee(t)}),I.updateListener.of(e=>{!e.selectionSet&&!e.docChanged||(o!==null&&clearTimeout(o),o=setTimeout(()=>{o=null,de(t,`source`,ue(e.view)),je(t,`source`,Ae(e.view,t))},120))}),m.of(be(l??``)),I.theme({"&":{height:`100%`}}),I.scrollMargins.of(Rt)]}),parent:e});de(t,`source`,ue(v)),je(t,`source`,Ae(v,t));let y=v.contentDOM;return y.addEventListener(`keydown`,_),y.addEventListener(`paste`,_),y.addEventListener(`drop`,_),y.addEventListener(`cut`,_),{view:v,ydoc:c.document,ytext:s,provider:c,undoManager:u,themeCompartment:f,wordWrapCompartment:p,placeholderCompartment:m,lintCompartment:h}}catch(e){let t=e;throw u.destroy(),t}}}),D.current=m,p.current=m.view,At(m.view,d),o(r,m.view),fe()&&m.view.focus()}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),D.current=null,p.current=null,h(t instanceof Error?t:Error(String(t)))}return()=>{let e=D.current;D.current=null,p.current=null,e&&Nt(r,e)}},t[5]=r,t[6]=d,t[7]=w,t[8]=l,t[9]=c,t[10]=g,t[11]=x,t[12]=s,t[13]=O):O=t[13];let k;t[14]!==c||t[15]!==s?(k=[s,c],t[14]=c,t[15]=s,t[16]=k):k=t[16],(0,Q.useEffect)(O,k);let A,j;t[17]===d?(A=t[18],j=t[19]):(A=()=>{b.current=d;let e=p.current;e&&At(e,d)},j=[d],t[17]=d,t[18]=A,t[19]=j),(0,Q.useEffect)(A,j);let M,N;t[20]===r?(M=t[21],N=t[22]):(M=()=>{},N=[r],t[20]=r,t[21]=M,t[22]=N),(0,Q.useEffect)(M,N);let F,L;t[23]===g?(F=t[24],L=t[25]):(L=()=>{let e=D.current;e&&e.view.dispatch({effects:e.themeCompartment.reconfigure(g===`dark`?me:ge)})},F=[g],t[23]=g,t[24]=F,t[25]=L),(0,Q.useEffect)(L,F);let R,z;t[26]===x?(R=t[27],z=t[28]):(R=()=>{let e=D.current;e&&e.view.dispatch({effects:e.wordWrapCompartment.reconfigure(x?I.lineWrapping:[])})},z=[x],t[26]=x,t[27]=R,t[28]=z),(0,Q.useEffect)(R,z);let B,V;t[29]===l?(B=t[30],V=t[31]):(B=()=>{let e=D.current;e&&e.view.dispatch({effects:e.placeholderCompartment.reconfigure(be(l??``))})},V=[l],t[29]=l,t[30]=B,t[31]=V),(0,Q.useEffect)(B,V);let H;t[32]!==r||t[33]!==w?(H=()=>{let e=D.current;e&&e.view.dispatch({effects:e.lintCompartment.reconfigure(it(w,r))})},t[32]=r,t[33]=w,t[34]=H):H=t[34];let U;t[35]===E?U=t[36]:(U=[E],t[35]=E,t[36]=U),(0,Q.useEffect)(H,U);let W,G;t[37]!==r||t[38]!==d?(W=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==r||t.mode!==`source`||!d)return;let n=p.current;if(!n){_e(pe,{docName:r,mode:`source`,index:t.index,outcome:`no-view`});return}Pt(n,t,r),re(r)};return window.addEventListener(ce,e),()=>window.removeEventListener(ce,e)},G=[r,d],t[37]=r,t[38]=d,t[39]=W,t[40]=G):(W=t[39],G=t[40]),(0,Q.useEffect)(W,G);let K,J;t[41]!==r||t[42]!==d?(K=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==r||!d)return;let n=p.current;n&&It(n,t,r)&&re(r)};return window.addEventListener(le,e),()=>window.removeEventListener(le,e)},J=[r,d],t[41]=r,t[42]=d,t[43]=K,t[44]=J):(K=t[43],J=t[44]),(0,Q.useEffect)(K,J);let Y,X;t[45]!==r||t[46]!==d||t[47]!==c?(Y=()=>{if(!d)return;let e=p.current;if(!e)return;let t=oe(r);if(!t)return;if(t.kind!==`selection-offset`){ie(r),t.kind===`outline`?Pt(e,t.detail,r):t.kind===`lint`?It(e,t.detail,r):t.kind===`raw-mdx`&&Ft(e,t.detail,()=>b.current,r);return}let n=!1,i=null;return queueMicrotask(()=>{if(n)return;let t=oe(r);t?.kind===`selection-offset`&&(i=ae({view:e,docName:r,navigation:t,ydoc:c.document,transition:{from:`wysiwyg`,to:`source`}}),i&&ie(r))}),()=>{n=!0,i?.cancel(`mode-flip`)}},X=[r,d,c],t[45]=r,t[46]=d,t[47]=c,t[48]=Y,t[49]=X):(Y=t[48],X=t[49]),(0,Q.useEffect)(Y,X);let Z;return t[50]===Symbol.for(`react.memo_cache_sentinel`)?(Z=(0,jt.jsx)(`div`,{ref:f,className:`source-editor h-full pb-3`}),t[50]=Z):Z=t[50],Z}function Rt(){return{top:O()}}function zt(){return D()}export{Lt as SourceEditor,Ft as applyRawMdxNavigation};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Lt as n,Nn as r,On as i,U as a,_n as o,bt as s,lt as c,mt as l,nn as u,rn as d,st as f,ut as p,yn as m,yt as h,zt as ee}from"./DocumentContext-DS_dUWBr.js";import{t as g}from"./react-f2sANaYj.js";import{n as _}from"./dist-PQ5KMVDh.js";import{t as v}from"./compiler-runtime-BfE3aGVn.js";import{O as y,gs as b,js as x,ta as te,ui as S,xs as C}from"./dist-CGNkoXKB.js";import{i as ne}from"./use-apply-config-theme-DpLdjUDN.js";import{E as w,F as re,I as ie,M as ae,O as T,R as oe,V as se,d as ce,g as le,i as ue,m as E,r as de,t as fe,u as pe}from"./typing-burst-detector-BIDnBCHc.js";import{P as D,S as O,Y as k,Z as A,a as me,i as he,o as ge}from"./CodeMirrorPropInput-DyT36_0H.js";import{a as j,s as _e}from"./startup-marks-D0gyAKgY.js";import{g as ve}from"./config-provider-Ck1DNDm7.js";import{$ as M,At as N,Ct as P,E as F,J as I,K as L,Mt as R,N as z,Nt as B,Tt as ye,X as V,at as H,b as U,et as W,ft as be,g as G,l as K,lt as q,ot as J,pt as Y,st as X,tt as Z,ut as xe,v as Se,wt as Ce}from"./dist-DlsJ2gMP.js";import{i as we,t as Te}from"./dist-Baby7q1O.js";import{i as Ee,n as De,o as Oe,r as ke}from"./dist-CQP6rPA_.js";import{o as Ae,r as je}from"./selection-context-VgoGxndZ.js";import{l as Me}from"./lint-config-client-D2qMETc6.js";import{a as Ne,i as Pe,n as Fe,o as Ie,r as Le,s as Re,t as ze}from"./dist-zWrmTYco2.js";import{n as Be,t as Ve}from"./src-_s2f2_6g.js";var Q=e(g(),1),He=v();function Ue(){let e=h();return e===null?null:new Set(e.keys())}function We(e,t,n){let r=[],i=z(e);if(n!=null){let a=[];for(let{from:e,to:n}of t)i.iterate({from:e,to:n,enter(e){if(e.name===`InlineCode`||e.name===`FencedCode`)return a.push({from:e.from,to:e.to}),!1}});let o=(e,t)=>a.some(n=>e>=n.from&&t<=n.to);for(let{from:i,to:a}of t){let t=e.doc.sliceString(i,a);C.lastIndex=0;for(let e=C.exec(t);e!==null;e=C.exec(t)){let t=e[2];if(!x(t))continue;let a=i+(e.index??0)+e[1].length,s=a+t.length+1;o(a,s)||r.push(L.mark({class:n.has(t)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":t}}).range(a,s))}}}for(let{from:a,to:o}of t)i.iterate({from:a,to:o,enter(t){if(t.name!==`InlineCode`)return;let i=e.doc.sliceString(t.from,t.to),a=i.length-i.replace(/^`+/,``).length,o=i.length-i.replace(/`+$/,``).length,s=i.slice(a,i.length-o),c=/^\/([a-z0-9][a-z0-9-]{1,63})$/.exec(s)?.[1];if(c!==void 0&&x(c)&&n!=null)return r.push(L.mark({class:n.has(c)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":c}}).range(t.from+a,t.to-o)),!1;let l=f.exec(s);if(l)return r.push(L.mark({class:`cm-skill-path-link`,attributes:{"data-skill-path":l[1]}}).range(t.from+a,t.to-o)),!1}});return r.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),L.set(r)}function Ge(e){let t=p(e);return t===null?[]:[V.fromClass(class{decorations;constructor(e){this.decorations=We(e.state,e.visibleRanges,Ue())}update(e){(e.docChanged||e.viewportChanged||z(e.startState)!==z(e.state))&&(this.decorations=We(e.view.state,e.view.visibleRanges,Ue()))}},{decorations:e=>e.decorations}),I.domEventHandlers({mousedown(n){let r=n.target?.closest?.(`[data-skill-ref]`),i=r instanceof HTMLElement?r.dataset.skillRef:void 0;if(i!==void 0){n.preventDefault();let e=h()?.get(i);return e===void 0?l():window.location.hash=s(i,e),!0}let a=n.target?.closest?.(`.cm-skill-path-link`),o=a instanceof HTMLElement?a.dataset.skillPath:void 0;return o===void 0?!1:(n.preventDefault(),window.location.hash=c(t,e,o),!0)}})]}var Ke=L.line({attributes:{dir:`auto`}});function qe(e){let t=new N;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,Ke),r=n.to+1}return t.finish()}var Je=V.fromClass(class{decorations;constructor(e){this.decorations=qe(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=qe(e.view))}},{decorations:e=>e.decorations}),Ye=[I.perLineTextDirection.of(!0),Je],Xe=new Set([`Link`,`Image`,`HTMLTag`,`HTMLBlock`]),Ze=`cm-lint-local-target`;function Qe(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 $e(e,t){let n=G(e,t+1,100);if(n){let e=n.resolveInner(t,1);for(;e;){if(Xe.has(e.name))return{from:e.from,to:e.to};e=e.parent}}return{from:t,to:t}}function et(e){return e===`error`?`error`:e===`info`?`info`:`warning`}function tt(e,t){let n=e.doc,r=[];for(let i of t){if(i.source!==`links`)continue;let t=$e(e,Qe(n,i.range.start));r.push({from:t.from,to:Math.max(t.to,t.from),severity:et(i.severity),message:T(i),source:`${i.source}/${i.code}`,markClass:Ze})}return r}var nt=R.define();function rt(e){let t={findings:[]};return[Pe(e=>k()?tt(e.state,t.findings):[],{delay:300,needsRefresh:e=>e.transactions.some(e=>e.effects.some(e=>e.is(nt)))}),V.define(n=>{let r=e=>{t.findings=e,n.dispatch({effects:nt.of(null)}),ze(n)},i=w(e,e=>{e.status===`loaded`&&r(e.findings)}),a=A(()=>r(t.findings));return{destroy(){i(),a()}}})]}function it(e,t){return e.enabled?[Fe(),Pe(async n=>at(n.state.doc,await S(n.state.doc.toString(),e,t)),{delay:600})]:[]}function $(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 at(e,t){let n=[];for(let r of t){let t=$(e,r.range.start),i=$(e,r.range.end),a={from:t,to:Math.max(i,t),severity:r.severity,message:r.message,source:`${r.source}/${r.code}`},o=ot(r);o&&(a.actions=[o]),n.push(a)}return n}function ot(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:$(n,e.range.start),to:$(n,e.range.end),insert:e.newText})),userEvent:`input.complete`})}}}var st=[xe(),J(),X(),Se(),W(),Z(),ye.allowMultipleSelections.of(!0),F(),K(),ke(),De(),Y(),M(),H(),Ne(),q.of([...Ee,...Te,...Re,...U,...Oe,...Le])],ct=L.mark({class:`cm-link-ref-broken`}),lt=/^\s{0,3}\[([^\]]+)\]:\s/,ut=/\[([^\]]*)\]\[([^\]]*)\]/g,dt=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function ft(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 pt(e){let t=[];return z(e).iterate({enter(e){if(dt.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function mt(e){let t=new Set,n=[],r=e.doc,i=pt(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if(ft(n.from,i))continue;let a=lt.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!ft(t.from,i)&&!lt.test(t.text))for(ut.lastIndex=0;;){let e=ut.exec(t.text);if(!e)break;let r=t.from+e.index;if(ft(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(ct.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),L.set(a)}var ht=B.define({create(e){return mt(e)},update(e,t){return t.docChanged?mt(t.state):e},provide:e=>I.decorations.from(e)}),gt=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,_t=L.mark({class:`cm-del`}),vt=L.line({class:`cm-table-header`,attributes:{style:`--list-hang: 2ch`}}),yt=L.line({class:`cm-table-row`,attributes:{style:`--list-hang: 2ch`}});function bt(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function xt(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 St(e,t){let n=[],r=z(e),i=xt(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(_t.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=gt.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=bt(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(vt.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(yt.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(yt.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),L.set(n)}var Ct=class{decorations;constructor(e){this.decorations=St(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||z(e.startState)!==z(e.state))&&(this.decorations=St(e.view.state,e.view.visibleRanges))}},wt=V.fromClass(Ct,{decorations:e=>e.decorations});function Tt(){return[wt,ht]}function Et(e,t){let n=e.trackedOrigins;return n.has(t)?!0:t?n.has(t.constructor):!1}function Dt(e){let{docName:t,ytext:n,undoManager:r}=e,i=!1,a=!1,o=!1,s=(e,t)=>{i||Et(r,t.origin)||(a=!0)};return n.observe(s),{setSourceModeActive(e){if(!o&&e!==i){if(!e){i=!1,r.stopCapturing();return}a&&(r.clear(),j(`ok/source-undo/flip-clear`,{docName:t})),a=!1,i=!0}},destroy(){o||(o=!0,n.unobserve(s))}}}var Ot=new WeakMap;function kt(e){return V.define(t=>{let n=Dt(e);return Ot.set(t,n),{destroy(){n.destroy()}}})}function At(e,t){let n=Ot.get(e);if(!n)throw Error(`createSourceUndoFlipExtension is not installed on this EditorView`);n.setSourceModeActive(t)}var jt=t(),Mt=R.define();function Nt(e,t){try{At(t.view,!1)}finally{try{d(t)}finally{m(e,t.view)}}}function Pt(e,t,n){let i=E(e.state.doc),a=i[t.index],o={docName:n,mode:`source`,index:t.index,sourceHeadingCount:i.length};if(!a){_e(pe,{...o,outcome:`no-target`});return}let s=r(n,`outline`,()=>{e.dispatch({selection:Ce.cursor(a.from),effects:I.scrollIntoView(a.from,{y:`start`})}),e.focus()});_e(pe,{...o,outcome:s?`scrolled`:`declined`,targetLine:e.state.doc.lineAt(a.from).number})}function Ft(e,t,n,i){requestAnimationFrame(()=>{if(!n())return;let a=e.state.doc,o=Math.min(t.offset,a.length);r(i,`raw-mdx`,()=>{e.dispatch({selection:Ce.cursor(o),effects:I.scrollIntoView(o,{y:`center`})}),e.focus()})})}function It(e,t,n){let i=e.state.doc,a=Math.min(Math.max(t.line,1),i.lines),o=i.line(a),s=Math.min(o.from+Math.max(0,t.column-1),o.to);return r(n,`problems-row`,()=>{e.dispatch({selection:Ce.cursor(s),effects:I.scrollIntoView(s,{y:`start`})}),e.focus()})}function Lt(e){let t=(0,He.c)(51),{docName:r,ytext:s,provider:c,placeholder:l,isSourceModeActive:d}=e,f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),[m,h]=(0,Q.useState)(null);if(m)throw m;let{resolvedTheme:g}=_(),{merged:v}=ne(),b=(0,Q.useRef)(d),x=v?.editor?.wordWrap??!0,{data:S}=Me(r),C;t[0]!==S?.effective||t[1]!==v?(C=S?.effective??(v?.contentRules?te(v.contentRules):y),t[0]=S?.effective,t[1]=v,t[2]=C):C=t[2];let w=C,T;t[3]===w?T=t[4]:(T=JSON.stringify(w),t[3]=w,t[4]=T);let E=T,D=(0,Q.useRef)(null),O;t[5]!==r||t[6]!==d||t[7]!==w||t[8]!==l||t[9]!==c||t[10]!==g||t[11]!==x||t[12]!==s?(O=()=>{let e=f.current;if(!e)return;let t=c.configuration.name??``,m,_=zt;try{m=u({docName:t,container:e,sizeStats:{viewCount:0,bytes:s.length},factory:e=>{let o=null,u=new ve(s);try{let d=a({ydoc:c.document,ytext:s,docName:t}),f=new P,p=new P,m=new P,h=new P,v=new I({state:ye.create({doc:s.toString(),extensions:[st,Ye,Ie({scrollToMatch:e=>i(t,`find-match`)?I.scrollIntoView(e,{y:`start`}):Mt.of(null)}),q.of([we]),Ve(s,c.awareness,{undoManager:u}),q.of(Be),kt({docName:t,ytext:s,undoManager:u}),...he({themeCompartment:f,resolvedTheme:g,ydoc:c.document,wordWrapCompartment:p,wordWrap:x,currentDocName:t}),Tt(),Ge(t),se(),h.of(it(w,r)),rt(r),d,I.updateListener.of(e=>{n(e)&&ee(t)}),I.updateListener.of(e=>{!e.selectionSet&&!e.docChanged||(o!==null&&clearTimeout(o),o=setTimeout(()=>{o=null,de(t,`source`,ue(e.view)),je(t,`source`,Ae(e.view,t))},120))}),m.of(be(l??``)),I.theme({"&":{height:`100%`}}),I.scrollMargins.of(Rt)]}),parent:e});de(t,`source`,ue(v)),je(t,`source`,Ae(v,t));let y=v.contentDOM;return y.addEventListener(`keydown`,_),y.addEventListener(`paste`,_),y.addEventListener(`drop`,_),y.addEventListener(`cut`,_),{view:v,ydoc:c.document,ytext:s,provider:c,undoManager:u,themeCompartment:f,wordWrapCompartment:p,placeholderCompartment:m,lintCompartment:h}}catch(e){let t=e;throw u.destroy(),t}}}),D.current=m,p.current=m.view,At(m.view,d),o(r,m.view),fe()&&m.view.focus()}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),D.current=null,p.current=null,h(t instanceof Error?t:Error(String(t)))}return()=>{let e=D.current;D.current=null,p.current=null,e&&Nt(r,e)}},t[5]=r,t[6]=d,t[7]=w,t[8]=l,t[9]=c,t[10]=g,t[11]=x,t[12]=s,t[13]=O):O=t[13];let k;t[14]!==c||t[15]!==s?(k=[s,c],t[14]=c,t[15]=s,t[16]=k):k=t[16],(0,Q.useEffect)(O,k);let A,j;t[17]===d?(A=t[18],j=t[19]):(A=()=>{b.current=d;let e=p.current;e&&At(e,d)},j=[d],t[17]=d,t[18]=A,t[19]=j),(0,Q.useEffect)(A,j);let M,N;t[20]===r?(M=t[21],N=t[22]):(M=()=>{},N=[r],t[20]=r,t[21]=M,t[22]=N),(0,Q.useEffect)(M,N);let F,L;t[23]===g?(F=t[24],L=t[25]):(L=()=>{let e=D.current;e&&e.view.dispatch({effects:e.themeCompartment.reconfigure(g===`dark`?me:ge)})},F=[g],t[23]=g,t[24]=F,t[25]=L),(0,Q.useEffect)(L,F);let R,z;t[26]===x?(R=t[27],z=t[28]):(R=()=>{let e=D.current;e&&e.view.dispatch({effects:e.wordWrapCompartment.reconfigure(x?I.lineWrapping:[])})},z=[x],t[26]=x,t[27]=R,t[28]=z),(0,Q.useEffect)(R,z);let B,V;t[29]===l?(B=t[30],V=t[31]):(B=()=>{let e=D.current;e&&e.view.dispatch({effects:e.placeholderCompartment.reconfigure(be(l??``))})},V=[l],t[29]=l,t[30]=B,t[31]=V),(0,Q.useEffect)(B,V);let H;t[32]!==r||t[33]!==w?(H=()=>{let e=D.current;e&&e.view.dispatch({effects:e.lintCompartment.reconfigure(it(w,r))})},t[32]=r,t[33]=w,t[34]=H):H=t[34];let U;t[35]===E?U=t[36]:(U=[E],t[35]=E,t[36]=U),(0,Q.useEffect)(H,U);let W,G;t[37]!==r||t[38]!==d?(W=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==r||t.mode!==`source`||!d)return;let n=p.current;if(!n){_e(pe,{docName:r,mode:`source`,index:t.index,outcome:`no-view`});return}Pt(n,t,r),re(r)};return window.addEventListener(ce,e),()=>window.removeEventListener(ce,e)},G=[r,d],t[37]=r,t[38]=d,t[39]=W,t[40]=G):(W=t[39],G=t[40]),(0,Q.useEffect)(W,G);let K,J;t[41]!==r||t[42]!==d?(K=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==r||!d)return;let n=p.current;n&&It(n,t,r)&&re(r)};return window.addEventListener(le,e),()=>window.removeEventListener(le,e)},J=[r,d],t[41]=r,t[42]=d,t[43]=K,t[44]=J):(K=t[43],J=t[44]),(0,Q.useEffect)(K,J);let Y,X;t[45]!==r||t[46]!==d||t[47]!==c?(Y=()=>{if(!d)return;let e=p.current;if(!e)return;let t=oe(r);if(!t)return;if(t.kind!==`selection-offset`){ie(r),t.kind===`outline`?Pt(e,t.detail,r):t.kind===`lint`?It(e,t.detail,r):t.kind===`raw-mdx`&&Ft(e,t.detail,()=>b.current,r);return}let n=!1,i=null;return queueMicrotask(()=>{if(n)return;let t=oe(r);t?.kind===`selection-offset`&&(i=ae({view:e,docName:r,navigation:t,ydoc:c.document,transition:{from:`wysiwyg`,to:`source`}}),i&&ie(r))}),()=>{n=!0,i?.cancel(`mode-flip`)}},X=[r,d,c],t[45]=r,t[46]=d,t[47]=c,t[48]=Y,t[49]=X):(Y=t[48],X=t[49]),(0,Q.useEffect)(Y,X);let Z;return t[50]===Symbol.for(`react.memo_cache_sentinel`)?(Z=(0,jt.jsx)(`div`,{ref:f,className:`source-editor h-full pb-3`}),t[50]=Z):Z=t[50],Z}function Rt(){return{top:O()}}function zt(){return D()}export{Lt as SourceEditor,Ft 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-Cym3gapE.js";import{$s as c,ac as l,cc as u,ic as d,lc as f,oc as p,uc as m}from"./dist-CGNkoXKB.js";import{n as h}from"./dist-CJhtNlOm2.js";import{r as g}from"./use-apply-config-theme-DpLdjUDN.js";import{t as _}from"./x-CnGRb1ER.js";import{l as v,s as y,u as b}from"./doc-hash-CH3Kq7TA.js";import{n as ee}from"./page-list-cache-DoLH1XoG.js";import{f as te,h as x}from"./file-tree-adapter-Co9sJppq.js";import{t as ne}from"./use-live-xterm-theme-BgQOsQLk.js";import{i as S,r as re}from"./terminal-command-events-CloL_dun.js";import{t as C}from"./TerminalStartingNotice-CTgu71yV.js";var ie=a(),w=2,T=1,ae=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(w,Math.floor(u/e.css.cell.width)),rows:Math.max(T,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 k(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 oe=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]:k(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=it.extractWidth(t);e===0?r=!1:e>n&&(n=e)}return it.createPropertyValue(0,n,r)}},se=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?fe.isErrorNoTelemetry(e)?new fe(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-Cym3gapE.js";import{$s as c,ac as l,cc as u,ic as d,lc as f,oc as p,uc as m}from"./dist-CGNkoXKB.js";import{n as h}from"./dist-CJhtNlOm2.js";import{r as g}from"./use-apply-config-theme-DpLdjUDN.js";import{t as _}from"./x-CnGRb1ER.js";import{l as v,s as y,u as b}from"./doc-hash-CH3Kq7TA.js";import{n as ee}from"./page-list-cache-DoLH1XoG.js";import{f as te,h as x}from"./file-tree-adapter-VUzkO2kv.js";import{t as ne}from"./use-live-xterm-theme-BgQOsQLk.js";import{i as S,r as re}from"./terminal-command-events-CloL_dun.js";import{t as C}from"./TerminalStartingNotice-CTgu71yV.js";var ie=a(),w=2,T=1,ae=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(w,Math.floor(u/e.css.cell.width)),rows:Math.max(T,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 k(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 oe=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]:k(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=it.extractWidth(t);e===0?r=!1:e>n&&(n=e)}return it.createPropertyValue(0,n,r)}},se=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?fe.isErrorNoTelemetry(e)?new fe(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{n as a,t as o}from"./ReportBugMenuTrigger-Ilx23iFu.js";import{t as s}from"./config-provider-DlzcUiYU.js";import{t as c}from"./use-live-xterm-theme-BgQOsQLk.js";import{SessionsHost as l}from"./SessionsHost-CqTpS39k.js";var u=i(),d=e(n(),1),f=t();function p(e){let t=(0,u.c)(8),{bridge:n}=e,r=n.config.collabUrl?n.config.collabUrl:null,i;t[0]===n?i=t[1]:(i=(0,f.jsx)(m,{bridge:n}),t[0]=n,t[1]=i);let a=r===null,c;t[2]===a?c=t[3]:(c=(0,f.jsx)(o,{systemWide:a}),t[2]=a,t[3]=c);let l;return t[4]!==r||t[5]!==i||t[6]!==c?(l=(0,f.jsxs)(s,{collabUrl:r,children:[i,c]}),t[4]=r,t[5]=i,t[6]=c,t[7]=l):l=t[7],l}function m(e){let t=(0,u.c)(9),{bridge:n}=e,{resolvedTheme:i}=r(),o=c(i),s=a(),[p,m]=(0,d.useState)(null),_;t[0]===o.background?_=t[1]:(_=(0,f.jsx)(`div`,{ref:m,className:`flex h-screen min-h-0 flex-col`,style:{backgroundColor:o.background}}),t[0]=o.background,t[1]=_);let v;t[2]!==n||t[3]!==p||t[4]!==s?(v=(0,f.jsx)(l,{bridge:n,surface:`terminal-window`,terminalCapable:!0,visible:!0,onVisibleChange:g,installedClis:s,container:p,isShowing:!0,onRequestEditorFocus:h}),t[2]=n,t[3]=p,t[4]=s,t[5]=v):v=t[5];let y;return t[6]!==_||t[7]!==v?(y=(0,f.jsxs)(f.Fragment,{children:[_,v]}),t[6]=_,t[7]=v,t[8]=y):y=t[8],y}function h(){}function g(e){e||window.close()}export{p 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{n as a,t as o}from"./ReportBugMenuTrigger-UUESg7vh.js";import{t as s}from"./config-provider-Ck1DNDm7.js";import{t as c}from"./use-live-xterm-theme-BgQOsQLk.js";import{SessionsHost as l}from"./SessionsHost-Df5IVb6O.js";var u=i(),d=e(n(),1),f=t();function p(e){let t=(0,u.c)(8),{bridge:n}=e,r=n.config.collabUrl?n.config.collabUrl:null,i;t[0]===n?i=t[1]:(i=(0,f.jsx)(m,{bridge:n}),t[0]=n,t[1]=i);let a=r===null,c;t[2]===a?c=t[3]:(c=(0,f.jsx)(o,{systemWide:a}),t[2]=a,t[3]=c);let l;return t[4]!==r||t[5]!==i||t[6]!==c?(l=(0,f.jsxs)(s,{collabUrl:r,children:[i,c]}),t[4]=r,t[5]=i,t[6]=c,t[7]=l):l=t[7],l}function m(e){let t=(0,u.c)(9),{bridge:n}=e,{resolvedTheme:i}=r(),o=c(i),s=a(),[p,m]=(0,d.useState)(null),_;t[0]===o.background?_=t[1]:(_=(0,f.jsx)(`div`,{ref:m,className:`flex h-screen min-h-0 flex-col`,style:{backgroundColor:o.background}}),t[0]=o.background,t[1]=_);let v;t[2]!==n||t[3]!==p||t[4]!==s?(v=(0,f.jsx)(l,{bridge:n,surface:`terminal-window`,terminalCapable:!0,visible:!0,onVisibleChange:g,installedClis:s,container:p,isShowing:!0,onRequestEditorFocus:h}),t[2]=n,t[3]=p,t[4]=s,t[5]=v):v=t[5];let y;return t[6]!==_||t[7]!==v?(y=(0,f.jsxs)(f.Fragment,{children:[_,v]}),t[6]=_,t[7]=v,t[8]=y):y=t[8],y}function h(){}function g(e){e||window.close()}export{p 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{Io as o,hr as s,wo as c}from"./dist-CGNkoXKB.js";import{n as l}from"./CodeMirrorPropInput-CvenaDDl.js";import{Ct as u,J as d,M as f,Tt as p}from"./dist-DlsJ2gMP.js";import{t as m}from"./cm-theme-Cr3L_kQp.js";import{t as h}from"./dist-yFrmqHNO2.js";import{t as g}from"./text-viewer-languages-C-SOVufZ.js";import{t as _}from"./src-BuzwpJZ-.js";import{t as v}from"./doc-undo-manager-B2S3p7Kh.js";var y=a(),b=e(n(),1),x=t(),S=m({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),C=m({dark:!1,background:`var(--background)`,gutterBackground:`var(--muted)`});function w(e){let t=(0,y.c)(18),{docName:n,provider:a}=e,{_:m}=r(),w=n.slice(n.lastIndexOf(`/`)+1),T=(0,b.useRef)(null),{resolvedTheme:E}=i(),D,O;t[0]===a?(D=t[1],O=t[2]):(O=a.document.getText(`source`),D=v(a,O),t[0]=a,t[1]=D,t[2]=O);let k=D,A;t[3]!==n||t[4]!==a.awareness||t[5]!==E||t[6]!==k||t[7]!==O?(A=()=>{let e=T.current;if(!e)return;let t=E===`dark`?S:C,r=new u,i=new u,m=(c[s(n)]??o(s(n)))!==null&&s(n)!==``,v=new d({state:p.create({doc:O.toString(),extensions:[h,_(O,a.awareness,{undoManager:k}),r.of([]),f(l),i.of(m?[]:d.lineWrapping),d.theme({"&":{height:`100%`}}),t]}),parent:e}),y=!1,b=s(n)||null;return b&&g(b,c[b]??o(b)).then(e=>{y||!e||v.dispatch({effects:r.reconfigure(e)})}),()=>{y=!0,v.destroy()}},t[3]=n,t[4]=a.awareness,t[5]=E,t[6]=k,t[7]=O,t[8]=A):A=t[8];let j;t[9]!==n||t[10]!==a||t[11]!==E||t[12]!==k||t[13]!==O?(j=[O,a,E,n,k],t[9]=n,t[10]=a,t[11]=E,t[12]=k,t[13]=O,t[14]=j):j=t[14],(0,b.useEffect)(A,j);let M=m({id:`xAlHfe`,values:{basename:w}}),N;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,x.jsx)(`div`,{ref:T,className:`min-h-0 flex-1 overflow-auto`}),t[15]=N):N=t[15];let P;return t[16]===M?P=t[17]:(P=(0,x.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":M,"data-text-doc-editor":``,children:N}),t[16]=M,t[17]=P),P}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{Io as o,hr as s,wo as c}from"./dist-CGNkoXKB.js";import{n as l}from"./CodeMirrorPropInput-DyT36_0H.js";import{Ct as u,J as d,M as f,Tt as p}from"./dist-DlsJ2gMP.js";import{t as m}from"./cm-theme-Cr3L_kQp.js";import{t as h}from"./dist-D_m2fuwc2.js";import{t as g}from"./text-viewer-languages-CSz-0bs7.js";import{t as _}from"./src-_s2f2_6g.js";import{t as v}from"./doc-undo-manager-VvINx_vq.js";var y=a(),b=e(n(),1),x=t(),S=m({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),C=m({dark:!1,background:`var(--background)`,gutterBackground:`var(--muted)`});function w(e){let t=(0,y.c)(18),{docName:n,provider:a}=e,{_:m}=r(),w=n.slice(n.lastIndexOf(`/`)+1),T=(0,b.useRef)(null),{resolvedTheme:E}=i(),D,O;t[0]===a?(D=t[1],O=t[2]):(O=a.document.getText(`source`),D=v(a,O),t[0]=a,t[1]=D,t[2]=O);let k=D,A;t[3]!==n||t[4]!==a.awareness||t[5]!==E||t[6]!==k||t[7]!==O?(A=()=>{let e=T.current;if(!e)return;let t=E===`dark`?S:C,r=new u,i=new u,m=(c[s(n)]??o(s(n)))!==null&&s(n)!==``,v=new d({state:p.create({doc:O.toString(),extensions:[h,_(O,a.awareness,{undoManager:k}),r.of([]),f(l),i.of(m?[]:d.lineWrapping),d.theme({"&":{height:`100%`}}),t]}),parent:e}),y=!1,b=s(n)||null;return b&&g(b,c[b]??o(b)).then(e=>{y||!e||v.dispatch({effects:r.reconfigure(e)})}),()=>{y=!0,v.destroy()}},t[3]=n,t[4]=a.awareness,t[5]=E,t[6]=k,t[7]=O,t[8]=A):A=t[8];let j;t[9]!==n||t[10]!==a||t[11]!==E||t[12]!==k||t[13]!==O?(j=[O,a,E,n,k],t[9]=n,t[10]=a,t[11]=E,t[12]=k,t[13]=O,t[14]=j):j=t[14],(0,b.useEffect)(A,j);let M=m({id:`xAlHfe`,values:{basename:w}}),N;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,x.jsx)(`div`,{ref:T,className:`min-h-0 flex-1 overflow-auto`}),t[15]=N):N=t[15];let P;return t[16]===M?P=t[17]:(P=(0,x.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":M,"data-text-doc-editor":``,children:N}),t[16]=M,t[17]=P),P}export{w as TextDocEditor};