@axhub/genie 0.1.2 → 0.1.4

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.
@@ -1213,7 +1213,7 @@ File: ${e?.name||"New PRD"}
1213
1213
  Path: ${e?.path||"Not saved yet"}
1214
1214
 
1215
1215
  ${F}`)}finally{d(!1)}})()},[e,r,s]),b.useEffect(()=>{(async()=>{if(!n?.name){console.log("No project name available:",n);return}try{console.log("Fetching PRDs for project:",n.name);const K=await bt.get(`/taskmaster/prd/${encodeURIComponent(n.name)}`);if(K.ok){const pe=await K.json();console.log("Fetched existing PRDs:",pe.prds),P(pe.prds||[])}else console.log("Failed to fetch PRDs:",K.status,K.statusText)}catch(K){console.error("Error fetching existing PRDs:",K)}})()},[n?.name]);const $=async()=>{if(!l.trim()){alert("Please add content before saving.");return}if(!C.trim()){alert("Please provide a filename for the PRD.");return}const R=C.endsWith(".txt")||C.endsWith(".md")?C:`${C}.txt`,K=D.find(pe=>pe.name===R);if(console.log("Save check:",{fullFileName:R,existingPRDs:D,existingFile:K,isExisting:e?.isExisting,fileObject:e,shouldShowModal:K&&!e?.isExisting}),K&&!e?.isExisting){console.log("Showing overwrite confirmation modal"),V(!0);return}await H()},H=async()=>{h(!0);try{const R=C.endsWith(".txt")||C.endsWith(".md")?C:`${C}.txt`,K=await Ae(`/api/taskmaster/prd/${encodeURIComponent(n?.name)}`,{method:"POST",body:JSON.stringify({fileName:R,content:l})});if(!K.ok){const ve=await K.json();throw new Error(ve.message||`Save failed: ${K.status}`)}v(!0),setTimeout(()=>v(!1),2e3);const pe=await bt.get(`/taskmaster/prd/${encodeURIComponent(n.name)}`);if(pe.ok){const ve=await pe.json();P(ve.prds||[])}o&&await o()}catch(R){console.error("Error saving PRD:",R),alert(`Error saving PRD: ${R.message}`)}finally{h(!1)}},ne=()=>{const R=new Blob([l],{type:"text/markdown"}),K=URL.createObjectURL(R),pe=document.createElement("a");pe.href=K;const ve=C?`${C}.txt`:"prd.txt";pe.download=ve,document.body.appendChild(pe),pe.click(),document.body.removeChild(pe),URL.revokeObjectURL(K)},N=async()=>{if(!l.trim()){alert("Please add content to the PRD before generating tasks.");return}j(!0)},z=()=>{g(!m)};b.useEffect(()=>{const R=K=>{(K.ctrlKey||K.metaKey)&&(K.key==="s"?(K.preventDefault(),$()):K.key==="Escape"&&(K.preventDefault(),t()))};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[l]);const re=R=>R.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*)\*\*/gim,"<strong>$1</strong>").replace(/\*(.*)\*/gim,"<em>$1</em>").replace(/^\- (.*$)/gim,"<li>$1</li>").replace(/(<li>.*<\/li>)/gims,"<ul>$1</ul>").replace(/\n\n/gim,"</p><p>").replace(/^(?!<[h|u|l])(.*$)/gim,"<p>$1</p>").replace(/<\/ul>\s*<ul>/gim,"");return u?i.jsx("div",{className:"fixed inset-0 z-[200] md:bg-black/50 md:flex md:items-center md:justify-center",children:i.jsx("div",{className:"w-full h-full md:rounded-lg md:w-auto md:h-auto p-8 flex items-center justify-center bg-white dark:bg-gray-900",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-600"}),i.jsx("span",{className:"text-gray-900 dark:text-white",children:"Loading PRD..."})]})})}):i.jsxs("div",{className:`fixed inset-0 z-[200] md:bg-black/50 md:flex md:items-center md:justify-center md:p-4 ${m?"md:p-0":""}`,children:[i.jsxs("div",{className:Je("bg-white dark:bg-gray-900 shadow-2xl flex flex-col","w-full h-full md:rounded-lg md:shadow-2xl",m?"md:w-full md:h-full md:rounded-none":"md:w-full md:max-w-6xl md:h-[85vh] md:max-h-[85vh]"),children:[i.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700 flex-shrink-0 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[i.jsx("div",{className:"w-8 h-8 bg-purple-600 rounded flex items-center justify-center flex-shrink-0",children:i.jsx(zr,{className:"w-4 h-4 text-white"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center min-w-0 flex-1 bg-gray-50 dark:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-md px-3 py-2 focus-within:ring-2 focus-within:ring-purple-500 focus-within:border-purple-500 dark:focus-within:ring-purple-400 dark:focus-within:border-purple-400",children:[i.jsx("input",{type:"text",value:C,onChange:R=>{const K=R.target.value.replace(/[<>:"/\\|?*]/g,"");M(K)},className:"font-medium text-gray-900 dark:text-white bg-transparent border-none outline-none min-w-0 flex-1 text-base sm:text-sm placeholder-gray-400 dark:placeholder-gray-500",placeholder:"Enter PRD filename",maxLength:100}),i.jsx("span",{className:"text-sm sm:text-xs text-gray-500 dark:text-gray-400 whitespace-nowrap ml-1",children:".txt"})]}),i.jsx("button",{onClick:()=>document.querySelector('input[placeholder="Enter PRD filename"]')?.focus(),className:"p-1 text-gray-400 hover:text-purple-600 dark:hover:text-purple-400 transition-colors",title:"Click to edit filename",children:i.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})})})]}),i.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[i.jsx("span",{className:"text-xs bg-purple-100 dark:bg-purple-900 text-purple-600 dark:text-purple-300 px-2 py-1 rounded whitespace-nowrap",children:"📋 PRD"}),s&&i.jsx("span",{className:"text-xs bg-green-100 dark:bg-green-900 text-green-600 dark:text-green-300 px-2 py-1 rounded whitespace-nowrap",children:"✨ New"})]})]}),i.jsx("p",{className:"text-xs sm:text-sm text-gray-500 dark:text-gray-400 truncate mt-1",children:"Product Requirements Document"})]})]}),i.jsxs("div",{className:"flex items-center gap-1 md:gap-2 flex-shrink-0",children:[i.jsx("button",{onClick:()=>A(!w),className:Je("p-2 md:p-2 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800","min-w-[44px] min-h-[44px] md:min-w-0 md:min-h-0 flex items-center justify-center",w?"text-purple-600 dark:text-purple-400 bg-purple-50 dark:bg-purple-900":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white"),title:w?"Switch to edit mode":"Preview markdown",children:i.jsx(Ai,{className:"w-5 h-5 md:w-4 md:h-4"})}),i.jsx("button",{onClick:()=>E(!I),className:Je("p-2 md:p-2 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800","min-w-[44px] min-h-[44px] md:min-w-0 md:min-h-0 flex items-center justify-center",I?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white"),title:I?"Disable word wrap":"Enable word wrap",children:i.jsx("span",{className:"text-sm md:text-xs font-mono font-bold",children:"↵"})}),i.jsx("button",{onClick:()=>k(!f),className:"p-2 md:p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 min-w-[44px] min-h-[44px] md:min-w-0 md:min-h-0 flex items-center justify-center",title:"Toggle theme",children:i.jsx("span",{className:"text-lg md:text-base",children:f?"☀️":"🌙"})}),i.jsx("button",{onClick:ne,className:"p-2 md:p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 min-w-[44px] min-h-[44px] md:min-w-0 md:min-h-0 flex items-center justify-center",title:"Download PRD",children:i.jsx(yo,{className:"w-5 h-5 md:w-4 md:h-4"})}),i.jsxs("button",{onClick:N,disabled:!l.trim(),className:Je("px-3 py-2 rounded-md disabled:opacity-50 flex items-center gap-2 transition-colors text-sm font-medium","bg-purple-600 hover:bg-purple-700 text-white","min-h-[44px] md:min-h-0"),title:"Generate tasks from PRD content",children:[i.jsx(Wn,{className:"w-4 h-4"}),i.jsx("span",{className:"hidden md:inline",children:"Generate Tasks"})]}),i.jsx("button",{onClick:$,disabled:p,className:Je("px-3 py-2 text-white rounded-md disabled:opacity-50 flex items-center gap-2 transition-colors","min-h-[44px] md:min-h-0",S?"bg-green-600 hover:bg-green-700":"bg-purple-600 hover:bg-purple-700"),children:S?i.jsxs(i.Fragment,{children:[i.jsx("svg",{className:"w-5 h-5 md:w-4 md:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),i.jsx("span",{className:"hidden sm:inline",children:"Saved!"})]}):i.jsxs(i.Fragment,{children:[i.jsx(wo,{className:"w-5 h-5 md:w-4 md:h-4"}),i.jsx("span",{className:"hidden sm:inline",children:p?"Saving...":"Save PRD"})]})}),i.jsx("button",{onClick:z,className:"hidden md:flex p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 items-center justify-center",title:m?"Exit fullscreen":"Fullscreen",children:m?i.jsx(eS,{className:"w-4 h-4"}):i.jsx(gg,{className:"w-4 h-4"})}),i.jsx("button",{onClick:t,className:"p-2 md:p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 min-w-[44px] min-h-[44px] md:min-w-0 md:min-h-0 flex items-center justify-center",title:"Close",children:i.jsx($t,{className:"w-6 h-6 md:w-4 md:h-4"})})]})]}),i.jsx("div",{className:"flex-1 overflow-hidden",children:w?i.jsx("div",{className:"h-full overflow-y-auto p-6 prose prose-gray dark:prose-invert max-w-none",children:i.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:re(l)}})}):i.jsx(G4,{ref:B,value:l,onChange:c,extensions:[W4(),...I?[sn.lineWrapping]:[]],theme:f?H4:void 0,height:"100%",style:{fontSize:"14px",height:"100%"},basicSetup:{lineNumbers:!0,foldGutter:!0,dropCursor:!1,allowMultipleSelections:!1,indentOnInput:!0,bracketMatching:!0,closeBrackets:!0,autocompletion:!0,highlightSelectionMatches:!0,searchKeymap:!0}})}),i.jsxs("div",{className:"flex items-center justify-between p-3 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800 flex-shrink-0",children:[i.jsxs("div",{className:"flex items-center gap-4 text-sm text-gray-600 dark:text-gray-400",children:[i.jsxs("span",{children:["Lines: ",l.split(`
1216
- `).length]}),i.jsxs("span",{children:["Characters: ",l.length]}),i.jsxs("span",{children:["Words: ",l.split(/\s+/).filter(R=>R.length>0).length]}),i.jsx("span",{children:"Format: Markdown"})]}),i.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Press Ctrl+S to save • Esc to close"})]})]}),O&&i.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:i.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl w-full max-w-md border border-gray-200 dark:border-gray-700",children:[i.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-8 h-8 bg-purple-100 dark:bg-purple-900/50 rounded-lg flex items-center justify-center",children:i.jsx(Wn,{className:"w-4 h-4 text-purple-600 dark:text-purple-400"})}),i.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Generate Tasks from PRD"})]}),i.jsx("button",{onClick:()=>j(!1),className:"p-2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700",children:i.jsx($t,{className:"w-5 h-5"})})]}),i.jsxs("div",{className:"p-6 space-y-4",children:[i.jsx("div",{className:"bg-purple-50 dark:bg-purple-900/20 rounded-lg p-4 border border-purple-200 dark:border-purple-800",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:"w-8 h-8 bg-purple-100 dark:bg-purple-900/50 rounded-lg flex items-center justify-center flex-shrink-0 mt-0.5",children:i.jsx(Wn,{className:"w-4 h-4 text-purple-600 dark:text-purple-400"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h4",{className:"font-semibold text-purple-900 dark:text-purple-100 mb-2",children:"💡 Pro Tip: Ask Claude Code Directly!"}),i.jsx("p",{className:"text-sm text-purple-800 dark:text-purple-200 mb-3",children:"You can simply ask Claude Code in the chat to parse your PRD and generate tasks. The AI assistant will automatically save your PRD and create detailed tasks with implementation details."}),i.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded border border-purple-200 dark:border-purple-700 p-3 mb-3",children:[i.jsx("p",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:"💬 Example:"}),i.jsxs("p",{className:"text-xs text-gray-900 dark:text-white font-mono",children:[`"I've just initialized a new project with Claude Task Master. I have a PRD at .taskmaster/docs/`,C.endsWith(".txt")||C.endsWith(".md")?C:`${C}.txt`,'. Can you help me parse it and set up the initial tasks?"']})]}),i.jsxs("p",{className:"text-xs text-purple-700 dark:text-purple-300",children:[i.jsx("strong",{children:"This will:"})," Save your PRD, analyze its content, and generate structured tasks with subtasks, dependencies, and implementation details."]})]})]})}),i.jsxs("div",{className:"text-center pt-4 border-t border-gray-200 dark:border-gray-700",children:[i.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-3",children:"For more examples and advanced usage patterns:"}),i.jsx("a",{href:"https://github.com/eyaltoledano/claude-task-master/blob/main/docs/examples.md",target:"_blank",rel:"noopener noreferrer",className:"inline-block text-sm text-purple-600 dark:text-purple-400 hover:text-purple-700 dark:hover:text-purple-300 underline font-medium",children:"View TaskMaster Documentation →"})]}),i.jsx("div",{className:"pt-4",children:i.jsx("button",{onClick:()=>j(!1),className:"w-full px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-600 transition-colors",children:"Got it, I'll ask Claude Code directly"})})]})]})}),G&&i.jsxs("div",{className:"fixed inset-0 z-[300] flex items-center justify-center p-4",children:[i.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50",onClick:()=>V(!1)}),i.jsx("div",{className:"relative bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-md w-full border border-gray-200 dark:border-gray-700",children:i.jsxs("div",{className:"p-6",children:[i.jsxs("div",{className:"flex items-center mb-4",children:[i.jsx("div",{className:"p-2 rounded-full mr-3 bg-yellow-100 dark:bg-yellow-900",children:i.jsx(Yn,{className:"w-5 h-5 text-yellow-600 dark:text-yellow-400"})}),i.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"File Already Exists"})]}),i.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:['A PRD file named "',C.endsWith(".txt")||C.endsWith(".md")?C:`${C}.txt`,'" already exists. Do you want to overwrite it with the current content?']}),i.jsxs("div",{className:"flex justify-end space-x-3",children:[i.jsx("button",{onClick:()=>V(!1),className:"px-4 py-2 text-sm text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md hover:bg-gray-50 dark:hover:bg-gray-600 transition-colors",children:"Cancel"}),i.jsxs("button",{onClick:async()=>{V(!1),await H()},className:"px-4 py-2 text-sm text-white bg-yellow-600 hover:bg-yellow-700 rounded-md flex items-center space-x-2 transition-colors",children:[i.jsx(wo,{className:"w-4 h-4"}),i.jsx("span",{children:"Overwrite"})]})]})]})})]})]})};function LH({selectedProject:e,selectedSession:t,activeTab:r,setActiveTab:n,ws:a,sendMessage:s,latestMessage:o,isMobile:l,isPWA:c,onMenuClick:u,isLoading:d,onInputFocusChange:p,onSessionActive:h,onSessionInactive:m,onSessionProcessing:g,onSessionNotProcessing:f,processingSessions:k,onReplaceTemporarySession:S,onNavigateToSession:v,onShowSettings:w,autoExpandTools:A,showRawParameters:I,showThinking:E,autoScrollToBottom:C,sendByCtrlEnter:M,externalMessageUpdate:O,urlProvider:j,urlModel:G,urlContext:V,urlPrompt:D,onShowNewProject:P,onNewSession:B}){const{t:F}=Kt(),[$,H]=b.useState(null),[ne,N]=b.useState(null),[z,re]=b.useState(!1),[R,K]=b.useState(600),[pe,ve]=b.useState(!1),[oe,Ie]=b.useState(!1),ce=b.useRef(null),[ye,_e]=b.useState(!1),[qe,Ke]=b.useState(null),[xt,dt]=b.useState([]),[St,ft]=b.useState(null),{tasks:pt,currentProject:Le,refreshTasks:et,setCurrentProject:yt}=ys(),{tasksEnabled:be,isTaskMasterInstalled:Ge,isTaskMasterReady:he}=Wo(),Ee=be&&Ge;b.useEffect(()=>{e&&e!==Le&&yt(e)},[e,Le,yt]),b.useEffect(()=>{!Ee&&r==="tasks"&&n("chat")},[Ee,r,n]),b.useEffect(()=>{(async()=>{if(!Le?.name){dt([]);return}try{const Xe=await bt.get(`/taskmaster/prd/${encodeURIComponent(Le.name)}`);if(Xe.ok){const ht=await Xe.json();dt(ht.prdFiles||[])}else dt([])}catch(Xe){console.error("Failed to load existing PRDs:",Xe),dt([])}})()},[Le?.name]);const J=(Ve,Xe=null)=>{const ht={name:Ve.split("/").pop(),path:Ve,projectName:e?.name,diffInfo:Xe};H(ht)},ie=()=>{H(null),Ie(!1)},fe=()=>{Ie(!oe)},De=Ve=>{if(typeof Ve=="object"&&Ve.id&&!Ve.title){const Xe=pt?.find(ht=>ht.id===Ve.id);Xe&&(N(Xe),re(!0))}else N(Ve),re(!0)},Ye=()=>{re(!1),N(null)},mt=(Ve,Xe)=>{console.log("Update task status:",Ve,Xe),et?.()},tt=Ve=>{l||(ve(!0),Ve.preventDefault())};if(b.useEffect(()=>{const Ve=ht=>{if(!pe)return;const Gt=ce.current?.parentElement;if(!Gt)return;const Ft=Gt.getBoundingClientRect(),Lt=Ft.right-ht.clientX,qt=300,ar=Ft.width*.8;Lt>=qt&&Lt<=ar&&K(Lt)},Xe=()=>{ve(!1)};return pe&&(document.addEventListener("mousemove",Ve),document.addEventListener("mouseup",Xe),document.body.style.cursor="col-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",Ve),document.removeEventListener("mouseup",Xe),document.body.style.cursor="",document.body.style.userSelect=""}},[pe]),d)return i.jsxs("div",{className:"h-full flex flex-col",children:[l&&i.jsx("div",{className:"bg-background border-b border-border p-2 sm:p-3 pwa-header-safe flex-shrink-0",children:i.jsx("button",{onClick:u,className:"p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 pwa-menu-button",children:i.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})}),i.jsx("div",{className:"flex-1 flex items-center justify-center",children:i.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[i.jsx("div",{className:"w-12 h-12 mx-auto mb-4",children:i.jsx("div",{className:"w-full h-full rounded-full border-4 border-gray-200 border-t-blue-500",style:{animation:"spin 1s linear infinite",WebkitAnimation:"spin 1s linear infinite",MozAnimation:"spin 1s linear infinite"}})}),i.jsx("h2",{className:"text-xl font-semibold mb-2",children:F("mainContent.loading")}),i.jsx("p",{children:F("mainContent.settingUpWorkspace")})]})})]});if(!e)return i.jsxs("div",{className:"h-full flex flex-col",children:[l&&i.jsx("div",{className:"bg-background border-b border-border p-2 sm:p-3 pwa-header-safe flex-shrink-0",children:i.jsx("button",{onClick:u,className:"p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 pwa-menu-button",children:i.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})}),i.jsxs("div",{className:"flex-1 flex items-center justify-center",children:[i.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400 max-w-md mx-auto px-6",children:[i.jsx("div",{className:"w-16 h-16 mx-auto mb-6 bg-gray-100 dark:bg-gray-800 rounded-full flex items-center justify-center",children:i.jsx("svg",{className:"w-8 h-8 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-5l-2-2H5a2 2 0 00-2 2z"})})}),i.jsx("h2",{className:"text-2xl font-semibold mb-3 text-gray-900 dark:text-white",children:F("mainContent.chooseProject")}),i.jsx("p",{className:"text-gray-600 dark:text-gray-300 mb-6 leading-relaxed",children:F("mainContent.selectProjectDescription")}),i.jsx("div",{className:"bg-blue-50 dark:bg-blue-900/20 rounded-lg p-4 border border-blue-200 dark:border-blue-800",children:i.jsxs("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:["💡 ",i.jsxs("strong",{children:[F("mainContent.tip"),":"]})," ",F(l?"mainContent.createProjectMobile":"mainContent.createProjectDesktop")]})})]}),i.jsx("button",{onClick:P,className:"p-2 text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md transition-colors",title:F("tooltips.createProject")||"New Chat",children:i.jsx(gi,{className:"w-5 h-5"})})]})]});const jt=t?.__provider||t?.provider||"claude",$e=jt==="openai"?"codex":jt,_t=$e==="codex"&&typeof t?.id=="string"?t.id.trim():"",vt=_t?`codex://threads/${encodeURIComponent(_t)}`:"",ut=()=>{vt&&(window.location.href=vt)};return i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsx("div",{className:"bg-background border-b border-border p-2 sm:p-3 pwa-header-safe flex-shrink-0",children:i.jsxs("div",{className:"flex items-center justify-between relative",children:[i.jsxs("div",{className:"flex items-center space-x-2 min-w-0 flex-1",children:[l&&i.jsx("button",{onClick:u,onTouchStart:Ve=>{Ve.preventDefault(),u()},className:"p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 touch-manipulation active:scale-95 pwa-menu-button flex-shrink-0",children:i.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),i.jsxs("div",{className:"min-w-0 flex items-center gap-2 flex-1 overflow-x-auto scrollbar-hide",children:[r==="chat"&&t&&i.jsx("div",{className:"w-5 h-5 flex-shrink-0 flex items-center justify-center",children:$e==="cursor"?i.jsx(Xn,{className:"w-4 h-4"}):$e==="codex"?i.jsx(Zn,{className:"w-4 h-4"}):i.jsx(In,{className:"w-4 h-4"})}),i.jsx("div",{className:"min-w-0 flex-1",children:r==="chat"&&t?i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-sm sm:text-base font-semibold text-gray-900 dark:text-white whitespace-nowrap overflow-x-auto scrollbar-hide",children:$e==="cursor"?t.name||"Untitled Session":$e==="codex"?t.summary||t.name||"Codex Session":t.summary||"New Session"}),i.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:e.displayName})]}):r==="chat"&&!t?i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-sm sm:text-base font-semibold text-gray-900 dark:text-white",children:F("mainContent.newSession")}),i.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:e.displayName})]}):i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-sm sm:text-base font-semibold text-gray-900 dark:text-white",children:r==="files"?F("mainContent.projectFiles"):r==="git"?F("tabs.git"):r==="tasks"&&Ee?"TaskMaster":"Project"}),i.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:e.displayName})]})})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[r==="chat"&&$e==="codex"&&vt&&i.jsx("button",{onClick:ut,className:"p-1.5 text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md transition-colors",title:F("mainContent.openInCodexClient"),"aria-label":F("mainContent.openInCodexClient"),children:i.jsx(ch,{className:"w-5 h-5"})}),i.jsx("button",{onClick:()=>B&&B(e),className:"p-1.5 text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md transition-colors",title:F("tooltips.newChat","New Chat"),children:i.jsx(h6,{className:"w-5 h-5"})}),i.jsx("div",{className:"flex-shrink-0 hidden sm:block",children:i.jsxs("div",{className:"relative flex bg-gray-100 dark:bg-gray-800 rounded-lg p-1",children:[i.jsx(Nr,{content:F("tabs.chat"),position:"bottom",children:i.jsx("button",{onClick:()=>n("chat"),className:`relative px-2 sm:px-3 py-1.5 text-xs sm:text-sm font-medium rounded-md ${r==="chat"?"bg-white dark:bg-gray-700 text-gray-900 dark:text-white shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:i.jsxs("span",{className:"flex items-center gap-1 sm:gap-1.5",children:[i.jsx("svg",{className:"w-3 sm:w-3.5 h-3 sm:h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),i.jsx("span",{className:"hidden md:hidden lg:inline",children:F("tabs.chat")})]})})}),i.jsx(Nr,{content:F("tabs.files"),position:"bottom",children:i.jsx("button",{onClick:()=>n("files"),className:`relative px-2 sm:px-3 py-1.5 text-xs sm:text-sm font-medium rounded-md transition-all duration-200 ${r==="files"?"bg-white dark:bg-gray-700 text-gray-900 dark:text-white shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:i.jsxs("span",{className:"flex items-center gap-1 sm:gap-1.5",children:[i.jsx("svg",{className:"w-3 sm:w-3.5 h-3 sm:h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-5l-2-2H5a2 2 0 00-2 2z"})}),i.jsx("span",{className:"hidden md:hidden lg:inline",children:F("tabs.files")})]})})}),Ee&&i.jsx(Nr,{content:F("tabs.tasks"),position:"bottom",children:i.jsx("button",{onClick:()=>n("tasks"),className:`relative px-2 sm:px-3 py-1.5 text-xs sm:text-sm font-medium rounded-md transition-all duration-200 ${r==="tasks"?"bg-white dark:bg-gray-700 text-gray-900 dark:text-white shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:i.jsxs("span",{className:"flex items-center gap-1 sm:gap-1.5",children:[i.jsx("svg",{className:"w-3 sm:w-3.5 h-3 sm:h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})}),i.jsx("span",{className:"hidden md:hidden lg:inline",children:F("tabs.tasks")})]})})})]})})]})]})}),i.jsxs("div",{className:"flex-1 flex min-h-0 overflow-hidden",children:[i.jsxs("div",{className:`flex-1 flex flex-col min-h-0 overflow-hidden ${$?"mr-0":""} ${oe?"hidden":""}`,children:[i.jsx("div",{className:`h-full ${r==="chat"?"block":"hidden"}`,children:i.jsx(IH,{showDetails:!0,children:i.jsx(DG,{selectedProject:e,selectedSession:t,ws:a,sendMessage:s,latestMessage:o,onFileOpen:J,onInputFocusChange:p,onSessionActive:h,onSessionInactive:m,onSessionProcessing:g,onSessionNotProcessing:f,processingSessions:k,onReplaceTemporarySession:S,onNavigateToSession:v,onShowSettings:w,autoExpandTools:A,showRawParameters:I,showThinking:E,autoScrollToBottom:C,sendByCtrlEnter:M,externalMessageUpdate:O,urlProvider:j,urlModel:G,urlContext:V,urlPrompt:D,onShowAllTasks:be?()=>n("tasks"):null})})}),r==="files"&&i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(NH,{selectedProject:e})}),r==="shell"&&i.jsx("div",{className:"h-full w-full overflow-hidden",children:i.jsx(H3,{project:e,session:t,showHeader:!1})}),r==="git"&&i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(AH,{selectedProject:e,isMobile:l,onFileOpen:J})}),Ee&&i.jsx("div",{className:`h-full ${r==="tasks"?"block":"hidden"}`,children:i.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:i.jsx(jH,{tasks:pt||[],onTaskClick:De,showParentTasks:!0,className:"flex-1 overflow-y-auto p-4",currentProject:Le,onTaskCreated:et,onShowPRDEditor:(Ve=null)=>{Ke(Ve),_e(!0)},existingPRDs:xt,onRefreshPRDs:(Ve=!1)=>{Le?.name&&bt.get(`/taskmaster/prd/${encodeURIComponent(Le.name)}`).then(Xe=>Xe.ok?Xe.json():Promise.reject()).then(Xe=>{dt(Xe.prdFiles||[]),Ve&&(ft("PRD saved successfully!"),setTimeout(()=>ft(null),3e3))}).catch(Xe=>console.error("Failed to refresh PRDs:",Xe))}})})}),i.jsx("div",{className:`h-full overflow-hidden ${r==="preview"?"block":"hidden"}`})]}),$&&!l&&i.jsxs(i.Fragment,{children:[!oe&&i.jsx("div",{ref:ce,onMouseDown:tt,className:"flex-shrink-0 w-1 bg-gray-200 dark:bg-gray-700 hover:bg-blue-500 dark:hover:bg-blue-600 cursor-col-resize transition-colors relative group",title:"Drag to resize",children:i.jsx("div",{className:"absolute inset-y-0 left-1/2 -translate-x-1/2 w-1 bg-blue-500 dark:bg-blue-600 opacity-0 group-hover:opacity-100 transition-opacity"})}),i.jsx("div",{className:`flex-shrink-0 border-l border-gray-200 dark:border-gray-700 h-full overflow-hidden ${oe?"flex-1":""}`,style:oe?{}:{width:`${R}px`},children:i.jsx(sg,{file:$,onClose:ie,projectPath:e?.path,isSidebar:!0,isExpanded:oe,onToggleExpand:fe})})]})]}),$&&l&&i.jsx(sg,{file:$,onClose:ie,projectPath:e?.path,isSidebar:!1}),Ee&&z&&ne&&i.jsx(m3,{task:ne,isOpen:z,onClose:Ye,onStatusChange:mt,onTaskClick:De}),ye&&i.jsx(_H,{project:Le,projectPath:Le?.fullPath||Le?.path,onClose:()=>{_e(!1),Ke(null)},isNewFile:!qe?.isExisting,file:{name:qe?.name||"prd.txt",content:qe?.content||""},onSave:async()=>{_e(!1),Ke(null);try{const Ve=await bt.get(`/taskmaster/prd/${encodeURIComponent(Le.name)}`);if(Ve.ok){const Xe=await Ve.json();dt(Xe.prdFiles||[]),ft("PRD saved successfully!"),setTimeout(()=>ft(null),3e3)}}catch(Ve){console.error("Failed to refresh PRDs:",Ve)}et?.()}}),St&&i.jsx("div",{className:"fixed bottom-4 right-4 z-50 animate-in slide-in-from-bottom-2 duration-300",children:i.jsxs("div",{className:"bg-green-600 text-white px-4 py-3 rounded-lg shadow-lg flex items-center gap-3",children:[i.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),i.jsx("span",{className:"font-medium",children:St})]})})]})}const OH=dr.memo(LH),og="0.1.1",W3=(e,t)=>{const[r,n]=b.useState(!1),[a,s]=b.useState(null),[o,l]=b.useState(null);return b.useEffect(()=>{const c=async()=>{try{const p=await(await fetch(`https://api.github.com/repos/${e}/${t}/releases/latest`)).json();if(p.tag_name){const h=p.tag_name.replace(/^v/,"");s(h),n(og!==h),l({title:p.name||p.tag_name,body:p.body||"",htmlUrl:p.html_url||`https://github.com/${e}/${t}/releases/latest`,publishedAt:p.published_at})}else n(!1),s(null),l(null)}catch(d){console.error("Version check failed:",d),n(!1),s(null),l(null)}};c();const u=setInterval(c,300*1e3);return()=>clearInterval(u)},[e,t]),{updateAvailable:r,latestVersion:a,currentVersion:og,releaseInfo:o}};function DH(){const{t:e}=Kt("settings"),[t,r]=b.useState([]),[n,a]=b.useState([]),[s,o]=b.useState(!0),[l,c]=b.useState(!1),[u,d]=b.useState(!1),[p,h]=b.useState(""),[m,g]=b.useState(""),[f,k]=b.useState(""),[S,v]=b.useState(""),[w,A]=b.useState({}),[I,E]=b.useState(null),[C,M]=b.useState(null),{updateAvailable:O,latestVersion:j,releaseInfo:G}=W3("siteboon","claudecodeui");b.useEffect(()=>{V()},[]);const V=async()=>{try{o(!0);const z=await(await Ae("/api/settings/api-keys")).json();r(z.apiKeys||[]);const R=await(await Ae("/api/settings/credentials?type=github_token")).json();a(R.credentials||[])}catch(N){console.error("Error fetching settings:",N)}finally{o(!1)}},D=async()=>{if(p.trim())try{const z=await(await Ae("/api/settings/api-keys",{method:"POST",body:JSON.stringify({keyName:p})})).json();z.success&&(M(z.apiKey),h(""),c(!1),V())}catch(N){console.error("Error creating API key:",N)}},P=async N=>{if(confirm(e("apiKeys.confirmDelete")))try{await Ae(`/api/settings/api-keys/${N}`,{method:"DELETE"}),V()}catch(z){console.error("Error deleting API key:",z)}},B=async(N,z)=>{try{await Ae(`/api/settings/api-keys/${N}/toggle`,{method:"PATCH",body:JSON.stringify({isActive:!z})}),V()}catch(re){console.error("Error toggling API key:",re)}},F=async()=>{if(!(!m.trim()||!f.trim()))try{(await(await Ae("/api/settings/credentials",{method:"POST",body:JSON.stringify({credentialName:m,credentialType:"github_token",credentialValue:f,description:S})})).json()).success&&(g(""),k(""),v(""),d(!1),V())}catch(N){console.error("Error creating GitHub credential:",N)}},$=async N=>{if(confirm(e("apiKeys.github.confirmDelete")))try{await Ae(`/api/settings/credentials/${N}`,{method:"DELETE"}),V()}catch(z){console.error("Error deleting GitHub credential:",z)}},H=async(N,z)=>{try{await Ae(`/api/settings/credentials/${N}/toggle`,{method:"PATCH",body:JSON.stringify({isActive:!z})}),V()}catch(re){console.error("Error toggling GitHub credential:",re)}},ne=(N,z)=>{navigator.clipboard.writeText(N),E(z),setTimeout(()=>E(null),2e3)};return s?i.jsx("div",{className:"text-muted-foreground",children:e("apiKeys.loading")}):i.jsxs("div",{className:"space-y-8",children:[C&&i.jsxs("div",{className:"p-4 bg-yellow-500/10 border border-yellow-500/20 rounded-lg",children:[i.jsx("h4",{className:"font-semibold text-yellow-500 mb-2",children:e("apiKeys.newKey.alertTitle")}),i.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:e("apiKeys.newKey.alertMessage")}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("code",{className:"flex-1 px-3 py-2 bg-background/50 rounded font-mono text-sm break-all",children:C.apiKey}),i.jsx(ze,{size:"sm",variant:"outline",onClick:()=>ne(C.apiKey,"new"),children:I==="new"?i.jsx(_r,{className:"h-4 w-4"}):i.jsx(Y4,{className:"h-4 w-4"})})]}),i.jsx(ze,{size:"sm",variant:"ghost",className:"mt-3",onClick:()=>M(null),children:e("apiKeys.newKey.iveSavedIt")})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(hg,{className:"h-5 w-5"}),i.jsx("h3",{className:"text-lg font-semibold",children:e("apiKeys.title")})]}),i.jsxs(ze,{size:"sm",onClick:()=>c(!l),children:[i.jsx(Tr,{className:"h-4 w-4 mr-1"}),e("apiKeys.newButton")]})]}),i.jsxs("div",{className:"mb-4",children:[i.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:e("apiKeys.description")}),i.jsxs("a",{href:"/api-docs.html",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-primary hover:underline inline-flex items-center gap-1",children:[e("apiKeys.apiDocsLink"),i.jsx(ch,{className:"h-3 w-3"})]})]}),l&&i.jsxs("div",{className:"mb-4 p-4 border rounded-lg bg-card",children:[i.jsx(lr,{placeholder:e("apiKeys.form.placeholder"),value:p,onChange:N=>h(N.target.value),className:"mb-2"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(ze,{onClick:D,children:e("apiKeys.form.createButton")}),i.jsx(ze,{variant:"outline",onClick:()=>c(!1),children:e("apiKeys.form.cancelButton")})]})]}),i.jsx("div",{className:"space-y-2",children:t.length===0?i.jsx("p",{className:"text-sm text-muted-foreground italic",children:e("apiKeys.empty")}):t.map(N=>i.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"font-medium",children:N.key_name}),i.jsx("code",{className:"text-xs text-muted-foreground",children:N.api_key}),i.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[e("apiKeys.list.created")," ",new Date(N.created_at).toLocaleDateString(),N.last_used&&` • ${e("apiKeys.list.lastUsed")} ${new Date(N.last_used).toLocaleDateString()}`]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(ze,{size:"sm",variant:N.is_active?"outline":"secondary",onClick:()=>B(N.id,N.is_active),children:N.is_active?e("apiKeys.status.active"):e("apiKeys.status.inactive")}),i.jsx(ze,{size:"sm",variant:"ghost",onClick:()=>P(N.id),children:i.jsx(jr,{className:"h-4 w-4"})})]})]},N.id))})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(XC,{className:"h-5 w-5"}),i.jsx("h3",{className:"text-lg font-semibold",children:e("apiKeys.github.title")})]}),i.jsxs(ze,{size:"sm",onClick:()=>d(!u),children:[i.jsx(Tr,{className:"h-4 w-4 mr-1"}),e("apiKeys.github.addButton")]})]}),i.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:e("apiKeys.github.descriptionAlt")}),u&&i.jsxs("div",{className:"mb-4 p-4 border rounded-lg bg-card space-y-3",children:[i.jsx(lr,{placeholder:e("apiKeys.github.form.namePlaceholder"),value:m,onChange:N=>g(N.target.value)}),i.jsxs("div",{className:"relative",children:[i.jsx(lr,{type:w.new?"text":"password",placeholder:e("apiKeys.github.form.tokenPlaceholder"),value:f,onChange:N=>k(N.target.value),className:"pr-10"}),i.jsx("button",{type:"button",onClick:()=>A({...w,new:!w.new}),className:"absolute right-3 top-2.5 text-muted-foreground hover:text-foreground",children:w.new?i.jsx(X4,{className:"h-4 w-4"}):i.jsx(Ai,{className:"h-4 w-4"})})]}),i.jsx(lr,{placeholder:e("apiKeys.github.form.descriptionPlaceholder"),value:S,onChange:N=>v(N.target.value)}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(ze,{onClick:F,children:e("apiKeys.github.form.addButton")}),i.jsx(ze,{variant:"outline",onClick:()=>{d(!1),g(""),k(""),v("")},children:e("apiKeys.github.form.cancelButton")})]}),i.jsx("a",{href:"https://github.com/settings/tokens",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline block",children:e("apiKeys.github.form.howToCreate")})]}),i.jsx("div",{className:"space-y-2",children:n.length===0?i.jsx("p",{className:"text-sm text-muted-foreground italic",children:e("apiKeys.github.empty")}):n.map(N=>i.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"font-medium",children:N.credential_name}),N.description&&i.jsx("div",{className:"text-xs text-muted-foreground",children:N.description}),i.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[e("apiKeys.github.added")," ",new Date(N.created_at).toLocaleDateString()]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(ze,{size:"sm",variant:N.is_active?"outline":"secondary",onClick:()=>H(N.id,N.is_active),children:N.is_active?e("apiKeys.status.active"):e("apiKeys.status.inactive")}),i.jsx(ze,{size:"sm",variant:"ghost",onClick:()=>$(N.id),children:i.jsx(jr,{className:"h-4 w-4"})})]})]},N.id))})]}),i.jsx("div",{className:"pt-6 border-t border-border/50",children:i.jsxs("div",{className:"flex items-center justify-between text-xs italic text-muted-foreground/60",children:[i.jsxs("a",{href:G?.htmlUrl||"https://github.com/siteboon/claudecodeui/releases",target:"_blank",rel:"noopener noreferrer",className:"hover:text-muted-foreground transition-colors",children:["v",og]}),O&&j&&i.jsxs("a",{href:G?.htmlUrl||"https://github.com/siteboon/claudecodeui/releases",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 px-2 py-0.5 bg-green-500/10 text-green-600 dark:text-green-400 rounded-full hover:bg-green-500/20 transition-colors not-italic font-medium",children:[i.jsx("span",{className:"text-[10px]",children:e("apiKeys.version.updateAvailable",{version:j})}),i.jsx(ch,{className:"h-2.5 w-2.5"})]})]})})]})}function MH(){const{t:e}=Kt("settings"),[t,r]=b.useState(""),[n,a]=b.useState(""),[s,o]=b.useState(!1),[l,c]=b.useState(!1),[u,d]=b.useState(null);b.useEffect(()=>{p()},[]);const p=async()=>{try{o(!0);const m=await Ae("/api/user/git-config");if(m.ok){const g=await m.json();r(g.gitName||""),a(g.gitEmail||"")}}catch(m){console.error("Error loading git config:",m)}finally{o(!1)}},h=async()=>{try{c(!0);const m=await Ae("/api/user/git-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gitName:t,gitEmail:n})});if(m.ok)d("success"),setTimeout(()=>d(null),3e3);else{const g=await m.json();d("error"),console.error("Failed to save git config:",g.error)}}catch(m){console.error("Error saving git config:",m),d("error")}finally{c(!1)}};return i.jsx("div",{className:"space-y-8",children:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[i.jsx(ba,{className:"h-5 w-5"}),i.jsx("h3",{className:"text-lg font-semibold",children:e("git.title")})]}),i.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:e("git.description")}),i.jsxs("div",{className:"p-4 border rounded-lg bg-card space-y-3",children:[i.jsxs("div",{children:[i.jsx("label",{htmlFor:"settings-git-name",className:"block text-sm font-medium text-foreground mb-2",children:e("git.name.label")}),i.jsx(lr,{id:"settings-git-name",type:"text",value:t,onChange:m=>r(m.target.value),placeholder:"John Doe",disabled:s,className:"w-full"}),i.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:e("git.name.help")})]}),i.jsxs("div",{children:[i.jsx("label",{htmlFor:"settings-git-email",className:"block text-sm font-medium text-foreground mb-2",children:e("git.email.label")}),i.jsx(lr,{id:"settings-git-email",type:"email",value:n,onChange:m=>a(m.target.value),placeholder:"john@example.com",disabled:s,className:"w-full"}),i.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:e("git.email.help")})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(ze,{onClick:h,disabled:l||!t||!n,children:e(l?"git.actions.saving":"git.actions.save")}),u==="success"&&i.jsxs("div",{className:"text-sm text-green-600 dark:text-green-400 flex items-center gap-2",children:[i.jsx(_r,{className:"w-4 h-4"}),e("git.status.success")]})]})]})]})})}function FH(){const{t:e}=Kt("settings"),{tasksEnabled:t,setTasksEnabled:r,isTaskMasterInstalled:n,isCheckingInstallation:a}=Wo();return i.jsx("div",{className:"space-y-8",children:a?i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-blue-600 border-t-transparent rounded-full"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:e("tasks.checking")})]})}):i.jsxs(i.Fragment,{children:[!n&&i.jsx("div",{className:"bg-orange-50 dark:bg-orange-950/50 border border-orange-200 dark:border-orange-800 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:"w-8 h-8 bg-orange-100 dark:bg-orange-900 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",children:i.jsx("svg",{className:"w-4 h-4 text-orange-600 dark:text-orange-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"font-medium text-orange-900 dark:text-orange-100 mb-2",children:e("tasks.notInstalled.title")}),i.jsxs("div",{className:"text-sm text-orange-800 dark:text-orange-200 space-y-3",children:[i.jsx("p",{children:e("tasks.notInstalled.description")}),i.jsx("div",{className:"bg-orange-100 dark:bg-orange-900/50 rounded-lg p-3 font-mono text-sm",children:i.jsx("code",{children:e("tasks.notInstalled.installCommand")})}),i.jsx("div",{children:i.jsxs("a",{href:"https://github.com/eyaltoledano/claude-task-master",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium text-sm",children:[i.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:i.jsx("path",{fillRule:"evenodd",d:"M10 0C4.477 0 0 4.484 0 10.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 0110 4.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 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.942.359.31.678.921.678 1.856 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0020 10.017C20 4.484 15.522 0 10 0z",clipRule:"evenodd"})}),e("tasks.notInstalled.viewOnGitHub"),i.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"font-medium",children:e("tasks.notInstalled.afterInstallation")}),i.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-xs",children:[i.jsx("li",{children:e("tasks.notInstalled.steps.restart")}),i.jsx("li",{children:e("tasks.notInstalled.steps.autoAvailable")}),i.jsx("li",{children:e("tasks.notInstalled.steps.initCommand")})]})]})]})]})]})}),n&&i.jsx("div",{className:"space-y-4",children:i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-foreground",children:e("tasks.settings.enableLabel")}),i.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:e("tasks.settings.enableDescription")})]}),i.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[i.jsx("input",{type:"checkbox",checked:t,onChange:s=>r(s.target.checked),className:"sr-only peer"}),i.jsx("div",{className:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"})]})]})})})]})})}function V3({isOpen:e,onClose:t,provider:r="claude",project:n,onComplete:a,customCommand:s,isAuthenticated:o=!1}){if(!e)return null;const l=()=>{if(s)return s;switch(r){case"claude":return o?"claude setup-token --dangerously-skip-permissions":"claude /exit --dangerously-skip-permissions";case"cursor":return"cursor-agent login";case"codex":return"codex login";default:return o?"claude setup-token --dangerously-skip-permissions":"claude /exit --dangerously-skip-permissions"}},c=()=>{switch(r){case"claude":return"Claude CLI Login";case"cursor":return"Cursor CLI Login";case"codex":return"Codex CLI Login";default:return"CLI Login"}},u=d=>{a&&a(d),d===0&&t()};return i.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-[9999] max-md:items-stretch max-md:justify-stretch",children:i.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl w-full max-w-4xl h-3/4 flex flex-col md:max-w-4xl md:h-3/4 md:rounded-lg md:m-4 max-md:max-w-none max-md:h-full max-md:rounded-none max-md:m-0",children:[i.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700",children:[i.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:c()}),i.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors","aria-label":"Close login modal",children:i.jsx($t,{className:"w-6 h-6"})})]}),i.jsx("div",{className:"flex-1 overflow-hidden",children:i.jsx(H3,{project:n,command:l(),onComplete:u,minimal:!0})})]})})}const PH={claude:{name:"Claude",color:"blue",Logo:In},cursor:{name:"Cursor",color:"purple",Logo:Xn},codex:{name:"Codex",color:"gray",Logo:Zn}},BH={blue:{border:"border-l-blue-500 md:border-l-blue-500",borderBottom:"border-b-blue-500",bg:"bg-blue-50 dark:bg-blue-900/20",dot:"bg-blue-500"},purple:{border:"border-l-purple-500 md:border-l-purple-500",borderBottom:"border-b-purple-500",bg:"bg-purple-50 dark:bg-purple-900/20",dot:"bg-purple-500"},gray:{border:"border-l-gray-700 dark:border-l-gray-300",borderBottom:"border-b-gray-700 dark:border-b-gray-300",bg:"bg-gray-100 dark:bg-gray-800/50",dot:"bg-gray-700 dark:bg-gray-300"}};function oi({agentId:e,authStatus:t,isSelected:r,onClick:n,isMobile:a=!1}){const{t:s}=Kt("settings"),o=PH[e],l=BH[o.color],{Logo:c}=o;return a?i.jsx("button",{onClick:n,className:`flex-1 text-center py-3 px-2 border-b-2 transition-colors ${r?`${l.borderBottom} ${l.bg}`:"border-transparent hover:bg-gray-50 dark:hover:bg-gray-800"}`,children:i.jsxs("div",{className:"flex flex-col items-center gap-1",children:[i.jsx(c,{className:"w-5 h-5"}),i.jsx("span",{className:"text-xs font-medium text-foreground",children:o.name}),t?.authenticated&&i.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${l.dot}`})]})}):i.jsxs("button",{onClick:n,className:`w-full text-left p-3 border-l-4 transition-colors ${r?`${l.border} ${l.bg}`:"border-transparent hover:bg-gray-50 dark:hover:bg-gray-800"}`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx(c,{className:"w-4 h-4"}),i.jsx("span",{className:"font-medium text-foreground",children:o.name})]}),i.jsx("div",{className:"text-xs text-muted-foreground pl-6",children:t?.loading?i.jsx("span",{className:"text-gray-400",children:s("agents.authStatus.checking")}):t?.authenticated?i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${l.dot}`}),i.jsx("span",{className:"truncate max-w-[120px]",title:t.email,children:t.email||s("agents.authStatus.connected")})]}):i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-400"}),i.jsx("span",{children:s("agents.authStatus.notConnected")})]})})]})}const zH={claude:{name:"Claude",description:"Anthropic Claude AI assistant",Logo:In,bgClass:"bg-blue-50 dark:bg-blue-900/20",borderClass:"border-blue-200 dark:border-blue-800",textClass:"text-blue-900 dark:text-blue-100",subtextClass:"text-blue-700 dark:text-blue-300",buttonClass:"bg-blue-600 hover:bg-blue-700"},cursor:{name:"Cursor",description:"Cursor AI-powered code editor",Logo:Xn,bgClass:"bg-purple-50 dark:bg-purple-900/20",borderClass:"border-purple-200 dark:border-purple-800",textClass:"text-purple-900 dark:text-purple-100",subtextClass:"text-purple-700 dark:text-purple-300",buttonClass:"bg-purple-600 hover:bg-purple-700"},codex:{name:"Codex",description:"OpenAI Codex AI assistant",Logo:Zn,bgClass:"bg-gray-100 dark:bg-gray-800/50",borderClass:"border-gray-300 dark:border-gray-600",textClass:"text-gray-900 dark:text-gray-100",subtextClass:"text-gray-700 dark:text-gray-300",buttonClass:"bg-gray-800 hover:bg-gray-900 dark:bg-gray-700 dark:hover:bg-gray-600"}};function UH({agent:e,authStatus:t,onLogin:r}){const{t:n}=Kt("settings"),a=zH[e],{Logo:s}=a;return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[i.jsx(s,{className:"w-6 h-6"}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-medium text-foreground",children:a.name}),i.jsx("p",{className:"text-sm text-muted-foreground",children:n(`agents.account.${e}.description`)})]})]}),i.jsx("div",{className:`${a.bgClass} border ${a.borderClass} rounded-lg p-4`,children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:`font-medium ${a.textClass}`,children:n("agents.connectionStatus")}),i.jsx("div",{className:`text-sm ${a.subtextClass}`,children:t?.loading?n("agents.authStatus.checkingAuth"):t?.authenticated?n("agents.authStatus.loggedInAs",{email:t.email||n("agents.authStatus.authenticatedUser")}):n("agents.authStatus.notConnected")})]}),i.jsx("div",{children:t?.loading?i.jsx(gn,{variant:"secondary",className:"bg-gray-100 dark:bg-gray-800",children:n("agents.authStatus.checking")}):t?.authenticated?i.jsx(gn,{variant:"success",className:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",children:n("agents.authStatus.connected")}):i.jsx(gn,{variant:"secondary",className:"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-300",children:n("agents.authStatus.disconnected")})})]}),i.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 pt-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:`font-medium ${a.textClass}`,children:t?.authenticated?n("agents.login.reAuthenticate"):n("agents.login.title")}),i.jsx("div",{className:`text-sm ${a.subtextClass}`,children:t?.authenticated?n("agents.login.reAuthDescription"):n("agents.login.description",{agent:a.name})})]}),i.jsxs(ze,{onClick:r,className:`${a.buttonClass} text-white`,size:"sm",children:[i.jsx(Q4,{className:"w-4 h-4 mr-2"}),t?.authenticated?n("agents.login.reLoginButton"):n("agents.login.button")]})]})}),t?.error&&i.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 pt-4",children:i.jsx("div",{className:"text-sm text-red-600 dark:text-red-400",children:n("agents.error",{error:t.error})})})]})})]})}const $H=["Bash(git log:*)","Bash(git diff:*)","Bash(git status:*)","Write","Read","Edit","Glob","Grep","MultiEdit","Task","TodoWrite","TodoRead","WebFetch","WebSearch"],qH=["Shell(ls)","Shell(mkdir)","Shell(cd)","Shell(cat)","Shell(echo)","Shell(git status)","Shell(git diff)","Shell(git log)","Shell(npm install)","Shell(npm run)","Shell(python)","Shell(node)"];function GH({skipPermissions:e,setSkipPermissions:t,allowedTools:r,setAllowedTools:n,disallowedTools:a,setDisallowedTools:s,newAllowedTool:o,setNewAllowedTool:l,newDisallowedTool:c,setNewDisallowedTool:u}){const{t:d}=Kt("settings"),p=f=>{f&&!r.includes(f)&&(n([...r,f]),l(""))},h=f=>{n(r.filter(k=>k!==f))},m=f=>{f&&!a.includes(f)&&(s([...a,f]),u(""))},g=f=>{s(a.filter(k=>k!==f))};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Yn,{className:"w-5 h-5 text-orange-500"}),i.jsx("h3",{className:"text-lg font-medium text-foreground",children:d("permissions.title")})]}),i.jsx("div",{className:"bg-orange-50 dark:bg-orange-900/20 border border-orange-200 dark:border-orange-800 rounded-lg p-4",children:i.jsxs("label",{className:"flex items-center gap-3",children:[i.jsx("input",{type:"checkbox",checked:e,onChange:f=>t(f.target.checked),className:"w-4 h-4 text-blue-600 bg-gray-100 dark:bg-gray-700 border-gray-300 dark:border-gray-600 rounded focus:ring-blue-500 focus:ring-2"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-orange-900 dark:text-orange-100",children:d("permissions.skipPermissions.label")}),i.jsx("div",{className:"text-sm text-orange-700 dark:text-orange-300",children:d("permissions.skipPermissions.claudeDescription")})]})]})})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(fg,{className:"w-5 h-5 text-green-500"}),i.jsx("h3",{className:"text-lg font-medium text-foreground",children:d("permissions.allowedTools.title")})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:d("permissions.allowedTools.description")}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[i.jsx(lr,{value:o,onChange:f=>l(f.target.value),placeholder:d("permissions.allowedTools.placeholder"),onKeyPress:f=>{f.key==="Enter"&&(f.preventDefault(),p(o))},className:"flex-1 h-10"}),i.jsxs(ze,{onClick:()=>p(o),disabled:!o,size:"sm",className:"h-10 px-4",children:[i.jsx(Tr,{className:"w-4 h-4 mr-2 sm:mr-0"}),i.jsx("span",{className:"sm:hidden",children:d("permissions.actions.add")})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:d("permissions.allowedTools.quickAdd")}),i.jsx("div",{className:"flex flex-wrap gap-2",children:$H.map(f=>i.jsx(ze,{variant:"outline",size:"sm",onClick:()=>p(f),disabled:r.includes(f),className:"text-xs h-8",children:f},f))})]}),i.jsxs("div",{className:"space-y-2",children:[r.map(f=>i.jsxs("div",{className:"flex items-center justify-between bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-3",children:[i.jsx("span",{className:"font-mono text-sm text-green-800 dark:text-green-200",children:f}),i.jsx(ze,{variant:"ghost",size:"sm",onClick:()=>h(f),className:"text-green-600 hover:text-green-700",children:i.jsx($t,{className:"w-4 h-4"})})]},f)),r.length===0&&i.jsx("div",{className:"text-center py-6 text-gray-500 dark:text-gray-400",children:d("permissions.allowedTools.empty")})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Yn,{className:"w-5 h-5 text-red-500"}),i.jsx("h3",{className:"text-lg font-medium text-foreground",children:d("permissions.blockedTools.title")})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:d("permissions.blockedTools.description")}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[i.jsx(lr,{value:c,onChange:f=>u(f.target.value),placeholder:d("permissions.blockedTools.placeholder"),onKeyPress:f=>{f.key==="Enter"&&(f.preventDefault(),m(c))},className:"flex-1 h-10"}),i.jsxs(ze,{onClick:()=>m(c),disabled:!c,size:"sm",className:"h-10 px-4",children:[i.jsx(Tr,{className:"w-4 h-4 mr-2 sm:mr-0"}),i.jsx("span",{className:"sm:hidden",children:d("permissions.actions.add")})]})]}),i.jsxs("div",{className:"space-y-2",children:[a.map(f=>i.jsxs("div",{className:"flex items-center justify-between bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-3",children:[i.jsx("span",{className:"font-mono text-sm text-red-800 dark:text-red-200",children:f}),i.jsx(ze,{variant:"ghost",size:"sm",onClick:()=>g(f),className:"text-red-600 hover:text-red-700",children:i.jsx($t,{className:"w-4 h-4"})})]},f)),a.length===0&&i.jsx("div",{className:"text-center py-6 text-gray-500 dark:text-gray-400",children:d("permissions.blockedTools.empty")})]})]}),i.jsxs("div",{className:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4",children:[i.jsx("h4",{className:"font-medium text-blue-900 dark:text-blue-100 mb-2",children:d("permissions.toolExamples.title")}),i.jsxs("ul",{className:"text-sm text-blue-800 dark:text-blue-200 space-y-1",children:[i.jsxs("li",{children:[i.jsx("code",{className:"bg-blue-100 dark:bg-blue-800 px-1 rounded",children:'"Bash(git log:*)"'})," ",d("permissions.toolExamples.bashGitLog")]}),i.jsxs("li",{children:[i.jsx("code",{className:"bg-blue-100 dark:bg-blue-800 px-1 rounded",children:'"Bash(git diff:*)"'})," ",d("permissions.toolExamples.bashGitDiff")]}),i.jsxs("li",{children:[i.jsx("code",{className:"bg-blue-100 dark:bg-blue-800 px-1 rounded",children:'"Write"'})," ",d("permissions.toolExamples.write")]}),i.jsxs("li",{children:[i.jsx("code",{className:"bg-blue-100 dark:bg-blue-800 px-1 rounded",children:'"Bash(rm:*)"'})," ",d("permissions.toolExamples.bashRm")]})]})]})]})}function HH({skipPermissions:e,setSkipPermissions:t,allowedCommands:r,setAllowedCommands:n,disallowedCommands:a,setDisallowedCommands:s,newAllowedCommand:o,setNewAllowedCommand:l,newDisallowedCommand:c,setNewDisallowedCommand:u}){const{t:d}=Kt("settings"),p=f=>{f&&!r.includes(f)&&(n([...r,f]),l(""))},h=f=>{n(r.filter(k=>k!==f))},m=f=>{f&&!a.includes(f)&&(s([...a,f]),u(""))},g=f=>{s(a.filter(k=>k!==f))};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Yn,{className:"w-5 h-5 text-orange-500"}),i.jsx("h3",{className:"text-lg font-medium text-foreground",children:d("permissions.title")})]}),i.jsx("div",{className:"bg-orange-50 dark:bg-orange-900/20 border border-orange-200 dark:border-orange-800 rounded-lg p-4",children:i.jsxs("label",{className:"flex items-center gap-3",children:[i.jsx("input",{type:"checkbox",checked:e,onChange:f=>t(f.target.checked),className:"w-4 h-4 text-purple-600 bg-gray-100 dark:bg-gray-700 border-gray-300 dark:border-gray-600 rounded focus:ring-purple-500 focus:ring-2"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-orange-900 dark:text-orange-100",children:d("permissions.skipPermissions.label")}),i.jsx("div",{className:"text-sm text-orange-700 dark:text-orange-300",children:d("permissions.skipPermissions.cursorDescription")})]})]})})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(fg,{className:"w-5 h-5 text-green-500"}),i.jsx("h3",{className:"text-lg font-medium text-foreground",children:d("permissions.allowedCommands.title")})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:d("permissions.allowedCommands.description")}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[i.jsx(lr,{value:o,onChange:f=>l(f.target.value),placeholder:d("permissions.allowedCommands.placeholder"),onKeyPress:f=>{f.key==="Enter"&&(f.preventDefault(),p(o))},className:"flex-1 h-10"}),i.jsxs(ze,{onClick:()=>p(o),disabled:!o,size:"sm",className:"h-10 px-4",children:[i.jsx(Tr,{className:"w-4 h-4 mr-2 sm:mr-0"}),i.jsx("span",{className:"sm:hidden",children:d("permissions.actions.add")})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:d("permissions.allowedCommands.quickAdd")}),i.jsx("div",{className:"flex flex-wrap gap-2",children:qH.map(f=>i.jsx(ze,{variant:"outline",size:"sm",onClick:()=>p(f),disabled:r.includes(f),className:"text-xs h-8",children:f},f))})]}),i.jsxs("div",{className:"space-y-2",children:[r.map(f=>i.jsxs("div",{className:"flex items-center justify-between bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-3",children:[i.jsx("span",{className:"font-mono text-sm text-green-800 dark:text-green-200",children:f}),i.jsx(ze,{variant:"ghost",size:"sm",onClick:()=>h(f),className:"text-green-600 hover:text-green-700",children:i.jsx($t,{className:"w-4 h-4"})})]},f)),r.length===0&&i.jsx("div",{className:"text-center py-6 text-gray-500 dark:text-gray-400",children:d("permissions.allowedCommands.empty")})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Yn,{className:"w-5 h-5 text-red-500"}),i.jsx("h3",{className:"text-lg font-medium text-foreground",children:d("permissions.blockedCommands.title")})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:d("permissions.blockedCommands.description")}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[i.jsx(lr,{value:c,onChange:f=>u(f.target.value),placeholder:d("permissions.blockedCommands.placeholder"),onKeyPress:f=>{f.key==="Enter"&&(f.preventDefault(),m(c))},className:"flex-1 h-10"}),i.jsxs(ze,{onClick:()=>m(c),disabled:!c,size:"sm",className:"h-10 px-4",children:[i.jsx(Tr,{className:"w-4 h-4 mr-2 sm:mr-0"}),i.jsx("span",{className:"sm:hidden",children:d("permissions.actions.add")})]})]}),i.jsxs("div",{className:"space-y-2",children:[a.map(f=>i.jsxs("div",{className:"flex items-center justify-between bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-3",children:[i.jsx("span",{className:"font-mono text-sm text-red-800 dark:text-red-200",children:f}),i.jsx(ze,{variant:"ghost",size:"sm",onClick:()=>g(f),className:"text-red-600 hover:text-red-700",children:i.jsx($t,{className:"w-4 h-4"})})]},f)),a.length===0&&i.jsx("div",{className:"text-center py-6 text-gray-500 dark:text-gray-400",children:d("permissions.blockedCommands.empty")})]})]}),i.jsxs("div",{className:"bg-purple-50 dark:bg-purple-900/20 border border-purple-200 dark:border-purple-800 rounded-lg p-4",children:[i.jsx("h4",{className:"font-medium text-purple-900 dark:text-purple-100 mb-2",children:d("permissions.shellExamples.title")}),i.jsxs("ul",{className:"text-sm text-purple-800 dark:text-purple-200 space-y-1",children:[i.jsxs("li",{children:[i.jsx("code",{className:"bg-purple-100 dark:bg-purple-800 px-1 rounded",children:'"Shell(ls)"'})," ",d("permissions.shellExamples.ls")]}),i.jsxs("li",{children:[i.jsx("code",{className:"bg-purple-100 dark:bg-purple-800 px-1 rounded",children:'"Shell(git status)"'})," ",d("permissions.shellExamples.gitStatus")]}),i.jsxs("li",{children:[i.jsx("code",{className:"bg-purple-100 dark:bg-purple-800 px-1 rounded",children:'"Shell(npm install)"'})," ",d("permissions.shellExamples.npmInstall")]}),i.jsxs("li",{children:[i.jsx("code",{className:"bg-purple-100 dark:bg-purple-800 px-1 rounded",children:'"Shell(rm -rf)"'})," ",d("permissions.shellExamples.rmRf")]})]})]})]})}function WH({permissionMode:e,setPermissionMode:t}){const{t:r}=Kt("settings");return i.jsx("div",{className:"space-y-6",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(fg,{className:"w-5 h-5 text-green-500"}),i.jsx("h3",{className:"text-lg font-medium text-foreground",children:r("permissions.codex.permissionMode")})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:r("permissions.codex.description")}),i.jsx("div",{className:`border rounded-lg p-4 cursor-pointer transition-all ${e==="default"?"bg-gray-100 dark:bg-gray-800 border-gray-400 dark:border-gray-500":"bg-gray-50 dark:bg-gray-900/50 border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}`,onClick:()=>t("default"),children:i.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[i.jsx("input",{type:"radio",name:"codexPermissionMode",checked:e==="default",onChange:()=>t("default"),className:"mt-1 w-4 h-4 text-green-600"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-foreground",children:r("permissions.codex.modes.default.title")}),i.jsx("div",{className:"text-sm text-muted-foreground",children:r("permissions.codex.modes.default.description")})]})]})}),i.jsx("div",{className:`border rounded-lg p-4 cursor-pointer transition-all ${e==="acceptEdits"?"bg-green-50 dark:bg-green-900/20 border-green-400 dark:border-green-600":"bg-gray-50 dark:bg-gray-900/50 border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}`,onClick:()=>t("acceptEdits"),children:i.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[i.jsx("input",{type:"radio",name:"codexPermissionMode",checked:e==="acceptEdits",onChange:()=>t("acceptEdits"),className:"mt-1 w-4 h-4 text-green-600"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-green-900 dark:text-green-100",children:r("permissions.codex.modes.acceptEdits.title")}),i.jsx("div",{className:"text-sm text-green-700 dark:text-green-300",children:r("permissions.codex.modes.acceptEdits.description")})]})]})}),i.jsx("div",{className:`border rounded-lg p-4 cursor-pointer transition-all ${e==="bypassPermissions"?"bg-orange-50 dark:bg-orange-900/20 border-orange-400 dark:border-orange-600":"bg-gray-50 dark:bg-gray-900/50 border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}`,onClick:()=>t("bypassPermissions"),children:i.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[i.jsx("input",{type:"radio",name:"codexPermissionMode",checked:e==="bypassPermissions",onChange:()=>t("bypassPermissions"),className:"mt-1 w-4 h-4 text-orange-600"}),i.jsxs("div",{children:[i.jsxs("div",{className:"font-medium text-orange-900 dark:text-orange-100 flex items-center gap-2",children:[r("permissions.codex.modes.bypassPermissions.title"),i.jsx(Yn,{className:"w-4 h-4"})]}),i.jsx("div",{className:"text-sm text-orange-700 dark:text-orange-300",children:r("permissions.codex.modes.bypassPermissions.description")})]})]})}),i.jsxs("details",{className:"text-sm",children:[i.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground",children:r("permissions.codex.technicalDetails")}),i.jsxs("div",{className:"mt-2 p-3 bg-gray-50 dark:bg-gray-900/50 rounded-lg text-xs text-muted-foreground space-y-2",children:[i.jsxs("p",{children:[i.jsxs("strong",{children:[r("permissions.codex.modes.default.title"),":"]})," ",r("permissions.codex.technicalInfo.default")]}),i.jsxs("p",{children:[i.jsxs("strong",{children:[r("permissions.codex.modes.acceptEdits.title"),":"]})," ",r("permissions.codex.technicalInfo.acceptEdits")]}),i.jsxs("p",{children:[i.jsxs("strong",{children:[r("permissions.codex.modes.bypassPermissions.title"),":"]})," ",r("permissions.codex.technicalInfo.bypassPermissions")]}),i.jsx("p",{className:"text-xs opacity-75",children:r("permissions.codex.technicalInfo.overrideNote")})]})]})]})})}function sh({agent:e,...t}){return e==="claude"?i.jsx(GH,{...t}):e==="cursor"?i.jsx(HH,{...t}):e==="codex"?i.jsx(WH,{...t}):null}const VH=e=>{switch(e){case"stdio":return i.jsx(Ba,{className:"w-4 h-4"});case"sse":return i.jsx(bg,{className:"w-4 h-4"});case"http":return i.jsx(uh,{className:"w-4 h-4"});default:return i.jsx(Go,{className:"w-4 h-4"})}};function KH({servers:e,onAdd:t,onEdit:r,onDelete:n,onTest:a,onDiscoverTools:s,testResults:o,serverTools:l,toolsLoading:c}){const{t:u}=Kt("settings");return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Go,{className:"w-5 h-5 text-purple-500"}),i.jsx("h3",{className:"text-lg font-medium text-foreground",children:u("mcpServers.title")})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:u("mcpServers.description.claude")}),i.jsx("div",{className:"flex justify-between items-center",children:i.jsxs(ze,{onClick:t,className:"bg-purple-600 hover:bg-purple-700 text-white",size:"sm",children:[i.jsx(Tr,{className:"w-4 h-4 mr-2"}),u("mcpServers.addButton")]})}),i.jsxs("div",{className:"space-y-2",children:[e.map(d=>i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[VH(d.type),i.jsx("span",{className:"font-medium text-foreground",children:d.name}),i.jsx(gn,{variant:"outline",className:"text-xs",children:d.type}),i.jsx(gn,{variant:"outline",className:"text-xs",children:d.scope==="local"?u("mcpServers.scope.local"):d.scope==="user"?u("mcpServers.scope.user"):d.scope})]}),i.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[d.type==="stdio"&&d.config?.command&&i.jsxs("div",{children:[u("mcpServers.config.command"),": ",i.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded text-xs",children:d.config.command})]}),(d.type==="sse"||d.type==="http")&&d.config?.url&&i.jsxs("div",{children:[u("mcpServers.config.url"),": ",i.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded text-xs",children:d.config.url})]}),d.config?.args&&d.config.args.length>0&&i.jsxs("div",{children:[u("mcpServers.config.args"),": ",i.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded text-xs",children:d.config.args.join(" ")})]})]}),o?.[d.id]&&i.jsx("div",{className:`mt-2 p-2 rounded text-xs ${o[d.id].success?"bg-green-50 dark:bg-green-900/20 text-green-800 dark:text-green-200":"bg-red-50 dark:bg-red-900/20 text-red-800 dark:text-red-200"}`,children:i.jsx("div",{className:"font-medium",children:o[d.id].message})}),l?.[d.id]&&l[d.id].tools?.length>0&&i.jsxs("div",{className:"mt-2 p-2 rounded text-xs bg-blue-50 dark:bg-blue-900/20 text-blue-800 dark:text-blue-200",children:[i.jsxs("div",{className:"font-medium",children:[u("mcpServers.tools.title")," ",u("mcpServers.tools.count",{count:l[d.id].tools.length})]}),i.jsxs("div",{className:"flex flex-wrap gap-1 mt-1",children:[l[d.id].tools.slice(0,5).map((p,h)=>i.jsx("code",{className:"bg-blue-100 dark:bg-blue-800 px-1 rounded",children:p.name},h)),l[d.id].tools.length>5&&i.jsx("span",{className:"text-xs opacity-75",children:u("mcpServers.tools.more",{count:l[d.id].tools.length-5})})]})]})]}),i.jsxs("div",{className:"flex items-center gap-2 ml-4",children:[i.jsx(ze,{onClick:()=>r(d),variant:"ghost",size:"sm",className:"text-gray-600 hover:text-gray-700",title:u("mcpServers.actions.edit"),children:i.jsx(ss,{className:"w-4 h-4"})}),i.jsx(ze,{onClick:()=>n(d.id,d.scope),variant:"ghost",size:"sm",className:"text-red-600 hover:text-red-700",title:u("mcpServers.actions.delete"),children:i.jsx(jr,{className:"w-4 h-4"})})]})]})},d.id)),e.length===0&&i.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:u("mcpServers.empty")})]})]})}function YH({servers:e,onAdd:t,onEdit:r,onDelete:n}){const{t:a}=Kt("settings");return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Go,{className:"w-5 h-5 text-purple-500"}),i.jsx("h3",{className:"text-lg font-medium text-foreground",children:a("mcpServers.title")})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:a("mcpServers.description.cursor")}),i.jsx("div",{className:"flex justify-between items-center",children:i.jsxs(ze,{onClick:t,className:"bg-purple-600 hover:bg-purple-700 text-white",size:"sm",children:[i.jsx(Tr,{className:"w-4 h-4 mr-2"}),a("mcpServers.addButton")]})}),i.jsxs("div",{className:"space-y-2",children:[e.map(s=>i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ba,{className:"w-4 h-4"}),i.jsx("span",{className:"font-medium text-foreground",children:s.name}),i.jsx(gn,{variant:"outline",className:"text-xs",children:"stdio"})]}),i.jsx("div",{className:"text-sm text-muted-foreground",children:s.config?.command&&i.jsxs("div",{children:[a("mcpServers.config.command"),": ",i.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded text-xs",children:s.config.command})]})})]}),i.jsxs("div",{className:"flex items-center gap-2 ml-4",children:[i.jsx(ze,{onClick:()=>r(s),variant:"ghost",size:"sm",className:"text-gray-600 hover:text-gray-700",title:a("mcpServers.actions.edit"),children:i.jsx(ss,{className:"w-4 h-4"})}),i.jsx(ze,{onClick:()=>n(s.name),variant:"ghost",size:"sm",className:"text-red-600 hover:text-red-700",title:a("mcpServers.actions.delete"),children:i.jsx(jr,{className:"w-4 h-4"})})]})]})},s.name||s.id)),e.length===0&&i.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:a("mcpServers.empty")})]})]})}function XH({servers:e,onAdd:t,onEdit:r,onDelete:n}){const{t:a}=Kt("settings");return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Go,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"}),i.jsx("h3",{className:"text-lg font-medium text-foreground",children:a("mcpServers.title")})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:a("mcpServers.description.codex")}),i.jsx("div",{className:"flex justify-between items-center",children:i.jsxs(ze,{onClick:t,className:"bg-gray-800 hover:bg-gray-900 dark:bg-gray-700 dark:hover:bg-gray-600 text-white",size:"sm",children:[i.jsx(Tr,{className:"w-4 h-4 mr-2"}),a("mcpServers.addButton")]})}),i.jsxs("div",{className:"space-y-2",children:[e.map(s=>i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ba,{className:"w-4 h-4"}),i.jsx("span",{className:"font-medium text-foreground",children:s.name}),i.jsx(gn,{variant:"outline",className:"text-xs",children:"stdio"})]}),i.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[s.config?.command&&i.jsxs("div",{children:[a("mcpServers.config.command"),": ",i.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded text-xs",children:s.config.command})]}),s.config?.args&&s.config.args.length>0&&i.jsxs("div",{children:[a("mcpServers.config.args"),": ",i.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded text-xs",children:s.config.args.join(" ")})]}),s.config?.env&&Object.keys(s.config.env).length>0&&i.jsxs("div",{children:[a("mcpServers.config.environment"),": ",i.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded text-xs",children:Object.entries(s.config.env).map(([o,l])=>`${o}=${l}`).join(", ")})]})]})]}),i.jsxs("div",{className:"flex items-center gap-2 ml-4",children:[i.jsx(ze,{onClick:()=>r(s),variant:"ghost",size:"sm",className:"text-gray-600 hover:text-gray-700",title:a("mcpServers.actions.edit"),children:i.jsx(ss,{className:"w-4 h-4"})}),i.jsx(ze,{onClick:()=>n(s.name),variant:"ghost",size:"sm",className:"text-red-600 hover:text-red-700",title:a("mcpServers.actions.delete"),children:i.jsx(jr,{className:"w-4 h-4"})})]})]})},s.name)),e.length===0&&i.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:a("mcpServers.empty")})]}),i.jsxs("div",{className:"bg-gray-100 dark:bg-gray-800/50 border border-gray-300 dark:border-gray-600 rounded-lg p-4",children:[i.jsx("h4",{className:"font-medium text-gray-900 dark:text-gray-100 mb-2",children:a("mcpServers.help.title")}),i.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-300",children:a("mcpServers.help.description")})]})]})}function oh({agent:e,...t}){return e==="claude"?i.jsx(KH,{...t}):e==="cursor"?i.jsx(YH,{...t}):e==="codex"?i.jsx(XH,{...t}):null}const lg=[{value:"en",label:"English",nativeName:"English"},{value:"zh-CN",label:"Simplified Chinese",nativeName:"简体中文"}];function K3({compact:e=!1}){const{i18n:t,t:r}=Kt("settings"),n=a=>{const s=a.target.value;t.changeLanguage(s)};return e?i.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[i.jsx(J4,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),r("account.language")]}),i.jsx("select",{value:t.language,onChange:n,className:"w-[100px] text-sm bg-gray-50 dark:bg-gray-800 border border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500 p-2 focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400",children:lg.map(a=>i.jsx("option",{value:a.value,children:a.nativeName},a.value))})]}):i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-gray-900 dark:text-gray-100 mb-1",children:r("account.languageLabel")}),i.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:r("account.languageDescription")})]}),i.jsx("select",{value:t.language,onChange:n,className:"text-sm bg-gray-50 dark:bg-gray-800 border border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500 p-2 w-36",children:lg.map(a=>i.jsx("option",{value:a.value,children:a.nativeName},a.value))})]})})}function ZH({isOpen:e,onClose:t,projects:r=[],initialTab:n="agents"}){const{isDarkMode:a,toggleDarkMode:s}=xs(),{t:o}=Kt("settings"),[l,c]=b.useState([]),[u,d]=b.useState([]),[p,h]=b.useState(""),[m,g]=b.useState(""),[f,k]=b.useState(!1),[S,v]=b.useState(!1),[w,A]=b.useState(null),[I,E]=b.useState("name"),[C,M]=b.useState([]),[O,j]=b.useState(!1),[G,V]=b.useState(null),[D,P]=b.useState({name:"",type:"stdio",scope:"user",projectPath:"",config:{command:"",args:[],env:{},url:"",headers:{},timeout:3e4},jsonInput:"",importMode:"form"}),[B,F]=b.useState(!1),[$,H]=b.useState({}),[ne,N]=b.useState({}),[z,re]=b.useState({}),[R,K]=b.useState(n),[pe,ve]=b.useState(""),[oe,Ie]=b.useState("claude"),[ce,ye]=b.useState("account"),[_e,qe]=b.useState(()=>localStorage.getItem("codeEditorTheme")||"dark"),[Ke,xt]=b.useState(()=>localStorage.getItem("codeEditorWordWrap")==="true"),[dt,St]=b.useState(()=>localStorage.getItem("codeEditorShowMinimap")!=="false"),[ft,pt]=b.useState(()=>localStorage.getItem("codeEditorLineNumbers")!=="false"),[Le,et]=b.useState(()=>localStorage.getItem("codeEditorFontSize")||"14"),[yt,be]=b.useState([]),[Ge,he]=b.useState([]),[Ee,J]=b.useState(!1),[ie,fe]=b.useState(""),[De,Ye]=b.useState(""),[mt,tt]=b.useState([]),[jt,$e]=b.useState([]),[_t,vt]=b.useState("default"),[ut,Ve]=b.useState(!1),[Xe,ht]=b.useState({name:"",type:"stdio",config:{command:"",args:[],env:{}}}),[Gt,Ft]=b.useState(null),[Lt,qt]=b.useState(!1),[ar,vr]=b.useState(!1),[Q,Pe]=b.useState(""),[le,ge]=b.useState(null),[ke,W]=b.useState({authenticated:!1,email:null,loading:!0,error:null}),[se,te]=b.useState({authenticated:!1,email:null,loading:!0,error:null}),[Be,At]=b.useState({authenticated:!1,email:null,loading:!0,error:null}),ur=async()=>{try{const Z=await Ae("/api/cursor/mcp");if(Z.ok){const me=await Z.json();tt(me.servers||[])}else console.error("Failed to fetch Cursor MCP servers")}catch(Z){console.error("Error fetching Cursor MCP servers:",Z)}},er=async()=>{try{const Z=await Ae("/api/codex/mcp/config/read");if(Z.ok){const je=await Z.json();if(je.success&&je.servers){$e(je.servers);return}}const me=await Ae("/api/codex/mcp/cli/list");if(me.ok){const je=await me.json();if(je.success&&je.servers){const st=je.servers.map(fr=>({id:fr.name,name:fr.name,type:fr.type||"stdio",scope:"user",config:{command:fr.command||"",args:fr.args||[],env:fr.env||{}}}));$e(st)}}}catch(Z){console.error("Error fetching Codex MCP servers:",Z)}},wr=async()=>{try{const Z=await Ae("/api/mcp/config/read");if(Z.ok){const st=await Z.json();if(st.success&&st.servers){M(st.servers);return}}const me=await Ae("/api/mcp/cli/list");if(me.ok){const st=await me.json();if(st.success&&st.servers){const fr=st.servers.map(Fr=>({id:Fr.name,name:Fr.name,type:Fr.type,scope:"user",config:{command:Fr.command||"",args:Fr.args||[],env:Fr.env||{},url:Fr.url||"",headers:Fr.headers||{},timeout:3e4},created:new Date().toISOString(),updated:new Date().toISOString()}));M(fr);return}}const je=await Ae("/api/mcp/servers?scope=user");if(je.ok){const st=await je.json();M(st.servers||[])}else console.error("Failed to fetch MCP servers")}catch(Z){console.error("Error fetching MCP servers:",Z)}},Ir=async Z=>{try{G&&await sa(G.id,"user");const me=await Ae("/api/mcp/cli/add",{method:"POST",body:JSON.stringify({name:Z.name,type:Z.type,scope:Z.scope,projectPath:Z.projectPath,command:Z.config?.command,args:Z.config?.args||[],url:Z.config?.url,headers:Z.config?.headers||{},env:Z.config?.env||{}})});if(me.ok){const je=await me.json();if(je.success)return await wr(),!0;throw new Error(je.error||"Failed to save server via Claude CLI")}else{const je=await me.json();throw new Error(je.error||"Failed to save server")}}catch(me){throw console.error("Error saving MCP server:",me),me}},sa=async(Z,me="user")=>{try{const je=await Ae(`/api/mcp/cli/remove/${Z}?scope=${me}`,{method:"DELETE"});if(je.ok){const st=await je.json();if(st.success)return await wr(),!0;throw new Error(st.error||"Failed to delete server via Claude CLI")}else{const st=await je.json();throw new Error(st.error||"Failed to delete server")}}catch(je){throw console.error("Error deleting MCP server:",je),je}},On=async(Z,me="user")=>{try{const je=await Ae(`/api/mcp/servers/${Z}/test?scope=${me}`,{method:"POST"});if(je.ok)return(await je.json()).testResult;{const st=await je.json();throw new Error(st.error||"Failed to test server")}}catch(je){throw console.error("Error testing MCP server:",je),je}},Sr=async(Z,me="user")=>{try{const je=await Ae(`/api/mcp/servers/${Z}/tools?scope=${me}`,{method:"POST"});if(je.ok)return(await je.json()).toolsResult;{const st=await je.json();throw new Error(st.error||"Failed to discover tools")}}catch(je){throw console.error("Error discovering MCP tools:",je),je}},oa=async Z=>{try{Gt&&await Hr(Gt.id);const me=await Ae("/api/codex/mcp/cli/add",{method:"POST",body:JSON.stringify({name:Z.name,command:Z.config?.command,args:Z.config?.args||[],env:Z.config?.env||{}})});if(me.ok){const je=await me.json();if(je.success)return await er(),!0;throw new Error(je.error||"Failed to save Codex MCP server")}else{const je=await me.json();throw new Error(je.error||"Failed to save server")}}catch(me){throw console.error("Error saving Codex MCP server:",me),me}},Hr=async Z=>{try{const me=await Ae(`/api/codex/mcp/cli/remove/${Z}`,{method:"DELETE"});if(me.ok){const je=await me.json();if(je.success)return await er(),!0;throw new Error(je.error||"Failed to delete Codex MCP server")}else{const je=await me.json();throw new Error(je.error||"Failed to delete server")}}catch(me){throw console.error("Error deleting Codex MCP server:",me),me}},Yt=()=>{ht({name:"",type:"stdio",config:{command:"",args:[],env:{}}}),Ft(null),Ve(!1)},Ka=(Z=null)=>{Z?(Ft(Z),ht({name:Z.name,type:Z.type||"stdio",config:{command:Z.config?.command||"",args:Z.config?.args||[],env:Z.config?.env||{}}})):Yt(),Ve(!0)},dn=async Z=>{Z.preventDefault(),qt(!0);try{Gt&&await Hr(Gt.name),await oa(Xe),Yt(),A("success")}catch(me){alert(`Error: ${me.message}`),A("error")}finally{qt(!1)}},bn=async Z=>{if(confirm("Are you sure you want to delete this MCP server?"))try{await Hr(Z),A("success")}catch(me){alert(`Error: ${me.message}`),A("error")}};b.useEffect(()=>{e&&(Fi(),xn(),Ya(),Na(),K(n))},[e,n]),b.useEffect(()=>{localStorage.setItem("codeEditorTheme",_e),window.dispatchEvent(new Event("codeEditorSettingsChanged"))},[_e]),b.useEffect(()=>{localStorage.setItem("codeEditorWordWrap",Ke.toString()),window.dispatchEvent(new Event("codeEditorSettingsChanged"))},[Ke]),b.useEffect(()=>{localStorage.setItem("codeEditorShowMinimap",dt.toString()),window.dispatchEvent(new Event("codeEditorSettingsChanged"))},[dt]),b.useEffect(()=>{localStorage.setItem("codeEditorLineNumbers",ft.toString()),window.dispatchEvent(new Event("codeEditorSettingsChanged"))},[ft]),b.useEffect(()=>{localStorage.setItem("codeEditorFontSize",Le),window.dispatchEvent(new Event("codeEditorSettingsChanged"))},[Le]);const Fi=async()=>{try{const Z=localStorage.getItem("claude-settings");if(Z){const st=JSON.parse(Z);c(st.allowedTools||[]),d(st.disallowedTools||[]),k(st.skipPermissions||!1),E(st.projectSortOrder||"name")}else c([]),d([]),k(!1),E("name");const me=localStorage.getItem("cursor-tools-settings");if(me){const st=JSON.parse(me);be(st.allowedCommands||[]),he(st.disallowedCommands||[]),J(st.skipPermissions||!1)}else be([]),he([]),J(!1);const je=localStorage.getItem("codex-settings");if(je){const st=JSON.parse(je);vt(st.permissionMode||"default")}else vt("default");await wr(),await ur(),await er()}catch(Z){console.error("Error loading tool settings:",Z),c([]),d([]),k(!1),E("name")}},xn=async()=>{try{const Z=await Ae("/api/cli/claude/status");if(Z.ok){const me=await Z.json();W({authenticated:me.authenticated,email:me.email,loading:!1,error:me.error||null})}else W({authenticated:!1,email:null,loading:!1,error:"Failed to check authentication status"})}catch(Z){console.error("Error checking Claude auth status:",Z),W({authenticated:!1,email:null,loading:!1,error:Z.message})}},Ya=async()=>{try{const Z=await Ae("/api/cli/cursor/status");if(Z.ok){const me=await Z.json();te({authenticated:me.authenticated,email:me.email,loading:!1,error:me.error||null})}else te({authenticated:!1,email:null,loading:!1,error:"Failed to check authentication status"})}catch(Z){console.error("Error checking Cursor auth status:",Z),te({authenticated:!1,email:null,loading:!1,error:Z.message})}},Na=async()=>{try{const Z=await Ae("/api/cli/codex/status");if(Z.ok){const me=await Z.json();At({authenticated:me.authenticated,email:me.email,loading:!1,error:me.error||null})}else At({authenticated:!1,email:null,loading:!1,error:"Failed to check authentication status"})}catch(Z){console.error("Error checking Codex auth status:",Z),At({authenticated:!1,email:null,loading:!1,error:Z.message})}},yn=()=>{Pe("claude"),ge(r?.[0]||{name:"default",fullPath:process.cwd()}),vr(!0)},ul=()=>{Pe("cursor"),ge(r?.[0]||{name:"default",fullPath:process.cwd()}),vr(!0)},Dn=()=>{Pe("codex"),ge(r?.[0]||{name:"default",fullPath:process.cwd()}),vr(!0)},tn=Z=>{Z===0&&(A("success"),Q==="claude"?xn():Q==="cursor"?Ya():Q==="codex"&&Na())},Mn=()=>{v(!0),A(null);try{const Z={allowedTools:l,disallowedTools:u,skipPermissions:f,projectSortOrder:I,lastUpdated:new Date().toISOString()},me={allowedCommands:yt,disallowedCommands:Ge,skipPermissions:Ee,lastUpdated:new Date().toISOString()},je={permissionMode:_t,lastUpdated:new Date().toISOString()};localStorage.setItem("claude-settings",JSON.stringify(Z)),localStorage.setItem("cursor-tools-settings",JSON.stringify(me)),localStorage.setItem("codex-settings",JSON.stringify(je)),A("success"),setTimeout(()=>{t()},1e3)}catch(Z){console.error("Error saving tool settings:",Z),A("error")}finally{v(!1)}},Fn=()=>{P({name:"",type:"stdio",scope:"user",projectPath:"",config:{command:"",args:[],env:{},url:"",headers:{},timeout:3e4},jsonInput:"",importMode:"form"}),V(null),j(!1),ve("")},pn=(Z=null)=>{Z?(V(Z),P({name:Z.name,type:Z.type,scope:Z.scope,projectPath:Z.projectPath||"",config:{...Z.config},raw:Z.raw,importMode:"form",jsonInput:""})):Fn(),j(!0)},As=async Z=>{Z.preventDefault(),F(!0);try{if(D.importMode==="json"){const me=await Ae("/api/mcp/cli/add-json",{method:"POST",body:JSON.stringify({name:D.name,jsonConfig:D.jsonInput,scope:D.scope,projectPath:D.projectPath})});if(me.ok){const je=await me.json();if(je.success)await wr(),Fn(),A("success");else throw new Error(je.error||"Failed to add server via JSON")}else{const je=await me.json();throw new Error(je.error||"Failed to add server")}}else await Ir(D),Fn(),A("success")}catch(me){alert(`Error: ${me.message}`),A("error")}finally{F(!1)}},vn=async(Z,me)=>{if(confirm("Are you sure you want to delete this MCP server?"))try{await sa(Z,me),A("success")}catch(je){alert(`Error: ${je.message}`),A("error")}},Ca=async(Z,me)=>{try{H({...$,[Z]:{loading:!0}});const je=await On(Z,me);H({...$,[Z]:je})}catch(je){H({...$,[Z]:{success:!1,message:je.message,details:[]}})}},dl=async(Z,me)=>{try{re({...z,[Z]:!0});const je=await Sr(Z,me);N({...ne,[Z]:je})}catch{N({...ne,[Z]:{success:!1,tools:[],resources:[],prompts:[]}})}finally{re({...z,[Z]:!1})}},Ta=(Z,me)=>{P(je=>({...je,config:{...je.config,[Z]:me}}))};return e?i.jsxs("div",{className:"modal-backdrop fixed inset-0 flex items-center justify-center z-[9999] md:p-4 bg-background/95",children:[i.jsxs("div",{className:"bg-background border border-border md:rounded-lg shadow-xl w-full md:max-w-4xl h-full md:h-[90vh] flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between p-4 md:p-6 border-b border-border flex-shrink-0",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Pa,{className:"w-5 h-5 md:w-6 md:h-6 text-blue-600"}),i.jsx("h2",{className:"text-lg md:text-xl font-semibold text-foreground",children:o("title")})]}),i.jsx(ze,{variant:"ghost",size:"sm",onClick:t,className:"text-muted-foreground hover:text-foreground touch-manipulation",children:i.jsx($t,{className:"w-5 h-5"})})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto",children:[i.jsx("div",{className:"border-b border-border",children:i.jsxs("div",{className:"flex px-4 md:px-6",children:[i.jsx("button",{onClick:()=>K("agents"),className:`px-4 py-3 text-sm font-medium border-b-2 transition-colors ${R==="agents"?"border-blue-600 text-blue-600 dark:text-blue-400":"border-transparent text-muted-foreground hover:text-foreground"}`,children:o("mainTabs.agents")}),i.jsx("button",{onClick:()=>K("appearance"),className:`px-4 py-3 text-sm font-medium border-b-2 transition-colors ${R==="appearance"?"border-blue-600 text-blue-600 dark:text-blue-400":"border-transparent text-muted-foreground hover:text-foreground"}`,children:o("mainTabs.appearance")}),i.jsxs("button",{onClick:()=>K("git"),className:`px-4 py-3 text-sm font-medium border-b-2 transition-colors ${R==="git"?"border-blue-600 text-blue-600 dark:text-blue-400":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[i.jsx(ba,{className:"w-4 h-4 inline mr-2"}),o("mainTabs.git")]}),i.jsxs("button",{onClick:()=>K("api"),className:`px-4 py-3 text-sm font-medium border-b-2 transition-colors ${R==="api"?"border-blue-600 text-blue-600 dark:text-blue-400":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[i.jsx(hg,{className:"w-4 h-4 inline mr-2"}),o("mainTabs.apiTokens")]}),i.jsx("button",{onClick:()=>K("tasks"),className:`px-4 py-3 text-sm font-medium border-b-2 transition-colors ${R==="tasks"?"border-blue-600 text-blue-600 dark:text-blue-400":"border-transparent text-muted-foreground hover:text-foreground"}`,children:o("mainTabs.tasks")})]})}),i.jsxs("div",{className:"p-4 md:p-6 space-y-6 md:space-y-8 pb-safe-area-inset-bottom",children:[R==="appearance"&&i.jsx("div",{className:"space-y-6 md:space-y-8",children:R==="appearance"&&i.jsxs("div",{className:"space-y-6 md:space-y-8",children:[i.jsx("div",{className:"space-y-4",children:i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-foreground",children:o("appearanceSettings.darkMode.label")}),i.jsx("div",{className:"text-sm text-muted-foreground",children:o("appearanceSettings.darkMode.description")})]}),i.jsxs("button",{onClick:s,className:"relative inline-flex h-8 w-14 items-center rounded-full bg-gray-200 dark:bg-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",role:"switch","aria-checked":a,"aria-label":"Toggle dark mode",children:[i.jsx("span",{className:"sr-only",children:"Toggle dark mode"}),i.jsx("span",{className:`${a?"translate-x-7":"translate-x-1"} inline-block h-6 w-6 transform rounded-full bg-white shadow-lg transition-transform duration-200 flex items-center justify-center`,children:a?i.jsx(dh,{className:"w-3.5 h-3.5 text-gray-700"}):i.jsx(ph,{className:"w-3.5 h-3.5 text-yellow-500"})})]})]})})}),i.jsx("div",{className:"space-y-4",children:i.jsx(K3,{})}),i.jsx("div",{className:"space-y-4",children:i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-foreground",children:o("appearanceSettings.projectSorting.label")}),i.jsx("div",{className:"text-sm text-muted-foreground",children:o("appearanceSettings.projectSorting.description")})]}),i.jsxs("select",{value:I,onChange:Z=>E(Z.target.value),className:"text-sm bg-gray-50 dark:bg-gray-800 border border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500 p-2 w-32",children:[i.jsx("option",{value:"name",children:o("appearanceSettings.projectSorting.alphabetical")}),i.jsx("option",{value:"date",children:o("appearanceSettings.projectSorting.recentActivity")})]})]})})}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-lg font-semibold text-foreground",children:o("appearanceSettings.codeEditor.title")}),i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-foreground",children:o("appearanceSettings.codeEditor.theme.label")}),i.jsx("div",{className:"text-sm text-muted-foreground",children:o("appearanceSettings.codeEditor.theme.description")})]}),i.jsxs("button",{onClick:()=>qe(_e==="dark"?"light":"dark"),className:"relative inline-flex h-8 w-14 items-center rounded-full bg-gray-200 dark:bg-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",role:"switch","aria-checked":_e==="dark","aria-label":"Toggle editor theme",children:[i.jsx("span",{className:"sr-only",children:"Toggle editor theme"}),i.jsx("span",{className:`${_e==="dark"?"translate-x-7":"translate-x-1"} inline-block h-6 w-6 transform rounded-full bg-white shadow-lg transition-transform duration-200 flex items-center justify-center`,children:_e==="dark"?i.jsx(dh,{className:"w-3.5 h-3.5 text-gray-700"}):i.jsx(ph,{className:"w-3.5 h-3.5 text-yellow-500"})})]})]})}),i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-foreground",children:o("appearanceSettings.codeEditor.wordWrap.label")}),i.jsx("div",{className:"text-sm text-muted-foreground",children:o("appearanceSettings.codeEditor.wordWrap.description")})]}),i.jsxs("button",{onClick:()=>xt(!Ke),className:"relative inline-flex h-8 w-14 items-center rounded-full bg-gray-200 dark:bg-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",role:"switch","aria-checked":Ke,"aria-label":"Toggle word wrap",children:[i.jsx("span",{className:"sr-only",children:"Toggle word wrap"}),i.jsx("span",{className:`${Ke?"translate-x-7":"translate-x-1"} inline-block h-6 w-6 transform rounded-full bg-white shadow-lg transition-transform duration-200`})]})]})}),i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-foreground",children:o("appearanceSettings.codeEditor.showMinimap.label")}),i.jsx("div",{className:"text-sm text-muted-foreground",children:o("appearanceSettings.codeEditor.showMinimap.description")})]}),i.jsxs("button",{onClick:()=>St(!dt),className:"relative inline-flex h-8 w-14 items-center rounded-full bg-gray-200 dark:bg-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",role:"switch","aria-checked":dt,"aria-label":"Toggle minimap",children:[i.jsx("span",{className:"sr-only",children:"Toggle minimap"}),i.jsx("span",{className:`${dt?"translate-x-7":"translate-x-1"} inline-block h-6 w-6 transform rounded-full bg-white shadow-lg transition-transform duration-200`})]})]})}),i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-foreground",children:o("appearanceSettings.codeEditor.lineNumbers.label")}),i.jsx("div",{className:"text-sm text-muted-foreground",children:o("appearanceSettings.codeEditor.lineNumbers.description")})]}),i.jsxs("button",{onClick:()=>pt(!ft),className:"relative inline-flex h-8 w-14 items-center rounded-full bg-gray-200 dark:bg-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",role:"switch","aria-checked":ft,"aria-label":"Toggle line numbers",children:[i.jsx("span",{className:"sr-only",children:"Toggle line numbers"}),i.jsx("span",{className:`${ft?"translate-x-7":"translate-x-1"} inline-block h-6 w-6 transform rounded-full bg-white shadow-lg transition-transform duration-200`})]})]})}),i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-foreground",children:o("appearanceSettings.codeEditor.fontSize.label")}),i.jsx("div",{className:"text-sm text-muted-foreground",children:o("appearanceSettings.codeEditor.fontSize.description")})]}),i.jsxs("select",{value:Le,onChange:Z=>et(Z.target.value),className:"text-sm bg-gray-50 dark:bg-gray-800 border border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500 p-2 w-24",children:[i.jsx("option",{value:"10",children:"10px"}),i.jsx("option",{value:"11",children:"11px"}),i.jsx("option",{value:"12",children:"12px"}),i.jsx("option",{value:"13",children:"13px"}),i.jsx("option",{value:"14",children:"14px"}),i.jsx("option",{value:"15",children:"15px"}),i.jsx("option",{value:"16",children:"16px"}),i.jsx("option",{value:"18",children:"18px"}),i.jsx("option",{value:"20",children:"20px"})]})]})})]})]})}),R==="git"&&i.jsx(MH,{}),R==="agents"&&i.jsxs("div",{className:"flex flex-col md:flex-row h-full min-h-[400px] md:min-h-[500px]",children:[i.jsx("div",{className:"md:hidden border-b border-gray-200 dark:border-gray-700 flex-shrink-0",children:i.jsxs("div",{className:"flex",children:[i.jsx(oi,{agentId:"claude",authStatus:ke,isSelected:oe==="claude",onClick:()=>Ie("claude"),isMobile:!0}),i.jsx(oi,{agentId:"cursor",authStatus:se,isSelected:oe==="cursor",onClick:()=>Ie("cursor"),isMobile:!0}),i.jsx(oi,{agentId:"codex",authStatus:Be,isSelected:oe==="codex",onClick:()=>Ie("codex"),isMobile:!0})]})}),i.jsx("div",{className:"hidden md:block w-48 border-r border-gray-200 dark:border-gray-700 flex-shrink-0",children:i.jsxs("div",{className:"p-2",children:[i.jsx(oi,{agentId:"claude",authStatus:ke,isSelected:oe==="claude",onClick:()=>Ie("claude")}),i.jsx(oi,{agentId:"cursor",authStatus:se,isSelected:oe==="cursor",onClick:()=>Ie("cursor")}),i.jsx(oi,{agentId:"codex",authStatus:Be,isSelected:oe==="codex",onClick:()=>Ie("codex")})]})}),i.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[i.jsx("div",{className:"border-b border-gray-200 dark:border-gray-700 flex-shrink-0",children:i.jsxs("div",{className:"flex px-2 md:px-4 overflow-x-auto",children:[i.jsx("button",{onClick:()=>ye("account"),className:`px-3 md:px-4 py-2 md:py-3 text-xs md:text-sm font-medium border-b-2 transition-colors whitespace-nowrap ${ce==="account"?"border-blue-600 text-blue-600 dark:text-blue-400":"border-transparent text-muted-foreground hover:text-foreground"}`,children:o("tabs.account")}),i.jsx("button",{onClick:()=>ye("permissions"),className:`px-3 md:px-4 py-2 md:py-3 text-xs md:text-sm font-medium border-b-2 transition-colors whitespace-nowrap ${ce==="permissions"?"border-blue-600 text-blue-600 dark:text-blue-400":"border-transparent text-muted-foreground hover:text-foreground"}`,children:o("tabs.permissions")}),i.jsx("button",{onClick:()=>ye("mcp"),className:`px-3 md:px-4 py-2 md:py-3 text-xs md:text-sm font-medium border-b-2 transition-colors whitespace-nowrap ${ce==="mcp"?"border-blue-600 text-blue-600 dark:text-blue-400":"border-transparent text-muted-foreground hover:text-foreground"}`,children:o("tabs.mcpServers")})]})}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-3 md:p-4",children:[ce==="account"&&i.jsx(UH,{agent:oe,authStatus:oe==="claude"?ke:oe==="cursor"?se:Be,onLogin:oe==="claude"?yn:oe==="cursor"?ul:Dn}),ce==="permissions"&&oe==="claude"&&i.jsx(sh,{agent:"claude",skipPermissions:f,setSkipPermissions:k,allowedTools:l,setAllowedTools:c,disallowedTools:u,setDisallowedTools:d,newAllowedTool:p,setNewAllowedTool:h,newDisallowedTool:m,setNewDisallowedTool:g}),ce==="permissions"&&oe==="cursor"&&i.jsx(sh,{agent:"cursor",skipPermissions:Ee,setSkipPermissions:J,allowedCommands:yt,setAllowedCommands:be,disallowedCommands:Ge,setDisallowedCommands:he,newAllowedCommand:ie,setNewAllowedCommand:fe,newDisallowedCommand:De,setNewDisallowedCommand:Ye}),ce==="permissions"&&oe==="codex"&&i.jsx(sh,{agent:"codex",permissionMode:_t,setPermissionMode:vt}),ce==="mcp"&&oe==="claude"&&i.jsx(oh,{agent:"claude",servers:C,onAdd:()=>pn(),onEdit:Z=>pn(Z),onDelete:(Z,me)=>vn(Z,me),onTest:(Z,me)=>Ca(Z,me),onDiscoverTools:(Z,me)=>dl(Z,me),testResults:$,serverTools:ne,toolsLoading:z}),ce==="mcp"&&oe==="cursor"&&i.jsx(oh,{agent:"cursor",servers:mt,onAdd:()=>{},onEdit:Z=>{},onDelete:Z=>{}}),ce==="mcp"&&oe==="codex"&&i.jsx(oh,{agent:"codex",servers:jt,onAdd:()=>Ka(),onEdit:Z=>Ka(Z),onDelete:Z=>bn(Z)})]})]})]}),O&&i.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[110] p-4",children:i.jsxs("div",{className:"bg-background border border-border rounded-lg w-full max-w-2xl max-h-[90vh] overflow-y-auto",children:[i.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[i.jsx("h3",{className:"text-lg font-medium text-foreground",children:o(G?"mcpForm.title.edit":"mcpForm.title.add")}),i.jsx(ze,{variant:"ghost",size:"sm",onClick:Fn,children:i.jsx($t,{className:"w-4 h-4"})})]}),i.jsxs("form",{onSubmit:As,className:"p-4 space-y-4",children:[!G&&i.jsxs("div",{className:"flex gap-2 mb-4",children:[i.jsx("button",{type:"button",onClick:()=>P(Z=>({...Z,importMode:"form"})),className:`px-4 py-2 rounded-lg font-medium transition-colors ${D.importMode==="form"?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:o("mcpForm.importMode.form")}),i.jsx("button",{type:"button",onClick:()=>P(Z=>({...Z,importMode:"json"})),className:`px-4 py-2 rounded-lg font-medium transition-colors ${D.importMode==="json"?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:o("mcpForm.importMode.json")})]}),D.importMode==="form"&&G&&i.jsxs("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-3",children:[i.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:o("mcpForm.scope.label")}),i.jsxs("div",{className:"flex items-center gap-2",children:[D.scope==="user"?i.jsx(uh,{className:"w-4 h-4"}):i.jsx(An,{className:"w-4 h-4"}),i.jsx("span",{className:"text-sm",children:D.scope==="user"?o("mcpForm.scope.userGlobal"):o("mcpForm.scope.projectLocal")}),D.scope==="local"&&D.projectPath&&i.jsxs("span",{className:"text-xs text-muted-foreground",children:["- ",D.projectPath]})]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:o("mcpForm.scope.cannotChange")})]}),D.importMode==="form"&&!G&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsxs("label",{className:"block text-sm font-medium text-foreground mb-2",children:[o("mcpForm.scope.label")," *"]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{type:"button",onClick:()=>P(Z=>({...Z,scope:"user",projectPath:""})),className:`flex-1 px-4 py-2 rounded-lg font-medium transition-colors ${D.scope==="user"?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:i.jsxs("div",{className:"flex items-center justify-center gap-2",children:[i.jsx(uh,{className:"w-4 h-4"}),i.jsx("span",{children:o("mcpForm.scope.userGlobal")})]})}),i.jsx("button",{type:"button",onClick:()=>P(Z=>({...Z,scope:"local"})),className:`flex-1 px-4 py-2 rounded-lg font-medium transition-colors ${D.scope==="local"?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:i.jsxs("div",{className:"flex items-center justify-center gap-2",children:[i.jsx(An,{className:"w-4 h-4"}),i.jsx("span",{children:o("mcpForm.scope.projectLocal")})]})})]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:D.scope==="user"?o("mcpForm.scope.userDescription"):o("mcpForm.scope.projectDescription")})]}),D.scope==="local"&&!G&&i.jsxs("div",{children:[i.jsxs("label",{className:"block text-sm font-medium text-foreground mb-2",children:[o("mcpForm.fields.selectProject")," *"]}),i.jsxs("select",{value:D.projectPath,onChange:Z=>P(me=>({...me,projectPath:Z.target.value})),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500",required:D.scope==="local",children:[i.jsxs("option",{value:"",children:[o("mcpForm.fields.selectProject"),"..."]}),r.map(Z=>i.jsx("option",{value:Z.path||Z.fullPath,children:Z.displayName||Z.name},Z.name))]}),D.projectPath&&i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:o("mcpForm.projectPath",{path:D.projectPath})})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:D.importMode==="json"?"md:col-span-2":"",children:[i.jsxs("label",{className:"block text-sm font-medium text-foreground mb-2",children:[o("mcpForm.fields.serverName")," *"]}),i.jsx(lr,{value:D.name,onChange:Z=>{P(me=>({...me,name:Z.target.value}))},placeholder:o("mcpForm.placeholders.serverName"),required:!0})]}),D.importMode==="form"&&i.jsxs("div",{children:[i.jsxs("label",{className:"block text-sm font-medium text-foreground mb-2",children:[o("mcpForm.fields.transportType")," *"]}),i.jsxs("select",{value:D.type,onChange:Z=>{P(me=>({...me,type:Z.target.value}))},className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500",children:[i.jsx("option",{value:"stdio",children:"stdio"}),i.jsx("option",{value:"sse",children:"SSE"}),i.jsx("option",{value:"http",children:"HTTP"})]})]})]}),G&&D.raw&&D.importMode==="form"&&i.jsxs("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:[i.jsx("h4",{className:"text-sm font-medium text-foreground mb-2",children:o("mcpForm.configDetails",{configFile:G.scope==="global"?"~/.claude.json":"project config"})}),i.jsx("pre",{className:"text-xs bg-gray-100 dark:bg-gray-800 p-3 rounded overflow-x-auto",children:JSON.stringify(D.raw,null,2)})]}),D.importMode==="json"&&i.jsx("div",{className:"space-y-4",children:i.jsxs("div",{children:[i.jsxs("label",{className:"block text-sm font-medium text-foreground mb-2",children:[o("mcpForm.fields.jsonConfig")," *"]}),i.jsx("textarea",{value:D.jsonInput,onChange:Z=>{P(me=>({...me,jsonInput:Z.target.value}));try{if(Z.target.value.trim()){const me=JSON.parse(Z.target.value);me.type?me.type==="stdio"&&!me.command?ve(o("mcpForm.validation.stdioRequiresCommand")):(me.type==="http"||me.type==="sse")&&!me.url?ve(o("mcpForm.validation.httpRequiresUrl",{type:me.type})):ve(""):ve(o("mcpForm.validation.missingType"))}}catch{Z.target.value.trim()?ve(o("mcpForm.validation.invalidJson")):ve("")}},className:`w-full px-3 py-2 border ${pe?"border-red-500":"border-gray-300 dark:border-gray-600"} bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500 font-mono text-sm`,rows:"8",placeholder:`{
1216
+ `).length]}),i.jsxs("span",{children:["Characters: ",l.length]}),i.jsxs("span",{children:["Words: ",l.split(/\s+/).filter(R=>R.length>0).length]}),i.jsx("span",{children:"Format: Markdown"})]}),i.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Press Ctrl+S to save • Esc to close"})]})]}),O&&i.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:i.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl w-full max-w-md border border-gray-200 dark:border-gray-700",children:[i.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-8 h-8 bg-purple-100 dark:bg-purple-900/50 rounded-lg flex items-center justify-center",children:i.jsx(Wn,{className:"w-4 h-4 text-purple-600 dark:text-purple-400"})}),i.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Generate Tasks from PRD"})]}),i.jsx("button",{onClick:()=>j(!1),className:"p-2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700",children:i.jsx($t,{className:"w-5 h-5"})})]}),i.jsxs("div",{className:"p-6 space-y-4",children:[i.jsx("div",{className:"bg-purple-50 dark:bg-purple-900/20 rounded-lg p-4 border border-purple-200 dark:border-purple-800",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:"w-8 h-8 bg-purple-100 dark:bg-purple-900/50 rounded-lg flex items-center justify-center flex-shrink-0 mt-0.5",children:i.jsx(Wn,{className:"w-4 h-4 text-purple-600 dark:text-purple-400"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h4",{className:"font-semibold text-purple-900 dark:text-purple-100 mb-2",children:"💡 Pro Tip: Ask Claude Code Directly!"}),i.jsx("p",{className:"text-sm text-purple-800 dark:text-purple-200 mb-3",children:"You can simply ask Claude Code in the chat to parse your PRD and generate tasks. The AI assistant will automatically save your PRD and create detailed tasks with implementation details."}),i.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded border border-purple-200 dark:border-purple-700 p-3 mb-3",children:[i.jsx("p",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:"💬 Example:"}),i.jsxs("p",{className:"text-xs text-gray-900 dark:text-white font-mono",children:[`"I've just initialized a new project with Claude Task Master. I have a PRD at .taskmaster/docs/`,C.endsWith(".txt")||C.endsWith(".md")?C:`${C}.txt`,'. Can you help me parse it and set up the initial tasks?"']})]}),i.jsxs("p",{className:"text-xs text-purple-700 dark:text-purple-300",children:[i.jsx("strong",{children:"This will:"})," Save your PRD, analyze its content, and generate structured tasks with subtasks, dependencies, and implementation details."]})]})]})}),i.jsxs("div",{className:"text-center pt-4 border-t border-gray-200 dark:border-gray-700",children:[i.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-3",children:"For more examples and advanced usage patterns:"}),i.jsx("a",{href:"https://github.com/eyaltoledano/claude-task-master/blob/main/docs/examples.md",target:"_blank",rel:"noopener noreferrer",className:"inline-block text-sm text-purple-600 dark:text-purple-400 hover:text-purple-700 dark:hover:text-purple-300 underline font-medium",children:"View TaskMaster Documentation →"})]}),i.jsx("div",{className:"pt-4",children:i.jsx("button",{onClick:()=>j(!1),className:"w-full px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-600 transition-colors",children:"Got it, I'll ask Claude Code directly"})})]})]})}),G&&i.jsxs("div",{className:"fixed inset-0 z-[300] flex items-center justify-center p-4",children:[i.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50",onClick:()=>V(!1)}),i.jsx("div",{className:"relative bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-md w-full border border-gray-200 dark:border-gray-700",children:i.jsxs("div",{className:"p-6",children:[i.jsxs("div",{className:"flex items-center mb-4",children:[i.jsx("div",{className:"p-2 rounded-full mr-3 bg-yellow-100 dark:bg-yellow-900",children:i.jsx(Yn,{className:"w-5 h-5 text-yellow-600 dark:text-yellow-400"})}),i.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"File Already Exists"})]}),i.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:['A PRD file named "',C.endsWith(".txt")||C.endsWith(".md")?C:`${C}.txt`,'" already exists. Do you want to overwrite it with the current content?']}),i.jsxs("div",{className:"flex justify-end space-x-3",children:[i.jsx("button",{onClick:()=>V(!1),className:"px-4 py-2 text-sm text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md hover:bg-gray-50 dark:hover:bg-gray-600 transition-colors",children:"Cancel"}),i.jsxs("button",{onClick:async()=>{V(!1),await H()},className:"px-4 py-2 text-sm text-white bg-yellow-600 hover:bg-yellow-700 rounded-md flex items-center space-x-2 transition-colors",children:[i.jsx(wo,{className:"w-4 h-4"}),i.jsx("span",{children:"Overwrite"})]})]})]})})]})]})};function LH({selectedProject:e,selectedSession:t,activeTab:r,setActiveTab:n,ws:a,sendMessage:s,latestMessage:o,isMobile:l,isPWA:c,onMenuClick:u,isLoading:d,onInputFocusChange:p,onSessionActive:h,onSessionInactive:m,onSessionProcessing:g,onSessionNotProcessing:f,processingSessions:k,onReplaceTemporarySession:S,onNavigateToSession:v,onShowSettings:w,autoExpandTools:A,showRawParameters:I,showThinking:E,autoScrollToBottom:C,sendByCtrlEnter:M,externalMessageUpdate:O,urlProvider:j,urlModel:G,urlContext:V,urlPrompt:D,onShowNewProject:P,onNewSession:B}){const{t:F}=Kt(),[$,H]=b.useState(null),[ne,N]=b.useState(null),[z,re]=b.useState(!1),[R,K]=b.useState(600),[pe,ve]=b.useState(!1),[oe,Ie]=b.useState(!1),ce=b.useRef(null),[ye,_e]=b.useState(!1),[qe,Ke]=b.useState(null),[xt,dt]=b.useState([]),[St,ft]=b.useState(null),{tasks:pt,currentProject:Le,refreshTasks:et,setCurrentProject:yt}=ys(),{tasksEnabled:be,isTaskMasterInstalled:Ge,isTaskMasterReady:he}=Wo(),Ee=be&&Ge;b.useEffect(()=>{e&&e!==Le&&yt(e)},[e,Le,yt]),b.useEffect(()=>{!Ee&&r==="tasks"&&n("chat")},[Ee,r,n]),b.useEffect(()=>{(async()=>{if(!Le?.name){dt([]);return}try{const Xe=await bt.get(`/taskmaster/prd/${encodeURIComponent(Le.name)}`);if(Xe.ok){const ht=await Xe.json();dt(ht.prdFiles||[])}else dt([])}catch(Xe){console.error("Failed to load existing PRDs:",Xe),dt([])}})()},[Le?.name]);const J=(Ve,Xe=null)=>{const ht={name:Ve.split("/").pop(),path:Ve,projectName:e?.name,diffInfo:Xe};H(ht)},ie=()=>{H(null),Ie(!1)},fe=()=>{Ie(!oe)},De=Ve=>{if(typeof Ve=="object"&&Ve.id&&!Ve.title){const Xe=pt?.find(ht=>ht.id===Ve.id);Xe&&(N(Xe),re(!0))}else N(Ve),re(!0)},Ye=()=>{re(!1),N(null)},mt=(Ve,Xe)=>{console.log("Update task status:",Ve,Xe),et?.()},tt=Ve=>{l||(ve(!0),Ve.preventDefault())};if(b.useEffect(()=>{const Ve=ht=>{if(!pe)return;const Gt=ce.current?.parentElement;if(!Gt)return;const Ft=Gt.getBoundingClientRect(),Lt=Ft.right-ht.clientX,qt=300,ar=Ft.width*.8;Lt>=qt&&Lt<=ar&&K(Lt)},Xe=()=>{ve(!1)};return pe&&(document.addEventListener("mousemove",Ve),document.addEventListener("mouseup",Xe),document.body.style.cursor="col-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",Ve),document.removeEventListener("mouseup",Xe),document.body.style.cursor="",document.body.style.userSelect=""}},[pe]),d)return i.jsxs("div",{className:"h-full flex flex-col",children:[l&&i.jsx("div",{className:"bg-background border-b border-border p-2 sm:p-3 pwa-header-safe flex-shrink-0",children:i.jsx("button",{onClick:u,className:"p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 pwa-menu-button",children:i.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})}),i.jsx("div",{className:"flex-1 flex items-center justify-center",children:i.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[i.jsx("div",{className:"w-12 h-12 mx-auto mb-4",children:i.jsx("div",{className:"w-full h-full rounded-full border-4 border-gray-200 border-t-blue-500",style:{animation:"spin 1s linear infinite",WebkitAnimation:"spin 1s linear infinite",MozAnimation:"spin 1s linear infinite"}})}),i.jsx("h2",{className:"text-xl font-semibold mb-2",children:F("mainContent.loading")}),i.jsx("p",{children:F("mainContent.settingUpWorkspace")})]})})]});if(!e)return i.jsxs("div",{className:"h-full flex flex-col",children:[l&&i.jsx("div",{className:"bg-background border-b border-border p-2 sm:p-3 pwa-header-safe flex-shrink-0",children:i.jsx("button",{onClick:u,className:"p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 pwa-menu-button",children:i.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})}),i.jsxs("div",{className:"flex-1 flex items-center justify-center",children:[i.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400 max-w-md mx-auto px-6",children:[i.jsx("div",{className:"w-16 h-16 mx-auto mb-6 bg-gray-100 dark:bg-gray-800 rounded-full flex items-center justify-center",children:i.jsx("svg",{className:"w-8 h-8 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-5l-2-2H5a2 2 0 00-2 2z"})})}),i.jsx("h2",{className:"text-2xl font-semibold mb-3 text-gray-900 dark:text-white",children:F("mainContent.chooseProject")}),i.jsx("p",{className:"text-gray-600 dark:text-gray-300 mb-6 leading-relaxed",children:F("mainContent.selectProjectDescription")}),i.jsx("div",{className:"bg-blue-50 dark:bg-blue-900/20 rounded-lg p-4 border border-blue-200 dark:border-blue-800",children:i.jsxs("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:["💡 ",i.jsxs("strong",{children:[F("mainContent.tip"),":"]})," ",F(l?"mainContent.createProjectMobile":"mainContent.createProjectDesktop")]})})]}),i.jsx("button",{onClick:P,className:"p-2 text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md transition-colors",title:F("tooltips.createProject")||"New Chat",children:i.jsx(gi,{className:"w-5 h-5"})})]})]});const jt=t?.__provider||t?.provider||"claude",$e=jt==="openai"?"codex":jt,_t=$e==="codex"&&typeof t?.id=="string"?t.id.trim():"",vt=_t?`codex://threads/${encodeURIComponent(_t)}`:"",ut=()=>{vt&&(window.location.href=vt)};return i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsx("div",{className:"bg-background border-b border-border p-2 sm:p-3 pwa-header-safe flex-shrink-0",children:i.jsxs("div",{className:"flex items-center justify-between relative",children:[i.jsxs("div",{className:"flex items-center space-x-2 min-w-0 flex-1",children:[l&&i.jsx("button",{onClick:u,onTouchStart:Ve=>{Ve.preventDefault(),u()},className:"p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 touch-manipulation active:scale-95 pwa-menu-button flex-shrink-0",children:i.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),i.jsxs("div",{className:"min-w-0 flex items-center gap-2 flex-1 overflow-x-auto scrollbar-hide",children:[r==="chat"&&t&&i.jsx("div",{className:"w-5 h-5 flex-shrink-0 flex items-center justify-center",children:$e==="cursor"?i.jsx(Xn,{className:"w-4 h-4"}):$e==="codex"?i.jsx(Zn,{className:"w-4 h-4"}):i.jsx(In,{className:"w-4 h-4"})}),i.jsx("div",{className:"min-w-0 flex-1",children:r==="chat"&&t?i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-sm sm:text-base font-semibold text-gray-900 dark:text-white whitespace-nowrap overflow-x-auto scrollbar-hide",children:$e==="cursor"?t.name||"Untitled Session":$e==="codex"?t.summary||t.name||"Codex Session":t.summary||"New Session"}),i.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:e.displayName})]}):r==="chat"&&!t?i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-sm sm:text-base font-semibold text-gray-900 dark:text-white",children:F("mainContent.newSession")}),i.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:e.displayName})]}):i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-sm sm:text-base font-semibold text-gray-900 dark:text-white",children:r==="files"?F("mainContent.projectFiles"):r==="git"?F("tabs.git"):r==="tasks"&&Ee?"TaskMaster":"Project"}),i.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:e.displayName})]})})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[r==="chat"&&$e==="codex"&&vt&&i.jsx("button",{onClick:ut,className:"p-1.5 text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md transition-colors",title:F("mainContent.openInCodexClient"),"aria-label":F("mainContent.openInCodexClient"),children:i.jsx(ch,{className:"w-5 h-5"})}),i.jsx("button",{onClick:()=>B&&B(e),className:"p-1.5 text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md transition-colors",title:F("tooltips.newChat","New Chat"),children:i.jsx(h6,{className:"w-5 h-5"})}),i.jsx("div",{className:"flex-shrink-0 hidden sm:block",children:i.jsxs("div",{className:"relative flex bg-gray-100 dark:bg-gray-800 rounded-lg p-1",children:[i.jsx(Nr,{content:F("tabs.chat"),position:"bottom",children:i.jsx("button",{onClick:()=>n("chat"),className:`relative px-2 sm:px-3 py-1.5 text-xs sm:text-sm font-medium rounded-md ${r==="chat"?"bg-white dark:bg-gray-700 text-gray-900 dark:text-white shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:i.jsxs("span",{className:"flex items-center gap-1 sm:gap-1.5",children:[i.jsx("svg",{className:"w-3 sm:w-3.5 h-3 sm:h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),i.jsx("span",{className:"hidden md:hidden lg:inline",children:F("tabs.chat")})]})})}),i.jsx(Nr,{content:F("tabs.files"),position:"bottom",children:i.jsx("button",{onClick:()=>n("files"),className:`relative px-2 sm:px-3 py-1.5 text-xs sm:text-sm font-medium rounded-md transition-all duration-200 ${r==="files"?"bg-white dark:bg-gray-700 text-gray-900 dark:text-white shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:i.jsxs("span",{className:"flex items-center gap-1 sm:gap-1.5",children:[i.jsx("svg",{className:"w-3 sm:w-3.5 h-3 sm:h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-5l-2-2H5a2 2 0 00-2 2z"})}),i.jsx("span",{className:"hidden md:hidden lg:inline",children:F("tabs.files")})]})})}),Ee&&i.jsx(Nr,{content:F("tabs.tasks"),position:"bottom",children:i.jsx("button",{onClick:()=>n("tasks"),className:`relative px-2 sm:px-3 py-1.5 text-xs sm:text-sm font-medium rounded-md transition-all duration-200 ${r==="tasks"?"bg-white dark:bg-gray-700 text-gray-900 dark:text-white shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:i.jsxs("span",{className:"flex items-center gap-1 sm:gap-1.5",children:[i.jsx("svg",{className:"w-3 sm:w-3.5 h-3 sm:h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})}),i.jsx("span",{className:"hidden md:hidden lg:inline",children:F("tabs.tasks")})]})})})]})})]})]})}),i.jsxs("div",{className:"flex-1 flex min-h-0 overflow-hidden",children:[i.jsxs("div",{className:`flex-1 flex flex-col min-h-0 overflow-hidden ${$?"mr-0":""} ${oe?"hidden":""}`,children:[i.jsx("div",{className:`h-full ${r==="chat"?"block":"hidden"}`,children:i.jsx(IH,{showDetails:!0,children:i.jsx(DG,{selectedProject:e,selectedSession:t,ws:a,sendMessage:s,latestMessage:o,onFileOpen:J,onInputFocusChange:p,onSessionActive:h,onSessionInactive:m,onSessionProcessing:g,onSessionNotProcessing:f,processingSessions:k,onReplaceTemporarySession:S,onNavigateToSession:v,onShowSettings:w,autoExpandTools:A,showRawParameters:I,showThinking:E,autoScrollToBottom:C,sendByCtrlEnter:M,externalMessageUpdate:O,urlProvider:j,urlModel:G,urlContext:V,urlPrompt:D,onShowAllTasks:be?()=>n("tasks"):null})})}),r==="files"&&i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(NH,{selectedProject:e})}),r==="shell"&&i.jsx("div",{className:"h-full w-full overflow-hidden",children:i.jsx(H3,{project:e,session:t,showHeader:!1})}),r==="git"&&i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(AH,{selectedProject:e,isMobile:l,onFileOpen:J})}),Ee&&i.jsx("div",{className:`h-full ${r==="tasks"?"block":"hidden"}`,children:i.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:i.jsx(jH,{tasks:pt||[],onTaskClick:De,showParentTasks:!0,className:"flex-1 overflow-y-auto p-4",currentProject:Le,onTaskCreated:et,onShowPRDEditor:(Ve=null)=>{Ke(Ve),_e(!0)},existingPRDs:xt,onRefreshPRDs:(Ve=!1)=>{Le?.name&&bt.get(`/taskmaster/prd/${encodeURIComponent(Le.name)}`).then(Xe=>Xe.ok?Xe.json():Promise.reject()).then(Xe=>{dt(Xe.prdFiles||[]),Ve&&(ft("PRD saved successfully!"),setTimeout(()=>ft(null),3e3))}).catch(Xe=>console.error("Failed to refresh PRDs:",Xe))}})})}),i.jsx("div",{className:`h-full overflow-hidden ${r==="preview"?"block":"hidden"}`})]}),$&&!l&&i.jsxs(i.Fragment,{children:[!oe&&i.jsx("div",{ref:ce,onMouseDown:tt,className:"flex-shrink-0 w-1 bg-gray-200 dark:bg-gray-700 hover:bg-blue-500 dark:hover:bg-blue-600 cursor-col-resize transition-colors relative group",title:"Drag to resize",children:i.jsx("div",{className:"absolute inset-y-0 left-1/2 -translate-x-1/2 w-1 bg-blue-500 dark:bg-blue-600 opacity-0 group-hover:opacity-100 transition-opacity"})}),i.jsx("div",{className:`flex-shrink-0 border-l border-gray-200 dark:border-gray-700 h-full overflow-hidden ${oe?"flex-1":""}`,style:oe?{}:{width:`${R}px`},children:i.jsx(sg,{file:$,onClose:ie,projectPath:e?.path,isSidebar:!0,isExpanded:oe,onToggleExpand:fe})})]})]}),$&&l&&i.jsx(sg,{file:$,onClose:ie,projectPath:e?.path,isSidebar:!1}),Ee&&z&&ne&&i.jsx(m3,{task:ne,isOpen:z,onClose:Ye,onStatusChange:mt,onTaskClick:De}),ye&&i.jsx(_H,{project:Le,projectPath:Le?.fullPath||Le?.path,onClose:()=>{_e(!1),Ke(null)},isNewFile:!qe?.isExisting,file:{name:qe?.name||"prd.txt",content:qe?.content||""},onSave:async()=>{_e(!1),Ke(null);try{const Ve=await bt.get(`/taskmaster/prd/${encodeURIComponent(Le.name)}`);if(Ve.ok){const Xe=await Ve.json();dt(Xe.prdFiles||[]),ft("PRD saved successfully!"),setTimeout(()=>ft(null),3e3)}}catch(Ve){console.error("Failed to refresh PRDs:",Ve)}et?.()}}),St&&i.jsx("div",{className:"fixed bottom-4 right-4 z-50 animate-in slide-in-from-bottom-2 duration-300",children:i.jsxs("div",{className:"bg-green-600 text-white px-4 py-3 rounded-lg shadow-lg flex items-center gap-3",children:[i.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),i.jsx("span",{className:"font-medium",children:St})]})})]})}const OH=dr.memo(LH),og="0.1.3",W3=(e,t)=>{const[r,n]=b.useState(!1),[a,s]=b.useState(null),[o,l]=b.useState(null);return b.useEffect(()=>{(async()=>{try{const d=await(await fetch(`https://api.github.com/repos/${e}/${t}/releases/latest`)).json();if(d.tag_name){const p=d.tag_name.replace(/^v/,"");s(p),n(og!==p),l({title:d.name||d.tag_name,body:d.body||"",htmlUrl:d.html_url||`https://github.com/${e}/${t}/releases/latest`,publishedAt:d.published_at})}else n(!1),s(null),l(null)}catch(u){console.error("Version check failed:",u),n(!1),s(null),l(null)}})()},[e,t]),{updateAvailable:r,latestVersion:a,currentVersion:og,releaseInfo:o}};function DH(){const{t:e}=Kt("settings"),[t,r]=b.useState([]),[n,a]=b.useState([]),[s,o]=b.useState(!0),[l,c]=b.useState(!1),[u,d]=b.useState(!1),[p,h]=b.useState(""),[m,g]=b.useState(""),[f,k]=b.useState(""),[S,v]=b.useState(""),[w,A]=b.useState({}),[I,E]=b.useState(null),[C,M]=b.useState(null),{updateAvailable:O,latestVersion:j,releaseInfo:G}=W3("lintendo","Axhub-Genie");b.useEffect(()=>{V()},[]);const V=async()=>{try{o(!0);const z=await(await Ae("/api/settings/api-keys")).json();r(z.apiKeys||[]);const R=await(await Ae("/api/settings/credentials?type=github_token")).json();a(R.credentials||[])}catch(N){console.error("Error fetching settings:",N)}finally{o(!1)}},D=async()=>{if(p.trim())try{const z=await(await Ae("/api/settings/api-keys",{method:"POST",body:JSON.stringify({keyName:p})})).json();z.success&&(M(z.apiKey),h(""),c(!1),V())}catch(N){console.error("Error creating API key:",N)}},P=async N=>{if(confirm(e("apiKeys.confirmDelete")))try{await Ae(`/api/settings/api-keys/${N}`,{method:"DELETE"}),V()}catch(z){console.error("Error deleting API key:",z)}},B=async(N,z)=>{try{await Ae(`/api/settings/api-keys/${N}/toggle`,{method:"PATCH",body:JSON.stringify({isActive:!z})}),V()}catch(re){console.error("Error toggling API key:",re)}},F=async()=>{if(!(!m.trim()||!f.trim()))try{(await(await Ae("/api/settings/credentials",{method:"POST",body:JSON.stringify({credentialName:m,credentialType:"github_token",credentialValue:f,description:S})})).json()).success&&(g(""),k(""),v(""),d(!1),V())}catch(N){console.error("Error creating GitHub credential:",N)}},$=async N=>{if(confirm(e("apiKeys.github.confirmDelete")))try{await Ae(`/api/settings/credentials/${N}`,{method:"DELETE"}),V()}catch(z){console.error("Error deleting GitHub credential:",z)}},H=async(N,z)=>{try{await Ae(`/api/settings/credentials/${N}/toggle`,{method:"PATCH",body:JSON.stringify({isActive:!z})}),V()}catch(re){console.error("Error toggling GitHub credential:",re)}},ne=(N,z)=>{navigator.clipboard.writeText(N),E(z),setTimeout(()=>E(null),2e3)};return s?i.jsx("div",{className:"text-muted-foreground",children:e("apiKeys.loading")}):i.jsxs("div",{className:"space-y-8",children:[C&&i.jsxs("div",{className:"p-4 bg-yellow-500/10 border border-yellow-500/20 rounded-lg",children:[i.jsx("h4",{className:"font-semibold text-yellow-500 mb-2",children:e("apiKeys.newKey.alertTitle")}),i.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:e("apiKeys.newKey.alertMessage")}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("code",{className:"flex-1 px-3 py-2 bg-background/50 rounded font-mono text-sm break-all",children:C.apiKey}),i.jsx(ze,{size:"sm",variant:"outline",onClick:()=>ne(C.apiKey,"new"),children:I==="new"?i.jsx(_r,{className:"h-4 w-4"}):i.jsx(Y4,{className:"h-4 w-4"})})]}),i.jsx(ze,{size:"sm",variant:"ghost",className:"mt-3",onClick:()=>M(null),children:e("apiKeys.newKey.iveSavedIt")})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(hg,{className:"h-5 w-5"}),i.jsx("h3",{className:"text-lg font-semibold",children:e("apiKeys.title")})]}),i.jsxs(ze,{size:"sm",onClick:()=>c(!l),children:[i.jsx(Tr,{className:"h-4 w-4 mr-1"}),e("apiKeys.newButton")]})]}),i.jsxs("div",{className:"mb-4",children:[i.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:e("apiKeys.description")}),i.jsxs("a",{href:"/api-docs.html",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-primary hover:underline inline-flex items-center gap-1",children:[e("apiKeys.apiDocsLink"),i.jsx(ch,{className:"h-3 w-3"})]})]}),l&&i.jsxs("div",{className:"mb-4 p-4 border rounded-lg bg-card",children:[i.jsx(lr,{placeholder:e("apiKeys.form.placeholder"),value:p,onChange:N=>h(N.target.value),className:"mb-2"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(ze,{onClick:D,children:e("apiKeys.form.createButton")}),i.jsx(ze,{variant:"outline",onClick:()=>c(!1),children:e("apiKeys.form.cancelButton")})]})]}),i.jsx("div",{className:"space-y-2",children:t.length===0?i.jsx("p",{className:"text-sm text-muted-foreground italic",children:e("apiKeys.empty")}):t.map(N=>i.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"font-medium",children:N.key_name}),i.jsx("code",{className:"text-xs text-muted-foreground",children:N.api_key}),i.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[e("apiKeys.list.created")," ",new Date(N.created_at).toLocaleDateString(),N.last_used&&` • ${e("apiKeys.list.lastUsed")} ${new Date(N.last_used).toLocaleDateString()}`]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(ze,{size:"sm",variant:N.is_active?"outline":"secondary",onClick:()=>B(N.id,N.is_active),children:N.is_active?e("apiKeys.status.active"):e("apiKeys.status.inactive")}),i.jsx(ze,{size:"sm",variant:"ghost",onClick:()=>P(N.id),children:i.jsx(jr,{className:"h-4 w-4"})})]})]},N.id))})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(XC,{className:"h-5 w-5"}),i.jsx("h3",{className:"text-lg font-semibold",children:e("apiKeys.github.title")})]}),i.jsxs(ze,{size:"sm",onClick:()=>d(!u),children:[i.jsx(Tr,{className:"h-4 w-4 mr-1"}),e("apiKeys.github.addButton")]})]}),i.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:e("apiKeys.github.descriptionAlt")}),u&&i.jsxs("div",{className:"mb-4 p-4 border rounded-lg bg-card space-y-3",children:[i.jsx(lr,{placeholder:e("apiKeys.github.form.namePlaceholder"),value:m,onChange:N=>g(N.target.value)}),i.jsxs("div",{className:"relative",children:[i.jsx(lr,{type:w.new?"text":"password",placeholder:e("apiKeys.github.form.tokenPlaceholder"),value:f,onChange:N=>k(N.target.value),className:"pr-10"}),i.jsx("button",{type:"button",onClick:()=>A({...w,new:!w.new}),className:"absolute right-3 top-2.5 text-muted-foreground hover:text-foreground",children:w.new?i.jsx(X4,{className:"h-4 w-4"}):i.jsx(Ai,{className:"h-4 w-4"})})]}),i.jsx(lr,{placeholder:e("apiKeys.github.form.descriptionPlaceholder"),value:S,onChange:N=>v(N.target.value)}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(ze,{onClick:F,children:e("apiKeys.github.form.addButton")}),i.jsx(ze,{variant:"outline",onClick:()=>{d(!1),g(""),k(""),v("")},children:e("apiKeys.github.form.cancelButton")})]}),i.jsx("a",{href:"https://github.com/settings/tokens",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline block",children:e("apiKeys.github.form.howToCreate")})]}),i.jsx("div",{className:"space-y-2",children:n.length===0?i.jsx("p",{className:"text-sm text-muted-foreground italic",children:e("apiKeys.github.empty")}):n.map(N=>i.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"font-medium",children:N.credential_name}),N.description&&i.jsx("div",{className:"text-xs text-muted-foreground",children:N.description}),i.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[e("apiKeys.github.added")," ",new Date(N.created_at).toLocaleDateString()]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(ze,{size:"sm",variant:N.is_active?"outline":"secondary",onClick:()=>H(N.id,N.is_active),children:N.is_active?e("apiKeys.status.active"):e("apiKeys.status.inactive")}),i.jsx(ze,{size:"sm",variant:"ghost",onClick:()=>$(N.id),children:i.jsx(jr,{className:"h-4 w-4"})})]})]},N.id))})]}),i.jsx("div",{className:"pt-6 border-t border-border/50",children:i.jsxs("div",{className:"flex items-center justify-between text-xs italic text-muted-foreground/60",children:[i.jsxs("a",{href:G?.htmlUrl||"https://github.com/siteboon/claudecodeui/releases",target:"_blank",rel:"noopener noreferrer",className:"hover:text-muted-foreground transition-colors",children:["v",og]}),O&&j&&i.jsxs("a",{href:G?.htmlUrl||"https://github.com/siteboon/claudecodeui/releases",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 px-2 py-0.5 bg-green-500/10 text-green-600 dark:text-green-400 rounded-full hover:bg-green-500/20 transition-colors not-italic font-medium",children:[i.jsx("span",{className:"text-[10px]",children:e("apiKeys.version.updateAvailable",{version:j})}),i.jsx(ch,{className:"h-2.5 w-2.5"})]})]})})]})}function MH(){const{t:e}=Kt("settings"),[t,r]=b.useState(""),[n,a]=b.useState(""),[s,o]=b.useState(!1),[l,c]=b.useState(!1),[u,d]=b.useState(null);b.useEffect(()=>{p()},[]);const p=async()=>{try{o(!0);const m=await Ae("/api/user/git-config");if(m.ok){const g=await m.json();r(g.gitName||""),a(g.gitEmail||"")}}catch(m){console.error("Error loading git config:",m)}finally{o(!1)}},h=async()=>{try{c(!0);const m=await Ae("/api/user/git-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gitName:t,gitEmail:n})});if(m.ok)d("success"),setTimeout(()=>d(null),3e3);else{const g=await m.json();d("error"),console.error("Failed to save git config:",g.error)}}catch(m){console.error("Error saving git config:",m),d("error")}finally{c(!1)}};return i.jsx("div",{className:"space-y-8",children:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[i.jsx(ba,{className:"h-5 w-5"}),i.jsx("h3",{className:"text-lg font-semibold",children:e("git.title")})]}),i.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:e("git.description")}),i.jsxs("div",{className:"p-4 border rounded-lg bg-card space-y-3",children:[i.jsxs("div",{children:[i.jsx("label",{htmlFor:"settings-git-name",className:"block text-sm font-medium text-foreground mb-2",children:e("git.name.label")}),i.jsx(lr,{id:"settings-git-name",type:"text",value:t,onChange:m=>r(m.target.value),placeholder:"John Doe",disabled:s,className:"w-full"}),i.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:e("git.name.help")})]}),i.jsxs("div",{children:[i.jsx("label",{htmlFor:"settings-git-email",className:"block text-sm font-medium text-foreground mb-2",children:e("git.email.label")}),i.jsx(lr,{id:"settings-git-email",type:"email",value:n,onChange:m=>a(m.target.value),placeholder:"john@example.com",disabled:s,className:"w-full"}),i.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:e("git.email.help")})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(ze,{onClick:h,disabled:l||!t||!n,children:e(l?"git.actions.saving":"git.actions.save")}),u==="success"&&i.jsxs("div",{className:"text-sm text-green-600 dark:text-green-400 flex items-center gap-2",children:[i.jsx(_r,{className:"w-4 h-4"}),e("git.status.success")]})]})]})]})})}function FH(){const{t:e}=Kt("settings"),{tasksEnabled:t,setTasksEnabled:r,isTaskMasterInstalled:n,isCheckingInstallation:a}=Wo();return i.jsx("div",{className:"space-y-8",children:a?i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-blue-600 border-t-transparent rounded-full"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:e("tasks.checking")})]})}):i.jsxs(i.Fragment,{children:[!n&&i.jsx("div",{className:"bg-orange-50 dark:bg-orange-950/50 border border-orange-200 dark:border-orange-800 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:"w-8 h-8 bg-orange-100 dark:bg-orange-900 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",children:i.jsx("svg",{className:"w-4 h-4 text-orange-600 dark:text-orange-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"font-medium text-orange-900 dark:text-orange-100 mb-2",children:e("tasks.notInstalled.title")}),i.jsxs("div",{className:"text-sm text-orange-800 dark:text-orange-200 space-y-3",children:[i.jsx("p",{children:e("tasks.notInstalled.description")}),i.jsx("div",{className:"bg-orange-100 dark:bg-orange-900/50 rounded-lg p-3 font-mono text-sm",children:i.jsx("code",{children:e("tasks.notInstalled.installCommand")})}),i.jsx("div",{children:i.jsxs("a",{href:"https://github.com/eyaltoledano/claude-task-master",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium text-sm",children:[i.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:i.jsx("path",{fillRule:"evenodd",d:"M10 0C4.477 0 0 4.484 0 10.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 0110 4.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 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.942.359.31.678.921.678 1.856 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0020 10.017C20 4.484 15.522 0 10 0z",clipRule:"evenodd"})}),e("tasks.notInstalled.viewOnGitHub"),i.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"font-medium",children:e("tasks.notInstalled.afterInstallation")}),i.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-xs",children:[i.jsx("li",{children:e("tasks.notInstalled.steps.restart")}),i.jsx("li",{children:e("tasks.notInstalled.steps.autoAvailable")}),i.jsx("li",{children:e("tasks.notInstalled.steps.initCommand")})]})]})]})]})]})}),n&&i.jsx("div",{className:"space-y-4",children:i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-foreground",children:e("tasks.settings.enableLabel")}),i.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:e("tasks.settings.enableDescription")})]}),i.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[i.jsx("input",{type:"checkbox",checked:t,onChange:s=>r(s.target.checked),className:"sr-only peer"}),i.jsx("div",{className:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"})]})]})})})]})})}function V3({isOpen:e,onClose:t,provider:r="claude",project:n,onComplete:a,customCommand:s,isAuthenticated:o=!1}){if(!e)return null;const l=()=>{if(s)return s;switch(r){case"claude":return o?"claude setup-token --dangerously-skip-permissions":"claude /exit --dangerously-skip-permissions";case"cursor":return"cursor-agent login";case"codex":return"codex login";default:return o?"claude setup-token --dangerously-skip-permissions":"claude /exit --dangerously-skip-permissions"}},c=()=>{switch(r){case"claude":return"Claude CLI Login";case"cursor":return"Cursor CLI Login";case"codex":return"Codex CLI Login";default:return"CLI Login"}},u=d=>{a&&a(d),d===0&&t()};return i.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-[9999] max-md:items-stretch max-md:justify-stretch",children:i.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl w-full max-w-4xl h-3/4 flex flex-col md:max-w-4xl md:h-3/4 md:rounded-lg md:m-4 max-md:max-w-none max-md:h-full max-md:rounded-none max-md:m-0",children:[i.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700",children:[i.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:c()}),i.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors","aria-label":"Close login modal",children:i.jsx($t,{className:"w-6 h-6"})})]}),i.jsx("div",{className:"flex-1 overflow-hidden",children:i.jsx(H3,{project:n,command:l(),onComplete:u,minimal:!0})})]})})}const PH={claude:{name:"Claude",color:"blue",Logo:In},cursor:{name:"Cursor",color:"purple",Logo:Xn},codex:{name:"Codex",color:"gray",Logo:Zn}},BH={blue:{border:"border-l-blue-500 md:border-l-blue-500",borderBottom:"border-b-blue-500",bg:"bg-blue-50 dark:bg-blue-900/20",dot:"bg-blue-500"},purple:{border:"border-l-purple-500 md:border-l-purple-500",borderBottom:"border-b-purple-500",bg:"bg-purple-50 dark:bg-purple-900/20",dot:"bg-purple-500"},gray:{border:"border-l-gray-700 dark:border-l-gray-300",borderBottom:"border-b-gray-700 dark:border-b-gray-300",bg:"bg-gray-100 dark:bg-gray-800/50",dot:"bg-gray-700 dark:bg-gray-300"}};function oi({agentId:e,authStatus:t,isSelected:r,onClick:n,isMobile:a=!1}){const{t:s}=Kt("settings"),o=PH[e],l=BH[o.color],{Logo:c}=o;return a?i.jsx("button",{onClick:n,className:`flex-1 text-center py-3 px-2 border-b-2 transition-colors ${r?`${l.borderBottom} ${l.bg}`:"border-transparent hover:bg-gray-50 dark:hover:bg-gray-800"}`,children:i.jsxs("div",{className:"flex flex-col items-center gap-1",children:[i.jsx(c,{className:"w-5 h-5"}),i.jsx("span",{className:"text-xs font-medium text-foreground",children:o.name}),t?.authenticated&&i.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${l.dot}`})]})}):i.jsxs("button",{onClick:n,className:`w-full text-left p-3 border-l-4 transition-colors ${r?`${l.border} ${l.bg}`:"border-transparent hover:bg-gray-50 dark:hover:bg-gray-800"}`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx(c,{className:"w-4 h-4"}),i.jsx("span",{className:"font-medium text-foreground",children:o.name})]}),i.jsx("div",{className:"text-xs text-muted-foreground pl-6",children:t?.loading?i.jsx("span",{className:"text-gray-400",children:s("agents.authStatus.checking")}):t?.authenticated?i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${l.dot}`}),i.jsx("span",{className:"truncate max-w-[120px]",title:t.email,children:t.email||s("agents.authStatus.connected")})]}):i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-400"}),i.jsx("span",{children:s("agents.authStatus.notConnected")})]})})]})}const zH={claude:{name:"Claude",description:"Anthropic Claude AI assistant",Logo:In,bgClass:"bg-blue-50 dark:bg-blue-900/20",borderClass:"border-blue-200 dark:border-blue-800",textClass:"text-blue-900 dark:text-blue-100",subtextClass:"text-blue-700 dark:text-blue-300",buttonClass:"bg-blue-600 hover:bg-blue-700"},cursor:{name:"Cursor",description:"Cursor AI-powered code editor",Logo:Xn,bgClass:"bg-purple-50 dark:bg-purple-900/20",borderClass:"border-purple-200 dark:border-purple-800",textClass:"text-purple-900 dark:text-purple-100",subtextClass:"text-purple-700 dark:text-purple-300",buttonClass:"bg-purple-600 hover:bg-purple-700"},codex:{name:"Codex",description:"OpenAI Codex AI assistant",Logo:Zn,bgClass:"bg-gray-100 dark:bg-gray-800/50",borderClass:"border-gray-300 dark:border-gray-600",textClass:"text-gray-900 dark:text-gray-100",subtextClass:"text-gray-700 dark:text-gray-300",buttonClass:"bg-gray-800 hover:bg-gray-900 dark:bg-gray-700 dark:hover:bg-gray-600"}};function UH({agent:e,authStatus:t,onLogin:r}){const{t:n}=Kt("settings"),a=zH[e],{Logo:s}=a;return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[i.jsx(s,{className:"w-6 h-6"}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-medium text-foreground",children:a.name}),i.jsx("p",{className:"text-sm text-muted-foreground",children:n(`agents.account.${e}.description`)})]})]}),i.jsx("div",{className:`${a.bgClass} border ${a.borderClass} rounded-lg p-4`,children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:`font-medium ${a.textClass}`,children:n("agents.connectionStatus")}),i.jsx("div",{className:`text-sm ${a.subtextClass}`,children:t?.loading?n("agents.authStatus.checkingAuth"):t?.authenticated?n("agents.authStatus.loggedInAs",{email:t.email||n("agents.authStatus.authenticatedUser")}):n("agents.authStatus.notConnected")})]}),i.jsx("div",{children:t?.loading?i.jsx(gn,{variant:"secondary",className:"bg-gray-100 dark:bg-gray-800",children:n("agents.authStatus.checking")}):t?.authenticated?i.jsx(gn,{variant:"success",className:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",children:n("agents.authStatus.connected")}):i.jsx(gn,{variant:"secondary",className:"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-300",children:n("agents.authStatus.disconnected")})})]}),i.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 pt-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:`font-medium ${a.textClass}`,children:t?.authenticated?n("agents.login.reAuthenticate"):n("agents.login.title")}),i.jsx("div",{className:`text-sm ${a.subtextClass}`,children:t?.authenticated?n("agents.login.reAuthDescription"):n("agents.login.description",{agent:a.name})})]}),i.jsxs(ze,{onClick:r,className:`${a.buttonClass} text-white`,size:"sm",children:[i.jsx(Q4,{className:"w-4 h-4 mr-2"}),t?.authenticated?n("agents.login.reLoginButton"):n("agents.login.button")]})]})}),t?.error&&i.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 pt-4",children:i.jsx("div",{className:"text-sm text-red-600 dark:text-red-400",children:n("agents.error",{error:t.error})})})]})})]})}const $H=["Bash(git log:*)","Bash(git diff:*)","Bash(git status:*)","Write","Read","Edit","Glob","Grep","MultiEdit","Task","TodoWrite","TodoRead","WebFetch","WebSearch"],qH=["Shell(ls)","Shell(mkdir)","Shell(cd)","Shell(cat)","Shell(echo)","Shell(git status)","Shell(git diff)","Shell(git log)","Shell(npm install)","Shell(npm run)","Shell(python)","Shell(node)"];function GH({skipPermissions:e,setSkipPermissions:t,allowedTools:r,setAllowedTools:n,disallowedTools:a,setDisallowedTools:s,newAllowedTool:o,setNewAllowedTool:l,newDisallowedTool:c,setNewDisallowedTool:u}){const{t:d}=Kt("settings"),p=f=>{f&&!r.includes(f)&&(n([...r,f]),l(""))},h=f=>{n(r.filter(k=>k!==f))},m=f=>{f&&!a.includes(f)&&(s([...a,f]),u(""))},g=f=>{s(a.filter(k=>k!==f))};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Yn,{className:"w-5 h-5 text-orange-500"}),i.jsx("h3",{className:"text-lg font-medium text-foreground",children:d("permissions.title")})]}),i.jsx("div",{className:"bg-orange-50 dark:bg-orange-900/20 border border-orange-200 dark:border-orange-800 rounded-lg p-4",children:i.jsxs("label",{className:"flex items-center gap-3",children:[i.jsx("input",{type:"checkbox",checked:e,onChange:f=>t(f.target.checked),className:"w-4 h-4 text-blue-600 bg-gray-100 dark:bg-gray-700 border-gray-300 dark:border-gray-600 rounded focus:ring-blue-500 focus:ring-2"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-orange-900 dark:text-orange-100",children:d("permissions.skipPermissions.label")}),i.jsx("div",{className:"text-sm text-orange-700 dark:text-orange-300",children:d("permissions.skipPermissions.claudeDescription")})]})]})})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(fg,{className:"w-5 h-5 text-green-500"}),i.jsx("h3",{className:"text-lg font-medium text-foreground",children:d("permissions.allowedTools.title")})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:d("permissions.allowedTools.description")}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[i.jsx(lr,{value:o,onChange:f=>l(f.target.value),placeholder:d("permissions.allowedTools.placeholder"),onKeyPress:f=>{f.key==="Enter"&&(f.preventDefault(),p(o))},className:"flex-1 h-10"}),i.jsxs(ze,{onClick:()=>p(o),disabled:!o,size:"sm",className:"h-10 px-4",children:[i.jsx(Tr,{className:"w-4 h-4 mr-2 sm:mr-0"}),i.jsx("span",{className:"sm:hidden",children:d("permissions.actions.add")})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:d("permissions.allowedTools.quickAdd")}),i.jsx("div",{className:"flex flex-wrap gap-2",children:$H.map(f=>i.jsx(ze,{variant:"outline",size:"sm",onClick:()=>p(f),disabled:r.includes(f),className:"text-xs h-8",children:f},f))})]}),i.jsxs("div",{className:"space-y-2",children:[r.map(f=>i.jsxs("div",{className:"flex items-center justify-between bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-3",children:[i.jsx("span",{className:"font-mono text-sm text-green-800 dark:text-green-200",children:f}),i.jsx(ze,{variant:"ghost",size:"sm",onClick:()=>h(f),className:"text-green-600 hover:text-green-700",children:i.jsx($t,{className:"w-4 h-4"})})]},f)),r.length===0&&i.jsx("div",{className:"text-center py-6 text-gray-500 dark:text-gray-400",children:d("permissions.allowedTools.empty")})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Yn,{className:"w-5 h-5 text-red-500"}),i.jsx("h3",{className:"text-lg font-medium text-foreground",children:d("permissions.blockedTools.title")})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:d("permissions.blockedTools.description")}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[i.jsx(lr,{value:c,onChange:f=>u(f.target.value),placeholder:d("permissions.blockedTools.placeholder"),onKeyPress:f=>{f.key==="Enter"&&(f.preventDefault(),m(c))},className:"flex-1 h-10"}),i.jsxs(ze,{onClick:()=>m(c),disabled:!c,size:"sm",className:"h-10 px-4",children:[i.jsx(Tr,{className:"w-4 h-4 mr-2 sm:mr-0"}),i.jsx("span",{className:"sm:hidden",children:d("permissions.actions.add")})]})]}),i.jsxs("div",{className:"space-y-2",children:[a.map(f=>i.jsxs("div",{className:"flex items-center justify-between bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-3",children:[i.jsx("span",{className:"font-mono text-sm text-red-800 dark:text-red-200",children:f}),i.jsx(ze,{variant:"ghost",size:"sm",onClick:()=>g(f),className:"text-red-600 hover:text-red-700",children:i.jsx($t,{className:"w-4 h-4"})})]},f)),a.length===0&&i.jsx("div",{className:"text-center py-6 text-gray-500 dark:text-gray-400",children:d("permissions.blockedTools.empty")})]})]}),i.jsxs("div",{className:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4",children:[i.jsx("h4",{className:"font-medium text-blue-900 dark:text-blue-100 mb-2",children:d("permissions.toolExamples.title")}),i.jsxs("ul",{className:"text-sm text-blue-800 dark:text-blue-200 space-y-1",children:[i.jsxs("li",{children:[i.jsx("code",{className:"bg-blue-100 dark:bg-blue-800 px-1 rounded",children:'"Bash(git log:*)"'})," ",d("permissions.toolExamples.bashGitLog")]}),i.jsxs("li",{children:[i.jsx("code",{className:"bg-blue-100 dark:bg-blue-800 px-1 rounded",children:'"Bash(git diff:*)"'})," ",d("permissions.toolExamples.bashGitDiff")]}),i.jsxs("li",{children:[i.jsx("code",{className:"bg-blue-100 dark:bg-blue-800 px-1 rounded",children:'"Write"'})," ",d("permissions.toolExamples.write")]}),i.jsxs("li",{children:[i.jsx("code",{className:"bg-blue-100 dark:bg-blue-800 px-1 rounded",children:'"Bash(rm:*)"'})," ",d("permissions.toolExamples.bashRm")]})]})]})]})}function HH({skipPermissions:e,setSkipPermissions:t,allowedCommands:r,setAllowedCommands:n,disallowedCommands:a,setDisallowedCommands:s,newAllowedCommand:o,setNewAllowedCommand:l,newDisallowedCommand:c,setNewDisallowedCommand:u}){const{t:d}=Kt("settings"),p=f=>{f&&!r.includes(f)&&(n([...r,f]),l(""))},h=f=>{n(r.filter(k=>k!==f))},m=f=>{f&&!a.includes(f)&&(s([...a,f]),u(""))},g=f=>{s(a.filter(k=>k!==f))};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Yn,{className:"w-5 h-5 text-orange-500"}),i.jsx("h3",{className:"text-lg font-medium text-foreground",children:d("permissions.title")})]}),i.jsx("div",{className:"bg-orange-50 dark:bg-orange-900/20 border border-orange-200 dark:border-orange-800 rounded-lg p-4",children:i.jsxs("label",{className:"flex items-center gap-3",children:[i.jsx("input",{type:"checkbox",checked:e,onChange:f=>t(f.target.checked),className:"w-4 h-4 text-purple-600 bg-gray-100 dark:bg-gray-700 border-gray-300 dark:border-gray-600 rounded focus:ring-purple-500 focus:ring-2"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-orange-900 dark:text-orange-100",children:d("permissions.skipPermissions.label")}),i.jsx("div",{className:"text-sm text-orange-700 dark:text-orange-300",children:d("permissions.skipPermissions.cursorDescription")})]})]})})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(fg,{className:"w-5 h-5 text-green-500"}),i.jsx("h3",{className:"text-lg font-medium text-foreground",children:d("permissions.allowedCommands.title")})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:d("permissions.allowedCommands.description")}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[i.jsx(lr,{value:o,onChange:f=>l(f.target.value),placeholder:d("permissions.allowedCommands.placeholder"),onKeyPress:f=>{f.key==="Enter"&&(f.preventDefault(),p(o))},className:"flex-1 h-10"}),i.jsxs(ze,{onClick:()=>p(o),disabled:!o,size:"sm",className:"h-10 px-4",children:[i.jsx(Tr,{className:"w-4 h-4 mr-2 sm:mr-0"}),i.jsx("span",{className:"sm:hidden",children:d("permissions.actions.add")})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:d("permissions.allowedCommands.quickAdd")}),i.jsx("div",{className:"flex flex-wrap gap-2",children:qH.map(f=>i.jsx(ze,{variant:"outline",size:"sm",onClick:()=>p(f),disabled:r.includes(f),className:"text-xs h-8",children:f},f))})]}),i.jsxs("div",{className:"space-y-2",children:[r.map(f=>i.jsxs("div",{className:"flex items-center justify-between bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-3",children:[i.jsx("span",{className:"font-mono text-sm text-green-800 dark:text-green-200",children:f}),i.jsx(ze,{variant:"ghost",size:"sm",onClick:()=>h(f),className:"text-green-600 hover:text-green-700",children:i.jsx($t,{className:"w-4 h-4"})})]},f)),r.length===0&&i.jsx("div",{className:"text-center py-6 text-gray-500 dark:text-gray-400",children:d("permissions.allowedCommands.empty")})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Yn,{className:"w-5 h-5 text-red-500"}),i.jsx("h3",{className:"text-lg font-medium text-foreground",children:d("permissions.blockedCommands.title")})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:d("permissions.blockedCommands.description")}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[i.jsx(lr,{value:c,onChange:f=>u(f.target.value),placeholder:d("permissions.blockedCommands.placeholder"),onKeyPress:f=>{f.key==="Enter"&&(f.preventDefault(),m(c))},className:"flex-1 h-10"}),i.jsxs(ze,{onClick:()=>m(c),disabled:!c,size:"sm",className:"h-10 px-4",children:[i.jsx(Tr,{className:"w-4 h-4 mr-2 sm:mr-0"}),i.jsx("span",{className:"sm:hidden",children:d("permissions.actions.add")})]})]}),i.jsxs("div",{className:"space-y-2",children:[a.map(f=>i.jsxs("div",{className:"flex items-center justify-between bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-3",children:[i.jsx("span",{className:"font-mono text-sm text-red-800 dark:text-red-200",children:f}),i.jsx(ze,{variant:"ghost",size:"sm",onClick:()=>g(f),className:"text-red-600 hover:text-red-700",children:i.jsx($t,{className:"w-4 h-4"})})]},f)),a.length===0&&i.jsx("div",{className:"text-center py-6 text-gray-500 dark:text-gray-400",children:d("permissions.blockedCommands.empty")})]})]}),i.jsxs("div",{className:"bg-purple-50 dark:bg-purple-900/20 border border-purple-200 dark:border-purple-800 rounded-lg p-4",children:[i.jsx("h4",{className:"font-medium text-purple-900 dark:text-purple-100 mb-2",children:d("permissions.shellExamples.title")}),i.jsxs("ul",{className:"text-sm text-purple-800 dark:text-purple-200 space-y-1",children:[i.jsxs("li",{children:[i.jsx("code",{className:"bg-purple-100 dark:bg-purple-800 px-1 rounded",children:'"Shell(ls)"'})," ",d("permissions.shellExamples.ls")]}),i.jsxs("li",{children:[i.jsx("code",{className:"bg-purple-100 dark:bg-purple-800 px-1 rounded",children:'"Shell(git status)"'})," ",d("permissions.shellExamples.gitStatus")]}),i.jsxs("li",{children:[i.jsx("code",{className:"bg-purple-100 dark:bg-purple-800 px-1 rounded",children:'"Shell(npm install)"'})," ",d("permissions.shellExamples.npmInstall")]}),i.jsxs("li",{children:[i.jsx("code",{className:"bg-purple-100 dark:bg-purple-800 px-1 rounded",children:'"Shell(rm -rf)"'})," ",d("permissions.shellExamples.rmRf")]})]})]})]})}function WH({permissionMode:e,setPermissionMode:t}){const{t:r}=Kt("settings");return i.jsx("div",{className:"space-y-6",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(fg,{className:"w-5 h-5 text-green-500"}),i.jsx("h3",{className:"text-lg font-medium text-foreground",children:r("permissions.codex.permissionMode")})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:r("permissions.codex.description")}),i.jsx("div",{className:`border rounded-lg p-4 cursor-pointer transition-all ${e==="default"?"bg-gray-100 dark:bg-gray-800 border-gray-400 dark:border-gray-500":"bg-gray-50 dark:bg-gray-900/50 border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}`,onClick:()=>t("default"),children:i.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[i.jsx("input",{type:"radio",name:"codexPermissionMode",checked:e==="default",onChange:()=>t("default"),className:"mt-1 w-4 h-4 text-green-600"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-foreground",children:r("permissions.codex.modes.default.title")}),i.jsx("div",{className:"text-sm text-muted-foreground",children:r("permissions.codex.modes.default.description")})]})]})}),i.jsx("div",{className:`border rounded-lg p-4 cursor-pointer transition-all ${e==="acceptEdits"?"bg-green-50 dark:bg-green-900/20 border-green-400 dark:border-green-600":"bg-gray-50 dark:bg-gray-900/50 border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}`,onClick:()=>t("acceptEdits"),children:i.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[i.jsx("input",{type:"radio",name:"codexPermissionMode",checked:e==="acceptEdits",onChange:()=>t("acceptEdits"),className:"mt-1 w-4 h-4 text-green-600"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-green-900 dark:text-green-100",children:r("permissions.codex.modes.acceptEdits.title")}),i.jsx("div",{className:"text-sm text-green-700 dark:text-green-300",children:r("permissions.codex.modes.acceptEdits.description")})]})]})}),i.jsx("div",{className:`border rounded-lg p-4 cursor-pointer transition-all ${e==="bypassPermissions"?"bg-orange-50 dark:bg-orange-900/20 border-orange-400 dark:border-orange-600":"bg-gray-50 dark:bg-gray-900/50 border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}`,onClick:()=>t("bypassPermissions"),children:i.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[i.jsx("input",{type:"radio",name:"codexPermissionMode",checked:e==="bypassPermissions",onChange:()=>t("bypassPermissions"),className:"mt-1 w-4 h-4 text-orange-600"}),i.jsxs("div",{children:[i.jsxs("div",{className:"font-medium text-orange-900 dark:text-orange-100 flex items-center gap-2",children:[r("permissions.codex.modes.bypassPermissions.title"),i.jsx(Yn,{className:"w-4 h-4"})]}),i.jsx("div",{className:"text-sm text-orange-700 dark:text-orange-300",children:r("permissions.codex.modes.bypassPermissions.description")})]})]})}),i.jsxs("details",{className:"text-sm",children:[i.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground",children:r("permissions.codex.technicalDetails")}),i.jsxs("div",{className:"mt-2 p-3 bg-gray-50 dark:bg-gray-900/50 rounded-lg text-xs text-muted-foreground space-y-2",children:[i.jsxs("p",{children:[i.jsxs("strong",{children:[r("permissions.codex.modes.default.title"),":"]})," ",r("permissions.codex.technicalInfo.default")]}),i.jsxs("p",{children:[i.jsxs("strong",{children:[r("permissions.codex.modes.acceptEdits.title"),":"]})," ",r("permissions.codex.technicalInfo.acceptEdits")]}),i.jsxs("p",{children:[i.jsxs("strong",{children:[r("permissions.codex.modes.bypassPermissions.title"),":"]})," ",r("permissions.codex.technicalInfo.bypassPermissions")]}),i.jsx("p",{className:"text-xs opacity-75",children:r("permissions.codex.technicalInfo.overrideNote")})]})]})]})})}function sh({agent:e,...t}){return e==="claude"?i.jsx(GH,{...t}):e==="cursor"?i.jsx(HH,{...t}):e==="codex"?i.jsx(WH,{...t}):null}const VH=e=>{switch(e){case"stdio":return i.jsx(Ba,{className:"w-4 h-4"});case"sse":return i.jsx(bg,{className:"w-4 h-4"});case"http":return i.jsx(uh,{className:"w-4 h-4"});default:return i.jsx(Go,{className:"w-4 h-4"})}};function KH({servers:e,onAdd:t,onEdit:r,onDelete:n,onTest:a,onDiscoverTools:s,testResults:o,serverTools:l,toolsLoading:c}){const{t:u}=Kt("settings");return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Go,{className:"w-5 h-5 text-purple-500"}),i.jsx("h3",{className:"text-lg font-medium text-foreground",children:u("mcpServers.title")})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:u("mcpServers.description.claude")}),i.jsx("div",{className:"flex justify-between items-center",children:i.jsxs(ze,{onClick:t,className:"bg-purple-600 hover:bg-purple-700 text-white",size:"sm",children:[i.jsx(Tr,{className:"w-4 h-4 mr-2"}),u("mcpServers.addButton")]})}),i.jsxs("div",{className:"space-y-2",children:[e.map(d=>i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[VH(d.type),i.jsx("span",{className:"font-medium text-foreground",children:d.name}),i.jsx(gn,{variant:"outline",className:"text-xs",children:d.type}),i.jsx(gn,{variant:"outline",className:"text-xs",children:d.scope==="local"?u("mcpServers.scope.local"):d.scope==="user"?u("mcpServers.scope.user"):d.scope})]}),i.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[d.type==="stdio"&&d.config?.command&&i.jsxs("div",{children:[u("mcpServers.config.command"),": ",i.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded text-xs",children:d.config.command})]}),(d.type==="sse"||d.type==="http")&&d.config?.url&&i.jsxs("div",{children:[u("mcpServers.config.url"),": ",i.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded text-xs",children:d.config.url})]}),d.config?.args&&d.config.args.length>0&&i.jsxs("div",{children:[u("mcpServers.config.args"),": ",i.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded text-xs",children:d.config.args.join(" ")})]})]}),o?.[d.id]&&i.jsx("div",{className:`mt-2 p-2 rounded text-xs ${o[d.id].success?"bg-green-50 dark:bg-green-900/20 text-green-800 dark:text-green-200":"bg-red-50 dark:bg-red-900/20 text-red-800 dark:text-red-200"}`,children:i.jsx("div",{className:"font-medium",children:o[d.id].message})}),l?.[d.id]&&l[d.id].tools?.length>0&&i.jsxs("div",{className:"mt-2 p-2 rounded text-xs bg-blue-50 dark:bg-blue-900/20 text-blue-800 dark:text-blue-200",children:[i.jsxs("div",{className:"font-medium",children:[u("mcpServers.tools.title")," ",u("mcpServers.tools.count",{count:l[d.id].tools.length})]}),i.jsxs("div",{className:"flex flex-wrap gap-1 mt-1",children:[l[d.id].tools.slice(0,5).map((p,h)=>i.jsx("code",{className:"bg-blue-100 dark:bg-blue-800 px-1 rounded",children:p.name},h)),l[d.id].tools.length>5&&i.jsx("span",{className:"text-xs opacity-75",children:u("mcpServers.tools.more",{count:l[d.id].tools.length-5})})]})]})]}),i.jsxs("div",{className:"flex items-center gap-2 ml-4",children:[i.jsx(ze,{onClick:()=>r(d),variant:"ghost",size:"sm",className:"text-gray-600 hover:text-gray-700",title:u("mcpServers.actions.edit"),children:i.jsx(ss,{className:"w-4 h-4"})}),i.jsx(ze,{onClick:()=>n(d.id,d.scope),variant:"ghost",size:"sm",className:"text-red-600 hover:text-red-700",title:u("mcpServers.actions.delete"),children:i.jsx(jr,{className:"w-4 h-4"})})]})]})},d.id)),e.length===0&&i.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:u("mcpServers.empty")})]})]})}function YH({servers:e,onAdd:t,onEdit:r,onDelete:n}){const{t:a}=Kt("settings");return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Go,{className:"w-5 h-5 text-purple-500"}),i.jsx("h3",{className:"text-lg font-medium text-foreground",children:a("mcpServers.title")})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:a("mcpServers.description.cursor")}),i.jsx("div",{className:"flex justify-between items-center",children:i.jsxs(ze,{onClick:t,className:"bg-purple-600 hover:bg-purple-700 text-white",size:"sm",children:[i.jsx(Tr,{className:"w-4 h-4 mr-2"}),a("mcpServers.addButton")]})}),i.jsxs("div",{className:"space-y-2",children:[e.map(s=>i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ba,{className:"w-4 h-4"}),i.jsx("span",{className:"font-medium text-foreground",children:s.name}),i.jsx(gn,{variant:"outline",className:"text-xs",children:"stdio"})]}),i.jsx("div",{className:"text-sm text-muted-foreground",children:s.config?.command&&i.jsxs("div",{children:[a("mcpServers.config.command"),": ",i.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded text-xs",children:s.config.command})]})})]}),i.jsxs("div",{className:"flex items-center gap-2 ml-4",children:[i.jsx(ze,{onClick:()=>r(s),variant:"ghost",size:"sm",className:"text-gray-600 hover:text-gray-700",title:a("mcpServers.actions.edit"),children:i.jsx(ss,{className:"w-4 h-4"})}),i.jsx(ze,{onClick:()=>n(s.name),variant:"ghost",size:"sm",className:"text-red-600 hover:text-red-700",title:a("mcpServers.actions.delete"),children:i.jsx(jr,{className:"w-4 h-4"})})]})]})},s.name||s.id)),e.length===0&&i.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:a("mcpServers.empty")})]})]})}function XH({servers:e,onAdd:t,onEdit:r,onDelete:n}){const{t:a}=Kt("settings");return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Go,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"}),i.jsx("h3",{className:"text-lg font-medium text-foreground",children:a("mcpServers.title")})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:a("mcpServers.description.codex")}),i.jsx("div",{className:"flex justify-between items-center",children:i.jsxs(ze,{onClick:t,className:"bg-gray-800 hover:bg-gray-900 dark:bg-gray-700 dark:hover:bg-gray-600 text-white",size:"sm",children:[i.jsx(Tr,{className:"w-4 h-4 mr-2"}),a("mcpServers.addButton")]})}),i.jsxs("div",{className:"space-y-2",children:[e.map(s=>i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(Ba,{className:"w-4 h-4"}),i.jsx("span",{className:"font-medium text-foreground",children:s.name}),i.jsx(gn,{variant:"outline",className:"text-xs",children:"stdio"})]}),i.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[s.config?.command&&i.jsxs("div",{children:[a("mcpServers.config.command"),": ",i.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded text-xs",children:s.config.command})]}),s.config?.args&&s.config.args.length>0&&i.jsxs("div",{children:[a("mcpServers.config.args"),": ",i.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded text-xs",children:s.config.args.join(" ")})]}),s.config?.env&&Object.keys(s.config.env).length>0&&i.jsxs("div",{children:[a("mcpServers.config.environment"),": ",i.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded text-xs",children:Object.entries(s.config.env).map(([o,l])=>`${o}=${l}`).join(", ")})]})]})]}),i.jsxs("div",{className:"flex items-center gap-2 ml-4",children:[i.jsx(ze,{onClick:()=>r(s),variant:"ghost",size:"sm",className:"text-gray-600 hover:text-gray-700",title:a("mcpServers.actions.edit"),children:i.jsx(ss,{className:"w-4 h-4"})}),i.jsx(ze,{onClick:()=>n(s.name),variant:"ghost",size:"sm",className:"text-red-600 hover:text-red-700",title:a("mcpServers.actions.delete"),children:i.jsx(jr,{className:"w-4 h-4"})})]})]})},s.name)),e.length===0&&i.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:a("mcpServers.empty")})]}),i.jsxs("div",{className:"bg-gray-100 dark:bg-gray-800/50 border border-gray-300 dark:border-gray-600 rounded-lg p-4",children:[i.jsx("h4",{className:"font-medium text-gray-900 dark:text-gray-100 mb-2",children:a("mcpServers.help.title")}),i.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-300",children:a("mcpServers.help.description")})]})]})}function oh({agent:e,...t}){return e==="claude"?i.jsx(KH,{...t}):e==="cursor"?i.jsx(YH,{...t}):e==="codex"?i.jsx(XH,{...t}):null}const lg=[{value:"en",label:"English",nativeName:"English"},{value:"zh-CN",label:"Simplified Chinese",nativeName:"简体中文"}];function K3({compact:e=!1}){const{i18n:t,t:r}=Kt("settings"),n=a=>{const s=a.target.value;t.changeLanguage(s)};return e?i.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[i.jsx(J4,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),r("account.language")]}),i.jsx("select",{value:t.language,onChange:n,className:"w-[100px] text-sm bg-gray-50 dark:bg-gray-800 border border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500 p-2 focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400",children:lg.map(a=>i.jsx("option",{value:a.value,children:a.nativeName},a.value))})]}):i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-gray-900 dark:text-gray-100 mb-1",children:r("account.languageLabel")}),i.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:r("account.languageDescription")})]}),i.jsx("select",{value:t.language,onChange:n,className:"text-sm bg-gray-50 dark:bg-gray-800 border border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500 p-2 w-36",children:lg.map(a=>i.jsx("option",{value:a.value,children:a.nativeName},a.value))})]})})}function ZH({isOpen:e,onClose:t,projects:r=[],initialTab:n="agents"}){const{isDarkMode:a,toggleDarkMode:s}=xs(),{t:o}=Kt("settings"),[l,c]=b.useState([]),[u,d]=b.useState([]),[p,h]=b.useState(""),[m,g]=b.useState(""),[f,k]=b.useState(!1),[S,v]=b.useState(!1),[w,A]=b.useState(null),[I,E]=b.useState("name"),[C,M]=b.useState([]),[O,j]=b.useState(!1),[G,V]=b.useState(null),[D,P]=b.useState({name:"",type:"stdio",scope:"user",projectPath:"",config:{command:"",args:[],env:{},url:"",headers:{},timeout:3e4},jsonInput:"",importMode:"form"}),[B,F]=b.useState(!1),[$,H]=b.useState({}),[ne,N]=b.useState({}),[z,re]=b.useState({}),[R,K]=b.useState(n),[pe,ve]=b.useState(""),[oe,Ie]=b.useState("claude"),[ce,ye]=b.useState("account"),[_e,qe]=b.useState(()=>localStorage.getItem("codeEditorTheme")||"dark"),[Ke,xt]=b.useState(()=>localStorage.getItem("codeEditorWordWrap")==="true"),[dt,St]=b.useState(()=>localStorage.getItem("codeEditorShowMinimap")!=="false"),[ft,pt]=b.useState(()=>localStorage.getItem("codeEditorLineNumbers")!=="false"),[Le,et]=b.useState(()=>localStorage.getItem("codeEditorFontSize")||"14"),[yt,be]=b.useState([]),[Ge,he]=b.useState([]),[Ee,J]=b.useState(!1),[ie,fe]=b.useState(""),[De,Ye]=b.useState(""),[mt,tt]=b.useState([]),[jt,$e]=b.useState([]),[_t,vt]=b.useState("default"),[ut,Ve]=b.useState(!1),[Xe,ht]=b.useState({name:"",type:"stdio",config:{command:"",args:[],env:{}}}),[Gt,Ft]=b.useState(null),[Lt,qt]=b.useState(!1),[ar,vr]=b.useState(!1),[Q,Pe]=b.useState(""),[le,ge]=b.useState(null),[ke,W]=b.useState({authenticated:!1,email:null,loading:!0,error:null}),[se,te]=b.useState({authenticated:!1,email:null,loading:!0,error:null}),[Be,At]=b.useState({authenticated:!1,email:null,loading:!0,error:null}),ur=async()=>{try{const Z=await Ae("/api/cursor/mcp");if(Z.ok){const me=await Z.json();tt(me.servers||[])}else console.error("Failed to fetch Cursor MCP servers")}catch(Z){console.error("Error fetching Cursor MCP servers:",Z)}},er=async()=>{try{const Z=await Ae("/api/codex/mcp/config/read");if(Z.ok){const je=await Z.json();if(je.success&&je.servers){$e(je.servers);return}}const me=await Ae("/api/codex/mcp/cli/list");if(me.ok){const je=await me.json();if(je.success&&je.servers){const st=je.servers.map(fr=>({id:fr.name,name:fr.name,type:fr.type||"stdio",scope:"user",config:{command:fr.command||"",args:fr.args||[],env:fr.env||{}}}));$e(st)}}}catch(Z){console.error("Error fetching Codex MCP servers:",Z)}},wr=async()=>{try{const Z=await Ae("/api/mcp/config/read");if(Z.ok){const st=await Z.json();if(st.success&&st.servers){M(st.servers);return}}const me=await Ae("/api/mcp/cli/list");if(me.ok){const st=await me.json();if(st.success&&st.servers){const fr=st.servers.map(Fr=>({id:Fr.name,name:Fr.name,type:Fr.type,scope:"user",config:{command:Fr.command||"",args:Fr.args||[],env:Fr.env||{},url:Fr.url||"",headers:Fr.headers||{},timeout:3e4},created:new Date().toISOString(),updated:new Date().toISOString()}));M(fr);return}}const je=await Ae("/api/mcp/servers?scope=user");if(je.ok){const st=await je.json();M(st.servers||[])}else console.error("Failed to fetch MCP servers")}catch(Z){console.error("Error fetching MCP servers:",Z)}},Ir=async Z=>{try{G&&await sa(G.id,"user");const me=await Ae("/api/mcp/cli/add",{method:"POST",body:JSON.stringify({name:Z.name,type:Z.type,scope:Z.scope,projectPath:Z.projectPath,command:Z.config?.command,args:Z.config?.args||[],url:Z.config?.url,headers:Z.config?.headers||{},env:Z.config?.env||{}})});if(me.ok){const je=await me.json();if(je.success)return await wr(),!0;throw new Error(je.error||"Failed to save server via Claude CLI")}else{const je=await me.json();throw new Error(je.error||"Failed to save server")}}catch(me){throw console.error("Error saving MCP server:",me),me}},sa=async(Z,me="user")=>{try{const je=await Ae(`/api/mcp/cli/remove/${Z}?scope=${me}`,{method:"DELETE"});if(je.ok){const st=await je.json();if(st.success)return await wr(),!0;throw new Error(st.error||"Failed to delete server via Claude CLI")}else{const st=await je.json();throw new Error(st.error||"Failed to delete server")}}catch(je){throw console.error("Error deleting MCP server:",je),je}},On=async(Z,me="user")=>{try{const je=await Ae(`/api/mcp/servers/${Z}/test?scope=${me}`,{method:"POST"});if(je.ok)return(await je.json()).testResult;{const st=await je.json();throw new Error(st.error||"Failed to test server")}}catch(je){throw console.error("Error testing MCP server:",je),je}},Sr=async(Z,me="user")=>{try{const je=await Ae(`/api/mcp/servers/${Z}/tools?scope=${me}`,{method:"POST"});if(je.ok)return(await je.json()).toolsResult;{const st=await je.json();throw new Error(st.error||"Failed to discover tools")}}catch(je){throw console.error("Error discovering MCP tools:",je),je}},oa=async Z=>{try{Gt&&await Hr(Gt.id);const me=await Ae("/api/codex/mcp/cli/add",{method:"POST",body:JSON.stringify({name:Z.name,command:Z.config?.command,args:Z.config?.args||[],env:Z.config?.env||{}})});if(me.ok){const je=await me.json();if(je.success)return await er(),!0;throw new Error(je.error||"Failed to save Codex MCP server")}else{const je=await me.json();throw new Error(je.error||"Failed to save server")}}catch(me){throw console.error("Error saving Codex MCP server:",me),me}},Hr=async Z=>{try{const me=await Ae(`/api/codex/mcp/cli/remove/${Z}`,{method:"DELETE"});if(me.ok){const je=await me.json();if(je.success)return await er(),!0;throw new Error(je.error||"Failed to delete Codex MCP server")}else{const je=await me.json();throw new Error(je.error||"Failed to delete server")}}catch(me){throw console.error("Error deleting Codex MCP server:",me),me}},Yt=()=>{ht({name:"",type:"stdio",config:{command:"",args:[],env:{}}}),Ft(null),Ve(!1)},Ka=(Z=null)=>{Z?(Ft(Z),ht({name:Z.name,type:Z.type||"stdio",config:{command:Z.config?.command||"",args:Z.config?.args||[],env:Z.config?.env||{}}})):Yt(),Ve(!0)},dn=async Z=>{Z.preventDefault(),qt(!0);try{Gt&&await Hr(Gt.name),await oa(Xe),Yt(),A("success")}catch(me){alert(`Error: ${me.message}`),A("error")}finally{qt(!1)}},bn=async Z=>{if(confirm("Are you sure you want to delete this MCP server?"))try{await Hr(Z),A("success")}catch(me){alert(`Error: ${me.message}`),A("error")}};b.useEffect(()=>{e&&(Fi(),xn(),Ya(),Na(),K(n))},[e,n]),b.useEffect(()=>{localStorage.setItem("codeEditorTheme",_e),window.dispatchEvent(new Event("codeEditorSettingsChanged"))},[_e]),b.useEffect(()=>{localStorage.setItem("codeEditorWordWrap",Ke.toString()),window.dispatchEvent(new Event("codeEditorSettingsChanged"))},[Ke]),b.useEffect(()=>{localStorage.setItem("codeEditorShowMinimap",dt.toString()),window.dispatchEvent(new Event("codeEditorSettingsChanged"))},[dt]),b.useEffect(()=>{localStorage.setItem("codeEditorLineNumbers",ft.toString()),window.dispatchEvent(new Event("codeEditorSettingsChanged"))},[ft]),b.useEffect(()=>{localStorage.setItem("codeEditorFontSize",Le),window.dispatchEvent(new Event("codeEditorSettingsChanged"))},[Le]);const Fi=async()=>{try{const Z=localStorage.getItem("claude-settings");if(Z){const st=JSON.parse(Z);c(st.allowedTools||[]),d(st.disallowedTools||[]),k(st.skipPermissions||!1),E(st.projectSortOrder||"name")}else c([]),d([]),k(!1),E("name");const me=localStorage.getItem("cursor-tools-settings");if(me){const st=JSON.parse(me);be(st.allowedCommands||[]),he(st.disallowedCommands||[]),J(st.skipPermissions||!1)}else be([]),he([]),J(!1);const je=localStorage.getItem("codex-settings");if(je){const st=JSON.parse(je);vt(st.permissionMode||"default")}else vt("default");await wr(),await ur(),await er()}catch(Z){console.error("Error loading tool settings:",Z),c([]),d([]),k(!1),E("name")}},xn=async()=>{try{const Z=await Ae("/api/cli/claude/status");if(Z.ok){const me=await Z.json();W({authenticated:me.authenticated,email:me.email,loading:!1,error:me.error||null})}else W({authenticated:!1,email:null,loading:!1,error:"Failed to check authentication status"})}catch(Z){console.error("Error checking Claude auth status:",Z),W({authenticated:!1,email:null,loading:!1,error:Z.message})}},Ya=async()=>{try{const Z=await Ae("/api/cli/cursor/status");if(Z.ok){const me=await Z.json();te({authenticated:me.authenticated,email:me.email,loading:!1,error:me.error||null})}else te({authenticated:!1,email:null,loading:!1,error:"Failed to check authentication status"})}catch(Z){console.error("Error checking Cursor auth status:",Z),te({authenticated:!1,email:null,loading:!1,error:Z.message})}},Na=async()=>{try{const Z=await Ae("/api/cli/codex/status");if(Z.ok){const me=await Z.json();At({authenticated:me.authenticated,email:me.email,loading:!1,error:me.error||null})}else At({authenticated:!1,email:null,loading:!1,error:"Failed to check authentication status"})}catch(Z){console.error("Error checking Codex auth status:",Z),At({authenticated:!1,email:null,loading:!1,error:Z.message})}},yn=()=>{Pe("claude"),ge(r?.[0]||{name:"default",fullPath:process.cwd()}),vr(!0)},ul=()=>{Pe("cursor"),ge(r?.[0]||{name:"default",fullPath:process.cwd()}),vr(!0)},Dn=()=>{Pe("codex"),ge(r?.[0]||{name:"default",fullPath:process.cwd()}),vr(!0)},tn=Z=>{Z===0&&(A("success"),Q==="claude"?xn():Q==="cursor"?Ya():Q==="codex"&&Na())},Mn=()=>{v(!0),A(null);try{const Z={allowedTools:l,disallowedTools:u,skipPermissions:f,projectSortOrder:I,lastUpdated:new Date().toISOString()},me={allowedCommands:yt,disallowedCommands:Ge,skipPermissions:Ee,lastUpdated:new Date().toISOString()},je={permissionMode:_t,lastUpdated:new Date().toISOString()};localStorage.setItem("claude-settings",JSON.stringify(Z)),localStorage.setItem("cursor-tools-settings",JSON.stringify(me)),localStorage.setItem("codex-settings",JSON.stringify(je)),A("success"),setTimeout(()=>{t()},1e3)}catch(Z){console.error("Error saving tool settings:",Z),A("error")}finally{v(!1)}},Fn=()=>{P({name:"",type:"stdio",scope:"user",projectPath:"",config:{command:"",args:[],env:{},url:"",headers:{},timeout:3e4},jsonInput:"",importMode:"form"}),V(null),j(!1),ve("")},pn=(Z=null)=>{Z?(V(Z),P({name:Z.name,type:Z.type,scope:Z.scope,projectPath:Z.projectPath||"",config:{...Z.config},raw:Z.raw,importMode:"form",jsonInput:""})):Fn(),j(!0)},As=async Z=>{Z.preventDefault(),F(!0);try{if(D.importMode==="json"){const me=await Ae("/api/mcp/cli/add-json",{method:"POST",body:JSON.stringify({name:D.name,jsonConfig:D.jsonInput,scope:D.scope,projectPath:D.projectPath})});if(me.ok){const je=await me.json();if(je.success)await wr(),Fn(),A("success");else throw new Error(je.error||"Failed to add server via JSON")}else{const je=await me.json();throw new Error(je.error||"Failed to add server")}}else await Ir(D),Fn(),A("success")}catch(me){alert(`Error: ${me.message}`),A("error")}finally{F(!1)}},vn=async(Z,me)=>{if(confirm("Are you sure you want to delete this MCP server?"))try{await sa(Z,me),A("success")}catch(je){alert(`Error: ${je.message}`),A("error")}},Ca=async(Z,me)=>{try{H({...$,[Z]:{loading:!0}});const je=await On(Z,me);H({...$,[Z]:je})}catch(je){H({...$,[Z]:{success:!1,message:je.message,details:[]}})}},dl=async(Z,me)=>{try{re({...z,[Z]:!0});const je=await Sr(Z,me);N({...ne,[Z]:je})}catch{N({...ne,[Z]:{success:!1,tools:[],resources:[],prompts:[]}})}finally{re({...z,[Z]:!1})}},Ta=(Z,me)=>{P(je=>({...je,config:{...je.config,[Z]:me}}))};return e?i.jsxs("div",{className:"modal-backdrop fixed inset-0 flex items-center justify-center z-[9999] md:p-4 bg-background/95",children:[i.jsxs("div",{className:"bg-background border border-border md:rounded-lg shadow-xl w-full md:max-w-4xl h-full md:h-[90vh] flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between p-4 md:p-6 border-b border-border flex-shrink-0",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Pa,{className:"w-5 h-5 md:w-6 md:h-6 text-blue-600"}),i.jsx("h2",{className:"text-lg md:text-xl font-semibold text-foreground",children:o("title")})]}),i.jsx(ze,{variant:"ghost",size:"sm",onClick:t,className:"text-muted-foreground hover:text-foreground touch-manipulation",children:i.jsx($t,{className:"w-5 h-5"})})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto",children:[i.jsx("div",{className:"border-b border-border",children:i.jsxs("div",{className:"flex px-4 md:px-6",children:[i.jsx("button",{onClick:()=>K("agents"),className:`px-4 py-3 text-sm font-medium border-b-2 transition-colors ${R==="agents"?"border-blue-600 text-blue-600 dark:text-blue-400":"border-transparent text-muted-foreground hover:text-foreground"}`,children:o("mainTabs.agents")}),i.jsx("button",{onClick:()=>K("appearance"),className:`px-4 py-3 text-sm font-medium border-b-2 transition-colors ${R==="appearance"?"border-blue-600 text-blue-600 dark:text-blue-400":"border-transparent text-muted-foreground hover:text-foreground"}`,children:o("mainTabs.appearance")}),i.jsxs("button",{onClick:()=>K("git"),className:`px-4 py-3 text-sm font-medium border-b-2 transition-colors ${R==="git"?"border-blue-600 text-blue-600 dark:text-blue-400":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[i.jsx(ba,{className:"w-4 h-4 inline mr-2"}),o("mainTabs.git")]}),i.jsxs("button",{onClick:()=>K("api"),className:`px-4 py-3 text-sm font-medium border-b-2 transition-colors ${R==="api"?"border-blue-600 text-blue-600 dark:text-blue-400":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[i.jsx(hg,{className:"w-4 h-4 inline mr-2"}),o("mainTabs.apiTokens")]}),i.jsx("button",{onClick:()=>K("tasks"),className:`px-4 py-3 text-sm font-medium border-b-2 transition-colors ${R==="tasks"?"border-blue-600 text-blue-600 dark:text-blue-400":"border-transparent text-muted-foreground hover:text-foreground"}`,children:o("mainTabs.tasks")})]})}),i.jsxs("div",{className:"p-4 md:p-6 space-y-6 md:space-y-8 pb-safe-area-inset-bottom",children:[R==="appearance"&&i.jsx("div",{className:"space-y-6 md:space-y-8",children:R==="appearance"&&i.jsxs("div",{className:"space-y-6 md:space-y-8",children:[i.jsx("div",{className:"space-y-4",children:i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-foreground",children:o("appearanceSettings.darkMode.label")}),i.jsx("div",{className:"text-sm text-muted-foreground",children:o("appearanceSettings.darkMode.description")})]}),i.jsxs("button",{onClick:s,className:"relative inline-flex h-8 w-14 items-center rounded-full bg-gray-200 dark:bg-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",role:"switch","aria-checked":a,"aria-label":"Toggle dark mode",children:[i.jsx("span",{className:"sr-only",children:"Toggle dark mode"}),i.jsx("span",{className:`${a?"translate-x-7":"translate-x-1"} inline-block h-6 w-6 transform rounded-full bg-white shadow-lg transition-transform duration-200 flex items-center justify-center`,children:a?i.jsx(dh,{className:"w-3.5 h-3.5 text-gray-700"}):i.jsx(ph,{className:"w-3.5 h-3.5 text-yellow-500"})})]})]})})}),i.jsx("div",{className:"space-y-4",children:i.jsx(K3,{})}),i.jsx("div",{className:"space-y-4",children:i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-foreground",children:o("appearanceSettings.projectSorting.label")}),i.jsx("div",{className:"text-sm text-muted-foreground",children:o("appearanceSettings.projectSorting.description")})]}),i.jsxs("select",{value:I,onChange:Z=>E(Z.target.value),className:"text-sm bg-gray-50 dark:bg-gray-800 border border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500 p-2 w-32",children:[i.jsx("option",{value:"name",children:o("appearanceSettings.projectSorting.alphabetical")}),i.jsx("option",{value:"date",children:o("appearanceSettings.projectSorting.recentActivity")})]})]})})}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-lg font-semibold text-foreground",children:o("appearanceSettings.codeEditor.title")}),i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-foreground",children:o("appearanceSettings.codeEditor.theme.label")}),i.jsx("div",{className:"text-sm text-muted-foreground",children:o("appearanceSettings.codeEditor.theme.description")})]}),i.jsxs("button",{onClick:()=>qe(_e==="dark"?"light":"dark"),className:"relative inline-flex h-8 w-14 items-center rounded-full bg-gray-200 dark:bg-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",role:"switch","aria-checked":_e==="dark","aria-label":"Toggle editor theme",children:[i.jsx("span",{className:"sr-only",children:"Toggle editor theme"}),i.jsx("span",{className:`${_e==="dark"?"translate-x-7":"translate-x-1"} inline-block h-6 w-6 transform rounded-full bg-white shadow-lg transition-transform duration-200 flex items-center justify-center`,children:_e==="dark"?i.jsx(dh,{className:"w-3.5 h-3.5 text-gray-700"}):i.jsx(ph,{className:"w-3.5 h-3.5 text-yellow-500"})})]})]})}),i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-foreground",children:o("appearanceSettings.codeEditor.wordWrap.label")}),i.jsx("div",{className:"text-sm text-muted-foreground",children:o("appearanceSettings.codeEditor.wordWrap.description")})]}),i.jsxs("button",{onClick:()=>xt(!Ke),className:"relative inline-flex h-8 w-14 items-center rounded-full bg-gray-200 dark:bg-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",role:"switch","aria-checked":Ke,"aria-label":"Toggle word wrap",children:[i.jsx("span",{className:"sr-only",children:"Toggle word wrap"}),i.jsx("span",{className:`${Ke?"translate-x-7":"translate-x-1"} inline-block h-6 w-6 transform rounded-full bg-white shadow-lg transition-transform duration-200`})]})]})}),i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-foreground",children:o("appearanceSettings.codeEditor.showMinimap.label")}),i.jsx("div",{className:"text-sm text-muted-foreground",children:o("appearanceSettings.codeEditor.showMinimap.description")})]}),i.jsxs("button",{onClick:()=>St(!dt),className:"relative inline-flex h-8 w-14 items-center rounded-full bg-gray-200 dark:bg-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",role:"switch","aria-checked":dt,"aria-label":"Toggle minimap",children:[i.jsx("span",{className:"sr-only",children:"Toggle minimap"}),i.jsx("span",{className:`${dt?"translate-x-7":"translate-x-1"} inline-block h-6 w-6 transform rounded-full bg-white shadow-lg transition-transform duration-200`})]})]})}),i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-foreground",children:o("appearanceSettings.codeEditor.lineNumbers.label")}),i.jsx("div",{className:"text-sm text-muted-foreground",children:o("appearanceSettings.codeEditor.lineNumbers.description")})]}),i.jsxs("button",{onClick:()=>pt(!ft),className:"relative inline-flex h-8 w-14 items-center rounded-full bg-gray-200 dark:bg-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",role:"switch","aria-checked":ft,"aria-label":"Toggle line numbers",children:[i.jsx("span",{className:"sr-only",children:"Toggle line numbers"}),i.jsx("span",{className:`${ft?"translate-x-7":"translate-x-1"} inline-block h-6 w-6 transform rounded-full bg-white shadow-lg transition-transform duration-200`})]})]})}),i.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-foreground",children:o("appearanceSettings.codeEditor.fontSize.label")}),i.jsx("div",{className:"text-sm text-muted-foreground",children:o("appearanceSettings.codeEditor.fontSize.description")})]}),i.jsxs("select",{value:Le,onChange:Z=>et(Z.target.value),className:"text-sm bg-gray-50 dark:bg-gray-800 border border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500 p-2 w-24",children:[i.jsx("option",{value:"10",children:"10px"}),i.jsx("option",{value:"11",children:"11px"}),i.jsx("option",{value:"12",children:"12px"}),i.jsx("option",{value:"13",children:"13px"}),i.jsx("option",{value:"14",children:"14px"}),i.jsx("option",{value:"15",children:"15px"}),i.jsx("option",{value:"16",children:"16px"}),i.jsx("option",{value:"18",children:"18px"}),i.jsx("option",{value:"20",children:"20px"})]})]})})]})]})}),R==="git"&&i.jsx(MH,{}),R==="agents"&&i.jsxs("div",{className:"flex flex-col md:flex-row h-full min-h-[400px] md:min-h-[500px]",children:[i.jsx("div",{className:"md:hidden border-b border-gray-200 dark:border-gray-700 flex-shrink-0",children:i.jsxs("div",{className:"flex",children:[i.jsx(oi,{agentId:"claude",authStatus:ke,isSelected:oe==="claude",onClick:()=>Ie("claude"),isMobile:!0}),i.jsx(oi,{agentId:"cursor",authStatus:se,isSelected:oe==="cursor",onClick:()=>Ie("cursor"),isMobile:!0}),i.jsx(oi,{agentId:"codex",authStatus:Be,isSelected:oe==="codex",onClick:()=>Ie("codex"),isMobile:!0})]})}),i.jsx("div",{className:"hidden md:block w-48 border-r border-gray-200 dark:border-gray-700 flex-shrink-0",children:i.jsxs("div",{className:"p-2",children:[i.jsx(oi,{agentId:"claude",authStatus:ke,isSelected:oe==="claude",onClick:()=>Ie("claude")}),i.jsx(oi,{agentId:"cursor",authStatus:se,isSelected:oe==="cursor",onClick:()=>Ie("cursor")}),i.jsx(oi,{agentId:"codex",authStatus:Be,isSelected:oe==="codex",onClick:()=>Ie("codex")})]})}),i.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[i.jsx("div",{className:"border-b border-gray-200 dark:border-gray-700 flex-shrink-0",children:i.jsxs("div",{className:"flex px-2 md:px-4 overflow-x-auto",children:[i.jsx("button",{onClick:()=>ye("account"),className:`px-3 md:px-4 py-2 md:py-3 text-xs md:text-sm font-medium border-b-2 transition-colors whitespace-nowrap ${ce==="account"?"border-blue-600 text-blue-600 dark:text-blue-400":"border-transparent text-muted-foreground hover:text-foreground"}`,children:o("tabs.account")}),i.jsx("button",{onClick:()=>ye("permissions"),className:`px-3 md:px-4 py-2 md:py-3 text-xs md:text-sm font-medium border-b-2 transition-colors whitespace-nowrap ${ce==="permissions"?"border-blue-600 text-blue-600 dark:text-blue-400":"border-transparent text-muted-foreground hover:text-foreground"}`,children:o("tabs.permissions")}),i.jsx("button",{onClick:()=>ye("mcp"),className:`px-3 md:px-4 py-2 md:py-3 text-xs md:text-sm font-medium border-b-2 transition-colors whitespace-nowrap ${ce==="mcp"?"border-blue-600 text-blue-600 dark:text-blue-400":"border-transparent text-muted-foreground hover:text-foreground"}`,children:o("tabs.mcpServers")})]})}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-3 md:p-4",children:[ce==="account"&&i.jsx(UH,{agent:oe,authStatus:oe==="claude"?ke:oe==="cursor"?se:Be,onLogin:oe==="claude"?yn:oe==="cursor"?ul:Dn}),ce==="permissions"&&oe==="claude"&&i.jsx(sh,{agent:"claude",skipPermissions:f,setSkipPermissions:k,allowedTools:l,setAllowedTools:c,disallowedTools:u,setDisallowedTools:d,newAllowedTool:p,setNewAllowedTool:h,newDisallowedTool:m,setNewDisallowedTool:g}),ce==="permissions"&&oe==="cursor"&&i.jsx(sh,{agent:"cursor",skipPermissions:Ee,setSkipPermissions:J,allowedCommands:yt,setAllowedCommands:be,disallowedCommands:Ge,setDisallowedCommands:he,newAllowedCommand:ie,setNewAllowedCommand:fe,newDisallowedCommand:De,setNewDisallowedCommand:Ye}),ce==="permissions"&&oe==="codex"&&i.jsx(sh,{agent:"codex",permissionMode:_t,setPermissionMode:vt}),ce==="mcp"&&oe==="claude"&&i.jsx(oh,{agent:"claude",servers:C,onAdd:()=>pn(),onEdit:Z=>pn(Z),onDelete:(Z,me)=>vn(Z,me),onTest:(Z,me)=>Ca(Z,me),onDiscoverTools:(Z,me)=>dl(Z,me),testResults:$,serverTools:ne,toolsLoading:z}),ce==="mcp"&&oe==="cursor"&&i.jsx(oh,{agent:"cursor",servers:mt,onAdd:()=>{},onEdit:Z=>{},onDelete:Z=>{}}),ce==="mcp"&&oe==="codex"&&i.jsx(oh,{agent:"codex",servers:jt,onAdd:()=>Ka(),onEdit:Z=>Ka(Z),onDelete:Z=>bn(Z)})]})]})]}),O&&i.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[110] p-4",children:i.jsxs("div",{className:"bg-background border border-border rounded-lg w-full max-w-2xl max-h-[90vh] overflow-y-auto",children:[i.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[i.jsx("h3",{className:"text-lg font-medium text-foreground",children:o(G?"mcpForm.title.edit":"mcpForm.title.add")}),i.jsx(ze,{variant:"ghost",size:"sm",onClick:Fn,children:i.jsx($t,{className:"w-4 h-4"})})]}),i.jsxs("form",{onSubmit:As,className:"p-4 space-y-4",children:[!G&&i.jsxs("div",{className:"flex gap-2 mb-4",children:[i.jsx("button",{type:"button",onClick:()=>P(Z=>({...Z,importMode:"form"})),className:`px-4 py-2 rounded-lg font-medium transition-colors ${D.importMode==="form"?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:o("mcpForm.importMode.form")}),i.jsx("button",{type:"button",onClick:()=>P(Z=>({...Z,importMode:"json"})),className:`px-4 py-2 rounded-lg font-medium transition-colors ${D.importMode==="json"?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:o("mcpForm.importMode.json")})]}),D.importMode==="form"&&G&&i.jsxs("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-3",children:[i.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:o("mcpForm.scope.label")}),i.jsxs("div",{className:"flex items-center gap-2",children:[D.scope==="user"?i.jsx(uh,{className:"w-4 h-4"}):i.jsx(An,{className:"w-4 h-4"}),i.jsx("span",{className:"text-sm",children:D.scope==="user"?o("mcpForm.scope.userGlobal"):o("mcpForm.scope.projectLocal")}),D.scope==="local"&&D.projectPath&&i.jsxs("span",{className:"text-xs text-muted-foreground",children:["- ",D.projectPath]})]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:o("mcpForm.scope.cannotChange")})]}),D.importMode==="form"&&!G&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsxs("label",{className:"block text-sm font-medium text-foreground mb-2",children:[o("mcpForm.scope.label")," *"]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{type:"button",onClick:()=>P(Z=>({...Z,scope:"user",projectPath:""})),className:`flex-1 px-4 py-2 rounded-lg font-medium transition-colors ${D.scope==="user"?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:i.jsxs("div",{className:"flex items-center justify-center gap-2",children:[i.jsx(uh,{className:"w-4 h-4"}),i.jsx("span",{children:o("mcpForm.scope.userGlobal")})]})}),i.jsx("button",{type:"button",onClick:()=>P(Z=>({...Z,scope:"local"})),className:`flex-1 px-4 py-2 rounded-lg font-medium transition-colors ${D.scope==="local"?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:i.jsxs("div",{className:"flex items-center justify-center gap-2",children:[i.jsx(An,{className:"w-4 h-4"}),i.jsx("span",{children:o("mcpForm.scope.projectLocal")})]})})]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:D.scope==="user"?o("mcpForm.scope.userDescription"):o("mcpForm.scope.projectDescription")})]}),D.scope==="local"&&!G&&i.jsxs("div",{children:[i.jsxs("label",{className:"block text-sm font-medium text-foreground mb-2",children:[o("mcpForm.fields.selectProject")," *"]}),i.jsxs("select",{value:D.projectPath,onChange:Z=>P(me=>({...me,projectPath:Z.target.value})),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500",required:D.scope==="local",children:[i.jsxs("option",{value:"",children:[o("mcpForm.fields.selectProject"),"..."]}),r.map(Z=>i.jsx("option",{value:Z.path||Z.fullPath,children:Z.displayName||Z.name},Z.name))]}),D.projectPath&&i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:o("mcpForm.projectPath",{path:D.projectPath})})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:D.importMode==="json"?"md:col-span-2":"",children:[i.jsxs("label",{className:"block text-sm font-medium text-foreground mb-2",children:[o("mcpForm.fields.serverName")," *"]}),i.jsx(lr,{value:D.name,onChange:Z=>{P(me=>({...me,name:Z.target.value}))},placeholder:o("mcpForm.placeholders.serverName"),required:!0})]}),D.importMode==="form"&&i.jsxs("div",{children:[i.jsxs("label",{className:"block text-sm font-medium text-foreground mb-2",children:[o("mcpForm.fields.transportType")," *"]}),i.jsxs("select",{value:D.type,onChange:Z=>{P(me=>({...me,type:Z.target.value}))},className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500",children:[i.jsx("option",{value:"stdio",children:"stdio"}),i.jsx("option",{value:"sse",children:"SSE"}),i.jsx("option",{value:"http",children:"HTTP"})]})]})]}),G&&D.raw&&D.importMode==="form"&&i.jsxs("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:[i.jsx("h4",{className:"text-sm font-medium text-foreground mb-2",children:o("mcpForm.configDetails",{configFile:G.scope==="global"?"~/.claude.json":"project config"})}),i.jsx("pre",{className:"text-xs bg-gray-100 dark:bg-gray-800 p-3 rounded overflow-x-auto",children:JSON.stringify(D.raw,null,2)})]}),D.importMode==="json"&&i.jsx("div",{className:"space-y-4",children:i.jsxs("div",{children:[i.jsxs("label",{className:"block text-sm font-medium text-foreground mb-2",children:[o("mcpForm.fields.jsonConfig")," *"]}),i.jsx("textarea",{value:D.jsonInput,onChange:Z=>{P(me=>({...me,jsonInput:Z.target.value}));try{if(Z.target.value.trim()){const me=JSON.parse(Z.target.value);me.type?me.type==="stdio"&&!me.command?ve(o("mcpForm.validation.stdioRequiresCommand")):(me.type==="http"||me.type==="sse")&&!me.url?ve(o("mcpForm.validation.httpRequiresUrl",{type:me.type})):ve(""):ve(o("mcpForm.validation.missingType"))}}catch{Z.target.value.trim()?ve(o("mcpForm.validation.invalidJson")):ve("")}},className:`w-full px-3 py-2 border ${pe?"border-red-500":"border-gray-300 dark:border-gray-600"} bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500 font-mono text-sm`,rows:"8",placeholder:`{
1217
1217
  "type": "stdio",
1218
1218
  "command": "/path/to/server",
1219
1219
  "args": ["--api-key", "abc123"],
@@ -1235,7 +1235,7 @@ X-API-Key=your-key`})]}),i.jsxs("div",{className:"flex justify-end gap-2 pt-4",c
1235
1235
  3000`,rows:3,className:"w-full px-3 py-2 text-sm bg-background border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:o("mcpForm.fields.envVars")}),i.jsx("textarea",{value:Object.entries(Xe.config?.env||{}).map(([Z,me])=>`${Z}=${me}`).join(`
1236
1236
  `),onChange:Z=>{const me={};Z.target.value.split(`
1237
1237
  `).forEach(je=>{const[st,...fr]=je.split("=");st&&fr.length>0&&(me[st.trim()]=fr.join("=").trim())}),ht(je=>({...je,config:{...je.config,env:me}}))},placeholder:`API_KEY=xxx
1238
- DEBUG=true`,rows:3,className:"w-full px-3 py-2 text-sm bg-background border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring"})]}),i.jsxs("div",{className:"flex justify-end gap-2 pt-4 border-t border-border",children:[i.jsx(ze,{type:"button",variant:"outline",onClick:Yt,children:o("mcpForm.actions.cancel")}),i.jsx(ze,{type:"submit",disabled:Lt||!Xe.name||!Xe.config?.command,className:"bg-green-600 hover:bg-green-700 text-white",children:o(Lt?"mcpForm.actions.saving":Gt?"mcpForm.actions.updateServer":"mcpForm.actions.addServer")})]})]})]})}),R==="tasks"&&i.jsx("div",{className:"space-y-6 md:space-y-8",children:i.jsx(FH,{})}),R==="api"&&i.jsx("div",{className:"space-y-6 md:space-y-8",children:i.jsx(DH,{})})]})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between p-4 md:p-6 border-t border-border flex-shrink-0 gap-3 pb-safe-area-inset-bottom",children:[i.jsxs("div",{className:"flex items-center justify-center sm:justify-start gap-2 order-2 sm:order-1",children:[w==="success"&&i.jsxs("div",{className:"text-green-600 dark:text-green-400 text-sm flex items-center gap-1",children:[i.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:i.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),o("saveStatus.success")]}),w==="error"&&i.jsxs("div",{className:"text-red-600 dark:text-red-400 text-sm flex items-center gap-1",children:[i.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:i.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),o("saveStatus.error")]})]}),i.jsxs("div",{className:"flex items-center gap-3 order-1 sm:order-2",children:[i.jsx(ze,{variant:"outline",onClick:t,disabled:S,className:"flex-1 sm:flex-none h-10 touch-manipulation",children:o("footerActions.cancel")}),i.jsx(ze,{onClick:Mn,disabled:S,className:"flex-1 sm:flex-none h-10 bg-blue-600 hover:bg-blue-700 disabled:opacity-50 touch-manipulation",children:S?i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-4 h-4 animate-spin rounded-full border-2 border-white border-t-transparent"}),o("saveStatus.saving")]}):o("footerActions.save")})]})]})]}),i.jsx(V3,{isOpen:ar,onClose:()=>vr(!1),provider:Q,project:le,onComplete:tn,isAuthenticated:Q==="claude"?ke.authenticated:Q==="cursor"?se.authenticated:Q==="codex"?Be.authenticated:!1},Q)]}):null}function JH(){const{isDarkMode:e,toggleDarkMode:t}=xs();return i.jsxs("button",{onClick:t,className:"relative inline-flex h-8 w-14 items-center rounded-full bg-gray-200 dark:bg-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",role:"switch","aria-checked":e,"aria-label":"Toggle dark mode",children:[i.jsx("span",{className:"sr-only",children:"Toggle dark mode"}),i.jsx("span",{className:`${e?"translate-x-7":"translate-x-1"} inline-block h-6 w-6 transform rounded-full bg-white shadow-lg transition-transform duration-200 flex items-center justify-center`,children:e?i.jsx("svg",{className:"w-3.5 h-3.5 text-gray-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})}):i.jsx("svg",{className:"w-3.5 h-3.5 text-yellow-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})})})]})}const QH=({isOpen:e,onToggle:t,autoExpandTools:r,onAutoExpandChange:n,showRawParameters:a,onShowRawParametersChange:s,showThinking:o,onShowThinkingChange:l,autoScrollToBottom:c,onAutoScrollChange:u,sendByCtrlEnter:d,onSendByCtrlEnterChange:p,isMobile:h})=>{const{t:m}=Kt("settings"),[g,f]=b.useState(e),[k,S]=b.useState(()=>localStorage.getItem("whisperMode")||"default"),{isDarkMode:v}=xs(),[w,A]=b.useState(()=>{const z=localStorage.getItem("quickSettingsHandlePosition");if(z)try{return JSON.parse(z).y??50}catch{return localStorage.removeItem("quickSettingsHandlePosition"),50}return 50}),[I,E]=b.useState(!1),[C,M]=b.useState(0),[O,j]=b.useState(0),[G,V]=b.useState(!1),D=b.useRef(null),P=b.useRef({min:10,max:90}),B=5;b.useEffect(()=>{f(e)},[e]),b.useEffect(()=>{localStorage.setItem("quickSettingsHandlePosition",JSON.stringify({y:w}))},[w]);const F=b.useCallback(()=>h?{bottom:`${window.innerHeight*w/100}px`}:{top:`${w}%`,transform:"translateY(-50%)"},[w,h]),$=b.useCallback(z=>{z.stopPropagation();const re=z.type.includes("touch")?z.touches[0].clientY:z.clientY;M(re),j(w),V(!1),E(!1)},[w]),H=b.useCallback(z=>{if(C===0)return;const re=z.type.includes("touch")?z.touches[0].clientY:z.clientY,R=Math.abs(re-C);if(!I&&R>B&&(E(!0),V(!0),document.body.style.cursor="grabbing",document.body.style.userSelect="none",z.type.includes("touch")&&(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%")),!I)return;z.type.includes("touch")&&z.preventDefault();const K=re-C;let pe;h?pe=-(K/window.innerHeight)*100:pe=K/window.innerHeight*100;let ve=O+pe;ve=Math.max(P.current.min,Math.min(P.current.max,ve)),A(ve)},[I,C,O,h,B]),ne=b.useCallback(()=>{E(!1),M(0),document.body.style.cursor="",document.body.style.userSelect="",document.body.style.overflow="",document.body.style.position="",document.body.style.width=""},[]);b.useEffect(()=>()=>{document.body.style.cursor="",document.body.style.userSelect="",document.body.style.overflow="",document.body.style.position="",document.body.style.width=""},[]),b.useEffect(()=>{if(C!==0){const z=pe=>H(pe),re=()=>ne(),R=pe=>H(pe),K=()=>ne();return document.addEventListener("mousemove",z),document.addEventListener("mouseup",re),document.addEventListener("touchmove",R,{passive:!1}),document.addEventListener("touchend",K),()=>{document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",re),document.removeEventListener("touchmove",R),document.removeEventListener("touchend",K)}}},[C,H,ne]);const N=z=>{if(G){z.preventDefault(),V(!1);return}const re=!g;f(re),t(re)};return i.jsxs(i.Fragment,{children:[i.jsx("button",{ref:D,onClick:N,onMouseDown:z=>{$(z)},onTouchStart:z=>{$(z)},className:`fixed ${g?"right-64":"right-0"} z-50 ${I?"":"transition-all duration-150 ease-out"} bg-white dark:bg-gray-800 border ${I?"border-blue-500 dark:border-blue-400":"border-gray-200 dark:border-gray-700"} rounded-l-md p-2 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors shadow-lg ${I?"cursor-grabbing":"cursor-pointer"} touch-none`,style:{...F(),touchAction:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none"},"aria-label":m(I?"quickSettings.dragHandle.dragging":g?"quickSettings.dragHandle.closePanel":"quickSettings.dragHandle.openPanel"),title:m(I?"quickSettings.dragHandle.draggingStatus":"quickSettings.dragHandle.toggleAndMove"),children:I?i.jsx(t6,{className:"h-5 w-5 text-blue-500 dark:text-blue-400"}):g?i.jsx(Hn,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"}):i.jsx(mg,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"})}),i.jsx("div",{className:`fixed top-0 right-0 h-full w-64 bg-background border-l border-border shadow-xl transform transition-transform duration-150 ease-out z-40 ${g?"translate-x-0":"translate-x-full"} ${h?"h-screen":""}`,children:i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900",children:i.jsxs("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[i.jsx(O6,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"}),m("quickSettings.title")]})}),i.jsxs("div",{className:`flex-1 overflow-y-auto overflow-x-hidden p-4 space-y-6 bg-background ${h?"pb-mobile-nav":""}`,children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:m("quickSettings.sections.appearance")}),i.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[v?i.jsx(dh,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}):i.jsx(ph,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),m("quickSettings.darkMode")]}),i.jsx(JH,{})]}),i.jsx("div",{children:i.jsx(K3,{compact:!0})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:m("quickSettings.sections.toolDisplay")}),i.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[i.jsx(gg,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),m("quickSettings.autoExpandTools")]}),i.jsx("input",{type:"checkbox",checked:r,onChange:z=>n(z.target.checked),className:"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"})]}),i.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[i.jsx(Ai,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),m("quickSettings.showRawParameters")]}),i.jsx("input",{type:"checkbox",checked:a,onChange:z=>s(z.target.checked),className:"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"})]}),i.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[i.jsx($o,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),m("quickSettings.showThinking")]}),i.jsx("input",{type:"checkbox",checked:o,onChange:z=>l(z.target.checked),className:"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"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:m("quickSettings.sections.viewOptions")}),i.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[i.jsx(K4,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),m("quickSettings.autoScrollToBottom")]}),i.jsx("input",{type:"checkbox",checked:c,onChange:z=>u(z.target.checked),className:"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"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:m("quickSettings.sections.inputSettings")}),i.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[i.jsx(J4,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),m("quickSettings.sendByCtrlEnter")]}),i.jsx("input",{type:"checkbox",checked:d,onChange:z=>p(z.target.checked),className:"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"})]}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 ml-3",children:m("quickSettings.sendByCtrlEnterDescription")})]}),i.jsxs("div",{className:"space-y-2",style:{display:"none"},children:[i.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:m("quickSettings.sections.whisperDictation")}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("label",{className:"flex items-start p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[i.jsx("input",{type:"radio",name:"whisperMode",value:"default",checked:k==="default",onChange:()=>{S("default"),localStorage.setItem("whisperMode","default"),window.dispatchEvent(new Event("whisperModeChanged"))},className:"mt-0.5 h-4 w-4 border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"}),i.jsxs("div",{className:"ml-3 flex-1",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white",children:[i.jsx(po,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),m("quickSettings.whisper.modes.default")]}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:m("quickSettings.whisper.modes.defaultDescription")})]})]}),i.jsxs("label",{className:"flex items-start p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[i.jsx("input",{type:"radio",name:"whisperMode",value:"prompt",checked:k==="prompt",onChange:()=>{S("prompt"),localStorage.setItem("whisperMode","prompt"),window.dispatchEvent(new Event("whisperModeChanged"))},className:"mt-0.5 h-4 w-4 border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"}),i.jsxs("div",{className:"ml-3 flex-1",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white",children:[i.jsx(Wn,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),m("quickSettings.whisper.modes.prompt")]}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:m("quickSettings.whisper.modes.promptDescription")})]})]}),i.jsxs("label",{className:"flex items-start p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[i.jsx("input",{type:"radio",name:"whisperMode",value:"vibe",checked:k==="vibe"||k==="instructions"||k==="architect",onChange:()=>{S("vibe"),localStorage.setItem("whisperMode","vibe"),window.dispatchEvent(new Event("whisperModeChanged"))},className:"mt-0.5 h-4 w-4 border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"}),i.jsxs("div",{className:"ml-3 flex-1",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white",children:[i.jsx(zr,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),m("quickSettings.whisper.modes.vibe")]}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:m("quickSettings.whisper.modes.vibeDescription")})]})]})]})]})]})]})}),g&&i.jsx("div",{className:"fixed inset-0 bg-background/80 backdrop-blur-sm z-30 transition-opacity duration-150 ease-out",onClick:N})]})},eW=()=>{const[e,t]=b.useState(""),[r,n]=b.useState(""),[a,s]=b.useState(""),[o,l]=b.useState(!1),[c,u]=b.useState(""),{register:d}=ji(),p=async h=>{if(h.preventDefault(),u(""),r!==a){u("Passwords do not match");return}if(e.length<3){u("Username must be at least 3 characters long");return}if(r.length<6){u("Password must be at least 6 characters long");return}l(!0);const m=await d(e,r);m.success||u(m.error),l(!1)};return i.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:i.jsx("div",{className:"w-full max-w-md",children:i.jsxs("div",{className:"bg-card rounded-lg shadow-lg border border-border p-8 space-y-6",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"flex justify-center mb-4",children:i.jsx(In,{size:64})}),i.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Welcome to Axhub Genie"}),i.jsx("p",{className:"text-muted-foreground mt-2",children:"Set up your account to get started"})]}),i.jsxs("form",{onSubmit:p,className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-foreground mb-1",children:"Username"}),i.jsx("input",{type:"text",id:"username",value:e,onChange:h=>t(h.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter your username",required:!0,disabled:o})]}),i.jsxs("div",{children:[i.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-foreground mb-1",children:"Password"}),i.jsx("input",{type:"password",id:"password",value:r,onChange:h=>n(h.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter your password",required:!0,disabled:o})]}),i.jsxs("div",{children:[i.jsx("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-foreground mb-1",children:"Confirm Password"}),i.jsx("input",{type:"password",id:"confirmPassword",value:a,onChange:h=>s(h.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Confirm your password",required:!0,disabled:o})]}),c&&i.jsx("div",{className:"p-3 bg-red-100 dark:bg-red-900/20 border border-red-300 dark:border-red-800 rounded-md",children:i.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:c})}),i.jsx("button",{type:"submit",disabled:o,className:"w-full bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 text-white font-medium py-2 px-4 rounded-md transition-colors duration-200",children:o?"Setting up...":"Create Account"})]}),i.jsx("div",{className:"text-center",children:i.jsx("p",{className:"text-sm text-muted-foreground",children:"This is a single-user system. Only one account can be created."})})]})})})},tW=()=>{const{t:e}=Kt("auth"),[t,r]=b.useState(""),[n,a]=b.useState(""),[s,o]=b.useState(!1),[l,c]=b.useState(""),{login:u}=ji(),d=async p=>{if(p.preventDefault(),c(""),!t||!n){c(e("errors.requiredFields"));return}o(!0);const h=await u(t,n);h.success||c(h.error),o(!1)};return i.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:i.jsx("div",{className:"w-full max-w-md",children:i.jsxs("div",{className:"bg-card rounded-lg shadow-lg border border-border p-8 space-y-6",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"flex justify-center mb-4",children:i.jsx("div",{className:"w-16 h-16 bg-primary rounded-lg flex items-center justify-center shadow-sm",children:i.jsx(ko,{className:"w-8 h-8 text-primary-foreground"})})}),i.jsx("h1",{className:"text-2xl font-bold text-foreground",children:e("login.title")}),i.jsx("p",{className:"text-muted-foreground mt-2",children:e("login.description")})]}),i.jsxs("form",{onSubmit:d,className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-foreground mb-1",children:e("login.username")}),i.jsx("input",{type:"text",id:"username",value:t,onChange:p=>r(p.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:e("login.placeholders.username"),required:!0,disabled:s})]}),i.jsxs("div",{children:[i.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-foreground mb-1",children:e("login.password")}),i.jsx("input",{type:"password",id:"password",value:n,onChange:p=>a(p.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:e("login.placeholders.password"),required:!0,disabled:s})]}),l&&i.jsx("div",{className:"p-3 bg-red-100 dark:bg-red-900/20 border border-red-300 dark:border-red-800 rounded-md",children:i.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:l})}),i.jsx("button",{type:"submit",disabled:s,className:"w-full bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 text-white font-medium py-2 px-4 rounded-md transition-colors duration-200",children:e(s?"login.loading":"login.submit")})]}),i.jsx("div",{className:"text-center",children:i.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter your credentials to access Axhub Genie"})})]})})})},rW=({onComplete:e})=>{const[t,r]=b.useState(0),[n,a]=b.useState(""),[s,o]=b.useState(""),[l,c]=b.useState(!1),[u,d]=b.useState(""),[p,h]=b.useState(null),[m]=b.useState({name:"default",fullPath:""}),[g,f]=b.useState({authenticated:!1,email:null,loading:!0,error:null}),[k,S]=b.useState({authenticated:!1,email:null,loading:!0,error:null}),[v,w]=b.useState({authenticated:!1,email:null,loading:!0,error:null}),{user:A}=ji(),I=b.useRef(void 0);b.useEffect(()=>{E()},[]);const E=async()=>{try{const N=await Ae("/api/user/git-config");if(N.ok){const z=await N.json();z.gitName&&a(z.gitName),z.gitEmail&&o(z.gitEmail)}}catch(N){console.error("Error loading git config:",N)}};b.useEffect(()=>{const N=I.current;I.current=p,(N===void 0||N!==null&&p===null)&&(C(),M(),O())},[p]);const C=async()=>{try{const N=await Ae("/api/cli/claude/status");if(N.ok){const z=await N.json();f({authenticated:z.authenticated,email:z.email,loading:!1,error:z.error||null})}else f({authenticated:!1,email:null,loading:!1,error:"Failed to check authentication status"})}catch(N){console.error("Error checking Claude auth status:",N),f({authenticated:!1,email:null,loading:!1,error:N.message})}},M=async()=>{try{const N=await Ae("/api/cli/cursor/status");if(N.ok){const z=await N.json();S({authenticated:z.authenticated,email:z.email,loading:!1,error:z.error||null})}else S({authenticated:!1,email:null,loading:!1,error:"Failed to check authentication status"})}catch(N){console.error("Error checking Cursor auth status:",N),S({authenticated:!1,email:null,loading:!1,error:N.message})}},O=async()=>{try{const N=await Ae("/api/cli/codex/status");if(N.ok){const z=await N.json();w({authenticated:z.authenticated,email:z.email,loading:!1,error:z.error||null})}else w({authenticated:!1,email:null,loading:!1,error:"Failed to check authentication status"})}catch(N){console.error("Error checking Codex auth status:",N),w({authenticated:!1,email:null,loading:!1,error:N.message})}},j=()=>h("claude"),G=()=>h("cursor"),V=()=>h("codex"),D=N=>{N===0&&(p==="claude"?C():p==="cursor"?M():p==="codex"&&O())},P=async()=>{if(d(""),t===0){if(!n.trim()||!s.trim()){d("Both git name and email are required");return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s)){d("Please enter a valid email address");return}c(!0);try{const z=await Ae("/api/user/git-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gitName:n,gitEmail:s})});if(!z.ok){const re=await z.json();throw new Error(re.error||"Failed to save git configuration")}r(t+1)}catch(z){d(z.message)}finally{c(!1)}return}r(t+1)},B=()=>{d(""),r(t-1)},F=async()=>{c(!0),d("");try{const N=await Ae("/api/user/complete-onboarding",{method:"POST"});if(!N.ok){const z=await N.json();throw new Error(z.error||"Failed to complete onboarding")}e&&e()}catch(N){d(N.message)}finally{c(!1)}},$=[{title:"Git Configuration",description:"Set up your git identity for commits",icon:ba,required:!0},{title:"Connect Agents",description:"Connect your AI coding assistants",icon:Q4,required:!1}],H=()=>{switch(t){case 0:return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"text-center mb-8",children:[i.jsx("div",{className:"w-16 h-16 bg-blue-100 dark:bg-blue-900/30 rounded-full flex items-center justify-center mx-auto mb-4",children:i.jsx(ba,{className:"w-8 h-8 text-blue-600 dark:text-blue-400"})}),i.jsx("h2",{className:"text-2xl font-bold text-foreground mb-2",children:"Git Configuration"}),i.jsx("p",{className:"text-muted-foreground",children:"Configure your git identity to ensure proper attribution for your commits"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsxs("label",{htmlFor:"gitName",className:"flex items-center gap-2 text-sm font-medium text-foreground mb-2",children:[i.jsx(X6,{className:"w-4 h-4"}),"Git Name ",i.jsx("span",{className:"text-red-500",children:"*"})]}),i.jsx("input",{type:"text",id:"gitName",value:n,onChange:N=>a(N.target.value),className:"w-full px-4 py-3 border border-border rounded-lg bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"John Doe",required:!0,disabled:l}),i.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"This will be used as: git config --global user.name"})]}),i.jsxs("div",{children:[i.jsxs("label",{htmlFor:"gitEmail",className:"flex items-center gap-2 text-sm font-medium text-foreground mb-2",children:[i.jsx(d6,{className:"w-4 h-4"}),"Git Email ",i.jsx("span",{className:"text-red-500",children:"*"})]}),i.jsx("input",{type:"email",id:"gitEmail",value:s,onChange:N=>o(N.target.value),className:"w-full px-4 py-3 border border-border rounded-lg bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"john@example.com",required:!0,disabled:l}),i.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"This will be used as: git config --global user.email"})]})]})]});case 1:return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"text-center mb-6",children:[i.jsx("h2",{className:"text-2xl font-bold text-foreground mb-2",children:"Connect Your AI Agents"}),i.jsx("p",{className:"text-muted-foreground",children:"Login to one or more AI coding assistants. All are optional."})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx("div",{className:`border rounded-lg p-4 transition-colors ${g.authenticated?"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800":"border-border bg-card"}`,children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 bg-blue-100 dark:bg-blue-900/30 rounded-full flex items-center justify-center",children:i.jsx(In,{size:20})}),i.jsxs("div",{children:[i.jsxs("div",{className:"font-medium text-foreground flex items-center gap-2",children:["Claude Code",g.authenticated&&i.jsx(_r,{className:"w-4 h-4 text-green-500"})]}),i.jsx("div",{className:"text-xs text-muted-foreground",children:g.loading?"Checking...":g.authenticated?g.email||"Connected":"Not connected"})]})]}),!g.authenticated&&!g.loading&&i.jsx("button",{onClick:j,className:"bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium py-2 px-4 rounded-lg transition-colors",children:"Login"})]})}),i.jsx("div",{className:`border rounded-lg p-4 transition-colors ${k.authenticated?"bg-purple-50 dark:bg-purple-900/20 border-purple-200 dark:border-purple-800":"border-border bg-card"}`,children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 bg-purple-100 dark:bg-purple-900/30 rounded-full flex items-center justify-center",children:i.jsx(Xn,{size:20})}),i.jsxs("div",{children:[i.jsxs("div",{className:"font-medium text-foreground flex items-center gap-2",children:["Cursor",k.authenticated&&i.jsx(_r,{className:"w-4 h-4 text-green-500"})]}),i.jsx("div",{className:"text-xs text-muted-foreground",children:k.loading?"Checking...":k.authenticated?k.email||"Connected":"Not connected"})]})]}),!k.authenticated&&!k.loading&&i.jsx("button",{onClick:G,className:"bg-purple-600 hover:bg-purple-700 text-white text-sm font-medium py-2 px-4 rounded-lg transition-colors",children:"Login"})]})}),i.jsx("div",{className:`border rounded-lg p-4 transition-colors ${v.authenticated?"bg-gray-100 dark:bg-gray-800/50 border-gray-300 dark:border-gray-600":"border-border bg-card"}`,children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 bg-gray-100 dark:bg-gray-800 rounded-full flex items-center justify-center",children:i.jsx(Zn,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"font-medium text-foreground flex items-center gap-2",children:["OpenAI Codex",v.authenticated&&i.jsx(_r,{className:"w-4 h-4 text-green-500"})]}),i.jsx("div",{className:"text-xs text-muted-foreground",children:v.loading?"Checking...":v.authenticated?v.email||"Connected":"Not connected"})]})]}),!v.authenticated&&!v.loading&&i.jsx("button",{onClick:V,className:"bg-gray-800 hover:bg-gray-900 dark:bg-gray-700 dark:hover:bg-gray-600 text-white text-sm font-medium py-2 px-4 rounded-lg transition-colors",children:"Login"})]})})]}),i.jsx("div",{className:"text-center text-sm text-muted-foreground pt-2",children:i.jsx("p",{children:"You can configure these later in Settings."})})]});default:return null}},ne=()=>{switch(t){case 0:return n.trim()&&s.trim()&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s);case 1:return!0;default:return!1}};return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:i.jsxs("div",{className:"w-full max-w-2xl",children:[i.jsx("div",{className:"mb-8",children:i.jsx("div",{className:"flex items-center justify-between",children:$.map((N,z)=>i.jsxs(dr.Fragment,{children:[i.jsxs("div",{className:"flex flex-col items-center flex-1",children:[i.jsx("div",{className:`w-12 h-12 rounded-full flex items-center justify-center border-2 transition-colors duration-200 ${z<t?"bg-green-500 border-green-500 text-white":z===t?"bg-blue-600 border-blue-600 text-white":"bg-background border-border text-muted-foreground"}`,children:z<t?i.jsx(_r,{className:"w-6 h-6"}):typeof N.icon=="function"?i.jsx(N.icon,{}):i.jsx(N.icon,{className:"w-6 h-6"})}),i.jsxs("div",{className:"mt-2 text-center",children:[i.jsx("p",{className:`text-sm font-medium ${z===t?"text-foreground":"text-muted-foreground"}`,children:N.title}),N.required&&i.jsx("span",{className:"text-xs text-red-500",children:"Required"})]})]}),z<$.length-1&&i.jsx("div",{className:`flex-1 h-0.5 mx-2 transition-colors duration-200 ${z<t?"bg-green-500":"bg-border"}`})]},z))})}),i.jsxs("div",{className:"bg-card rounded-lg shadow-lg border border-border p-8",children:[H(),u&&i.jsx("div",{className:"mt-6 p-4 bg-red-100 dark:bg-red-900/20 border border-red-300 dark:border-red-800 rounded-lg",children:i.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:u})}),i.jsxs("div",{className:"flex items-center justify-between mt-8 pt-6 border-t border-border",children:[i.jsxs("button",{onClick:B,disabled:t===0||l,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-muted-foreground hover:text-foreground disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200",children:[i.jsx(mg,{className:"w-4 h-4"}),"Previous"]}),i.jsx("div",{className:"flex items-center gap-3",children:t<$.length-1?i.jsx("button",{onClick:P,disabled:!ne()||l,className:"flex items-center gap-2 px-6 py-3 bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 disabled:cursor-not-allowed text-white font-medium rounded-lg transition-colors duration-200",children:l?i.jsxs(i.Fragment,{children:[i.jsx(Ma,{className:"w-4 h-4 animate-spin"}),"Saving..."]}):i.jsxs(i.Fragment,{children:["Next",i.jsx(Hn,{className:"w-4 h-4"})]})}):i.jsx("button",{onClick:F,disabled:l,className:"flex items-center gap-2 px-6 py-3 bg-green-600 hover:bg-green-700 disabled:bg-green-400 disabled:cursor-not-allowed text-white font-medium rounded-lg transition-colors duration-200",children:l?i.jsxs(i.Fragment,{children:[i.jsx(Ma,{className:"w-4 h-4 animate-spin"}),"Completing..."]}):i.jsxs(i.Fragment,{children:[i.jsx(_r,{className:"w-4 h-4"}),"Complete Setup"]})})})]})]})]})}),p&&i.jsx(V3,{isOpen:!!p,onClose:()=>h(null),provider:p,project:m,onComplete:D})]})},nW=()=>i.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"flex justify-center mb-4",children:i.jsx("div",{className:"w-16 h-16 bg-primary rounded-lg flex items-center justify-center shadow-sm",children:i.jsx(ko,{className:"w-8 h-8 text-primary-foreground"})})}),i.jsx("h1",{className:"text-2xl font-bold text-foreground mb-2",children:"Axhub Genie"}),i.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[i.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full animate-bounce"}),i.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),i.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]}),i.jsx("p",{className:"text-muted-foreground mt-2",children:"Loading..."})]})}),aW=({children:e})=>{const{user:t,isLoading:r,needsSetup:n,hasCompletedOnboarding:a,refreshOnboardingStatus:s}=ji();return r?i.jsx(nW,{}):n?i.jsx(eW,{}):t?a?e:i.jsx(rW,{onComplete:s}):i.jsx(tW,{})};function li(e,t){const[r,n]=b.useState(()=>{if(typeof window>"u")return t;try{const s=window.localStorage.getItem(e);return s?JSON.parse(s):t}catch(s){return console.log(s),t}});return[r,s=>{if(!(typeof window>"u"))try{const o=s instanceof Function?s(r):s;window.localStorage.setItem(e,JSON.stringify(o)),n(o)}catch(o){console.log(o)}}]}const{slice:iW,forEach:sW}=[];function oW(e){return sW.call(iW.call(arguments,1),t=>{if(t)for(const r in t)e[r]===void 0&&(e[r]=t[r])}),e}function lW(e){return typeof e!="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(r=>r.test(e))}const D4=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,cW=function(e,t){const n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},a=encodeURIComponent(t);let s=`${e}=${a}`;if(n.maxAge>0){const o=n.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(o)}`}if(n.domain){if(!D4.test(n.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${n.domain}`}if(n.path){if(!D4.test(n.path))throw new TypeError("option path is invalid");s+=`; Path=${n.path}`}if(n.expires){if(typeof n.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(s+="; HttpOnly"),n.secure&&(s+="; Secure"),n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return n.partitioned&&(s+="; Partitioned"),s},M4={create(e,t,r,n){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+r*60*1e3)),n&&(a.domain=n),document.cookie=cW(e,t,a)},read(e){const t=`${e}=`,r=document.cookie.split(";");for(let n=0;n<r.length;n++){let a=r[n];for(;a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(t)===0)return a.substring(t.length,a.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var uW={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return M4.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:r,cookieMinutes:n,cookieDomain:a,cookieOptions:s}=t;r&&typeof document<"u"&&M4.create(r,e,n,a,s)}},dW={name:"querystring",lookup(e){let{lookupQuerystring:t}=e,r;if(typeof window<"u"){let{search:n}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));const s=n.substring(1).split("&");for(let o=0;o<s.length;o++){const l=s[o].indexOf("=");l>0&&s[o].substring(0,l)===t&&(r=s[o].substring(l+1))}}return r}},pW={name:"hash",lookup(e){let{lookupHash:t,lookupFromHashIndex:r}=e,n;if(typeof window<"u"){const{hash:a}=window.location;if(a&&a.length>2){const s=a.substring(1);if(t){const o=s.split("&");for(let l=0;l<o.length;l++){const c=o[l].indexOf("=");c>0&&o[l].substring(0,c)===t&&(n=o[l].substring(c+1))}}if(n)return n;if(!n&&r>-1){const o=a.match(/\/([a-zA-Z-]*)/g);return Array.isArray(o)?o[typeof r=="number"?r:0]?.replace("/",""):void 0}}}return n}};let ci=null;const F4=()=>{if(ci!==null)return ci;try{if(ci=typeof window<"u"&&window.localStorage!==null,!ci)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{ci=!1}return ci};var mW={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&F4())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:r}=t;r&&F4()&&window.localStorage.setItem(r,e)}};let ui=null;const P4=()=>{if(ui!==null)return ui;try{if(ui=typeof window<"u"&&window.sessionStorage!==null,!ui)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{ui=!1}return ui};var hW={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&P4())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:r}=t;r&&P4()&&window.sessionStorage.setItem(r,e)}},gW={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:r,userLanguage:n,language:a}=navigator;if(r)for(let s=0;s<r.length;s++)t.push(r[s]);n&&t.push(n),a&&t.push(a)}return t.length>0?t:void 0}},fW={name:"htmlTag",lookup(e){let{htmlTag:t}=e,r;const n=t||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(r=n.getAttribute("lang")),r}},bW={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?r[typeof t=="number"?t:0]?.replace("/",""):void 0}},xW={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const r=typeof t=="number"?t+1:1,n=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[r]}};let Y3=!1;try{document.cookie,Y3=!0}catch{}const X3=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Y3||X3.splice(1,1);const yW=()=>({order:X3,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class Z3{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,r)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=oW(r,this.options||{},yW()),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=n,this.addDetector(uW),this.addDetector(dW),this.addDetector(mW),this.addDetector(hW),this.addDetector(gW),this.addDetector(fW),this.addDetector(bW),this.addDetector(xW),this.addDetector(pW)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,r=[];return t.forEach(n=>{if(this.detectors[n]){let a=this.detectors[n].lookup(this.options);a&&typeof a=="string"&&(a=[a]),a&&(r=r.concat(a))}}),r=r.filter(n=>n!=null&&!lW(n)).map(n=>this.options.convertDetectedLanguage(n)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}cacheUserLanguage(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||r.forEach(n=>{this.detectors[n]&&this.detectors[n].cacheUserLanguage(t,this.options)}))}}Z3.type="languageDetector";const vW={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"},kW={chat:"Chat",shell:"Shell",files:"Files",git:"Source Control",tasks:"Tasks"},wW={loading:"Loading...",success:"Success",error:"Error",failed:"Failed",pending:"Pending",completed:"Completed",inProgress:"In Progress"},SW={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"},EW={settings:"Settings",home:"Home",back:"Back",next:"Next",previous:"Previous",logout:"Logout"},NW={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"},CW={justNow:"Just now",minutesAgo:"{{count}} mins ago",hoursAgo:"{{count}} hours ago",daysAgo:"{{count}} days ago",yesterday:"Yesterday"},TW={newFile:"New File",newFolder:"New Folder",rename:"Rename",move:"Move",copyPath:"Copy Path",openInEditor:"Open in Editor"},AW={loading:"Loading Axhub Genie",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",openInCodexClient:"Open in Codex client"},IW={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",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"},RW={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",workspaceType:"Workspace Type:",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"}},jW={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:",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"}},_W={buttons:vW,tabs:kW,status:wW,messages:SW,navigation:EW,common:NW,time:CW,fileOperations:TW,mainContent:AW,fileTree:IW,projectWizard:RW,versionUpdate:jW},LW="Settings",OW={account:"Account",permissions:"Permissions",mcpServers:"MCP Servers",appearance:"Appearance"},DW={title:"Account",language:"Language",languageLabel:"Display Language",languageDescription:"Choose your preferred language for the interface",username:"Username",email:"Email",profile:"Profile",changePassword:"Change Password"},MW={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"}},FW={title:"Appearance",theme:"Theme",codeEditor:"Code Editor",editorTheme:"Editor Theme",wordWrap:"Word Wrap",showMinimap:"Show Minimap",lineNumbers:"Line Numbers",fontSize:"Font Size"},PW={saveChanges:"Save Changes",resetToDefaults:"Reset to Defaults",cancelChanges:"Cancel Changes"},BW={title:"Quick Settings",sections:{appearance:"Appearance",toolDisplay:"Tool Display",viewOptions:"View Options",inputSettings:"Input Settings",whisperDictation:"Whisper Dictation"},darkMode:"Dark Mode",autoExpandTools:"Auto-expand tools",showRawParameters:"Show raw parameters",showThinking:"Show thinking",autoScrollToBottom:"Auto-scroll to bottom",sendByCtrlEnter:"Send by Ctrl+Enter",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"},whisper:{modes:{default:"Default Mode",defaultDescription:"Direct transcription of your speech",prompt:"Prompt Enhancement",promptDescription:"Transform rough ideas into clear, detailed AI prompts",vibe:"Vibe Mode",vibeDescription:"Format ideas as clear agent instructions with details"}}},zW={agents:"Agents",appearance:"Appearance",git:"Git",apiTokens:"API & Tokens",tasks:"Tasks"},UW={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"}}},$W={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"}},qW={success:"Settings saved successfully!",error:"Failed to save settings",saving:"Saving..."},GW={save:"Save Settings",cancel:"Cancel"},HW={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"}},WW={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}}"}},VW={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"}},KW={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"}},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}}"},YW={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"}},XW={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"},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"},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."}},ZW={title:LW,tabs:OW,account:DW,mcp:MW,appearance:FW,actions:PW,quickSettings:BW,mainTabs:zW,appearanceSettings:UW,mcpForm:$W,saveStatus:qW,footerActions:GW,git:HW,apiKeys:WW,tasks:VW,agents:KW,permissions:YW,mcpServers:XW},JW={title:"Welcome Back",description:"Sign in to your Axhub Genie 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"}},QW={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"}},eV={title:"Sign Out",confirm:"Are you sure you want to sign out?",button:"Sign Out"},tV={login:JW,register:QW,logout:eV},rV={title:"Projects",newProject:"New Project",deleteProject:"Delete 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"},nV={title:"Axhub Genie",subtitle:"AI coding assistant interface"},aV={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"},iV={viewEnvironments:"View Environments",hideSidebar:"Hide sidebar",createProject:"Create new project",refresh:"Refresh projects and sessions (Ctrl+R)",renameProject:"Rename project (F2)",deleteProject:"Delete empty project (Delete)",addToFavorites:"Add to favorites",removeFromFavorites:"Remove from favorites",editSessionName:"Manually edit session name",deleteSession:"Delete this session permanently",save:"Save",cancel:"Cancel"},sV={chat:"Chat",files:"Files",git:"Git",terminal:"Terminal",tasks:"Tasks"},oV={refresh:"Refresh",settings:"Settings",collapseAll:"Collapse All",expandAll:"Expand All",cancel:"Cancel",save:"Save",delete:"Delete",rename:"Rename"},lV={active:"Active",inactive:"Inactive",thinking:"Thinking...",error:"Error",aborted:"Aborted",unknown:"Unknown"},cV={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"},uV={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:"Are you sure you want to delete this empty project? This action cannot be undone.",enterProjectPath:"Please enter a project path",deleteSessionFailed:"Failed to delete session. Please try again.",deleteSessionError:"Error deleting session. Please try again.",deleteProjectFailed:"Failed to delete project. Please try again.",deleteProjectError:"Error deleting project. Please try again.",createProjectFailed:"Failed to create project. Please try again.",createProjectError:"Error creating project. Please try again."},dV={updateAvailable:"Update available"},pV={deleteProject:"Delete Project",deleteSession:"Delete Session",confirmDelete:"Are you sure you want to delete",sessionCount_one:"This project contains {{count}} conversation.",sessionCount_other:"This project contains {{count}} conversations.",allConversationsDeleted:"All conversations will be permanently deleted.",cannotUndo:"This action cannot be undone."},mV={projects:rV,app:nV,sessions:aV,tooltips:iV,navigation:sV,actions:oV,status:lV,time:cV,messages:uV,version:dV,deleteConfirmation:pV},hV={copy:"Copy",copied:"Copied",copyCode:"Copy code"},gV={user:"U",error:"Error",tool:"Tool",claude:"Claude",cursor:"Cursor",codex:"Codex"},fV={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"},bV={found:"Found {{count}} {{type}}",file:"file",files:"files",pattern:"pattern:",in:"in:"},xV={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"},yV={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."},vV={title:"Thinking...",emoji:"💭 Thinking..."},kV={response:"JSON Response"},wV={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"},SV={updated:"Todo list has been updated successfully",current:"Current Todo List"},EV={viewPlan:"📋 View implementation plan",title:"Implementation Plan"},NV={resetAt:"Claude usage limit reached. Your limit will reset at **{{time}} {{timezone}}** - {{date}}"},CV={permissionMode:"Permission Mode",modes:{default:"Default 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.",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"},TV={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"},clickToChangeMode:"Click to change permission mode (or press Tab in input)",showAllCommands:"Show all commands",dynamicContext:{systemChip:"System Context",removeSystem:"Remove system context",removeCurrentFile:"Remove current file",removeElement:"Remove selected element",elementFallback:"Element"}},AV={selector:{title:"Thinking Mode",description:"Extended thinking gives Claude more time to evaluate alternatives",active:"Active",tip:"Higher thinking modes take more time but provide more thorough analysis"},modes:{none:{name:"Standard",description:"Regular Claude response",prefix:""},think:{name:"Think",description:"Basic extended thinking",prefix:"think"},thinkHard:{name:"Think Hard",description:"More thorough evaluation",prefix:"think hard"},thinkHarder:{name:"Think Harder",description:"Deep analysis with alternatives",prefix:"think harder"},ultrathink:{name:"Ultrathink",description:"Maximum thinking budget",prefix:"ultrathink"}},buttonTitle:"Thinking mode: {{mode}}"},IV={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"},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.",default:"Select a provider above to begin"}},RV={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"}},jV={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 (disconnect first)",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"},_V={codeBlock:hV,messageTypes:gV,tools:fV,search:bV,fileOperations:xV,interactive:yV,thinking:vV,json:kV,permissions:wV,todo:SV,plan:EV,usageLimit:NV,codex:CV,input:TV,thinkingMode:AV,providerSelection:IV,session:RV,shell:jV},LV={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"},OV="Loading {{fileName}}...",DV={showingChanges:"Showing changes"},MV={download:"Download file",save:"Save",saving:"Saving...",saved:"Saved!",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",close:"Close"},FV={lines:"Lines:",characters:"Characters:",shortcuts:"Press Ctrl+S to save • Esc to close"},PV={toolbar:LV,loading:OV,header:DV,actions:MV,footer:FV},BV={save:"保存",cancel:"取消",delete:"删除",create:"创建",edit:"编辑",close:"关闭",confirm:"确认",submit:"提交",retry:"重试",refresh:"刷新",search:"搜索",clear:"清除",copy:"复制",download:"下载",upload:"上传",browse:"浏览"},zV={chat:"聊天",shell:"终端",files:"文件",git:"源代码管理",tasks:"任务"},UV={loading:"加载中...",success:"成功",error:"错误",failed:"失败",pending:"待处理",completed:"已完成",inProgress:"进行中"},$V={savedSuccessfully:"保存成功",deletedSuccessfully:"删除成功",updatedSuccessfully:"更新成功",operationFailed:"操作失败",networkError:"网络错误,请检查您的连接。",unauthorized:"未授权,请登录。",notFound:"未找到",invalidInput:"输入无效",requiredField:"此字段为必填项",unknownError:"发生未知错误"},qV={settings:"设置",home:"首页",back:"返回",next:"下一步",previous:"上一步",logout:"退出登录"},GV={language:"语言",theme:"主题",darkMode:"深色模式",lightMode:"浅色模式",name:"名称",description:"描述",enabled:"已启用",disabled:"已禁用",optional:"可选",version:"版本",select:"选择",selectAll:"全选",deselectAll:"取消全选"},HV={justNow:"刚刚",minutesAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",daysAgo:"{{count}} 天前",yesterday:"昨天"},WV={newFile:"新建文件",newFolder:"新建文件夹",rename:"重命名",move:"移动",copyPath:"复制路径",openInEditor:"在编辑器中打开"},VV={loading:"正在加载 Axhub Genie",settingUpWorkspace:"正在设置您的工作空间...",chooseProject:"选择您的项目",selectProjectDescription:"从侧边栏选择一个项目以开始使用 Claude 进行编程。每个项目包含您的聊天会话和文件历史。",tip:"提示",createProjectMobile:"点击上方的菜单按钮以访问项目",createProjectDesktop:"点击侧边栏中的文件夹图标以创建新项目",newSession:"新会话",untitledSession:"未命名会话",projectFiles:"项目文件",openInCodexClient:"在 Codex 客户端打开"},KV={loading:"正在加载文件...",files:"文件",simpleView:"简单视图",compactView:"紧凑视图",detailedView:"详细视图",searchPlaceholder:"搜索文件和文件夹...",clearSearch:"清除搜索",name:"名称",size:"大小",modified:"修改时间",permissions:"权限",noFilesFound:"未找到文件",checkProjectPath:"检查项目路径是否可访问",noMatchesFound:"未找到匹配项",tryDifferentSearch:"尝试不同的搜索词或清除搜索",justNow:"刚刚",minAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",daysAgo:"{{count}} 天前"},YV={title:"创建新项目",steps:{type:"类型",configure:"配置",confirm:"确认"},step1:{question:"您已经有工作区,还是想创建一个新的工作区?",existing:{title:"现有工作区",description:"我的服务器上已经有工作区,只需要将其添加到项目列表中"},new:{title:"新建工作区",description:"创建一个新工作区,可选择从 GitHub 仓库克隆"}},step2:{existingPath:"工作区路径",newPath:"工作区路径",existingPlaceholder:"/path/to/existing/workspace",newPlaceholder:"/path/to/new/workspace",existingHelp:"您现有工作区目录的完整路径",newHelp:"工作区目录的完整路径",githubUrl:"GitHub URL(可选)",githubPlaceholder:"https://github.com/username/repository",githubHelp:"可选:提供 GitHub URL 以克隆仓库",githubAuth:"GitHub 身份验证(可选)",githubAuthHelp:"仅私有仓库需要。公共仓库无需身份验证即可克隆。",loadingTokens:"正在加载已保存的令牌...",storedToken:"已保存的令牌",newToken:"新令牌",nonePublic:"无(公共)",selectToken:"选择令牌",selectTokenPlaceholder:"-- 选择令牌 --",tokenPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",tokenHelp:"此令牌仅用于此操作",publicRepoInfo:"公共仓库不需要身份验证。如果克隆公共仓库,可以跳过提供令牌。",noTokensHelp:"没有可用的已保存令牌。您可以在 设置 → API 密钥 中添加令牌以便重复使用。",optionalTokenPublic:"GitHub 令牌(公共仓库可选)",tokenPublicPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(公共仓库可留空)"},step3:{reviewConfig:"查看您的配置",workspaceType:"工作区类型:",existingWorkspace:"现有工作区",newWorkspace:"新建工作区",path:"路径:",cloneFrom:"克隆自:",authentication:"身份验证:",usingStoredToken:"使用已保存的令牌:",usingProvidedToken:"使用提供的令牌",noAuthentication:"无身份验证",sshKey:"SSH 密钥",existingInfo:"工作区将被添加到您的项目列表中,并可用于 Claude/Cursor 会话。",newWithClone:"仓库将从此文件夹克隆。",newEmpty:"工作区将被添加到您的项目列表中,并可用于 Claude/Cursor 会话。",cloningRepository:"正在克隆仓库..."},buttons:{cancel:"取消",back:"返回",next:"下一步",createProject:"创建项目",creating:"创建中...",cloning:"正在克隆..."},errors:{selectType:"请选择您已有现有工作区还是想创建新工作区",providePath:"请提供工作区路径",failedToCreate:"创建工作区失败",failedToCreateFolder:"创建文件夹失败"}},XV={title:"有可用更新",newVersionReady:"新版本已准备就绪",currentVersion:"当前版本",latestVersion:"最新版本",whatsNew:"新内容:",viewFullRelease:"查看完整发布",updateProgress:"更新进度:",manualUpgrade:"手动升级:",manualUpgradeHint:"或点击'立即更新'以自动运行更新。",updateCompleted:"更新成功完成!",restartServer:"请重启服务器以应用更改。",updateFailed:"更新失败",buttons:{close:"关闭",later:"稍后",copyCommand:"复制命令",updateNow:"立即更新",updating:"更新中..."},ariaLabels:{closeModal:"关闭版本升级模态框",showSidebar:"显示侧边栏",settings:"设置",updateAvailable:"有可用更新",closeSidebar:"关闭侧边栏"}},ZV={buttons:BV,tabs:zV,status:UV,messages:$V,navigation:qV,common:GV,time:HV,fileOperations:WV,mainContent:VV,fileTree:KV,projectWizard:YV,versionUpdate:XV},JV="设置",QV={account:"账户",permissions:"权限",mcpServers:"MCP 服务器",appearance:"外观"},eK={title:"账户",language:"语言",languageLabel:"显示语言",languageDescription:"选择您偏好的界面语言",username:"用户名",email:"邮箱",profile:"个人资料",changePassword:"修改密码"},tK={title:"MCP 服务器",addServer:"添加服务器",editServer:"编辑服务器",deleteServer:"删除服务器",serverName:"服务器名称",serverType:"服务器类型",config:"配置",testConnection:"测试连接",status:"状态",connected:"已连接",disconnected:"未连接",scope:{label:"范围",user:"用户",project:"项目"}},rK={title:"外观",theme:"主题",codeEditor:"代码编辑器",editorTheme:"编辑器主题",wordWrap:"自动换行",showMinimap:"显示缩略图",lineNumbers:"行号",fontSize:"字体大小"},nK={saveChanges:"保存更改",resetToDefaults:"重置为默认值",cancelChanges:"取消更改"},aK={title:"快速设置",sections:{appearance:"外观",toolDisplay:"工具显示",viewOptions:"视图选项",inputSettings:"输入设置",whisperDictation:"Whisper 听写"},darkMode:"深色模式",autoExpandTools:"自动展开工具",showRawParameters:"显示原始参数",showThinking:"显示思考过程",autoScrollToBottom:"自动滚动到底部",sendByCtrlEnter:"使用 Ctrl+Enter 发送",sendByCtrlEnterDescription:"启用后,按 Ctrl+Enter 发送消息,而不是仅按 Enter。这对于使用输入法的用户可以避免意外发送。",dragHandle:{dragging:"正在拖拽手柄",closePanel:"关闭设置面板",openPanel:"打开设置面板",draggingStatus:"正在拖拽...",toggleAndMove:"点击切换,拖拽移动"},whisper:{modes:{default:"默认模式",defaultDescription:"直接转录您的语音",prompt:"提示词增强",promptDescription:"将粗略的想法转化为清晰、详细的 AI 提示词",vibe:"Vibe 模式",vibeDescription:"将想法格式化为带有详细说明的清晰智能体指令"}}},iK={agents:"智能体",appearance:"外观",git:"Git",apiTokens:"API 和令牌",tasks:"任务"},sK={darkMode:{label:"深色模式",description:"切换浅色和深色主题"},projectSorting:{label:"项目排序",description:"项目在侧边栏中的排列方式",alphabetical:"按字母顺序",recentActivity:"最近活动"},codeEditor:{title:"代码编辑器",theme:{label:"编辑器主题",description:"代码编辑器的默认主题"},wordWrap:{label:"自动换行",description:"在编辑器中默认启用自动换行"},showMinimap:{label:"显示缩略图",description:"在差异视图中显示缩略图以便于导航"},lineNumbers:{label:"显示行号",description:"在编辑器中显示行号"},fontSize:{label:"字体大小",description:"编辑器字体大小(px)"}}},oK={title:{add:"添加 MCP 服务器",edit:"编辑 MCP 服务器"},importMode:{form:"表单输入",json:"JSON 导入"},scope:{label:"范围",userGlobal:"用户(全局)",projectLocal:"项目(本地)",userDescription:"用户范围:在您机器上的所有项目中可用",projectDescription:"本地范围:仅在选定项目中可用",cannotChange:"编辑现有服务器时无法更改范围"},fields:{serverName:"服务器名称",transportType:"传输类型",command:"命令",arguments:"参数(每行一个)",jsonConfig:"JSON 配置",url:"URL",envVars:"环境变量(KEY=值,每行一个)",headers:"请求头(KEY=值,每行一个)",selectProject:"选择项目..."},placeholders:{serverName:"我的服务"},validation:{missingType:"缺少必填字段:type",stdioRequiresCommand:"stdio 类型需要 command 字段",httpRequiresUrl:"{{type}} 类型需要 url 字段",invalidJson:"无效的 JSON 格式",jsonHelp:"粘贴您的 MCP 服务器配置(JSON 格式)。示例格式:",jsonExampleStdio:'• stdio: {"type":"stdio","command":"npx","args":["@upstash/context7-mcp"]}',jsonExampleHttp:'• http/sse: {"type":"http","url":"https://api.example.com/mcp"}'},configDetails:"配置详细信息(来自 {{configFile}})",projectPath:"路径:{{path}}",actions:{cancel:"取消",saving:"保存中...",addServer:"添加服务器",updateServer:"更新服务器"}},lK={success:"设置保存成功!",error:"保存设置失败",saving:"保存中..."},cK={save:"保存设置",cancel:"取消"},uK={title:"Git 配置",description:"配置您的 git 提交身份。这些设置将通过 git config --global 全局应用",name:{label:"Git 名称",help:"您的 git 提交名称"},email:{label:"Git 邮箱",help:"您的 git 提交邮箱"},actions:{save:"保存配置",saving:"保存中..."},status:{success:"保存成功"}},dK={title:"API 密钥",description:"生成 API 密钥以从其他应用访问外部 API。",newKey:{alertTitle:"⚠️ 保存您的 API 密钥",alertMessage:"这是您唯一一次看到此密钥。请妥善保存。",iveSavedIt:"我已保存"},form:{placeholder:"API 密钥名称(例如:生产服务器)",createButton:"创建",cancelButton:"取消"},newButton:"新建 API 密钥",empty:"尚未创建 API 密钥。",list:{created:"创建时间:",lastUsed:"最后使用:"},confirmDelete:"确定要删除此 API 密钥吗?",status:{active:"激活",inactive:"未激活"},github:{title:"GitHub 令牌",description:"添加 GitHub 个人访问令牌以通过外部 API 克隆私有仓库。",descriptionAlt:"添加 GitHub 个人访问令牌以克隆私有仓库。您也可以直接在 API 请求中传递令牌而无需存储。",addButton:"添加令牌",form:{namePlaceholder:"令牌名称(例如:个人仓库)",tokenPlaceholder:"GitHub 个人访问令牌(ghp_...)",descriptionPlaceholder:"描述(可选)",addButton:"添加令牌",cancelButton:"取消",howToCreate:"如何创建 GitHub 个人访问令牌 →"},empty:"尚未添加 GitHub 令牌。",added:"添加时间:",confirmDelete:"确定要删除此 GitHub 令牌吗?"},apiDocsLink:"API 文档",documentation:{title:"外部 API 文档",description:"了解如何使用外部 API 从您的应用程序触发 Claude/Cursor 会话。",viewLink:"查看 API 文档 →"},loading:"加载中...",version:{updateAvailable:"有可用更新:v{{version}}"}},pK={checking:"正在检查 TaskMaster 安装...",notInstalled:{title:"未安装 TaskMaster AI CLI",description:"需要 TaskMaster CLI 才能使用任务管理功能。安装它以开始使用:",installCommand:"npm install -g task-master-ai",viewOnGitHub:"在 GitHub 上查看",afterInstallation:"安装后:",steps:{restart:"重启此应用程序",autoAvailable:"TaskMaster 功能将自动可用",initCommand:"在项目目录中使用 task-master init"}},settings:{enableLabel:"启用 TaskMaster 集成",enableDescription:"在整个界面中显示 TaskMaster 任务、横幅和侧边栏指示器"}},mK={authStatus:{checking:"检查中...",connected:"已连接",notConnected:"未连接",disconnected:"已断开",checkingAuth:"正在检查认证状态...",loggedInAs:"登录为 {{email}}",authenticatedUser:"已认证用户"},account:{claude:{description:"Anthropic Claude AI 助手"},cursor:{description:"Cursor AI 驱动的代码编辑器"},codex:{description:"OpenAI Codex AI 助手"}},connectionStatus:"连接状态",login:{title:"登录",reAuthenticate:"重新认证",description:"登录您的 {{agent}} 账户以启用 AI 功能",reAuthDescription:"使用其他账户登录或刷新凭据",button:"登录",reLoginButton:"重新登录"},error:"错误:{{error}}"},hK={title:"权限设置",skipPermissions:{label:"跳过权限提示(请谨慎使用)",claudeDescription:"等同于 --dangerously-skip-permissions 标志",cursorDescription:"等同于 Cursor CLI 中的 -f 标志"},allowedTools:{title:"允许的工具",description:"无需权限提示即可自动使用的工具",placeholder:'例如:"Bash(git log:*)" 或 "Write"',quickAdd:"快速添加常用工具:",empty:"未配置允许的工具"},blockedTools:{title:"禁用的工具",description:"无需权限提示即可自动禁用的工具",placeholder:'例如:"Bash(rm:*)"',empty:"未配置禁用的工具"},allowedCommands:{title:"允许的 Shell 命令",description:"无需权限提示即可自动执行的 Shell 命令",placeholder:'例如:"Shell(ls)" 或 "Shell(git status)"',quickAdd:"快速添加常用命令:",empty:"未配置允许的命令"},blockedCommands:{title:"阻止的 Shell 命令",description:"自动阻止的 Shell 命令",placeholder:'例如:"Shell(rm -rf)" 或 "Shell(sudo)"',empty:"未配置阻止的命令"},toolExamples:{title:"工具模式示例:",bashGitLog:"- 允许所有 git log 命令",bashGitDiff:"- 允许所有 git diff 命令",write:"- 允许所有 Write 工具使用",bashRm:"- 阻止所有 rm 命令(危险)"},shellExamples:{title:"Shell 命令示例:",ls:"- 允许 ls 命令",gitStatus:"- 允许 git status",npmInstall:"- 允许 npm install",rmRf:"- 阻止递归删除"},codex:{permissionMode:"权限模式",description:"控制 Codex 如何处理文件修改和命令执行",modes:{default:{title:"默认",description:"只有受信任的命令(ls、cat、grep、git status 等)会自动运行。其他命令将被跳过。可以写入工作区。"},acceptEdits:{title:"接受编辑",description:"所有命令在工作区内自动运行。具有沙箱执行的全自动模式。"},bypassPermissions:{title:"绕过权限",description:"完全系统访问,无任何限制。所有命令自动运行,具有完整的磁盘和网络访问权限。请谨慎使用。"}},technicalDetails:"技术详情",technicalInfo:{default:"sandboxMode=workspace-write, approvalPolicy=untrusted。受信任的命令:cat、cd、grep、head、ls、pwd、tail、git status/log/diff/show、find(不带 -exec)等。",acceptEdits:"sandboxMode=workspace-write, approvalPolicy=never。所有命令在项目目录内自动执行。",bypassPermissions:"sandboxMode=danger-full-access, approvalPolicy=never。完全系统访问权限,仅在可信环境中使用。",overrideNote:"您可以使用聊天界面中的模式按钮按会话覆盖此设置。"}},actions:{add:"添加"}},gK={title:"MCP 服务器",description:{claude:"Model Context Protocol 服务器为 Claude 提供额外的工具和数据源",cursor:"Model Context Protocol 服务器为 Cursor 提供额外的工具和数据源",codex:"Model Context Protocol 服务器为 Codex 提供额外的工具和数据源"},addButton:"添加 MCP 服务器",empty:"未配置 MCP 服务器",serverType:"类型",scope:{local:"本地",user:"用户"},config:{command:"命令",url:"URL",args:"参数",environment:"环境变量"},tools:{title:"工具",count:"({{count}}):",more:"还有 {{count}} 个"},actions:{edit:"编辑服务器",delete:"删除服务器"},help:{title:"关于 Codex MCP",description:"Codex 支持基于 stdio 的 MCP 服务器。您可以添加服务器,通过额外的工具和资源来扩展 Codex 的功能。"}},fK={title:JV,tabs:QV,account:eK,mcp:tK,appearance:rK,actions:nK,quickSettings:aK,mainTabs:iK,appearanceSettings:sK,mcpForm:oK,saveStatus:lK,footerActions:cK,git:uK,apiKeys:dK,tasks:pK,agents:mK,permissions:hK,mcpServers:gK},bK={title:"欢迎回来",description:"登录您的 Axhub Genie 账户",username:"用户名",password:"密码",submit:"登录",loading:"登录中...",errors:{invalidCredentials:"用户名或密码无效",requiredFields:"请填写所有字段",networkError:"网络错误,请重试。"},placeholders:{username:"输入您的用户名",password:"输入您的密码"}},xK={title:"创建账户",username:"用户名",password:"密码",confirmPassword:"确认密码",submit:"创建账户",loading:"创建账户中...",errors:{passwordMismatch:"密码不匹配",usernameTaken:"用户名已被占用",weakPassword:"密码强度太弱"}},yK={title:"退出登录",confirm:"确定要退出登录吗?",button:"退出登录"},vK={login:bK,register:xK,logout:yK},kK={title:"项目",newProject:"新建项目",deleteProject:"删除项目",renameProject:"重命名项目",noProjects:"未找到项目",loadingProjects:"加载项目中...",searchPlaceholder:"搜索项目...",projectNamePlaceholder:"项目名称",starred:"星标",all:"全部",untitledSession:"未命名会话",newSession:"新会话",codexSession:"Codex 会话",fetchingProjects:"正在获取您的 Claude 项目和会话",projects:"项目",noMatchingProjects:"未找到匹配的项目",tryDifferentSearch:"尝试调整您的搜索词",runClaudeCli:"在项目目录中运行 Claude CLI 以开始使用"},wK={title:"Axhub Genie",subtitle:"适合处理轻量级任务"},SK={title:"会话",newSession:"新建会话",deleteSession:"删除会话",renameSession:"重命名会话",noSessions:"暂无会话",loadingSessions:"加载会话中...",unnamed:"未命名",loading:"加载中...",showMore:"显示更多会话"},EK={viewEnvironments:"查看环境",hideSidebar:"隐藏侧边栏",createProject:"创建新项目",refresh:"刷新项目和会话 (Ctrl+R)",renameProject:"重命名项目 (F2)",deleteProject:"删除空项目 (Delete)",addToFavorites:"添加到收藏",removeFromFavorites:"从收藏移除",editSessionName:"手动编辑会话名称",deleteSession:"永久删除此会话",save:"保存",cancel:"取消"},NK={chat:"聊天",files:"文件",git:"Git",terminal:"终端",tasks:"任务"},CK={refresh:"刷新",settings:"设置",collapseAll:"全部折叠",expandAll:"全部展开",cancel:"取消",save:"保存",delete:"删除",rename:"重命名"},TK={active:"活动",inactive:"非活动",thinking:"思考中...",error:"错误",aborted:"已中止",unknown:"未知"},AK={justNow:"刚刚",oneMinuteAgo:"1 分钟前",minutesAgo:"{{count}} 分钟前",oneHourAgo:"1 小时前",hoursAgo:"{{count}} 小时前",oneDayAgo:"1 天前",daysAgo:"{{count}} 天前"},IK={deleteConfirm:"确定要删除吗?",renameSuccess:"重命名成功",deleteSuccess:"删除成功",errorOccurred:"发生错误",deleteSessionConfirm:"确定要删除此会话吗?此操作无法撤销。",deleteProjectConfirm:"确定要删除此空项目吗?此操作无法撤销。",enterProjectPath:"请输入项目路径",deleteSessionFailed:"删除会话失败,请重试。",deleteSessionError:"删除会话时出错,请重试。",deleteProjectFailed:"删除项目失败,请重试。",deleteProjectError:"删除项目时出错,请重试。",createProjectFailed:"创建项目失败,请重试。",createProjectError:"创建项目时出错,请重试。"},RK={updateAvailable:"有可用更新"},jK={deleteProject:"删除项目",deleteSession:"删除会话",confirmDelete:"您确定要删除",sessionCount_one:"此项目包含 {{count}} 个对话。",sessionCount_other:"此项目包含 {{count}} 个对话。",allConversationsDeleted:"所有对话将被永久删除。",cannotUndo:"此操作无法撤销。"},_K={projects:kK,app:wK,sessions:SK,tooltips:EK,navigation:NK,actions:CK,status:TK,time:AK,messages:IK,version:RK,deleteConfirmation:jK},LK={copy:"复制",copied:"已复制",copyCode:"复制代码"},OK={user:"U",error:"错误",tool:"工具",claude:"Claude",cursor:"Cursor",codex:"Codex"},DK={settings:"工具设置",error:"工具错误",result:"工具结果",viewParams:"查看输入参数",viewRawParams:"查看原始参数",viewDiff:"查看编辑差异",creatingFile:"创建新文件:",updatingTodo:"更新待办事项",read:"读取",readFile:"读取文件",updateTodo:"更新待办列表",readTodo:"读取待办列表",searchResults:"结果"},MK={found:"找到 {{count}} 个{{type}}",file:"文件",files:"文件",pattern:"模式:",in:"在:"},FK={updated:"文件更新成功",created:"文件创建成功",written:"文件写入成功",diff:"差异",newFile:"新文件",viewContent:"查看文件内容",viewFullOutput:"查看完整输出({{count}} 个字符)",contentDisplayed:"文件内容显示在上面的差异视图中"},PK={title:"交互式提示",waiting:"等待您在 CLI 中响应",instruction:"请在 Claude 运行的终端中选择一个选项。",selectedOption:"✓ Claude 选择了选项 {{number}}",instructionDetail:"在 CLI 中,您可以使用方向键或输入数字来交互式地选择此选项。"},BK={title:"思考中...",emoji:"💭 思考中..."},zK={response:"JSON 响应"},UK={grant:"授予 {{tool}} 权限",added:"权限已添加",addTo:"将 {{entry}} 添加到允许的工具。",retry:"权限已保存。重试请求以使用该工具。",error:"无法更新权限。请重试。",openSettings:"打开设置"},$K={updated:"待办列表已成功更新",current:"当前待办列表"},qK={viewPlan:"📋 查看实施计划",title:"实施计划"},GK={resetAt:"Claude 使用限制已达到。您的限制将在 **{{time}} {{timezone}}** - {{date}} 重置"},HK={permissionMode:"权限模式",modes:{default:"默认模式",acceptEdits:"编辑模式",bypassPermissions:"无限制模式",plan:"计划模式"},descriptions:{default:"只有受信任的命令(ls、cat、grep、git status 等)自动运行。其他命令将被跳过。可以写入工作区。",acceptEdits:"工作区内的所有命令自动运行。完全自动模式,具有沙盒执行功能。",bypassPermissions:"完全的系统访问,无限制。所有命令自动运行,具有完整的磁盘和网络访问权限。请谨慎使用。",plan:"计划模式 - 不执行任何命令"},technicalDetails:"技术细节"},WK={placeholder:"输入 / 调用命令,@ 选择文件,或向 {{provider}} 提问...",placeholderDefault:"输入您的消息...",disabled:"输入已禁用",attachFiles:"附加文件",attachImages:"附加图片",send:"发送",stop:"停止",hintText:{ctrlEnter:"Ctrl+Enter 发送 • Shift+Enter 换行 • Tab 切换模式 • / 斜杠命令",enter:"Enter 发送 • Shift+Enter 换行 • Tab 切换模式 • / 斜杠命令"},clickToChangeMode:"点击更改权限模式(或在输入框中按 Tab)",showAllCommands:"显示所有命令",dynamicContext:{systemChip:"系统上下文",removeSystem:"移除系统上下文",removeCurrentFile:"移除当前文件",removeElement:"移除选中元素",elementFallback:"元素"}},VK={selector:{title:"思考模式",description:"扩展思考给 Claude 更多时间来评估替代方案",active:"激活",tip:"更高的思考模式需要更多时间,但提供更彻底的分析"},modes:{none:{name:"标准",description:"常规 Claude 响应",prefix:""},think:{name:"思考",description:"基本扩展思考",prefix:"思考"},thinkHard:{name:"深入思考",description:"更彻底的评估",prefix:"深入思考"},thinkHarder:{name:"更深入思考",description:"考虑替代方案的深度分析",prefix:"更深入思考"},ultrathink:{name:"超级思考",description:"最大思考预算",prefix:"超级思考"}},buttonTitle:"思考模式:{{mode}}"},KK={title:"选择你的 AI 助手",description:"需提前安装对应的软件",selectModel:"选择模型",providerInfo:{anthropic:"Anthropic",openai:"OpenAI",cursorEditor:"AI 代码编辑器"},readyPrompt:{claude:"已准备好使用 Claude {{model}}。在下方输入您的消息。",cursor:"已准备好使用 Cursor {{model}}。在下方输入您的消息。",codex:"已准备好使用 Codex {{model}}。在下方输入您的消息。",default:"请在上方选择一个供应商以开始"}},YK={continue:{title:"继续您的对话",description:"询问有关代码的问题、请求更改或获取开发任务的帮助"},loading:{olderMessages:"正在加载更早的消息...",sessionMessages:"正在加载会话消息..."},messages:{showingOf:"显示 {{shown}} / {{total}} 条消息",scrollToLoad:"向上滚动以加载更多",showingLast:"显示最近 {{count}} 条消息(共 {{total}} 条)",loadEarlier:"加载更早的消息"}},XK={selectProject:{title:"选择项目",description:"选择一个项目以在该目录中打开交互式 Shell"},status:{newSession:"新会话",initializing:"初始化中...",restarting:"重启中..."},actions:{disconnect:"断开连接",disconnectTitle:"断开 Shell 连接",restart:"重启",restartTitle:"重启 Shell(请先断开连接)",connect:"在 Shell 中继续",connectTitle:"连接到 Shell"},loading:"正在加载终端...",connecting:"正在连接到 Shell...",startSession:"启动新的 Claude 会话",resumeSession:"恢复会话:{{displayName}}...",runCommand:"在 {{projectName}} 中运行 {{command}}",startCli:"在 {{projectName}} 中启动 Claude CLI",defaultCommand:"命令"},ZK={codeBlock:LK,messageTypes:OK,tools:DK,search:MK,fileOperations:FK,interactive:PK,thinking:BK,json:zK,permissions:UK,todo:$K,plan:qK,usageLimit:GK,codex:HK,input:WK,thinkingMode:VK,providerSelection:KK,session:YK,shell:XK},JK={changes:"个更改",previousChange:"上一个更改",nextChange:"下一个更改",hideDiff:"隐藏差异高亮",showDiff:"显示差异高亮",settings:"编辑器设置",collapse:"折叠编辑器",expand:"展开编辑器到全宽"},QK="正在加载 {{fileName}}...",eY={showingChanges:"显示更改"},tY={download:"下载文件",save:"保存",saving:"保存中...",saved:"已保存!",exitFullscreen:"退出全屏",fullscreen:"全屏",close:"关闭"},rY={lines:"行数:",characters:"字符数:",shortcuts:"按 Ctrl+S 保存 • Esc 关闭"},nY={toolbar:JK,loading:QK,header:eY,actions:tY,footer:rY},aY=()=>{try{const e=localStorage.getItem("userLanguage");return e&&lg.some(t=>t.value===e)?e:"zh-CN"}catch{return"zh-CN"}};kr.use(Z3).use(pA).init({resources:{en:{common:_W,settings:ZW,auth:tV,sidebar:mV,chat:_V,codeEditor:PV},"zh-CN":{common:ZV,settings:fK,auth:vK,sidebar:_K,chat:ZK,codeEditor:nY}},lng:aY(),fallbackLng:"en",debug:!1,ns:["common","settings","auth","sidebar","chat","codeEditor"],defaultNS:"common",keySeparator:".",nsSeparator:":",saveMissing:!1,interpolation:{escapeValue:!1},react:{useSuspense:!0,bindI18n:"languageChanged",bindI18nStore:!1},detection:{order:["localStorage"],lookupLocalStorage:"userLanguage",caches:["localStorage"]}});kr.on("languageChanged",e=>{try{localStorage.setItem("userLanguage",e)}catch(t){console.error("Failed to save language preference:",t)}});function B4(){const e=H5(),{sessionId:t}=W5(),[r]=V5(),{t:n}=Kt("common");b.useRef(0);const{updateAvailable:a,latestVersion:s,currentVersion:o,releaseInfo:l}=W3("siteboon","claudecodeui"),[c,u]=b.useState(!1),[d,p]=b.useState([]),[h,m]=b.useState(null),[g,f]=b.useState(null),[k,S]=b.useState("chat"),[v,w]=b.useState(!1),A=v&&!1,[I,E]=b.useState(!1),[C,M]=b.useState(!0),[O,j]=b.useState(null),[G,V]=b.useState(!1),[D,P]=b.useState(!1),[B,F]=b.useState("agents"),[$,H]=b.useState(!1),[ne,N]=li("autoExpandTools",!1),[z,re]=li("showRawParameters",!1),[R,K]=li("showThinking",!0),[pe,ve]=li("autoScrollToBottom",!0),[oe,Ie]=li("sendByCtrlEnter",!1),[ce,ye]=li("sidebarVisible",!0),[_e,qe]=b.useState(!1),[Ke,xt]=b.useState(new Set),[dt,St]=b.useState(new Set),[ft,pt]=b.useState(0),Le=b.useRef({selectionKey:null}),et=r.get("cwd")||r.get("workdir"),yt=r.get("project")||r.get("projectName"),be=r.get("provider")||r.get("tool")||r.get("cli"),Ge=r.get("model"),he=r.get("context"),Ee=r.get("prompt"),ie=d.find(le=>!!(et&&(le.fullPath===et||le.path===et)||yt&&(le.fullPath===yt||le.path===yt)))?.name||null,fe=b.useCallback((le,ge)=>{const ke=r.toString(),W=ke?`${le}?${ke}`:le;e(W,ge)},[e,r]),{ws:De,sendMessage:Ye,latestMessage:mt}=NS(),tt=b.useRef(null),[jt,$e]=b.useState(!1);b.useEffect(()=>{const le=()=>{const ge=window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone||document.referrer.includes("android-app://");$e(ge),document.addEventListener("touchstart",{}),ge?(document.documentElement.classList.add("pwa-mode"),document.body.classList.add("pwa-mode")):(document.documentElement.classList.remove("pwa-mode"),document.body.classList.remove("pwa-mode"))};return le(),window.matchMedia("(display-mode: standalone)").addEventListener("change",le),()=>{window.matchMedia("(display-mode: standalone)").removeEventListener("change",le)}},[]),b.useEffect(()=>{const le=()=>{w(window.innerWidth<768)};return le(),window.addEventListener("resize",le),()=>window.removeEventListener("resize",le)},[]),b.useEffect(()=>{vt()},[]),b.useEffect(()=>{if(!et&&!yt||d.length===0)return;const le=`${et||""}::${yt||""}`;if(Le.current.selectionKey===le)return;if(g){Le.current.selectionKey=le;return}let ge=null;if(et&&(ge=d.find(ke=>ke.fullPath===et||ke.path===et)),!ge&&yt){const ke=yt.trim().toLowerCase();ge=d.find(W=>[W.name,W.displayName,W.path,W.fullPath].some(te=>typeof te=="string"&&te.toLowerCase()===ke))}ge&&m(ge),Le.current.selectionKey=le},[et,yt,d,g]);const _t=(le,ge,ke,W)=>{if(!ke||!W)return!0;const se=le?.find(er=>er.name===ke.name),te=ge?.find(er=>er.name===ke.name);if(!se||!te)return!1;const Be=se.sessions?.find(er=>er.id===W.id),At=te.sessions?.find(er=>er.id===W.id);return!Be||!At?!1:Be.id===At.id&&Be.title===At.title&&Be.created_at===At.created_at&&Be.updated_at===At.updated_at};b.useEffect(()=>{if(mt){if(mt.type==="loading_progress"){tt.current&&(clearTimeout(tt.current),tt.current=null),j(mt),mt.phase==="complete"&&(tt.current=setTimeout(()=>{j(null),tt.current=null},500));return}if(mt.type==="projects_updated"){if(mt.changedFile&&g&&h){const W=mt.changedFile.replace(/\\/g,"/").split("/");W.length>=2&&W[W.length-1].replace(".jsonl","")===g.id&&(Ke.has(g.id)||pt(At=>At+1))}if(g&&Ke.has(g.id)||Ke.size>0&&Array.from(Ke).some(ke=>ke.startsWith("new-session-"))){const ke=mt.projects;if(!_t(d,ke,h,g))return}const ge=mt.projects;if(p(ge),h){const ke=ge.find(W=>W.name===h.name);ke&&(JSON.stringify(ke)!==JSON.stringify(h)&&m(ke),g&&([...ke.sessions||[],...ke.codexSessions||[],...ke.cursorSessions||[]].find(te=>te.id===g.id)||f(null)))}}}return()=>{tt.current&&(clearTimeout(tt.current),tt.current=null)}},[mt,h,g,Ke]);const vt=async()=>{try{M(!0);const ge=await(await bt.projects()).json();for(let ke of ge)try{const W=`/api/cursor/sessions?projectPath=${encodeURIComponent(ke.fullPath||ke.path)}`,se=await Ae(W);if(se.ok){const te=await se.json();te.success&&te.sessions?ke.cursorSessions=te.sessions:ke.cursorSessions=[]}else ke.cursorSessions=[]}catch(W){console.error(`Error fetching Cursor sessions for project ${ke.name}:`,W),ke.cursorSessions=[]}p(ke=>ke.length===0||ge.some((se,te)=>{const Be=ke[te];return Be?se.name!==Be.name||se.displayName!==Be.displayName||se.fullPath!==Be.fullPath||JSON.stringify(se.sessionMeta)!==JSON.stringify(Be.sessionMeta)||JSON.stringify(se.sessions)!==JSON.stringify(Be.sessions)||JSON.stringify(se.cursorSessions)!==JSON.stringify(Be.cursorSessions):!0})||ge.length!==ke.length?ge:ke)}catch(le){console.error("Error fetching projects:",le)}finally{M(!1)}};window.refreshProjects=vt,window.openSettings=b.useCallback((le="tools")=>{F(le),P(!0)},[]),b.useEffect(()=>{if(t&&d.length>0){const le=!g||g.id!==t;for(const ge of d){let ke=ge.sessions?.find(te=>te.id===t);if(ke){m(ge),f({...ke,__provider:"claude"}),le&&S("chat");return}const W=ge.codexSessions?.find(te=>te.id===t);if(W){m(ge),f({...W,__provider:"codex"}),le&&S("chat");return}const se=ge.cursorSessions?.find(te=>te.id===t);if(se){m(ge),f({...se,__provider:"cursor"}),le&&S("chat");return}}}},[t,d,e]);const ut=le=>{m(le),f(null),fe("/"),v&&E(!1)},Ve=le=>{if(f(le),k!=="git"&&k!=="preview"&&S("chat"),(localStorage.getItem("selected-provider")||"claude")==="cursor"&&sessionStorage.setItem("cursorSessionId",le.id),v){const ke=le.__projectName,W=h?.name;ke!==W&&E(!1)}fe(`/session/${le.id}`)},Xe=le=>{m(le),f(null),S("chat"),fe("/"),v&&E(!1)},ht=le=>{g?.id===le&&(f(null),fe("/")),p(ge=>ge.map(ke=>({...ke,sessions:ke.sessions?.filter(W=>W.id!==le)||[],sessionMeta:{...ke.sessionMeta,total:Math.max(0,(ke.sessionMeta?.total||0)-1)}})))},Gt=async()=>{try{const ge=await(await bt.projects()).json();if(p(ke=>ge.some((se,te)=>{const Be=ke[te];return Be?se.name!==Be.name||se.displayName!==Be.displayName||se.fullPath!==Be.fullPath||JSON.stringify(se.sessionMeta)!==JSON.stringify(Be.sessionMeta)||JSON.stringify(se.sessions)!==JSON.stringify(Be.sessions):!0})||ge.length!==ke.length?ge:ke),h){const ke=ge.find(W=>W.name===h.name);if(ke&&(JSON.stringify(ke)!==JSON.stringify(h)&&m(ke),g)){const W=ke.sessions?.find(se=>se.id===g.id);W&&JSON.stringify(W)!==JSON.stringify(g)&&f(W)}}}catch(le){console.error("Error refreshing sidebar:",le)}},Ft=le=>{h?.name===le&&(m(null),f(null),fe("/")),p(ge=>ge.filter(ke=>ke.name!==le))},Lt=b.useCallback(le=>{le&&xt(ge=>new Set([...ge,le]))},[]),qt=b.useCallback(le=>{le&&xt(ge=>{const ke=new Set(ge);return ke.delete(le),ke})},[]),ar=b.useCallback(le=>{le&&St(ge=>new Set([...ge,le]))},[]),vr=b.useCallback(le=>{le&&St(ge=>{const ke=new Set(ge);return ke.delete(le),ke})},[]),Q=b.useCallback(le=>{le&&xt(ge=>{const ke=new Set;for(const W of ge)W.startsWith("new-session-")||ke.add(W);return ke.add(le),ke})},[]),Pe=()=>{const{t:le}=Kt("common"),[ge,ke]=b.useState(!1),[W,se]=b.useState(""),[te,Be]=b.useState("");if(!c)return null;const At=er=>er?er.replace(/\b[0-9a-f]{40}\b/gi,"").replace(/(?:^|\s|-)([0-9a-f]{7,10})\b/gi,"").replace(/\*\*Full Changelog\*\*:.*$/gim,"").replace(/https?:\/\/github\.com\/[^\/]+\/[^\/]+\/compare\/[^\s)]+/gi,"").replace(/\n\s*\n\s*\n/g,`
1238
+ DEBUG=true`,rows:3,className:"w-full px-3 py-2 text-sm bg-background border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring"})]}),i.jsxs("div",{className:"flex justify-end gap-2 pt-4 border-t border-border",children:[i.jsx(ze,{type:"button",variant:"outline",onClick:Yt,children:o("mcpForm.actions.cancel")}),i.jsx(ze,{type:"submit",disabled:Lt||!Xe.name||!Xe.config?.command,className:"bg-green-600 hover:bg-green-700 text-white",children:o(Lt?"mcpForm.actions.saving":Gt?"mcpForm.actions.updateServer":"mcpForm.actions.addServer")})]})]})]})}),R==="tasks"&&i.jsx("div",{className:"space-y-6 md:space-y-8",children:i.jsx(FH,{})}),R==="api"&&i.jsx("div",{className:"space-y-6 md:space-y-8",children:i.jsx(DH,{})})]})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between p-4 md:p-6 border-t border-border flex-shrink-0 gap-3 pb-safe-area-inset-bottom",children:[i.jsxs("div",{className:"flex items-center justify-center sm:justify-start gap-2 order-2 sm:order-1",children:[w==="success"&&i.jsxs("div",{className:"text-green-600 dark:text-green-400 text-sm flex items-center gap-1",children:[i.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:i.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),o("saveStatus.success")]}),w==="error"&&i.jsxs("div",{className:"text-red-600 dark:text-red-400 text-sm flex items-center gap-1",children:[i.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:i.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),o("saveStatus.error")]})]}),i.jsxs("div",{className:"flex items-center gap-3 order-1 sm:order-2",children:[i.jsx(ze,{variant:"outline",onClick:t,disabled:S,className:"flex-1 sm:flex-none h-10 touch-manipulation",children:o("footerActions.cancel")}),i.jsx(ze,{onClick:Mn,disabled:S,className:"flex-1 sm:flex-none h-10 bg-blue-600 hover:bg-blue-700 disabled:opacity-50 touch-manipulation",children:S?i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-4 h-4 animate-spin rounded-full border-2 border-white border-t-transparent"}),o("saveStatus.saving")]}):o("footerActions.save")})]})]})]}),i.jsx(V3,{isOpen:ar,onClose:()=>vr(!1),provider:Q,project:le,onComplete:tn,isAuthenticated:Q==="claude"?ke.authenticated:Q==="cursor"?se.authenticated:Q==="codex"?Be.authenticated:!1},Q)]}):null}function JH(){const{isDarkMode:e,toggleDarkMode:t}=xs();return i.jsxs("button",{onClick:t,className:"relative inline-flex h-8 w-14 items-center rounded-full bg-gray-200 dark:bg-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",role:"switch","aria-checked":e,"aria-label":"Toggle dark mode",children:[i.jsx("span",{className:"sr-only",children:"Toggle dark mode"}),i.jsx("span",{className:`${e?"translate-x-7":"translate-x-1"} inline-block h-6 w-6 transform rounded-full bg-white shadow-lg transition-transform duration-200 flex items-center justify-center`,children:e?i.jsx("svg",{className:"w-3.5 h-3.5 text-gray-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})}):i.jsx("svg",{className:"w-3.5 h-3.5 text-yellow-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})})})]})}const QH=({isOpen:e,onToggle:t,autoExpandTools:r,onAutoExpandChange:n,showRawParameters:a,onShowRawParametersChange:s,showThinking:o,onShowThinkingChange:l,autoScrollToBottom:c,onAutoScrollChange:u,sendByCtrlEnter:d,onSendByCtrlEnterChange:p,isMobile:h})=>{const{t:m}=Kt("settings"),[g,f]=b.useState(e),[k,S]=b.useState(()=>localStorage.getItem("whisperMode")||"default"),{isDarkMode:v}=xs(),[w,A]=b.useState(()=>{const z=localStorage.getItem("quickSettingsHandlePosition");if(z)try{return JSON.parse(z).y??50}catch{return localStorage.removeItem("quickSettingsHandlePosition"),50}return 50}),[I,E]=b.useState(!1),[C,M]=b.useState(0),[O,j]=b.useState(0),[G,V]=b.useState(!1),D=b.useRef(null),P=b.useRef({min:10,max:90}),B=5;b.useEffect(()=>{f(e)},[e]),b.useEffect(()=>{localStorage.setItem("quickSettingsHandlePosition",JSON.stringify({y:w}))},[w]);const F=b.useCallback(()=>h?{bottom:`${window.innerHeight*w/100}px`}:{top:`${w}%`,transform:"translateY(-50%)"},[w,h]),$=b.useCallback(z=>{z.stopPropagation();const re=z.type.includes("touch")?z.touches[0].clientY:z.clientY;M(re),j(w),V(!1),E(!1)},[w]),H=b.useCallback(z=>{if(C===0)return;const re=z.type.includes("touch")?z.touches[0].clientY:z.clientY,R=Math.abs(re-C);if(!I&&R>B&&(E(!0),V(!0),document.body.style.cursor="grabbing",document.body.style.userSelect="none",z.type.includes("touch")&&(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%")),!I)return;z.type.includes("touch")&&z.preventDefault();const K=re-C;let pe;h?pe=-(K/window.innerHeight)*100:pe=K/window.innerHeight*100;let ve=O+pe;ve=Math.max(P.current.min,Math.min(P.current.max,ve)),A(ve)},[I,C,O,h,B]),ne=b.useCallback(()=>{E(!1),M(0),document.body.style.cursor="",document.body.style.userSelect="",document.body.style.overflow="",document.body.style.position="",document.body.style.width=""},[]);b.useEffect(()=>()=>{document.body.style.cursor="",document.body.style.userSelect="",document.body.style.overflow="",document.body.style.position="",document.body.style.width=""},[]),b.useEffect(()=>{if(C!==0){const z=pe=>H(pe),re=()=>ne(),R=pe=>H(pe),K=()=>ne();return document.addEventListener("mousemove",z),document.addEventListener("mouseup",re),document.addEventListener("touchmove",R,{passive:!1}),document.addEventListener("touchend",K),()=>{document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",re),document.removeEventListener("touchmove",R),document.removeEventListener("touchend",K)}}},[C,H,ne]);const N=z=>{if(G){z.preventDefault(),V(!1);return}const re=!g;f(re),t(re)};return i.jsxs(i.Fragment,{children:[i.jsx("button",{ref:D,onClick:N,onMouseDown:z=>{$(z)},onTouchStart:z=>{$(z)},className:`fixed ${g?"right-64":"right-0"} z-50 ${I?"":"transition-all duration-150 ease-out"} bg-white dark:bg-gray-800 border ${I?"border-blue-500 dark:border-blue-400":"border-gray-200 dark:border-gray-700"} rounded-l-md p-2 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors shadow-lg ${I?"cursor-grabbing":"cursor-pointer"} touch-none`,style:{...F(),touchAction:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none"},"aria-label":m(I?"quickSettings.dragHandle.dragging":g?"quickSettings.dragHandle.closePanel":"quickSettings.dragHandle.openPanel"),title:m(I?"quickSettings.dragHandle.draggingStatus":"quickSettings.dragHandle.toggleAndMove"),children:I?i.jsx(t6,{className:"h-5 w-5 text-blue-500 dark:text-blue-400"}):g?i.jsx(Hn,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"}):i.jsx(mg,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"})}),i.jsx("div",{className:`fixed top-0 right-0 h-full w-64 bg-background border-l border-border shadow-xl transform transition-transform duration-150 ease-out z-40 ${g?"translate-x-0":"translate-x-full"} ${h?"h-screen":""}`,children:i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900",children:i.jsxs("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[i.jsx(O6,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"}),m("quickSettings.title")]})}),i.jsxs("div",{className:`flex-1 overflow-y-auto overflow-x-hidden p-4 space-y-6 bg-background ${h?"pb-mobile-nav":""}`,children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:m("quickSettings.sections.appearance")}),i.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[v?i.jsx(dh,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}):i.jsx(ph,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),m("quickSettings.darkMode")]}),i.jsx(JH,{})]}),i.jsx("div",{children:i.jsx(K3,{compact:!0})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:m("quickSettings.sections.toolDisplay")}),i.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[i.jsx(gg,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),m("quickSettings.autoExpandTools")]}),i.jsx("input",{type:"checkbox",checked:r,onChange:z=>n(z.target.checked),className:"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"})]}),i.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[i.jsx(Ai,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),m("quickSettings.showRawParameters")]}),i.jsx("input",{type:"checkbox",checked:a,onChange:z=>s(z.target.checked),className:"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"})]}),i.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[i.jsx($o,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),m("quickSettings.showThinking")]}),i.jsx("input",{type:"checkbox",checked:o,onChange:z=>l(z.target.checked),className:"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"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:m("quickSettings.sections.viewOptions")}),i.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[i.jsx(K4,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),m("quickSettings.autoScrollToBottom")]}),i.jsx("input",{type:"checkbox",checked:c,onChange:z=>u(z.target.checked),className:"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"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:m("quickSettings.sections.inputSettings")}),i.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[i.jsx(J4,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),m("quickSettings.sendByCtrlEnter")]}),i.jsx("input",{type:"checkbox",checked:d,onChange:z=>p(z.target.checked),className:"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"})]}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 ml-3",children:m("quickSettings.sendByCtrlEnterDescription")})]}),i.jsxs("div",{className:"space-y-2",style:{display:"none"},children:[i.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:m("quickSettings.sections.whisperDictation")}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("label",{className:"flex items-start p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[i.jsx("input",{type:"radio",name:"whisperMode",value:"default",checked:k==="default",onChange:()=>{S("default"),localStorage.setItem("whisperMode","default"),window.dispatchEvent(new Event("whisperModeChanged"))},className:"mt-0.5 h-4 w-4 border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"}),i.jsxs("div",{className:"ml-3 flex-1",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white",children:[i.jsx(po,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),m("quickSettings.whisper.modes.default")]}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:m("quickSettings.whisper.modes.defaultDescription")})]})]}),i.jsxs("label",{className:"flex items-start p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[i.jsx("input",{type:"radio",name:"whisperMode",value:"prompt",checked:k==="prompt",onChange:()=>{S("prompt"),localStorage.setItem("whisperMode","prompt"),window.dispatchEvent(new Event("whisperModeChanged"))},className:"mt-0.5 h-4 w-4 border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"}),i.jsxs("div",{className:"ml-3 flex-1",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white",children:[i.jsx(Wn,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),m("quickSettings.whisper.modes.prompt")]}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:m("quickSettings.whisper.modes.promptDescription")})]})]}),i.jsxs("label",{className:"flex items-start p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[i.jsx("input",{type:"radio",name:"whisperMode",value:"vibe",checked:k==="vibe"||k==="instructions"||k==="architect",onChange:()=>{S("vibe"),localStorage.setItem("whisperMode","vibe"),window.dispatchEvent(new Event("whisperModeChanged"))},className:"mt-0.5 h-4 w-4 border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"}),i.jsxs("div",{className:"ml-3 flex-1",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white",children:[i.jsx(zr,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),m("quickSettings.whisper.modes.vibe")]}),i.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:m("quickSettings.whisper.modes.vibeDescription")})]})]})]})]})]})]})}),g&&i.jsx("div",{className:"fixed inset-0 bg-background/80 backdrop-blur-sm z-30 transition-opacity duration-150 ease-out",onClick:N})]})},eW=()=>{const[e,t]=b.useState(""),[r,n]=b.useState(""),[a,s]=b.useState(""),[o,l]=b.useState(!1),[c,u]=b.useState(""),{register:d}=ji(),p=async h=>{if(h.preventDefault(),u(""),r!==a){u("Passwords do not match");return}if(e.length<3){u("Username must be at least 3 characters long");return}if(r.length<6){u("Password must be at least 6 characters long");return}l(!0);const m=await d(e,r);m.success||u(m.error),l(!1)};return i.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:i.jsx("div",{className:"w-full max-w-md",children:i.jsxs("div",{className:"bg-card rounded-lg shadow-lg border border-border p-8 space-y-6",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"flex justify-center mb-4",children:i.jsx(In,{size:64})}),i.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Welcome to Axhub Genie"}),i.jsx("p",{className:"text-muted-foreground mt-2",children:"Set up your account to get started"})]}),i.jsxs("form",{onSubmit:p,className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-foreground mb-1",children:"Username"}),i.jsx("input",{type:"text",id:"username",value:e,onChange:h=>t(h.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter your username",required:!0,disabled:o})]}),i.jsxs("div",{children:[i.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-foreground mb-1",children:"Password"}),i.jsx("input",{type:"password",id:"password",value:r,onChange:h=>n(h.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter your password",required:!0,disabled:o})]}),i.jsxs("div",{children:[i.jsx("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-foreground mb-1",children:"Confirm Password"}),i.jsx("input",{type:"password",id:"confirmPassword",value:a,onChange:h=>s(h.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Confirm your password",required:!0,disabled:o})]}),c&&i.jsx("div",{className:"p-3 bg-red-100 dark:bg-red-900/20 border border-red-300 dark:border-red-800 rounded-md",children:i.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:c})}),i.jsx("button",{type:"submit",disabled:o,className:"w-full bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 text-white font-medium py-2 px-4 rounded-md transition-colors duration-200",children:o?"Setting up...":"Create Account"})]}),i.jsx("div",{className:"text-center",children:i.jsx("p",{className:"text-sm text-muted-foreground",children:"This is a single-user system. Only one account can be created."})})]})})})},tW=()=>{const{t:e}=Kt("auth"),[t,r]=b.useState(""),[n,a]=b.useState(""),[s,o]=b.useState(!1),[l,c]=b.useState(""),{login:u}=ji(),d=async p=>{if(p.preventDefault(),c(""),!t||!n){c(e("errors.requiredFields"));return}o(!0);const h=await u(t,n);h.success||c(h.error),o(!1)};return i.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:i.jsx("div",{className:"w-full max-w-md",children:i.jsxs("div",{className:"bg-card rounded-lg shadow-lg border border-border p-8 space-y-6",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"flex justify-center mb-4",children:i.jsx("div",{className:"w-16 h-16 bg-primary rounded-lg flex items-center justify-center shadow-sm",children:i.jsx(ko,{className:"w-8 h-8 text-primary-foreground"})})}),i.jsx("h1",{className:"text-2xl font-bold text-foreground",children:e("login.title")}),i.jsx("p",{className:"text-muted-foreground mt-2",children:e("login.description")})]}),i.jsxs("form",{onSubmit:d,className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-foreground mb-1",children:e("login.username")}),i.jsx("input",{type:"text",id:"username",value:t,onChange:p=>r(p.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:e("login.placeholders.username"),required:!0,disabled:s})]}),i.jsxs("div",{children:[i.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-foreground mb-1",children:e("login.password")}),i.jsx("input",{type:"password",id:"password",value:n,onChange:p=>a(p.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:e("login.placeholders.password"),required:!0,disabled:s})]}),l&&i.jsx("div",{className:"p-3 bg-red-100 dark:bg-red-900/20 border border-red-300 dark:border-red-800 rounded-md",children:i.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:l})}),i.jsx("button",{type:"submit",disabled:s,className:"w-full bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 text-white font-medium py-2 px-4 rounded-md transition-colors duration-200",children:e(s?"login.loading":"login.submit")})]}),i.jsx("div",{className:"text-center",children:i.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter your credentials to access Axhub Genie"})})]})})})},rW=({onComplete:e})=>{const[t,r]=b.useState(0),[n,a]=b.useState(""),[s,o]=b.useState(""),[l,c]=b.useState(!1),[u,d]=b.useState(""),[p,h]=b.useState(null),[m]=b.useState({name:"default",fullPath:""}),[g,f]=b.useState({authenticated:!1,email:null,loading:!0,error:null}),[k,S]=b.useState({authenticated:!1,email:null,loading:!0,error:null}),[v,w]=b.useState({authenticated:!1,email:null,loading:!0,error:null}),{user:A}=ji(),I=b.useRef(void 0);b.useEffect(()=>{E()},[]);const E=async()=>{try{const N=await Ae("/api/user/git-config");if(N.ok){const z=await N.json();z.gitName&&a(z.gitName),z.gitEmail&&o(z.gitEmail)}}catch(N){console.error("Error loading git config:",N)}};b.useEffect(()=>{const N=I.current;I.current=p,(N===void 0||N!==null&&p===null)&&(C(),M(),O())},[p]);const C=async()=>{try{const N=await Ae("/api/cli/claude/status");if(N.ok){const z=await N.json();f({authenticated:z.authenticated,email:z.email,loading:!1,error:z.error||null})}else f({authenticated:!1,email:null,loading:!1,error:"Failed to check authentication status"})}catch(N){console.error("Error checking Claude auth status:",N),f({authenticated:!1,email:null,loading:!1,error:N.message})}},M=async()=>{try{const N=await Ae("/api/cli/cursor/status");if(N.ok){const z=await N.json();S({authenticated:z.authenticated,email:z.email,loading:!1,error:z.error||null})}else S({authenticated:!1,email:null,loading:!1,error:"Failed to check authentication status"})}catch(N){console.error("Error checking Cursor auth status:",N),S({authenticated:!1,email:null,loading:!1,error:N.message})}},O=async()=>{try{const N=await Ae("/api/cli/codex/status");if(N.ok){const z=await N.json();w({authenticated:z.authenticated,email:z.email,loading:!1,error:z.error||null})}else w({authenticated:!1,email:null,loading:!1,error:"Failed to check authentication status"})}catch(N){console.error("Error checking Codex auth status:",N),w({authenticated:!1,email:null,loading:!1,error:N.message})}},j=()=>h("claude"),G=()=>h("cursor"),V=()=>h("codex"),D=N=>{N===0&&(p==="claude"?C():p==="cursor"?M():p==="codex"&&O())},P=async()=>{if(d(""),t===0){if(!n.trim()||!s.trim()){d("Both git name and email are required");return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s)){d("Please enter a valid email address");return}c(!0);try{const z=await Ae("/api/user/git-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gitName:n,gitEmail:s})});if(!z.ok){const re=await z.json();throw new Error(re.error||"Failed to save git configuration")}r(t+1)}catch(z){d(z.message)}finally{c(!1)}return}r(t+1)},B=()=>{d(""),r(t-1)},F=async()=>{c(!0),d("");try{const N=await Ae("/api/user/complete-onboarding",{method:"POST"});if(!N.ok){const z=await N.json();throw new Error(z.error||"Failed to complete onboarding")}e&&e()}catch(N){d(N.message)}finally{c(!1)}},$=[{title:"Git Configuration",description:"Set up your git identity for commits",icon:ba,required:!0},{title:"Connect Agents",description:"Connect your AI coding assistants",icon:Q4,required:!1}],H=()=>{switch(t){case 0:return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"text-center mb-8",children:[i.jsx("div",{className:"w-16 h-16 bg-blue-100 dark:bg-blue-900/30 rounded-full flex items-center justify-center mx-auto mb-4",children:i.jsx(ba,{className:"w-8 h-8 text-blue-600 dark:text-blue-400"})}),i.jsx("h2",{className:"text-2xl font-bold text-foreground mb-2",children:"Git Configuration"}),i.jsx("p",{className:"text-muted-foreground",children:"Configure your git identity to ensure proper attribution for your commits"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsxs("label",{htmlFor:"gitName",className:"flex items-center gap-2 text-sm font-medium text-foreground mb-2",children:[i.jsx(X6,{className:"w-4 h-4"}),"Git Name ",i.jsx("span",{className:"text-red-500",children:"*"})]}),i.jsx("input",{type:"text",id:"gitName",value:n,onChange:N=>a(N.target.value),className:"w-full px-4 py-3 border border-border rounded-lg bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"John Doe",required:!0,disabled:l}),i.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"This will be used as: git config --global user.name"})]}),i.jsxs("div",{children:[i.jsxs("label",{htmlFor:"gitEmail",className:"flex items-center gap-2 text-sm font-medium text-foreground mb-2",children:[i.jsx(d6,{className:"w-4 h-4"}),"Git Email ",i.jsx("span",{className:"text-red-500",children:"*"})]}),i.jsx("input",{type:"email",id:"gitEmail",value:s,onChange:N=>o(N.target.value),className:"w-full px-4 py-3 border border-border rounded-lg bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"john@example.com",required:!0,disabled:l}),i.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"This will be used as: git config --global user.email"})]})]})]});case 1:return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"text-center mb-6",children:[i.jsx("h2",{className:"text-2xl font-bold text-foreground mb-2",children:"Connect Your AI Agents"}),i.jsx("p",{className:"text-muted-foreground",children:"Login to one or more AI coding assistants. All are optional."})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx("div",{className:`border rounded-lg p-4 transition-colors ${g.authenticated?"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800":"border-border bg-card"}`,children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 bg-blue-100 dark:bg-blue-900/30 rounded-full flex items-center justify-center",children:i.jsx(In,{size:20})}),i.jsxs("div",{children:[i.jsxs("div",{className:"font-medium text-foreground flex items-center gap-2",children:["Claude Code",g.authenticated&&i.jsx(_r,{className:"w-4 h-4 text-green-500"})]}),i.jsx("div",{className:"text-xs text-muted-foreground",children:g.loading?"Checking...":g.authenticated?g.email||"Connected":"Not connected"})]})]}),!g.authenticated&&!g.loading&&i.jsx("button",{onClick:j,className:"bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium py-2 px-4 rounded-lg transition-colors",children:"Login"})]})}),i.jsx("div",{className:`border rounded-lg p-4 transition-colors ${k.authenticated?"bg-purple-50 dark:bg-purple-900/20 border-purple-200 dark:border-purple-800":"border-border bg-card"}`,children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 bg-purple-100 dark:bg-purple-900/30 rounded-full flex items-center justify-center",children:i.jsx(Xn,{size:20})}),i.jsxs("div",{children:[i.jsxs("div",{className:"font-medium text-foreground flex items-center gap-2",children:["Cursor",k.authenticated&&i.jsx(_r,{className:"w-4 h-4 text-green-500"})]}),i.jsx("div",{className:"text-xs text-muted-foreground",children:k.loading?"Checking...":k.authenticated?k.email||"Connected":"Not connected"})]})]}),!k.authenticated&&!k.loading&&i.jsx("button",{onClick:G,className:"bg-purple-600 hover:bg-purple-700 text-white text-sm font-medium py-2 px-4 rounded-lg transition-colors",children:"Login"})]})}),i.jsx("div",{className:`border rounded-lg p-4 transition-colors ${v.authenticated?"bg-gray-100 dark:bg-gray-800/50 border-gray-300 dark:border-gray-600":"border-border bg-card"}`,children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 bg-gray-100 dark:bg-gray-800 rounded-full flex items-center justify-center",children:i.jsx(Zn,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"font-medium text-foreground flex items-center gap-2",children:["OpenAI Codex",v.authenticated&&i.jsx(_r,{className:"w-4 h-4 text-green-500"})]}),i.jsx("div",{className:"text-xs text-muted-foreground",children:v.loading?"Checking...":v.authenticated?v.email||"Connected":"Not connected"})]})]}),!v.authenticated&&!v.loading&&i.jsx("button",{onClick:V,className:"bg-gray-800 hover:bg-gray-900 dark:bg-gray-700 dark:hover:bg-gray-600 text-white text-sm font-medium py-2 px-4 rounded-lg transition-colors",children:"Login"})]})})]}),i.jsx("div",{className:"text-center text-sm text-muted-foreground pt-2",children:i.jsx("p",{children:"You can configure these later in Settings."})})]});default:return null}},ne=()=>{switch(t){case 0:return n.trim()&&s.trim()&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s);case 1:return!0;default:return!1}};return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:i.jsxs("div",{className:"w-full max-w-2xl",children:[i.jsx("div",{className:"mb-8",children:i.jsx("div",{className:"flex items-center justify-between",children:$.map((N,z)=>i.jsxs(dr.Fragment,{children:[i.jsxs("div",{className:"flex flex-col items-center flex-1",children:[i.jsx("div",{className:`w-12 h-12 rounded-full flex items-center justify-center border-2 transition-colors duration-200 ${z<t?"bg-green-500 border-green-500 text-white":z===t?"bg-blue-600 border-blue-600 text-white":"bg-background border-border text-muted-foreground"}`,children:z<t?i.jsx(_r,{className:"w-6 h-6"}):typeof N.icon=="function"?i.jsx(N.icon,{}):i.jsx(N.icon,{className:"w-6 h-6"})}),i.jsxs("div",{className:"mt-2 text-center",children:[i.jsx("p",{className:`text-sm font-medium ${z===t?"text-foreground":"text-muted-foreground"}`,children:N.title}),N.required&&i.jsx("span",{className:"text-xs text-red-500",children:"Required"})]})]}),z<$.length-1&&i.jsx("div",{className:`flex-1 h-0.5 mx-2 transition-colors duration-200 ${z<t?"bg-green-500":"bg-border"}`})]},z))})}),i.jsxs("div",{className:"bg-card rounded-lg shadow-lg border border-border p-8",children:[H(),u&&i.jsx("div",{className:"mt-6 p-4 bg-red-100 dark:bg-red-900/20 border border-red-300 dark:border-red-800 rounded-lg",children:i.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:u})}),i.jsxs("div",{className:"flex items-center justify-between mt-8 pt-6 border-t border-border",children:[i.jsxs("button",{onClick:B,disabled:t===0||l,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-muted-foreground hover:text-foreground disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200",children:[i.jsx(mg,{className:"w-4 h-4"}),"Previous"]}),i.jsx("div",{className:"flex items-center gap-3",children:t<$.length-1?i.jsx("button",{onClick:P,disabled:!ne()||l,className:"flex items-center gap-2 px-6 py-3 bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 disabled:cursor-not-allowed text-white font-medium rounded-lg transition-colors duration-200",children:l?i.jsxs(i.Fragment,{children:[i.jsx(Ma,{className:"w-4 h-4 animate-spin"}),"Saving..."]}):i.jsxs(i.Fragment,{children:["Next",i.jsx(Hn,{className:"w-4 h-4"})]})}):i.jsx("button",{onClick:F,disabled:l,className:"flex items-center gap-2 px-6 py-3 bg-green-600 hover:bg-green-700 disabled:bg-green-400 disabled:cursor-not-allowed text-white font-medium rounded-lg transition-colors duration-200",children:l?i.jsxs(i.Fragment,{children:[i.jsx(Ma,{className:"w-4 h-4 animate-spin"}),"Completing..."]}):i.jsxs(i.Fragment,{children:[i.jsx(_r,{className:"w-4 h-4"}),"Complete Setup"]})})})]})]})]})}),p&&i.jsx(V3,{isOpen:!!p,onClose:()=>h(null),provider:p,project:m,onComplete:D})]})},nW=()=>i.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"flex justify-center mb-4",children:i.jsx("div",{className:"w-16 h-16 bg-primary rounded-lg flex items-center justify-center shadow-sm",children:i.jsx(ko,{className:"w-8 h-8 text-primary-foreground"})})}),i.jsx("h1",{className:"text-2xl font-bold text-foreground mb-2",children:"Axhub Genie"}),i.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[i.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full animate-bounce"}),i.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),i.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]}),i.jsx("p",{className:"text-muted-foreground mt-2",children:"Loading..."})]})}),aW=({children:e})=>{const{user:t,isLoading:r,needsSetup:n,hasCompletedOnboarding:a,refreshOnboardingStatus:s}=ji();return r?i.jsx(nW,{}):n?i.jsx(eW,{}):t?a?e:i.jsx(rW,{onComplete:s}):i.jsx(tW,{})};function li(e,t){const[r,n]=b.useState(()=>{if(typeof window>"u")return t;try{const s=window.localStorage.getItem(e);return s?JSON.parse(s):t}catch(s){return console.log(s),t}});return[r,s=>{if(!(typeof window>"u"))try{const o=s instanceof Function?s(r):s;window.localStorage.setItem(e,JSON.stringify(o)),n(o)}catch(o){console.log(o)}}]}const{slice:iW,forEach:sW}=[];function oW(e){return sW.call(iW.call(arguments,1),t=>{if(t)for(const r in t)e[r]===void 0&&(e[r]=t[r])}),e}function lW(e){return typeof e!="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(r=>r.test(e))}const D4=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,cW=function(e,t){const n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},a=encodeURIComponent(t);let s=`${e}=${a}`;if(n.maxAge>0){const o=n.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(o)}`}if(n.domain){if(!D4.test(n.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${n.domain}`}if(n.path){if(!D4.test(n.path))throw new TypeError("option path is invalid");s+=`; Path=${n.path}`}if(n.expires){if(typeof n.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(s+="; HttpOnly"),n.secure&&(s+="; Secure"),n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return n.partitioned&&(s+="; Partitioned"),s},M4={create(e,t,r,n){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+r*60*1e3)),n&&(a.domain=n),document.cookie=cW(e,t,a)},read(e){const t=`${e}=`,r=document.cookie.split(";");for(let n=0;n<r.length;n++){let a=r[n];for(;a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(t)===0)return a.substring(t.length,a.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var uW={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return M4.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:r,cookieMinutes:n,cookieDomain:a,cookieOptions:s}=t;r&&typeof document<"u"&&M4.create(r,e,n,a,s)}},dW={name:"querystring",lookup(e){let{lookupQuerystring:t}=e,r;if(typeof window<"u"){let{search:n}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));const s=n.substring(1).split("&");for(let o=0;o<s.length;o++){const l=s[o].indexOf("=");l>0&&s[o].substring(0,l)===t&&(r=s[o].substring(l+1))}}return r}},pW={name:"hash",lookup(e){let{lookupHash:t,lookupFromHashIndex:r}=e,n;if(typeof window<"u"){const{hash:a}=window.location;if(a&&a.length>2){const s=a.substring(1);if(t){const o=s.split("&");for(let l=0;l<o.length;l++){const c=o[l].indexOf("=");c>0&&o[l].substring(0,c)===t&&(n=o[l].substring(c+1))}}if(n)return n;if(!n&&r>-1){const o=a.match(/\/([a-zA-Z-]*)/g);return Array.isArray(o)?o[typeof r=="number"?r:0]?.replace("/",""):void 0}}}return n}};let ci=null;const F4=()=>{if(ci!==null)return ci;try{if(ci=typeof window<"u"&&window.localStorage!==null,!ci)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{ci=!1}return ci};var mW={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&F4())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:r}=t;r&&F4()&&window.localStorage.setItem(r,e)}};let ui=null;const P4=()=>{if(ui!==null)return ui;try{if(ui=typeof window<"u"&&window.sessionStorage!==null,!ui)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{ui=!1}return ui};var hW={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&P4())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:r}=t;r&&P4()&&window.sessionStorage.setItem(r,e)}},gW={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:r,userLanguage:n,language:a}=navigator;if(r)for(let s=0;s<r.length;s++)t.push(r[s]);n&&t.push(n),a&&t.push(a)}return t.length>0?t:void 0}},fW={name:"htmlTag",lookup(e){let{htmlTag:t}=e,r;const n=t||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(r=n.getAttribute("lang")),r}},bW={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?r[typeof t=="number"?t:0]?.replace("/",""):void 0}},xW={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const r=typeof t=="number"?t+1:1,n=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[r]}};let Y3=!1;try{document.cookie,Y3=!0}catch{}const X3=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Y3||X3.splice(1,1);const yW=()=>({order:X3,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class Z3{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,r)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=oW(r,this.options||{},yW()),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=n,this.addDetector(uW),this.addDetector(dW),this.addDetector(mW),this.addDetector(hW),this.addDetector(gW),this.addDetector(fW),this.addDetector(bW),this.addDetector(xW),this.addDetector(pW)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,r=[];return t.forEach(n=>{if(this.detectors[n]){let a=this.detectors[n].lookup(this.options);a&&typeof a=="string"&&(a=[a]),a&&(r=r.concat(a))}}),r=r.filter(n=>n!=null&&!lW(n)).map(n=>this.options.convertDetectedLanguage(n)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}cacheUserLanguage(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||r.forEach(n=>{this.detectors[n]&&this.detectors[n].cacheUserLanguage(t,this.options)}))}}Z3.type="languageDetector";const vW={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"},kW={chat:"Chat",shell:"Shell",files:"Files",git:"Source Control",tasks:"Tasks"},wW={loading:"Loading...",success:"Success",error:"Error",failed:"Failed",pending:"Pending",completed:"Completed",inProgress:"In Progress"},SW={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"},EW={settings:"Settings",home:"Home",back:"Back",next:"Next",previous:"Previous",logout:"Logout"},NW={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"},CW={justNow:"Just now",minutesAgo:"{{count}} mins ago",hoursAgo:"{{count}} hours ago",daysAgo:"{{count}} days ago",yesterday:"Yesterday"},TW={newFile:"New File",newFolder:"New Folder",rename:"Rename",move:"Move",copyPath:"Copy Path",openInEditor:"Open in Editor"},AW={loading:"Loading Axhub Genie",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",openInCodexClient:"Open in Codex client"},IW={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",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"},RW={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",workspaceType:"Workspace Type:",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"}},jW={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:",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"}},_W={buttons:vW,tabs:kW,status:wW,messages:SW,navigation:EW,common:NW,time:CW,fileOperations:TW,mainContent:AW,fileTree:IW,projectWizard:RW,versionUpdate:jW},LW="Settings",OW={account:"Account",permissions:"Permissions",mcpServers:"MCP Servers",appearance:"Appearance"},DW={title:"Account",language:"Language",languageLabel:"Display Language",languageDescription:"Choose your preferred language for the interface",username:"Username",email:"Email",profile:"Profile",changePassword:"Change Password"},MW={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"}},FW={title:"Appearance",theme:"Theme",codeEditor:"Code Editor",editorTheme:"Editor Theme",wordWrap:"Word Wrap",showMinimap:"Show Minimap",lineNumbers:"Line Numbers",fontSize:"Font Size"},PW={saveChanges:"Save Changes",resetToDefaults:"Reset to Defaults",cancelChanges:"Cancel Changes"},BW={title:"Quick Settings",sections:{appearance:"Appearance",toolDisplay:"Tool Display",viewOptions:"View Options",inputSettings:"Input Settings",whisperDictation:"Whisper Dictation"},darkMode:"Dark Mode",autoExpandTools:"Auto-expand tools",showRawParameters:"Show raw parameters",showThinking:"Show thinking",autoScrollToBottom:"Auto-scroll to bottom",sendByCtrlEnter:"Send by Ctrl+Enter",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"},whisper:{modes:{default:"Default Mode",defaultDescription:"Direct transcription of your speech",prompt:"Prompt Enhancement",promptDescription:"Transform rough ideas into clear, detailed AI prompts",vibe:"Vibe Mode",vibeDescription:"Format ideas as clear agent instructions with details"}}},zW={agents:"Agents",appearance:"Appearance",git:"Git",apiTokens:"API & Tokens",tasks:"Tasks"},UW={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"}}},$W={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"}},qW={success:"Settings saved successfully!",error:"Failed to save settings",saving:"Saving..."},GW={save:"Save Settings",cancel:"Cancel"},HW={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"}},WW={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}}"}},VW={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"}},KW={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"}},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}}"},YW={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"}},XW={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"},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"},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."}},ZW={title:LW,tabs:OW,account:DW,mcp:MW,appearance:FW,actions:PW,quickSettings:BW,mainTabs:zW,appearanceSettings:UW,mcpForm:$W,saveStatus:qW,footerActions:GW,git:HW,apiKeys:WW,tasks:VW,agents:KW,permissions:YW,mcpServers:XW},JW={title:"Welcome Back",description:"Sign in to your Axhub Genie 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"}},QW={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"}},eV={title:"Sign Out",confirm:"Are you sure you want to sign out?",button:"Sign Out"},tV={login:JW,register:QW,logout:eV},rV={title:"Projects",newProject:"New Project",deleteProject:"Delete 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"},nV={title:"Axhub Genie",subtitle:"AI coding assistant interface"},aV={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"},iV={viewEnvironments:"View Environments",hideSidebar:"Hide sidebar",createProject:"Create new project",refresh:"Refresh projects and sessions (Ctrl+R)",renameProject:"Rename project (F2)",deleteProject:"Delete empty project (Delete)",addToFavorites:"Add to favorites",removeFromFavorites:"Remove from favorites",editSessionName:"Manually edit session name",deleteSession:"Delete this session permanently",save:"Save",cancel:"Cancel"},sV={chat:"Chat",files:"Files",git:"Git",terminal:"Terminal",tasks:"Tasks"},oV={refresh:"Refresh",settings:"Settings",collapseAll:"Collapse All",expandAll:"Expand All",cancel:"Cancel",save:"Save",delete:"Delete",rename:"Rename"},lV={active:"Active",inactive:"Inactive",thinking:"Thinking...",error:"Error",aborted:"Aborted",unknown:"Unknown"},cV={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"},uV={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:"Are you sure you want to delete this empty project? This action cannot be undone.",enterProjectPath:"Please enter a project path",deleteSessionFailed:"Failed to delete session. Please try again.",deleteSessionError:"Error deleting session. Please try again.",deleteProjectFailed:"Failed to delete project. Please try again.",deleteProjectError:"Error deleting project. Please try again.",createProjectFailed:"Failed to create project. Please try again.",createProjectError:"Error creating project. Please try again."},dV={updateAvailable:"Update available"},pV={deleteProject:"Delete Project",deleteSession:"Delete Session",confirmDelete:"Are you sure you want to delete",sessionCount_one:"This project contains {{count}} conversation.",sessionCount_other:"This project contains {{count}} conversations.",allConversationsDeleted:"All conversations will be permanently deleted.",cannotUndo:"This action cannot be undone."},mV={projects:rV,app:nV,sessions:aV,tooltips:iV,navigation:sV,actions:oV,status:lV,time:cV,messages:uV,version:dV,deleteConfirmation:pV},hV={copy:"Copy",copied:"Copied",copyCode:"Copy code"},gV={user:"U",error:"Error",tool:"Tool",claude:"Claude",cursor:"Cursor",codex:"Codex"},fV={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"},bV={found:"Found {{count}} {{type}}",file:"file",files:"files",pattern:"pattern:",in:"in:"},xV={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"},yV={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."},vV={title:"Thinking...",emoji:"💭 Thinking..."},kV={response:"JSON Response"},wV={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"},SV={updated:"Todo list has been updated successfully",current:"Current Todo List"},EV={viewPlan:"📋 View implementation plan",title:"Implementation Plan"},NV={resetAt:"Claude usage limit reached. Your limit will reset at **{{time}} {{timezone}}** - {{date}}"},CV={permissionMode:"Permission Mode",modes:{default:"Default 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.",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"},TV={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"},clickToChangeMode:"Click to change permission mode (or press Tab in input)",showAllCommands:"Show all commands",dynamicContext:{systemChip:"System Context",removeSystem:"Remove system context",removeCurrentFile:"Remove current file",removeElement:"Remove selected element",elementFallback:"Element"}},AV={selector:{title:"Thinking Mode",description:"Extended thinking gives Claude more time to evaluate alternatives",active:"Active",tip:"Higher thinking modes take more time but provide more thorough analysis"},modes:{none:{name:"Standard",description:"Regular Claude response",prefix:""},think:{name:"Think",description:"Basic extended thinking",prefix:"think"},thinkHard:{name:"Think Hard",description:"More thorough evaluation",prefix:"think hard"},thinkHarder:{name:"Think Harder",description:"Deep analysis with alternatives",prefix:"think harder"},ultrathink:{name:"Ultrathink",description:"Maximum thinking budget",prefix:"ultrathink"}},buttonTitle:"Thinking mode: {{mode}}"},IV={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"},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.",default:"Select a provider above to begin"}},RV={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"}},jV={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 (disconnect first)",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"},_V={codeBlock:hV,messageTypes:gV,tools:fV,search:bV,fileOperations:xV,interactive:yV,thinking:vV,json:kV,permissions:wV,todo:SV,plan:EV,usageLimit:NV,codex:CV,input:TV,thinkingMode:AV,providerSelection:IV,session:RV,shell:jV},LV={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"},OV="Loading {{fileName}}...",DV={showingChanges:"Showing changes"},MV={download:"Download file",save:"Save",saving:"Saving...",saved:"Saved!",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",close:"Close"},FV={lines:"Lines:",characters:"Characters:",shortcuts:"Press Ctrl+S to save • Esc to close"},PV={toolbar:LV,loading:OV,header:DV,actions:MV,footer:FV},BV={save:"保存",cancel:"取消",delete:"删除",create:"创建",edit:"编辑",close:"关闭",confirm:"确认",submit:"提交",retry:"重试",refresh:"刷新",search:"搜索",clear:"清除",copy:"复制",download:"下载",upload:"上传",browse:"浏览"},zV={chat:"聊天",shell:"终端",files:"文件",git:"源代码管理",tasks:"任务"},UV={loading:"加载中...",success:"成功",error:"错误",failed:"失败",pending:"待处理",completed:"已完成",inProgress:"进行中"},$V={savedSuccessfully:"保存成功",deletedSuccessfully:"删除成功",updatedSuccessfully:"更新成功",operationFailed:"操作失败",networkError:"网络错误,请检查您的连接。",unauthorized:"未授权,请登录。",notFound:"未找到",invalidInput:"输入无效",requiredField:"此字段为必填项",unknownError:"发生未知错误"},qV={settings:"设置",home:"首页",back:"返回",next:"下一步",previous:"上一步",logout:"退出登录"},GV={language:"语言",theme:"主题",darkMode:"深色模式",lightMode:"浅色模式",name:"名称",description:"描述",enabled:"已启用",disabled:"已禁用",optional:"可选",version:"版本",select:"选择",selectAll:"全选",deselectAll:"取消全选"},HV={justNow:"刚刚",minutesAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",daysAgo:"{{count}} 天前",yesterday:"昨天"},WV={newFile:"新建文件",newFolder:"新建文件夹",rename:"重命名",move:"移动",copyPath:"复制路径",openInEditor:"在编辑器中打开"},VV={loading:"正在加载 Axhub Genie",settingUpWorkspace:"正在设置您的工作空间...",chooseProject:"选择您的项目",selectProjectDescription:"从侧边栏选择一个项目以开始使用 Claude 进行编程。每个项目包含您的聊天会话和文件历史。",tip:"提示",createProjectMobile:"点击上方的菜单按钮以访问项目",createProjectDesktop:"点击侧边栏中的文件夹图标以创建新项目",newSession:"新会话",untitledSession:"未命名会话",projectFiles:"项目文件",openInCodexClient:"在 Codex 客户端打开"},KV={loading:"正在加载文件...",files:"文件",simpleView:"简单视图",compactView:"紧凑视图",detailedView:"详细视图",searchPlaceholder:"搜索文件和文件夹...",clearSearch:"清除搜索",name:"名称",size:"大小",modified:"修改时间",permissions:"权限",noFilesFound:"未找到文件",checkProjectPath:"检查项目路径是否可访问",noMatchesFound:"未找到匹配项",tryDifferentSearch:"尝试不同的搜索词或清除搜索",justNow:"刚刚",minAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",daysAgo:"{{count}} 天前"},YV={title:"创建新项目",steps:{type:"类型",configure:"配置",confirm:"确认"},step1:{question:"您已经有工作区,还是想创建一个新的工作区?",existing:{title:"现有工作区",description:"我的服务器上已经有工作区,只需要将其添加到项目列表中"},new:{title:"新建工作区",description:"创建一个新工作区,可选择从 GitHub 仓库克隆"}},step2:{existingPath:"工作区路径",newPath:"工作区路径",existingPlaceholder:"/path/to/existing/workspace",newPlaceholder:"/path/to/new/workspace",existingHelp:"您现有工作区目录的完整路径",newHelp:"工作区目录的完整路径",githubUrl:"GitHub URL(可选)",githubPlaceholder:"https://github.com/username/repository",githubHelp:"可选:提供 GitHub URL 以克隆仓库",githubAuth:"GitHub 身份验证(可选)",githubAuthHelp:"仅私有仓库需要。公共仓库无需身份验证即可克隆。",loadingTokens:"正在加载已保存的令牌...",storedToken:"已保存的令牌",newToken:"新令牌",nonePublic:"无(公共)",selectToken:"选择令牌",selectTokenPlaceholder:"-- 选择令牌 --",tokenPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",tokenHelp:"此令牌仅用于此操作",publicRepoInfo:"公共仓库不需要身份验证。如果克隆公共仓库,可以跳过提供令牌。",noTokensHelp:"没有可用的已保存令牌。您可以在 设置 → API 密钥 中添加令牌以便重复使用。",optionalTokenPublic:"GitHub 令牌(公共仓库可选)",tokenPublicPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(公共仓库可留空)"},step3:{reviewConfig:"查看您的配置",workspaceType:"工作区类型:",existingWorkspace:"现有工作区",newWorkspace:"新建工作区",path:"路径:",cloneFrom:"克隆自:",authentication:"身份验证:",usingStoredToken:"使用已保存的令牌:",usingProvidedToken:"使用提供的令牌",noAuthentication:"无身份验证",sshKey:"SSH 密钥",existingInfo:"工作区将被添加到您的项目列表中,并可用于 Claude/Cursor 会话。",newWithClone:"仓库将从此文件夹克隆。",newEmpty:"工作区将被添加到您的项目列表中,并可用于 Claude/Cursor 会话。",cloningRepository:"正在克隆仓库..."},buttons:{cancel:"取消",back:"返回",next:"下一步",createProject:"创建项目",creating:"创建中...",cloning:"正在克隆..."},errors:{selectType:"请选择您已有现有工作区还是想创建新工作区",providePath:"请提供工作区路径",failedToCreate:"创建工作区失败",failedToCreateFolder:"创建文件夹失败"}},XV={title:"有可用更新",newVersionReady:"新版本已准备就绪",currentVersion:"当前版本",latestVersion:"最新版本",whatsNew:"新内容:",viewFullRelease:"查看完整发布",updateProgress:"更新进度:",manualUpgrade:"手动升级:",manualUpgradeHint:"或点击'立即更新'以自动运行更新。",updateCompleted:"更新成功完成!",restartServer:"请重启服务器以应用更改。",updateFailed:"更新失败",buttons:{close:"关闭",later:"稍后",copyCommand:"复制命令",updateNow:"立即更新",updating:"更新中..."},ariaLabels:{closeModal:"关闭版本升级模态框",showSidebar:"显示侧边栏",settings:"设置",updateAvailable:"有可用更新",closeSidebar:"关闭侧边栏"}},ZV={buttons:BV,tabs:zV,status:UV,messages:$V,navigation:qV,common:GV,time:HV,fileOperations:WV,mainContent:VV,fileTree:KV,projectWizard:YV,versionUpdate:XV},JV="设置",QV={account:"账户",permissions:"权限",mcpServers:"MCP 服务器",appearance:"外观"},eK={title:"账户",language:"语言",languageLabel:"显示语言",languageDescription:"选择您偏好的界面语言",username:"用户名",email:"邮箱",profile:"个人资料",changePassword:"修改密码"},tK={title:"MCP 服务器",addServer:"添加服务器",editServer:"编辑服务器",deleteServer:"删除服务器",serverName:"服务器名称",serverType:"服务器类型",config:"配置",testConnection:"测试连接",status:"状态",connected:"已连接",disconnected:"未连接",scope:{label:"范围",user:"用户",project:"项目"}},rK={title:"外观",theme:"主题",codeEditor:"代码编辑器",editorTheme:"编辑器主题",wordWrap:"自动换行",showMinimap:"显示缩略图",lineNumbers:"行号",fontSize:"字体大小"},nK={saveChanges:"保存更改",resetToDefaults:"重置为默认值",cancelChanges:"取消更改"},aK={title:"快速设置",sections:{appearance:"外观",toolDisplay:"工具显示",viewOptions:"视图选项",inputSettings:"输入设置",whisperDictation:"Whisper 听写"},darkMode:"深色模式",autoExpandTools:"自动展开工具",showRawParameters:"显示原始参数",showThinking:"显示思考过程",autoScrollToBottom:"自动滚动到底部",sendByCtrlEnter:"使用 Ctrl+Enter 发送",sendByCtrlEnterDescription:"启用后,按 Ctrl+Enter 发送消息,而不是仅按 Enter。这对于使用输入法的用户可以避免意外发送。",dragHandle:{dragging:"正在拖拽手柄",closePanel:"关闭设置面板",openPanel:"打开设置面板",draggingStatus:"正在拖拽...",toggleAndMove:"点击切换,拖拽移动"},whisper:{modes:{default:"默认模式",defaultDescription:"直接转录您的语音",prompt:"提示词增强",promptDescription:"将粗略的想法转化为清晰、详细的 AI 提示词",vibe:"Vibe 模式",vibeDescription:"将想法格式化为带有详细说明的清晰智能体指令"}}},iK={agents:"智能体",appearance:"外观",git:"Git",apiTokens:"API 和令牌",tasks:"任务"},sK={darkMode:{label:"深色模式",description:"切换浅色和深色主题"},projectSorting:{label:"项目排序",description:"项目在侧边栏中的排列方式",alphabetical:"按字母顺序",recentActivity:"最近活动"},codeEditor:{title:"代码编辑器",theme:{label:"编辑器主题",description:"代码编辑器的默认主题"},wordWrap:{label:"自动换行",description:"在编辑器中默认启用自动换行"},showMinimap:{label:"显示缩略图",description:"在差异视图中显示缩略图以便于导航"},lineNumbers:{label:"显示行号",description:"在编辑器中显示行号"},fontSize:{label:"字体大小",description:"编辑器字体大小(px)"}}},oK={title:{add:"添加 MCP 服务器",edit:"编辑 MCP 服务器"},importMode:{form:"表单输入",json:"JSON 导入"},scope:{label:"范围",userGlobal:"用户(全局)",projectLocal:"项目(本地)",userDescription:"用户范围:在您机器上的所有项目中可用",projectDescription:"本地范围:仅在选定项目中可用",cannotChange:"编辑现有服务器时无法更改范围"},fields:{serverName:"服务器名称",transportType:"传输类型",command:"命令",arguments:"参数(每行一个)",jsonConfig:"JSON 配置",url:"URL",envVars:"环境变量(KEY=值,每行一个)",headers:"请求头(KEY=值,每行一个)",selectProject:"选择项目..."},placeholders:{serverName:"我的服务"},validation:{missingType:"缺少必填字段:type",stdioRequiresCommand:"stdio 类型需要 command 字段",httpRequiresUrl:"{{type}} 类型需要 url 字段",invalidJson:"无效的 JSON 格式",jsonHelp:"粘贴您的 MCP 服务器配置(JSON 格式)。示例格式:",jsonExampleStdio:'• stdio: {"type":"stdio","command":"npx","args":["@upstash/context7-mcp"]}',jsonExampleHttp:'• http/sse: {"type":"http","url":"https://api.example.com/mcp"}'},configDetails:"配置详细信息(来自 {{configFile}})",projectPath:"路径:{{path}}",actions:{cancel:"取消",saving:"保存中...",addServer:"添加服务器",updateServer:"更新服务器"}},lK={success:"设置保存成功!",error:"保存设置失败",saving:"保存中..."},cK={save:"保存设置",cancel:"取消"},uK={title:"Git 配置",description:"配置您的 git 提交身份。这些设置将通过 git config --global 全局应用",name:{label:"Git 名称",help:"您的 git 提交名称"},email:{label:"Git 邮箱",help:"您的 git 提交邮箱"},actions:{save:"保存配置",saving:"保存中..."},status:{success:"保存成功"}},dK={title:"API 密钥",description:"生成 API 密钥以从其他应用访问外部 API。",newKey:{alertTitle:"⚠️ 保存您的 API 密钥",alertMessage:"这是您唯一一次看到此密钥。请妥善保存。",iveSavedIt:"我已保存"},form:{placeholder:"API 密钥名称(例如:生产服务器)",createButton:"创建",cancelButton:"取消"},newButton:"新建 API 密钥",empty:"尚未创建 API 密钥。",list:{created:"创建时间:",lastUsed:"最后使用:"},confirmDelete:"确定要删除此 API 密钥吗?",status:{active:"激活",inactive:"未激活"},github:{title:"GitHub 令牌",description:"添加 GitHub 个人访问令牌以通过外部 API 克隆私有仓库。",descriptionAlt:"添加 GitHub 个人访问令牌以克隆私有仓库。您也可以直接在 API 请求中传递令牌而无需存储。",addButton:"添加令牌",form:{namePlaceholder:"令牌名称(例如:个人仓库)",tokenPlaceholder:"GitHub 个人访问令牌(ghp_...)",descriptionPlaceholder:"描述(可选)",addButton:"添加令牌",cancelButton:"取消",howToCreate:"如何创建 GitHub 个人访问令牌 →"},empty:"尚未添加 GitHub 令牌。",added:"添加时间:",confirmDelete:"确定要删除此 GitHub 令牌吗?"},apiDocsLink:"API 文档",documentation:{title:"外部 API 文档",description:"了解如何使用外部 API 从您的应用程序触发 Claude/Cursor 会话。",viewLink:"查看 API 文档 →"},loading:"加载中...",version:{updateAvailable:"有可用更新:v{{version}}"}},pK={checking:"正在检查 TaskMaster 安装...",notInstalled:{title:"未安装 TaskMaster AI CLI",description:"需要 TaskMaster CLI 才能使用任务管理功能。安装它以开始使用:",installCommand:"npm install -g task-master-ai",viewOnGitHub:"在 GitHub 上查看",afterInstallation:"安装后:",steps:{restart:"重启此应用程序",autoAvailable:"TaskMaster 功能将自动可用",initCommand:"在项目目录中使用 task-master init"}},settings:{enableLabel:"启用 TaskMaster 集成",enableDescription:"在整个界面中显示 TaskMaster 任务、横幅和侧边栏指示器"}},mK={authStatus:{checking:"检查中...",connected:"已连接",notConnected:"未连接",disconnected:"已断开",checkingAuth:"正在检查认证状态...",loggedInAs:"登录为 {{email}}",authenticatedUser:"已认证用户"},account:{claude:{description:"Anthropic Claude AI 助手"},cursor:{description:"Cursor AI 驱动的代码编辑器"},codex:{description:"OpenAI Codex AI 助手"}},connectionStatus:"连接状态",login:{title:"登录",reAuthenticate:"重新认证",description:"登录您的 {{agent}} 账户以启用 AI 功能",reAuthDescription:"使用其他账户登录或刷新凭据",button:"登录",reLoginButton:"重新登录"},error:"错误:{{error}}"},hK={title:"权限设置",skipPermissions:{label:"跳过权限提示(请谨慎使用)",claudeDescription:"等同于 --dangerously-skip-permissions 标志",cursorDescription:"等同于 Cursor CLI 中的 -f 标志"},allowedTools:{title:"允许的工具",description:"无需权限提示即可自动使用的工具",placeholder:'例如:"Bash(git log:*)" 或 "Write"',quickAdd:"快速添加常用工具:",empty:"未配置允许的工具"},blockedTools:{title:"禁用的工具",description:"无需权限提示即可自动禁用的工具",placeholder:'例如:"Bash(rm:*)"',empty:"未配置禁用的工具"},allowedCommands:{title:"允许的 Shell 命令",description:"无需权限提示即可自动执行的 Shell 命令",placeholder:'例如:"Shell(ls)" 或 "Shell(git status)"',quickAdd:"快速添加常用命令:",empty:"未配置允许的命令"},blockedCommands:{title:"阻止的 Shell 命令",description:"自动阻止的 Shell 命令",placeholder:'例如:"Shell(rm -rf)" 或 "Shell(sudo)"',empty:"未配置阻止的命令"},toolExamples:{title:"工具模式示例:",bashGitLog:"- 允许所有 git log 命令",bashGitDiff:"- 允许所有 git diff 命令",write:"- 允许所有 Write 工具使用",bashRm:"- 阻止所有 rm 命令(危险)"},shellExamples:{title:"Shell 命令示例:",ls:"- 允许 ls 命令",gitStatus:"- 允许 git status",npmInstall:"- 允许 npm install",rmRf:"- 阻止递归删除"},codex:{permissionMode:"权限模式",description:"控制 Codex 如何处理文件修改和命令执行",modes:{default:{title:"默认",description:"只有受信任的命令(ls、cat、grep、git status 等)会自动运行。其他命令将被跳过。可以写入工作区。"},acceptEdits:{title:"接受编辑",description:"所有命令在工作区内自动运行。具有沙箱执行的全自动模式。"},bypassPermissions:{title:"绕过权限",description:"完全系统访问,无任何限制。所有命令自动运行,具有完整的磁盘和网络访问权限。请谨慎使用。"}},technicalDetails:"技术详情",technicalInfo:{default:"sandboxMode=workspace-write, approvalPolicy=untrusted。受信任的命令:cat、cd、grep、head、ls、pwd、tail、git status/log/diff/show、find(不带 -exec)等。",acceptEdits:"sandboxMode=workspace-write, approvalPolicy=never。所有命令在项目目录内自动执行。",bypassPermissions:"sandboxMode=danger-full-access, approvalPolicy=never。完全系统访问权限,仅在可信环境中使用。",overrideNote:"您可以使用聊天界面中的模式按钮按会话覆盖此设置。"}},actions:{add:"添加"}},gK={title:"MCP 服务器",description:{claude:"Model Context Protocol 服务器为 Claude 提供额外的工具和数据源",cursor:"Model Context Protocol 服务器为 Cursor 提供额外的工具和数据源",codex:"Model Context Protocol 服务器为 Codex 提供额外的工具和数据源"},addButton:"添加 MCP 服务器",empty:"未配置 MCP 服务器",serverType:"类型",scope:{local:"本地",user:"用户"},config:{command:"命令",url:"URL",args:"参数",environment:"环境变量"},tools:{title:"工具",count:"({{count}}):",more:"还有 {{count}} 个"},actions:{edit:"编辑服务器",delete:"删除服务器"},help:{title:"关于 Codex MCP",description:"Codex 支持基于 stdio 的 MCP 服务器。您可以添加服务器,通过额外的工具和资源来扩展 Codex 的功能。"}},fK={title:JV,tabs:QV,account:eK,mcp:tK,appearance:rK,actions:nK,quickSettings:aK,mainTabs:iK,appearanceSettings:sK,mcpForm:oK,saveStatus:lK,footerActions:cK,git:uK,apiKeys:dK,tasks:pK,agents:mK,permissions:hK,mcpServers:gK},bK={title:"欢迎回来",description:"登录您的 Axhub Genie 账户",username:"用户名",password:"密码",submit:"登录",loading:"登录中...",errors:{invalidCredentials:"用户名或密码无效",requiredFields:"请填写所有字段",networkError:"网络错误,请重试。"},placeholders:{username:"输入您的用户名",password:"输入您的密码"}},xK={title:"创建账户",username:"用户名",password:"密码",confirmPassword:"确认密码",submit:"创建账户",loading:"创建账户中...",errors:{passwordMismatch:"密码不匹配",usernameTaken:"用户名已被占用",weakPassword:"密码强度太弱"}},yK={title:"退出登录",confirm:"确定要退出登录吗?",button:"退出登录"},vK={login:bK,register:xK,logout:yK},kK={title:"项目",newProject:"新建项目",deleteProject:"删除项目",renameProject:"重命名项目",noProjects:"未找到项目",loadingProjects:"加载项目中...",searchPlaceholder:"搜索项目...",projectNamePlaceholder:"项目名称",starred:"星标",all:"全部",untitledSession:"未命名会话",newSession:"新会话",codexSession:"Codex 会话",fetchingProjects:"正在获取您的 Claude 项目和会话",projects:"项目",noMatchingProjects:"未找到匹配的项目",tryDifferentSearch:"尝试调整您的搜索词",runClaudeCli:"在项目目录中运行 Claude CLI 以开始使用"},wK={title:"Axhub Genie",subtitle:"适合处理轻量级任务"},SK={title:"会话",newSession:"新建会话",deleteSession:"删除会话",renameSession:"重命名会话",noSessions:"暂无会话",loadingSessions:"加载会话中...",unnamed:"未命名",loading:"加载中...",showMore:"显示更多会话"},EK={viewEnvironments:"查看环境",hideSidebar:"隐藏侧边栏",createProject:"创建新项目",refresh:"刷新项目和会话 (Ctrl+R)",renameProject:"重命名项目 (F2)",deleteProject:"删除空项目 (Delete)",addToFavorites:"添加到收藏",removeFromFavorites:"从收藏移除",editSessionName:"手动编辑会话名称",deleteSession:"永久删除此会话",save:"保存",cancel:"取消"},NK={chat:"聊天",files:"文件",git:"Git",terminal:"终端",tasks:"任务"},CK={refresh:"刷新",settings:"设置",collapseAll:"全部折叠",expandAll:"全部展开",cancel:"取消",save:"保存",delete:"删除",rename:"重命名"},TK={active:"活动",inactive:"非活动",thinking:"思考中...",error:"错误",aborted:"已中止",unknown:"未知"},AK={justNow:"刚刚",oneMinuteAgo:"1 分钟前",minutesAgo:"{{count}} 分钟前",oneHourAgo:"1 小时前",hoursAgo:"{{count}} 小时前",oneDayAgo:"1 天前",daysAgo:"{{count}} 天前"},IK={deleteConfirm:"确定要删除吗?",renameSuccess:"重命名成功",deleteSuccess:"删除成功",errorOccurred:"发生错误",deleteSessionConfirm:"确定要删除此会话吗?此操作无法撤销。",deleteProjectConfirm:"确定要删除此空项目吗?此操作无法撤销。",enterProjectPath:"请输入项目路径",deleteSessionFailed:"删除会话失败,请重试。",deleteSessionError:"删除会话时出错,请重试。",deleteProjectFailed:"删除项目失败,请重试。",deleteProjectError:"删除项目时出错,请重试。",createProjectFailed:"创建项目失败,请重试。",createProjectError:"创建项目时出错,请重试。"},RK={updateAvailable:"有可用更新"},jK={deleteProject:"删除项目",deleteSession:"删除会话",confirmDelete:"您确定要删除",sessionCount_one:"此项目包含 {{count}} 个对话。",sessionCount_other:"此项目包含 {{count}} 个对话。",allConversationsDeleted:"所有对话将被永久删除。",cannotUndo:"此操作无法撤销。"},_K={projects:kK,app:wK,sessions:SK,tooltips:EK,navigation:NK,actions:CK,status:TK,time:AK,messages:IK,version:RK,deleteConfirmation:jK},LK={copy:"复制",copied:"已复制",copyCode:"复制代码"},OK={user:"U",error:"错误",tool:"工具",claude:"Claude",cursor:"Cursor",codex:"Codex"},DK={settings:"工具设置",error:"工具错误",result:"工具结果",viewParams:"查看输入参数",viewRawParams:"查看原始参数",viewDiff:"查看编辑差异",creatingFile:"创建新文件:",updatingTodo:"更新待办事项",read:"读取",readFile:"读取文件",updateTodo:"更新待办列表",readTodo:"读取待办列表",searchResults:"结果"},MK={found:"找到 {{count}} 个{{type}}",file:"文件",files:"文件",pattern:"模式:",in:"在:"},FK={updated:"文件更新成功",created:"文件创建成功",written:"文件写入成功",diff:"差异",newFile:"新文件",viewContent:"查看文件内容",viewFullOutput:"查看完整输出({{count}} 个字符)",contentDisplayed:"文件内容显示在上面的差异视图中"},PK={title:"交互式提示",waiting:"等待您在 CLI 中响应",instruction:"请在 Claude 运行的终端中选择一个选项。",selectedOption:"✓ Claude 选择了选项 {{number}}",instructionDetail:"在 CLI 中,您可以使用方向键或输入数字来交互式地选择此选项。"},BK={title:"思考中...",emoji:"💭 思考中..."},zK={response:"JSON 响应"},UK={grant:"授予 {{tool}} 权限",added:"权限已添加",addTo:"将 {{entry}} 添加到允许的工具。",retry:"权限已保存。重试请求以使用该工具。",error:"无法更新权限。请重试。",openSettings:"打开设置"},$K={updated:"待办列表已成功更新",current:"当前待办列表"},qK={viewPlan:"📋 查看实施计划",title:"实施计划"},GK={resetAt:"Claude 使用限制已达到。您的限制将在 **{{time}} {{timezone}}** - {{date}} 重置"},HK={permissionMode:"权限模式",modes:{default:"默认模式",acceptEdits:"编辑模式",bypassPermissions:"无限制模式",plan:"计划模式"},descriptions:{default:"只有受信任的命令(ls、cat、grep、git status 等)自动运行。其他命令将被跳过。可以写入工作区。",acceptEdits:"工作区内的所有命令自动运行。完全自动模式,具有沙盒执行功能。",bypassPermissions:"完全的系统访问,无限制。所有命令自动运行,具有完整的磁盘和网络访问权限。请谨慎使用。",plan:"计划模式 - 不执行任何命令"},technicalDetails:"技术细节"},WK={placeholder:"输入 / 调用命令,@ 选择文件,或向 {{provider}} 提问...",placeholderDefault:"输入您的消息...",disabled:"输入已禁用",attachFiles:"附加文件",attachImages:"附加图片",send:"发送",stop:"停止",hintText:{ctrlEnter:"Ctrl+Enter 发送 • Shift+Enter 换行 • Tab 切换模式 • / 斜杠命令",enter:"Enter 发送 • Shift+Enter 换行 • Tab 切换模式 • / 斜杠命令"},clickToChangeMode:"点击更改权限模式(或在输入框中按 Tab)",showAllCommands:"显示所有命令",dynamicContext:{systemChip:"系统上下文",removeSystem:"移除系统上下文",removeCurrentFile:"移除当前文件",removeElement:"移除选中元素",elementFallback:"元素"}},VK={selector:{title:"思考模式",description:"扩展思考给 Claude 更多时间来评估替代方案",active:"激活",tip:"更高的思考模式需要更多时间,但提供更彻底的分析"},modes:{none:{name:"标准",description:"常规 Claude 响应",prefix:""},think:{name:"思考",description:"基本扩展思考",prefix:"思考"},thinkHard:{name:"深入思考",description:"更彻底的评估",prefix:"深入思考"},thinkHarder:{name:"更深入思考",description:"考虑替代方案的深度分析",prefix:"更深入思考"},ultrathink:{name:"超级思考",description:"最大思考预算",prefix:"超级思考"}},buttonTitle:"思考模式:{{mode}}"},KK={title:"选择你的 AI 助手",description:"需提前安装对应的软件",selectModel:"选择模型",providerInfo:{anthropic:"Anthropic",openai:"OpenAI",cursorEditor:"AI 代码编辑器"},readyPrompt:{claude:"已准备好使用 Claude {{model}}。在下方输入您的消息。",cursor:"已准备好使用 Cursor {{model}}。在下方输入您的消息。",codex:"已准备好使用 Codex {{model}}。在下方输入您的消息。",default:"请在上方选择一个供应商以开始"}},YK={continue:{title:"继续您的对话",description:"询问有关代码的问题、请求更改或获取开发任务的帮助"},loading:{olderMessages:"正在加载更早的消息...",sessionMessages:"正在加载会话消息..."},messages:{showingOf:"显示 {{shown}} / {{total}} 条消息",scrollToLoad:"向上滚动以加载更多",showingLast:"显示最近 {{count}} 条消息(共 {{total}} 条)",loadEarlier:"加载更早的消息"}},XK={selectProject:{title:"选择项目",description:"选择一个项目以在该目录中打开交互式 Shell"},status:{newSession:"新会话",initializing:"初始化中...",restarting:"重启中..."},actions:{disconnect:"断开连接",disconnectTitle:"断开 Shell 连接",restart:"重启",restartTitle:"重启 Shell(请先断开连接)",connect:"在 Shell 中继续",connectTitle:"连接到 Shell"},loading:"正在加载终端...",connecting:"正在连接到 Shell...",startSession:"启动新的 Claude 会话",resumeSession:"恢复会话:{{displayName}}...",runCommand:"在 {{projectName}} 中运行 {{command}}",startCli:"在 {{projectName}} 中启动 Claude CLI",defaultCommand:"命令"},ZK={codeBlock:LK,messageTypes:OK,tools:DK,search:MK,fileOperations:FK,interactive:PK,thinking:BK,json:zK,permissions:UK,todo:$K,plan:qK,usageLimit:GK,codex:HK,input:WK,thinkingMode:VK,providerSelection:KK,session:YK,shell:XK},JK={changes:"个更改",previousChange:"上一个更改",nextChange:"下一个更改",hideDiff:"隐藏差异高亮",showDiff:"显示差异高亮",settings:"编辑器设置",collapse:"折叠编辑器",expand:"展开编辑器到全宽"},QK="正在加载 {{fileName}}...",eY={showingChanges:"显示更改"},tY={download:"下载文件",save:"保存",saving:"保存中...",saved:"已保存!",exitFullscreen:"退出全屏",fullscreen:"全屏",close:"关闭"},rY={lines:"行数:",characters:"字符数:",shortcuts:"按 Ctrl+S 保存 • Esc 关闭"},nY={toolbar:JK,loading:QK,header:eY,actions:tY,footer:rY},aY=()=>{try{const e=localStorage.getItem("userLanguage");return e&&lg.some(t=>t.value===e)?e:"zh-CN"}catch{return"zh-CN"}};kr.use(Z3).use(pA).init({resources:{en:{common:_W,settings:ZW,auth:tV,sidebar:mV,chat:_V,codeEditor:PV},"zh-CN":{common:ZV,settings:fK,auth:vK,sidebar:_K,chat:ZK,codeEditor:nY}},lng:aY(),fallbackLng:"en",debug:!1,ns:["common","settings","auth","sidebar","chat","codeEditor"],defaultNS:"common",keySeparator:".",nsSeparator:":",saveMissing:!1,interpolation:{escapeValue:!1},react:{useSuspense:!0,bindI18n:"languageChanged",bindI18nStore:!1},detection:{order:["localStorage"],lookupLocalStorage:"userLanguage",caches:["localStorage"]}});kr.on("languageChanged",e=>{try{localStorage.setItem("userLanguage",e)}catch(t){console.error("Failed to save language preference:",t)}});function B4(){const e=H5(),{sessionId:t}=W5(),[r]=V5(),{t:n}=Kt("common");b.useRef(0);const{updateAvailable:a,latestVersion:s,currentVersion:o,releaseInfo:l}=W3("lintendo","Axhub-Genie"),[c,u]=b.useState(!1),[d,p]=b.useState([]),[h,m]=b.useState(null),[g,f]=b.useState(null),[k,S]=b.useState("chat"),[v,w]=b.useState(!1),A=v&&!1,[I,E]=b.useState(!1),[C,M]=b.useState(!0),[O,j]=b.useState(null),[G,V]=b.useState(!1),[D,P]=b.useState(!1),[B,F]=b.useState("agents"),[$,H]=b.useState(!1),[ne,N]=li("autoExpandTools",!1),[z,re]=li("showRawParameters",!1),[R,K]=li("showThinking",!0),[pe,ve]=li("autoScrollToBottom",!0),[oe,Ie]=li("sendByCtrlEnter",!1),[ce,ye]=li("sidebarVisible",!0),[_e,qe]=b.useState(!1),[Ke,xt]=b.useState(new Set),[dt,St]=b.useState(new Set),[ft,pt]=b.useState(0),Le=b.useRef({selectionKey:null}),et=r.get("cwd")||r.get("workdir"),yt=r.get("project")||r.get("projectName"),be=r.get("provider")||r.get("tool")||r.get("cli"),Ge=r.get("model"),he=r.get("context"),Ee=r.get("prompt"),ie=d.find(le=>!!(et&&(le.fullPath===et||le.path===et)||yt&&(le.fullPath===yt||le.path===yt)))?.name||null,fe=b.useCallback((le,ge)=>{const ke=r.toString(),W=ke?`${le}?${ke}`:le;e(W,ge)},[e,r]),{ws:De,sendMessage:Ye,latestMessage:mt}=NS(),tt=b.useRef(null),[jt,$e]=b.useState(!1);b.useEffect(()=>{const le=()=>{const ge=window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone||document.referrer.includes("android-app://");$e(ge),document.addEventListener("touchstart",{}),ge?(document.documentElement.classList.add("pwa-mode"),document.body.classList.add("pwa-mode")):(document.documentElement.classList.remove("pwa-mode"),document.body.classList.remove("pwa-mode"))};return le(),window.matchMedia("(display-mode: standalone)").addEventListener("change",le),()=>{window.matchMedia("(display-mode: standalone)").removeEventListener("change",le)}},[]),b.useEffect(()=>{const le=()=>{w(window.innerWidth<768)};return le(),window.addEventListener("resize",le),()=>window.removeEventListener("resize",le)},[]),b.useEffect(()=>{vt()},[]),b.useEffect(()=>{if(!et&&!yt||d.length===0)return;const le=`${et||""}::${yt||""}`;if(Le.current.selectionKey===le)return;if(g){Le.current.selectionKey=le;return}let ge=null;if(et&&(ge=d.find(ke=>ke.fullPath===et||ke.path===et)),!ge&&yt){const ke=yt.trim().toLowerCase();ge=d.find(W=>[W.name,W.displayName,W.path,W.fullPath].some(te=>typeof te=="string"&&te.toLowerCase()===ke))}ge&&m(ge),Le.current.selectionKey=le},[et,yt,d,g]);const _t=(le,ge,ke,W)=>{if(!ke||!W)return!0;const se=le?.find(er=>er.name===ke.name),te=ge?.find(er=>er.name===ke.name);if(!se||!te)return!1;const Be=se.sessions?.find(er=>er.id===W.id),At=te.sessions?.find(er=>er.id===W.id);return!Be||!At?!1:Be.id===At.id&&Be.title===At.title&&Be.created_at===At.created_at&&Be.updated_at===At.updated_at};b.useEffect(()=>{if(mt){if(mt.type==="loading_progress"){tt.current&&(clearTimeout(tt.current),tt.current=null),j(mt),mt.phase==="complete"&&(tt.current=setTimeout(()=>{j(null),tt.current=null},500));return}if(mt.type==="projects_updated"){if(mt.changedFile&&g&&h){const W=mt.changedFile.replace(/\\/g,"/").split("/");W.length>=2&&W[W.length-1].replace(".jsonl","")===g.id&&(Ke.has(g.id)||pt(At=>At+1))}if(g&&Ke.has(g.id)||Ke.size>0&&Array.from(Ke).some(ke=>ke.startsWith("new-session-"))){const ke=mt.projects;if(!_t(d,ke,h,g))return}const ge=mt.projects;if(p(ge),h){const ke=ge.find(W=>W.name===h.name);ke&&(JSON.stringify(ke)!==JSON.stringify(h)&&m(ke),g&&([...ke.sessions||[],...ke.codexSessions||[],...ke.cursorSessions||[]].find(te=>te.id===g.id)||f(null)))}}}return()=>{tt.current&&(clearTimeout(tt.current),tt.current=null)}},[mt,h,g,Ke]);const vt=async()=>{try{M(!0);const ge=await(await bt.projects()).json();for(let ke of ge)try{const W=`/api/cursor/sessions?projectPath=${encodeURIComponent(ke.fullPath||ke.path)}`,se=await Ae(W);if(se.ok){const te=await se.json();te.success&&te.sessions?ke.cursorSessions=te.sessions:ke.cursorSessions=[]}else ke.cursorSessions=[]}catch(W){console.error(`Error fetching Cursor sessions for project ${ke.name}:`,W),ke.cursorSessions=[]}p(ke=>ke.length===0||ge.some((se,te)=>{const Be=ke[te];return Be?se.name!==Be.name||se.displayName!==Be.displayName||se.fullPath!==Be.fullPath||JSON.stringify(se.sessionMeta)!==JSON.stringify(Be.sessionMeta)||JSON.stringify(se.sessions)!==JSON.stringify(Be.sessions)||JSON.stringify(se.cursorSessions)!==JSON.stringify(Be.cursorSessions):!0})||ge.length!==ke.length?ge:ke)}catch(le){console.error("Error fetching projects:",le)}finally{M(!1)}};window.refreshProjects=vt,window.openSettings=b.useCallback((le="tools")=>{F(le),P(!0)},[]),b.useEffect(()=>{if(t&&d.length>0){const le=!g||g.id!==t;for(const ge of d){let ke=ge.sessions?.find(te=>te.id===t);if(ke){m(ge),f({...ke,__provider:"claude"}),le&&S("chat");return}const W=ge.codexSessions?.find(te=>te.id===t);if(W){m(ge),f({...W,__provider:"codex"}),le&&S("chat");return}const se=ge.cursorSessions?.find(te=>te.id===t);if(se){m(ge),f({...se,__provider:"cursor"}),le&&S("chat");return}}}},[t,d,e]);const ut=le=>{m(le),f(null),fe("/"),v&&E(!1)},Ve=le=>{if(f(le),k!=="git"&&k!=="preview"&&S("chat"),(localStorage.getItem("selected-provider")||"claude")==="cursor"&&sessionStorage.setItem("cursorSessionId",le.id),v){const ke=le.__projectName,W=h?.name;ke!==W&&E(!1)}fe(`/session/${le.id}`)},Xe=le=>{m(le),f(null),S("chat"),fe("/"),v&&E(!1)},ht=le=>{g?.id===le&&(f(null),fe("/")),p(ge=>ge.map(ke=>({...ke,sessions:ke.sessions?.filter(W=>W.id!==le)||[],sessionMeta:{...ke.sessionMeta,total:Math.max(0,(ke.sessionMeta?.total||0)-1)}})))},Gt=async()=>{try{const ge=await(await bt.projects()).json();if(p(ke=>ge.some((se,te)=>{const Be=ke[te];return Be?se.name!==Be.name||se.displayName!==Be.displayName||se.fullPath!==Be.fullPath||JSON.stringify(se.sessionMeta)!==JSON.stringify(Be.sessionMeta)||JSON.stringify(se.sessions)!==JSON.stringify(Be.sessions):!0})||ge.length!==ke.length?ge:ke),h){const ke=ge.find(W=>W.name===h.name);if(ke&&(JSON.stringify(ke)!==JSON.stringify(h)&&m(ke),g)){const W=ke.sessions?.find(se=>se.id===g.id);W&&JSON.stringify(W)!==JSON.stringify(g)&&f(W)}}}catch(le){console.error("Error refreshing sidebar:",le)}},Ft=le=>{h?.name===le&&(m(null),f(null),fe("/")),p(ge=>ge.filter(ke=>ke.name!==le))},Lt=b.useCallback(le=>{le&&xt(ge=>new Set([...ge,le]))},[]),qt=b.useCallback(le=>{le&&xt(ge=>{const ke=new Set(ge);return ke.delete(le),ke})},[]),ar=b.useCallback(le=>{le&&St(ge=>new Set([...ge,le]))},[]),vr=b.useCallback(le=>{le&&St(ge=>{const ke=new Set(ge);return ke.delete(le),ke})},[]),Q=b.useCallback(le=>{le&&xt(ge=>{const ke=new Set;for(const W of ge)W.startsWith("new-session-")||ke.add(W);return ke.add(le),ke})},[]),Pe=()=>{const{t:le}=Kt("common"),[ge,ke]=b.useState(!1),[W,se]=b.useState(""),[te,Be]=b.useState("");if(!c)return null;const At=er=>er?er.replace(/\b[0-9a-f]{40}\b/gi,"").replace(/(?:^|\s|-)([0-9a-f]{7,10})\b/gi,"").replace(/\*\*Full Changelog\*\*:.*$/gim,"").replace(/https?:\/\/github\.com\/[^\/]+\/[^\/]+\/compare\/[^\s)]+/gi,"").replace(/\n\s*\n\s*\n/g,`
1239
1239
 
1240
1240
  `).trim():"",ur=async()=>{ke(!0),se(`Starting update...
1241
1241
  `),Be("");try{const er=await Ae("/api/system/update",{method:"POST"}),wr=await er.json();er.ok?(se(Ir=>Ir+wr.output+`