tarsk 0.5.67 → 0.5.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/index.js +3 -2
  2. package/dist/public/assets/{account-view-BlK6g38q.js → account-view-Chzj6v7a.js} +1 -1
  3. package/dist/public/assets/{alert-dialog-B6An1LDY.js → alert-dialog-CLYxQdrK.js} +1 -1
  4. package/dist/public/assets/{async-error-boundary-Rf-s2_Ez.js → async-error-boundary-CM6LU7nT.js} +1 -1
  5. package/dist/public/assets/{browser-tab-BJxPUVJi.js → browser-tab--1iEoJGu.js} +1 -1
  6. package/dist/public/assets/{chat-dock-context-DyKjqpND.js → chat-dock-context-Gg1jpamu.js} +1 -1
  7. package/dist/public/assets/{commit-dialog-CYb1kJCq.js → commit-dialog-BfdxNX_T.js} +1 -1
  8. package/dist/public/assets/{commit-error-dialog-DvxaNRcH.js → commit-error-dialog-DrsDKL-B.js} +1 -1
  9. package/dist/public/assets/{commit-method-fields-Dijc502F.js → commit-method-fields-o-xw2faT.js} +1 -1
  10. package/dist/public/assets/{context-menu-C51M1WGZ.js → context-menu-BLvLpqq7.js} +1 -1
  11. package/dist/public/assets/{conversation-history-view-w_6Jd3d-.js → conversation-history-view-ukfe_7qw.js} +1 -1
  12. package/dist/public/assets/{create-project-dialog-CSVkngnF.js → create-project-dialog-DrXo61FQ.js} +1 -1
  13. package/dist/public/assets/{create-repo-dialog-CcFA8pXz.js → create-repo-dialog-CkFACtMf.js} +1 -1
  14. package/dist/public/assets/{delete-confirm-dialog-uTSX_x-i.js → delete-confirm-dialog-D1zjctrX.js} +1 -1
  15. package/dist/public/assets/{diff-view-XN5G5F6E.js → diff-view-Cxf7v9t1.js} +1 -1
  16. package/dist/public/assets/{explorer-tab-view-A2ICDFPB.js → explorer-tab-view-LkT0bDcR.js} +2 -2
  17. package/dist/public/assets/{explorer-tree-B04Ba59E.js → explorer-tree-B6EZUVTn.js} +1 -1
  18. package/dist/public/assets/{explorer-view-CofaKFiu.js → explorer-view-D5y8Uxoi.js} +1 -1
  19. package/dist/public/assets/{git-history-dialog-V3kaff2G.js → git-history-dialog-X6sVwgPT.js} +1 -1
  20. package/dist/public/assets/{index-B0xy4BkI.js → index-CJCQ4bTo.js} +32 -33
  21. package/dist/public/assets/{mcp-server-card-DOsP-SQ8.js → mcp-server-card-DPakHrG9.js} +1 -1
  22. package/dist/public/assets/{merged-pr-dialog-BerRzLlh.js → merged-pr-dialog-C3euJvCu.js} +1 -1
  23. package/dist/public/assets/{model-list-controls-Dw98tMn7.js → model-list-controls-2JtkzWsp.js} +1 -1
  24. package/dist/public/assets/{monaco-setup-C87kBr4u.js → monaco-setup-b-rhUj5t.js} +1 -1
  25. package/dist/public/assets/{onboarding-DVc9-yKJ.js → onboarding-KBcwP-kU.js} +1 -1
  26. package/dist/public/assets/{project-env-vars-view-BQwUd7y6.js → project-env-vars-view-D60J_-qQ.js} +1 -1
  27. package/dist/public/assets/{project-model-aliases-view-CobSp09z.js → project-model-aliases-view-EClnOgBH.js} +1 -1
  28. package/dist/public/assets/{project-settings-view-CPTd5lEi.js → project-settings-view-Cb0iiyad.js} +1 -1
  29. package/dist/public/assets/{project-tools-view-DShQghoz.js → project-tools-view-B_WnVICB.js} +1 -1
  30. package/dist/public/assets/{providers-list-view-Da9VMcuP.js → providers-list-view-CYy82_hl.js} +1 -1
  31. package/dist/public/assets/{pull-request-dialog-BAarT9EM.js → pull-request-dialog-CitbRcub.js} +1 -1
  32. package/dist/public/assets/{pull-with-changes-dialog-BcF25mjQ.js → pull-with-changes-dialog-CpgHqvKf.js} +1 -1
  33. package/dist/public/assets/{push-before-pr-dialog-BF0NzV2u.js → push-before-pr-dialog-CrcNZDLb.js} +1 -1
  34. package/dist/public/assets/{react-vendor-B7jFrulV.js → react-vendor-7n7LyU5o.js} +1 -1
  35. package/dist/public/assets/{settings-general-view-DT4nElcL.js → settings-general-view-72s5xgPj.js} +1 -1
  36. package/dist/public/assets/{settings-instructions-view-Bsr8wRMf.js → settings-instructions-view-DN4-73KP.js} +1 -1
  37. package/dist/public/assets/{settings-list-B9wyVzKw.js → settings-list-CWdsaJKC.js} +1 -1
  38. package/dist/public/assets/{settings-logs-view-CyaGqUKH.js → settings-logs-view-CkkVgGvv.js} +1 -1
  39. package/dist/public/assets/{settings-mcp-servers-view-BTUWHB5K.js → settings-mcp-servers-view-B8_vnfl6.js} +1 -1
  40. package/dist/public/assets/{settings-models-view-DFwkVdt3.js → settings-models-view-xIRY7PvW.js} +1 -1
  41. package/dist/public/assets/{settings-rules-view-BhA9tjVh.js → settings-rules-view-DIk0ghSW.js} +1 -1
  42. package/dist/public/assets/{settings-skills-view-BFoO9oZk.js → settings-skills-view-qWbr0Vl2.js} +1 -1
  43. package/dist/public/assets/{settings-slack-view-D4mrQ9C9.js → settings-slack-view-RFLP0USW.js} +1 -1
  44. package/dist/public/assets/{settings-slash-commands-view-BLKPDUVG.js → settings-slash-commands-view-zFWoR_R7.js} +1 -1
  45. package/dist/public/assets/{settings-statistics-view-fa6iBiP8.js → settings-statistics-view-BgrzVn4R.js} +1 -1
  46. package/dist/public/assets/{settings-storage-view-LaiAi5gv.js → settings-storage-view-BS2k7E74.js} +1 -1
  47. package/dist/public/assets/{settings-subagents-view-BjMz2Ri_.js → settings-subagents-view-BZr1NkVp.js} +1 -1
  48. package/dist/public/assets/{settings-system-prompt-view-DNh1yqZh.js → settings-system-prompt-view-mQErde93.js} +1 -1
  49. package/dist/public/assets/{settings-view-BoC66Wji.js → settings-view-D4-XZz2V.js} +2 -2
  50. package/dist/public/assets/{tasks-view-B049aXpC.js → tasks-view-DgkXglqW.js} +2 -2
  51. package/dist/public/assets/{terminal-panel-Pv5xqCpm.js → terminal-panel-DCaBWV04.js} +1 -1
  52. package/dist/public/assets/{ui-components-DJLsrr5e.js → ui-components-1WsgZqWa.js} +1 -1
  53. package/dist/public/assets/{use-active-dock-panel-instance-BlRDPUlZ.js → use-active-dock-panel-instance-B9ao_JH2.js} +1 -1
  54. package/dist/public/assets/{use-installed-ai-files-DmLnugpj.js → use-installed-ai-files-GpG9ZL8U.js} +1 -1
  55. package/dist/public/assets/{web-BidDZaMC.js → web-BuYdGVW8.js} +1 -1
  56. package/dist/public/assets/{web-DHUv7oQP.js → web-CEfF0992.js} +1 -1
  57. package/dist/public/assets/{web-JMCxQg4N.js → web-D7CwlITA.js} +1 -1
  58. package/dist/public/assets/{web-C_HuLxHj.js → web-yeAPC2wm.js} +1 -1
  59. package/dist/public/index.html +5 -5
  60. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{$ as t,Ct as n,Di as r,Oi as i,Rr as a,Vt as o,X as s,c,et as l,i as u,in as d,ki as f,m as p,rr as m,xn as h,yt as g}from"./interactive-BrHVRHmQ.js";import{$a as _,A as v,Bi as y,Ct as b,D as x,Eo as S,Ga as C,Ia as w,Ii as T,La as E,Lr as D,Mi as O,Ni as k,O as A,Ri as j,So as M,St as N,T as P,Tt as F,Ui as I,Vi as L,Wi as R,_ as z,b as B,bt as V,dt as ee,et as te,f as H,gn as ne,h as U,j as W,ji as re,k as G,m as ie,mt as K,no as ae,nt as oe,p as se,pt as ce,rt as q,si as le,st as ue,tt as de,ut as fe,v as pe,wt as me,x as J,yo as he,zi as ge}from"./onboarding-DVc9-yKJ.js";import{r as _e}from"./store-B_cK-gsT.js";import{t as Y}from"./use-toast-hxHsVv6a.js";import{a as ve,c as ye,i as be,n as xe,o as Se,r as Ce,s as we,t as Te}from"./alert-dialog-B6An1LDY.js";import{Bt as X,Ht as Ee,It as De,Kt as Oe,Lt as ke,U as Ae,a as je,zt as Me}from"./index-B0xy4BkI.js";import{t as Ne}from"./delete-confirm-dialog-uTSX_x-i.js";import{t as Pe}from"./use-settings-page-loading-BU2CDnfE.js";import{a as Fe,i as Ie,o as Le,r as Re}from"./settings-list-B9wyVzKw.js";import{t as ze}from"./use-deferred-search-0sV7mSzX.js";import{a as Be,i as Ve,n as He,r as Ue,t as We}from"./mcp-server-card-DOsP-SQ8.js";import{t as Ge}from"./use-installed-ai-files-DmLnugpj.js";var Z=i(),Q=e(f(),1),$=r();function Ke({threadId:e,onSkillCreated:t}){let[n,r]=(0,Q.useState)(``),[i,o]=(0,Q.useState)(``),[s,c]=(0,Q.useState)(!1),l=Ve(n),d=Ue(l),f=async()=>{if(!(!d||!i.trim()||!e)){c(!0);try{let n=await ne(e,l,i.trim());Y({title:`Skill created`,description:`Skill '${l}' was created successfully.`}),r(``),o(``),t?.(n.path,`SKILL.md`)}catch(e){Y({title:`Error`,description:e instanceof Error?e.message:`Failed to create skill`,variant:`destructive`})}finally{c(!1)}}};return e?(0,$.jsx)(ce,{children:(0,$.jsxs)(te,{children:[(0,$.jsx)(q,{title:`Add Skill`,description:`Saved as SKILL.md in .agents/skills.`,sticky:!0,className:`pr-10`}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(de,{title:`Skill Name`,controlLayout:`stack`,className:`pt-6`,children:[(0,$.jsx)(J,{id:`skillName`,value:n,onChange:e=>r(e.target.value),placeholder:`e.g. Code Review`,disabled:s}),n?(0,$.jsxs)(`p`,{className:u(a.caption,`mt-2`),children:[`Folder name: `,(0,$.jsx)(`span`,{className:`font-mono`,children:l||`...`})]}):null]}),(0,$.jsx)(de,{title:`Description`,controlLayout:`stack`,className:`pt-6`,children:(0,$.jsx)(Ae,{id:`skillDescription`,value:i,onChange:e=>o(e.target.value),placeholder:`Describe when Tarsk should apply this skill`,className:`resize-none min-h-[120px]`,disabled:s})}),(0,$.jsx)(Be,{onContinue:()=>void f(),disabled:!d||!i.trim(),creating:s})]})]})}):(0,$.jsx)(fe,{title:`No thread selected`,children:`Please select a thread to add a skill.`})}function qe(e){let t=[`---`,`name: ${e.id}`,`description: ${e.description}`];return e.allowedTools&&t.push(`allowed-tools: ${e.allowedTools}`),e.license&&t.push(`license: ${e.license}`),t.push(`---`,``,e.instructions??``),t.join(`
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{$ as t,Ct as n,Di as r,Oi as i,Rr as a,Vt as o,X as s,c,et as l,i as u,in as d,ki as f,m as p,rr as m,xn as h,yt as g}from"./interactive-BrHVRHmQ.js";import{$a as _,A as v,Bi as y,Ct as b,D as x,Eo as S,Ga as C,Ia as w,Ii as T,La as E,Lr as D,Mi as O,Ni as k,O as A,Ri as j,So as M,St as N,T as P,Tt as F,Ui as I,Vi as L,Wi as R,_ as z,b as B,bt as V,dt as ee,et as te,f as H,gn as ne,h as U,j as W,ji as re,k as G,m as ie,mt as K,no as ae,nt as oe,p as se,pt as ce,rt as q,si as le,st as ue,tt as de,ut as fe,v as pe,wt as me,x as J,yo as he,zi as ge}from"./onboarding-KBcwP-kU.js";import{r as _e}from"./store-B_cK-gsT.js";import{t as Y}from"./use-toast-hxHsVv6a.js";import{a as ve,c as ye,i as be,n as xe,o as Se,r as Ce,s as we,t as Te}from"./alert-dialog-CLYxQdrK.js";import{Bt as X,Ht as Ee,It as De,Kt as Oe,Lt as ke,U as Ae,a as je,zt as Me}from"./index-CJCQ4bTo.js";import{t as Ne}from"./delete-confirm-dialog-D1zjctrX.js";import{t as Pe}from"./use-settings-page-loading-BU2CDnfE.js";import{a as Fe,i as Ie,o as Le,r as Re}from"./settings-list-CWdsaJKC.js";import{t as ze}from"./use-deferred-search-0sV7mSzX.js";import{a as Be,i as Ve,n as He,r as Ue,t as We}from"./mcp-server-card-DPakHrG9.js";import{t as Ge}from"./use-installed-ai-files-GpG9ZL8U.js";var Z=i(),Q=e(f(),1),$=r();function Ke({threadId:e,onSkillCreated:t}){let[n,r]=(0,Q.useState)(``),[i,o]=(0,Q.useState)(``),[s,c]=(0,Q.useState)(!1),l=Ve(n),d=Ue(l),f=async()=>{if(!(!d||!i.trim()||!e)){c(!0);try{let n=await ne(e,l,i.trim());Y({title:`Skill created`,description:`Skill '${l}' was created successfully.`}),r(``),o(``),t?.(n.path,`SKILL.md`)}catch(e){Y({title:`Error`,description:e instanceof Error?e.message:`Failed to create skill`,variant:`destructive`})}finally{c(!1)}}};return e?(0,$.jsx)(ce,{children:(0,$.jsxs)(te,{children:[(0,$.jsx)(q,{title:`Add Skill`,description:`Saved as SKILL.md in .agents/skills.`,sticky:!0,className:`pr-10`}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(de,{title:`Skill Name`,controlLayout:`stack`,className:`pt-6`,children:[(0,$.jsx)(J,{id:`skillName`,value:n,onChange:e=>r(e.target.value),placeholder:`e.g. Code Review`,disabled:s}),n?(0,$.jsxs)(`p`,{className:u(a.caption,`mt-2`),children:[`Folder name: `,(0,$.jsx)(`span`,{className:`font-mono`,children:l||`...`})]}):null]}),(0,$.jsx)(de,{title:`Description`,controlLayout:`stack`,className:`pt-6`,children:(0,$.jsx)(Ae,{id:`skillDescription`,value:i,onChange:e=>o(e.target.value),placeholder:`Describe when Tarsk should apply this skill`,className:`resize-none min-h-[120px]`,disabled:s})}),(0,$.jsx)(Be,{onContinue:()=>void f(),disabled:!d||!i.trim(),creating:s})]})]})}):(0,$.jsx)(fe,{title:`No thread selected`,children:`Please select a thread to add a skill.`})}function qe(e){let t=[`---`,`name: ${e.id}`,`description: ${e.description}`];return e.allowedTools&&t.push(`allowed-tools: ${e.allowedTools}`),e.license&&t.push(`license: ${e.license}`),t.push(`---`,``,e.instructions??``),t.join(`
2
2
  `)}function Je(e){return e.endsWith(`.md`)||e.endsWith(`.mdx`)}function Ye(e){return e.includes(`SKILL.md`)?`SKILL.md`:e[0]??`SKILL.md`}function Xe(e,t){let n=e?.sourceId??t;if(!(!n||n==="default"))return n}function Ze({open:e,onOpenChange:t,skill:n,catalogSourceId:r,onInstall:i}){let[s,c]=(0,Q.useState)([]),[l,d]=(0,Q.useState)(null),[f,p]=(0,Q.useState)(``),[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(!1),[y,b]=(0,Q.useState)(null),[C,w]=(0,Q.useState)(!1),T=Xe(n,r),E=!!T;(0,Q.useEffect)(()=>{if(!e||!n)return;let t=n,i=Xe(t,r),a=!1;async function o(){h(!0),b(null),c([]),d(null),p(``);try{if(i){let e=await k(i,t.id);if(a)return;c(e.files),d(Ye(e.files))}else{if(a)return;c([`SKILL.md`]),d(`SKILL.md`),p(qe(t))}}catch(e){if(a)return;b(e instanceof Error?e.message:`Failed to load skill files`)}finally{a||h(!1)}}return o(),()=>{a=!0}},[e,n,r]),(0,Q.useEffect)(()=>{if(!e||!n||!l||!E||!T)return;let t=n,r=l,i=!1;async function a(){_(!0),b(null);try{let e=await O(T,t.id,r);if(i)return;p(e.content)}catch(e){if(i)return;b(e instanceof Error?e.message:`Failed to load file`),p(``)}finally{i||_(!1)}}return a(),()=>{i=!0}},[e,n,l,E,T]);let D=(0,Q.useCallback)(async()=>{if(!n)return;let e=T?{...n,sourceId:T}:n;w(!0);try{await i(e),t(!1)}finally{w(!1)}},[n,T,i,t]),j=m||E&&g,M=l?Je(l):!1,N=(0,Q.useMemo)(()=>s.map(e=>(0,$.jsxs)(H,{selected:e===l,onClick:()=>d(e),className:`gap-2 cursor-pointer`,children:[(0,$.jsx)(o,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:u(a.caption,`truncate`),children:e})]},e)),[s,l]);return(0,$.jsx)(P,{open:e,onOpenChange:t,children:(0,$.jsxs)(x,{className:`flex max-h-[90vh] max-w-5xl flex-col gap-0 overflow-hidden p-0`,children:[(0,$.jsxs)(v,{className:`border-b border-border px-6 py-4`,children:[(0,$.jsx)(W,{children:n?.name??`Review skill`}),n?.description?(0,$.jsx)(A,{children:n.description}):null]}),(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col sm:flex-row`,children:[(0,$.jsxs)(`div`,{className:`flex max-h-40 shrink-0 flex-col border-b border-border sm:max-h-none sm:w-56 sm:border-b-0 sm:border-r`,children:[(0,$.jsx)(`div`,{className:u(a.labelMuted,`px-3 py-2`),children:`Files`}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-1 pb-2`,children:m?(0,$.jsx)(V,{className:`py-8`,label:`Loading files...`}):s.length===0?(0,$.jsx)(`p`,{className:u(a.caption,`px-3 py-2 text-muted-foreground`),children:`No files found.`}):N})]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-4`,children:y?(0,$.jsx)(`p`,{className:u(a.body,`text-destructive`),children:y}):j?(0,$.jsx)(V,{className:`py-12`,label:`Loading preview...`}):M?(0,$.jsx)(De,{content:f,enableMermaid:!1}):(0,$.jsx)(`pre`,{className:u(a.caption,`overflow-x-auto whitespace-pre-wrap font-mono`),children:f})})]}),(0,$.jsxs)(G,{className:`border-t border-border px-6 py-4 sm:justify-between`,children:[(0,$.jsx)(S,{type:`button`,variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,$.jsx)(S,{type:`button`,onClick:()=>void D(),disabled:C||!n,children:C?`Installing...`:`Install`})]})]})})}var Qe=new Map;function $e(e){let t=Qe.get(e);if(t)return t;let n=j(e).finally(()=>{Qe.delete(e)});return Qe.set(e,n),n}function et(e,t){return t.map(t=>({...t,sourceId:t.sourceId??e}))}function tt(){let e=(0,Z.c)(18),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let[n,r]=(0,Q.useState)(t),[i,a]=(0,Q.useState)(_),o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=[],e[1]=o):o=e[1];let[s,c]=(0,Q.useState)(o),[l,u]=(0,Q.useState)(!1),[d,f]=(0,Q.useState)(!1),p;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=async()=>{try{r(await ge())}catch{r([])}},e[2]=p):p=e[2];let m=p,h,g;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>{(async function(){let e=C();if(e.length>0)try{await y(e),w()}catch{}await m()})()},g=[m],e[3]=h,e[4]=g):(h=e[3],g=e[4]),(0,Q.useEffect)(h,g);let v;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>{a(e),he(e)},e[5]=v):v=e[5];let b=v,x;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>{r(t=>[...t.filter(t=>t.id!==e.id),e].sort(rt)),b(e.id)},e[6]=x):x=e[6];let S=x,T;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>{r(t=>t.map(t=>t.id===e.id?e:t).sort(nt)),E(e.id)},e[7]=T):T=e[7];let D=T,O;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(O=e=>{r(t=>t.filter(t=>t.id!==e)),E(e),a(t=>t===e?(he(`default`),`default`):t)},e[8]=O):O=e[8];let k=O,A,j;e[9]===i?(A=e[10],j=e[11]):(j=()=>{if(i==="default"){c([]),u(!1),f(!1);return}let e=ae(i);e?.skills?(c(et(i,e.skills)),u(!1)):(c([]),u(!0));let t=!1;return f(!!e?.skills),$e(i).then(e=>{if(t)return;let n=et(i,e);c(n),M(i,{fetchedAt:Date.now(),skills:n})}).catch(n=>{t||(e?.skills||c([]),Y({title:`Error`,description:n instanceof Error?n.message:`Failed to load skill catalog`,variant:`destructive`}))}).finally(()=>{t||(u(!1),f(!1))}),()=>{t=!0}},A=[i],e[9]=i,e[10]=A,e[11]=j),(0,Q.useEffect)(j,A);let N;return e[12]!==s||e[13]!==l||e[14]!==d||e[15]!==i||e[16]!==n?(N={sources:n,selectedSourceId:i,setSelectedSourceId:b,addSource:S,updateSource:D,removeSource:k,reloadSources:m,catalogSkills:s,isLoadingCatalog:l,isRefreshingCatalog:d},e[12]=s,e[13]=l,e[14]=d,e[15]=i,e[16]=n,e[17]=N):N=e[17],N}function nt(e,t){return e.title.localeCompare(t.title)}function rt(e,t){return e.title.localeCompare(t.title)}function it({open:e,onOpenChange:t,editingSource:n,onSourceAdded:r,onSourceUpdated:i,onSourceDeleted:o}){let[s,c]=(0,Q.useState)(``),[l,d]=(0,Q.useState)(``),[f,p]=(0,Q.useState)(null),[m,h]=(0,Q.useState)(!1),[_,y]=(0,Q.useState)(!1),[b,C]=(0,Q.useState)(!1),w=n!=null;function T(){c(``),d(``),p(null),h(!1),y(!1),C(!1)}function E(e){e||T(),t(e)}(0,Q.useEffect)(()=>{if(e){if(n){c(n.title),d(n.url),p(null);return}c(``),d(``),p(null)}},[e,n]);async function D(){let e=s.trim(),t=l.trim();if(!e||!t){p(`Title and URL are required.`);return}h(!0),p(null);try{if(w&&n){let r=await I(n.id,e,t);i?.(r.source)}else r((await R(e,t)).source);E(!1)}catch(e){p(e instanceof Error?e.message:`Failed to verify skill source`)}finally{h(!1)}}async function O(){if(n){y(!0),p(null);try{await re(n.id),o?.(n.id),C(!1),E(!1)}catch(e){p(e instanceof Error?e.message:`Failed to delete skill source`),C(!1)}finally{y(!1)}}}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(P,{open:e,onOpenChange:E,children:(0,$.jsxs)(x,{className:`sm:max-w-lg`,children:[(0,$.jsxs)(v,{children:[(0,$.jsx)(W,{children:w?`Edit Skill Source`:`Add Skill Source`}),(0,$.jsx)(A,{children:w?`Update the title or GitHub skills folder URL for this custom source.`:`Add a GitHub skills folder URL. The source is verified by loading at least one skill from the repository.`})]}),(0,$.jsxs)(`div`,{className:`grid gap-4 py-2`,children:[(0,$.jsxs)(`div`,{className:`grid gap-2`,children:[(0,$.jsx)(B,{htmlFor:`skill-source-title`,children:`Title`}),(0,$.jsx)(J,{id:`skill-source-title`,placeholder:`e.g. My Team Skills`,value:s,onChange:e=>c(e.target.value),disabled:m||_,autoFocus:!0})]}),(0,$.jsxs)(`div`,{className:`grid gap-2`,children:[(0,$.jsx)(B,{htmlFor:`skill-source-url`,children:`URL`}),(0,$.jsx)(J,{id:`skill-source-url`,placeholder:`https://github.com/org/repo or .../tree/main/skills`,value:l,onChange:e=>d(e.target.value),disabled:m||_})]}),f?(0,$.jsx)(`p`,{className:u(a.caption,`text-destructive`),children:f}):null]}),(0,$.jsxs)(G,{className:`flex-col-reverse gap-2 sm:flex-row sm:justify-between`,children:[w?(0,$.jsx)(S,{type:`button`,variant:`destructive`,onClick:()=>C(!0),disabled:m||_,children:`Delete`}):(0,$.jsx)(`div`,{className:`hidden sm:block`}),(0,$.jsxs)(`div`,{className:`flex w-full flex-col-reverse gap-2 sm:w-auto sm:flex-row`,children:[(0,$.jsx)(S,{variant:`outline`,onClick:()=>E(!1),disabled:m||_,children:`Cancel`}),(0,$.jsx)(S,{onClick:()=>void D(),disabled:m||_||!s.trim()||!l.trim(),children:m?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(g,{className:`mr-2 h-4 w-4 animate-spin`}),`Verifying...`]}):w?`Save Changes`:`Add Source`})]})]})]})}),(0,$.jsx)(Te,{open:b,onOpenChange:C,children:(0,$.jsxs)(be,{children:[(0,$.jsxs)(we,{children:[(0,$.jsx)(ye,{children:`Delete Skill Source`}),(0,$.jsxs)(ve,{children:[`Are you sure you want to delete "`,n?.title,`"? This removes the source from your list but does not uninstall skills you already added.`]})]}),(0,$.jsxs)(Se,{children:[(0,$.jsx)(Ce,{disabled:_,children:`Cancel`}),(0,$.jsx)(xe,{onClick:()=>void O(),disabled:_,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:_?`Deleting...`:`Delete`})]})]})})]})}var at=`https://tarsk.io/skills/list/`;function ot(e){let t=(0,Z.c)(20),{onSelectMode:r,manualDisabled:i}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(Oe,{asChild:!0,children:(0,$.jsxs)(S,{className:`gap-1`,children:[`Add Skill`,(0,$.jsx)(h,{className:`h-4 w-4 opacity-70`})]})}),t[0]=o):o=t[0];let s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=u(a.body,`gap-2`),t[1]=s):s=t[1];let c;t[2]===r?c=t[3]:(c=()=>r(`manual`),t[2]=r,t[3]=c);let f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(l,{className:`h-4 w-4 shrink-0`}),t[4]=f):f=t[4];let p;t[5]!==i||t[6]!==c?(p=(0,$.jsxs)(X,{className:s,disabled:i,onSelect:c,children:[f,`Manually Enter`]}),t[5]=i,t[6]=c,t[7]=p):p=t[7];let m;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(m=u(a.body,`gap-2`),t[8]=m):m=t[8];let g;t[9]===r?g=t[10]:(g=()=>r(`url`),t[9]=r,t[10]=g);let _;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(n,{className:`h-4 w-4 shrink-0`}),t[11]=_):_=t[11];let v;t[12]===g?v=t[13]:(v=(0,$.jsxs)(X,{className:m,onSelect:g,children:[_,`Via URL`]}),t[12]=g,t[13]=v);let y;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(Ee,{}),t[14]=y):y=t[14];let b;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(b=u(a.body,`gap-2`),t[15]=b):b=t[15];let x;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsxs)(X,{className:b,onSelect:st,children:[(0,$.jsx)(d,{className:`h-4 w-4 shrink-0`}),`Marketplace`]}),t[16]=x):x=t[16];let C;return t[17]!==p||t[18]!==v?(C=(0,$.jsxs)(ke,{children:[o,(0,$.jsxs)(Me,{align:`end`,className:`w-44`,children:[p,v,y,x]})]}),t[17]=p,t[18]=v,t[19]=C):C=t[19],C}function st(){D(at)}function ct(e){let t=e.trim();if(!t)return null;if(/^https?:\/\//i.test(t))try{return new URL(t),t}catch{return null}if(t.startsWith(`tarsk://`))try{let e=new URL(`https://tarsk.invalid/${t.slice(8)}`);if(e.pathname===`/skill-install`&&e.searchParams.get(`url`))return e.searchParams.get(`url`)}catch{return null}return null}function lt(e){let t=(0,Z.c)(40),{open:n,onOpenChange:r,onSubmit:i}=e,[o,s]=(0,Q.useState)(``),[c,l]=(0,Q.useState)(null),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=function(){s(``),l(null)},t[0]=d):d=t[0];let f=d,p;t[1]===r?p=t[2]:(p=function(e){e||f(),r(e)},t[1]=r,t[2]=p);let m=p,h,g;t[3]===n?(h=t[4],g=t[5]):(h=()=>{n&&f()},g=[n],t[3]=n,t[4]=h,t[5]=g),(0,Q.useEffect)(h,g);let _;t[6]!==m||t[7]!==i||t[8]!==o?(_=function(){let e=ct(o);if(!e){l(`Enter a valid http(s) URL for the plugin archive or paste a tarsk:// install link.`);return}i(e),m(!1)},t[6]=m,t[7]=i,t[8]=o,t[9]=_):_=t[9];let y=_,b;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsxs)(v,{children:[(0,$.jsx)(W,{children:`Add Skill via URL`}),(0,$.jsx)(A,{children:`Paste the URL of a plugin archive. Its skills and MCP servers are installed into this project.`})]}),t[10]=b):b=t[10];let C;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(B,{htmlFor:`add-skill-url`,children:`URL`}),t[11]=C):C=t[11];let w;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>s(e.target.value),t[12]=w):w=t[12];let T;t[13]===y?T=t[14]:(T=e=>{e.key===`Enter`&&(e.preventDefault(),y())},t[13]=y,t[14]=T);let E;t[15]!==T||t[16]!==o?(E=(0,$.jsx)(J,{id:`add-skill-url`,placeholder:`https://example.com/my-plugin.zip`,value:o,onChange:w,autoFocus:!0,onKeyDown:T}),t[15]=T,t[16]=o,t[17]=E):E=t[17];let D;t[18]===c?D=t[19]:(D=c?(0,$.jsx)(`p`,{className:u(a.caption,`text-destructive`),children:c}):null,t[18]=c,t[19]=D);let O;t[20]!==E||t[21]!==D?(O=(0,$.jsx)(`div`,{className:`grid gap-4 py-2`,children:(0,$.jsxs)(`div`,{className:`grid gap-2`,children:[C,E,D]})}),t[20]=E,t[21]=D,t[22]=O):O=t[22];let k;t[23]===m?k=t[24]:(k=(0,$.jsx)(S,{variant:`outline`,onClick:()=>m(!1),children:`Cancel`}),t[23]=m,t[24]=k);let j;t[25]===o?j=t[26]:(j=o.trim(),t[25]=o,t[26]=j);let M=!j,N;t[27]!==y||t[28]!==M?(N=(0,$.jsx)(S,{onClick:y,disabled:M,children:`Continue`}),t[27]=y,t[28]=M,t[29]=N):N=t[29];let F;t[30]!==k||t[31]!==N?(F=(0,$.jsxs)(G,{children:[k,N]}),t[30]=k,t[31]=N,t[32]=F):F=t[32];let I;t[33]!==O||t[34]!==F?(I=(0,$.jsxs)(x,{className:`sm:max-w-lg`,children:[b,O,F]}),t[33]=O,t[34]=F,t[35]=I):I=t[35];let L;return t[36]!==m||t[37]!==n||t[38]!==I?(L=(0,$.jsx)(P,{open:n,onOpenChange:m,children:I}),t[36]=m,t[37]=n,t[38]=I,t[39]=L):L=t[39],L}function ut(e){let t=[];for(let n of e){if(n.path===`.agents/skills`&&n.type===`folder`&&n.children)for(let e of n.children)e.type===`folder`&&t.push(e);n.children&&n.children.length>0&&t.push(...ut(n.children))}return t}function dt(e){return`.agents/skills/${e}/SKILL.md`}function ft(e,t){let n=t.trim();if(!n)return e;let r=n.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(r)||e.description.toLowerCase().includes(r))}function pt(e){let t=(0,Z.c)(9),{items:n,installedFilePaths:r,onPreview:i}=e,a;if(t[0]!==r||t[1]!==n||t[2]!==i){let e;t[4]!==r||t[5]!==i?(e=e=>{let t=dt(e.id),n=r.has(t);return(0,$.jsx)(We,{className:`bg-background hover:bg-background`,name:He(e.name),description:e.description,installed:n,onClick:()=>{n||i(e)},showInstalledControls:!1},e.id)},t[4]=r,t[5]=i,t[6]=e):e=t[6],a=n.map(e),t[0]=r,t[1]=n,t[2]=i,t[3]=a}else a=t[3];let o;return t[7]===a?o=t[8]:(o=(0,$.jsx)(Ie,{children:a}),t[7]=a,t[8]=o),o}function mt(e){let t=(0,Z.c)(21),{skills:n,threadId:r,onOpenSkill:i,onDelete:a,onAddManual:o,onAddUrl:s}=e,c=!r,l;t[0]!==o||t[1]!==s?(l=e=>{e===`manual`?o():s()},t[0]=o,t[1]=s,t[2]=l):l=t[2];let u;t[3]!==c||t[4]!==l?(u=(0,$.jsx)(q,{title:`Installed Skills`,description:`Reusable instruction sets that guide agent behavior in this project.`,action:(0,$.jsx)(ot,{manualDisabled:c,onSelectMode:l}),sticky:!1}),t[3]=c,t[4]=l,t[5]=u):u=t[5];let d;t[6]===r?d=t[7]:(d=!r&&(0,$.jsx)(oe,{children:`Select a thread to add or install skills.`}),t[6]=r,t[7]=d);let f;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(f={icon:p,title:`No skills installed`,description:`Add skills to extend agent capabilities with reusable instructions.`},t[8]=f):f=t[8];let m;t[9]===i?m=t[10]:(m=e=>i(e.path),t[9]=i,t[10]=m);let h;t[11]!==a||t[12]!==n||t[13]!==m?(h=(0,$.jsx)(Re,{showHeader:!1,compact:!0,loading:!1,items:n,emptyState:f,getKey:vt,renderContent:_t,onItemClick:m,itemClickLabel:gt,onDelete:a,deleteAriaLabel:ht,deleteTooltip:`Remove this skill from the project`}),t[11]=a,t[12]=n,t[13]=m,t[14]=h):h=t[14];let g;t[15]!==d||t[16]!==h?(g=(0,$.jsxs)(ee,{className:`pt-6`,children:[d,h]}),t[15]=d,t[16]=h,t[17]=g):g=t[17];let _;return t[18]!==u||t[19]!==g?(_=(0,$.jsxs)(K,{className:`shrink-0`,children:[u,g]}),t[18]=u,t[19]=g,t[20]=_):_=t[20],_}function ht(e){return`Delete ${e.name}`}function gt(e){return`Open ${e.name} in Files`}function _t(e){return(0,$.jsx)(`span`,{className:u(a.body,`truncate text-left`),children:e.name})}function vt(e){return e.id}function yt(e){let n=(0,Z.c)(40),{availableSearch:r,onSearchChange:i,selectedSourceId:a,onSourceChange:o,sources:c,selectedCustomSource:l,availableCatalogLoading:u,isDefaultSource:d,filteredPopular:f,filteredCatalog:p,installedFilePaths:m,onPreviewPopular:h,onPreviewCatalog:g,onAddSource:_}=e,v;n[0]!==r||n[1]!==i?(v=(0,$.jsx)(Le,{placeholder:`Search`,value:r,onChange:i,className:`mb-0 w-64`}),n[0]=r,n[1]=i,n[2]=v):v=n[2];let y;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(z,{className:`w-40`,"aria-label":`Skill source`,children:(0,$.jsx)(pe,{placeholder:`Default`})}),n[3]=y):y=n[3];let x;n[4]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(U,{value:`default`,children:`Default`}),n[4]=x):x=n[4];let C;n[5]===c?C=n[6]:(C=c.map(bt),n[5]=c,n[6]=C);let w;n[7]===C?w=n[8]:(w=(0,$.jsxs)(ie,{children:[x,C]}),n[7]=C,n[8]=w);let T;n[9]!==o||n[10]!==a||n[11]!==w?(T=(0,$.jsxs)(se,{value:a,onValueChange:o,children:[y,w]}),n[9]=o,n[10]=a,n[11]=w,n[12]=T):T=n[12];let E=l?`Edit skill source`:`Add skill source`,D;n[13]===l?D=n[14]:(D=l?(0,$.jsx)(t,{className:`h-4 w-4`}):(0,$.jsx)(s,{className:`h-4 w-4`}),n[13]=l,n[14]=D);let O;n[15]!==_||n[16]!==E||n[17]!==D?(O=(0,$.jsx)(F,{asChild:!0,children:(0,$.jsx)(S,{type:`button`,variant:`outline`,size:`icon`,className:`shrink-0`,onClick:_,"aria-label":E,children:D})}),n[15]=_,n[16]=E,n[17]=D,n[18]=O):O=n[18];let k=l?`Edit this custom skill source`:`Add a custom skill source`,A;n[19]===k?A=n[20]:(A=(0,$.jsx)(b,{children:k}),n[19]=k,n[20]=A);let j;n[21]!==A||n[22]!==O?(j=(0,$.jsx)(me,{children:(0,$.jsxs)(N,{children:[O,A]})}),n[21]=A,n[22]=O,n[23]=j):j=n[23];let M;n[24]!==v||n[25]!==j||n[26]!==T?(M=(0,$.jsx)(q,{title:`Available Skills`,description:`Browse and install skills from the catalog.`,action:(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[v,T,j]}),sticky:!1}),n[24]=v,n[25]=j,n[26]=T,n[27]=M):M=n[27];let P;n[28]!==u||n[29]!==r||n[30]!==p||n[31]!==f||n[32]!==m||n[33]!==d||n[34]!==g||n[35]!==h?(P=(0,$.jsx)(ee,{className:`pt-6`,children:u?(0,$.jsx)(V,{className:`py-12`,label:`Loading skills...`}):d?f.length===0?(0,$.jsx)(Fe,{searchQuery:r,emptyLabel:`No available skills found.`}):(0,$.jsx)(pt,{items:f,installedFilePaths:m,onPreview:h}):p.length===0?(0,$.jsx)(Fe,{searchQuery:r,emptyLabel:`No available skills found.`}):(0,$.jsx)(pt,{items:p,installedFilePaths:m,onPreview:g})}),n[28]=u,n[29]=r,n[30]=p,n[31]=f,n[32]=m,n[33]=d,n[34]=g,n[35]=h,n[36]=P):P=n[36];let I;return n[37]!==M||n[38]!==P?(I=(0,$.jsxs)(K,{className:`shrink-0`,children:[M,P]}),n[37]=M,n[38]=P,n[39]=I):I=n[39],I}function bt(e){return(0,$.jsx)(U,{value:e.id,children:e.title},e.id)}function xt(){let{selectedProjectId:e,selectedThreadId:t,items:n,loading:r,deleteConfirm:i,setDeleteConfirm:a,deleting:o,installedFilePaths:s,setInstalledFilePaths:l,loadItems:u,handleDelete:d,handleOpenInExplorer:f,triggerExplorerRefresh:p}=Ge({findItems:ut,installedPathSuffix:`/SKILL.md`,explorerPathSuffix:`/SKILL.md`,sortByName:!0,removedToastTitle:`Skill removed`}),h=_e(e=>e.projects),g=(0,Q.useMemo)(()=>h.find(t=>t.projectId===e)??null,[h,e]),[_,v]=(0,Q.useState)(!1),[y,b]=(0,Q.useState)(!1),[S,C]=(0,Q.useState)(null),[w,E]=(0,Q.useState)([]),[D,O]=(0,Q.useState)(!0),[k,A]=(0,Q.useState)(null),[j,M]=(0,Q.useState)(!1),{query:N,setQuery:F,deferredQuery:I}=ze(),{sources:R,selectedSourceId:z,setSelectedSourceId:B,addSource:V,updateSource:ee,removeSource:te,catalogSkills:H,isLoadingCatalog:ne}=tt(),U=z==="default",W=(0,Q.useMemo)(()=>m(z)?R.find(e=>e.id===z)??null:null,[z,R]);(0,Q.useEffect)(()=>{O(!0),T().then(E).catch(()=>E([])).finally(()=>O(!1))},[]);let re=Pe(e?`${e}:${t??``}`:null,[r,D]),G=(0,Q.useCallback)(async e=>{let n=`.agents/skills/${e.id}/SKILL.md`;if(!t||s.has(n))return;let r=e.sourceId??(z==="default"?void 0:z);try{if(r)await L(t,r,e.id,`.agents/skills/${e.id}`);else{let r=[`---`,`name: ${e.id}`,`description: ${e.description}`];e.allowedTools&&r.push(`allowed-tools: ${e.allowedTools}`),e.license&&r.push(`license: ${e.license}`),r.push(`---`,``,e.instructions??``),await le(t,n,r.join(`
3
3
  `))}l(e=>new Set(e).add(n)),p(),u(),Y({title:`Skill installed`,description:e.name})}catch(e){throw Y({title:`Error`,description:e instanceof Error?e.message:`Failed to install skill`,variant:`destructive`}),e}},[t,z,s,p,u]),ie=(0,Q.useMemo)(()=>ft(w,I),[w,I]),K=(0,Q.useMemo)(()=>ft(H,I),[H,I]),ae=!U&&ne&&H.length===0;return e?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(ue,{loading:re,children:[(0,$.jsx)(mt,{skills:n,threadId:t,onOpenSkill:f,onDelete:a,onAddManual:()=>v(!0),onAddUrl:()=>b(!0)}),(0,$.jsx)(yt,{availableSearch:N,onSearchChange:F,selectedSourceId:z,onSourceChange:B,sources:R,selectedCustomSource:W,availableCatalogLoading:ae,isDefaultSource:U,filteredPopular:ie,filteredCatalog:K,installedFilePaths:s,onPreviewPopular:e=>A(e),onPreviewCatalog:e=>A({...e,sourceId:e.sourceId??z}),onAddSource:()=>M(!0)})]}),(0,$.jsx)(Ze,{open:k!==null,onOpenChange:e=>{e||A(null)},skill:k,catalogSourceId:U?void 0:z,onInstall:G}),(0,$.jsx)(it,{open:j,onOpenChange:M,editingSource:W,onSourceAdded:e=>{V(e),Y({title:`Skill source added`,description:`${e.title} is now available in the source list.`})},onSourceUpdated:e=>{ee(e),Y({title:`Skill source updated`,description:`${e.title} has been saved.`})},onSourceDeleted:e=>{te(e),Y({title:`Skill source removed`,description:`The custom source has been deleted.`})}}),(0,$.jsx)(P,{open:_,onOpenChange:v,children:(0,$.jsx)(x,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,$.jsx)(Ke,{threadId:t,onSkillCreated:()=>{v(!1),u(),p()}})})}),(0,$.jsx)(lt,{open:y,onOpenChange:b,onSubmit:e=>C(e)}),(0,$.jsx)(je,{url:S,projectId:e,projectName:g?c(g):null,projects:h,onSelectProject:()=>{},onClose:()=>C(null),onInstalled:({mcpOnly:e})=>{u(),p(),Y({title:e?`MCP server installed`:`Plugin installed`,description:e?`Its MCP servers were added to this project.`:`Its skills and MCP servers were added to this project.`})}}),(0,$.jsx)(Ne,{open:i!==null,onOpenChange:e=>!e&&a(null),title:`Delete Skill`,description:`Are you sure you want to delete the skill "${i?.name}"? This action cannot be undone.`,onConfirm:()=>{i&&d(i)},confirming:o})]}):(0,$.jsx)(fe,{children:`Select a project to manage skills.`})}export{xt as SettingsSkillsView,xt as default};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Di as t,Rr as n,b as r,dn as i,i as a,ki as o,sn as s,yt as c}from"./interactive-BrHVRHmQ.js";import{Cn as l,Eo as u,Sr as d,_ as f,an as p,fn as m,ft as h,h as g,it as _,lt as v,m as y,mr as b,p as x,tt as S,ui as C,v as w,x as T,xr as E}from"./onboarding-DVc9-yKJ.js";import{t as D}from"./use-toast-hxHsVv6a.js";var O=e(o(),1),k=t();function A(){let[e,t]=(0,O.useState)(null),[o,A]=(0,O.useState)([]),[j,M]=(0,O.useState)(``),[N,P]=(0,O.useState)(``),[F,I]=(0,O.useState)(``),[L,R]=(0,O.useState)(``),[z,B]=(0,O.useState)(``),[V,H]=(0,O.useState)(!0),[U,W]=(0,O.useState)(!1),[G,K]=(0,O.useState)(!1),q=(0,O.useCallback)(async()=>{let[e,n]=await Promise.all([d(),b()]);t(e),A(n.projects)},[]);(0,O.useEffect)(()=>{let e=!1;async function n(){H(!0);try{let[n,r,i]=await Promise.all([d(),b(),E()]);e||(t(n),A(r.projects),B(i.manifest),r.projects[0]&&!L&&R(r.projects[0].projectId))}catch(e){D({title:`Failed to load Slack settings`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{e||H(!1)}}return n(),()=>{e=!0}},[]);async function J(){if(!(!j.trim()||!N.trim())){W(!0);try{await C({botToken:j.trim(),appToken:N.trim()}),M(``),P(``),await q(),D({title:`Slack tokens saved`})}catch(e){D({title:`Failed to save tokens`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{W(!1)}}}async function Y(){W(!0);try{await p(),await q(),D({title:`Slack tokens cleared`})}catch(e){D({title:`Failed to clear tokens`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{W(!1)}}async function X(){let t=F.trim();if(!(!t||!L)){K(!0);try{let n=e?.channels.find(e=>e.id===t);await m({slackChannelId:t,projectId:L,...n?{slackChannelName:n.name}:{}}),I(``),await q(),D({title:`Channel bound`})}catch(e){D({title:`Failed to bind channel`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{K(!1)}}}async function Z(e){try{await l(e.slackTeamId,e.slackChannelId),await q(),D({title:`Binding removed`})}catch(e){D({title:`Failed to remove binding`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}}async function Q(){try{await navigator.clipboard.writeText(z||(await E()).manifest),D({title:`Manifest copied`})}catch(e){D({title:`Failed to copy manifest`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}}if(V||!e)return(0,k.jsx)(h,{title:`Slack`,description:`Loading Slack settings…`,children:(0,k.jsxs)(`div`,{className:a(`flex items-center gap-2 text-muted-foreground`,n.compact),children:[(0,k.jsx)(c,{className:`h-4 w-4 animate-spin`}),`Loading Slack settings…`]})});let $=e.configured?[e.botUsername?`@${e.botUsername}`:e.botTokenPreview,`Bridge ${e.bridgeRunning?`running`:`stopped`}`,e.teamName].filter(Boolean).join(` · `):`Not configured`;return(0,k.jsx)(h,{title:`Slack`,description:`Connect a Slack app (Socket Mode) and bind channels to Tarsk projects.`,children:(0,k.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(_,{title:`Slack App`}),(0,k.jsxs)(v,{children:[(0,k.jsx)(S,{title:`App Manifest`,description:`Create a Slack app from this manifest, enable Socket Mode, then paste the Bot and App-Level tokens below. The Slack manifest cannot include an app icon — download the Tarsk logo and upload it under Basic Information after creating the app.`,controlLayout:`row-end`,action:(0,k.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,k.jsxs)(u,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void Q(),children:[(0,k.jsx)(i,{className:`mr-2 h-4 w-4`}),`Copy app manifest`]}),(0,k.jsx)(u,{type:`button`,variant:`outline`,size:`sm`,asChild:!0,children:(0,k.jsxs)(`a`,{href:`/slack-app-icon.png`,download:`tarsk-slack-app-icon.png`,children:[(0,k.jsx)(s,{className:`mr-2 h-4 w-4`}),`Download app icon`]})})]})}),(0,k.jsx)(S,{title:`Status`,description:`Bot identity and Socket Mode bridge status.`,children:(0,k.jsx)(`span`,{className:a(`text-muted-foreground`,n.bodyMuted),children:$})}),(0,k.jsx)(S,{title:`Bot Token`,description:`Bot User OAuth Token from your Slack app (starts with xoxb-).`,children:(0,k.jsx)(T,{id:`slack-bot-token`,type:`password`,autoComplete:`off`,placeholder:e.botTokenPreview||`xoxb-…`,value:j,onChange:e=>M(e.target.value)})}),(0,k.jsx)(S,{title:`App-Level Token`,description:`App-Level Token with connections:write for Socket Mode (starts with xapp-).`,children:(0,k.jsx)(T,{id:`slack-app-token`,type:`password`,autoComplete:`off`,placeholder:e.appTokenPreview||`xapp-…`,value:N,onChange:e=>P(e.target.value)})}),(0,k.jsx)(S,{title:`Tokens`,description:`Save both tokens to start the bridge, or clear them to disconnect.`,controlLayout:`row-end`,action:(0,k.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,k.jsxs)(u,{type:`button`,onClick:()=>void J(),disabled:U||!j.trim()||!N.trim(),children:[U?(0,k.jsx)(c,{className:`mr-2 h-4 w-4 animate-spin`}):null,`Save`]}),e.configured?(0,k.jsx)(u,{type:`button`,variant:`outline`,onClick:()=>void Y(),disabled:U,children:`Clear`}):null]})})]})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(_,{title:`Channel Bindings`}),(0,k.jsxs)(v,{children:[(0,k.jsx)(S,{title:`Slack Channel`,description:`Invite the bot to the channel first. Only channels the bot can see are listed.`,children:e.channels.length>0?(0,k.jsxs)(x,{value:F||void 0,onValueChange:I,children:[(0,k.jsx)(f,{id:`slack-channel`,"aria-label":`Slack Channel`,children:(0,k.jsx)(w,{placeholder:`Select a channel…`})}),(0,k.jsx)(y,{children:e.channels.map(e=>(0,k.jsx)(g,{value:e.id,children:e.name},e.id))})]}):(0,k.jsx)(T,{id:`slack-channel`,placeholder:`Channel ID (C…)`,value:F,onChange:e=>I(e.target.value)})}),(0,k.jsx)(S,{title:`Tarsk Project`,description:`Each Slack channel maps to one Tarsk project.`,children:(0,k.jsxs)(x,{value:L||void 0,onValueChange:R,disabled:o.length===0,children:[(0,k.jsx)(f,{id:`slack-project`,"aria-label":`Tarsk Project`,children:(0,k.jsx)(w,{placeholder:o.length===0?`No projects`:`Select a project…`})}),(0,k.jsx)(y,{children:o.map(e=>(0,k.jsx)(g,{value:e.projectId,children:e.name},e.projectId))})]})}),(0,k.jsx)(S,{title:`Bind`,description:`Create a channel ↔ project binding.`,controlLayout:`row-end`,action:(0,k.jsxs)(u,{type:`button`,onClick:()=>void X(),disabled:G||!F.trim()||!L,children:[G?(0,k.jsx)(c,{className:`mr-2 h-4 w-4 animate-spin`}):null,`Bind channel`]})})]}),(0,k.jsx)(`div`,{className:`mt-4 flex flex-col gap-2`,children:e.bindings.length===0?(0,k.jsx)(`p`,{className:a(`text-muted-foreground`,n.compact),children:`No bindings yet.`}):e.bindings.map(e=>{let t=o.find(t=>t.projectId===e.projectId)?.name||e.projectId;return(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border px-3 py-2`,children:[(0,k.jsxs)(`div`,{className:a(n.compact),children:[(0,k.jsx)(`div`,{className:`font-medium`,children:e.slackChannelName||e.slackChannelId}),(0,k.jsx)(`div`,{className:`text-muted-foreground`,children:t})]}),(0,k.jsx)(u,{type:`button`,variant:`ghost`,size:`icon`,onClick:()=>void Z(e),"aria-label":`Remove binding`,children:(0,k.jsx)(r,{className:`h-4 w-4`})})]},`${e.slackTeamId}:${e.slackChannelId}`)})})]})]})})}export{A as default};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Di as t,Rr as n,b as r,dn as i,i as a,ki as o,sn as s,yt as c}from"./interactive-BrHVRHmQ.js";import{Cn as l,Eo as u,Sr as d,_ as f,an as p,fn as m,ft as h,h as g,it as _,lt as v,m as y,mr as b,p as x,tt as S,ui as C,v as w,x as T,xr as E}from"./onboarding-KBcwP-kU.js";import{t as D}from"./use-toast-hxHsVv6a.js";var O=e(o(),1),k=t();function A(){let[e,t]=(0,O.useState)(null),[o,A]=(0,O.useState)([]),[j,M]=(0,O.useState)(``),[N,P]=(0,O.useState)(``),[F,I]=(0,O.useState)(``),[L,R]=(0,O.useState)(``),[z,B]=(0,O.useState)(``),[V,H]=(0,O.useState)(!0),[U,W]=(0,O.useState)(!1),[G,K]=(0,O.useState)(!1),q=(0,O.useCallback)(async()=>{let[e,n]=await Promise.all([d(),b()]);t(e),A(n.projects)},[]);(0,O.useEffect)(()=>{let e=!1;async function n(){H(!0);try{let[n,r,i]=await Promise.all([d(),b(),E()]);e||(t(n),A(r.projects),B(i.manifest),r.projects[0]&&!L&&R(r.projects[0].projectId))}catch(e){D({title:`Failed to load Slack settings`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{e||H(!1)}}return n(),()=>{e=!0}},[]);async function J(){if(!(!j.trim()||!N.trim())){W(!0);try{await C({botToken:j.trim(),appToken:N.trim()}),M(``),P(``),await q(),D({title:`Slack tokens saved`})}catch(e){D({title:`Failed to save tokens`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{W(!1)}}}async function Y(){W(!0);try{await p(),await q(),D({title:`Slack tokens cleared`})}catch(e){D({title:`Failed to clear tokens`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{W(!1)}}async function X(){let t=F.trim();if(!(!t||!L)){K(!0);try{let n=e?.channels.find(e=>e.id===t);await m({slackChannelId:t,projectId:L,...n?{slackChannelName:n.name}:{}}),I(``),await q(),D({title:`Channel bound`})}catch(e){D({title:`Failed to bind channel`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{K(!1)}}}async function Z(e){try{await l(e.slackTeamId,e.slackChannelId),await q(),D({title:`Binding removed`})}catch(e){D({title:`Failed to remove binding`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}}async function Q(){try{await navigator.clipboard.writeText(z||(await E()).manifest),D({title:`Manifest copied`})}catch(e){D({title:`Failed to copy manifest`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}}if(V||!e)return(0,k.jsx)(h,{title:`Slack`,description:`Loading Slack settings…`,children:(0,k.jsxs)(`div`,{className:a(`flex items-center gap-2 text-muted-foreground`,n.compact),children:[(0,k.jsx)(c,{className:`h-4 w-4 animate-spin`}),`Loading Slack settings…`]})});let $=e.configured?[e.botUsername?`@${e.botUsername}`:e.botTokenPreview,`Bridge ${e.bridgeRunning?`running`:`stopped`}`,e.teamName].filter(Boolean).join(` · `):`Not configured`;return(0,k.jsx)(h,{title:`Slack`,description:`Connect a Slack app (Socket Mode) and bind channels to Tarsk projects.`,children:(0,k.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(_,{title:`Slack App`}),(0,k.jsxs)(v,{children:[(0,k.jsx)(S,{title:`App Manifest`,description:`Create a Slack app from this manifest, enable Socket Mode, then paste the Bot and App-Level tokens below. The Slack manifest cannot include an app icon — download the Tarsk logo and upload it under Basic Information after creating the app.`,controlLayout:`row-end`,action:(0,k.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,k.jsxs)(u,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void Q(),children:[(0,k.jsx)(i,{className:`mr-2 h-4 w-4`}),`Copy app manifest`]}),(0,k.jsx)(u,{type:`button`,variant:`outline`,size:`sm`,asChild:!0,children:(0,k.jsxs)(`a`,{href:`/slack-app-icon.png`,download:`tarsk-slack-app-icon.png`,children:[(0,k.jsx)(s,{className:`mr-2 h-4 w-4`}),`Download app icon`]})})]})}),(0,k.jsx)(S,{title:`Status`,description:`Bot identity and Socket Mode bridge status.`,children:(0,k.jsx)(`span`,{className:a(`text-muted-foreground`,n.bodyMuted),children:$})}),(0,k.jsx)(S,{title:`Bot Token`,description:`Bot User OAuth Token from your Slack app (starts with xoxb-).`,children:(0,k.jsx)(T,{id:`slack-bot-token`,type:`password`,autoComplete:`off`,placeholder:e.botTokenPreview||`xoxb-…`,value:j,onChange:e=>M(e.target.value)})}),(0,k.jsx)(S,{title:`App-Level Token`,description:`App-Level Token with connections:write for Socket Mode (starts with xapp-).`,children:(0,k.jsx)(T,{id:`slack-app-token`,type:`password`,autoComplete:`off`,placeholder:e.appTokenPreview||`xapp-…`,value:N,onChange:e=>P(e.target.value)})}),(0,k.jsx)(S,{title:`Tokens`,description:`Save both tokens to start the bridge, or clear them to disconnect.`,controlLayout:`row-end`,action:(0,k.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,k.jsxs)(u,{type:`button`,onClick:()=>void J(),disabled:U||!j.trim()||!N.trim(),children:[U?(0,k.jsx)(c,{className:`mr-2 h-4 w-4 animate-spin`}):null,`Save`]}),e.configured?(0,k.jsx)(u,{type:`button`,variant:`outline`,onClick:()=>void Y(),disabled:U,children:`Clear`}):null]})})]})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(_,{title:`Channel Bindings`}),(0,k.jsxs)(v,{children:[(0,k.jsx)(S,{title:`Slack Channel`,description:`Invite the bot to the channel first. Only channels the bot can see are listed.`,children:e.channels.length>0?(0,k.jsxs)(x,{value:F||void 0,onValueChange:I,children:[(0,k.jsx)(f,{id:`slack-channel`,"aria-label":`Slack Channel`,children:(0,k.jsx)(w,{placeholder:`Select a channel…`})}),(0,k.jsx)(y,{children:e.channels.map(e=>(0,k.jsx)(g,{value:e.id,children:e.name},e.id))})]}):(0,k.jsx)(T,{id:`slack-channel`,placeholder:`Channel ID (C…)`,value:F,onChange:e=>I(e.target.value)})}),(0,k.jsx)(S,{title:`Tarsk Project`,description:`Each Slack channel maps to one Tarsk project.`,children:(0,k.jsxs)(x,{value:L||void 0,onValueChange:R,disabled:o.length===0,children:[(0,k.jsx)(f,{id:`slack-project`,"aria-label":`Tarsk Project`,children:(0,k.jsx)(w,{placeholder:o.length===0?`No projects`:`Select a project…`})}),(0,k.jsx)(y,{children:o.map(e=>(0,k.jsx)(g,{value:e.projectId,children:e.name},e.projectId))})]})}),(0,k.jsx)(S,{title:`Bind`,description:`Create a channel ↔ project binding.`,controlLayout:`row-end`,action:(0,k.jsxs)(u,{type:`button`,onClick:()=>void X(),disabled:G||!F.trim()||!L,children:[G?(0,k.jsx)(c,{className:`mr-2 h-4 w-4 animate-spin`}):null,`Bind channel`]})})]}),(0,k.jsx)(`div`,{className:`mt-4 flex flex-col gap-2`,children:e.bindings.length===0?(0,k.jsx)(`p`,{className:a(`text-muted-foreground`,n.compact),children:`No bindings yet.`}):e.bindings.map(e=>{let t=o.find(t=>t.projectId===e.projectId)?.name||e.projectId;return(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border px-3 py-2`,children:[(0,k.jsxs)(`div`,{className:a(n.compact),children:[(0,k.jsx)(`div`,{className:`font-medium`,children:e.slackChannelName||e.slackChannelId}),(0,k.jsx)(`div`,{className:`text-muted-foreground`,children:t})]}),(0,k.jsx)(u,{type:`button`,variant:`ghost`,size:`icon`,onClick:()=>void Z(e),"aria-label":`Remove binding`,children:(0,k.jsx)(r,{className:`h-4 w-4`})})]},`${e.slackTeamId}:${e.slackChannelId}`)})})]})]})})}export{A as default};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Di as t,Oi as n,Rr as r,S as i,i as a,ki as o,pn as s}from"./interactive-BrHVRHmQ.js";import{n as c,r as l,t as u}from"./react-vendor-B7jFrulV.js";import{Cr as d,D as f,Eo as p,Hi as m,Li as h,T as g,b as _,dt as v,et as y,mt as b,nt as x,pn as S,pt as C,rt as w,st as T,tt as E,ut as D,wn as ee,x as O}from"./onboarding-DVc9-yKJ.js";import{r as k}from"./store-B_cK-gsT.js";import{t as A}from"./use-toast-hxHsVv6a.js";import{n as j}from"./explorer-tab-context-BdjTEbFh.js";import{Nt as M}from"./index-B0xy4BkI.js";import{t as N}from"./delete-confirm-dialog-uTSX_x-i.js";import{t as P}from"./use-settings-page-loading-BU2CDnfE.js";import{a as F,i as I,o as L,r as R}from"./settings-list-B9wyVzKw.js";import{a as z,i as B,r as V,t as te}from"./mcp-server-card-DOsP-SQ8.js";var H=n(),U=e(o(),1),W=t(),G=U.forwardRef((e,t)=>{let n=(0,H.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let o;n[3]===r?o=n[4]:(o=a(`grid gap-2`,r),n[3]=r,n[4]=o);let s;return n[5]!==i||n[6]!==t||n[7]!==o?(s=(0,W.jsx)(l,{className:o,...i,ref:t}),n[5]=i,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});G.displayName=l.displayName;var K=U.forwardRef((e,t)=>{let n=(0,H.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let o;n[3]===r?o=n[4]:(o=a(`aspect-square h-4 w-4 rounded-full border border-brand text-brand ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,r),n[3]=r,n[4]=o);let l;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,W.jsx)(u,{className:`flex items-center justify-center`,children:(0,W.jsx)(s,{className:`h-2.5 w-2.5 fill-current text-current`})}),n[5]=l):l=n[5];let d;return n[6]!==i||n[7]!==t||n[8]!==o?(d=(0,W.jsx)(c,{ref:t,className:o,...i,children:l}),n[6]=i,n[7]=t,n[8]=o,n[9]=d):d=n[9],d});K.displayName=c.displayName;function q({projectId:e,threadId:t,onCommandCreated:n}){let[i,o]=(0,U.useState)(``),[s,c]=(0,U.useState)(``),[l,u]=(0,U.useState)(``),[d,f]=(0,U.useState)(`default`),[p,m]=(0,U.useState)(!1),h=B(i),g=V(h),v=async()=>{if(!(!g||!e)){m(!0);try{await S(h,``,{description:s.trim()||void 0,argumentHint:l.trim()||void 0,mode:d===`plan`?`plan`:void 0},`project`,t??void 0),A({title:`Command created`,description:`Command '/${h}' was created successfully.`}),o(``),c(``),u(``),f(`default`),n?.(h)}catch(e){A({title:`Error`,description:e instanceof Error?e.message:`Failed to create command`,variant:`destructive`})}finally{m(!1)}}};return e?(0,W.jsx)(C,{children:(0,W.jsxs)(y,{children:[(0,W.jsx)(w,{title:`Add Slash Command`,description:`Saved as a .md file in ~/.agents/commands.`,sticky:!0,className:`pr-10`}),(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(E,{title:`Command Name`,controlLayout:`stack`,className:`pt-6`,children:[(0,W.jsx)(O,{id:`commandName`,value:i,onChange:e=>o(e.target.value),placeholder:`e.g. review`,disabled:p}),i?(0,W.jsxs)(`p`,{className:a(r.caption,`mt-2`),children:[`Command: `,(0,W.jsxs)(`span`,{className:`font-mono`,children:[`/`,h||`...`]})]}):null]}),(0,W.jsx)(E,{title:`Description`,controlLayout:`stack`,className:`pt-6`,children:(0,W.jsx)(O,{id:`commandDescription`,value:s,onChange:e=>c(e.target.value),placeholder:`Brief description shown in autocomplete`,disabled:p})}),(0,W.jsx)(E,{title:`Argument Hint`,description:`Shows after the command name to guide users what to type`,controlLayout:`stack`,className:`pt-6`,children:(0,W.jsx)(O,{id:`argumentHint`,value:l,onChange:e=>u(e.target.value),placeholder:`e.g. <focus-area> or <branch-name>`,disabled:p})}),(0,W.jsx)(E,{title:`Mode`,description:d==="default"?`Standard chat mode`:`Activates plan mode when this command is used`,controlLayout:`stack`,className:`pt-6`,children:(0,W.jsxs)(G,{value:d,onValueChange:e=>f(e),className:`flex gap-4`,disabled:p,children:[(0,W.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,W.jsx)(K,{value:`default`,id:`mode-default`}),(0,W.jsx)(_,{htmlFor:`mode-default`,className:a(r.labelNormal,`cursor-pointer`),children:`Default`})]}),(0,W.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,W.jsx)(K,{value:`plan`,id:`mode-plan`}),(0,W.jsx)(_,{htmlFor:`mode-plan`,className:a(r.labelNormal,`cursor-pointer`),children:`Plan`})]})]})}),(0,W.jsx)(z,{onContinue:()=>void v(),disabled:!g,creating:p})]})]})}):(0,W.jsx)(D,{title:`No project selected`,children:`Please select a project to add a slash command.`})}function J(){let e=k(e=>e.selectedProjectId),t=k(e=>e.selectedThreadId),{openChatDockPanel:n}=M(),{setPendingExplorerPath:o,triggerExplorerRefresh:s,setExplorerClearPath:c}=j(),[l,u]=(0,U.useState)([]),[_,y]=(0,U.useState)(!0),[C,E]=(0,U.useState)(!1),[O,z]=(0,U.useState)(null),[B,V]=(0,U.useState)(!1),[H,G]=(0,U.useState)([]),[K,J]=(0,U.useState)(!0),[Y,X]=(0,U.useState)(new Map),[Z,ne]=(0,U.useState)(``),Q=(0,U.useCallback)(async()=>{if(!t){y(!1),u([]),X(new Map);return}y(!0);try{let e=await d(t);u(e.filter(e=>!e.isBuiltIn)),X(new Map(e.map(e=>[e.name,e.filePath])))}catch{u([]),X(new Map)}finally{y(!1)}},[t]);(0,U.useLayoutEffect)(()=>{t&&y(!0)},[e,t]),(0,U.useEffect)(()=>{Q()},[Q]),(0,U.useEffect)(()=>{J(!0),h().then(G).catch(()=>G([])).finally(()=>J(!1))},[]);let re=P(e?`${e}:${t??``}`:null,[_,K]),ie=(0,U.useCallback)(async e=>{V(!0);try{await ee(e.filePath),c(e.filePath),s(),X(t=>{let n=new Map(t);return n.delete(e.name),n}),A({title:`Command removed`,description:`/${e.name}`}),z(null),await Q()}catch(e){A({title:`Error`,description:e instanceof Error?e.message:`Failed to remove command`,variant:`destructive`})}finally{V(!1)}},[Q,s,c]),ae=(0,U.useCallback)(e=>{o(e),n(`explorer`)},[o,n]),oe=(0,U.useCallback)(e=>{let t=e.metadata?.description?.trim();return t&&t.length>0?t:`No description`},[]),se=(0,U.useCallback)(async e=>{if(!(!t||Y.has(e.name)))try{if(e.gitHubRepo&&e.gitHubFolder){let n=`.agents/commands`;await m(t,e.gitHubRepo,e.gitHubFolder,n);let r=`${n}/${e.name}.md`;X(t=>new Map(t).set(e.name,r))}else{let n=await S(e.name,e.content,{description:e.description,argumentHint:e.argumentHint},`project`,t);X(t=>new Map(t).set(e.name,n.filePath))}s(),Q(),A({title:`Command installed`,description:`/${e.name}`})}catch(e){A({title:`Error`,description:e instanceof Error?e.message:`Failed to install command`,variant:`destructive`})}},[t,Y,s,Q]),$=Z.trim()?H.filter(e=>e.name.toLowerCase().includes(Z.toLowerCase())||e.description.toLowerCase().includes(Z.toLowerCase())):H;return e?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(T,{loading:re,children:[(0,W.jsxs)(b,{className:`shrink-0`,children:[(0,W.jsx)(w,{title:`Installed Slash Commands`,description:`Project slash commands you run with / in chat.`,action:(0,W.jsx)(p,{onClick:()=>E(!0),disabled:!t,children:`Add Command`}),sticky:!1}),(0,W.jsxs)(v,{className:`pt-6`,children:[!t&&(0,W.jsx)(x,{children:`Select a thread to add or install slash commands.`}),(0,W.jsx)(R,{showHeader:!1,loading:!1,items:l,emptyState:{icon:i,title:`No slash commands installed`,description:`Add slash commands to create quick actions in chat.`},getKey:e=>e.filePath,columnsClassName:`grid-cols-[minmax(0,1fr)_auto_1.75rem]`,renderContent:e=>(0,W.jsxs)(`div`,{className:`min-w-0 text-left`,children:[(0,W.jsxs)(`div`,{className:a(r.body,`truncate`),children:[`/`,e.name]}),(0,W.jsx)(`div`,{className:a(r.compact,`truncate text-muted-foreground`),children:oe(e)})]}),renderMiddle:e=>e.metadata?.mode?(0,W.jsx)(`span`,{className:a(r.compact,`bg-muted px-1.5 py-0.5 rounded flex-shrink-0`),children:e.metadata.mode}):(0,W.jsx)(`div`,{}),onItemClick:e=>ae(e.filePath),itemClickLabel:e=>`Open /${e.name} in Files`,onDelete:z,deleteAriaLabel:e=>`Delete /${e.name}`,deleteTooltip:`Remove this slash command from the project`})]})]}),(0,W.jsxs)(b,{className:`shrink-0`,children:[(0,W.jsx)(w,{title:`Available Slash Commands`,description:`Browse and install slash commands from the catalog.`,action:(0,W.jsx)(L,{placeholder:`Search`,value:Z,onChange:ne,className:`mb-0 w-64`}),sticky:!1}),(0,W.jsx)(v,{className:`pt-6`,children:$.length===0?(0,W.jsx)(F,{searchQuery:Z,emptyLabel:`No available commands found.`}):(0,W.jsx)(I,{children:$.map(e=>{let t=Y.has(e.name);return(0,W.jsx)(te,{className:`bg-background hover:bg-background`,name:`/${e.name}`,description:e.description,installed:t,onClick:()=>{t||se(e)},showInstalledControls:!1},e.id)})})})]})]}),(0,W.jsx)(g,{open:C,onOpenChange:E,children:(0,W.jsx)(f,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,W.jsx)(q,{projectId:e,threadId:t,onCommandCreated:()=>{E(!1),Q(),s()}})})}),(0,W.jsx)(N,{open:O!==null,onOpenChange:e=>!e&&z(null),title:`Delete Slash Command`,description:`Are you sure you want to delete "/${O?.name}"? This action cannot be undone.`,onConfirm:()=>{O&&ie(O)},confirming:B})]}):(0,W.jsx)(D,{children:`Select a project to manage slash commands.`})}export{J as SettingsSlashCommandsView,J as default};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Di as t,Oi as n,Rr as r,S as i,i as a,ki as o,pn as s}from"./interactive-BrHVRHmQ.js";import{n as c,r as l,t as u}from"./react-vendor-7n7LyU5o.js";import{Cr as d,D as f,Eo as p,Hi as m,Li as h,T as g,b as _,dt as v,et as y,mt as b,nt as x,pn as S,pt as C,rt as w,st as T,tt as E,ut as D,wn as ee,x as O}from"./onboarding-KBcwP-kU.js";import{r as k}from"./store-B_cK-gsT.js";import{t as A}from"./use-toast-hxHsVv6a.js";import{n as j}from"./explorer-tab-context-BdjTEbFh.js";import{Nt as M}from"./index-CJCQ4bTo.js";import{t as N}from"./delete-confirm-dialog-D1zjctrX.js";import{t as P}from"./use-settings-page-loading-BU2CDnfE.js";import{a as F,i as I,o as L,r as R}from"./settings-list-CWdsaJKC.js";import{a as z,i as B,r as V,t as te}from"./mcp-server-card-DPakHrG9.js";var H=n(),U=e(o(),1),W=t(),G=U.forwardRef((e,t)=>{let n=(0,H.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let o;n[3]===r?o=n[4]:(o=a(`grid gap-2`,r),n[3]=r,n[4]=o);let s;return n[5]!==i||n[6]!==t||n[7]!==o?(s=(0,W.jsx)(l,{className:o,...i,ref:t}),n[5]=i,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});G.displayName=l.displayName;var K=U.forwardRef((e,t)=>{let n=(0,H.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let o;n[3]===r?o=n[4]:(o=a(`aspect-square h-4 w-4 rounded-full border border-brand text-brand ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,r),n[3]=r,n[4]=o);let l;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,W.jsx)(u,{className:`flex items-center justify-center`,children:(0,W.jsx)(s,{className:`h-2.5 w-2.5 fill-current text-current`})}),n[5]=l):l=n[5];let d;return n[6]!==i||n[7]!==t||n[8]!==o?(d=(0,W.jsx)(c,{ref:t,className:o,...i,children:l}),n[6]=i,n[7]=t,n[8]=o,n[9]=d):d=n[9],d});K.displayName=c.displayName;function q({projectId:e,threadId:t,onCommandCreated:n}){let[i,o]=(0,U.useState)(``),[s,c]=(0,U.useState)(``),[l,u]=(0,U.useState)(``),[d,f]=(0,U.useState)(`default`),[p,m]=(0,U.useState)(!1),h=B(i),g=V(h),v=async()=>{if(!(!g||!e)){m(!0);try{await S(h,``,{description:s.trim()||void 0,argumentHint:l.trim()||void 0,mode:d===`plan`?`plan`:void 0},`project`,t??void 0),A({title:`Command created`,description:`Command '/${h}' was created successfully.`}),o(``),c(``),u(``),f(`default`),n?.(h)}catch(e){A({title:`Error`,description:e instanceof Error?e.message:`Failed to create command`,variant:`destructive`})}finally{m(!1)}}};return e?(0,W.jsx)(C,{children:(0,W.jsxs)(y,{children:[(0,W.jsx)(w,{title:`Add Slash Command`,description:`Saved as a .md file in ~/.agents/commands.`,sticky:!0,className:`pr-10`}),(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(E,{title:`Command Name`,controlLayout:`stack`,className:`pt-6`,children:[(0,W.jsx)(O,{id:`commandName`,value:i,onChange:e=>o(e.target.value),placeholder:`e.g. review`,disabled:p}),i?(0,W.jsxs)(`p`,{className:a(r.caption,`mt-2`),children:[`Command: `,(0,W.jsxs)(`span`,{className:`font-mono`,children:[`/`,h||`...`]})]}):null]}),(0,W.jsx)(E,{title:`Description`,controlLayout:`stack`,className:`pt-6`,children:(0,W.jsx)(O,{id:`commandDescription`,value:s,onChange:e=>c(e.target.value),placeholder:`Brief description shown in autocomplete`,disabled:p})}),(0,W.jsx)(E,{title:`Argument Hint`,description:`Shows after the command name to guide users what to type`,controlLayout:`stack`,className:`pt-6`,children:(0,W.jsx)(O,{id:`argumentHint`,value:l,onChange:e=>u(e.target.value),placeholder:`e.g. <focus-area> or <branch-name>`,disabled:p})}),(0,W.jsx)(E,{title:`Mode`,description:d==="default"?`Standard chat mode`:`Activates plan mode when this command is used`,controlLayout:`stack`,className:`pt-6`,children:(0,W.jsxs)(G,{value:d,onValueChange:e=>f(e),className:`flex gap-4`,disabled:p,children:[(0,W.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,W.jsx)(K,{value:`default`,id:`mode-default`}),(0,W.jsx)(_,{htmlFor:`mode-default`,className:a(r.labelNormal,`cursor-pointer`),children:`Default`})]}),(0,W.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,W.jsx)(K,{value:`plan`,id:`mode-plan`}),(0,W.jsx)(_,{htmlFor:`mode-plan`,className:a(r.labelNormal,`cursor-pointer`),children:`Plan`})]})]})}),(0,W.jsx)(z,{onContinue:()=>void v(),disabled:!g,creating:p})]})]})}):(0,W.jsx)(D,{title:`No project selected`,children:`Please select a project to add a slash command.`})}function J(){let e=k(e=>e.selectedProjectId),t=k(e=>e.selectedThreadId),{openChatDockPanel:n}=M(),{setPendingExplorerPath:o,triggerExplorerRefresh:s,setExplorerClearPath:c}=j(),[l,u]=(0,U.useState)([]),[_,y]=(0,U.useState)(!0),[C,E]=(0,U.useState)(!1),[O,z]=(0,U.useState)(null),[B,V]=(0,U.useState)(!1),[H,G]=(0,U.useState)([]),[K,J]=(0,U.useState)(!0),[Y,X]=(0,U.useState)(new Map),[Z,ne]=(0,U.useState)(``),Q=(0,U.useCallback)(async()=>{if(!t){y(!1),u([]),X(new Map);return}y(!0);try{let e=await d(t);u(e.filter(e=>!e.isBuiltIn)),X(new Map(e.map(e=>[e.name,e.filePath])))}catch{u([]),X(new Map)}finally{y(!1)}},[t]);(0,U.useLayoutEffect)(()=>{t&&y(!0)},[e,t]),(0,U.useEffect)(()=>{Q()},[Q]),(0,U.useEffect)(()=>{J(!0),h().then(G).catch(()=>G([])).finally(()=>J(!1))},[]);let re=P(e?`${e}:${t??``}`:null,[_,K]),ie=(0,U.useCallback)(async e=>{V(!0);try{await ee(e.filePath),c(e.filePath),s(),X(t=>{let n=new Map(t);return n.delete(e.name),n}),A({title:`Command removed`,description:`/${e.name}`}),z(null),await Q()}catch(e){A({title:`Error`,description:e instanceof Error?e.message:`Failed to remove command`,variant:`destructive`})}finally{V(!1)}},[Q,s,c]),ae=(0,U.useCallback)(e=>{o(e),n(`explorer`)},[o,n]),oe=(0,U.useCallback)(e=>{let t=e.metadata?.description?.trim();return t&&t.length>0?t:`No description`},[]),se=(0,U.useCallback)(async e=>{if(!(!t||Y.has(e.name)))try{if(e.gitHubRepo&&e.gitHubFolder){let n=`.agents/commands`;await m(t,e.gitHubRepo,e.gitHubFolder,n);let r=`${n}/${e.name}.md`;X(t=>new Map(t).set(e.name,r))}else{let n=await S(e.name,e.content,{description:e.description,argumentHint:e.argumentHint},`project`,t);X(t=>new Map(t).set(e.name,n.filePath))}s(),Q(),A({title:`Command installed`,description:`/${e.name}`})}catch(e){A({title:`Error`,description:e instanceof Error?e.message:`Failed to install command`,variant:`destructive`})}},[t,Y,s,Q]),$=Z.trim()?H.filter(e=>e.name.toLowerCase().includes(Z.toLowerCase())||e.description.toLowerCase().includes(Z.toLowerCase())):H;return e?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(T,{loading:re,children:[(0,W.jsxs)(b,{className:`shrink-0`,children:[(0,W.jsx)(w,{title:`Installed Slash Commands`,description:`Project slash commands you run with / in chat.`,action:(0,W.jsx)(p,{onClick:()=>E(!0),disabled:!t,children:`Add Command`}),sticky:!1}),(0,W.jsxs)(v,{className:`pt-6`,children:[!t&&(0,W.jsx)(x,{children:`Select a thread to add or install slash commands.`}),(0,W.jsx)(R,{showHeader:!1,loading:!1,items:l,emptyState:{icon:i,title:`No slash commands installed`,description:`Add slash commands to create quick actions in chat.`},getKey:e=>e.filePath,columnsClassName:`grid-cols-[minmax(0,1fr)_auto_1.75rem]`,renderContent:e=>(0,W.jsxs)(`div`,{className:`min-w-0 text-left`,children:[(0,W.jsxs)(`div`,{className:a(r.body,`truncate`),children:[`/`,e.name]}),(0,W.jsx)(`div`,{className:a(r.compact,`truncate text-muted-foreground`),children:oe(e)})]}),renderMiddle:e=>e.metadata?.mode?(0,W.jsx)(`span`,{className:a(r.compact,`bg-muted px-1.5 py-0.5 rounded flex-shrink-0`),children:e.metadata.mode}):(0,W.jsx)(`div`,{}),onItemClick:e=>ae(e.filePath),itemClickLabel:e=>`Open /${e.name} in Files`,onDelete:z,deleteAriaLabel:e=>`Delete /${e.name}`,deleteTooltip:`Remove this slash command from the project`})]})]}),(0,W.jsxs)(b,{className:`shrink-0`,children:[(0,W.jsx)(w,{title:`Available Slash Commands`,description:`Browse and install slash commands from the catalog.`,action:(0,W.jsx)(L,{placeholder:`Search`,value:Z,onChange:ne,className:`mb-0 w-64`}),sticky:!1}),(0,W.jsx)(v,{className:`pt-6`,children:$.length===0?(0,W.jsx)(F,{searchQuery:Z,emptyLabel:`No available commands found.`}):(0,W.jsx)(I,{children:$.map(e=>{let t=Y.has(e.name);return(0,W.jsx)(te,{className:`bg-background hover:bg-background`,name:`/${e.name}`,description:e.description,installed:t,onClick:()=>{t||se(e)},showInstalledControls:!1},e.id)})})})]})]}),(0,W.jsx)(g,{open:C,onOpenChange:E,children:(0,W.jsx)(f,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,W.jsx)(q,{projectId:e,threadId:t,onCommandCreated:()=>{E(!1),Q(),s()}})})}),(0,W.jsx)(N,{open:O!==null,onOpenChange:e=>!e&&z(null),title:`Delete Slash Command`,description:`Are you sure you want to delete "/${O?.name}"? This action cannot be undone.`,onConfirm:()=>{O&&ie(O)},confirming:B})]}):(0,W.jsx)(D,{children:`Select a project to manage slash commands.`})}export{J as SettingsSlashCommandsView,J as default};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Di as t,Oi as n,Rr as r,i,ki as a,tr as o}from"./interactive-BrHVRHmQ.js";import{$n as s,a as c,ft as l,o as u}from"./onboarding-DVc9-yKJ.js";import{a as d,i as f,n as p,r as m,t as h}from"./table-Cb2C1rQy.js";var g=n(),_=e(a(),1),v=o(`app.use-latency-stats.hook`),y={tools:[],models:[]};function b(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(!0),[o,c]=(0,_.useState)(null),l=(0,_.useCallback)(async function(){try{c(null);let e=await s();t(e.tools??y.tools),r(e.models??y.models)}catch(e){v.error(`Failed to load latency statistics`,e),c(e instanceof Error?e.message:`Failed to load statistics`)}finally{a(!1)}},[]);return(0,_.useEffect)(()=>{l()},[l]),{tools:e,models:n,isLoading:i,error:o,refresh:l}}var x=t(),S=[{value:`tools`,label:`Tools`},{value:`models`,label:`Models`}],C=`inline-flex rounded-full border bg-muted/40 p-1`,w=`rounded-full border-0 px-4 data-[state=on]:bg-foreground data-[state=on]:text-background data-[state=on]:shadow-sm`,T=`h-9`,E=`table-fixed`,D=i(r.body,`py-1.5`),O=i(r.body,`w-28 py-1.5 text-right tabular-nums`),k=i(r.body,`w-32 py-1.5 text-right tabular-nums`),A=`h-9 w-28 bg-transparent py-2 text-right`,j=`h-9 w-32 bg-transparent py-2 text-right`;function M(e){if(!Number.isFinite(e)||e<0)return`—`;if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;return t<10?`${t.toFixed(1)}s`:`${Math.round(t)}s`}function N(e){let t=(0,g.c)(3),{view:n}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=i(`w-full caption-bottom`,E,r.body),t[0]=a):a=t[0];let o;return t[1]===n?o=t[2]:(o=(0,x.jsx)(`table`,{className:a,children:(0,x.jsx)(`thead`,{className:`[&_tr]:border-b [&_tr]:border-table-border`,children:(0,x.jsx)(`tr`,{children:n===`tools`?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(f,{className:`h-9 bg-transparent py-2`,children:`Tool`}),(0,x.jsx)(f,{className:A,children:`Calls`}),(0,x.jsx)(f,{className:j,children:`Latency`})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(f,{className:`h-9 bg-transparent py-2`,children:`Model`}),(0,x.jsx)(f,{className:A,children:`Requests`}),(0,x.jsx)(f,{className:j,children:`Latency`})]})})})}),t[1]=n,t[2]=o),o}function P(){let e=(0,g.c)(19),{tools:t,models:n,isLoading:a,error:o}=b(),[s,u]=(0,_.useState)(`tools`),d=s===`tools`&&!a&&t.length>0,f=s===`models`&&!a&&n.length>0,m=d||f,v;e[0]!==m||e[1]!==s?(v=m?(0,x.jsx)(N,{view:s}):void 0,e[0]=m,e[1]=s,e[2]=v):v=e[2];let y;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{(e===`tools`||e===`models`)&&u(e)},e[3]=y):y=e[3];let w;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(w=S.map(L),e[4]=w):w=e[4];let T;e[5]===s?T=e[6]:(T=(0,x.jsx)(c,{type:`single`,value:s,onValueChange:y,"aria-label":`Statistics view`,variant:`outline`,className:C,children:w}),e[5]=s,e[6]=T);let D;e[7]===o?D=e[8]:(D=o?(0,x.jsx)(`p`,{className:i(r.bodyMuted,`mb-6 text-destructive`),children:o}):null,e[7]=o,e[8]=D);let O;e[9]!==a||e[10]!==n||e[11]!==t||e[12]!==s?(O=s===`tools`?a?(0,x.jsx)(`p`,{className:r.bodyMuted,children:`Loading…`}):t.length===0?(0,x.jsx)(`p`,{className:r.bodyMuted,children:`No tool call timings recorded yet. Stats appear after agent tool calls complete.`}):(0,x.jsx)(h,{className:E,children:(0,x.jsx)(p,{children:t.map(I)})}):a?(0,x.jsx)(`p`,{className:r.bodyMuted,children:`Loading…`}):n.length===0?(0,x.jsx)(`p`,{className:r.bodyMuted,children:`No model timings recorded yet. Stats appear after assistant responses complete.`}):(0,x.jsx)(h,{className:E,children:(0,x.jsx)(p,{children:n.map(F)})}),e[9]=a,e[10]=n,e[11]=t,e[12]=s,e[13]=O):O=e[13];let k;return e[14]!==v||e[15]!==T||e[16]!==D||e[17]!==O?(k=(0,x.jsxs)(l,{title:`Statistics`,description:`Average latency and request counts for tool calls and model responses.`,tableHeader:v,action:T,children:[D,O]}),e[14]=v,e[15]=T,e[16]=D,e[17]=O,e[18]=k):k=e[18],k}function F(e){return(0,x.jsxs)(d,{className:T,children:[(0,x.jsx)(m,{className:D,children:e.modelId}),(0,x.jsx)(m,{className:O,children:e.requestCount.toLocaleString()}),(0,x.jsx)(m,{className:k,children:M(e.averageDurationMs)})]},e.modelId)}function I(e){return(0,x.jsxs)(d,{className:T,children:[(0,x.jsx)(m,{className:D,children:e.toolName}),(0,x.jsx)(m,{className:O,children:e.callCount.toLocaleString()}),(0,x.jsx)(m,{className:k,children:M(e.averageDurationMs)})]},e.toolName)}function L(e){return(0,x.jsx)(u,{value:e.value,"aria-label":e.label,className:w,children:e.label},e.value)}export{P as default};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Di as t,Oi as n,Rr as r,i,ki as a,tr as o}from"./interactive-BrHVRHmQ.js";import{$n as s,a as c,ft as l,o as u}from"./onboarding-KBcwP-kU.js";import{a as d,i as f,n as p,r as m,t as h}from"./table-Cb2C1rQy.js";var g=n(),_=e(a(),1),v=o(`app.use-latency-stats.hook`),y={tools:[],models:[]};function b(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(!0),[o,c]=(0,_.useState)(null),l=(0,_.useCallback)(async function(){try{c(null);let e=await s();t(e.tools??y.tools),r(e.models??y.models)}catch(e){v.error(`Failed to load latency statistics`,e),c(e instanceof Error?e.message:`Failed to load statistics`)}finally{a(!1)}},[]);return(0,_.useEffect)(()=>{l()},[l]),{tools:e,models:n,isLoading:i,error:o,refresh:l}}var x=t(),S=[{value:`tools`,label:`Tools`},{value:`models`,label:`Models`}],C=`inline-flex rounded-full border bg-muted/40 p-1`,w=`rounded-full border-0 px-4 data-[state=on]:bg-foreground data-[state=on]:text-background data-[state=on]:shadow-sm`,T=`h-9`,E=`table-fixed`,D=i(r.body,`py-1.5`),O=i(r.body,`w-28 py-1.5 text-right tabular-nums`),k=i(r.body,`w-32 py-1.5 text-right tabular-nums`),A=`h-9 w-28 bg-transparent py-2 text-right`,j=`h-9 w-32 bg-transparent py-2 text-right`;function M(e){if(!Number.isFinite(e)||e<0)return`—`;if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;return t<10?`${t.toFixed(1)}s`:`${Math.round(t)}s`}function N(e){let t=(0,g.c)(3),{view:n}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=i(`w-full caption-bottom`,E,r.body),t[0]=a):a=t[0];let o;return t[1]===n?o=t[2]:(o=(0,x.jsx)(`table`,{className:a,children:(0,x.jsx)(`thead`,{className:`[&_tr]:border-b [&_tr]:border-table-border`,children:(0,x.jsx)(`tr`,{children:n===`tools`?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(f,{className:`h-9 bg-transparent py-2`,children:`Tool`}),(0,x.jsx)(f,{className:A,children:`Calls`}),(0,x.jsx)(f,{className:j,children:`Latency`})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(f,{className:`h-9 bg-transparent py-2`,children:`Model`}),(0,x.jsx)(f,{className:A,children:`Requests`}),(0,x.jsx)(f,{className:j,children:`Latency`})]})})})}),t[1]=n,t[2]=o),o}function P(){let e=(0,g.c)(19),{tools:t,models:n,isLoading:a,error:o}=b(),[s,u]=(0,_.useState)(`tools`),d=s===`tools`&&!a&&t.length>0,f=s===`models`&&!a&&n.length>0,m=d||f,v;e[0]!==m||e[1]!==s?(v=m?(0,x.jsx)(N,{view:s}):void 0,e[0]=m,e[1]=s,e[2]=v):v=e[2];let y;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{(e===`tools`||e===`models`)&&u(e)},e[3]=y):y=e[3];let w;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(w=S.map(L),e[4]=w):w=e[4];let T;e[5]===s?T=e[6]:(T=(0,x.jsx)(c,{type:`single`,value:s,onValueChange:y,"aria-label":`Statistics view`,variant:`outline`,className:C,children:w}),e[5]=s,e[6]=T);let D;e[7]===o?D=e[8]:(D=o?(0,x.jsx)(`p`,{className:i(r.bodyMuted,`mb-6 text-destructive`),children:o}):null,e[7]=o,e[8]=D);let O;e[9]!==a||e[10]!==n||e[11]!==t||e[12]!==s?(O=s===`tools`?a?(0,x.jsx)(`p`,{className:r.bodyMuted,children:`Loading…`}):t.length===0?(0,x.jsx)(`p`,{className:r.bodyMuted,children:`No tool call timings recorded yet. Stats appear after agent tool calls complete.`}):(0,x.jsx)(h,{className:E,children:(0,x.jsx)(p,{children:t.map(I)})}):a?(0,x.jsx)(`p`,{className:r.bodyMuted,children:`Loading…`}):n.length===0?(0,x.jsx)(`p`,{className:r.bodyMuted,children:`No model timings recorded yet. Stats appear after assistant responses complete.`}):(0,x.jsx)(h,{className:E,children:(0,x.jsx)(p,{children:n.map(F)})}),e[9]=a,e[10]=n,e[11]=t,e[12]=s,e[13]=O):O=e[13];let k;return e[14]!==v||e[15]!==T||e[16]!==D||e[17]!==O?(k=(0,x.jsxs)(l,{title:`Statistics`,description:`Average latency and request counts for tool calls and model responses.`,tableHeader:v,action:T,children:[D,O]}),e[14]=v,e[15]=T,e[16]=D,e[17]=O,e[18]=k):k=e[18],k}function F(e){return(0,x.jsxs)(d,{className:T,children:[(0,x.jsx)(m,{className:D,children:e.modelId}),(0,x.jsx)(m,{className:O,children:e.requestCount.toLocaleString()}),(0,x.jsx)(m,{className:k,children:M(e.averageDurationMs)})]},e.modelId)}function I(e){return(0,x.jsxs)(d,{className:T,children:[(0,x.jsx)(m,{className:D,children:e.toolName}),(0,x.jsx)(m,{className:O,children:e.callCount.toLocaleString()}),(0,x.jsx)(m,{className:k,children:M(e.averageDurationMs)})]},e.toolName)}function L(e){return(0,x.jsx)(u,{value:e.value,"aria-label":e.label,className:w,children:e.label},e.value)}export{P as default};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Di as t,Oi as n,On as r,Rr as i,b as a,c as o,i as s,jn as c,ki as l,yt as u,zn as d}from"./interactive-BrHVRHmQ.js";import{nt as f}from"./react-vendor-B7jFrulV.js";import{Ct as p,Eo as m,St as h,Tt as g,bt as _,dt as v,rt as y}from"./onboarding-DVc9-yKJ.js";import{W as ee,r as b,z as x}from"./store-B_cK-gsT.js";import{n as te}from"./use-toast-hxHsVv6a.js";import{ot as ne,q as re}from"./index-B0xy4BkI.js";import{t as ie}from"./delete-confirm-dialog-uTSX_x-i.js";import{i as ae,r as S}from"./table-Cb2C1rQy.js";import{t as oe}from"./settings-list-B9wyVzKw.js";import{t as se}from"./is-macos-client-BIb4ZSEa.js";var C=n(),ce=e(l(),1),w=t(),le=36,ue=`table-fixed`,de=`h-9 w-48 bg-transparent py-2`,fe=`h-9 bg-transparent py-2`,pe=`h-9 w-32 bg-transparent py-2`,me=`h-9 w-10 bg-transparent py-2`,he=s(i.bodyMuted,`w-48 truncate py-1.5`),ge=s(i.body,`truncate py-1.5`),_e=s(i.bodyMuted,`w-32 truncate py-1.5`),ve=`w-10 py-1.5`,ye={column:`project`,direction:`asc`};function be(e){let t=(0,C.c)(4),n;if(t[0]!==e){let{style:r,...a}=e,o;t[2]===r?o=t[3]:(o={...r,width:`100%`},t[2]=r,t[3]=o),n=(0,w.jsx)(`table`,{...a,style:o,className:s(`w-full caption-bottom`,ue,i.body,a.className)}),t[0]=e,t[1]=n}else n=t[1];return n}function xe(e){let t=(0,C.c)(5),n;t[0]===e.className?n=t[1]:(n=s(`hidden`,e.className),t[0]=e.className,t[1]=n);let r;return t[2]!==e||t[3]!==n?(r=(0,w.jsx)(`thead`,{...e,className:n}),t[2]=e,t[3]=n,t[4]=r):r=t[4],r}function Se(e){let t=(0,C.c)(5),n;t[0]===e.className?n=t[1]:(n=s(`[&_tr:last-child]:border-0`,e.className),t[0]=e.className,t[1]=n);let r;return t[2]!==e||t[3]!==n?(r=(0,w.jsx)(`tbody`,{...e,className:n}),t[2]=e,t[3]=n,t[4]=r):r=t[4],r}function Ce(e){let t=(0,C.c)(5),n;t[0]===e.className?n=t[1]:(n=s(`frosted-scrollbar`,e.className),t[0]=e.className,t[1]=n);let r;return t[2]!==e||t[3]!==n?(r=(0,w.jsx)(`div`,{...e,className:n}),t[2]=e,t[3]=n,t[4]=r):r=t[4],r}function we(e,t){return t?d(t,e):e}function T(e,t,n){switch(t){case`project`:return e.projectName;case`path`:return we(e.path,n);case`branch`:return e.branch}}function Te(e){let t=[];for(let n of e){let e=o(n);for(let r of n.threads)t.push({threadId:r.threadId,projectId:n.projectId,projectName:e,path:r.path,branch:r.currentBranch||r.title})}return t}function Ee(e,t,n,r){return[...e].sort((e,i)=>{let a=T(e,t,r).localeCompare(T(i,t,r),void 0,{sensitivity:`base`});return n===`asc`?a:-a})}function De(e){let t=(0,C.c)(17),{label:n,column:i,sortColumn:a,sortDirection:o,className:l,onSort:u}=e,d=a===i,f=o===`asc`?r:c,p=d?`text-foreground`:`text-muted-foreground`,m;t[0]===p?m=t[1]:(m=s(`inline-flex items-center gap-1 transition-colors hover:text-foreground`,p),t[0]=p,t[1]=m);let h;t[2]!==i||t[3]!==u?(h=()=>u(i),t[2]=i,t[3]=u,t[4]=h):h=t[4];let g=d?o===`asc`?`ascending`:`descending`:`none`,_;t[5]!==f||t[6]!==d?(_=d?(0,w.jsx)(f,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`}):null,t[5]=f,t[6]=d,t[7]=_):_=t[7];let v;t[8]!==n||t[9]!==m||t[10]!==h||t[11]!==g||t[12]!==_?(v=(0,w.jsxs)(`button`,{type:`button`,className:m,onClick:h,"aria-sort":g,children:[n,_]}),t[8]=n,t[9]=m,t[10]=h,t[11]=g,t[12]=_,t[13]=v):v=t[13];let y;return t[14]!==l||t[15]!==v?(y=(0,w.jsx)(ae,{className:l,children:v}),t[14]=l,t[15]=v,t[16]=y):y=t[16],y}function E(){let e=(0,C.c)(55),t=b(Ie),n=b(Fe),r=b(Pe),o=b(Ne),c=b(Me),l=b(je),d=b(Ae),x=b(ke),{handleDeleteThread:T,refreshWorkspaces:E}=re(),{toast:Le}=te(),[D,O]=(0,ce.useState)(null),[k,Re]=(0,ce.useState)(ye),ze=se()?`Finder`:`Explorer`,A,j;e[0]===E?(A=e[1],j=e[2]):(A=()=>{E()},j=[E],e[0]=E,e[1]=A,e[2]=j),(0,ce.useEffect)(A,j);let M;e[3]!==n||e[4]!==t||e[5]!==k.column||e[6]!==k.direction?(M=Ee(Te(t),k.column,k.direction,n),e[3]=n,e[4]=t,e[5]=k.column,e[6]=k.direction,e[7]=M):M=e[7];let N=M,P;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(P=function(e){Re(t=>t.column===e?{column:e,direction:t.direction===`asc`?`desc`:`asc`}:{column:e,direction:`asc`})},e[8]=P):P=e[8];let Be=P,F;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(F=function(e){let{...t}=e;return(0,w.jsx)(`tr`,{...t,className:s(`group border-0 transition-colors hover:bg-muted/50`,t.className)})},e[9]=F):F=e[9];let Ve=F,I;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(I={Table:be,TableHead:xe,TableBody:Se,TableRow:Ve,Scroller:Ce},e[10]=I):I=e[10];let He=I,L;e[11]!==T||e[12]!==D?(L=function(){if(!D)return;let{projectId:e,threadId:t}=D;O(null),T(e,t)},e[11]=T,e[12]=D,e[13]=L):L=e[13];let Ue=L,R;e[14]===Le?R=e[15]:(R=async function(e){try{await ne(e.threadId,`.`)}catch{Le({title:`Error`,description:`Failed to open folder in ${ze}.`,variant:`destructive`})}},e[14]=Le,e[15]=R);let z=R,B;e[16]!==n||e[17]!==l||e[18]!==o||e[19]!==z||e[20]!==x||e[21]!==c||e[22]!==d?(B=function(e,t){let r=o.includes(t.threadId),f=ee(t.threadId,c,d,x),_=l.includes(t.threadId),v=!f&&!r&&!_,y=we(t.path,n);return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(S,{className:he,children:t.projectName}),(0,w.jsx)(S,{className:ge,children:(0,w.jsx)(`button`,{type:`button`,className:s(i.body,`block w-full truncate text-left hover:underline`),title:`${t.path}\nOpen in ${ze}`,onClick:()=>void z(t),children:y})}),(0,w.jsx)(S,{className:_e,children:t.branch}),(0,w.jsx)(S,{className:ve,children:(0,w.jsx)(`div`,{className:`ml-auto flex h-7 w-7 items-center justify-center`,children:r?(0,w.jsx)(u,{className:`h-4 w-4 animate-spin text-muted-foreground`,"aria-label":`Deleting`}):v?(0,w.jsxs)(h,{children:[(0,w.jsx)(g,{asChild:!0,children:(0,w.jsxs)(m,{variant:`ghost`,size:`icon-sm`,className:oe,onClick:e=>{e.stopPropagation(),O(t)},children:[(0,w.jsx)(a,{}),(0,w.jsx)(`span`,{className:`sr-only`,children:`Delete workspace`})]})}),(0,w.jsx)(p,{side:`left`,children:`Delete branch and files from the repo`})]}):null})})]})},e[16]=n,e[17]=l,e[18]=o,e[19]=z,e[20]=x,e[21]=c,e[22]=d,e[23]=B):B=e[23];let We=B,V;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(V=s(`w-full caption-bottom`,ue,i.body),e[24]=V):V=e[24];let H,U,W;e[25]!==k.column||e[26]!==k.direction?(H=(0,w.jsx)(De,{label:`Project`,column:`project`,sortColumn:k.column,sortDirection:k.direction,className:de,onSort:Be}),U=(0,w.jsx)(De,{label:`Path`,column:`path`,sortColumn:k.column,sortDirection:k.direction,className:fe,onSort:Be}),W=(0,w.jsx)(De,{label:`Branch`,column:`branch`,sortColumn:k.column,sortDirection:k.direction,className:pe,onSort:Be}),e[25]=k.column,e[26]=k.direction,e[27]=H,e[28]=U,e[29]=W):(H=e[27],U=e[28],W=e[29]);let G;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,w.jsx)(ae,{className:me,children:(0,w.jsx)(`span`,{className:`sr-only`,children:`Actions`})}),e[30]=G):G=e[30];let K;e[31]!==H||e[32]!==U||e[33]!==W?(K=(0,w.jsx)(`table`,{className:V,children:(0,w.jsx)(`thead`,{className:`[&_tr]:border-b [&_tr]:border-table-border`,children:(0,w.jsxs)(`tr`,{children:[H,U,W,G]})})}),e[31]=H,e[32]=U,e[33]=W,e[34]=K):K=e[34];let Ge=K,Ke=N.length>0?Ge:void 0,q;e[35]===Ke?q=e[36]:(q=(0,w.jsx)(y,{title:`Storage`,description:`Workspaces and branches stored on disk across all projects.`,tableHeader:Ke}),e[35]=Ke,e[36]=q);let J;e[37]!==r||e[38]!==We||e[39]!==N?(J=(0,w.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:r&&N.length===0?(0,w.jsx)(_,{label:`Loading workspaces...`,size:`lg`}):N.length===0?(0,w.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,w.jsxs)(`div`,{className:`max-w-md space-y-2 text-center`,children:[(0,w.jsx)(`h3`,{className:i.emptyStateTitle,children:`No workspaces`}),(0,w.jsx)(`p`,{className:i.bodyMuted,children:`No branches or workspaces found yet.`})]})}):(0,w.jsx)(f,{style:{height:`100%`},data:N,computeItemKey:Oe,itemContent:We,defaultItemHeight:le,increaseViewportBy:le*5,components:He})}),e[37]=r,e[38]=We,e[39]=N,e[40]=J):J=e[40];let Y;e[41]!==q||e[42]!==J?(Y=(0,w.jsxs)(v,{className:`flex w-full max-w-none min-w-0 min-h-0 flex-1 flex-col pb-0 pt-0`,children:[q,J]}),e[41]=q,e[42]=J,e[43]=Y):Y=e[43];let qe=D!==null,X;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(X=e=>{e||O(null)},e[44]=X):X=e[44];let Z;e[45]!==n||e[46]!==D?(Z=D?`Are you sure you want to delete the workspace at "${we(D.path,n)}"? This removes the branch and all its files. This action cannot be undone.`:``,e[45]=n,e[46]=D,e[47]=Z):Z=e[47];let Q;e[48]!==Ue||e[49]!==qe||e[50]!==Z?(Q=(0,w.jsx)(ie,{open:qe,onOpenChange:X,title:`Delete workspace?`,description:Z,onConfirm:Ue,confirmLabel:`Delete`,confirmingLabel:`Deleting...`}),e[48]=Ue,e[49]=qe,e[50]=Z,e[51]=Q):Q=e[51];let $;return e[52]!==Y||e[53]!==Q?($=(0,w.jsxs)(`div`,{className:`flex h-full min-h-0 w-full min-w-0 flex-1 flex-col`,children:[Y,Q]}),e[52]=Y,e[53]=Q,e[54]=$):$=e[54],$}function Oe(e,t){return t.threadId}function ke(e){return e.pendingChatMessage}function Ae(e){return x(e.threadStreamingStates)}function je(e){return e.completedThreadIds}function Me(e){return e.processingThreadIds}function Ne(e){return e.deletingThreadIds}function Pe(e){return e.projectsLoading}function Fe(e){return e.cloneRootPath}function Ie(e){return e.projects}export{E as default};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Di as t,Oi as n,On as r,Rr as i,b as a,c as o,i as s,jn as c,ki as l,yt as u,zn as d}from"./interactive-BrHVRHmQ.js";import{nt as f}from"./react-vendor-7n7LyU5o.js";import{Ct as p,Eo as m,St as h,Tt as g,bt as _,dt as v,rt as y}from"./onboarding-KBcwP-kU.js";import{W as ee,r as b,z as x}from"./store-B_cK-gsT.js";import{n as te}from"./use-toast-hxHsVv6a.js";import{ot as ne,q as re}from"./index-CJCQ4bTo.js";import{t as ie}from"./delete-confirm-dialog-D1zjctrX.js";import{i as ae,r as S}from"./table-Cb2C1rQy.js";import{t as oe}from"./settings-list-CWdsaJKC.js";import{t as se}from"./is-macos-client-BIb4ZSEa.js";var C=n(),ce=e(l(),1),w=t(),le=36,ue=`table-fixed`,de=`h-9 w-48 bg-transparent py-2`,fe=`h-9 bg-transparent py-2`,pe=`h-9 w-32 bg-transparent py-2`,me=`h-9 w-10 bg-transparent py-2`,he=s(i.bodyMuted,`w-48 truncate py-1.5`),ge=s(i.body,`truncate py-1.5`),_e=s(i.bodyMuted,`w-32 truncate py-1.5`),ve=`w-10 py-1.5`,ye={column:`project`,direction:`asc`};function be(e){let t=(0,C.c)(4),n;if(t[0]!==e){let{style:r,...a}=e,o;t[2]===r?o=t[3]:(o={...r,width:`100%`},t[2]=r,t[3]=o),n=(0,w.jsx)(`table`,{...a,style:o,className:s(`w-full caption-bottom`,ue,i.body,a.className)}),t[0]=e,t[1]=n}else n=t[1];return n}function xe(e){let t=(0,C.c)(5),n;t[0]===e.className?n=t[1]:(n=s(`hidden`,e.className),t[0]=e.className,t[1]=n);let r;return t[2]!==e||t[3]!==n?(r=(0,w.jsx)(`thead`,{...e,className:n}),t[2]=e,t[3]=n,t[4]=r):r=t[4],r}function Se(e){let t=(0,C.c)(5),n;t[0]===e.className?n=t[1]:(n=s(`[&_tr:last-child]:border-0`,e.className),t[0]=e.className,t[1]=n);let r;return t[2]!==e||t[3]!==n?(r=(0,w.jsx)(`tbody`,{...e,className:n}),t[2]=e,t[3]=n,t[4]=r):r=t[4],r}function Ce(e){let t=(0,C.c)(5),n;t[0]===e.className?n=t[1]:(n=s(`frosted-scrollbar`,e.className),t[0]=e.className,t[1]=n);let r;return t[2]!==e||t[3]!==n?(r=(0,w.jsx)(`div`,{...e,className:n}),t[2]=e,t[3]=n,t[4]=r):r=t[4],r}function we(e,t){return t?d(t,e):e}function T(e,t,n){switch(t){case`project`:return e.projectName;case`path`:return we(e.path,n);case`branch`:return e.branch}}function Te(e){let t=[];for(let n of e){let e=o(n);for(let r of n.threads)t.push({threadId:r.threadId,projectId:n.projectId,projectName:e,path:r.path,branch:r.currentBranch||r.title})}return t}function Ee(e,t,n,r){return[...e].sort((e,i)=>{let a=T(e,t,r).localeCompare(T(i,t,r),void 0,{sensitivity:`base`});return n===`asc`?a:-a})}function De(e){let t=(0,C.c)(17),{label:n,column:i,sortColumn:a,sortDirection:o,className:l,onSort:u}=e,d=a===i,f=o===`asc`?r:c,p=d?`text-foreground`:`text-muted-foreground`,m;t[0]===p?m=t[1]:(m=s(`inline-flex items-center gap-1 transition-colors hover:text-foreground`,p),t[0]=p,t[1]=m);let h;t[2]!==i||t[3]!==u?(h=()=>u(i),t[2]=i,t[3]=u,t[4]=h):h=t[4];let g=d?o===`asc`?`ascending`:`descending`:`none`,_;t[5]!==f||t[6]!==d?(_=d?(0,w.jsx)(f,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`}):null,t[5]=f,t[6]=d,t[7]=_):_=t[7];let v;t[8]!==n||t[9]!==m||t[10]!==h||t[11]!==g||t[12]!==_?(v=(0,w.jsxs)(`button`,{type:`button`,className:m,onClick:h,"aria-sort":g,children:[n,_]}),t[8]=n,t[9]=m,t[10]=h,t[11]=g,t[12]=_,t[13]=v):v=t[13];let y;return t[14]!==l||t[15]!==v?(y=(0,w.jsx)(ae,{className:l,children:v}),t[14]=l,t[15]=v,t[16]=y):y=t[16],y}function E(){let e=(0,C.c)(55),t=b(Ie),n=b(Fe),r=b(Pe),o=b(Ne),c=b(Me),l=b(je),d=b(Ae),x=b(ke),{handleDeleteThread:T,refreshWorkspaces:E}=re(),{toast:Le}=te(),[D,O]=(0,ce.useState)(null),[k,Re]=(0,ce.useState)(ye),ze=se()?`Finder`:`Explorer`,A,j;e[0]===E?(A=e[1],j=e[2]):(A=()=>{E()},j=[E],e[0]=E,e[1]=A,e[2]=j),(0,ce.useEffect)(A,j);let M;e[3]!==n||e[4]!==t||e[5]!==k.column||e[6]!==k.direction?(M=Ee(Te(t),k.column,k.direction,n),e[3]=n,e[4]=t,e[5]=k.column,e[6]=k.direction,e[7]=M):M=e[7];let N=M,P;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(P=function(e){Re(t=>t.column===e?{column:e,direction:t.direction===`asc`?`desc`:`asc`}:{column:e,direction:`asc`})},e[8]=P):P=e[8];let Be=P,F;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(F=function(e){let{...t}=e;return(0,w.jsx)(`tr`,{...t,className:s(`group border-0 transition-colors hover:bg-muted/50`,t.className)})},e[9]=F):F=e[9];let Ve=F,I;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(I={Table:be,TableHead:xe,TableBody:Se,TableRow:Ve,Scroller:Ce},e[10]=I):I=e[10];let He=I,L;e[11]!==T||e[12]!==D?(L=function(){if(!D)return;let{projectId:e,threadId:t}=D;O(null),T(e,t)},e[11]=T,e[12]=D,e[13]=L):L=e[13];let Ue=L,R;e[14]===Le?R=e[15]:(R=async function(e){try{await ne(e.threadId,`.`)}catch{Le({title:`Error`,description:`Failed to open folder in ${ze}.`,variant:`destructive`})}},e[14]=Le,e[15]=R);let z=R,B;e[16]!==n||e[17]!==l||e[18]!==o||e[19]!==z||e[20]!==x||e[21]!==c||e[22]!==d?(B=function(e,t){let r=o.includes(t.threadId),f=ee(t.threadId,c,d,x),_=l.includes(t.threadId),v=!f&&!r&&!_,y=we(t.path,n);return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(S,{className:he,children:t.projectName}),(0,w.jsx)(S,{className:ge,children:(0,w.jsx)(`button`,{type:`button`,className:s(i.body,`block w-full truncate text-left hover:underline`),title:`${t.path}\nOpen in ${ze}`,onClick:()=>void z(t),children:y})}),(0,w.jsx)(S,{className:_e,children:t.branch}),(0,w.jsx)(S,{className:ve,children:(0,w.jsx)(`div`,{className:`ml-auto flex h-7 w-7 items-center justify-center`,children:r?(0,w.jsx)(u,{className:`h-4 w-4 animate-spin text-muted-foreground`,"aria-label":`Deleting`}):v?(0,w.jsxs)(h,{children:[(0,w.jsx)(g,{asChild:!0,children:(0,w.jsxs)(m,{variant:`ghost`,size:`icon-sm`,className:oe,onClick:e=>{e.stopPropagation(),O(t)},children:[(0,w.jsx)(a,{}),(0,w.jsx)(`span`,{className:`sr-only`,children:`Delete workspace`})]})}),(0,w.jsx)(p,{side:`left`,children:`Delete branch and files from the repo`})]}):null})})]})},e[16]=n,e[17]=l,e[18]=o,e[19]=z,e[20]=x,e[21]=c,e[22]=d,e[23]=B):B=e[23];let We=B,V;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(V=s(`w-full caption-bottom`,ue,i.body),e[24]=V):V=e[24];let H,U,W;e[25]!==k.column||e[26]!==k.direction?(H=(0,w.jsx)(De,{label:`Project`,column:`project`,sortColumn:k.column,sortDirection:k.direction,className:de,onSort:Be}),U=(0,w.jsx)(De,{label:`Path`,column:`path`,sortColumn:k.column,sortDirection:k.direction,className:fe,onSort:Be}),W=(0,w.jsx)(De,{label:`Branch`,column:`branch`,sortColumn:k.column,sortDirection:k.direction,className:pe,onSort:Be}),e[25]=k.column,e[26]=k.direction,e[27]=H,e[28]=U,e[29]=W):(H=e[27],U=e[28],W=e[29]);let G;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,w.jsx)(ae,{className:me,children:(0,w.jsx)(`span`,{className:`sr-only`,children:`Actions`})}),e[30]=G):G=e[30];let K;e[31]!==H||e[32]!==U||e[33]!==W?(K=(0,w.jsx)(`table`,{className:V,children:(0,w.jsx)(`thead`,{className:`[&_tr]:border-b [&_tr]:border-table-border`,children:(0,w.jsxs)(`tr`,{children:[H,U,W,G]})})}),e[31]=H,e[32]=U,e[33]=W,e[34]=K):K=e[34];let Ge=K,Ke=N.length>0?Ge:void 0,q;e[35]===Ke?q=e[36]:(q=(0,w.jsx)(y,{title:`Storage`,description:`Workspaces and branches stored on disk across all projects.`,tableHeader:Ke}),e[35]=Ke,e[36]=q);let J;e[37]!==r||e[38]!==We||e[39]!==N?(J=(0,w.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:r&&N.length===0?(0,w.jsx)(_,{label:`Loading workspaces...`,size:`lg`}):N.length===0?(0,w.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,w.jsxs)(`div`,{className:`max-w-md space-y-2 text-center`,children:[(0,w.jsx)(`h3`,{className:i.emptyStateTitle,children:`No workspaces`}),(0,w.jsx)(`p`,{className:i.bodyMuted,children:`No branches or workspaces found yet.`})]})}):(0,w.jsx)(f,{style:{height:`100%`},data:N,computeItemKey:Oe,itemContent:We,defaultItemHeight:le,increaseViewportBy:le*5,components:He})}),e[37]=r,e[38]=We,e[39]=N,e[40]=J):J=e[40];let Y;e[41]!==q||e[42]!==J?(Y=(0,w.jsxs)(v,{className:`flex w-full max-w-none min-w-0 min-h-0 flex-1 flex-col pb-0 pt-0`,children:[q,J]}),e[41]=q,e[42]=J,e[43]=Y):Y=e[43];let qe=D!==null,X;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(X=e=>{e||O(null)},e[44]=X):X=e[44];let Z;e[45]!==n||e[46]!==D?(Z=D?`Are you sure you want to delete the workspace at "${we(D.path,n)}"? This removes the branch and all its files. This action cannot be undone.`:``,e[45]=n,e[46]=D,e[47]=Z):Z=e[47];let Q;e[48]!==Ue||e[49]!==qe||e[50]!==Z?(Q=(0,w.jsx)(ie,{open:qe,onOpenChange:X,title:`Delete workspace?`,description:Z,onConfirm:Ue,confirmLabel:`Delete`,confirmingLabel:`Deleting...`}),e[48]=Ue,e[49]=qe,e[50]=Z,e[51]=Q):Q=e[51];let $;return e[52]!==Y||e[53]!==Q?($=(0,w.jsxs)(`div`,{className:`flex h-full min-h-0 w-full min-w-0 flex-1 flex-col`,children:[Y,Q]}),e[52]=Y,e[53]=Q,e[54]=$):$=e[54],$}function Oe(e,t){return t.threadId}function ke(e){return e.pendingChatMessage}function Ae(e){return x(e.threadStreamingStates)}function je(e){return e.completedThreadIds}function Me(e){return e.processingThreadIds}function Ne(e){return e.deletingThreadIds}function Pe(e){return e.projectsLoading}function Fe(e){return e.cloneRootPath}function Ie(e){return e.projects}export{E as default};
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Di as t,Rr as n,h as r,i,ki as a}from"./interactive-BrHVRHmQ.js";import{D as o,Eo as s,Hi as c,Pi as l,T as u,dt as d,et as f,hn as p,mt as m,nt as h,pt as g,rt as _,si as v,st as y,tt as b,ut as x,x as S}from"./onboarding-DVc9-yKJ.js";import{t as C}from"./use-toast-hxHsVv6a.js";import{U as w}from"./index-B0xy4BkI.js";import{t as T}from"./delete-confirm-dialog-uTSX_x-i.js";import{t as E}from"./use-settings-page-loading-BU2CDnfE.js";import{a as D,i as O,o as k,r as A}from"./settings-list-B9wyVzKw.js";import{a as j,i as M,r as N,t as P}from"./mcp-server-card-DOsP-SQ8.js";import{t as F}from"./use-installed-ai-files-DmLnugpj.js";var I=e(a(),1),L=t();function R({threadId:e,onAgentCreated:t}){let[r,a]=(0,I.useState)(``),[o,s]=(0,I.useState)(``),[c,l]=(0,I.useState)(``),[u,d]=(0,I.useState)(!1),m=M(r),h=N(m),v=async()=>{if(!(!h||!o.trim()||!e)){d(!0);try{let n=await p(e,m,o.trim(),c.trim()||void 0);C({title:`Agent created`,description:`Agent '${m}' was created successfully.`}),a(``),s(``),l(``),t?.(n.path,`AGENTS.md`)}catch(e){C({title:`Error`,description:e instanceof Error?e.message:`Failed to create agent`,variant:`destructive`})}finally{d(!1)}}};return e?(0,L.jsx)(g,{children:(0,L.jsxs)(f,{children:[(0,L.jsx)(_,{title:`Add Agent`,description:`Saved as AGENT.md in .agents/agents.`,sticky:!0,className:`pr-10`}),(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(b,{title:`Agent Name`,controlLayout:`stack`,className:`pt-6`,children:[(0,L.jsx)(S,{id:`agentName`,value:r,onChange:e=>a(e.target.value),placeholder:`e.g. Code Reviewer`,disabled:u}),r?(0,L.jsxs)(`p`,{className:i(n.caption,`mt-2`),children:[`Folder name: `,(0,L.jsx)(`span`,{className:`font-mono`,children:m||`...`})]}):null]}),(0,L.jsx)(b,{title:`Description`,controlLayout:`stack`,className:`pt-6`,children:(0,L.jsx)(w,{id:`agentDescription`,value:o,onChange:e=>s(e.target.value),placeholder:`Describe the agent's purpose and behavior...`,className:`resize-none min-h-[120px]`,disabled:u})}),(0,L.jsx)(b,{title:`Tools`,description:`Optional space-separated list of tools this agent can use`,controlLayout:`stack`,className:`pt-6`,children:(0,L.jsx)(S,{id:`agentTools`,value:c,onChange:e=>l(e.target.value),placeholder:`e.g. read grep glob`,disabled:u})}),(0,L.jsx)(j,{onContinue:()=>void v(),disabled:!h||!o.trim(),creating:u})]})]})}):(0,L.jsx)(x,{title:`No thread selected`,children:`Please select a thread to add an agent.`})}function z(e){let t=[];for(let n of e)n.path.startsWith(`.agents/agents/`)&&n.type===`folder`&&t.push(n),n.children&&n.children.length>0&&t.push(...z(n.children));return t}function B(){let{selectedProjectId:e,selectedThreadId:t,items:a,loading:f,deleteConfirm:p,setDeleteConfirm:g,deleting:b,installedFilePaths:S,setInstalledFilePaths:w,loadItems:j,handleDelete:M,handleOpenInExplorer:N,triggerExplorerRefresh:B}=F({findItems:z,installedPathSuffix:`/AGENT.md`,explorerPathSuffix:`/AGENT.md`,sortByName:!0,removedToastTitle:`Agent removed`}),[V,H]=(0,I.useState)(!1),[U,W]=(0,I.useState)([]),[G,K]=(0,I.useState)(!0),[q,J]=(0,I.useState)(``);(0,I.useEffect)(()=>{K(!0),l().then(W).catch(()=>W([])).finally(()=>K(!1))},[]);let Y=E(e?`${e}:${t??``}`:null,[f,G]),X=(0,I.useCallback)(async e=>{let n=`.agents/agents/${e.id}/AGENT.md`;if(!(!t||S.has(n)))try{if(e.gitHubRepo&&e.gitHubFolder)await c(t,e.gitHubRepo,e.gitHubFolder,`.agents/agents/${e.id}`);else{let r=[`---`,`name: ${e.id}`,`description: ${e.description}`];e.tools&&r.push(`tools: ${e.tools}`),r.push(`---`,``,e.systemPrompt),await v(t,n,r.join(`
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Di as t,Rr as n,h as r,i,ki as a}from"./interactive-BrHVRHmQ.js";import{D as o,Eo as s,Hi as c,Pi as l,T as u,dt as d,et as f,hn as p,mt as m,nt as h,pt as g,rt as _,si as v,st as y,tt as b,ut as x,x as S}from"./onboarding-KBcwP-kU.js";import{t as C}from"./use-toast-hxHsVv6a.js";import{U as w}from"./index-CJCQ4bTo.js";import{t as T}from"./delete-confirm-dialog-D1zjctrX.js";import{t as E}from"./use-settings-page-loading-BU2CDnfE.js";import{a as D,i as O,o as k,r as A}from"./settings-list-CWdsaJKC.js";import{a as j,i as M,r as N,t as P}from"./mcp-server-card-DPakHrG9.js";import{t as F}from"./use-installed-ai-files-GpG9ZL8U.js";var I=e(a(),1),L=t();function R({threadId:e,onAgentCreated:t}){let[r,a]=(0,I.useState)(``),[o,s]=(0,I.useState)(``),[c,l]=(0,I.useState)(``),[u,d]=(0,I.useState)(!1),m=M(r),h=N(m),v=async()=>{if(!(!h||!o.trim()||!e)){d(!0);try{let n=await p(e,m,o.trim(),c.trim()||void 0);C({title:`Agent created`,description:`Agent '${m}' was created successfully.`}),a(``),s(``),l(``),t?.(n.path,`AGENTS.md`)}catch(e){C({title:`Error`,description:e instanceof Error?e.message:`Failed to create agent`,variant:`destructive`})}finally{d(!1)}}};return e?(0,L.jsx)(g,{children:(0,L.jsxs)(f,{children:[(0,L.jsx)(_,{title:`Add Agent`,description:`Saved as AGENT.md in .agents/agents.`,sticky:!0,className:`pr-10`}),(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(b,{title:`Agent Name`,controlLayout:`stack`,className:`pt-6`,children:[(0,L.jsx)(S,{id:`agentName`,value:r,onChange:e=>a(e.target.value),placeholder:`e.g. Code Reviewer`,disabled:u}),r?(0,L.jsxs)(`p`,{className:i(n.caption,`mt-2`),children:[`Folder name: `,(0,L.jsx)(`span`,{className:`font-mono`,children:m||`...`})]}):null]}),(0,L.jsx)(b,{title:`Description`,controlLayout:`stack`,className:`pt-6`,children:(0,L.jsx)(w,{id:`agentDescription`,value:o,onChange:e=>s(e.target.value),placeholder:`Describe the agent's purpose and behavior...`,className:`resize-none min-h-[120px]`,disabled:u})}),(0,L.jsx)(b,{title:`Tools`,description:`Optional space-separated list of tools this agent can use`,controlLayout:`stack`,className:`pt-6`,children:(0,L.jsx)(S,{id:`agentTools`,value:c,onChange:e=>l(e.target.value),placeholder:`e.g. read grep glob`,disabled:u})}),(0,L.jsx)(j,{onContinue:()=>void v(),disabled:!h||!o.trim(),creating:u})]})]})}):(0,L.jsx)(x,{title:`No thread selected`,children:`Please select a thread to add an agent.`})}function z(e){let t=[];for(let n of e)n.path.startsWith(`.agents/agents/`)&&n.type===`folder`&&t.push(n),n.children&&n.children.length>0&&t.push(...z(n.children));return t}function B(){let{selectedProjectId:e,selectedThreadId:t,items:a,loading:f,deleteConfirm:p,setDeleteConfirm:g,deleting:b,installedFilePaths:S,setInstalledFilePaths:w,loadItems:j,handleDelete:M,handleOpenInExplorer:N,triggerExplorerRefresh:B}=F({findItems:z,installedPathSuffix:`/AGENT.md`,explorerPathSuffix:`/AGENT.md`,sortByName:!0,removedToastTitle:`Agent removed`}),[V,H]=(0,I.useState)(!1),[U,W]=(0,I.useState)([]),[G,K]=(0,I.useState)(!0),[q,J]=(0,I.useState)(``);(0,I.useEffect)(()=>{K(!0),l().then(W).catch(()=>W([])).finally(()=>K(!1))},[]);let Y=E(e?`${e}:${t??``}`:null,[f,G]),X=(0,I.useCallback)(async e=>{let n=`.agents/agents/${e.id}/AGENT.md`;if(!(!t||S.has(n)))try{if(e.gitHubRepo&&e.gitHubFolder)await c(t,e.gitHubRepo,e.gitHubFolder,`.agents/agents/${e.id}`);else{let r=[`---`,`name: ${e.id}`,`description: ${e.description}`];e.tools&&r.push(`tools: ${e.tools}`),r.push(`---`,``,e.systemPrompt),await v(t,n,r.join(`
2
2
  `))}w(e=>new Set(e).add(n)),B(),j(),C({title:`Agent installed`,description:e.name})}catch(e){C({title:`Error`,description:e instanceof Error?e.message:`Failed to install agent`,variant:`destructive`})}},[t,S,B,j]),Z=q.trim()?U.filter(e=>e.name.toLowerCase().includes(q.toLowerCase())||e.description.toLowerCase().includes(q.toLowerCase())):U;return e?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(y,{loading:Y,children:[(0,L.jsxs)(m,{className:`shrink-0`,children:[(0,L.jsx)(_,{title:`Installed Subagents`,description:`Specialized agents for focused tasks in this project.`,action:(0,L.jsx)(s,{onClick:()=>H(!0),disabled:!t,children:`Add Subagent`}),sticky:!1}),(0,L.jsxs)(d,{className:`pt-6`,children:[!t&&(0,L.jsx)(h,{children:`Select a thread to add or install subagents.`}),(0,L.jsx)(A,{showHeader:!1,compact:!0,loading:!1,items:a,emptyState:{icon:r,title:`No subagents installed`,description:`Add subagents for specialized, focused tasks.`,bordered:!1},getKey:e=>e.id,renderContent:e=>(0,L.jsx)(`span`,{className:i(n.body,`truncate text-left`),children:e.name}),onItemClick:e=>N(e.path),itemClickLabel:e=>`Open ${e.name} in Files`,onDelete:g,deleteAriaLabel:e=>`Delete ${e.name}`,deleteTooltip:`Remove this subagent from the project`})]})]}),(0,L.jsxs)(m,{className:`shrink-0`,children:[(0,L.jsx)(_,{title:`Available Subagents`,description:`Browse and install subagents from the catalog.`,action:(0,L.jsx)(k,{placeholder:`Search`,value:q,onChange:J,className:`mb-0 w-64`}),sticky:!1}),(0,L.jsx)(d,{className:`pt-6`,children:Z.length===0?(0,L.jsx)(D,{searchQuery:q,emptyLabel:`No available subagents found.`}):(0,L.jsx)(O,{children:Z.map(e=>{let t=`.agents/agents/${e.id}/AGENT.md`,n=S.has(t);return(0,L.jsx)(P,{className:`bg-background hover:bg-background`,name:e.name,description:e.description,installed:n,onClick:()=>{n||X(e)},showInstalledControls:!1},e.id)})})})]})]}),(0,L.jsx)(u,{open:V,onOpenChange:H,children:(0,L.jsx)(o,{className:`max-w-2xl max-h-[90vh] overflow-y-auto p-0`,children:(0,L.jsx)(R,{threadId:t,onAgentCreated:()=>{H(!1),j(),B()}})})}),(0,L.jsx)(T,{open:p!==null,onOpenChange:e=>!e&&g(null),title:`Delete Subagent`,description:`Are you sure you want to delete the subagent "${p?.name}"? This action cannot be undone.`,onConfirm:()=>{p&&M(p)},confirming:b})]}):(0,L.jsx)(x,{children:`Select a project to manage subagents.`})}export{B as SettingsSubagentsView,B as default};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Di as t,Rr as n,i as r,ki as i,yt as a}from"./interactive-BrHVRHmQ.js";import{Ct as ee,Eo as o,Pr as s,St as c,Ti as l,Tt as u,at as d,dt as f,fr as p,ot as m,rt as h,ut as g}from"./onboarding-DVc9-yKJ.js";import{r as _}from"./store-B_cK-gsT.js";import{t as v}from"./use-toast-hxHsVv6a.js";import{a as y,c as b,i as x,n as S,o as C,r as w,s as T,t as E}from"./alert-dialog-B6An1LDY.js";import{U as D,ft as O}from"./index-B0xy4BkI.js";import{t as k}from"./use-settings-page-loading-BU2CDnfE.js";var A=e(i(),1),j=t();function M(){let e=_(e=>e.selectedProjectId),[t,i]=(0,A.useState)(``),[M,N]=(0,A.useState)(``),[P,F]=(0,A.useState)(!0),[I,L]=(0,A.useState)(!1),[R,z]=(0,A.useState)(``),[B,V]=(0,A.useState)(!0),[H,U]=(0,A.useState)(!1),[W,G]=(0,A.useState)(!1);(0,A.useLayoutEffect)(()=>{e&&V(!0)},[e]),(0,A.useEffect)(()=>{if(!e){V(!1);return}V(!0),p(e).then(e=>{let t=e.useCustomSystemPrompt;i(e.generatedPrompt),L(t),z(e.customSystemPrompt),F(!t),N(t?e.customSystemPrompt:e.generatedPrompt)}).catch(()=>{i(``),N(``),F(!0),L(!1),z(``)}).finally(()=>V(!1))},[e]);let K=k(e,[B]);function q(){return P?I:M.trim()!==R.trim()}function J(e){N(e),P&&F(!1)}function Y(){N(t),F(!0)}function X(e){if(!e){F(!1);return}if(M===t){Y();return}G(!0)}function Z(){Y(),G(!1)}function Q(){G(!1)}async function $(){if(e){if(!P&&!M.trim()){v({title:`System prompt required`,description:`Enter a system prompt or enable Generated.`,variant:`destructive`});return}U(!0);try{await l(e,{customSystemPrompt:P?null:M.trim(),useCustomSystemPrompt:!P}),s(),L(!P),z(P?``:M.trim()),v({title:`System prompt settings saved`})}catch(e){v({title:`Error`,description:e instanceof Error?e.message:`Failed to save system prompt settings`,variant:`destructive`})}finally{U(!1)}}}return e?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(m,{loading:K,children:(0,j.jsx)(d,{children:(0,j.jsxs)(f,{className:`w-full flex-1 flex flex-col min-h-0 pt-0`,children:[(0,j.jsx)(h,{title:`System Prompt`,description:`View the default system prompt or override it for this project.`,sticky:!1,action:(0,j.jsx)(o,{onClick:$,disabled:H||!q(),children:H?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(a,{className:`mr-2 h-4 w-4 animate-spin`}),`Saving...`]}):`Save`})}),(0,j.jsxs)(`div`,{className:`mb-4 flex w-full items-center justify-end gap-2`,children:[(0,j.jsxs)(c,{children:[(0,j.jsx)(u,{asChild:!0,children:(0,j.jsx)(`span`,{tabIndex:0,className:r(n.label,`cursor-help`),children:`Generated`})}),(0,j.jsx)(ee,{side:`top`,className:`max-w-xs`,children:`Use the auto-generated system prompt instead of a custom override.`})]}),(0,j.jsx)(O,{value:P,onChange:X,disabled:H,ariaLabel:`Generated system prompt`})]}),(0,j.jsx)(D,{value:M,onChange:e=>J(e.target.value),className:r(n.mono,`flex-1 min-h-0 resize-none`),placeholder:`System prompt will appear here...`,disabled:H})]})})}),(0,j.jsx)(E,{open:W,onOpenChange:G,children:(0,j.jsxs)(x,{children:[(0,j.jsxs)(T,{children:[(0,j.jsx)(b,{children:`Overwrite custom system prompt?`}),(0,j.jsx)(y,{children:`This will replace your custom system prompt with the generated default. You can save the change after confirming.`})]}),(0,j.jsxs)(C,{children:[(0,j.jsx)(w,{onClick:Q,children:`No`}),(0,j.jsx)(S,{onClick:Z,children:`Yes`})]})]})})]}):(0,j.jsx)(g,{children:`Select a project to edit the system prompt.`})}export{M as SettingsSystemPromptView,M as default};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Di as t,Rr as n,i as r,ki as i,yt as a}from"./interactive-BrHVRHmQ.js";import{Ct as ee,Eo as o,Pr as s,St as c,Ti as l,Tt as u,at as d,dt as f,fr as p,ot as m,rt as h,ut as g}from"./onboarding-KBcwP-kU.js";import{r as _}from"./store-B_cK-gsT.js";import{t as v}from"./use-toast-hxHsVv6a.js";import{a as y,c as b,i as x,n as S,o as C,r as w,s as T,t as E}from"./alert-dialog-CLYxQdrK.js";import{U as D,ft as O}from"./index-CJCQ4bTo.js";import{t as k}from"./use-settings-page-loading-BU2CDnfE.js";var A=e(i(),1),j=t();function M(){let e=_(e=>e.selectedProjectId),[t,i]=(0,A.useState)(``),[M,N]=(0,A.useState)(``),[P,F]=(0,A.useState)(!0),[I,L]=(0,A.useState)(!1),[R,z]=(0,A.useState)(``),[B,V]=(0,A.useState)(!0),[H,U]=(0,A.useState)(!1),[W,G]=(0,A.useState)(!1);(0,A.useLayoutEffect)(()=>{e&&V(!0)},[e]),(0,A.useEffect)(()=>{if(!e){V(!1);return}V(!0),p(e).then(e=>{let t=e.useCustomSystemPrompt;i(e.generatedPrompt),L(t),z(e.customSystemPrompt),F(!t),N(t?e.customSystemPrompt:e.generatedPrompt)}).catch(()=>{i(``),N(``),F(!0),L(!1),z(``)}).finally(()=>V(!1))},[e]);let K=k(e,[B]);function q(){return P?I:M.trim()!==R.trim()}function J(e){N(e),P&&F(!1)}function Y(){N(t),F(!0)}function X(e){if(!e){F(!1);return}if(M===t){Y();return}G(!0)}function Z(){Y(),G(!1)}function Q(){G(!1)}async function $(){if(e){if(!P&&!M.trim()){v({title:`System prompt required`,description:`Enter a system prompt or enable Generated.`,variant:`destructive`});return}U(!0);try{await l(e,{customSystemPrompt:P?null:M.trim(),useCustomSystemPrompt:!P}),s(),L(!P),z(P?``:M.trim()),v({title:`System prompt settings saved`})}catch(e){v({title:`Error`,description:e instanceof Error?e.message:`Failed to save system prompt settings`,variant:`destructive`})}finally{U(!1)}}}return e?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(m,{loading:K,children:(0,j.jsx)(d,{children:(0,j.jsxs)(f,{className:`w-full flex-1 flex flex-col min-h-0 pt-0`,children:[(0,j.jsx)(h,{title:`System Prompt`,description:`View the default system prompt or override it for this project.`,sticky:!1,action:(0,j.jsx)(o,{onClick:$,disabled:H||!q(),children:H?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(a,{className:`mr-2 h-4 w-4 animate-spin`}),`Saving...`]}):`Save`})}),(0,j.jsxs)(`div`,{className:`mb-4 flex w-full items-center justify-end gap-2`,children:[(0,j.jsxs)(c,{children:[(0,j.jsx)(u,{asChild:!0,children:(0,j.jsx)(`span`,{tabIndex:0,className:r(n.label,`cursor-help`),children:`Generated`})}),(0,j.jsx)(ee,{side:`top`,className:`max-w-xs`,children:`Use the auto-generated system prompt instead of a custom override.`})]}),(0,j.jsx)(O,{value:P,onChange:X,disabled:H,ariaLabel:`Generated system prompt`})]}),(0,j.jsx)(D,{value:M,onChange:e=>J(e.target.value),className:r(n.mono,`flex-1 min-h-0 resize-none`),placeholder:`System prompt will appear here...`,disabled:H})]})})}),(0,j.jsx)(E,{open:W,onOpenChange:G,children:(0,j.jsxs)(x,{children:[(0,j.jsxs)(T,{children:[(0,j.jsx)(b,{children:`Overwrite custom system prompt?`}),(0,j.jsx)(y,{children:`This will replace your custom system prompt with the generated default. You can save the change after confirming.`})]}),(0,j.jsxs)(C,{children:[(0,j.jsx)(w,{onClick:Q,children:`No`}),(0,j.jsx)(S,{onClick:Z,children:`Yes`})]})]})})]}):(0,j.jsx)(g,{children:`Select a project to edit the system prompt.`})}export{M as SettingsSystemPromptView,M as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-general-view-DT4nElcL.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-B0xy4BkI.js","assets/monaco-D1hpqXQ0.js","assets/monaco-BQve5vfS.css","assets/onboarding-DVc9-yKJ.js","assets/interactive-BrHVRHmQ.js","assets/alert-dialog-B6An1LDY.js","assets/react-vendor-B7jFrulV.js","assets/use-toast-hxHsVv6a.js","assets/chat-dock-context-DyKjqpND.js","assets/store-B_cK-gsT.js","assets/explorer-tab-context-BdjTEbFh.js","assets/main-tab-context-zQSuRQQG.js","assets/use-suspense-resource-CExc4Svq.js","assets/thread-tool-blocks-D9HUkPHB.js","assets/ndjson-stream-DeGpE5o5.js","assets/utils-SsF94Pkg.js","assets/index-Cndc50ux.css","assets/use-settings-page-loading-BU2CDnfE.js","assets/is-macos-client-BIb4ZSEa.js","assets/project-settings-view-CPTd5lEi.js","assets/commit-method-fields-Dijc502F.js","assets/context-menu-C51M1WGZ.js","assets/project-env-vars-view-BQwUd7y6.js","assets/project-model-aliases-view-CobSp09z.js","assets/project-tools-view-DShQghoz.js","assets/providers-list-view-Da9VMcuP.js","assets/model-list-controls-Dw98tMn7.js","assets/async-error-boundary-Rf-s2_Ez.js","assets/card-BDQUHsPD.js","assets/settings-list-B9wyVzKw.js","assets/skeleton-CJSNEi3C.js","assets/use-deferred-search-0sV7mSzX.js","assets/settings-models-view-DFwkVdt3.js","assets/table-Cb2C1rQy.js","assets/settings-mcp-servers-view-BTUWHB5K.js","assets/delete-confirm-dialog-uTSX_x-i.js","assets/settings-slack-view-D4mrQ9C9.js","assets/settings-logs-view-CyaGqUKH.js","assets/settings-skills-view-BFoO9oZk.js","assets/mcp-server-card-DOsP-SQ8.js","assets/use-installed-ai-files-DmLnugpj.js","assets/settings-rules-view-BhA9tjVh.js","assets/settings-slash-commands-view-BLKPDUVG.js","assets/settings-subagents-view-BjMz2Ri_.js","assets/settings-instructions-view-Bsr8wRMf.js","assets/settings-system-prompt-view-DNh1yqZh.js","assets/account-view-BlK6g38q.js","assets/conversation-history-view-w_6Jd3d-.js","assets/settings-storage-view-LaiAi5gv.js","assets/settings-statistics-view-fa6iBiP8.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{At as t,C as n,Cn as r,Di as i,En as a,I as o,Oi as s,R as c,Rr as l,S as u,Tn as d,V as f,c as p,f as m,g as h,h as g,i as _,it as v,k as y,ki as b,kt as x,m as S,p as C,tr as w,un as T,vt as E,wn as D}from"./interactive-BrHVRHmQ.js";import{Gt as O,Ut as k,Wt as A}from"./react-vendor-B7jFrulV.js";import{Ct as j,Eo as M,F as N,I as P,L as F,M as I,N as L,Oo as R,P as z,Pr as B,R as V,S as H,St as ee,Tt as te,Xr as ne,bt as U,f as W,ht as re,ko as G,mr as ie,ut as ae,wt as oe,x as se}from"./onboarding-DVc9-yKJ.js";import{l as K}from"./monaco-D1hpqXQ0.js";import{J as ce,n as le,r as q}from"./store-B_cK-gsT.js";import{A as ue,Jt as de,M as fe,N as pe,c as me,l as he,s as J,u as ge}from"./index-B0xy4BkI.js";import{t as _e}from"./skeleton-CJSNEi3C.js";var Y=s(),X=e(b(),1),Z=i(),ve=(0,X.forwardRef)(function(e,t){let n=(0,Y.c)(29),{sidebar:r,children:i,defaultSidebarSize:a,minSidebarSize:o,maxSidebarSize:s,minContentSize:c,collapsible:l,collapsedSize:u,className:d,onCollapse:f,onExpand:p,isMobile:m,mobileShowSidebar:h,sidebarClassName:g}=e,v=a===void 0?25:a,y=o===void 0?20:o,b=s===void 0?30:s,x=c===void 0?40:c,S=l===void 0?!1:l,C=u===void 0?0:u,w=d===void 0?``:d,T=m===void 0?!1:m,E=h===void 0?!0:h,D=T&&!E,O=T&&E,k=`h-full ${w}`,A=T?100:v,j=T?50:y,M=T?100:b,N=D&&`hidden`,P;n[0]!==g||n[1]!==N?(P=_(`border-r border-transparent`,N,g),n[0]=g,n[1]=N,n[2]=P):P=n[2];let F;n[3]!==C||n[4]!==S||n[5]!==f||n[6]!==p||n[7]!==t||n[8]!==r||n[9]!==A||n[10]!==j||n[11]!==M||n[12]!==P?(F=(0,Z.jsx)(he,{ref:t,defaultSize:A,minSize:j,maxSize:M,collapsible:S,collapsedSize:C,onCollapse:f,onExpand:p,className:P,children:r}),n[3]=C,n[4]=S,n[5]=f,n[6]=p,n[7]=t,n[8]=r,n[9]=A,n[10]=j,n[11]=M,n[12]=P,n[13]=F):F=n[13];let I;n[14]===T?I=n[15]:(I=!T&&(0,Z.jsx)(me,{withHandle:!0,className:`ml-[-10px]`}),n[14]=T,n[15]=I);let L=O&&`hidden`,R;n[16]===L?R=n[17]:(R=_(`overflow-hidden`,L),n[16]=L,n[17]=R);let z;n[18]!==i||n[19]!==x||n[20]!==R?(z=(0,Z.jsx)(he,{minSize:x,className:R,children:i}),n[18]=i,n[19]=x,n[20]=R,n[21]=z):z=n[21];let B;n[22]!==F||n[23]!==I||n[24]!==z?(B=(0,Z.jsxs)(ge,{direction:`horizontal`,className:`h-full`,children:[F,I,z]}),n[22]=F,n[23]=I,n[24]=z,n[25]=B):B=n[25];let V;return n[26]!==k||n[27]!==B?(V=(0,Z.jsx)(`div`,{className:k,children:B}),n[26]=k,n[27]=B,n[28]=V):V=n[28],V});function ye(e){let t=(0,Y.c)(5),{className:n}=e,r;t[0]===n?r=t[1]:(r=_(`h-4 w-4`,n),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`path`,{d:`M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.528 2.528 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.528 2.528 0 0 1-2.52-2.523 2.528 2.528 0 0 1 2.52-2.52h6.313A2.528 2.528 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z`}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,className:r,children:i}),t[3]=r,t[4]=a),a}var be=F,xe=P,Se=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(N,{className:a,...i,ref:t}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Se.displayName=N.displayName;var Ce=R(`fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500`,{variants:{side:{top:`inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,bottom:`inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,left:`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,right:`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`}},defaultVariants:{side:`right`}}),we=X.forwardRef((e,t)=>{let n=(0,Y.c)(15),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({side:o,className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s=o===void 0?`right`:o,c;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(Se,{}),n[5]=c):c=n[5];let l;n[6]!==i||n[7]!==s?(l=_(Ce({side:s}),i),n[6]=i,n[7]=s,n[8]=l):l=n[8];let u;n[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsxs)(I,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,Z.jsx)(m,{className:`h-4 w-4`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Close`})]}),n[9]=u):u=n[9];let d;return n[10]!==r||n[11]!==a||n[12]!==t||n[13]!==l?(d=(0,Z.jsxs)(xe,{children:[c,(0,Z.jsxs)(L,{ref:t,className:l,...a,children:[r,u]})]}),n[10]=r,n[11]=a,n[12]=t,n[13]=l,n[14]=d):d=n[14],d});we.displayName=L.displayName;var Te=e=>{let t=(0,Y.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=_(`flex flex-col space-y-2 text-center sm:text-left`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};Te.displayName=`SheetHeader`;var Ee=e=>{let t=(0,Y.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=_(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};Ee.displayName=`SheetFooter`;var De=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(l.dialogTitle,`text-foreground`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(V,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});De.displayName=V.displayName;var Oe=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(l.dialogDescription,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(z,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Oe.displayName=z.displayName;var ke=`sidebar:state`,Ae=3600*24*7,je=`16rem`,Me=`18rem`,Ne=`3rem`,Pe=X.createContext(null);function Q(){let e=X.useContext(Pe);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}var Fe=X.forwardRef((e,t)=>{let n=(0,Y.c)(37),r,i,a,o,s,c,l;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6],l=n[7]):({defaultOpen:l,open:a,onOpenChange:s,className:i,style:c,children:r,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c,n[7]=l);let u=l===void 0?!0:l,d=J(),[f,p]=X.useState(!1),[m,h]=X.useState(u),g=a??m,v;n[8]!==g||n[9]!==s?(v=e=>{let t=typeof e==`function`?e(g):e;s?s(t):h(t),document.cookie=`${ke}=${t}; path=/; max-age=${Ae}`},n[8]=g,n[9]=s,n[10]=v):v=n[10];let y=v,b;n[11]!==d||n[12]!==y?(b=()=>d?p(Ie):y(Le),n[11]=d,n[12]=y,n[13]=b):b=n[13];let x=b,S,C;n[14]===x?(S=n[15],C=n[16]):(S=()=>{let e=e=>{e.key===`b`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),x())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},C=[x],n[14]=x,n[15]=S,n[16]=C),X.useEffect(S,C);let w=g?`expanded`:`collapsed`,T;n[17]!==d||n[18]!==g||n[19]!==f||n[20]!==y||n[21]!==w||n[22]!==x?(T={state:w,open:g,setOpen:y,isMobile:d,openMobile:f,setOpenMobile:p,toggleSidebar:x},n[17]=d,n[18]=g,n[19]=f,n[20]=y,n[21]=w,n[22]=x,n[23]=T):T=n[23];let E=T,D;n[24]===c?D=n[25]:(D={"--sidebar-width":je,"--sidebar-width-icon":Ne,...c},n[24]=c,n[25]=D);let O=D,k;n[26]===i?k=n[27]:(k=_(`group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar`,i),n[26]=i,n[27]=k);let A;n[28]!==r||n[29]!==o||n[30]!==t||n[31]!==O||n[32]!==k?(A=(0,Z.jsx)(oe,{delayDuration:0,children:(0,Z.jsx)(`div`,{style:O,className:k,ref:t,...o,children:r})}),n[28]=r,n[29]=o,n[30]=t,n[31]=O,n[32]=k,n[33]=A):A=n[33];let j;return n[34]!==E||n[35]!==A?(j=(0,Z.jsx)(Pe.Provider,{value:E,children:A}),n[34]=E,n[35]=A,n[36]=j):j=n[36],j});Fe.displayName=`SidebarProvider`;function Ie(e){return!e}function Le(e){return!e}var Re=X.forwardRef((e,t)=>{let n=(0,Y.c)(47),r,i,a,o,s,c;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6]):({side:o,variant:s,collapsible:c,className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c);let l=o===void 0?`left`:o,u=s===void 0?`sidebar`:s,d=c===void 0?`offcanvas`:c,{isMobile:f,state:p,openMobile:m,setOpenMobile:h}=Q();if(d===`none`){let e;n[7]===i?e=n[8]:(e=_(`flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground`,i),n[7]=i,n[8]=e);let o;return n[9]!==r||n[10]!==a||n[11]!==t||n[12]!==e?(o=(0,Z.jsx)(`div`,{className:e,ref:t,...a,children:r}),n[9]=r,n[10]=a,n[11]=t,n[12]=e,n[13]=o):o=n[13],o}if(f){let e;n[14]===Symbol.for(`react.memo_cache_sentinel`)?(e={"--sidebar-width":Me},n[14]=e):e=n[14];let t;n[15]===r?t=n[16]:(t=(0,Z.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:r}),n[15]=r,n[16]=t);let i;n[17]!==l||n[18]!==t?(i=(0,Z.jsx)(we,{"data-sidebar":`sidebar`,"data-mobile":`true`,className:`w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:e,side:l,children:t}),n[17]=l,n[18]=t,n[19]=i):i=n[19];let o;return n[20]!==m||n[21]!==a||n[22]!==h||n[23]!==i?(o=(0,Z.jsx)(be,{open:m,onOpenChange:h,...a,children:i}),n[20]=m,n[21]=a,n[22]=h,n[23]=i,n[24]=o):o=n[24],o}let g=p===`collapsed`?d:``,v=u===`floating`||u===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]`:`group-data-[collapsible=icon]:w-[--sidebar-width-icon]`,y;n[25]===v?y=n[26]:(y=_(`relative h-svh w-[--sidebar-width] bg-transparent`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,v),n[25]=v,n[26]=y);let b;n[27]===y?b=n[28]:(b=(0,Z.jsx)(`div`,{className:y}),n[27]=y,n[28]=b);let x=l===`left`?`left-0`:`right-0`,S=u===`floating`||u===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]`:`group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l`,C;n[29]!==i||n[30]!==x||n[31]!==S?(C=_(`fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] md:flex`,x,`group-data-[collapsible=offcanvas]:hidden`,S,i),n[29]=i,n[30]=x,n[31]=S,n[32]=C):C=n[32];let w;n[33]===r?w=n[34]:(w=(0,Z.jsx)(`div`,{"data-sidebar":`sidebar`,className:`flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow`,children:r}),n[33]=r,n[34]=w);let T;n[35]!==a||n[36]!==C||n[37]!==w?(T=(0,Z.jsx)(`div`,{className:C,...a,children:w}),n[35]=a,n[36]=C,n[37]=w,n[38]=T):T=n[38];let E;return n[39]!==t||n[40]!==l||n[41]!==p||n[42]!==T||n[43]!==g||n[44]!==b||n[45]!==u?(E=(0,Z.jsxs)(`div`,{ref:t,className:`group peer hidden md:block text-sidebar-foreground`,"data-state":p,"data-collapsible":g,"data-variant":u,"data-side":l,children:[b,T]}),n[39]=t,n[40]=l,n[41]=p,n[42]=T,n[43]=g,n[44]=b,n[45]=u,n[46]=E):E=n[46],E});Re.displayName=`Sidebar`;var ze=X.forwardRef((e,t)=>{let n=(0,Y.c)(16),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,onClick:i,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let{toggleSidebar:o}=Q(),s;n[4]===r?s=n[5]:(s=_(`h-7 w-7`,r),n[4]=r,n[5]=s);let c;n[6]!==i||n[7]!==o?(c=e=>{i?.(e),o()},n[6]=i,n[7]=o,n[8]=c):c=n[8];let l,u;n[9]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(v,{}),u=(0,Z.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`}),n[9]=l,n[10]=u):(l=n[9],u=n[10]);let d;return n[11]!==a||n[12]!==t||n[13]!==s||n[14]!==c?(d=(0,Z.jsxs)(M,{ref:t,"data-sidebar":`trigger`,variant:`ghost`,size:`icon`,className:s,onClick:c,...a,children:[l,u]}),n[11]=a,n[12]=t,n[13]=s,n[14]=c,n[15]=d):d=n[15],d});ze.displayName=`SidebarTrigger`;var Be=X.forwardRef((e,t)=>{let n=(0,Y.c)(13),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let{toggleSidebar:a}=Q(),o;n[3]===r?o=n[4]:(o=_(`absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex`,`[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,r),n[3]=r,n[4]=o);let s;n[5]!==i||n[6]!==t||n[7]!==o||n[8]!==a?(s=(0,Z.jsx)(te,{asChild:!0,children:(0,Z.jsx)(`button`,{ref:t,"data-sidebar":`rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onClick:a,className:o,...i})}),n[5]=i,n[6]=t,n[7]=o,n[8]=a,n[9]=s):s=n[9];let c;n[10]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(j,{children:`Toggle Sidebar`}),n[10]=c):c=n[10];let l;return n[11]===s?l=n[12]:(l=(0,Z.jsxs)(ee,{children:[s,c]}),n[11]=s,n[12]=l),l});Be.displayName=`SidebarRail`;var Ve=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`relative flex min-h-svh flex-1 flex-col bg-background`,`peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`main`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Ve.displayName=`SidebarInset`;var He=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(se,{ref:t,"data-sidebar":`input`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});He.displayName=`SidebarInput`;var Ue=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`flex flex-col gap-2 p-2`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`div`,{ref:t,"data-sidebar":`header`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Ue.displayName=`SidebarHeader`;var We=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`flex flex-col gap-2 p-2`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`div`,{ref:t,"data-sidebar":`footer`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});We.displayName=`SidebarFooter`;var Ge=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`mx-2 w-auto bg-divider`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(H,{ref:t,"data-sidebar":`separator`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Ge.displayName=`SidebarSeparator`;var Ke=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`div`,{ref:t,"data-sidebar":`content`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Ke.displayName=`SidebarContent`;var qe=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`relative flex w-full min-w-0 flex-col p-2`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`div`,{ref:t,"data-sidebar":`group`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});qe.displayName=`SidebarGroup`;var Je=X.forwardRef((e,t)=>{let n=(0,Y.c)(11),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,asChild:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=a!==void 0&&a?G:`div`,s;n[4]===r?s=n[5]:(s=_(`duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-base font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0`,r),n[4]=r,n[5]=s);let c;return n[6]!==o||n[7]!==i||n[8]!==t||n[9]!==s?(c=(0,Z.jsx)(o,{ref:t,"data-sidebar":`group-label`,className:s,...i}),n[6]=o,n[7]=i,n[8]=t,n[9]=s,n[10]=c):c=n[10],c});Je.displayName=`SidebarGroupLabel`;var Ye=X.forwardRef((e,t)=>{let n=(0,Y.c)(11),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,asChild:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=a!==void 0&&a?G:`button`,s;n[4]===r?s=n[5]:(s=_(`absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`group-data-[collapsible=icon]:hidden`,r),n[4]=r,n[5]=s);let c;return n[6]!==o||n[7]!==i||n[8]!==t||n[9]!==s?(c=(0,Z.jsx)(o,{ref:t,"data-sidebar":`group-action`,className:s,...i}),n[6]=o,n[7]=i,n[8]=t,n[9]=s,n[10]=c):c=n[10],c});Ye.displayName=`SidebarGroupAction`;var Xe=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`w-full`,l.compact,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`div`,{ref:t,"data-sidebar":`group-content`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Xe.displayName=`SidebarGroupContent`;var Ze=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`flex w-full min-w-0 flex-col gap-1`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`ul`,{ref:t,"data-sidebar":`menu`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Ze.displayName=`SidebarMenu`;var Qe=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`group/menu-item relative`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`li`,{ref:t,"data-sidebar":`menu-item`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Qe.displayName=`SidebarMenuItem`;var $e=R(`peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left ${l.compact} outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8`,sm:`h-7`,lg:`h-12 group-data-[collapsible=icon]:!p-0`}},defaultVariants:{variant:`default`,size:`default`}}),et=X.forwardRef((e,t)=>{let n=(0,Y.c)(29),r,i,a,o,s,c,l;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6],l=n[7]):({asChild:a,isActive:o,variant:s,size:c,tooltip:l,className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c,n[7]=l);let u=a===void 0?!1:a,d=o===void 0?!1:o,f=s===void 0?`default`:s,p=c===void 0?`default`:c,m=u?G:`button`,{isMobile:h,state:g}=Q(),v;n[8]!==r||n[9]!==p||n[10]!==f?(v=_($e({variant:f,size:p}),r),n[8]=r,n[9]=p,n[10]=f,n[11]=v):v=n[11];let y;n[12]!==m||n[13]!==d||n[14]!==i||n[15]!==t||n[16]!==p||n[17]!==v?(y=(0,Z.jsx)(m,{ref:t,"data-sidebar":`menu-button`,"data-size":p,"data-active":d,className:v,...i}),n[12]=m,n[13]=d,n[14]=i,n[15]=t,n[16]=p,n[17]=v,n[18]=y):y=n[18];let b=y;if(!l)return b;if(typeof l==`string`){let e;n[19]===l?e=n[20]:(e={children:l},n[19]=l,n[20]=e),l=e}let x;n[21]===b?x=n[22]:(x=(0,Z.jsx)(te,{asChild:!0,children:b}),n[21]=b,n[22]=x);let S=g!==`collapsed`||h,C;n[23]!==S||n[24]!==l?(C=(0,Z.jsx)(j,{side:`right`,align:`center`,hidden:S,...l}),n[23]=S,n[24]=l,n[25]=C):C=n[25];let w;return n[26]!==x||n[27]!==C?(w=(0,Z.jsxs)(ee,{children:[x,C]}),n[26]=x,n[27]=C,n[28]=w):w=n[28],w});et.displayName=`SidebarMenuButton`;var tt=X.forwardRef((e,t)=>{let n=(0,Y.c)(13),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({className:r,asChild:a,showOnHover:o,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s=a===void 0?!1:a,c=o===void 0?!1:o,l=s?G:`button`,u=c&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0`,d;n[5]!==r||n[6]!==u?(d=_(`absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,u,r),n[5]=r,n[6]=u,n[7]=d):d=n[7];let f;return n[8]!==l||n[9]!==i||n[10]!==t||n[11]!==d?(f=(0,Z.jsx)(l,{ref:t,"data-sidebar":`menu-action`,className:d,...i}),n[8]=l,n[9]=i,n[10]=t,n[11]=d,n[12]=f):f=n[12],f});tt.displayName=`SidebarMenuAction`;var nt=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none`,`peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`div`,{ref:t,"data-sidebar":`menu-badge`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});nt.displayName=`SidebarMenuBadge`;var rt=X.forwardRef((e,t)=>{let n=(0,Y.c)(15),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,showIcon:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=a===void 0?!1:a,s=`${Math.floor(Math.random()*40)+50}%`,c;n[4]===r?c=n[5]:(c=_(`rounded-md h-8 flex gap-2 px-2 items-center`,r),n[4]=r,n[5]=c);let l;n[6]===o?l=n[7]:(l=o&&(0,Z.jsx)(_e,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),n[6]=o,n[7]=l);let u;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(u={"--skeleton-width":s},n[8]=u):u=n[8];let d;n[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(_e,{className:`h-4 flex-1 max-w-[--skeleton-width]`,"data-sidebar":`menu-skeleton-text`,style:u}),n[9]=d):d=n[9];let f;return n[10]!==i||n[11]!==t||n[12]!==c||n[13]!==l?(f=(0,Z.jsxs)(`div`,{ref:t,"data-sidebar":`menu-skeleton`,className:c,...i,children:[l,d]}),n[10]=i,n[11]=t,n[12]=c,n[13]=l,n[14]=f):f=n[14],f});rt.displayName=`SidebarMenuSkeleton`;var it=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5`,`group-data-[collapsible=icon]:hidden`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`ul`,{ref:t,"data-sidebar":`menu-sub`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});it.displayName=`SidebarMenuSub`;var at=X.forwardRef((e,t)=>{let n=(0,Y.c)(5),r;n[0]===e?r=n[1]:({...r}=e,n[0]=e,n[1]=r);let i;return n[2]!==r||n[3]!==t?(i=(0,Z.jsx)(`li`,{ref:t,...r}),n[2]=r,n[3]=t,n[4]=i):i=n[4],i});at.displayName=`SidebarMenuSubItem`;var ot=X.forwardRef((e,t)=>{let n=(0,Y.c)(17),r,i,a,o,s;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5]):({asChild:o,size:s,isActive:i,className:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s);let c=o===void 0?!1:o,u=s===void 0?`md`:s,d=c?G:`a`,f=u===`sm`&&l.compact,p=u===`md`&&l.compact,m;n[6]!==r||n[7]!==f||n[8]!==p?(m=_(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,`data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground`,f,p,`group-data-[collapsible=icon]:hidden`,r),n[6]=r,n[7]=f,n[8]=p,n[9]=m):m=n[9];let h;return n[10]!==d||n[11]!==i||n[12]!==a||n[13]!==t||n[14]!==u||n[15]!==m?(h=(0,Z.jsx)(d,{ref:t,"data-sidebar":`menu-sub-button`,"data-size":u,"data-active":i,className:m,...a}),n[10]=d,n[11]=i,n[12]=a,n[13]=t,n[14]=u,n[15]=m,n[16]=h):h=n[16],h});ot.displayName=`SidebarMenuSubButton`;var st=[{id:`skills`,label:`Skills`,icon:(0,Z.jsx)(S,{className:`h-4 w-4`}),route:`/settings/skills`},{id:`rules`,label:`Rules`,icon:(0,Z.jsx)(f,{className:`h-4 w-4`}),route:`/settings/rules`},{id:`slash-commands`,label:`Slash Commands`,icon:(0,Z.jsx)(u,{className:`h-4 w-4`}),route:`/settings/slash-commands`},{id:`subagents`,label:`Subagents`,icon:(0,Z.jsx)(g,{className:`h-4 w-4`}),route:`/settings/subagents`},{id:`instructions`,label:`Instructions`,icon:(0,Z.jsx)(a,{className:`h-4 w-4`}),route:`/settings/instructions`},{id:`system-prompt`,label:`System Prompt`,icon:(0,Z.jsx)(y,{className:`h-4 w-4`}),route:`/settings/system-prompt`},{id:`mcp-servers`,label:`MCP Servers`,icon:(0,Z.jsx)(c,{className:`h-4 w-4`}),route:`/settings/mcp-servers`},{id:`general`,label:`Settings`,icon:(0,Z.jsx)(o,{className:`h-4 w-4`}),route:`/settings/general`},{id:`logs`,label:`Logs`,icon:(0,Z.jsx)(E,{className:`h-4 w-4`}),route:`/settings/logs`},{id:`slack`,label:`Slack`,icon:(0,Z.jsx)(ye,{}),route:`/settings/slack`},{id:`providers`,label:`Providers`,icon:(0,Z.jsx)(T,{className:`h-4 w-4`}),route:`/settings/providers`},{id:`models`,label:`Models`,icon:(0,Z.jsx)(D,{className:`h-4 w-4`}),route:`/settings/models`},{id:`statistics`,label:`Statistics`,icon:(0,Z.jsx)(r,{className:`h-4 w-4`}),route:`/settings/statistics`},{id:`history`,label:`History`,icon:(0,Z.jsx)(x,{className:`h-4 w-4`}),route:`/settings/history`},{id:`storage`,label:`Storage`,icon:(0,Z.jsx)(t,{className:`h-4 w-4`}),route:`/settings/storage`},{id:`account`,label:`Account`,icon:(0,Z.jsx)(h,{className:`h-4 w-4`}),route:`/settings/account`}],ct=new Set([`project`,`project-env-vars`,`project-model-aliases`,`project-tools`,`skills`,`rules`,`slash-commands`,`subagents`,`instructions`,`system-prompt`,`mcp-servers`]),lt=new Set([`project`,`instructions`,`project-env-vars`]),ut=new Set([`skills`,`rules`,`slash-commands`,`subagents`,`mcp-servers`]),dt=new Set([`system-prompt`,`project-model-aliases`,`project-tools`]),ft=new Set([`general`,`logs`,`slack`,`providers`,`models`,`statistics`,`history`,`storage`,`account`]);function pt(e){return ct.has(e)?`project`:`general`}function $(e){let t=(0,Y.c)(18),{label:n,items:r,activeTabId:i,onItemClick:a,showSeparator:o,className:s}=e,c=o===void 0?!0:o;if(r.length===0)return null;let l;t[0]===n?l=t[1]:(l=n?(0,Z.jsx)(Je,{children:n}):null,t[0]=n,t[1]=l);let u;if(t[2]!==i||t[3]!==r||t[4]!==a){let e;t[6]!==i||t[7]!==a?(e=e=>(0,Z.jsx)(W,{selected:i===e.id,asChild:!0,children:(0,Z.jsx)(`button`,{className:`justify-start`,onClick:()=>a(e),children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.icon,(0,Z.jsx)(`span`,{children:e.label})]})})},e.id),t[6]=i,t[7]=a,t[8]=e):e=t[8],u=r.map(e),t[2]=i,t[3]=r,t[4]=a,t[5]=u}else u=t[5];let d;t[9]===u?d=t[10]:(d=(0,Z.jsx)(`div`,{className:`space-y-1`,children:u}),t[9]=u,t[10]=d);let f;t[11]===c?f=t[12]:(f=c?(0,Z.jsx)(H,{className:`my-2`}):null,t[11]=c,t[12]=f);let p;return t[13]!==s||t[14]!==l||t[15]!==d||t[16]!==f?(p=(0,Z.jsxs)(`div`,{className:s,children:[l,d,f]}),t[13]=s,t[14]=l,t[15]=d,t[16]=f,t[17]=p):p=t[17],p}function mt(e){let t=[...st];if(!e)return t;let r=t.findIndex(e=>e.id===`skills`);t.splice(r,0,{id:`project`,label:`Settings`,icon:(0,Z.jsx)(o,{className:`h-4 w-4`}),route:`/settings/project/${e}`},{id:`project-env-vars`,label:`Environment Variables`,icon:(0,Z.jsx)(d,{className:`h-4 w-4`}),route:`/settings/project/${e}/env-vars`});let i=t.findIndex(e=>e.id===`instructions`),a=t.findIndex(e=>e.id===`project`);if(i!==-1&&a!==-1){let[e]=t.splice(i,1);t.splice(a+1,0,e)}let s=t.findIndex(e=>e.id===`system-prompt`),c=s===-1?null:t.splice(s,1)[0],l=t.findIndex(e=>e.id===`mcp-servers`);return l!==-1&&t.splice(l+1,0,...c?[c]:[],{id:`project-model-aliases`,label:`Model Aliases`,icon:(0,Z.jsx)(n,{className:`h-4 w-4`}),route:`/settings/project/${e}/model-aliases`},{id:`project-tools`,label:`Tools`,icon:(0,Z.jsx)(C,{className:`h-4 w-4`}),route:`/settings/project/${e}/tools`}),t}function ht(e){let t=(0,Y.c)(48),{className:n,selectedProjectId:r,settingsScope:i,onResetOnboarding:a,onNavItemSelect:o}=e,s=A(),c=k(),l=(0,X.useRef)(0),u=(0,X.useRef)(null),d,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>()=>{u.current&&clearTimeout(u.current)},f=[],t[0]=d,t[1]=f):(d=t[0],f=t[1]),(0,X.useEffect)(d,f);let p=J(),m;t[2]===r?m=t[3]:(m=mt(r),t[2]=r,t[3]=m);let h=m,g;t[4]!==p||t[5]!==h?(g=p?h.filter(St):h,t[4]=p,t[5]=h,t[6]=g):g=t[6];let v=g,y;t[7]!==c.pathname||t[8]!==v?(y=function(){let e=c.pathname;if(e.endsWith(`/tools`)&&e.startsWith(`/settings/project/`))return`project-tools`;if(e.endsWith(`/model-aliases`)&&e.startsWith(`/settings/project/`))return`project-model-aliases`;if(e.endsWith(`/env-vars`)&&e.startsWith(`/settings/project/`))return`project-env-vars`;if(e.startsWith(`/settings/project/`))return`project`;for(let t of v)if(e.startsWith(t.route))return t.id;return`general`}(),t[7]=c.pathname,t[8]=v,t[9]=y):y=t[9];let b=y,x,S,C,w,T,E,D,O,j;if(t[10]!==b||t[11]!==n||t[12]!==v||t[13]!==s||t[14]!==o||t[15]!==a||t[16]!==r||t[17]!==i){S=function(e){e.id===`general`&&a&&(u.current&&clearTimeout(u.current),l.current+=1,l.current>=3?(l.current=0,a()):u.current=setTimeout(()=>{l.current=0},1500)),o?.(),s(e.route)};let e=!!r;E=!e||i!==`project`,D=e&&i!==`general`;let c=v.filter(xt);T=c.filter(bt),w=c.filter(yt),C=c.filter(vt);let d;t[27]===v?d=t[28]:(d=v.filter(_t),t[27]=v,t[28]=d),x=d;let f=e?[]:c.filter(gt);t[29]===n?O=t[30]:(O=_(`space-y-1`,n),t[29]=n,t[30]=O),j=f.length>0?(0,Z.jsxs)(Z.Fragment,{children:[f.map(e=>(0,Z.jsx)(W,{selected:b===e.id,asChild:!0,children:(0,Z.jsx)(`button`,{className:`justify-start`,onClick:()=>S(e),children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.icon,(0,Z.jsx)(`span`,{children:e.label})]})})},e.id)),(0,Z.jsx)(H,{className:`my-2`})]}):null,t[10]=b,t[11]=n,t[12]=v,t[13]=s,t[14]=o,t[15]=a,t[16]=r,t[17]=i,t[18]=x,t[19]=S,t[20]=C,t[21]=w,t[22]=T,t[23]=E,t[24]=D,t[25]=O,t[26]=j}else x=t[18],S=t[19],C=t[20],w=t[21],T=t[22],E=t[23],D=t[24],O=t[25],j=t[26];let M;t[31]!==b||t[32]!==S||t[33]!==C||t[34]!==w||t[35]!==T||t[36]!==D?(M=D?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($,{label:`Project`,items:T,activeTabId:b,onItemClick:S,showSeparator:!1}),(0,Z.jsx)($,{label:`Customize`,items:w,activeTabId:b,onItemClick:S,showSeparator:!1,className:`pt-3`}),(0,Z.jsx)($,{label:`Advanced`,items:C,activeTabId:b,onItemClick:S,showSeparator:!1,className:`pt-3`})]}):null,t[31]=b,t[32]=S,t[33]=C,t[34]=w,t[35]=T,t[36]=D,t[37]=M):M=t[37];let N;t[38]!==b||t[39]!==x||t[40]!==S||t[41]!==E?(N=E?(0,Z.jsx)($,{items:x,activeTabId:b,onItemClick:S,showSeparator:!1}):null,t[38]=b,t[39]=x,t[40]=S,t[41]=E,t[42]=N):N=t[42];let P;return t[43]!==O||t[44]!==j||t[45]!==M||t[46]!==N?(P=(0,Z.jsxs)(`div`,{className:O,children:[j,M,N]}),t[43]=O,t[44]=j,t[45]=M,t[46]=N,t[47]=P):P=t[47],P}function gt(e){return e.id!==`project`}function _t(e){return ft.has(e.id)}function vt(e){return dt.has(e.id)}function yt(e){return ut.has(e.id)}function bt(e){return lt.has(e.id)}function xt(e){return ct.has(e.id)}function St(e){return e.id!==`account`}var Ct=w(`app.settings-view.ui`),wt=`h-8 rounded-full border-0 bg-muted/40 p-0.5`,Tt=`h-7 rounded-full px-4 data-[state=active]:bg-foreground data-[state=active]:text-background data-[state=active]:shadow-sm`,Et=`frosted-surface backdrop-blur-2xl`,Dt=(0,X.lazy)(()=>K(()=>import(`./settings-general-view-DT4nElcL.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),Ot=(0,X.lazy)(()=>K(()=>import(`./project-settings-view-CPTd5lEi.js`),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,22,23,19]))),kt=(0,X.lazy)(()=>K(()=>import(`./project-env-vars-view-BQwUd7y6.js`),__vite__mapDeps([24,1,5,6,9,19,8,3,4]))),At=(0,X.lazy)(()=>K(()=>import(`./project-model-aliases-view-CobSp09z.js`),__vite__mapDeps([25,1,5,6,9,19,8,3,4]))),jt=(0,X.lazy)(()=>K(()=>import(`./project-tools-view-DShQghoz.js`),__vite__mapDeps([26,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]))),Mt=(0,X.lazy)(()=>K(()=>import(`./providers-list-view-Da9VMcuP.js`),__vite__mapDeps([27,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,28,29,30,31,32,33]))),Nt=(0,X.lazy)(()=>K(()=>import(`./settings-models-view-DFwkVdt3.js`),__vite__mapDeps([34,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,22,28,29,30,31,32,35,33]))),Pt=(0,X.lazy)(()=>K(()=>import(`./settings-mcp-servers-view-BTUWHB5K.js`),__vite__mapDeps([36,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,37,31,30,32,19]))),Ft=(0,X.lazy)(()=>K(()=>import(`./settings-slack-view-D4mrQ9C9.js`),__vite__mapDeps([38,1,5,6,9]))),It=(0,X.lazy)(()=>K(()=>import(`./settings-logs-view-CyaGqUKH.js`),__vite__mapDeps([39,1,5,6,9,8,3,4]))),Lt=(0,X.lazy)(()=>K(()=>import(`./settings-skills-view-BFoO9oZk.js`),__vite__mapDeps([40,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,41,37,31,30,32,33,42,19]))),Rt=(0,X.lazy)(()=>K(()=>import(`./settings-rules-view-BhA9tjVh.js`),__vite__mapDeps([43,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,41,37,31,30,32,33,42,19]))),zt=(0,X.lazy)(()=>K(()=>import(`./settings-slash-commands-view-BLKPDUVG.js`),__vite__mapDeps([44,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,41,37,31,30,32,19]))),Bt=(0,X.lazy)(()=>K(()=>import(`./settings-subagents-view-BjMz2Ri_.js`),__vite__mapDeps([45,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,41,37,31,30,32,42,19]))),Vt=(0,X.lazy)(()=>K(()=>import(`./settings-instructions-view-Bsr8wRMf.js`),__vite__mapDeps([46,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]))),Ht=(0,X.lazy)(()=>K(()=>import(`./settings-system-prompt-view-DNh1yqZh.js`),__vite__mapDeps([47,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]))),Ut=(0,X.lazy)(()=>K(()=>import(`./account-view-BlK6g38q.js`),__vite__mapDeps([48,1,5,6,37,7,8,3,4,32,9,11]))),Wt=(0,X.lazy)(()=>K(()=>import(`./conversation-history-view-w_6Jd3d-.js`),__vite__mapDeps([49,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,37,35]))),Gt=(0,X.lazy)(()=>K(()=>import(`./settings-storage-view-LaiAi5gv.js`),__vite__mapDeps([50,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,37,31,30,32,35,20]))),Kt=(0,X.lazy)(()=>K(()=>import(`./settings-statistics-view-fa6iBiP8.js`),__vite__mapDeps([51,1,5,6,35]))),qt=[`general`,`providers`,`models`,`skills`,`rules`,`slash-commands`,`subagents`,`instructions`,`system-prompt`,`mcp-servers`,`slack`,`logs`,`statistics`,`history`,`storage`,`account`];function Jt(e){let t=(0,Y.c)(2),{title:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(ae,{title:n,children:`Content coming soon...`}),t[0]=n,t[1]=r),r}function Yt(e){return e.startsWith(`/settings/general`)?`general`:e.startsWith(`/settings/providers`)?`providers`:e.startsWith(`/settings/models`)?`models`:e.startsWith(`/settings/skills`)?`skills`:e.startsWith(`/settings/rules`)?`rules`:e.startsWith(`/settings/slash-commands`)?`slash-commands`:e.startsWith(`/settings/subagents`)?`subagents`:e.startsWith(`/settings/instructions`)?`instructions`:e.startsWith(`/settings/system-prompt`)?`system-prompt`:e.startsWith(`/settings/mcp-servers`)?`mcp-servers`:e.startsWith(`/settings/slack`)?`slack`:e.startsWith(`/settings/logs`)?`logs`:e.startsWith(`/settings/statistics`)?`statistics`:e.startsWith(`/settings/history`)?`history`:e.startsWith(`/settings/storage`)?`storage`:e.startsWith(`/settings/account`)?`account`:`general`}function Xt(e){let t=e.match(/^\/settings\/providers\/([^/]+)$/);return t?decodeURIComponent(t[1]):null}function Zt(e,t,n){return e&&qt.includes(e)?e:t&&qt.includes(t)?t:Yt(n)}function Qt(e,t,n,r,i){return e?`project-tools`:t?`project-model-aliases`:n?`project-env-vars`:r?`project`:i}function $t(e,t,n,r,i){return e?`Tools`:t?`Model Aliases`:n?`Environment Variables`:r?`Project`:st.find(e=>e.id===i)?.label??`Settings`}function en(e,t){return e===`/settings`||e===`/settings/project`||[`/settings/mcp-server-edit`,`/settings/add-skill`,`/settings/add-command`,`/settings/add-rule`,`/settings/add-agent`].some(t=>e.startsWith(t))||t&&e.startsWith(`/settings/account`)}function tn(e,t){let n=!!e&&t.startsWith(`/settings/project/`),r=n&&t.endsWith(`/tools`),i=n&&t.endsWith(`/model-aliases`),a=n&&t.endsWith(`/env-vars`);return{isProjectRoute:n,isProjectToolsRoute:r,isProjectModelAliasesRoute:i,isProjectEnvVarsRoute:a,isProjectSettingsRoute:n&&!a&&!i&&!r}}function nn(e,t){let n=(0,Y.c)(5),r;n[0]!==t||n[1]!==e?(r=()=>{let n=e.current;if(!n)return;let r=function(e){if(e.key!==`Escape`)return;let n=document.activeElement;if(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLElement&&n.isContentEditable){n.blur();return}t()};return n.addEventListener(`keydown`,r),()=>n.removeEventListener(`keydown`,r)},n[0]=t,n[1]=e,n[2]=r):r=n[2];let i;n[3]===t?i=n[4]:(i=[t],n[3]=t,n[4]=i),(0,X.useEffect)(r,i)}function rn(e){let t=(0,Y.c)(5),{selectedProjectId:n,settingsScope:r,onResetOnboarding:i,onNavItemSelect:a}=e,o=n?r:void 0,s;return t[0]!==a||t[1]!==i||t[2]!==n||t[3]!==o?(s=(0,Z.jsx)(`div`,{className:`flex h-full flex-col overflow-hidden p-2.5`,children:(0,Z.jsx)(re,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(`div`,{className:`py-2`,children:(0,Z.jsx)(ht,{selectedProjectId:n,settingsScope:o,onResetOnboarding:i,onNavItemSelect:a})})})}),t[0]=a,t[1]=i,t[2]=n,t[3]=o,t[4]=s):s=t[4],s}function an(e){let t=(0,Y.c)(21),{settingsHeaderTitle:n,isProjectSettingsScope:r,selectedProject:i,selectedProjectId:a,settingsScope:o,onScopeChange:s,onRequestClose:c}=e,u;t[0]!==r||t[1]!==i?(u=r&&i?(0,Z.jsx)(de,{project:i,elevated:!1,className:`h-7 w-7 shrink-0 rounded-md`,iconClassName:`h-3.5 w-3.5`}):(0,Z.jsx)(`div`,{className:`flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border shadow-sm`,children:(0,Z.jsx)(`img`,{src:`/tarsk.svg`,alt:`Tarsk`,className:`h-full w-full`})}),t[0]=r,t[1]=i,t[2]=u):u=t[2];let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=_(l.sectionTitle,`truncate`),t[3]=d):d=t[3];let f;t[4]===n?f=t[5]:(f=(0,Z.jsx)(`span`,{className:d,children:n}),t[4]=n,t[5]=f);let p;t[6]!==u||t[7]!==f?(p=(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 electrobun-webkit-app-region-no-drag`,children:[u,f]}),t[6]=u,t[7]=f,t[8]=p):p=t[8];let h;t[9]!==s||t[10]!==a||t[11]!==o?(h=a?(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-4 flex justify-center`,children:(0,Z.jsx)(ue,{value:o,onValueChange:e=>{(e===`project`||e===`general`)&&s(e)},className:`pointer-events-auto electrobun-webkit-app-region-no-drag`,children:(0,Z.jsxs)(fe,{className:wt,children:[(0,Z.jsx)(pe,{value:`project`,className:Tt,children:`Project`}),(0,Z.jsx)(pe,{value:`general`,className:Tt,children:`General`})]})})}):null,t[9]=s,t[10]=a,t[11]=o,t[12]=h):h=t[12];let g,v;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(m,{className:`h-4 w-4`}),v=(0,Z.jsx)(`span`,{className:`sr-only`,children:`Close`}),t[13]=g,t[14]=v):(g=t[13],v=t[14]);let y;t[15]===c?y=t[16]:(y=(0,Z.jsx)(`div`,{className:`ml-auto flex items-center gap-2 electrobun-webkit-app-region-no-drag`,children:(0,Z.jsxs)(M,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:c,children:[g,v]})}),t[15]=c,t[16]=y);let b;return t[17]!==p||t[18]!==h||t[19]!==y?(b=(0,Z.jsxs)(`div`,{className:`relative flex h-14 shrink-0 items-start px-4 pt-4 pb-2 electrobun-webkit-app-region-drag`,children:[p,h,y]}),t[17]=p,t[18]=h,t[19]=y,t[20]=b):b=t[20],b}function on(e){let t=(0,Y.c)(10),{isMobile:n,mobileShowSidebar:r,isProviderDetailRoute:i,activeSectionLabel:a,onShowSidebar:o}=e;if(!n||r||i)return null;let s,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(v,{className:`h-4 w-4`}),c=(0,Z.jsx)(`span`,{className:`sr-only`,children:`Show settings menu`}),t[0]=s,t[1]=c):(s=t[0],c=t[1]);let u;t[2]===o?u=t[3]:(u=(0,Z.jsxs)(M,{variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0 text-muted-foreground`,onClick:o,children:[s,c]}),t[2]=o,t[3]=u);let d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=_(l.sectionTitle,`truncate text-foreground`),t[4]=d):d=t[4];let f;t[5]===a?f=t[6]:(f=(0,Z.jsx)(`span`,{className:d,children:a}),t[5]=a,t[6]=f);let p;return t[7]!==u||t[8]!==f?(p=(0,Z.jsx)(`div`,{className:`px-6 pb-0 pt-6`,children:(0,Z.jsxs)(`div`,{className:`mb-4 flex min-w-0 items-center gap-2`,children:[u,f]})}),t[7]=u,t[8]=f,t[9]=p):p=t[9],p}function sn(e){let t=(0,Y.c)(19),{isProjectToolsRoute:n,isProjectModelAliasesRoute:r,isProjectEnvVarsRoute:i,isProjectSettingsRoute:a,projectId:o,activeTab:s,locationKey:c,onboardingResetSignal:l,handleProjectUpdated:u}=e;if(n&&o){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(U,{}),t[0]=e):e=t[0];let n;return t[1]!==u||t[2]!==o?(n=(0,Z.jsx)(X.Suspense,{fallback:e,children:(0,Z.jsx)(jt,{projectId:o,onProjectUpdated:u})}),t[1]=u,t[2]=o,t[3]=n):n=t[3],n}if(r&&o){let e;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(U,{}),t[4]=e):e=t[4];let n;return t[5]!==u||t[6]!==o?(n=(0,Z.jsx)(X.Suspense,{fallback:e,children:(0,Z.jsx)(At,{projectId:o,onProjectUpdated:u})}),t[5]=u,t[6]=o,t[7]=n):n=t[7],n}if(i&&o){let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(U,{}),t[8]=e):e=t[8];let n;return t[9]===o?n=t[10]:(n=(0,Z.jsx)(X.Suspense,{fallback:e,children:(0,Z.jsx)(kt,{projectId:o})}),t[9]=o,t[10]=n),n}if(a&&o){let e;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(U,{}),t[11]=e):e=t[11];let n;return t[12]!==u||t[13]!==o?(n=(0,Z.jsx)(X.Suspense,{fallback:e,children:(0,Z.jsx)(Ot,{projectId:o,onProjectUpdated:u})}),t[12]=u,t[13]=o,t[14]=n):n=t[14],n}let d;return t[15]!==s||t[16]!==c||t[17]!==l?(d=cn(s,c,l),t[15]=s,t[16]=c,t[17]=l,t[18]=d):d=t[18],d}function cn(e,t,n){return{general:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Dt,{onboardingResetSignal:n})}),providers:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{label:`Loading providers...`,size:`lg`}),children:(0,Z.jsx)(Mt,{})}),models:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{label:`Loading models...`,size:`lg`}),children:(0,Z.jsx)(Nt,{})}),skills:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Lt,{},t)}),rules:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Rt,{})}),"slash-commands":(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(zt,{})}),subagents:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Bt,{})}),instructions:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Vt,{})}),"system-prompt":(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Ht,{})}),"mcp-servers":(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Pt,{})}),slack:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Ft,{})}),logs:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(It,{})}),statistics:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Kt,{})}),history:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Wt,{})}),storage:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Gt,{})}),account:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Ut,{})})}[e]??(0,Z.jsx)(Jt,{title:`Settings`})}function ln({onRequestClose:e}){let{tab:t,projectId:n}=O(),r=A(),i=k(),a=le(),o=q(e=>e.selectedProjectId),s=q(e=>e.projects),{isProjectRoute:c,isProjectToolsRoute:l,isProjectModelAliasesRoute:u,isProjectEnvVarsRoute:d,isProjectSettingsRoute:f}=tn(n,i.pathname),m=Xt(i.pathname)!==null,h=Zt(new URLSearchParams(i.search).get(`tab`),t,i.pathname),g=J(),[v,y]=(0,X.useState)(!0),[b,x]=(0,X.useState)(0),S=(0,X.useRef)(null),C=(0,X.useRef)(null),w=Qt(l,u,d,c,h),[T,E]=(0,X.useState)(()=>pt(w));(0,X.useEffect)(()=>{E(pt(w))},[w]);let D=(0,X.useCallback)(e=>{if(E(e),e===`project`&&o){r(`/settings/project/${o}`);return}e===`general`&&r(`/settings/general`)},[r,o]),j=(0,X.useMemo)(()=>s.find(e=>e.projectId===o)??null,[s,o]),M=T===`project`&&j!==null,N=M?`${p(j)} Settings`:`General Settings`,P=(0,X.useMemo)(()=>$t(l,u,d,f,h),[h,d,u,f,l]),F=(0,X.useCallback)(()=>{g&&y(!1)},[g]),I=(0,X.useCallback)(()=>{y(!0)},[]),L=(0,X.useCallback)(async()=>{try{await ne(),x(e=>e+1)}catch(e){Ct.error(`Failed to reset onboarding:`,e)}},[]),R=(0,X.useCallback)(async()=>{B(n);try{let e=await ie();a({type:ce.SetProjects,projects:e.projects,cloneRootPath:e.cloneRootPath})}catch(e){throw Ct.error(`Failed to refresh projects after settings update:`,e),e}},[a,n]);return(0,X.useEffect)(()=>{en(i.pathname,g)&&r(`/settings/general`,{replace:!0})},[i.pathname,r,g]),nn(C,e),(0,Z.jsxs)(`div`,{ref:C,role:`dialog`,"aria-modal":`true`,"aria-label":`Settings`,className:_(`rounded-2xl border border-border shadow-lg`,Et,`flex h-full w-full flex-col overflow-hidden md:h-[95vh] md:w-[80vw] md:max-w-[1400px]`),children:[(0,Z.jsx)(an,{settingsHeaderTitle:N,isProjectSettingsScope:M,selectedProject:j,selectedProjectId:o,settingsScope:T,onScopeChange:D,onRequestClose:e}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(ve,{ref:S,collapsible:!0,isMobile:g,mobileShowSidebar:v,sidebarClassName:_(`overflow-hidden rounded-tr-2xl`,Et),sidebar:(0,Z.jsx)(rn,{selectedProjectId:o,settingsScope:T,onResetOnboarding:L,onNavItemSelect:F}),children:(0,Z.jsxs)(`div`,{className:_(`relative flex h-full min-h-0 flex-col overflow-hidden py-2.5 pl-2.5`,g?null:`ml-2.5`),children:[(0,Z.jsx)(on,{isMobile:g,mobileShowSidebar:v,isProviderDetailRoute:m,activeSectionLabel:P,onShowSidebar:I}),(0,Z.jsx)(sn,{isProjectToolsRoute:l,isProjectModelAliasesRoute:u,isProjectEnvVarsRoute:d,isProjectSettingsRoute:f,projectId:n,activeTab:h,locationKey:i.key,onboardingResetSignal:b,handleProjectUpdated:R})]})})})]})}export{ln as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-general-view-72s5xgPj.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-CJCQ4bTo.js","assets/monaco-D1hpqXQ0.js","assets/monaco-BQve5vfS.css","assets/onboarding-KBcwP-kU.js","assets/interactive-BrHVRHmQ.js","assets/alert-dialog-CLYxQdrK.js","assets/react-vendor-7n7LyU5o.js","assets/use-toast-hxHsVv6a.js","assets/chat-dock-context-Gg1jpamu.js","assets/store-B_cK-gsT.js","assets/explorer-tab-context-BdjTEbFh.js","assets/main-tab-context-zQSuRQQG.js","assets/use-suspense-resource-CExc4Svq.js","assets/thread-tool-blocks-D9HUkPHB.js","assets/ndjson-stream-DeGpE5o5.js","assets/utils-SsF94Pkg.js","assets/index-Cndc50ux.css","assets/use-settings-page-loading-BU2CDnfE.js","assets/is-macos-client-BIb4ZSEa.js","assets/project-settings-view-Cb0iiyad.js","assets/commit-method-fields-o-xw2faT.js","assets/context-menu-BLvLpqq7.js","assets/project-env-vars-view-D60J_-qQ.js","assets/project-model-aliases-view-EClnOgBH.js","assets/project-tools-view-B_WnVICB.js","assets/providers-list-view-CYy82_hl.js","assets/model-list-controls-2JtkzWsp.js","assets/async-error-boundary-CM6LU7nT.js","assets/card-BDQUHsPD.js","assets/settings-list-CWdsaJKC.js","assets/skeleton-CJSNEi3C.js","assets/use-deferred-search-0sV7mSzX.js","assets/settings-models-view-xIRY7PvW.js","assets/table-Cb2C1rQy.js","assets/settings-mcp-servers-view-B8_vnfl6.js","assets/delete-confirm-dialog-D1zjctrX.js","assets/settings-slack-view-RFLP0USW.js","assets/settings-logs-view-CkkVgGvv.js","assets/settings-skills-view-qWbr0Vl2.js","assets/mcp-server-card-DPakHrG9.js","assets/use-installed-ai-files-GpG9ZL8U.js","assets/settings-rules-view-DIk0ghSW.js","assets/settings-slash-commands-view-zFWoR_R7.js","assets/settings-subagents-view-BZr1NkVp.js","assets/settings-instructions-view-DN4-73KP.js","assets/settings-system-prompt-view-mQErde93.js","assets/account-view-Chzj6v7a.js","assets/conversation-history-view-ukfe_7qw.js","assets/settings-storage-view-BS2k7E74.js","assets/settings-statistics-view-BgrzVn4R.js"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{At as t,C as n,Cn as r,Di as i,En as a,I as o,Oi as s,R as c,Rr as l,S as u,Tn as d,V as f,c as p,f as m,g as h,h as g,i as _,it as v,k as y,ki as b,kt as x,m as S,p as C,tr as w,un as T,vt as E,wn as D}from"./interactive-BrHVRHmQ.js";import{Gt as O,Ut as k,Wt as A}from"./react-vendor-7n7LyU5o.js";import{Ct as j,Eo as M,F as N,I as P,L as F,M as I,N as L,Oo as R,P as z,Pr as B,R as V,S as H,St as ee,Tt as te,Xr as ne,bt as U,f as W,ht as re,ko as G,mr as ie,ut as ae,wt as oe,x as se}from"./onboarding-KBcwP-kU.js";import{l as K}from"./monaco-D1hpqXQ0.js";import{J as ce,n as le,r as q}from"./store-B_cK-gsT.js";import{A as ue,Jt as de,M as fe,N as pe,c as me,l as he,s as J,u as ge}from"./index-CJCQ4bTo.js";import{t as _e}from"./skeleton-CJSNEi3C.js";var Y=s(),X=e(b(),1),Z=i(),ve=(0,X.forwardRef)(function(e,t){let n=(0,Y.c)(29),{sidebar:r,children:i,defaultSidebarSize:a,minSidebarSize:o,maxSidebarSize:s,minContentSize:c,collapsible:l,collapsedSize:u,className:d,onCollapse:f,onExpand:p,isMobile:m,mobileShowSidebar:h,sidebarClassName:g}=e,v=a===void 0?25:a,y=o===void 0?20:o,b=s===void 0?30:s,x=c===void 0?40:c,S=l===void 0?!1:l,C=u===void 0?0:u,w=d===void 0?``:d,T=m===void 0?!1:m,E=h===void 0?!0:h,D=T&&!E,O=T&&E,k=`h-full ${w}`,A=T?100:v,j=T?50:y,M=T?100:b,N=D&&`hidden`,P;n[0]!==g||n[1]!==N?(P=_(`border-r border-transparent`,N,g),n[0]=g,n[1]=N,n[2]=P):P=n[2];let F;n[3]!==C||n[4]!==S||n[5]!==f||n[6]!==p||n[7]!==t||n[8]!==r||n[9]!==A||n[10]!==j||n[11]!==M||n[12]!==P?(F=(0,Z.jsx)(he,{ref:t,defaultSize:A,minSize:j,maxSize:M,collapsible:S,collapsedSize:C,onCollapse:f,onExpand:p,className:P,children:r}),n[3]=C,n[4]=S,n[5]=f,n[6]=p,n[7]=t,n[8]=r,n[9]=A,n[10]=j,n[11]=M,n[12]=P,n[13]=F):F=n[13];let I;n[14]===T?I=n[15]:(I=!T&&(0,Z.jsx)(me,{withHandle:!0,className:`ml-[-10px]`}),n[14]=T,n[15]=I);let L=O&&`hidden`,R;n[16]===L?R=n[17]:(R=_(`overflow-hidden`,L),n[16]=L,n[17]=R);let z;n[18]!==i||n[19]!==x||n[20]!==R?(z=(0,Z.jsx)(he,{minSize:x,className:R,children:i}),n[18]=i,n[19]=x,n[20]=R,n[21]=z):z=n[21];let B;n[22]!==F||n[23]!==I||n[24]!==z?(B=(0,Z.jsxs)(ge,{direction:`horizontal`,className:`h-full`,children:[F,I,z]}),n[22]=F,n[23]=I,n[24]=z,n[25]=B):B=n[25];let V;return n[26]!==k||n[27]!==B?(V=(0,Z.jsx)(`div`,{className:k,children:B}),n[26]=k,n[27]=B,n[28]=V):V=n[28],V});function ye(e){let t=(0,Y.c)(5),{className:n}=e,r;t[0]===n?r=t[1]:(r=_(`h-4 w-4`,n),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`path`,{d:`M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.528 2.528 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.528 2.528 0 0 1-2.52-2.523 2.528 2.528 0 0 1 2.52-2.52h6.313A2.528 2.528 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z`}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,className:r,children:i}),t[3]=r,t[4]=a),a}var be=F,xe=P,Se=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(N,{className:a,...i,ref:t}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Se.displayName=N.displayName;var Ce=R(`fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500`,{variants:{side:{top:`inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,bottom:`inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,left:`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,right:`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`}},defaultVariants:{side:`right`}}),we=X.forwardRef((e,t)=>{let n=(0,Y.c)(15),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({side:o,className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s=o===void 0?`right`:o,c;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(Se,{}),n[5]=c):c=n[5];let l;n[6]!==i||n[7]!==s?(l=_(Ce({side:s}),i),n[6]=i,n[7]=s,n[8]=l):l=n[8];let u;n[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsxs)(I,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,Z.jsx)(m,{className:`h-4 w-4`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Close`})]}),n[9]=u):u=n[9];let d;return n[10]!==r||n[11]!==a||n[12]!==t||n[13]!==l?(d=(0,Z.jsxs)(xe,{children:[c,(0,Z.jsxs)(L,{ref:t,className:l,...a,children:[r,u]})]}),n[10]=r,n[11]=a,n[12]=t,n[13]=l,n[14]=d):d=n[14],d});we.displayName=L.displayName;var Te=e=>{let t=(0,Y.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=_(`flex flex-col space-y-2 text-center sm:text-left`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};Te.displayName=`SheetHeader`;var Ee=e=>{let t=(0,Y.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=_(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};Ee.displayName=`SheetFooter`;var De=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(l.dialogTitle,`text-foreground`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(V,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});De.displayName=V.displayName;var Oe=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(l.dialogDescription,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(z,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Oe.displayName=z.displayName;var ke=`sidebar:state`,Ae=3600*24*7,je=`16rem`,Me=`18rem`,Ne=`3rem`,Pe=X.createContext(null);function Q(){let e=X.useContext(Pe);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}var Fe=X.forwardRef((e,t)=>{let n=(0,Y.c)(37),r,i,a,o,s,c,l;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6],l=n[7]):({defaultOpen:l,open:a,onOpenChange:s,className:i,style:c,children:r,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c,n[7]=l);let u=l===void 0?!0:l,d=J(),[f,p]=X.useState(!1),[m,h]=X.useState(u),g=a??m,v;n[8]!==g||n[9]!==s?(v=e=>{let t=typeof e==`function`?e(g):e;s?s(t):h(t),document.cookie=`${ke}=${t}; path=/; max-age=${Ae}`},n[8]=g,n[9]=s,n[10]=v):v=n[10];let y=v,b;n[11]!==d||n[12]!==y?(b=()=>d?p(Ie):y(Le),n[11]=d,n[12]=y,n[13]=b):b=n[13];let x=b,S,C;n[14]===x?(S=n[15],C=n[16]):(S=()=>{let e=e=>{e.key===`b`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),x())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},C=[x],n[14]=x,n[15]=S,n[16]=C),X.useEffect(S,C);let w=g?`expanded`:`collapsed`,T;n[17]!==d||n[18]!==g||n[19]!==f||n[20]!==y||n[21]!==w||n[22]!==x?(T={state:w,open:g,setOpen:y,isMobile:d,openMobile:f,setOpenMobile:p,toggleSidebar:x},n[17]=d,n[18]=g,n[19]=f,n[20]=y,n[21]=w,n[22]=x,n[23]=T):T=n[23];let E=T,D;n[24]===c?D=n[25]:(D={"--sidebar-width":je,"--sidebar-width-icon":Ne,...c},n[24]=c,n[25]=D);let O=D,k;n[26]===i?k=n[27]:(k=_(`group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar`,i),n[26]=i,n[27]=k);let A;n[28]!==r||n[29]!==o||n[30]!==t||n[31]!==O||n[32]!==k?(A=(0,Z.jsx)(oe,{delayDuration:0,children:(0,Z.jsx)(`div`,{style:O,className:k,ref:t,...o,children:r})}),n[28]=r,n[29]=o,n[30]=t,n[31]=O,n[32]=k,n[33]=A):A=n[33];let j;return n[34]!==E||n[35]!==A?(j=(0,Z.jsx)(Pe.Provider,{value:E,children:A}),n[34]=E,n[35]=A,n[36]=j):j=n[36],j});Fe.displayName=`SidebarProvider`;function Ie(e){return!e}function Le(e){return!e}var Re=X.forwardRef((e,t)=>{let n=(0,Y.c)(47),r,i,a,o,s,c;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6]):({side:o,variant:s,collapsible:c,className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c);let l=o===void 0?`left`:o,u=s===void 0?`sidebar`:s,d=c===void 0?`offcanvas`:c,{isMobile:f,state:p,openMobile:m,setOpenMobile:h}=Q();if(d===`none`){let e;n[7]===i?e=n[8]:(e=_(`flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground`,i),n[7]=i,n[8]=e);let o;return n[9]!==r||n[10]!==a||n[11]!==t||n[12]!==e?(o=(0,Z.jsx)(`div`,{className:e,ref:t,...a,children:r}),n[9]=r,n[10]=a,n[11]=t,n[12]=e,n[13]=o):o=n[13],o}if(f){let e;n[14]===Symbol.for(`react.memo_cache_sentinel`)?(e={"--sidebar-width":Me},n[14]=e):e=n[14];let t;n[15]===r?t=n[16]:(t=(0,Z.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:r}),n[15]=r,n[16]=t);let i;n[17]!==l||n[18]!==t?(i=(0,Z.jsx)(we,{"data-sidebar":`sidebar`,"data-mobile":`true`,className:`w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:e,side:l,children:t}),n[17]=l,n[18]=t,n[19]=i):i=n[19];let o;return n[20]!==m||n[21]!==a||n[22]!==h||n[23]!==i?(o=(0,Z.jsx)(be,{open:m,onOpenChange:h,...a,children:i}),n[20]=m,n[21]=a,n[22]=h,n[23]=i,n[24]=o):o=n[24],o}let g=p===`collapsed`?d:``,v=u===`floating`||u===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]`:`group-data-[collapsible=icon]:w-[--sidebar-width-icon]`,y;n[25]===v?y=n[26]:(y=_(`relative h-svh w-[--sidebar-width] bg-transparent`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,v),n[25]=v,n[26]=y);let b;n[27]===y?b=n[28]:(b=(0,Z.jsx)(`div`,{className:y}),n[27]=y,n[28]=b);let x=l===`left`?`left-0`:`right-0`,S=u===`floating`||u===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]`:`group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l`,C;n[29]!==i||n[30]!==x||n[31]!==S?(C=_(`fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] md:flex`,x,`group-data-[collapsible=offcanvas]:hidden`,S,i),n[29]=i,n[30]=x,n[31]=S,n[32]=C):C=n[32];let w;n[33]===r?w=n[34]:(w=(0,Z.jsx)(`div`,{"data-sidebar":`sidebar`,className:`flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow`,children:r}),n[33]=r,n[34]=w);let T;n[35]!==a||n[36]!==C||n[37]!==w?(T=(0,Z.jsx)(`div`,{className:C,...a,children:w}),n[35]=a,n[36]=C,n[37]=w,n[38]=T):T=n[38];let E;return n[39]!==t||n[40]!==l||n[41]!==p||n[42]!==T||n[43]!==g||n[44]!==b||n[45]!==u?(E=(0,Z.jsxs)(`div`,{ref:t,className:`group peer hidden md:block text-sidebar-foreground`,"data-state":p,"data-collapsible":g,"data-variant":u,"data-side":l,children:[b,T]}),n[39]=t,n[40]=l,n[41]=p,n[42]=T,n[43]=g,n[44]=b,n[45]=u,n[46]=E):E=n[46],E});Re.displayName=`Sidebar`;var ze=X.forwardRef((e,t)=>{let n=(0,Y.c)(16),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,onClick:i,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let{toggleSidebar:o}=Q(),s;n[4]===r?s=n[5]:(s=_(`h-7 w-7`,r),n[4]=r,n[5]=s);let c;n[6]!==i||n[7]!==o?(c=e=>{i?.(e),o()},n[6]=i,n[7]=o,n[8]=c):c=n[8];let l,u;n[9]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(v,{}),u=(0,Z.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`}),n[9]=l,n[10]=u):(l=n[9],u=n[10]);let d;return n[11]!==a||n[12]!==t||n[13]!==s||n[14]!==c?(d=(0,Z.jsxs)(M,{ref:t,"data-sidebar":`trigger`,variant:`ghost`,size:`icon`,className:s,onClick:c,...a,children:[l,u]}),n[11]=a,n[12]=t,n[13]=s,n[14]=c,n[15]=d):d=n[15],d});ze.displayName=`SidebarTrigger`;var Be=X.forwardRef((e,t)=>{let n=(0,Y.c)(13),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let{toggleSidebar:a}=Q(),o;n[3]===r?o=n[4]:(o=_(`absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex`,`[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,r),n[3]=r,n[4]=o);let s;n[5]!==i||n[6]!==t||n[7]!==o||n[8]!==a?(s=(0,Z.jsx)(te,{asChild:!0,children:(0,Z.jsx)(`button`,{ref:t,"data-sidebar":`rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onClick:a,className:o,...i})}),n[5]=i,n[6]=t,n[7]=o,n[8]=a,n[9]=s):s=n[9];let c;n[10]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(j,{children:`Toggle Sidebar`}),n[10]=c):c=n[10];let l;return n[11]===s?l=n[12]:(l=(0,Z.jsxs)(ee,{children:[s,c]}),n[11]=s,n[12]=l),l});Be.displayName=`SidebarRail`;var Ve=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`relative flex min-h-svh flex-1 flex-col bg-background`,`peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`main`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Ve.displayName=`SidebarInset`;var He=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(se,{ref:t,"data-sidebar":`input`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});He.displayName=`SidebarInput`;var Ue=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`flex flex-col gap-2 p-2`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`div`,{ref:t,"data-sidebar":`header`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Ue.displayName=`SidebarHeader`;var We=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`flex flex-col gap-2 p-2`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`div`,{ref:t,"data-sidebar":`footer`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});We.displayName=`SidebarFooter`;var Ge=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`mx-2 w-auto bg-divider`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(H,{ref:t,"data-sidebar":`separator`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Ge.displayName=`SidebarSeparator`;var Ke=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`div`,{ref:t,"data-sidebar":`content`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Ke.displayName=`SidebarContent`;var qe=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`relative flex w-full min-w-0 flex-col p-2`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`div`,{ref:t,"data-sidebar":`group`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});qe.displayName=`SidebarGroup`;var Je=X.forwardRef((e,t)=>{let n=(0,Y.c)(11),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,asChild:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=a!==void 0&&a?G:`div`,s;n[4]===r?s=n[5]:(s=_(`duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-base font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0`,r),n[4]=r,n[5]=s);let c;return n[6]!==o||n[7]!==i||n[8]!==t||n[9]!==s?(c=(0,Z.jsx)(o,{ref:t,"data-sidebar":`group-label`,className:s,...i}),n[6]=o,n[7]=i,n[8]=t,n[9]=s,n[10]=c):c=n[10],c});Je.displayName=`SidebarGroupLabel`;var Ye=X.forwardRef((e,t)=>{let n=(0,Y.c)(11),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,asChild:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=a!==void 0&&a?G:`button`,s;n[4]===r?s=n[5]:(s=_(`absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`group-data-[collapsible=icon]:hidden`,r),n[4]=r,n[5]=s);let c;return n[6]!==o||n[7]!==i||n[8]!==t||n[9]!==s?(c=(0,Z.jsx)(o,{ref:t,"data-sidebar":`group-action`,className:s,...i}),n[6]=o,n[7]=i,n[8]=t,n[9]=s,n[10]=c):c=n[10],c});Ye.displayName=`SidebarGroupAction`;var Xe=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`w-full`,l.compact,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`div`,{ref:t,"data-sidebar":`group-content`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Xe.displayName=`SidebarGroupContent`;var Ze=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`flex w-full min-w-0 flex-col gap-1`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`ul`,{ref:t,"data-sidebar":`menu`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Ze.displayName=`SidebarMenu`;var Qe=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`group/menu-item relative`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`li`,{ref:t,"data-sidebar":`menu-item`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Qe.displayName=`SidebarMenuItem`;var $e=R(`peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left ${l.compact} outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8`,sm:`h-7`,lg:`h-12 group-data-[collapsible=icon]:!p-0`}},defaultVariants:{variant:`default`,size:`default`}}),et=X.forwardRef((e,t)=>{let n=(0,Y.c)(29),r,i,a,o,s,c,l;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6],l=n[7]):({asChild:a,isActive:o,variant:s,size:c,tooltip:l,className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c,n[7]=l);let u=a===void 0?!1:a,d=o===void 0?!1:o,f=s===void 0?`default`:s,p=c===void 0?`default`:c,m=u?G:`button`,{isMobile:h,state:g}=Q(),v;n[8]!==r||n[9]!==p||n[10]!==f?(v=_($e({variant:f,size:p}),r),n[8]=r,n[9]=p,n[10]=f,n[11]=v):v=n[11];let y;n[12]!==m||n[13]!==d||n[14]!==i||n[15]!==t||n[16]!==p||n[17]!==v?(y=(0,Z.jsx)(m,{ref:t,"data-sidebar":`menu-button`,"data-size":p,"data-active":d,className:v,...i}),n[12]=m,n[13]=d,n[14]=i,n[15]=t,n[16]=p,n[17]=v,n[18]=y):y=n[18];let b=y;if(!l)return b;if(typeof l==`string`){let e;n[19]===l?e=n[20]:(e={children:l},n[19]=l,n[20]=e),l=e}let x;n[21]===b?x=n[22]:(x=(0,Z.jsx)(te,{asChild:!0,children:b}),n[21]=b,n[22]=x);let S=g!==`collapsed`||h,C;n[23]!==S||n[24]!==l?(C=(0,Z.jsx)(j,{side:`right`,align:`center`,hidden:S,...l}),n[23]=S,n[24]=l,n[25]=C):C=n[25];let w;return n[26]!==x||n[27]!==C?(w=(0,Z.jsxs)(ee,{children:[x,C]}),n[26]=x,n[27]=C,n[28]=w):w=n[28],w});et.displayName=`SidebarMenuButton`;var tt=X.forwardRef((e,t)=>{let n=(0,Y.c)(13),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({className:r,asChild:a,showOnHover:o,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s=a===void 0?!1:a,c=o===void 0?!1:o,l=s?G:`button`,u=c&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0`,d;n[5]!==r||n[6]!==u?(d=_(`absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,u,r),n[5]=r,n[6]=u,n[7]=d):d=n[7];let f;return n[8]!==l||n[9]!==i||n[10]!==t||n[11]!==d?(f=(0,Z.jsx)(l,{ref:t,"data-sidebar":`menu-action`,className:d,...i}),n[8]=l,n[9]=i,n[10]=t,n[11]=d,n[12]=f):f=n[12],f});tt.displayName=`SidebarMenuAction`;var nt=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none`,`peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`div`,{ref:t,"data-sidebar":`menu-badge`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});nt.displayName=`SidebarMenuBadge`;var rt=X.forwardRef((e,t)=>{let n=(0,Y.c)(15),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,showIcon:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=a===void 0?!1:a,s=`${Math.floor(Math.random()*40)+50}%`,c;n[4]===r?c=n[5]:(c=_(`rounded-md h-8 flex gap-2 px-2 items-center`,r),n[4]=r,n[5]=c);let l;n[6]===o?l=n[7]:(l=o&&(0,Z.jsx)(_e,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),n[6]=o,n[7]=l);let u;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(u={"--skeleton-width":s},n[8]=u):u=n[8];let d;n[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(_e,{className:`h-4 flex-1 max-w-[--skeleton-width]`,"data-sidebar":`menu-skeleton-text`,style:u}),n[9]=d):d=n[9];let f;return n[10]!==i||n[11]!==t||n[12]!==c||n[13]!==l?(f=(0,Z.jsxs)(`div`,{ref:t,"data-sidebar":`menu-skeleton`,className:c,...i,children:[l,d]}),n[10]=i,n[11]=t,n[12]=c,n[13]=l,n[14]=f):f=n[14],f});rt.displayName=`SidebarMenuSkeleton`;var it=X.forwardRef((e,t)=>{let n=(0,Y.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=_(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5`,`group-data-[collapsible=icon]:hidden`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,Z.jsx)(`ul`,{ref:t,"data-sidebar":`menu-sub`,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});it.displayName=`SidebarMenuSub`;var at=X.forwardRef((e,t)=>{let n=(0,Y.c)(5),r;n[0]===e?r=n[1]:({...r}=e,n[0]=e,n[1]=r);let i;return n[2]!==r||n[3]!==t?(i=(0,Z.jsx)(`li`,{ref:t,...r}),n[2]=r,n[3]=t,n[4]=i):i=n[4],i});at.displayName=`SidebarMenuSubItem`;var ot=X.forwardRef((e,t)=>{let n=(0,Y.c)(17),r,i,a,o,s;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5]):({asChild:o,size:s,isActive:i,className:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s);let c=o===void 0?!1:o,u=s===void 0?`md`:s,d=c?G:`a`,f=u===`sm`&&l.compact,p=u===`md`&&l.compact,m;n[6]!==r||n[7]!==f||n[8]!==p?(m=_(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,`data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground`,f,p,`group-data-[collapsible=icon]:hidden`,r),n[6]=r,n[7]=f,n[8]=p,n[9]=m):m=n[9];let h;return n[10]!==d||n[11]!==i||n[12]!==a||n[13]!==t||n[14]!==u||n[15]!==m?(h=(0,Z.jsx)(d,{ref:t,"data-sidebar":`menu-sub-button`,"data-size":u,"data-active":i,className:m,...a}),n[10]=d,n[11]=i,n[12]=a,n[13]=t,n[14]=u,n[15]=m,n[16]=h):h=n[16],h});ot.displayName=`SidebarMenuSubButton`;var st=[{id:`skills`,label:`Skills`,icon:(0,Z.jsx)(S,{className:`h-4 w-4`}),route:`/settings/skills`},{id:`rules`,label:`Rules`,icon:(0,Z.jsx)(f,{className:`h-4 w-4`}),route:`/settings/rules`},{id:`slash-commands`,label:`Slash Commands`,icon:(0,Z.jsx)(u,{className:`h-4 w-4`}),route:`/settings/slash-commands`},{id:`subagents`,label:`Subagents`,icon:(0,Z.jsx)(g,{className:`h-4 w-4`}),route:`/settings/subagents`},{id:`instructions`,label:`Instructions`,icon:(0,Z.jsx)(a,{className:`h-4 w-4`}),route:`/settings/instructions`},{id:`system-prompt`,label:`System Prompt`,icon:(0,Z.jsx)(y,{className:`h-4 w-4`}),route:`/settings/system-prompt`},{id:`mcp-servers`,label:`MCP Servers`,icon:(0,Z.jsx)(c,{className:`h-4 w-4`}),route:`/settings/mcp-servers`},{id:`general`,label:`Settings`,icon:(0,Z.jsx)(o,{className:`h-4 w-4`}),route:`/settings/general`},{id:`logs`,label:`Logs`,icon:(0,Z.jsx)(E,{className:`h-4 w-4`}),route:`/settings/logs`},{id:`slack`,label:`Slack`,icon:(0,Z.jsx)(ye,{}),route:`/settings/slack`},{id:`providers`,label:`Providers`,icon:(0,Z.jsx)(T,{className:`h-4 w-4`}),route:`/settings/providers`},{id:`models`,label:`Models`,icon:(0,Z.jsx)(D,{className:`h-4 w-4`}),route:`/settings/models`},{id:`statistics`,label:`Statistics`,icon:(0,Z.jsx)(r,{className:`h-4 w-4`}),route:`/settings/statistics`},{id:`history`,label:`History`,icon:(0,Z.jsx)(x,{className:`h-4 w-4`}),route:`/settings/history`},{id:`storage`,label:`Storage`,icon:(0,Z.jsx)(t,{className:`h-4 w-4`}),route:`/settings/storage`},{id:`account`,label:`Account`,icon:(0,Z.jsx)(h,{className:`h-4 w-4`}),route:`/settings/account`}],ct=new Set([`project`,`project-env-vars`,`project-model-aliases`,`project-tools`,`skills`,`rules`,`slash-commands`,`subagents`,`instructions`,`system-prompt`,`mcp-servers`]),lt=new Set([`project`,`instructions`,`project-env-vars`]),ut=new Set([`skills`,`rules`,`slash-commands`,`subagents`,`mcp-servers`]),dt=new Set([`system-prompt`,`project-model-aliases`,`project-tools`]),ft=new Set([`general`,`logs`,`slack`,`providers`,`models`,`statistics`,`history`,`storage`,`account`]);function pt(e){return ct.has(e)?`project`:`general`}function $(e){let t=(0,Y.c)(18),{label:n,items:r,activeTabId:i,onItemClick:a,showSeparator:o,className:s}=e,c=o===void 0?!0:o;if(r.length===0)return null;let l;t[0]===n?l=t[1]:(l=n?(0,Z.jsx)(Je,{children:n}):null,t[0]=n,t[1]=l);let u;if(t[2]!==i||t[3]!==r||t[4]!==a){let e;t[6]!==i||t[7]!==a?(e=e=>(0,Z.jsx)(W,{selected:i===e.id,asChild:!0,children:(0,Z.jsx)(`button`,{className:`justify-start`,onClick:()=>a(e),children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.icon,(0,Z.jsx)(`span`,{children:e.label})]})})},e.id),t[6]=i,t[7]=a,t[8]=e):e=t[8],u=r.map(e),t[2]=i,t[3]=r,t[4]=a,t[5]=u}else u=t[5];let d;t[9]===u?d=t[10]:(d=(0,Z.jsx)(`div`,{className:`space-y-1`,children:u}),t[9]=u,t[10]=d);let f;t[11]===c?f=t[12]:(f=c?(0,Z.jsx)(H,{className:`my-2`}):null,t[11]=c,t[12]=f);let p;return t[13]!==s||t[14]!==l||t[15]!==d||t[16]!==f?(p=(0,Z.jsxs)(`div`,{className:s,children:[l,d,f]}),t[13]=s,t[14]=l,t[15]=d,t[16]=f,t[17]=p):p=t[17],p}function mt(e){let t=[...st];if(!e)return t;let r=t.findIndex(e=>e.id===`skills`);t.splice(r,0,{id:`project`,label:`Settings`,icon:(0,Z.jsx)(o,{className:`h-4 w-4`}),route:`/settings/project/${e}`},{id:`project-env-vars`,label:`Environment Variables`,icon:(0,Z.jsx)(d,{className:`h-4 w-4`}),route:`/settings/project/${e}/env-vars`});let i=t.findIndex(e=>e.id===`instructions`),a=t.findIndex(e=>e.id===`project`);if(i!==-1&&a!==-1){let[e]=t.splice(i,1);t.splice(a+1,0,e)}let s=t.findIndex(e=>e.id===`system-prompt`),c=s===-1?null:t.splice(s,1)[0],l=t.findIndex(e=>e.id===`mcp-servers`);return l!==-1&&t.splice(l+1,0,...c?[c]:[],{id:`project-model-aliases`,label:`Model Aliases`,icon:(0,Z.jsx)(n,{className:`h-4 w-4`}),route:`/settings/project/${e}/model-aliases`},{id:`project-tools`,label:`Tools`,icon:(0,Z.jsx)(C,{className:`h-4 w-4`}),route:`/settings/project/${e}/tools`}),t}function ht(e){let t=(0,Y.c)(48),{className:n,selectedProjectId:r,settingsScope:i,onResetOnboarding:a,onNavItemSelect:o}=e,s=A(),c=k(),l=(0,X.useRef)(0),u=(0,X.useRef)(null),d,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>()=>{u.current&&clearTimeout(u.current)},f=[],t[0]=d,t[1]=f):(d=t[0],f=t[1]),(0,X.useEffect)(d,f);let p=J(),m;t[2]===r?m=t[3]:(m=mt(r),t[2]=r,t[3]=m);let h=m,g;t[4]!==p||t[5]!==h?(g=p?h.filter(St):h,t[4]=p,t[5]=h,t[6]=g):g=t[6];let v=g,y;t[7]!==c.pathname||t[8]!==v?(y=function(){let e=c.pathname;if(e.endsWith(`/tools`)&&e.startsWith(`/settings/project/`))return`project-tools`;if(e.endsWith(`/model-aliases`)&&e.startsWith(`/settings/project/`))return`project-model-aliases`;if(e.endsWith(`/env-vars`)&&e.startsWith(`/settings/project/`))return`project-env-vars`;if(e.startsWith(`/settings/project/`))return`project`;for(let t of v)if(e.startsWith(t.route))return t.id;return`general`}(),t[7]=c.pathname,t[8]=v,t[9]=y):y=t[9];let b=y,x,S,C,w,T,E,D,O,j;if(t[10]!==b||t[11]!==n||t[12]!==v||t[13]!==s||t[14]!==o||t[15]!==a||t[16]!==r||t[17]!==i){S=function(e){e.id===`general`&&a&&(u.current&&clearTimeout(u.current),l.current+=1,l.current>=3?(l.current=0,a()):u.current=setTimeout(()=>{l.current=0},1500)),o?.(),s(e.route)};let e=!!r;E=!e||i!==`project`,D=e&&i!==`general`;let c=v.filter(xt);T=c.filter(bt),w=c.filter(yt),C=c.filter(vt);let d;t[27]===v?d=t[28]:(d=v.filter(_t),t[27]=v,t[28]=d),x=d;let f=e?[]:c.filter(gt);t[29]===n?O=t[30]:(O=_(`space-y-1`,n),t[29]=n,t[30]=O),j=f.length>0?(0,Z.jsxs)(Z.Fragment,{children:[f.map(e=>(0,Z.jsx)(W,{selected:b===e.id,asChild:!0,children:(0,Z.jsx)(`button`,{className:`justify-start`,onClick:()=>S(e),children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.icon,(0,Z.jsx)(`span`,{children:e.label})]})})},e.id)),(0,Z.jsx)(H,{className:`my-2`})]}):null,t[10]=b,t[11]=n,t[12]=v,t[13]=s,t[14]=o,t[15]=a,t[16]=r,t[17]=i,t[18]=x,t[19]=S,t[20]=C,t[21]=w,t[22]=T,t[23]=E,t[24]=D,t[25]=O,t[26]=j}else x=t[18],S=t[19],C=t[20],w=t[21],T=t[22],E=t[23],D=t[24],O=t[25],j=t[26];let M;t[31]!==b||t[32]!==S||t[33]!==C||t[34]!==w||t[35]!==T||t[36]!==D?(M=D?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($,{label:`Project`,items:T,activeTabId:b,onItemClick:S,showSeparator:!1}),(0,Z.jsx)($,{label:`Customize`,items:w,activeTabId:b,onItemClick:S,showSeparator:!1,className:`pt-3`}),(0,Z.jsx)($,{label:`Advanced`,items:C,activeTabId:b,onItemClick:S,showSeparator:!1,className:`pt-3`})]}):null,t[31]=b,t[32]=S,t[33]=C,t[34]=w,t[35]=T,t[36]=D,t[37]=M):M=t[37];let N;t[38]!==b||t[39]!==x||t[40]!==S||t[41]!==E?(N=E?(0,Z.jsx)($,{items:x,activeTabId:b,onItemClick:S,showSeparator:!1}):null,t[38]=b,t[39]=x,t[40]=S,t[41]=E,t[42]=N):N=t[42];let P;return t[43]!==O||t[44]!==j||t[45]!==M||t[46]!==N?(P=(0,Z.jsxs)(`div`,{className:O,children:[j,M,N]}),t[43]=O,t[44]=j,t[45]=M,t[46]=N,t[47]=P):P=t[47],P}function gt(e){return e.id!==`project`}function _t(e){return ft.has(e.id)}function vt(e){return dt.has(e.id)}function yt(e){return ut.has(e.id)}function bt(e){return lt.has(e.id)}function xt(e){return ct.has(e.id)}function St(e){return e.id!==`account`}var Ct=w(`app.settings-view.ui`),wt=`h-8 rounded-full border-0 bg-muted/40 p-0.5`,Tt=`h-7 rounded-full px-4 data-[state=active]:bg-foreground data-[state=active]:text-background data-[state=active]:shadow-sm`,Et=`frosted-surface backdrop-blur-2xl`,Dt=(0,X.lazy)(()=>K(()=>import(`./settings-general-view-72s5xgPj.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),Ot=(0,X.lazy)(()=>K(()=>import(`./project-settings-view-Cb0iiyad.js`),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,22,23,19]))),kt=(0,X.lazy)(()=>K(()=>import(`./project-env-vars-view-D60J_-qQ.js`),__vite__mapDeps([24,1,5,6,9,19,8,3,4]))),At=(0,X.lazy)(()=>K(()=>import(`./project-model-aliases-view-EClnOgBH.js`),__vite__mapDeps([25,1,5,6,9,19,8,3,4]))),jt=(0,X.lazy)(()=>K(()=>import(`./project-tools-view-B_WnVICB.js`),__vite__mapDeps([26,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]))),Mt=(0,X.lazy)(()=>K(()=>import(`./providers-list-view-CYy82_hl.js`),__vite__mapDeps([27,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,28,29,30,31,32,33]))),Nt=(0,X.lazy)(()=>K(()=>import(`./settings-models-view-xIRY7PvW.js`),__vite__mapDeps([34,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,22,28,29,30,31,32,35,33]))),Pt=(0,X.lazy)(()=>K(()=>import(`./settings-mcp-servers-view-B8_vnfl6.js`),__vite__mapDeps([36,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,37,31,30,32,19]))),Ft=(0,X.lazy)(()=>K(()=>import(`./settings-slack-view-RFLP0USW.js`),__vite__mapDeps([38,1,5,6,9]))),It=(0,X.lazy)(()=>K(()=>import(`./settings-logs-view-CkkVgGvv.js`),__vite__mapDeps([39,1,5,6,9,8,3,4]))),Lt=(0,X.lazy)(()=>K(()=>import(`./settings-skills-view-qWbr0Vl2.js`),__vite__mapDeps([40,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,41,37,31,30,32,33,42,19]))),Rt=(0,X.lazy)(()=>K(()=>import(`./settings-rules-view-DIk0ghSW.js`),__vite__mapDeps([43,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,41,37,31,30,32,33,42,19]))),zt=(0,X.lazy)(()=>K(()=>import(`./settings-slash-commands-view-zFWoR_R7.js`),__vite__mapDeps([44,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,41,37,31,30,32,19]))),Bt=(0,X.lazy)(()=>K(()=>import(`./settings-subagents-view-BZr1NkVp.js`),__vite__mapDeps([45,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,41,37,31,30,32,42,19]))),Vt=(0,X.lazy)(()=>K(()=>import(`./settings-instructions-view-DN4-73KP.js`),__vite__mapDeps([46,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]))),Ht=(0,X.lazy)(()=>K(()=>import(`./settings-system-prompt-view-mQErde93.js`),__vite__mapDeps([47,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]))),Ut=(0,X.lazy)(()=>K(()=>import(`./account-view-Chzj6v7a.js`),__vite__mapDeps([48,1,5,6,37,7,8,3,4,32,9,11]))),Wt=(0,X.lazy)(()=>K(()=>import(`./conversation-history-view-ukfe_7qw.js`),__vite__mapDeps([49,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,37,35]))),Gt=(0,X.lazy)(()=>K(()=>import(`./settings-storage-view-BS2k7E74.js`),__vite__mapDeps([50,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,37,31,30,32,35,20]))),Kt=(0,X.lazy)(()=>K(()=>import(`./settings-statistics-view-BgrzVn4R.js`),__vite__mapDeps([51,1,5,6,35]))),qt=[`general`,`providers`,`models`,`skills`,`rules`,`slash-commands`,`subagents`,`instructions`,`system-prompt`,`mcp-servers`,`slack`,`logs`,`statistics`,`history`,`storage`,`account`];function Jt(e){let t=(0,Y.c)(2),{title:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(ae,{title:n,children:`Content coming soon...`}),t[0]=n,t[1]=r),r}function Yt(e){return e.startsWith(`/settings/general`)?`general`:e.startsWith(`/settings/providers`)?`providers`:e.startsWith(`/settings/models`)?`models`:e.startsWith(`/settings/skills`)?`skills`:e.startsWith(`/settings/rules`)?`rules`:e.startsWith(`/settings/slash-commands`)?`slash-commands`:e.startsWith(`/settings/subagents`)?`subagents`:e.startsWith(`/settings/instructions`)?`instructions`:e.startsWith(`/settings/system-prompt`)?`system-prompt`:e.startsWith(`/settings/mcp-servers`)?`mcp-servers`:e.startsWith(`/settings/slack`)?`slack`:e.startsWith(`/settings/logs`)?`logs`:e.startsWith(`/settings/statistics`)?`statistics`:e.startsWith(`/settings/history`)?`history`:e.startsWith(`/settings/storage`)?`storage`:e.startsWith(`/settings/account`)?`account`:`general`}function Xt(e){let t=e.match(/^\/settings\/providers\/([^/]+)$/);return t?decodeURIComponent(t[1]):null}function Zt(e,t,n){return e&&qt.includes(e)?e:t&&qt.includes(t)?t:Yt(n)}function Qt(e,t,n,r,i){return e?`project-tools`:t?`project-model-aliases`:n?`project-env-vars`:r?`project`:i}function $t(e,t,n,r,i){return e?`Tools`:t?`Model Aliases`:n?`Environment Variables`:r?`Project`:st.find(e=>e.id===i)?.label??`Settings`}function en(e,t){return e===`/settings`||e===`/settings/project`||[`/settings/mcp-server-edit`,`/settings/add-skill`,`/settings/add-command`,`/settings/add-rule`,`/settings/add-agent`].some(t=>e.startsWith(t))||t&&e.startsWith(`/settings/account`)}function tn(e,t){let n=!!e&&t.startsWith(`/settings/project/`),r=n&&t.endsWith(`/tools`),i=n&&t.endsWith(`/model-aliases`),a=n&&t.endsWith(`/env-vars`);return{isProjectRoute:n,isProjectToolsRoute:r,isProjectModelAliasesRoute:i,isProjectEnvVarsRoute:a,isProjectSettingsRoute:n&&!a&&!i&&!r}}function nn(e,t){let n=(0,Y.c)(5),r;n[0]!==t||n[1]!==e?(r=()=>{let n=e.current;if(!n)return;let r=function(e){if(e.key!==`Escape`)return;let n=document.activeElement;if(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLElement&&n.isContentEditable){n.blur();return}t()};return n.addEventListener(`keydown`,r),()=>n.removeEventListener(`keydown`,r)},n[0]=t,n[1]=e,n[2]=r):r=n[2];let i;n[3]===t?i=n[4]:(i=[t],n[3]=t,n[4]=i),(0,X.useEffect)(r,i)}function rn(e){let t=(0,Y.c)(5),{selectedProjectId:n,settingsScope:r,onResetOnboarding:i,onNavItemSelect:a}=e,o=n?r:void 0,s;return t[0]!==a||t[1]!==i||t[2]!==n||t[3]!==o?(s=(0,Z.jsx)(`div`,{className:`flex h-full flex-col overflow-hidden p-2.5`,children:(0,Z.jsx)(re,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(`div`,{className:`py-2`,children:(0,Z.jsx)(ht,{selectedProjectId:n,settingsScope:o,onResetOnboarding:i,onNavItemSelect:a})})})}),t[0]=a,t[1]=i,t[2]=n,t[3]=o,t[4]=s):s=t[4],s}function an(e){let t=(0,Y.c)(21),{settingsHeaderTitle:n,isProjectSettingsScope:r,selectedProject:i,selectedProjectId:a,settingsScope:o,onScopeChange:s,onRequestClose:c}=e,u;t[0]!==r||t[1]!==i?(u=r&&i?(0,Z.jsx)(de,{project:i,elevated:!1,className:`h-7 w-7 shrink-0 rounded-md`,iconClassName:`h-3.5 w-3.5`}):(0,Z.jsx)(`div`,{className:`flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border shadow-sm`,children:(0,Z.jsx)(`img`,{src:`/tarsk.svg`,alt:`Tarsk`,className:`h-full w-full`})}),t[0]=r,t[1]=i,t[2]=u):u=t[2];let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=_(l.sectionTitle,`truncate`),t[3]=d):d=t[3];let f;t[4]===n?f=t[5]:(f=(0,Z.jsx)(`span`,{className:d,children:n}),t[4]=n,t[5]=f);let p;t[6]!==u||t[7]!==f?(p=(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 electrobun-webkit-app-region-no-drag`,children:[u,f]}),t[6]=u,t[7]=f,t[8]=p):p=t[8];let h;t[9]!==s||t[10]!==a||t[11]!==o?(h=a?(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-4 flex justify-center`,children:(0,Z.jsx)(ue,{value:o,onValueChange:e=>{(e===`project`||e===`general`)&&s(e)},className:`pointer-events-auto electrobun-webkit-app-region-no-drag`,children:(0,Z.jsxs)(fe,{className:wt,children:[(0,Z.jsx)(pe,{value:`project`,className:Tt,children:`Project`}),(0,Z.jsx)(pe,{value:`general`,className:Tt,children:`General`})]})})}):null,t[9]=s,t[10]=a,t[11]=o,t[12]=h):h=t[12];let g,v;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(m,{className:`h-4 w-4`}),v=(0,Z.jsx)(`span`,{className:`sr-only`,children:`Close`}),t[13]=g,t[14]=v):(g=t[13],v=t[14]);let y;t[15]===c?y=t[16]:(y=(0,Z.jsx)(`div`,{className:`ml-auto flex items-center gap-2 electrobun-webkit-app-region-no-drag`,children:(0,Z.jsxs)(M,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:c,children:[g,v]})}),t[15]=c,t[16]=y);let b;return t[17]!==p||t[18]!==h||t[19]!==y?(b=(0,Z.jsxs)(`div`,{className:`relative flex h-14 shrink-0 items-start px-4 pt-4 pb-2 electrobun-webkit-app-region-drag`,children:[p,h,y]}),t[17]=p,t[18]=h,t[19]=y,t[20]=b):b=t[20],b}function on(e){let t=(0,Y.c)(10),{isMobile:n,mobileShowSidebar:r,isProviderDetailRoute:i,activeSectionLabel:a,onShowSidebar:o}=e;if(!n||r||i)return null;let s,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(v,{className:`h-4 w-4`}),c=(0,Z.jsx)(`span`,{className:`sr-only`,children:`Show settings menu`}),t[0]=s,t[1]=c):(s=t[0],c=t[1]);let u;t[2]===o?u=t[3]:(u=(0,Z.jsxs)(M,{variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0 text-muted-foreground`,onClick:o,children:[s,c]}),t[2]=o,t[3]=u);let d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=_(l.sectionTitle,`truncate text-foreground`),t[4]=d):d=t[4];let f;t[5]===a?f=t[6]:(f=(0,Z.jsx)(`span`,{className:d,children:a}),t[5]=a,t[6]=f);let p;return t[7]!==u||t[8]!==f?(p=(0,Z.jsx)(`div`,{className:`px-6 pb-0 pt-6`,children:(0,Z.jsxs)(`div`,{className:`mb-4 flex min-w-0 items-center gap-2`,children:[u,f]})}),t[7]=u,t[8]=f,t[9]=p):p=t[9],p}function sn(e){let t=(0,Y.c)(19),{isProjectToolsRoute:n,isProjectModelAliasesRoute:r,isProjectEnvVarsRoute:i,isProjectSettingsRoute:a,projectId:o,activeTab:s,locationKey:c,onboardingResetSignal:l,handleProjectUpdated:u}=e;if(n&&o){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(U,{}),t[0]=e):e=t[0];let n;return t[1]!==u||t[2]!==o?(n=(0,Z.jsx)(X.Suspense,{fallback:e,children:(0,Z.jsx)(jt,{projectId:o,onProjectUpdated:u})}),t[1]=u,t[2]=o,t[3]=n):n=t[3],n}if(r&&o){let e;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(U,{}),t[4]=e):e=t[4];let n;return t[5]!==u||t[6]!==o?(n=(0,Z.jsx)(X.Suspense,{fallback:e,children:(0,Z.jsx)(At,{projectId:o,onProjectUpdated:u})}),t[5]=u,t[6]=o,t[7]=n):n=t[7],n}if(i&&o){let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(U,{}),t[8]=e):e=t[8];let n;return t[9]===o?n=t[10]:(n=(0,Z.jsx)(X.Suspense,{fallback:e,children:(0,Z.jsx)(kt,{projectId:o})}),t[9]=o,t[10]=n),n}if(a&&o){let e;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(U,{}),t[11]=e):e=t[11];let n;return t[12]!==u||t[13]!==o?(n=(0,Z.jsx)(X.Suspense,{fallback:e,children:(0,Z.jsx)(Ot,{projectId:o,onProjectUpdated:u})}),t[12]=u,t[13]=o,t[14]=n):n=t[14],n}let d;return t[15]!==s||t[16]!==c||t[17]!==l?(d=cn(s,c,l),t[15]=s,t[16]=c,t[17]=l,t[18]=d):d=t[18],d}function cn(e,t,n){return{general:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Dt,{onboardingResetSignal:n})}),providers:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{label:`Loading providers...`,size:`lg`}),children:(0,Z.jsx)(Mt,{})}),models:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{label:`Loading models...`,size:`lg`}),children:(0,Z.jsx)(Nt,{})}),skills:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Lt,{},t)}),rules:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Rt,{})}),"slash-commands":(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(zt,{})}),subagents:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Bt,{})}),instructions:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Vt,{})}),"system-prompt":(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Ht,{})}),"mcp-servers":(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Pt,{})}),slack:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Ft,{})}),logs:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(It,{})}),statistics:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Kt,{})}),history:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Wt,{})}),storage:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Gt,{})}),account:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(U,{}),children:(0,Z.jsx)(Ut,{})})}[e]??(0,Z.jsx)(Jt,{title:`Settings`})}function ln({onRequestClose:e}){let{tab:t,projectId:n}=O(),r=A(),i=k(),a=le(),o=q(e=>e.selectedProjectId),s=q(e=>e.projects),{isProjectRoute:c,isProjectToolsRoute:l,isProjectModelAliasesRoute:u,isProjectEnvVarsRoute:d,isProjectSettingsRoute:f}=tn(n,i.pathname),m=Xt(i.pathname)!==null,h=Zt(new URLSearchParams(i.search).get(`tab`),t,i.pathname),g=J(),[v,y]=(0,X.useState)(!0),[b,x]=(0,X.useState)(0),S=(0,X.useRef)(null),C=(0,X.useRef)(null),w=Qt(l,u,d,c,h),[T,E]=(0,X.useState)(()=>pt(w));(0,X.useEffect)(()=>{E(pt(w))},[w]);let D=(0,X.useCallback)(e=>{if(E(e),e===`project`&&o){r(`/settings/project/${o}`);return}e===`general`&&r(`/settings/general`)},[r,o]),j=(0,X.useMemo)(()=>s.find(e=>e.projectId===o)??null,[s,o]),M=T===`project`&&j!==null,N=M?`${p(j)} Settings`:`General Settings`,P=(0,X.useMemo)(()=>$t(l,u,d,f,h),[h,d,u,f,l]),F=(0,X.useCallback)(()=>{g&&y(!1)},[g]),I=(0,X.useCallback)(()=>{y(!0)},[]),L=(0,X.useCallback)(async()=>{try{await ne(),x(e=>e+1)}catch(e){Ct.error(`Failed to reset onboarding:`,e)}},[]),R=(0,X.useCallback)(async()=>{B(n);try{let e=await ie();a({type:ce.SetProjects,projects:e.projects,cloneRootPath:e.cloneRootPath})}catch(e){throw Ct.error(`Failed to refresh projects after settings update:`,e),e}},[a,n]);return(0,X.useEffect)(()=>{en(i.pathname,g)&&r(`/settings/general`,{replace:!0})},[i.pathname,r,g]),nn(C,e),(0,Z.jsxs)(`div`,{ref:C,role:`dialog`,"aria-modal":`true`,"aria-label":`Settings`,className:_(`rounded-2xl border border-border shadow-lg`,Et,`flex h-full w-full flex-col overflow-hidden md:h-[95vh] md:w-[80vw] md:max-w-[1400px]`),children:[(0,Z.jsx)(an,{settingsHeaderTitle:N,isProjectSettingsScope:M,selectedProject:j,selectedProjectId:o,settingsScope:T,onScopeChange:D,onRequestClose:e}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(ve,{ref:S,collapsible:!0,isMobile:g,mobileShowSidebar:v,sidebarClassName:_(`overflow-hidden rounded-tr-2xl`,Et),sidebar:(0,Z.jsx)(rn,{selectedProjectId:o,settingsScope:T,onResetOnboarding:L,onNavItemSelect:F}),children:(0,Z.jsxs)(`div`,{className:_(`relative flex h-full min-h-0 flex-col overflow-hidden py-2.5 pl-2.5`,g?null:`ml-2.5`),children:[(0,Z.jsx)(on,{isMobile:g,mobileShowSidebar:v,isProviderDetailRoute:m,activeSectionLabel:P,onShowSidebar:I}),(0,Z.jsx)(sn,{isProjectToolsRoute:l,isProjectModelAliasesRoute:u,isProjectEnvVarsRoute:d,isProjectSettingsRoute:f,projectId:n,activeTab:h,locationKey:i.key,onboardingResetSignal:b,handleProjectUpdated:R})]})})})]})}export{ln as default};