wind-agent-cli 1.38.0 → 1.38.1

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 (77) hide show
  1. package/dist/assets/{CodeEditor-FvgsnJ7J.js → CodeEditor-Cx2QOPKS.js} +1 -1
  2. package/dist/assets/{FileTree-NLULrBDi.js → FileTree-CaCZBfXB.js} +1 -1
  3. package/dist/assets/{GitPanel-51KUBbEW.js → GitPanel-C8vu-HU9.js} +1 -1
  4. package/dist/assets/{MarkdownPreview-PEEWVWeS.js → MarkdownPreview-DM1I8sMC.js} +1 -1
  5. package/dist/assets/{Shell-BEx66cW_.js → Shell-eRBEAkRb.js} +1 -1
  6. package/dist/assets/{StandaloneShell-BkuUCPZP.js → StandaloneShell-C_SgfnxT.js} +1 -1
  7. package/dist/assets/{TaskMasterPanel-DfQG80SF.js → TaskMasterPanel-ePMcx8a-.js} +2 -2
  8. package/dist/assets/{abnfDiagram-N423BO3Z-Cc0ul87U.js → abnfDiagram-N423BO3Z-BcJZs1lF.js} +1 -1
  9. package/dist/assets/{arc-BAuugHw_.js → arc-B53XXXxy.js} +1 -1
  10. package/dist/assets/{architectureDiagram-T3A2C74G-DA3G7QZD.js → architectureDiagram-T3A2C74G-vTs0UDp_.js} +1 -1
  11. package/dist/assets/{blockDiagram-VBNYF7ZC-tJ12IJs3.js → blockDiagram-VBNYF7ZC-CRlmkPBH.js} +1 -1
  12. package/dist/assets/{c4Diagram-5PPSVZJV-5BTMCXL4.js → c4Diagram-5PPSVZJV-CDkarwX2.js} +1 -1
  13. package/dist/assets/channel-BBmlxLKm.js +1 -0
  14. package/dist/assets/{chunk-2GRJ4B5K-BPaI06Ou.js → chunk-2GRJ4B5K-CdVcURNG.js} +1 -1
  15. package/dist/assets/{chunk-2Q5K7J3B-HV4zmsEe.js → chunk-2Q5K7J3B-CSMQbOQx.js} +1 -1
  16. package/dist/assets/{chunk-5RXB4S5H-BAwutJoU.js → chunk-5RXB4S5H-DFW9zj_c.js} +1 -1
  17. package/dist/assets/{chunk-5VM5RSS4-B9QAJPrv.js → chunk-5VM5RSS4-DBpthDmq.js} +1 -1
  18. package/dist/assets/{chunk-6Q2QTUOP-BOIW8bzI.js → chunk-6Q2QTUOP-BcUSTdgD.js} +1 -1
  19. package/dist/assets/{chunk-GF5L2VYU-DD13o00-.js → chunk-GF5L2VYU-4m17UUNv.js} +1 -1
  20. package/dist/assets/{chunk-JWPE2WC7-CFBm23VK.js → chunk-JWPE2WC7-BQbCGGN3.js} +1 -1
  21. package/dist/assets/{chunk-KBJHAD2P-C0i0v8Op.js → chunk-KBJHAD2P-BSUyigrP.js} +1 -1
  22. package/dist/assets/{chunk-RYQCIY6F-DfeK0taV.js → chunk-RYQCIY6F-IDx48cke.js} +1 -1
  23. package/dist/assets/{chunk-XXDRQBXY-BKWvf-QE.js → chunk-XXDRQBXY-CkptWWiw.js} +1 -1
  24. package/dist/assets/classDiagram-JCYQIIEL-Zuuh6WIs.js +1 -0
  25. package/dist/assets/classDiagram-v2-OCEON4UE-Zuuh6WIs.js +1 -0
  26. package/dist/assets/{cose-bilkent-JH36ORCC-CBE8oM7L.js → cose-bilkent-JH36ORCC-Di3RMB4X.js} +1 -1
  27. package/dist/assets/{cynefin-VYW2F7L2-DziGp35A.js → cynefin-VYW2F7L2-DBEP-JNm.js} +1 -1
  28. package/dist/assets/{cynefinDiagram-MW4NZA55-CNvtHl39.js → cynefinDiagram-MW4NZA55-DCa5bQ3E.js} +1 -1
  29. package/dist/assets/{dagre-VZM6K2ZE-Bz9lsU7m.js → dagre-VZM6K2ZE-N0N_WSj2.js} +1 -1
  30. package/dist/assets/{diagram-7IWD3JNH-CV7D3VSd.js → diagram-7IWD3JNH-wYn0p431.js} +1 -1
  31. package/dist/assets/{diagram-B4RE2ZJO-Dj4EjDNC.js → diagram-B4RE2ZJO-Cse-jrwQ.js} +1 -1
  32. package/dist/assets/{diagram-LBJQPF4R-wJ6FHvf-.js → diagram-LBJQPF4R-Byhmgq5m.js} +1 -1
  33. package/dist/assets/{diagram-Q27KOJAE-DMFYMhOB.js → diagram-Q27KOJAE-BNsUkxU7.js} +1 -1
  34. package/dist/assets/{diagram-UB23O5K3-DeBSbWAI.js → diagram-UB23O5K3-C3QHYX7n.js} +1 -1
  35. package/dist/assets/{ebnfDiagram-BXEA7PRR-2NnJSGhT.js → ebnfDiagram-BXEA7PRR-BP6B3t_z.js} +1 -1
  36. package/dist/assets/{erDiagram-JOGREHBK-DrSlg8hr.js → erDiagram-JOGREHBK-CjYRNWDj.js} +1 -1
  37. package/dist/assets/feature-chat-CenAll-X.js +88 -0
  38. package/dist/assets/{feature-workspace-CAB6bgPy.js → feature-workspace-X9kJZ4EG.js} +2 -2
  39. package/dist/assets/{flowDiagram-UKHOOZJN-C0pejU6W.js → flowDiagram-UKHOOZJN-4H-yy-hv.js} +1 -1
  40. package/dist/assets/{ganttDiagram-PKOTCBZU-BM0VCUUz.js → ganttDiagram-PKOTCBZU-CEjsxzjF.js} +1 -1
  41. package/dist/assets/{gitGraphDiagram-DS77QQ5N-SbLG0c5_.js → gitGraphDiagram-DS77QQ5N-CNEvMqer.js} +1 -1
  42. package/dist/assets/{index-Btkf0_rU.js → index-BIKUx4Nd.js} +1 -1
  43. package/dist/assets/{index-Gqazqfs3.js → index-BnTqIKbW.js} +1 -1
  44. package/dist/assets/{index-nyrkoQK6.js → index-CblFvRGn.js} +2 -2
  45. package/dist/assets/{index-BflGfU1C.js → index-Dn_5mZup.js} +1 -1
  46. package/dist/assets/{infoDiagram-6WML65LV-Cf5DSa66.js → infoDiagram-6WML65LV-CaQEYwl_.js} +1 -1
  47. package/dist/assets/{ishikawaDiagram-WSZJBQD7-DwyFutKy.js → ishikawaDiagram-WSZJBQD7-jvmcvqKv.js} +1 -1
  48. package/dist/assets/{journeyDiagram-NVQOT4AX-Df0FRhLo.js → journeyDiagram-NVQOT4AX-D3t6ZEEp.js} +1 -1
  49. package/dist/assets/{kanban-definition-27J2QSJJ-HmpbjrZz.js → kanban-definition-27J2QSJJ-DndXvXlL.js} +1 -1
  50. package/dist/assets/{linear-DOM01LBe.js → linear-CRI9G1bv.js} +1 -1
  51. package/dist/assets/{mermaid.core-C2Ma-_S6.js → mermaid.core-Nej1-0Ug.js} +4 -4
  52. package/dist/assets/{mindmap-definition-FAOFIHXS-B4GOIn76.js → mindmap-definition-FAOFIHXS-7fzz0Exr.js} +1 -1
  53. package/dist/assets/{pegDiagram-VL7TDLO6-BHur7aH2.js → pegDiagram-VL7TDLO6-DTiRFRfv.js} +1 -1
  54. package/dist/assets/{pieDiagram-7S7Q4E2Y-Cw0UELLV.js → pieDiagram-7S7Q4E2Y-BU4cScsB.js} +1 -1
  55. package/dist/assets/{quadrantDiagram-CIZ2JOQS-CB2BrX3g.js → quadrantDiagram-CIZ2JOQS-Cc13j5j0.js} +1 -1
  56. package/dist/assets/{railroadDiagram-AXF67PYL-DPYZYmLX.js → railroadDiagram-AXF67PYL-CfB467SJ.js} +1 -1
  57. package/dist/assets/{requirementDiagram-LRYGKXZP-DSX4IJ1n.js → requirementDiagram-LRYGKXZP-BddSRoQa.js} +1 -1
  58. package/dist/assets/{sankeyDiagram-W5VNT64P-TenC3ZQo.js → sankeyDiagram-W5VNT64P-D33-L55R.js} +1 -1
  59. package/dist/assets/{sequenceDiagram-SI44F4Z6-DltGsf3F.js → sequenceDiagram-SI44F4Z6-BP7gKO1m.js} +1 -1
  60. package/dist/assets/{sizeCapture-X5ZJPWSS-D7llwbJZ.js → sizeCapture-X5ZJPWSS-DLmxTSos.js} +1 -1
  61. package/dist/assets/{stateDiagram-OKZ733FA-C-hAvbnY.js → stateDiagram-OKZ733FA-2fN5h0fl.js} +1 -1
  62. package/dist/assets/stateDiagram-v2-UEYNNEHI-ddGXuRHz.js +1 -0
  63. package/dist/assets/{swimlanes-SLNWSIFB-DWD30fv6.js → swimlanes-SLNWSIFB-m6QzM3CR.js} +2 -2
  64. package/dist/assets/swimlanesDiagram-ULZ7WXOC-DNmdh3Nm.js +8 -0
  65. package/dist/assets/{timeline-definition-Z64GVDOM-quWmimSE.js → timeline-definition-Z64GVDOM-B-4XL-3f.js} +1 -1
  66. package/dist/assets/{vennDiagram-T6HMQDX7-aUQcm8h5.js → vennDiagram-T6HMQDX7-C-2U26ta.js} +1 -1
  67. package/dist/assets/{wardleyDiagram-T6FBY63Y-BZ0bwsFQ.js → wardleyDiagram-T6FBY63Y-BM4F1_6i.js} +1 -1
  68. package/dist/assets/{xychartDiagram-ELKLHX3M-DOVzAq63.js → xychartDiagram-ELKLHX3M-BWBCnHJm.js} +1 -1
  69. package/dist/index.html +3 -3
  70. package/dist/sw.js +1 -1
  71. package/package.json +5 -1
  72. package/dist/assets/channel-BGDgNNQz.js +0 -1
  73. package/dist/assets/classDiagram-JCYQIIEL-C2SNM4oy.js +0 -1
  74. package/dist/assets/classDiagram-v2-OCEON4UE-C2SNM4oy.js +0 -1
  75. package/dist/assets/feature-chat-CvOCyaLe.js +0 -88
  76. package/dist/assets/stateDiagram-v2-UEYNNEHI-DaYSFcRQ.js +0 -1
  77. package/dist/assets/swimlanesDiagram-ULZ7WXOC-LTkF2T6t.js +0 -8
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeEditor-FvgsnJ7J.js","assets/vendor-react-C2GTiUCy.js","assets/MarkdownPreview-PEEWVWeS.js","assets/vendor-markdown-DkITEES2.js","assets/feature-chat-CvOCyaLe.js","assets/feature-workspace-CAB6bgPy.js","assets/vendor-ui-CAUHSABu.js","assets/vendor-i18n-B6HjLCnN.js","assets/vendor-data-DsEZeNPr.js","assets/FileTree-NLULrBDi.js","assets/StandaloneShell-BkuUCPZP.js","assets/Shell-BEx66cW_.js","assets/Shell-DrlLKa8f.css","assets/GitPanel-51KUBbEW.js","assets/index-Btkf0_rU.js","assets/index-Gqazqfs3.js","assets/TaskMasterPanel-DfQG80SF.js"])))=>i.map(i=>d[i]);
2
- import{j as e,r,d as bt,u as vt,f as Kt,B as _t,h as Yt,i as We,k as Jt}from"./vendor-react-C2GTiUCy.js";import{L as kt,aa as Qt,a as ae,ab as Zt,ac as Xt,a6 as xt,ad as Be,c as ie,_ as ee,ae as yt,af as en,a4 as tn,ag as nn,ah as sn,ai as Ve,f as an,aj as wt,a2 as on,ak as Ct,u as St,h as rn,D as ln,z as cn,A as dn,E as un,F as pn,G as mn,H as gn,J as se,K as V,al as hn,am as fn,an as bn,ao as Pt,ap as vn,a3 as kn,aq as xn,ar as Ke,as as yn,at as wn,au as Cn,av as Sn,aw as Pn,ax as An}from"./feature-workspace-CAB6bgPy.js";import{o as Ge,G as He,aG as Oe,bB as jn,a3 as Tn,ao as Ue,L as we,t as Ce,n as In,a8 as En,a9 as At,Q as jt,bC as _e,bD as Mn,j as Tt,U as zn,F as It,z as Dn,bE as Nn,X as Et,bF as $n,S as Rn,bG as Ln,R as Mt,bA as Fn,bH as Bn,$ as Gn,bs as Hn,bv as On,a5 as Un,x as qn,B as Wn,M as Vn,c as Kn,bI as _n,bJ as Yn,bK as Jn,aa as Qn}from"./vendor-ui-CAUHSABu.js";import{u as Z,i as qe,a as Zn,I as Xn}from"./vendor-i18n-B6HjLCnN.js";import{C as es,r as ts,c as ns}from"./feature-chat-CvOCyaLe.js";import"./vendor-data-DsEZeNPr.js";import"./vendor-markdown-DkITEES2.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();function ss({provider:t,title:s,status:n,connectedClassName:i,iconContainerClassName:a,loginButtonClassName:o,onLogin:l}){const c=n.authenticated?i:"border-border bg-card",u=n.loading?"Checking...":n.authenticated?n.email||"Connected":n.error||"Not connected";return e.jsx("div",{className:`rounded-xl border px-3 py-2.5 transition-colors ${c}`,children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("div",{className:`flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-full ${a}`,children:e.jsx(kt,{provider:t,className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-sm font-medium text-foreground",children:[s,n.authenticated&&e.jsx(Ge,{className:"h-3.5 w-3.5 flex-shrink-0 text-emerald-500"})]}),e.jsx("div",{className:"truncate text-xs text-muted-foreground",title:u,children:u})]})]}),!n.authenticated&&!n.loading&&e.jsx("button",{onClick:l,className:`${o} flex-shrink-0 rounded-lg px-4 py-1.5 text-sm font-medium text-white transition-colors`,children:"Login"})]})})}const is=[{provider:"claude",title:"Claude Code",connectedClassName:"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800",iconContainerClassName:"bg-blue-100 dark:bg-blue-900/30",loginButtonClassName:"bg-blue-600 hover:bg-blue-700"},{provider:"cursor",title:"Cursor",connectedClassName:"bg-purple-50 dark:bg-purple-900/20 border-purple-200 dark:border-purple-800",iconContainerClassName:"bg-purple-100 dark:bg-purple-900/30",loginButtonClassName:"bg-purple-600 hover:bg-purple-700"},{provider:"codex",title:"OpenAI Codex",connectedClassName:"bg-gray-100 dark:bg-gray-800/50 border-gray-300 dark:border-gray-600",iconContainerClassName:"bg-gray-100 dark:bg-gray-800",loginButtonClassName:"bg-gray-800 hover:bg-gray-900 dark:bg-gray-700 dark:hover:bg-gray-600"},{provider:"opencode",title:"OpenCode",connectedClassName:"bg-zinc-100 dark:bg-zinc-800/50 border-zinc-300 dark:border-zinc-600",iconContainerClassName:"bg-zinc-100 dark:bg-zinc-800",loginButtonClassName:"bg-zinc-800 hover:bg-zinc-900 dark:bg-zinc-700 dark:hover:bg-zinc-600"}];function as({providerStatuses:t,onOpenProviderLogin:s}){return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"font-serif text-xl font-bold tracking-tight text-foreground",children:"Connect Your AI Agents"}),e.jsx("p",{className:"mx-auto mt-1 max-w-sm text-sm leading-relaxed text-muted-foreground",children:"Login to one or more AI coding assistants. All are optional."})]}),e.jsx("div",{className:"-mr-1 max-h-[38vh] space-y-2 overflow-y-auto pr-1",children:is.map(n=>e.jsx(ss,{provider:n.provider,title:n.title,status:t[n.provider],connectedClassName:n.connectedClassName,iconContainerClassName:n.iconContainerClassName,loginButtonClassName:n.loginButtonClassName,onLogin:()=>s(n.provider)},n.provider))}),e.jsx("p",{className:"text-center text-xs text-muted-foreground",children:"You can configure these later in Settings."})]})}function os({gitName:t,gitEmail:s,isSubmitting:n,onGitNameChange:i,onGitEmailChange:a}){return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"mx-auto mb-3 flex h-14 w-14 items-center justify-center rounded-2xl bg-primary/10 ring-1 ring-inset ring-primary/20",children:e.jsx(He,{className:"h-7 w-7 text-primary"})}),e.jsx("h2",{className:"font-serif text-xl font-bold tracking-tight text-foreground",children:"Git Configuration"}),e.jsx("p",{className:"mx-auto mt-1 max-w-sm text-sm leading-relaxed text-muted-foreground",children:"Configure your git identity to ensure proper attribution for commits."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"gitName",className:"mb-2 flex items-center gap-2 text-sm font-medium text-foreground",children:[e.jsx(Oe,{className:"h-4 w-4"}),"Git Name ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",id:"gitName",value:t,onChange:o=>i(o.target.value),className:"w-full rounded-xl border border-border bg-background/60 px-4 py-2.5 text-foreground shadow-sm transition-colors placeholder:text-muted-foreground/60 hover:border-foreground/20 focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/30",placeholder:"John Doe",required:!0,disabled:n}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Saved as `git config --global user.name`."})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"gitEmail",className:"mb-2 flex items-center gap-2 text-sm font-medium text-foreground",children:[e.jsx(jn,{className:"h-4 w-4"}),"Git Email ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"email",id:"gitEmail",value:s,onChange:o=>a(o.target.value),className:"w-full rounded-xl border border-border bg-background/60 px-4 py-2.5 text-foreground shadow-sm transition-colors placeholder:text-muted-foreground/60 hover:border-foreground/20 focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/30",placeholder:"john@example.com",required:!0,disabled:n}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Saved as `git config --global user.email`."})]})]})]})}const Ye=[{title:"Git Configuration",icon:He,required:!0},{title:"Connect Agents",icon:Tn,required:!1}];function rs({currentStep:t}){return e.jsx("div",{className:"mb-5",children:e.jsx("div",{className:"flex items-center justify-between",children:Ye.map((s,n)=>{const i=n<t,a=n===t,o=s.icon;return e.jsxs("div",{className:"contents",children:[e.jsxs("div",{className:"flex flex-1 flex-col items-center",children:[e.jsx("div",{className:`flex h-10 w-10 items-center justify-center rounded-full border-2 transition-all duration-200 ${i?"border-emerald-500 bg-emerald-500 text-white shadow-lg shadow-emerald-500/25":a?"border-primary bg-primary text-primary-foreground shadow-lg shadow-primary/25":"border-border bg-card text-muted-foreground"}`,children:i?e.jsx(Ge,{className:"h-5 w-5"}):e.jsx(o,{className:"h-5 w-5"})}),e.jsxs("div",{className:"mt-1.5 text-center",children:[e.jsx("p",{className:`text-sm font-medium ${a?"text-foreground":"text-muted-foreground"}`,children:s.title}),s.required&&e.jsx("span",{className:"text-xs text-red-500",children:"Required"})]})]}),n<Ye.length-1&&e.jsx("div",{className:`mx-2 h-0.5 flex-1 transition-colors duration-200 ${i?"bg-emerald-500":"bg-border"}`})]},s.title)})})})}const Je=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Qe=async(t,s)=>{try{return(await t.json()).error||s}catch{return s}};function Ze({onComplete:t}){const[s,n]=r.useState(0),[i,a]=r.useState(""),[o,l]=r.useState(""),[c,u]=r.useState(!1),[d,g]=r.useState(""),[p,b]=r.useState(null),{providerAuthStatus:m,checkProviderAuthStatus:v,refreshProviderAuthStatuses:k}=Qt(),M=r.useRef(void 0),x=r.useCallback(async()=>{try{const P=await ae("/api/user/git-config");if(!P.ok)return;const N=await P.json();N.gitName&&a(N.gitName),N.gitEmail&&l(N.gitEmail)}catch(P){console.error("Error loading git config:",P)}},[]);r.useEffect(()=>{x(),k()},[x,k]),r.useEffect(()=>{const P=M.current;M.current=p,P!=null&&p===null&&k()},[p,k]);const A=P=>{b(P)},y=P=>{P===0&&p&&v(p)},E=async()=>{if(g(""),s!==0){n(P=>P+1);return}if(!i.trim()||!o.trim()){g("Both git name and email are required.");return}if(!Je.test(o)){g("Please enter a valid email address.");return}u(!0);try{const P=await ae("/api/user/git-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gitName:i,gitEmail:o})});if(!P.ok){const N=await Qe(P,"Failed to save git configuration");throw new Error(N)}n(N=>N+1)}catch(P){g(P instanceof Error?P.message:"Failed to save git configuration")}finally{u(!1)}},L=()=>{g(""),n(P=>P-1)},D=async()=>{u(!0),g("");try{const P=await ae("/api/user/complete-onboarding",{method:"POST"});if(!P.ok){const N=await Qe(P,"Failed to complete onboarding");throw new Error(N)}await t?.()}catch(P){g(P instanceof Error?P.message:"Failed to complete onboarding")}finally{u(!1)}},F=s===0?!!(i.trim()&&o.trim()&&Je.test(o)):!0;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative h-screen overflow-y-auto bg-background",children:[e.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none fixed inset-0",children:[e.jsx("div",{className:"absolute -top-40 left-1/2 h-[36rem] w-[36rem] -translate-x-1/2 rounded-full bg-primary/10 blur-3xl"}),e.jsx("div",{className:"absolute -bottom-32 -left-24 h-[26rem] w-[26rem] rounded-full bg-primary/5 blur-3xl"}),e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(hsl(var(--foreground)/0.04)_1px,transparent_1px)] opacity-60 [background-size:22px_22px]"})]}),e.jsx("div",{className:"relative mx-auto flex min-h-full w-full max-w-2xl items-center justify-center p-4",children:e.jsxs("div",{className:"w-full py-6",children:[e.jsx(rs,{currentStep:s}),e.jsxs("div",{className:"rounded-2xl border border-border/70 bg-card/90 p-6 shadow-[0_24px_60px_-20px_hsl(var(--foreground)/0.18)] ring-1 ring-foreground/5 backdrop-blur-xl",children:[s===0?e.jsx(os,{gitName:i,gitEmail:o,isSubmitting:c,onGitNameChange:a,onGitEmailChange:l}):e.jsx(as,{providerStatuses:m,onOpenProviderLogin:A}),d&&e.jsx("div",{role:"alert",className:"mt-5 rounded-xl border border-destructive/30 bg-destructive/10 p-3.5",children:e.jsx("p",{className:"text-sm text-destructive",children:d})}),e.jsxs("div",{className:"mt-6 flex items-center justify-between border-t border-border pt-5",children:[e.jsxs("button",{onClick:L,disabled:s===0||c,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-muted-foreground transition-colors duration-200 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",children:[e.jsx(Ue,{className:"h-4 w-4"}),"Previous"]}),e.jsx("div",{className:"flex items-center gap-3",children:s<1?e.jsx("button",{onClick:E,disabled:!F||c,className:"flex items-center gap-2 rounded-xl bg-primary px-6 py-2.5 font-medium text-primary-foreground shadow-lg shadow-primary/25 transition-all duration-200 hover:brightness-110 active:scale-[0.99] disabled:cursor-not-allowed disabled:opacity-60 disabled:shadow-none",children:c?e.jsxs(e.Fragment,{children:[e.jsx(we,{className:"h-4 w-4 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:["Next",e.jsx(Ce,{className:"h-4 w-4"})]})}):e.jsx("button",{onClick:D,disabled:c,className:"flex items-center gap-2 rounded-xl bg-emerald-600 px-6 py-2.5 font-medium text-white shadow-lg shadow-emerald-600/25 transition-all duration-200 hover:bg-emerald-700 active:scale-[0.99] disabled:cursor-not-allowed disabled:opacity-60 disabled:shadow-none",children:c?e.jsxs(e.Fragment,{children:[e.jsx(we,{className:"h-4 w-4 animate-spin"}),"Completing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ge,{className:"h-4 w-4"}),"Complete Setup"]})})})]})]})]})})]}),p&&e.jsx(Zt,{isOpen:!!p,onClose:()=>b(null),provider:p,onComplete:y})]})}const ls=["0s","0.15s","0.3s"];function cs(){return e.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[e.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0",children:e.jsx("div",{className:"absolute -top-40 left-1/2 h-[36rem] w-[36rem] -translate-x-1/2 rounded-full bg-primary/10 blur-3xl"})}),e.jsxs("div",{className:"relative text-center",role:"status","aria-live":"polite",children:[e.jsx("div",{className:"mb-5 flex justify-center",children:e.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gradient-to-br from-primary to-primary/80 shadow-lg shadow-primary/25 ring-1 ring-inset ring-white/20",children:e.jsx("img",{src:"/logo.svg",alt:"WindCli",className:"h-9 w-9"})})}),e.jsx("h1",{className:"mb-4 text-2xl font-bold tracking-tight text-foreground",style:{fontFamily:Xt},children:"WindCli"}),e.jsx("p",{className:"sr-only",children:"Loading authentication state…"}),e.jsx("div",{"aria-hidden":!0,className:"flex items-center justify-center gap-2",children:ls.map(t=>e.jsx("div",{className:"h-2 w-2 animate-bounce rounded-full bg-primary",style:{animationDelay:t}},t))})]})]})}function zt({errorMessage:t}){return t?e.jsxs("div",{role:"alert",className:"flex items-start gap-2.5 rounded-xl border border-destructive/30 bg-destructive/10 p-3 text-destructive",children:[e.jsx(In,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),e.jsx("p",{className:"text-sm leading-relaxed",children:t})]}):null}function fe({id:t,label:s,value:n,onChange:i,placeholder:a,isDisabled:o,type:l="text",name:c,autoComplete:u,icon:d}){const[g,p]=r.useState(!1),b=l==="password",m=b&&g?"text":l;return e.jsxs("div",{children:[e.jsx("label",{htmlFor:t,className:"mb-1.5 block text-sm font-medium text-foreground",children:s}),e.jsxs("div",{className:"group relative",children:[d&&e.jsx(d,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground transition-colors group-focus-within:text-primary"}),e.jsx("input",{id:t,type:m,name:c??t,autoComplete:u,value:n,onChange:v=>i(v.target.value),className:`w-full rounded-xl border border-border bg-background/60 py-2.5 text-foreground shadow-sm transition-colors placeholder:text-muted-foreground/60 hover:border-foreground/20 focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/30 disabled:cursor-not-allowed disabled:opacity-60 ${d?"pl-10":"pl-3.5"} ${b?"pr-11":"pr-3.5"}`,placeholder:a,required:!0,disabled:o}),b&&e.jsx("button",{type:"button",onClick:()=>p(v=>!v),disabled:o,"aria-label":g?"Hide password":"Show password",className:"absolute right-2 top-1/2 flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 disabled:opacity-60",children:g?e.jsx(En,{className:"h-4 w-4"}):e.jsx(At,{className:"h-4 w-4"})})]})]})}function Dt({title:t,description:s,children:n,footerText:i,logo:a}){return e.jsxs("div",{className:"relative h-screen overflow-y-auto bg-background",children:[e.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none fixed inset-0",children:[e.jsx("div",{className:"absolute -top-40 left-1/2 h-[36rem] w-[36rem] -translate-x-1/2 rounded-full bg-primary/10 blur-3xl"}),e.jsx("div",{className:"absolute -bottom-32 -left-24 h-[26rem] w-[26rem] rounded-full bg-primary/5 blur-3xl"}),e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(hsl(var(--foreground)/0.04)_1px,transparent_1px)] opacity-60 [background-size:22px_22px]"})]}),e.jsx("div",{className:"relative mx-auto flex min-h-full w-full max-w-md items-center justify-center p-4 py-8",children:e.jsxs("div",{className:"w-full rounded-2xl border border-border/70 bg-card/90 p-8 shadow-[0_24px_60px_-20px_hsl(var(--foreground)/0.18)] ring-1 ring-foreground/5 backdrop-blur-xl sm:p-10",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"mb-5 flex justify-center",children:a??e.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gradient-to-br from-primary to-primary/80 shadow-lg shadow-primary/25 ring-1 ring-inset ring-white/20",children:e.jsx("img",{src:"/logo.svg",alt:"WindCli",className:"h-9 w-9"})})}),e.jsx("h1",{className:"font-serif text-3xl font-bold tracking-tight text-foreground",children:t}),e.jsx("p",{className:"mx-auto mt-2 max-w-xs text-sm leading-relaxed text-muted-foreground",children:s})]}),e.jsx("div",{className:"mt-8",children:n}),e.jsx("div",{className:"mt-6 border-t border-border/60 pt-5 text-center",children:e.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:i})}),!xt&&e.jsxs("div",{className:"mt-4 flex items-center justify-center gap-1.5",children:[e.jsx("svg",{className:"h-3.5 w-3.5 text-muted-foreground/50",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"})}),e.jsx("a",{href:"https://github.com/CaineWind/wacli",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground/50 transition-colors hover:text-muted-foreground",children:"WindCli is open source"})]})]})})]})}const ds={username:"",password:""};function us(){const{t}=Z("auth"),{error:s,login:n}=Be(),[i,a]=r.useState(ds),[o,l]=r.useState(""),[c,u]=r.useState(!1),d=r.useCallback((p,b)=>{a(m=>({...m,[p]:b}))},[]),g=r.useCallback(async p=>{if(p.preventDefault(),l(""),!i.username.trim()||!i.password){l(t("login.errors.requiredFields"));return}u(!0);const b=await n(i.username.trim(),i.password);b.success||l(b.error),u(!1)},[i.password,i.username,n,t]);return e.jsx(Dt,{title:t("login.title"),description:t("login.description"),footerText:"Enter your credentials to access WindCli",children:e.jsxs("form",{onSubmit:g,className:"space-y-4",children:[e.jsx(fe,{id:"username",label:t("login.username"),value:i.username,onChange:p=>d("username",p),placeholder:t("login.placeholders.username"),isDisabled:c,autoComplete:"username",icon:Oe}),e.jsx(fe,{id:"password",label:t("login.password"),value:i.password,onChange:p=>d("password",p),placeholder:t("login.placeholders.password"),isDisabled:c,type:"password",autoComplete:"current-password",icon:jt}),e.jsx(zt,{errorMessage:o||s||""}),e.jsx("button",{type:"submit",disabled:c,className:"flex w-full items-center justify-center gap-2 rounded-xl bg-primary px-4 py-2.5 font-medium text-primary-foreground shadow-lg shadow-primary/25 transition-all duration-200 hover:shadow-primary/30 hover:brightness-110 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-2 focus:ring-offset-card active:scale-[0.99] disabled:cursor-not-allowed disabled:opacity-60",children:c?e.jsxs(e.Fragment,{children:[e.jsx(we,{className:"h-4 w-4 animate-spin"}),t("login.loading")]}):t("login.submit")})]})})}const ps={username:"",password:"",confirmPassword:""};function ms(t){return!t.username.trim()||!t.password||!t.confirmPassword?"Please fill in all fields.":t.username.trim().length<3?"Username must be at least 3 characters long.":t.password.length<6?"Password must be at least 6 characters long.":t.password!==t.confirmPassword?"Passwords do not match.":null}function gs(){const{register:t}=Be(),[s,n]=r.useState(ps),[i,a]=r.useState(""),[o,l]=r.useState(!1),c=r.useCallback((d,g)=>{n(p=>({...p,[d]:g}))},[]),u=r.useCallback(async d=>{d.preventDefault(),a("");const g=ms(s);if(g){a(g);return}l(!0);const p=await t(s.username.trim(),s.password);p.success||a(p.error),l(!1)},[s,t]);return e.jsx(Dt,{title:"Welcome to WindCli",description:"Set up your account to get started",footerText:"This is a single-user system. Only one account can be created.",children:e.jsxs("form",{onSubmit:u,className:"space-y-4",children:[e.jsx(fe,{id:"username",name:"username",label:"Username",value:s.username,onChange:d=>c("username",d),placeholder:"Choose a username",isDisabled:o,autoComplete:"username",icon:Oe}),e.jsx(fe,{id:"password",name:"password",label:"Password",value:s.password,onChange:d=>c("password",d),placeholder:"Create a password",isDisabled:o,type:"password",autoComplete:"new-password",icon:jt}),e.jsx(fe,{id:"confirmPassword",name:"confirmPassword",label:"Confirm Password",value:s.confirmPassword,onChange:d=>c("confirmPassword",d),placeholder:"Re-enter your password",isDisabled:o,type:"password",autoComplete:"new-password",icon:_e}),e.jsxs("p",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(_e,{className:"h-3.5 w-3.5"}),"At least 3 characters for username, 6 for password."]}),e.jsx(zt,{errorMessage:i}),e.jsx("button",{type:"submit",disabled:o,className:"flex w-full items-center justify-center gap-2 rounded-xl bg-primary px-4 py-2.5 font-medium text-primary-foreground shadow-lg shadow-primary/25 transition-all duration-200 hover:shadow-primary/30 hover:brightness-110 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-2 focus:ring-offset-card active:scale-[0.99] disabled:cursor-not-allowed disabled:opacity-60",children:o?e.jsxs(e.Fragment,{children:[e.jsx(we,{className:"h-4 w-4 animate-spin"}),"Setting up..."]}):"Create Account"})]})})}function hs({children:t}){const{user:s,isLoading:n,needsSetup:i,hasCompletedOnboarding:a,refreshOnboardingStatus:o}=Be();return n?e.jsx(cs,{}):xt?a?e.jsx(e.Fragment,{children:t}):e.jsx(Ze,{onComplete:o}):i?e.jsx(gs,{}):s?a?e.jsx(e.Fragment,{children:t}):e.jsx(Ze,{onComplete:o}):e.jsx(us,{})}const Re=t=>t.replace(/\\/g,"/"),Nt=(t,s)=>{for(const n of t)n.type==="file"?s.push({name:n.name,path:n.path}):n.children&&n.children.length>0&&Nt(n.children,s)},fs=(t,s)=>{const n=Re(s).replace(/^\.\//,"").replace(/^\/+/,"");if(!n)return null;const i=t.find(o=>{const l=Re(o.path);return l===n||l.endsWith(`/${n}`)});if(i)return i.path;const a=n.split("/").pop()||n;return t.find(o=>o.name===a)?.path??null};function bs(t,s){const n=t?.projectId,i=r.useRef({projectId:void 0,files:null}),a=r.useCallback(()=>{if(!n)return Promise.resolve([]);if(i.current.projectId===n&&i.current.files)return i.current.files;const o=(async()=>{try{const l=await ie.getFiles(n);if(!l.ok)return[];const c=await l.json(),u=Array.isArray(c)?c:[],d=[];return Nt(u,d),d}catch{return[]}})();return i.current={projectId:n,files:o},o},[n]);return r.useCallback((o,l)=>{const c=Re(o).trim();a().then(u=>{const d=fs(u,c);s(d??o,l)})},[a,s])}const vs=({selectedProject:t,isMobile:s,initialWidth:n=600})=>{const[i,a]=r.useState(null),[o,l]=r.useState(n),[c,u]=r.useState(!1),[d,g]=r.useState(!1),[p,b]=r.useState(!1),m=r.useRef(null),v=r.useCallback((A,y=null)=>{const L=A.replace(/\\/g,"/").split("/").pop()||A;a({name:L,path:A,projectId:t?.projectId,diffInfo:y})},[t?.projectId]),k=r.useCallback(()=>{a(null),u(!1)},[]),M=r.useCallback(()=>{u(A=>!A)},[]),x=r.useCallback(A=>{s||(b(!0),g(!0),A.preventDefault())},[s]);return r.useEffect(()=>{const A=E=>{if(!d)return;const D=m.current?.parentElement?.parentElement;if(!D)return;const F=D.getBoundingClientRect(),P=F.right-E.clientX,N=300,K=F.width*.8;P>=N&&P<=K&&l(P)},y=()=>{g(!1)};return d&&(document.addEventListener("mousemove",A),document.addEventListener("mouseup",y),document.body.style.cursor="col-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",y),document.body.style.cursor="",document.body.style.userSelect=""}},[d]),{editingFile:i,editorWidth:o,editorExpanded:c,hasManualWidth:p,resizeHandleRef:m,handleFileOpen:v,handleCloseEditor:k,handleToggleEditorExpand:M,handleResizeStart:x}},Xe=r.lazy(()=>ee(()=>import("./CodeEditor-FvgsnJ7J.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])));function et(){return e.jsx("div",{className:"flex h-full min-h-0 flex-1 items-center justify-center",role:"status","aria-label":"Loading editor",children:e.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-muted-foreground/30 border-t-muted-foreground"})})}const ks=200,De=280;function xs({editingFile:t,isMobile:s,editorExpanded:n,editorWidth:i,hasManualWidth:a,resizeHandleRef:o,onResizeStart:l,onCloseEditor:c,onToggleEditorExpand:u,projectPath:d,fillSpace:g}){const[p,b]=r.useState(!1),m=r.useRef(null),[v,k]=r.useState(i);if(r.useEffect(()=>{if(!t||s||p)return;const x=()=>{if(!m.current)return;const E=m.current.parentElement;if(!E)return;const D=E.clientWidth-ks;D<De?b(!0):i>D?k(D):k(i)};x(),window.addEventListener("resize",x);const A=new ResizeObserver(x),y=m.current?.parentElement;return y&&A.observe(y),()=>{window.removeEventListener("resize",x),A.disconnect()}},[t,s,p,i]),!t)return null;if(s||p)return e.jsx(r.Suspense,{fallback:e.jsx(et,{}),children:e.jsx(Xe,{file:t,onClose:()=>{b(!1),c()},projectPath:d,isSidebar:!1})});const M=n||g&&!a;return e.jsxs("div",{ref:m,className:`flex h-full min-w-0 ${n?"flex-1":""}`,children:[!n&&e.jsx("div",{ref:o,onMouseDown:l,className:"group relative w-1 flex-shrink-0 cursor-col-resize bg-gray-200 transition-colors hover:bg-blue-500 dark:bg-gray-700 dark:hover:bg-blue-600",title:"Drag to resize",children:e.jsx("div",{className:"absolute inset-y-0 left-1/2 w-1 -translate-x-1/2 bg-blue-500 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-blue-600"})}),e.jsx("div",{className:`h-full overflow-hidden border-l border-gray-200 dark:border-gray-700 ${M?"min-w-0 flex-1":`min-w-[ flex-shrink-0${De}px]`}`,style:M?void 0:{width:`${v}px`,minWidth:`${De}px`},children:e.jsx(r.Suspense,{fallback:e.jsx(et,{}),children:e.jsx(Xe,{file:t,onClose:c,projectPath:d,isSidebar:!0,isExpanded:n,onToggleExpand:u,onPopOut:()=>b(!0)})})})]})}function ys({hasSelectedProject:t,children:s}){const n=t?"flex min-w-0 flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-3":"flex min-w-0 flex-row items-center justify-between gap-2 sm:gap-3";return e.jsx("div",{className:n,children:s})}function ws(t){const s=r.useRef(!1),n=r.useCallback(o=>{o&&(o.preventDefault(),o.stopPropagation()),t()},[t]),i=r.useCallback(o=>{s.current=!0,n(o),window.setTimeout(()=>{s.current=!1},350)},[n]);return{handleMobileMenuClick:r.useCallback(o=>{if(s.current){o.preventDefault(),o.stopPropagation();return}n(o)},[n]),handleMobileMenuTouchEnd:i}}function $t({onMenuClick:t,compact:s=!1}){const{handleMobileMenuClick:n,handleMobileMenuTouchEnd:i}=ws(t),a=s?"flex h-10 w-10 items-center justify-center rounded-lg text-muted-foreground hover:bg-accent/60 hover:text-foreground pwa-menu-button":"flex h-10 w-10 flex-shrink-0 touch-manipulation items-center justify-center rounded-lg text-muted-foreground hover:bg-accent/60 hover:text-foreground active:scale-95 pwa-menu-button";return e.jsx("button",{onClick:n,onTouchEnd:i,className:a,"aria-label":"Open menu",children:e.jsx("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})}const Rt={kind:"builtin",id:"herdr",labelKey:"tabs.herdr",icon:Mn},Cs=[{kind:"builtin",id:"chat",labelKey:"tabs.chat",icon:Tt},{kind:"builtin",id:"shell",labelKey:"tabs.shell",icon:zn},Rt,{kind:"builtin",id:"files",labelKey:"tabs.files",icon:It},{kind:"builtin",id:"git",labelKey:"tabs.git",icon:He}],Ss={kind:"builtin",id:"browser",labelKey:"tabs.browser",icon:Dn},Ps={kind:"builtin",id:"tasks",labelKey:"tabs.tasks",icon:Nn};function As({hasSelectedProject:t,shouldShowTasksTab:s,shouldShowBrowserTab:n}){return t?[...Cs,...n?[Ss]:[],...s?[Ps]:[]]:[Rt]}function js({activeTab:t,setActiveTab:s,hasSelectedProject:n,shouldShowTasksTab:i,shouldShowBrowserTab:a}){const{t:o}=Z(),{plugins:l}=yt(),c=As({hasSelectedProject:n,shouldShowBrowserTab:a,shouldShowTasksTab:i}),u=(n?l:[]).filter(p=>p.enabled).map(p=>({kind:"plugin",id:`plugin:${p.name}`,label:p.displayName,pluginName:p.name,iconFile:p.icon})),d=[...c,...u],g=p=>{const b=p.currentTarget.closest('[role="tablist"]');if(!b)return;const m=Array.from(b.querySelectorAll('[role="tab"]')),v=m.indexOf(p.currentTarget);let k;if(p.key==="ArrowRight")k=(v+1)%m.length;else if(p.key==="ArrowLeft")k=(v-1+m.length)%m.length;else if(p.key==="Home")k=0;else if(p.key==="End")k=m.length-1;else return;p.preventDefault(),m[k]?.focus(),m[k]?.click()};return e.jsx(en,{role:"tablist","aria-label":o("tabs.views",{defaultValue:"Workspace views"}),className:d.length===1?"min-w-max bg-transparent p-0 shadow-none":"min-w-max border border-border/40 bg-muted/50 shadow-inner shadow-black/[0.025] dark:shadow-black/10",children:d.map((p,b)=>{const m=p.id===t,v=p.kind==="builtin"?o(p.labelKey):p.label;return e.jsxs(r.Fragment,{children:[b===c.length&&u.length>0&&e.jsx("span",{"aria-hidden":"true",className:"mx-1 h-4 w-px shrink-0 bg-border"}),e.jsx(tn,{content:v,position:"bottom",children:e.jsxs(nn,{role:"tab","aria-label":v,"aria-selected":m,tabIndex:m?0:-1,isActive:m,onClick:()=>s(p.id),onKeyDown:g,className:"h-10 max-w-44 px-3 py-[5px] sm:h-8 sm:px-2.5",children:[p.kind==="builtin"?e.jsx(p.icon,{className:"h-3.5 w-3.5 shrink-0",strokeWidth:m?2.2:1.8}):e.jsx(sn,{pluginName:p.pluginName,iconFile:p.iconFile,className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center [&>svg]:h-full [&>svg]:w-full"}),e.jsx("span",{className:`${m?"inline max-w-28":"hidden"} truncate sm:max-w-36 lg:inline`,children:v})]})})]},`${p.id}-${b}`)})})}function Ts(t,s,n,i){return t.startsWith("plugin:")&&i?i:t==="files"?n("mainContent.projectFiles"):t==="git"?n("tabs.git"):t==="herdr"?n("tabs.herdr"):t==="tasks"&&s?"TaskMaster":t==="browser"?n("tabs.browser"):"Project"}function Is({activeTab:t,selectedProject:s,selectedSession:n,shouldShowTasksTab:i}){const{t:a}=Z(),{plugins:o}=yt(),l=t.startsWith("plugin:")?o.find(d=>d.name===t.replace("plugin:",""))?.displayName:void 0,c=t==="chat"&&!!n,u=t==="chat"&&!n;return e.jsxs("div",{className:"scrollbar-hide flex min-w-0 flex-1 items-center gap-2 overflow-x-auto",children:[c&&e.jsx("div",{className:"flex h-5 w-5 flex-shrink-0 items-center justify-center",children:e.jsx(kt,{provider:n?.__provider,className:"h-4 w-4"})}),e.jsx("div",{className:"min-w-0 flex-1",children:t==="chat"&&n?e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{title:Ve(n),className:"truncate text-sm font-semibold leading-tight text-foreground",children:Ve(n)}),e.jsx("div",{className:"truncate text-[11px] leading-tight text-muted-foreground",children:s.displayName})]}):u?e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"text-base font-semibold leading-tight text-foreground",children:a("mainContent.newSession")}),e.jsx("div",{className:"truncate text-xs leading-tight text-muted-foreground",children:s.displayName})]}):e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"text-sm font-semibold leading-tight text-foreground",children:Ts(t,i,a,l)}),e.jsx("div",{className:"truncate text-[11px] leading-tight text-muted-foreground",children:s.displayName})]})})]})}function tt({activeTab:t,setActiveTab:s,selectedProject:n,selectedSession:i,shouldShowTasksTab:a,shouldShowBrowserTab:o,isMobile:l,onMenuClick:c}){const{t:u}=Z(),d=r.useRef(null),[g,p]=r.useState(!1),[b,m]=r.useState(!1),v=g||b,k=r.useCallback(()=>{const x=d.current;x&&(p(x.scrollLeft>2),m(x.scrollLeft<x.scrollWidth-x.clientWidth-2))},[]);r.useEffect(()=>{const x=d.current;if(!x)return;k();const A=new ResizeObserver(k);return A.observe(x),x.firstElementChild&&A.observe(x.firstElementChild),()=>A.disconnect()},[k]),r.useEffect(()=>{const x=d.current;if(!x)return;const A=y=>{if(Math.abs(y.deltaY)<=Math.abs(y.deltaX))return;const E=x.scrollWidth-x.clientWidth;if(!(y.deltaY<0?x.scrollLeft>0:x.scrollLeft<E))return;y.preventDefault();const D=y.deltaMode===WheelEvent.DOM_DELTA_LINE?20:1;x.scrollBy({left:y.deltaY*D,behavior:"auto"})};return x.addEventListener("wheel",A,{passive:!1}),()=>x.removeEventListener("wheel",A)},[]),r.useEffect(()=>{const x=window.requestAnimationFrame(()=>{d.current?.querySelector('[role="tab"][aria-selected="true"]')?.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}),k()});return()=>window.cancelAnimationFrame(x)},[t,k]);const M=x=>{const A=d.current;A&&A.scrollBy({left:x*Math.max(180,A.clientWidth*.65),behavior:"smooth"})};return e.jsx("header",{className:"pwa-header-safe flex-shrink-0 border-b border-border/60 bg-background/95 px-3 py-1.5 backdrop-blur-sm sm:px-4 sm:py-2",children:e.jsxs(ys,{hasSelectedProject:!!n,children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2 sm:max-w-[min(34%,24rem)] sm:flex-[1_1_18rem]",children:[l&&e.jsx($t,{onMenuClick:c}),n&&e.jsx(Is,{activeTab:t,selectedProject:n,selectedSession:i,shouldShowTasksTab:a})]}),e.jsx("div",{className:"-mx-3 min-w-0 sm:mx-0 sm:flex-1",children:e.jsxs("div",{className:"relative ml-auto w-fit max-w-full",children:[g&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 z-10 w-12 bg-gradient-to-r from-background via-background/90 to-transparent"}),e.jsx("div",{ref:d,onScroll:k,className:an("scrollbar-hide max-w-full scroll-smooth overflow-x-auto overscroll-x-contain px-3 [-webkit-overflow-scrolling:touch]",v?"sm:px-9":"sm:pl-3 sm:pr-0"),children:e.jsx(js,{activeTab:t,setActiveTab:s,hasSelectedProject:!!n,shouldShowTasksTab:a,shouldShowBrowserTab:o})}),b&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 z-10 w-12 bg-gradient-to-l from-background via-background/90 to-transparent"}),g&&e.jsx("button",{type:"button",onClick:()=>M(-1),"aria-label":u("navigation.scrollTabsLeft",{defaultValue:"Scroll tabs left"}),className:"absolute left-1 top-1/2 z-20 hidden h-7 w-7 -translate-y-1/2 items-center justify-center rounded-md border border-border/70 bg-background/95 text-muted-foreground shadow-sm outline-none hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-primary/60 sm:flex",children:e.jsx(Ue,{className:"h-4 w-4"})}),b&&e.jsx("button",{type:"button",onClick:()=>M(1),"aria-label":u("navigation.scrollTabsRight",{defaultValue:"Scroll tabs right"}),className:"absolute right-1 top-1/2 z-20 hidden h-7 w-7 -translate-y-1/2 items-center justify-center rounded-md border border-border/70 bg-background/95 text-muted-foreground shadow-sm outline-none hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-primary/60 sm:flex",children:e.jsx(Ce,{className:"h-4 w-4"})})]})})]})})}function nt({mode:t,isMobile:s,onMenuClick:n,showMobileHeader:i=!0}){const{t:a}=Z(),o=t==="loading";return e.jsxs("div",{className:"flex h-full flex-col",children:[s&&i&&e.jsx("div",{className:"pwa-header-safe flex-shrink-0 border-b border-border/50 bg-background/80 p-2 backdrop-blur-sm sm:p-3",children:e.jsx($t,{onMenuClick:n,compact:!0})}),o?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsxs("div",{className:"text-center text-muted-foreground",children:[e.jsx("div",{className:"mx-auto mb-4 h-10 w-10",children:e.jsx("div",{className:"h-full w-full rounded-full border-[3px] border-muted border-t-primary",style:{animation:"spin 1s linear infinite",WebkitAnimation:"spin 1s linear infinite",MozAnimation:"spin 1s linear infinite"}})}),e.jsx("h2",{className:"mb-1 text-lg font-semibold text-foreground",children:a("mainContent.loading")}),e.jsx("p",{className:"text-sm",children:a("mainContent.settingUpWorkspace")})]})}):e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsxs("div",{className:"mx-auto max-w-md px-6 text-center",children:[e.jsx("div",{className:"mx-auto mb-5 flex h-14 w-14 items-center justify-center rounded-2xl bg-muted/50",children:e.jsx(It,{className:"h-7 w-7 text-muted-foreground"})}),e.jsx("h2",{className:"mb-2 text-xl font-semibold text-foreground",children:a("mainContent.chooseProject")}),e.jsx("p",{className:"mb-5 text-sm leading-relaxed text-muted-foreground",children:a("mainContent.selectProjectDescription")}),e.jsx("div",{className:"rounded-xl border border-primary/10 bg-primary/5 p-3.5",children:e.jsxs("p",{className:"text-sm text-primary",children:[e.jsxs("strong",{children:[a("mainContent.tip"),":"]})," ",a(s?"mainContent.createProjectMobile":"mainContent.createProjectDesktop")]})})]})})]})}const Es=r.createContext(null),Ne={didCatch:!1,error:null};let Ms=class extends r.Component{constructor(s){super(s),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Ne}static getDerivedStateFromError(s){return{didCatch:!0,error:s}}resetErrorBoundary(){const{error:s}=this.state;if(s!==null){for(var n,i,a=arguments.length,o=new Array(a),l=0;l<a;l++)o[l]=arguments[l];(n=(i=this.props).onReset)===null||n===void 0||n.call(i,{args:o,reason:"imperative-api"}),this.setState(Ne)}}componentDidCatch(s,n){var i,a;(i=(a=this.props).onError)===null||i===void 0||i.call(a,s,n)}componentDidUpdate(s,n){const{didCatch:i}=this.state,{resetKeys:a}=this.props;if(i&&n.error!==null&&zs(s.resetKeys,a)){var o,l;(o=(l=this.props).onReset)===null||o===void 0||o.call(l,{next:a,prev:s.resetKeys,reason:"keys"}),this.setState(Ne)}}render(){const{children:s,fallbackRender:n,FallbackComponent:i,fallback:a}=this.props,{didCatch:o,error:l}=this.state;let c=s;if(o){const u={error:l,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")c=n(u);else if(i)c=r.createElement(i,u);else if(a!==void 0)c=a;else throw l}return r.createElement(Es.Provider,{value:{didCatch:o,error:l,resetErrorBoundary:this.resetErrorBoundary}},c)}};function zs(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.length!==s.length||t.some((n,i)=>!Object.is(n,s[i]))}function Ds(t){return t instanceof Error?`${t.name}: ${t.message}`:String(t)}function Ns({error:t,resetErrorBoundary:s,showDetails:n,componentStack:i}){return e.jsx("div",{className:"flex flex-col items-center justify-center p-8 text-center",children:e.jsxs("div",{className:"max-w-md rounded-lg border border-red-200 bg-red-50 p-6",children:[e.jsxs("div",{className:"mb-4 flex items-center",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx("svg",{className:"h-5 w-5 text-red-400",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})}),e.jsx("h3",{className:"ml-3 text-sm font-medium text-red-800",children:"Something went wrong"})]}),e.jsxs("div",{className:"text-sm text-red-700",children:[e.jsx("p",{className:"mb-2",children:"An error occurred while loading this view."}),n&&e.jsxs("details",{className:"mt-4",children:[e.jsx("summary",{className:"cursor-pointer font-mono text-xs",children:"Error Details"}),e.jsxs("pre",{className:"mt-2 max-h-40 overflow-auto rounded bg-red-100 p-2 text-xs",children:[Ds(t),i]})]})]}),e.jsx("div",{className:"mt-4",children:e.jsx("button",{onClick:s,className:"rounded bg-red-600 px-4 py-2 text-sm text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500",children:"Try Again"})})]})})}function Lt({children:t,showDetails:s=!1,onRetry:n=void 0,resetKeys:i=void 0}){const[a,o]=r.useState(null),l=r.useCallback((d,g)=>{console.error("ErrorBoundary caught an error:",d,g),o(g?.componentStack??null)},[]),c=r.useCallback(()=>{o(null),n?.()},[n]),u=r.useCallback(({error:d,resetErrorBoundary:g})=>e.jsx(Ns,{error:d,resetErrorBoundary:g,showDetails:s,componentStack:a}),[s,a]);return e.jsx(Ms,{fallbackRender:u,onError:l,onReset:c,resetKeys:i,children:t})}const $s=r.lazy(()=>ee(()=>import("./FileTree-NLULrBDi.js"),__vite__mapDeps([9,1,5,6,7,8,3]))),Rs=r.lazy(()=>ee(()=>import("./StandaloneShell-BkuUCPZP.js"),__vite__mapDeps([10,1,11,5,6,7,8,3,12]))),Ls=r.lazy(()=>ee(()=>import("./GitPanel-51KUBbEW.js"),__vite__mapDeps([13,1,5,6,7,8,3]))),Fs=r.lazy(()=>ee(()=>import("./feature-workspace-CAB6bgPy.js").then(t=>t.ay),__vite__mapDeps([5,1,6,7,8,3]))),Bs=r.lazy(()=>ee(()=>import("./index-Btkf0_rU.js"),__vite__mapDeps([14,1,5,6,7,8,3])).then(t=>({default:t.BrowserUsePanel}))),st=r.lazy(()=>ee(()=>import("./index-Gqazqfs3.js"),__vite__mapDeps([15,1,10,11,5,6,7,8,3,12])).then(t=>({default:t.HerdrPanel}))),Gs=r.lazy(()=>ee(()=>import("./TaskMasterPanel-DfQG80SF.js"),__vite__mapDeps([16,5,1,6,7,8,3,4])));function Hs(){return e.jsx("div",{className:"flex h-full w-full items-center justify-center",role:"status","aria-label":"Loading view",children:e.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-muted-foreground/30 border-t-muted-foreground"})})}function X({children:t,resetKey:s}){return e.jsx(Lt,{resetKeys:[s],onRetry:()=>window.location.reload(),children:e.jsx(r.Suspense,{fallback:e.jsx(Hs,{}),children:t})})}function Os({selectedProject:t,selectedSession:s,activeTab:n,setActiveTab:i,ws:a,sendMessage:o,isMobile:l,onMenuClick:c,isLoading:u,onInputFocusChange:d,onSessionProcessing:g,onSessionIdle:p,processingSessions:b,onNavigateToSession:m,onSessionEstablished:v,onShowSettings:k,externalMessageUpdate:M,newSessionTrigger:x,onProjectSelect:A,onProjectsRefresh:y}){const{preferences:E}=wt(),{showRawParameters:L,showThinking:D,sendByCtrlEnter:F}=E,{tasksEnabled:P,isTaskMasterInstalled:N}=on(),[K,U]=r.useState(!1),[W,I]=r.useState(n==="tasks"),H=!!(P&&N),$=K,{editingFile:R,editorWidth:re,editorExpanded:te,hasManualWidth:le,resizeHandleRef:ce,handleFileOpen:f,handleCloseEditor:z,handleToggleEditorExpand:q,handleResizeStart:J}=vs({selectedProject:t,isMobile:l}),Pe=bs(t,f);r.useEffect(()=>{!H&&n==="tasks"&&i("chat")},[H,n,i]),r.useEffect(()=>{n==="tasks"&&I(!0)},[n]);const ue=r.useCallback(async()=>{try{const ne=await ae("/api/browser-use/settings"),be=await ne.json();U(!!(ne.ok&&be?.success!==!1&&be?.data?.settings?.enabled))}catch{U(!1)}},[]);return r.useEffect(()=>(ue(),window.addEventListener("browserUseSettingsChanged",ue),()=>window.removeEventListener("browserUseSettingsChanged",ue)),[ue]),r.useEffect(()=>{!$&&n==="browser"&&i("chat")},[$,n,i]),Ct({openFile:ne=>{i("files"),f(ne)},openFileInEditor:ne=>{Pe(ne)}}),u?e.jsx(nt,{mode:"loading",isMobile:l,onMenuClick:c}):t?e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx(tt,{activeTab:n,setActiveTab:i,selectedProject:t,selectedSession:s,shouldShowTasksTab:H,shouldShowBrowserTab:$,isMobile:l,onMenuClick:c}),e.jsxs("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[e.jsxs("div",{className:`flex min-h-0 min-w-[200px] flex-col overflow-hidden ${te?"hidden":""} flex-1`,children:[e.jsx("div",{className:`h-full ${n==="chat"?"block":"hidden"}`,children:e.jsx(Lt,{showDetails:!0,children:e.jsx(es,{isActive:n==="chat",selectedProject:t,selectedSession:s,ws:a,sendMessage:o,onFileOpen:f,onInputFocusChange:d,onSessionProcessing:g,onSessionIdle:p,processingSessions:b,onNavigateToSession:m,onSessionEstablished:v,onShowSettings:k,showRawParameters:L,showThinking:D,sendByCtrlEnter:F,externalMessageUpdate:M,newSessionTrigger:x,onShowAllTasks:P?()=>i("tasks"):null})})}),n==="files"&&e.jsx("div",{className:"h-full overflow-hidden",children:e.jsx(X,{resetKey:"files",children:e.jsx($s,{selectedProject:t,onFileOpen:f})})}),n==="shell"&&e.jsx("div",{className:"h-full w-full overflow-hidden",children:e.jsx(X,{resetKey:"shell",children:e.jsx(Rs,{project:t,session:s,showHeader:!1,isActive:n==="shell"})})}),n==="herdr"&&e.jsx("div",{className:"h-full w-full overflow-hidden bg-gray-900",children:e.jsx(X,{resetKey:"herdr",children:e.jsx(st,{isActive:n==="herdr"})})}),n==="git"&&e.jsx("div",{className:"h-full overflow-hidden",children:e.jsx(X,{resetKey:"git",children:e.jsx(Ls,{selectedProject:t,isMobile:l,onFileOpen:f,onProjectSelect:A,onProjectsRefresh:y})})}),H&&W&&e.jsx(X,{resetKey:"tasks",children:e.jsx(Gs,{isVisible:n==="tasks"})}),$&&n==="browser"&&e.jsx("div",{className:"h-full overflow-hidden",children:e.jsx(X,{resetKey:"browser",children:e.jsx(Bs,{isVisible:n==="browser",onShowSettings:k})})}),n.startsWith("plugin:")&&e.jsx("div",{className:"h-full overflow-hidden",children:e.jsx(X,{resetKey:n,children:e.jsx(Fs,{pluginName:n.replace("plugin:",""),selectedProject:t,selectedSession:s})})})]}),e.jsx(X,{resetKey:`editor:${R?.path??"closed"}`,children:e.jsx(xs,{editingFile:R,isMobile:l,editorExpanded:te,editorWidth:re,hasManualWidth:le,resizeHandleRef:ce,onResizeStart:J,onCloseEditor:z,onToggleEditorExpand:q,projectPath:t.path,fillSpace:n==="files"})})]})]}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx(tt,{activeTab:n,setActiveTab:i,selectedProject:null,selectedSession:null,shouldShowTasksTab:!1,shouldShowBrowserTab:!1,isMobile:l,onMenuClick:c}),e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:n==="herdr"?e.jsx("div",{className:"h-full w-full overflow-hidden bg-gray-900",children:e.jsx(X,{resetKey:"herdr-empty-project",children:e.jsx(st,{isActive:!0})})}):e.jsx(nt,{mode:"empty",isMobile:l,onMenuClick:c,showMobileHeader:!1})})]})}const Us=bt.memo(Os);function Se(t){const[s,n]=r.useState([]),{enabled:i,deps:a,fetcher:o,parse:l}=t;return r.useEffect(()=>{if(!i){n([]);return}const c=new AbortController;return o(c.signal).then(u=>u.json()).then(u=>{c.signal.aborted||n(l(u))}).catch(u=>{c.signal.aborted||u instanceof DOMException&&u.name==="AbortError"||n([])}),()=>c.abort()},[i,...a]),s}function qs(t,s){return Se({enabled:s&&!!t,deps:[t],fetcher:n=>{const i=new URLSearchParams({limit:"50",offset:"0"});return ae(`/api/projects/${encodeURIComponent(t)}/sessions?${i.toString()}`,{signal:n})},parse:n=>(n.sessions??[]).map(i=>({id:i.id,label:i.title||i.summary||i.name||i.id,provider:i.__provider||i.provider}))})}const Ws=500;function Ft(t,s){for(const n of t){if(s.length>=Ws)return;n.type==="file"?s.push({path:n.path,name:n.name}):n.children&&n.children.length>0&&Ft(n.children,s)}}function Vs(t,s){return Se({enabled:s&&!!t,deps:[t],fetcher:n=>ie.getFiles(t,{signal:n}),parse:n=>{const i=Array.isArray(n)?n:[],a=[];return Ft(i,a),a}})}function Ks(t,s){return Se({enabled:s&&!!t,deps:[t],fetcher:n=>{const i=new URLSearchParams({project:t,limit:"50"});return ae(`/api/git/commits?${i.toString()}`,{signal:n})},parse:n=>n.commits?n.commits.map(i=>({hash:i.hash,shortHash:i.hash.slice(0,7),message:i.message,author:i.author})):[]})}const _s=2,Ys=250;function Js(t,s,n){const[i,a]=r.useState([]),o=r.useRef(0),l=r.useRef(null);return r.useEffect(()=>{const c=s.trim();if(!n||!t||c.length<_s){a([]),l.current?.close(),l.current=null;return}l.current?.close(),l.current=null,o.current++;const u=setTimeout(()=>{const d=++o.current,g=ie.searchConversationsUrl(c),p=new EventSource(g);l.current=p;const b=[];p.addEventListener("result",v=>{if(d!==o.current){p.close();return}try{const M=JSON.parse(v.data).projectResult;if(M.projectId!==t)return;for(const x of M.sessions)b.push({sessionId:x.sessionId,label:x.sessionSummary||x.sessionId,snippet:x.matches[0]?.snippet??"",provider:x.provider});a([...b])}catch{}});const m=()=>{d===o.current&&(p.close(),l.current=null)};p.addEventListener("done",m),p.addEventListener("error",m)},Ys);return()=>{clearTimeout(u)}},[t,s,n]),r.useEffect(()=>()=>{l.current?.close(),l.current=null},[]),i}function Qs(t,s){return Se({enabled:s&&!!t,deps:[t],fetcher:n=>{const i=new URLSearchParams({project:t});return ae(`/api/git/branches?${i.toString()}`,{signal:n})},parse:n=>(n.localBranches??[]).map(i=>({name:i}))})}async function ke(t,s){return(await ae(t,{method:"POST",body:JSON.stringify(s)})).json()}function Zs(t){const s=r.useCallback(()=>t?ke("/api/git/fetch",{project:t}):Promise.resolve(),[t]),n=r.useCallback(()=>t?ke("/api/git/pull",{project:t}):Promise.resolve(),[t]),i=r.useCallback(()=>t?ke("/api/git/push",{project:t}):Promise.resolve(),[t]),a=r.useCallback(o=>t?ke("/api/git/checkout",{project:t,branch:o}):Promise.resolve(),[t]);return{fetch:s,pull:n,push:i,checkout:a}}const it={actions:"Actions",files:"Files",sessions:"Sessions",commits:"Commits",branches:"Branches"},Xs=[{id:"chat",label:"Go to Chat",keywords:"chat messages conversation"},{id:"files",label:"Go to Files",keywords:"files file tree explorer"},{id:"shell",label:"Go to Shell",keywords:"shell terminal console"},{id:"herdr",label:"Go to Herdr",keywords:"herdr agents panes workspace terminal"},{id:"git",label:"Go to Git",keywords:"git diff branches"},{id:"tasks",label:"Go to Tasks",keywords:"tasks taskmaster"}];function ei({selectedProject:t,onStartNewChat:s,onOpenSettings:n,onShowTab:i}){const[a,o]=r.useState(!1),[l,c]=r.useState(""),[u,d]=r.useState([]),{toggleDarkMode:g}=St(),p=vt(),b=rn(),m=u.at(-1);r.useEffect(()=>{const f=z=>{(z.metaKey||z.ctrlKey)&&!z.shiftKey&&!z.altKey&&z.key.toLowerCase()==="k"&&(z.preventDefault(),o(J=>!J))};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[]),r.useEffect(()=>{a||(c(""),d([]))},[a]);const v=t?.projectId,k=!m||m==="actions",M=!m||m==="sessions",x=!m||m==="files",A=!m||m==="commits",y=!m||m==="branches"||m==="actions",E=qs(v,a&&M),L=Js(v,l,a&&M),D=Vs(v,a&&x),F=Ks(v,a&&A),P=Qs(v,a&&y),N=Zs(v),K=r.useMemo(()=>{if(!M)return[];const f=new Map;for(const z of E)f.set(z.id,{id:z.id,label:z.label,provider:z.provider});for(const z of L){const q=f.get(z.sessionId);q?q.snippet=z.snippet:f.set(z.sessionId,{id:z.sessionId,label:z.label,provider:z.provider,snippet:z.snippet})}return Array.from(f.values())},[E,L,M]),U=r.useCallback(f=>{o(!1),f()},[]),W=r.useCallback(f=>{c(""),d(z=>[...z,f])},[]),I=r.useCallback(()=>{c(""),d(f=>f.slice(0,-1))},[]),H=r.useCallback(f=>{f.key==="Backspace"&&!l&&u.length>0&&(f.preventDefault(),I())},[l,u.length,I]),$=!t,R=5,re=m==="files"?D:D.slice(0,R),te=m==="commits"?F:F.slice(0,R),le=m==="sessions"?K:K.slice(0,R),ce=m==="branches"?P:P.slice(0,R);return e.jsx(ln,{open:a,onOpenChange:o,children:e.jsxs(cn,{className:"max-w-xl overflow-hidden p-0",children:[e.jsx(dn,{children:"Command palette"}),e.jsxs(un,{label:"Command palette",onKeyDown:H,children:[m&&e.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-accent px-2 py-0.5 text-xs font-medium text-accent-foreground",children:[it[m],e.jsx("button",{type:"button",onClick:I,"aria-label":"Back to all",className:"ml-0.5 rounded-sm opacity-70 hover:opacity-100",children:e.jsx(Et,{className:"h-3 w-3"})})]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Backspace to go back"})]}),e.jsx(pn,{placeholder:m?`Search ${it[m].toLowerCase()}…`:"Type to search anything…",value:l,onValueChange:c}),e.jsxs(mn,{children:[e.jsx(gn,{children:"No results."}),k&&e.jsxs(se,{heading:"Actions",children:[e.jsxs(V,{value:"Start new chat",disabled:$,onSelect:()=>{t&&U(()=>s(t))},children:[e.jsx($n,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsx("span",{className:"flex-1",children:"Start new chat"}),$&&e.jsx("span",{className:"text-xs text-muted-foreground",children:"Select a project first"})]}),e.jsxs(V,{value:"Open settings",onSelect:()=>U(()=>n()),children:[e.jsx(Rn,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsx("span",{className:"flex-1",children:"Open settings"})]}),e.jsxs(V,{value:"Toggle theme dark light mode",onSelect:()=>U(g),children:[e.jsx(Ln,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsx("span",{className:"flex-1",children:"Toggle theme"})]})]}),k&&e.jsx(se,{heading:"Navigate",children:Xs.map(f=>e.jsx(V,{value:`${f.label} ${f.keywords}`,onSelect:()=>U(()=>i?.(f.id)),children:e.jsx("span",{className:"flex-1",children:f.label})},f.id))}),k&&v&&e.jsxs(se,{heading:"Git",children:[e.jsxs(V,{value:"Git Fetch remote",onSelect:()=>U(()=>{N.fetch(),i?.("git")}),children:[e.jsx(Mt,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsx("span",{className:"flex-1",children:"Git: Fetch"})]}),e.jsxs(V,{value:"Git Pull merge upstream",onSelect:()=>U(()=>{N.pull(),i?.("git")}),children:[e.jsx(Fn,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsx("span",{className:"flex-1",children:"Git: Pull"})]}),e.jsxs(V,{value:"Git Push origin remote",onSelect:()=>U(()=>{N.push(),i?.("git")}),children:[e.jsx(Bn,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsx("span",{className:"flex-1",children:"Git: Push"})]})]}),k&&e.jsx(se,{heading:"Settings",children:hn.map(({id:f,label:z,keywords:q,icon:J})=>e.jsxs(V,{value:`Settings ${z} ${q}`,onSelect:()=>U(()=>n(f)),children:[e.jsx(J,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsxs("span",{className:"flex-1",children:["Settings: ",z]})]},f))}),M&&v&&le.length>0&&e.jsxs(se,{heading:"Sessions",children:[le.map(f=>e.jsxs(V,{value:`${f.label} ${f.snippet??""} ${f.id}`.trim(),onSelect:()=>U(()=>p(`/session/${f.id}`)),children:[e.jsx(Tt,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsx("span",{className:"truncate",children:f.label}),f.snippet&&e.jsx("span",{className:"truncate text-xs text-muted-foreground",children:f.snippet})]}),f.provider&&e.jsx("span",{className:"text-xs text-muted-foreground",children:f.provider})]},f.id)),!m&&K.length>R&&e.jsx(xe,{label:`Browse all sessions (${K.length})`,onSelect:()=>W("sessions")})]}),x&&v&&re.length>0&&e.jsxs(se,{heading:"Files",children:[re.map(f=>e.jsxs(V,{value:f.path,onSelect:()=>U(()=>b.openFile(f.path)),children:[e.jsx(Gn,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsx("span",{className:"flex-1 truncate",children:f.name}),e.jsx("span",{className:"truncate text-xs text-muted-foreground",children:f.path})]},f.path)),!m&&D.length>R&&e.jsx(xe,{label:`Browse all files (${D.length})`,onSelect:()=>W("files")})]}),A&&v&&te.length>0&&e.jsxs(se,{heading:"Commits",children:[te.map(f=>e.jsxs(V,{value:`${f.message} ${f.author} ${f.shortHash}`,onSelect:()=>U(()=>i?.("git")),children:[e.jsx(Hn,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:f.shortHash}),e.jsx("span",{className:"flex-1 truncate",children:f.message}),e.jsx("span",{className:"truncate text-xs text-muted-foreground",children:f.author})]},f.hash)),!m&&F.length>R&&e.jsx(xe,{label:`Browse all commits (${F.length})`,onSelect:()=>W("commits")})]}),y&&v&&ce.length>0&&e.jsxs(se,{heading:"Branches",children:[ce.map(f=>e.jsxs(V,{value:f.name,onSelect:()=>U(()=>{N.checkout(f.name),i?.("git")}),children:[e.jsx(On,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsxs("span",{className:"flex-1 truncate",children:["Switch to: ",f.name]})]},`branch-${f.name}`)),!m&&P.length>R&&e.jsx(xe,{label:`Browse all branches (${P.length})`,onSelect:()=>W("branches")})]})]})]})]})})}function xe({label:t,onSelect:s}){return e.jsxs(V,{value:t,onSelect:s,children:[e.jsx(Ce,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsx("span",{className:"flex-1 text-muted-foreground",children:t})]})}const Le="quickSettingsHandlePosition",he=50,ti=10,ni=90,si=5,Bt="flex items-center justify-between p-3 rounded-lg bg-muted/60 hover:bg-accent transition-colors border border-transparent hover:border-border",ii=`${Bt} cursor-pointer`,ai="h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 focus:ring-2 dark:focus:ring-blue-400 bg-gray-100 dark:bg-gray-800 checked:bg-blue-600 dark:checked:bg-blue-600",oi=[{key:"showRawParameters",labelKey:"quickSettings.showRawParameters",icon:At},{key:"showThinking",labelKey:"quickSettings.showThinking",icon:Wn}],at=[{key:"sendByCtrlEnter",labelKey:"quickSettings.sendByCtrlEnter",icon:Un},{key:"voiceEnabled",labelKey:"quickSettings.voiceEnabled",icon:qn}],Gt=t=>Math.max(ti,Math.min(ni,t)),ri=()=>{if(typeof window>"u")return he;const t=localStorage.getItem(Le);if(!t)return he;try{const s=JSON.parse(t);if(typeof s.y=="number"&&Number.isFinite(s.y))return Gt(s.y)}catch{return localStorage.removeItem(Le),he}return he},ot=t=>t.type.includes("touch"),rt=t=>"touches"in t?t.touches[0]?.clientY??null:"clientY"in t&&typeof t.clientY=="number"?t.clientY:null;function li({isMobile:t}){const[s,n]=r.useState(ri),[i,a]=r.useState(!1),[o,l]=r.useState(!1),c=r.useRef(null),u=r.useRef(he),d=r.useRef(!1),g=r.useRef(!1),p=r.useRef(!1),b=r.useCallback(()=>{p.current&&(document.body.style.cursor="",document.body.style.userSelect="",document.body.style.overflow="",document.body.style.position="",document.body.style.width="",p.current=!1)},[]),m=r.useCallback(y=>{p.current||(document.body.style.cursor="grabbing",document.body.style.userSelect="none",y&&(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%"),p.current=!0)},[]),v=r.useCallback(()=>{!i&&c.current===null||(g.current=d.current,d.current=!1,c.current=null,a(!1),l(!1),b())},[b,i]),k=r.useCallback(y=>{if(!i||c.current===null)return;const E=rt(y);if(E===null)return;const L=E-c.current,D=Math.abs(L)>si;if(!d.current&&D&&(d.current=!0,l(!0),m(ot(y))),!d.current)return;ot(y)&&y.preventDefault();const F=Math.max(window.innerHeight,1),P=L/F*100,N=t?-P:P;n(Gt(u.current+N))},[m,t,i]),M=r.useCallback(y=>{y.stopPropagation();const E=rt(y);E!==null&&(c.current=E,u.current=s,d.current=!1,l(!1),a(!0))},[s]);r.useEffect(()=>{localStorage.setItem(Le,JSON.stringify({y:s}))},[s]),r.useEffect(()=>{if(!i)return;const y=F=>{k(F)},E=()=>{v()},L=F=>{k(F)},D=()=>{v()};return document.addEventListener("mousemove",y),document.addEventListener("mouseup",E),document.addEventListener("touchmove",L,{passive:!1}),document.addEventListener("touchend",D),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",E),document.removeEventListener("touchmove",L),document.removeEventListener("touchend",D)}},[v,k,i]),r.useEffect(()=>(()=>{b()}),[b]);const x=r.useCallback(()=>g.current?(g.current=!1,!0):!1,[]),A=r.useMemo(()=>!t||typeof window>"u"?{top:`${s}%`,transform:"translateY(-50%)"}:{bottom:`${window.innerHeight*s/100}px`},[s,t]);return{isDragging:o,handleStyle:A,startDrag:M,endDrag:v,consumeSuppressedClick:x}}function $e({title:t,children:s,className:n=""}){return e.jsxs("div",{className:`space-y-2 ${n}`,children:[e.jsx("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:t}),s]})}function ci({label:t,icon:s,checked:n,onCheckedChange:i}){return e.jsxs("label",{className:ii,children:[e.jsxs("span",{className:"flex items-center gap-2 text-sm text-foreground",children:[e.jsx(s,{className:"h-4 w-4 text-muted-foreground"}),t]}),e.jsx("input",{type:"checkbox",checked:n,onChange:a=>i(a.target.checked),className:ai})]})}const di=r.memo(ci);function ui({isDarkMode:t,preferences:s,onPreferenceChange:n}){const{t:i}=Z("settings"),a=s.voiceEnabled?at:at.filter(({key:l})=>l!=="voiceEnabled"),o=l=>l.map(({key:c,labelKey:u,icon:d})=>e.jsx(di,{label:i(u),icon:d,checked:s[c],onCheckedChange:g=>n(c,g)},c));return e.jsxs("div",{className:"flex-1 space-y-6 overflow-y-auto overflow-x-hidden bg-background p-4",children:[e.jsxs($e,{title:i("quickSettings.sections.appearance"),children:[e.jsxs("div",{className:Bt,children:[e.jsxs("span",{className:"flex items-center gap-2 text-sm text-foreground",children:[t?e.jsx(Vn,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(Kn,{className:"h-4 w-4 text-muted-foreground"}),i("quickSettings.darkMode")]}),e.jsx(fn,{})]}),e.jsx(bn,{compact:!0})]}),e.jsx($e,{title:i("quickSettings.sections.toolDisplay"),children:o(oi)}),e.jsxs($e,{title:i("quickSettings.sections.inputSettings"),children:[o(a),e.jsx("p",{className:"ml-3 text-xs text-muted-foreground",children:i("quickSettings.sendByCtrlEnterDescription")})]})]})}function pi({isOpen:t,isDragging:s,hideOnMobile:n=!1,style:i,onClick:a,onMouseDown:o,onTouchStart:l}){const{t:c}=Z("settings"),u=t?"right-64":"right-0",d=s?"border-blue-500 dark:border-blue-400":"border-gray-200 dark:border-gray-700",g=s?"":"transition-all duration-150 ease-out",p=s?"cursor-grabbing":"cursor-pointer",b=c(s?"quickSettings.dragHandle.dragging":t?"quickSettings.dragHandle.closePanel":"quickSettings.dragHandle.openPanel"),m=c(s?"quickSettings.dragHandle.draggingStatus":"quickSettings.dragHandle.toggleAndMove");return e.jsx("button",{type:"button",onClick:a,onMouseDown:o,onTouchStart:l,className:`fixed ${u} z-50 ${n?"hidden md:block":""} ${g} border bg-white dark:bg-gray-800 ${d} rounded-l-md p-2 shadow-lg transition-colors hover:bg-gray-100 dark:hover:bg-gray-700 ${p} touch-none`,style:{...i,touchAction:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none"},"aria-label":b,title:m,children:s?e.jsx(_n,{className:"h-5 w-5 text-blue-500 dark:text-blue-400"}):t?e.jsx(Ce,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"}):e.jsx(Ue,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"})})}function mi(){const{t}=Z("settings");return e.jsx("div",{className:"border-b border-border bg-muted/40 p-4",children:e.jsxs("h3",{className:"flex items-center gap-2 text-lg font-semibold text-foreground",children:[e.jsx(Yn,{className:"h-5 w-5 text-muted-foreground"}),t("quickSettings.title")]})})}function gi({hideHandleOnMobile:t=!1}){const[s,n]=r.useState(!1),{isMobile:i}=Pt({trackPWA:!1}),{isDarkMode:a}=St(),{preferences:o,setPreference:l}=wt(),{isDragging:c,handleStyle:u,startDrag:d,consumeSuppressedClick:g}=li({isMobile:i}),p=r.useMemo(()=>({showRawParameters:o.showRawParameters,showThinking:o.showThinking,sendByCtrlEnter:o.sendByCtrlEnter,voiceEnabled:o.voiceEnabled}),[o.sendByCtrlEnter,o.showRawParameters,o.showThinking,o.voiceEnabled]),b=r.useCallback((v,k)=>{l(v,k)},[l]),m=r.useCallback(v=>{if(g()){v.preventDefault();return}n(k=>!k)},[g]);return e.jsxs(e.Fragment,{children:[e.jsx(pi,{isOpen:s,isDragging:c,hideOnMobile:t,style:u,onClick:m,onMouseDown:d,onTouchStart:d}),e.jsx("div",{className:`fixed right-0 top-0 z-[9999] h-full w-64 transform border-l border-border bg-background shadow-xl transition-transform duration-150 ease-out ${s?"translate-x-0":"translate-x-full"} ${i?"h-screen":""}`,children:e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx(mi,{}),e.jsx(ui,{isDarkMode:a,preferences:p,onPreferenceChange:b})]})}),s&&e.jsx("div",{className:"fixed inset-0 z-[9998] bg-background/80 backdrop-blur-sm transition-opacity duration-150 ease-out",onClick:()=>n(!1)})]})}const hi=1e4,fi=(t,s)=>{if(t.size!==s.size)return!1;for(const[n,i]of t){const a=s.get(n);if(!a||i.statusText!==a.statusText||i.canInterrupt!==a.canInterrupt||i.startedAt!==a.startedAt)return!1}return!0};function bi(){const[t,s]=r.useState(new Map),n=r.useCallback((o,l)=>{o&&s(c=>{const u=c.get(o),d={statusText:l?.statusText!==void 0?l.statusText:u?.statusText??null,canInterrupt:l?.canInterrupt??u?.canInterrupt??!0,startedAt:u?.startedAt??Date.now()};if(u&&u.statusText===d.statusText&&u.canInterrupt===d.canInterrupt)return c;const g=new Map(c);return g.set(o,d),g})},[]),i=r.useCallback((o,l)=>{o&&s(c=>{const u=c.get(o);if(!u||l?.ifStartedBefore!==void 0&&u.startedAt>=l.ifStartedBefore)return c;const d=new Map(c);return d.delete(o),d})},[]),a=r.useCallback(o=>{const l=Date.now();s(c=>{const u=new Map;for(const g of o)g.sessionId&&u.set(g.sessionId,g);const d=new Map;for(const[g,p]of u){const b=c.get(g),m=typeof p.startedAt=="number"&&Number.isFinite(p.startedAt)&&p.startedAt>0?p.startedAt:void 0;d.set(g,{statusText:p.statusText!==void 0?p.statusText:b?.statusText??null,canInterrupt:p.canInterrupt??b?.canInterrupt??!0,startedAt:m??b?.startedAt??l})}for(const[g,p]of c)!u.has(g)&&l-p.startedAt<hi&&d.set(g,p);return fi(c,d)?c:d})},[]);return{processingSessions:t,markSessionProcessing:n,markSessionIdle:i,syncProcessingSessions:a}}const Fe="claude",Y=t=>JSON.stringify(t??null),lt=()=>{try{const t=localStorage.getItem("selected-provider");return t||Fe}catch{return Fe}},vi=t=>{const s=t.__provider??t.provider;return typeof s=="string"&&s.trim()?s:Fe},ki=t=>({...t,__provider:vi(t)}),ct=(t,s)=>t.length!==s.length?!0:s.some((n,i)=>{const a=t[i];return a?n.projectId!==a.projectId||n.displayName!==a.displayName||n.fullPath!==a.fullPath||!!n.isStarred!=!!a.isStarred||Y(n.sessionMeta)!==Y(a.sessionMeta)||Y(n.sessions)!==Y(a.sessions)||Y(n.taskmaster)!==Y(a.taskmaster):!0}),dt=(t,s)=>{if(s.length===0)return t;const n=new Map(s.filter(i=>!!i.taskmaster).map(i=>[i.projectId,i.taskmaster]));return t.map(i=>{const a=n.get(i.projectId);return a?{...i,taskmaster:a}:i})},ye=t=>t.sessions??[],oe=t=>ye(t).length,Ht=(t,s)=>{const n=[...t],i=new Set(t.map(a=>String(a.id)));for(const a of s){const o=String(a.id);i.has(o)||(n.push(a),i.add(o))}return n},ut=(t,s)=>{if(t.length===0)return s;const n=new Map(t.map(i=>[i.projectId,i]));return s.map(i=>{const a=n.get(i.projectId);if(!a)return i;const o=oe(a),l=oe(i);if(o<=l)return i;const c={...i,sessions:Ht(i.sessions??[],a.sessions??[])},u=Number(i.sessionMeta?.total??o);return c.sessionMeta={...i.sessionMeta,total:u,hasMore:oe(c)<u},c})},xi=(t,s)=>{const n={...t,sessions:Ht(t.sessions??[],s.sessions??[])},i=Number(s.sessionMeta?.total??t.sessionMeta?.total??0);return n.sessionMeta={...t.sessionMeta,...s.sessionMeta,total:i,hasMore:oe(n)<i},n},yi=t=>{const s=new Set,n=i=>{if(typeof i!="string")return;const a=i.trim();a&&s.add(a)};return n(t.sessionId),n(t.providerSessionId),n(t.session?.id),s},pe=(t,s)=>{const n=t.sessions??[],i=yi(s),a={...s.session,id:s.sessionId,__provider:s.provider},o=n.findIndex(d=>i.has(String(d.id)));let l,c=!1;if(o>=0){let d=!1;l=[];for(const[g,p]of n.entries()){if(g===o){const b={...p,...a};!a.summary?.trim()&&p.summary?.trim()&&(b.summary=p.summary),Y(p)!==Y(b)&&(d=!0),l.push(b);continue}if(i.has(String(p.id))){d=!0;continue}l.push(p)}if(!d)return t}else l=[a,...n],c=!0;const u={...t,sessions:l};if(c){const d=Number(t.sessionMeta?.total??0)+1;u.sessionMeta={...t.sessionMeta,total:d,hasMore:oe(u)<d}}return u},wi=t=>({projectId:t.projectId,path:t.path||t.fullPath,fullPath:t.fullPath||t.path||"",displayName:t.displayName,isStarred:t.isStarred,sessions:t.sessions??[],sessionMeta:t.sessionMeta??{hasMore:!1,total:oe(t)},taskmaster:t.taskmaster}),Ci=(t,s)=>{const n=t.sessions??[],i=n.filter(l=>l.id!==s);if(i.length===n.length)return t;const a={...t,sessions:i},o=Math.max(0,Number(t.sessionMeta?.total??0)-1);return a.sessionMeta={...t.sessionMeta,total:o,hasMore:oe(a)<o},a},Si=new Set(["chat","files","shell","herdr","git","tasks","browser"]),Pi=t=>Si.has(t)||t.startsWith("plugin:"),Ai=()=>{try{const t=localStorage.getItem("activeTab");if(t&&Pi(t))return t}catch{}return"chat"};function ji({sessionId:t,navigate:s,subscribe:n,isMobile:i,activeSessions:a}){const[o,l]=r.useState([]),[c,u]=r.useState(null),[d,g]=r.useState(null),[p,b]=r.useState(new Set),[m,v]=r.useState(Ai);r.useEffect(()=>{try{localStorage.setItem("activeTab",m)}catch{}},[m]);const[k,M]=r.useState(!1),[x,A]=r.useState(!0),[y,E]=r.useState(null),[L,D]=r.useState(!1),[F,P]=r.useState(!1),[N,K]=r.useState("agents"),[U,W]=r.useState(0),[I,H]=r.useState(0),$=r.useRef(null),R=r.useRef(d);R.current=d;const re=r.useRef(a);re.current=a;const te=r.useRef(c);te.current=c;const le=r.useRef(o);le.current=o;const ce=r.useRef(t);ce.current=t;const f=r.useRef(null);r.useEffect(()=>{f.current=null},[t]);const z=r.useCallback(h=>{if(!h)return;const w=R.current?.id??t??null;h!==w&&b(C=>{if(C.has(h))return C;const j=new Set(C);return j.add(h),j})},[t]),q=r.useCallback(h=>{h&&b(w=>{if(!w.has(h))return w;const C=new Set(w);return C.delete(h),C})},[]),J=r.useCallback(async({showLoadingState:h=!0}={})=>{try{h&&A(!0);const C=await(await ie.projects()).json();l(j=>{const S=dt(C,j),O=ut(j,S);return j.length===0||ct(j,O)?O:j})}catch(w){console.error("Error fetching projects:",w)}finally{h&&A(!1)}},[]),Pe=r.useCallback(async()=>{await J({showLoadingState:!1})},[J]),ue=r.useCallback(({sessionId:h,provider:w,project:C,summary:j})=>{if(!h||!C?.projectId)return;const S=new Date().toISOString(),O={id:h,summary:j??"",messageCount:0,createdAt:S,created_at:S,updated_at:S,lastActivity:S,__provider:w,__projectId:C.projectId},B={sessionId:h,provider:w,session:O,project:{projectId:C.projectId,path:C.path||C.fullPath,fullPath:C.fullPath||C.path||"",displayName:C.displayName,isStarred:!!C.isStarred}};l(G=>{const T=G.find(_=>_.projectId===C.projectId);if(!T)return[pe(wi(C),B),...G];const Q=pe(T,B);return Q===T?G:G.map(_=>_.projectId===T.projectId?Q:_)}),u(G=>{if(!G||G.projectId!==C.projectId)return G;const T=pe(G,B);return T===G?G:T}),g(G=>G?.id===h?{...G,...O}:O)},[]),ne=r.useCallback((h,w)=>{l(C=>C.map(j=>j.projectId===h?{...j,taskmaster:w??void 0}:j)),u(C=>C?.projectId===h?{...C,taskmaster:w??void 0}:C)},[]),be=r.useCallback((h="tools")=>{K(h),P(!0)},[]);r.useEffect(()=>{J()},[J]),r.useEffect(()=>{!x&&o.length===1&&!c&&!t&&u(o[0])},[x,o,c,t]),r.useEffect(()=>n(w=>{if(w.kind==="loading_progress"){$.current&&(clearTimeout($.current),$.current=null),E(w),w.phase==="complete"&&($.current=setTimeout(()=>{E(null),$.current=null},500));return}const C=typeof w.sessionId=="string"&&w.sessionId?w.sessionId:null,j=R.current?.id??t??null;if(C&&C!==j&&w.kind!=="chat_subscribed"&&w.kind!=="loading_progress"&&w.kind!=="session_upserted"&&w.kind!=="status"&&w.kind!=="stream_end"&&w.kind!=="permission_cancelled"&&w.kind!=="websocket_reconnected"&&z(C),w.kind!=="session_upserted")return;const S=w;if(!S.sessionId||!S.session)return;const O=R.current;O&&S.sessionId===O.id&&!re.current.has(S.sessionId)?W(T=>T+1):z(S.sessionId),l(T=>{const Q=S.project?.projectId,_=T.find(de=>Q?de.projectId===Q:ye(de).some(Vt=>Vt.id===S.sessionId));if(!_){if(!S.project)return T;const de={projectId:S.project.projectId,path:S.project.path,fullPath:S.project.fullPath,displayName:S.project.displayName,isStarred:S.project.isStarred,sessions:[],sessionMeta:{hasMore:!1,total:0}};return[...T,pe(de,S)]}const ve=pe(_,S);return ve===_?T:T.map(de=>de.projectId===_.projectId?ve:de)}),u(T=>{if(!T||!(S.project?T.projectId===S.project.projectId:ye(T).some(ve=>ve.id===S.sessionId)))return T;const _=pe(T,S);return _===T?T:_});const B=typeof S.providerSessionId=="string"&&S.providerSessionId!==S.sessionId?S.providerSessionId:null;if(!B)return;const G={...S.session,id:S.sessionId,__provider:S.provider,__projectId:S.project?.projectId??O?.__projectId};g(T=>T?.id!==B?T:{...T,...G}),t===B&&s(`/session/${S.sessionId}`)}),[z,s,t,n]),r.useEffect(()=>()=>{$.current&&(clearTimeout($.current),$.current=null)},[]),r.useEffect(()=>{q(d?.id??t??null)},[q,d?.id,t]),r.useEffect(()=>{if(t){for(const h of o){const w=h.sessions?.find(C=>C.id===t);if(w){const C=ki(w),j=c?.projectId!==h.projectId,S=d?.id!==t||d.__provider!==C.__provider;j&&u(h),S&&g(C);return}}d?.id!==t&&f.current!==t&&(f.current=t,(async()=>{let h=null;try{const j=await ie.sessionDetails(t);j.ok&&(h=(await j.json()).data??null)}catch(j){console.error(`Error resolving session ${t}:`,j)}if(ce.current!==t)return;if(!h){const j=te.current;if(!j||R.current?.id===t)return;g({id:t,__provider:lt(),__projectId:j.projectId,summary:""});return}if(typeof h.sessionId=="string"&&h.sessionId&&h.sessionId!==t){s(`/session/${h.sessionId}`,{replace:!0});return}const w=h.project?.projectId;w&&u(j=>{if(j?.projectId===w)return j;const S=le.current.find(O=>O.projectId===w);return S||{projectId:w,path:h.project?.path??h.project?.fullPath??"",fullPath:h.project?.fullPath??h.project?.path??"",displayName:h.project?.displayName??"",isStarred:!!h.project?.isStarred,sessions:[],sessionMeta:{hasMore:!1,total:0}}});const C={id:t,summary:h.summary??"",createdAt:h.createdAt??void 0,lastActivity:h.lastActivity??void 0,__provider:typeof h.provider=="string"&&h.provider.trim()?h.provider:lt(),__projectId:w};g(j=>j?.id===t?{...j,...C}:C)})())}},[s,t,o,c,d?.id,d?.__provider]);const Ae=r.useCallback(h=>{u(h),g(null),s("/"),i&&M(!1)},[i,s]),je=r.useCallback(h=>{if(q(h.id),g(h),(m==="tasks"||m==="browser")&&v("chat"),i){const w=h.__projectId,C=c?.projectId;w!==C&&M(!1)}s(`/session/${h.id}`)},[m,q,i,s,c?.projectId]),Te=r.useCallback(h=>{u(h),g(null),v("chat"),H(w=>w+1),s("/"),i&&M(!1)},[i,s]),Ie=r.useCallback(h=>{q(h),d?.id===h&&(g(null),s("/")),l(w=>w.map(C=>Ci(C,h)))},[q,s,d?.id]),Ee=r.useCallback(async()=>{try{const w=await(await ie.projects()).json(),C=dt(w,o),j=ut(o,C);if(l(B=>ct(B,j)?j:B),!c)return;const S=j.find(B=>B.projectId===c.projectId);if(!S||(Y(S)!==Y(c)&&u(S),!d))return;const O=ye(S).find(B=>B.id===d.id);if(O){const B=O.__provider||!d.__provider?O:{...O,__provider:d.__provider};Y(B)!==Y(d)&&g(B)}}catch(h){console.error("Error refreshing sidebar:",h)}},[o,c,d]),Me=r.useCallback(async h=>{const w=o.find(G=>G.projectId===h);if(!w)return;const C=oe(w),j=Number(w.sessionMeta?.total??0);if(j>0&&C>=j)return;const S=await ie.projectSessions(h,{limit:20,offset:C});if(!S.ok){const T=(await S.json().catch(()=>({}))).error,Q=typeof T=="string"?T:T&&typeof T=="object"&&T.message?T.message:`Failed to load more sessions for project ${h}`;throw new Error(Q)}const O=await S.json();let B=null;l(G=>G.map(T=>{if(T.projectId!==h)return T;const Q=xi(T,O);return B=Q,Q})),c?.projectId===h&&B&&u(B)},[o,c?.projectId]),ze=r.useCallback(h=>{c?.projectId===h&&(u(null),g(null),s("/")),l(w=>w.filter(C=>C.projectId!==h))},[s,c?.projectId]),Wt=r.useMemo(()=>({projects:o,selectedProject:c,selectedSession:d,activeSessions:a,attentionSessionIds:p,onProjectSelect:Ae,onSessionSelect:je,onNewSession:Te,onSessionDelete:Ie,onLoadMoreSessions:Me,onProjectDelete:ze,isLoading:x,loadingProgress:y,onRefresh:Ee,onShowSettings:()=>P(!0),showSettings:F,settingsInitialTab:N,onCloseSettings:()=>P(!1),isMobile:i}),[p,Te,ze,Ae,Ie,Me,je,Ee,x,i,y,a,o,N,c,d,F]);return{projects:o,selectedProject:c,selectedSession:d,activeTab:m,sidebarOpen:k,isLoadingProjects:x,loadingProgress:y,isInputFocused:L,showSettings:F,settingsInitialTab:N,externalMessageUpdate:U,newSessionTrigger:I,setActiveTab:v,setSidebarOpen:M,setIsInputFocused:D,setShowSettings:P,openSettings:be,fetchProjects:J,refreshProjectsSilently:Pe,registerOptimisticSession:ue,updateProjectTaskMaster:ne,sidebarSharedProps:Wt,handleProjectSelect:Ae,handleSessionSelect:je,handleNewSession:Te,handleSessionDelete:Ie,loadMoreProjectSessions:Me,handleProjectDelete:ze,handleSidebarRefresh:Ee}}function Ti({processingSessions:t,activeSessionId:s,ws:n,sendMessage:i,markSessionProcessing:a}){const o=r.useRef(new Set);r.useEffect(()=>{const l=o.current,c=new Set(t.keys());o.current=c;for(const u of l){if(c.has(u)||u===s)continue;const d=ts(u);d&&(!n||n.readyState!==WebSocket.OPEN||(ns(u),i({type:"chat.send",sessionId:u,content:d.content,options:{...d.options??{},attachments:d.attachments??d.images??[]}}),a(u,{statusText:null,canInterrupt:!0})))}},[t,s,n,i,a])}const Ii=t=>{if(typeof t=="number"&&Number.isFinite(t)&&t>0)return t;if(typeof t!="string")return;const s=Date.parse(t);return Number.isFinite(s)?s:void 0};function pt(){return e.jsx(vn,{children:e.jsx(Ei,{})})}function Ei(){const t=vt(),{sessionId:s}=Kt(),{t:n}=Z("common"),{isMobile:i}=Pt({trackPWA:!1}),{ws:a,sendMessage:o,subscribe:l}=kn(),{processingSessions:c,markSessionProcessing:u,markSessionIdle:d,syncProcessingSessions:g}=bi(),{selectedProject:p,selectedSession:b,activeTab:m,sidebarOpen:v,isLoadingProjects:k,externalMessageUpdate:M,newSessionTrigger:x,setActiveTab:A,setSidebarOpen:y,setIsInputFocused:E,openSettings:L,refreshProjectsSilently:D,registerOptimisticSession:F,updateProjectTaskMaster:P,sidebarSharedProps:N,handleNewSession:K,handleProjectSelect:U}=ji({sessionId:s,navigate:t,subscribe:l,isMobile:i,activeSessions:c});Ti({processingSessions:c,activeSessionId:b?.id??s??null,ws:a,sendMessage:o,markSessionProcessing:u});const W=r.useCallback(async()=>{try{const I=await ie.runningSessions();if(!I.ok)return;const H=await I.json(),$=Array.isArray(H.data?.sessions)?H.data.sessions:[];g($.map(R=>typeof R.sessionId!="string"||!R.sessionId?null:{sessionId:R.sessionId,startedAt:Ii(R.startedAt),statusText:typeof R.statusText=="string"?R.statusText:void 0,canInterrupt:typeof R.canInterrupt=="boolean"?R.canInterrupt:void 0}).filter(R=>!!R))}catch(I){console.error("[AppContent] Failed to sync running sessions:",I)}},[g]);return r.useEffect(()=>{W()},[W]),r.useEffect(()=>{const I=window.setInterval(()=>{W()},5e3);return()=>window.clearInterval(I)},[W]),Ct({openSettings:L,refreshProjects:D}),r.useEffect(()=>{if(typeof navigator>"u"||!("serviceWorker"in navigator))return;const I=H=>{const $=H.data;if(!(!$||$.type!=="notification:navigate")){if(typeof $.provider=="string"&&$.provider.trim()&&localStorage.setItem("selected-provider",$.provider),A("chat"),y(!1),D(),typeof $.sessionId=="string"&&$.sessionId){t(`/session/${$.sessionId}`);return}t("/")}};return navigator.serviceWorker.addEventListener("message",I),()=>{navigator.serviceWorker.removeEventListener("message",I)}},[t,D,A,y]),r.useEffect(()=>{const I=window.visualViewport;if(!I)return;const H=()=>{const $=Math.max(0,window.innerHeight-I.height);document.documentElement.style.setProperty("--keyboard-height",`${$}px`)};return I.addEventListener("resize",H),()=>I.removeEventListener("resize",H)},[]),e.jsx(xn,{project:p,onProjectTaskMasterChange:P,children:e.jsxs("div",{className:"fixed inset-0 flex bg-background",style:{bottom:"var(--keyboard-height, 0px)"},children:[i?e.jsxs("div",{className:`fixed inset-0 z-50 flex transition-all duration-150 ease-out ${v?"visible opacity-100":"invisible opacity-0"}`,children:[e.jsx("button",{className:"fixed inset-0 bg-background/60 backdrop-blur-sm transition-opacity duration-150 ease-out",onClick:I=>{I.stopPropagation(),y(!1)},onTouchStart:I=>{I.preventDefault(),I.stopPropagation(),y(!1)},"aria-label":n("versionUpdate.ariaLabels.closeSidebar")}),e.jsx("div",{className:`relative h-full w-[85vw] max-w-sm transform border-r border-border/40 bg-card transition-transform duration-150 ease-out sm:w-80 ${v?"translate-x-0":"-translate-x-full"}`,onClick:I=>I.stopPropagation(),onTouchStart:I=>I.stopPropagation(),children:e.jsx(Ke,{...N})})]}):e.jsx("div",{className:"h-full flex-shrink-0 border-r border-border/50",children:e.jsx(Ke,{...N})}),e.jsx("div",{className:"flex min-w-0 flex-1 flex-col",children:e.jsx(Us,{selectedProject:p,selectedSession:b,activeTab:m,setActiveTab:A,ws:a,sendMessage:o,isMobile:i,onMenuClick:()=>y(!0),isLoading:k,onInputFocusChange:E,onSessionProcessing:u,onSessionIdle:d,processingSessions:c,onNavigateToSession:(I,H)=>t(`/session/${I}`,{replace:!!H?.replace}),onSessionEstablished:(I,H)=>F({sessionId:I,...H}),onShowSettings:L,externalMessageUpdate:M,newSessionTrigger:x,onProjectSelect:U,onProjectsRefresh:()=>{D()}})}),e.jsx(ei,{selectedProject:p,onStartNewChat:K,onOpenSettings:()=>L(),onShowTab:A}),e.jsx(gi,{hideHandleOnMobile:m==="herdr"})]})})}function Mi(t={}){const{immediate:s=!1,onNeedReload:n,onNeedRefresh:i,onOfflineReady:a,onRegistered:o,onRegisteredSW:l,onRegisterError:c}=t;let u,d,g;const p=async(m=!0)=>{await d,g?.()};async function b(){if("serviceWorker"in navigator){if(u=await ee(async()=>{const{Workbox:m}=await import("./workbox-window.prod.es5-BBnX5xw4.js");return{Workbox:m}},[]).then(({Workbox:m})=>new m("/sw.js",{scope:"/",type:"classic"})).catch(m=>{c?.(m)}),!u)return;g=()=>{u?.messageSkipWaiting()};{let m=!1;const v=()=>{m=!0,u?.addEventListener("controlling",k=>{k.isUpdate&&(n?n():window.location.reload())}),i?.()};u.addEventListener("installed",k=>{typeof k.isUpdate>"u"?typeof k.isExternal<"u"&&k.isExternal?v():!m&&a?.():k.isUpdate||a?.()}),u.addEventListener("waiting",v)}u.register({immediate:s}).then(m=>{l?l("/sw.js",m):o?.(m)}).catch(m=>{c?.(m)})}}return d=b(),p}function zi(t={}){const{immediate:s=!0,onNeedReload:n,onNeedRefresh:i,onOfflineReady:a,onRegistered:o,onRegisteredSW:l,onRegisterError:c}=t,[u,d]=r.useState(!1),[g,p]=r.useState(!1),[b]=r.useState(()=>Mi({immediate:s,onNeedReload:n,onOfflineReady(){p(!0),a?.()},onNeedRefresh(){d(!0),i?.()},onRegistered:o,onRegisteredSW:l,onRegisterError:c}));return{needRefresh:[u,d],offlineReady:[g,p],updateServiceWorker:b}}function Di(t){return t.needRefresh?"update":t.installAvailable&&!t.installDismissed?"install":t.offlineReady&&!t.offlineDismissed?"offline":null}const Ni=3600*1e3;function $i(){const{t}=Z("common"),[s,n]=r.useState(),[i,a]=r.useState(),[o,l]=r.useState(!1),[c,u]=r.useState(!1),{needRefresh:[d,g],offlineReady:[p,b],updateServiceWorker:m}=zi({immediate:!0,onRegisteredSW:(y,E)=>n(E),onRegisterError:y=>console.error("Service worker registration failed:",y)});r.useEffect(()=>{if(!s)return;const y=window.setInterval(()=>{navigator.onLine&&s.update()},Ni);return()=>window.clearInterval(y)},[s]),r.useEffect(()=>{const y=L=>{L.preventDefault(),a(L),l(!1)},E=()=>a(void 0);return window.addEventListener("beforeinstallprompt",y),window.addEventListener("appinstalled",E),()=>{window.removeEventListener("beforeinstallprompt",y),window.removeEventListener("appinstalled",E)}},[]),r.useEffect(()=>{if(!p)return;const y=window.setTimeout(()=>u(!0),8e3);return()=>window.clearTimeout(y)},[p]);const v=Di({installAvailable:!!i,installDismissed:o,needRefresh:d,offlineDismissed:c,offlineReady:p});if(!v)return null;const k={update:{icon:Mt,message:t("pwa.updateReady"),action:t("pwa.reload")},install:{icon:Qn,message:t("pwa.installAvailable"),action:t("pwa.install")},offline:{icon:Jn,message:t("pwa.offlineReady"),action:null}}[v],M=k.icon,x=()=>{v==="update"&&g(!1),v==="install"&&l(!0),v==="offline"&&(u(!0),b(!1))},A=async()=>{if(v==="update"){await m(!0);return}v==="install"&&i&&(await i.prompt(),await i.userChoice,a(void 0))};return e.jsxs("aside",{role:"status","aria-live":"polite",className:"fixed inset-x-3 bottom-[calc(0.75rem+env(safe-area-inset-bottom,0px))] z-[100] mx-auto flex min-h-12 max-w-xl items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-card-foreground shadow-lg",children:[e.jsx(M,{className:"h-4 w-4 flex-shrink-0 text-primary"}),e.jsx("span",{className:"min-w-0 flex-1 text-sm",children:k.message}),k.action&&e.jsx("button",{type:"button",className:"flex-shrink-0 text-sm font-medium text-primary hover:underline",onClick:()=>{A()},children:k.action}),e.jsx("button",{type:"button",className:"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground",onClick:x,"aria-label":t("pwa.dismiss"),title:t("pwa.dismiss"),children:e.jsx(Et,{className:"h-4 w-4"})})]})}const{slice:Ri,forEach:Li}=[];function Fi(t){return Li.call(Ri.call(arguments,1),s=>{if(s)for(const n in s)t[n]===void 0&&(t[n]=s[n])}),t}function Bi(t){return typeof t!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(t))}const mt=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Gi=function(t,s){const i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},a=encodeURIComponent(s);let o=`${t}=${a}`;if(i.maxAge>0){const l=i.maxAge-0;if(Number.isNaN(l))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(l)}`}if(i.domain){if(!mt.test(i.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${i.domain}`}if(i.path){if(!mt.test(i.path))throw new TypeError("option path is invalid");o+=`; Path=${i.path}`}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${i.expires.toUTCString()}`}if(i.httpOnly&&(o+="; HttpOnly"),i.secure&&(o+="; Secure"),i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i.partitioned&&(o+="; Partitioned"),o},gt={create(t,s,n,i){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+n*60*1e3)),i&&(a.domain=i),document.cookie=Gi(t,s,a)},read(t){const s=`${t}=`,n=document.cookie.split(";");for(let i=0;i<n.length;i++){let a=n[i];for(;a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(s)===0)return a.substring(s.length,a.length)}return null},remove(t,s){this.create(t,"",-1,s)}};var Hi={name:"cookie",lookup(t){let{lookupCookie:s}=t;if(s&&typeof document<"u")return gt.read(s)||void 0},cacheUserLanguage(t,s){let{lookupCookie:n,cookieMinutes:i,cookieDomain:a,cookieOptions:o}=s;n&&typeof document<"u"&&gt.create(n,t,i,a,o)}},Oi={name:"querystring",lookup(t){let{lookupQuerystring:s}=t,n;if(typeof window<"u"){let{search:i}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const o=i.substring(1).split("&");for(let l=0;l<o.length;l++){const c=o[l].indexOf("=");c>0&&o[l].substring(0,c)===s&&(n=o[l].substring(c+1))}}return n}},Ui={name:"hash",lookup(t){let{lookupHash:s,lookupFromHashIndex:n}=t,i;if(typeof window<"u"){const{hash:a}=window.location;if(a&&a.length>2){const o=a.substring(1);if(s){const l=o.split("&");for(let c=0;c<l.length;c++){const u=l[c].indexOf("=");u>0&&l[c].substring(0,u)===s&&(i=l[c].substring(u+1))}}if(i)return i;if(!i&&n>-1){const l=a.match(/\/([a-zA-Z-]*)/g);return Array.isArray(l)?l[typeof n=="number"?n:0]?.replace("/",""):void 0}}}return i}};let me=null;const ht=()=>{if(me!==null)return me;try{if(me=typeof window<"u"&&window.localStorage!==null,!me)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{me=!1}return me};var qi={name:"localStorage",lookup(t){let{lookupLocalStorage:s}=t;if(s&&ht())return window.localStorage.getItem(s)||void 0},cacheUserLanguage(t,s){let{lookupLocalStorage:n}=s;n&&ht()&&window.localStorage.setItem(n,t)}};let ge=null;const ft=()=>{if(ge!==null)return ge;try{if(ge=typeof window<"u"&&window.sessionStorage!==null,!ge)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{ge=!1}return ge};var Wi={name:"sessionStorage",lookup(t){let{lookupSessionStorage:s}=t;if(s&&ft())return window.sessionStorage.getItem(s)||void 0},cacheUserLanguage(t,s){let{lookupSessionStorage:n}=s;n&&ft()&&window.sessionStorage.setItem(n,t)}},Vi={name:"navigator",lookup(t){const s=[];if(typeof navigator<"u"){const{languages:n,userLanguage:i,language:a}=navigator;if(n)for(let o=0;o<n.length;o++)s.push(n[o]);i&&s.push(i),a&&s.push(a)}return s.length>0?s:void 0}},Ki={name:"htmlTag",lookup(t){let{htmlTag:s}=t,n;const i=s||(typeof document<"u"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(n=i.getAttribute("lang")),n}},_i={name:"path",lookup(t){let{lookupFromPathIndex:s}=t;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?n[typeof s=="number"?s:0]?.replace("/",""):void 0}},Yi={name:"subdomain",lookup(t){let{lookupFromSubdomainIndex:s}=t;const n=typeof s=="number"?s+1:1,i=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(i)return i[n]}};let Ot=!1;try{document.cookie,Ot=!0}catch{}const Ut=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Ot||Ut.splice(1,1);const Ji=()=>({order:Ut,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t});class qt{constructor(s){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(s,n)}init(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=s,this.options=Fi(n,this.options||{},Ji()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=a=>a.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(Hi),this.addDetector(Oi),this.addDetector(qi),this.addDetector(Wi),this.addDetector(Vi),this.addDetector(Ki),this.addDetector(_i),this.addDetector(Yi),this.addDetector(Ui)}addDetector(s){return this.detectors[s.name]=s,this}detect(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return s.forEach(i=>{if(this.detectors[i]){let a=this.detectors[i].lookup(this.options);a&&typeof a=="string"&&(a=[a]),a&&(n=n.concat(a))}}),n=n.filter(i=>i!=null&&!Bi(i)).map(i=>this.options.convertDetectedLanguage(i)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(s){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(s)>-1||n.forEach(i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(s,this.options)}))}}qt.type="languageDetector";const Qi={save:"Save",cancel:"Cancel",delete:"Delete",create:"Create",edit:"Edit",close:"Close",confirm:"Confirm",submit:"Submit",retry:"Retry",refresh:"Refresh",search:"Search",clear:"Clear",copy:"Copy",download:"Download",upload:"Upload",browse:"Browse"},Zi={chat:"Chat",shell:"Shell",herdr:"Herdr",files:"Files",git:"Source Control",tasks:"Tasks",browser:"Browser",computer:"Computer"},Xi={loading:"Loading...",success:"Success",error:"Error",failed:"Failed",pending:"Pending",completed:"Completed",inProgress:"In Progress"},ea={savedSuccessfully:"Saved successfully",deletedSuccessfully:"Deleted successfully",updatedSuccessfully:"Updated successfully",operationFailed:"Operation failed",networkError:"Network error. Please check your connection.",unauthorized:"Unauthorized. Please log in.",notFound:"Not found",invalidInput:"Invalid input",requiredField:"This field is required",unknownError:"An unknown error occurred"},ta={settings:"Settings",home:"Home",back:"Back",next:"Next",previous:"Previous",logout:"Logout"},na={language:"Language",theme:"Theme",darkMode:"Dark Mode",lightMode:"Light Mode",name:"Name",description:"Description",enabled:"Enabled",disabled:"Disabled",optional:"Optional",version:"Version",select:"Select",selectAll:"Select All",deselectAll:"Deselect All"},sa={justNow:"Just now",minutesAgo:"{{count}} mins ago",hoursAgo:"{{count}} hours ago",daysAgo:"{{count}} days ago",yesterday:"Yesterday"},ia={newFile:"New File",newFolder:"New Folder",rename:"Rename",move:"Move",copyPath:"Copy Path",openInEditor:"Open in Editor"},aa={loading:"Loading WindCli",settingUpWorkspace:"Setting up your workspace...",chooseProject:"Choose Your Project",selectProjectDescription:"Select a project from the sidebar to start coding with Claude. Each project contains your chat sessions and file history.",tip:"Tip",createProjectMobile:"Tap the menu button above to access projects",createProjectDesktop:"Create a new project by clicking the folder icon in the sidebar",newSession:"New Session",untitledSession:"Untitled Session",projectFiles:"Project Files"},oa={loading:"Loading files...",files:"Files",simpleView:"Simple view",compactView:"Compact view",detailedView:"Detailed view",searchPlaceholder:"Search files and folders...",clearSearch:"Clear search",name:"Name",size:"Size",modified:"Modified",permissions:"Permissions",noFilesFound:"No files found",checkProjectPath:"Check if the project path is accessible",loadFailed:"Unable to load files",noMatchesFound:"No matches found",tryDifferentSearch:"Try a different search term or clear the search",justNow:"just now",minAgo:"{{count}} min ago",hoursAgo:"{{count}} hours ago",daysAgo:"{{count}} days ago",newFile:"New File (Cmd+N)",newFolder:"New Folder (Cmd+Shift+N)",refresh:"Refresh",collapseAll:"Collapse All",context:{rename:"Rename",delete:"Delete",copyPath:"Copy Path",download:"Download",newFile:"New File",newFolder:"New Folder",upload:"Upload Files",refresh:"Refresh",menuLabel:"File context menu",loading:"Loading..."}},ra={title:"Create New Project",steps:{type:"Type",configure:"Configure",confirm:"Confirm"},step1:{question:"Do you already have a workspace, or would you like to create a new one?",existing:{title:"Existing Workspace",description:"I already have a workspace on my server and just need to add it to the project list"},new:{title:"New Workspace",description:"Create a new workspace, optionally clone from a GitHub repository"}},step2:{existingPath:"Workspace Path",newPath:"Workspace Path",existingPlaceholder:"/path/to/existing/workspace",newPlaceholder:"/path/to/new/workspace",existingHelp:"Full path to your existing workspace directory",newHelp:"Full path to your workspace directory",githubUrl:"GitHub URL (Optional)",githubPlaceholder:"https://github.com/username/repository",githubHelp:"Optional: provide a GitHub URL to clone a repository",githubAuth:"GitHub Authentication (Optional)",githubAuthHelp:"Only required for private repositories. Public repos can be cloned without authentication.",loadingTokens:"Loading stored tokens...",storedToken:"Stored Token",newToken:"New Token",nonePublic:"None (Public)",selectToken:"Select Token",selectTokenPlaceholder:"-- Select a token --",tokenPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",tokenHelp:"This token will be used only for this operation",publicRepoInfo:"Public repositories don't require authentication. You can skip providing a token if cloning a public repo.",noTokensHelp:"No stored tokens available. You can add tokens in Settings → API Keys for easier reuse.",optionalTokenPublic:"GitHub Token (Optional for Public Repos)",tokenPublicPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (leave empty for public repos)"},step3:{reviewConfig:"Review Your Configuration",existingWorkspace:"Existing Workspace",newWorkspace:"New Workspace",path:"Path:",cloneFrom:"Clone From:",authentication:"Authentication:",usingStoredToken:"Using stored token:",usingProvidedToken:"Using provided token",noAuthentication:"No authentication",sshKey:"SSH Key",existingInfo:"The workspace will be added to your project list and will be available for Claude/Cursor sessions.",newWithClone:"The repository will be cloned from this folder.",newEmpty:"The workspace will be added to your project list and will be available for Claude/Cursor sessions.",cloningRepository:"Cloning repository..."},buttons:{cancel:"Cancel",back:"Back",next:"Next",createProject:"Create Project",creating:"Creating...",cloning:"Cloning..."},errors:{selectType:"Please select whether you have an existing workspace or want to create a new one",providePath:"Please provide a workspace path",failedToCreate:"Failed to create workspace",failedToCreateFolder:"Failed to create folder"}},la={genericTool:"a tool",codes:{generic:{info:{title:"Notification"}},permission:{required:{title:"Action Required",body:"{{toolName}} is waiting for your decision."}},run:{stopped:{title:"Run Stopped",body:"Reason: {{reason}}"},failed:{title:"Run Failed"}},agent:{notification:{title:"Agent Notification"}}}},ca={updateReady:"A new version of WindCli is ready.",reload:"Reload",installAvailable:"Install WindCli for faster access and offline support.",install:"Install",offlineReady:"WindCli is ready to use offline.",dismiss:"Dismiss"},da={title:"Update Available",newVersionReady:"A new version is ready",currentVersion:"Current Version",latestVersion:"Latest Version",whatsNew:"What's New:",viewFullRelease:"View full release",updateProgress:"Update Progress:",manualUpgrade:"Manual upgrade:",npmUpgradeCommand:"npm install -g wind-agent-cli@latest",manualUpgradeHint:'Or click "Update Now" to run the update automatically.',updateCompleted:"Update completed successfully!",restartServer:"Please restart the server to apply changes.",updateFailed:"Update failed",buttons:{close:"Close",later:"Later",copyCommand:"Copy Command",updateNow:"Update Now",updating:"Updating..."},ariaLabels:{closeModal:"Close version upgrade modal",showSidebar:"Show sidebar",settings:"Settings",updateAvailable:"Update available",closeSidebar:"Close sidebar"}},ua={buttons:Qi,tabs:Zi,status:Xi,messages:ea,navigation:ta,common:na,time:sa,fileOperations:ia,mainContent:aa,fileTree:oa,projectWizard:ra,notifications:la,pwa:ca,versionUpdate:da},pa="Settings",ma={account:"Account",permissions:"Permissions",mcpServers:"MCP Servers",skills:"Skills",appearance:"Appearance"},ga={title:"Account",language:"Language",languageLabel:"Display Language",languageDescription:"Choose your preferred language for the interface",username:"Username",email:"Email",profile:"Profile",changePassword:"Change Password"},ha={title:"MCP Servers",addServer:"Add Server",editServer:"Edit Server",deleteServer:"Delete Server",serverName:"Server Name",serverType:"Server Type",config:"Configuration",testConnection:"Test Connection",status:"Status",connected:"Connected",disconnected:"Disconnected",scope:{label:"Scope",user:"User",project:"Project"}},fa={title:"Appearance",theme:"Theme",codeEditor:"Code Editor",editorTheme:"Editor Theme",wordWrap:"Word Wrap",showMinimap:"Show Minimap",lineNumbers:"Line Numbers",fontSize:"Font Size"},ba={saveChanges:"Save Changes",resetToDefaults:"Reset to Defaults",cancelChanges:"Cancel Changes"},va={title:"Voice",description:"Speech-to-text input and read-aloud, via an OpenAI-compatible audio backend.",enable:"Enable voice",enableDescription:"Show the mic button and the read-aloud button on messages.",backendTitle:"Backend",backendDescription:"Point at OpenAI, Groq, or a local server (LocalAI, Speaches, Kokoro-FastAPI). Leave blank to use the server default.",baseUrl:"Base URL",apiKey:"API key",sttModel:"Speech-to-text model",ttsModel:"Text-to-speech model",voice:"Voice",format:"Audio format",note:"A custom base URL is called directly by your browser and must allow browser CORS requests. Leave it blank to use the server-configured backend."},ka={title:"Quick Settings",sections:{appearance:"Appearance",toolDisplay:"Tool Display",inputSettings:"Input Settings"},darkMode:"Dark Mode",showRawParameters:"Show raw parameters",showThinking:"Show thinking",sendByCtrlEnter:"Send by Ctrl+Enter",voiceEnabled:"Voice (mic + read aloud)",sendByCtrlEnterDescription:"When enabled, pressing Ctrl+Enter will send the message instead of just Enter. This is useful for IME users to avoid accidental sends.",dragHandle:{dragging:"Dragging handle",closePanel:"Close settings panel",openPanel:"Open settings panel",draggingStatus:"Dragging...",toggleAndMove:"Click to toggle, drag to move"}},xa={title:"Terminal Shortcuts",sectionKeys:"Keys",sectionNavigation:"Navigation",escape:"Escape",tab:"Tab",shiftTab:"Shift+Tab",arrowUp:"Arrow Up",arrowDown:"Arrow Down",scrollDown:"Scroll Down",handle:{closePanel:"Close shortcuts panel",openPanel:"Open shortcuts panel"}},ya={label:"Settings",agents:"Agents",appearance:"Appearance",git:"Git",apiTokens:"API & Tokens",voice:"Voice",tasks:"Tasks",browser:"Browser",notifications:"Notifications",plugins:"Plugins",about:"About"},wa={title:"Notifications",description:"Control which notification events you receive.",webPush:{title:"Notify this browser",enable:"Enable notifications",disable:"Disable notifications",enabled:"Notifications are enabled for this browser",loading:"Updating...",unsupported:"Push notifications are not supported in this browser.",denied:"Push notifications are blocked. Please allow them in your browser settings."},desktop:{title:"Notify this desktop app",enable:"Enable notifications",disable:"Disable notifications",enabled:"Notifications are enabled for this desktop app",unsupported:"Desktop notifications are not supported on this system."},sound:{title:"Sound",description:"Play a short tone when a chat run finishes or needs tool approval.",enabled:"Enabled",test:"Test sound"},events:{title:"Event Types",actionRequired:"Action required",stop:"Run stopped",error:"Run failed"}},Ca={darkMode:{label:"Dark Mode",description:"Toggle between light and dark themes"},projectSorting:{label:"Project Sorting",description:"How projects are ordered in the sidebar",alphabetical:"Alphabetical",recentActivity:"Recent Activity"},codeEditor:{title:"Code Editor",theme:{label:"Editor Theme",description:"Default theme for the code editor"},wordWrap:{label:"Word Wrap",description:"Enable word wrapping by default in the editor"},showMinimap:{label:"Show Minimap",description:"Display a minimap for easier navigation in diff view"},lineNumbers:{label:"Show Line Numbers",description:"Display line numbers in the editor"},fontSize:{label:"Font Size",description:"Editor font size in pixels"}}},Sa={title:{add:"Add MCP Server",edit:"Edit MCP Server"},importMode:{form:"Form Input",json:"JSON Import"},scope:{label:"Scope",userGlobal:"User (Global)",projectLocal:"Project (Local)",userDescription:"User scope: Available across all projects on your machine",projectDescription:"Local scope: Only available in the selected project",cannotChange:"Scope cannot be changed when editing an existing server"},fields:{serverName:"Server Name",transportType:"Transport Type",command:"Command",arguments:"Arguments (one per line)",jsonConfig:"JSON Configuration",url:"URL",envVars:"Environment Variables (KEY=value, one per line)",headers:"Headers (KEY=value, one per line)",selectProject:"Select a project..."},placeholders:{serverName:"my-server"},validation:{missingType:"Missing required field: type",stdioRequiresCommand:"stdio type requires a command field",httpRequiresUrl:"{{type}} type requires a url field",invalidJson:"Invalid JSON format",jsonHelp:"Paste your MCP server configuration in JSON format. Example formats:",jsonExampleStdio:'• stdio: {"type":"stdio","command":"npx","args":["@upstash/context7-mcp"]}',jsonExampleHttp:'• http/sse: {"type":"http","url":"https://api.example.com/mcp"}'},configDetails:"Configuration Details (from {{configFile}})",projectPath:"Path: {{path}}",actions:{cancel:"Cancel",saving:"Saving...",addServer:"Add Server",updateServer:"Update Server"}},Pa={success:"Settings saved successfully!",error:"Failed to save settings",saving:"Saving..."},Aa={save:"Save Settings",cancel:"Cancel"},ja={title:"Git Configuration",description:"Configure your git identity for commits. These settings will be applied globally via git config --global",name:{label:"Git Name",help:"Your name for git commits"},email:{label:"Git Email",help:"Your email for git commits"},actions:{save:"Save Configuration",saving:"Saving..."},status:{success:"Saved successfully"}},Ta={title:"API Keys",description:"Generate API keys to access the external API from other applications.",newKey:{alertTitle:"⚠️ Save Your API Key",alertMessage:"This is the only time you'll see this key. Store it securely.",iveSavedIt:"I've saved it"},form:{placeholder:"API Key Name (e.g., Production Server)",createButton:"Create",cancelButton:"Cancel"},newButton:"New API Key",empty:"No API keys created yet.",list:{created:"Created:",lastUsed:"Last used:"},confirmDelete:"Are you sure you want to delete this API key?",status:{active:"Active",inactive:"Inactive"},github:{title:"GitHub Tokens",description:"Add GitHub Personal Access Tokens to clone private repositories via the external API.",descriptionAlt:"Add GitHub Personal Access Tokens to clone private repositories. You can also pass tokens directly in API requests without storing them.",addButton:"Add Token",form:{namePlaceholder:"Token Name (e.g., Personal Repos)",tokenPlaceholder:"GitHub Personal Access Token (ghp_...)",descriptionPlaceholder:"Description (optional)",addButton:"Add Token",cancelButton:"Cancel",howToCreate:"How to create a GitHub Personal Access Token →"},empty:"No GitHub tokens added yet.",added:"Added:",confirmDelete:"Are you sure you want to delete this GitHub token?"},apiDocsLink:"API Documentation",documentation:{title:"External API Documentation",description:"Learn how to use the external API to trigger Claude/Cursor sessions from your applications.",viewLink:"View API Documentation →"},loading:"Loading...",version:{updateAvailable:"Update available: v{{version}}"}},Ia={checking:"Checking TaskMaster installation...",notInstalled:{title:"TaskMaster AI CLI Not Installed",description:"TaskMaster CLI is required to use task management features. Install it to get started:",installCommand:"npm install -g task-master-ai",viewOnGitHub:"View on GitHub",afterInstallation:"After installation:",steps:{restart:"Restart this application",autoAvailable:"TaskMaster features will automatically become available",initCommand:"Use task-master init in your project directory"}},settings:{enableLabel:"Enable TaskMaster Integration",enableDescription:"Show TaskMaster tasks, banners, and sidebar indicators across the interface"}},Ea={authStatus:{checking:"Checking...",connected:"Connected",notConnected:"Not connected",disconnected:"Disconnected",checkingAuth:"Checking authentication status...",loggedInAs:"Logged in as {{email}}",authenticatedUser:"authenticated user"},account:{claude:{description:"Anthropic Claude AI assistant"},cursor:{description:"Cursor AI-powered code editor"},codex:{description:"OpenAI Codex AI assistant"},opencode:{description:"OpenCode CLI assistant"}},connectionStatus:"Connection Status",login:{title:"Login",reAuthenticate:"Re-authenticate",description:"Sign in to your {{agent}} account to enable AI features",reAuthDescription:"Sign in with a different account or refresh credentials",button:"Login",reLoginButton:"Re-login"},error:"Error: {{error}}"},Ma={title:"Permission Settings",skipPermissions:{label:"Skip permission prompts (use with caution)",claudeDescription:"Equivalent to --dangerously-skip-permissions flag",cursorDescription:"Equivalent to -f flag in Cursor CLI"},allowedTools:{title:"Allowed Tools",description:"Tools that are automatically allowed without prompting for permission",placeholder:'e.g., "Bash(git log:*)" or "Write"',quickAdd:"Quick add common tools:",empty:"No allowed tools configured"},blockedTools:{title:"Blocked Tools",description:"Tools that are automatically blocked without prompting for permission",placeholder:'e.g., "Bash(rm:*)"',empty:"No blocked tools configured"},allowedCommands:{title:"Allowed Shell Commands",description:"Shell commands that are automatically allowed without prompting",placeholder:'e.g., "Shell(ls)" or "Shell(git status)"',quickAdd:"Quick add common commands:",empty:"No allowed commands configured"},blockedCommands:{title:"Blocked Shell Commands",description:"Shell commands that are automatically blocked",placeholder:'e.g., "Shell(rm -rf)" or "Shell(sudo)"',empty:"No blocked commands configured"},toolExamples:{title:"Tool Pattern Examples:",bashGitLog:"- Allow all git log commands",bashGitDiff:"- Allow all git diff commands",write:"- Allow all Write tool usage",bashRm:"- Block all rm commands (dangerous)"},shellExamples:{title:"Shell Command Examples:",ls:"- Allow ls command",gitStatus:"- Allow git status",npmInstall:"- Allow npm install",rmRf:"- Block recursive delete"},codex:{permissionMode:"Permission Mode",description:"Controls how Codex handles file modifications and command execution",modes:{default:{title:"Default",description:"Only trusted commands (ls, cat, grep, git status, etc.) run automatically. Other commands are skipped. Can write to workspace."},acceptEdits:{title:"Accept Edits",description:"All commands run automatically within the workspace. Full auto mode with sandboxed execution."},bypassPermissions:{title:"Bypass Permissions",description:"Full system access with no restrictions. All commands run automatically with full disk and network access. Use with caution."}},technicalDetails:"Technical details",technicalInfo:{default:"sandboxMode=workspace-write, approvalPolicy=untrusted. Trusted commands: cat, cd, grep, head, ls, pwd, tail, git status/log/diff/show, find (without -exec), etc.",acceptEdits:"sandboxMode=workspace-write, approvalPolicy=never. All commands auto-execute within project directory.",bypassPermissions:"sandboxMode=danger-full-access, approvalPolicy=never. Full system access, use only in trusted environments.",overrideNote:"You can override this per-session using the mode button in the chat interface."}},actions:{add:"Add"}},za={title:"MCP Servers",description:{claude:"Model Context Protocol servers provide additional tools and data sources to Claude",cursor:"Model Context Protocol servers provide additional tools and data sources to Cursor",codex:"Model Context Protocol servers provide additional tools and data sources to Codex",opencode:"Model Context Protocol servers provide additional tools and data sources to OpenCode"},addButton:"Add MCP Server",empty:"No MCP servers configured",serverType:"Type",scope:{local:"local",user:"user"},config:{command:"Command",url:"URL",args:"Args",environment:"Environment"},tools:{title:"Tools",count:"({{count}}):",more:"+{{count}} more"},actions:{edit:"Edit server",delete:"Delete server"},managed:{badge:"Managed",hint:"Managed by WindCli."},help:{title:"About Codex MCP",description:"Codex supports stdio-based MCP servers. You can add servers that extend Codex's capabilities with additional tools and resources."}},Da={title:"Plugins",description:"Extend the interface with custom plugins. Install from git or drop a folder in ~/.claude-code-ui/plugins/",installPlaceholder:"https://github.com/user/my-plugin",installButton:"Install",installing:"Installing…",securityWarning:"Only install plugins whose source code you have reviewed or from authors you trust.",scanningPlugins:"Scanning plugins…",noPluginsInstalled:"No plugins installed",pullLatest:"Pull latest from git",noGitRemote:"No git remote — update not available",uninstallPlugin:"Uninstall plugin",confirmUninstall:"Click again to confirm",confirmUninstallMessage:"Remove {{name}}? This cannot be undone.",cancel:"Cancel",remove:"Remove",updateFailed:"Update failed",installFailed:"Installation failed",uninstallFailed:"Uninstall failed",toggleFailed:"Toggle failed",starterPluginLabel:"Starter Plugin",starter:"Starter",docs:"Docs",sections:{officialTitle:"Official Plugins",officialDescription:"Maintained by the WindCli team and ready for direct install.",unofficialTitle:"Other Plugins",unofficialDescription:"Unofficial plugins and integrations from other users. Review the source before installing."},starterPlugin:{name:"Project Stats",badge:"starter",description:"File counts, lines of code, file-type breakdown, and recent activity for your project.",install:"Install"},terminalPlugin:{name:"Terminal",badge:"official",description:"Integrated terminal with full shell access directly within the interface.",install:"Install"},scheduledPromptPlugin:{name:"Scheduled Prompts",badge:"unofficial",description:"Schedule workspace prompts, review run history, and manage recurring local tasks.",install:"Install"},claudeWatchPlugin:{name:"Claude Watch",badge:"unofficial",description:"Watch long-running Claude Code sessions for hangs and expose process controls.",install:"Install"},prismCloudCLI:{name:"PRISM CloudCLI",badge:"unofficial",description:"Session intelligence for Claude Code, inside WindCli. See why your sessions are burning tokens without leaving the browser.",install:"Install"},sessionManagerPlugin:{name:"Sessions",badge:"unofficial",description:"View, manage, and kill active Claude Code sessions.",install:"Install"},tokenCostCalculatorPlugin:{name:"Token Cost Calculator",badge:"unofficial",description:"Calculate API costs from model prices and token usage, with preset model pricing support.",install:"Install"},taskQueuePlugin:{name:"Task Queue",badge:"unofficial",description:"Task queue dashboard to view, filter, and launch agent tasks.",install:"Install"},githubIssuesBoardPlugin:{name:"GitHub Issues Board",badge:"unofficial",description:"Kanban board for GitHub Issues with bidirectional TaskMaster sync and /github-task CLI skill auto-install",install:"Install"},claudeUsagePlugin:{name:"Claude Usage",badge:"unofficial",description:"Track live Claude Code plan limits and explore 30-day token and cost history.",install:"Install"},codexUsagePlugin:{name:"Codex Usage",badge:"unofficial",description:"Track live Codex plan limits, reset timing, and 30-day account token activity.",install:"Install"},morePlugins:"More",enable:"Enable",disable:"Disable",installAriaLabel:"Plugin git repository URL",tab:"tab",runningStatus:"running"},Na={title:pa,tabs:ma,account:ga,mcp:ha,appearance:fa,actions:ba,voiceSettings:va,quickSettings:ka,terminalShortcuts:xa,mainTabs:ya,notifications:wa,appearanceSettings:Ca,mcpForm:Sa,saveStatus:Pa,footerActions:Aa,git:ja,apiKeys:Ta,tasks:Ia,agents:Ea,permissions:Ma,mcpServers:za,pluginSettings:Da},$a={title:"Welcome Back",description:"Sign in to your WindCli self-hosted account",username:"Username",password:"Password",submit:"Sign In",loading:"Signing in...",errors:{invalidCredentials:"Invalid username or password",requiredFields:"Please fill in all fields",networkError:"Network error. Please try again."},placeholders:{username:"Enter your username",password:"Enter your password"}},Ra={title:"Create Account",username:"Username",password:"Password",confirmPassword:"Confirm Password",submit:"Create Account",loading:"Creating account...",errors:{passwordMismatch:"Passwords do not match",usernameTaken:"Username is already taken",weakPassword:"Password is too weak"}},La={title:"Sign Out",confirm:"Are you sure you want to sign out?",button:"Sign Out"},Fa={login:$a,register:Ra,logout:La},Ba={title:"Projects",newProject:"New Project",deleteProject:"Remove Project",renameProject:"Rename Project",noProjects:"No projects found",loadingProjects:"Loading projects...",searchPlaceholder:"Search projects...",projectNamePlaceholder:"Project name",starred:"Starred",all:"All",untitledSession:"Untitled Session",newSession:"New Session",codexSession:"Codex Session",fetchingProjects:"Fetching your Claude projects and sessions",projects:"projects",noMatchingProjects:"No matching projects",tryDifferentSearch:"Try adjusting your search term",runClaudeCli:"Run Claude CLI in a project directory to get started"},Ga={title:"WindCli",subtitle:"AI coding assistant interface"},Ha={title:"Sessions",newSession:"New Session",deleteSession:"Delete Session",renameSession:"Rename Session",noSessions:"No sessions yet",loadingSessions:"Loading sessions...",unnamed:"Unnamed",loading:"Loading...",showMore:"Show more sessions"},Oa={viewEnvironments:"View Environments",hideSidebar:"Hide sidebar",createProject:"Create new project",refresh:"Refresh projects and sessions (Ctrl+R)",renameProject:"Rename project (F2)",deleteProject:"Remove project from sidebar (Delete)",addToFavorites:"Add to favorites",removeFromFavorites:"Remove from favorites",editSessionName:"Manually edit session name",deleteSession:"Delete this session permanently",activeSessionIndicator:"Recently active session (last 10 minutes)",save:"Save",cancel:"Cancel",clearSearch:"Clear search",openCommandPalette:"Open command palette",attentionRequiredIndicator:"Session needs attention"},Ua={chat:"Chat",files:"Files",git:"Git",terminal:"Terminal",tasks:"Tasks"},qa={refresh:"Refresh",settings:"Settings",collapseAll:"Collapse All",expandAll:"Expand All",cancel:"Cancel",save:"Save",delete:"Delete",rename:"Rename",joinCommunity:"Join Community",reportIssue:"Report Issue",starOnGithub:"Star on GitHub"},Wa={openSource:"Open Source"},Va={active:"Active",inactive:"Inactive",thinking:"Thinking...",error:"Error",aborted:"Aborted",unknown:"Unknown"},Ka={justNow:"Just now",oneMinuteAgo:"1 min ago",minutesAgo:"{{count}} mins ago",oneHourAgo:"1 hour ago",hoursAgo:"{{count}} hours ago",oneDayAgo:"1 day ago",daysAgo:"{{count}} days ago"},_a={deleteConfirm:"Are you sure you want to delete this?",renameSuccess:"Renamed successfully",deleteSuccess:"Deleted successfully",errorOccurred:"An error occurred",deleteSessionConfirm:"Are you sure you want to delete this session? This action cannot be undone.",deleteProjectConfirm:"Remove this project from the sidebar? Your project files, memories, and session data will not be deleted.",enterProjectPath:"Please enter a project path",deleteSessionFailed:"Failed to delete session. Please try again.",deleteSessionError:"Error deleting session. Please try again.",renameSessionFailed:"Failed to rename session. Please try again.",renameSessionError:"Error renaming session. Please try again.",deleteProjectFailed:"Failed to remove project. Please try again.",deleteProjectError:"Error removing project. Please try again.",createProjectFailed:"Failed to create project. Please try again.",createProjectError:"Error creating project. Please try again.",updateProjectError:"Error updating project. Please try again.",refreshError:"Failed to refresh. Please try again.",restoreProjectFailed:"Failed to restore project. Please try again.",restoreProjectError:"Error restoring project. Please try again.",restoreSessionFailed:"Failed to restore session. Please try again.",restoreSessionError:"Error restoring session. Please try again."},Ya={updateAvailable:"Update available",restartRequired:"Update installed — restart the server to apply"},Ja={modeProjects:"Projects",modeConversations:"Conversations",conversationsPlaceholder:"Search in conversations...",searching:"Searching...",sessionTitles:"Session",conversationContents:"Conversation contents",noResults:"No results found",tryDifferentQuery:"Try a different search query",matches_one:"{{count}} match",matches_other:"{{count}} matches",projectsScanned_one:"{{count}} project scanned",projectsScanned_other:"{{count}} projects scanned"},Qa={title:"Recent conversations",emptyTitle:"No conversations yet",emptyDescription:"Your most recently updated conversations will appear here.",loadFailed:"Could not load recent conversations",loadMore:"Load older conversations",loadingMore:"Loading more..."},Za={deleteProject:"Remove Project",deleteSession:"Delete Session",confirmDelete:"What would you like to do with",sessionCount_one:"This project contains {{count}} conversation.",sessionCount_other:"This project contains {{count}} conversations.",removeFromSidebar:"Remove from sidebar only",deleteAllData:"Delete all data permanently",allConversationsDeleted:"The project will be removed from the sidebar. Your files, memories, and session data will be preserved.",cannotUndo:"You can re-add the project later."},Xa={projects:Ba,app:Ga,sessions:Ha,tooltips:Oa,navigation:Ua,actions:qa,branding:Wa,status:Va,time:Ka,messages:_a,version:Ya,search:Ja,recent:Qa,deleteConfirmation:Za},eo={copy:"Copy",copied:"Copied",copyCode:"Copy code"},to={copy:"Copy message",copied:"Message copied",selectFormat:"Select copy format",copyAsMarkdown:"Copy as markdown",copyAsText:"Copy as text"},no={user:"U",error:"Error",tool:"Tool",claude:"Claude",cursor:"Cursor",codex:"Codex",opencode:"OpenCode"},so={settings:"Tool Settings",error:"Tool Error",result:"Tool Result",viewParams:"View input parameters",viewRawParams:"View raw parameters",viewDiff:"View edit diff for",creatingFile:"Creating new file:",updatingTodo:"Updating Todo List",read:"Read",readFile:"Read file",updateTodo:"Update todo list",readTodo:"Read todo list",searchResults:"results"},io={found:"Found {{count}} {{type}}",file:"file",files:"files",pattern:"pattern:",in:"in:"},ao={updated:"File updated successfully",created:"File created successfully",written:"File written successfully",diff:"Diff",newFile:"New File",viewContent:"View file content",viewFullOutput:"View full output ({{count}} chars)",contentDisplayed:"The file content is displayed in the diff view above"},oo={title:"Interactive Prompt",waiting:"Waiting for your response in the CLI",instruction:"Please select an option in your terminal where Claude is running.",selectedOption:"✓ Claude selected option {{number}}",instructionDetail:"In the CLI, you would select this option interactively using arrow keys or by typing the number."},ro={title:"Thinking...",emoji:"💭 Thinking..."},lo={response:"JSON Response"},co={grant:"Grant permission for {{tool}}",added:"Permission added",addTo:"Adds {{entry}} to Allowed Tools.",retry:"Permission saved. Retry the request to use the tool.",error:"Unable to update permissions. Please try again.",openSettings:"Open settings"},uo={updated:"Todo list has been updated successfully",current:"Current Todo List"},po={viewPlan:"📋 View implementation plan",title:"Implementation Plan"},mo={resetAt:"Claude usage limit reached. Your limit will reset at **{{time}} {{timezone}}** - {{date}}"},go={permissionMode:"Permission Mode",modes:{default:"Default Mode",auto:"Auto Mode",acceptEdits:"Accept Edits",bypassPermissions:"Bypass Permissions",plan:"Plan Mode"},descriptions:{default:"Only trusted commands (ls, cat, grep, git status, etc.) run automatically. Other commands are skipped. Can write to workspace.",auto:"A model classifier decides per tool call whether to approve or deny. Hands-off, but safer than Bypass — denials still happen.",acceptEdits:"All commands run automatically within the workspace. Full auto mode with sandboxed execution.",bypassPermissions:"Full system access with no restrictions. All commands run automatically with full disk and network access. Use with caution.",plan:"Planning mode - no commands are executed"},technicalDetails:"Technical details"},ho={input:"Voice input",stopRecording:"Stop recording",transcribing:"Transcribing…",speak:"Read aloud",stopSpeaking:"Stop",loading:"Loading…"},fo={placeholder:"Type / for commands, @ for files, or ask {{provider}} anything...",placeholderDefault:"Type your message...",disabled:"Input disabled",attachFiles:"Attach files",attachImages:"Attach images",send:"Send",stop:"Stop",hintText:{ctrlEnter:"Ctrl+Enter to send • Shift+Enter for new line • Tab to change modes • / for slash commands",enter:"Enter to send • Shift+Enter for new line • Tab to change modes • / for slash commands",queue:"Enter to queue your next message",updateQueued:"Enter to update queued message"},clickToChangeMode:"Click to change permission mode (or press Tab in input)",showAllCommands:"Show all commands",clearInput:"Clear input",scrollToBottom:"Scroll to bottom",queue:{sendNext:"Queue next message",update:"Update queued message",label:"Queued",willSend:"Will send when this finishes",edit:"Edit queued message",delete:"Delete queued message"}},bo={reasoning:"Reasoning",model:"Model",effortDefault:"Default",loadingModels:"Loading models…",modelMenu:"Select model and reasoning effort",permissionHeading:"How should {{provider}} actions be approved?"},vo={title:"Choose Your AI Assistant",description:"Select a provider to start a new conversation",selectModel:"Select Model",providerInfo:{anthropic:"by Anthropic",openai:"by OpenAI",cursorEditor:"AI Code Editor",google:"by Google"},readyPrompt:{claude:"Ready to use Claude with {{model}}. Start typing your message below.",cursor:"Ready to use Cursor with {{model}}. Start typing your message below.",codex:"Ready to use Codex with {{model}}. Start typing your message below.",opencode:"Ready to use OpenCode with {{model}}. Start typing your message below.",default:"Select a provider above to begin"},pressToSearch:"Press <kbd>{{shortcut}}</kbd> to search sessions, files, and commits"},ko={continue:{title:"Continue your conversation",description:"Ask questions about your code, request changes, or get help with development tasks"},loading:{olderMessages:"Loading older messages...",sessionMessages:"Loading session messages..."},messages:{showingOf:"Showing {{shown}} of {{total}} messages",scrollToLoad:"Scroll up to load more",showingLast:"Showing last {{count}} messages ({{total}} total)",loadEarlier:"Load earlier messages",loadAll:"Load all messages",loadingAll:"Loading all messages...",allLoaded:"All messages loaded",perfWarning:'All messages loaded — scrolling may be slower. Click "Scroll to bottom" to restore performance.'}},xo={selectProject:{title:"Select a Project",description:"Choose a project to open an interactive shell in that directory"},status:{newSession:"New Session",initializing:"Initializing...",restarting:"Restarting..."},actions:{disconnect:"Disconnect",disconnectTitle:"Disconnect from shell",restart:"Restart",restartTitle:"Restart Shell",connect:"Continue in Shell",connectTitle:"Connect to shell"},loading:"Loading terminal...",connecting:"Connecting to shell...",startSession:"Start a new Claude session",resumeSession:"Resume session: {{displayName}}...",runCommand:"Run {{command}} in {{projectName}}",startCli:"Starting Claude CLI in {{projectName}}",defaultCommand:"command"},yo={actions:{thinking:"Thinking",processing:"Processing",analyzing:"Analyzing",working:"Working",computing:"Computing",reasoning:"Reasoning"},state:{live:"Live",paused:"Paused"},elapsed:{seconds:"{{count}}s",minutesSeconds:"{{minutes}}m {{seconds}}s",label:"{{time}} elapsed",startingNow:"Starting now"},stop:"Stop",controls:{stopGeneration:"Stop Generation",pressEscToStop:"Press Esc anytime to stop"},providers:{assistant:"Assistant"}},wo={startChatWithProvider:"Select a project to start chatting with {{provider}}"},Co={nextTaskPrompt:"Start the next task"},So={codeBlock:eo,copyMessage:to,messageTypes:no,tools:so,search:io,fileOperations:ao,interactive:oo,thinking:ro,json:lo,permissions:co,todo:uo,plan:po,usageLimit:mo,codex:go,voice:ho,input:fo,composer:bo,providerSelection:vo,session:ko,shell:xo,claudeStatus:yo,projectSelection:wo,tasks:Co},Po={changes:"changes",previousChange:"Previous change",nextChange:"Next change",hideDiff:"Hide diff highlighting",showDiff:"Show diff highlighting",settings:"Editor Settings",collapse:"Collapse editor",expand:"Expand editor to full width"},Ao="Loading {{fileName}}...",jo={showingChanges:"Showing changes"},To={copyPath:"Copy file path",pathCopied:"File path copied",download:"Download file",save:"Save",saving:"Saving...",saved:"Saved!",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",close:"Close",previewMarkdown:"Preview markdown",editMarkdown:"Edit markdown"},Io={lines:"Lines:",characters:"Characters:",shortcuts:"Press Ctrl+S to save • Esc to close"},Eo={title:"Binary File",message:'The file "{{fileName}}" cannot be displayed in the text editor because it is a binary file.'},Mo={loading:"Loading preview...",error:"Unable to display this file.",openInNewTab:"Open in new tab"},zo={toolbar:Po,loading:Ao,header:jo,actions:To,footer:Io,binaryFile:Eo,filePreview:Mo},Do={title:"TaskMaster AI is not configured",description:"TaskMaster helps break down complex projects into manageable tasks with AI-powered assistance",whatIsTitle:"🎯 What is TaskMaster?",features:{aiPowered:"AI-Powered Task Management: Break complex projects into manageable subtasks",prdTemplates:"PRD Templates: Generate tasks from Product Requirements Documents",dependencyTracking:"Dependency Tracking: Understand task relationships and execution order",progressVisualization:"Progress Visualization: Kanban boards and detailed task analytics",cliIntegration:"CLI Integration: Use taskmaster commands for advanced workflows"},initializeButton:"Initialize TaskMaster AI"},No={title:"Getting Started with TaskMaster",subtitle:"TaskMaster is initialized! Here's what to do next:",steps:{createPRD:{title:"Create a Product Requirements Document (PRD)",description:"Discuss your project idea and create a PRD that describes what you want to build.",addButton:"Add PRD",existingPRDs:"Existing PRDs:"},generateTasks:{title:"Generate Tasks from PRD",description:"Once you have a PRD, ask your AI assistant to parse it and TaskMaster will automatically break it down into manageable tasks with implementation details."},analyzeTasks:{title:"Analyze & Expand Tasks",description:"Ask your AI assistant to analyze task complexity and expand them into detailed subtasks for easier implementation."},startBuilding:{title:"Start Building",description:"Ask your AI assistant to begin working on tasks, update their status, and add new tasks as your project evolves."}},tip:"💡 Tip: Start with a PRD to get the most out of TaskMaster's AI-powered task generation"},$o={title:"TaskMaster Setup",subtitle:"Interactive CLI for {{projectName}}",willStart:"TaskMaster initialization will start automatically",completed:"TaskMaster setup completed! You can now close this window.",closeButton:"Close",closeContinueButton:"Close & Continue"},Ro={title:"Getting Started with TaskMaster",subtitle:"Your guide to productive task management",examples:{parsePRD:`💬 Example:
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeEditor-Cx2QOPKS.js","assets/vendor-react-C2GTiUCy.js","assets/MarkdownPreview-DM1I8sMC.js","assets/vendor-markdown-DkITEES2.js","assets/feature-chat-CenAll-X.js","assets/feature-workspace-X9kJZ4EG.js","assets/vendor-ui-CAUHSABu.js","assets/vendor-i18n-B6HjLCnN.js","assets/vendor-data-DsEZeNPr.js","assets/FileTree-CaCZBfXB.js","assets/StandaloneShell-C_SgfnxT.js","assets/Shell-eRBEAkRb.js","assets/Shell-DrlLKa8f.css","assets/GitPanel-C8vu-HU9.js","assets/index-BIKUx4Nd.js","assets/index-BnTqIKbW.js","assets/TaskMasterPanel-ePMcx8a-.js"])))=>i.map(i=>d[i]);
2
+ import{j as e,r,d as bt,u as vt,f as Kt,B as _t,h as Yt,i as We,k as Jt}from"./vendor-react-C2GTiUCy.js";import{L as kt,aa as Qt,a as ae,ab as Zt,ac as Xt,a6 as xt,ad as Be,c as ie,_ as ee,ae as yt,af as en,a4 as tn,ag as nn,ah as sn,ai as Ve,f as an,aj as wt,a2 as on,ak as Ct,u as St,h as rn,D as ln,z as cn,A as dn,E as un,F as pn,G as mn,H as gn,J as se,K as V,al as hn,am as fn,an as bn,ao as Pt,ap as vn,a3 as kn,aq as xn,ar as Ke,as as yn,at as wn,au as Cn,av as Sn,aw as Pn,ax as An}from"./feature-workspace-X9kJZ4EG.js";import{o as Ge,G as He,aG as Oe,bB as jn,a3 as Tn,ao as Ue,L as we,t as Ce,n as In,a8 as En,a9 as At,Q as jt,bC as _e,bD as Mn,j as Tt,U as zn,F as It,z as Dn,bE as Nn,X as Et,bF as $n,S as Rn,bG as Ln,R as Mt,bA as Fn,bH as Bn,$ as Gn,bs as Hn,bv as On,a5 as Un,x as qn,B as Wn,M as Vn,c as Kn,bI as _n,bJ as Yn,bK as Jn,aa as Qn}from"./vendor-ui-CAUHSABu.js";import{u as Z,i as qe,a as Zn,I as Xn}from"./vendor-i18n-B6HjLCnN.js";import{C as es,r as ts,c as ns}from"./feature-chat-CenAll-X.js";import"./vendor-data-DsEZeNPr.js";import"./vendor-markdown-DkITEES2.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();function ss({provider:t,title:s,status:n,connectedClassName:i,iconContainerClassName:a,loginButtonClassName:o,onLogin:l}){const c=n.authenticated?i:"border-border bg-card",u=n.loading?"Checking...":n.authenticated?n.email||"Connected":n.error||"Not connected";return e.jsx("div",{className:`rounded-xl border px-3 py-2.5 transition-colors ${c}`,children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("div",{className:`flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-full ${a}`,children:e.jsx(kt,{provider:t,className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-sm font-medium text-foreground",children:[s,n.authenticated&&e.jsx(Ge,{className:"h-3.5 w-3.5 flex-shrink-0 text-emerald-500"})]}),e.jsx("div",{className:"truncate text-xs text-muted-foreground",title:u,children:u})]})]}),!n.authenticated&&!n.loading&&e.jsx("button",{onClick:l,className:`${o} flex-shrink-0 rounded-lg px-4 py-1.5 text-sm font-medium text-white transition-colors`,children:"Login"})]})})}const is=[{provider:"claude",title:"Claude Code",connectedClassName:"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800",iconContainerClassName:"bg-blue-100 dark:bg-blue-900/30",loginButtonClassName:"bg-blue-600 hover:bg-blue-700"},{provider:"cursor",title:"Cursor",connectedClassName:"bg-purple-50 dark:bg-purple-900/20 border-purple-200 dark:border-purple-800",iconContainerClassName:"bg-purple-100 dark:bg-purple-900/30",loginButtonClassName:"bg-purple-600 hover:bg-purple-700"},{provider:"codex",title:"OpenAI Codex",connectedClassName:"bg-gray-100 dark:bg-gray-800/50 border-gray-300 dark:border-gray-600",iconContainerClassName:"bg-gray-100 dark:bg-gray-800",loginButtonClassName:"bg-gray-800 hover:bg-gray-900 dark:bg-gray-700 dark:hover:bg-gray-600"},{provider:"opencode",title:"OpenCode",connectedClassName:"bg-zinc-100 dark:bg-zinc-800/50 border-zinc-300 dark:border-zinc-600",iconContainerClassName:"bg-zinc-100 dark:bg-zinc-800",loginButtonClassName:"bg-zinc-800 hover:bg-zinc-900 dark:bg-zinc-700 dark:hover:bg-zinc-600"}];function as({providerStatuses:t,onOpenProviderLogin:s}){return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"font-serif text-xl font-bold tracking-tight text-foreground",children:"Connect Your AI Agents"}),e.jsx("p",{className:"mx-auto mt-1 max-w-sm text-sm leading-relaxed text-muted-foreground",children:"Login to one or more AI coding assistants. All are optional."})]}),e.jsx("div",{className:"-mr-1 max-h-[38vh] space-y-2 overflow-y-auto pr-1",children:is.map(n=>e.jsx(ss,{provider:n.provider,title:n.title,status:t[n.provider],connectedClassName:n.connectedClassName,iconContainerClassName:n.iconContainerClassName,loginButtonClassName:n.loginButtonClassName,onLogin:()=>s(n.provider)},n.provider))}),e.jsx("p",{className:"text-center text-xs text-muted-foreground",children:"You can configure these later in Settings."})]})}function os({gitName:t,gitEmail:s,isSubmitting:n,onGitNameChange:i,onGitEmailChange:a}){return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"mx-auto mb-3 flex h-14 w-14 items-center justify-center rounded-2xl bg-primary/10 ring-1 ring-inset ring-primary/20",children:e.jsx(He,{className:"h-7 w-7 text-primary"})}),e.jsx("h2",{className:"font-serif text-xl font-bold tracking-tight text-foreground",children:"Git Configuration"}),e.jsx("p",{className:"mx-auto mt-1 max-w-sm text-sm leading-relaxed text-muted-foreground",children:"Configure your git identity to ensure proper attribution for commits."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"gitName",className:"mb-2 flex items-center gap-2 text-sm font-medium text-foreground",children:[e.jsx(Oe,{className:"h-4 w-4"}),"Git Name ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",id:"gitName",value:t,onChange:o=>i(o.target.value),className:"w-full rounded-xl border border-border bg-background/60 px-4 py-2.5 text-foreground shadow-sm transition-colors placeholder:text-muted-foreground/60 hover:border-foreground/20 focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/30",placeholder:"John Doe",required:!0,disabled:n}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Saved as `git config --global user.name`."})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"gitEmail",className:"mb-2 flex items-center gap-2 text-sm font-medium text-foreground",children:[e.jsx(jn,{className:"h-4 w-4"}),"Git Email ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"email",id:"gitEmail",value:s,onChange:o=>a(o.target.value),className:"w-full rounded-xl border border-border bg-background/60 px-4 py-2.5 text-foreground shadow-sm transition-colors placeholder:text-muted-foreground/60 hover:border-foreground/20 focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/30",placeholder:"john@example.com",required:!0,disabled:n}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Saved as `git config --global user.email`."})]})]})]})}const Ye=[{title:"Git Configuration",icon:He,required:!0},{title:"Connect Agents",icon:Tn,required:!1}];function rs({currentStep:t}){return e.jsx("div",{className:"mb-5",children:e.jsx("div",{className:"flex items-center justify-between",children:Ye.map((s,n)=>{const i=n<t,a=n===t,o=s.icon;return e.jsxs("div",{className:"contents",children:[e.jsxs("div",{className:"flex flex-1 flex-col items-center",children:[e.jsx("div",{className:`flex h-10 w-10 items-center justify-center rounded-full border-2 transition-all duration-200 ${i?"border-emerald-500 bg-emerald-500 text-white shadow-lg shadow-emerald-500/25":a?"border-primary bg-primary text-primary-foreground shadow-lg shadow-primary/25":"border-border bg-card text-muted-foreground"}`,children:i?e.jsx(Ge,{className:"h-5 w-5"}):e.jsx(o,{className:"h-5 w-5"})}),e.jsxs("div",{className:"mt-1.5 text-center",children:[e.jsx("p",{className:`text-sm font-medium ${a?"text-foreground":"text-muted-foreground"}`,children:s.title}),s.required&&e.jsx("span",{className:"text-xs text-red-500",children:"Required"})]})]}),n<Ye.length-1&&e.jsx("div",{className:`mx-2 h-0.5 flex-1 transition-colors duration-200 ${i?"bg-emerald-500":"bg-border"}`})]},s.title)})})})}const Je=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Qe=async(t,s)=>{try{return(await t.json()).error||s}catch{return s}};function Ze({onComplete:t}){const[s,n]=r.useState(0),[i,a]=r.useState(""),[o,l]=r.useState(""),[c,u]=r.useState(!1),[d,g]=r.useState(""),[p,b]=r.useState(null),{providerAuthStatus:m,checkProviderAuthStatus:v,refreshProviderAuthStatuses:k}=Qt(),M=r.useRef(void 0),x=r.useCallback(async()=>{try{const P=await ae("/api/user/git-config");if(!P.ok)return;const N=await P.json();N.gitName&&a(N.gitName),N.gitEmail&&l(N.gitEmail)}catch(P){console.error("Error loading git config:",P)}},[]);r.useEffect(()=>{x(),k()},[x,k]),r.useEffect(()=>{const P=M.current;M.current=p,P!=null&&p===null&&k()},[p,k]);const A=P=>{b(P)},y=P=>{P===0&&p&&v(p)},E=async()=>{if(g(""),s!==0){n(P=>P+1);return}if(!i.trim()||!o.trim()){g("Both git name and email are required.");return}if(!Je.test(o)){g("Please enter a valid email address.");return}u(!0);try{const P=await ae("/api/user/git-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gitName:i,gitEmail:o})});if(!P.ok){const N=await Qe(P,"Failed to save git configuration");throw new Error(N)}n(N=>N+1)}catch(P){g(P instanceof Error?P.message:"Failed to save git configuration")}finally{u(!1)}},L=()=>{g(""),n(P=>P-1)},D=async()=>{u(!0),g("");try{const P=await ae("/api/user/complete-onboarding",{method:"POST"});if(!P.ok){const N=await Qe(P,"Failed to complete onboarding");throw new Error(N)}await t?.()}catch(P){g(P instanceof Error?P.message:"Failed to complete onboarding")}finally{u(!1)}},F=s===0?!!(i.trim()&&o.trim()&&Je.test(o)):!0;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative h-screen overflow-y-auto bg-background",children:[e.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none fixed inset-0",children:[e.jsx("div",{className:"absolute -top-40 left-1/2 h-[36rem] w-[36rem] -translate-x-1/2 rounded-full bg-primary/10 blur-3xl"}),e.jsx("div",{className:"absolute -bottom-32 -left-24 h-[26rem] w-[26rem] rounded-full bg-primary/5 blur-3xl"}),e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(hsl(var(--foreground)/0.04)_1px,transparent_1px)] opacity-60 [background-size:22px_22px]"})]}),e.jsx("div",{className:"relative mx-auto flex min-h-full w-full max-w-2xl items-center justify-center p-4",children:e.jsxs("div",{className:"w-full py-6",children:[e.jsx(rs,{currentStep:s}),e.jsxs("div",{className:"rounded-2xl border border-border/70 bg-card/90 p-6 shadow-[0_24px_60px_-20px_hsl(var(--foreground)/0.18)] ring-1 ring-foreground/5 backdrop-blur-xl",children:[s===0?e.jsx(os,{gitName:i,gitEmail:o,isSubmitting:c,onGitNameChange:a,onGitEmailChange:l}):e.jsx(as,{providerStatuses:m,onOpenProviderLogin:A}),d&&e.jsx("div",{role:"alert",className:"mt-5 rounded-xl border border-destructive/30 bg-destructive/10 p-3.5",children:e.jsx("p",{className:"text-sm text-destructive",children:d})}),e.jsxs("div",{className:"mt-6 flex items-center justify-between border-t border-border pt-5",children:[e.jsxs("button",{onClick:L,disabled:s===0||c,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-muted-foreground transition-colors duration-200 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",children:[e.jsx(Ue,{className:"h-4 w-4"}),"Previous"]}),e.jsx("div",{className:"flex items-center gap-3",children:s<1?e.jsx("button",{onClick:E,disabled:!F||c,className:"flex items-center gap-2 rounded-xl bg-primary px-6 py-2.5 font-medium text-primary-foreground shadow-lg shadow-primary/25 transition-all duration-200 hover:brightness-110 active:scale-[0.99] disabled:cursor-not-allowed disabled:opacity-60 disabled:shadow-none",children:c?e.jsxs(e.Fragment,{children:[e.jsx(we,{className:"h-4 w-4 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:["Next",e.jsx(Ce,{className:"h-4 w-4"})]})}):e.jsx("button",{onClick:D,disabled:c,className:"flex items-center gap-2 rounded-xl bg-emerald-600 px-6 py-2.5 font-medium text-white shadow-lg shadow-emerald-600/25 transition-all duration-200 hover:bg-emerald-700 active:scale-[0.99] disabled:cursor-not-allowed disabled:opacity-60 disabled:shadow-none",children:c?e.jsxs(e.Fragment,{children:[e.jsx(we,{className:"h-4 w-4 animate-spin"}),"Completing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ge,{className:"h-4 w-4"}),"Complete Setup"]})})})]})]})]})})]}),p&&e.jsx(Zt,{isOpen:!!p,onClose:()=>b(null),provider:p,onComplete:y})]})}const ls=["0s","0.15s","0.3s"];function cs(){return e.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[e.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0",children:e.jsx("div",{className:"absolute -top-40 left-1/2 h-[36rem] w-[36rem] -translate-x-1/2 rounded-full bg-primary/10 blur-3xl"})}),e.jsxs("div",{className:"relative text-center",role:"status","aria-live":"polite",children:[e.jsx("div",{className:"mb-5 flex justify-center",children:e.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gradient-to-br from-primary to-primary/80 shadow-lg shadow-primary/25 ring-1 ring-inset ring-white/20",children:e.jsx("img",{src:"/logo.svg",alt:"WindCli",className:"h-9 w-9"})})}),e.jsx("h1",{className:"mb-4 text-2xl font-bold tracking-tight text-foreground",style:{fontFamily:Xt},children:"WindCli"}),e.jsx("p",{className:"sr-only",children:"Loading authentication state…"}),e.jsx("div",{"aria-hidden":!0,className:"flex items-center justify-center gap-2",children:ls.map(t=>e.jsx("div",{className:"h-2 w-2 animate-bounce rounded-full bg-primary",style:{animationDelay:t}},t))})]})]})}function zt({errorMessage:t}){return t?e.jsxs("div",{role:"alert",className:"flex items-start gap-2.5 rounded-xl border border-destructive/30 bg-destructive/10 p-3 text-destructive",children:[e.jsx(In,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),e.jsx("p",{className:"text-sm leading-relaxed",children:t})]}):null}function fe({id:t,label:s,value:n,onChange:i,placeholder:a,isDisabled:o,type:l="text",name:c,autoComplete:u,icon:d}){const[g,p]=r.useState(!1),b=l==="password",m=b&&g?"text":l;return e.jsxs("div",{children:[e.jsx("label",{htmlFor:t,className:"mb-1.5 block text-sm font-medium text-foreground",children:s}),e.jsxs("div",{className:"group relative",children:[d&&e.jsx(d,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground transition-colors group-focus-within:text-primary"}),e.jsx("input",{id:t,type:m,name:c??t,autoComplete:u,value:n,onChange:v=>i(v.target.value),className:`w-full rounded-xl border border-border bg-background/60 py-2.5 text-foreground shadow-sm transition-colors placeholder:text-muted-foreground/60 hover:border-foreground/20 focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/30 disabled:cursor-not-allowed disabled:opacity-60 ${d?"pl-10":"pl-3.5"} ${b?"pr-11":"pr-3.5"}`,placeholder:a,required:!0,disabled:o}),b&&e.jsx("button",{type:"button",onClick:()=>p(v=>!v),disabled:o,"aria-label":g?"Hide password":"Show password",className:"absolute right-2 top-1/2 flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 disabled:opacity-60",children:g?e.jsx(En,{className:"h-4 w-4"}):e.jsx(At,{className:"h-4 w-4"})})]})]})}function Dt({title:t,description:s,children:n,footerText:i,logo:a}){return e.jsxs("div",{className:"relative h-screen overflow-y-auto bg-background",children:[e.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none fixed inset-0",children:[e.jsx("div",{className:"absolute -top-40 left-1/2 h-[36rem] w-[36rem] -translate-x-1/2 rounded-full bg-primary/10 blur-3xl"}),e.jsx("div",{className:"absolute -bottom-32 -left-24 h-[26rem] w-[26rem] rounded-full bg-primary/5 blur-3xl"}),e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(hsl(var(--foreground)/0.04)_1px,transparent_1px)] opacity-60 [background-size:22px_22px]"})]}),e.jsx("div",{className:"relative mx-auto flex min-h-full w-full max-w-md items-center justify-center p-4 py-8",children:e.jsxs("div",{className:"w-full rounded-2xl border border-border/70 bg-card/90 p-8 shadow-[0_24px_60px_-20px_hsl(var(--foreground)/0.18)] ring-1 ring-foreground/5 backdrop-blur-xl sm:p-10",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"mb-5 flex justify-center",children:a??e.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gradient-to-br from-primary to-primary/80 shadow-lg shadow-primary/25 ring-1 ring-inset ring-white/20",children:e.jsx("img",{src:"/logo.svg",alt:"WindCli",className:"h-9 w-9"})})}),e.jsx("h1",{className:"font-serif text-3xl font-bold tracking-tight text-foreground",children:t}),e.jsx("p",{className:"mx-auto mt-2 max-w-xs text-sm leading-relaxed text-muted-foreground",children:s})]}),e.jsx("div",{className:"mt-8",children:n}),e.jsx("div",{className:"mt-6 border-t border-border/60 pt-5 text-center",children:e.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:i})}),!xt&&e.jsxs("div",{className:"mt-4 flex items-center justify-center gap-1.5",children:[e.jsx("svg",{className:"h-3.5 w-3.5 text-muted-foreground/50",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"})}),e.jsx("a",{href:"https://github.com/CaineWind/wacli",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground/50 transition-colors hover:text-muted-foreground",children:"WindCli is open source"})]})]})})]})}const ds={username:"",password:""};function us(){const{t}=Z("auth"),{error:s,login:n}=Be(),[i,a]=r.useState(ds),[o,l]=r.useState(""),[c,u]=r.useState(!1),d=r.useCallback((p,b)=>{a(m=>({...m,[p]:b}))},[]),g=r.useCallback(async p=>{if(p.preventDefault(),l(""),!i.username.trim()||!i.password){l(t("login.errors.requiredFields"));return}u(!0);const b=await n(i.username.trim(),i.password);b.success||l(b.error),u(!1)},[i.password,i.username,n,t]);return e.jsx(Dt,{title:t("login.title"),description:t("login.description"),footerText:"Enter your credentials to access WindCli",children:e.jsxs("form",{onSubmit:g,className:"space-y-4",children:[e.jsx(fe,{id:"username",label:t("login.username"),value:i.username,onChange:p=>d("username",p),placeholder:t("login.placeholders.username"),isDisabled:c,autoComplete:"username",icon:Oe}),e.jsx(fe,{id:"password",label:t("login.password"),value:i.password,onChange:p=>d("password",p),placeholder:t("login.placeholders.password"),isDisabled:c,type:"password",autoComplete:"current-password",icon:jt}),e.jsx(zt,{errorMessage:o||s||""}),e.jsx("button",{type:"submit",disabled:c,className:"flex w-full items-center justify-center gap-2 rounded-xl bg-primary px-4 py-2.5 font-medium text-primary-foreground shadow-lg shadow-primary/25 transition-all duration-200 hover:shadow-primary/30 hover:brightness-110 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-2 focus:ring-offset-card active:scale-[0.99] disabled:cursor-not-allowed disabled:opacity-60",children:c?e.jsxs(e.Fragment,{children:[e.jsx(we,{className:"h-4 w-4 animate-spin"}),t("login.loading")]}):t("login.submit")})]})})}const ps={username:"",password:"",confirmPassword:""};function ms(t){return!t.username.trim()||!t.password||!t.confirmPassword?"Please fill in all fields.":t.username.trim().length<3?"Username must be at least 3 characters long.":t.password.length<6?"Password must be at least 6 characters long.":t.password!==t.confirmPassword?"Passwords do not match.":null}function gs(){const{register:t}=Be(),[s,n]=r.useState(ps),[i,a]=r.useState(""),[o,l]=r.useState(!1),c=r.useCallback((d,g)=>{n(p=>({...p,[d]:g}))},[]),u=r.useCallback(async d=>{d.preventDefault(),a("");const g=ms(s);if(g){a(g);return}l(!0);const p=await t(s.username.trim(),s.password);p.success||a(p.error),l(!1)},[s,t]);return e.jsx(Dt,{title:"Welcome to WindCli",description:"Set up your account to get started",footerText:"This is a single-user system. Only one account can be created.",children:e.jsxs("form",{onSubmit:u,className:"space-y-4",children:[e.jsx(fe,{id:"username",name:"username",label:"Username",value:s.username,onChange:d=>c("username",d),placeholder:"Choose a username",isDisabled:o,autoComplete:"username",icon:Oe}),e.jsx(fe,{id:"password",name:"password",label:"Password",value:s.password,onChange:d=>c("password",d),placeholder:"Create a password",isDisabled:o,type:"password",autoComplete:"new-password",icon:jt}),e.jsx(fe,{id:"confirmPassword",name:"confirmPassword",label:"Confirm Password",value:s.confirmPassword,onChange:d=>c("confirmPassword",d),placeholder:"Re-enter your password",isDisabled:o,type:"password",autoComplete:"new-password",icon:_e}),e.jsxs("p",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(_e,{className:"h-3.5 w-3.5"}),"At least 3 characters for username, 6 for password."]}),e.jsx(zt,{errorMessage:i}),e.jsx("button",{type:"submit",disabled:o,className:"flex w-full items-center justify-center gap-2 rounded-xl bg-primary px-4 py-2.5 font-medium text-primary-foreground shadow-lg shadow-primary/25 transition-all duration-200 hover:shadow-primary/30 hover:brightness-110 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-2 focus:ring-offset-card active:scale-[0.99] disabled:cursor-not-allowed disabled:opacity-60",children:o?e.jsxs(e.Fragment,{children:[e.jsx(we,{className:"h-4 w-4 animate-spin"}),"Setting up..."]}):"Create Account"})]})})}function hs({children:t}){const{user:s,isLoading:n,needsSetup:i,hasCompletedOnboarding:a,refreshOnboardingStatus:o}=Be();return n?e.jsx(cs,{}):xt?a?e.jsx(e.Fragment,{children:t}):e.jsx(Ze,{onComplete:o}):i?e.jsx(gs,{}):s?a?e.jsx(e.Fragment,{children:t}):e.jsx(Ze,{onComplete:o}):e.jsx(us,{})}const Re=t=>t.replace(/\\/g,"/"),Nt=(t,s)=>{for(const n of t)n.type==="file"?s.push({name:n.name,path:n.path}):n.children&&n.children.length>0&&Nt(n.children,s)},fs=(t,s)=>{const n=Re(s).replace(/^\.\//,"").replace(/^\/+/,"");if(!n)return null;const i=t.find(o=>{const l=Re(o.path);return l===n||l.endsWith(`/${n}`)});if(i)return i.path;const a=n.split("/").pop()||n;return t.find(o=>o.name===a)?.path??null};function bs(t,s){const n=t?.projectId,i=r.useRef({projectId:void 0,files:null}),a=r.useCallback(()=>{if(!n)return Promise.resolve([]);if(i.current.projectId===n&&i.current.files)return i.current.files;const o=(async()=>{try{const l=await ie.getFiles(n);if(!l.ok)return[];const c=await l.json(),u=Array.isArray(c)?c:[],d=[];return Nt(u,d),d}catch{return[]}})();return i.current={projectId:n,files:o},o},[n]);return r.useCallback((o,l)=>{const c=Re(o).trim();a().then(u=>{const d=fs(u,c);s(d??o,l)})},[a,s])}const vs=({selectedProject:t,isMobile:s,initialWidth:n=600})=>{const[i,a]=r.useState(null),[o,l]=r.useState(n),[c,u]=r.useState(!1),[d,g]=r.useState(!1),[p,b]=r.useState(!1),m=r.useRef(null),v=r.useCallback((A,y=null)=>{const L=A.replace(/\\/g,"/").split("/").pop()||A;a({name:L,path:A,projectId:t?.projectId,diffInfo:y})},[t?.projectId]),k=r.useCallback(()=>{a(null),u(!1)},[]),M=r.useCallback(()=>{u(A=>!A)},[]),x=r.useCallback(A=>{s||(b(!0),g(!0),A.preventDefault())},[s]);return r.useEffect(()=>{const A=E=>{if(!d)return;const D=m.current?.parentElement?.parentElement;if(!D)return;const F=D.getBoundingClientRect(),P=F.right-E.clientX,N=300,K=F.width*.8;P>=N&&P<=K&&l(P)},y=()=>{g(!1)};return d&&(document.addEventListener("mousemove",A),document.addEventListener("mouseup",y),document.body.style.cursor="col-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",y),document.body.style.cursor="",document.body.style.userSelect=""}},[d]),{editingFile:i,editorWidth:o,editorExpanded:c,hasManualWidth:p,resizeHandleRef:m,handleFileOpen:v,handleCloseEditor:k,handleToggleEditorExpand:M,handleResizeStart:x}},Xe=r.lazy(()=>ee(()=>import("./CodeEditor-Cx2QOPKS.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])));function et(){return e.jsx("div",{className:"flex h-full min-h-0 flex-1 items-center justify-center",role:"status","aria-label":"Loading editor",children:e.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-muted-foreground/30 border-t-muted-foreground"})})}const ks=200,De=280;function xs({editingFile:t,isMobile:s,editorExpanded:n,editorWidth:i,hasManualWidth:a,resizeHandleRef:o,onResizeStart:l,onCloseEditor:c,onToggleEditorExpand:u,projectPath:d,fillSpace:g}){const[p,b]=r.useState(!1),m=r.useRef(null),[v,k]=r.useState(i);if(r.useEffect(()=>{if(!t||s||p)return;const x=()=>{if(!m.current)return;const E=m.current.parentElement;if(!E)return;const D=E.clientWidth-ks;D<De?b(!0):i>D?k(D):k(i)};x(),window.addEventListener("resize",x);const A=new ResizeObserver(x),y=m.current?.parentElement;return y&&A.observe(y),()=>{window.removeEventListener("resize",x),A.disconnect()}},[t,s,p,i]),!t)return null;if(s||p)return e.jsx(r.Suspense,{fallback:e.jsx(et,{}),children:e.jsx(Xe,{file:t,onClose:()=>{b(!1),c()},projectPath:d,isSidebar:!1})});const M=n||g&&!a;return e.jsxs("div",{ref:m,className:`flex h-full min-w-0 ${n?"flex-1":""}`,children:[!n&&e.jsx("div",{ref:o,onMouseDown:l,className:"group relative w-1 flex-shrink-0 cursor-col-resize bg-gray-200 transition-colors hover:bg-blue-500 dark:bg-gray-700 dark:hover:bg-blue-600",title:"Drag to resize",children:e.jsx("div",{className:"absolute inset-y-0 left-1/2 w-1 -translate-x-1/2 bg-blue-500 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-blue-600"})}),e.jsx("div",{className:`h-full overflow-hidden border-l border-gray-200 dark:border-gray-700 ${M?"min-w-0 flex-1":`min-w-[ flex-shrink-0${De}px]`}`,style:M?void 0:{width:`${v}px`,minWidth:`${De}px`},children:e.jsx(r.Suspense,{fallback:e.jsx(et,{}),children:e.jsx(Xe,{file:t,onClose:c,projectPath:d,isSidebar:!0,isExpanded:n,onToggleExpand:u,onPopOut:()=>b(!0)})})})]})}function ys({hasSelectedProject:t,children:s}){const n=t?"flex min-w-0 flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-3":"flex min-w-0 flex-row items-center justify-between gap-2 sm:gap-3";return e.jsx("div",{className:n,children:s})}function ws(t){const s=r.useRef(!1),n=r.useCallback(o=>{o&&(o.preventDefault(),o.stopPropagation()),t()},[t]),i=r.useCallback(o=>{s.current=!0,n(o),window.setTimeout(()=>{s.current=!1},350)},[n]);return{handleMobileMenuClick:r.useCallback(o=>{if(s.current){o.preventDefault(),o.stopPropagation();return}n(o)},[n]),handleMobileMenuTouchEnd:i}}function $t({onMenuClick:t,compact:s=!1}){const{handleMobileMenuClick:n,handleMobileMenuTouchEnd:i}=ws(t),a=s?"flex h-10 w-10 items-center justify-center rounded-lg text-muted-foreground hover:bg-accent/60 hover:text-foreground pwa-menu-button":"flex h-10 w-10 flex-shrink-0 touch-manipulation items-center justify-center rounded-lg text-muted-foreground hover:bg-accent/60 hover:text-foreground active:scale-95 pwa-menu-button";return e.jsx("button",{onClick:n,onTouchEnd:i,className:a,"aria-label":"Open menu",children:e.jsx("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})}const Rt={kind:"builtin",id:"herdr",labelKey:"tabs.herdr",icon:Mn},Cs=[{kind:"builtin",id:"chat",labelKey:"tabs.chat",icon:Tt},{kind:"builtin",id:"shell",labelKey:"tabs.shell",icon:zn},Rt,{kind:"builtin",id:"files",labelKey:"tabs.files",icon:It},{kind:"builtin",id:"git",labelKey:"tabs.git",icon:He}],Ss={kind:"builtin",id:"browser",labelKey:"tabs.browser",icon:Dn},Ps={kind:"builtin",id:"tasks",labelKey:"tabs.tasks",icon:Nn};function As({hasSelectedProject:t,shouldShowTasksTab:s,shouldShowBrowserTab:n}){return t?[...Cs,...n?[Ss]:[],...s?[Ps]:[]]:[Rt]}function js({activeTab:t,setActiveTab:s,hasSelectedProject:n,shouldShowTasksTab:i,shouldShowBrowserTab:a}){const{t:o}=Z(),{plugins:l}=yt(),c=As({hasSelectedProject:n,shouldShowBrowserTab:a,shouldShowTasksTab:i}),u=(n?l:[]).filter(p=>p.enabled).map(p=>({kind:"plugin",id:`plugin:${p.name}`,label:p.displayName,pluginName:p.name,iconFile:p.icon})),d=[...c,...u],g=p=>{const b=p.currentTarget.closest('[role="tablist"]');if(!b)return;const m=Array.from(b.querySelectorAll('[role="tab"]')),v=m.indexOf(p.currentTarget);let k;if(p.key==="ArrowRight")k=(v+1)%m.length;else if(p.key==="ArrowLeft")k=(v-1+m.length)%m.length;else if(p.key==="Home")k=0;else if(p.key==="End")k=m.length-1;else return;p.preventDefault(),m[k]?.focus(),m[k]?.click()};return e.jsx(en,{role:"tablist","aria-label":o("tabs.views",{defaultValue:"Workspace views"}),className:d.length===1?"min-w-max bg-transparent p-0 shadow-none":"min-w-max border border-border/40 bg-muted/50 shadow-inner shadow-black/[0.025] dark:shadow-black/10",children:d.map((p,b)=>{const m=p.id===t,v=p.kind==="builtin"?o(p.labelKey):p.label;return e.jsxs(r.Fragment,{children:[b===c.length&&u.length>0&&e.jsx("span",{"aria-hidden":"true",className:"mx-1 h-4 w-px shrink-0 bg-border"}),e.jsx(tn,{content:v,position:"bottom",children:e.jsxs(nn,{role:"tab","aria-label":v,"aria-selected":m,tabIndex:m?0:-1,isActive:m,onClick:()=>s(p.id),onKeyDown:g,className:"h-10 max-w-44 px-3 py-[5px] sm:h-8 sm:px-2.5",children:[p.kind==="builtin"?e.jsx(p.icon,{className:"h-3.5 w-3.5 shrink-0",strokeWidth:m?2.2:1.8}):e.jsx(sn,{pluginName:p.pluginName,iconFile:p.iconFile,className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center [&>svg]:h-full [&>svg]:w-full"}),e.jsx("span",{className:`${m?"inline max-w-28":"hidden"} truncate sm:max-w-36 lg:inline`,children:v})]})})]},`${p.id}-${b}`)})})}function Ts(t,s,n,i){return t.startsWith("plugin:")&&i?i:t==="files"?n("mainContent.projectFiles"):t==="git"?n("tabs.git"):t==="herdr"?n("tabs.herdr"):t==="tasks"&&s?"TaskMaster":t==="browser"?n("tabs.browser"):"Project"}function Is({activeTab:t,selectedProject:s,selectedSession:n,shouldShowTasksTab:i}){const{t:a}=Z(),{plugins:o}=yt(),l=t.startsWith("plugin:")?o.find(d=>d.name===t.replace("plugin:",""))?.displayName:void 0,c=t==="chat"&&!!n,u=t==="chat"&&!n;return e.jsxs("div",{className:"scrollbar-hide flex min-w-0 flex-1 items-center gap-2 overflow-x-auto",children:[c&&e.jsx("div",{className:"flex h-5 w-5 flex-shrink-0 items-center justify-center",children:e.jsx(kt,{provider:n?.__provider,className:"h-4 w-4"})}),e.jsx("div",{className:"min-w-0 flex-1",children:t==="chat"&&n?e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{title:Ve(n),className:"truncate text-sm font-semibold leading-tight text-foreground",children:Ve(n)}),e.jsx("div",{className:"truncate text-[11px] leading-tight text-muted-foreground",children:s.displayName})]}):u?e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"text-base font-semibold leading-tight text-foreground",children:a("mainContent.newSession")}),e.jsx("div",{className:"truncate text-xs leading-tight text-muted-foreground",children:s.displayName})]}):e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"text-sm font-semibold leading-tight text-foreground",children:Ts(t,i,a,l)}),e.jsx("div",{className:"truncate text-[11px] leading-tight text-muted-foreground",children:s.displayName})]})})]})}function tt({activeTab:t,setActiveTab:s,selectedProject:n,selectedSession:i,shouldShowTasksTab:a,shouldShowBrowserTab:o,isMobile:l,onMenuClick:c}){const{t:u}=Z(),d=r.useRef(null),[g,p]=r.useState(!1),[b,m]=r.useState(!1),v=g||b,k=r.useCallback(()=>{const x=d.current;x&&(p(x.scrollLeft>2),m(x.scrollLeft<x.scrollWidth-x.clientWidth-2))},[]);r.useEffect(()=>{const x=d.current;if(!x)return;k();const A=new ResizeObserver(k);return A.observe(x),x.firstElementChild&&A.observe(x.firstElementChild),()=>A.disconnect()},[k]),r.useEffect(()=>{const x=d.current;if(!x)return;const A=y=>{if(Math.abs(y.deltaY)<=Math.abs(y.deltaX))return;const E=x.scrollWidth-x.clientWidth;if(!(y.deltaY<0?x.scrollLeft>0:x.scrollLeft<E))return;y.preventDefault();const D=y.deltaMode===WheelEvent.DOM_DELTA_LINE?20:1;x.scrollBy({left:y.deltaY*D,behavior:"auto"})};return x.addEventListener("wheel",A,{passive:!1}),()=>x.removeEventListener("wheel",A)},[]),r.useEffect(()=>{const x=window.requestAnimationFrame(()=>{d.current?.querySelector('[role="tab"][aria-selected="true"]')?.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}),k()});return()=>window.cancelAnimationFrame(x)},[t,k]);const M=x=>{const A=d.current;A&&A.scrollBy({left:x*Math.max(180,A.clientWidth*.65),behavior:"smooth"})};return e.jsx("header",{className:"pwa-header-safe flex-shrink-0 border-b border-border/60 bg-background/95 px-3 py-1.5 backdrop-blur-sm sm:px-4 sm:py-2",children:e.jsxs(ys,{hasSelectedProject:!!n,children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2 sm:max-w-[min(34%,24rem)] sm:flex-[1_1_18rem]",children:[l&&e.jsx($t,{onMenuClick:c}),n&&e.jsx(Is,{activeTab:t,selectedProject:n,selectedSession:i,shouldShowTasksTab:a})]}),e.jsx("div",{className:"-mx-3 min-w-0 sm:mx-0 sm:flex-1",children:e.jsxs("div",{className:"relative ml-auto w-fit max-w-full",children:[g&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 z-10 w-12 bg-gradient-to-r from-background via-background/90 to-transparent"}),e.jsx("div",{ref:d,onScroll:k,className:an("scrollbar-hide max-w-full scroll-smooth overflow-x-auto overscroll-x-contain px-3 [-webkit-overflow-scrolling:touch]",v?"sm:px-9":"sm:pl-3 sm:pr-0"),children:e.jsx(js,{activeTab:t,setActiveTab:s,hasSelectedProject:!!n,shouldShowTasksTab:a,shouldShowBrowserTab:o})}),b&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 z-10 w-12 bg-gradient-to-l from-background via-background/90 to-transparent"}),g&&e.jsx("button",{type:"button",onClick:()=>M(-1),"aria-label":u("navigation.scrollTabsLeft",{defaultValue:"Scroll tabs left"}),className:"absolute left-1 top-1/2 z-20 hidden h-7 w-7 -translate-y-1/2 items-center justify-center rounded-md border border-border/70 bg-background/95 text-muted-foreground shadow-sm outline-none hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-primary/60 sm:flex",children:e.jsx(Ue,{className:"h-4 w-4"})}),b&&e.jsx("button",{type:"button",onClick:()=>M(1),"aria-label":u("navigation.scrollTabsRight",{defaultValue:"Scroll tabs right"}),className:"absolute right-1 top-1/2 z-20 hidden h-7 w-7 -translate-y-1/2 items-center justify-center rounded-md border border-border/70 bg-background/95 text-muted-foreground shadow-sm outline-none hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-primary/60 sm:flex",children:e.jsx(Ce,{className:"h-4 w-4"})})]})})]})})}function nt({mode:t,isMobile:s,onMenuClick:n,showMobileHeader:i=!0}){const{t:a}=Z(),o=t==="loading";return e.jsxs("div",{className:"flex h-full flex-col",children:[s&&i&&e.jsx("div",{className:"pwa-header-safe flex-shrink-0 border-b border-border/50 bg-background/80 p-2 backdrop-blur-sm sm:p-3",children:e.jsx($t,{onMenuClick:n,compact:!0})}),o?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsxs("div",{className:"text-center text-muted-foreground",children:[e.jsx("div",{className:"mx-auto mb-4 h-10 w-10",children:e.jsx("div",{className:"h-full w-full rounded-full border-[3px] border-muted border-t-primary",style:{animation:"spin 1s linear infinite",WebkitAnimation:"spin 1s linear infinite",MozAnimation:"spin 1s linear infinite"}})}),e.jsx("h2",{className:"mb-1 text-lg font-semibold text-foreground",children:a("mainContent.loading")}),e.jsx("p",{className:"text-sm",children:a("mainContent.settingUpWorkspace")})]})}):e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsxs("div",{className:"mx-auto max-w-md px-6 text-center",children:[e.jsx("div",{className:"mx-auto mb-5 flex h-14 w-14 items-center justify-center rounded-2xl bg-muted/50",children:e.jsx(It,{className:"h-7 w-7 text-muted-foreground"})}),e.jsx("h2",{className:"mb-2 text-xl font-semibold text-foreground",children:a("mainContent.chooseProject")}),e.jsx("p",{className:"mb-5 text-sm leading-relaxed text-muted-foreground",children:a("mainContent.selectProjectDescription")}),e.jsx("div",{className:"rounded-xl border border-primary/10 bg-primary/5 p-3.5",children:e.jsxs("p",{className:"text-sm text-primary",children:[e.jsxs("strong",{children:[a("mainContent.tip"),":"]})," ",a(s?"mainContent.createProjectMobile":"mainContent.createProjectDesktop")]})})]})})]})}const Es=r.createContext(null),Ne={didCatch:!1,error:null};let Ms=class extends r.Component{constructor(s){super(s),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Ne}static getDerivedStateFromError(s){return{didCatch:!0,error:s}}resetErrorBoundary(){const{error:s}=this.state;if(s!==null){for(var n,i,a=arguments.length,o=new Array(a),l=0;l<a;l++)o[l]=arguments[l];(n=(i=this.props).onReset)===null||n===void 0||n.call(i,{args:o,reason:"imperative-api"}),this.setState(Ne)}}componentDidCatch(s,n){var i,a;(i=(a=this.props).onError)===null||i===void 0||i.call(a,s,n)}componentDidUpdate(s,n){const{didCatch:i}=this.state,{resetKeys:a}=this.props;if(i&&n.error!==null&&zs(s.resetKeys,a)){var o,l;(o=(l=this.props).onReset)===null||o===void 0||o.call(l,{next:a,prev:s.resetKeys,reason:"keys"}),this.setState(Ne)}}render(){const{children:s,fallbackRender:n,FallbackComponent:i,fallback:a}=this.props,{didCatch:o,error:l}=this.state;let c=s;if(o){const u={error:l,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")c=n(u);else if(i)c=r.createElement(i,u);else if(a!==void 0)c=a;else throw l}return r.createElement(Es.Provider,{value:{didCatch:o,error:l,resetErrorBoundary:this.resetErrorBoundary}},c)}};function zs(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.length!==s.length||t.some((n,i)=>!Object.is(n,s[i]))}function Ds(t){return t instanceof Error?`${t.name}: ${t.message}`:String(t)}function Ns({error:t,resetErrorBoundary:s,showDetails:n,componentStack:i}){return e.jsx("div",{className:"flex flex-col items-center justify-center p-8 text-center",children:e.jsxs("div",{className:"max-w-md rounded-lg border border-red-200 bg-red-50 p-6",children:[e.jsxs("div",{className:"mb-4 flex items-center",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx("svg",{className:"h-5 w-5 text-red-400",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})}),e.jsx("h3",{className:"ml-3 text-sm font-medium text-red-800",children:"Something went wrong"})]}),e.jsxs("div",{className:"text-sm text-red-700",children:[e.jsx("p",{className:"mb-2",children:"An error occurred while loading this view."}),n&&e.jsxs("details",{className:"mt-4",children:[e.jsx("summary",{className:"cursor-pointer font-mono text-xs",children:"Error Details"}),e.jsxs("pre",{className:"mt-2 max-h-40 overflow-auto rounded bg-red-100 p-2 text-xs",children:[Ds(t),i]})]})]}),e.jsx("div",{className:"mt-4",children:e.jsx("button",{onClick:s,className:"rounded bg-red-600 px-4 py-2 text-sm text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500",children:"Try Again"})})]})})}function Lt({children:t,showDetails:s=!1,onRetry:n=void 0,resetKeys:i=void 0}){const[a,o]=r.useState(null),l=r.useCallback((d,g)=>{console.error("ErrorBoundary caught an error:",d,g),o(g?.componentStack??null)},[]),c=r.useCallback(()=>{o(null),n?.()},[n]),u=r.useCallback(({error:d,resetErrorBoundary:g})=>e.jsx(Ns,{error:d,resetErrorBoundary:g,showDetails:s,componentStack:a}),[s,a]);return e.jsx(Ms,{fallbackRender:u,onError:l,onReset:c,resetKeys:i,children:t})}const $s=r.lazy(()=>ee(()=>import("./FileTree-CaCZBfXB.js"),__vite__mapDeps([9,1,5,6,7,8,3]))),Rs=r.lazy(()=>ee(()=>import("./StandaloneShell-C_SgfnxT.js"),__vite__mapDeps([10,1,11,5,6,7,8,3,12]))),Ls=r.lazy(()=>ee(()=>import("./GitPanel-C8vu-HU9.js"),__vite__mapDeps([13,1,5,6,7,8,3]))),Fs=r.lazy(()=>ee(()=>import("./feature-workspace-X9kJZ4EG.js").then(t=>t.ay),__vite__mapDeps([5,1,6,7,8,3]))),Bs=r.lazy(()=>ee(()=>import("./index-BIKUx4Nd.js"),__vite__mapDeps([14,1,5,6,7,8,3])).then(t=>({default:t.BrowserUsePanel}))),st=r.lazy(()=>ee(()=>import("./index-BnTqIKbW.js"),__vite__mapDeps([15,1,10,11,5,6,7,8,3,12])).then(t=>({default:t.HerdrPanel}))),Gs=r.lazy(()=>ee(()=>import("./TaskMasterPanel-ePMcx8a-.js"),__vite__mapDeps([16,5,1,6,7,8,3,4])));function Hs(){return e.jsx("div",{className:"flex h-full w-full items-center justify-center",role:"status","aria-label":"Loading view",children:e.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-muted-foreground/30 border-t-muted-foreground"})})}function X({children:t,resetKey:s}){return e.jsx(Lt,{resetKeys:[s],onRetry:()=>window.location.reload(),children:e.jsx(r.Suspense,{fallback:e.jsx(Hs,{}),children:t})})}function Os({selectedProject:t,selectedSession:s,activeTab:n,setActiveTab:i,ws:a,sendMessage:o,isMobile:l,onMenuClick:c,isLoading:u,onInputFocusChange:d,onSessionProcessing:g,onSessionIdle:p,processingSessions:b,onNavigateToSession:m,onSessionEstablished:v,onShowSettings:k,externalMessageUpdate:M,newSessionTrigger:x,onProjectSelect:A,onProjectsRefresh:y}){const{preferences:E}=wt(),{showRawParameters:L,showThinking:D,sendByCtrlEnter:F}=E,{tasksEnabled:P,isTaskMasterInstalled:N}=on(),[K,U]=r.useState(!1),[W,I]=r.useState(n==="tasks"),H=!!(P&&N),$=K,{editingFile:R,editorWidth:re,editorExpanded:te,hasManualWidth:le,resizeHandleRef:ce,handleFileOpen:f,handleCloseEditor:z,handleToggleEditorExpand:q,handleResizeStart:J}=vs({selectedProject:t,isMobile:l}),Pe=bs(t,f);r.useEffect(()=>{!H&&n==="tasks"&&i("chat")},[H,n,i]),r.useEffect(()=>{n==="tasks"&&I(!0)},[n]);const ue=r.useCallback(async()=>{try{const ne=await ae("/api/browser-use/settings"),be=await ne.json();U(!!(ne.ok&&be?.success!==!1&&be?.data?.settings?.enabled))}catch{U(!1)}},[]);return r.useEffect(()=>(ue(),window.addEventListener("browserUseSettingsChanged",ue),()=>window.removeEventListener("browserUseSettingsChanged",ue)),[ue]),r.useEffect(()=>{!$&&n==="browser"&&i("chat")},[$,n,i]),Ct({openFile:ne=>{i("files"),f(ne)},openFileInEditor:ne=>{Pe(ne)}}),u?e.jsx(nt,{mode:"loading",isMobile:l,onMenuClick:c}):t?e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx(tt,{activeTab:n,setActiveTab:i,selectedProject:t,selectedSession:s,shouldShowTasksTab:H,shouldShowBrowserTab:$,isMobile:l,onMenuClick:c}),e.jsxs("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[e.jsxs("div",{className:`flex min-h-0 min-w-[200px] flex-col overflow-hidden ${te?"hidden":""} flex-1`,children:[e.jsx("div",{className:`h-full ${n==="chat"?"block":"hidden"}`,children:e.jsx(Lt,{showDetails:!0,children:e.jsx(es,{isActive:n==="chat",selectedProject:t,selectedSession:s,ws:a,sendMessage:o,onFileOpen:f,onInputFocusChange:d,onSessionProcessing:g,onSessionIdle:p,processingSessions:b,onNavigateToSession:m,onSessionEstablished:v,onShowSettings:k,showRawParameters:L,showThinking:D,sendByCtrlEnter:F,externalMessageUpdate:M,newSessionTrigger:x,onShowAllTasks:P?()=>i("tasks"):null})})}),n==="files"&&e.jsx("div",{className:"h-full overflow-hidden",children:e.jsx(X,{resetKey:"files",children:e.jsx($s,{selectedProject:t,onFileOpen:f})})}),n==="shell"&&e.jsx("div",{className:"h-full w-full overflow-hidden",children:e.jsx(X,{resetKey:"shell",children:e.jsx(Rs,{project:t,session:s,showHeader:!1,isActive:n==="shell"})})}),n==="herdr"&&e.jsx("div",{className:"h-full w-full overflow-hidden bg-gray-900",children:e.jsx(X,{resetKey:"herdr",children:e.jsx(st,{isActive:n==="herdr"})})}),n==="git"&&e.jsx("div",{className:"h-full overflow-hidden",children:e.jsx(X,{resetKey:"git",children:e.jsx(Ls,{selectedProject:t,isMobile:l,onFileOpen:f,onProjectSelect:A,onProjectsRefresh:y})})}),H&&W&&e.jsx(X,{resetKey:"tasks",children:e.jsx(Gs,{isVisible:n==="tasks"})}),$&&n==="browser"&&e.jsx("div",{className:"h-full overflow-hidden",children:e.jsx(X,{resetKey:"browser",children:e.jsx(Bs,{isVisible:n==="browser",onShowSettings:k})})}),n.startsWith("plugin:")&&e.jsx("div",{className:"h-full overflow-hidden",children:e.jsx(X,{resetKey:n,children:e.jsx(Fs,{pluginName:n.replace("plugin:",""),selectedProject:t,selectedSession:s})})})]}),e.jsx(X,{resetKey:`editor:${R?.path??"closed"}`,children:e.jsx(xs,{editingFile:R,isMobile:l,editorExpanded:te,editorWidth:re,hasManualWidth:le,resizeHandleRef:ce,onResizeStart:J,onCloseEditor:z,onToggleEditorExpand:q,projectPath:t.path,fillSpace:n==="files"})})]})]}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx(tt,{activeTab:n,setActiveTab:i,selectedProject:null,selectedSession:null,shouldShowTasksTab:!1,shouldShowBrowserTab:!1,isMobile:l,onMenuClick:c}),e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:n==="herdr"?e.jsx("div",{className:"h-full w-full overflow-hidden bg-gray-900",children:e.jsx(X,{resetKey:"herdr-empty-project",children:e.jsx(st,{isActive:!0})})}):e.jsx(nt,{mode:"empty",isMobile:l,onMenuClick:c,showMobileHeader:!1})})]})}const Us=bt.memo(Os);function Se(t){const[s,n]=r.useState([]),{enabled:i,deps:a,fetcher:o,parse:l}=t;return r.useEffect(()=>{if(!i){n([]);return}const c=new AbortController;return o(c.signal).then(u=>u.json()).then(u=>{c.signal.aborted||n(l(u))}).catch(u=>{c.signal.aborted||u instanceof DOMException&&u.name==="AbortError"||n([])}),()=>c.abort()},[i,...a]),s}function qs(t,s){return Se({enabled:s&&!!t,deps:[t],fetcher:n=>{const i=new URLSearchParams({limit:"50",offset:"0"});return ae(`/api/projects/${encodeURIComponent(t)}/sessions?${i.toString()}`,{signal:n})},parse:n=>(n.sessions??[]).map(i=>({id:i.id,label:i.title||i.summary||i.name||i.id,provider:i.__provider||i.provider}))})}const Ws=500;function Ft(t,s){for(const n of t){if(s.length>=Ws)return;n.type==="file"?s.push({path:n.path,name:n.name}):n.children&&n.children.length>0&&Ft(n.children,s)}}function Vs(t,s){return Se({enabled:s&&!!t,deps:[t],fetcher:n=>ie.getFiles(t,{signal:n}),parse:n=>{const i=Array.isArray(n)?n:[],a=[];return Ft(i,a),a}})}function Ks(t,s){return Se({enabled:s&&!!t,deps:[t],fetcher:n=>{const i=new URLSearchParams({project:t,limit:"50"});return ae(`/api/git/commits?${i.toString()}`,{signal:n})},parse:n=>n.commits?n.commits.map(i=>({hash:i.hash,shortHash:i.hash.slice(0,7),message:i.message,author:i.author})):[]})}const _s=2,Ys=250;function Js(t,s,n){const[i,a]=r.useState([]),o=r.useRef(0),l=r.useRef(null);return r.useEffect(()=>{const c=s.trim();if(!n||!t||c.length<_s){a([]),l.current?.close(),l.current=null;return}l.current?.close(),l.current=null,o.current++;const u=setTimeout(()=>{const d=++o.current,g=ie.searchConversationsUrl(c),p=new EventSource(g);l.current=p;const b=[];p.addEventListener("result",v=>{if(d!==o.current){p.close();return}try{const M=JSON.parse(v.data).projectResult;if(M.projectId!==t)return;for(const x of M.sessions)b.push({sessionId:x.sessionId,label:x.sessionSummary||x.sessionId,snippet:x.matches[0]?.snippet??"",provider:x.provider});a([...b])}catch{}});const m=()=>{d===o.current&&(p.close(),l.current=null)};p.addEventListener("done",m),p.addEventListener("error",m)},Ys);return()=>{clearTimeout(u)}},[t,s,n]),r.useEffect(()=>()=>{l.current?.close(),l.current=null},[]),i}function Qs(t,s){return Se({enabled:s&&!!t,deps:[t],fetcher:n=>{const i=new URLSearchParams({project:t});return ae(`/api/git/branches?${i.toString()}`,{signal:n})},parse:n=>(n.localBranches??[]).map(i=>({name:i}))})}async function ke(t,s){return(await ae(t,{method:"POST",body:JSON.stringify(s)})).json()}function Zs(t){const s=r.useCallback(()=>t?ke("/api/git/fetch",{project:t}):Promise.resolve(),[t]),n=r.useCallback(()=>t?ke("/api/git/pull",{project:t}):Promise.resolve(),[t]),i=r.useCallback(()=>t?ke("/api/git/push",{project:t}):Promise.resolve(),[t]),a=r.useCallback(o=>t?ke("/api/git/checkout",{project:t,branch:o}):Promise.resolve(),[t]);return{fetch:s,pull:n,push:i,checkout:a}}const it={actions:"Actions",files:"Files",sessions:"Sessions",commits:"Commits",branches:"Branches"},Xs=[{id:"chat",label:"Go to Chat",keywords:"chat messages conversation"},{id:"files",label:"Go to Files",keywords:"files file tree explorer"},{id:"shell",label:"Go to Shell",keywords:"shell terminal console"},{id:"herdr",label:"Go to Herdr",keywords:"herdr agents panes workspace terminal"},{id:"git",label:"Go to Git",keywords:"git diff branches"},{id:"tasks",label:"Go to Tasks",keywords:"tasks taskmaster"}];function ei({selectedProject:t,onStartNewChat:s,onOpenSettings:n,onShowTab:i}){const[a,o]=r.useState(!1),[l,c]=r.useState(""),[u,d]=r.useState([]),{toggleDarkMode:g}=St(),p=vt(),b=rn(),m=u.at(-1);r.useEffect(()=>{const f=z=>{(z.metaKey||z.ctrlKey)&&!z.shiftKey&&!z.altKey&&z.key.toLowerCase()==="k"&&(z.preventDefault(),o(J=>!J))};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[]),r.useEffect(()=>{a||(c(""),d([]))},[a]);const v=t?.projectId,k=!m||m==="actions",M=!m||m==="sessions",x=!m||m==="files",A=!m||m==="commits",y=!m||m==="branches"||m==="actions",E=qs(v,a&&M),L=Js(v,l,a&&M),D=Vs(v,a&&x),F=Ks(v,a&&A),P=Qs(v,a&&y),N=Zs(v),K=r.useMemo(()=>{if(!M)return[];const f=new Map;for(const z of E)f.set(z.id,{id:z.id,label:z.label,provider:z.provider});for(const z of L){const q=f.get(z.sessionId);q?q.snippet=z.snippet:f.set(z.sessionId,{id:z.sessionId,label:z.label,provider:z.provider,snippet:z.snippet})}return Array.from(f.values())},[E,L,M]),U=r.useCallback(f=>{o(!1),f()},[]),W=r.useCallback(f=>{c(""),d(z=>[...z,f])},[]),I=r.useCallback(()=>{c(""),d(f=>f.slice(0,-1))},[]),H=r.useCallback(f=>{f.key==="Backspace"&&!l&&u.length>0&&(f.preventDefault(),I())},[l,u.length,I]),$=!t,R=5,re=m==="files"?D:D.slice(0,R),te=m==="commits"?F:F.slice(0,R),le=m==="sessions"?K:K.slice(0,R),ce=m==="branches"?P:P.slice(0,R);return e.jsx(ln,{open:a,onOpenChange:o,children:e.jsxs(cn,{className:"max-w-xl overflow-hidden p-0",children:[e.jsx(dn,{children:"Command palette"}),e.jsxs(un,{label:"Command palette",onKeyDown:H,children:[m&&e.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-accent px-2 py-0.5 text-xs font-medium text-accent-foreground",children:[it[m],e.jsx("button",{type:"button",onClick:I,"aria-label":"Back to all",className:"ml-0.5 rounded-sm opacity-70 hover:opacity-100",children:e.jsx(Et,{className:"h-3 w-3"})})]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Backspace to go back"})]}),e.jsx(pn,{placeholder:m?`Search ${it[m].toLowerCase()}…`:"Type to search anything…",value:l,onValueChange:c}),e.jsxs(mn,{children:[e.jsx(gn,{children:"No results."}),k&&e.jsxs(se,{heading:"Actions",children:[e.jsxs(V,{value:"Start new chat",disabled:$,onSelect:()=>{t&&U(()=>s(t))},children:[e.jsx($n,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsx("span",{className:"flex-1",children:"Start new chat"}),$&&e.jsx("span",{className:"text-xs text-muted-foreground",children:"Select a project first"})]}),e.jsxs(V,{value:"Open settings",onSelect:()=>U(()=>n()),children:[e.jsx(Rn,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsx("span",{className:"flex-1",children:"Open settings"})]}),e.jsxs(V,{value:"Toggle theme dark light mode",onSelect:()=>U(g),children:[e.jsx(Ln,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsx("span",{className:"flex-1",children:"Toggle theme"})]})]}),k&&e.jsx(se,{heading:"Navigate",children:Xs.map(f=>e.jsx(V,{value:`${f.label} ${f.keywords}`,onSelect:()=>U(()=>i?.(f.id)),children:e.jsx("span",{className:"flex-1",children:f.label})},f.id))}),k&&v&&e.jsxs(se,{heading:"Git",children:[e.jsxs(V,{value:"Git Fetch remote",onSelect:()=>U(()=>{N.fetch(),i?.("git")}),children:[e.jsx(Mt,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsx("span",{className:"flex-1",children:"Git: Fetch"})]}),e.jsxs(V,{value:"Git Pull merge upstream",onSelect:()=>U(()=>{N.pull(),i?.("git")}),children:[e.jsx(Fn,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsx("span",{className:"flex-1",children:"Git: Pull"})]}),e.jsxs(V,{value:"Git Push origin remote",onSelect:()=>U(()=>{N.push(),i?.("git")}),children:[e.jsx(Bn,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsx("span",{className:"flex-1",children:"Git: Push"})]})]}),k&&e.jsx(se,{heading:"Settings",children:hn.map(({id:f,label:z,keywords:q,icon:J})=>e.jsxs(V,{value:`Settings ${z} ${q}`,onSelect:()=>U(()=>n(f)),children:[e.jsx(J,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsxs("span",{className:"flex-1",children:["Settings: ",z]})]},f))}),M&&v&&le.length>0&&e.jsxs(se,{heading:"Sessions",children:[le.map(f=>e.jsxs(V,{value:`${f.label} ${f.snippet??""} ${f.id}`.trim(),onSelect:()=>U(()=>p(`/session/${f.id}`)),children:[e.jsx(Tt,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsx("span",{className:"truncate",children:f.label}),f.snippet&&e.jsx("span",{className:"truncate text-xs text-muted-foreground",children:f.snippet})]}),f.provider&&e.jsx("span",{className:"text-xs text-muted-foreground",children:f.provider})]},f.id)),!m&&K.length>R&&e.jsx(xe,{label:`Browse all sessions (${K.length})`,onSelect:()=>W("sessions")})]}),x&&v&&re.length>0&&e.jsxs(se,{heading:"Files",children:[re.map(f=>e.jsxs(V,{value:f.path,onSelect:()=>U(()=>b.openFile(f.path)),children:[e.jsx(Gn,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsx("span",{className:"flex-1 truncate",children:f.name}),e.jsx("span",{className:"truncate text-xs text-muted-foreground",children:f.path})]},f.path)),!m&&D.length>R&&e.jsx(xe,{label:`Browse all files (${D.length})`,onSelect:()=>W("files")})]}),A&&v&&te.length>0&&e.jsxs(se,{heading:"Commits",children:[te.map(f=>e.jsxs(V,{value:`${f.message} ${f.author} ${f.shortHash}`,onSelect:()=>U(()=>i?.("git")),children:[e.jsx(Hn,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:f.shortHash}),e.jsx("span",{className:"flex-1 truncate",children:f.message}),e.jsx("span",{className:"truncate text-xs text-muted-foreground",children:f.author})]},f.hash)),!m&&F.length>R&&e.jsx(xe,{label:`Browse all commits (${F.length})`,onSelect:()=>W("commits")})]}),y&&v&&ce.length>0&&e.jsxs(se,{heading:"Branches",children:[ce.map(f=>e.jsxs(V,{value:f.name,onSelect:()=>U(()=>{N.checkout(f.name),i?.("git")}),children:[e.jsx(On,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsxs("span",{className:"flex-1 truncate",children:["Switch to: ",f.name]})]},`branch-${f.name}`)),!m&&P.length>R&&e.jsx(xe,{label:`Browse all branches (${P.length})`,onSelect:()=>W("branches")})]})]})]})]})})}function xe({label:t,onSelect:s}){return e.jsxs(V,{value:t,onSelect:s,children:[e.jsx(Ce,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),e.jsx("span",{className:"flex-1 text-muted-foreground",children:t})]})}const Le="quickSettingsHandlePosition",he=50,ti=10,ni=90,si=5,Bt="flex items-center justify-between p-3 rounded-lg bg-muted/60 hover:bg-accent transition-colors border border-transparent hover:border-border",ii=`${Bt} cursor-pointer`,ai="h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 focus:ring-2 dark:focus:ring-blue-400 bg-gray-100 dark:bg-gray-800 checked:bg-blue-600 dark:checked:bg-blue-600",oi=[{key:"showRawParameters",labelKey:"quickSettings.showRawParameters",icon:At},{key:"showThinking",labelKey:"quickSettings.showThinking",icon:Wn}],at=[{key:"sendByCtrlEnter",labelKey:"quickSettings.sendByCtrlEnter",icon:Un},{key:"voiceEnabled",labelKey:"quickSettings.voiceEnabled",icon:qn}],Gt=t=>Math.max(ti,Math.min(ni,t)),ri=()=>{if(typeof window>"u")return he;const t=localStorage.getItem(Le);if(!t)return he;try{const s=JSON.parse(t);if(typeof s.y=="number"&&Number.isFinite(s.y))return Gt(s.y)}catch{return localStorage.removeItem(Le),he}return he},ot=t=>t.type.includes("touch"),rt=t=>"touches"in t?t.touches[0]?.clientY??null:"clientY"in t&&typeof t.clientY=="number"?t.clientY:null;function li({isMobile:t}){const[s,n]=r.useState(ri),[i,a]=r.useState(!1),[o,l]=r.useState(!1),c=r.useRef(null),u=r.useRef(he),d=r.useRef(!1),g=r.useRef(!1),p=r.useRef(!1),b=r.useCallback(()=>{p.current&&(document.body.style.cursor="",document.body.style.userSelect="",document.body.style.overflow="",document.body.style.position="",document.body.style.width="",p.current=!1)},[]),m=r.useCallback(y=>{p.current||(document.body.style.cursor="grabbing",document.body.style.userSelect="none",y&&(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%"),p.current=!0)},[]),v=r.useCallback(()=>{!i&&c.current===null||(g.current=d.current,d.current=!1,c.current=null,a(!1),l(!1),b())},[b,i]),k=r.useCallback(y=>{if(!i||c.current===null)return;const E=rt(y);if(E===null)return;const L=E-c.current,D=Math.abs(L)>si;if(!d.current&&D&&(d.current=!0,l(!0),m(ot(y))),!d.current)return;ot(y)&&y.preventDefault();const F=Math.max(window.innerHeight,1),P=L/F*100,N=t?-P:P;n(Gt(u.current+N))},[m,t,i]),M=r.useCallback(y=>{y.stopPropagation();const E=rt(y);E!==null&&(c.current=E,u.current=s,d.current=!1,l(!1),a(!0))},[s]);r.useEffect(()=>{localStorage.setItem(Le,JSON.stringify({y:s}))},[s]),r.useEffect(()=>{if(!i)return;const y=F=>{k(F)},E=()=>{v()},L=F=>{k(F)},D=()=>{v()};return document.addEventListener("mousemove",y),document.addEventListener("mouseup",E),document.addEventListener("touchmove",L,{passive:!1}),document.addEventListener("touchend",D),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",E),document.removeEventListener("touchmove",L),document.removeEventListener("touchend",D)}},[v,k,i]),r.useEffect(()=>(()=>{b()}),[b]);const x=r.useCallback(()=>g.current?(g.current=!1,!0):!1,[]),A=r.useMemo(()=>!t||typeof window>"u"?{top:`${s}%`,transform:"translateY(-50%)"}:{bottom:`${window.innerHeight*s/100}px`},[s,t]);return{isDragging:o,handleStyle:A,startDrag:M,endDrag:v,consumeSuppressedClick:x}}function $e({title:t,children:s,className:n=""}){return e.jsxs("div",{className:`space-y-2 ${n}`,children:[e.jsx("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:t}),s]})}function ci({label:t,icon:s,checked:n,onCheckedChange:i}){return e.jsxs("label",{className:ii,children:[e.jsxs("span",{className:"flex items-center gap-2 text-sm text-foreground",children:[e.jsx(s,{className:"h-4 w-4 text-muted-foreground"}),t]}),e.jsx("input",{type:"checkbox",checked:n,onChange:a=>i(a.target.checked),className:ai})]})}const di=r.memo(ci);function ui({isDarkMode:t,preferences:s,onPreferenceChange:n}){const{t:i}=Z("settings"),a=s.voiceEnabled?at:at.filter(({key:l})=>l!=="voiceEnabled"),o=l=>l.map(({key:c,labelKey:u,icon:d})=>e.jsx(di,{label:i(u),icon:d,checked:s[c],onCheckedChange:g=>n(c,g)},c));return e.jsxs("div",{className:"flex-1 space-y-6 overflow-y-auto overflow-x-hidden bg-background p-4",children:[e.jsxs($e,{title:i("quickSettings.sections.appearance"),children:[e.jsxs("div",{className:Bt,children:[e.jsxs("span",{className:"flex items-center gap-2 text-sm text-foreground",children:[t?e.jsx(Vn,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(Kn,{className:"h-4 w-4 text-muted-foreground"}),i("quickSettings.darkMode")]}),e.jsx(fn,{})]}),e.jsx(bn,{compact:!0})]}),e.jsx($e,{title:i("quickSettings.sections.toolDisplay"),children:o(oi)}),e.jsxs($e,{title:i("quickSettings.sections.inputSettings"),children:[o(a),e.jsx("p",{className:"ml-3 text-xs text-muted-foreground",children:i("quickSettings.sendByCtrlEnterDescription")})]})]})}function pi({isOpen:t,isDragging:s,hideOnMobile:n=!1,style:i,onClick:a,onMouseDown:o,onTouchStart:l}){const{t:c}=Z("settings"),u=t?"right-64":"right-0",d=s?"border-blue-500 dark:border-blue-400":"border-gray-200 dark:border-gray-700",g=s?"":"transition-all duration-150 ease-out",p=s?"cursor-grabbing":"cursor-pointer",b=c(s?"quickSettings.dragHandle.dragging":t?"quickSettings.dragHandle.closePanel":"quickSettings.dragHandle.openPanel"),m=c(s?"quickSettings.dragHandle.draggingStatus":"quickSettings.dragHandle.toggleAndMove");return e.jsx("button",{type:"button",onClick:a,onMouseDown:o,onTouchStart:l,className:`fixed ${u} z-50 ${n?"hidden md:block":""} ${g} border bg-white dark:bg-gray-800 ${d} rounded-l-md p-2 shadow-lg transition-colors hover:bg-gray-100 dark:hover:bg-gray-700 ${p} touch-none`,style:{...i,touchAction:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none"},"aria-label":b,title:m,children:s?e.jsx(_n,{className:"h-5 w-5 text-blue-500 dark:text-blue-400"}):t?e.jsx(Ce,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"}):e.jsx(Ue,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"})})}function mi(){const{t}=Z("settings");return e.jsx("div",{className:"border-b border-border bg-muted/40 p-4",children:e.jsxs("h3",{className:"flex items-center gap-2 text-lg font-semibold text-foreground",children:[e.jsx(Yn,{className:"h-5 w-5 text-muted-foreground"}),t("quickSettings.title")]})})}function gi({hideHandleOnMobile:t=!1}){const[s,n]=r.useState(!1),{isMobile:i}=Pt({trackPWA:!1}),{isDarkMode:a}=St(),{preferences:o,setPreference:l}=wt(),{isDragging:c,handleStyle:u,startDrag:d,consumeSuppressedClick:g}=li({isMobile:i}),p=r.useMemo(()=>({showRawParameters:o.showRawParameters,showThinking:o.showThinking,sendByCtrlEnter:o.sendByCtrlEnter,voiceEnabled:o.voiceEnabled}),[o.sendByCtrlEnter,o.showRawParameters,o.showThinking,o.voiceEnabled]),b=r.useCallback((v,k)=>{l(v,k)},[l]),m=r.useCallback(v=>{if(g()){v.preventDefault();return}n(k=>!k)},[g]);return e.jsxs(e.Fragment,{children:[e.jsx(pi,{isOpen:s,isDragging:c,hideOnMobile:t,style:u,onClick:m,onMouseDown:d,onTouchStart:d}),e.jsx("div",{className:`fixed right-0 top-0 z-[9999] h-full w-64 transform border-l border-border bg-background shadow-xl transition-transform duration-150 ease-out ${s?"translate-x-0":"translate-x-full"} ${i?"h-screen":""}`,children:e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx(mi,{}),e.jsx(ui,{isDarkMode:a,preferences:p,onPreferenceChange:b})]})}),s&&e.jsx("div",{className:"fixed inset-0 z-[9998] bg-background/80 backdrop-blur-sm transition-opacity duration-150 ease-out",onClick:()=>n(!1)})]})}const hi=1e4,fi=(t,s)=>{if(t.size!==s.size)return!1;for(const[n,i]of t){const a=s.get(n);if(!a||i.statusText!==a.statusText||i.canInterrupt!==a.canInterrupt||i.startedAt!==a.startedAt)return!1}return!0};function bi(){const[t,s]=r.useState(new Map),n=r.useCallback((o,l)=>{o&&s(c=>{const u=c.get(o),d={statusText:l?.statusText!==void 0?l.statusText:u?.statusText??null,canInterrupt:l?.canInterrupt??u?.canInterrupt??!0,startedAt:u?.startedAt??Date.now()};if(u&&u.statusText===d.statusText&&u.canInterrupt===d.canInterrupt)return c;const g=new Map(c);return g.set(o,d),g})},[]),i=r.useCallback((o,l)=>{o&&s(c=>{const u=c.get(o);if(!u||l?.ifStartedBefore!==void 0&&u.startedAt>=l.ifStartedBefore)return c;const d=new Map(c);return d.delete(o),d})},[]),a=r.useCallback(o=>{const l=Date.now();s(c=>{const u=new Map;for(const g of o)g.sessionId&&u.set(g.sessionId,g);const d=new Map;for(const[g,p]of u){const b=c.get(g),m=typeof p.startedAt=="number"&&Number.isFinite(p.startedAt)&&p.startedAt>0?p.startedAt:void 0;d.set(g,{statusText:p.statusText!==void 0?p.statusText:b?.statusText??null,canInterrupt:p.canInterrupt??b?.canInterrupt??!0,startedAt:m??b?.startedAt??l})}for(const[g,p]of c)!u.has(g)&&l-p.startedAt<hi&&d.set(g,p);return fi(c,d)?c:d})},[]);return{processingSessions:t,markSessionProcessing:n,markSessionIdle:i,syncProcessingSessions:a}}const Fe="claude",Y=t=>JSON.stringify(t??null),lt=()=>{try{const t=localStorage.getItem("selected-provider");return t||Fe}catch{return Fe}},vi=t=>{const s=t.__provider??t.provider;return typeof s=="string"&&s.trim()?s:Fe},ki=t=>({...t,__provider:vi(t)}),ct=(t,s)=>t.length!==s.length?!0:s.some((n,i)=>{const a=t[i];return a?n.projectId!==a.projectId||n.displayName!==a.displayName||n.fullPath!==a.fullPath||!!n.isStarred!=!!a.isStarred||Y(n.sessionMeta)!==Y(a.sessionMeta)||Y(n.sessions)!==Y(a.sessions)||Y(n.taskmaster)!==Y(a.taskmaster):!0}),dt=(t,s)=>{if(s.length===0)return t;const n=new Map(s.filter(i=>!!i.taskmaster).map(i=>[i.projectId,i.taskmaster]));return t.map(i=>{const a=n.get(i.projectId);return a?{...i,taskmaster:a}:i})},ye=t=>t.sessions??[],oe=t=>ye(t).length,Ht=(t,s)=>{const n=[...t],i=new Set(t.map(a=>String(a.id)));for(const a of s){const o=String(a.id);i.has(o)||(n.push(a),i.add(o))}return n},ut=(t,s)=>{if(t.length===0)return s;const n=new Map(t.map(i=>[i.projectId,i]));return s.map(i=>{const a=n.get(i.projectId);if(!a)return i;const o=oe(a),l=oe(i);if(o<=l)return i;const c={...i,sessions:Ht(i.sessions??[],a.sessions??[])},u=Number(i.sessionMeta?.total??o);return c.sessionMeta={...i.sessionMeta,total:u,hasMore:oe(c)<u},c})},xi=(t,s)=>{const n={...t,sessions:Ht(t.sessions??[],s.sessions??[])},i=Number(s.sessionMeta?.total??t.sessionMeta?.total??0);return n.sessionMeta={...t.sessionMeta,...s.sessionMeta,total:i,hasMore:oe(n)<i},n},yi=t=>{const s=new Set,n=i=>{if(typeof i!="string")return;const a=i.trim();a&&s.add(a)};return n(t.sessionId),n(t.providerSessionId),n(t.session?.id),s},pe=(t,s)=>{const n=t.sessions??[],i=yi(s),a={...s.session,id:s.sessionId,__provider:s.provider},o=n.findIndex(d=>i.has(String(d.id)));let l,c=!1;if(o>=0){let d=!1;l=[];for(const[g,p]of n.entries()){if(g===o){const b={...p,...a};!a.summary?.trim()&&p.summary?.trim()&&(b.summary=p.summary),Y(p)!==Y(b)&&(d=!0),l.push(b);continue}if(i.has(String(p.id))){d=!0;continue}l.push(p)}if(!d)return t}else l=[a,...n],c=!0;const u={...t,sessions:l};if(c){const d=Number(t.sessionMeta?.total??0)+1;u.sessionMeta={...t.sessionMeta,total:d,hasMore:oe(u)<d}}return u},wi=t=>({projectId:t.projectId,path:t.path||t.fullPath,fullPath:t.fullPath||t.path||"",displayName:t.displayName,isStarred:t.isStarred,sessions:t.sessions??[],sessionMeta:t.sessionMeta??{hasMore:!1,total:oe(t)},taskmaster:t.taskmaster}),Ci=(t,s)=>{const n=t.sessions??[],i=n.filter(l=>l.id!==s);if(i.length===n.length)return t;const a={...t,sessions:i},o=Math.max(0,Number(t.sessionMeta?.total??0)-1);return a.sessionMeta={...t.sessionMeta,total:o,hasMore:oe(a)<o},a},Si=new Set(["chat","files","shell","herdr","git","tasks","browser"]),Pi=t=>Si.has(t)||t.startsWith("plugin:"),Ai=()=>{try{const t=localStorage.getItem("activeTab");if(t&&Pi(t))return t}catch{}return"chat"};function ji({sessionId:t,navigate:s,subscribe:n,isMobile:i,activeSessions:a}){const[o,l]=r.useState([]),[c,u]=r.useState(null),[d,g]=r.useState(null),[p,b]=r.useState(new Set),[m,v]=r.useState(Ai);r.useEffect(()=>{try{localStorage.setItem("activeTab",m)}catch{}},[m]);const[k,M]=r.useState(!1),[x,A]=r.useState(!0),[y,E]=r.useState(null),[L,D]=r.useState(!1),[F,P]=r.useState(!1),[N,K]=r.useState("agents"),[U,W]=r.useState(0),[I,H]=r.useState(0),$=r.useRef(null),R=r.useRef(d);R.current=d;const re=r.useRef(a);re.current=a;const te=r.useRef(c);te.current=c;const le=r.useRef(o);le.current=o;const ce=r.useRef(t);ce.current=t;const f=r.useRef(null);r.useEffect(()=>{f.current=null},[t]);const z=r.useCallback(h=>{if(!h)return;const w=R.current?.id??t??null;h!==w&&b(C=>{if(C.has(h))return C;const j=new Set(C);return j.add(h),j})},[t]),q=r.useCallback(h=>{h&&b(w=>{if(!w.has(h))return w;const C=new Set(w);return C.delete(h),C})},[]),J=r.useCallback(async({showLoadingState:h=!0}={})=>{try{h&&A(!0);const C=await(await ie.projects()).json();l(j=>{const S=dt(C,j),O=ut(j,S);return j.length===0||ct(j,O)?O:j})}catch(w){console.error("Error fetching projects:",w)}finally{h&&A(!1)}},[]),Pe=r.useCallback(async()=>{await J({showLoadingState:!1})},[J]),ue=r.useCallback(({sessionId:h,provider:w,project:C,summary:j})=>{if(!h||!C?.projectId)return;const S=new Date().toISOString(),O={id:h,summary:j??"",messageCount:0,createdAt:S,created_at:S,updated_at:S,lastActivity:S,__provider:w,__projectId:C.projectId},B={sessionId:h,provider:w,session:O,project:{projectId:C.projectId,path:C.path||C.fullPath,fullPath:C.fullPath||C.path||"",displayName:C.displayName,isStarred:!!C.isStarred}};l(G=>{const T=G.find(_=>_.projectId===C.projectId);if(!T)return[pe(wi(C),B),...G];const Q=pe(T,B);return Q===T?G:G.map(_=>_.projectId===T.projectId?Q:_)}),u(G=>{if(!G||G.projectId!==C.projectId)return G;const T=pe(G,B);return T===G?G:T}),g(G=>G?.id===h?{...G,...O}:O)},[]),ne=r.useCallback((h,w)=>{l(C=>C.map(j=>j.projectId===h?{...j,taskmaster:w??void 0}:j)),u(C=>C?.projectId===h?{...C,taskmaster:w??void 0}:C)},[]),be=r.useCallback((h="tools")=>{K(h),P(!0)},[]);r.useEffect(()=>{J()},[J]),r.useEffect(()=>{!x&&o.length===1&&!c&&!t&&u(o[0])},[x,o,c,t]),r.useEffect(()=>n(w=>{if(w.kind==="loading_progress"){$.current&&(clearTimeout($.current),$.current=null),E(w),w.phase==="complete"&&($.current=setTimeout(()=>{E(null),$.current=null},500));return}const C=typeof w.sessionId=="string"&&w.sessionId?w.sessionId:null,j=R.current?.id??t??null;if(C&&C!==j&&w.kind!=="chat_subscribed"&&w.kind!=="loading_progress"&&w.kind!=="session_upserted"&&w.kind!=="status"&&w.kind!=="stream_end"&&w.kind!=="permission_cancelled"&&w.kind!=="websocket_reconnected"&&z(C),w.kind!=="session_upserted")return;const S=w;if(!S.sessionId||!S.session)return;const O=R.current;O&&S.sessionId===O.id&&!re.current.has(S.sessionId)?W(T=>T+1):z(S.sessionId),l(T=>{const Q=S.project?.projectId,_=T.find(de=>Q?de.projectId===Q:ye(de).some(Vt=>Vt.id===S.sessionId));if(!_){if(!S.project)return T;const de={projectId:S.project.projectId,path:S.project.path,fullPath:S.project.fullPath,displayName:S.project.displayName,isStarred:S.project.isStarred,sessions:[],sessionMeta:{hasMore:!1,total:0}};return[...T,pe(de,S)]}const ve=pe(_,S);return ve===_?T:T.map(de=>de.projectId===_.projectId?ve:de)}),u(T=>{if(!T||!(S.project?T.projectId===S.project.projectId:ye(T).some(ve=>ve.id===S.sessionId)))return T;const _=pe(T,S);return _===T?T:_});const B=typeof S.providerSessionId=="string"&&S.providerSessionId!==S.sessionId?S.providerSessionId:null;if(!B)return;const G={...S.session,id:S.sessionId,__provider:S.provider,__projectId:S.project?.projectId??O?.__projectId};g(T=>T?.id!==B?T:{...T,...G}),t===B&&s(`/session/${S.sessionId}`)}),[z,s,t,n]),r.useEffect(()=>()=>{$.current&&(clearTimeout($.current),$.current=null)},[]),r.useEffect(()=>{q(d?.id??t??null)},[q,d?.id,t]),r.useEffect(()=>{if(t){for(const h of o){const w=h.sessions?.find(C=>C.id===t);if(w){const C=ki(w),j=c?.projectId!==h.projectId,S=d?.id!==t||d.__provider!==C.__provider;j&&u(h),S&&g(C);return}}d?.id!==t&&f.current!==t&&(f.current=t,(async()=>{let h=null;try{const j=await ie.sessionDetails(t);j.ok&&(h=(await j.json()).data??null)}catch(j){console.error(`Error resolving session ${t}:`,j)}if(ce.current!==t)return;if(!h){const j=te.current;if(!j||R.current?.id===t)return;g({id:t,__provider:lt(),__projectId:j.projectId,summary:""});return}if(typeof h.sessionId=="string"&&h.sessionId&&h.sessionId!==t){s(`/session/${h.sessionId}`,{replace:!0});return}const w=h.project?.projectId;w&&u(j=>{if(j?.projectId===w)return j;const S=le.current.find(O=>O.projectId===w);return S||{projectId:w,path:h.project?.path??h.project?.fullPath??"",fullPath:h.project?.fullPath??h.project?.path??"",displayName:h.project?.displayName??"",isStarred:!!h.project?.isStarred,sessions:[],sessionMeta:{hasMore:!1,total:0}}});const C={id:t,summary:h.summary??"",createdAt:h.createdAt??void 0,lastActivity:h.lastActivity??void 0,__provider:typeof h.provider=="string"&&h.provider.trim()?h.provider:lt(),__projectId:w};g(j=>j?.id===t?{...j,...C}:C)})())}},[s,t,o,c,d?.id,d?.__provider]);const Ae=r.useCallback(h=>{u(h),g(null),s("/"),i&&M(!1)},[i,s]),je=r.useCallback(h=>{if(q(h.id),g(h),(m==="tasks"||m==="browser")&&v("chat"),i){const w=h.__projectId,C=c?.projectId;w!==C&&M(!1)}s(`/session/${h.id}`)},[m,q,i,s,c?.projectId]),Te=r.useCallback(h=>{u(h),g(null),v("chat"),H(w=>w+1),s("/"),i&&M(!1)},[i,s]),Ie=r.useCallback(h=>{q(h),d?.id===h&&(g(null),s("/")),l(w=>w.map(C=>Ci(C,h)))},[q,s,d?.id]),Ee=r.useCallback(async()=>{try{const w=await(await ie.projects()).json(),C=dt(w,o),j=ut(o,C);if(l(B=>ct(B,j)?j:B),!c)return;const S=j.find(B=>B.projectId===c.projectId);if(!S||(Y(S)!==Y(c)&&u(S),!d))return;const O=ye(S).find(B=>B.id===d.id);if(O){const B=O.__provider||!d.__provider?O:{...O,__provider:d.__provider};Y(B)!==Y(d)&&g(B)}}catch(h){console.error("Error refreshing sidebar:",h)}},[o,c,d]),Me=r.useCallback(async h=>{const w=o.find(G=>G.projectId===h);if(!w)return;const C=oe(w),j=Number(w.sessionMeta?.total??0);if(j>0&&C>=j)return;const S=await ie.projectSessions(h,{limit:20,offset:C});if(!S.ok){const T=(await S.json().catch(()=>({}))).error,Q=typeof T=="string"?T:T&&typeof T=="object"&&T.message?T.message:`Failed to load more sessions for project ${h}`;throw new Error(Q)}const O=await S.json();let B=null;l(G=>G.map(T=>{if(T.projectId!==h)return T;const Q=xi(T,O);return B=Q,Q})),c?.projectId===h&&B&&u(B)},[o,c?.projectId]),ze=r.useCallback(h=>{c?.projectId===h&&(u(null),g(null),s("/")),l(w=>w.filter(C=>C.projectId!==h))},[s,c?.projectId]),Wt=r.useMemo(()=>({projects:o,selectedProject:c,selectedSession:d,activeSessions:a,attentionSessionIds:p,onProjectSelect:Ae,onSessionSelect:je,onNewSession:Te,onSessionDelete:Ie,onLoadMoreSessions:Me,onProjectDelete:ze,isLoading:x,loadingProgress:y,onRefresh:Ee,onShowSettings:()=>P(!0),showSettings:F,settingsInitialTab:N,onCloseSettings:()=>P(!1),isMobile:i}),[p,Te,ze,Ae,Ie,Me,je,Ee,x,i,y,a,o,N,c,d,F]);return{projects:o,selectedProject:c,selectedSession:d,activeTab:m,sidebarOpen:k,isLoadingProjects:x,loadingProgress:y,isInputFocused:L,showSettings:F,settingsInitialTab:N,externalMessageUpdate:U,newSessionTrigger:I,setActiveTab:v,setSidebarOpen:M,setIsInputFocused:D,setShowSettings:P,openSettings:be,fetchProjects:J,refreshProjectsSilently:Pe,registerOptimisticSession:ue,updateProjectTaskMaster:ne,sidebarSharedProps:Wt,handleProjectSelect:Ae,handleSessionSelect:je,handleNewSession:Te,handleSessionDelete:Ie,loadMoreProjectSessions:Me,handleProjectDelete:ze,handleSidebarRefresh:Ee}}function Ti({processingSessions:t,activeSessionId:s,ws:n,sendMessage:i,markSessionProcessing:a}){const o=r.useRef(new Set);r.useEffect(()=>{const l=o.current,c=new Set(t.keys());o.current=c;for(const u of l){if(c.has(u)||u===s)continue;const d=ts(u);d&&(!n||n.readyState!==WebSocket.OPEN||(ns(u),i({type:"chat.send",sessionId:u,content:d.content,options:{...d.options??{},attachments:d.attachments??d.images??[]}}),a(u,{statusText:null,canInterrupt:!0})))}},[t,s,n,i,a])}const Ii=t=>{if(typeof t=="number"&&Number.isFinite(t)&&t>0)return t;if(typeof t!="string")return;const s=Date.parse(t);return Number.isFinite(s)?s:void 0};function pt(){return e.jsx(vn,{children:e.jsx(Ei,{})})}function Ei(){const t=vt(),{sessionId:s}=Kt(),{t:n}=Z("common"),{isMobile:i}=Pt({trackPWA:!1}),{ws:a,sendMessage:o,subscribe:l}=kn(),{processingSessions:c,markSessionProcessing:u,markSessionIdle:d,syncProcessingSessions:g}=bi(),{selectedProject:p,selectedSession:b,activeTab:m,sidebarOpen:v,isLoadingProjects:k,externalMessageUpdate:M,newSessionTrigger:x,setActiveTab:A,setSidebarOpen:y,setIsInputFocused:E,openSettings:L,refreshProjectsSilently:D,registerOptimisticSession:F,updateProjectTaskMaster:P,sidebarSharedProps:N,handleNewSession:K,handleProjectSelect:U}=ji({sessionId:s,navigate:t,subscribe:l,isMobile:i,activeSessions:c});Ti({processingSessions:c,activeSessionId:b?.id??s??null,ws:a,sendMessage:o,markSessionProcessing:u});const W=r.useCallback(async()=>{try{const I=await ie.runningSessions();if(!I.ok)return;const H=await I.json(),$=Array.isArray(H.data?.sessions)?H.data.sessions:[];g($.map(R=>typeof R.sessionId!="string"||!R.sessionId?null:{sessionId:R.sessionId,startedAt:Ii(R.startedAt),statusText:typeof R.statusText=="string"?R.statusText:void 0,canInterrupt:typeof R.canInterrupt=="boolean"?R.canInterrupt:void 0}).filter(R=>!!R))}catch(I){console.error("[AppContent] Failed to sync running sessions:",I)}},[g]);return r.useEffect(()=>{W()},[W]),r.useEffect(()=>{const I=window.setInterval(()=>{W()},5e3);return()=>window.clearInterval(I)},[W]),Ct({openSettings:L,refreshProjects:D}),r.useEffect(()=>{if(typeof navigator>"u"||!("serviceWorker"in navigator))return;const I=H=>{const $=H.data;if(!(!$||$.type!=="notification:navigate")){if(typeof $.provider=="string"&&$.provider.trim()&&localStorage.setItem("selected-provider",$.provider),A("chat"),y(!1),D(),typeof $.sessionId=="string"&&$.sessionId){t(`/session/${$.sessionId}`);return}t("/")}};return navigator.serviceWorker.addEventListener("message",I),()=>{navigator.serviceWorker.removeEventListener("message",I)}},[t,D,A,y]),r.useEffect(()=>{const I=window.visualViewport;if(!I)return;const H=()=>{const $=Math.max(0,window.innerHeight-I.height);document.documentElement.style.setProperty("--keyboard-height",`${$}px`)};return I.addEventListener("resize",H),()=>I.removeEventListener("resize",H)},[]),e.jsx(xn,{project:p,onProjectTaskMasterChange:P,children:e.jsxs("div",{className:"fixed inset-0 flex bg-background",style:{bottom:"var(--keyboard-height, 0px)"},children:[i?e.jsxs("div",{className:`fixed inset-0 z-50 flex transition-all duration-150 ease-out ${v?"visible opacity-100":"invisible opacity-0"}`,children:[e.jsx("button",{className:"fixed inset-0 bg-background/60 backdrop-blur-sm transition-opacity duration-150 ease-out",onClick:I=>{I.stopPropagation(),y(!1)},onTouchStart:I=>{I.preventDefault(),I.stopPropagation(),y(!1)},"aria-label":n("versionUpdate.ariaLabels.closeSidebar")}),e.jsx("div",{className:`relative h-full w-[85vw] max-w-sm transform border-r border-border/40 bg-card transition-transform duration-150 ease-out sm:w-80 ${v?"translate-x-0":"-translate-x-full"}`,onClick:I=>I.stopPropagation(),onTouchStart:I=>I.stopPropagation(),children:e.jsx(Ke,{...N})})]}):e.jsx("div",{className:"h-full flex-shrink-0 border-r border-border/50",children:e.jsx(Ke,{...N})}),e.jsx("div",{className:"flex min-w-0 flex-1 flex-col",children:e.jsx(Us,{selectedProject:p,selectedSession:b,activeTab:m,setActiveTab:A,ws:a,sendMessage:o,isMobile:i,onMenuClick:()=>y(!0),isLoading:k,onInputFocusChange:E,onSessionProcessing:u,onSessionIdle:d,processingSessions:c,onNavigateToSession:(I,H)=>t(`/session/${I}`,{replace:!!H?.replace}),onSessionEstablished:(I,H)=>F({sessionId:I,...H}),onShowSettings:L,externalMessageUpdate:M,newSessionTrigger:x,onProjectSelect:U,onProjectsRefresh:()=>{D()}})}),e.jsx(ei,{selectedProject:p,onStartNewChat:K,onOpenSettings:()=>L(),onShowTab:A}),e.jsx(gi,{hideHandleOnMobile:m==="herdr"})]})})}function Mi(t={}){const{immediate:s=!1,onNeedReload:n,onNeedRefresh:i,onOfflineReady:a,onRegistered:o,onRegisteredSW:l,onRegisterError:c}=t;let u,d,g;const p=async(m=!0)=>{await d,g?.()};async function b(){if("serviceWorker"in navigator){if(u=await ee(async()=>{const{Workbox:m}=await import("./workbox-window.prod.es5-BBnX5xw4.js");return{Workbox:m}},[]).then(({Workbox:m})=>new m("/sw.js",{scope:"/",type:"classic"})).catch(m=>{c?.(m)}),!u)return;g=()=>{u?.messageSkipWaiting()};{let m=!1;const v=()=>{m=!0,u?.addEventListener("controlling",k=>{k.isUpdate&&(n?n():window.location.reload())}),i?.()};u.addEventListener("installed",k=>{typeof k.isUpdate>"u"?typeof k.isExternal<"u"&&k.isExternal?v():!m&&a?.():k.isUpdate||a?.()}),u.addEventListener("waiting",v)}u.register({immediate:s}).then(m=>{l?l("/sw.js",m):o?.(m)}).catch(m=>{c?.(m)})}}return d=b(),p}function zi(t={}){const{immediate:s=!0,onNeedReload:n,onNeedRefresh:i,onOfflineReady:a,onRegistered:o,onRegisteredSW:l,onRegisterError:c}=t,[u,d]=r.useState(!1),[g,p]=r.useState(!1),[b]=r.useState(()=>Mi({immediate:s,onNeedReload:n,onOfflineReady(){p(!0),a?.()},onNeedRefresh(){d(!0),i?.()},onRegistered:o,onRegisteredSW:l,onRegisterError:c}));return{needRefresh:[u,d],offlineReady:[g,p],updateServiceWorker:b}}function Di(t){return t.needRefresh?"update":t.installAvailable&&!t.installDismissed?"install":t.offlineReady&&!t.offlineDismissed?"offline":null}const Ni=3600*1e3;function $i(){const{t}=Z("common"),[s,n]=r.useState(),[i,a]=r.useState(),[o,l]=r.useState(!1),[c,u]=r.useState(!1),{needRefresh:[d,g],offlineReady:[p,b],updateServiceWorker:m}=zi({immediate:!0,onRegisteredSW:(y,E)=>n(E),onRegisterError:y=>console.error("Service worker registration failed:",y)});r.useEffect(()=>{if(!s)return;const y=window.setInterval(()=>{navigator.onLine&&s.update()},Ni);return()=>window.clearInterval(y)},[s]),r.useEffect(()=>{const y=L=>{L.preventDefault(),a(L),l(!1)},E=()=>a(void 0);return window.addEventListener("beforeinstallprompt",y),window.addEventListener("appinstalled",E),()=>{window.removeEventListener("beforeinstallprompt",y),window.removeEventListener("appinstalled",E)}},[]),r.useEffect(()=>{if(!p)return;const y=window.setTimeout(()=>u(!0),8e3);return()=>window.clearTimeout(y)},[p]);const v=Di({installAvailable:!!i,installDismissed:o,needRefresh:d,offlineDismissed:c,offlineReady:p});if(!v)return null;const k={update:{icon:Mt,message:t("pwa.updateReady"),action:t("pwa.reload")},install:{icon:Qn,message:t("pwa.installAvailable"),action:t("pwa.install")},offline:{icon:Jn,message:t("pwa.offlineReady"),action:null}}[v],M=k.icon,x=()=>{v==="update"&&g(!1),v==="install"&&l(!0),v==="offline"&&(u(!0),b(!1))},A=async()=>{if(v==="update"){await m(!0);return}v==="install"&&i&&(await i.prompt(),await i.userChoice,a(void 0))};return e.jsxs("aside",{role:"status","aria-live":"polite",className:"fixed inset-x-3 bottom-[calc(0.75rem+env(safe-area-inset-bottom,0px))] z-[100] mx-auto flex min-h-12 max-w-xl items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-card-foreground shadow-lg",children:[e.jsx(M,{className:"h-4 w-4 flex-shrink-0 text-primary"}),e.jsx("span",{className:"min-w-0 flex-1 text-sm",children:k.message}),k.action&&e.jsx("button",{type:"button",className:"flex-shrink-0 text-sm font-medium text-primary hover:underline",onClick:()=>{A()},children:k.action}),e.jsx("button",{type:"button",className:"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground",onClick:x,"aria-label":t("pwa.dismiss"),title:t("pwa.dismiss"),children:e.jsx(Et,{className:"h-4 w-4"})})]})}const{slice:Ri,forEach:Li}=[];function Fi(t){return Li.call(Ri.call(arguments,1),s=>{if(s)for(const n in s)t[n]===void 0&&(t[n]=s[n])}),t}function Bi(t){return typeof t!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(t))}const mt=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Gi=function(t,s){const i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},a=encodeURIComponent(s);let o=`${t}=${a}`;if(i.maxAge>0){const l=i.maxAge-0;if(Number.isNaN(l))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(l)}`}if(i.domain){if(!mt.test(i.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${i.domain}`}if(i.path){if(!mt.test(i.path))throw new TypeError("option path is invalid");o+=`; Path=${i.path}`}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${i.expires.toUTCString()}`}if(i.httpOnly&&(o+="; HttpOnly"),i.secure&&(o+="; Secure"),i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i.partitioned&&(o+="; Partitioned"),o},gt={create(t,s,n,i){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+n*60*1e3)),i&&(a.domain=i),document.cookie=Gi(t,s,a)},read(t){const s=`${t}=`,n=document.cookie.split(";");for(let i=0;i<n.length;i++){let a=n[i];for(;a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(s)===0)return a.substring(s.length,a.length)}return null},remove(t,s){this.create(t,"",-1,s)}};var Hi={name:"cookie",lookup(t){let{lookupCookie:s}=t;if(s&&typeof document<"u")return gt.read(s)||void 0},cacheUserLanguage(t,s){let{lookupCookie:n,cookieMinutes:i,cookieDomain:a,cookieOptions:o}=s;n&&typeof document<"u"&&gt.create(n,t,i,a,o)}},Oi={name:"querystring",lookup(t){let{lookupQuerystring:s}=t,n;if(typeof window<"u"){let{search:i}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const o=i.substring(1).split("&");for(let l=0;l<o.length;l++){const c=o[l].indexOf("=");c>0&&o[l].substring(0,c)===s&&(n=o[l].substring(c+1))}}return n}},Ui={name:"hash",lookup(t){let{lookupHash:s,lookupFromHashIndex:n}=t,i;if(typeof window<"u"){const{hash:a}=window.location;if(a&&a.length>2){const o=a.substring(1);if(s){const l=o.split("&");for(let c=0;c<l.length;c++){const u=l[c].indexOf("=");u>0&&l[c].substring(0,u)===s&&(i=l[c].substring(u+1))}}if(i)return i;if(!i&&n>-1){const l=a.match(/\/([a-zA-Z-]*)/g);return Array.isArray(l)?l[typeof n=="number"?n:0]?.replace("/",""):void 0}}}return i}};let me=null;const ht=()=>{if(me!==null)return me;try{if(me=typeof window<"u"&&window.localStorage!==null,!me)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{me=!1}return me};var qi={name:"localStorage",lookup(t){let{lookupLocalStorage:s}=t;if(s&&ht())return window.localStorage.getItem(s)||void 0},cacheUserLanguage(t,s){let{lookupLocalStorage:n}=s;n&&ht()&&window.localStorage.setItem(n,t)}};let ge=null;const ft=()=>{if(ge!==null)return ge;try{if(ge=typeof window<"u"&&window.sessionStorage!==null,!ge)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{ge=!1}return ge};var Wi={name:"sessionStorage",lookup(t){let{lookupSessionStorage:s}=t;if(s&&ft())return window.sessionStorage.getItem(s)||void 0},cacheUserLanguage(t,s){let{lookupSessionStorage:n}=s;n&&ft()&&window.sessionStorage.setItem(n,t)}},Vi={name:"navigator",lookup(t){const s=[];if(typeof navigator<"u"){const{languages:n,userLanguage:i,language:a}=navigator;if(n)for(let o=0;o<n.length;o++)s.push(n[o]);i&&s.push(i),a&&s.push(a)}return s.length>0?s:void 0}},Ki={name:"htmlTag",lookup(t){let{htmlTag:s}=t,n;const i=s||(typeof document<"u"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(n=i.getAttribute("lang")),n}},_i={name:"path",lookup(t){let{lookupFromPathIndex:s}=t;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?n[typeof s=="number"?s:0]?.replace("/",""):void 0}},Yi={name:"subdomain",lookup(t){let{lookupFromSubdomainIndex:s}=t;const n=typeof s=="number"?s+1:1,i=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(i)return i[n]}};let Ot=!1;try{document.cookie,Ot=!0}catch{}const Ut=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Ot||Ut.splice(1,1);const Ji=()=>({order:Ut,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t});class qt{constructor(s){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(s,n)}init(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=s,this.options=Fi(n,this.options||{},Ji()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=a=>a.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(Hi),this.addDetector(Oi),this.addDetector(qi),this.addDetector(Wi),this.addDetector(Vi),this.addDetector(Ki),this.addDetector(_i),this.addDetector(Yi),this.addDetector(Ui)}addDetector(s){return this.detectors[s.name]=s,this}detect(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return s.forEach(i=>{if(this.detectors[i]){let a=this.detectors[i].lookup(this.options);a&&typeof a=="string"&&(a=[a]),a&&(n=n.concat(a))}}),n=n.filter(i=>i!=null&&!Bi(i)).map(i=>this.options.convertDetectedLanguage(i)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(s){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(s)>-1||n.forEach(i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(s,this.options)}))}}qt.type="languageDetector";const Qi={save:"Save",cancel:"Cancel",delete:"Delete",create:"Create",edit:"Edit",close:"Close",confirm:"Confirm",submit:"Submit",retry:"Retry",refresh:"Refresh",search:"Search",clear:"Clear",copy:"Copy",download:"Download",upload:"Upload",browse:"Browse"},Zi={chat:"Chat",shell:"Shell",herdr:"Herdr",files:"Files",git:"Source Control",tasks:"Tasks",browser:"Browser",computer:"Computer"},Xi={loading:"Loading...",success:"Success",error:"Error",failed:"Failed",pending:"Pending",completed:"Completed",inProgress:"In Progress"},ea={savedSuccessfully:"Saved successfully",deletedSuccessfully:"Deleted successfully",updatedSuccessfully:"Updated successfully",operationFailed:"Operation failed",networkError:"Network error. Please check your connection.",unauthorized:"Unauthorized. Please log in.",notFound:"Not found",invalidInput:"Invalid input",requiredField:"This field is required",unknownError:"An unknown error occurred"},ta={settings:"Settings",home:"Home",back:"Back",next:"Next",previous:"Previous",logout:"Logout"},na={language:"Language",theme:"Theme",darkMode:"Dark Mode",lightMode:"Light Mode",name:"Name",description:"Description",enabled:"Enabled",disabled:"Disabled",optional:"Optional",version:"Version",select:"Select",selectAll:"Select All",deselectAll:"Deselect All"},sa={justNow:"Just now",minutesAgo:"{{count}} mins ago",hoursAgo:"{{count}} hours ago",daysAgo:"{{count}} days ago",yesterday:"Yesterday"},ia={newFile:"New File",newFolder:"New Folder",rename:"Rename",move:"Move",copyPath:"Copy Path",openInEditor:"Open in Editor"},aa={loading:"Loading WindCli",settingUpWorkspace:"Setting up your workspace...",chooseProject:"Choose Your Project",selectProjectDescription:"Select a project from the sidebar to start coding with Claude. Each project contains your chat sessions and file history.",tip:"Tip",createProjectMobile:"Tap the menu button above to access projects",createProjectDesktop:"Create a new project by clicking the folder icon in the sidebar",newSession:"New Session",untitledSession:"Untitled Session",projectFiles:"Project Files"},oa={loading:"Loading files...",files:"Files",simpleView:"Simple view",compactView:"Compact view",detailedView:"Detailed view",searchPlaceholder:"Search files and folders...",clearSearch:"Clear search",name:"Name",size:"Size",modified:"Modified",permissions:"Permissions",noFilesFound:"No files found",checkProjectPath:"Check if the project path is accessible",loadFailed:"Unable to load files",noMatchesFound:"No matches found",tryDifferentSearch:"Try a different search term or clear the search",justNow:"just now",minAgo:"{{count}} min ago",hoursAgo:"{{count}} hours ago",daysAgo:"{{count}} days ago",newFile:"New File (Cmd+N)",newFolder:"New Folder (Cmd+Shift+N)",refresh:"Refresh",collapseAll:"Collapse All",context:{rename:"Rename",delete:"Delete",copyPath:"Copy Path",download:"Download",newFile:"New File",newFolder:"New Folder",upload:"Upload Files",refresh:"Refresh",menuLabel:"File context menu",loading:"Loading..."}},ra={title:"Create New Project",steps:{type:"Type",configure:"Configure",confirm:"Confirm"},step1:{question:"Do you already have a workspace, or would you like to create a new one?",existing:{title:"Existing Workspace",description:"I already have a workspace on my server and just need to add it to the project list"},new:{title:"New Workspace",description:"Create a new workspace, optionally clone from a GitHub repository"}},step2:{existingPath:"Workspace Path",newPath:"Workspace Path",existingPlaceholder:"/path/to/existing/workspace",newPlaceholder:"/path/to/new/workspace",existingHelp:"Full path to your existing workspace directory",newHelp:"Full path to your workspace directory",githubUrl:"GitHub URL (Optional)",githubPlaceholder:"https://github.com/username/repository",githubHelp:"Optional: provide a GitHub URL to clone a repository",githubAuth:"GitHub Authentication (Optional)",githubAuthHelp:"Only required for private repositories. Public repos can be cloned without authentication.",loadingTokens:"Loading stored tokens...",storedToken:"Stored Token",newToken:"New Token",nonePublic:"None (Public)",selectToken:"Select Token",selectTokenPlaceholder:"-- Select a token --",tokenPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",tokenHelp:"This token will be used only for this operation",publicRepoInfo:"Public repositories don't require authentication. You can skip providing a token if cloning a public repo.",noTokensHelp:"No stored tokens available. You can add tokens in Settings → API Keys for easier reuse.",optionalTokenPublic:"GitHub Token (Optional for Public Repos)",tokenPublicPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (leave empty for public repos)"},step3:{reviewConfig:"Review Your Configuration",existingWorkspace:"Existing Workspace",newWorkspace:"New Workspace",path:"Path:",cloneFrom:"Clone From:",authentication:"Authentication:",usingStoredToken:"Using stored token:",usingProvidedToken:"Using provided token",noAuthentication:"No authentication",sshKey:"SSH Key",existingInfo:"The workspace will be added to your project list and will be available for Claude/Cursor sessions.",newWithClone:"The repository will be cloned from this folder.",newEmpty:"The workspace will be added to your project list and will be available for Claude/Cursor sessions.",cloningRepository:"Cloning repository..."},buttons:{cancel:"Cancel",back:"Back",next:"Next",createProject:"Create Project",creating:"Creating...",cloning:"Cloning..."},errors:{selectType:"Please select whether you have an existing workspace or want to create a new one",providePath:"Please provide a workspace path",failedToCreate:"Failed to create workspace",failedToCreateFolder:"Failed to create folder"}},la={genericTool:"a tool",codes:{generic:{info:{title:"Notification"}},permission:{required:{title:"Action Required",body:"{{toolName}} is waiting for your decision."}},run:{stopped:{title:"Run Stopped",body:"Reason: {{reason}}"},failed:{title:"Run Failed"}},agent:{notification:{title:"Agent Notification"}}}},ca={updateReady:"A new version of WindCli is ready.",reload:"Reload",installAvailable:"Install WindCli for faster access and offline support.",install:"Install",offlineReady:"WindCli is ready to use offline.",dismiss:"Dismiss"},da={title:"Update Available",newVersionReady:"A new version is ready",currentVersion:"Current Version",latestVersion:"Latest Version",whatsNew:"What's New:",viewFullRelease:"View full release",updateProgress:"Update Progress:",manualUpgrade:"Manual upgrade:",npmUpgradeCommand:"npm install -g wind-agent-cli@latest",manualUpgradeHint:'Or click "Update Now" to run the update automatically.',updateCompleted:"Update completed successfully!",restartServer:"Please restart the server to apply changes.",updateFailed:"Update failed",buttons:{close:"Close",later:"Later",copyCommand:"Copy Command",updateNow:"Update Now",updating:"Updating..."},ariaLabels:{closeModal:"Close version upgrade modal",showSidebar:"Show sidebar",settings:"Settings",updateAvailable:"Update available",closeSidebar:"Close sidebar"}},ua={buttons:Qi,tabs:Zi,status:Xi,messages:ea,navigation:ta,common:na,time:sa,fileOperations:ia,mainContent:aa,fileTree:oa,projectWizard:ra,notifications:la,pwa:ca,versionUpdate:da},pa="Settings",ma={account:"Account",permissions:"Permissions",mcpServers:"MCP Servers",skills:"Skills",appearance:"Appearance"},ga={title:"Account",language:"Language",languageLabel:"Display Language",languageDescription:"Choose your preferred language for the interface",username:"Username",email:"Email",profile:"Profile",changePassword:"Change Password"},ha={title:"MCP Servers",addServer:"Add Server",editServer:"Edit Server",deleteServer:"Delete Server",serverName:"Server Name",serverType:"Server Type",config:"Configuration",testConnection:"Test Connection",status:"Status",connected:"Connected",disconnected:"Disconnected",scope:{label:"Scope",user:"User",project:"Project"}},fa={title:"Appearance",theme:"Theme",codeEditor:"Code Editor",editorTheme:"Editor Theme",wordWrap:"Word Wrap",showMinimap:"Show Minimap",lineNumbers:"Line Numbers",fontSize:"Font Size"},ba={saveChanges:"Save Changes",resetToDefaults:"Reset to Defaults",cancelChanges:"Cancel Changes"},va={title:"Voice",description:"Speech-to-text input and read-aloud, via an OpenAI-compatible audio backend.",enable:"Enable voice",enableDescription:"Show the mic button and the read-aloud button on messages.",backendTitle:"Backend",backendDescription:"Point at OpenAI, Groq, or a local server (LocalAI, Speaches, Kokoro-FastAPI). Leave blank to use the server default.",baseUrl:"Base URL",apiKey:"API key",sttModel:"Speech-to-text model",ttsModel:"Text-to-speech model",voice:"Voice",format:"Audio format",note:"A custom base URL is called directly by your browser and must allow browser CORS requests. Leave it blank to use the server-configured backend."},ka={title:"Quick Settings",sections:{appearance:"Appearance",toolDisplay:"Tool Display",inputSettings:"Input Settings"},darkMode:"Dark Mode",showRawParameters:"Show raw parameters",showThinking:"Show thinking",sendByCtrlEnter:"Send by Ctrl+Enter",voiceEnabled:"Voice (mic + read aloud)",sendByCtrlEnterDescription:"When enabled, pressing Ctrl+Enter will send the message instead of just Enter. This is useful for IME users to avoid accidental sends.",dragHandle:{dragging:"Dragging handle",closePanel:"Close settings panel",openPanel:"Open settings panel",draggingStatus:"Dragging...",toggleAndMove:"Click to toggle, drag to move"}},xa={title:"Terminal Shortcuts",sectionKeys:"Keys",sectionNavigation:"Navigation",escape:"Escape",tab:"Tab",shiftTab:"Shift+Tab",arrowUp:"Arrow Up",arrowDown:"Arrow Down",scrollDown:"Scroll Down",handle:{closePanel:"Close shortcuts panel",openPanel:"Open shortcuts panel"}},ya={label:"Settings",agents:"Agents",appearance:"Appearance",git:"Git",apiTokens:"API & Tokens",voice:"Voice",tasks:"Tasks",browser:"Browser",notifications:"Notifications",plugins:"Plugins",about:"About"},wa={title:"Notifications",description:"Control which notification events you receive.",webPush:{title:"Notify this browser",enable:"Enable notifications",disable:"Disable notifications",enabled:"Notifications are enabled for this browser",loading:"Updating...",unsupported:"Push notifications are not supported in this browser.",denied:"Push notifications are blocked. Please allow them in your browser settings."},desktop:{title:"Notify this desktop app",enable:"Enable notifications",disable:"Disable notifications",enabled:"Notifications are enabled for this desktop app",unsupported:"Desktop notifications are not supported on this system."},sound:{title:"Sound",description:"Play a short tone when a chat run finishes or needs tool approval.",enabled:"Enabled",test:"Test sound"},events:{title:"Event Types",actionRequired:"Action required",stop:"Run stopped",error:"Run failed"}},Ca={darkMode:{label:"Dark Mode",description:"Toggle between light and dark themes"},projectSorting:{label:"Project Sorting",description:"How projects are ordered in the sidebar",alphabetical:"Alphabetical",recentActivity:"Recent Activity"},codeEditor:{title:"Code Editor",theme:{label:"Editor Theme",description:"Default theme for the code editor"},wordWrap:{label:"Word Wrap",description:"Enable word wrapping by default in the editor"},showMinimap:{label:"Show Minimap",description:"Display a minimap for easier navigation in diff view"},lineNumbers:{label:"Show Line Numbers",description:"Display line numbers in the editor"},fontSize:{label:"Font Size",description:"Editor font size in pixels"}}},Sa={title:{add:"Add MCP Server",edit:"Edit MCP Server"},importMode:{form:"Form Input",json:"JSON Import"},scope:{label:"Scope",userGlobal:"User (Global)",projectLocal:"Project (Local)",userDescription:"User scope: Available across all projects on your machine",projectDescription:"Local scope: Only available in the selected project",cannotChange:"Scope cannot be changed when editing an existing server"},fields:{serverName:"Server Name",transportType:"Transport Type",command:"Command",arguments:"Arguments (one per line)",jsonConfig:"JSON Configuration",url:"URL",envVars:"Environment Variables (KEY=value, one per line)",headers:"Headers (KEY=value, one per line)",selectProject:"Select a project..."},placeholders:{serverName:"my-server"},validation:{missingType:"Missing required field: type",stdioRequiresCommand:"stdio type requires a command field",httpRequiresUrl:"{{type}} type requires a url field",invalidJson:"Invalid JSON format",jsonHelp:"Paste your MCP server configuration in JSON format. Example formats:",jsonExampleStdio:'• stdio: {"type":"stdio","command":"npx","args":["@upstash/context7-mcp"]}',jsonExampleHttp:'• http/sse: {"type":"http","url":"https://api.example.com/mcp"}'},configDetails:"Configuration Details (from {{configFile}})",projectPath:"Path: {{path}}",actions:{cancel:"Cancel",saving:"Saving...",addServer:"Add Server",updateServer:"Update Server"}},Pa={success:"Settings saved successfully!",error:"Failed to save settings",saving:"Saving..."},Aa={save:"Save Settings",cancel:"Cancel"},ja={title:"Git Configuration",description:"Configure your git identity for commits. These settings will be applied globally via git config --global",name:{label:"Git Name",help:"Your name for git commits"},email:{label:"Git Email",help:"Your email for git commits"},actions:{save:"Save Configuration",saving:"Saving..."},status:{success:"Saved successfully"}},Ta={title:"API Keys",description:"Generate API keys to access the external API from other applications.",newKey:{alertTitle:"⚠️ Save Your API Key",alertMessage:"This is the only time you'll see this key. Store it securely.",iveSavedIt:"I've saved it"},form:{placeholder:"API Key Name (e.g., Production Server)",createButton:"Create",cancelButton:"Cancel"},newButton:"New API Key",empty:"No API keys created yet.",list:{created:"Created:",lastUsed:"Last used:"},confirmDelete:"Are you sure you want to delete this API key?",status:{active:"Active",inactive:"Inactive"},github:{title:"GitHub Tokens",description:"Add GitHub Personal Access Tokens to clone private repositories via the external API.",descriptionAlt:"Add GitHub Personal Access Tokens to clone private repositories. You can also pass tokens directly in API requests without storing them.",addButton:"Add Token",form:{namePlaceholder:"Token Name (e.g., Personal Repos)",tokenPlaceholder:"GitHub Personal Access Token (ghp_...)",descriptionPlaceholder:"Description (optional)",addButton:"Add Token",cancelButton:"Cancel",howToCreate:"How to create a GitHub Personal Access Token →"},empty:"No GitHub tokens added yet.",added:"Added:",confirmDelete:"Are you sure you want to delete this GitHub token?"},apiDocsLink:"API Documentation",documentation:{title:"External API Documentation",description:"Learn how to use the external API to trigger Claude/Cursor sessions from your applications.",viewLink:"View API Documentation →"},loading:"Loading...",version:{updateAvailable:"Update available: v{{version}}"}},Ia={checking:"Checking TaskMaster installation...",notInstalled:{title:"TaskMaster AI CLI Not Installed",description:"TaskMaster CLI is required to use task management features. Install it to get started:",installCommand:"npm install -g task-master-ai",viewOnGitHub:"View on GitHub",afterInstallation:"After installation:",steps:{restart:"Restart this application",autoAvailable:"TaskMaster features will automatically become available",initCommand:"Use task-master init in your project directory"}},settings:{enableLabel:"Enable TaskMaster Integration",enableDescription:"Show TaskMaster tasks, banners, and sidebar indicators across the interface"}},Ea={authStatus:{checking:"Checking...",connected:"Connected",notConnected:"Not connected",disconnected:"Disconnected",checkingAuth:"Checking authentication status...",loggedInAs:"Logged in as {{email}}",authenticatedUser:"authenticated user"},account:{claude:{description:"Anthropic Claude AI assistant"},cursor:{description:"Cursor AI-powered code editor"},codex:{description:"OpenAI Codex AI assistant"},opencode:{description:"OpenCode CLI assistant"}},connectionStatus:"Connection Status",login:{title:"Login",reAuthenticate:"Re-authenticate",description:"Sign in to your {{agent}} account to enable AI features",reAuthDescription:"Sign in with a different account or refresh credentials",button:"Login",reLoginButton:"Re-login"},error:"Error: {{error}}"},Ma={title:"Permission Settings",skipPermissions:{label:"Skip permission prompts (use with caution)",claudeDescription:"Equivalent to --dangerously-skip-permissions flag",cursorDescription:"Equivalent to -f flag in Cursor CLI"},allowedTools:{title:"Allowed Tools",description:"Tools that are automatically allowed without prompting for permission",placeholder:'e.g., "Bash(git log:*)" or "Write"',quickAdd:"Quick add common tools:",empty:"No allowed tools configured"},blockedTools:{title:"Blocked Tools",description:"Tools that are automatically blocked without prompting for permission",placeholder:'e.g., "Bash(rm:*)"',empty:"No blocked tools configured"},allowedCommands:{title:"Allowed Shell Commands",description:"Shell commands that are automatically allowed without prompting",placeholder:'e.g., "Shell(ls)" or "Shell(git status)"',quickAdd:"Quick add common commands:",empty:"No allowed commands configured"},blockedCommands:{title:"Blocked Shell Commands",description:"Shell commands that are automatically blocked",placeholder:'e.g., "Shell(rm -rf)" or "Shell(sudo)"',empty:"No blocked commands configured"},toolExamples:{title:"Tool Pattern Examples:",bashGitLog:"- Allow all git log commands",bashGitDiff:"- Allow all git diff commands",write:"- Allow all Write tool usage",bashRm:"- Block all rm commands (dangerous)"},shellExamples:{title:"Shell Command Examples:",ls:"- Allow ls command",gitStatus:"- Allow git status",npmInstall:"- Allow npm install",rmRf:"- Block recursive delete"},codex:{permissionMode:"Permission Mode",description:"Controls how Codex handles file modifications and command execution",modes:{default:{title:"Default",description:"Only trusted commands (ls, cat, grep, git status, etc.) run automatically. Other commands are skipped. Can write to workspace."},acceptEdits:{title:"Accept Edits",description:"All commands run automatically within the workspace. Full auto mode with sandboxed execution."},bypassPermissions:{title:"Bypass Permissions",description:"Full system access with no restrictions. All commands run automatically with full disk and network access. Use with caution."}},technicalDetails:"Technical details",technicalInfo:{default:"sandboxMode=workspace-write, approvalPolicy=untrusted. Trusted commands: cat, cd, grep, head, ls, pwd, tail, git status/log/diff/show, find (without -exec), etc.",acceptEdits:"sandboxMode=workspace-write, approvalPolicy=never. All commands auto-execute within project directory.",bypassPermissions:"sandboxMode=danger-full-access, approvalPolicy=never. Full system access, use only in trusted environments.",overrideNote:"You can override this per-session using the mode button in the chat interface."}},actions:{add:"Add"}},za={title:"MCP Servers",description:{claude:"Model Context Protocol servers provide additional tools and data sources to Claude",cursor:"Model Context Protocol servers provide additional tools and data sources to Cursor",codex:"Model Context Protocol servers provide additional tools and data sources to Codex",opencode:"Model Context Protocol servers provide additional tools and data sources to OpenCode"},addButton:"Add MCP Server",empty:"No MCP servers configured",serverType:"Type",scope:{local:"local",user:"user"},config:{command:"Command",url:"URL",args:"Args",environment:"Environment"},tools:{title:"Tools",count:"({{count}}):",more:"+{{count}} more"},actions:{edit:"Edit server",delete:"Delete server"},managed:{badge:"Managed",hint:"Managed by WindCli."},help:{title:"About Codex MCP",description:"Codex supports stdio-based MCP servers. You can add servers that extend Codex's capabilities with additional tools and resources."}},Da={title:"Plugins",description:"Extend the interface with custom plugins. Install from git or drop a folder in ~/.claude-code-ui/plugins/",installPlaceholder:"https://github.com/user/my-plugin",installButton:"Install",installing:"Installing…",securityWarning:"Only install plugins whose source code you have reviewed or from authors you trust.",scanningPlugins:"Scanning plugins…",noPluginsInstalled:"No plugins installed",pullLatest:"Pull latest from git",noGitRemote:"No git remote — update not available",uninstallPlugin:"Uninstall plugin",confirmUninstall:"Click again to confirm",confirmUninstallMessage:"Remove {{name}}? This cannot be undone.",cancel:"Cancel",remove:"Remove",updateFailed:"Update failed",installFailed:"Installation failed",uninstallFailed:"Uninstall failed",toggleFailed:"Toggle failed",starterPluginLabel:"Starter Plugin",starter:"Starter",docs:"Docs",sections:{officialTitle:"Official Plugins",officialDescription:"Maintained by the WindCli team and ready for direct install.",unofficialTitle:"Other Plugins",unofficialDescription:"Unofficial plugins and integrations from other users. Review the source before installing."},starterPlugin:{name:"Project Stats",badge:"starter",description:"File counts, lines of code, file-type breakdown, and recent activity for your project.",install:"Install"},terminalPlugin:{name:"Terminal",badge:"official",description:"Integrated terminal with full shell access directly within the interface.",install:"Install"},scheduledPromptPlugin:{name:"Scheduled Prompts",badge:"unofficial",description:"Schedule workspace prompts, review run history, and manage recurring local tasks.",install:"Install"},claudeWatchPlugin:{name:"Claude Watch",badge:"unofficial",description:"Watch long-running Claude Code sessions for hangs and expose process controls.",install:"Install"},prismCloudCLI:{name:"PRISM CloudCLI",badge:"unofficial",description:"Session intelligence for Claude Code, inside WindCli. See why your sessions are burning tokens without leaving the browser.",install:"Install"},sessionManagerPlugin:{name:"Sessions",badge:"unofficial",description:"View, manage, and kill active Claude Code sessions.",install:"Install"},tokenCostCalculatorPlugin:{name:"Token Cost Calculator",badge:"unofficial",description:"Calculate API costs from model prices and token usage, with preset model pricing support.",install:"Install"},taskQueuePlugin:{name:"Task Queue",badge:"unofficial",description:"Task queue dashboard to view, filter, and launch agent tasks.",install:"Install"},githubIssuesBoardPlugin:{name:"GitHub Issues Board",badge:"unofficial",description:"Kanban board for GitHub Issues with bidirectional TaskMaster sync and /github-task CLI skill auto-install",install:"Install"},claudeUsagePlugin:{name:"Claude Usage",badge:"unofficial",description:"Track live Claude Code plan limits and explore 30-day token and cost history.",install:"Install"},codexUsagePlugin:{name:"Codex Usage",badge:"unofficial",description:"Track live Codex plan limits, reset timing, and 30-day account token activity.",install:"Install"},morePlugins:"More",enable:"Enable",disable:"Disable",installAriaLabel:"Plugin git repository URL",tab:"tab",runningStatus:"running"},Na={title:pa,tabs:ma,account:ga,mcp:ha,appearance:fa,actions:ba,voiceSettings:va,quickSettings:ka,terminalShortcuts:xa,mainTabs:ya,notifications:wa,appearanceSettings:Ca,mcpForm:Sa,saveStatus:Pa,footerActions:Aa,git:ja,apiKeys:Ta,tasks:Ia,agents:Ea,permissions:Ma,mcpServers:za,pluginSettings:Da},$a={title:"Welcome Back",description:"Sign in to your WindCli self-hosted account",username:"Username",password:"Password",submit:"Sign In",loading:"Signing in...",errors:{invalidCredentials:"Invalid username or password",requiredFields:"Please fill in all fields",networkError:"Network error. Please try again."},placeholders:{username:"Enter your username",password:"Enter your password"}},Ra={title:"Create Account",username:"Username",password:"Password",confirmPassword:"Confirm Password",submit:"Create Account",loading:"Creating account...",errors:{passwordMismatch:"Passwords do not match",usernameTaken:"Username is already taken",weakPassword:"Password is too weak"}},La={title:"Sign Out",confirm:"Are you sure you want to sign out?",button:"Sign Out"},Fa={login:$a,register:Ra,logout:La},Ba={title:"Projects",newProject:"New Project",deleteProject:"Remove Project",renameProject:"Rename Project",noProjects:"No projects found",loadingProjects:"Loading projects...",searchPlaceholder:"Search projects...",projectNamePlaceholder:"Project name",starred:"Starred",all:"All",untitledSession:"Untitled Session",newSession:"New Session",codexSession:"Codex Session",fetchingProjects:"Fetching your Claude projects and sessions",projects:"projects",noMatchingProjects:"No matching projects",tryDifferentSearch:"Try adjusting your search term",runClaudeCli:"Run Claude CLI in a project directory to get started"},Ga={title:"WindCli",subtitle:"AI coding assistant interface"},Ha={title:"Sessions",newSession:"New Session",deleteSession:"Delete Session",renameSession:"Rename Session",noSessions:"No sessions yet",loadingSessions:"Loading sessions...",unnamed:"Unnamed",loading:"Loading...",showMore:"Show more sessions"},Oa={viewEnvironments:"View Environments",hideSidebar:"Hide sidebar",createProject:"Create new project",refresh:"Refresh projects and sessions (Ctrl+R)",renameProject:"Rename project (F2)",deleteProject:"Remove project from sidebar (Delete)",addToFavorites:"Add to favorites",removeFromFavorites:"Remove from favorites",editSessionName:"Manually edit session name",deleteSession:"Delete this session permanently",activeSessionIndicator:"Recently active session (last 10 minutes)",save:"Save",cancel:"Cancel",clearSearch:"Clear search",openCommandPalette:"Open command palette",attentionRequiredIndicator:"Session needs attention"},Ua={chat:"Chat",files:"Files",git:"Git",terminal:"Terminal",tasks:"Tasks"},qa={refresh:"Refresh",settings:"Settings",collapseAll:"Collapse All",expandAll:"Expand All",cancel:"Cancel",save:"Save",delete:"Delete",rename:"Rename",joinCommunity:"Join Community",reportIssue:"Report Issue",starOnGithub:"Star on GitHub"},Wa={openSource:"Open Source"},Va={active:"Active",inactive:"Inactive",thinking:"Thinking...",error:"Error",aborted:"Aborted",unknown:"Unknown"},Ka={justNow:"Just now",oneMinuteAgo:"1 min ago",minutesAgo:"{{count}} mins ago",oneHourAgo:"1 hour ago",hoursAgo:"{{count}} hours ago",oneDayAgo:"1 day ago",daysAgo:"{{count}} days ago"},_a={deleteConfirm:"Are you sure you want to delete this?",renameSuccess:"Renamed successfully",deleteSuccess:"Deleted successfully",errorOccurred:"An error occurred",deleteSessionConfirm:"Are you sure you want to delete this session? This action cannot be undone.",deleteProjectConfirm:"Remove this project from the sidebar? Your project files, memories, and session data will not be deleted.",enterProjectPath:"Please enter a project path",deleteSessionFailed:"Failed to delete session. Please try again.",deleteSessionError:"Error deleting session. Please try again.",renameSessionFailed:"Failed to rename session. Please try again.",renameSessionError:"Error renaming session. Please try again.",deleteProjectFailed:"Failed to remove project. Please try again.",deleteProjectError:"Error removing project. Please try again.",createProjectFailed:"Failed to create project. Please try again.",createProjectError:"Error creating project. Please try again.",updateProjectError:"Error updating project. Please try again.",refreshError:"Failed to refresh. Please try again.",restoreProjectFailed:"Failed to restore project. Please try again.",restoreProjectError:"Error restoring project. Please try again.",restoreSessionFailed:"Failed to restore session. Please try again.",restoreSessionError:"Error restoring session. Please try again."},Ya={updateAvailable:"Update available",restartRequired:"Update installed — restart the server to apply"},Ja={modeProjects:"Projects",modeConversations:"Conversations",conversationsPlaceholder:"Search in conversations...",searching:"Searching...",sessionTitles:"Session",conversationContents:"Conversation contents",noResults:"No results found",tryDifferentQuery:"Try a different search query",matches_one:"{{count}} match",matches_other:"{{count}} matches",projectsScanned_one:"{{count}} project scanned",projectsScanned_other:"{{count}} projects scanned"},Qa={title:"Recent conversations",emptyTitle:"No conversations yet",emptyDescription:"Your most recently updated conversations will appear here.",loadFailed:"Could not load recent conversations",loadMore:"Load older conversations",loadingMore:"Loading more..."},Za={deleteProject:"Remove Project",deleteSession:"Delete Session",confirmDelete:"What would you like to do with",sessionCount_one:"This project contains {{count}} conversation.",sessionCount_other:"This project contains {{count}} conversations.",removeFromSidebar:"Remove from sidebar only",deleteAllData:"Delete all data permanently",allConversationsDeleted:"The project will be removed from the sidebar. Your files, memories, and session data will be preserved.",cannotUndo:"You can re-add the project later."},Xa={projects:Ba,app:Ga,sessions:Ha,tooltips:Oa,navigation:Ua,actions:qa,branding:Wa,status:Va,time:Ka,messages:_a,version:Ya,search:Ja,recent:Qa,deleteConfirmation:Za},eo={copy:"Copy",copied:"Copied",copyCode:"Copy code"},to={copy:"Copy message",copied:"Message copied",selectFormat:"Select copy format",copyAsMarkdown:"Copy as markdown",copyAsText:"Copy as text"},no={user:"U",error:"Error",tool:"Tool",claude:"Claude",cursor:"Cursor",codex:"Codex",opencode:"OpenCode"},so={settings:"Tool Settings",error:"Tool Error",result:"Tool Result",viewParams:"View input parameters",viewRawParams:"View raw parameters",viewDiff:"View edit diff for",creatingFile:"Creating new file:",updatingTodo:"Updating Todo List",read:"Read",readFile:"Read file",updateTodo:"Update todo list",readTodo:"Read todo list",searchResults:"results"},io={found:"Found {{count}} {{type}}",file:"file",files:"files",pattern:"pattern:",in:"in:"},ao={updated:"File updated successfully",created:"File created successfully",written:"File written successfully",diff:"Diff",newFile:"New File",viewContent:"View file content",viewFullOutput:"View full output ({{count}} chars)",contentDisplayed:"The file content is displayed in the diff view above"},oo={title:"Interactive Prompt",waiting:"Waiting for your response in the CLI",instruction:"Please select an option in your terminal where Claude is running.",selectedOption:"✓ Claude selected option {{number}}",instructionDetail:"In the CLI, you would select this option interactively using arrow keys or by typing the number."},ro={title:"Thinking...",emoji:"💭 Thinking..."},lo={response:"JSON Response"},co={grant:"Grant permission for {{tool}}",added:"Permission added",addTo:"Adds {{entry}} to Allowed Tools.",retry:"Permission saved. Retry the request to use the tool.",error:"Unable to update permissions. Please try again.",openSettings:"Open settings"},uo={updated:"Todo list has been updated successfully",current:"Current Todo List"},po={viewPlan:"📋 View implementation plan",title:"Implementation Plan"},mo={resetAt:"Claude usage limit reached. Your limit will reset at **{{time}} {{timezone}}** - {{date}}"},go={permissionMode:"Permission Mode",modes:{default:"Default Mode",auto:"Auto Mode",acceptEdits:"Accept Edits",bypassPermissions:"Bypass Permissions",plan:"Plan Mode"},descriptions:{default:"Only trusted commands (ls, cat, grep, git status, etc.) run automatically. Other commands are skipped. Can write to workspace.",auto:"A model classifier decides per tool call whether to approve or deny. Hands-off, but safer than Bypass — denials still happen.",acceptEdits:"All commands run automatically within the workspace. Full auto mode with sandboxed execution.",bypassPermissions:"Full system access with no restrictions. All commands run automatically with full disk and network access. Use with caution.",plan:"Planning mode - no commands are executed"},technicalDetails:"Technical details"},ho={input:"Voice input",stopRecording:"Stop recording",transcribing:"Transcribing…",speak:"Read aloud",stopSpeaking:"Stop",loading:"Loading…"},fo={placeholder:"Type / for commands, @ for files, or ask {{provider}} anything...",placeholderDefault:"Type your message...",disabled:"Input disabled",attachFiles:"Attach files",attachImages:"Attach images",send:"Send",stop:"Stop",hintText:{ctrlEnter:"Ctrl+Enter to send • Shift+Enter for new line • Tab to change modes • / for slash commands",enter:"Enter to send • Shift+Enter for new line • Tab to change modes • / for slash commands",queue:"Enter to queue your next message",updateQueued:"Enter to update queued message"},clickToChangeMode:"Click to change permission mode (or press Tab in input)",showAllCommands:"Show all commands",clearInput:"Clear input",scrollToBottom:"Scroll to bottom",queue:{sendNext:"Queue next message",update:"Update queued message",label:"Queued",willSend:"Will send when this finishes",edit:"Edit queued message",delete:"Delete queued message"}},bo={reasoning:"Reasoning",model:"Model",effortDefault:"Default",loadingModels:"Loading models…",modelMenu:"Select model and reasoning effort",permissionHeading:"How should {{provider}} actions be approved?"},vo={title:"Choose Your AI Assistant",description:"Select a provider to start a new conversation",selectModel:"Select Model",providerInfo:{anthropic:"by Anthropic",openai:"by OpenAI",cursorEditor:"AI Code Editor",google:"by Google"},readyPrompt:{claude:"Ready to use Claude with {{model}}. Start typing your message below.",cursor:"Ready to use Cursor with {{model}}. Start typing your message below.",codex:"Ready to use Codex with {{model}}. Start typing your message below.",opencode:"Ready to use OpenCode with {{model}}. Start typing your message below.",default:"Select a provider above to begin"},pressToSearch:"Press <kbd>{{shortcut}}</kbd> to search sessions, files, and commits"},ko={continue:{title:"Continue your conversation",description:"Ask questions about your code, request changes, or get help with development tasks"},loading:{olderMessages:"Loading older messages...",sessionMessages:"Loading session messages..."},messages:{showingOf:"Showing {{shown}} of {{total}} messages",scrollToLoad:"Scroll up to load more",showingLast:"Showing last {{count}} messages ({{total}} total)",loadEarlier:"Load earlier messages",loadAll:"Load all messages",loadingAll:"Loading all messages...",allLoaded:"All messages loaded",perfWarning:'All messages loaded — scrolling may be slower. Click "Scroll to bottom" to restore performance.'}},xo={selectProject:{title:"Select a Project",description:"Choose a project to open an interactive shell in that directory"},status:{newSession:"New Session",initializing:"Initializing...",restarting:"Restarting..."},actions:{disconnect:"Disconnect",disconnectTitle:"Disconnect from shell",restart:"Restart",restartTitle:"Restart Shell",connect:"Continue in Shell",connectTitle:"Connect to shell"},loading:"Loading terminal...",connecting:"Connecting to shell...",startSession:"Start a new Claude session",resumeSession:"Resume session: {{displayName}}...",runCommand:"Run {{command}} in {{projectName}}",startCli:"Starting Claude CLI in {{projectName}}",defaultCommand:"command"},yo={actions:{thinking:"Thinking",processing:"Processing",analyzing:"Analyzing",working:"Working",computing:"Computing",reasoning:"Reasoning"},state:{live:"Live",paused:"Paused"},elapsed:{seconds:"{{count}}s",minutesSeconds:"{{minutes}}m {{seconds}}s",label:"{{time}} elapsed",startingNow:"Starting now"},stop:"Stop",controls:{stopGeneration:"Stop Generation",pressEscToStop:"Press Esc anytime to stop"},providers:{assistant:"Assistant"}},wo={startChatWithProvider:"Select a project to start chatting with {{provider}}"},Co={nextTaskPrompt:"Start the next task"},So={codeBlock:eo,copyMessage:to,messageTypes:no,tools:so,search:io,fileOperations:ao,interactive:oo,thinking:ro,json:lo,permissions:co,todo:uo,plan:po,usageLimit:mo,codex:go,voice:ho,input:fo,composer:bo,providerSelection:vo,session:ko,shell:xo,claudeStatus:yo,projectSelection:wo,tasks:Co},Po={changes:"changes",previousChange:"Previous change",nextChange:"Next change",hideDiff:"Hide diff highlighting",showDiff:"Show diff highlighting",settings:"Editor Settings",collapse:"Collapse editor",expand:"Expand editor to full width"},Ao="Loading {{fileName}}...",jo={showingChanges:"Showing changes"},To={copyPath:"Copy file path",pathCopied:"File path copied",download:"Download file",save:"Save",saving:"Saving...",saved:"Saved!",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",close:"Close",previewMarkdown:"Preview markdown",editMarkdown:"Edit markdown"},Io={lines:"Lines:",characters:"Characters:",shortcuts:"Press Ctrl+S to save • Esc to close"},Eo={title:"Binary File",message:'The file "{{fileName}}" cannot be displayed in the text editor because it is a binary file.'},Mo={loading:"Loading preview...",error:"Unable to display this file.",openInNewTab:"Open in new tab"},zo={toolbar:Po,loading:Ao,header:jo,actions:To,footer:Io,binaryFile:Eo,filePreview:Mo},Do={title:"TaskMaster AI is not configured",description:"TaskMaster helps break down complex projects into manageable tasks with AI-powered assistance",whatIsTitle:"🎯 What is TaskMaster?",features:{aiPowered:"AI-Powered Task Management: Break complex projects into manageable subtasks",prdTemplates:"PRD Templates: Generate tasks from Product Requirements Documents",dependencyTracking:"Dependency Tracking: Understand task relationships and execution order",progressVisualization:"Progress Visualization: Kanban boards and detailed task analytics",cliIntegration:"CLI Integration: Use taskmaster commands for advanced workflows"},initializeButton:"Initialize TaskMaster AI"},No={title:"Getting Started with TaskMaster",subtitle:"TaskMaster is initialized! Here's what to do next:",steps:{createPRD:{title:"Create a Product Requirements Document (PRD)",description:"Discuss your project idea and create a PRD that describes what you want to build.",addButton:"Add PRD",existingPRDs:"Existing PRDs:"},generateTasks:{title:"Generate Tasks from PRD",description:"Once you have a PRD, ask your AI assistant to parse it and TaskMaster will automatically break it down into manageable tasks with implementation details."},analyzeTasks:{title:"Analyze & Expand Tasks",description:"Ask your AI assistant to analyze task complexity and expand them into detailed subtasks for easier implementation."},startBuilding:{title:"Start Building",description:"Ask your AI assistant to begin working on tasks, update their status, and add new tasks as your project evolves."}},tip:"💡 Tip: Start with a PRD to get the most out of TaskMaster's AI-powered task generation"},$o={title:"TaskMaster Setup",subtitle:"Interactive CLI for {{projectName}}",willStart:"TaskMaster initialization will start automatically",completed:"TaskMaster setup completed! You can now close this window.",closeButton:"Close",closeContinueButton:"Close & Continue"},Ro={title:"Getting Started with TaskMaster",subtitle:"Your guide to productive task management",examples:{parsePRD:`💬 Example:
3
3
  "I've just initialized a new project with Claude Task Master. I have a PRD at .taskmaster/docs/prd.txt. Can you help me parse it and set up the initial tasks?"`,expandTask:`💬 Example:
4
4
  "Task 5 seems complex. Can you break it down into subtasks?"`,addTask:`💬 Example:
5
5
  "Please add a new task to implement user profile image uploads using Cloudinary, research the best approach."`},moreExamples:"View more examples and usage patterns →",proTips:{title:"💡 Pro Tips",search:"Use the search bar to quickly find specific tasks",views:"Switch between Kanban, List, and Grid views using the view toggles",filters:"Use filters to focus on specific task statuses or priorities",details:"Click on any task to view detailed information and manage subtasks"},learnMore:{title:"📚 Learn More",description:"TaskMaster AI is an advanced task management system built for developers. Get documentation, examples, and contribute to the project.",githubButton:"View on GitHub"}},Lo={placeholder:"Search tasks..."},Fo={button:"Filters",status:"Status",priority:"Priority",sortBy:"Sort By",allStatuses:"All Statuses",allPriorities:"All Priorities",showing:"Showing {{filtered}} of {{total}} tasks",clearFilters:"Clear Filters"},Bo={id:"ID",status:"Status",priority:"Priority",idAsc:"ID (Ascending)",idDesc:"ID (Descending)",titleAsc:"Title (A-Z)",titleDesc:"Title (Z-A)",statusAsc:"Status (Pending First)",statusDesc:"Status (Done First)",priorityAsc:"Priority (High First)",priorityDesc:"Priority (Low First)"},Go={kanban:"Kanban view",list:"List view",grid:"Grid view"},Ho={pending:"📋 To Do",inProgress:"🚀 In Progress",done:"✅ Done",blocked:"🚫 Blocked",deferred:"⏳ Deferred",cancelled:"❌ Cancelled",noTasksYet:"No tasks yet",tasksWillAppear:"Tasks will appear here",moveTasksHere:"Move tasks here when started",completedTasksHere:"Completed tasks appear here",statusTasksHere:"Tasks with this status will appear here"},Oo={help:"TaskMaster Getting Started Guide",prds:"PRDs",addPRD:"Add PRD",addTask:"Add Task",createNewPRD:"Create New PRD",prdsAvailable:"{{count}} PRD(s) available"},Uo={modified:"Modified: {{date}}"},qo={pending:"Pending","in-progress":"In Progress",done:"Done",blocked:"Blocked",deferred:"Deferred",cancelled:"Cancelled"},Wo={high:"High",medium:"Medium",low:"Low"},Vo={title:"No tasks match your filters",description:"Try adjusting your search or filter criteria."},Ko={notConfigured:Do,gettingStarted:No,setupModal:$o,helpGuide:Ro,search:Lo,filters:Fo,sort:Bo,views:Go,kanban:Ho,buttons:Oo,prd:Uo,statuses:qo,priorities:Wo,noMatchingTasks:Vo},_o={save:"Enregistrer",cancel:"Annuler",delete:"Supprimer",create:"Créer",edit:"Modifier",close:"Fermer",confirm:"Confirmer",submit:"Soumettre",retry:"Réessayer",refresh:"Actualiser",search:"Rechercher",clear:"Effacer",copy:"Copier",download:"Télécharger",upload:"Envoyer",browse:"Parcourir"},Yo={chat:"Chat",shell:"Terminal",files:"Fichiers",git:"Contrôle de source",tasks:"Tâches",browser:"Navigateur",computer:"Ordinateur"},Jo={loading:"Chargement...",success:"Succès",error:"Erreur",failed:"Échec",pending:"En attente",completed:"Terminé",inProgress:"En cours"},Qo={savedSuccessfully:"Enregistré avec succès",deletedSuccessfully:"Supprimé avec succès",updatedSuccessfully:"Mis à jour avec succès",operationFailed:"Opération échouée",networkError:"Erreur réseau. Vérifiez votre connexion.",unauthorized:"Non autorisé. Veuillez vous connecter.",notFound:"Introuvable",invalidInput:"Entrée invalide",requiredField:"Ce champ est obligatoire",unknownError:"Une erreur inconnue s'est produite"},Zo={settings:"Paramètres",home:"Accueil",back:"Retour",next:"Suivant",previous:"Précédent",logout:"Déconnexion"},Xo={language:"Langue",theme:"Thème",darkMode:"Mode sombre",lightMode:"Mode clair",name:"Nom",description:"Description",enabled:"Activé",disabled:"Désactivé",optional:"Optionnel",version:"Version",select:"Sélectionner",selectAll:"Tout sélectionner",deselectAll:"Tout désélectionner"},er={justNow:"À l'instant",minutesAgo:"Il y a {{count}} min",hoursAgo:"Il y a {{count}} h",daysAgo:"Il y a {{count}} j",yesterday:"Hier"},tr={newFile:"Nouveau fichier",newFolder:"Nouveau dossier",rename:"Renommer",move:"Déplacer",copyPath:"Copier le chemin",openInEditor:"Ouvrir dans l'éditeur"},nr={loading:"Chargement de WindCli",settingUpWorkspace:"Préparation de votre espace de travail...",chooseProject:"Choisissez votre projet",selectProjectDescription:"Sélectionnez un projet dans la barre latérale pour commencer à coder avec Claude. Chaque projet contient vos sessions de chat et l'historique des fichiers.",tip:"Astuce",createProjectMobile:"Appuyez sur le bouton menu ci-dessus pour accéder aux projets",createProjectDesktop:"Créez un nouveau projet en cliquant sur l'icône de dossier dans la barre latérale",newSession:"Nouvelle session",untitledSession:"Session sans titre",projectFiles:"Fichiers du projet"},sr={loading:"Chargement des fichiers...",files:"Fichiers",simpleView:"Vue simple",compactView:"Vue compacte",detailedView:"Vue détaillée",searchPlaceholder:"Rechercher fichiers et dossiers...",clearSearch:"Effacer la recherche",name:"Nom",size:"Taille",modified:"Modifié",permissions:"Permissions",noFilesFound:"Aucun fichier trouvé",checkProjectPath:"Vérifiez si le chemin du projet est accessible",noMatchesFound:"Aucun résultat",tryDifferentSearch:"Essayez un autre terme ou effacez la recherche",justNow:"à l'instant",minAgo:"il y a {{count}} min",hoursAgo:"il y a {{count}} h",daysAgo:"il y a {{count}} j",newFile:"Nouveau fichier (Cmd+N)",newFolder:"Nouveau dossier (Cmd+Maj+N)",refresh:"Actualiser",collapseAll:"Tout réduire",context:{rename:"Renommer",delete:"Supprimer",copyPath:"Copier le chemin",download:"Télécharger",newFile:"Nouveau fichier",newFolder:"Nouveau dossier",upload:"Téléverser des fichiers",refresh:"Actualiser",menuLabel:"Menu contextuel du fichier",loading:"Chargement..."}},ir={title:"Créer un nouveau projet",steps:{type:"Type",configure:"Configurer",confirm:"Confirmer"},step1:{question:"Avez-vous déjà un espace de travail, ou souhaitez-vous en créer un nouveau ?",existing:{title:"Espace de travail existant",description:"J'ai déjà un espace de travail sur mon serveur et je veux juste l'ajouter à la liste des projets"},new:{title:"Nouvel espace de travail",description:"Créer un nouvel espace de travail, éventuellement cloné depuis un dépôt GitHub"}},step2:{existingPath:"Chemin de l'espace de travail",newPath:"Chemin de l'espace de travail",existingPlaceholder:"/chemin/vers/espace-de-travail",newPlaceholder:"/chemin/vers/nouvel-espace",existingHelp:"Chemin complet vers votre répertoire d'espace de travail existant",newHelp:"Chemin complet vers votre répertoire d'espace de travail",githubUrl:"URL GitHub (optionnel)",githubPlaceholder:"https://github.com/utilisateur/depot",githubHelp:"Optionnel : fournissez une URL GitHub pour cloner un dépôt",githubAuth:"Authentification GitHub (optionnel)",githubAuthHelp:"Uniquement requis pour les dépôts privés. Les dépôts publics peuvent être clonés sans authentification.",loadingTokens:"Chargement des tokens enregistrés...",storedToken:"Token enregistré",newToken:"Nouveau token",nonePublic:"Aucun (Public)",selectToken:"Sélectionner un token",selectTokenPlaceholder:"-- Sélectionner un token --",tokenPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",tokenHelp:"Ce token sera utilisé uniquement pour cette opération",publicRepoInfo:"Les dépôts publics ne nécessitent pas d'authentification. Vous pouvez ignorer le token pour cloner un dépôt public.",noTokensHelp:"Aucun token enregistré. Vous pouvez en ajouter dans Paramètres → Clés API.",optionalTokenPublic:"Token GitHub (optionnel pour les dépôts publics)",tokenPublicPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (laisser vide pour les dépôts publics)"},step3:{reviewConfig:"Vérifiez votre configuration",existingWorkspace:"Espace de travail existant",newWorkspace:"Nouvel espace de travail",path:"Chemin :",cloneFrom:"Cloner depuis :",authentication:"Authentification :",usingStoredToken:"Utilisation du token enregistré :",usingProvidedToken:"Utilisation du token fourni",noAuthentication:"Sans authentification",sshKey:"Clé SSH",existingInfo:"L'espace de travail sera ajouté à votre liste de projets et disponible pour les sessions Claude/Cursor.",newWithClone:"Le dépôt sera cloné depuis ce dossier.",newEmpty:"L'espace de travail sera ajouté à votre liste de projets et disponible pour les sessions Claude/Cursor.",cloningRepository:"Clonage du dépôt..."},buttons:{cancel:"Annuler",back:"Retour",next:"Suivant",createProject:"Créer le projet",creating:"Création...",cloning:"Clonage..."},errors:{selectType:"Veuillez indiquer si vous avez un espace de travail existant ou si vous souhaitez en créer un nouveau",providePath:"Veuillez fournir un chemin d'espace de travail",failedToCreate:"Échec de la création de l'espace de travail",failedToCreateFolder:"Échec de la création du dossier"}},ar={genericTool:"un outil",codes:{generic:{info:{title:"Notification"}},permission:{required:{title:"Action requise",body:"{{toolName}} attend votre décision."}},run:{stopped:{title:"Exécution arrêtée",body:"Raison : {{reason}}"},failed:{title:"Exécution échouée"}},agent:{notification:{title:"Notification de l'agent"}}}},or={title:"Mise à jour disponible",newVersionReady:"Une nouvelle version est prête",currentVersion:"Version actuelle",latestVersion:"Dernière version",whatsNew:"Nouveautés :",viewFullRelease:"Voir les notes de version complètes",updateProgress:"Progression de la mise à jour :",manualUpgrade:"Mise à jour manuelle :",npmUpgradeCommand:"npm install -g wind-agent-cli@latest",manualUpgradeHint:"Ou cliquez sur « Mettre à jour maintenant » pour lancer la mise à jour automatiquement.",updateCompleted:"Mise à jour effectuée avec succès !",restartServer:"Veuillez redémarrer le serveur pour appliquer les modifications.",updateFailed:"Échec de la mise à jour",buttons:{close:"Fermer",later:"Plus tard",copyCommand:"Copier la commande",updateNow:"Mettre à jour maintenant",updating:"Mise à jour..."},ariaLabels:{closeModal:"Fermer la fenêtre de mise à jour",showSidebar:"Afficher la barre latérale",settings:"Paramètres",updateAvailable:"Mise à jour disponible",closeSidebar:"Masquer la barre latérale"}},rr={buttons:_o,tabs:Yo,status:Jo,messages:Qo,navigation:Zo,common:Xo,time:er,fileOperations:tr,mainContent:nr,fileTree:sr,projectWizard:ir,notifications:ar,versionUpdate:or},lr="Paramètres",cr={account:"Compte",permissions:"Permissions",mcpServers:"Serveurs MCP",appearance:"Apparence"},dr={title:"Compte",language:"Langue",languageLabel:"Langue d'affichage",languageDescription:"Choisissez votre langue préférée pour l'interface",username:"Nom d'utilisateur",email:"E-mail",profile:"Profil",changePassword:"Changer le mot de passe"},ur={title:"Serveurs MCP",addServer:"Ajouter un serveur",editServer:"Modifier le serveur",deleteServer:"Supprimer le serveur",serverName:"Nom du serveur",serverType:"Type de serveur",config:"Configuration",testConnection:"Tester la connexion",status:"Statut",connected:"Connecté",disconnected:"Déconnecté",scope:{label:"Portée",user:"Utilisateur",project:"Projet"}},pr={title:"Apparence",theme:"Thème",codeEditor:"Éditeur de code",editorTheme:"Thème de l'éditeur",wordWrap:"Retour à la ligne",showMinimap:"Afficher la minimap",lineNumbers:"Numéros de ligne",fontSize:"Taille de police"},mr={saveChanges:"Enregistrer les modifications",resetToDefaults:"Rétablir les valeurs par défaut",cancelChanges:"Annuler les modifications"},gr={title:"Paramètres rapides",sections:{appearance:"Apparence",toolDisplay:"Affichage des outils",inputSettings:"Paramètres de saisie"},darkMode:"Mode sombre",showRawParameters:"Afficher les paramètres bruts",showThinking:"Afficher la réflexion",sendByCtrlEnter:"Envoyer avec Ctrl+Entrée",sendByCtrlEnterDescription:"Lorsqu'activé, appuyer sur Ctrl+Entrée envoie le message au lieu de simplement Entrée. Utile pour les utilisateurs IME pour éviter les envois accidentels.",dragHandle:{dragging:"Glissement en cours",closePanel:"Fermer le panneau de paramètres",openPanel:"Ouvrir le panneau de paramètres",draggingStatus:"Glissement...",toggleAndMove:"Cliquer pour basculer, glisser pour déplacer"}},hr={title:"Raccourcis terminal",sectionKeys:"Touches",sectionNavigation:"Navigation",escape:"Échap",tab:"Tab",shiftTab:"Maj+Tab",arrowUp:"Flèche haut",arrowDown:"Flèche bas",scrollDown:"Défiler vers le bas",handle:{closePanel:"Fermer le panneau de raccourcis",openPanel:"Ouvrir le panneau de raccourcis"}},fr={label:"Paramètres",agents:"Agents",appearance:"Apparence",git:"Git",apiTokens:"API & Tokens",tasks:"Tâches",notifications:"Notifications",plugins:"Plugins",about:"À propos"},br={title:"Notifications",description:"Contrôlez les événements de notification que vous recevez.",webPush:{title:"Notifications push web",enable:"Activer les notifications push",disable:"Désactiver les notifications push",enabled:"Les notifications push sont activées",loading:"Mise à jour...",unsupported:"Les notifications push ne sont pas prises en charge dans ce navigateur.",denied:"Les notifications push sont bloquées. Veuillez les autoriser dans les paramètres de votre navigateur."},sound:{title:"Son",description:"Jouer un court son lorsqu'une exécution de chat se termine.",enabled:"Activé",test:"Tester le son"},events:{title:"Types d'événements",actionRequired:"Action requise",stop:"Exécution arrêtée",error:"Exécution échouée"}},vr={darkMode:{label:"Mode sombre",description:"Basculer entre les thèmes clair et sombre"},projectSorting:{label:"Tri des projets",description:"Ordre d'affichage des projets dans la barre latérale",alphabetical:"Alphabétique",recentActivity:"Activité récente"},codeEditor:{title:"Éditeur de code",theme:{label:"Thème de l'éditeur",description:"Thème par défaut pour l'éditeur de code"},wordWrap:{label:"Retour à la ligne",description:"Activer le retour à la ligne par défaut dans l'éditeur"},showMinimap:{label:"Afficher la minimap",description:"Afficher une minimap pour une navigation plus facile en vue diff"},lineNumbers:{label:"Afficher les numéros de ligne",description:"Afficher les numéros de ligne dans l'éditeur"},fontSize:{label:"Taille de police",description:"Taille de police de l'éditeur en pixels"}}},kr={title:{add:"Ajouter un serveur MCP",edit:"Modifier le serveur MCP"},importMode:{form:"Saisie via formulaire",json:"Import JSON"},scope:{label:"Portée",userGlobal:"Utilisateur (global)",projectLocal:"Projet (local)",userDescription:"Portée utilisateur : Disponible dans tous les projets sur votre machine",projectDescription:"Portée locale : Disponible uniquement dans le projet sélectionné",cannotChange:"La portée ne peut pas être modifiée lors de la modification d'un serveur existant"},fields:{serverName:"Nom du serveur",transportType:"Type de transport",command:"Commande",arguments:"Arguments (un par ligne)",jsonConfig:"Configuration JSON",url:"URL",envVars:"Variables d'environnement (CLÉ=valeur, une par ligne)",headers:"En-têtes (CLÉ=valeur, un par ligne)",selectProject:"Sélectionner un projet..."},placeholders:{serverName:"mon-serveur"},validation:{missingType:"Champ requis manquant : type",stdioRequiresCommand:"Le type stdio nécessite un champ command",httpRequiresUrl:"Le type {{type}} nécessite un champ url",invalidJson:"Format JSON invalide",jsonHelp:"Collez la configuration de votre serveur MCP en format JSON. Exemples :",jsonExampleStdio:'• stdio : {"type":"stdio","command":"npx","args":["@upstash/context7-mcp"]}',jsonExampleHttp:'• http/sse : {"type":"http","url":"https://api.exemple.com/mcp"}'},configDetails:"Détails de configuration (depuis {{configFile}})",projectPath:"Chemin : {{path}}",actions:{cancel:"Annuler",saving:"Enregistrement...",addServer:"Ajouter le serveur",updateServer:"Mettre à jour le serveur"}},xr={success:"Paramètres enregistrés avec succès !",error:"Échec de l'enregistrement des paramètres",saving:"Enregistrement..."},yr={save:"Enregistrer les paramètres",cancel:"Annuler"},wr={title:"Configuration Git",description:"Configurez votre identité git pour les commits. Ces paramètres seront appliqués globalement via git config --global",name:{label:"Nom Git",help:"Votre nom pour les commits git"},email:{label:"E-mail Git",help:"Votre e-mail pour les commits git"},actions:{save:"Enregistrer la configuration",saving:"Enregistrement..."},status:{success:"Enregistré avec succès"}},Cr={title:"Clés API",description:"Générez des clés API pour accéder à l'API externe depuis d'autres applications.",newKey:{alertTitle:"⚠️ Sauvegardez votre clé API",alertMessage:"C'est la seule fois que vous verrez cette clé. Stockez-la en lieu sûr.",iveSavedIt:"Je l'ai sauvegardée"},form:{placeholder:"Nom de la clé API (ex. : Serveur de production)",createButton:"Créer",cancelButton:"Annuler"},newButton:"Nouvelle clé API",empty:"Aucune clé API créée pour l'instant.",list:{created:"Créée :",lastUsed:"Dernière utilisation :"},confirmDelete:"Êtes-vous sûr de vouloir supprimer cette clé API ?",status:{active:"Active",inactive:"Inactive"},github:{title:"Tokens GitHub",description:"Ajoutez des tokens d'accès personnel GitHub pour cloner des dépôts privés via l'API externe.",descriptionAlt:"Ajoutez des tokens d'accès personnel GitHub pour cloner des dépôts privés. Vous pouvez aussi passer des tokens directement dans les requêtes API sans les stocker.",addButton:"Ajouter un token",form:{namePlaceholder:"Nom du token (ex. : Dépôts personnels)",tokenPlaceholder:"Token d'accès personnel GitHub (ghp_...)",descriptionPlaceholder:"Description (optionnel)",addButton:"Ajouter le token",cancelButton:"Annuler",howToCreate:"Comment créer un token d'accès personnel GitHub →"},empty:"Aucun token GitHub ajouté pour l'instant.",added:"Ajouté :",confirmDelete:"Êtes-vous sûr de vouloir supprimer ce token GitHub ?"},apiDocsLink:"Documentation API",documentation:{title:"Documentation de l'API externe",description:"Apprenez à utiliser l'API externe pour déclencher des sessions Claude/Cursor depuis vos applications.",viewLink:"Voir la documentation API →"},loading:"Chargement...",version:{updateAvailable:"Mise à jour disponible : v{{version}}"}},Sr={checking:"Vérification de l'installation TaskMaster...",notInstalled:{title:"CLI TaskMaster AI non installé",description:"Le CLI TaskMaster est requis pour utiliser les fonctionnalités de gestion des tâches. Installez-le pour commencer :",installCommand:"npm install -g task-master-ai",viewOnGitHub:"Voir sur GitHub",afterInstallation:"Après l'installation :",steps:{restart:"Redémarrez cette application",autoAvailable:"Les fonctionnalités TaskMaster deviendront automatiquement disponibles",initCommand:"Utilisez task-master init dans votre répertoire de projet"}},settings:{enableLabel:"Activer l'intégration TaskMaster",enableDescription:"Afficher les tâches TaskMaster, les bannières et les indicateurs dans la barre latérale"}},Pr={authStatus:{checking:"Vérification...",connected:"Connecté",notConnected:"Non connecté",disconnected:"Déconnecté",checkingAuth:"Vérification du statut d'authentification...",loggedInAs:"Connecté en tant que {{email}}",authenticatedUser:"utilisateur authentifié"},account:{claude:{description:"Assistant IA Claude d'Anthropic"},cursor:{description:"Éditeur de code IA Cursor"},codex:{description:"Assistant IA Codex d'OpenAI"},opencode:{description:"Assistant CLI OpenCode"}},connectionStatus:"Statut de la connexion",login:{title:"Connexion",reAuthenticate:"Se ré-authentifier",description:"Connectez-vous à votre compte {{agent}} pour activer les fonctionnalités IA",reAuthDescription:"Connectez-vous avec un autre compte ou actualisez les identifiants",button:"Se connecter",reLoginButton:"Se reconnecter"},error:"Erreur : {{error}}"},Ar={title:"Paramètres de permission",skipPermissions:{label:"Ignorer les invites de permission (à utiliser avec précaution)",claudeDescription:"Équivalent au flag --dangerously-skip-permissions",cursorDescription:"Équivalent au flag -f dans le CLI Cursor"},allowedTools:{title:"Outils autorisés",description:"Outils automatiquement autorisés sans demande de permission",placeholder:'ex. : "Bash(git log:*)" ou "Write"',quickAdd:"Ajout rapide d'outils courants :",empty:"Aucun outil autorisé configuré"},blockedTools:{title:"Outils bloqués",description:"Outils automatiquement bloqués sans demande de permission",placeholder:'ex. : "Bash(rm:*)"',empty:"Aucun outil bloqué configuré"},allowedCommands:{title:"Commandes shell autorisées",description:"Commandes shell automatiquement autorisées sans demande",placeholder:'ex. : "Shell(ls)" ou "Shell(git status)"',quickAdd:"Ajout rapide de commandes courantes :",empty:"Aucune commande autorisée configurée"},blockedCommands:{title:"Commandes shell bloquées",description:"Commandes shell automatiquement bloquées",placeholder:'ex. : "Shell(rm -rf)" ou "Shell(sudo)"',empty:"Aucune commande bloquée configurée"},toolExamples:{title:"Exemples de motifs d'outils :",bashGitLog:"- Autoriser toutes les commandes git log",bashGitDiff:"- Autoriser toutes les commandes git diff",write:"- Autoriser toutes les utilisations de l'outil Write",bashRm:"- Bloquer toutes les commandes rm (dangereux)"},shellExamples:{title:"Exemples de commandes shell :",ls:"- Autoriser la commande ls",gitStatus:"- Autoriser git status",npmInstall:"- Autoriser npm install",rmRf:"- Bloquer la suppression récursive"},codex:{permissionMode:"Mode de permission",description:"Contrôle comment Codex gère les modifications de fichiers et l'exécution des commandes",modes:{default:{title:"Par défaut",description:"Seules les commandes de confiance (ls, cat, grep, git status, etc.) s'exécutent automatiquement. Les autres sont ignorées. Peut écrire dans l'espace de travail."},acceptEdits:{title:"Accepter les modifications",description:"Toutes les commandes s'exécutent automatiquement dans l'espace de travail. Mode entièrement automatique avec exécution sandboxée."},bypassPermissions:{title:"Contourner les permissions",description:"Accès système complet sans restrictions. Toutes les commandes s'exécutent automatiquement avec accès disque et réseau complet. À utiliser avec précaution."}},technicalDetails:"Détails techniques",technicalInfo:{default:"sandboxMode=workspace-write, approvalPolicy=untrusted. Commandes de confiance : cat, cd, grep, head, ls, pwd, tail, git status/log/diff/show, find (sans -exec), etc.",acceptEdits:"sandboxMode=workspace-write, approvalPolicy=never. Toutes les commandes s'exécutent automatiquement dans le répertoire du projet.",bypassPermissions:"sandboxMode=danger-full-access, approvalPolicy=never. Accès système complet, à utiliser uniquement dans des environnements de confiance.",overrideNote:"Vous pouvez remplacer ce mode par session via le bouton de mode dans l'interface de chat."}},actions:{add:"Ajouter"}},jr={title:"Serveurs MCP",description:{claude:"Les serveurs Model Context Protocol fournissent des outils et sources de données supplémentaires à Claude",cursor:"Les serveurs Model Context Protocol fournissent des outils et sources de données supplémentaires à Cursor",codex:"Les serveurs Model Context Protocol fournissent des outils et sources de données supplémentaires à Codex",opencode:"Les serveurs Model Context Protocol fournissent des outils et sources de données supplémentaires à OpenCode"},addButton:"Ajouter un serveur MCP",empty:"Aucun serveur MCP configuré",serverType:"Type",scope:{local:"local",user:"utilisateur"},config:{command:"Commande",url:"URL",args:"Arguments",environment:"Environnement"},tools:{title:"Outils",count:"({{count}}) :",more:"+{{count}} de plus"},actions:{edit:"Modifier le serveur",delete:"Supprimer le serveur"},help:{title:"À propos de Codex MCP",description:"Codex prend en charge les serveurs MCP basés sur stdio. Vous pouvez ajouter des serveurs qui étendent les capacités de Codex avec des outils et ressources supplémentaires."}},Tr={title:"Plugins",description:"Étendez l'interface avec des plugins personnalisés. Installez depuis git ou déposez un dossier dans ~/.claude-code-ui/plugins/",installPlaceholder:"https://github.com/utilisateur/mon-plugin",installButton:"Installer",installing:"Installation…",securityWarning:"N'installez que des plugins dont vous avez examiné le code source ou provenant d'auteurs de confiance.",scanningPlugins:"Analyse des plugins…",noPluginsInstalled:"Aucun plugin installé",pullLatest:"Récupérer la dernière version depuis git",noGitRemote:"Pas de remote git — mise à jour indisponible",uninstallPlugin:"Désinstaller le plugin",confirmUninstall:"Cliquez à nouveau pour confirmer",confirmUninstallMessage:"Supprimer {{name}} ? Cette action est irréversible.",cancel:"Annuler",remove:"Supprimer",updateFailed:"Échec de la mise à jour",installFailed:"Échec de l'installation",uninstallFailed:"Échec de la désinstallation",toggleFailed:"Échec du basculement",starterPluginLabel:"Plugin de démarrage",starter:"Démarrage",docs:"Docs",sections:{officialTitle:"Plugins officiels",officialDescription:"Maintenus par l'équipe WindCli et prêts à être installés directement.",unofficialTitle:"Autres plugins",unofficialDescription:"Plugins non officiels et intégrations d'autres utilisateurs. Examinez le code source avant d'installer."},starterPlugin:{name:"Statistiques du projet",badge:"démarrage",description:"Nombre de fichiers, lignes de code, répartition par type de fichier et activité récente pour votre projet.",install:"Installer"},terminalPlugin:{name:"Terminal",badge:"officiel",description:"Terminal intégré avec accès shell complet directement dans l'interface.",install:"Installer"},scheduledPromptPlugin:{name:"Invites planifiées",badge:"non officiel",description:"Planifiez des invites d'espace de travail, consultez l'historique des exécutions et gérez les tâches locales récurrentes.",install:"Installer"},claudeWatchPlugin:{name:"Claude Watch",badge:"non officiel",description:"Surveillez les sessions Claude Code longues pour détecter les blocages et exposez les contrôles de processus.",install:"Installer"},prismCloudCLI:{name:"PRISM CloudCLI",badge:"non officiel",description:"Intelligence de session pour Claude Code, dans WindCli. Voyez pourquoi vos sessions consomment des tokens sans quitter le navigateur.",install:"Installer"},sessionManagerPlugin:{name:"Sessions",badge:"non officiel",description:"Visualisez, gérez et terminez les sessions Claude Code actives.",install:"Installer"},tokenCostCalculatorPlugin:{name:"Calculateur de coût en tokens",badge:"non officiel",description:"Calculez les coûts API à partir des prix des modèles et de l'utilisation des tokens, avec prise en charge des tarifs préréglés.",install:"Installer"},taskQueuePlugin:{name:"File de tâches",badge:"non officiel",description:"Tableau de bord de file de tâches pour visualiser, filtrer et lancer des tâches d'agent.",install:"Installer"},githubIssuesBoardPlugin:{name:"Tableau des issues GitHub",badge:"non officiel",description:"Tableau Kanban pour les issues GitHub avec synchronisation bidirectionnelle TaskMaster et installation automatique de la compétence CLI /github-task",install:"Installer"},morePlugins:"Plus",enable:"Activer",disable:"Désactiver",installAriaLabel:"URL du dépôt git du plugin",tab:"onglet",runningStatus:"en cours"},Ir={title:lr,tabs:cr,account:dr,mcp:ur,appearance:pr,actions:mr,quickSettings:gr,terminalShortcuts:hr,mainTabs:fr,notifications:br,appearanceSettings:vr,mcpForm:kr,saveStatus:xr,footerActions:yr,git:wr,apiKeys:Cr,tasks:Sr,agents:Pr,permissions:Ar,mcpServers:jr,pluginSettings:Tr},Er={title:"Bon retour",description:"Connectez-vous à votre compte WindCli auto-hébergé",username:"Nom d'utilisateur",password:"Mot de passe",submit:"Se connecter",loading:"Connexion en cours...",errors:{invalidCredentials:"Nom d'utilisateur ou mot de passe incorrect",requiredFields:"Veuillez remplir tous les champs",networkError:"Erreur réseau. Veuillez réessayer."},placeholders:{username:"Entrez votre nom d'utilisateur",password:"Entrez votre mot de passe"}},Mr={title:"Créer un compte",username:"Nom d'utilisateur",password:"Mot de passe",confirmPassword:"Confirmer le mot de passe",submit:"Créer le compte",loading:"Création du compte...",errors:{passwordMismatch:"Les mots de passe ne correspondent pas",usernameTaken:"Ce nom d'utilisateur est déjà pris",weakPassword:"Le mot de passe est trop faible"}},zr={title:"Se déconnecter",confirm:"Êtes-vous sûr de vouloir vous déconnecter ?",button:"Se déconnecter"},Dr={login:Er,register:Mr,logout:zr},Nr={title:"Projets",newProject:"Nouveau projet",deleteProject:"Supprimer le projet",renameProject:"Renommer le projet",noProjects:"Aucun projet trouvé",loadingProjects:"Chargement des projets...",searchPlaceholder:"Rechercher des projets...",projectNamePlaceholder:"Nom du projet",starred:"Favoris",all:"Tous",untitledSession:"Session sans titre",newSession:"Nouvelle session",codexSession:"Session Codex",fetchingProjects:"Récupération de vos projets et sessions Claude",projects:"projets",noMatchingProjects:"Aucun projet correspondant",tryDifferentSearch:"Essayez d'ajuster votre terme de recherche",runClaudeCli:"Exécutez le CLI Claude dans un répertoire de projet pour commencer"},$r={title:"WindCli",subtitle:"Interface d'assistant de codage IA"},Rr={title:"Sessions",newSession:"Nouvelle session",deleteSession:"Supprimer la session",renameSession:"Renommer la session",noSessions:"Aucune session pour l'instant",loadingSessions:"Chargement des sessions...",unnamed:"Sans nom",loading:"Chargement...",showMore:"Afficher plus de sessions"},Lr={viewEnvironments:"Voir les environnements",hideSidebar:"Masquer la barre latérale",createProject:"Créer un nouveau projet",refresh:"Actualiser les projets et sessions (Ctrl+R)",renameProject:"Renommer le projet (F2)",deleteProject:"Retirer le projet de la barre latérale (Suppr)",addToFavorites:"Ajouter aux favoris",removeFromFavorites:"Retirer des favoris",editSessionName:"Modifier manuellement le nom de la session",deleteSession:"Supprimer définitivement cette session",activeSessionIndicator:"Session récemment active (10 dernières minutes)",save:"Enregistrer",cancel:"Annuler",clearSearch:"Effacer la recherche",openCommandPalette:"Ouvrir la palette de commandes",attentionRequiredIndicator:"La session nécessite votre attention"},Fr={chat:"Chat",files:"Fichiers",git:"Git",terminal:"Terminal",tasks:"Tâches"},Br={refresh:"Actualiser",settings:"Paramètres",collapseAll:"Tout réduire",expandAll:"Tout développer",cancel:"Annuler",save:"Enregistrer",delete:"Supprimer",rename:"Renommer",joinCommunity:"Rejoindre la communauté",reportIssue:"Signaler un problème",starOnGithub:"Étoile sur GitHub"},Gr={openSource:"Open Source"},Hr={active:"Actif",inactive:"Inactif",thinking:"Réflexion...",error:"Erreur",aborted:"Annulé",unknown:"Inconnu"},Or={justNow:"À l'instant",oneMinuteAgo:"Il y a 1 min",minutesAgo:"Il y a {{count}} min",oneHourAgo:"Il y a 1 heure",hoursAgo:"Il y a {{count}} heures",oneDayAgo:"Il y a 1 jour",daysAgo:"Il y a {{count}} jours"},Ur={deleteConfirm:"Êtes-vous sûr de vouloir supprimer ceci ?",renameSuccess:"Renommé avec succès",deleteSuccess:"Supprimé avec succès",errorOccurred:"Une erreur s'est produite",deleteSessionConfirm:"Êtes-vous sûr de vouloir supprimer cette session ? Cette action est irréversible.",deleteProjectConfirm:"Retirer ce projet de la barre latérale ? Vos fichiers, mémoires et données de session ne seront pas supprimés.",enterProjectPath:"Veuillez entrer un chemin de projet",deleteSessionFailed:"Échec de la suppression de la session. Veuillez réessayer.",deleteSessionError:"Erreur lors de la suppression de la session. Veuillez réessayer.",renameSessionFailed:"Échec du renommage de la session. Veuillez réessayer.",renameSessionError:"Erreur lors du renommage de la session. Veuillez réessayer.",deleteProjectFailed:"Échec de la suppression du projet. Veuillez réessayer.",deleteProjectError:"Erreur lors de la suppression du projet. Veuillez réessayer.",createProjectFailed:"Échec de la création du projet. Veuillez réessayer.",createProjectError:"Erreur lors de la création du projet. Veuillez réessayer.",updateProjectError:"Erreur lors de la mise à jour du projet. Veuillez réessayer.",refreshError:"Échec de l'actualisation. Veuillez réessayer.",restoreProjectFailed:"Échec de la restauration du projet. Veuillez réessayer.",restoreProjectError:"Erreur lors de la restauration du projet. Veuillez réessayer.",restoreSessionFailed:"Échec de la restauration de la session. Veuillez réessayer.",restoreSessionError:"Erreur lors de la restauration de la session. Veuillez réessayer."},qr={updateAvailable:"Mise à jour disponible",restartRequired:"Mise à jour installée — redémarrez le serveur pour l'appliquer"},Wr={modeProjects:"Projets",modeConversations:"Conversations",conversationsPlaceholder:"Rechercher dans les conversations...",searching:"Recherche en cours...",sessionTitles:"Titres des sessions",conversationContents:"Contenu des conversations",noResults:"Aucun résultat trouvé",tryDifferentQuery:"Essayez une autre requête de recherche",matches_one:"{{count}} résultat",matches_other:"{{count}} résultats",projectsScanned_one:"{{count}} projet analysé",projectsScanned_other:"{{count}} projets analysés"},Vr={deleteProject:"Supprimer le projet",deleteSession:"Supprimer la session",confirmDelete:"Que souhaitez-vous faire avec",sessionCount_one:"Ce projet contient {{count}} conversation.",sessionCount_other:"Ce projet contient {{count}} conversations.",removeFromSidebar:"Retirer de la barre latérale uniquement",deleteAllData:"Supprimer toutes les données définitivement",allConversationsDeleted:"Le projet sera retiré de la barre latérale. Vos fichiers, mémoires et données de session seront conservés.",cannotUndo:"Vous pourrez rajouter le projet ultérieurement."},Kr={projects:Nr,app:$r,sessions:Rr,tooltips:Lr,navigation:Fr,actions:Br,branding:Gr,status:Hr,time:Or,messages:Ur,version:qr,search:Wr,deleteConfirmation:Vr},_r={copy:"Copier",copied:"Copié",copyCode:"Copier le code"},Yr={copy:"Copier le message",copied:"Message copié",selectFormat:"Sélectionner le format de copie",copyAsMarkdown:"Copier en markdown",copyAsText:"Copier en texte brut"},Jr={user:"U",error:"Erreur",tool:"Outil",claude:"Claude",cursor:"Cursor",codex:"Codex",opencode:"OpenCode"},Qr={settings:"Paramètres de l'outil",error:"Erreur de l'outil",result:"Résultat de l'outil",viewParams:"Voir les paramètres d'entrée",viewRawParams:"Voir les paramètres bruts",viewDiff:"Voir les différences pour",creatingFile:"Création du fichier :",updatingTodo:"Mise à jour de la liste de tâches",read:"Lire",readFile:"Lire le fichier",updateTodo:"Mettre à jour la liste de tâches",readTodo:"Lire la liste de tâches",searchResults:"résultats"},Zr={found:"{{count}} {{type}} trouvé(s)",file:"fichier",files:"fichiers",pattern:"motif :",in:"dans :"},Xr={updated:"Fichier mis à jour avec succès",created:"Fichier créé avec succès",written:"Fichier écrit avec succès",diff:"Diff",newFile:"Nouveau fichier",viewContent:"Voir le contenu du fichier",viewFullOutput:"Voir la sortie complète ({{count}} caractères)",contentDisplayed:"Le contenu du fichier est affiché dans la vue diff ci-dessus"},el={title:"Invite interactive",waiting:"En attente de votre réponse dans le CLI",instruction:"Veuillez sélectionner une option dans votre terminal où Claude s'exécute.",selectedOption:"✓ Claude a sélectionné l'option {{number}}",instructionDetail:"Dans le CLI, vous sélectionneriez cette option de manière interactive avec les touches fléchées ou en tapant le numéro."},tl={title:"Réflexion...",emoji:"💭 Réflexion..."},nl={response:"Réponse JSON"},sl={grant:"Autoriser {{tool}}",added:"Permission ajoutée",addTo:"Ajoute {{entry}} aux outils autorisés.",retry:"Permission enregistrée. Relancez la requête pour utiliser l'outil.",error:"Impossible de mettre à jour les permissions. Veuillez réessayer.",openSettings:"Ouvrir les paramètres"},il={updated:"La liste de tâches a été mise à jour avec succès",current:"Liste de tâches actuelle"},al={viewPlan:"📋 Voir le plan d'implémentation",title:"Plan d'implémentation"},ol={resetAt:"Limite d'utilisation Claude atteinte. Votre limite sera réinitialisée à **{{time}} {{timezone}}** - {{date}}"},rl={permissionMode:"Mode de permission",modes:{default:"Mode par défaut",auto:"Mode automatique",acceptEdits:"Accepter les modifications",bypassPermissions:"Contourner les permissions",plan:"Mode planification"},descriptions:{default:"Seules les commandes de confiance (ls, cat, grep, git status, etc.) s'exécutent automatiquement. Les autres commandes sont ignorées. Peut écrire dans l'espace de travail.",auto:"Un classifieur de modèle décide pour chaque appel d'outil d'approuver ou refuser. Mode mains libres, mais plus sûr que le contournement — des refus peuvent toujours se produire.",acceptEdits:"Toutes les commandes s'exécutent automatiquement dans l'espace de travail. Mode entièrement automatique avec exécution sandboxée.",bypassPermissions:"Accès système complet sans restrictions. Toutes les commandes s'exécutent automatiquement avec accès disque et réseau complet. À utiliser avec précaution.",plan:"Mode planification - aucune commande n'est exécutée"},technicalDetails:"Détails techniques"},ll={placeholder:"Tapez / pour les commandes, @ pour les fichiers, ou posez une question à {{provider}}...",placeholderDefault:"Tapez votre message...",disabled:"Saisie désactivée",attachFiles:"Joindre des fichiers",attachImages:"Joindre des images",send:"Envoyer",stop:"Arrêter",hintText:{ctrlEnter:"Ctrl+Entrée pour envoyer • Maj+Entrée pour nouvelle ligne • Tab pour changer de mode • / pour les commandes slash",enter:"Entrée pour envoyer • Maj+Entrée pour nouvelle ligne • Tab pour changer de mode • / pour les commandes slash"},clickToChangeMode:"Cliquez pour changer le mode de permission (ou appuyez sur Tab dans la saisie)",showAllCommands:"Afficher toutes les commandes",clearInput:"Effacer la saisie",scrollToBottom:"Défiler vers le bas"},cl={title:"Choisissez votre assistant IA",description:"Sélectionnez un fournisseur pour démarrer une nouvelle conversation",selectModel:"Sélectionner un modèle",providerInfo:{anthropic:"par Anthropic",openai:"par OpenAI",cursorEditor:"Éditeur de code IA",google:"par Google"},readyPrompt:{claude:"Prêt à utiliser Claude avec {{model}}. Commencez à taper votre message ci-dessous.",cursor:"Prêt à utiliser Cursor avec {{model}}. Commencez à taper votre message ci-dessous.",codex:"Prêt à utiliser Codex avec {{model}}. Commencez à taper votre message ci-dessous.",opencode:"Prêt à utiliser OpenCode avec {{model}}. Commencez à taper votre message ci-dessous.",default:"Sélectionnez un fournisseur ci-dessus pour commencer"},pressToSearch:"Appuyez sur <kbd>{{shortcut}}</kbd> pour rechercher sessions, fichiers et commits"},dl={continue:{title:"Continuer votre conversation",description:"Posez des questions sur votre code, demandez des modifications ou obtenez de l'aide pour vos tâches de développement"},loading:{olderMessages:"Chargement des messages précédents...",sessionMessages:"Chargement des messages de la session..."},messages:{showingOf:"Affichage de {{shown}} sur {{total}} messages",scrollToLoad:"Faites défiler vers le haut pour charger plus",showingLast:"Affichage des {{count}} derniers messages ({{total}} au total)",loadEarlier:"Charger les messages précédents",loadAll:"Charger tous les messages",loadingAll:"Chargement de tous les messages...",allLoaded:"Tous les messages chargés",perfWarning:"Tous les messages chargés — le défilement peut être plus lent. Cliquez sur « Défiler vers le bas » pour rétablir les performances."}},ul={selectProject:{title:"Sélectionner un projet",description:"Choisissez un projet pour ouvrir un shell interactif dans ce répertoire"},status:{newSession:"Nouvelle session",initializing:"Initialisation...",restarting:"Redémarrage..."},actions:{disconnect:"Déconnecter",disconnectTitle:"Se déconnecter du shell",restart:"Redémarrer",restartTitle:"Redémarrer le shell",connect:"Continuer dans le shell",connectTitle:"Se connecter au shell"},loading:"Chargement du terminal...",connecting:"Connexion au shell...",startSession:"Démarrer une nouvelle session Claude",resumeSession:"Reprendre la session : {{displayName}}...",runCommand:"Exécuter {{command}} dans {{projectName}}",startCli:"Démarrage du CLI Claude dans {{projectName}}",defaultCommand:"commande"},pl={actions:{thinking:"Réflexion",processing:"Traitement",analyzing:"Analyse",working:"Travail",computing:"Calcul",reasoning:"Raisonnement"},state:{live:"En direct",paused:"En pause"},elapsed:{seconds:"{{count}}s",minutesSeconds:"{{minutes}}m {{seconds}}s",label:"{{time}} écoulé",startingNow:"Démarrage"},controls:{stopGeneration:"Arrêter la génération",pressEscToStop:"Appuyez sur Échap à tout moment pour arrêter"},providers:{assistant:"Assistant"}},ml={startChatWithProvider:"Sélectionnez un projet pour commencer à chatter avec {{provider}}"},gl={nextTaskPrompt:"Commencer la prochaine tâche"},hl={codeBlock:_r,copyMessage:Yr,messageTypes:Jr,tools:Qr,search:Zr,fileOperations:Xr,interactive:el,thinking:tl,json:nl,permissions:sl,todo:il,plan:al,usageLimit:ol,codex:rl,input:ll,providerSelection:cl,session:dl,shell:ul,claudeStatus:pl,projectSelection:ml,tasks:gl},fl={changes:"modifications",previousChange:"Modification précédente",nextChange:"Modification suivante",hideDiff:"Masquer la mise en évidence des différences",showDiff:"Afficher la mise en évidence des différences",settings:"Paramètres de l'éditeur",collapse:"Réduire l'éditeur",expand:"Étendre l'éditeur en pleine largeur"},bl="Chargement de {{fileName}}...",vl={showingChanges:"Affichage des modifications"},kl={copyPath:"Copier le chemin du fichier",pathCopied:"Chemin du fichier copié",download:"Télécharger le fichier",save:"Enregistrer",saving:"Enregistrement...",saved:"Enregistré !",exitFullscreen:"Quitter le plein écran",fullscreen:"Plein écran",close:"Fermer",previewMarkdown:"Aperçu markdown",editMarkdown:"Modifier le markdown"},xl={lines:"Lignes :",characters:"Caractères :",shortcuts:"Ctrl+S pour enregistrer • Échap pour fermer"},yl={title:"Fichier binaire",message:`Le fichier "{{fileName}}" ne peut pas être affiché dans l'éditeur de texte car c'est un fichier binaire.`},wl={toolbar:fl,loading:bl,header:vl,actions:kl,footer:xl,binaryFile:yl},Cl={title:"TaskMaster AI n'est pas configuré",description:"TaskMaster aide à décomposer des projets complexes en tâches gérables avec une assistance IA",whatIsTitle:"🎯 Qu'est-ce que TaskMaster ?",features:{aiPowered:"Gestion des tâches assistée par IA : Décomposez des projets complexes en sous-tâches gérables",prdTemplates:"Modèles PRD : Générez des tâches à partir de documents d'exigences produit",dependencyTracking:"Suivi des dépendances : Comprenez les relations entre tâches et l'ordre d'exécution",progressVisualization:"Visualisation de l'avancement : Tableaux Kanban et analyses détaillées des tâches",cliIntegration:"Intégration CLI : Utilisez les commandes taskmaster pour des flux de travail avancés"},initializeButton:"Initialiser TaskMaster AI"},Sl={title:"Démarrer avec TaskMaster",subtitle:"TaskMaster est initialisé ! Voici la suite :",steps:{createPRD:{title:"Créer un document d'exigences produit (PRD)",description:"Discutez de votre idée de projet et créez un PRD décrivant ce que vous voulez construire.",addButton:"Ajouter un PRD",existingPRDs:"PRDs existants :"},generateTasks:{title:"Générer des tâches à partir du PRD",description:"Une fois votre PRD prêt, demandez à votre assistant IA de l'analyser et TaskMaster le décomposera automatiquement en tâches gérables avec des détails d'implémentation."},analyzeTasks:{title:"Analyser et développer les tâches",description:"Demandez à votre assistant IA d'analyser la complexité des tâches et de les développer en sous-tâches détaillées pour une implémentation plus facile."},startBuilding:{title:"Commencer à construire",description:"Demandez à votre assistant IA de commencer à travailler sur les tâches, mettre à jour leur statut et ajouter de nouvelles tâches au fur et à mesure."}},tip:"💡 Astuce : Commencez par un PRD pour tirer le meilleur parti de la génération de tâches IA de TaskMaster"},Pl={title:"Configuration TaskMaster",subtitle:"CLI interactif pour {{projectName}}",willStart:"L'initialisation de TaskMaster démarrera automatiquement",completed:"Configuration TaskMaster terminée ! Vous pouvez fermer cette fenêtre.",closeButton:"Fermer",closeContinueButton:"Fermer et continuer"},Al={title:"Démarrer avec TaskMaster",subtitle:"Votre guide pour une gestion productive des tâches",examples:{parsePRD:`💬 Exemple :