@inkeep/open-knowledge 0.68.8 → 0.68.11-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acp-harness-probe-moJTQgK2.mjs → acp-harness-probe-DaYXqGxg.mjs} +2 -2
- package/dist/cli.mjs +29 -29
- package/dist/config-schema.json +1 -1
- package/dist/config.project-local.schema.json +1 -1
- package/dist/constants-jyYwGmDC.mjs +2 -0
- package/dist/{fs-traced-C8gNIaHq.mjs → fs-traced-DgX7lP1u.mjs} +2 -2
- package/dist/fs-traced-Q0dJJRAw.mjs +1 -0
- package/dist/{git-handle-C9RU-MxT.mjs → git-handle-C0onz3KH.mjs} +2 -2
- package/dist/git-handle-GcGVb-Kt.mjs +1 -0
- package/dist/index.mjs +14 -14
- package/dist/init-CBEFRP85.mjs +1 -0
- package/dist/{init-Ba4MR5c4.mjs → init-_7R63fwz.mjs} +34 -34
- package/dist/{launch-json-removal-COTaVRNm.mjs → launch-json-removal-B28FsoE2.mjs} +2 -2
- package/dist/loader-Bz5cS92c.mjs +1 -0
- package/dist/{loader-D7rKGq0a.mjs → loader-C4UW1MW5.mjs} +2 -2
- package/dist/md-manager--OJ_B4tb.mjs +2 -0
- package/dist/{open-browser-CDpmQINA.mjs → open-browser-H-QKQd10.mjs} +2 -2
- package/dist/parse-worker.mjs +1 -1
- package/dist/preview-26pLGThq.mjs +1 -0
- package/dist/{preview-8z2Ze4V5.mjs → preview-DKtYHQbM.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-Co1JyqXQ.js → ActivityModeContent-C9Z839EN.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-b5lnEVKK.js → AddPropertiesButton-DSQKtGW9.js} +2 -2
- package/dist/public/assets/{AgentDiffPane-DSyEDn_Y.js → AgentDiffPane-Cu3m0Lib.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-g9d9BU09.js → AgentThreadClientBinder-D1mSPUsr.js} +1 -1
- package/dist/public/assets/{BugReportHistory-BYU251NU.js → BugReportHistory-C2-fO6T3.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-wi8j2imF.js → BugReportHistoryDialog-BO92hFGg.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-2n_88FNl.js → CodeMirrorPropInput-CRa8tGX-.js} +1 -1
- package/dist/public/assets/{ConsentDialogBody-D2QQqLvP.js → ConsentDialogBody-Bu8u9p1a.js} +2 -2
- package/dist/public/assets/{DiffViewBoundary-BIjXbCNm.js → DiffViewBoundary-BDQV_30P.js} +1 -1
- package/dist/public/assets/{DocumentContext-C1MDqUGQ.js → DocumentContext-BdZiErvh.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-PGfji8Z4.js → EditorModeToggle-DYldyVnC.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-D73cTIc2.js → EnableSyncConfirmDialog-N_l5NwWg.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-DLYL4uLQ.js → ExcalidrawDocEditor-CFg6aGVN.js} +1 -1
- package/dist/public/assets/FeedbackForm-CnwouVSg.js +1 -0
- package/dist/public/assets/{GraphPanel-DODcHiM6.js → GraphPanel-r8Gqxdvr.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-SFJoXCHy.js → ImportSkillDialog-DOKtVFqO.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-cz4oBJkn.js → LintConfigEditor-SzAKIf-P.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-DVYEs_-t.js → ManagedArtifactProperties-8E5SQSnI.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-DyQXtUCs.js +1 -0
- package/dist/public/assets/{McpConsentDialogBody-CS-c374d.js → McpConsentDialogBody-D3q7WAev.js} +1 -1
- package/dist/public/assets/{Mermaid-mq736Zb_.js → Mermaid-Cw1EnMJu.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-BnbvkIUa.js → MermaidDocEditor-C-qlUZje.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-DoKlSeCY.js → PropertyDisplayRow-CBiQBnOL.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-Cn9kuPrd.js → ReportBugDialogBody-B4Ph81pw.js} +2 -2
- package/dist/public/assets/{ReportBugMenuTrigger-BWaaWbbQ.js → ReportBugMenuTrigger-D7aC0OiR.js} +2 -2
- package/dist/public/assets/{SchemaConfigEditor-BqXzeHB3.js → SchemaConfigEditor-DGBRJY7Q.js} +1 -1
- package/dist/public/assets/{SessionsHost-C1OZt5vc.js → SessionsHost-CrnQRViT.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-DQtkh-bL.js → SettingsDialogBody-DnEGrTMq.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog--N1Bd5qo.js → ShareBranchSwitchDialog-Cgkl3a5v.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-By6mslOj.js → ShareReceiveDialog-6TxrHOIU.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-DrHrN8Zh.js → ShareReceiveMissDialog-BCkm-E10.js} +1 -1
- package/dist/public/assets/{SkillCostValue-CkONMU96.js → SkillCostValue-BMSdP6MA.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-BkN4Vlyo.js → SkillEditBanner-D_nkf6Qd.js} +1 -1
- package/dist/public/assets/{SkillForkDialog-Bkhm9FwF.js → SkillForkDialog-Bhq9zhtY.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-DPBO7ZLl.js → SkillInstallMenu-D3KWfbhA.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-DqGgPWeD.js → SkillOriginInline-CaEMp81T.js} +2 -2
- package/dist/public/assets/{SkillToolbarControls-kSIovUXj.js → SkillToolbarControls-tpuUyOLu.js} +1 -1
- package/dist/public/assets/{SkillUpdateConflictDialog-AerOBYmk.js → SkillUpdateConflictDialog-Cbj5JNXp.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-CJSUDVcP.js → SlidesToolbarControls-DWqUzkgL.js} +1 -1
- package/dist/public/assets/{SourceEditor-DxcW7Ji4.js → SourceEditor-D_IY9GyQ.js} +1 -1
- package/dist/public/assets/{TerminalPanel-zXPIa6n_.js → TerminalPanel-MpZfhb9K.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-Cpr1PRtm.js → TerminalWindowApp-CwExuljm.js} +1 -1
- package/dist/public/assets/{TextDocEditor-CNvGi20m.js → TextDocEditor-DAcD7hS1.js} +1 -1
- package/dist/public/assets/{ThreadView-BdfdaWKJ.js → ThreadView-Dv-MJgLn.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-BIR2lWwH.js → TimelineDiffPane-G1nycx_c.js} +1 -1
- package/dist/public/assets/{agent-diff-store-_WIhmrnK.js → agent-diff-store-Bln_lxtD.js} +1 -1
- package/dist/public/assets/{alert-dialog-BFfs04J5.js → alert-dialog-DLAYZZMu.js} +2 -2
- package/dist/public/assets/{auth-state-cache-BCDkELSW.js → auth-state-cache-BLGrQ86G.js} +4 -4
- package/dist/public/assets/{bug-report-send-manager-BhNwFXTM.js → bug-report-send-manager-B4I-UPj9.js} +1 -1
- package/dist/public/assets/client-version-CXZnsz8b.js +1 -0
- package/dist/public/assets/{comment-chips-SxWcQbb_.js → comment-chips-Bm8WWDT7.js} +1 -1
- package/dist/public/assets/{config-provider-CFXUtiwu.js → config-provider-BvIhxk0G.js} +1 -1
- package/dist/public/assets/{dialog-CCHt-oLh.js → dialog-_kqu_91M.js} +1 -1
- package/dist/public/assets/{dist-CDr44_5B.js → dist-D6JA916i.js} +1 -1
- package/dist/public/assets/{doc-hash-CbPdvdAA.js → doc-hash-Dx9hwyex.js} +1 -1
- package/dist/public/assets/{documents-events-CRdjzLAr.js → documents-events-DR8HEJoe.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-Bg4PgS4F.js → file-tree-adapter-C4gKqxzg.js} +1 -1
- package/dist/public/assets/{file-tree-utils-Dt-qVN4W.js → file-tree-utils-DGw50SVS.js} +1 -1
- package/dist/public/assets/{folder-config-api-Do2u-Rpg.js → folder-config-api-D4N0ED0-.js} +1 -1
- package/dist/public/assets/{globals-ByagJMEb.css → globals-DeOHYo0q.css} +1 -1
- package/dist/public/assets/i18n-Bl2radzN.js +1 -0
- package/dist/public/assets/{index-DnjxrnEw.js → index-BLB78i4B.js} +9 -9
- package/dist/public/assets/{launcher-selection-BtAC_6OE.js → launcher-selection-BZDeoOtN.js} +1 -1
- package/dist/public/assets/{lint-config-client-C7Do4K-V.js → lint-config-client-DBF47lRL.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-BuLeocmZ.js → markdownlint-rule-browser-CF1tj7Rc.js} +1 -1
- package/dist/public/assets/{page-list-cache-VMIjzKn4.js → page-list-cache-DZPKVqeA.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-DWGtNmXZ.js → pending-receive-nav-store-BtQaH8Ow.js} +1 -1
- package/dist/public/assets/{progress-mhZcxRBo.js → progress-DKwbAv_d.js} +1 -1
- package/dist/public/assets/{project-paths-BhoLIJti.js → project-paths-BGMK3dxo.js} +1 -1
- package/dist/public/assets/{prop-types-CUmrzSW1.js → prop-types-gfjew8MI.js} +1 -1
- package/dist/public/assets/{receive-store-D2_q1wUu.js → receive-store-OL80o-sI.js} +1 -1
- package/dist/public/assets/{selection-context-EAVqhQEK.js → selection-context-BBTm-UVn.js} +1 -1
- package/dist/public/assets/{skill-scope-NCYHirwV.js → skill-scope-D9dg7q4P.js} +1 -1
- package/dist/public/assets/{skills-api-Dz_rVA1C.js → skills-api-BU5k9WYz.js} +1 -1
- package/dist/public/assets/{src-DuGGvfdD.js → src-BBEwVksN.js} +1 -1
- package/dist/public/assets/{startup-marks-BPR5ipj8.js → startup-marks-Ml5LD4ks.js} +1 -1
- package/dist/public/assets/{tag-pill-input-CYAsZCew.js → tag-pill-input-vfk8h50K.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-CYAnPRok.js → target-navigation-intent-Dpq3EXpz.js} +1 -1
- package/dist/public/assets/{telemetry-impl-Cx5oP3TZ.js → telemetry-impl-B_63zFxn.js} +1 -1
- package/dist/public/assets/{telemetry-startup-kezMCRHJ.js → telemetry-startup-BMrCBn-y.js} +1 -1
- package/dist/public/assets/{terminal-cli-display-jaULlk-O.js → terminal-cli-display-XU6hL6_q.js} +1 -1
- package/dist/public/assets/{terminal-command-events-D5gbDNfs.js → terminal-command-events-DBrAYz2u.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-Dc6Z0dV2.js → typing-burst-detector-D-RxXAZt.js} +1 -1
- package/dist/public/assets/{uninstall-DAcZS1HG.js → uninstall-C645M4Nr.js} +1 -1
- package/dist/public/assets/{use-activity-panel-C8rnLWCk.js → use-activity-panel-TaOc5fsr.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-C3t6RLOI.js → use-apply-config-color-theme-D-13D2Xt.js} +1 -1
- package/dist/public/assets/{use-collab-url-CUI36lWb.js → use-collab-url-CqeAlJNl.js} +1 -1
- package/dist/public/assets/{use-conflicts-CBdH6psn.js → use-conflicts-CXDbJNoF.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-mYE4hguI.js → use-live-xterm-theme-aXDStBRf.js} +1 -1
- package/dist/public/assets/{use-open-skill-1xuIk7AK.js → use-open-skill-BfikAHGm.js} +1 -1
- package/dist/public/assets/{use-settings-route-C_HC7gny.js → use-settings-route-WFqgyKMc.js} +1 -1
- package/dist/public/assets/{use-skill-origin-BKe9dbHW.js → use-skill-origin-M6b5sY_s.js} +1 -1
- package/dist/public/assets/{use-skills-BhaOexz2.js → use-skills-dKHpTH68.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-M2ci--Ho.js → use-terminal-enabled-f6uI67oZ.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-CIsFdF1_.js → use-timeline-entry-diff-DEsOnT79.js} +1 -1
- package/dist/public/assets/{use-workspace-BHq7gCE9.js → use-workspace-DAuqjfCS.js} +1 -1
- package/dist/public/index.html +54 -54
- package/dist/public/uninstall.html +5 -5
- package/dist/{repair-launch-json-CcgD5Q8I.mjs → repair-launch-json-O0pvONvJ.mjs} +2 -2
- package/dist/{repair-mcp-configs-CG-Wr3i4.mjs → repair-mcp-configs-BFtKKOXF.mjs} +2 -2
- package/dist/repair-skills-BkLHvKTk.mjs +1 -0
- package/dist/{repair-skills-BSimb6wa.mjs → repair-skills-zu7vM_05.mjs} +2 -2
- package/dist/{resolve-project-root-Bq-TBff8.mjs → resolve-project-root-dt8lYC9W.mjs} +3 -3
- package/dist/schemas/v0/config.project-local.schema.json +1 -1
- package/dist/server-lock-D-DD35fh.mjs +1 -0
- package/dist/{server-lock-CGm9uKLf.mjs → server-lock-DKS1ePB3.mjs} +2 -2
- package/dist/{skill-teardown-7aiCD98i.mjs → skill-teardown-DUZd_juy.mjs} +2 -2
- package/dist/{sleep-CFk6IVkN.mjs → sleep-zea4v2sB.mjs} +2 -2
- package/dist/{src-CIngi0dD.mjs → src-B2bAQ64a.mjs} +2 -2
- package/dist/src-CT7Wk-MG.mjs +1 -0
- package/dist/src-D5pqfubu.mjs +21 -0
- package/dist/src-e2udu2Rw.mjs +2045 -0
- package/dist/src-y6vbbp7M.mjs +1 -0
- package/dist/start-BoiJ1XmS.mjs +1 -0
- package/dist/start-DET7Qj8h.mjs +5 -0
- package/package.json +4 -4
- package/dist/constants-DObAsBjb.mjs +0 -2
- package/dist/fs-traced-CMCYO7L0.mjs +0 -1
- package/dist/git-handle-CzN6a5i1.mjs +0 -1
- package/dist/init-BIp5JihP.mjs +0 -1
- package/dist/loader-Qwm0-JSC.mjs +0 -1
- package/dist/md-manager-B0rABilg.mjs +0 -2
- package/dist/preview-uPU2tGKj.mjs +0 -1
- package/dist/public/assets/FeedbackForm-CeFv-wxn.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-D4in1i0d.js +0 -1
- package/dist/public/assets/client-version-DPdchc8q.js +0 -1
- package/dist/public/assets/i18n-CApFNCKM.js +0 -1
- package/dist/repair-skills-OE0auD8d.mjs +0 -1
- package/dist/server-lock-CHQfzAi7.mjs +0 -1
- package/dist/src-B2ESrG1g.mjs +0 -1
- package/dist/src-BLkJBxuv.mjs +0 -1
- package/dist/src-CQ0mDiOq.mjs +0 -21
- package/dist/src-xI8ra_S9.mjs +0 -2045
- package/dist/start-hJmkelSD.mjs +0 -5
- package/dist/start-ppMYmXMM.mjs +0 -1
- /package/dist/public/assets/{globals-DIT-uAXH.js → globals--7ibIAoz.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{tr as n}from"./DocumentContext-C1MDqUGQ.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-BFfs04J5.js";import{f as b}from"./RegisteredAgentIcon-5StNVeMK.js";import{Jt as x,Xt as S,hs as C,ii as w}from"./dist-CDr44_5B.js";import{n as T}from"./dist-CJhtNlOm2.js";import{c as E}from"./documents-events-CRdjzLAr.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-jaULlk-O.js";import{t as I}from"./createLucideIcon-BYL3gqKc.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-DYfdElMl.js";import{c as W}from"./use-open-skill-1xuIk7AK.js";import{t as te}from"./spinner-By93kIxm.js";import{i as ne,l as re,n as ie,r as G}from"./skill-scope-NCYHirwV.js";import{N as K,S as ae,j as q,x as oe}from"./skills-api-Dz_rVA1C.js";import{t as J}from"./use-skills-BhaOexz2.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(b.flatMap(e=>e.schemes))];function Be(e,t){let n=t.now?.()??Date.now(),r={};for(let t of b){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:C[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=x.options,wt=S.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,x,S,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,x=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?(S=(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]=S):S=t[42],w=x===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:x}),(()=>{let e=U(x).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`:C[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]=x,t[17]=S,t[18]=w,t[19]=D,t[20]=O}else g=t[11],_=t[12],v=t[13],y=t[14],b=t[15],x=t[16],S=t[17],w=t[18],D=t[19],O=t[20];let k;t[43]!==v||t[44]!==b.length||t[45]!==x?(k=b.length===0&&v.length===0&&x===null?(0,Y.jsx)(`div`,{className:`px-2 py-1.5 text-[11px] text-muted-foreground leading-snug`,"data-testid":`skill-install-no-destinations`,children:(0,Y.jsx)(i,{id:`MOAoFO`})}):null,t[43]=v,t[44]=b.length,t[45]=x,t[46]=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{tr as n}from"./DocumentContext-BdZiErvh.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-DLAYZZMu.js";import{f as b}from"./RegisteredAgentIcon-5StNVeMK.js";import{Jt as x,Xt as S,hs as C,ii as w}from"./dist-D6JA916i.js";import{n as T}from"./dist-CJhtNlOm2.js";import{c as E}from"./documents-events-DR8HEJoe.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-XU6hL6_q.js";import{t as I}from"./createLucideIcon-BYL3gqKc.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-DYfdElMl.js";import{c as W}from"./use-open-skill-BfikAHGm.js";import{t as te}from"./spinner-By93kIxm.js";import{i as ne,l as re,n as ie,r as G}from"./skill-scope-D9dg7q4P.js";import{N as K,S as ae,j as q,x as oe}from"./skills-api-BU5k9WYz.js";import{t as J}from"./use-skills-dKHpTH68.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(b.flatMap(e=>e.schemes))];function Be(e,t){let n=t.now?.()??Date.now(),r={};for(let t of b){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:C[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=x.options,wt=S.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,x,S,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,x=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?(S=(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]=S):S=t[42],w=x===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:x}),(()=>{let e=U(x).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`:C[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]=x,t[17]=S,t[18]=w,t[19]=D,t[20]=O}else g=t[11],_=t[12],v=t[13],y=t[14],b=t[15],x=t[16],S=t[17],w=t[18],D=t[19],O=t[20];let k;t[43]!==v||t[44]!==b.length||t[45]!==x?(k=b.length===0&&v.length===0&&x===null?(0,Y.jsx)(`div`,{className:`px-2 py-1.5 text-[11px] text-muted-foreground leading-snug`,"data-testid":`skill-install-no-destinations`,children:(0,Y.jsx)(i,{id:`MOAoFO`})}):null,t[43]=v,t[44]=b.length,t[45]=x,t[46]=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]!==S||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:[S,w,D,O,k,A,j,L]}),t[68]=L,t[69]=S,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`:C[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
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./SkillUpdateConflictDialog-
|
|
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-BaKj0sfV.js";import{t as p}from"./spinner-By93kIxm.js";import{t as m}from"./refresh-cw-BO3b6gLF.js";import{t as h}from"./undo-2-DXBUErQ5.js";import{t as g}from"./use-skill-origin-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./SkillUpdateConflictDialog-Cbj5JNXp.js","./dist-Nvb76hAm.js","./chunk-CYidjpOJ.js","./jsx-runtime-BUgB2tll.js","./react-f2sANaYj.js","./pierre-theme-CQAERd6x.js","./preload-helper-Chd9yIcd.js","./engine-compile-DQkU3NTo.js","./lib-DmueaA5E.js","./html-void-elements-zEl0KGqf.js","./ok-syntax-theme-COS26B1a.js","./MultiFileDiff-B2LBKfyB.js","./dialog-_kqu_91M.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-CAqepOgq.js","./createLucideIcon-BYL3gqKc.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-BaKj0sfV.js";import{t as p}from"./spinner-By93kIxm.js";import{t as m}from"./refresh-cw-BO3b6gLF.js";import{t as h}from"./undo-2-DXBUErQ5.js";import{t as g}from"./use-skill-origin-M6b5sY_s.js";var _=o(),v=e(r(),1),y=n(),b=(0,v.lazy)(async()=>({default:(await t(()=>import(`./SkillUpdateConflictDialog-Cbj5JNXp.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};
|
package/dist/public/assets/{SkillToolbarControls-kSIovUXj.js → SkillToolbarControls-tpuUyOLu.js}
RENAMED
|
@@ -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-
|
|
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-D3KWfbhA.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-BL1z9P70.js";import{l as g,n as _,r as v,t as y}from"./AddPropertiesButton-DSQKtGW9.js";import{a as b,m as x,r as S,t as C,u as w}from"./dropdown-menu-DYfdElMl.js";import{t as T}from"./list-plus-BXaFXlLg.js";import{p as E,t as D}from"./skill-scope-D9dg7q4P.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{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"./button-Cym3gapE.js";import{a as i,c as a,i as o,n as s,o as c,s as l,t as u}from"./dialog-
|
|
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"./button-Cym3gapE.js";import{a as i,c as a,i as o,n as s,o as c,s as l,t as u}from"./dialog-_kqu_91M.js";import{t as d}from"./pierre-theme-CQAERd6x.js";import{t as f}from"./MultiFileDiff-B2LBKfyB.js";var p=n(),m=e();function h(e){let n=(0,p.c)(38),{open:h,onOpenChange:g,skillName:_,localBody:v,upstreamBody:y,applying:b,onTakeUpstream:x}=e,S;n[0]===_?S=n[1]:(S=(0,m.jsx)(a,{children:(0,m.jsx)(t,{id:`EPKVES`,values:{skillName:_}})}),n[0]=_,n[1]=S);let C;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,m.jsx)(i,{children:(0,m.jsx)(t,{id:`kKw0H3`})}),n[2]=C):C=n[2];let w;n[3]===S?w=n[4]:(w=(0,m.jsxs)(l,{children:[S,C]}),n[3]=S,n[4]=w);let T;n[5]!==v||n[6]!==_?(T={name:_,contents:v},n[5]=v,n[6]=_,n[7]=T):T=n[7];let E;n[8]!==_||n[9]!==y?(E={name:_,contents:y},n[8]=_,n[9]=y,n[10]=E):E=n[10];let D;n[11]===Symbol.for(`react.memo_cache_sentinel`)?(D={overflow:`wrap`,diffStyle:`unified`,theme:d()},n[11]=D):D=n[11];let O;n[12]!==T||n[13]!==E?(O=(0,m.jsx)(s,{className:`min-h-0 flex-1 overflow-auto`,children:(0,m.jsx)(f,{className:`conflict-view`,oldFile:T,newFile:E,options:D})}),n[12]=T,n[13]=E,n[14]=O):O=n[14];let k;n[15]===g?k=n[16]:(k=()=>g(!1),n[15]=g,n[16]=k);let A;n[17]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,m.jsx)(t,{id:`Tq3pcs`}),n[17]=A):A=n[17];let j;n[18]!==b||n[19]!==k?(j=(0,m.jsx)(r,{variant:`outline`,onClick:k,disabled:b,children:A}),n[18]=b,n[19]=k,n[20]=j):j=n[20];let M;n[21]===b?M=n[22]:(M=b?(0,m.jsx)(t,{id:`JL3si7`}):(0,m.jsx)(t,{id:`qkqG0b`}),n[21]=b,n[22]=M);let N;n[23]!==b||n[24]!==x||n[25]!==M?(N=(0,m.jsx)(r,{onClick:x,disabled:b,children:M}),n[23]=b,n[24]=x,n[25]=M,n[26]=N):N=n[26];let P;n[27]!==j||n[28]!==N?(P=(0,m.jsxs)(c,{children:[j,N]}),n[27]=j,n[28]=N,n[29]=P):P=n[29];let F;n[30]!==P||n[31]!==w||n[32]!==O?(F=(0,m.jsxs)(o,{className:`flex max-h-[85vh] flex-col sm:max-w-5xl`,children:[w,O,P]}),n[30]=P,n[31]=w,n[32]=O,n[33]=F):F=n[33];let I;return n[34]!==g||n[35]!==h||n[36]!==F?(I=(0,m.jsx)(u,{open:h,onOpenChange:g,children:F}),n[34]=g,n[35]=h,n[36]=F,n[37]=I):I=n[37],I}export{h as SkillUpdateConflictDialog};
|
package/dist/public/assets/{SlidesToolbarControls-CJSUDVcP.js → SlidesToolbarControls-DWqUzkgL.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-Cym3gapE.js";import{i as s,n as c,t as l}from"./tooltip-DttaCTqz.js";import{yn as u}from"./dist-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-Cym3gapE.js";import{i as s,n as c,t as l}from"./tooltip-DttaCTqz.js";import{yn as u}from"./dist-D6JA916i.js";import{t as d}from"./trace-api-BP9dN1Hz.js";import{n as f}from"./dist-CJhtNlOm2.js";import{n as p,t as m}from"./workspace-paths-hw0bowEX.js";import{n as h}from"./use-workspace-DAuqjfCS.js";import{t as g}from"./createLucideIcon-BYL3gqKc.js";var _=g(`presentation`,[[`path`,{d:`M2 3h20`,key:`91anmk`}],[`path`,{d:`M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3`,key:`2k9sn8`}],[`path`,{d:`m7 21 5-5 5 5`,key:`bip4we`}]]),v=e(n(),1),y=a(),b=`open-knowledge-app`;function x(e){try{d.getTracer(b).startSpan(e).end()}catch(e){console.warn(`[slides-telemetry] span emit failed:`,e instanceof Error?e:String(e))}}function S(){x(`ok.slides.opened`)}function C(e,t){return e[t]===!0}function w(e,t){let n=(0,y.c)(7),r;n[0]!==t||n[1]!==e?(r=()=>{let n=u(e),r=C(n.current().map,t);return n.dispose(),r},n[0]=t,n[1]=e,n[2]=r):r=n[2];let[i,a]=(0,v.useState)(r),o,s;return n[3]!==t||n[4]!==e?(o=()=>{let n=u(e);a(C(n.current().map,t));let r=n.subscribe(e=>{a(C(e.map,t))});return()=>{r(),n.dispose()}},s=[e,t],n[3]=t,n[4]=e,n[5]=o,n[6]=s):(o=n[5],s=n[6]),(0,v.useEffect)(o,s),i}var T=t();async function E(e,t,n,r){let i=f.loading(n.opening,{duration:1/0});try{let a=await e.open(t);if(a.ok){f.dismiss(i);return}if(a.reason===`cancelled`){f.dismiss(i);return}let o,s=!1;switch(a.reason){case`timeout`:o=n.timeout,s=!0;break;case`exited-early`:case`renderer-failed`:o=n.renderFailed,s=!0;break;case`load-failed`:o=n.openFailed,s=!0;break;case`unsupported-server`:o=n.unsupported;break;case`spawn-error`:o=n.startFailed,s=!0;break;case`not-available`:case`invalid-path`:o=n.openFailed;break;default:a.reason,o=n.openFailed}f.error(o,{id:i,...s?{action:{label:n.retry,onClick:r}}:{}})}catch(e){console.warn(`[slides] open dispatch failed:`,e instanceof Error?e:String(e)),f.error(n.openFailed,{id:i,action:{label:n.retry,onClick:r}})}}async function D(e,t,n,r,i,a){if(!r.current.has(t)){r.current.add(t);try{i(new Set(r.current)),a&&S(),await E(e,t,n,()=>{D(e,t,n,r,i,!1)})}finally{r.current.delete(t),i(new Set(r.current))}}}function O(e){let t=(0,y.c)(3),[n,r]=(0,v.useState)(`pending`),i,a;return t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(!e)return;let t=!0,n=0,i=!1,a=()=>{n=Date.now();let e=window.okDesktop?.slides;if(e==null){r(`unavailable`);return}e.status().then(e=>{t&&(r(e.available?`available`:`unavailable`),e.available&&(i=!0))}).catch(e=>{console.warn(`[slides] availability probe failed:`,e instanceof Error?e:String(e)),t&&r(`unavailable`)})},o=()=>{i||Date.now()-n<1e4||a()};return a(),window.addEventListener(`focus`,o),()=>{t=!1,window.removeEventListener(`focus`,o)}},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,v.useEffect)(i,a),n}function k(e){let t=(0,y.c)(12),{provider:n,docName:a}=e,{_:u}=i(),d=w(n,`slides`),f=O(d),g=h(),b=(0,v.useRef)(new Set),[x,S]=(0,v.useState)(A);if(!d||f!==`available`)return null;let C=g==null?null:p(g.contentDir,m(a),g.pathSeparator),E=async function(){let e=window.okDesktop?.slides;e==null||C==null||await D(e,C,{opening:u({id:`PKLY-1`}),timeout:u({id:`NeY1Np`}),renderFailed:u({id:`Lm3r51`}),openFailed:u({id:`X59Fx2`}),unsupported:u({id:`T_j5G0`}),startFailed:u({id:`TBfy1C`}),retry:u({id:`KDw4GX`})},b,S,!0)},k=l,j=o,M;t[0]===u?M=t[1]:(M=u({id:`w52SKa`}),t[0]=u,t[1]=M);let N=C!=null&&x.has(C),P;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,T.jsx)(s,{children:(0,T.jsx)(_,{"aria-hidden":!0})}),t[2]=P):P=t[2];let F;t[3]!==j||t[4]!==E||t[5]!==M||t[6]!==N?(F=(0,T.jsx)(j,{variant:`ghost`,size:`icon`,onClick:E,"aria-label":M,"aria-busy":N,"data-testid":`slides-toolbar-action`,asChild:!0,children:P}),t[3]=j,t[4]=E,t[5]=M,t[6]=N,t[7]=F):F=t[7];let I;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,T.jsx)(c,{side:`bottom`,children:(0,T.jsx)(r,{id:`w52SKa`})}),t[8]=I):I=t[8];let L;return t[9]!==k||t[10]!==F?(L=(0,T.jsxs)(k,{children:[F,I]}),t[9]=k,t[10]=F,t[11]=L):L=t[11],L}function A(){return new Set}export{k as SlidesToolbarControls};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Dn as n,H as r,It as i,Mn as a,Rt as o,ct as s,gn as c,lt as l,nn as ee,ot as u,pt as d,tn as f,vn as te,vt as p,yt as m}from"./DocumentContext-C1MDqUGQ.js";import{t as h}from"./react-f2sANaYj.js";import{n as g}from"./dist-PQ5KMVDh.js";import{t as ne}from"./compiler-runtime-BfE3aGVn.js";import{Es as _,Is as v,T as re,bs as y,ea as ie,si as b}from"./dist-CDr44_5B.js";import{i as ae}from"./use-apply-config-theme-CBmHKD_B.js";import{B as oe,D as x,F as se,L as ce,P as le,T as S,d as ue,h as de,i as fe,j as pe,m as C,r as me,t as he,u as w}from"./typing-burst-detector-Dc6Z0dV2.js";import{J as T,N as E,X as D,a as ge,i as _e,o as ve,x as O}from"./CodeMirrorPropInput-2n_88FNl.js";import{s as k}from"./startup-marks-BPR5ipj8.js";import"./config-provider-CFXUtiwu.js";import{$ as A,At as j,Ct as M,E as N,J as P,K as F,Mt as I,N as L,Nt as R,Tt as ye,X as z,at as B,b as V,et as H,ft as be,g as U,l as W,lt as xe,ot as G,pt as K,st as q,tt as J,ut as Y,v as X,wt as Z}from"./dist-C_J0Iqwf.js";import{i as Se,t as Ce}from"./dist-BamsYfxi.js";import{i as we,n as Te,o as Ee,r as De}from"./dist-DX3X9Ax9.js";import{o as Oe,r as ke}from"./selection-context-EAVqhQEK.js";import{l as Ae}from"./lint-config-client-C7Do4K-V.js";import{a as je,i as Me,n as Ne,o as Pe,r as Fe,s as Ie,t as Le}from"./dist-BHeX1K_T2.js";import{n as Re,t as ze}from"./src-DuGGvfdD.js";var Q=e(h(),1),Be=ne();function Ve(){let e=p();return e===null?null:new Set(e.keys())}function He(e,t,n){let r=[],i=L(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);_.lastIndex=0;for(let e=_.exec(t);e!==null;e=_.exec(t)){let t=e[2];if(!v(t))continue;let a=i+(e.index??0)+e[1].length,s=a+t.length+1;o(a,s)||r.push(F.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&&v(c)&&n!=null)return r.push(F.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=u.exec(s);if(l)return r.push(F.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),F.set(r)}function Ue(e){let t=l(e);return t===null?[]:[z.fromClass(class{decorations;constructor(e){this.decorations=He(e.state,e.visibleRanges,Ve())}update(e){(e.docChanged||e.viewportChanged||L(e.startState)!==L(e.state))&&(this.decorations=He(e.view.state,e.view.visibleRanges,Ve()))}},{decorations:e=>e.decorations}),P.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=p()?.get(i);return e===void 0?d():window.location.hash=m(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=s(t,e,o),!0)}})]}var We=F.line({attributes:{dir:`auto`}});function Ge(e){let t=new j;for(let n of e.visibleRanges)for(let r=n.from;r<=n.to;){let n=e.state.doc.lineAt(r);t.add(n.from,n.from,We),r=n.to+1}return t.finish()}var Ke=z.fromClass(class{decorations;constructor(e){this.decorations=Ge(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=Ge(e.view))}},{decorations:e=>e.decorations}),qe=[P.perLineTextDirection.of(!0),Ke],Je=new Set([`Link`,`Image`,`HTMLTag`,`HTMLBlock`]),Ye=`cm-lint-local-target`;function Xe(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function Ze(e,t){let n=U(e,t+1,100);if(n){let e=n.resolveInner(t,1);for(;e;){if(Je.has(e.name))return{from:e.from,to:e.to};e=e.parent}}return{from:t,to:t}}function Qe(e){return e===`error`?`error`:e===`info`?`info`:`warning`}function $e(e,t){let n=e.doc,r=[];for(let i of t){if(i.source!==`links`)continue;let t=Ze(e,Xe(n,i.range.start));r.push({from:t.from,to:Math.max(t.to,t.from),severity:Qe(i.severity),message:x(i),source:`${i.source}/${i.code}`,markClass:Ye})}return r}var et=I.define();function tt(e){let t={findings:[]};return[Me(e=>T()?$e(e.state,t.findings):[],{delay:300,needsRefresh:e=>e.transactions.some(e=>e.effects.some(e=>e.is(et)))}),z.define(n=>{let r=e=>{t.findings=e,n.dispatch({effects:et.of(null)}),Le(n)},i=S(e,e=>{e.status===`loaded`&&r(e.findings)}),a=D(()=>r(t.findings));return{destroy(){i(),a()}}})]}function nt(e,t){return e.enabled?[Ne(),Me(async n=>rt(n.state.doc,await b(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 rt(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=it(r);o&&(a.actions=[o]),n.push(a)}return n}function it(e){let t=e.fixes;return!t||t.length===0?null:{name:`Fix`,apply(e){let n=e.state.doc;e.dispatch({changes:t.map(e=>({from:$(n,e.range.start),to:$(n,e.range.end),insert:e.newText})),userEvent:`input.complete`})}}}var at=[Y(),G(),q(),X(),H(),J(),ye.allowMultipleSelections.of(!0),N(),W(),De(),Te(),K(),A(),B(),je(),xe.of([...we,...Ce,...Ie,...V,...Ee,...Fe])],ot=F.mark({class:`cm-link-ref-broken`}),st=/^\s{0,3}\[([^\]]+)\]:\s/,ct=/\[([^\]]*)\]\[([^\]]*)\]/g,lt=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function ut(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 dt(e){let t=[];return L(e).iterate({enter(e){if(lt.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function ft(e){let t=new Set,n=[],r=e.doc,i=dt(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if(ut(n.from,i))continue;let a=st.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!ut(t.from,i)&&!st.test(t.text))for(ct.lastIndex=0;;){let e=ct.exec(t.text);if(!e)break;let r=t.from+e.index;if(ut(r,i))continue;let a=e[2]||e[1];n.push({from:r,to:r+e[0].length,label:a.toLowerCase()})}}let a=[];for(let e of n)t.has(e.label)||a.push(ot.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),F.set(a)}var pt=R.define({create(e){return ft(e)},update(e,t){return t.docChanged?ft(t.state):e},provide:e=>P.decorations.from(e)}),mt=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,ht=F.mark({class:`cm-del`}),gt=F.line({class:`cm-table-header`,attributes:{style:`--list-hang: 2ch`}}),_t=F.line({class:`cm-table-row`,attributes:{style:`--list-hang: 2ch`}});function vt(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function yt(e){if(e.doc.lines<2)return null;let t=e.doc.line(1);if(!y.test(t.text))return null;for(let n=2;n<=e.doc.lines;n++){let r=e.doc.line(n);if(y.test(r.text))return{from:t.from,to:r.to}}return null}function bt(e,t){let n=[],r=L(e),i=yt(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(ht.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=mt.exec(r.text),a=i?i[1].length:2,o=F.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=vt(r.text),a=F.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(gt.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(_t.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(_t.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),F.set(n)}var xt=class{decorations;constructor(e){this.decorations=bt(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||L(e.startState)!==L(e.state))&&(this.decorations=bt(e.view.state,e.view.visibleRanges))}},St=z.fromClass(xt,{decorations:e=>e.decorations});function Ct(){return[St,pt]}var wt=t(),Tt=I.define();function Et(e,t,n){let r=C(e.state.doc),i=r[t.index],o={docName:n,mode:`source`,index:t.index,sourceHeadingCount:r.length};if(!i){k(w,{...o,outcome:`no-target`});return}let s=a(n,`outline`,()=>{e.dispatch({selection:Z.cursor(i.from),effects:P.scrollIntoView(i.from,{y:`start`})}),e.focus()});k(w,{...o,outcome:s?`scrolled`:`declined`,targetLine:e.state.doc.lineAt(i.from).number})}function Dt(e,t,n,r){requestAnimationFrame(()=>{if(!n())return;let i=e.state.doc,o=Math.min(t.offset,i.length);a(r,`raw-mdx`,()=>{e.dispatch({selection:Z.cursor(o),effects:P.scrollIntoView(o,{y:`center`})}),e.focus()})})}function Ot(e,t,n){let r=e.state.doc,i=Math.min(Math.max(t.line,1),r.lines),o=r.line(i),s=Math.min(o.from+Math.max(0,t.column-1),o.to);return a(n,`problems-row`,()=>{e.dispatch({selection:Z.cursor(s),effects:P.scrollIntoView(s,{y:`start`})}),e.focus()})}function kt(e){let t=(0,Be.c)(50),{docName:a,ytext:s,provider:l,placeholder:u,isSourceModeActive:d}=e,p=(0,Q.useRef)(null),m=(0,Q.useRef)(null),[h,ne]=(0,Q.useState)(null);if(h)throw h;let{resolvedTheme:_}=g(),{merged:v}=ae(),y=(0,Q.useRef)(d),b=v?.editor?.wordWrap??!0,{data:x}=Ae(a),S;t[0]!==x?.effective||t[1]!==v?(S=x?.effective??(v?.contentRules?ie(v.contentRules):re),t[0]=x?.effective,t[1]=v,t[2]=S):S=t[2];let C=S,T;t[3]===C?T=t[4]:(T=JSON.stringify(C),t[3]=C,t[4]=T);let E=T,D,O;t[5]===d?(D=t[6],O=t[7]):(D=()=>{y.current=d},O=[d],t[5]=d,t[6]=D,t[7]=O),(0,Q.useEffect)(D,O);let A=(0,Q.useRef)(null),j;t[8]!==a||t[9]!==C||t[10]!==u||t[11]!==l||t[12]!==_||t[13]!==b||t[14]!==s?(j=()=>{let e=p.current;if(!e)return;let t=l.configuration.name??``,d,h=jt;try{d=f({docName:t,container:e,sizeStats:{viewCount:0,bytes:s.length},factory:e=>{let c=null,ee=r({ydoc:l.document,ytext:s,docName:t}),d=new M,f=new M,te=new M,p=new M,m=new P({state:ye.create({doc:s.toString(),extensions:[at,qe,Pe({scrollToMatch:e=>n(t,`find-match`)?P.scrollIntoView(e,{y:`start`}):Tt.of(null)}),xe.of([Se]),ze(s,l.awareness),xe.of(Re),..._e({themeCompartment:d,resolvedTheme:_,ydoc:l.document,wordWrapCompartment:f,wordWrap:b,currentDocName:t}),Ct(),Ue(t),oe(),p.of(nt(C,a)),tt(a),ee,P.updateListener.of(e=>{i(e)&&o(t)}),P.updateListener.of(e=>{!e.selectionSet&&!e.docChanged||(c!==null&&clearTimeout(c),c=setTimeout(()=>{c=null,me(t,`source`,fe(e.view)),ke(t,`source`,Oe(e.view,t))},120))}),te.of(be(u??``)),P.theme({"&":{height:`100%`}}),P.scrollMargins.of(At)]}),parent:e});me(t,`source`,fe(m)),ke(t,`source`,Oe(m,t));let g=m.contentDOM;return g.addEventListener(`keydown`,h),g.addEventListener(`paste`,h),g.addEventListener(`drop`,h),g.addEventListener(`cut`,h),{view:m,ydoc:l.document,ytext:s,provider:l,themeCompartment:d,wordWrapCompartment:f,placeholderCompartment:te,lintCompartment:p}}}),A.current=d,m.current=d.view,c(a,d.view),he()&&d.view.focus()}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),A.current=null,m.current=null,ne(t instanceof Error?t:Error(String(t)))}return()=>{let e=A.current;e&&(ee(e),te(a,e.view)),A.current=null,m.current=null}},t[8]=a,t[9]=C,t[10]=u,t[11]=l,t[12]=_,t[13]=b,t[14]=s,t[15]=j):j=t[15];let N;t[16]!==l||t[17]!==s?(N=[s,l],t[16]=l,t[17]=s,t[18]=N):N=t[18],(0,Q.useEffect)(j,N);let F,I;t[19]===a?(F=t[20],I=t[21]):(F=()=>{},I=[a],t[19]=a,t[20]=F,t[21]=I),(0,Q.useEffect)(F,I);let L,R;t[22]===_?(L=t[23],R=t[24]):(R=()=>{let e=A.current;e&&e.view.dispatch({effects:e.themeCompartment.reconfigure(_===`dark`?ge:ve)})},L=[_],t[22]=_,t[23]=L,t[24]=R),(0,Q.useEffect)(R,L);let z,B;t[25]===b?(z=t[26],B=t[27]):(z=()=>{let e=A.current;e&&e.view.dispatch({effects:e.wordWrapCompartment.reconfigure(b?P.lineWrapping:[])})},B=[b],t[25]=b,t[26]=z,t[27]=B),(0,Q.useEffect)(z,B);let V,H;t[28]===u?(V=t[29],H=t[30]):(V=()=>{let e=A.current;e&&e.view.dispatch({effects:e.placeholderCompartment.reconfigure(be(u??``))})},H=[u],t[28]=u,t[29]=V,t[30]=H),(0,Q.useEffect)(V,H);let U;t[31]!==a||t[32]!==C?(U=()=>{let e=A.current;e&&e.view.dispatch({effects:e.lintCompartment.reconfigure(nt(C,a))})},t[31]=a,t[32]=C,t[33]=U):U=t[33];let W;t[34]===E?W=t[35]:(W=[E],t[34]=E,t[35]=W),(0,Q.useEffect)(U,W);let G,K;t[36]!==a||t[37]!==d?(G=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==a||t.mode!==`source`||!d)return;let n=m.current;if(!n){k(w,{docName:a,mode:`source`,index:t.index,outcome:`no-view`});return}Et(n,t,a),le(a)};return window.addEventListener(ue,e),()=>window.removeEventListener(ue,e)},K=[a,d],t[36]=a,t[37]=d,t[38]=G,t[39]=K):(G=t[38],K=t[39]),(0,Q.useEffect)(G,K);let q,J;t[40]!==a||t[41]!==d?(q=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==a||!d)return;let n=m.current;n&&Ot(n,t,a)&&le(a)};return window.addEventListener(de,e),()=>window.removeEventListener(de,e)},J=[a,d],t[40]=a,t[41]=d,t[42]=q,t[43]=J):(q=t[42],J=t[43]),(0,Q.useEffect)(q,J);let Y,X;t[44]!==a||t[45]!==d||t[46]!==l?(Y=()=>{if(!d)return;let e=m.current;if(!e)return;let t=ce(a);if(!t)return;if(t.kind!==`selection-offset`){se(a),t.kind===`outline`?Et(e,t.detail,a):t.kind===`lint`?Ot(e,t.detail,a):t.kind===`raw-mdx`&&Dt(e,t.detail,()=>y.current,a);return}let n=!1,r=null;return queueMicrotask(()=>{if(n)return;let t=ce(a);t?.kind===`selection-offset`&&(r=pe({view:e,docName:a,navigation:t,ydoc:l.document,transition:{from:`wysiwyg`,to:`source`}}),r&&se(a))}),()=>{n=!0,r?.cancel(`mode-flip`)}},X=[a,d,l],t[44]=a,t[45]=d,t[46]=l,t[47]=Y,t[48]=X):(Y=t[47],X=t[48]),(0,Q.useEffect)(Y,X);let Z;return t[49]===Symbol.for(`react.memo_cache_sentinel`)?(Z=(0,wt.jsx)(`div`,{ref:p,className:`source-editor h-full pb-3`}),t[49]=Z):Z=t[49],Z}function At(){return{top:O()}}function jt(){return E()}export{kt as SourceEditor,Dt as applyRawMdxNavigation};
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Dn as n,H as r,It as i,Mn as a,Rt as o,ct as s,gn as c,lt as l,nn as ee,ot as u,pt as d,tn as f,vn as te,vt as p,yt as m}from"./DocumentContext-BdZiErvh.js";import{t as h}from"./react-f2sANaYj.js";import{n as g}from"./dist-PQ5KMVDh.js";import{t as ne}from"./compiler-runtime-BfE3aGVn.js";import{Es as _,Is as v,T as re,bs as y,ea as ie,si as b}from"./dist-D6JA916i.js";import{i as ae}from"./use-apply-config-theme-CBmHKD_B.js";import{B as oe,D as x,F as se,L as ce,P as le,T as S,d as ue,h as de,i as fe,j as pe,m as C,r as me,t as he,u as w}from"./typing-burst-detector-D-RxXAZt.js";import{J as T,N as E,X as D,a as ge,i as _e,o as ve,x as O}from"./CodeMirrorPropInput-CRa8tGX-.js";import{s as k}from"./startup-marks-Ml5LD4ks.js";import"./config-provider-BvIhxk0G.js";import{$ as A,At as j,Ct as M,E as N,J as P,K as F,Mt as I,N as L,Nt as R,Tt as ye,X as z,at as B,b as V,et as H,ft as be,g as U,l as W,lt as xe,ot as G,pt as K,st as q,tt as J,ut as Y,v as X,wt as Z}from"./dist-C_J0Iqwf.js";import{i as Se,t as Ce}from"./dist-BamsYfxi.js";import{i as we,n as Te,o as Ee,r as De}from"./dist-DX3X9Ax9.js";import{o as Oe,r as ke}from"./selection-context-BBTm-UVn.js";import{l as Ae}from"./lint-config-client-DBF47lRL.js";import{a as je,i as Me,n as Ne,o as Pe,r as Fe,s as Ie,t as Le}from"./dist-BHeX1K_T2.js";import{n as Re,t as ze}from"./src-BBEwVksN.js";var Q=e(h(),1),Be=ne();function Ve(){let e=p();return e===null?null:new Set(e.keys())}function He(e,t,n){let r=[],i=L(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);_.lastIndex=0;for(let e=_.exec(t);e!==null;e=_.exec(t)){let t=e[2];if(!v(t))continue;let a=i+(e.index??0)+e[1].length,s=a+t.length+1;o(a,s)||r.push(F.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&&v(c)&&n!=null)return r.push(F.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=u.exec(s);if(l)return r.push(F.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),F.set(r)}function Ue(e){let t=l(e);return t===null?[]:[z.fromClass(class{decorations;constructor(e){this.decorations=He(e.state,e.visibleRanges,Ve())}update(e){(e.docChanged||e.viewportChanged||L(e.startState)!==L(e.state))&&(this.decorations=He(e.view.state,e.view.visibleRanges,Ve()))}},{decorations:e=>e.decorations}),P.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=p()?.get(i);return e===void 0?d():window.location.hash=m(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=s(t,e,o),!0)}})]}var We=F.line({attributes:{dir:`auto`}});function Ge(e){let t=new j;for(let n of e.visibleRanges)for(let r=n.from;r<=n.to;){let n=e.state.doc.lineAt(r);t.add(n.from,n.from,We),r=n.to+1}return t.finish()}var Ke=z.fromClass(class{decorations;constructor(e){this.decorations=Ge(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=Ge(e.view))}},{decorations:e=>e.decorations}),qe=[P.perLineTextDirection.of(!0),Ke],Je=new Set([`Link`,`Image`,`HTMLTag`,`HTMLBlock`]),Ye=`cm-lint-local-target`;function Xe(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function Ze(e,t){let n=U(e,t+1,100);if(n){let e=n.resolveInner(t,1);for(;e;){if(Je.has(e.name))return{from:e.from,to:e.to};e=e.parent}}return{from:t,to:t}}function Qe(e){return e===`error`?`error`:e===`info`?`info`:`warning`}function $e(e,t){let n=e.doc,r=[];for(let i of t){if(i.source!==`links`)continue;let t=Ze(e,Xe(n,i.range.start));r.push({from:t.from,to:Math.max(t.to,t.from),severity:Qe(i.severity),message:x(i),source:`${i.source}/${i.code}`,markClass:Ye})}return r}var et=I.define();function tt(e){let t={findings:[]};return[Me(e=>T()?$e(e.state,t.findings):[],{delay:300,needsRefresh:e=>e.transactions.some(e=>e.effects.some(e=>e.is(et)))}),z.define(n=>{let r=e=>{t.findings=e,n.dispatch({effects:et.of(null)}),Le(n)},i=S(e,e=>{e.status===`loaded`&&r(e.findings)}),a=D(()=>r(t.findings));return{destroy(){i(),a()}}})]}function nt(e,t){return e.enabled?[Ne(),Me(async n=>rt(n.state.doc,await b(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 rt(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=it(r);o&&(a.actions=[o]),n.push(a)}return n}function it(e){let t=e.fixes;return!t||t.length===0?null:{name:`Fix`,apply(e){let n=e.state.doc;e.dispatch({changes:t.map(e=>({from:$(n,e.range.start),to:$(n,e.range.end),insert:e.newText})),userEvent:`input.complete`})}}}var at=[Y(),G(),q(),X(),H(),J(),ye.allowMultipleSelections.of(!0),N(),W(),De(),Te(),K(),A(),B(),je(),xe.of([...we,...Ce,...Ie,...V,...Ee,...Fe])],ot=F.mark({class:`cm-link-ref-broken`}),st=/^\s{0,3}\[([^\]]+)\]:\s/,ct=/\[([^\]]*)\]\[([^\]]*)\]/g,lt=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function ut(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 dt(e){let t=[];return L(e).iterate({enter(e){if(lt.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function ft(e){let t=new Set,n=[],r=e.doc,i=dt(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if(ut(n.from,i))continue;let a=st.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!ut(t.from,i)&&!st.test(t.text))for(ct.lastIndex=0;;){let e=ct.exec(t.text);if(!e)break;let r=t.from+e.index;if(ut(r,i))continue;let a=e[2]||e[1];n.push({from:r,to:r+e[0].length,label:a.toLowerCase()})}}let a=[];for(let e of n)t.has(e.label)||a.push(ot.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),F.set(a)}var pt=R.define({create(e){return ft(e)},update(e,t){return t.docChanged?ft(t.state):e},provide:e=>P.decorations.from(e)}),mt=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,ht=F.mark({class:`cm-del`}),gt=F.line({class:`cm-table-header`,attributes:{style:`--list-hang: 2ch`}}),_t=F.line({class:`cm-table-row`,attributes:{style:`--list-hang: 2ch`}});function vt(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function yt(e){if(e.doc.lines<2)return null;let t=e.doc.line(1);if(!y.test(t.text))return null;for(let n=2;n<=e.doc.lines;n++){let r=e.doc.line(n);if(y.test(r.text))return{from:t.from,to:r.to}}return null}function bt(e,t){let n=[],r=L(e),i=yt(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(ht.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=mt.exec(r.text),a=i?i[1].length:2,o=F.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=vt(r.text),a=F.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(gt.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(_t.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(_t.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),F.set(n)}var xt=class{decorations;constructor(e){this.decorations=bt(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||L(e.startState)!==L(e.state))&&(this.decorations=bt(e.view.state,e.view.visibleRanges))}},St=z.fromClass(xt,{decorations:e=>e.decorations});function Ct(){return[St,pt]}var wt=t(),Tt=I.define();function Et(e,t,n){let r=C(e.state.doc),i=r[t.index],o={docName:n,mode:`source`,index:t.index,sourceHeadingCount:r.length};if(!i){k(w,{...o,outcome:`no-target`});return}let s=a(n,`outline`,()=>{e.dispatch({selection:Z.cursor(i.from),effects:P.scrollIntoView(i.from,{y:`start`})}),e.focus()});k(w,{...o,outcome:s?`scrolled`:`declined`,targetLine:e.state.doc.lineAt(i.from).number})}function Dt(e,t,n,r){requestAnimationFrame(()=>{if(!n())return;let i=e.state.doc,o=Math.min(t.offset,i.length);a(r,`raw-mdx`,()=>{e.dispatch({selection:Z.cursor(o),effects:P.scrollIntoView(o,{y:`center`})}),e.focus()})})}function Ot(e,t,n){let r=e.state.doc,i=Math.min(Math.max(t.line,1),r.lines),o=r.line(i),s=Math.min(o.from+Math.max(0,t.column-1),o.to);return a(n,`problems-row`,()=>{e.dispatch({selection:Z.cursor(s),effects:P.scrollIntoView(s,{y:`start`})}),e.focus()})}function kt(e){let t=(0,Be.c)(50),{docName:a,ytext:s,provider:l,placeholder:u,isSourceModeActive:d}=e,p=(0,Q.useRef)(null),m=(0,Q.useRef)(null),[h,ne]=(0,Q.useState)(null);if(h)throw h;let{resolvedTheme:_}=g(),{merged:v}=ae(),y=(0,Q.useRef)(d),b=v?.editor?.wordWrap??!0,{data:x}=Ae(a),S;t[0]!==x?.effective||t[1]!==v?(S=x?.effective??(v?.contentRules?ie(v.contentRules):re),t[0]=x?.effective,t[1]=v,t[2]=S):S=t[2];let C=S,T;t[3]===C?T=t[4]:(T=JSON.stringify(C),t[3]=C,t[4]=T);let E=T,D,O;t[5]===d?(D=t[6],O=t[7]):(D=()=>{y.current=d},O=[d],t[5]=d,t[6]=D,t[7]=O),(0,Q.useEffect)(D,O);let A=(0,Q.useRef)(null),j;t[8]!==a||t[9]!==C||t[10]!==u||t[11]!==l||t[12]!==_||t[13]!==b||t[14]!==s?(j=()=>{let e=p.current;if(!e)return;let t=l.configuration.name??``,d,h=jt;try{d=f({docName:t,container:e,sizeStats:{viewCount:0,bytes:s.length},factory:e=>{let c=null,ee=r({ydoc:l.document,ytext:s,docName:t}),d=new M,f=new M,te=new M,p=new M,m=new P({state:ye.create({doc:s.toString(),extensions:[at,qe,Pe({scrollToMatch:e=>n(t,`find-match`)?P.scrollIntoView(e,{y:`start`}):Tt.of(null)}),xe.of([Se]),ze(s,l.awareness),xe.of(Re),..._e({themeCompartment:d,resolvedTheme:_,ydoc:l.document,wordWrapCompartment:f,wordWrap:b,currentDocName:t}),Ct(),Ue(t),oe(),p.of(nt(C,a)),tt(a),ee,P.updateListener.of(e=>{i(e)&&o(t)}),P.updateListener.of(e=>{!e.selectionSet&&!e.docChanged||(c!==null&&clearTimeout(c),c=setTimeout(()=>{c=null,me(t,`source`,fe(e.view)),ke(t,`source`,Oe(e.view,t))},120))}),te.of(be(u??``)),P.theme({"&":{height:`100%`}}),P.scrollMargins.of(At)]}),parent:e});me(t,`source`,fe(m)),ke(t,`source`,Oe(m,t));let g=m.contentDOM;return g.addEventListener(`keydown`,h),g.addEventListener(`paste`,h),g.addEventListener(`drop`,h),g.addEventListener(`cut`,h),{view:m,ydoc:l.document,ytext:s,provider:l,themeCompartment:d,wordWrapCompartment:f,placeholderCompartment:te,lintCompartment:p}}}),A.current=d,m.current=d.view,c(a,d.view),he()&&d.view.focus()}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),A.current=null,m.current=null,ne(t instanceof Error?t:Error(String(t)))}return()=>{let e=A.current;e&&(ee(e),te(a,e.view)),A.current=null,m.current=null}},t[8]=a,t[9]=C,t[10]=u,t[11]=l,t[12]=_,t[13]=b,t[14]=s,t[15]=j):j=t[15];let N;t[16]!==l||t[17]!==s?(N=[s,l],t[16]=l,t[17]=s,t[18]=N):N=t[18],(0,Q.useEffect)(j,N);let F,I;t[19]===a?(F=t[20],I=t[21]):(F=()=>{},I=[a],t[19]=a,t[20]=F,t[21]=I),(0,Q.useEffect)(F,I);let L,R;t[22]===_?(L=t[23],R=t[24]):(R=()=>{let e=A.current;e&&e.view.dispatch({effects:e.themeCompartment.reconfigure(_===`dark`?ge:ve)})},L=[_],t[22]=_,t[23]=L,t[24]=R),(0,Q.useEffect)(R,L);let z,B;t[25]===b?(z=t[26],B=t[27]):(z=()=>{let e=A.current;e&&e.view.dispatch({effects:e.wordWrapCompartment.reconfigure(b?P.lineWrapping:[])})},B=[b],t[25]=b,t[26]=z,t[27]=B),(0,Q.useEffect)(z,B);let V,H;t[28]===u?(V=t[29],H=t[30]):(V=()=>{let e=A.current;e&&e.view.dispatch({effects:e.placeholderCompartment.reconfigure(be(u??``))})},H=[u],t[28]=u,t[29]=V,t[30]=H),(0,Q.useEffect)(V,H);let U;t[31]!==a||t[32]!==C?(U=()=>{let e=A.current;e&&e.view.dispatch({effects:e.lintCompartment.reconfigure(nt(C,a))})},t[31]=a,t[32]=C,t[33]=U):U=t[33];let W;t[34]===E?W=t[35]:(W=[E],t[34]=E,t[35]=W),(0,Q.useEffect)(U,W);let G,K;t[36]!==a||t[37]!==d?(G=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==a||t.mode!==`source`||!d)return;let n=m.current;if(!n){k(w,{docName:a,mode:`source`,index:t.index,outcome:`no-view`});return}Et(n,t,a),le(a)};return window.addEventListener(ue,e),()=>window.removeEventListener(ue,e)},K=[a,d],t[36]=a,t[37]=d,t[38]=G,t[39]=K):(G=t[38],K=t[39]),(0,Q.useEffect)(G,K);let q,J;t[40]!==a||t[41]!==d?(q=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==a||!d)return;let n=m.current;n&&Ot(n,t,a)&&le(a)};return window.addEventListener(de,e),()=>window.removeEventListener(de,e)},J=[a,d],t[40]=a,t[41]=d,t[42]=q,t[43]=J):(q=t[42],J=t[43]),(0,Q.useEffect)(q,J);let Y,X;t[44]!==a||t[45]!==d||t[46]!==l?(Y=()=>{if(!d)return;let e=m.current;if(!e)return;let t=ce(a);if(!t)return;if(t.kind!==`selection-offset`){se(a),t.kind===`outline`?Et(e,t.detail,a):t.kind===`lint`?Ot(e,t.detail,a):t.kind===`raw-mdx`&&Dt(e,t.detail,()=>y.current,a);return}let n=!1,r=null;return queueMicrotask(()=>{if(n)return;let t=ce(a);t?.kind===`selection-offset`&&(r=pe({view:e,docName:a,navigation:t,ydoc:l.document,transition:{from:`wysiwyg`,to:`source`}}),r&&se(a))}),()=>{n=!0,r?.cancel(`mode-flip`)}},X=[a,d,l],t[44]=a,t[45]=d,t[46]=l,t[47]=Y,t[48]=X):(Y=t[47],X=t[48]),(0,Q.useEffect)(Y,X);let Z;return t[49]===Symbol.for(`react.memo_cache_sentinel`)?(Z=(0,wt.jsx)(`div`,{ref:p,className:`source-editor h-full pb-3`}),t[49]=Z):Z=t[49],Z}function At(){return{top:O()}}function jt(){return E()}export{kt as SourceEditor,Dt 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{$t as c,Di as l,Ji as u,On as d,Sn as f,kn as p,qi as m}from"./dist-
|
|
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{$t as c,Di as l,Ji as u,On as d,Sn as f,kn as p,qi as m}from"./dist-D6JA916i.js";import{n as h}from"./dist-CJhtNlOm2.js";import{r as g}from"./use-apply-config-theme-CBmHKD_B.js";import{t as _}from"./x-CAqepOgq.js";import{l as v,s as y,u as b}from"./doc-hash-Dx9hwyex.js";import{n as ee}from"./page-list-cache-DZPKVqeA.js";import{f as te,h as x}from"./file-tree-adapter-C4gKqxzg.js";import{t as ne}from"./use-live-xterm-theme-aXDStBRf.js";import{i as S,r as re}from"./terminal-command-events-DBrAYz2u.js";import{t as C}from"./TerminalStartingNotice-DPZ5efWf.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-
|
|
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-D7aC0OiR.js";import{t as s}from"./config-provider-BvIhxk0G.js";import{t as c}from"./use-live-xterm-theme-aXDStBRf.js";import{SessionsHost as l}from"./SessionsHost-CrnQRViT.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{Co as o,Fo as s,hr as c}from"./dist-
|
|
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{Co as o,Fo as s,hr as c}from"./dist-D6JA916i.js";import{n as l}from"./CodeMirrorPropInput-CRa8tGX-.js";import{g as u}from"./config-provider-BvIhxk0G.js";import{Ct as d,J as f,M as p,Tt as m}from"./dist-C_J0Iqwf.js";import{t as h}from"./cm-theme-BAUNpz80.js";import{t as g}from"./dist-Dk_qlbA92.js";import{t as _}from"./text-viewer-languages-DE3Z2Ufk.js";import{t as v}from"./src-BBEwVksN.js";var y=a(),b=e(n(),1),x=t(),S=h({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),C=h({dark:!1,background:`var(--background)`,gutterBackground:`var(--muted)`});function w(e){let t=(0,y.c)(19),{docName:n,provider:a}=e,{_:h}=r(),w=n.slice(n.lastIndexOf(`/`)+1),T=(0,b.useRef)(null),{resolvedTheme:E}=i(),D;t[0]===a.document?D=t[1]:(D=a.document.getText(`source`),t[0]=a.document,t[1]=D);let O=D,k;t[2]===O?k=t[3]:(k=()=>new u(O),t[2]=O,t[3]=k);let[A]=(0,b.useState)(k),j;t[4]!==n||t[5]!==a.awareness||t[6]!==E||t[7]!==A||t[8]!==O?(j=()=>{let e=T.current;if(!e)return;let t=E===`dark`?S:C,r=new d,i=new d,u=(o[c(n)]??s(c(n)))!==null&&c(n)!==``,h=new f({state:m.create({doc:O.toString(),extensions:[g,v(O,a.awareness,{undoManager:A}),r.of([]),p(l),i.of(u?[]:f.lineWrapping),f.theme({"&":{height:`100%`}}),t]}),parent:e}),y=!1,b=c(n)||null;return b&&_(b,o[b]??s(b)).then(e=>{y||!e||h.dispatch({effects:r.reconfigure(e)})}),()=>{y=!0,h.destroy()}},t[4]=n,t[5]=a.awareness,t[6]=E,t[7]=A,t[8]=O,t[9]=j):j=t[9];let M;t[10]!==n||t[11]!==a||t[12]!==E||t[13]!==A||t[14]!==O?(M=[O,a,E,n,A],t[10]=n,t[11]=a,t[12]=E,t[13]=A,t[14]=O,t[15]=M):M=t[15],(0,b.useEffect)(j,M);let N=h({id:`xAlHfe`,values:{basename:w}}),P;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,x.jsx)(`div`,{ref:T,className:`min-h-0 flex-1 overflow-auto`}),t[16]=P):P=t[16];let F;return t[17]===N?F=t[18]:(F=(0,x.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":N,"data-text-doc-editor":``,children:P}),t[17]=N,t[18]=F),F}export{w as TextDocEditor};
|