@inkeep/open-knowledge 0.80.0-beta.6 → 0.80.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +6 -6
- package/dist/constants-H8MPNRhO.mjs +1 -0
- package/dist/index.mjs +1 -1
- package/dist/init-7G_l7gil.mjs +1 -0
- package/dist/{init-BR_RY0pY.mjs → init-DvYKQnB9.mjs} +2 -2
- package/dist/{launch-json-removal-CSulcUxI.mjs → launch-json-removal-7bCaKHP1.mjs} +1 -1
- package/dist/loader-BWhgdNl5.mjs +1 -0
- package/dist/{loader-CpDpte48.mjs → loader-DrjH_b9L.mjs} +1 -1
- package/dist/{preview-BCSrELqH.mjs → preview-BYnQz9HD.mjs} +1 -1
- package/dist/preview-CuyQLuj5.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-DItZVTCk.js → ActivityModeContent-BZzgyg-l.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-CvdBSXbP.js → AddPropertiesButton-DARtVJlU.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-Cm2GzZBM.js → AgentDiffPane-BdSQEzRZ.js} +1 -1
- package/dist/public/assets/{DocumentContext-B3xlplVb.js → DocumentContext-D7jvhyCA.js} +1 -1
- package/dist/public/assets/FeedbackForm-D0MIsMOt.js +1 -0
- package/dist/public/assets/{ImportSkillDialog-CgCFe5Pv.js → ImportSkillDialog-C6LzDIr2.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-BTFq6Ngk.js → ManagedArtifactProperties-Cw4XtRx_.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-Da_vwJzP.js +1 -0
- package/dist/public/assets/{PropertyDisplayRow-D2nLNITg.js → PropertyDisplayRow-C8_v-Tu6.js} +1 -1
- package/dist/public/assets/{SessionsHost-4CsyZngA.js → SessionsHost-CGMm3aDb.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-bpn_QRzv.js → SettingsDialogBody-k_8sF_t3.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-Cesp0OI6.js → SkillInstallMenu-BRjVgdkn.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-C3cT4d_4.js → SkillToolbarControls-OhQrSWSi.js} +1 -1
- package/dist/public/assets/{SourceEditor-Dkmhiwbb.js → SourceEditor-CgtZzyfW.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-vD_LAXsa.js → TerminalWindowApp-CFd6nVNH.js} +1 -1
- package/dist/public/assets/{ThreadView-DMbL0dhG.js → ThreadView-DL5_M7LX.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-vm_67Xp-.js → TimelineDiffPane-B_27zkg0.js} +1 -1
- package/dist/public/assets/{auth-state-cache-DYtj5a86.js → auth-state-cache-B5AZOzS0.js} +1 -1
- package/dist/public/assets/{comment-chips-ClsM-kmI.js → comment-chips-DuFqX1af.js} +1 -1
- package/dist/public/assets/{index-KTOtrBN1.js → index-DcJjM2Hn.js} +7 -7
- package/dist/public/assets/{progress-_zYa5fpq.js → progress-C4SiEBGf.js} +1 -1
- package/dist/public/assets/{selection-context-C1ld48kx.js → selection-context-COlhw5nL.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-d8VRIyWa.js → typing-burst-detector-H1V6TICJ.js} +1 -1
- package/dist/public/assets/{use-activity-panel-HUILZrq4.js → use-activity-panel-BP0UGAow.js} +1 -1
- package/dist/public/assets/{use-open-skill-Ci_4ajE0.js → use-open-skill-C7UyAcdd.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-Cf1oA_J7.js → use-timeline-entry-diff-DY2_QU4I.js} +1 -1
- package/dist/public/index.html +12 -12
- package/dist/{registry-probes-CpUHw0Pt.mjs → registry-probes-p0ZApPjq.mjs} +1 -1
- package/dist/{removal-file-path-D4u7hIns.mjs → removal-file-path-Bx2ZAa33.mjs} +1 -1
- package/dist/{repair-launch-json-D12M3uwf.mjs → repair-launch-json-Bfv2MHor.mjs} +1 -1
- package/dist/{repair-mcp-configs-CFOzC6j6.mjs → repair-mcp-configs-Dae5PZa1.mjs} +1 -1
- package/dist/src-BP-PBpUx.mjs +1 -0
- package/dist/{src-CO1INi5A.mjs → src-Cy-zDyG6.mjs} +1 -1
- package/dist/start-D6uOZUia.mjs +1 -0
- package/dist/{start-CfQ2ZJ9V.mjs → start-DTpjNc5f.mjs} +2 -2
- package/package.json +4 -4
- package/dist/constants-BM21y1CS.mjs +0 -1
- package/dist/init-z4dkIpZb.mjs +0 -1
- package/dist/loader-CDBcy7_5.mjs +0 -1
- package/dist/preview-rGoADBsd.mjs +0 -1
- package/dist/public/assets/FeedbackForm-GRSOr0fy.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-mFeT6hbW.js +0 -1
- package/dist/src-DmfAVE82.mjs +0 -1
- package/dist/start-DjI3fnEc.mjs +0 -1
package/dist/public/assets/{SettingsDialogBody-bpn_QRzv.js → SettingsDialogBody-k_8sF_t3.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{B as r,O as i,Sr as a,at as o,dt as s,gi as c,lt as l,st as u,ut as d,z as f}from"./DocumentContext-B3xlplVb.js";import{t as p}from"./react-f2sANaYj.js";import{n as m,r as h}from"./dist-Nvb76hAm.js";import{t as g}from"./useQuery-ZeEDLtxh.js";import{n as _}from"./dist-PQ5KMVDh.js";import{t as v}from"./react-dom-DPxgxlDT.js";import{t as y}from"./compiler-runtime-BfE3aGVn.js";import{t as b}from"./utils-CPqDy6Hr.js";import{S as x,_ as S,a as C,b as w,c as T,d as E,f as D,g as O,h as k,i as A,l as j,m as M,o as N,p as P,r as F,s as I,t as L,u as R,v as z,x as B,y as V}from"./agent-connections-BZwWjV-L.js";import{t as H}from"./button-BeFNZANd.js";import{i as U,n as W,r as G,t as K}from"./tooltip-DVBVVaAs.js";import{n as ee,r as te,t as q}from"./collapsible-DYySK8La.js";import{a as J,c as ne,i as re,l as ie,n as ae,o as oe,r as se,s as ce,t as le}from"./alert-dialog-CqqfqWNT.js";import{n as ue,t as de}from"./with-selector-PRoyWQiu.js";import{t as fe}from"./checkbox-Crs_F_Np.js";import{A as pe,C as me,D as he,E as ge,O as _e,S as ve,T as ye,_ as be,b as xe,f as Se,g as Ce,h as we,j as Te,k as Ee,m as De,p as Oe,r as ke,v as Ae,w as je,x as Me,y as Ne}from"./floating-ui.dom-CDtYEnEj.js";import{c as Pe,d as Fe,l as Ie,o as Le,s as Re,u as ze}from"./dist-DYso7MCm.js";import{t as Be}from"./label-D-K3fWtj.js";import{i as Ve,n as He,o as Ue,s as We,t as Ge}from"./select-D_BhUvh8.js";import{n as Ke,t as qe}from"./radio-group-npdxiS6E.js";import{t as Je}from"./switch-iwBsEWej.js";import{n as Ye,r as Xe,t as Ze}from"./toggle-group-BxIyZnUJ.js";import{a as Qe,c as $e,g as et,h as tt,l as nt,n as rt,o as it,r as at,s as Y,t as ot,u as st,y as ct}from"./RegisteredAgentIcon--fiCkSba.js";import{a as lt,i as ut,o as dt}from"./terminal-telemetry-BHuv7G5q.js";import{$o as ft,Ac as pt,As as mt,Bs as ht,Ci as gt,Cn as _t,Cs as vt,Es as yt,Fc as bt,Gc as xt,Go as St,Ic as Ct,Is as wt,Jc as Tt,Jo as Et,Ls as Dt,Mc as Ot,Mr as kt,Ms as At,Nc as jt,Ns as Mt,Ot as Nt,Pc as Pt,Qs as Ft,Rs as It,Tc as Lt,Un as Rt,Uo as zt,Wo as Bt,Xn as Vt,Xo as Ht,Yo as Ut,Ys as Wt,Zc as Gt,_s as Kt,as as qt,ba as Jt,cs as Yt,fi as Xt,fs as Zt,gi as Qt,gs as $t,is as en,js as tn,kc as nn,ks as rn,ls as an,ms as on,mt as sn,nl as cn,os as ln,ot as un,ps as dn,pt as fn,qo as pn,qs as mn,rs as hn,ss as gn,vs as _n,wn as vn,zs as yn}from"./dist-DILeGueK.js";import{t as bn}from"./trace-api-BP9dN1Hz.js";import{n as X}from"./dist-CJhtNlOm2.js";import{d as xn,f as Sn,h as Cn,n as wn,o as Tn,p as En,r as Dn,u as On,v as kn}from"./use-settings-route-DHuAch1j.js";import{t as An}from"./dist-Cr4-nBVI.js";import{c as jn}from"./documents-events-Do7TM3Hd.js";import{a as Mn,i as Nn,o as Pn}from"./local-menu-action-bus-DaoT7_kL.js";import{a as Fn,i as In,t as Ln}from"./use-apply-config-theme-B5w38X1P.js";import{t as Rn}from"./OpenInAgentMenuItem-QrteG6Br.js";import{g as zn,h as Bn,p as Vn,v as Hn,y as Un}from"./SkillInstallMenu-Cesp0OI6.js";import{t as Wn}from"./createLucideIcon-B6ULg5PN.js";import{a as Gn,c as Kn,f as qn,l as Jn,p as Yn,s as Xn,t as Zn}from"./EnableSyncConfirmDialog-B056XoQ0.js";import{p as Qn}from"./Mermaid-DZf1Vjbg.js";import{t as $n}from"./arrow-up-right-B3B9a7te.js";import{t as er}from"./check-BzfGb3KU.js";import{t as tr}from"./chevron-right-C-g4JuT4.js";import{n as nr,t as rr}from"./lint-plugin-meta-zA9wHIBR.js";import{t as ir}from"./circle-alert-Czw40trT.js";import{i as ar,r as or}from"./prop-types-CT1xGqpW.js";import{a as sr,h as cr,r as lr,t as ur}from"./dropdown-menu-BEhl0wvu.js";import{A as dr,B as fr,C as pr,F as mr,G as hr,H as gr,J as _r,K as vr,L as yr,M as br,N as xr,O as Sr,P as Cr,Q as wr,R as Tr,S as Er,U as Dr,V as Or,W as kr,Y as Ar,at as jr,b as Mr,c as Nr,d as Pr,et as Fr,f as Ir,h as Lr,i as Rr,j as zr,k as Br,l as Vr,m as Hr,n as Ur,nt as Wr,o as Gr,p as Kr,q as qr,v as Jr,w as Yr,x as Xr,y as Zr}from"./auth-state-cache-DYtj5a86.js";import{It as Qr}from"./CodeMirrorPropInput-Bf645WUa.js";import{r as $r,t as ei}from"./use-git-sync-status-CoUdayE7.js";import{o as ti}from"./folder-config-api-CDR1eAcz.js";import{t as ni}from"./info-CilGMBpP.js";import{t as ri}from"./spinner-Bp2_BYkl.js";import{n as ii,r as ai,t as oi}from"./ThemePicker-wGe4WU58.js";import{t as si}from"./rotate-ccw-B05K_aam.js";import{t as ci}from"./square-pen-BhqhPrdL.js";import{t as li}from"./terminal-DGmaW797.js";import{t as ui}from"./trash-2-B9Flu-41.js";import{t as di}from"./triangle-alert-CCeXtPLU.js";import{t as fi}from"./x-DIayTyoR.js";import{t as pi}from"./badge-5sA3wpe0.js";import{a as mi,c as hi,i as gi,n as _i,o as vi,r as yi,s as bi,t as xi}from"./dialog-DJkPMmCN.js";import{i as Si,o as Ci,r as wi,t as Ti}from"./field-BmnhqmEH.js";import{t as Ei}from"./tool-list-format-BVkGh5Od.js";import{n as Di}from"./use-workspace-2aIeQVoi.js";import{d as Oi}from"./doc-paths-BWrKtSx2.js";import{a as ki}from"./startup-marks-vgWlVGPK.js";import{n as Ai}from"./config-provider-Ca2HUShB.js";import{a as ji}from"./skill-scope-CUAEKGV-.js";import{m as Mi}from"./skills-api-CM8h9xtl.js";import{t as Ni}from"./input-3o4m6NnP.js";import{a as Pi,i as Fi,t as Ii}from"./popover-DwsSVA7z.js";import{_ as Li,a as Ri,d as zi,f as Bi,g as Vi,h as Hi,m as Ui,p as Wi,u as Gi,v as Ki,y as qi}from"./css-color-to-hex-AUn7eIel.js";import{n as Ji}from"./use-apply-config-language-BwIOrXvC.js";import{t as Yi}from"./external-link-DCF8KwVP.js";import{t as Xi}from"./ConfigSharingInfoTooltip-CF-B970o.js";import{t as Zi}from"./use-skills-DJX6inxB.js";import{o as Qi,s as $i,t as ea}from"./use-open-skill-Ci_4ajE0.js";import{r as ta,t as na}from"./DeleteConfirmationDialog-n90yA0mh.js";import{t as ra}from"./skeleton-C6CemrJA.js";import{d as ia,n as aa,r as oa,t as sa,u as ca}from"./lint-config-client--83L6Vzq.js";import{_ as la,a as ua,d as da,f as fa,g as pa,h as ma,i as ha,o as ga,s as _a,t as va,u as ya}from"./sortable.esm-Dd5xvHIC.js";import{t as ba}from"./textarea-CKTD258L.js";import{i as xa,n as Sa,t as Ca}from"./input-group-Bp9yqbay.js";import{a as wa,f as Ta,i as Ea,n as Da,o as Oa,p as ka,r as Aa,s as ja,t as Ma}from"./form-CEg9p5Rf.js";import{r as Na,t as Pa}from"./terminal-command-events-CVCqfbNT.js";import{t as Fa}from"./tag-pill-input-BRyN2FKA.js";import{t as Ia}from"./markdownlint-rule-browser-Dwh97LWk.js";import{n as La}from"./schema-fields-view-intent-BhBMXWR3.js";import{n as Ra,t as za}from"./use-terminal-enabled-Y78SBxmZ.js";var Ba=Wn(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),Va=Wn(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Ha=Wn(`unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),Ua=Wn(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Z=e(p(),1),Q=y(),$=n();function Wa(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(pi,{variant:`gray`,children:(0,$.jsx)(m,{id:`YBt9YP`})}),e[0]=t):t=e[0],t}function Ga(e){let t=(0,Q.c)(10),{scope:n}=e,r=`settings-scope-badge-${n}`,i;t[0]===n?i=t[1]:(i=n===`user`?(0,$.jsx)(m,{id:`7PzzBU`}):n===`project-local`?(0,$.jsx)(m,{id:`ImTzPZ`}):(0,$.jsx)(m,{id:`e0NrBM`}),t[0]=n,t[1]=i);let a;t[2]!==r||t[3]!==i?(a=(0,$.jsx)(U,{asChild:!0,children:(0,$.jsx)(pi,{variant:`gray`,tabIndex:0,className:`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,"data-testid":r,children:i})}),t[2]=r,t[3]=i,t[4]=a):a=t[4];let o;t[5]===n?o=t[6]:(o=(0,$.jsx)(W,{children:n===`user`?(0,$.jsx)(m,{id:`cFSbbh`}):n===`project-local`?(0,$.jsx)(m,{id:`YlwI5F`}):(0,$.jsx)(m,{id:`ebqMh6`})}),t[5]=n,t[6]=o);let s;return t[7]!==a||t[8]!==o?(s=(0,$.jsx)(G,{children:(0,$.jsxs)(K,{children:[a,o]})}),t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function Ka(e){let t=(0,Q.c)(27),{titleId:n,title:r,scope:i,level:a,beta:o,adornment:s,docUrl:c,children:l}=e,u=a===void 0?`page`:a,{_:d}=h(),f=u===`page`?`h3`:`h4`,p=u===`page`?`text-lg`:`text-base`,g;t[0]===p?g=t[1]:(g=b(`font-semibold`,p),t[0]=p,t[1]=g);let _;t[2]!==f||t[3]!==g||t[4]!==r||t[5]!==n?(_=(0,$.jsx)(f,{id:n,className:g,children:r}),t[2]=f,t[3]=g,t[4]=r,t[5]=n,t[6]=_):_=t[6];let v;t[7]===o?v=t[8]:(v=o?(0,$.jsx)(Wa,{}):null,t[7]=o,t[8]=v);let y;t[9]===i?y=t[10]:(y=i?(0,$.jsx)(Ga,{scope:i}):null,t[9]=i,t[10]=y);let x;t[11]!==s||t[12]!==_||t[13]!==v||t[14]!==y?(x=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_,s,v,y]}),t[11]=s,t[12]=_,t[13]=v,t[14]=y,t[15]=x):x=t[15];let S;t[16]===l?S=t[17]:(S=l?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:l}):null,t[16]=l,t[17]=S);let C;t[18]!==d||t[19]!==c||t[20]!==r||t[21]!==n?(C=c===void 0?null:(0,$.jsxs)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>Yi(e,c),onAuxClick:e=>Yi(e,c),"aria-label":d(typeof r==`string`?{id:`Li4U-T`,values:{title:r}}:{id:`zwWKhA`}),className:`inline-flex items-center gap-0.5 text-sm text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,"data-testid":`${n}-docs-link`,children:[(0,$.jsx)(m,{id:`zwWKhA`}),(0,$.jsx)($n,{"aria-hidden":!0,className:`size-3`})]}),t[18]=d,t[19]=c,t[20]=r,t[21]=n,t[22]=C):C=t[22];let w;return t[23]!==x||t[24]!==S||t[25]!==C?(w=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[x,S,C]}),t[23]=x,t[24]=S,t[25]=C,t[26]=w):w=t[26],w}var qa=`settings-sharing-title`;function Ja(){let e=(0,Q.c)(1),t=(typeof window<`u`?window.okDesktop:void 0)?.sharing,n;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=t===void 0?(0,$.jsx)(Ya,{}):(0,$.jsx)(Xa,{}),e[0]=n):n=e[0],n}function Ya(){let e=(0,Q.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(m,{id:`cs4mps`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`section`,{"aria-labelledby":qa,className:`space-y-3`,"data-field":`section:sharing`,children:(0,$.jsx)(Ka,{titleId:qa,title:t,scope:`project`,level:`block`,children:(0,$.jsx)(m,{id:`7YRrJ9`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{})}})})}),e[1]=n):n=e[1],n}function Xa(){let e=(0,Q.c)(29),{_:t}=h(),[n,r]=(0,Z.useState)(null),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),c;e[0]===t?c=e[1]:(c=async function(){let e=window.okDesktop?.sharing;if(e)try{r(await e.status())}catch(e){let n=e;X.error(n instanceof Error?n.message:t({id:`K0N7zS`})),r(Qa)}},e[0]=t,e[1]=c);let l=c,u;e[2]===l?u=e[3]:(u=()=>{l()},e[2]=l,e[3]=u);let d;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=[],e[4]=d):d=e[4],(0,Z.useEffect)(u,d);let f;e[5]!==t||e[6]!==i||e[7]!==l||e[8]!==n?(f=async function(e){let r=window.okDesktop?.sharing;if(!r||n===null||i||n.mode===e)return;a(!0),s(null);let o=null,c=null;try{o=await r.setMode(e)}catch(e){c=e}if(a(!1),c!==null){X.error(c instanceof Error?c.message:t({id:`qZv5ZR`}));return}o!==null&&(o.kind===`refused-tracked`?(s({tracked:o.tracked,remediation:o.remediation}),X.error(t({id:`z2JdQ-`}),{duration:5e3})):o.kind===`no-exclude`?X.warning(o.reason===`no-git`?t({id:`YSFv5w`}):t({id:`8cS0nH`,values:{0:o.reason}})):X.success(t(e===`local-only`?{id:`wdzBgi`}:{id:`k_pade`})),await l())},e[5]=t,e[6]=i,e[7]=l,e[8]=n,e[9]=f):f=e[9];let p=f;if(n===null){let t;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Ka,{titleId:qa,title:(0,$.jsx)(m,{id:`cs4mps`}),scope:`project`,level:`block`}),e[10]=t):t=e[10];let n;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`section`,{"aria-labelledby":qa,className:`space-y-3`,"data-field":`section:sharing`,children:[t,(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(m,{id:`eQn7nI`})}),(0,$.jsx)(ra,{className:`h-24`})]})]}),e[11]=n):n=e[11],n}let g=n.mode===`no-git`,_;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(m,{id:`cs4mps`}),e[12]=_):_=e[12];let v;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(Ka,{titleId:qa,title:_,scope:`project`,level:`block`,adornment:(0,$.jsx)(Xi,{}),children:(0,$.jsx)(m,{id:`N55YNr`})}),e[13]=v):v=e[13];let y;e[14]!==i||e[15]!==g||e[16]!==p||e[17]!==n.mode?(y=g?(0,$.jsx)(`p`,{className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,role:`status`,"data-testid":`settings-sharing-no-git`,children:(0,$.jsx)(m,{id:`ju38ms`})}):(0,$.jsxs)(qe,{value:n.mode,onValueChange:e=>void p(e),disabled:i,className:`gap-2`,"aria-labelledby":qa,"data-testid":`settings-sharing-radiogroup`,children:[(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-local-only`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(Ke,{id:`settings-sharing-local-only`,value:`local-only`,"data-testid":`settings-sharing-local-only`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(m,{id:`QjzFZj`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`un-K1H`})})]})]}),(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-shared`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(Ke,{id:`settings-sharing-shared`,value:`shared`,"data-testid":`settings-sharing-shared`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(m,{id:`0Gd0NU`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`dJw2_7`})})]})]})]}),e[14]=i,e[15]=g,e[16]=p,e[17]=n.mode,e[18]=y):y=e[18];let b;e[19]===o?b=e[20]:(b=o===null?null:(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border border-destructive bg-destructive/10 p-3 text-sm`,role:`alert`,"data-testid":`settings-sharing-refusal`,children:[(0,$.jsx)(`p`,{className:`font-semibold`,children:(0,$.jsx)(m,{id:`ZscwQ0`})}),(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs leading-relaxed`,children:o.remediation}),(0,$.jsx)(H,{variant:`outline`,size:`sm`,onClick:()=>s(null),children:(0,$.jsx)(m,{id:`1QfxQT`})})]}),e[19]=o,e[20]=b);let x;e[21]!==o||e[22]!==n.mode||e[23]!==n.trackedUpstream?(x=n.trackedUpstream.length>0&&n.mode!==`no-git`&&o===null?(0,$.jsxs)(`div`,{className:`space-y-1 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-tracked-info`,children:[(0,$.jsx)(`p`,{className:`font-medium`,children:(0,$.jsx)(m,{id:`LhWYpm`})}),(0,$.jsx)(`ul`,{className:`list-disc pl-5 font-mono text-xs text-muted-foreground`,children:n.trackedUpstream.map(Za)}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`1XSMhZ`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]}):null,e[21]=o,e[22]=n.mode,e[23]=n.trackedUpstream,e[24]=x):x=e[24];let S;return e[25]!==y||e[26]!==b||e[27]!==x?(S=(0,$.jsxs)(`section`,{"aria-labelledby":qa,className:`space-y-4`,"data-testid":`settings-sharing`,"data-field":`section:sharing`,children:[v,y,b,x]}),e[25]=y,e[26]=b,e[27]=x,e[28]=S):S=e[28],S}function Za(e){return(0,$.jsx)(`li`,{children:e},e)}function Qa(e){return e??{kind:`status`,mode:`no-git`,excluded:[],trackedUpstream:[]}}var $a=`[a-z0-9](?:[a-z0-9-]*[a-z0-9])?`,eo=RegExp(`^${$a}(?:\\.${$a})*$`),to=/^[a-z][a-z0-9+.-]*:\/\//i;function no(e){if(to.test(e))try{return new URL(e).host}catch{return null}let t=e.split(`/`)[0]??``;return t.slice(t.lastIndexOf(`@`)+1).replace(/:(?!\d+$).*$/,``)}function ro(e,t){let n=e.trim();if(n===``)return{ok:!1,reason:`empty`};let r=no(n);if(r===null||r===``)return{ok:!1,reason:`invalid`};let i=tn(r);return eo.test(i)?i===`github.com`?{ok:!1,reason:`github-com`}:t.has(i)?{ok:!1,reason:`duplicate`}:{ok:!0,host:i}:{ok:!1,reason:`invalid`}}function io(e){let t=e.git?.hosts??{};return Object.entries(t).filter(([,e])=>e?.provider===`github`).map(([e])=>e).sort((e,t)=>e.localeCompare(t))}function ao(e){let t=(0,Q.c)(59),{binding:n}=e,{_:r}=h(),i=(0,Z.useId)(),a=(0,Z.useId)(),o;t[0]===n?o=t[1]:(o=()=>io(n.current()),t[0]=n,t[1]=o);let[s,c]=(0,Z.useState)(o),[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(null),[p,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(null),y;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=new Map,t[2]=y):y=t[2];let b=(0,Z.useRef)(y),x=(0,Z.useRef)(null),S,C;t[3]===_?(S=t[4],C=t[5]):(S=()=>{_!==null&&(((_.host===null?null:b.current.get(_.host))??x.current)?.focus(),v(null))},C=[_],t[3]=_,t[4]=S,t[5]=C),(0,Z.useEffect)(S,C);let w,T;t[6]===n?(w=t[7],T=t[8]):(w=()=>n.subscribe(e=>c(io(e))),T=[n],t[6]=n,t[7]=w,t[8]=T),(0,Z.useEffect)(w,T);let E;t[9]===r?E=t[10]:(E=function(e){switch(e){case`empty`:return r({id:`cFONFy`});case`invalid`:return r({id:`QsnBxE`});case`github-com`:return r({id:`UK3GW4`});case`duplicate`:return r({id:`DEkRZA`})}},t[9]=r,t[10]=E);let D=E,O;t[11]!==n||t[12]!==l||t[13]!==s||t[14]!==D?(O=function(e){e.preventDefault();let t=ro(l,new Set(s.map(oo)));if(!t.ok){f(D(t.reason));return}let r=n.patch({git:{hosts:{[t.host]:{provider:`github`}}}});if(!r.ok){f(_n(r.error));return}c(io(r.effective)),u(``),f(null),g(!0)},t[11]=n,t[12]=l,t[13]=s,t[14]=D,t[15]=O):O=t[15];let k=O,A;t[16]!==n||t[17]!==s?(A=function(e){let t=s.indexOf(e),r=s[t+1]??s[t-1]??null,i=n.patch({git:{hosts:{[e]:null}}});if(!i.ok){f(_n(i.error));return}c(io(i.effective)),v({host:r}),f(null),g(!0)},t[16]=n,t[17]=s,t[18]=A):A=t[18];let j=A,M;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(`h4`,{id:`settings-enterprise-hosts-title`,className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`J2-D_a`})}),t[19]=M):M=t[19];let N;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(m,{id:`PgY2nN`}),t[20]=N):N=t[20];let P;t[21]===i?P=t[22]:(P=(0,$.jsxs)(`div`,{children:[M,(0,$.jsx)(`p`,{id:i,className:`text-1sm text-muted-foreground`,children:N})]}),t[21]=i,t[22]=P);let F;t[23]!==r||t[24]!==j||t[25]!==s?(F=s.length>0?(0,$.jsx)(`ul`,{className:`space-y-1`,"data-testid":`settings-enterprise-hosts-list`,children:s.map(e=>(0,$.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs`,children:e}),(0,$.jsx)(H,{variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":r({id:`xVMoYb`,values:{host:e}}),ref:t=>{t?b.current.set(e,t):b.current.delete(e)},onClick:()=>j(e),children:(0,$.jsx)(ui,{"aria-hidden":`true`})})]},e))}):(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-enterprise-hosts-empty`,children:(0,$.jsx)(m,{id:`HK2eIK`})}),t[23]=r,t[24]=j,t[25]=s,t[26]=F):F=t[26];let I;t[27]===r?I=t[28]:(I=r({id:`Qbf7Q4`}),t[27]=r,t[28]=I);let L=d!==null,R=d===null?i:`${i} ${a}`,z;t[29]===d?z=t[30]:(z=e=>{u(e.target.value),d!==null&&f(null)},t[29]=d,t[30]=z);let B;t[31]!==l||t[32]!==I||t[33]!==L||t[34]!==R||t[35]!==z?(B=(0,$.jsx)(Ni,{ref:x,value:l,"aria-label":I,placeholder:`github.example.com`,autoComplete:`off`,spellCheck:!1,inputMode:`url`,className:`h-7 flex-1 font-mono text-xs`,"aria-invalid":L,"aria-describedby":R,onChange:z}),t[31]=l,t[32]=I,t[33]=L,t[34]=R,t[35]=z,t[36]=B):B=t[36];let V;t[37]===l?V=t[38]:(V=l.trim(),t[37]=l,t[38]=V);let U=V===``,W;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(m,{id:`ALFlyF`}),t[39]=W):W=t[39];let G;t[40]===U?G=t[41]:(G=(0,$.jsx)(H,{type:`submit`,size:`sm`,variant:`secondary`,disabled:U,className:`h-7 px-2 font-normal text-xs`,children:W}),t[40]=U,t[41]=G);let K;t[42]!==k||t[43]!==B||t[44]!==G?(K=(0,$.jsxs)(`form`,{className:`flex items-center gap-2 pt-1`,onSubmit:k,noValidate:!0,children:[B,G]}),t[42]=k,t[43]=B,t[44]=G,t[45]=K):K=t[45];let ee;t[46]!==d||t[47]!==a?(ee=d===null?null:(0,$.jsx)(`p`,{id:a,role:`alert`,className:`text-1sm text-destructive`,children:d}),t[46]=d,t[47]=a,t[48]=ee):ee=t[48];let te;t[49]===p?te=t[50]:(te=p?(0,$.jsx)(`p`,{role:`status`,className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`3LuFP-`})}):null,t[49]=p,t[50]=te);let q;t[51]!==F||t[52]!==K||t[53]!==ee||t[54]!==te?(q=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-lg border bg-card p-3`,children:[F,K,ee,te]}),t[51]=F,t[52]=K,t[53]=ee,t[54]=te,t[55]=q):q=t[55];let J;return t[56]!==P||t[57]!==q?(J=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-enterprise-hosts-title`,className:`space-y-4 pt-5`,"data-field":`section:enterprise-hosts`,"data-testid":`settings-enterprise-hosts`,children:[P,q]}),t[56]=P,t[57]=q,t[58]=J):J=t[58],J}function oo(e){return tn(e)}function so(e){let t=(0,Q.c)(38),{authQueryTransport:n,authTransport:r,userBinding:i}=e,{_:a}=h(),o;t[0]===n?o=t[1]:(o=n??wr(),t[0]=n,t[1]=o);let s=o,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c={phase:`loading`},t[2]=c):c=t[2];let[l,u]=(0,Z.useState)(c),[d,f]=(0,Z.useState)(!1),[p,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(null),y=(0,Z.useRef)(!1),b;t[3]===s?b=t[4]:(b=async function(){u({phase:`loading`});try{let e=await s.status();u({phase:`loaded`,result:e}),Ur(e)}catch(e){console.warn(`[AccountSection] GitHub status check failed`,e),u({phase:`check-failed`})}},t[3]=s,t[4]=b);let x=b,S;t[5]===x?S=t[6]:(S=()=>{x()},t[5]=x,t[6]=S);let C;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(C=[],t[7]=C):C=t[7],(0,Z.useEffect)(S,C);let w;t[8]!==a||t[9]!==x||t[10]!==s?(w=async function(){if(y.current)return;y.current=!0,f(!1),g(!0),v(null);let e=null;try{let t=s.signout?await s.signout():{ok:!1,error:a({id:`8cpOa8`})};t.ok||(e=t.error??a({id:`8cpOa8`}))}catch(t){console.warn(`[AccountSection] GitHub disconnect failed`,t),e=a({id:`8cpOa8`})}await x(),e&&v(e),g(!1),y.current=!1},t[8]=a,t[9]=x,t[10]=s,t[11]=w):w=t[11];let T=w,E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(m,{id:`AeXO77`}),t[12]=E):E=t[12];let D;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(Ka,{titleId:`settings-account-title`,title:E,scope:`user`,children:(0,$.jsx)(m,{id:`E6lrpp`})}),t[13]=D):D=t[13];let O;t[14]!==_||t[15]!==p||t[16]!==T||t[17]!==x||t[18]!==l.phase||t[19]!==l.result?(O=l.phase===`loading`?(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-loading`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(m,{id:`IWGfGF`})}),(0,$.jsx)(ra,{className:`h-4 w-40`}),(0,$.jsx)(ra,{className:`h-8 w-32`})]}):l.phase===`check-failed`?(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-check-failed`,children:[(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`T_wG4n`})}),(0,$.jsx)(H,{variant:`outline`,size:`sm`,onClick:()=>void x(),children:(0,$.jsx)(m,{id:`KDw4GX`})})]}):l.result.authenticated?l.result.tier===`A`?(0,$.jsx)(lo,{login:l.result.login}):(0,$.jsx)(co,{login:l.result.login,disconnecting:p,error:_,onDisconnect:()=>void T()}):l.result.unsupportedOrigin===void 0?(0,$.jsx)(fo,{onConnect:()=>f(!0)}):(0,$.jsx)(uo,{host:l.result.unsupportedOrigin.host}),t[14]=_,t[15]=p,t[16]=T,t[17]=x,t[18]=l.phase,t[19]=l.result,t[20]=O):O=t[20];let k;t[21]===i?k=t[22]:(k=(0,$.jsx)(ao,{binding:i}),t[21]=i,t[22]=k);let A;t[23]===x?A=t[24]:(A=e=>{f(e),e||x()},t[23]=x,t[24]=A);let j=l.phase===`loaded`?l.result.host:void 0,M=l.phase===`loaded`?l.result.ghAvailable:void 0,N;t[25]===x?N=t[26]:(N=()=>{x()},t[25]=x,t[26]=N);let P;t[27]!==d||t[28]!==r||t[29]!==A||t[30]!==j||t[31]!==M||t[32]!==N?(P=(0,$.jsx)(Ar,{open:d,onOpenChange:A,transport:r,host:j,ghAvailable:M,onSuccess:N}),t[27]=d,t[28]=r,t[29]=A,t[30]=j,t[31]=M,t[32]=N,t[33]=P):P=t[33];let F;return t[34]!==k||t[35]!==P||t[36]!==O?(F=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-account-title`,className:`space-y-3`,"data-testid":`settings-account`,children:[D,O,k,P]}),t[34]=k,t[35]=P,t[36]=O,t[37]=F):F=t[37],F}function co(e){let t=(0,Q.c)(20),{login:n,disconnecting:r,error:i,onDisconnect:a}=e,o;t[0]===n?o=t[1]:(o=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(m,{id:`nxlOpL`})}),t[2]=s):s=t[2];let c;t[3]===o?c=t[4]:(c=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[o,s]}),t[3]=o,t[4]=c);let l;t[5]===r?l=t[6]:(l=r?(0,$.jsx)(m,{id:`rppgXF`}):(0,$.jsx)(m,{id:`-K0AvT`}),t[5]=r,t[6]=l);let u;t[7]!==r||t[8]!==a||t[9]!==l?(u=(0,$.jsx)(H,{variant:`outline`,onClick:a,disabled:r,"aria-describedby":`settings-account-disconnect-caveat`,"data-testid":`settings-account-disconnect`,children:l}),t[7]=r,t[8]=a,t[9]=l,t[10]=u):u=t[10];let d;t[11]!==c||t[12]!==u?(d=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[c,u]}),t[11]=c,t[12]=u,t[13]=d):d=t[13];let f;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`p`,{id:`settings-account-disconnect-caveat`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-account-disconnect-caveat`,children:(0,$.jsx)(m,{id:`msOK6I`})}),t[14]=f):f=t[14];let p;t[15]===i?p=t[16]:(p=i?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-account-disconnect-error`,children:i}):null,t[15]=i,t[16]=p);let h;return t[17]!==d||t[18]!==p?(h=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-connected`,children:[d,f,p]}),t[17]=d,t[18]=p,t[19]=h):h=t[19],h}function lo(e){let t=(0,Q.c)(5),{login:n}=e,r;t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(m,{id:`ny6vNn`})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-gh-cli`,children:(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[r,i]})}),t[3]=r,t[4]=a),a}function uo(e){let t=(0,Q.c)(3),{host:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`xBjIs7`})}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,$.jsxs)(`div`,{role:`status`,className:`space-y-1 rounded-md border p-3`,"data-testid":`settings-account-unsupported-origin`,children:[r,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:n===null?(0,$.jsx)(m,{id:`XBpH6-`}):(0,$.jsx)(m,{id:`7_I248`,values:{host:n}})})]}),t[1]=n,t[2]=i),i}function fo(e){let t=(0,Q.c)(5),{onConnect:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`S33tz3`})}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[r,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(m,{id:`EJuO7B`})})]}),t[1]=i):i=t[1];let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(m,{id:`5lWFkC`}),t[2]=a):a=t[2];let o;return t[3]===n?o=t[4]:(o=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-disconnected`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[i,(0,$.jsx)(H,{onClick:n,"data-testid":`settings-account-connect`,children:a})]})}),t[3]=n,t[4]=o),o}function po(e){if(e===void 0)return null;let t=e.params?.agent;if(typeof t!=`string`)return null;let n=cn[t]??t;return e.id===`followup.enable-manually`?An._({id:`followup.enable-manually`,values:{agent:n}}):null}function mo(e){let{enabled:t,installedCount:n,presence:r,configurable:i,setupDocSlug:a,installUrl:o}=e,s=n>0,c=r===`absent`,l=()=>a===null?{kind:`none`}:{kind:`setup-doc`,slug:a};return c?o==null||o===``?l():{kind:`install`,url:o}:i?t?s?{kind:`manage`}:{kind:`connect`}:s?{kind:`remove`}:{kind:`none`}:s?{kind:`remove`}:l()}function ho(e){return e.presence===`absent`&&e.installedCount>0}function go(e){let t=(0,Q.c)(32),{icon:n,name:r,hint:i,status:a,action:o,checked:s,disabled:c,ariaLabel:l,testId:u,rowTestId:d,statusId:f,onToggle:p}=e,m=i?`${d}-hint`:void 0,h;t[0]===n?h=t[1]:(h=(0,$.jsx)(`span`,{className:`flex h-5 shrink-0 items-center`,children:n}),t[0]=n,t[1]=h);let g;t[2]===r?g=t[3]:(g=(0,$.jsx)(`span`,{className:`truncate text-sm leading-5`,children:r}),t[2]=r,t[3]=g);let _;t[4]!==i||t[5]!==m?(_=i?(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,$.jsx)(`span`,{id:m,className:`truncate text-muted-foreground text-1sm`,children:i.text}),i.action]}):null,t[4]=i,t[5]=m,t[6]=_):_=t[6];let v;t[7]!==a||t[8]!==f?(v=a?(0,$.jsx)(`span`,{id:f,children:a}):null,t[7]=a,t[8]=f,t[9]=v):v=t[9];let y;t[10]!==g||t[11]!==_||t[12]!==v?(y=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[g,_,v]}),t[10]=g,t[11]=_,t[12]=v,t[13]=y):y=t[13];let b;t[14]!==h||t[15]!==y?(b=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2.5`,children:[h,y]}),t[14]=h,t[15]=y,t[16]=b):b=t[16];let x;t[17]!==l||t[18]!==s||t[19]!==c||t[20]!==m||t[21]!==p||t[22]!==f||t[23]!==u?(x=p===void 0?null:(0,$.jsx)(Je,{checked:s??!1,disabled:c,onCheckedChange:p,"aria-label":l,"aria-describedby":[m,f].filter(Boolean).join(` `)||void 0,"data-testid":u}),t[17]=l,t[18]=s,t[19]=c,t[20]=m,t[21]=p,t[22]=f,t[23]=u,t[24]=x):x=t[24];let S;t[25]!==o||t[26]!==x?(S=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[o,x]}),t[25]=o,t[26]=x,t[27]=S):S=t[27];let C;return t[28]!==d||t[29]!==b||t[30]!==S?(C=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2.5`,"data-testid":d,children:[b,S]}),t[28]=d,t[29]=b,t[30]=S,t[31]=C):C=t[31],C}function _o(e){let t=(0,Q.c)(15),{target:n,projectDir:r,displayName:i}=e,{_:a}=h(),o;t[0]!==r||t[1]!==n?(o=()=>Un(n,r),t[0]=r,t[1]=n,t[2]=o):o=t[2];let[s,c]=(0,Z.useState)(o);if(!s)return null;let l;t[3]!==a||t[4]!==i?(l=a({id:`jIWP0P`,values:{displayName:i}}),t[3]=a,t[4]=i,t[5]=l):l=t[5];let u;t[6]!==r||t[7]!==n?(u=()=>{Hn(n,r,!1),c(Un(n,r))},t[6]=r,t[7]=n,t[8]=u):u=t[8];let d;t[9]===a?d=t[10]:(d=a({id:`LhVIxY`}),t[9]=a,t[10]=d);let f;return t[11]!==l||t[12]!==u||t[13]!==d?(f=(0,$.jsx)(H,{variant:`ghost`,size:`sm`,className:`shrink-0 font-mono uppercase`,"aria-label":l,onClick:u,children:d}),t[11]=l,t[12]=u,t[13]=d,t[14]=f):f=t[14],f}function vo(e,t){return e===`absent`&&!t}function yo(e){let t=(0,Q.c)(15),{label:n,labelIcon:r,subtitle:i,children:a,labelId:o}=e,s;t[0]!==n||t[1]!==r||t[2]!==o?(s=(0,$.jsxs)(`h4`,{id:o,tabIndex:-1,className:`flex items-center gap-1.5 font-mono text-muted-foreground text-xs uppercase tracking-wide`,children:[n,r]}),t[0]=n,t[1]=r,t[2]=o,t[3]=s):s=t[3];let c;t[4]===i?c=t[5]:(c=i?(0,$.jsx)(`p`,{className:`mt-1 text-muted-foreground text-xs`,children:i}):null,t[4]=i,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,$.jsxs)(`div`,{className:`mb-2`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]===a?u=t[10]:(u=(0,$.jsx)(`div`,{className:`divide-y overflow-hidden rounded-md border`,children:a}),t[9]=a,t[10]=u);let d;return t[11]!==o||t[12]!==l||t[13]!==u?(d=(0,$.jsxs)(`section`,{"aria-labelledby":o,children:[l,u]}),t[11]=o,t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function bo(e){if(e)return()=>{e.ownerDocument.activeElement===e&&V(e)?.focus()}}function xo(e){let t=(0,Q.c)(9),{hiddenCount:n,expanded:r,onToggle:i,testId:a}=e,{_:o}=h();if(n<=0)return null;let s;t[0]!==o||t[1]!==r||t[2]!==n?(s=o(r?{id:`6lGV3K`}:{id:`INN7OX`,values:{hiddenCount:n}}),t[0]=o,t[1]=r,t[2]=n,t[3]=s):s=t[3];let c;return t[4]!==r||t[5]!==i||t[6]!==s||t[7]!==a?(c=(0,$.jsx)(H,{ref:bo,type:`button`,variant:`ghost`,onClick:i,"aria-expanded":r,className:`w-full justify-center rounded-none font-normal text-1sm text-muted-foreground`,"data-testid":a,children:s}),t[4]=r,t[5]=i,t[6]=s,t[7]=a,t[8]=c):c=t[8],c}function So(e){let t=(0,Q.c)(10),{status:n,enabled:r}=e,{_:i}=h();if(n===`connected`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(er,{"aria-hidden":!0,className:`size-3.5`}),t[0]=e):e=t[0];let n;t[1]===i?n=t[2]:(n=i({id:`QHcLEN`}),t[1]=i,t[2]=n);let r;return t[3]===n?r=t[4]:(r=(0,$.jsxs)(`span`,{className:`mt-0.5 inline-flex items-center gap-1 text-muted-foreground text-xs`,children:[e,n]}),t[3]=n,t[4]=r),r}if(n===`not-connected`&&r){let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(di,{"aria-hidden":!0,className:`size-3.5`}),t[5]=e):e=t[5];let n;t[6]===i?n=t[7]:(n=i({id:`S33tz3`}),t[6]=i,t[7]=n);let r;return t[8]===n?r=t[9]:(r=(0,$.jsxs)(`span`,{className:`mt-0.5 inline-flex items-center gap-1 text-amber-700 text-xs dark:text-amber-400`,children:[e,n]}),t[8]=n,t[9]=r),r}return null}function Co(e){let t=(0,Q.c)(52),{action:n,rowLabel:r,describedById:i,onConfigure:a,onRemove:o}=e,{_:s}=h();switch(n.kind){case`none`:return null;case`install`:{let e=n.url,a;t[0]!==s||t[1]!==r?(a=s({id:`wfZwqe`,values:{rowLabel:r}}),t[0]=s,t[1]=r,t[2]=a):a=t[2];let o;t[3]===s?o=t[4]:(o=s({id:`TKQ7K-`}),t[3]=s,t[4]=o);let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)($n,{"aria-hidden":!0}),t[5]=c):c=t[5];let l;return t[6]!==n.url||t[7]!==i||t[8]!==a||t[9]!==o?(l=(0,$.jsx)(H,{variant:`link`,size:`sm`,className:`shrink-0 text-muted-foreground hover:text-foreground`,asChild:!0,children:(0,$.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,"aria-label":a,"aria-describedby":i,children:[o,c]})}),t[6]=n.url,t[7]=i,t[8]=a,t[9]=o,t[10]=l):l=t[10],l}case`setup-doc`:{let e=`https://openknowledge.ai/docs/integrations/${n.slug}`,a;t[11]!==s||t[12]!==r?(a=s({id:`Kuw5NN`,values:{rowLabel:r}}),t[11]=s,t[12]=r,t[13]=a):a=t[13];let o;t[14]===s?o=t[15]:(o=s({id:`P_bX4O`}),t[14]=s,t[15]=o);let c;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)($n,{"aria-hidden":!0}),t[16]=c):c=t[16];let l;return t[17]!==i||t[18]!==e||t[19]!==a||t[20]!==o?(l=(0,$.jsx)(H,{variant:`link`,size:`sm`,className:`shrink-0 text-muted-foreground hover:text-foreground`,asChild:!0,children:(0,$.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,"aria-label":a,"aria-describedby":i,children:[o,c]})}),t[17]=i,t[18]=e,t[19]=a,t[20]=o,t[21]=l):l=t[21],l}case`connect`:{let e;t[22]!==s||t[23]!==r?(e=s({id:`_uxBz5`,values:{rowLabel:r}}),t[22]=s,t[23]=r,t[24]=e):e=t[24];let n;t[25]===s?n=t[26]:(n=s({id:`q63KUv`}),t[25]=s,t[26]=n);let o;return t[27]!==i||t[28]!==a||t[29]!==e||t[30]!==n?(o=(0,$.jsx)(H,{size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:a,"aria-label":e,"aria-describedby":i,children:n}),t[27]=i,t[28]=a,t[29]=e,t[30]=n,t[31]=o):o=t[31],o}case`manage`:{let e;t[32]!==s||t[33]!==r?(e=s({id:`wSBXaS`,values:{rowLabel:r}}),t[32]=s,t[33]=r,t[34]=e):e=t[34];let n;t[35]===s?n=t[36]:(n=s({id:`wckWOP`}),t[35]=s,t[36]=n);let o;return t[37]!==i||t[38]!==a||t[39]!==e||t[40]!==n?(o=(0,$.jsx)(H,{variant:`outline`,size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:a,"aria-label":e,"aria-describedby":i,children:n}),t[37]=i,t[38]=a,t[39]=e,t[40]=n,t[41]=o):o=t[41],o}case`remove`:{let e;t[42]!==s||t[43]!==r?(e=s({id:`vRlzx-`,values:{rowLabel:r}}),t[42]=s,t[43]=r,t[44]=e):e=t[44];let n;t[45]===s?n=t[46]:(n=s({id:`t_YqKh`}),t[45]=s,t[46]=n);let a;return t[47]!==i||t[48]!==o||t[49]!==e||t[50]!==n?(a=(0,$.jsx)(H,{variant:`outline`,size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:o,"aria-label":e,"aria-describedby":i,children:n}),t[47]=i,t[48]=o,t[49]=e,t[50]=n,t[51]=a):a=t[51],a}}}function wo(e){let t=(0,Q.c)(9),{rowLabel:n,onRemove:r}=e,{_:i}=h(),a;t[0]!==i||t[1]!==n?(a=i({id:`vRlzx-`,values:{rowLabel:n}}),t[0]=i,t[1]=n,t[2]=a):a=t[2];let o;t[3]===i?o=t[4]:(o=i({id:`t_YqKh`}),t[3]=i,t[4]=o);let s;return t[5]!==r||t[6]!==a||t[7]!==o?(s=(0,$.jsx)(H,{type:`button`,variant:`link-muted`,className:`h-auto p-0 text-1sm underline underline-offset-4 hover:text-destructive`,onClick:r,"aria-label":a,children:o}),t[5]=r,t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function To(e){return e===void 0?null:nn[e].external?.installUrl??null}function Eo(e){return e!==null&&Object.values(e.probes.satisfiers).some(e=>e!==void 0&&e.state!==`unprobed`)}function Do(e){return`${e.source}:${e.id}`}function Oo(e,t,n){let r=t.has(Do(n)),i=dt(n);return at(e,n.source,n.id,r||i,n.supported)}function ko(e,t,n){return n.harness!==void 0&<(n)===0||Oo(e,t,n)}function Ao(e,t,n){let r=new Set(n.map(e=>Do(e))),i=e=>ko(t,r,e),a=[...e].sort((e,t)=>Number(i(t))-Number(i(e))||e.name.localeCompare(t.name));return{primaryKeys:new Set(a.filter(i).map(Do)),ranks:new Map(a.map((e,t)=>[Do(e),t]))}}function jo(e,t,n,r){let i=t.filter(t=>!e.ranks.has(Do(t)));if(i.length===0)return e;let a=new Set(r.map(e=>Do(e))),o=e=>ko(n,a,e),s=i.filter(o).sort((e,t)=>e.name.localeCompare(t.name)),c=i.filter(e=>!o(e)).sort((e,t)=>e.name.localeCompare(t.name)),l=[...e.ranks.entries()].sort(([,e],[,t])=>e-t).map(([e])=>e),u=l.filter(t=>e.primaryKeys.has(t)),d=l.filter(t=>!e.primaryKeys.has(t)),f=[...u,...s.map(Do),...d,...c.map(Do)];return{primaryKeys:new Set([...e.primaryKeys,...s.map(Do)]),ranks:new Map(f.map((e,t)=>[e,t]))}}function Mo(e){let t=(0,Q.c)(124),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{applyConnections:r}=n,i=r===void 0?L:r,{_:a}=h(),o=st(),s=ct(),{states:c,refresh:l}=zn(),u=Bn(),d=Di(),[f,p]=(0,Z.useState)(``),[m,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(!1),[w,B]=(0,Z.useState)(null),[V,U]=(0,Z.useState)(!1),[W,G]=(0,Z.useState)(!1),[K,ee]=(0,Z.useState)(0),[te,q]=(0,Z.useState)(null),[J,ne]=(0,Z.useState)(null),re=(0,Z.useRef)(null),ie=(0,Z.useRef)(0),ae;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(ae={queryKey:[`acp-catalog`],queryFn:Ho,staleTime:3e5},t[2]=ae):ae=t[2];let oe=g(ae),se;t[3]!==oe.data||t[4]!==o||t[5]!==s?(se=()=>oe.data===void 0?null:Ao(oe.data.agents,o,s),t[3]=oe.data,t[4]=o,t[5]=s,t[6]=se):se=t[6];let[ce,le]=(0,Z.useState)(se),ue=ce??Ao([],o,s);if(oe.data!==void 0){let e;t[7]!==oe.data.agents||t[8]!==ce||t[9]!==o||t[10]!==s?(e=ce===null?Ao(oe.data.agents,o,s):jo(ce,oe.data.agents,o,s),t[7]=oe.data.agents,t[8]=ce,t[9]=o,t[10]=s,t[11]=e):e=t[11];let n=e;n!==ce&&le(n),ue=n}let de;t[12]===l?de=t[13]:(de=()=>{l()},t[12]=l,t[13]=de);let fe=(0,Z.useEffectEvent)(de),pe;t[14]===fe?pe=t[15]:(pe=()=>{fe()},t[14]=fe,t[15]=pe);let me;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(me=[],t[16]=me):me=t[16],(0,Z.useEffect)(pe,me);let he;t[17]===i?he=t[18]:(he=()=>{let e=!0,t=ie.current+=1;return i([]).then(n=>{!e||ie.current!==t||(n.snapshot!==null&&B(n.snapshot),U(!Eo(n.snapshot)),G(n.unavailable===!0))}).catch(()=>{e&&ie.current===t&&U(!0)}),()=>{e=!1}},t[17]=i,t[18]=he);let ge;t[19]!==i||t[20]!==K?(ge=[i,K],t[19]=i,t[20]=K,t[21]=ge):ge=t[21],(0,Z.useEffect)(he,ge);let _e=oe.data?.agents,ve=new Set(s.map(Vo)),ye;t[22]===u?.installedClis?ye=t[23]:(ye=u?.installedClis??{},t[22]=u?.installedClis,t[23]=ye);let be=ye,xe=w===null?[]:D(w),Se=xe.find(e=>e.id===te)??null,Ce=xe.find(e=>e.id===J)??null,we;t[24]===i?we=t[25]:(we=async function(e){let t=await i(e);return ie.current+=1,t.snapshot!==null&&B(t.snapshot),U(!Eo(t.snapshot)),t.unavailable===!0&&G(!0),t},t[24]=i,t[25]=we);let Te=we,Ee;t[26]===w?Ee=t[27]:(Ee=function(e,t){return t===!1?`absent`:t===!0?`present`:e===void 0?`unknown`:N(e,w,t)},t[26]=w,t[27]=Ee);let De=Ee,Oe;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=new Set(jt.map(Ct).filter(Bo)),t[28]=Oe):Oe=t[28];let ke=Oe,Ae;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=new Set(Pt.map(zo).filter(Ro)),t[29]=Ae):Ae=t[29];let je=Ae,Me;t[30]!==be||t[31]!==De||t[32]!==c?(Me=function(e,t){if(t===`terminal`){let t=nn[e].external?.targetId;return t===void 0?`unknown`:De(e,c[t]?.installed??null)}let n=jt.find(t=>Ct(t)===e);return n===void 0?`unknown`:De(e,be[n]??null)},t[30]=be,t[31]=De,t[32]=c,t[33]=Me):Me=t[33];let Ne=Me,Pe=function(e,t,n,r,i,a,o,s){let c=e===void 0?void 0:xe.find(t=>t.id===e);if(c===void 0||e===void 0||w===null||!Eo(w))return{status:void 0,action:void 0,hintAction:void 0,residualFiles:!1,statusId:void 0};let l={enabled:i,installedCount:k(S(c)),presence:o,configurable:P(c),setupDocSlug:c.row.setupDocSlug,installUrl:s===void 0?nn[e].external?.installUrl??null:s},u=mo(l),d=M(e)&&Ne(e,r)!==`absent`,f=ho(l)&&!d,p=F({agentId:e,mode:r,snapshot:w,detected:a}),m=p===`connected`||p===`not-connected`&&i,h=m?`${n}-status`:void 0,g=!W||u.kind===`install`||u.kind===`setup-doc`,_=c.cells.projectMcp,v=_===void 0||!M(e)||C(_.consentClass)===r?po(A({agentId:e,mode:r,snapshot:w,detected:a,projectMcp:_})):null;return{status:m?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(So,{status:p,enabled:i}),v===null?null:(0,$.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground text-xs`,"data-testid":`${n}-followup`,children:v})]}):void 0,action:g?(0,$.jsx)(Co,{action:u,rowLabel:t,describedById:h,onConfigure:()=>q(e),onRemove:()=>ne(e)}):void 0,hintAction:f&&!W?(0,$.jsx)(wo,{rowLabel:t,onRemove:()=>ne(e)}):void 0,residualFiles:f,statusId:h}},Fe;t[34]===a?Fe=t[35]:(Fe=function(e,t){return a(e===`not-installed`?t?{id:`06Ucfz`}:{id:`5SwVv1`}:t?{id:`V0Jk_K`}:{id:`EDD3UL`})},t[34]=a,t[35]=Fe);let Ie=Fe,Le=function(e,t,n,r,i){if($e(e,r),!r||W||t===void 0||w===null)return;let a=xe.find(e=>e.id===t);a===void 0||!P(a)||F({agentId:t,mode:n,snapshot:w,detected:i})===`not-connected`&&(re.current=e,q(t))},Re;t[36]!==_e||t[37]!==o||t[38]!==s?(Re=function(){_e!==void 0&&le(Ao(_e,o,s))},t[36]=_e,t[37]=o,t[38]=s,t[39]=Re):Re=t[39];let ze=Re,Be;t[40]!==f||t[41]!==ze?(Be=function(e){f.trim()!==``&&e.trim()===``&&ze(),p(e)},t[40]=f,t[41]=ze,t[42]=Be):Be=t[42];let Ve=Be,He;t[43]!==ze||t[44]!==m?(He=function(){m&&ze(),_(!m)},t[43]=ze,t[44]=m,t[45]=He):He=t[45];let Ue=He,We=f.trim().toLowerCase(),Ge=e=>We===``||e.toLowerCase().includes(We),Ke=(_e??[]).filter(e=>Ge(e.name)),qe;t[46]===be?qe=t[47]:(qe=e=>be[e]!==!1,t[46]=be,t[47]=qe);let Je=qe,Ye;t[48]===Je?Ye=t[49]:(Ye=(e,t)=>Number(Je(t))-Number(Je(e))||Ot[e].displayName.localeCompare(Ot[t].displayName),t[48]=Je,t[49]=Ye);let Xe=jt.filter(e=>{let{displayName:t}=Ot[e];return Ge(t)||Ge(a({id:`QYfQdv`,values:{displayName:t}}))||Ge(e)}).sort(Ye),Ze;t[50]!==De||t[51]!==c?(Ze=e=>De(bt(e),c[e]?.installed??null),t[50]=De,t[51]=c,t[52]=Ze):Ze=t[52];let lt=Ze,ut;t[53]===lt?ut=t[54]:(ut=(e,t)=>Number(lt(e.id)===`absent`)-Number(lt(t.id)===`absent`),t[53]=lt,t[54]=ut);let ft=Pt.filter(e=>{let{displayName:t}=e;return Ge(a({id:`CZBqrX`,values:{displayName:t}}))||Ge(e.id)}).sort(ut),mt=u!==null,ht;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(ht=new Set([...ke,...je]),t[55]=ht):ht=t[55];let gt=ht,_t=pt.filter(e=>!gt.has(e)&&Ge(E(e))),vt=We!==``,yt=!oe.isLoading&&!oe.isError,xt=vt&&yt&&Ke.length===0&&Xe.length===0&&ft.length===0&&_t.length===0,St=!vt||oe.isLoading||oe.isError||Ke.length>0,wt=!vt||Xe.length>0,Tt=!vt||ft.length>0||_t.length>0,Et=e=>Oo(o,ve,e),Dt=e=>ue.primaryKeys.has(Do(e)),kt=e=>ue.ranks.get(Do(e))??2**53-1,At=Ke.filter(Dt),Mt=[...vt||m?Ke:At].sort((e,t)=>kt(e)-kt(t)||e.name.localeCompare(t.name)),Nt=vt?0:Ke.length-At.length,Ft=Xe.filter(Je),It=Ft.length>0&&Ft.length<Xe.length,Lt=!It||vt||v?Xe:Ft,Rt=It&&!vt?Xe.length-Ft.length:0,zt;t[56]===lt?zt=t[57]:(zt=e=>lt(e.id)!==`absent`,t[56]=lt,t[57]=zt);let Bt=ft.filter(zt),Vt=_t.filter(e=>De(e,xe.find(t=>t.id===e)?.row.detected??null)!==`absent`),Ht=Bt.length+Vt.length,Ut=ft.length+_t.length,Wt=Ht>0&&Ht<Ut,Gt=!Wt||vt||b,Kt=Gt?ft:Bt,qt=Gt?_t:Vt,Jt=Wt&&!vt?Ut-Ht:0,Yt=!yt||Ke.some(dt),Xt=mt&&Xe.some(Je),Zt;t[58]===c?Zt=t[59]:(Zt=e=>c[e.id]?.installed===!0,t[58]=c,t[59]=Zt);let Qt=ft.some(Zt),$t=St?(0,$.jsx)(yo,{label:a({id:`RXEbZy`}),labelId:`settings-configure-agents-in-app`,children:oe.isLoading?(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-2 px-3 py-6 text-muted-foreground text-sm`,children:[(0,$.jsx)(ri,{className:`size-4`,"aria-hidden":`true`}),a({id:`ucXZ0k`})]}):oe.isError?(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-3 py-6 text-center text-muted-foreground text-sm`,children:[(0,$.jsx)(Ua,{className:`size-5`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:a({id:`FqGWeR`})}),(0,$.jsx)(H,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void oe.refetch(),children:a({id:`6gRgw8`})})]}):(_e?.length??0)===0?(0,$.jsx)(`p`,{className:`px-3 py-6 text-center text-muted-foreground text-sm`,children:a({id:`QQbwzK`})}):(0,$.jsxs)($.Fragment,{children:[Mt.map(e=>{let t=Do(e),n=Et(e),r=e.supported?e.description:a({id:`5jEnaB`});return(0,$.jsx)(go,{icon:(0,$.jsx)(ot,{agentId:e.id,iconUrl:e.iconUrl,className:`size-4`}),name:e.name,hint:r===void 0?void 0:{text:r},checked:n,disabled:!e.supported,ariaLabel:a({id:`FZtBeR`,values:{0:e.name}}),testId:`configure-agents-in-app-${t}`,rowTestId:`configure-agents-in-app-row-${t}`,onToggle:n=>{n?(et({source:e.source,id:e.id,name:e.name,supported:e.supported,featured:e.featured,...e.iconUrl===void 0?{}:{iconUrl:e.iconUrl}},{makeDefault:!1}),$e(Y(e.source,e.id),!0)):($e(Y(e.source,e.id),!1),tt(t,e=>at(o,e.source,e.id,!0,e.supported)))}},t)}),(0,$.jsx)(xo,{hiddenCount:Nt,expanded:m,onToggle:Ue,testId:`configure-agents-in-app-show-more`})]})},`in-app`):null,en=wt?(0,$.jsxs)(yo,{label:a({id:`ALhMYW`}),labelId:`settings-configure-agents-terminal`,children:[Lt.map(e=>{let{displayName:t}=Ot[e],n=be[e]??null,r=De(Ct(e),n),i=Qe(o,e,r===`absent`),s=`configure-agents-terminal-row-${e}`,{status:c,action:l,hintAction:u,residualFiles:d,statusId:f}=Pe(Ct(e),a({id:`QYfQdv`,values:{displayName:t}}),s,`terminal`,i,n,r,To(Ct(e))??Ot[e].docsUrl);return(0,$.jsx)(go,{icon:(0,$.jsx)(Rn,{id:ta(e),className:`size-4`,"aria-hidden":`true`}),name:a({id:`QYfQdv`,values:{displayName:t}}),hint:r===`absent`?{text:Ie(`not-installed`,d),action:u}:void 0,status:c,action:l,checked:i,disabled:vo(r,i),ariaLabel:a({id:`27TLNq`,values:{displayName:t}}),testId:`configure-agents-terminal-${e}`,rowTestId:s,statusId:f,onToggle:mt?t=>Le(nt(e),Ct(e),`terminal`,t,be[e]??null):void 0},e)}),(0,$.jsx)(xo,{hiddenCount:Rt,expanded:v,onToggle:()=>y(Lo),testId:`configure-agents-terminal-show-more`})]},`terminal`):null,tn=Tt?(0,$.jsxs)(yo,{label:a({id:`BwKH4d`}),labelId:`settings-configure-agents-desktop`,labelIcon:(0,$.jsx)($n,{"aria-hidden":`true`,className:`size-3`}),children:[Kt.map(e=>{let t=c[e.id]?.installed??null,{displayName:n}=e,r=rt(o,e.id,t),i=De(bt(e.id),t),s=`configure-agents-desktop-row-${e.id}`,{status:l,action:u,hintAction:f,residualFiles:p,statusId:m}=Pe(bt(e.id),a({id:`CZBqrX`,values:{displayName:n}}),s,`external`,r,t,i);return(0,$.jsx)(go,{icon:(0,$.jsx)(Rn,{id:e.id,className:`size-4`,"aria-hidden":`true`}),name:a({id:`CZBqrX`,values:{displayName:n}}),hint:i===`absent`?{text:Ie(`not-installed`,p),action:f}:void 0,status:l,action:(0,$.jsxs)($.Fragment,{children:[u,d===null?null:(0,$.jsx)(_o,{target:e.id,projectDir:d.contentDir,displayName:n},`${d.contentDir}:${e.id}`)]}),checked:r,disabled:vo(i,r),ariaLabel:a({id:`cdBape`,values:{displayName:n}}),testId:`configure-agents-desktop-${e.id}`,rowTestId:s,statusId:m,onToggle:n=>Le(it(e.id),bt(e.id),`external`,n,t)},e.id)}),qt.map(e=>{let t=xe.find(t=>t.id===e)??null,n=t?.row.detected??null,r=E(e),i=De(e,n),a=`agent-connection-${e}`,o=Pe(e,r,a,`external`,t===null||!R(t),n,i);return(0,$.jsx)(go,{icon:(0,$.jsx)(T,{agentId:e,className:`size-4 text-muted-foreground`}),name:r,hint:i===`absent`?{text:Ie(`not-detected`,o.residualFiles),action:o.hintAction}:void 0,status:o.status,action:o.action,ariaLabel:r,testId:`configure-agents-unlaunchable-${e}`,rowTestId:a,statusId:o.statusId},e)}),(0,$.jsx)(xo,{hiddenCount:Jt,expanded:b,onToggle:()=>x(Io),testId:`configure-agents-desktop-show-more`})]},`desktop`):null,rn=[{node:$t,hasPresent:Yt},{node:en,hasPresent:Xt},{node:tn,hasPresent:Qt}].sort(Fo).map(Po),an;t[60]===a?an=t[61]:(an=a({id:`lBN3T6`}),t[60]=a,t[61]=an);let on;t[62]===a?on=t[63]:(on=a({id:`D4I0F9`}),t[62]=a,t[63]=on);let sn;t[64]!==an||t[65]!==on?(sn=(0,$.jsx)(Ka,{titleId:`settings-configure-agents-title`,title:an,children:on}),t[64]=an,t[65]=on,t[66]=sn):sn=t[66];let cn;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(cn=(0,$.jsx)(Nn,{className:`-translate-y-1/2 absolute top-1/2 start-2.5 size-4 text-muted-foreground`,"aria-hidden":`true`}),t[67]=cn):cn=t[67];let ln;t[68]===Ve?ln=t[69]:(ln=e=>Ve(e.target.value),t[68]=Ve,t[69]=ln);let un;t[70]===a?un=t[71]:(un=a({id:`-7s4fw`}),t[70]=a,t[71]=un);let dn;t[72]===a?dn=t[73]:(dn=a({id:`-7s4fw`}),t[72]=a,t[73]=dn);let fn;t[74]!==f||t[75]!==ln||t[76]!==un||t[77]!==dn?(fn=(0,$.jsxs)(`div`,{className:`relative`,children:[cn,(0,$.jsx)(Ni,{value:f,onChange:ln,placeholder:un,"aria-label":dn,className:`ps-8`,"data-testid":`configure-agents-search`})]}),t[74]=f,t[75]=ln,t[76]=un,t[77]=dn,t[78]=fn):fn=t[78];let pn;t[79]!==a||t[80]!==W?(pn=W?(0,$.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2 rounded-md border px-3 py-2.5 text-muted-foreground text-sm`,"data-testid":`configure-agents-read-only`,children:[(0,$.jsx)(di,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{children:a({id:`RD8cCw`})})]}):null,t[79]=a,t[80]=W,t[81]=pn):pn=t[81];let mn;t[82]!==a||t[83]!==V?(mn=V?(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border px-3 py-2.5 text-muted-foreground text-sm`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Ua,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{role:`status`,children:a({id:`4sE6E9`})})]}),(0,$.jsx)(H,{type:`button`,variant:`outline`,size:`sm`,className:`shrink-0`,onClick:()=>ee(No),children:a({id:`6gRgw8`})})]}):null,t[82]=a,t[83]=V,t[84]=mn):mn=t[84];let hn;t[85]!==a||t[86]!==xt?(hn=xt?(0,$.jsx)(`p`,{className:`py-6 text-center text-muted-foreground text-sm`,"data-testid":`configure-agents-no-results`,children:a({id:`Nay2Yr`})}):null,t[85]=a,t[86]=xt,t[87]=hn):hn=t[87];let gn=`configure:${te??`closed`}`,_n;t[88]===te?_n=t[89]:(_n=te!==null&&M(te),t[88]=te,t[89]=_n);let vn=Se!==null,yn;t[90]===re?yn=t[91]:(yn=e=>{e||(re.current!==null&&($e(re.current,!1),re.current=null),q(null))},t[90]=re,t[91]=yn);let bn;t[92]!==Te||t[93]!==Se||t[94]!==re?(bn=(e,t)=>Se===null?Promise.resolve({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null}):Te(O(Se,e,t)).then(e=>(e.ok&&(re.current=null),e)),t[92]=Te,t[93]=Se,t[94]=re,t[95]=bn):bn=t[95];let X;t[96]!==Se||t[97]!==gn||t[98]!==_n||t[99]!==vn||t[100]!==yn||t[101]!==bn?(X=(0,$.jsx)(I,{connection:Se,paired:_n,open:vn,onOpenChange:yn,onSave:bn},gn),t[96]=Se,t[97]=gn,t[98]=_n,t[99]=vn,t[100]=yn,t[101]=bn,t[102]=X):X=t[102];let xn=`remove:${J??`closed`}`,Sn;t[103]===J?Sn=t[104]:(Sn=J!==null&&M(J),t[103]=J,t[104]=Sn);let Cn=Ce!==null,wn;t[105]===Symbol.for(`react.memo_cache_sentinel`)?(wn=e=>{e||ne(null)},t[105]=wn):wn=t[105];let Tn;t[106]!==Te||t[107]!==Ce?(Tn=e=>Ce===null?Promise.resolve({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null}):Te(z(Ce,e===void 0?[]:e)),t[106]=Te,t[107]=Ce,t[108]=Tn):Tn=t[108];let En;t[109]!==Ce||t[110]!==xn||t[111]!==Sn||t[112]!==Cn||t[113]!==Tn?(En=(0,$.jsx)(j,{connection:Ce,paired:Sn,open:Cn,onOpenChange:wn,onRemove:Tn},xn),t[109]=Ce,t[110]=xn,t[111]=Sn,t[112]=Cn,t[113]=Tn,t[114]=En):En=t[114];let Dn;return t[115]!==rn||t[116]!==sn||t[117]!==fn||t[118]!==pn||t[119]!==mn||t[120]!==hn||t[121]!==X||t[122]!==En?(Dn=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-configure-agents-title`,className:`space-y-6`,"data-field":`section:agent-connections`,"data-testid":`settings-configure-agents`,children:[sn,fn,pn,mn,hn,rn,X,En]}),t[115]=rn,t[116]=sn,t[117]=fn,t[118]=pn,t[119]=mn,t[120]=hn,t[121]=X,t[122]=En,t[123]=Dn):Dn=t[123],Dn}function No(e){return e+1}function Po(e){return e.node}function Fo(e,t){return Number(t.hasPresent)-Number(e.hasPresent)}function Io(e){return!e}function Lo(e){return!e}function Ro(e){return e!==void 0}function zo(e){return bt(e.id)}function Bo(e){return e!==void 0}function Vo(e){return Do(e)}function Ho(e){let{signal:t}=e;return ut(t)}var Uo=`open-knowledge-app`;function Wo({from:e,to:t}){try{bn.getTracer(Uo).startSpan(`ok.language.preferenceChanged`,{attributes:{"ok.language.from":e,"ok.language.to":t}}).end()}catch(e){console.warn(`[language-telemetry] span emit failed:`,e instanceof Error?e:String(e))}}var Go=`open-knowledge-app`;function Ko(e){let t=e.light.startsWith(`saved-`),n=e.dark.startsWith(`saved-`);return!t||!n?`incomplete`:e.light===e.dark?`same`:`different`}function qo(e){try{bn.getTracer(Go).startSpan(`ok.saved_themes.assignment`,{attributes:{"saved_theme.pair":Ko(e)}}).end()}catch(e){console.warn(`[saved-theme-telemetry] assignment span emit failed:`,e instanceof Error?e:String(e))}}var Jo=`system`;function Yo(e){return typeof e==`string`&&gn.includes(e)}function Xo(e){return Yo(e)?e:Jo}function Zo(e){return new Intl.DisplayNames([e],{type:`language`}).of(e)??e}function Qo(e){let t=(0,Q.c)(6),{choice:n}=e;if(n===Jo){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(m,{id:`D-NlUC`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=Zo(n),t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,$.jsx)(`span`,{lang:n,className:`capitalize`,children:r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function $o(e){let t=(0,Q.c)(22),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({value:o,onValueChange:r,onBlur:n,ref:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===o?s=t[7]:(s=Xo(o),t[6]=o,t[7]=s);let c=s,l;t[8]===r?l=t[9]:(l=e=>r(Xo(e)),t[8]=r,t[9]=l);let u;t[10]===c?u=t[11]:(u=(0,$.jsx)(We,{children:(0,$.jsx)(Qo,{choice:c})}),t[10]=c,t[11]=u);let d;t[12]!==n||t[13]!==i||t[14]!==a||t[15]!==u?(d=(0,$.jsx)(Ue,{...a,ref:i,onBlur:n,size:`sm`,className:`w-48`,children:u}),t[12]=n,t[13]=i,t[14]=a,t[15]=u,t[16]=d):d=t[16];let f;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(He,{children:[(0,$.jsx)(Ve,{value:Jo,children:(0,$.jsx)(Qo,{choice:Jo})}),ln.map(es)]}),t[17]=f):f=t[17];let p;return t[18]!==c||t[19]!==l||t[20]!==d?(p=(0,$.jsxs)(Ge,{value:c,onValueChange:l,children:[d,f]}),t[18]=c,t[19]=l,t[20]=d,t[21]=p):p=t[21],p}function es(e){return(0,$.jsx)(Ve,{value:e,children:(0,$.jsx)(Qo,{choice:e})},e)}function ts(e){return{chrome:e.sidebar,surface:e.background,bar:e.primary,line:e.border,dots:[e[`syntax-string`],e[`syntax-keyword`],e[`syntax-atom`]]}}function ns(e,t,n){return e.id===`custom`?ts(Zt(qi(t))):e.scheme?ts(Zt(e.scheme)):ts(Vi(n))}function rs(e){let t=(0,Q.c)(38),{theme:n,customSeed:r,slotMode:i}=e,a,o,s,c,l,u,d,f,p,m;t[0]!==r||t[1]!==i||t[2]!==n?(a=ns(n,r,i),u=!0,d=``,f=`aspect-[4/3] w-full overflow-hidden rounded-md border`,p={backgroundColor:a.surface,borderColor:a.line},m=(0,$.jsxs)(`div`,{className:`flex h-1/3 items-center gap-1 px-1.5`,style:{backgroundColor:a.chrome,borderBottom:`1px solid ${a.line}`},children:[(0,$.jsx)(`span`,{className:`h-1.5 w-5 rounded-full`,style:{backgroundColor:a.bar}}),(0,$.jsx)(`span`,{className:`h-1.5 flex-1 rounded-full opacity-50`,style:{backgroundColor:a.line}})]}),l=`flex h-2/3`,o=`flex w-1/4 flex-col items-center justify-center gap-1`,s={backgroundColor:a.chrome,borderRight:`1px solid ${a.line}`},c=a.dots.map(is),t[0]=r,t[1]=i,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m):(a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]);let h;t[13]!==o||t[14]!==s||t[15]!==c?(h=(0,$.jsx)(`div`,{className:o,style:s,children:c}),t[13]=o,t[14]=s,t[15]=c,t[16]=h):h=t[16];let g;t[17]===a.dots[1]?g=t[18]:(g=(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-full`,style:{backgroundColor:a.dots[1]}}),t[17]=a.dots[1],t[18]=g);let _;t[19]===a.line?_=t[20]:(_=(0,$.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-full opacity-60`,style:{backgroundColor:a.line}}),t[19]=a.line,t[20]=_);let v;t[21]===a.dots[0]?v=t[22]:(v=(0,$.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-full`,style:{backgroundColor:a.dots[0]}}),t[21]=a.dots[0],t[22]=v);let y;t[23]!==g||t[24]!==_||t[25]!==v?(y=(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1 px-1.5`,children:[g,_,v]}),t[23]=g,t[24]=_,t[25]=v,t[26]=y):y=t[26];let b;t[27]!==h||t[28]!==y||t[29]!==l?(b=(0,$.jsxs)(`div`,{className:l,children:[h,y]}),t[27]=h,t[28]=y,t[29]=l,t[30]=b):b=t[30];let x;return t[31]!==b||t[32]!==u||t[33]!==d||t[34]!==f||t[35]!==p||t[36]!==m?(x=(0,$.jsxs)(`div`,{"aria-hidden":u,"data-theme-swatch":d,className:f,style:p,children:[m,b]}),t[31]=b,t[32]=u,t[33]=d,t[34]=f,t[35]=p,t[36]=m,t[37]=x):x=t[37],x}function is(e,t){return(0,$.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{backgroundColor:e}},t)}function as(e){return b(`size-6 min-w-6 rounded-md border p-0 transition-colors`,e?`border-primary bg-primary/15 text-primary hover:bg-primary/20 data-[state=on]:bg-primary/15`:`border-border/70 text-muted-foreground/70 hover:text-foreground`)}function os(e){return b(`size-3.5`,e&&`fill-current`)}function ss(e){let t=(0,Q.c)(33),{selection:n,themes:r,unavailableThemes:i,onAssign:a,editControl:o,deleteControl:s,createControl:c,slotMode:l,customSeed:u,firstItemId:d,"aria-label":f,"aria-describedby":p,"aria-invalid":m}=e,g=r===void 0?an:r,_;t[0]===i?_=t[1]:(_=i===void 0?[]:i,t[0]=i,t[1]=_);let v=_,y=l===void 0?`light`:l,{_:x}=h(),S;if(t[2]!==x||t[3]!==u||t[4]!==s||t[5]!==o||t[6]!==d||t[7]!==a||t[8]!==n||t[9]!==y||t[10]!==g){let e;t[12]!==x||t[13]!==u||t[14]!==s||t[15]!==o||t[16]!==d||t[17]!==a||t[18]!==n||t[19]!==y?(e=(e,t)=>{let r=n.light===e.id,i=n.dark===e.id,c=o?.themeIds.includes(e.id)??!1,l=s?.themeIds.includes(e.id)??!1,f=o?.selectedId===e.id,p=x(y===`light`?{id:`hgF0al`,values:{0:e.label}}:{id:`6Nea1q`,values:{0:e.label}});return(0,$.jsxs)(`fieldset`,{"aria-label":e.label,className:b(`relative flex min-w-0 flex-col gap-1.5 rounded-lg border-2 p-1 text-left`,n[y]===e.id?`border-primary`:`border-transparent`),children:[(0,$.jsx)(H,{type:`button`,variant:`ghost`,"aria-label":p,"data-theme-focus-target":``,onClick:()=>a(y,e.id),className:`h-auto w-full cursor-pointer p-0 transition-opacity hover:bg-transparent hover:opacity-90`,children:(0,$.jsx)(rs,{theme:e,customSeed:u,slotMode:y})}),l?(0,$.jsx)(H,{type:`button`,variant:`outline`,size:`icon-sm`,title:x({id:`Y2tU6I`,values:{0:e.label}}),"aria-label":x({id:`Y2tU6I`,values:{0:e.label}}),className:`absolute top-2 end-2 z-10 border-border/80 bg-background/85 text-muted-foreground shadow-sm backdrop-blur-sm hover:border-destructive/50 hover:bg-destructive/15 hover:text-destructive focus-visible:border-destructive/50 focus-visible:text-destructive focus-visible:ring-destructive/20 dark:bg-background/80 dark:hover:bg-destructive/20`,onClick:async t=>{let n=t.currentTarget.closest(`fieldset`),r=n?.previousElementSibling?.querySelector(`[data-theme-focus-target]`)??n?.nextElementSibling?.querySelector(`[data-theme-focus-target]`);await s?.onDelete(e.id)!==!1&&r?.focus()},children:(0,$.jsx)(ui,{"aria-hidden":!0})}):null,(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-1 px-0.5`,children:[(0,$.jsx)(`span`,{className:`truncate text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[c?(0,$.jsx)(Xe,{className:as(f),pressed:f,onPressedChange:t=>{o?.onSelect(t?e.id:null)},"aria-label":x(f?{id:`8x6zk9`,values:{0:e.label}}:{id:`N6j2JH`,values:{0:e.label}}),children:(0,$.jsx)(Pn,{className:`size-3.5`})}):null,(0,$.jsx)(Xe,{id:t===0?d:void 0,className:as(r),pressed:r,onPressedChange:t=>{t&&a(`light`,e.id)},"aria-label":x({id:`sq4WQH`,values:{0:e.label}}),children:(0,$.jsx)(ii,{className:os(r)})}),(0,$.jsx)(Xe,{className:as(i),pressed:i,onPressedChange:t=>{t&&a(`dark`,e.id)},"aria-label":x({id:`lZvQrY`,values:{0:e.label}}),children:(0,$.jsx)(ai,{className:os(i)})})]})]})]},e.id)},t[12]=x,t[13]=u,t[14]=s,t[15]=o,t[16]=d,t[17]=a,t[18]=n,t[19]=y,t[20]=e):e=t[20],S=g.map(e),t[2]=x,t[3]=u,t[4]=s,t[5]=o,t[6]=d,t[7]=a,t[8]=n,t[9]=y,t[10]=g,t[11]=S}else S=t[11];let C;t[21]!==x||t[22]!==c?(C=c?(0,$.jsxs)(H,{type:`button`,variant:`ghost`,onClick:c.onCreate,className:`group h-auto min-w-0 flex-col items-stretch gap-1.5 rounded-lg border-2 border-transparent p-1 text-left text-muted-foreground hover:bg-transparent hover:text-foreground`,children:[(0,$.jsx)(`span`,{className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-dashed border-border bg-muted/10 transition-colors group-hover:border-foreground/40`,children:(0,$.jsx)(Mn,{"aria-hidden":!0,className:`size-6`})}),(0,$.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium`,children:x({id:`AJ7_B2`})})]}):null,t[21]=x,t[22]=c,t[23]=C):C=t[23];let w;t[24]===v?w=t[25]:(w=v.map(cs),t[24]=v,t[25]=w);let T;return t[26]!==p||t[27]!==m||t[28]!==f||t[29]!==S||t[30]!==C||t[31]!==w?(T=(0,$.jsxs)(`fieldset`,{"aria-label":f,"aria-describedby":p,"aria-invalid":m,className:`grid w-full min-w-0 grid-cols-2 gap-2 sm:grid-cols-3`,children:[S,C,w]}),t[26]=p,t[27]=m,t[28]=f,t[29]=S,t[30]=C,t[31]=w,t[32]=T):T=t[32],T}function cs(e){return(0,$.jsxs)(`fieldset`,{"aria-label":e.label,className:`flex min-w-0 flex-col gap-1.5 rounded-lg border-2 border-destructive/40 bg-destructive/5 p-1 text-left`,children:[(0,$.jsx)(`div`,{"aria-hidden":!0,className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-destructive/30 bg-muted/40 text-destructive`,children:(0,$.jsx)(ir,{className:`size-6`})}),(0,$.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`px-0.5 text-xs font-medium text-destructive`,children:e.problem}),(0,$.jsx)(`span`,{className:`px-0.5 pb-0.5 text-xs text-muted-foreground`,children:e.detail})]},e.key)}var ls=12e3;function us(e){let t=(0,Q.c)(210),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({appearance:n,onAssign:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{_:a}=h(),{themes:o,warnings:s,truncated:c,loadError:l,refresh:u,deleteTheme:d,restoreTheme:f,editingThemeId:p,themeEditorOpen:m,selectThemeToEdit:g}=Ai(),[_,v]=(0,Z.useState)(!1),[y,b]=(0,Z.useState)(``),[x,S]=(0,Z.useState)(null),[C,w]=(0,Z.useState)(!1),T=(0,Z.useRef)(null),E,D;t[4]===u?(E=t[5],D=t[6]):(E=()=>{u()},D=[u],t[4]=u,t[5]=E,t[6]=D),(0,Z.useEffect)(E,D);let O;t[7]!==n||t[8]!==o?(O=Dt(n,o),t[7]=n,t[8]=o,t[9]=O):O=t[9];let k=O,A,j,M,N,P,F,I,L,R,z,B,V,U,W,G,K,ee,te,q,J,ne;if(t[10]!==a||t[11]!==x||t[12]!==y||t[13]!==_||t[14]!==d||t[15]!==p||t[16]!==C||t[17]!==l||t[18]!==r||t[19]!==i||t[20]!==u||t[21]!==f||t[22]!==g||t[23]!==k||t[24]!==m||t[25]!==o||t[26]!==c||t[27]!==s){let e=$t(y),n;t[49]===o?n=t[50]:(n=o.filter(hs),t[49]=o,t[50]=n);let h=n,E,D,O,re,ie,ae,oe,se,ce;if(t[51]!==a||t[52]!==y||t[53]!==d||t[54]!==p||t[55]!==h||t[56]!==C||t[57]!==l||t[58]!==r||t[59]!==i||t[60]!==u||t[61]!==f||t[62]!==g||t[63]!==k||t[64]!==m||t[65]!==o||t[66]!==c||t[67]!==s){let e=o.flatMap(ms),n;t[80]!==a||t[81]!==u||t[82]!==f?(n=async function(e){let t=await f({id:e.id,name:e.scheme.name,stem:e.stem,scheme:{...e.scheme,palette:{...e.scheme.palette}},extension:e.filename.endsWith(`.yml`)?`.yml`:`.yaml`});if(t.ok){await u(),X.success(a({id:`Kx881F`,values:{0:e.label}}));return}if(t.reason===`name-taken`){X.error(a({id:`oZUYMv`,values:{0:e.label}}));return}X.error(a({id:`7O7REc`,values:{0:e.label}}))},t[80]=a,t[81]=u,t[82]=f,t[83]=n):n=t[83];let _=n;O=async function(t){let n=e.find(e=>e.id===t);if(!n)return X.error(a({id:`ANFxWn`})),!1;let r=await d(n.id);if(!r.ok)return X.error(a({id:`kkux8f`,values:{0:n.label}})),!1;if(p===n.id&&g(null),await u(),!r.existed)return X(a({id:`ekSPiP`,values:{0:n.label}})),!0;let i={...n,filename:r.filename,label:r.scheme.name,scheme:r.scheme};return X(a({id:`YCmS3k`,values:{0:i.label}}),{duration:ls,action:{label:a({id:`9uI_rE`}),onClick:()=>_(i)}}),!0};let x;t[84]!==a||t[85]!==y||t[86]!==C||t[87]!==r||t[88]!==i||t[89]!==u||t[90]!==f||t[91]!==g||t[92]!==k||t[93]!==o?(x=async function(e){if(e.preventDefault(),C)return;let t=$t(y);if(!t.ok){S(a({id:`RG3yW6`})),T.current?.focus();return}let n=i.slotMode??`light`,s=o.find(e=>e.id===k[n])?.scheme??qi(i.customSeed),c={name:t.name,variant:s.variant,palette:{...s.palette}};S(null),w(!0);let l=await f({id:t.id,name:t.name,scheme:c});if(!l.ok){S(l.reason===`name-taken`?a({id:`_IfSZn`}):l.reason===`name-invalid`?a({id:`qtnmEX`}):a({id:`DmkTrb`})),w(!1),T.current?.focus();return}let d={id:l.id,label:c.name,kind:c.variant,scheme:c,toTokens:()=>Zt(c)};r(n,l.id,k,[...o,d]),await u(),b(``),v(!1),w(!1),g(l.id)},t[84]=a,t[85]=y,t[86]=C,t[87]=r,t[88]=i,t[89]=u,t[90]=f,t[91]=g,t[92]=k,t[93]=o,t[94]=x):x=t[94],D=x;let A;if(t[95]!==a||t[96]!==s){let e;t[98]===a?e=t[99]:(e=e=>{let t;bb90:switch(e.code){case`unparseable`:t=a({id:`g12y1g`});break bb90;case`not-a-scheme`:t=a({id:`p7Utw8`});break bb90;case`missing-slots`:t=a({id:`GUZHkL`});break bb90;case`bad-hex`:t=a({id:`IMLUBh`});break bb90;case`empty`:t=a({id:`k_tFzX`});break bb90;case`too-long`:t=a({id:`FyyIjH`});break bb90;case`invalid-chars`:t=a({id:`JaU1ld`});break bb90;case`unsupported-extension-case`:t=a({id:`R30SFt`});break bb90;case`duplicate-identity`:t=a({id:`DUb7Ax`});break bb90;case`symlink`:t=a({id:`hFmYGU`});break bb90;case`not-regular-file`:t=a({id:`UH0Zqw`});break bb90;case`file-too-large`:t=a({id:`-othoN`});break bb90;case`read-failed`:t=a({id:`cLn264`});break bb90;default:t=a({id:`WBNpt9`,values:{0:e.code}})}return{key:e.filename,label:e.filename,problem:t,detail:e.conflictingFilenames?a({id:`QwG_zJ`,values:{0:e.conflictingFilenames.join(`, `)}}):a({id:`kwNS82`})}},t[98]=a,t[99]=e),A=s.map(e),t[95]=a,t[96]=s,t[97]=A}else A=t[97];let j=A;V=`flex w-full min-w-0 flex-col gap-2`,t[100]!==a||t[101]!==l||t[102]!==u?(U=l?(0,$.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-foreground`,children:[(0,$.jsx)(`span`,{children:a({id:`hVzt9x`})}),(0,$.jsx)(H,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>void u(),children:a({id:`KDw4GX`})})]}):null,t[100]=a,t[101]=l,t[102]=u,t[103]=U):U=t[103];let M;t[104]!==a||t[105]!==c?(M=c?(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-sm text-foreground`,children:[(0,$.jsx)(di,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-amber-600`}),(0,$.jsx)(`span`,{children:a({id:`DLIljL`})})]}):null,t[104]=a,t[105]=c,t[106]=M):M=t[106],t[107]===M?W=t[108]:(W=(0,$.jsx)(`div`,{role:`status`,children:M}),t[107]=M,t[108]=W),E=ss,ie=i,ae=k,oe=h,se=j;let N;t[109]===o?N=t[110]:(N=o.filter(ps).map(fs),t[109]=o,t[110]=N);let P=m?p:null;t[111]!==g||t[112]!==N||t[113]!==P?(ce={themeIds:N,selectedId:P,onSelect:g},t[111]=g,t[112]=N,t[113]=P,t[114]=ce):ce=t[114],re=e.map(ds),t[51]=a,t[52]=y,t[53]=d,t[54]=p,t[55]=h,t[56]=C,t[57]=l,t[58]=r,t[59]=i,t[60]=u,t[61]=f,t[62]=g,t[63]=k,t[64]=m,t[65]=o,t[66]=c,t[67]=s,t[68]=E,t[69]=D,t[70]=O,t[71]=V,t[72]=U,t[73]=W,t[74]=re,t[75]=ie,t[76]=ae,t[77]=oe,t[78]=se,t[79]=ce}else E=t[68],D=t[69],O=t[70],V=t[71],U=t[72],W=t[73],re=t[74],ie=t[75],ae=t[76],oe=t[77],se=t[78],ce=t[79];let le;t[115]!==O||t[116]!==re?(le={themeIds:re,onDelete:O},t[115]=O,t[116]=re,t[117]=le):le=t[117];let ue;t[118]===Symbol.for(`react.memo_cache_sentinel`)?(ue={onCreate:()=>v(!0)},t[118]=ue):ue=t[118];let de;t[119]!==r||t[120]!==k||t[121]!==o?(de=(e,t)=>r(e,t,k,o),t[119]=r,t[120]=k,t[121]=o,t[122]=de):de=t[122],t[123]!==E||t[124]!==ie||t[125]!==ae||t[126]!==oe||t[127]!==se||t[128]!==ce||t[129]!==le||t[130]!==de?(G=(0,$.jsx)(E,{...ie,selection:ae,themes:oe,unavailableThemes:se,editControl:ce,deleteControl:le,createControl:ue,onAssign:de}),t[123]=E,t[124]=ie,t[125]=ae,t[126]=oe,t[127]=se,t[128]=ce,t[129]=le,t[130]=de,t[131]=G):G=t[131],P=xi,z=_,t[132]===C?B=t[133]:(B=e=>{C||v(e)},t[132]=C,t[133]=B),N=gi;let fe;t[134]===a?fe=t[135]:(fe=a({id:`Z_nNa2`}),t[134]=a,t[135]=fe);let pe;t[136]===fe?pe=t[137]:(pe=(0,$.jsx)(hi,{children:fe}),t[136]=fe,t[137]=pe);let me;t[138]===a?me=t[139]:(me=a({id:`nTM8ab`}),t[138]=a,t[139]=me);let he;t[140]===me?he=t[141]:(he=(0,$.jsx)(mi,{children:me}),t[140]=me,t[141]=he),t[142]!==pe||t[143]!==he?(R=(0,$.jsxs)(bi,{className:`gap-2`,children:[pe,he]}),t[142]=pe,t[143]=he,t[144]=R):R=t[144],M=_i,F=`create-saved-theme-form`,I=!0,L=D,j=Ti,q=x!==null;let ge;t[145]===a?ge=t[146]:(ge=a({id:`HZ7fEu`}),t[145]=a,t[146]=ge),t[147]===ge?J=t[148]:(J=(0,$.jsx)(Ci,{htmlFor:`create-saved-theme-name`,children:ge}),t[147]=ge,t[148]=J);let _e=x!==null,ve=x?`create-saved-theme-help create-saved-theme-error`:`create-saved-theme-help`,ye;t[149]===x?ye=t[150]:(ye=e=>{b(e.target.value),x&&S(null)},t[149]=x,t[150]=ye),t[151]!==y||t[152]!==C||t[153]!==_e||t[154]!==ve||t[155]!==ye?(ne=(0,$.jsx)(Ni,{ref:T,id:`create-saved-theme-name`,value:y,autoFocus:!0,autoComplete:`off`,required:!0,readOnly:C,"aria-invalid":_e,"aria-describedby":ve,onChange:ye}),t[151]=y,t[152]=C,t[153]=_e,t[154]=ve,t[155]=ye,t[156]=ne):ne=t[156],A=wi,K=`create-saved-theme-help`,ee=`font-mono`,te=e.ok?a({id:`Yb82LN`,values:{0:e.stem}}):a({id:`4d0VYJ`}),t[10]=a,t[11]=x,t[12]=y,t[13]=_,t[14]=d,t[15]=p,t[16]=C,t[17]=l,t[18]=r,t[19]=i,t[20]=u,t[21]=f,t[22]=g,t[23]=k,t[24]=m,t[25]=o,t[26]=c,t[27]=s,t[28]=A,t[29]=j,t[30]=M,t[31]=N,t[32]=P,t[33]=F,t[34]=I,t[35]=L,t[36]=R,t[37]=z,t[38]=B,t[39]=V,t[40]=U,t[41]=W,t[42]=G,t[43]=K,t[44]=ee,t[45]=te,t[46]=q,t[47]=J,t[48]=ne}else A=t[28],j=t[29],M=t[30],N=t[31],P=t[32],F=t[33],I=t[34],L=t[35],R=t[36],z=t[37],B=t[38],V=t[39],U=t[40],W=t[41],G=t[42],K=t[43],ee=t[44],te=t[45],q=t[46],J=t[47],ne=t[48];let re;t[157]!==A||t[158]!==K||t[159]!==ee||t[160]!==te?(re=(0,$.jsx)(A,{id:K,className:ee,children:te}),t[157]=A,t[158]=K,t[159]=ee,t[160]=te,t[161]=re):re=t[161];let ie;t[162]===x?ie=t[163]:(ie=x?(0,$.jsx)(Si,{id:`create-saved-theme-error`,children:x}):null,t[162]=x,t[163]=ie);let ae;t[164]!==j||t[165]!==re||t[166]!==ie||t[167]!==q||t[168]!==J||t[169]!==ne?(ae=(0,$.jsxs)(j,{"data-invalid":q,children:[J,ne,re,ie]}),t[164]=j,t[165]=re,t[166]=ie,t[167]=q,t[168]=J,t[169]=ne,t[170]=ae):ae=t[170];let oe;t[171]!==F||t[172]!==I||t[173]!==L||t[174]!==ae?(oe=(0,$.jsx)(`form`,{id:F,noValidate:I,onSubmit:L,children:ae}),t[171]=F,t[172]=I,t[173]=L,t[174]=ae,t[175]=oe):oe=t[175];let se;t[176]!==M||t[177]!==oe?(se=(0,$.jsx)(M,{children:oe}),t[176]=M,t[177]=oe,t[178]=se):se=t[178];let ce;t[179]===Symbol.for(`react.memo_cache_sentinel`)?(ce=()=>v(!1),t[179]=ce):ce=t[179];let le;t[180]===a?le=t[181]:(le=a({id:`dEgA5A`}),t[180]=a,t[181]=le);let ue;t[182]!==C||t[183]!==le?(ue=(0,$.jsx)(H,{type:`button`,variant:`outline`,disabled:C,onClick:ce,children:le}),t[182]=C,t[183]=le,t[184]=ue):ue=t[184];let de;t[185]!==a||t[186]!==C?(de=a(C?{id:`_DwR-n`}:{id:`cuHhjo`}),t[185]=a,t[186]=C,t[187]=de):de=t[187];let fe;t[188]!==C||t[189]!==de?(fe=(0,$.jsx)(H,{type:`submit`,form:`create-saved-theme-form`,disabled:C,children:de}),t[188]=C,t[189]=de,t[190]=fe):fe=t[190];let pe;t[191]!==ue||t[192]!==fe?(pe=(0,$.jsxs)(vi,{children:[ue,fe]}),t[191]=ue,t[192]=fe,t[193]=pe):pe=t[193];let me;t[194]!==N||t[195]!==R||t[196]!==se||t[197]!==pe?(me=(0,$.jsxs)(N,{children:[R,se,pe]}),t[194]=N,t[195]=R,t[196]=se,t[197]=pe,t[198]=me):me=t[198];let he;t[199]!==P||t[200]!==z||t[201]!==B||t[202]!==me?(he=(0,$.jsx)(P,{open:z,onOpenChange:B,children:me}),t[199]=P,t[200]=z,t[201]=B,t[202]=me,t[203]=he):he=t[203];let ge;return t[204]!==V||t[205]!==U||t[206]!==W||t[207]!==G||t[208]!==he?(ge=(0,$.jsxs)(`div`,{className:V,children:[U,W,G,he]}),t[204]=V,t[205]=U,t[206]=W,t[207]=G,t[208]=he,t[209]=ge):ge=t[209],ge}function ds(e){return e.id}function fs(e){return e.id}function ps(e){return e.id.startsWith(`saved-`)}function ms(e){let t=Mt(e.id);return!t.ok||!e.scheme?[]:[{id:e.id,stem:t.stem,label:e.label,scheme:e.scheme}]}function hs(e){return e.id!==`custom`}function gs(e,t){if(e.length===0)throw Error(`buildPatch: path must be non-empty`);let[n,...r]=e;return r.length===0?{[String(n)]:t}:{[String(n)]:gs(r,t)}}function _s(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(e?.type===`default`){let t=e.defaultValue;return typeof t==`function`?t():t}let n=t?._zod?.def?.innerType;if(n===void 0)return;t=n}}function vs(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`default`||e.type===`optional`||e.type===`nullable`){t=e.innerType;continue}return e.type}}function ys(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`enum`)return e.entries?Object.values(e.entries):void 0;if(e.innerType!==void 0){t=e.innerType;continue}return}}function bs(e){let t=(0,Q.c)(14),n;t[0]===e?n=t[1]:(n=e.current(),t[0]=e,t[1]=n);let r=n,i;t[2]===r?i=t[3]:(i={defaultValues:r,mode:`onBlur`},t[2]=r,t[3]=i);let a=Ta(i),o,s;t[4]!==e||t[5]!==a?(o=()=>e.subscribe(e=>{xs(a,e)}),s=[e,a],t[4]=e,t[5]=a,t[6]=o,t[7]=s):(o=t[6],s=t[7]),(0,Z.useEffect)(o,s);let c;t[8]!==e||t[9]!==a?(c=t=>Ss(a,e,t),t[8]=e,t[9]=a,t[10]=c):c=t[10];let l=c,u;return t[11]!==l||t[12]!==a?(u={form:a,commitField:l},t[11]=l,t[12]=a,t[13]=u):u=t[13],u}function xs(e,t){e.reset(t,{keepDirtyValues:!0,keepDirty:!0,keepTouched:!0})}function Ss(e,t,n){let r=e.getValues(n),i=gs(Ts(n),r),a=t.patch(i);if(a.ok)return e.clearErrors(n),e.resetField(n,{defaultValue:r,keepError:!1}),!0;if(vt(a.error)&&a.error.code===`SCHEMA_INVALID`&&a.error.issues.length>0){e.clearErrors(n);for(let t of a.error.issues){let r=t.path.length>0?t.path.map(String).join(`.`):n;e.setError(r,{type:`config-binding`,message:t.message})}}else e.setError(n,{type:`config-binding`,message:Cs(a.error,n)});return!1}function Cs(e,t){if(vt(e)&&e.code===`SCHEMA_INVALID`){let n=e.issues.find(e=>ws(e,t));if(n)return n.message}return _n(e)}function ws(e,t){return e.path.map(String).join(`.`)===t}function Ts(e){return e.split(`.`)}function Es(e){if(!vt(e)||e.code!==`SCHEMA_INVALID`)return null;let t=e.issues[0];return!t||t.path.length===0?null:t.path.map(String).join(`.`)}function Ds(){let e=(0,Q.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(ra,{className:`h-5 w-32`}),n=(0,$.jsx)(ra,{className:`h-4 w-64`}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[t,n,(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(ra,{className:`h-9 w-full`}),(0,$.jsx)(ra,{className:`h-9 w-full`})]})]}),e[2]=r):r=e[2],r}function Os({field:e,scope:t,commitField:n,isFlashed:r}){"use no memo";let{_:i}=h(),a=ka(),{setTheme:o}=_(),s=Fn(),c=It(St,e.path),l=c?vs(c):void 0,u=c?_s(c):void 0,d=c?ys(c):void 0,f=c?Kt(c):void 0,p=f?.scope===`project`&&t!==`project`||f?.scope===`user`&&t!==`user`,g=e.path.join(`.`),v=i(e.label),[y,x]=(0,Z.useState)(!1),S=(0,Z.useRef)(null);(0,Z.useEffect)(()=>()=>{S.current&&clearTimeout(S.current)},[]);let C=()=>{x(!0),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>x(!1),1200)},w=()=>{let e=n(g);return e&&C(),e},T=()=>a.getFieldState(g).isDirty?w():!0,E=()=>{if(e.control===`theme-tiles`){let e=s?.userBinding;if(!e)return;let t=e.patch({appearance:Bi()});t.ok?C():a.setError(g,{type:`manual`,message:Cs(t.error,g)});return}let t=u===void 0?null:u;a.setValue(g,t,{shouldDirty:!1}),e.control===`theme-cards`&&o(Ln(t)),w()},D=b(`relative`,r&&`animate-settings-flash`);return(0,$.jsx)(Ea,{control:a.control,name:g,render:({field:n})=>{let r=!p&&(u!==void 0||n.value!==void 0);return(0,$.jsxs)(wa,{className:D,"data-field":e.path.join(`.`),"data-scope":t,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(Oa,{className:`text-sm font-medium`,children:v}),r?(0,$.jsxs)(K,{children:[(0,$.jsx)(U,{asChild:!0,children:(0,$.jsx)(H,{variant:`ghost`,size:`icon`,className:`h-5 w-5 text-muted-foreground opacity-60 hover:opacity-100`,onClick:E,"aria-label":i({id:`lhjq3G`,values:{labelText:v}}),children:(0,$.jsx)(si,{className:`size-3.5`})})}),(0,$.jsx)(W,{children:(0,$.jsx)(m,{id:`L-rMC9`})})]}):null]}),e.description?(0,$.jsx)(Aa,{className:`text-muted-foreground text-1sm`,children:i(e.description)}):null,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Da,{children:(0,$.jsx)(As,{field:e,ctl:n,typeTag:l,enumOptions:d,onCommit:T,onRevertToBaseline:()=>a.resetField(g,{keepError:!0}),onSavedOutsideForm:C,onWriteRejected:e=>{a.setError(g,{type:`manual`,message:Cs(e,g)})}})}),(0,$.jsx)(Ps,{visible:y,srOnly:ks(e.control)})]}),(0,$.jsx)(ja,{"data-field-error":e.path.join(`.`)})]})}})}function ks(e){return e===`theme-tiles`||e===`theme-cards`}function As({field:e,ctl:t,typeTag:n,enumOptions:r,onCommit:i,onRevertToBaseline:a,onSavedOutsideForm:o,onWriteRejected:s,...c}){"use no memo";let{_:l}=h(),{setTheme:u,systemTheme:d}=_(),f=Fn(),p=f?.merged??null;if(e.control===`language-select`)return(0,$.jsx)($o,{...c,value:t.value,ref:t.ref,onBlur:t.onBlur,onValueChange:e=>{let n=Ji(t.value)??`system`;n!==e&&Wo({from:n,to:e}),t.onChange(e),i()}});if(e.control===`theme-cards`){let{id:n,...r}=c;return(0,$.jsx)(oi,{...r,firstItemId:n,value:Ln(t.value),"aria-label":l(e.label),onValueChange:e=>{let n=Ln(t.value);u(e),t.onChange(e),!i()&&(u(n),a())}})}if(e.control===`theme-tiles`){let{id:t,...n}=c,r=p?.appearance?.customTheme,i=p?.appearance?.theme,a=ht(i,d===`dark`);return(0,$.jsx)(us,{...n,firstItemId:t,appearance:p?.appearance,customSeed:r,slotMode:a,"aria-label":l(e.label),onAssign:(e,t,n,c)=>{let l=f?.userBinding;if(!l)return;let d={...n,[e]:t},p=e=>{let t=e[a];return t===`custom`?Ui(qi(r)):zi(t,c)};Ri({selection:d,modePreference:i,slotMode:a,customSeed:r,themes:c}),u(p(d)??i??`system`);let m=l.patch({appearance:Wi(d)});if(m.ok){qo(d),o();return}Ri({selection:n,modePreference:i,slotMode:a,customSeed:r,themes:c}),u(p(n)??i??`system`),s(m.error)}})}if(n===`boolean`)return(0,$.jsx)(Je,{...c,checked:!!t.value,ref:t.ref,onCheckedChange:e=>{t.onChange(e),i()},onBlur:t.onBlur});if(n===`enum`&&r&&r.length>0&&(e.control===`enum-toggle`||r.length<=4)){let{id:n,...a}=c;return(0,$.jsx)(Ze,{...a,type:`single`,value:typeof t.value==`string`?t.value:``,ref:t.ref,onValueChange:e=>{e&&(t.onChange(e),i())},onBlur:t.onBlur,variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-lg`,"aria-label":l(e.label),children:r.map((e,t)=>(0,$.jsx)(Ye,{value:e,id:t===0?n:void 0,className:`text-1sm capitalize`,children:e},e))})}return n===`number`||n===`int`?(0,$.jsx)(Ms,{ctl:t,onCommit:i,...c}):n===`array`?(0,$.jsx)(Ns,{ctl:t,onCommit:i,...c}):(0,$.jsx)(js,{ctl:t,onCommit:i,...c})}function js({ctl:e,onCommit:t,...n}){"use no memo";return(0,$.jsx)(Ni,{...n,value:typeof e.value==`string`?e.value:``,ref:e.ref,onChange:t=>e.onChange(t.target.value),onBlur:()=>{e.onBlur(),t()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),t())},className:`h-8 text-sm`})}function Ms({ctl:e,onCommit:t,...n}){"use no memo";let[r,i]=(0,Z.useState)(e.value===void 0?``:String(e.value)),a=(0,Z.useRef)(e.value);(0,Z.useEffect)(()=>{a.current!==e.value&&(i(e.value===void 0?``:String(e.value)),a.current=e.value)},[e.value]);let o=()=>{let n=Number(r);if(!Number.isFinite(n)){e.onChange(r),t();return}e.onChange(n),t(),a.current=n};return(0,$.jsx)(Ni,{...n,type:`number`,value:r,ref:e.ref,onChange:e=>i(e.target.value),onBlur:()=>{e.onBlur(),o()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())},className:`h-8 w-28 text-sm tabular-nums`})}function Ns({ctl:e,onCommit:t,...n}){"use no memo";let r=Array.isArray(e.value)?e.value.join(`
|
|
1
|
+
import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{B as r,O as i,Sr as a,at as o,dt as s,gi as c,lt as l,st as u,ut as d,z as f}from"./DocumentContext-D7jvhyCA.js";import{t as p}from"./react-f2sANaYj.js";import{n as m,r as h}from"./dist-Nvb76hAm.js";import{t as g}from"./useQuery-ZeEDLtxh.js";import{n as _}from"./dist-PQ5KMVDh.js";import{t as v}from"./react-dom-DPxgxlDT.js";import{t as y}from"./compiler-runtime-BfE3aGVn.js";import{t as b}from"./utils-CPqDy6Hr.js";import{S as x,_ as S,a as C,b as w,c as T,d as E,f as D,g as O,h as k,i as A,l as j,m as M,o as N,p as P,r as F,s as I,t as L,u as R,v as z,x as B,y as V}from"./agent-connections-BZwWjV-L.js";import{t as H}from"./button-BeFNZANd.js";import{i as U,n as W,r as G,t as K}from"./tooltip-DVBVVaAs.js";import{n as ee,r as te,t as q}from"./collapsible-DYySK8La.js";import{a as J,c as ne,i as re,l as ie,n as ae,o as oe,r as se,s as ce,t as le}from"./alert-dialog-CqqfqWNT.js";import{n as ue,t as de}from"./with-selector-PRoyWQiu.js";import{t as fe}from"./checkbox-Crs_F_Np.js";import{A as pe,C as me,D as he,E as ge,O as _e,S as ve,T as ye,_ as be,b as xe,f as Se,g as Ce,h as we,j as Te,k as Ee,m as De,p as Oe,r as ke,v as Ae,w as je,x as Me,y as Ne}from"./floating-ui.dom-CDtYEnEj.js";import{c as Pe,d as Fe,l as Ie,o as Le,s as Re,u as ze}from"./dist-DYso7MCm.js";import{t as Be}from"./label-D-K3fWtj.js";import{i as Ve,n as He,o as Ue,s as We,t as Ge}from"./select-D_BhUvh8.js";import{n as Ke,t as qe}from"./radio-group-npdxiS6E.js";import{t as Je}from"./switch-iwBsEWej.js";import{n as Ye,r as Xe,t as Ze}from"./toggle-group-BxIyZnUJ.js";import{a as Qe,c as $e,g as et,h as tt,l as nt,n as rt,o as it,r as at,s as Y,t as ot,u as st,y as ct}from"./RegisteredAgentIcon--fiCkSba.js";import{a as lt,i as ut,o as dt}from"./terminal-telemetry-BHuv7G5q.js";import{$o as ft,Ac as pt,As as mt,Bs as ht,Ci as gt,Cn as _t,Cs as vt,Es as yt,Fc as bt,Gc as xt,Go as St,Ic as Ct,Is as wt,Jc as Tt,Jo as Et,Ls as Dt,Mc as Ot,Mr as kt,Ms as At,Nc as jt,Ns as Mt,Ot as Nt,Pc as Pt,Qs as Ft,Rs as It,Tc as Lt,Un as Rt,Uo as zt,Wo as Bt,Xn as Vt,Xo as Ht,Yo as Ut,Ys as Wt,Zc as Gt,_s as Kt,as as qt,ba as Jt,cs as Yt,fi as Xt,fs as Zt,gi as Qt,gs as $t,is as en,js as tn,kc as nn,ks as rn,ls as an,ms as on,mt as sn,nl as cn,os as ln,ot as un,ps as dn,pt as fn,qo as pn,qs as mn,rs as hn,ss as gn,vs as _n,wn as vn,zs as yn}from"./dist-DILeGueK.js";import{t as bn}from"./trace-api-BP9dN1Hz.js";import{n as X}from"./dist-CJhtNlOm2.js";import{d as xn,f as Sn,h as Cn,n as wn,o as Tn,p as En,r as Dn,u as On,v as kn}from"./use-settings-route-DHuAch1j.js";import{t as An}from"./dist-Cr4-nBVI.js";import{c as jn}from"./documents-events-Do7TM3Hd.js";import{a as Mn,i as Nn,o as Pn}from"./local-menu-action-bus-DaoT7_kL.js";import{a as Fn,i as In,t as Ln}from"./use-apply-config-theme-B5w38X1P.js";import{t as Rn}from"./OpenInAgentMenuItem-QrteG6Br.js";import{g as zn,h as Bn,p as Vn,v as Hn,y as Un}from"./SkillInstallMenu-BRjVgdkn.js";import{t as Wn}from"./createLucideIcon-B6ULg5PN.js";import{a as Gn,c as Kn,f as qn,l as Jn,p as Yn,s as Xn,t as Zn}from"./EnableSyncConfirmDialog-B056XoQ0.js";import{p as Qn}from"./Mermaid-DZf1Vjbg.js";import{t as $n}from"./arrow-up-right-B3B9a7te.js";import{t as er}from"./check-BzfGb3KU.js";import{t as tr}from"./chevron-right-C-g4JuT4.js";import{n as nr,t as rr}from"./lint-plugin-meta-zA9wHIBR.js";import{t as ir}from"./circle-alert-Czw40trT.js";import{i as ar,r as or}from"./prop-types-CT1xGqpW.js";import{a as sr,h as cr,r as lr,t as ur}from"./dropdown-menu-BEhl0wvu.js";import{A as dr,B as fr,C as pr,F as mr,G as hr,H as gr,J as _r,K as vr,L as yr,M as br,N as xr,O as Sr,P as Cr,Q as wr,R as Tr,S as Er,U as Dr,V as Or,W as kr,Y as Ar,at as jr,b as Mr,c as Nr,d as Pr,et as Fr,f as Ir,h as Lr,i as Rr,j as zr,k as Br,l as Vr,m as Hr,n as Ur,nt as Wr,o as Gr,p as Kr,q as qr,v as Jr,w as Yr,x as Xr,y as Zr}from"./auth-state-cache-B5AZOzS0.js";import{It as Qr}from"./CodeMirrorPropInput-Bf645WUa.js";import{r as $r,t as ei}from"./use-git-sync-status-CoUdayE7.js";import{o as ti}from"./folder-config-api-CDR1eAcz.js";import{t as ni}from"./info-CilGMBpP.js";import{t as ri}from"./spinner-Bp2_BYkl.js";import{n as ii,r as ai,t as oi}from"./ThemePicker-wGe4WU58.js";import{t as si}from"./rotate-ccw-B05K_aam.js";import{t as ci}from"./square-pen-BhqhPrdL.js";import{t as li}from"./terminal-DGmaW797.js";import{t as ui}from"./trash-2-B9Flu-41.js";import{t as di}from"./triangle-alert-CCeXtPLU.js";import{t as fi}from"./x-DIayTyoR.js";import{t as pi}from"./badge-5sA3wpe0.js";import{a as mi,c as hi,i as gi,n as _i,o as vi,r as yi,s as bi,t as xi}from"./dialog-DJkPMmCN.js";import{i as Si,o as Ci,r as wi,t as Ti}from"./field-BmnhqmEH.js";import{t as Ei}from"./tool-list-format-BVkGh5Od.js";import{n as Di}from"./use-workspace-2aIeQVoi.js";import{d as Oi}from"./doc-paths-BWrKtSx2.js";import{a as ki}from"./startup-marks-vgWlVGPK.js";import{n as Ai}from"./config-provider-Ca2HUShB.js";import{a as ji}from"./skill-scope-CUAEKGV-.js";import{m as Mi}from"./skills-api-CM8h9xtl.js";import{t as Ni}from"./input-3o4m6NnP.js";import{a as Pi,i as Fi,t as Ii}from"./popover-DwsSVA7z.js";import{_ as Li,a as Ri,d as zi,f as Bi,g as Vi,h as Hi,m as Ui,p as Wi,u as Gi,v as Ki,y as qi}from"./css-color-to-hex-AUn7eIel.js";import{n as Ji}from"./use-apply-config-language-BwIOrXvC.js";import{t as Yi}from"./external-link-DCF8KwVP.js";import{t as Xi}from"./ConfigSharingInfoTooltip-CF-B970o.js";import{t as Zi}from"./use-skills-DJX6inxB.js";import{o as Qi,s as $i,t as ea}from"./use-open-skill-C7UyAcdd.js";import{r as ta,t as na}from"./DeleteConfirmationDialog-n90yA0mh.js";import{t as ra}from"./skeleton-C6CemrJA.js";import{d as ia,n as aa,r as oa,t as sa,u as ca}from"./lint-config-client--83L6Vzq.js";import{_ as la,a as ua,d as da,f as fa,g as pa,h as ma,i as ha,o as ga,s as _a,t as va,u as ya}from"./sortable.esm-Dd5xvHIC.js";import{t as ba}from"./textarea-CKTD258L.js";import{i as xa,n as Sa,t as Ca}from"./input-group-Bp9yqbay.js";import{a as wa,f as Ta,i as Ea,n as Da,o as Oa,p as ka,r as Aa,s as ja,t as Ma}from"./form-CEg9p5Rf.js";import{r as Na,t as Pa}from"./terminal-command-events-CVCqfbNT.js";import{t as Fa}from"./tag-pill-input-BRyN2FKA.js";import{t as Ia}from"./markdownlint-rule-browser-Dwh97LWk.js";import{n as La}from"./schema-fields-view-intent-BhBMXWR3.js";import{n as Ra,t as za}from"./use-terminal-enabled-Y78SBxmZ.js";var Ba=Wn(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),Va=Wn(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Ha=Wn(`unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),Ua=Wn(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Z=e(p(),1),Q=y(),$=n();function Wa(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(pi,{variant:`gray`,children:(0,$.jsx)(m,{id:`YBt9YP`})}),e[0]=t):t=e[0],t}function Ga(e){let t=(0,Q.c)(10),{scope:n}=e,r=`settings-scope-badge-${n}`,i;t[0]===n?i=t[1]:(i=n===`user`?(0,$.jsx)(m,{id:`7PzzBU`}):n===`project-local`?(0,$.jsx)(m,{id:`ImTzPZ`}):(0,$.jsx)(m,{id:`e0NrBM`}),t[0]=n,t[1]=i);let a;t[2]!==r||t[3]!==i?(a=(0,$.jsx)(U,{asChild:!0,children:(0,$.jsx)(pi,{variant:`gray`,tabIndex:0,className:`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,"data-testid":r,children:i})}),t[2]=r,t[3]=i,t[4]=a):a=t[4];let o;t[5]===n?o=t[6]:(o=(0,$.jsx)(W,{children:n===`user`?(0,$.jsx)(m,{id:`cFSbbh`}):n===`project-local`?(0,$.jsx)(m,{id:`YlwI5F`}):(0,$.jsx)(m,{id:`ebqMh6`})}),t[5]=n,t[6]=o);let s;return t[7]!==a||t[8]!==o?(s=(0,$.jsx)(G,{children:(0,$.jsxs)(K,{children:[a,o]})}),t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function Ka(e){let t=(0,Q.c)(27),{titleId:n,title:r,scope:i,level:a,beta:o,adornment:s,docUrl:c,children:l}=e,u=a===void 0?`page`:a,{_:d}=h(),f=u===`page`?`h3`:`h4`,p=u===`page`?`text-lg`:`text-base`,g;t[0]===p?g=t[1]:(g=b(`font-semibold`,p),t[0]=p,t[1]=g);let _;t[2]!==f||t[3]!==g||t[4]!==r||t[5]!==n?(_=(0,$.jsx)(f,{id:n,className:g,children:r}),t[2]=f,t[3]=g,t[4]=r,t[5]=n,t[6]=_):_=t[6];let v;t[7]===o?v=t[8]:(v=o?(0,$.jsx)(Wa,{}):null,t[7]=o,t[8]=v);let y;t[9]===i?y=t[10]:(y=i?(0,$.jsx)(Ga,{scope:i}):null,t[9]=i,t[10]=y);let x;t[11]!==s||t[12]!==_||t[13]!==v||t[14]!==y?(x=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_,s,v,y]}),t[11]=s,t[12]=_,t[13]=v,t[14]=y,t[15]=x):x=t[15];let S;t[16]===l?S=t[17]:(S=l?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:l}):null,t[16]=l,t[17]=S);let C;t[18]!==d||t[19]!==c||t[20]!==r||t[21]!==n?(C=c===void 0?null:(0,$.jsxs)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>Yi(e,c),onAuxClick:e=>Yi(e,c),"aria-label":d(typeof r==`string`?{id:`Li4U-T`,values:{title:r}}:{id:`zwWKhA`}),className:`inline-flex items-center gap-0.5 text-sm text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,"data-testid":`${n}-docs-link`,children:[(0,$.jsx)(m,{id:`zwWKhA`}),(0,$.jsx)($n,{"aria-hidden":!0,className:`size-3`})]}),t[18]=d,t[19]=c,t[20]=r,t[21]=n,t[22]=C):C=t[22];let w;return t[23]!==x||t[24]!==S||t[25]!==C?(w=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[x,S,C]}),t[23]=x,t[24]=S,t[25]=C,t[26]=w):w=t[26],w}var qa=`settings-sharing-title`;function Ja(){let e=(0,Q.c)(1),t=(typeof window<`u`?window.okDesktop:void 0)?.sharing,n;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=t===void 0?(0,$.jsx)(Ya,{}):(0,$.jsx)(Xa,{}),e[0]=n):n=e[0],n}function Ya(){let e=(0,Q.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(m,{id:`cs4mps`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`section`,{"aria-labelledby":qa,className:`space-y-3`,"data-field":`section:sharing`,children:(0,$.jsx)(Ka,{titleId:qa,title:t,scope:`project`,level:`block`,children:(0,$.jsx)(m,{id:`7YRrJ9`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{})}})})}),e[1]=n):n=e[1],n}function Xa(){let e=(0,Q.c)(29),{_:t}=h(),[n,r]=(0,Z.useState)(null),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),c;e[0]===t?c=e[1]:(c=async function(){let e=window.okDesktop?.sharing;if(e)try{r(await e.status())}catch(e){let n=e;X.error(n instanceof Error?n.message:t({id:`K0N7zS`})),r(Qa)}},e[0]=t,e[1]=c);let l=c,u;e[2]===l?u=e[3]:(u=()=>{l()},e[2]=l,e[3]=u);let d;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=[],e[4]=d):d=e[4],(0,Z.useEffect)(u,d);let f;e[5]!==t||e[6]!==i||e[7]!==l||e[8]!==n?(f=async function(e){let r=window.okDesktop?.sharing;if(!r||n===null||i||n.mode===e)return;a(!0),s(null);let o=null,c=null;try{o=await r.setMode(e)}catch(e){c=e}if(a(!1),c!==null){X.error(c instanceof Error?c.message:t({id:`qZv5ZR`}));return}o!==null&&(o.kind===`refused-tracked`?(s({tracked:o.tracked,remediation:o.remediation}),X.error(t({id:`z2JdQ-`}),{duration:5e3})):o.kind===`no-exclude`?X.warning(o.reason===`no-git`?t({id:`YSFv5w`}):t({id:`8cS0nH`,values:{0:o.reason}})):X.success(t(e===`local-only`?{id:`wdzBgi`}:{id:`k_pade`})),await l())},e[5]=t,e[6]=i,e[7]=l,e[8]=n,e[9]=f):f=e[9];let p=f;if(n===null){let t;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Ka,{titleId:qa,title:(0,$.jsx)(m,{id:`cs4mps`}),scope:`project`,level:`block`}),e[10]=t):t=e[10];let n;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`section`,{"aria-labelledby":qa,className:`space-y-3`,"data-field":`section:sharing`,children:[t,(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(m,{id:`eQn7nI`})}),(0,$.jsx)(ra,{className:`h-24`})]})]}),e[11]=n):n=e[11],n}let g=n.mode===`no-git`,_;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(m,{id:`cs4mps`}),e[12]=_):_=e[12];let v;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(Ka,{titleId:qa,title:_,scope:`project`,level:`block`,adornment:(0,$.jsx)(Xi,{}),children:(0,$.jsx)(m,{id:`N55YNr`})}),e[13]=v):v=e[13];let y;e[14]!==i||e[15]!==g||e[16]!==p||e[17]!==n.mode?(y=g?(0,$.jsx)(`p`,{className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,role:`status`,"data-testid":`settings-sharing-no-git`,children:(0,$.jsx)(m,{id:`ju38ms`})}):(0,$.jsxs)(qe,{value:n.mode,onValueChange:e=>void p(e),disabled:i,className:`gap-2`,"aria-labelledby":qa,"data-testid":`settings-sharing-radiogroup`,children:[(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-local-only`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(Ke,{id:`settings-sharing-local-only`,value:`local-only`,"data-testid":`settings-sharing-local-only`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(m,{id:`QjzFZj`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`un-K1H`})})]})]}),(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-shared`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(Ke,{id:`settings-sharing-shared`,value:`shared`,"data-testid":`settings-sharing-shared`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(m,{id:`0Gd0NU`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`dJw2_7`})})]})]})]}),e[14]=i,e[15]=g,e[16]=p,e[17]=n.mode,e[18]=y):y=e[18];let b;e[19]===o?b=e[20]:(b=o===null?null:(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border border-destructive bg-destructive/10 p-3 text-sm`,role:`alert`,"data-testid":`settings-sharing-refusal`,children:[(0,$.jsx)(`p`,{className:`font-semibold`,children:(0,$.jsx)(m,{id:`ZscwQ0`})}),(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs leading-relaxed`,children:o.remediation}),(0,$.jsx)(H,{variant:`outline`,size:`sm`,onClick:()=>s(null),children:(0,$.jsx)(m,{id:`1QfxQT`})})]}),e[19]=o,e[20]=b);let x;e[21]!==o||e[22]!==n.mode||e[23]!==n.trackedUpstream?(x=n.trackedUpstream.length>0&&n.mode!==`no-git`&&o===null?(0,$.jsxs)(`div`,{className:`space-y-1 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-tracked-info`,children:[(0,$.jsx)(`p`,{className:`font-medium`,children:(0,$.jsx)(m,{id:`LhWYpm`})}),(0,$.jsx)(`ul`,{className:`list-disc pl-5 font-mono text-xs text-muted-foreground`,children:n.trackedUpstream.map(Za)}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`1XSMhZ`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]}):null,e[21]=o,e[22]=n.mode,e[23]=n.trackedUpstream,e[24]=x):x=e[24];let S;return e[25]!==y||e[26]!==b||e[27]!==x?(S=(0,$.jsxs)(`section`,{"aria-labelledby":qa,className:`space-y-4`,"data-testid":`settings-sharing`,"data-field":`section:sharing`,children:[v,y,b,x]}),e[25]=y,e[26]=b,e[27]=x,e[28]=S):S=e[28],S}function Za(e){return(0,$.jsx)(`li`,{children:e},e)}function Qa(e){return e??{kind:`status`,mode:`no-git`,excluded:[],trackedUpstream:[]}}var $a=`[a-z0-9](?:[a-z0-9-]*[a-z0-9])?`,eo=RegExp(`^${$a}(?:\\.${$a})*$`),to=/^[a-z][a-z0-9+.-]*:\/\//i;function no(e){if(to.test(e))try{return new URL(e).host}catch{return null}let t=e.split(`/`)[0]??``;return t.slice(t.lastIndexOf(`@`)+1).replace(/:(?!\d+$).*$/,``)}function ro(e,t){let n=e.trim();if(n===``)return{ok:!1,reason:`empty`};let r=no(n);if(r===null||r===``)return{ok:!1,reason:`invalid`};let i=tn(r);return eo.test(i)?i===`github.com`?{ok:!1,reason:`github-com`}:t.has(i)?{ok:!1,reason:`duplicate`}:{ok:!0,host:i}:{ok:!1,reason:`invalid`}}function io(e){let t=e.git?.hosts??{};return Object.entries(t).filter(([,e])=>e?.provider===`github`).map(([e])=>e).sort((e,t)=>e.localeCompare(t))}function ao(e){let t=(0,Q.c)(59),{binding:n}=e,{_:r}=h(),i=(0,Z.useId)(),a=(0,Z.useId)(),o;t[0]===n?o=t[1]:(o=()=>io(n.current()),t[0]=n,t[1]=o);let[s,c]=(0,Z.useState)(o),[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(null),[p,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(null),y;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=new Map,t[2]=y):y=t[2];let b=(0,Z.useRef)(y),x=(0,Z.useRef)(null),S,C;t[3]===_?(S=t[4],C=t[5]):(S=()=>{_!==null&&(((_.host===null?null:b.current.get(_.host))??x.current)?.focus(),v(null))},C=[_],t[3]=_,t[4]=S,t[5]=C),(0,Z.useEffect)(S,C);let w,T;t[6]===n?(w=t[7],T=t[8]):(w=()=>n.subscribe(e=>c(io(e))),T=[n],t[6]=n,t[7]=w,t[8]=T),(0,Z.useEffect)(w,T);let E;t[9]===r?E=t[10]:(E=function(e){switch(e){case`empty`:return r({id:`cFONFy`});case`invalid`:return r({id:`QsnBxE`});case`github-com`:return r({id:`UK3GW4`});case`duplicate`:return r({id:`DEkRZA`})}},t[9]=r,t[10]=E);let D=E,O;t[11]!==n||t[12]!==l||t[13]!==s||t[14]!==D?(O=function(e){e.preventDefault();let t=ro(l,new Set(s.map(oo)));if(!t.ok){f(D(t.reason));return}let r=n.patch({git:{hosts:{[t.host]:{provider:`github`}}}});if(!r.ok){f(_n(r.error));return}c(io(r.effective)),u(``),f(null),g(!0)},t[11]=n,t[12]=l,t[13]=s,t[14]=D,t[15]=O):O=t[15];let k=O,A;t[16]!==n||t[17]!==s?(A=function(e){let t=s.indexOf(e),r=s[t+1]??s[t-1]??null,i=n.patch({git:{hosts:{[e]:null}}});if(!i.ok){f(_n(i.error));return}c(io(i.effective)),v({host:r}),f(null),g(!0)},t[16]=n,t[17]=s,t[18]=A):A=t[18];let j=A,M;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(`h4`,{id:`settings-enterprise-hosts-title`,className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`J2-D_a`})}),t[19]=M):M=t[19];let N;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(m,{id:`PgY2nN`}),t[20]=N):N=t[20];let P;t[21]===i?P=t[22]:(P=(0,$.jsxs)(`div`,{children:[M,(0,$.jsx)(`p`,{id:i,className:`text-1sm text-muted-foreground`,children:N})]}),t[21]=i,t[22]=P);let F;t[23]!==r||t[24]!==j||t[25]!==s?(F=s.length>0?(0,$.jsx)(`ul`,{className:`space-y-1`,"data-testid":`settings-enterprise-hosts-list`,children:s.map(e=>(0,$.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs`,children:e}),(0,$.jsx)(H,{variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":r({id:`xVMoYb`,values:{host:e}}),ref:t=>{t?b.current.set(e,t):b.current.delete(e)},onClick:()=>j(e),children:(0,$.jsx)(ui,{"aria-hidden":`true`})})]},e))}):(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-enterprise-hosts-empty`,children:(0,$.jsx)(m,{id:`HK2eIK`})}),t[23]=r,t[24]=j,t[25]=s,t[26]=F):F=t[26];let I;t[27]===r?I=t[28]:(I=r({id:`Qbf7Q4`}),t[27]=r,t[28]=I);let L=d!==null,R=d===null?i:`${i} ${a}`,z;t[29]===d?z=t[30]:(z=e=>{u(e.target.value),d!==null&&f(null)},t[29]=d,t[30]=z);let B;t[31]!==l||t[32]!==I||t[33]!==L||t[34]!==R||t[35]!==z?(B=(0,$.jsx)(Ni,{ref:x,value:l,"aria-label":I,placeholder:`github.example.com`,autoComplete:`off`,spellCheck:!1,inputMode:`url`,className:`h-7 flex-1 font-mono text-xs`,"aria-invalid":L,"aria-describedby":R,onChange:z}),t[31]=l,t[32]=I,t[33]=L,t[34]=R,t[35]=z,t[36]=B):B=t[36];let V;t[37]===l?V=t[38]:(V=l.trim(),t[37]=l,t[38]=V);let U=V===``,W;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(m,{id:`ALFlyF`}),t[39]=W):W=t[39];let G;t[40]===U?G=t[41]:(G=(0,$.jsx)(H,{type:`submit`,size:`sm`,variant:`secondary`,disabled:U,className:`h-7 px-2 font-normal text-xs`,children:W}),t[40]=U,t[41]=G);let K;t[42]!==k||t[43]!==B||t[44]!==G?(K=(0,$.jsxs)(`form`,{className:`flex items-center gap-2 pt-1`,onSubmit:k,noValidate:!0,children:[B,G]}),t[42]=k,t[43]=B,t[44]=G,t[45]=K):K=t[45];let ee;t[46]!==d||t[47]!==a?(ee=d===null?null:(0,$.jsx)(`p`,{id:a,role:`alert`,className:`text-1sm text-destructive`,children:d}),t[46]=d,t[47]=a,t[48]=ee):ee=t[48];let te;t[49]===p?te=t[50]:(te=p?(0,$.jsx)(`p`,{role:`status`,className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`3LuFP-`})}):null,t[49]=p,t[50]=te);let q;t[51]!==F||t[52]!==K||t[53]!==ee||t[54]!==te?(q=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-lg border bg-card p-3`,children:[F,K,ee,te]}),t[51]=F,t[52]=K,t[53]=ee,t[54]=te,t[55]=q):q=t[55];let J;return t[56]!==P||t[57]!==q?(J=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-enterprise-hosts-title`,className:`space-y-4 pt-5`,"data-field":`section:enterprise-hosts`,"data-testid":`settings-enterprise-hosts`,children:[P,q]}),t[56]=P,t[57]=q,t[58]=J):J=t[58],J}function oo(e){return tn(e)}function so(e){let t=(0,Q.c)(38),{authQueryTransport:n,authTransport:r,userBinding:i}=e,{_:a}=h(),o;t[0]===n?o=t[1]:(o=n??wr(),t[0]=n,t[1]=o);let s=o,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c={phase:`loading`},t[2]=c):c=t[2];let[l,u]=(0,Z.useState)(c),[d,f]=(0,Z.useState)(!1),[p,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(null),y=(0,Z.useRef)(!1),b;t[3]===s?b=t[4]:(b=async function(){u({phase:`loading`});try{let e=await s.status();u({phase:`loaded`,result:e}),Ur(e)}catch(e){console.warn(`[AccountSection] GitHub status check failed`,e),u({phase:`check-failed`})}},t[3]=s,t[4]=b);let x=b,S;t[5]===x?S=t[6]:(S=()=>{x()},t[5]=x,t[6]=S);let C;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(C=[],t[7]=C):C=t[7],(0,Z.useEffect)(S,C);let w;t[8]!==a||t[9]!==x||t[10]!==s?(w=async function(){if(y.current)return;y.current=!0,f(!1),g(!0),v(null);let e=null;try{let t=s.signout?await s.signout():{ok:!1,error:a({id:`8cpOa8`})};t.ok||(e=t.error??a({id:`8cpOa8`}))}catch(t){console.warn(`[AccountSection] GitHub disconnect failed`,t),e=a({id:`8cpOa8`})}await x(),e&&v(e),g(!1),y.current=!1},t[8]=a,t[9]=x,t[10]=s,t[11]=w):w=t[11];let T=w,E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(m,{id:`AeXO77`}),t[12]=E):E=t[12];let D;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(Ka,{titleId:`settings-account-title`,title:E,scope:`user`,children:(0,$.jsx)(m,{id:`E6lrpp`})}),t[13]=D):D=t[13];let O;t[14]!==_||t[15]!==p||t[16]!==T||t[17]!==x||t[18]!==l.phase||t[19]!==l.result?(O=l.phase===`loading`?(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-loading`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(m,{id:`IWGfGF`})}),(0,$.jsx)(ra,{className:`h-4 w-40`}),(0,$.jsx)(ra,{className:`h-8 w-32`})]}):l.phase===`check-failed`?(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-check-failed`,children:[(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:(0,$.jsx)(m,{id:`T_wG4n`})}),(0,$.jsx)(H,{variant:`outline`,size:`sm`,onClick:()=>void x(),children:(0,$.jsx)(m,{id:`KDw4GX`})})]}):l.result.authenticated?l.result.tier===`A`?(0,$.jsx)(lo,{login:l.result.login}):(0,$.jsx)(co,{login:l.result.login,disconnecting:p,error:_,onDisconnect:()=>void T()}):l.result.unsupportedOrigin===void 0?(0,$.jsx)(fo,{onConnect:()=>f(!0)}):(0,$.jsx)(uo,{host:l.result.unsupportedOrigin.host}),t[14]=_,t[15]=p,t[16]=T,t[17]=x,t[18]=l.phase,t[19]=l.result,t[20]=O):O=t[20];let k;t[21]===i?k=t[22]:(k=(0,$.jsx)(ao,{binding:i}),t[21]=i,t[22]=k);let A;t[23]===x?A=t[24]:(A=e=>{f(e),e||x()},t[23]=x,t[24]=A);let j=l.phase===`loaded`?l.result.host:void 0,M=l.phase===`loaded`?l.result.ghAvailable:void 0,N;t[25]===x?N=t[26]:(N=()=>{x()},t[25]=x,t[26]=N);let P;t[27]!==d||t[28]!==r||t[29]!==A||t[30]!==j||t[31]!==M||t[32]!==N?(P=(0,$.jsx)(Ar,{open:d,onOpenChange:A,transport:r,host:j,ghAvailable:M,onSuccess:N}),t[27]=d,t[28]=r,t[29]=A,t[30]=j,t[31]=M,t[32]=N,t[33]=P):P=t[33];let F;return t[34]!==k||t[35]!==P||t[36]!==O?(F=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-account-title`,className:`space-y-3`,"data-testid":`settings-account`,children:[D,O,k,P]}),t[34]=k,t[35]=P,t[36]=O,t[37]=F):F=t[37],F}function co(e){let t=(0,Q.c)(20),{login:n,disconnecting:r,error:i,onDisconnect:a}=e,o;t[0]===n?o=t[1]:(o=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(m,{id:`nxlOpL`})}),t[2]=s):s=t[2];let c;t[3]===o?c=t[4]:(c=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[o,s]}),t[3]=o,t[4]=c);let l;t[5]===r?l=t[6]:(l=r?(0,$.jsx)(m,{id:`rppgXF`}):(0,$.jsx)(m,{id:`-K0AvT`}),t[5]=r,t[6]=l);let u;t[7]!==r||t[8]!==a||t[9]!==l?(u=(0,$.jsx)(H,{variant:`outline`,onClick:a,disabled:r,"aria-describedby":`settings-account-disconnect-caveat`,"data-testid":`settings-account-disconnect`,children:l}),t[7]=r,t[8]=a,t[9]=l,t[10]=u):u=t[10];let d;t[11]!==c||t[12]!==u?(d=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[c,u]}),t[11]=c,t[12]=u,t[13]=d):d=t[13];let f;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`p`,{id:`settings-account-disconnect-caveat`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-account-disconnect-caveat`,children:(0,$.jsx)(m,{id:`msOK6I`})}),t[14]=f):f=t[14];let p;t[15]===i?p=t[16]:(p=i?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-account-disconnect-error`,children:i}):null,t[15]=i,t[16]=p);let h;return t[17]!==d||t[18]!==p?(h=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-connected`,children:[d,f,p]}),t[17]=d,t[18]=p,t[19]=h):h=t[19],h}function lo(e){let t=(0,Q.c)(5),{login:n}=e,r;t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(m,{id:`ny6vNn`})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-gh-cli`,children:(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[r,i]})}),t[3]=r,t[4]=a),a}function uo(e){let t=(0,Q.c)(3),{host:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`xBjIs7`})}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,$.jsxs)(`div`,{role:`status`,className:`space-y-1 rounded-md border p-3`,"data-testid":`settings-account-unsupported-origin`,children:[r,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:n===null?(0,$.jsx)(m,{id:`XBpH6-`}):(0,$.jsx)(m,{id:`7_I248`,values:{host:n}})})]}),t[1]=n,t[2]=i),i}function fo(e){let t=(0,Q.c)(5),{onConnect:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(m,{id:`S33tz3`})}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[r,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(m,{id:`EJuO7B`})})]}),t[1]=i):i=t[1];let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(m,{id:`5lWFkC`}),t[2]=a):a=t[2];let o;return t[3]===n?o=t[4]:(o=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-disconnected`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[i,(0,$.jsx)(H,{onClick:n,"data-testid":`settings-account-connect`,children:a})]})}),t[3]=n,t[4]=o),o}function po(e){if(e===void 0)return null;let t=e.params?.agent;if(typeof t!=`string`)return null;let n=cn[t]??t;return e.id===`followup.enable-manually`?An._({id:`followup.enable-manually`,values:{agent:n}}):null}function mo(e){let{enabled:t,installedCount:n,presence:r,configurable:i,setupDocSlug:a,installUrl:o}=e,s=n>0,c=r===`absent`,l=()=>a===null?{kind:`none`}:{kind:`setup-doc`,slug:a};return c?o==null||o===``?l():{kind:`install`,url:o}:i?t?s?{kind:`manage`}:{kind:`connect`}:s?{kind:`remove`}:{kind:`none`}:s?{kind:`remove`}:l()}function ho(e){return e.presence===`absent`&&e.installedCount>0}function go(e){let t=(0,Q.c)(32),{icon:n,name:r,hint:i,status:a,action:o,checked:s,disabled:c,ariaLabel:l,testId:u,rowTestId:d,statusId:f,onToggle:p}=e,m=i?`${d}-hint`:void 0,h;t[0]===n?h=t[1]:(h=(0,$.jsx)(`span`,{className:`flex h-5 shrink-0 items-center`,children:n}),t[0]=n,t[1]=h);let g;t[2]===r?g=t[3]:(g=(0,$.jsx)(`span`,{className:`truncate text-sm leading-5`,children:r}),t[2]=r,t[3]=g);let _;t[4]!==i||t[5]!==m?(_=i?(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,$.jsx)(`span`,{id:m,className:`truncate text-muted-foreground text-1sm`,children:i.text}),i.action]}):null,t[4]=i,t[5]=m,t[6]=_):_=t[6];let v;t[7]!==a||t[8]!==f?(v=a?(0,$.jsx)(`span`,{id:f,children:a}):null,t[7]=a,t[8]=f,t[9]=v):v=t[9];let y;t[10]!==g||t[11]!==_||t[12]!==v?(y=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[g,_,v]}),t[10]=g,t[11]=_,t[12]=v,t[13]=y):y=t[13];let b;t[14]!==h||t[15]!==y?(b=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2.5`,children:[h,y]}),t[14]=h,t[15]=y,t[16]=b):b=t[16];let x;t[17]!==l||t[18]!==s||t[19]!==c||t[20]!==m||t[21]!==p||t[22]!==f||t[23]!==u?(x=p===void 0?null:(0,$.jsx)(Je,{checked:s??!1,disabled:c,onCheckedChange:p,"aria-label":l,"aria-describedby":[m,f].filter(Boolean).join(` `)||void 0,"data-testid":u}),t[17]=l,t[18]=s,t[19]=c,t[20]=m,t[21]=p,t[22]=f,t[23]=u,t[24]=x):x=t[24];let S;t[25]!==o||t[26]!==x?(S=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[o,x]}),t[25]=o,t[26]=x,t[27]=S):S=t[27];let C;return t[28]!==d||t[29]!==b||t[30]!==S?(C=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2.5`,"data-testid":d,children:[b,S]}),t[28]=d,t[29]=b,t[30]=S,t[31]=C):C=t[31],C}function _o(e){let t=(0,Q.c)(15),{target:n,projectDir:r,displayName:i}=e,{_:a}=h(),o;t[0]!==r||t[1]!==n?(o=()=>Un(n,r),t[0]=r,t[1]=n,t[2]=o):o=t[2];let[s,c]=(0,Z.useState)(o);if(!s)return null;let l;t[3]!==a||t[4]!==i?(l=a({id:`jIWP0P`,values:{displayName:i}}),t[3]=a,t[4]=i,t[5]=l):l=t[5];let u;t[6]!==r||t[7]!==n?(u=()=>{Hn(n,r,!1),c(Un(n,r))},t[6]=r,t[7]=n,t[8]=u):u=t[8];let d;t[9]===a?d=t[10]:(d=a({id:`LhVIxY`}),t[9]=a,t[10]=d);let f;return t[11]!==l||t[12]!==u||t[13]!==d?(f=(0,$.jsx)(H,{variant:`ghost`,size:`sm`,className:`shrink-0 font-mono uppercase`,"aria-label":l,onClick:u,children:d}),t[11]=l,t[12]=u,t[13]=d,t[14]=f):f=t[14],f}function vo(e,t){return e===`absent`&&!t}function yo(e){let t=(0,Q.c)(15),{label:n,labelIcon:r,subtitle:i,children:a,labelId:o}=e,s;t[0]!==n||t[1]!==r||t[2]!==o?(s=(0,$.jsxs)(`h4`,{id:o,tabIndex:-1,className:`flex items-center gap-1.5 font-mono text-muted-foreground text-xs uppercase tracking-wide`,children:[n,r]}),t[0]=n,t[1]=r,t[2]=o,t[3]=s):s=t[3];let c;t[4]===i?c=t[5]:(c=i?(0,$.jsx)(`p`,{className:`mt-1 text-muted-foreground text-xs`,children:i}):null,t[4]=i,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,$.jsxs)(`div`,{className:`mb-2`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]===a?u=t[10]:(u=(0,$.jsx)(`div`,{className:`divide-y overflow-hidden rounded-md border`,children:a}),t[9]=a,t[10]=u);let d;return t[11]!==o||t[12]!==l||t[13]!==u?(d=(0,$.jsxs)(`section`,{"aria-labelledby":o,children:[l,u]}),t[11]=o,t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function bo(e){if(e)return()=>{e.ownerDocument.activeElement===e&&V(e)?.focus()}}function xo(e){let t=(0,Q.c)(9),{hiddenCount:n,expanded:r,onToggle:i,testId:a}=e,{_:o}=h();if(n<=0)return null;let s;t[0]!==o||t[1]!==r||t[2]!==n?(s=o(r?{id:`6lGV3K`}:{id:`INN7OX`,values:{hiddenCount:n}}),t[0]=o,t[1]=r,t[2]=n,t[3]=s):s=t[3];let c;return t[4]!==r||t[5]!==i||t[6]!==s||t[7]!==a?(c=(0,$.jsx)(H,{ref:bo,type:`button`,variant:`ghost`,onClick:i,"aria-expanded":r,className:`w-full justify-center rounded-none font-normal text-1sm text-muted-foreground`,"data-testid":a,children:s}),t[4]=r,t[5]=i,t[6]=s,t[7]=a,t[8]=c):c=t[8],c}function So(e){let t=(0,Q.c)(10),{status:n,enabled:r}=e,{_:i}=h();if(n===`connected`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(er,{"aria-hidden":!0,className:`size-3.5`}),t[0]=e):e=t[0];let n;t[1]===i?n=t[2]:(n=i({id:`QHcLEN`}),t[1]=i,t[2]=n);let r;return t[3]===n?r=t[4]:(r=(0,$.jsxs)(`span`,{className:`mt-0.5 inline-flex items-center gap-1 text-muted-foreground text-xs`,children:[e,n]}),t[3]=n,t[4]=r),r}if(n===`not-connected`&&r){let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(di,{"aria-hidden":!0,className:`size-3.5`}),t[5]=e):e=t[5];let n;t[6]===i?n=t[7]:(n=i({id:`S33tz3`}),t[6]=i,t[7]=n);let r;return t[8]===n?r=t[9]:(r=(0,$.jsxs)(`span`,{className:`mt-0.5 inline-flex items-center gap-1 text-amber-700 text-xs dark:text-amber-400`,children:[e,n]}),t[8]=n,t[9]=r),r}return null}function Co(e){let t=(0,Q.c)(52),{action:n,rowLabel:r,describedById:i,onConfigure:a,onRemove:o}=e,{_:s}=h();switch(n.kind){case`none`:return null;case`install`:{let e=n.url,a;t[0]!==s||t[1]!==r?(a=s({id:`wfZwqe`,values:{rowLabel:r}}),t[0]=s,t[1]=r,t[2]=a):a=t[2];let o;t[3]===s?o=t[4]:(o=s({id:`TKQ7K-`}),t[3]=s,t[4]=o);let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)($n,{"aria-hidden":!0}),t[5]=c):c=t[5];let l;return t[6]!==n.url||t[7]!==i||t[8]!==a||t[9]!==o?(l=(0,$.jsx)(H,{variant:`link`,size:`sm`,className:`shrink-0 text-muted-foreground hover:text-foreground`,asChild:!0,children:(0,$.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,"aria-label":a,"aria-describedby":i,children:[o,c]})}),t[6]=n.url,t[7]=i,t[8]=a,t[9]=o,t[10]=l):l=t[10],l}case`setup-doc`:{let e=`https://openknowledge.ai/docs/integrations/${n.slug}`,a;t[11]!==s||t[12]!==r?(a=s({id:`Kuw5NN`,values:{rowLabel:r}}),t[11]=s,t[12]=r,t[13]=a):a=t[13];let o;t[14]===s?o=t[15]:(o=s({id:`P_bX4O`}),t[14]=s,t[15]=o);let c;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)($n,{"aria-hidden":!0}),t[16]=c):c=t[16];let l;return t[17]!==i||t[18]!==e||t[19]!==a||t[20]!==o?(l=(0,$.jsx)(H,{variant:`link`,size:`sm`,className:`shrink-0 text-muted-foreground hover:text-foreground`,asChild:!0,children:(0,$.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,"aria-label":a,"aria-describedby":i,children:[o,c]})}),t[17]=i,t[18]=e,t[19]=a,t[20]=o,t[21]=l):l=t[21],l}case`connect`:{let e;t[22]!==s||t[23]!==r?(e=s({id:`_uxBz5`,values:{rowLabel:r}}),t[22]=s,t[23]=r,t[24]=e):e=t[24];let n;t[25]===s?n=t[26]:(n=s({id:`q63KUv`}),t[25]=s,t[26]=n);let o;return t[27]!==i||t[28]!==a||t[29]!==e||t[30]!==n?(o=(0,$.jsx)(H,{size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:a,"aria-label":e,"aria-describedby":i,children:n}),t[27]=i,t[28]=a,t[29]=e,t[30]=n,t[31]=o):o=t[31],o}case`manage`:{let e;t[32]!==s||t[33]!==r?(e=s({id:`wSBXaS`,values:{rowLabel:r}}),t[32]=s,t[33]=r,t[34]=e):e=t[34];let n;t[35]===s?n=t[36]:(n=s({id:`wckWOP`}),t[35]=s,t[36]=n);let o;return t[37]!==i||t[38]!==a||t[39]!==e||t[40]!==n?(o=(0,$.jsx)(H,{variant:`outline`,size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:a,"aria-label":e,"aria-describedby":i,children:n}),t[37]=i,t[38]=a,t[39]=e,t[40]=n,t[41]=o):o=t[41],o}case`remove`:{let e;t[42]!==s||t[43]!==r?(e=s({id:`vRlzx-`,values:{rowLabel:r}}),t[42]=s,t[43]=r,t[44]=e):e=t[44];let n;t[45]===s?n=t[46]:(n=s({id:`t_YqKh`}),t[45]=s,t[46]=n);let a;return t[47]!==i||t[48]!==o||t[49]!==e||t[50]!==n?(a=(0,$.jsx)(H,{variant:`outline`,size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:o,"aria-label":e,"aria-describedby":i,children:n}),t[47]=i,t[48]=o,t[49]=e,t[50]=n,t[51]=a):a=t[51],a}}}function wo(e){let t=(0,Q.c)(9),{rowLabel:n,onRemove:r}=e,{_:i}=h(),a;t[0]!==i||t[1]!==n?(a=i({id:`vRlzx-`,values:{rowLabel:n}}),t[0]=i,t[1]=n,t[2]=a):a=t[2];let o;t[3]===i?o=t[4]:(o=i({id:`t_YqKh`}),t[3]=i,t[4]=o);let s;return t[5]!==r||t[6]!==a||t[7]!==o?(s=(0,$.jsx)(H,{type:`button`,variant:`link-muted`,className:`h-auto p-0 text-1sm underline underline-offset-4 hover:text-destructive`,onClick:r,"aria-label":a,children:o}),t[5]=r,t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function To(e){return e===void 0?null:nn[e].external?.installUrl??null}function Eo(e){return e!==null&&Object.values(e.probes.satisfiers).some(e=>e!==void 0&&e.state!==`unprobed`)}function Do(e){return`${e.source}:${e.id}`}function Oo(e,t,n){let r=t.has(Do(n)),i=dt(n);return at(e,n.source,n.id,r||i,n.supported)}function ko(e,t,n){return n.harness!==void 0&<(n)===0||Oo(e,t,n)}function Ao(e,t,n){let r=new Set(n.map(e=>Do(e))),i=e=>ko(t,r,e),a=[...e].sort((e,t)=>Number(i(t))-Number(i(e))||e.name.localeCompare(t.name));return{primaryKeys:new Set(a.filter(i).map(Do)),ranks:new Map(a.map((e,t)=>[Do(e),t]))}}function jo(e,t,n,r){let i=t.filter(t=>!e.ranks.has(Do(t)));if(i.length===0)return e;let a=new Set(r.map(e=>Do(e))),o=e=>ko(n,a,e),s=i.filter(o).sort((e,t)=>e.name.localeCompare(t.name)),c=i.filter(e=>!o(e)).sort((e,t)=>e.name.localeCompare(t.name)),l=[...e.ranks.entries()].sort(([,e],[,t])=>e-t).map(([e])=>e),u=l.filter(t=>e.primaryKeys.has(t)),d=l.filter(t=>!e.primaryKeys.has(t)),f=[...u,...s.map(Do),...d,...c.map(Do)];return{primaryKeys:new Set([...e.primaryKeys,...s.map(Do)]),ranks:new Map(f.map((e,t)=>[e,t]))}}function Mo(e){let t=(0,Q.c)(124),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{applyConnections:r}=n,i=r===void 0?L:r,{_:a}=h(),o=st(),s=ct(),{states:c,refresh:l}=zn(),u=Bn(),d=Di(),[f,p]=(0,Z.useState)(``),[m,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(!1),[w,B]=(0,Z.useState)(null),[V,U]=(0,Z.useState)(!1),[W,G]=(0,Z.useState)(!1),[K,ee]=(0,Z.useState)(0),[te,q]=(0,Z.useState)(null),[J,ne]=(0,Z.useState)(null),re=(0,Z.useRef)(null),ie=(0,Z.useRef)(0),ae;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(ae={queryKey:[`acp-catalog`],queryFn:Ho,staleTime:3e5},t[2]=ae):ae=t[2];let oe=g(ae),se;t[3]!==oe.data||t[4]!==o||t[5]!==s?(se=()=>oe.data===void 0?null:Ao(oe.data.agents,o,s),t[3]=oe.data,t[4]=o,t[5]=s,t[6]=se):se=t[6];let[ce,le]=(0,Z.useState)(se),ue=ce??Ao([],o,s);if(oe.data!==void 0){let e;t[7]!==oe.data.agents||t[8]!==ce||t[9]!==o||t[10]!==s?(e=ce===null?Ao(oe.data.agents,o,s):jo(ce,oe.data.agents,o,s),t[7]=oe.data.agents,t[8]=ce,t[9]=o,t[10]=s,t[11]=e):e=t[11];let n=e;n!==ce&&le(n),ue=n}let de;t[12]===l?de=t[13]:(de=()=>{l()},t[12]=l,t[13]=de);let fe=(0,Z.useEffectEvent)(de),pe;t[14]===fe?pe=t[15]:(pe=()=>{fe()},t[14]=fe,t[15]=pe);let me;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(me=[],t[16]=me):me=t[16],(0,Z.useEffect)(pe,me);let he;t[17]===i?he=t[18]:(he=()=>{let e=!0,t=ie.current+=1;return i([]).then(n=>{!e||ie.current!==t||(n.snapshot!==null&&B(n.snapshot),U(!Eo(n.snapshot)),G(n.unavailable===!0))}).catch(()=>{e&&ie.current===t&&U(!0)}),()=>{e=!1}},t[17]=i,t[18]=he);let ge;t[19]!==i||t[20]!==K?(ge=[i,K],t[19]=i,t[20]=K,t[21]=ge):ge=t[21],(0,Z.useEffect)(he,ge);let _e=oe.data?.agents,ve=new Set(s.map(Vo)),ye;t[22]===u?.installedClis?ye=t[23]:(ye=u?.installedClis??{},t[22]=u?.installedClis,t[23]=ye);let be=ye,xe=w===null?[]:D(w),Se=xe.find(e=>e.id===te)??null,Ce=xe.find(e=>e.id===J)??null,we;t[24]===i?we=t[25]:(we=async function(e){let t=await i(e);return ie.current+=1,t.snapshot!==null&&B(t.snapshot),U(!Eo(t.snapshot)),t.unavailable===!0&&G(!0),t},t[24]=i,t[25]=we);let Te=we,Ee;t[26]===w?Ee=t[27]:(Ee=function(e,t){return t===!1?`absent`:t===!0?`present`:e===void 0?`unknown`:N(e,w,t)},t[26]=w,t[27]=Ee);let De=Ee,Oe;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=new Set(jt.map(Ct).filter(Bo)),t[28]=Oe):Oe=t[28];let ke=Oe,Ae;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=new Set(Pt.map(zo).filter(Ro)),t[29]=Ae):Ae=t[29];let je=Ae,Me;t[30]!==be||t[31]!==De||t[32]!==c?(Me=function(e,t){if(t===`terminal`){let t=nn[e].external?.targetId;return t===void 0?`unknown`:De(e,c[t]?.installed??null)}let n=jt.find(t=>Ct(t)===e);return n===void 0?`unknown`:De(e,be[n]??null)},t[30]=be,t[31]=De,t[32]=c,t[33]=Me):Me=t[33];let Ne=Me,Pe=function(e,t,n,r,i,a,o,s){let c=e===void 0?void 0:xe.find(t=>t.id===e);if(c===void 0||e===void 0||w===null||!Eo(w))return{status:void 0,action:void 0,hintAction:void 0,residualFiles:!1,statusId:void 0};let l={enabled:i,installedCount:k(S(c)),presence:o,configurable:P(c),setupDocSlug:c.row.setupDocSlug,installUrl:s===void 0?nn[e].external?.installUrl??null:s},u=mo(l),d=M(e)&&Ne(e,r)!==`absent`,f=ho(l)&&!d,p=F({agentId:e,mode:r,snapshot:w,detected:a}),m=p===`connected`||p===`not-connected`&&i,h=m?`${n}-status`:void 0,g=!W||u.kind===`install`||u.kind===`setup-doc`,_=c.cells.projectMcp,v=_===void 0||!M(e)||C(_.consentClass)===r?po(A({agentId:e,mode:r,snapshot:w,detected:a,projectMcp:_})):null;return{status:m?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(So,{status:p,enabled:i}),v===null?null:(0,$.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground text-xs`,"data-testid":`${n}-followup`,children:v})]}):void 0,action:g?(0,$.jsx)(Co,{action:u,rowLabel:t,describedById:h,onConfigure:()=>q(e),onRemove:()=>ne(e)}):void 0,hintAction:f&&!W?(0,$.jsx)(wo,{rowLabel:t,onRemove:()=>ne(e)}):void 0,residualFiles:f,statusId:h}},Fe;t[34]===a?Fe=t[35]:(Fe=function(e,t){return a(e===`not-installed`?t?{id:`06Ucfz`}:{id:`5SwVv1`}:t?{id:`V0Jk_K`}:{id:`EDD3UL`})},t[34]=a,t[35]=Fe);let Ie=Fe,Le=function(e,t,n,r,i){if($e(e,r),!r||W||t===void 0||w===null)return;let a=xe.find(e=>e.id===t);a===void 0||!P(a)||F({agentId:t,mode:n,snapshot:w,detected:i})===`not-connected`&&(re.current=e,q(t))},Re;t[36]!==_e||t[37]!==o||t[38]!==s?(Re=function(){_e!==void 0&&le(Ao(_e,o,s))},t[36]=_e,t[37]=o,t[38]=s,t[39]=Re):Re=t[39];let ze=Re,Be;t[40]!==f||t[41]!==ze?(Be=function(e){f.trim()!==``&&e.trim()===``&&ze(),p(e)},t[40]=f,t[41]=ze,t[42]=Be):Be=t[42];let Ve=Be,He;t[43]!==ze||t[44]!==m?(He=function(){m&&ze(),_(!m)},t[43]=ze,t[44]=m,t[45]=He):He=t[45];let Ue=He,We=f.trim().toLowerCase(),Ge=e=>We===``||e.toLowerCase().includes(We),Ke=(_e??[]).filter(e=>Ge(e.name)),qe;t[46]===be?qe=t[47]:(qe=e=>be[e]!==!1,t[46]=be,t[47]=qe);let Je=qe,Ye;t[48]===Je?Ye=t[49]:(Ye=(e,t)=>Number(Je(t))-Number(Je(e))||Ot[e].displayName.localeCompare(Ot[t].displayName),t[48]=Je,t[49]=Ye);let Xe=jt.filter(e=>{let{displayName:t}=Ot[e];return Ge(t)||Ge(a({id:`QYfQdv`,values:{displayName:t}}))||Ge(e)}).sort(Ye),Ze;t[50]!==De||t[51]!==c?(Ze=e=>De(bt(e),c[e]?.installed??null),t[50]=De,t[51]=c,t[52]=Ze):Ze=t[52];let lt=Ze,ut;t[53]===lt?ut=t[54]:(ut=(e,t)=>Number(lt(e.id)===`absent`)-Number(lt(t.id)===`absent`),t[53]=lt,t[54]=ut);let ft=Pt.filter(e=>{let{displayName:t}=e;return Ge(a({id:`CZBqrX`,values:{displayName:t}}))||Ge(e.id)}).sort(ut),mt=u!==null,ht;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(ht=new Set([...ke,...je]),t[55]=ht):ht=t[55];let gt=ht,_t=pt.filter(e=>!gt.has(e)&&Ge(E(e))),vt=We!==``,yt=!oe.isLoading&&!oe.isError,xt=vt&&yt&&Ke.length===0&&Xe.length===0&&ft.length===0&&_t.length===0,St=!vt||oe.isLoading||oe.isError||Ke.length>0,wt=!vt||Xe.length>0,Tt=!vt||ft.length>0||_t.length>0,Et=e=>Oo(o,ve,e),Dt=e=>ue.primaryKeys.has(Do(e)),kt=e=>ue.ranks.get(Do(e))??2**53-1,At=Ke.filter(Dt),Mt=[...vt||m?Ke:At].sort((e,t)=>kt(e)-kt(t)||e.name.localeCompare(t.name)),Nt=vt?0:Ke.length-At.length,Ft=Xe.filter(Je),It=Ft.length>0&&Ft.length<Xe.length,Lt=!It||vt||v?Xe:Ft,Rt=It&&!vt?Xe.length-Ft.length:0,zt;t[56]===lt?zt=t[57]:(zt=e=>lt(e.id)!==`absent`,t[56]=lt,t[57]=zt);let Bt=ft.filter(zt),Vt=_t.filter(e=>De(e,xe.find(t=>t.id===e)?.row.detected??null)!==`absent`),Ht=Bt.length+Vt.length,Ut=ft.length+_t.length,Wt=Ht>0&&Ht<Ut,Gt=!Wt||vt||b,Kt=Gt?ft:Bt,qt=Gt?_t:Vt,Jt=Wt&&!vt?Ut-Ht:0,Yt=!yt||Ke.some(dt),Xt=mt&&Xe.some(Je),Zt;t[58]===c?Zt=t[59]:(Zt=e=>c[e.id]?.installed===!0,t[58]=c,t[59]=Zt);let Qt=ft.some(Zt),$t=St?(0,$.jsx)(yo,{label:a({id:`RXEbZy`}),labelId:`settings-configure-agents-in-app`,children:oe.isLoading?(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-2 px-3 py-6 text-muted-foreground text-sm`,children:[(0,$.jsx)(ri,{className:`size-4`,"aria-hidden":`true`}),a({id:`ucXZ0k`})]}):oe.isError?(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-3 py-6 text-center text-muted-foreground text-sm`,children:[(0,$.jsx)(Ua,{className:`size-5`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:a({id:`FqGWeR`})}),(0,$.jsx)(H,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void oe.refetch(),children:a({id:`6gRgw8`})})]}):(_e?.length??0)===0?(0,$.jsx)(`p`,{className:`px-3 py-6 text-center text-muted-foreground text-sm`,children:a({id:`QQbwzK`})}):(0,$.jsxs)($.Fragment,{children:[Mt.map(e=>{let t=Do(e),n=Et(e),r=e.supported?e.description:a({id:`5jEnaB`});return(0,$.jsx)(go,{icon:(0,$.jsx)(ot,{agentId:e.id,iconUrl:e.iconUrl,className:`size-4`}),name:e.name,hint:r===void 0?void 0:{text:r},checked:n,disabled:!e.supported,ariaLabel:a({id:`FZtBeR`,values:{0:e.name}}),testId:`configure-agents-in-app-${t}`,rowTestId:`configure-agents-in-app-row-${t}`,onToggle:n=>{n?(et({source:e.source,id:e.id,name:e.name,supported:e.supported,featured:e.featured,...e.iconUrl===void 0?{}:{iconUrl:e.iconUrl}},{makeDefault:!1}),$e(Y(e.source,e.id),!0)):($e(Y(e.source,e.id),!1),tt(t,e=>at(o,e.source,e.id,!0,e.supported)))}},t)}),(0,$.jsx)(xo,{hiddenCount:Nt,expanded:m,onToggle:Ue,testId:`configure-agents-in-app-show-more`})]})},`in-app`):null,en=wt?(0,$.jsxs)(yo,{label:a({id:`ALhMYW`}),labelId:`settings-configure-agents-terminal`,children:[Lt.map(e=>{let{displayName:t}=Ot[e],n=be[e]??null,r=De(Ct(e),n),i=Qe(o,e,r===`absent`),s=`configure-agents-terminal-row-${e}`,{status:c,action:l,hintAction:u,residualFiles:d,statusId:f}=Pe(Ct(e),a({id:`QYfQdv`,values:{displayName:t}}),s,`terminal`,i,n,r,To(Ct(e))??Ot[e].docsUrl);return(0,$.jsx)(go,{icon:(0,$.jsx)(Rn,{id:ta(e),className:`size-4`,"aria-hidden":`true`}),name:a({id:`QYfQdv`,values:{displayName:t}}),hint:r===`absent`?{text:Ie(`not-installed`,d),action:u}:void 0,status:c,action:l,checked:i,disabled:vo(r,i),ariaLabel:a({id:`27TLNq`,values:{displayName:t}}),testId:`configure-agents-terminal-${e}`,rowTestId:s,statusId:f,onToggle:mt?t=>Le(nt(e),Ct(e),`terminal`,t,be[e]??null):void 0},e)}),(0,$.jsx)(xo,{hiddenCount:Rt,expanded:v,onToggle:()=>y(Lo),testId:`configure-agents-terminal-show-more`})]},`terminal`):null,tn=Tt?(0,$.jsxs)(yo,{label:a({id:`BwKH4d`}),labelId:`settings-configure-agents-desktop`,labelIcon:(0,$.jsx)($n,{"aria-hidden":`true`,className:`size-3`}),children:[Kt.map(e=>{let t=c[e.id]?.installed??null,{displayName:n}=e,r=rt(o,e.id,t),i=De(bt(e.id),t),s=`configure-agents-desktop-row-${e.id}`,{status:l,action:u,hintAction:f,residualFiles:p,statusId:m}=Pe(bt(e.id),a({id:`CZBqrX`,values:{displayName:n}}),s,`external`,r,t,i);return(0,$.jsx)(go,{icon:(0,$.jsx)(Rn,{id:e.id,className:`size-4`,"aria-hidden":`true`}),name:a({id:`CZBqrX`,values:{displayName:n}}),hint:i===`absent`?{text:Ie(`not-installed`,p),action:f}:void 0,status:l,action:(0,$.jsxs)($.Fragment,{children:[u,d===null?null:(0,$.jsx)(_o,{target:e.id,projectDir:d.contentDir,displayName:n},`${d.contentDir}:${e.id}`)]}),checked:r,disabled:vo(i,r),ariaLabel:a({id:`cdBape`,values:{displayName:n}}),testId:`configure-agents-desktop-${e.id}`,rowTestId:s,statusId:m,onToggle:n=>Le(it(e.id),bt(e.id),`external`,n,t)},e.id)}),qt.map(e=>{let t=xe.find(t=>t.id===e)??null,n=t?.row.detected??null,r=E(e),i=De(e,n),a=`agent-connection-${e}`,o=Pe(e,r,a,`external`,t===null||!R(t),n,i);return(0,$.jsx)(go,{icon:(0,$.jsx)(T,{agentId:e,className:`size-4 text-muted-foreground`}),name:r,hint:i===`absent`?{text:Ie(`not-detected`,o.residualFiles),action:o.hintAction}:void 0,status:o.status,action:o.action,ariaLabel:r,testId:`configure-agents-unlaunchable-${e}`,rowTestId:a,statusId:o.statusId},e)}),(0,$.jsx)(xo,{hiddenCount:Jt,expanded:b,onToggle:()=>x(Io),testId:`configure-agents-desktop-show-more`})]},`desktop`):null,rn=[{node:$t,hasPresent:Yt},{node:en,hasPresent:Xt},{node:tn,hasPresent:Qt}].sort(Fo).map(Po),an;t[60]===a?an=t[61]:(an=a({id:`lBN3T6`}),t[60]=a,t[61]=an);let on;t[62]===a?on=t[63]:(on=a({id:`D4I0F9`}),t[62]=a,t[63]=on);let sn;t[64]!==an||t[65]!==on?(sn=(0,$.jsx)(Ka,{titleId:`settings-configure-agents-title`,title:an,children:on}),t[64]=an,t[65]=on,t[66]=sn):sn=t[66];let cn;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(cn=(0,$.jsx)(Nn,{className:`-translate-y-1/2 absolute top-1/2 start-2.5 size-4 text-muted-foreground`,"aria-hidden":`true`}),t[67]=cn):cn=t[67];let ln;t[68]===Ve?ln=t[69]:(ln=e=>Ve(e.target.value),t[68]=Ve,t[69]=ln);let un;t[70]===a?un=t[71]:(un=a({id:`-7s4fw`}),t[70]=a,t[71]=un);let dn;t[72]===a?dn=t[73]:(dn=a({id:`-7s4fw`}),t[72]=a,t[73]=dn);let fn;t[74]!==f||t[75]!==ln||t[76]!==un||t[77]!==dn?(fn=(0,$.jsxs)(`div`,{className:`relative`,children:[cn,(0,$.jsx)(Ni,{value:f,onChange:ln,placeholder:un,"aria-label":dn,className:`ps-8`,"data-testid":`configure-agents-search`})]}),t[74]=f,t[75]=ln,t[76]=un,t[77]=dn,t[78]=fn):fn=t[78];let pn;t[79]!==a||t[80]!==W?(pn=W?(0,$.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2 rounded-md border px-3 py-2.5 text-muted-foreground text-sm`,"data-testid":`configure-agents-read-only`,children:[(0,$.jsx)(di,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{children:a({id:`RD8cCw`})})]}):null,t[79]=a,t[80]=W,t[81]=pn):pn=t[81];let mn;t[82]!==a||t[83]!==V?(mn=V?(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border px-3 py-2.5 text-muted-foreground text-sm`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Ua,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{role:`status`,children:a({id:`4sE6E9`})})]}),(0,$.jsx)(H,{type:`button`,variant:`outline`,size:`sm`,className:`shrink-0`,onClick:()=>ee(No),children:a({id:`6gRgw8`})})]}):null,t[82]=a,t[83]=V,t[84]=mn):mn=t[84];let hn;t[85]!==a||t[86]!==xt?(hn=xt?(0,$.jsx)(`p`,{className:`py-6 text-center text-muted-foreground text-sm`,"data-testid":`configure-agents-no-results`,children:a({id:`Nay2Yr`})}):null,t[85]=a,t[86]=xt,t[87]=hn):hn=t[87];let gn=`configure:${te??`closed`}`,_n;t[88]===te?_n=t[89]:(_n=te!==null&&M(te),t[88]=te,t[89]=_n);let vn=Se!==null,yn;t[90]===re?yn=t[91]:(yn=e=>{e||(re.current!==null&&($e(re.current,!1),re.current=null),q(null))},t[90]=re,t[91]=yn);let bn;t[92]!==Te||t[93]!==Se||t[94]!==re?(bn=(e,t)=>Se===null?Promise.resolve({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null}):Te(O(Se,e,t)).then(e=>(e.ok&&(re.current=null),e)),t[92]=Te,t[93]=Se,t[94]=re,t[95]=bn):bn=t[95];let X;t[96]!==Se||t[97]!==gn||t[98]!==_n||t[99]!==vn||t[100]!==yn||t[101]!==bn?(X=(0,$.jsx)(I,{connection:Se,paired:_n,open:vn,onOpenChange:yn,onSave:bn},gn),t[96]=Se,t[97]=gn,t[98]=_n,t[99]=vn,t[100]=yn,t[101]=bn,t[102]=X):X=t[102];let xn=`remove:${J??`closed`}`,Sn;t[103]===J?Sn=t[104]:(Sn=J!==null&&M(J),t[103]=J,t[104]=Sn);let Cn=Ce!==null,wn;t[105]===Symbol.for(`react.memo_cache_sentinel`)?(wn=e=>{e||ne(null)},t[105]=wn):wn=t[105];let Tn;t[106]!==Te||t[107]!==Ce?(Tn=e=>Ce===null?Promise.resolve({ok:!1,report:{actions:[],conflicts:[],withheld:[]},snapshot:null}):Te(z(Ce,e===void 0?[]:e)),t[106]=Te,t[107]=Ce,t[108]=Tn):Tn=t[108];let En;t[109]!==Ce||t[110]!==xn||t[111]!==Sn||t[112]!==Cn||t[113]!==Tn?(En=(0,$.jsx)(j,{connection:Ce,paired:Sn,open:Cn,onOpenChange:wn,onRemove:Tn},xn),t[109]=Ce,t[110]=xn,t[111]=Sn,t[112]=Cn,t[113]=Tn,t[114]=En):En=t[114];let Dn;return t[115]!==rn||t[116]!==sn||t[117]!==fn||t[118]!==pn||t[119]!==mn||t[120]!==hn||t[121]!==X||t[122]!==En?(Dn=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-configure-agents-title`,className:`space-y-6`,"data-field":`section:agent-connections`,"data-testid":`settings-configure-agents`,children:[sn,fn,pn,mn,hn,rn,X,En]}),t[115]=rn,t[116]=sn,t[117]=fn,t[118]=pn,t[119]=mn,t[120]=hn,t[121]=X,t[122]=En,t[123]=Dn):Dn=t[123],Dn}function No(e){return e+1}function Po(e){return e.node}function Fo(e,t){return Number(t.hasPresent)-Number(e.hasPresent)}function Io(e){return!e}function Lo(e){return!e}function Ro(e){return e!==void 0}function zo(e){return bt(e.id)}function Bo(e){return e!==void 0}function Vo(e){return Do(e)}function Ho(e){let{signal:t}=e;return ut(t)}var Uo=`open-knowledge-app`;function Wo({from:e,to:t}){try{bn.getTracer(Uo).startSpan(`ok.language.preferenceChanged`,{attributes:{"ok.language.from":e,"ok.language.to":t}}).end()}catch(e){console.warn(`[language-telemetry] span emit failed:`,e instanceof Error?e:String(e))}}var Go=`open-knowledge-app`;function Ko(e){let t=e.light.startsWith(`saved-`),n=e.dark.startsWith(`saved-`);return!t||!n?`incomplete`:e.light===e.dark?`same`:`different`}function qo(e){try{bn.getTracer(Go).startSpan(`ok.saved_themes.assignment`,{attributes:{"saved_theme.pair":Ko(e)}}).end()}catch(e){console.warn(`[saved-theme-telemetry] assignment span emit failed:`,e instanceof Error?e:String(e))}}var Jo=`system`;function Yo(e){return typeof e==`string`&&gn.includes(e)}function Xo(e){return Yo(e)?e:Jo}function Zo(e){return new Intl.DisplayNames([e],{type:`language`}).of(e)??e}function Qo(e){let t=(0,Q.c)(6),{choice:n}=e;if(n===Jo){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(m,{id:`D-NlUC`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=Zo(n),t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,$.jsx)(`span`,{lang:n,className:`capitalize`,children:r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function $o(e){let t=(0,Q.c)(22),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({value:o,onValueChange:r,onBlur:n,ref:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===o?s=t[7]:(s=Xo(o),t[6]=o,t[7]=s);let c=s,l;t[8]===r?l=t[9]:(l=e=>r(Xo(e)),t[8]=r,t[9]=l);let u;t[10]===c?u=t[11]:(u=(0,$.jsx)(We,{children:(0,$.jsx)(Qo,{choice:c})}),t[10]=c,t[11]=u);let d;t[12]!==n||t[13]!==i||t[14]!==a||t[15]!==u?(d=(0,$.jsx)(Ue,{...a,ref:i,onBlur:n,size:`sm`,className:`w-48`,children:u}),t[12]=n,t[13]=i,t[14]=a,t[15]=u,t[16]=d):d=t[16];let f;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(He,{children:[(0,$.jsx)(Ve,{value:Jo,children:(0,$.jsx)(Qo,{choice:Jo})}),ln.map(es)]}),t[17]=f):f=t[17];let p;return t[18]!==c||t[19]!==l||t[20]!==d?(p=(0,$.jsxs)(Ge,{value:c,onValueChange:l,children:[d,f]}),t[18]=c,t[19]=l,t[20]=d,t[21]=p):p=t[21],p}function es(e){return(0,$.jsx)(Ve,{value:e,children:(0,$.jsx)(Qo,{choice:e})},e)}function ts(e){return{chrome:e.sidebar,surface:e.background,bar:e.primary,line:e.border,dots:[e[`syntax-string`],e[`syntax-keyword`],e[`syntax-atom`]]}}function ns(e,t,n){return e.id===`custom`?ts(Zt(qi(t))):e.scheme?ts(Zt(e.scheme)):ts(Vi(n))}function rs(e){let t=(0,Q.c)(38),{theme:n,customSeed:r,slotMode:i}=e,a,o,s,c,l,u,d,f,p,m;t[0]!==r||t[1]!==i||t[2]!==n?(a=ns(n,r,i),u=!0,d=``,f=`aspect-[4/3] w-full overflow-hidden rounded-md border`,p={backgroundColor:a.surface,borderColor:a.line},m=(0,$.jsxs)(`div`,{className:`flex h-1/3 items-center gap-1 px-1.5`,style:{backgroundColor:a.chrome,borderBottom:`1px solid ${a.line}`},children:[(0,$.jsx)(`span`,{className:`h-1.5 w-5 rounded-full`,style:{backgroundColor:a.bar}}),(0,$.jsx)(`span`,{className:`h-1.5 flex-1 rounded-full opacity-50`,style:{backgroundColor:a.line}})]}),l=`flex h-2/3`,o=`flex w-1/4 flex-col items-center justify-center gap-1`,s={backgroundColor:a.chrome,borderRight:`1px solid ${a.line}`},c=a.dots.map(is),t[0]=r,t[1]=i,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m):(a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]);let h;t[13]!==o||t[14]!==s||t[15]!==c?(h=(0,$.jsx)(`div`,{className:o,style:s,children:c}),t[13]=o,t[14]=s,t[15]=c,t[16]=h):h=t[16];let g;t[17]===a.dots[1]?g=t[18]:(g=(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-full`,style:{backgroundColor:a.dots[1]}}),t[17]=a.dots[1],t[18]=g);let _;t[19]===a.line?_=t[20]:(_=(0,$.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-full opacity-60`,style:{backgroundColor:a.line}}),t[19]=a.line,t[20]=_);let v;t[21]===a.dots[0]?v=t[22]:(v=(0,$.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-full`,style:{backgroundColor:a.dots[0]}}),t[21]=a.dots[0],t[22]=v);let y;t[23]!==g||t[24]!==_||t[25]!==v?(y=(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1 px-1.5`,children:[g,_,v]}),t[23]=g,t[24]=_,t[25]=v,t[26]=y):y=t[26];let b;t[27]!==h||t[28]!==y||t[29]!==l?(b=(0,$.jsxs)(`div`,{className:l,children:[h,y]}),t[27]=h,t[28]=y,t[29]=l,t[30]=b):b=t[30];let x;return t[31]!==b||t[32]!==u||t[33]!==d||t[34]!==f||t[35]!==p||t[36]!==m?(x=(0,$.jsxs)(`div`,{"aria-hidden":u,"data-theme-swatch":d,className:f,style:p,children:[m,b]}),t[31]=b,t[32]=u,t[33]=d,t[34]=f,t[35]=p,t[36]=m,t[37]=x):x=t[37],x}function is(e,t){return(0,$.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{backgroundColor:e}},t)}function as(e){return b(`size-6 min-w-6 rounded-md border p-0 transition-colors`,e?`border-primary bg-primary/15 text-primary hover:bg-primary/20 data-[state=on]:bg-primary/15`:`border-border/70 text-muted-foreground/70 hover:text-foreground`)}function os(e){return b(`size-3.5`,e&&`fill-current`)}function ss(e){let t=(0,Q.c)(33),{selection:n,themes:r,unavailableThemes:i,onAssign:a,editControl:o,deleteControl:s,createControl:c,slotMode:l,customSeed:u,firstItemId:d,"aria-label":f,"aria-describedby":p,"aria-invalid":m}=e,g=r===void 0?an:r,_;t[0]===i?_=t[1]:(_=i===void 0?[]:i,t[0]=i,t[1]=_);let v=_,y=l===void 0?`light`:l,{_:x}=h(),S;if(t[2]!==x||t[3]!==u||t[4]!==s||t[5]!==o||t[6]!==d||t[7]!==a||t[8]!==n||t[9]!==y||t[10]!==g){let e;t[12]!==x||t[13]!==u||t[14]!==s||t[15]!==o||t[16]!==d||t[17]!==a||t[18]!==n||t[19]!==y?(e=(e,t)=>{let r=n.light===e.id,i=n.dark===e.id,c=o?.themeIds.includes(e.id)??!1,l=s?.themeIds.includes(e.id)??!1,f=o?.selectedId===e.id,p=x(y===`light`?{id:`hgF0al`,values:{0:e.label}}:{id:`6Nea1q`,values:{0:e.label}});return(0,$.jsxs)(`fieldset`,{"aria-label":e.label,className:b(`relative flex min-w-0 flex-col gap-1.5 rounded-lg border-2 p-1 text-left`,n[y]===e.id?`border-primary`:`border-transparent`),children:[(0,$.jsx)(H,{type:`button`,variant:`ghost`,"aria-label":p,"data-theme-focus-target":``,onClick:()=>a(y,e.id),className:`h-auto w-full cursor-pointer p-0 transition-opacity hover:bg-transparent hover:opacity-90`,children:(0,$.jsx)(rs,{theme:e,customSeed:u,slotMode:y})}),l?(0,$.jsx)(H,{type:`button`,variant:`outline`,size:`icon-sm`,title:x({id:`Y2tU6I`,values:{0:e.label}}),"aria-label":x({id:`Y2tU6I`,values:{0:e.label}}),className:`absolute top-2 end-2 z-10 border-border/80 bg-background/85 text-muted-foreground shadow-sm backdrop-blur-sm hover:border-destructive/50 hover:bg-destructive/15 hover:text-destructive focus-visible:border-destructive/50 focus-visible:text-destructive focus-visible:ring-destructive/20 dark:bg-background/80 dark:hover:bg-destructive/20`,onClick:async t=>{let n=t.currentTarget.closest(`fieldset`),r=n?.previousElementSibling?.querySelector(`[data-theme-focus-target]`)??n?.nextElementSibling?.querySelector(`[data-theme-focus-target]`);await s?.onDelete(e.id)!==!1&&r?.focus()},children:(0,$.jsx)(ui,{"aria-hidden":!0})}):null,(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-1 px-0.5`,children:[(0,$.jsx)(`span`,{className:`truncate text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[c?(0,$.jsx)(Xe,{className:as(f),pressed:f,onPressedChange:t=>{o?.onSelect(t?e.id:null)},"aria-label":x(f?{id:`8x6zk9`,values:{0:e.label}}:{id:`N6j2JH`,values:{0:e.label}}),children:(0,$.jsx)(Pn,{className:`size-3.5`})}):null,(0,$.jsx)(Xe,{id:t===0?d:void 0,className:as(r),pressed:r,onPressedChange:t=>{t&&a(`light`,e.id)},"aria-label":x({id:`sq4WQH`,values:{0:e.label}}),children:(0,$.jsx)(ii,{className:os(r)})}),(0,$.jsx)(Xe,{className:as(i),pressed:i,onPressedChange:t=>{t&&a(`dark`,e.id)},"aria-label":x({id:`lZvQrY`,values:{0:e.label}}),children:(0,$.jsx)(ai,{className:os(i)})})]})]})]},e.id)},t[12]=x,t[13]=u,t[14]=s,t[15]=o,t[16]=d,t[17]=a,t[18]=n,t[19]=y,t[20]=e):e=t[20],S=g.map(e),t[2]=x,t[3]=u,t[4]=s,t[5]=o,t[6]=d,t[7]=a,t[8]=n,t[9]=y,t[10]=g,t[11]=S}else S=t[11];let C;t[21]!==x||t[22]!==c?(C=c?(0,$.jsxs)(H,{type:`button`,variant:`ghost`,onClick:c.onCreate,className:`group h-auto min-w-0 flex-col items-stretch gap-1.5 rounded-lg border-2 border-transparent p-1 text-left text-muted-foreground hover:bg-transparent hover:text-foreground`,children:[(0,$.jsx)(`span`,{className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-dashed border-border bg-muted/10 transition-colors group-hover:border-foreground/40`,children:(0,$.jsx)(Mn,{"aria-hidden":!0,className:`size-6`})}),(0,$.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium`,children:x({id:`AJ7_B2`})})]}):null,t[21]=x,t[22]=c,t[23]=C):C=t[23];let w;t[24]===v?w=t[25]:(w=v.map(cs),t[24]=v,t[25]=w);let T;return t[26]!==p||t[27]!==m||t[28]!==f||t[29]!==S||t[30]!==C||t[31]!==w?(T=(0,$.jsxs)(`fieldset`,{"aria-label":f,"aria-describedby":p,"aria-invalid":m,className:`grid w-full min-w-0 grid-cols-2 gap-2 sm:grid-cols-3`,children:[S,C,w]}),t[26]=p,t[27]=m,t[28]=f,t[29]=S,t[30]=C,t[31]=w,t[32]=T):T=t[32],T}function cs(e){return(0,$.jsxs)(`fieldset`,{"aria-label":e.label,className:`flex min-w-0 flex-col gap-1.5 rounded-lg border-2 border-destructive/40 bg-destructive/5 p-1 text-left`,children:[(0,$.jsx)(`div`,{"aria-hidden":!0,className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-destructive/30 bg-muted/40 text-destructive`,children:(0,$.jsx)(ir,{className:`size-6`})}),(0,$.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`px-0.5 text-xs font-medium text-destructive`,children:e.problem}),(0,$.jsx)(`span`,{className:`px-0.5 pb-0.5 text-xs text-muted-foreground`,children:e.detail})]},e.key)}var ls=12e3;function us(e){let t=(0,Q.c)(210),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({appearance:n,onAssign:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{_:a}=h(),{themes:o,warnings:s,truncated:c,loadError:l,refresh:u,deleteTheme:d,restoreTheme:f,editingThemeId:p,themeEditorOpen:m,selectThemeToEdit:g}=Ai(),[_,v]=(0,Z.useState)(!1),[y,b]=(0,Z.useState)(``),[x,S]=(0,Z.useState)(null),[C,w]=(0,Z.useState)(!1),T=(0,Z.useRef)(null),E,D;t[4]===u?(E=t[5],D=t[6]):(E=()=>{u()},D=[u],t[4]=u,t[5]=E,t[6]=D),(0,Z.useEffect)(E,D);let O;t[7]!==n||t[8]!==o?(O=Dt(n,o),t[7]=n,t[8]=o,t[9]=O):O=t[9];let k=O,A,j,M,N,P,F,I,L,R,z,B,V,U,W,G,K,ee,te,q,J,ne;if(t[10]!==a||t[11]!==x||t[12]!==y||t[13]!==_||t[14]!==d||t[15]!==p||t[16]!==C||t[17]!==l||t[18]!==r||t[19]!==i||t[20]!==u||t[21]!==f||t[22]!==g||t[23]!==k||t[24]!==m||t[25]!==o||t[26]!==c||t[27]!==s){let e=$t(y),n;t[49]===o?n=t[50]:(n=o.filter(hs),t[49]=o,t[50]=n);let h=n,E,D,O,re,ie,ae,oe,se,ce;if(t[51]!==a||t[52]!==y||t[53]!==d||t[54]!==p||t[55]!==h||t[56]!==C||t[57]!==l||t[58]!==r||t[59]!==i||t[60]!==u||t[61]!==f||t[62]!==g||t[63]!==k||t[64]!==m||t[65]!==o||t[66]!==c||t[67]!==s){let e=o.flatMap(ms),n;t[80]!==a||t[81]!==u||t[82]!==f?(n=async function(e){let t=await f({id:e.id,name:e.scheme.name,stem:e.stem,scheme:{...e.scheme,palette:{...e.scheme.palette}},extension:e.filename.endsWith(`.yml`)?`.yml`:`.yaml`});if(t.ok){await u(),X.success(a({id:`Kx881F`,values:{0:e.label}}));return}if(t.reason===`name-taken`){X.error(a({id:`oZUYMv`,values:{0:e.label}}));return}X.error(a({id:`7O7REc`,values:{0:e.label}}))},t[80]=a,t[81]=u,t[82]=f,t[83]=n):n=t[83];let _=n;O=async function(t){let n=e.find(e=>e.id===t);if(!n)return X.error(a({id:`ANFxWn`})),!1;let r=await d(n.id);if(!r.ok)return X.error(a({id:`kkux8f`,values:{0:n.label}})),!1;if(p===n.id&&g(null),await u(),!r.existed)return X(a({id:`ekSPiP`,values:{0:n.label}})),!0;let i={...n,filename:r.filename,label:r.scheme.name,scheme:r.scheme};return X(a({id:`YCmS3k`,values:{0:i.label}}),{duration:ls,action:{label:a({id:`9uI_rE`}),onClick:()=>_(i)}}),!0};let x;t[84]!==a||t[85]!==y||t[86]!==C||t[87]!==r||t[88]!==i||t[89]!==u||t[90]!==f||t[91]!==g||t[92]!==k||t[93]!==o?(x=async function(e){if(e.preventDefault(),C)return;let t=$t(y);if(!t.ok){S(a({id:`RG3yW6`})),T.current?.focus();return}let n=i.slotMode??`light`,s=o.find(e=>e.id===k[n])?.scheme??qi(i.customSeed),c={name:t.name,variant:s.variant,palette:{...s.palette}};S(null),w(!0);let l=await f({id:t.id,name:t.name,scheme:c});if(!l.ok){S(l.reason===`name-taken`?a({id:`_IfSZn`}):l.reason===`name-invalid`?a({id:`qtnmEX`}):a({id:`DmkTrb`})),w(!1),T.current?.focus();return}let d={id:l.id,label:c.name,kind:c.variant,scheme:c,toTokens:()=>Zt(c)};r(n,l.id,k,[...o,d]),await u(),b(``),v(!1),w(!1),g(l.id)},t[84]=a,t[85]=y,t[86]=C,t[87]=r,t[88]=i,t[89]=u,t[90]=f,t[91]=g,t[92]=k,t[93]=o,t[94]=x):x=t[94],D=x;let A;if(t[95]!==a||t[96]!==s){let e;t[98]===a?e=t[99]:(e=e=>{let t;bb90:switch(e.code){case`unparseable`:t=a({id:`g12y1g`});break bb90;case`not-a-scheme`:t=a({id:`p7Utw8`});break bb90;case`missing-slots`:t=a({id:`GUZHkL`});break bb90;case`bad-hex`:t=a({id:`IMLUBh`});break bb90;case`empty`:t=a({id:`k_tFzX`});break bb90;case`too-long`:t=a({id:`FyyIjH`});break bb90;case`invalid-chars`:t=a({id:`JaU1ld`});break bb90;case`unsupported-extension-case`:t=a({id:`R30SFt`});break bb90;case`duplicate-identity`:t=a({id:`DUb7Ax`});break bb90;case`symlink`:t=a({id:`hFmYGU`});break bb90;case`not-regular-file`:t=a({id:`UH0Zqw`});break bb90;case`file-too-large`:t=a({id:`-othoN`});break bb90;case`read-failed`:t=a({id:`cLn264`});break bb90;default:t=a({id:`WBNpt9`,values:{0:e.code}})}return{key:e.filename,label:e.filename,problem:t,detail:e.conflictingFilenames?a({id:`QwG_zJ`,values:{0:e.conflictingFilenames.join(`, `)}}):a({id:`kwNS82`})}},t[98]=a,t[99]=e),A=s.map(e),t[95]=a,t[96]=s,t[97]=A}else A=t[97];let j=A;V=`flex w-full min-w-0 flex-col gap-2`,t[100]!==a||t[101]!==l||t[102]!==u?(U=l?(0,$.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-foreground`,children:[(0,$.jsx)(`span`,{children:a({id:`hVzt9x`})}),(0,$.jsx)(H,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>void u(),children:a({id:`KDw4GX`})})]}):null,t[100]=a,t[101]=l,t[102]=u,t[103]=U):U=t[103];let M;t[104]!==a||t[105]!==c?(M=c?(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-sm text-foreground`,children:[(0,$.jsx)(di,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-amber-600`}),(0,$.jsx)(`span`,{children:a({id:`DLIljL`})})]}):null,t[104]=a,t[105]=c,t[106]=M):M=t[106],t[107]===M?W=t[108]:(W=(0,$.jsx)(`div`,{role:`status`,children:M}),t[107]=M,t[108]=W),E=ss,ie=i,ae=k,oe=h,se=j;let N;t[109]===o?N=t[110]:(N=o.filter(ps).map(fs),t[109]=o,t[110]=N);let P=m?p:null;t[111]!==g||t[112]!==N||t[113]!==P?(ce={themeIds:N,selectedId:P,onSelect:g},t[111]=g,t[112]=N,t[113]=P,t[114]=ce):ce=t[114],re=e.map(ds),t[51]=a,t[52]=y,t[53]=d,t[54]=p,t[55]=h,t[56]=C,t[57]=l,t[58]=r,t[59]=i,t[60]=u,t[61]=f,t[62]=g,t[63]=k,t[64]=m,t[65]=o,t[66]=c,t[67]=s,t[68]=E,t[69]=D,t[70]=O,t[71]=V,t[72]=U,t[73]=W,t[74]=re,t[75]=ie,t[76]=ae,t[77]=oe,t[78]=se,t[79]=ce}else E=t[68],D=t[69],O=t[70],V=t[71],U=t[72],W=t[73],re=t[74],ie=t[75],ae=t[76],oe=t[77],se=t[78],ce=t[79];let le;t[115]!==O||t[116]!==re?(le={themeIds:re,onDelete:O},t[115]=O,t[116]=re,t[117]=le):le=t[117];let ue;t[118]===Symbol.for(`react.memo_cache_sentinel`)?(ue={onCreate:()=>v(!0)},t[118]=ue):ue=t[118];let de;t[119]!==r||t[120]!==k||t[121]!==o?(de=(e,t)=>r(e,t,k,o),t[119]=r,t[120]=k,t[121]=o,t[122]=de):de=t[122],t[123]!==E||t[124]!==ie||t[125]!==ae||t[126]!==oe||t[127]!==se||t[128]!==ce||t[129]!==le||t[130]!==de?(G=(0,$.jsx)(E,{...ie,selection:ae,themes:oe,unavailableThemes:se,editControl:ce,deleteControl:le,createControl:ue,onAssign:de}),t[123]=E,t[124]=ie,t[125]=ae,t[126]=oe,t[127]=se,t[128]=ce,t[129]=le,t[130]=de,t[131]=G):G=t[131],P=xi,z=_,t[132]===C?B=t[133]:(B=e=>{C||v(e)},t[132]=C,t[133]=B),N=gi;let fe;t[134]===a?fe=t[135]:(fe=a({id:`Z_nNa2`}),t[134]=a,t[135]=fe);let pe;t[136]===fe?pe=t[137]:(pe=(0,$.jsx)(hi,{children:fe}),t[136]=fe,t[137]=pe);let me;t[138]===a?me=t[139]:(me=a({id:`nTM8ab`}),t[138]=a,t[139]=me);let he;t[140]===me?he=t[141]:(he=(0,$.jsx)(mi,{children:me}),t[140]=me,t[141]=he),t[142]!==pe||t[143]!==he?(R=(0,$.jsxs)(bi,{className:`gap-2`,children:[pe,he]}),t[142]=pe,t[143]=he,t[144]=R):R=t[144],M=_i,F=`create-saved-theme-form`,I=!0,L=D,j=Ti,q=x!==null;let ge;t[145]===a?ge=t[146]:(ge=a({id:`HZ7fEu`}),t[145]=a,t[146]=ge),t[147]===ge?J=t[148]:(J=(0,$.jsx)(Ci,{htmlFor:`create-saved-theme-name`,children:ge}),t[147]=ge,t[148]=J);let _e=x!==null,ve=x?`create-saved-theme-help create-saved-theme-error`:`create-saved-theme-help`,ye;t[149]===x?ye=t[150]:(ye=e=>{b(e.target.value),x&&S(null)},t[149]=x,t[150]=ye),t[151]!==y||t[152]!==C||t[153]!==_e||t[154]!==ve||t[155]!==ye?(ne=(0,$.jsx)(Ni,{ref:T,id:`create-saved-theme-name`,value:y,autoFocus:!0,autoComplete:`off`,required:!0,readOnly:C,"aria-invalid":_e,"aria-describedby":ve,onChange:ye}),t[151]=y,t[152]=C,t[153]=_e,t[154]=ve,t[155]=ye,t[156]=ne):ne=t[156],A=wi,K=`create-saved-theme-help`,ee=`font-mono`,te=e.ok?a({id:`Yb82LN`,values:{0:e.stem}}):a({id:`4d0VYJ`}),t[10]=a,t[11]=x,t[12]=y,t[13]=_,t[14]=d,t[15]=p,t[16]=C,t[17]=l,t[18]=r,t[19]=i,t[20]=u,t[21]=f,t[22]=g,t[23]=k,t[24]=m,t[25]=o,t[26]=c,t[27]=s,t[28]=A,t[29]=j,t[30]=M,t[31]=N,t[32]=P,t[33]=F,t[34]=I,t[35]=L,t[36]=R,t[37]=z,t[38]=B,t[39]=V,t[40]=U,t[41]=W,t[42]=G,t[43]=K,t[44]=ee,t[45]=te,t[46]=q,t[47]=J,t[48]=ne}else A=t[28],j=t[29],M=t[30],N=t[31],P=t[32],F=t[33],I=t[34],L=t[35],R=t[36],z=t[37],B=t[38],V=t[39],U=t[40],W=t[41],G=t[42],K=t[43],ee=t[44],te=t[45],q=t[46],J=t[47],ne=t[48];let re;t[157]!==A||t[158]!==K||t[159]!==ee||t[160]!==te?(re=(0,$.jsx)(A,{id:K,className:ee,children:te}),t[157]=A,t[158]=K,t[159]=ee,t[160]=te,t[161]=re):re=t[161];let ie;t[162]===x?ie=t[163]:(ie=x?(0,$.jsx)(Si,{id:`create-saved-theme-error`,children:x}):null,t[162]=x,t[163]=ie);let ae;t[164]!==j||t[165]!==re||t[166]!==ie||t[167]!==q||t[168]!==J||t[169]!==ne?(ae=(0,$.jsxs)(j,{"data-invalid":q,children:[J,ne,re,ie]}),t[164]=j,t[165]=re,t[166]=ie,t[167]=q,t[168]=J,t[169]=ne,t[170]=ae):ae=t[170];let oe;t[171]!==F||t[172]!==I||t[173]!==L||t[174]!==ae?(oe=(0,$.jsx)(`form`,{id:F,noValidate:I,onSubmit:L,children:ae}),t[171]=F,t[172]=I,t[173]=L,t[174]=ae,t[175]=oe):oe=t[175];let se;t[176]!==M||t[177]!==oe?(se=(0,$.jsx)(M,{children:oe}),t[176]=M,t[177]=oe,t[178]=se):se=t[178];let ce;t[179]===Symbol.for(`react.memo_cache_sentinel`)?(ce=()=>v(!1),t[179]=ce):ce=t[179];let le;t[180]===a?le=t[181]:(le=a({id:`dEgA5A`}),t[180]=a,t[181]=le);let ue;t[182]!==C||t[183]!==le?(ue=(0,$.jsx)(H,{type:`button`,variant:`outline`,disabled:C,onClick:ce,children:le}),t[182]=C,t[183]=le,t[184]=ue):ue=t[184];let de;t[185]!==a||t[186]!==C?(de=a(C?{id:`_DwR-n`}:{id:`cuHhjo`}),t[185]=a,t[186]=C,t[187]=de):de=t[187];let fe;t[188]!==C||t[189]!==de?(fe=(0,$.jsx)(H,{type:`submit`,form:`create-saved-theme-form`,disabled:C,children:de}),t[188]=C,t[189]=de,t[190]=fe):fe=t[190];let pe;t[191]!==ue||t[192]!==fe?(pe=(0,$.jsxs)(vi,{children:[ue,fe]}),t[191]=ue,t[192]=fe,t[193]=pe):pe=t[193];let me;t[194]!==N||t[195]!==R||t[196]!==se||t[197]!==pe?(me=(0,$.jsxs)(N,{children:[R,se,pe]}),t[194]=N,t[195]=R,t[196]=se,t[197]=pe,t[198]=me):me=t[198];let he;t[199]!==P||t[200]!==z||t[201]!==B||t[202]!==me?(he=(0,$.jsx)(P,{open:z,onOpenChange:B,children:me}),t[199]=P,t[200]=z,t[201]=B,t[202]=me,t[203]=he):he=t[203];let ge;return t[204]!==V||t[205]!==U||t[206]!==W||t[207]!==G||t[208]!==he?(ge=(0,$.jsxs)(`div`,{className:V,children:[U,W,G,he]}),t[204]=V,t[205]=U,t[206]=W,t[207]=G,t[208]=he,t[209]=ge):ge=t[209],ge}function ds(e){return e.id}function fs(e){return e.id}function ps(e){return e.id.startsWith(`saved-`)}function ms(e){let t=Mt(e.id);return!t.ok||!e.scheme?[]:[{id:e.id,stem:t.stem,label:e.label,scheme:e.scheme}]}function hs(e){return e.id!==`custom`}function gs(e,t){if(e.length===0)throw Error(`buildPatch: path must be non-empty`);let[n,...r]=e;return r.length===0?{[String(n)]:t}:{[String(n)]:gs(r,t)}}function _s(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(e?.type===`default`){let t=e.defaultValue;return typeof t==`function`?t():t}let n=t?._zod?.def?.innerType;if(n===void 0)return;t=n}}function vs(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`default`||e.type===`optional`||e.type===`nullable`){t=e.innerType;continue}return e.type}}function ys(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`enum`)return e.entries?Object.values(e.entries):void 0;if(e.innerType!==void 0){t=e.innerType;continue}return}}function bs(e){let t=(0,Q.c)(14),n;t[0]===e?n=t[1]:(n=e.current(),t[0]=e,t[1]=n);let r=n,i;t[2]===r?i=t[3]:(i={defaultValues:r,mode:`onBlur`},t[2]=r,t[3]=i);let a=Ta(i),o,s;t[4]!==e||t[5]!==a?(o=()=>e.subscribe(e=>{xs(a,e)}),s=[e,a],t[4]=e,t[5]=a,t[6]=o,t[7]=s):(o=t[6],s=t[7]),(0,Z.useEffect)(o,s);let c;t[8]!==e||t[9]!==a?(c=t=>Ss(a,e,t),t[8]=e,t[9]=a,t[10]=c):c=t[10];let l=c,u;return t[11]!==l||t[12]!==a?(u={form:a,commitField:l},t[11]=l,t[12]=a,t[13]=u):u=t[13],u}function xs(e,t){e.reset(t,{keepDirtyValues:!0,keepDirty:!0,keepTouched:!0})}function Ss(e,t,n){let r=e.getValues(n),i=gs(Ts(n),r),a=t.patch(i);if(a.ok)return e.clearErrors(n),e.resetField(n,{defaultValue:r,keepError:!1}),!0;if(vt(a.error)&&a.error.code===`SCHEMA_INVALID`&&a.error.issues.length>0){e.clearErrors(n);for(let t of a.error.issues){let r=t.path.length>0?t.path.map(String).join(`.`):n;e.setError(r,{type:`config-binding`,message:t.message})}}else e.setError(n,{type:`config-binding`,message:Cs(a.error,n)});return!1}function Cs(e,t){if(vt(e)&&e.code===`SCHEMA_INVALID`){let n=e.issues.find(e=>ws(e,t));if(n)return n.message}return _n(e)}function ws(e,t){return e.path.map(String).join(`.`)===t}function Ts(e){return e.split(`.`)}function Es(e){if(!vt(e)||e.code!==`SCHEMA_INVALID`)return null;let t=e.issues[0];return!t||t.path.length===0?null:t.path.map(String).join(`.`)}function Ds(){let e=(0,Q.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(ra,{className:`h-5 w-32`}),n=(0,$.jsx)(ra,{className:`h-4 w-64`}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[t,n,(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(ra,{className:`h-9 w-full`}),(0,$.jsx)(ra,{className:`h-9 w-full`})]})]}),e[2]=r):r=e[2],r}function Os({field:e,scope:t,commitField:n,isFlashed:r}){"use no memo";let{_:i}=h(),a=ka(),{setTheme:o}=_(),s=Fn(),c=It(St,e.path),l=c?vs(c):void 0,u=c?_s(c):void 0,d=c?ys(c):void 0,f=c?Kt(c):void 0,p=f?.scope===`project`&&t!==`project`||f?.scope===`user`&&t!==`user`,g=e.path.join(`.`),v=i(e.label),[y,x]=(0,Z.useState)(!1),S=(0,Z.useRef)(null);(0,Z.useEffect)(()=>()=>{S.current&&clearTimeout(S.current)},[]);let C=()=>{x(!0),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>x(!1),1200)},w=()=>{let e=n(g);return e&&C(),e},T=()=>a.getFieldState(g).isDirty?w():!0,E=()=>{if(e.control===`theme-tiles`){let e=s?.userBinding;if(!e)return;let t=e.patch({appearance:Bi()});t.ok?C():a.setError(g,{type:`manual`,message:Cs(t.error,g)});return}let t=u===void 0?null:u;a.setValue(g,t,{shouldDirty:!1}),e.control===`theme-cards`&&o(Ln(t)),w()},D=b(`relative`,r&&`animate-settings-flash`);return(0,$.jsx)(Ea,{control:a.control,name:g,render:({field:n})=>{let r=!p&&(u!==void 0||n.value!==void 0);return(0,$.jsxs)(wa,{className:D,"data-field":e.path.join(`.`),"data-scope":t,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(Oa,{className:`text-sm font-medium`,children:v}),r?(0,$.jsxs)(K,{children:[(0,$.jsx)(U,{asChild:!0,children:(0,$.jsx)(H,{variant:`ghost`,size:`icon`,className:`h-5 w-5 text-muted-foreground opacity-60 hover:opacity-100`,onClick:E,"aria-label":i({id:`lhjq3G`,values:{labelText:v}}),children:(0,$.jsx)(si,{className:`size-3.5`})})}),(0,$.jsx)(W,{children:(0,$.jsx)(m,{id:`L-rMC9`})})]}):null]}),e.description?(0,$.jsx)(Aa,{className:`text-muted-foreground text-1sm`,children:i(e.description)}):null,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Da,{children:(0,$.jsx)(As,{field:e,ctl:n,typeTag:l,enumOptions:d,onCommit:T,onRevertToBaseline:()=>a.resetField(g,{keepError:!0}),onSavedOutsideForm:C,onWriteRejected:e=>{a.setError(g,{type:`manual`,message:Cs(e,g)})}})}),(0,$.jsx)(Ps,{visible:y,srOnly:ks(e.control)})]}),(0,$.jsx)(ja,{"data-field-error":e.path.join(`.`)})]})}})}function ks(e){return e===`theme-tiles`||e===`theme-cards`}function As({field:e,ctl:t,typeTag:n,enumOptions:r,onCommit:i,onRevertToBaseline:a,onSavedOutsideForm:o,onWriteRejected:s,...c}){"use no memo";let{_:l}=h(),{setTheme:u,systemTheme:d}=_(),f=Fn(),p=f?.merged??null;if(e.control===`language-select`)return(0,$.jsx)($o,{...c,value:t.value,ref:t.ref,onBlur:t.onBlur,onValueChange:e=>{let n=Ji(t.value)??`system`;n!==e&&Wo({from:n,to:e}),t.onChange(e),i()}});if(e.control===`theme-cards`){let{id:n,...r}=c;return(0,$.jsx)(oi,{...r,firstItemId:n,value:Ln(t.value),"aria-label":l(e.label),onValueChange:e=>{let n=Ln(t.value);u(e),t.onChange(e),!i()&&(u(n),a())}})}if(e.control===`theme-tiles`){let{id:t,...n}=c,r=p?.appearance?.customTheme,i=p?.appearance?.theme,a=ht(i,d===`dark`);return(0,$.jsx)(us,{...n,firstItemId:t,appearance:p?.appearance,customSeed:r,slotMode:a,"aria-label":l(e.label),onAssign:(e,t,n,c)=>{let l=f?.userBinding;if(!l)return;let d={...n,[e]:t},p=e=>{let t=e[a];return t===`custom`?Ui(qi(r)):zi(t,c)};Ri({selection:d,modePreference:i,slotMode:a,customSeed:r,themes:c}),u(p(d)??i??`system`);let m=l.patch({appearance:Wi(d)});if(m.ok){qo(d),o();return}Ri({selection:n,modePreference:i,slotMode:a,customSeed:r,themes:c}),u(p(n)??i??`system`),s(m.error)}})}if(n===`boolean`)return(0,$.jsx)(Je,{...c,checked:!!t.value,ref:t.ref,onCheckedChange:e=>{t.onChange(e),i()},onBlur:t.onBlur});if(n===`enum`&&r&&r.length>0&&(e.control===`enum-toggle`||r.length<=4)){let{id:n,...a}=c;return(0,$.jsx)(Ze,{...a,type:`single`,value:typeof t.value==`string`?t.value:``,ref:t.ref,onValueChange:e=>{e&&(t.onChange(e),i())},onBlur:t.onBlur,variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-lg`,"aria-label":l(e.label),children:r.map((e,t)=>(0,$.jsx)(Ye,{value:e,id:t===0?n:void 0,className:`text-1sm capitalize`,children:e},e))})}return n===`number`||n===`int`?(0,$.jsx)(Ms,{ctl:t,onCommit:i,...c}):n===`array`?(0,$.jsx)(Ns,{ctl:t,onCommit:i,...c}):(0,$.jsx)(js,{ctl:t,onCommit:i,...c})}function js({ctl:e,onCommit:t,...n}){"use no memo";return(0,$.jsx)(Ni,{...n,value:typeof e.value==`string`?e.value:``,ref:e.ref,onChange:t=>e.onChange(t.target.value),onBlur:()=>{e.onBlur(),t()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),t())},className:`h-8 text-sm`})}function Ms({ctl:e,onCommit:t,...n}){"use no memo";let[r,i]=(0,Z.useState)(e.value===void 0?``:String(e.value)),a=(0,Z.useRef)(e.value);(0,Z.useEffect)(()=>{a.current!==e.value&&(i(e.value===void 0?``:String(e.value)),a.current=e.value)},[e.value]);let o=()=>{let n=Number(r);if(!Number.isFinite(n)){e.onChange(r),t();return}e.onChange(n),t(),a.current=n};return(0,$.jsx)(Ni,{...n,type:`number`,value:r,ref:e.ref,onChange:e=>i(e.target.value),onBlur:()=>{e.onBlur(),o()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())},className:`h-8 w-28 text-sm tabular-nums`})}function Ns({ctl:e,onCommit:t,...n}){"use no memo";let r=Array.isArray(e.value)?e.value.join(`
|
|
2
2
|
`):``,[i,a]=(0,Z.useState)(r),o=(0,Z.useRef)(r);(0,Z.useEffect)(()=>{let t=Array.isArray(e.value)?e.value.join(`
|
|
3
3
|
`):``;t!==o.current&&(a(t),o.current=t)},[e.value]);let s=()=>{let n=i.split(`
|
|
4
4
|
`).map(e=>e.trim()).filter(e=>e.length>0);e.onChange(n),t(),o.current=n.join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{er as n}from"./DocumentContext-B3xlplVb.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{b as s,f as c,g as l,m as u,r as d,s as f,t as p}from"./agent-connections-BZwWjV-L.js";import{t as m}from"./button-BeFNZANd.js";import{i as h,n as g,t as _}from"./tooltip-DVBVVaAs.js";import"./RegisteredAgentIcon--fiCkSba.js";import{Fc as v,en as y,jc as b,nl as x,nn as S,wi as C}from"./dist-DILeGueK.js";import{n as w}from"./dist-CJhtNlOm2.js";import{c as T}from"./documents-events-Do7TM3Hd.js";import{t as E}from"./createLucideIcon-B6ULg5PN.js";import{a as D,f as O,i as k,m as A,n as j,o as M,p as N,u as P}from"./dropdown-menu-BEhl0wvu.js";import{t as F}from"./folder-BrDDZVzs.js";import{n as I,t as L}from"./bool-pref-SOpULTKU.js";import{i as R,l as z,n as B,r as V}from"./skill-scope-CUAEKGV-.js";import{F as H,S as ee,j as U,x as te}from"./skills-api-CM8h9xtl.js";import{t as ne}from"./use-skills-DJX6inxB.js";import{a as re,c as ie,d as ae,f as oe,l as se,p as W,s as G,u as K}from"./DeleteConfirmationDialog-n90yA0mh.js";var q=e(r(),1),J=o();async function Y(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.recordHandoff)try{await n.shell.recordHandoff(e)}catch(e){(t.warn??(e=>console.warn(e)))(`[handoff] recordHandoff IPC rejected (telemetry skipped): ${e instanceof Error?e.message:String(e)}`)}}var ce=E(`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`}]]),le=E(`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`}]]),ue=E(`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`}]]),X=t(),de=(0,q.createContext)(null),fe=`ok-external-handoff-setup-dismissed-v1`,pe=250,me=1e4;function he(e){return(e instanceof Error?e.message:typeof e==`string`?e:null)?.replace(/\s+/g,` `).trim().slice(0,240)||void 0}function Z(e,t,n){let r=he(n);console.warn(`[handoff] external readiness check bypassed`,{target:e,cause:t,...r===void 0?{}:{detail:r}})}function ge(e){let{check:t}=e;t.statusTimer!==null&&clearTimeout(t.statusTimer),t.deadlineTimer!==null&&clearTimeout(t.deadlineTimer),t.statusTimer=null,t.deadlineTimer=null,t.controller.abort()}function _e(e,t){ve(e.target,t),e.resolve({ok:!1,reason:t})}function ve(e,t){Y({target:e,host:typeof window<`u`&&window.okDesktop!=null?`electron`:`web`,outcome:`error`,reason:t,ts:new Date().toISOString()})}function ye(e,t){if(t.unavailable===!0)return{kind:`unknown`,cause:`unavailable`,detail:t.error};if(!t.ok)return{kind:`unknown`,cause:`read-failed`,detail:t.error};if(t.snapshot===null)return{kind:`unknown`,cause:`missing-snapshot`};let n=d({agentId:e,mode:`external`,snapshot:t.snapshot,detected:!0});if(n===`connected`)return{kind:`ready`};if(n!==`not-connected`)return{kind:`unknown`,cause:`unknown-status`,detail:n};let r=c(t.snapshot,{forceDetected:[e]}).find(t=>t.id===e);return r===void 0?{kind:`unknown`,cause:`missing-row`}:{kind:`setup`,connection:r}}function be(){if(typeof document>`u`)return null;let e=document.activeElement;for(;e instanceof HTMLElement;){let t=e.shadowRoot?.activeElement;if(!(t instanceof HTMLElement))break;e=t}return e instanceof HTMLElement?e:null}function xe(e,t){return`${n(fe,t)}:${e}`}function Se(e,t){return L(xe(e,t))}function Ce(e,t,n){I(xe(e,t),n)}function we(e){let t=(0,J.c)(31),{children:n,applyConnections:r}=e,i=r===void 0?p:r,{_:o}=a(),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s={kind:`idle`},t[0]=s):s=t[0];let[c,d]=(0,q.useState)(s),[m,h]=(0,q.useState)(!1),g=(0,q.useRef)(null),_=(0,q.useRef)(0),y;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(y=function(e){return g.current?.id===e.id},t[1]=y):y=t[1];let x=y,S;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(S=function(e){return x(e)?(g.current=null,ge(e),d({kind:`idle`}),!0):!1},t[2]=S):S=t[2];let C=S,w,T;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>()=>{let e=g.current;e!==null&&(g.current=null,ge(e),_e(e,`superseded`))},T=[],t[3]=w,t[4]=T):(w=t[3],T=t[4]),(0,q.useEffect)(w,T);let E;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(E=function(e){C(e)&&_e(e,`setup-canceled`)},t[5]=E):E=t[5];let D=E,O;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(O=function(e){C(e)&&Promise.resolve().then(e.rawDispatch).then(e.resolve,e.reject)},t[6]=O):O=t[6];let k=O,A;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(A=function(e){let t=be();if(t===null||t===document.body||!t.isConnected)return e;let n={...e,returnFocus:t};return g.current=n,n},t[7]=A):A=t[7];let j=A,M;if(t[8]!==i){let e=async function(e){let t=v(e.target);if(t===void 0){Z(e.target,`unmapped-target`),k(e);return}let n;try{n=await i([],{webSignal:e.check.controller.signal})}catch(t){let n=t;if(!x(e))return;Z(e.target,`read-threw`,n),k(e);return}if(!x(e))return;let r;try{r=ye(t,n)}catch(t){let n=t;Z(e.target,`derivation-threw`,n),k(e);return}if(r.kind!==`setup`){r.kind===`unknown`&&Z(e.target,r.cause,r.detail),k(e);return}ge(e),h(!1),d({kind:`setup`,pending:j(e),connection:r.connection})};M=function(t,n,r){let i=g.current;i!==null&&C(i)&&_e(i,`superseded`);let a=_.current+=1;return r.installState.installed===!1?(ve(t,`not-installed`),Promise.resolve({ok:!1,reason:`not-installed`})):new Promise((i,o)=>{let s=be(),c={id:a,target:t,projectDir:r.projectDir,rawDispatch:n,returnFocus:s?.tagName===`BODY`?null:s,restoreFocus:r.restoreFocus,resolve:i,reject:o,check:{controller:new AbortController,statusTimer:null,deadlineTimer:null}};if(g.current=c,Se(t,r.projectDir)){k(c);return}d({kind:`checking`,id:a,target:t,visible:!1}),c.check.statusTimer=setTimeout(()=>{x(c)&&d(e=>e.kind===`checking`&&e.id===a?{...e,visible:!0}:e)},pe),c.check.deadlineTimer=setTimeout(()=>{x(c)&&(Z(c.target,`read-timeout`),k(c))},me),e(c).catch(e=>{x(c)&&(Z(c.target,`check-threw`,e),k(c))})})},t[8]=i,t[9]=M}else M=t[9];let N=M,P=c.kind===`setup`?c:null,F=P?.connection.label??``,I;t[10]!==c.kind||t[11]!==c.target?(I=c.kind===`checking`?b.find(e=>e.id===c.target)?.displayName??c.target:``,t[10]=c.kind,t[11]=c.target,t[12]=I):I=t[12];let L=I,R;t[13]===N?R=t[14]:(R={dispatch:N},t[13]=N,t[14]=R);let z;t[15]!==o||t[16]!==L||t[17]!==c.kind||t[18]!==c.visible?(z=c.kind===`checking`&&c.visible?(0,X.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`pointer-events-none fixed left-1/2 top-4 z-50 -translate-x-1/2 rounded-full border border-border bg-background px-4 py-2 text-sm text-foreground shadow-md`,children:o({id:`jDejAI`,values:{checkingLabel:L}})}):null,t[15]=o,t[16]=L,t[17]=c.kind,t[18]=c.visible,t[19]=z):z=t[19];let B;t[20]!==o||t[21]!==i||t[22]!==F||t[23]!==m||t[24]!==P?(B=P===null?null:(0,X.jsx)(f,{connection:P.connection,paired:u(P.connection.id),open:!0,onOpenChange:e=>{e||D(P.pending)},onCloseAutoFocus:e=>{let t=P.pending.returnFocus;t?.isConnected===!0?(e.preventDefault(),t.focus()):P.pending.restoreFocus!==void 0&&(e.preventDefault(),P.pending.restoreFocus())},validateSave:e=>e.projectMcp||e.globalMcp?null:o({id:`Pur9o0`}),alternateAction:{label:o({id:`RcPztQ`,values:{handoffLabel:F}}),onClick:()=>{m&&Ce(P.pending.target,P.pending.projectDir,!0),k(P.pending)},preference:{checked:m,label:o({id:`IDXn2n`}),onCheckedChange:h}},onSave:async(e,t)=>{let n=await i(l(P.connection,e,t));if(!x(P.pending)||!n.ok)return n;let r;try{r=ye(P.connection.id,n)}catch(e){let t=e;return Z(P.pending.target,`derivation-threw`,t),{kind:`saved-not-ready`,message:o({id:`srbby-`,values:{handoffLabel:F}})}}return r.kind===`ready`?(k(P.pending),n):{kind:`saved-not-ready`,message:o({id:`srbby-`,values:{handoffLabel:F}})}}},P.pending.id),t[20]=o,t[21]=i,t[22]=F,t[23]=m,t[24]=P,t[25]=B):B=t[25];let V;return t[26]!==n||t[27]!==R||t[28]!==z||t[29]!==B?(V=(0,X.jsxs)(de,{value:R,children:[n,z,B]}),t[26]=n,t[27]=R,t[28]=z,t[29]=B,t[30]=V):V=t[30],V}function Te(){let e=(0,q.use)(de);if(e===null)throw Error(`useExternalHandoffGate must be used within <ExternalHandoffGateProvider />`);return e}var Ee=[...new Set(b.flatMap(e=>e.schemes))];function De(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 Oe(e){return De({},e)}async function ke(e){let t=e.schemes??Ee,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 Ae=Object.fromEntries(Ee.map(e=>[e,{installed:!1}]));async function je(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 Ae}if(!t.ok)return Ae;let n;try{n=await t.json()}catch{return Ae}if(typeof n!=`object`||!n||Array.isArray(n))return Ae;let r=n,i={};for(let e of Ee)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function Me(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 Ne(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Oe({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=De(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=!Me(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 Pe(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Fe(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>ke({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>je({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Ie(){let e=(0,J.c)(5),[t,n]=(0,q.useState)(Le),r=(0,q.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Ne(Fe());r.current=e;let t=e.subscribe(n);e.probe();let i=()=>{e.probe()};return window.addEventListener(`focus`,i),()=>{window.removeEventListener(`focus`,i),t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,q.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function Le(){return Oe({isElectronHost:Pe(),now:Date.now})}var Re=(0,q.createContext)(null);function ze(e){let t=(0,J.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,X.jsx)(Re,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Be(){return(0,q.use)(Re)}function Ve(e){let t=(0,J.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,X.jsx)(i,{id:`YjiZAs`}),t[2]=o):o=t[2];let s;return t[3]!==a||t[4]!==n?(s=(0,X.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 He(e){let t=(0,J.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,X.jsx)(G,{...r}):(0,X.jsx)(k,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Ue(e){let t=(0,J.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,X.jsx)(ie,{...r}):(0,X.jsx)(D,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function We(e){let t=(0,J.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,X.jsx)(re,{...r}):(0,X.jsx)(j,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Ge(e){let t=(0,J.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,X.jsx)(se,{...r}):(0,X.jsx)(M,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Ke(e){let t=(0,J.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,X.jsx)(K,{...r}):(0,X.jsx)(P,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function qe(e){let t=(0,J.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,X.jsx)(ae,{...r}):(0,X.jsx)(O,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Je(e){let t=(0,J.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,X.jsx)(oe,{...r}):(0,X.jsx)(N,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Ye(e){let t=(0,J.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,X.jsx)(W,{...r}):(0,X.jsx)(A,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var Xe=Object.freeze({hosts:null,source:null}),Ze=new Map,Qe=new Map;function $e(e,t){return`${e}:${t}`}function et(e){return Ze.get(e)??Xe}function tt(e,t){let n=Qe.get(e)??new Set;return Qe.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&Qe.delete(e)}}function Q(e,t){let n=et(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?Ze.delete(e):Ze.set(e,r);for(let t of Qe.get(e)??[])t()}}var nt=y.options,rt=S.options,it=`.agents/`;function at({skill:e,allSkills:t,hostSet:n,sourceHostOverlay:r,linkMode:i}){let a=t=>e?`${z(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(it)))),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`?rt:nt,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:V(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=>[V(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=V(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 ot=`min-w-[24rem]`;function st(e,t){let n=(0,J.c)(45),r=t.installingName===e.name,i=(0,q.useRef)(e),[a,o]=(0,q.useState)(!1),s=(0,q.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,q.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,q.useEffect)(u,d);let f=r||a,p;n[6]!==e.name||n[7]!==e.scope?(p=$e(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=>tt(m,e),g=()=>et(m),n[9]=m,n[10]=h,n[11]=g);let _=(0,q.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&&Q(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,q.useEffect)(b,x);let S=e.linkMode===!0,T=v??e.hosts,E;n[17]===T?E=n[18]:(E=new Set(T),n[17]=T,n[18]=E);let D=E,O=v?v.length>0:e.installed,k=(0,q.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,q.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=et(m).hosts;e&&[...e].sort().join(`,`)===N&&Q(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,q.useEffect)(P,F);let I=(0,q.useRef)(null),L=(0,q.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,q.useEffect)(R,z);let B;n[31]!==t||n[32]!==m||n[33]!==e?(B=function(n,r){k.current=n,Q(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(C));if(!r.ok){Q(m,{hosts:null});return}k.current=[...r.hosts],Q(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,ee;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?(ee={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`?rt:nt,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,()=>te({scope:e.scope,name:e.name,dir:n,mode:r})).then(lt)},unplaceAt(n){t.runLocationWrite(e,()=>H({scope:e.scope,name:e.name,path:n})).then(ct)},setSource(n){Q(m,{source:n}),t.runLocationWrite(e,()=>U({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(Q(m,{source:null}),w.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]=ee):ee=n[44],ee}function ct(e){e.ok||w.error(e.error)}function lt(e){e.ok||w.error(e.error)}function $(e){let t=(0,J.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,X.jsx)(h,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,X.jsx)(g,{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,X.jsxs)(_,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function ut(e){let t=(0,J.c)(77),{toggles:n,skill:r,onResolveFork:o,onRunStart:c,menuKind:l}=e,u=l===void 0?`dropdown`:l,{_:d}=a(),{hostSet:f,toggleEditor:p,installAll:h}=n,g=ne(),_,v,y,b,S,C,E,D,O,k;if(t[0]!==d||t[1]!==g.data||t[2]!==g.status||t[3]!==f||t[4]!==h||t[5]!==u||t[6]!==o||t[7]!==c||t[8]!==r||t[9]!==p||t[10]!==n){let{pathFor:e,aliases:a,rows:l,sourceRow:A,sourceHost:j,conflicted:M,drifted:N,linked:P,expectedMode:I,convertible:L,customRootRows:V}=at({skill:r,allSkills:g.status===`ready`?g.data:null,hostSet:f,sourceHostOverlay:n.sourceHost,linkMode:n.linkMode});S=l,C=A,b=I,v=L,y=V;let H=e=>B(a,e),U=_t,te=e=>{let t=H(e);return t.length===0?!0:window.confirm(d({id:`Uobeu9`,values:{0:t.map(U).join(`, `),rootRel:e}}))},ne;t[21]!==d||t[22]!==r?(ne=(e,t)=>{let n=e.includes(`/`)?e:z(e,r?.scope??`project`);return(0,X.jsx)($,{hint:d({id:`0dslv8`,values:{0:U(e),1:U(e),2:r?.name??``,poolRootRel:t,subRoot:n}}),children:(0,X.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":d({id:`G6Lrs_`,values:{0:U(e)}}),onClick:i=>{i.preventDefault(),i.stopPropagation(),window.confirm(d({id:`iiqOKM`,values:{0:U(e),1:r.name,2:U(e),subRoot:n,poolRootRel:t}}))&&ee({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?T():w.error(d({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,X.jsx)(s,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[21]=d,t[22]=r,t[23]=ne):ne=t[23];let re=ne;_=n.installing;let ie=R(r),ae=gt,oe;t[24]!==d||t[25]!==c||t[26]!==n?(oe=(e,t,r)=>{let a=r===`link`?`copy`:`link`;return(0,X.jsx)($,{hint:d(r===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,X.jsx)(m,{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}}))&&(c?.(),n.convertLocation?.(e,a))},"data-testid":`skill-convert-${e}`,children:r===`link`?(0,X.jsx)(i,{id:`uUCrBv`}):(0,X.jsx)(i,{id:`iaPtht`})})})},t[24]=d,t[25]=c,t[26]=n,t[27]=oe):oe=t[27];let se=oe,W;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,X.jsx)(i,{id:`npcziF`}),t[28]=W):W=t[28];let G;t[29]===d?G=t[30]:(G=d({id:`6f_UX4`}),t[29]=d,t[30]=G);let K;t[31]===h?K=t[32]:(K=()=>h(),t[31]=h,t[32]=K);let q;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,X.jsx)(i,{id:`N40H-G`}),t[33]=q):q=t[33];let J;t[34]!==_||t[35]!==K?(J=(0,X.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:_,onClick:K,"data-testid":`skill-install-all`,children:q}),t[34]=_,t[35]=K,t[36]=J):J=t[36];let Y;t[37]!==G||t[38]!==J?(Y=(0,X.jsx)($,{hint:G,children:J}),t[37]=G,t[38]=J,t[39]=Y):Y=t[39],t[40]!==u||t[41]!==Y?(E=(0,X.jsxs)(Ge,{menuKind:u,className:`flex items-center justify-between gap-2`,children:[W,Y]}),t[40]=u,t[41]=Y,t[42]=E):E=t[42],D=C===null?null:(0,X.jsx)($,{hint:d({id:`pXB6SL`}),children:(0,X.jsxs)(We,{menuKind:u,disabled:_,checked:!0,onSelect:ht,"data-testid":`skill-source-row`,children:[(0,X.jsx)(F,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:C}),(()=>{let e=ae(C).split(`/`).slice(0,-1).join(`/`),t=H(e);return t.length>0?(0,X.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-source`,children:t.map(t=>re(t,e))}):null})(),(0,X.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,X.jsx)(i,{id:`tiFPjk`})})]})]})}),O=S.map(t=>{let a=e(t),c=t===`agents`?`.agents`:x[t],l=ae(a).split(`/`).slice(0,-1).join(`/`),h=H(l);return(0,X.jsx)($,{hint:M.has(t)?d({id:`8HvJlU`,values:{0:a??c}}):t===j?a?d({id:`ssk6rl`,values:{path:a}}):c:f.has(t)?d(a?{id:`9ieZhu`,values:{path:a}}:{id:`n3T3EE`,values:{label:c}}):ie?.editor===t?d({id:`_3S4Ql`,values:{0:r?.name??``,1:ie.plugin,2:a??c,label:c}}):d(a?j===void 0?{id:`xk133d`,values:{path:a}}:b===`link`?{id:`1LtA5r`,values:{path:a}}:{id:`opPbzN`,values:{path:a}}:{id:`Pp0Vgd`,values:{label:c}}),children:(0,X.jsxs)(We,{menuKind:u,disabled:_,checked:f.has(t),onCheckedChange:e=>{M.has(t)||e===!0&&!te(l)||p(t,e===!0)},onSelect:mt,className:`group`,"data-testid":`skill-install-editor-${t}`,children:[(0,X.jsx)(s,{host:t,"aria-hidden":!0,className:`size-4`}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:a??c}),h.length>0?(0,X.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${t}`,children:h.map(e=>re(e,l))}):null,ie?.editor===t&&!f.has(t)?(0,X.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,X.jsx)(i,{id:`scRzTw`})}):null,M.has(t)?(0,X.jsx)($,{hint:d({id:`_O7dJS`}),children:(0,X.jsx)(m,{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,X.jsx)(i,{id:`jng7Ko`})})}):t===j?(0,X.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,X.jsx)(i,{id:`tiFPjk`})}):f.has(t)&&r?.hosts?(0,X.jsxs)(X.Fragment,{children:[!_&&(P.has(t)?`link`:`copy`)!==b?se(t,a??c,P.has(t)?`link`:`copy`):null,(0,X.jsx)($,{hint:d({id:`nBgzKO`}),children:(0,X.jsx)(m,{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,X.jsx)(i,{id:`VNNRfN`})})})]}):null,!_&&N.has(ae(a))?(0,X.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,X.jsx)(Ve,{testId:`skill-drift-${t}`})}):null]})]})},t)}),k=y.map(e=>{let t=e.display;return(0,X.jsx)($,{hint:e.placed===null?d(j===void 0?{id:`xk133d`,values:{path:t}}:b===`link`?{id:`1LtA5r`,values:{path:t}}:{id:`opPbzN`,values:{path:t}}):d({id:`9ieZhu`,values:{path:t}}),children:(0,X.jsxs)(We,{menuKind:u,disabled:_,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!te(e.root))return;n.placeAt(e.root,b)}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,X.jsx)(s,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,X.jsx)(F,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.display}),H(e.root).length>0?(0,X.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-custom-${e.root}`,children:H(e.root).map(t=>re(t,e.root))}):null,!_&&e.placed!==null&&N.has(e.placed.path)?(0,X.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,X.jsx)(Ve,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,X.jsxs)(X.Fragment,{children:[!_&&e.placed.mode!==b?se(e.root,e.display,e.placed.mode):null,(0,X.jsx)($,{hint:d({id:`nBgzKO`}),children:(0,X.jsx)(m,{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,X.jsx)(i,{id:`VNNRfN`})})})]})]})]})},e.root)}),t[0]=d,t[1]=g.data,t[2]=g.status,t[3]=f,t[4]=h,t[5]=u,t[6]=o,t[7]=c,t[8]=r,t[9]=p,t[10]=n,t[11]=_,t[12]=v,t[13]=y,t[14]=b,t[15]=S,t[16]=C,t[17]=E,t[18]=D,t[19]=O,t[20]=k}else _=t[11],v=t[12],y=t[13],b=t[14],S=t[15],C=t[16],E=t[17],D=t[18],O=t[19],k=t[20];let A;t[43]!==y||t[44]!==S.length||t[45]!==C?(A=S.length===0&&y.length===0&&C===null?(0,X.jsx)(`div`,{className:`px-2 py-1.5 text-[11px] text-muted-foreground leading-snug`,"data-testid":`skill-install-no-destinations`,children:(0,X.jsx)(i,{id:`MOAoFO`})}):null,t[43]=y,t[44]=S.length,t[45]=C,t[46]=A):A=t[46];let j;t[47]!==d||t[48]!==_||t[49]!==v||t[50]!==b||t[51]!==c||t[52]!==n?(j=v.length>0&&n.convertLocations?(0,X.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-1 pb-1.5`,children:[(0,X.jsx)(m,{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=b===`link`?`copy`:`link`,r=v.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(ft).join(`
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{er as n}from"./DocumentContext-D7jvhyCA.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{b as s,f as c,g as l,m as u,r as d,s as f,t as p}from"./agent-connections-BZwWjV-L.js";import{t as m}from"./button-BeFNZANd.js";import{i as h,n as g,t as _}from"./tooltip-DVBVVaAs.js";import"./RegisteredAgentIcon--fiCkSba.js";import{Fc as v,en as y,jc as b,nl as x,nn as S,wi as C}from"./dist-DILeGueK.js";import{n as w}from"./dist-CJhtNlOm2.js";import{c as T}from"./documents-events-Do7TM3Hd.js";import{t as E}from"./createLucideIcon-B6ULg5PN.js";import{a as D,f as O,i as k,m as A,n as j,o as M,p as N,u as P}from"./dropdown-menu-BEhl0wvu.js";import{t as F}from"./folder-BrDDZVzs.js";import{n as I,t as L}from"./bool-pref-SOpULTKU.js";import{i as R,l as z,n as B,r as V}from"./skill-scope-CUAEKGV-.js";import{F as H,S as ee,j as U,x as te}from"./skills-api-CM8h9xtl.js";import{t as ne}from"./use-skills-DJX6inxB.js";import{a as re,c as ie,d as ae,f as oe,l as se,p as W,s as G,u as K}from"./DeleteConfirmationDialog-n90yA0mh.js";var q=e(r(),1),J=o();async function Y(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.recordHandoff)try{await n.shell.recordHandoff(e)}catch(e){(t.warn??(e=>console.warn(e)))(`[handoff] recordHandoff IPC rejected (telemetry skipped): ${e instanceof Error?e.message:String(e)}`)}}var ce=E(`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`}]]),le=E(`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`}]]),ue=E(`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`}]]),X=t(),de=(0,q.createContext)(null),fe=`ok-external-handoff-setup-dismissed-v1`,pe=250,me=1e4;function he(e){return(e instanceof Error?e.message:typeof e==`string`?e:null)?.replace(/\s+/g,` `).trim().slice(0,240)||void 0}function Z(e,t,n){let r=he(n);console.warn(`[handoff] external readiness check bypassed`,{target:e,cause:t,...r===void 0?{}:{detail:r}})}function ge(e){let{check:t}=e;t.statusTimer!==null&&clearTimeout(t.statusTimer),t.deadlineTimer!==null&&clearTimeout(t.deadlineTimer),t.statusTimer=null,t.deadlineTimer=null,t.controller.abort()}function _e(e,t){ve(e.target,t),e.resolve({ok:!1,reason:t})}function ve(e,t){Y({target:e,host:typeof window<`u`&&window.okDesktop!=null?`electron`:`web`,outcome:`error`,reason:t,ts:new Date().toISOString()})}function ye(e,t){if(t.unavailable===!0)return{kind:`unknown`,cause:`unavailable`,detail:t.error};if(!t.ok)return{kind:`unknown`,cause:`read-failed`,detail:t.error};if(t.snapshot===null)return{kind:`unknown`,cause:`missing-snapshot`};let n=d({agentId:e,mode:`external`,snapshot:t.snapshot,detected:!0});if(n===`connected`)return{kind:`ready`};if(n!==`not-connected`)return{kind:`unknown`,cause:`unknown-status`,detail:n};let r=c(t.snapshot,{forceDetected:[e]}).find(t=>t.id===e);return r===void 0?{kind:`unknown`,cause:`missing-row`}:{kind:`setup`,connection:r}}function be(){if(typeof document>`u`)return null;let e=document.activeElement;for(;e instanceof HTMLElement;){let t=e.shadowRoot?.activeElement;if(!(t instanceof HTMLElement))break;e=t}return e instanceof HTMLElement?e:null}function xe(e,t){return`${n(fe,t)}:${e}`}function Se(e,t){return L(xe(e,t))}function Ce(e,t,n){I(xe(e,t),n)}function we(e){let t=(0,J.c)(31),{children:n,applyConnections:r}=e,i=r===void 0?p:r,{_:o}=a(),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s={kind:`idle`},t[0]=s):s=t[0];let[c,d]=(0,q.useState)(s),[m,h]=(0,q.useState)(!1),g=(0,q.useRef)(null),_=(0,q.useRef)(0),y;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(y=function(e){return g.current?.id===e.id},t[1]=y):y=t[1];let x=y,S;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(S=function(e){return x(e)?(g.current=null,ge(e),d({kind:`idle`}),!0):!1},t[2]=S):S=t[2];let C=S,w,T;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>()=>{let e=g.current;e!==null&&(g.current=null,ge(e),_e(e,`superseded`))},T=[],t[3]=w,t[4]=T):(w=t[3],T=t[4]),(0,q.useEffect)(w,T);let E;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(E=function(e){C(e)&&_e(e,`setup-canceled`)},t[5]=E):E=t[5];let D=E,O;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(O=function(e){C(e)&&Promise.resolve().then(e.rawDispatch).then(e.resolve,e.reject)},t[6]=O):O=t[6];let k=O,A;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(A=function(e){let t=be();if(t===null||t===document.body||!t.isConnected)return e;let n={...e,returnFocus:t};return g.current=n,n},t[7]=A):A=t[7];let j=A,M;if(t[8]!==i){let e=async function(e){let t=v(e.target);if(t===void 0){Z(e.target,`unmapped-target`),k(e);return}let n;try{n=await i([],{webSignal:e.check.controller.signal})}catch(t){let n=t;if(!x(e))return;Z(e.target,`read-threw`,n),k(e);return}if(!x(e))return;let r;try{r=ye(t,n)}catch(t){let n=t;Z(e.target,`derivation-threw`,n),k(e);return}if(r.kind!==`setup`){r.kind===`unknown`&&Z(e.target,r.cause,r.detail),k(e);return}ge(e),h(!1),d({kind:`setup`,pending:j(e),connection:r.connection})};M=function(t,n,r){let i=g.current;i!==null&&C(i)&&_e(i,`superseded`);let a=_.current+=1;return r.installState.installed===!1?(ve(t,`not-installed`),Promise.resolve({ok:!1,reason:`not-installed`})):new Promise((i,o)=>{let s=be(),c={id:a,target:t,projectDir:r.projectDir,rawDispatch:n,returnFocus:s?.tagName===`BODY`?null:s,restoreFocus:r.restoreFocus,resolve:i,reject:o,check:{controller:new AbortController,statusTimer:null,deadlineTimer:null}};if(g.current=c,Se(t,r.projectDir)){k(c);return}d({kind:`checking`,id:a,target:t,visible:!1}),c.check.statusTimer=setTimeout(()=>{x(c)&&d(e=>e.kind===`checking`&&e.id===a?{...e,visible:!0}:e)},pe),c.check.deadlineTimer=setTimeout(()=>{x(c)&&(Z(c.target,`read-timeout`),k(c))},me),e(c).catch(e=>{x(c)&&(Z(c.target,`check-threw`,e),k(c))})})},t[8]=i,t[9]=M}else M=t[9];let N=M,P=c.kind===`setup`?c:null,F=P?.connection.label??``,I;t[10]!==c.kind||t[11]!==c.target?(I=c.kind===`checking`?b.find(e=>e.id===c.target)?.displayName??c.target:``,t[10]=c.kind,t[11]=c.target,t[12]=I):I=t[12];let L=I,R;t[13]===N?R=t[14]:(R={dispatch:N},t[13]=N,t[14]=R);let z;t[15]!==o||t[16]!==L||t[17]!==c.kind||t[18]!==c.visible?(z=c.kind===`checking`&&c.visible?(0,X.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`pointer-events-none fixed left-1/2 top-4 z-50 -translate-x-1/2 rounded-full border border-border bg-background px-4 py-2 text-sm text-foreground shadow-md`,children:o({id:`jDejAI`,values:{checkingLabel:L}})}):null,t[15]=o,t[16]=L,t[17]=c.kind,t[18]=c.visible,t[19]=z):z=t[19];let B;t[20]!==o||t[21]!==i||t[22]!==F||t[23]!==m||t[24]!==P?(B=P===null?null:(0,X.jsx)(f,{connection:P.connection,paired:u(P.connection.id),open:!0,onOpenChange:e=>{e||D(P.pending)},onCloseAutoFocus:e=>{let t=P.pending.returnFocus;t?.isConnected===!0?(e.preventDefault(),t.focus()):P.pending.restoreFocus!==void 0&&(e.preventDefault(),P.pending.restoreFocus())},validateSave:e=>e.projectMcp||e.globalMcp?null:o({id:`Pur9o0`}),alternateAction:{label:o({id:`RcPztQ`,values:{handoffLabel:F}}),onClick:()=>{m&&Ce(P.pending.target,P.pending.projectDir,!0),k(P.pending)},preference:{checked:m,label:o({id:`IDXn2n`}),onCheckedChange:h}},onSave:async(e,t)=>{let n=await i(l(P.connection,e,t));if(!x(P.pending)||!n.ok)return n;let r;try{r=ye(P.connection.id,n)}catch(e){let t=e;return Z(P.pending.target,`derivation-threw`,t),{kind:`saved-not-ready`,message:o({id:`srbby-`,values:{handoffLabel:F}})}}return r.kind===`ready`?(k(P.pending),n):{kind:`saved-not-ready`,message:o({id:`srbby-`,values:{handoffLabel:F}})}}},P.pending.id),t[20]=o,t[21]=i,t[22]=F,t[23]=m,t[24]=P,t[25]=B):B=t[25];let V;return t[26]!==n||t[27]!==R||t[28]!==z||t[29]!==B?(V=(0,X.jsxs)(de,{value:R,children:[n,z,B]}),t[26]=n,t[27]=R,t[28]=z,t[29]=B,t[30]=V):V=t[30],V}function Te(){let e=(0,q.use)(de);if(e===null)throw Error(`useExternalHandoffGate must be used within <ExternalHandoffGateProvider />`);return e}var Ee=[...new Set(b.flatMap(e=>e.schemes))];function De(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 Oe(e){return De({},e)}async function ke(e){let t=e.schemes??Ee,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 Ae=Object.fromEntries(Ee.map(e=>[e,{installed:!1}]));async function je(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 Ae}if(!t.ok)return Ae;let n;try{n=await t.json()}catch{return Ae}if(typeof n!=`object`||!n||Array.isArray(n))return Ae;let r=n,i={};for(let e of Ee)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function Me(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 Ne(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Oe({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=De(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=!Me(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 Pe(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Fe(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>ke({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>je({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Ie(){let e=(0,J.c)(5),[t,n]=(0,q.useState)(Le),r=(0,q.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Ne(Fe());r.current=e;let t=e.subscribe(n);e.probe();let i=()=>{e.probe()};return window.addEventListener(`focus`,i),()=>{window.removeEventListener(`focus`,i),t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,q.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function Le(){return Oe({isElectronHost:Pe(),now:Date.now})}var Re=(0,q.createContext)(null);function ze(e){let t=(0,J.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,X.jsx)(Re,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Be(){return(0,q.use)(Re)}function Ve(e){let t=(0,J.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,X.jsx)(i,{id:`YjiZAs`}),t[2]=o):o=t[2];let s;return t[3]!==a||t[4]!==n?(s=(0,X.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 He(e){let t=(0,J.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,X.jsx)(G,{...r}):(0,X.jsx)(k,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Ue(e){let t=(0,J.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,X.jsx)(ie,{...r}):(0,X.jsx)(D,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function We(e){let t=(0,J.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,X.jsx)(re,{...r}):(0,X.jsx)(j,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Ge(e){let t=(0,J.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,X.jsx)(se,{...r}):(0,X.jsx)(M,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Ke(e){let t=(0,J.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,X.jsx)(K,{...r}):(0,X.jsx)(P,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function qe(e){let t=(0,J.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,X.jsx)(ae,{...r}):(0,X.jsx)(O,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Je(e){let t=(0,J.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,X.jsx)(oe,{...r}):(0,X.jsx)(N,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Ye(e){let t=(0,J.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,X.jsx)(W,{...r}):(0,X.jsx)(A,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var Xe=Object.freeze({hosts:null,source:null}),Ze=new Map,Qe=new Map;function $e(e,t){return`${e}:${t}`}function et(e){return Ze.get(e)??Xe}function tt(e,t){let n=Qe.get(e)??new Set;return Qe.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&Qe.delete(e)}}function Q(e,t){let n=et(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?Ze.delete(e):Ze.set(e,r);for(let t of Qe.get(e)??[])t()}}var nt=y.options,rt=S.options,it=`.agents/`;function at({skill:e,allSkills:t,hostSet:n,sourceHostOverlay:r,linkMode:i}){let a=t=>e?`${z(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(it)))),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`?rt:nt,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:V(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=>[V(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=V(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 ot=`min-w-[24rem]`;function st(e,t){let n=(0,J.c)(45),r=t.installingName===e.name,i=(0,q.useRef)(e),[a,o]=(0,q.useState)(!1),s=(0,q.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,q.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,q.useEffect)(u,d);let f=r||a,p;n[6]!==e.name||n[7]!==e.scope?(p=$e(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=>tt(m,e),g=()=>et(m),n[9]=m,n[10]=h,n[11]=g);let _=(0,q.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&&Q(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,q.useEffect)(b,x);let S=e.linkMode===!0,T=v??e.hosts,E;n[17]===T?E=n[18]:(E=new Set(T),n[17]=T,n[18]=E);let D=E,O=v?v.length>0:e.installed,k=(0,q.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,q.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=et(m).hosts;e&&[...e].sort().join(`,`)===N&&Q(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,q.useEffect)(P,F);let I=(0,q.useRef)(null),L=(0,q.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,q.useEffect)(R,z);let B;n[31]!==t||n[32]!==m||n[33]!==e?(B=function(n,r){k.current=n,Q(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(C));if(!r.ok){Q(m,{hosts:null});return}k.current=[...r.hosts],Q(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,ee;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?(ee={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`?rt:nt,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,()=>te({scope:e.scope,name:e.name,dir:n,mode:r})).then(lt)},unplaceAt(n){t.runLocationWrite(e,()=>H({scope:e.scope,name:e.name,path:n})).then(ct)},setSource(n){Q(m,{source:n}),t.runLocationWrite(e,()=>U({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(Q(m,{source:null}),w.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]=ee):ee=n[44],ee}function ct(e){e.ok||w.error(e.error)}function lt(e){e.ok||w.error(e.error)}function $(e){let t=(0,J.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,X.jsx)(h,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,X.jsx)(g,{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,X.jsxs)(_,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function ut(e){let t=(0,J.c)(77),{toggles:n,skill:r,onResolveFork:o,onRunStart:c,menuKind:l}=e,u=l===void 0?`dropdown`:l,{_:d}=a(),{hostSet:f,toggleEditor:p,installAll:h}=n,g=ne(),_,v,y,b,S,C,E,D,O,k;if(t[0]!==d||t[1]!==g.data||t[2]!==g.status||t[3]!==f||t[4]!==h||t[5]!==u||t[6]!==o||t[7]!==c||t[8]!==r||t[9]!==p||t[10]!==n){let{pathFor:e,aliases:a,rows:l,sourceRow:A,sourceHost:j,conflicted:M,drifted:N,linked:P,expectedMode:I,convertible:L,customRootRows:V}=at({skill:r,allSkills:g.status===`ready`?g.data:null,hostSet:f,sourceHostOverlay:n.sourceHost,linkMode:n.linkMode});S=l,C=A,b=I,v=L,y=V;let H=e=>B(a,e),U=_t,te=e=>{let t=H(e);return t.length===0?!0:window.confirm(d({id:`Uobeu9`,values:{0:t.map(U).join(`, `),rootRel:e}}))},ne;t[21]!==d||t[22]!==r?(ne=(e,t)=>{let n=e.includes(`/`)?e:z(e,r?.scope??`project`);return(0,X.jsx)($,{hint:d({id:`0dslv8`,values:{0:U(e),1:U(e),2:r?.name??``,poolRootRel:t,subRoot:n}}),children:(0,X.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":d({id:`G6Lrs_`,values:{0:U(e)}}),onClick:i=>{i.preventDefault(),i.stopPropagation(),window.confirm(d({id:`iiqOKM`,values:{0:U(e),1:r.name,2:U(e),subRoot:n,poolRootRel:t}}))&&ee({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?T():w.error(d({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,X.jsx)(s,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[21]=d,t[22]=r,t[23]=ne):ne=t[23];let re=ne;_=n.installing;let ie=R(r),ae=gt,oe;t[24]!==d||t[25]!==c||t[26]!==n?(oe=(e,t,r)=>{let a=r===`link`?`copy`:`link`;return(0,X.jsx)($,{hint:d(r===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,X.jsx)(m,{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}}))&&(c?.(),n.convertLocation?.(e,a))},"data-testid":`skill-convert-${e}`,children:r===`link`?(0,X.jsx)(i,{id:`uUCrBv`}):(0,X.jsx)(i,{id:`iaPtht`})})})},t[24]=d,t[25]=c,t[26]=n,t[27]=oe):oe=t[27];let se=oe,W;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,X.jsx)(i,{id:`npcziF`}),t[28]=W):W=t[28];let G;t[29]===d?G=t[30]:(G=d({id:`6f_UX4`}),t[29]=d,t[30]=G);let K;t[31]===h?K=t[32]:(K=()=>h(),t[31]=h,t[32]=K);let q;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,X.jsx)(i,{id:`N40H-G`}),t[33]=q):q=t[33];let J;t[34]!==_||t[35]!==K?(J=(0,X.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:_,onClick:K,"data-testid":`skill-install-all`,children:q}),t[34]=_,t[35]=K,t[36]=J):J=t[36];let Y;t[37]!==G||t[38]!==J?(Y=(0,X.jsx)($,{hint:G,children:J}),t[37]=G,t[38]=J,t[39]=Y):Y=t[39],t[40]!==u||t[41]!==Y?(E=(0,X.jsxs)(Ge,{menuKind:u,className:`flex items-center justify-between gap-2`,children:[W,Y]}),t[40]=u,t[41]=Y,t[42]=E):E=t[42],D=C===null?null:(0,X.jsx)($,{hint:d({id:`pXB6SL`}),children:(0,X.jsxs)(We,{menuKind:u,disabled:_,checked:!0,onSelect:ht,"data-testid":`skill-source-row`,children:[(0,X.jsx)(F,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:C}),(()=>{let e=ae(C).split(`/`).slice(0,-1).join(`/`),t=H(e);return t.length>0?(0,X.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-source`,children:t.map(t=>re(t,e))}):null})(),(0,X.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,X.jsx)(i,{id:`tiFPjk`})})]})]})}),O=S.map(t=>{let a=e(t),c=t===`agents`?`.agents`:x[t],l=ae(a).split(`/`).slice(0,-1).join(`/`),h=H(l);return(0,X.jsx)($,{hint:M.has(t)?d({id:`8HvJlU`,values:{0:a??c}}):t===j?a?d({id:`ssk6rl`,values:{path:a}}):c:f.has(t)?d(a?{id:`9ieZhu`,values:{path:a}}:{id:`n3T3EE`,values:{label:c}}):ie?.editor===t?d({id:`_3S4Ql`,values:{0:r?.name??``,1:ie.plugin,2:a??c,label:c}}):d(a?j===void 0?{id:`xk133d`,values:{path:a}}:b===`link`?{id:`1LtA5r`,values:{path:a}}:{id:`opPbzN`,values:{path:a}}:{id:`Pp0Vgd`,values:{label:c}}),children:(0,X.jsxs)(We,{menuKind:u,disabled:_,checked:f.has(t),onCheckedChange:e=>{M.has(t)||e===!0&&!te(l)||p(t,e===!0)},onSelect:mt,className:`group`,"data-testid":`skill-install-editor-${t}`,children:[(0,X.jsx)(s,{host:t,"aria-hidden":!0,className:`size-4`}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:a??c}),h.length>0?(0,X.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${t}`,children:h.map(e=>re(e,l))}):null,ie?.editor===t&&!f.has(t)?(0,X.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,X.jsx)(i,{id:`scRzTw`})}):null,M.has(t)?(0,X.jsx)($,{hint:d({id:`_O7dJS`}),children:(0,X.jsx)(m,{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,X.jsx)(i,{id:`jng7Ko`})})}):t===j?(0,X.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,X.jsx)(i,{id:`tiFPjk`})}):f.has(t)&&r?.hosts?(0,X.jsxs)(X.Fragment,{children:[!_&&(P.has(t)?`link`:`copy`)!==b?se(t,a??c,P.has(t)?`link`:`copy`):null,(0,X.jsx)($,{hint:d({id:`nBgzKO`}),children:(0,X.jsx)(m,{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,X.jsx)(i,{id:`VNNRfN`})})})]}):null,!_&&N.has(ae(a))?(0,X.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,X.jsx)(Ve,{testId:`skill-drift-${t}`})}):null]})]})},t)}),k=y.map(e=>{let t=e.display;return(0,X.jsx)($,{hint:e.placed===null?d(j===void 0?{id:`xk133d`,values:{path:t}}:b===`link`?{id:`1LtA5r`,values:{path:t}}:{id:`opPbzN`,values:{path:t}}):d({id:`9ieZhu`,values:{path:t}}),children:(0,X.jsxs)(We,{menuKind:u,disabled:_,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!te(e.root))return;n.placeAt(e.root,b)}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,X.jsx)(s,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,X.jsx)(F,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.display}),H(e.root).length>0?(0,X.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-custom-${e.root}`,children:H(e.root).map(t=>re(t,e.root))}):null,!_&&e.placed!==null&&N.has(e.placed.path)?(0,X.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,X.jsx)(Ve,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,X.jsxs)(X.Fragment,{children:[!_&&e.placed.mode!==b?se(e.root,e.display,e.placed.mode):null,(0,X.jsx)($,{hint:d({id:`nBgzKO`}),children:(0,X.jsx)(m,{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,X.jsx)(i,{id:`VNNRfN`})})})]})]})]})},e.root)}),t[0]=d,t[1]=g.data,t[2]=g.status,t[3]=f,t[4]=h,t[5]=u,t[6]=o,t[7]=c,t[8]=r,t[9]=p,t[10]=n,t[11]=_,t[12]=v,t[13]=y,t[14]=b,t[15]=S,t[16]=C,t[17]=E,t[18]=D,t[19]=O,t[20]=k}else _=t[11],v=t[12],y=t[13],b=t[14],S=t[15],C=t[16],E=t[17],D=t[18],O=t[19],k=t[20];let A;t[43]!==y||t[44]!==S.length||t[45]!==C?(A=S.length===0&&y.length===0&&C===null?(0,X.jsx)(`div`,{className:`px-2 py-1.5 text-[11px] text-muted-foreground leading-snug`,"data-testid":`skill-install-no-destinations`,children:(0,X.jsx)(i,{id:`MOAoFO`})}):null,t[43]=y,t[44]=S.length,t[45]=C,t[46]=A):A=t[46];let j;t[47]!==d||t[48]!==_||t[49]!==v||t[50]!==b||t[51]!==c||t[52]!==n?(j=v.length>0&&n.convertLocations?(0,X.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-1 pb-1.5`,children:[(0,X.jsx)(m,{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=b===`link`?`copy`:`link`,r=v.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(ft).join(`
|
|
2
2
|
`);window.confirm(`${i}\n\n${a}\n\n${o}\n\n${d({id:`Cu6GXQ`})}`)&&(c?.(),n.convertLocations?.(r.map(e=>({target:e.target,mode:t}))))},disabled:_,"data-testid":`skill-convert-all`,children:b===`link`?(0,X.jsx)(i,{id:`rcJmK8`}):(0,X.jsx)(i,{id:`LBv_TR`})}),(0,X.jsx)($,{hint:d({id:`0J6nhG`}),children:(0,X.jsx)(m,{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:dt,"data-testid":`skill-convert-all-help`,children:`?`})})]}):null,t[47]=d,t[48]=_,t[49]=v,t[50]=b,t[51]=c,t[52]=n,t[53]=j):j=t[53];let M;t[54]===u?M=t[55]:(M=(0,X.jsx)(Ke,{menuKind:u}),t[54]=u,t[55]=M);let N;t[56]===d?N=t[57]:(N=d({id:`5ymuTA`}),t[56]=d,t[57]=N);let P;t[58]===r?.scope?P=t[59]:(P=()=>{window.location.hash=r?.scope===`global`?`#settings/user-skills`:`#settings/skills`},t[58]=r?.scope,t[59]=P);let I,L;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,X.jsx)(ue,{"aria-hidden":!0}),L=(0,X.jsx)(i,{id:`ZBF9fn`}),t[60]=I,t[61]=L):(I=t[60],L=t[61]);let V;t[62]!==u||t[63]!==P?(V=(0,X.jsxs)(Ue,{menuKind:u,onSelect:P,children:[I,L]}),t[62]=u,t[63]=P,t[64]=V):V=t[64];let H;t[65]!==V||t[66]!==N?(H=(0,X.jsx)($,{hint:N,children:V}),t[65]=V,t[66]=N,t[67]=H):H=t[67];let U;return t[68]!==H||t[69]!==E||t[70]!==D||t[71]!==O||t[72]!==k||t[73]!==A||t[74]!==j||t[75]!==M?(U=(0,X.jsxs)(X.Fragment,{children:[E,D,O,k,A,j,M,H]}),t[68]=H,t[69]=E,t[70]=D,t[71]=O,t[72]=k,t[73]=A,t[74]=j,t[75]=M,t[76]=U):U=t[76],U}function dt(e){return e.preventDefault()}function ft(e){return e.display}function pt(e){return e.preventDefault()}function mt(e){return e.preventDefault()}function ht(e){return e.preventDefault()}function gt(e){return(e??``).replace(/^~\//,``)}function _t(e){return e===`agents`?`.agents`:x[e]??e}export{ce as C,le as S,we as _,nt as a,Te as b,Ge as c,Je as d,Ye as f,Ie as g,Be as h,rt as i,Ke as l,ze as m,ut as n,He as o,Ve as p,st as r,Ue as s,ot as t,qe as u,Ce as v,Y as w,ue as x,Se as y};
|
package/dist/public/assets/{SkillToolbarControls-C3cT4d_4.js → SkillToolbarControls-OhQrSWSi.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{t as s}from"./button-BeFNZANd.js";import{a as c,i as l,n as u,o as d,r as f,s as p,t as m}from"./select-D_BhUvh8.js";import{l as h,n as g,r as _,t as v}from"./AddPropertiesButton-
|
|
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{t as s}from"./button-BeFNZANd.js";import{a as c,i as l,n as u,o as d,r as f,s as p,t as m}from"./select-D_BhUvh8.js";import{l as h,n as g,r as _,t as v}from"./AddPropertiesButton-DARtVJlU.js";import{C as y}from"./SkillInstallMenu-BRjVgdkn.js";import{a as b,h as x,r as S,t as C,u as w}from"./dropdown-menu-BEhl0wvu.js";import{t as T}from"./list-plus-BmoxCvSM.js";import{p as E,t as D}from"./skill-scope-CUAEKGV-.js";var O=a(),k=t();function A(e){let t=(0,O.c)(21),{value:n,onRequestMove:a,disabled:s,triggerClassName:h}=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]===h?b=t[5]:(b=o(`w-auto gap-1 text-xs font-mono uppercase`,h),t[4]=h,t[5]=b);let x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,k.jsx)(p,{}),t[6]=x):x=t[6];let S;t[7]!==y||t[8]!==b?(S=(0,k.jsx)(d,{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)(c,{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)(l,{value:e,children:_[e]},e)),t[11]=_,t[12]=w);let T;t[13]===w?T=t[14]:(T=(0,k.jsx)(u,{align:`end`,children:(0,k.jsxs)(f,{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)(m,{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)(h,{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:c,problemCount:l,problemMessages:u}=e,{_:d}=i(),f;t[0]!==a||t[1]!==n?(f={scope:n,name:a},t[0]=a,t[1]=n,t[2]=f):f=t[2];let p=M(f),m;t[3]!==p.requestMove||t[4]!==n?(m=(0,k.jsx)(A,{value:n,onRequestMove:p.requestMove,triggerClassName:`hidden @xl/toolbar:flex`}),t[3]=p.requestMove,t[4]=n,t[5]=m):m=t[5];let h;t[6]!==a||t[7]!==n?(h=(0,k.jsx)(_,{scope:n,name:a}),t[6]=a,t[7]=n,t[8]=h):h=t[8];let E;t[9]!==m||t[10]!==h?(E=(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[m,h]}),t[9]=m,t[10]=h,t[11]=E):E=t[11];let D;t[12]!==c||t[13]!==l||t[14]!==u||t[15]!==o?(D=o?(0,k.jsx)(v,{onAddProperty:c,problemCount:l,problemMessages:u,className:`hidden @xl/toolbar:inline-flex`}):null,t[12]=c,t[13]=l,t[14]=u,t[15]=o,t[16]=D):D=t[16];let j;t[17]===d?j=t[18]:(j=d({id:`Yzs3QX`}),t[17]=d,t[18]=j);let N;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,k.jsx)(y,{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)(s,{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]===p?F=t[23]:(F=e=>p.requestMove(e),t[22]=p,t[23]=F);let I;t[24]!==n||t[25]!==F?(I=(0,k.jsx)(g,{value:n,onSelect:F}),t[24]=n,t[25]=F,t[26]=I):I=t[26];let L;t[27]!==c||t[28]!==o?(L=o?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(w,{}),(0,k.jsxs)(b,{onSelect:c,children:[(0,k.jsx)(T,{}),(0,k.jsx)(r,{id:`81H_23`})]})]}):null,t[27]=c,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]!==p.dialog||t[37]!==z||t[38]!==E||t[39]!==D?(B=(0,k.jsxs)(k.Fragment,{children:[E,D,z,p.dialog]}),t[36]=p.dialog,t[37]=z,t[38]=E,t[39]=D,t[40]=B):B=t[40],B}export{N as SkillToolbarControls};
|