@pixelbyte-software/pixcode 1.40.10 → 1.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{index-DeZLXqLz.js → index-DPzxZAAM.js} +3 -3
- package/dist/index.html +1 -1
- package/dist-server/server/routes/settings.js +11 -0
- package/dist-server/server/routes/settings.js.map +1 -1
- package/dist-server/server/services/notification-orchestrator.js +48 -16
- package/dist-server/server/services/notification-orchestrator.js.map +1 -1
- package/dist-server/server/services/notification-taxonomy.js +177 -0
- package/dist-server/server/services/notification-taxonomy.js.map +1 -0
- package/package.json +1 -1
- package/scripts/smoke/notification-taxonomy.mjs +58 -0
- package/server/routes/settings.js +11 -0
- package/server/services/notification-orchestrator.js +58 -15
- package/server/services/notification-taxonomy.js +204 -0
|
@@ -6,7 +6,7 @@ import{j as i,a as T4,R as hf,o as ff,_ as bj,b as xj,m as j4,E as Nn,T as _4,P
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Rv;function T_(){if(Rv)return Fu;Rv=1;var e=Mj();function t(p,f){return p===f&&(p!==0||1/p===1/f)||p!==p&&f!==f}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,a=e.useEffect,s=e.useLayoutEffect,o=e.useDebugValue;function l(p,f){var m=f(),g=n({inst:{value:m,getSnapshot:f}}),b=g[0].inst,x=g[1];return s(function(){b.value=m,b.getSnapshot=f,c(b)&&x({inst:b})},[p,m,f]),a(function(){return c(b)&&x({inst:b}),p(function(){c(b)&&x({inst:b})})},[p]),o(m),m}function c(p){var f=p.getSnapshot;p=p.value;try{var m=f();return!r(p,m)}catch{return!0}}function d(p,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return Fu.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Fu}var Lv;function j_(){return Lv||(Lv=1,Pu.exports=T_()),Pu.exports}var __=j_();const I_=(e,t)=>{if(Hi(t))return t;if(b_(t)&&Hi(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const r=e[e.length-1];return typeof r=="function"?"":r}return e},R_={t:I_,ready:!1},L_=()=>()=>{},Me=(e,t={})=>{const{i18n:r}=t,{i18n:n,defaultNS:a}=h.useContext(B4)||{},s=r||n||N_();s&&!s.reportNamespaces&&(s.reportNamespaces=new A_),s||Fm(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const o=h.useMemo(()=>({...S_(),...s?.options?.react,...t}),[s,t]),{useSuspense:l,keyPrefix:c}=o,d=e||a||s?.options?.defaultNS,u=Hi(d)?[d]:d||["translation"],p=h.useMemo(()=>u,u);s?.reportNamespaces?.addUsedNamespaces?.(p);const f=h.useRef(0),m=h.useCallback(T=>{if(!s)return L_;const{bindI18n:C,bindI18nStore:L}=o,A=()=>{f.current+=1,T()};return C&&s.on(C,A),L&&s.store.on(L,A),()=>{C&&C.split(" ").forEach(I=>s.off(I,A)),L&&L.split(" ").forEach(I=>s.store.off(I,A))}},[s,o]),g=h.useRef(),b=h.useCallback(()=>{if(!s)return R_;const T=!!(s.isInitialized||s.initializedStoreOnce)&&p.every(P=>g_(P,s,o)),C=t.lng||s.language,L=f.current,A=g.current;if(A&&A.ready===T&&A.lng===C&&A.keyPrefix===c&&A.revision===L)return A;const N={t:s.getFixedT(C,o.nsMode==="fallback"?p:p[0],c),ready:T,lng:C,keyPrefix:c,revision:L};return g.current=N,N},[s,p,c,o,t.lng]),[x,y]=h.useState(0),{t:v,ready:w}=__.useSyncExternalStore(m,b,b);h.useEffect(()=>{if(s&&!w&&!l){const T=()=>y(C=>C+1);t.lng?Iv(s,t.lng,p,T):zm(s,p,T)}},[s,t.lng,p,w,l,x]);const k=s||{},E=h.useRef(null),S=h.useRef(),j=T=>{const C=Object.getOwnPropertyDescriptors(T);C.__original&&delete C.__original;const L=Object.create(Object.getPrototypeOf(T),C);if(!Object.prototype.hasOwnProperty.call(L,"__original"))try{Object.defineProperty(L,"__original",{value:T,writable:!1,enumerable:!1,configurable:!1})}catch{}return L},_=h.useMemo(()=>{const T=k,C=T?.language;let L=T;T&&(E.current&&E.current.__original===T?S.current!==C?(L=j(T),E.current=L,S.current=C):L=E.current:(L=j(T),E.current=L,S.current=C));const A=!w&&!l?(...N)=>(Fm(s,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),v(...N)):v,I=[A,L,w];return I.t=A,I.i18n=L,I.ready=w,I},[v,k,w,k.resolvedLanguage,k.language,k.languages]);if(s&&l&&!w)throw new Promise(T=>{const C=()=>T();t.lng?Iv(s,t.lng,p,C):zm(s,p,C)});return _};function D_({i18n:e,defaultNS:t,children:r}){const n=h.useMemo(()=>({i18n:e,defaultNS:t}),[e,t]);return h.createElement(B4.Provider,{value:n},r)}const $4="pixcode.theme.accent",Dv="pixcode.theme.customLight",Ov="pixcode.theme.customDark",U4="#059669",G4="#10b981",dl=[{id:"emerald",label:"Emerald",light:"#059669",dark:"#10b981"},{id:"vscode",label:"VS Code",light:"#007acc",dark:"#007acc",darkBackground:"215 28% 7%",darkCard:"215 25% 10%",darkMuted:"215 18% 16%"},{id:"blue",label:"Blue",light:"#2563eb",dark:"#60a5fa"},{id:"violet",label:"Violet",light:"#7c3aed",dark:"#a78bfa"},{id:"amber",label:"Amber",light:"#d97706",dark:"#f59e0b"},{id:"rose",label:"Rose",light:"#e11d48",dark:"#fb7185"},{id:"custom",label:"Custom",light:U4,dark:G4}],O_="emerald";function M_(e){return typeof e=="string"&&dl.some(t=>t.id===e)}function P_(){const e=localStorage.getItem($4);return M_(e)?e:O_}function Mv(e,t){const r=localStorage.getItem(e);return r&&/^#[0-9a-fA-F]{6}$/.test(r)?r:t}function F_(e){const t=e.replace("#",""),r=parseInt(t.slice(0,2),16)/255,n=parseInt(t.slice(2,4),16)/255,a=parseInt(t.slice(4,6),16)/255,s=Math.max(r,n,a),o=Math.min(r,n,a);let l=0,c=0;const d=(s+o)/2;if(s!==o){const u=s-o;c=d>.5?u/(2-s-o):u/(s+o),s===r?l=(n-a)/u+(n<a?6:0):s===n?l=(a-r)/u+2:l=(r-n)/u+4,l/=6}return`${Math.round(l*360)} ${Math.round(c*100)}% ${Math.round(d*100)}%`}function z_(e){const t=e.replace("#",""),r=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),a=parseInt(t.slice(4,6),16);return(.2126*r+.7152*n+.0722*a)/255>.58?"160 18% 6%":"210 40% 98%"}function B_(e,t,r,n,a){const s=dl.find(c=>c.id===t)??dl[0],o=t==="custom"?r?a:n:r?s.dark:s.light,l=F_(o);return e.style.setProperty("--primary",l),e.style.setProperty("--ring",l),e.style.setProperty("--primary-foreground",z_(o)),e.style.setProperty("--nav-tab-glow",`${l} / ${r?"0.25":"0.18"}`),e.style.setProperty("--nav-tab-ring",`${l} / ${r?"0.15":"0.10"}`),e.style.setProperty("--nav-input-focus-ring",`${l} / ${r?"0.25":"0.22"}`),r&&s.darkBackground?(e.style.setProperty("--background",s.darkBackground),e.style.setProperty("--card",s.darkCard??s.darkBackground),e.style.setProperty("--popover",s.darkCard??s.darkBackground),e.style.setProperty("--muted",s.darkMuted??s.darkCard??s.darkBackground),e.style.setProperty("--secondary",s.darkMuted??s.darkCard??s.darkBackground),e.style.setProperty("--accent",s.darkMuted??s.darkCard??s.darkBackground)):["--background","--card","--popover","--muted","--secondary","--accent"].forEach(c=>{e.style.removeProperty(c)}),o}const H4=h.createContext(),Oa=()=>{const e=h.useContext(H4);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e},$_=({children:e})=>{const[t,r]=h.useState(()=>{const g=localStorage.getItem("theme");return g?g==="dark":window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)").matches:!1}),[n,a]=h.useState(P_),[s,o]=h.useState(()=>Mv(Dv,U4)),[l,c]=h.useState(()=>Mv(Ov,G4));h.useEffect(()=>{const g=B_(document.documentElement,n,t,s,l);if(t){document.documentElement.classList.add("dark"),localStorage.setItem("theme","dark");const b=document.querySelector('meta[name="apple-mobile-web-app-status-bar-style"]');b&&b.setAttribute("content","black-translucent");const x=document.querySelector('meta[name="theme-color"]');x&&x.setAttribute("content",g)}else{document.documentElement.classList.remove("dark"),localStorage.setItem("theme","light");const b=document.querySelector('meta[name="apple-mobile-web-app-status-bar-style"]');b&&b.setAttribute("content","default");const x=document.querySelector('meta[name="theme-color"]');x&&x.setAttribute("content",g)}},[n,l,s,t]),h.useEffect(()=>{if(!window.matchMedia)return;const g=window.matchMedia("(prefers-color-scheme: dark)"),b=x=>{localStorage.getItem("theme")||r(x.matches)};return g.addEventListener("change",b),()=>g.removeEventListener("change",b)},[]);const m={isDarkMode:t,toggleDarkMode:()=>{r(g=>!g)},accentTheme:n,setAccentTheme:g=>{a(g),localStorage.setItem($4,g)},customLightAccent:s,setCustomLightAccent:g=>{o(g),localStorage.setItem(Dv,g)},customDarkAccent:l,setCustomDarkAccent:g=>{c(g),localStorage.setItem(Ov,g)}};return i.jsx(H4.Provider,{value:m,children:e})},U_=!1,G_={name:"default",displayName:"default",fullPath:"",path:""},ve=(e,t={})=>{const r=localStorage.getItem("auth-token"),n={};return t.body instanceof FormData||(n["Content-Type"]="application/json"),r&&(n.Authorization=`Bearer ${r}`),fetch(e,{...t,headers:{...n,...t.headers}}).then(a=>{const s=a.headers.get("X-Refreshed-Token");return s&&localStorage.setItem("auth-token",s),a})},ot={auth:{status:()=>fetch("/api/auth/status"),connectionMode:()=>fetch("/api/auth/connection-mode"),updateConnectionMode:e=>fetch("/api/auth/connection-mode",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),login:(e,t)=>fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t})}),register:(e,t)=>fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t})}),user:()=>ve("/api/auth/user"),logout:()=>ve("/api/auth/logout",{method:"POST"})},publicApiManifest:()=>ve("/api/public/manifest"),diagnostics:()=>ve("/api/diagnostics"),refreshDiagnostics:()=>ve("/api/diagnostics/refresh",{method:"POST"}),remoteConnection:()=>ve("/api/remote/config"),updateRemoteConnection:e=>ve("/api/remote/config",{method:"PUT",body:JSON.stringify(e)}),projects:()=>ve("/api/projects"),sessions:(e,t=5,r=0)=>ve(`/api/projects/${e}/sessions?limit=${t}&offset=${r}`),unifiedSessionMessages:(e,t="claude",{projectName:r="",projectPath:n="",limit:a=null,offset:s=0}={})=>{const o=new URLSearchParams;o.append("provider",t),r&&o.append("projectName",r),n&&o.append("projectPath",n),a!==null&&(o.append("limit",String(a)),o.append("offset",String(s)));const l=o.toString();return ve(`/api/sessions/${encodeURIComponent(e)}/messages${l?`?${l}`:""}`)},renameProject:(e,t)=>ve(`/api/projects/${e}/rename`,{method:"PUT",body:JSON.stringify({displayName:t})}),deleteSession:(e,t)=>ve(`/api/projects/${e}/sessions/${t}`,{method:"DELETE"}),renameSession:(e,t,r)=>ve(`/api/sessions/${e}/rename`,{method:"PUT",body:JSON.stringify({summary:t,provider:r})}),deleteCodexSession:e=>ve(`/api/codex/sessions/${e}`,{method:"DELETE"}),deleteGeminiSession:e=>ve(`/api/gemini/sessions/${e}`,{method:"DELETE"}),deleteQwenSession:e=>ve(`/api/qwen/sessions/${e}`,{method:"DELETE"}),deleteProject:(e,t=!1,r=!1)=>{const n=new URLSearchParams;t&&n.set("force","true"),r&&n.set("deleteData","true");const a=n.toString();return ve(`/api/projects/${e}${a?`?${a}`:""}`,{method:"DELETE"})},searchConversationsUrl:(e,t=50)=>{const r=localStorage.getItem("auth-token"),n=new URLSearchParams({q:e,limit:String(t)});return r&&n.set("token",r),`/api/search/conversations?${n.toString()}`},createWorkspace:e=>ve("/api/projects/create-workspace",{method:"POST",body:JSON.stringify(e)}),quickStartProject:()=>ve("/api/projects/quick-start",{method:"POST",body:"{}"}),readFile:(e,t)=>ve(`/api/projects/${e}/file?filePath=${encodeURIComponent(t)}`),readFileBlob:(e,t)=>ve(`/api/projects/${e}/files/content?path=${encodeURIComponent(t)}`),saveFile:(e,t,r)=>ve(`/api/projects/${e}/file`,{method:"PUT",body:JSON.stringify({filePath:t,content:r})}),getFiles:(e,t={})=>ve(`/api/projects/${e}/files`,t),createFile:(e,{path:t,type:r,name:n})=>ve(`/api/projects/${e}/files/create`,{method:"POST",body:JSON.stringify({path:t,type:r,name:n})}),renameFile:(e,{oldPath:t,newName:r})=>ve(`/api/projects/${e}/files/rename`,{method:"PUT",body:JSON.stringify({oldPath:t,newName:r})}),deleteFile:(e,{path:t,type:r})=>ve(`/api/projects/${e}/files`,{method:"DELETE",body:JSON.stringify({path:t,type:r})}),uploadFiles:(e,t)=>ve(`/api/projects/${e}/files/upload`,{method:"POST",body:t,headers:{}}),taskmaster:{init:e=>ve(`/api/taskmaster/init/${e}`,{method:"POST"}),addTask:(e,{prompt:t,title:r,description:n,priority:a,dependencies:s})=>ve(`/api/taskmaster/add-task/${e}`,{method:"POST",body:JSON.stringify({prompt:t,title:r,description:n,priority:a,dependencies:s})}),parsePRD:(e,{fileName:t,numTasks:r,append:n})=>ve(`/api/taskmaster/parse-prd/${e}`,{method:"POST",body:JSON.stringify({fileName:t,numTasks:r,append:n})}),getTemplates:()=>ve("/api/taskmaster/prd-templates"),applyTemplate:(e,{templateId:t,fileName:r,customizations:n})=>ve(`/api/taskmaster/apply-template/${e}`,{method:"POST",body:JSON.stringify({templateId:t,fileName:r,customizations:n})}),updateTask:(e,t,r)=>ve(`/api/taskmaster/update-task/${e}/${t}`,{method:"PUT",body:JSON.stringify(r)})},browseFilesystem:(e=null)=>{const t=new URLSearchParams;return e&&t.append("path",e),ve(`/api/browse-filesystem?${t}`)},createFolder:e=>ve("/api/create-folder",{method:"POST",body:JSON.stringify({path:e})}),user:{gitConfig:()=>ve("/api/user/git-config"),updateGitConfig:(e,t)=>ve("/api/user/git-config",{method:"POST",body:JSON.stringify({gitName:e,gitEmail:t})}),onboardingStatus:()=>ve("/api/user/onboarding-status"),completeOnboarding:()=>ve("/api/user/complete-onboarding",{method:"POST"})},get:e=>ve(`/api${e}`),post:(e,t)=>ve(`/api${e}`,{method:"POST",...t instanceof FormData?{body:t}:{body:JSON.stringify(t)}}),put:(e,t)=>ve(`/api${e}`,{method:"PUT",body:JSON.stringify(t)}),delete:(e,t={})=>ve(`/api${e}`,{method:"DELETE",...t})},Ud="auth-token",yi={authStatusCheckFailed:"Failed to check authentication status",loginFailed:"Login failed",registrationFailed:"Registration failed",networkError:"Network error. Please try again."};async function So(e){try{return await e.json()}catch{return null}}function Pv(e,t){return e?e.error??e.message??t:t}const V4=h.createContext(null),H_=()=>localStorage.getItem(Ud),V_=e=>{localStorage.setItem(Ud,e)},q_=()=>{localStorage.removeItem(Ud)};function Ki(){const e=h.useContext(V4);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function W_({children:e}){const[t,r]=h.useState(null),[n,a]=h.useState(()=>H_()),[s,o]=h.useState(!0),[l,c]=h.useState(!1),[d,u]=h.useState(!0),[p,f]=h.useState(null),m=h.useCallback((S,j)=>{r(S),a(j),V_(j)},[]),g=h.useCallback(()=>{r(null),a(null),q_()},[]),b=h.useCallback(async()=>{try{const S=await ot.user.onboardingStatus();if(!S.ok)return;const j=await So(S);u(!!j?.hasCompletedOnboarding)}catch(S){console.error("Error checking onboarding status:",S),u(!0)}},[]),x=h.useCallback(async()=>{await b()},[b]),y=h.useCallback(async()=>{try{o(!0),f(null);const S=await ot.auth.status();if((await So(S))?.needsSetup){c(!0);return}if(c(!1),!n)return;const _=await ot.auth.user();if(!_.ok){g();return}const T=await So(_);if(!T?.user){g();return}r(T.user),await b()}catch(S){console.error("[Auth] Auth status check failed:",S),f(yi.authStatusCheckFailed)}finally{o(!1)}},[b,g,n]);h.useEffect(()=>{y()},[y,b]);const v=h.useCallback(async(S,j)=>{try{f(null);const _=await ot.auth.login(S,j),T=await So(_);if(!_.ok||!T?.token||!T.user){const C=Pv(T,yi.loginFailed);return f(C),{success:!1,error:C}}return m(T.user,T.token),c(!1),await b(),{success:!0}}catch(_){return console.error("Login error:",_),f(yi.networkError),{success:!1,error:yi.networkError}}},[b,m]),w=h.useCallback(async(S,j)=>{try{f(null);const _=await ot.auth.register(S,j),T=await So(_);if(!_.ok||!T?.token||!T.user){const C=Pv(T,yi.registrationFailed);return f(C),{success:!1,error:C}}return m(T.user,T.token),c(!1),await b(),{success:!0}}catch(_){return console.error("Registration error:",_),f(yi.networkError),{success:!1,error:yi.networkError}}},[b,m]),k=h.useCallback(()=>{const S=n;g(),S&&ot.auth.logout().catch(j=>{console.error("Logout endpoint error:",j)})},[g,n]),E=h.useMemo(()=>({user:t,token:n,isLoading:s,needsSetup:l,hasCompletedOnboarding:d,error:p,login:v,register:w,logout:k,refreshOnboardingStatus:x}),[p,d,s,v,k,l,x,w,n,t]);return i.jsx(V4.Provider,{value:E,children:e})}const K_="pixcode.notification.once.",q4="pixcode.notificationPreferences.v1",Y_={action_required:"actionRequired",stop:"stop",error:"error",update:"updates",updates:"updates"};function Z_(e="updates"){try{const t=JSON.parse(localStorage.getItem(q4)??"null");return t?.channels?.desktop===!1?!1:t?.events?.[Y_[e]||e]!==!1}catch{return!0}}function is(e){try{localStorage.setItem(q4,JSON.stringify(e)),window.dispatchEvent(new CustomEvent("pixcode:notification-preferences-changed"))}catch{}}async function W4({key:e,title:t,body:r,tag:n,data:a}){return K4({key:e,title:t,body:r,event:"updates",tag:n,data:a})}async function K4({key:e,title:t,body:r,event:n="updates",tag:a,data:s}){if(typeof window>"u"||!Z_(n))return!1;const o=`${K_}${e}`;try{if(localStorage.getItem(o))return!1}catch{}try{if(await window.pixcodeDesktop?.notify({title:t,body:r,event:n,tag:a,data:s})){try{localStorage.setItem(o,new Date().toISOString())}catch{}return!0}}catch(c){console.warn("Desktop notification bridge failed:",c)}if(!("Notification"in window)||Notification.permission!=="granted")return!1;const l={body:r,icon:"/logo-256.png",badge:"/logo-128.png",tag:a,data:s,renotify:!!a};try{const c="serviceWorker"in navigator?await navigator.serviceWorker.ready.catch(()=>null):null;c?.showNotification?await c.showNotification(t,l):new Notification(t,l);try{localStorage.setItem(o,new Date().toISOString())}catch{}return!0}catch(c){return console.warn("Local notification failed:",c),!1}}const Y4={claude:"npm install -g @anthropic-ai/claude-code",cursor:"curl https://cursor.com/install -fsSL | bash",codex:"npm install -g @openai/codex",gemini:"npm install -g @google/gemini-cli",qwen:"npm install -g @qwen-code/qwen-code",opencode:"npm install -g opencode-ai"},ul={claude:"Claude Code",cursor:"Cursor CLI",codex:"OpenAI Codex",gemini:"Gemini CLI",qwen:"Qwen Code",opencode:"OpenCode"},Z4=["claude","cursor","codex","gemini","qwen","opencode"],Fv={claude:"/api/providers/claude/auth/status",cursor:"/api/providers/cursor/auth/status",codex:"/api/providers/codex/auth/status",gemini:"/api/providers/gemini/auth/status",qwen:"/api/providers/qwen/auth/status",opencode:"/api/providers/opencode/auth/status"},zv=(e=!0)=>({claude:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null},cursor:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null},codex:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null},gemini:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null},qwen:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null},opencode:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null}}),X_="Failed to check authentication status",J_="Unknown error",X4="pixcode.providerAuthStatus.cache.v2",Mc=1440*60*1e3,Q_=3600*1e3;let Bv=0;const eI=e=>e instanceof Error?e.message:J_,tI=(e,t=null)=>({authenticated:!!e.authenticated,installed:typeof e.installed=="boolean"?e.installed:null,email:e.email??null,method:e.method??null,error:e.error??t,loading:!1,checkedAt:e.checkedAt??new Date().toISOString(),installedVersion:e.installedVersion??null,latestVersion:e.latestVersion??null,updateAvailable:!!e.updateAvailable,versionCheckSkipped:e.versionCheckSkipped??null,fromCache:!!e.fromCache});function $m(){try{const e=JSON.parse(localStorage.getItem(X4)??"null");return!e||typeof e.savedAt!="number"||!e.statuses?null:e}catch{return null}}function rI(e){try{localStorage.setItem(X4,JSON.stringify({savedAt:Date.now(),statuses:e}))}catch{}}function nI(e){const t=$m(),r=zv(!1);return t&&Date.now()-t.savedAt<Mc?Object.fromEntries(Z4.map(n=>[n,{...r[n],...t.statuses[n],loading:!1,fromCache:!0}])):zv(e)}function $v(e,t){if(!t.updateAvailable||!t.latestVersion)return;const r=ul[e]??e,n=t.installedVersion?` ${t.installedVersion}`:"";W4({key:`cli-update:${e}:${t.latestVersion}`,title:`${r} update available`,body:`${r}${n} can update to ${t.latestVersion}.`,tag:`pixcode-cli-update:${e}`,data:{type:"cli-update",provider:e,latestVersion:t.latestVersion}})}function yf({initialLoading:e=!0}={}){const[t,r]=h.useState(()=>nI(e)),n=h.useCallback(l=>{r(c=>({...c,[l]:{...c[l],loading:!0,error:null}}))},[]),a=h.useCallback((l,c)=>{r(d=>({...d,[l]:c}))},[]),s=h.useCallback(async(l,c={})=>{const d=$m(),u=d?.statuses?.[l];if(!c.force&&d&&u&&Date.now()-d.savedAt<Mc){const p={...u,loading:!1,fromCache:!0};a(l,p),$v(l,p);return}n(l);try{const p=c.force?`${Fv[l]}?refresh=1`:Fv[l],f=await ve(p,{cache:"no-store"});if(!f.ok){a(l,{authenticated:!1,installed:null,email:null,method:null,loading:!1,error:X_});return}const m=await f.json(),g=tI(m.data);$v(l,g),r(b=>{const x={...b,[l]:g};return rI(x),x})}catch(p){console.error(`Error checking ${l} auth status:`,p),a(l,{authenticated:!1,installed:null,email:null,method:null,loading:!1,error:eI(p)})}},[n,a]),o=h.useCallback(async(l=Z4,c={})=>{await Promise.all(l.map(d=>s(d,c)))},[s]);return h.useEffect(()=>{const l=window.setInterval(()=>{const c=Date.now();if(c-Bv<Mc)return;const d=$m();d&&c-d.savedAt<Mc||(Bv=c,o())},Q_);return()=>window.clearInterval(l)},[o]),{providerAuthStatus:t,setProviderAuthStatus:r,checkProviderAuthStatus:s,refreshProviderAuthStatuses:o}}const J4="https://auth.openai.com/codex/device",aI=200,Q4=100,iI=50,sI=500,oI=20,lI=15,cI=5,dI=2,uI={cursorBlink:!0,fontSize:14,fontFamily:'Menlo, Monaco, "Courier New", monospace',allowProposedApi:!0,allowTransparency:!1,convertEol:!0,scrollback:1e4,tabStopWidth:4,windowsMode:!1,macOptionIsMeta:!0,macOptionClickForcesSelection:!0,theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#ffffff",cursorAccent:"#1e1e1e",selectionBackground:"#264f78",selectionForeground:"#ffffff",black:"#000000",red:"#cd3131",green:"#0dbc79",yellow:"#e5e510",blue:"#2472c8",magenta:"#bc3fbc",cyan:"#11a8cd",white:"#e5e5e5",brightBlack:"#666666",brightRed:"#f14c4c",brightGreen:"#23d18b",brightYellow:"#f5f543",brightBlue:"#3b8eea",brightMagenta:"#d670d6",brightCyan:"#29b8db",brightWhite:"#ffffff",extendedAnsi:["#000000","#800000","#008000","#808000","#000080","#800080","#008080","#c0c0c0","#808080","#ff0000","#00ff00","#ffff00","#0000ff","#ff00ff","#00ffff","#ffffff"]}};function pI(e){if(!e||typeof document>"u")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.opacity="0",t.style.pointerEvents="none",document.body.appendChild(t),t.focus(),t.select();let r=!1;try{r=document.execCommand("copy")}catch{r=!1}finally{document.body.removeChild(t)}return r}async function Cn(e){if(!e)return!1;let t=!1;try{typeof navigator<"u"&&navigator.clipboard?.writeText&&(await navigator.clipboard.writeText(e),t=!0)}catch{t=!1}return t||(t=pI(e)),t}function mI(){const e=window.location.protocol==="https:"?"wss:":"ws:",t=localStorage.getItem("auth-token");return t?`${e}//${window.location.host}/shell?token=${encodeURIComponent(t)}`:(console.error("No authentication token found for Shell WebSocket connection"),null)}function hI(e){try{return JSON.parse(e)}catch{return null}}function Mi(e,t){e&&e.readyState===WebSocket.OPEN&&e.send(JSON.stringify(t))}const fI=/(?:\u001B\[[0-?]*[ -/]*[@-~]|\u009B[0-?]*[ -/]*[@-~]|\u001B\][^\u0007\u001B]*(?:\u0007|\u001B\\)|\u009D[^\u0007\u009C]*(?:\u0007|\u009C)|\u001B[PX^_][^\u001B]*\u001B\\|[\u0090\u0098\u009E\u009F][^\u009C]*\u009C|\u001B[@-Z\\-_])/g,gI=/Process exited with code (\d+)/;function bI({wsRef:e,terminalRef:t,fitAddonRef:r,selectedProjectRef:n,selectedSessionRef:a,initialCommandRef:s,isPlainShellRef:o,onProcessCompleteRef:l,isInitialized:c,autoConnect:d,closeSocket:u,clearTerminalScreen:p,setAuthUrl:f,onOutputRef:m}){const[g,b]=h.useState(!1),[x,y]=h.useState(!1),v=h.useRef(!1),w=h.useRef(!1),k=h.useCallback(T=>{if(!o.current||!l.current)return;const L=T.replace(fI,"");if(L.includes("Process exited with code 0")){l.current(0);return}const A=L.match(gI);if(!A)return;const I=Number.parseInt(A[1],10);!Number.isNaN(I)&&I!==0&&l.current(I)},[o,l]),E=h.useCallback(T=>{const C=hI(T);if(!C){console.error("[Shell] Error handling WebSocket message:",T);return}if(C.type==="output"){const L=typeof C.data=="string"?C.data:"";k(L),t.current?.write(L),m?.current?.();return}if(C.type==="auth_url"||C.type==="url_open"){const L=typeof C.url=="string"?C.url:"";L&&f(L)}},[k,m,f,t]),S=h.useCallback((T=!1)=>{if(!(v.current&&!T||x||g))try{const C=mI();if(!C){v.current=!1,y(!1);return}v.current=!0;const L=new WebSocket(C);e.current=L,L.onopen=()=>{b(!0),y(!1),v.current=!1,f(""),window.setTimeout(()=>{const A=t.current,I=r.current,N=n.current;!A||!I||!N||(I.fit(),Mi(L,{type:"init",projectPath:N.fullPath||N.path||"",sessionId:o.current?null:a.current?.id||null,hasSession:o.current?!1:!!a.current,provider:o.current?"plain-shell":a.current?.__provider||localStorage.getItem("selected-provider")||"claude",cols:A.cols,rows:A.rows,initialCommand:s.current,isPlainShell:o.current}))},Q4)},L.onmessage=A=>{const I=typeof A.data=="string"?A.data:String(A.data??"");E(I)},L.onclose=()=>{b(!1),y(!1),v.current=!1,p()},L.onerror=()=>{b(!1),y(!1),v.current=!1}}catch{b(!1),y(!1),v.current=!1}},[p,r,E,s,g,x,o,n,a,f,t,e]),j=h.useCallback(()=>{!c||g||x||v.current||(w.current=!1,v.current=!0,y(!0),S(!0))},[S,g,x,c]),_=h.useCallback((T=!0)=>{T&&(w.current=!0),u(),p(),b(!1),y(!1),v.current=!1,f("")},[p,u,f]);return h.useEffect(()=>{!d||w.current||!c||x||g||j()},[d,j,g,x,c]),{isConnected:g,isConnecting:x,closeSocket:u,connectToShell:j,disconnectFromShell:_}}var xI=$j(),zu={exports:{}},Uv;function yI(){return Uv||(Uv=1,function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={6:(o,l)=>{function c(u){try{const p=new URL(u),f=p.password&&p.username?`${p.protocol}//${p.username}:${p.password}@${p.host}`:p.username?`${p.protocol}//${p.username}@${p.host}`:`${p.protocol}//${p.host}`;return u.toLocaleLowerCase().startsWith(f.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(l,"__esModule",{value:!0}),l.LinkComputer=l.WebLinkProvider=void 0,l.WebLinkProvider=class{constructor(u,p,f,m={}){this._terminal=u,this._regex=p,this._handler=f,this._options=m}provideLinks(u,p){const f=d.computeLink(u,this._regex,this._terminal,this._handler);p(this._addCallbacks(f))}_addCallbacks(u){return u.map(p=>(p.leave=this._options.leave,p.hover=(f,m)=>{if(this._options.hover){const{range:g}=p;this._options.hover(f,m,g)}},p))}};class d{static computeLink(p,f,m,g){const b=new RegExp(f.source,(f.flags||"")+"g"),[x,y]=d._getWindowedLineStrings(p-1,m),v=x.join("");let w;const k=[];for(;w=b.exec(v);){const E=w[0];if(!c(E))continue;const[S,j]=d._mapStrIdx(m,y,0,w.index),[_,T]=d._mapStrIdx(m,S,j,E.length);if(S===-1||j===-1||_===-1||T===-1)continue;const C={start:{x:j+1,y:S+1},end:{x:T,y:_+1}};k.push({range:C,text:E,activate:g})}return k}static _getWindowedLineStrings(p,f){let m,g=p,b=p,x=0,y="";const v=[];if(m=f.buffer.active.getLine(p)){const w=m.translateToString(!0);if(m.isWrapped&&w[0]!==" "){for(x=0;(m=f.buffer.active.getLine(--g))&&x<2048&&(y=m.translateToString(!0),x+=y.length,v.push(y),m.isWrapped&&y.indexOf(" ")===-1););v.reverse()}for(v.push(w),x=0;(m=f.buffer.active.getLine(++b))&&m.isWrapped&&x<2048&&(y=m.translateToString(!0),x+=y.length,v.push(y),y.indexOf(" ")===-1););}return[v,g]}static _mapStrIdx(p,f,m,g){const b=p.buffer.active,x=b.getNullCell();let y=m;for(;g;){const v=b.getLine(f);if(!v)return[-1,-1];for(let w=y;w<v.length;++w){v.getCell(w,x);const k=x.getChars();if(x.getWidth()&&(g-=k.length||1,w===v.length-1&&k==="")){const E=b.getLine(f+1);E&&E.isWrapped&&(E.getCell(0,x),x.getWidth()===2&&(g+=1))}if(g<0)return[f,w]}f++,y=0}return[f,y]}}l.LinkComputer=d}},n={};function a(o){var l=n[o];if(l!==void 0)return l.exports;var c=n[o]={exports:{}};return r[o](c,c.exports,a),c.exports}var s={};return(()=>{var o=s;Object.defineProperty(o,"__esModule",{value:!0}),o.WebLinksAddon=void 0;const l=a(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(u,p){const f=window.open();if(f){try{f.opener=null}catch{}f.location.href=p}else console.warn("Opening link blocked as opener could not be cleared")}o.WebLinksAddon=class{constructor(u=d,p={}){this._handler=u,this._options=p}activate(u){this._terminal=u;const p=this._options,f=p.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new l.WebLinkProvider(this._terminal,f,this._handler,p))}dispose(){this._linkProvider?.dispose()}}})(),s})())}(zu)),zu.exports}var vI=yI(),wI=Uj(),kI=Gj();function eE(e){return typeof e=="string"&&/\bcodex\s+login\b/i.test(e)}function SI(e,t){return eE(e)?J4:t}function EI(e){return e?e.__provider==="cursor"?e.name||"Untitled Session":e.summary||"New Session":null}const Gv="shell-xterm-focus-style",NI=`
|
|
9
|
+
*/var Rv;function T_(){if(Rv)return Fu;Rv=1;var e=Mj();function t(p,f){return p===f&&(p!==0||1/p===1/f)||p!==p&&f!==f}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,a=e.useEffect,s=e.useLayoutEffect,o=e.useDebugValue;function l(p,f){var m=f(),g=n({inst:{value:m,getSnapshot:f}}),b=g[0].inst,x=g[1];return s(function(){b.value=m,b.getSnapshot=f,c(b)&&x({inst:b})},[p,m,f]),a(function(){return c(b)&&x({inst:b}),p(function(){c(b)&&x({inst:b})})},[p]),o(m),m}function c(p){var f=p.getSnapshot;p=p.value;try{var m=f();return!r(p,m)}catch{return!0}}function d(p,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return Fu.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Fu}var Lv;function j_(){return Lv||(Lv=1,Pu.exports=T_()),Pu.exports}var __=j_();const I_=(e,t)=>{if(Hi(t))return t;if(b_(t)&&Hi(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const r=e[e.length-1];return typeof r=="function"?"":r}return e},R_={t:I_,ready:!1},L_=()=>()=>{},Me=(e,t={})=>{const{i18n:r}=t,{i18n:n,defaultNS:a}=h.useContext(B4)||{},s=r||n||N_();s&&!s.reportNamespaces&&(s.reportNamespaces=new A_),s||Fm(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const o=h.useMemo(()=>({...S_(),...s?.options?.react,...t}),[s,t]),{useSuspense:l,keyPrefix:c}=o,d=e||a||s?.options?.defaultNS,u=Hi(d)?[d]:d||["translation"],p=h.useMemo(()=>u,u);s?.reportNamespaces?.addUsedNamespaces?.(p);const f=h.useRef(0),m=h.useCallback(T=>{if(!s)return L_;const{bindI18n:C,bindI18nStore:L}=o,A=()=>{f.current+=1,T()};return C&&s.on(C,A),L&&s.store.on(L,A),()=>{C&&C.split(" ").forEach(I=>s.off(I,A)),L&&L.split(" ").forEach(I=>s.store.off(I,A))}},[s,o]),g=h.useRef(),b=h.useCallback(()=>{if(!s)return R_;const T=!!(s.isInitialized||s.initializedStoreOnce)&&p.every(P=>g_(P,s,o)),C=t.lng||s.language,L=f.current,A=g.current;if(A&&A.ready===T&&A.lng===C&&A.keyPrefix===c&&A.revision===L)return A;const N={t:s.getFixedT(C,o.nsMode==="fallback"?p:p[0],c),ready:T,lng:C,keyPrefix:c,revision:L};return g.current=N,N},[s,p,c,o,t.lng]),[x,y]=h.useState(0),{t:v,ready:w}=__.useSyncExternalStore(m,b,b);h.useEffect(()=>{if(s&&!w&&!l){const T=()=>y(C=>C+1);t.lng?Iv(s,t.lng,p,T):zm(s,p,T)}},[s,t.lng,p,w,l,x]);const k=s||{},E=h.useRef(null),S=h.useRef(),j=T=>{const C=Object.getOwnPropertyDescriptors(T);C.__original&&delete C.__original;const L=Object.create(Object.getPrototypeOf(T),C);if(!Object.prototype.hasOwnProperty.call(L,"__original"))try{Object.defineProperty(L,"__original",{value:T,writable:!1,enumerable:!1,configurable:!1})}catch{}return L},_=h.useMemo(()=>{const T=k,C=T?.language;let L=T;T&&(E.current&&E.current.__original===T?S.current!==C?(L=j(T),E.current=L,S.current=C):L=E.current:(L=j(T),E.current=L,S.current=C));const A=!w&&!l?(...N)=>(Fm(s,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),v(...N)):v,I=[A,L,w];return I.t=A,I.i18n=L,I.ready=w,I},[v,k,w,k.resolvedLanguage,k.language,k.languages]);if(s&&l&&!w)throw new Promise(T=>{const C=()=>T();t.lng?Iv(s,t.lng,p,C):zm(s,p,C)});return _};function D_({i18n:e,defaultNS:t,children:r}){const n=h.useMemo(()=>({i18n:e,defaultNS:t}),[e,t]);return h.createElement(B4.Provider,{value:n},r)}const $4="pixcode.theme.accent",Dv="pixcode.theme.customLight",Ov="pixcode.theme.customDark",U4="#059669",G4="#10b981",dl=[{id:"emerald",label:"Emerald",light:"#059669",dark:"#10b981"},{id:"vscode",label:"VS Code",light:"#007acc",dark:"#007acc",darkBackground:"215 28% 7%",darkCard:"215 25% 10%",darkMuted:"215 18% 16%"},{id:"blue",label:"Blue",light:"#2563eb",dark:"#60a5fa"},{id:"violet",label:"Violet",light:"#7c3aed",dark:"#a78bfa"},{id:"amber",label:"Amber",light:"#d97706",dark:"#f59e0b"},{id:"rose",label:"Rose",light:"#e11d48",dark:"#fb7185"},{id:"custom",label:"Custom",light:U4,dark:G4}],O_="emerald";function M_(e){return typeof e=="string"&&dl.some(t=>t.id===e)}function P_(){const e=localStorage.getItem($4);return M_(e)?e:O_}function Mv(e,t){const r=localStorage.getItem(e);return r&&/^#[0-9a-fA-F]{6}$/.test(r)?r:t}function F_(e){const t=e.replace("#",""),r=parseInt(t.slice(0,2),16)/255,n=parseInt(t.slice(2,4),16)/255,a=parseInt(t.slice(4,6),16)/255,s=Math.max(r,n,a),o=Math.min(r,n,a);let l=0,c=0;const d=(s+o)/2;if(s!==o){const u=s-o;c=d>.5?u/(2-s-o):u/(s+o),s===r?l=(n-a)/u+(n<a?6:0):s===n?l=(a-r)/u+2:l=(r-n)/u+4,l/=6}return`${Math.round(l*360)} ${Math.round(c*100)}% ${Math.round(d*100)}%`}function z_(e){const t=e.replace("#",""),r=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),a=parseInt(t.slice(4,6),16);return(.2126*r+.7152*n+.0722*a)/255>.58?"160 18% 6%":"210 40% 98%"}function B_(e,t,r,n,a){const s=dl.find(c=>c.id===t)??dl[0],o=t==="custom"?r?a:n:r?s.dark:s.light,l=F_(o);return e.style.setProperty("--primary",l),e.style.setProperty("--ring",l),e.style.setProperty("--primary-foreground",z_(o)),e.style.setProperty("--nav-tab-glow",`${l} / ${r?"0.25":"0.18"}`),e.style.setProperty("--nav-tab-ring",`${l} / ${r?"0.15":"0.10"}`),e.style.setProperty("--nav-input-focus-ring",`${l} / ${r?"0.25":"0.22"}`),r&&s.darkBackground?(e.style.setProperty("--background",s.darkBackground),e.style.setProperty("--card",s.darkCard??s.darkBackground),e.style.setProperty("--popover",s.darkCard??s.darkBackground),e.style.setProperty("--muted",s.darkMuted??s.darkCard??s.darkBackground),e.style.setProperty("--secondary",s.darkMuted??s.darkCard??s.darkBackground),e.style.setProperty("--accent",s.darkMuted??s.darkCard??s.darkBackground)):["--background","--card","--popover","--muted","--secondary","--accent"].forEach(c=>{e.style.removeProperty(c)}),o}const H4=h.createContext(),Oa=()=>{const e=h.useContext(H4);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e},$_=({children:e})=>{const[t,r]=h.useState(()=>{const g=localStorage.getItem("theme");return g?g==="dark":window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)").matches:!1}),[n,a]=h.useState(P_),[s,o]=h.useState(()=>Mv(Dv,U4)),[l,c]=h.useState(()=>Mv(Ov,G4));h.useEffect(()=>{const g=B_(document.documentElement,n,t,s,l);if(t){document.documentElement.classList.add("dark"),localStorage.setItem("theme","dark");const b=document.querySelector('meta[name="apple-mobile-web-app-status-bar-style"]');b&&b.setAttribute("content","black-translucent");const x=document.querySelector('meta[name="theme-color"]');x&&x.setAttribute("content",g)}else{document.documentElement.classList.remove("dark"),localStorage.setItem("theme","light");const b=document.querySelector('meta[name="apple-mobile-web-app-status-bar-style"]');b&&b.setAttribute("content","default");const x=document.querySelector('meta[name="theme-color"]');x&&x.setAttribute("content",g)}},[n,l,s,t]),h.useEffect(()=>{if(!window.matchMedia)return;const g=window.matchMedia("(prefers-color-scheme: dark)"),b=x=>{localStorage.getItem("theme")||r(x.matches)};return g.addEventListener("change",b),()=>g.removeEventListener("change",b)},[]);const m={isDarkMode:t,toggleDarkMode:()=>{r(g=>!g)},accentTheme:n,setAccentTheme:g=>{a(g),localStorage.setItem($4,g)},customLightAccent:s,setCustomLightAccent:g=>{o(g),localStorage.setItem(Dv,g)},customDarkAccent:l,setCustomDarkAccent:g=>{c(g),localStorage.setItem(Ov,g)}};return i.jsx(H4.Provider,{value:m,children:e})},U_=!1,G_={name:"default",displayName:"default",fullPath:"",path:""},ve=(e,t={})=>{const r=localStorage.getItem("auth-token"),n={};return t.body instanceof FormData||(n["Content-Type"]="application/json"),r&&(n.Authorization=`Bearer ${r}`),fetch(e,{...t,headers:{...n,...t.headers}}).then(a=>{const s=a.headers.get("X-Refreshed-Token");return s&&localStorage.setItem("auth-token",s),a})},ot={auth:{status:()=>fetch("/api/auth/status"),connectionMode:()=>fetch("/api/auth/connection-mode"),updateConnectionMode:e=>fetch("/api/auth/connection-mode",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),login:(e,t)=>fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t})}),register:(e,t)=>fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t})}),user:()=>ve("/api/auth/user"),logout:()=>ve("/api/auth/logout",{method:"POST"})},publicApiManifest:()=>ve("/api/public/manifest"),diagnostics:()=>ve("/api/diagnostics"),refreshDiagnostics:()=>ve("/api/diagnostics/refresh",{method:"POST"}),remoteConnection:()=>ve("/api/remote/config"),updateRemoteConnection:e=>ve("/api/remote/config",{method:"PUT",body:JSON.stringify(e)}),projects:()=>ve("/api/projects"),sessions:(e,t=5,r=0)=>ve(`/api/projects/${e}/sessions?limit=${t}&offset=${r}`),unifiedSessionMessages:(e,t="claude",{projectName:r="",projectPath:n="",limit:a=null,offset:s=0}={})=>{const o=new URLSearchParams;o.append("provider",t),r&&o.append("projectName",r),n&&o.append("projectPath",n),a!==null&&(o.append("limit",String(a)),o.append("offset",String(s)));const l=o.toString();return ve(`/api/sessions/${encodeURIComponent(e)}/messages${l?`?${l}`:""}`)},renameProject:(e,t)=>ve(`/api/projects/${e}/rename`,{method:"PUT",body:JSON.stringify({displayName:t})}),deleteSession:(e,t)=>ve(`/api/projects/${e}/sessions/${t}`,{method:"DELETE"}),renameSession:(e,t,r)=>ve(`/api/sessions/${e}/rename`,{method:"PUT",body:JSON.stringify({summary:t,provider:r})}),deleteCodexSession:e=>ve(`/api/codex/sessions/${e}`,{method:"DELETE"}),deleteGeminiSession:e=>ve(`/api/gemini/sessions/${e}`,{method:"DELETE"}),deleteQwenSession:e=>ve(`/api/qwen/sessions/${e}`,{method:"DELETE"}),deleteProject:(e,t=!1,r=!1)=>{const n=new URLSearchParams;t&&n.set("force","true"),r&&n.set("deleteData","true");const a=n.toString();return ve(`/api/projects/${e}${a?`?${a}`:""}`,{method:"DELETE"})},searchConversationsUrl:(e,t=50)=>{const r=localStorage.getItem("auth-token"),n=new URLSearchParams({q:e,limit:String(t)});return r&&n.set("token",r),`/api/search/conversations?${n.toString()}`},createWorkspace:e=>ve("/api/projects/create-workspace",{method:"POST",body:JSON.stringify(e)}),quickStartProject:()=>ve("/api/projects/quick-start",{method:"POST",body:"{}"}),readFile:(e,t)=>ve(`/api/projects/${e}/file?filePath=${encodeURIComponent(t)}`),readFileBlob:(e,t)=>ve(`/api/projects/${e}/files/content?path=${encodeURIComponent(t)}`),saveFile:(e,t,r)=>ve(`/api/projects/${e}/file`,{method:"PUT",body:JSON.stringify({filePath:t,content:r})}),getFiles:(e,t={})=>ve(`/api/projects/${e}/files`,t),createFile:(e,{path:t,type:r,name:n})=>ve(`/api/projects/${e}/files/create`,{method:"POST",body:JSON.stringify({path:t,type:r,name:n})}),renameFile:(e,{oldPath:t,newName:r})=>ve(`/api/projects/${e}/files/rename`,{method:"PUT",body:JSON.stringify({oldPath:t,newName:r})}),deleteFile:(e,{path:t,type:r})=>ve(`/api/projects/${e}/files`,{method:"DELETE",body:JSON.stringify({path:t,type:r})}),uploadFiles:(e,t)=>ve(`/api/projects/${e}/files/upload`,{method:"POST",body:t,headers:{}}),taskmaster:{init:e=>ve(`/api/taskmaster/init/${e}`,{method:"POST"}),addTask:(e,{prompt:t,title:r,description:n,priority:a,dependencies:s})=>ve(`/api/taskmaster/add-task/${e}`,{method:"POST",body:JSON.stringify({prompt:t,title:r,description:n,priority:a,dependencies:s})}),parsePRD:(e,{fileName:t,numTasks:r,append:n})=>ve(`/api/taskmaster/parse-prd/${e}`,{method:"POST",body:JSON.stringify({fileName:t,numTasks:r,append:n})}),getTemplates:()=>ve("/api/taskmaster/prd-templates"),applyTemplate:(e,{templateId:t,fileName:r,customizations:n})=>ve(`/api/taskmaster/apply-template/${e}`,{method:"POST",body:JSON.stringify({templateId:t,fileName:r,customizations:n})}),updateTask:(e,t,r)=>ve(`/api/taskmaster/update-task/${e}/${t}`,{method:"PUT",body:JSON.stringify(r)})},browseFilesystem:(e=null)=>{const t=new URLSearchParams;return e&&t.append("path",e),ve(`/api/browse-filesystem?${t}`)},createFolder:e=>ve("/api/create-folder",{method:"POST",body:JSON.stringify({path:e})}),user:{gitConfig:()=>ve("/api/user/git-config"),updateGitConfig:(e,t)=>ve("/api/user/git-config",{method:"POST",body:JSON.stringify({gitName:e,gitEmail:t})}),onboardingStatus:()=>ve("/api/user/onboarding-status"),completeOnboarding:()=>ve("/api/user/complete-onboarding",{method:"POST"})},get:e=>ve(`/api${e}`),post:(e,t)=>ve(`/api${e}`,{method:"POST",...t instanceof FormData?{body:t}:{body:JSON.stringify(t)}}),put:(e,t)=>ve(`/api${e}`,{method:"PUT",body:JSON.stringify(t)}),delete:(e,t={})=>ve(`/api${e}`,{method:"DELETE",...t})},Ud="auth-token",yi={authStatusCheckFailed:"Failed to check authentication status",loginFailed:"Login failed",registrationFailed:"Registration failed",networkError:"Network error. Please try again."};async function So(e){try{return await e.json()}catch{return null}}function Pv(e,t){return e?e.error??e.message??t:t}const V4=h.createContext(null),H_=()=>localStorage.getItem(Ud),V_=e=>{localStorage.setItem(Ud,e)},q_=()=>{localStorage.removeItem(Ud)};function Ki(){const e=h.useContext(V4);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function W_({children:e}){const[t,r]=h.useState(null),[n,a]=h.useState(()=>H_()),[s,o]=h.useState(!0),[l,c]=h.useState(!1),[d,u]=h.useState(!0),[p,f]=h.useState(null),m=h.useCallback((S,j)=>{r(S),a(j),V_(j)},[]),g=h.useCallback(()=>{r(null),a(null),q_()},[]),b=h.useCallback(async()=>{try{const S=await ot.user.onboardingStatus();if(!S.ok)return;const j=await So(S);u(!!j?.hasCompletedOnboarding)}catch(S){console.error("Error checking onboarding status:",S),u(!0)}},[]),x=h.useCallback(async()=>{await b()},[b]),y=h.useCallback(async()=>{try{o(!0),f(null);const S=await ot.auth.status();if((await So(S))?.needsSetup){c(!0);return}if(c(!1),!n)return;const _=await ot.auth.user();if(!_.ok){g();return}const T=await So(_);if(!T?.user){g();return}r(T.user),await b()}catch(S){console.error("[Auth] Auth status check failed:",S),f(yi.authStatusCheckFailed)}finally{o(!1)}},[b,g,n]);h.useEffect(()=>{y()},[y,b]);const v=h.useCallback(async(S,j)=>{try{f(null);const _=await ot.auth.login(S,j),T=await So(_);if(!_.ok||!T?.token||!T.user){const C=Pv(T,yi.loginFailed);return f(C),{success:!1,error:C}}return m(T.user,T.token),c(!1),await b(),{success:!0}}catch(_){return console.error("Login error:",_),f(yi.networkError),{success:!1,error:yi.networkError}}},[b,m]),w=h.useCallback(async(S,j)=>{try{f(null);const _=await ot.auth.register(S,j),T=await So(_);if(!_.ok||!T?.token||!T.user){const C=Pv(T,yi.registrationFailed);return f(C),{success:!1,error:C}}return m(T.user,T.token),c(!1),await b(),{success:!0}}catch(_){return console.error("Registration error:",_),f(yi.networkError),{success:!1,error:yi.networkError}}},[b,m]),k=h.useCallback(()=>{const S=n;g(),S&&ot.auth.logout().catch(j=>{console.error("Logout endpoint error:",j)})},[g,n]),E=h.useMemo(()=>({user:t,token:n,isLoading:s,needsSetup:l,hasCompletedOnboarding:d,error:p,login:v,register:w,logout:k,refreshOnboardingStatus:x}),[p,d,s,v,k,l,x,w,n,t]);return i.jsx(V4.Provider,{value:E,children:e})}const K_="pixcode.notification.once.",q4="pixcode.notificationPreferences.v1",Y_={action_required:"actionRequired","approval.needed":"actionRequired",stop:"stop","chat.done":"stop","orchestration.done":"stop","run.stopped":"stop",error:"error","run.failed":"error","test.failed":"error","live_view.failed":"error",update:"updates",updates:"updates","push.enabled":"updates","app.update.available":"updates","cli.update.available":"updates"};function Z_(e="updates"){try{const t=JSON.parse(localStorage.getItem(q4)??"null");return t?.channels?.desktop===!1?!1:t?.events?.[Y_[e]||e]!==!1}catch{return!0}}function is(e){try{localStorage.setItem(q4,JSON.stringify(e)),window.dispatchEvent(new CustomEvent("pixcode:notification-preferences-changed"))}catch{}}async function W4({key:e,title:t,body:r,tag:n,data:a}){return K4({key:e,title:t,body:r,event:"updates",tag:n,data:a})}async function K4({key:e,title:t,body:r,event:n="updates",tag:a,data:s}){if(typeof window>"u"||!Z_(n))return!1;const o=`${K_}${e}`;try{if(localStorage.getItem(o))return!1}catch{}try{if(await window.pixcodeDesktop?.notify({title:t,body:r,event:n,tag:a,data:s})){try{localStorage.setItem(o,new Date().toISOString())}catch{}return!0}}catch(c){console.warn("Desktop notification bridge failed:",c)}if(!("Notification"in window)||Notification.permission!=="granted")return!1;const l={body:r,icon:"/logo-256.png",badge:"/logo-128.png",tag:a,data:s,renotify:!!a};try{const c="serviceWorker"in navigator?await navigator.serviceWorker.ready.catch(()=>null):null;c?.showNotification?await c.showNotification(t,l):new Notification(t,l);try{localStorage.setItem(o,new Date().toISOString())}catch{}return!0}catch(c){return console.warn("Local notification failed:",c),!1}}const Y4={claude:"npm install -g @anthropic-ai/claude-code",cursor:"curl https://cursor.com/install -fsSL | bash",codex:"npm install -g @openai/codex",gemini:"npm install -g @google/gemini-cli",qwen:"npm install -g @qwen-code/qwen-code",opencode:"npm install -g opencode-ai"},ul={claude:"Claude Code",cursor:"Cursor CLI",codex:"OpenAI Codex",gemini:"Gemini CLI",qwen:"Qwen Code",opencode:"OpenCode"},Z4=["claude","cursor","codex","gemini","qwen","opencode"],Fv={claude:"/api/providers/claude/auth/status",cursor:"/api/providers/cursor/auth/status",codex:"/api/providers/codex/auth/status",gemini:"/api/providers/gemini/auth/status",qwen:"/api/providers/qwen/auth/status",opencode:"/api/providers/opencode/auth/status"},zv=(e=!0)=>({claude:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null},cursor:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null},codex:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null},gemini:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null},qwen:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null},opencode:{authenticated:!1,installed:null,email:null,method:null,error:null,loading:e,checkedAt:null}}),X_="Failed to check authentication status",J_="Unknown error",X4="pixcode.providerAuthStatus.cache.v2",Mc=1440*60*1e3,Q_=3600*1e3;let Bv=0;const eI=e=>e instanceof Error?e.message:J_,tI=(e,t=null)=>({authenticated:!!e.authenticated,installed:typeof e.installed=="boolean"?e.installed:null,email:e.email??null,method:e.method??null,error:e.error??t,loading:!1,checkedAt:e.checkedAt??new Date().toISOString(),installedVersion:e.installedVersion??null,latestVersion:e.latestVersion??null,updateAvailable:!!e.updateAvailable,versionCheckSkipped:e.versionCheckSkipped??null,fromCache:!!e.fromCache});function $m(){try{const e=JSON.parse(localStorage.getItem(X4)??"null");return!e||typeof e.savedAt!="number"||!e.statuses?null:e}catch{return null}}function rI(e){try{localStorage.setItem(X4,JSON.stringify({savedAt:Date.now(),statuses:e}))}catch{}}function nI(e){const t=$m(),r=zv(!1);return t&&Date.now()-t.savedAt<Mc?Object.fromEntries(Z4.map(n=>[n,{...r[n],...t.statuses[n],loading:!1,fromCache:!0}])):zv(e)}function $v(e,t){if(!t.updateAvailable||!t.latestVersion)return;const r=ul[e]??e,n=t.installedVersion?` ${t.installedVersion}`:"";W4({key:`cli-update:${e}:${t.latestVersion}`,title:`${r} update available`,body:`${r}${n} can update to ${t.latestVersion}.`,tag:`pixcode-cli-update:${e}`,data:{type:"cli-update",provider:e,latestVersion:t.latestVersion}})}function yf({initialLoading:e=!0}={}){const[t,r]=h.useState(()=>nI(e)),n=h.useCallback(l=>{r(c=>({...c,[l]:{...c[l],loading:!0,error:null}}))},[]),a=h.useCallback((l,c)=>{r(d=>({...d,[l]:c}))},[]),s=h.useCallback(async(l,c={})=>{const d=$m(),u=d?.statuses?.[l];if(!c.force&&d&&u&&Date.now()-d.savedAt<Mc){const p={...u,loading:!1,fromCache:!0};a(l,p),$v(l,p);return}n(l);try{const p=c.force?`${Fv[l]}?refresh=1`:Fv[l],f=await ve(p,{cache:"no-store"});if(!f.ok){a(l,{authenticated:!1,installed:null,email:null,method:null,loading:!1,error:X_});return}const m=await f.json(),g=tI(m.data);$v(l,g),r(b=>{const x={...b,[l]:g};return rI(x),x})}catch(p){console.error(`Error checking ${l} auth status:`,p),a(l,{authenticated:!1,installed:null,email:null,method:null,loading:!1,error:eI(p)})}},[n,a]),o=h.useCallback(async(l=Z4,c={})=>{await Promise.all(l.map(d=>s(d,c)))},[s]);return h.useEffect(()=>{const l=window.setInterval(()=>{const c=Date.now();if(c-Bv<Mc)return;const d=$m();d&&c-d.savedAt<Mc||(Bv=c,o())},Q_);return()=>window.clearInterval(l)},[o]),{providerAuthStatus:t,setProviderAuthStatus:r,checkProviderAuthStatus:s,refreshProviderAuthStatuses:o}}const J4="https://auth.openai.com/codex/device",aI=200,Q4=100,iI=50,sI=500,oI=20,lI=15,cI=5,dI=2,uI={cursorBlink:!0,fontSize:14,fontFamily:'Menlo, Monaco, "Courier New", monospace',allowProposedApi:!0,allowTransparency:!1,convertEol:!0,scrollback:1e4,tabStopWidth:4,windowsMode:!1,macOptionIsMeta:!0,macOptionClickForcesSelection:!0,theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#ffffff",cursorAccent:"#1e1e1e",selectionBackground:"#264f78",selectionForeground:"#ffffff",black:"#000000",red:"#cd3131",green:"#0dbc79",yellow:"#e5e510",blue:"#2472c8",magenta:"#bc3fbc",cyan:"#11a8cd",white:"#e5e5e5",brightBlack:"#666666",brightRed:"#f14c4c",brightGreen:"#23d18b",brightYellow:"#f5f543",brightBlue:"#3b8eea",brightMagenta:"#d670d6",brightCyan:"#29b8db",brightWhite:"#ffffff",extendedAnsi:["#000000","#800000","#008000","#808000","#000080","#800080","#008080","#c0c0c0","#808080","#ff0000","#00ff00","#ffff00","#0000ff","#ff00ff","#00ffff","#ffffff"]}};function pI(e){if(!e||typeof document>"u")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.opacity="0",t.style.pointerEvents="none",document.body.appendChild(t),t.focus(),t.select();let r=!1;try{r=document.execCommand("copy")}catch{r=!1}finally{document.body.removeChild(t)}return r}async function Cn(e){if(!e)return!1;let t=!1;try{typeof navigator<"u"&&navigator.clipboard?.writeText&&(await navigator.clipboard.writeText(e),t=!0)}catch{t=!1}return t||(t=pI(e)),t}function mI(){const e=window.location.protocol==="https:"?"wss:":"ws:",t=localStorage.getItem("auth-token");return t?`${e}//${window.location.host}/shell?token=${encodeURIComponent(t)}`:(console.error("No authentication token found for Shell WebSocket connection"),null)}function hI(e){try{return JSON.parse(e)}catch{return null}}function Mi(e,t){e&&e.readyState===WebSocket.OPEN&&e.send(JSON.stringify(t))}const fI=/(?:\u001B\[[0-?]*[ -/]*[@-~]|\u009B[0-?]*[ -/]*[@-~]|\u001B\][^\u0007\u001B]*(?:\u0007|\u001B\\)|\u009D[^\u0007\u009C]*(?:\u0007|\u009C)|\u001B[PX^_][^\u001B]*\u001B\\|[\u0090\u0098\u009E\u009F][^\u009C]*\u009C|\u001B[@-Z\\-_])/g,gI=/Process exited with code (\d+)/;function bI({wsRef:e,terminalRef:t,fitAddonRef:r,selectedProjectRef:n,selectedSessionRef:a,initialCommandRef:s,isPlainShellRef:o,onProcessCompleteRef:l,isInitialized:c,autoConnect:d,closeSocket:u,clearTerminalScreen:p,setAuthUrl:f,onOutputRef:m}){const[g,b]=h.useState(!1),[x,y]=h.useState(!1),v=h.useRef(!1),w=h.useRef(!1),k=h.useCallback(T=>{if(!o.current||!l.current)return;const L=T.replace(fI,"");if(L.includes("Process exited with code 0")){l.current(0);return}const A=L.match(gI);if(!A)return;const I=Number.parseInt(A[1],10);!Number.isNaN(I)&&I!==0&&l.current(I)},[o,l]),E=h.useCallback(T=>{const C=hI(T);if(!C){console.error("[Shell] Error handling WebSocket message:",T);return}if(C.type==="output"){const L=typeof C.data=="string"?C.data:"";k(L),t.current?.write(L),m?.current?.();return}if(C.type==="auth_url"||C.type==="url_open"){const L=typeof C.url=="string"?C.url:"";L&&f(L)}},[k,m,f,t]),S=h.useCallback((T=!1)=>{if(!(v.current&&!T||x||g))try{const C=mI();if(!C){v.current=!1,y(!1);return}v.current=!0;const L=new WebSocket(C);e.current=L,L.onopen=()=>{b(!0),y(!1),v.current=!1,f(""),window.setTimeout(()=>{const A=t.current,I=r.current,N=n.current;!A||!I||!N||(I.fit(),Mi(L,{type:"init",projectPath:N.fullPath||N.path||"",sessionId:o.current?null:a.current?.id||null,hasSession:o.current?!1:!!a.current,provider:o.current?"plain-shell":a.current?.__provider||localStorage.getItem("selected-provider")||"claude",cols:A.cols,rows:A.rows,initialCommand:s.current,isPlainShell:o.current}))},Q4)},L.onmessage=A=>{const I=typeof A.data=="string"?A.data:String(A.data??"");E(I)},L.onclose=()=>{b(!1),y(!1),v.current=!1,p()},L.onerror=()=>{b(!1),y(!1),v.current=!1}}catch{b(!1),y(!1),v.current=!1}},[p,r,E,s,g,x,o,n,a,f,t,e]),j=h.useCallback(()=>{!c||g||x||v.current||(w.current=!1,v.current=!0,y(!0),S(!0))},[S,g,x,c]),_=h.useCallback((T=!0)=>{T&&(w.current=!0),u(),p(),b(!1),y(!1),v.current=!1,f("")},[p,u,f]);return h.useEffect(()=>{!d||w.current||!c||x||g||j()},[d,j,g,x,c]),{isConnected:g,isConnecting:x,closeSocket:u,connectToShell:j,disconnectFromShell:_}}var xI=$j(),zu={exports:{}},Uv;function yI(){return Uv||(Uv=1,function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={6:(o,l)=>{function c(u){try{const p=new URL(u),f=p.password&&p.username?`${p.protocol}//${p.username}:${p.password}@${p.host}`:p.username?`${p.protocol}//${p.username}@${p.host}`:`${p.protocol}//${p.host}`;return u.toLocaleLowerCase().startsWith(f.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(l,"__esModule",{value:!0}),l.LinkComputer=l.WebLinkProvider=void 0,l.WebLinkProvider=class{constructor(u,p,f,m={}){this._terminal=u,this._regex=p,this._handler=f,this._options=m}provideLinks(u,p){const f=d.computeLink(u,this._regex,this._terminal,this._handler);p(this._addCallbacks(f))}_addCallbacks(u){return u.map(p=>(p.leave=this._options.leave,p.hover=(f,m)=>{if(this._options.hover){const{range:g}=p;this._options.hover(f,m,g)}},p))}};class d{static computeLink(p,f,m,g){const b=new RegExp(f.source,(f.flags||"")+"g"),[x,y]=d._getWindowedLineStrings(p-1,m),v=x.join("");let w;const k=[];for(;w=b.exec(v);){const E=w[0];if(!c(E))continue;const[S,j]=d._mapStrIdx(m,y,0,w.index),[_,T]=d._mapStrIdx(m,S,j,E.length);if(S===-1||j===-1||_===-1||T===-1)continue;const C={start:{x:j+1,y:S+1},end:{x:T,y:_+1}};k.push({range:C,text:E,activate:g})}return k}static _getWindowedLineStrings(p,f){let m,g=p,b=p,x=0,y="";const v=[];if(m=f.buffer.active.getLine(p)){const w=m.translateToString(!0);if(m.isWrapped&&w[0]!==" "){for(x=0;(m=f.buffer.active.getLine(--g))&&x<2048&&(y=m.translateToString(!0),x+=y.length,v.push(y),m.isWrapped&&y.indexOf(" ")===-1););v.reverse()}for(v.push(w),x=0;(m=f.buffer.active.getLine(++b))&&m.isWrapped&&x<2048&&(y=m.translateToString(!0),x+=y.length,v.push(y),y.indexOf(" ")===-1););}return[v,g]}static _mapStrIdx(p,f,m,g){const b=p.buffer.active,x=b.getNullCell();let y=m;for(;g;){const v=b.getLine(f);if(!v)return[-1,-1];for(let w=y;w<v.length;++w){v.getCell(w,x);const k=x.getChars();if(x.getWidth()&&(g-=k.length||1,w===v.length-1&&k==="")){const E=b.getLine(f+1);E&&E.isWrapped&&(E.getCell(0,x),x.getWidth()===2&&(g+=1))}if(g<0)return[f,w]}f++,y=0}return[f,y]}}l.LinkComputer=d}},n={};function a(o){var l=n[o];if(l!==void 0)return l.exports;var c=n[o]={exports:{}};return r[o](c,c.exports,a),c.exports}var s={};return(()=>{var o=s;Object.defineProperty(o,"__esModule",{value:!0}),o.WebLinksAddon=void 0;const l=a(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(u,p){const f=window.open();if(f){try{f.opener=null}catch{}f.location.href=p}else console.warn("Opening link blocked as opener could not be cleared")}o.WebLinksAddon=class{constructor(u=d,p={}){this._handler=u,this._options=p}activate(u){this._terminal=u;const p=this._options,f=p.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new l.WebLinkProvider(this._terminal,f,this._handler,p))}dispose(){this._linkProvider?.dispose()}}})(),s})())}(zu)),zu.exports}var vI=yI(),wI=Uj(),kI=Gj();function eE(e){return typeof e=="string"&&/\bcodex\s+login\b/i.test(e)}function SI(e,t){return eE(e)?J4:t}function EI(e){return e?e.__provider==="cursor"?e.name||"Untitled Session":e.summary||"New Session":null}const Gv="shell-xterm-focus-style",NI=`
|
|
10
10
|
.xterm .xterm-screen {
|
|
11
11
|
outline: none !important;
|
|
12
12
|
}
|
|
@@ -226,7 +226,7 @@ import{j as i,a as T4,R as hf,o as ff,_ as bj,b as xj,m as j4,E as Nn,T as _4,P
|
|
|
226
226
|
*
|
|
227
227
|
* This source code is licensed under the ISC license.
|
|
228
228
|
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
-
*/const dD=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],uD=gt("workflow",dD),wf=rE,mE=XI,Vv=WI,pD=i7,mD=FI,kf=GI,hD=tE,Pr=iE,fD=z7,Sf=L7,An=O7,gD=P7,Kr=VI,ta=tE,nd=YI,hE=$I,bD=T7,xD=_7,fE=QI,ht=nE,Ot=nE,Gd=n7,gE=t7,yD=Y8,En=p8,Tr=h8,rr=C7,ra=E7,bE=D8,ln=xR,vD=lE,wD=lE,ad=b7,Hd=G7,xE=$7,Vd=sE,Qo=K7,Bs=a8,$t=s8,Pn=C8,Sa=k8,ai=E8,kD=rR,SD=R8,pl=z8,Ef=pR,ED=o7,Ll=y7,ND=LR,CD=vf,AD=vf,Um=Q8,TD=T8,jD=v8,_D=SR,ID=dR,RD=V8,yE=X8,Gm=vf,Nf=aR,Ut=sR,kr=OR,LD=l8,Ea=G8,xt=cE,Hm=cE,qd=AR,Cf=m7,DD=u7,Vm=c7,OD=d8,na=aE,MD=aE,PD=PR,vE=zR,ml=w7,wE=q7,Yi=x8,Af=g8,Fn=_8,kE=sE,Wd=oE,FD=oE,SE=P8,yn=$8,Tf=W8,EE=e8,NE=IR,zD=lR,jf=gR,BD=hR,Lt=Z7,$D=DI,CE=r8,Na=wR,Is=NR,_f=jR,Gr=J7,If=f7,UD=YR,Dl=tL,Rf=uE,GD=uE,Qr=FL,Pc=BL,HD=UL,ss=WR,os=XR,VD=QR,zo=nL,Rs=iL,qv=dL,Bo=pL,Eo=gL,qD=xL,AE=_L,qm=vL,_i=EL,No=kL,Wv=CL,Co=TL,Wm=RL,WD=DL,Km=ML,Ns=qL,$o=KL,Ba=ZL,ls=JL,KD=eD,Ym=rD,YD=iD,Ao=cD,aa=uD,hl=lL,TE=hL,ZD=HL,XD=oD,JD=[{type:"key",id:"esc",label:"Esc",sequence:"\x1B"},{type:"key",id:"tab",label:"Tab",sequence:" "},{type:"key",id:"shift-tab",label:"⇧Tab",sequence:"\x1B[Z"},{type:"modifier",id:"ctrl",label:"CTRL",modifier:"ctrl"},{type:"modifier",id:"alt",label:"ALT",modifier:"alt"},{type:"arrow",id:"arrow-up",sequence:"\x1B[A",icon:"up"},{type:"arrow",id:"arrow-down",sequence:"\x1B[B",icon:"down"},{type:"arrow",id:"arrow-left",sequence:"\x1B[D",icon:"left"},{type:"arrow",id:"arrow-right",sequence:"\x1B[C",icon:"right"}],QD={up:mE,down:wf,left:mD,right:kf},To=e=>e.preventDefault(),Kv="shrink-0 rounded-md border border-gray-600 bg-gray-700 px-2.5 py-1.5 text-xs font-medium text-gray-100 transition-colors select-none active:bg-blue-600 active:text-white active:border-blue-600 disabled:cursor-not-allowed disabled:opacity-40",eO="shrink-0 rounded-md border border-blue-500 bg-blue-600 px-2.5 py-1.5 text-xs font-medium text-white transition-colors select-none disabled:cursor-not-allowed disabled:opacity-40",Bu="shrink-0 rounded-md border border-gray-600 bg-gray-700 p-1.5 text-gray-100 transition-colors select-none active:bg-blue-600 active:text-white active:border-blue-600 disabled:cursor-not-allowed disabled:opacity-40";function Yv({wsRef:e,terminalRef:t,isConnected:r,bottomOffset:n="bottom-0"}){const{t:a}=Me("settings"),[s,o]=h.useState(!1),[l,c]=h.useState(!1),d=h.useCallback(m=>{Mi(e.current,{type:"input",data:m})},[e]),u=h.useCallback(()=>{t.current?.scrollToBottom()},[t]),p=h.useCallback(async()=>{if(!(typeof navigator>"u"||!navigator.clipboard?.readText))try{const m=await navigator.clipboard.readText();m.length>0&&d(m)}catch{}},[d]),f=h.useCallback(m=>{let g=m;if(s&&m.length===1){const b=m.toLowerCase().charCodeAt(0);b>=97&&b<=122&&(g=String.fromCharCode(b-96)),o(!1)}l&&m.length===1&&(g="\x1B"+g,c(!1)),d(g)},[s,l,d]);return i.jsx("div",{className:`pointer-events-none fixed inset-x-0 ${n} z-20 px-2 md:hidden`,children:i.jsxs("div",{className:"pointer-events-auto flex items-center gap-1 overflow-x-auto rounded-lg border border-gray-700/80 bg-gray-900/95 px-1.5 py-1.5 shadow-lg backdrop-blur-sm [-webkit-overflow-scrolling:touch] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[i.jsx("button",{type:"button",onPointerDown:To,onClick:()=>{p()},disabled:!r,className:Bu,title:a("terminalShortcuts.paste",{defaultValue:"Paste"}),"aria-label":a("terminalShortcuts.paste",{defaultValue:"Paste"}),children:i.jsx(Hd,{className:"h-4 w-4"})}),JD.map(m=>{if(m.type==="modifier"){const g=m.modifier==="ctrl"?s:l,b=m.modifier==="ctrl"?()=>o(x=>!x):()=>c(x=>!x);return i.jsx("button",{type:"button",onPointerDown:To,onClick:b,disabled:!r,className:g?eO:Kv,children:m.label},m.id)}if(m.type==="arrow"){const g=QD[m.icon];return i.jsx("button",{type:"button",onPointerDown:To,onClick:()=>d(m.sequence),disabled:!r,className:Bu,children:i.jsx(g,{className:"h-4 w-4"})},m.id)}return i.jsx("button",{type:"button",onPointerDown:To,onClick:()=>f(m.sequence),disabled:!r,className:Kv,children:m.label},m.id)}),i.jsx("button",{type:"button",onPointerDown:To,onClick:u,disabled:!r,className:Bu,title:a("terminalShortcuts.scrollDown"),"aria-label":a("terminalShortcuts.scrollDown"),children:i.jsx(hD,{className:"h-4 w-4"})})]})})}function jE({selectedProject:e=null,selectedSession:t=null,initialCommand:r=null,isPlainShell:n=!1,onProcessComplete:a=null,minimal:s=!1,autoConnect:o=!1,isActive:l=!0}){const{t:c}=Me("chat"),[d,u]=h.useState(!1),[p,f]=h.useState(null),m=h.useRef(null),g=h.useRef(null),{terminalContainerRef:b,terminalRef:x,wsRef:y,isConnected:v,isInitialized:w,isConnecting:k,authUrl:E,authUrlVersion:S,connectToShell:j,disconnectFromShell:_,openAuthUrlInBrowser:T,copyAuthUrlToClipboard:C}=TI({selectedProject:e,selectedSession:t,initialCommand:r,isPlainShell:n,minimal:s,autoConnect:o,isRestarting:d,onProcessComplete:a,onOutputRef:g}),L=h.useCallback(()=>{const $=x.current;if(!$)return;const F=$.buffer.active,te=F.baseY+F.cursorY,Q=Math.min(F.baseY+F.length-1,te+10),ge=Math.max(0,te-oI),ae=[];for(let xe=ge;xe<=Q;xe++){const Be=F.getLine(xe);Be&&ae.push(Be.translateToString().trimEnd())}let me=-1;for(let xe=ae.length-1;xe>=0;xe--)if(/esc to cancel/i.test(ae[xe])||/enter to select/i.test(ae[xe])){me=xe;break}if(me===-1){f(null);return}const pe=new Map,be=Math.max(0,me-lI);for(let xe=me-1;xe>=be;xe--){const Be=ae[xe].match(/^\s*[❯›>]?\s*(\d+)\.\s+(.+)/);if(Be){const M=Be[1],de=Be[2].trim();parseInt(M,10)<=cI&&de.length>0&&!pe.has(M)&&pe.set(M,de)}}const Ne=[];for(let xe=1;xe<=pe.size&&pe.has(String(xe));xe++)Ne.push({number:String(xe),label:pe.get(String(xe))});f(Ne.length>=dI?Ne:null)},[x]),A=h.useCallback(()=>{m.current&&clearTimeout(m.current),m.current=setTimeout(L,sI)},[L]);h.useEffect(()=>{g.current=A},[A]),h.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]),h.useEffect(()=>{v||(m.current&&(clearTimeout(m.current),m.current=null),f(null))},[v]),h.useEffect(()=>{if(!l||!w||!v)return;const $=()=>{x.current?.focus()},F=window.requestAnimationFrame($),te=window.setTimeout($,0);return()=>{window.cancelAnimationFrame(F),window.clearTimeout(te)}},[l,v,w,x]);const I=h.useCallback($=>{Mi(y.current,{type:"input",data:$})},[y]),N=h.useMemo(()=>EI(t),[t]),P=h.useMemo(()=>N?N.slice(0,30):null,[N]),H=h.useMemo(()=>N?N.slice(0,50):null,[N]),z=h.useCallback(()=>{u(!0),window.setTimeout(()=>{u(!1)},aI)},[]);if(!e)return i.jsx(_I,{title:c("shell.selectProject.title"),description:c("shell.selectProject.description")});if(s)return i.jsxs(i.Fragment,{children:[i.jsx(RI,{terminalContainerRef:b,authUrl:E,authUrlVersion:S,initialCommand:r,isConnected:v,openAuthUrlInBrowser:T,copyAuthUrlToClipboard:C}),i.jsx(Yv,{wsRef:y,terminalRef:x,isConnected:v,bottomOffset:"bottom-0"})]});const U=n?c("shell.runCommand",{command:r||c("shell.defaultCommand"),projectName:e.displayName}):t?c("shell.resumeSession",{displayName:H}):c("shell.startSession"),V=n?c("shell.runCommand",{command:r||c("shell.defaultCommand"),projectName:e.displayName}):c("shell.startCli",{projectName:e.displayName}),O=w?k?"connecting":v?null:"connect":"loading",G=O==="connecting"?V:U;return i.jsxs("div",{className:"flex h-full w-full flex-col bg-gray-900",children:[i.jsx(II,{isConnected:v,isInitialized:w,isRestarting:d,hasSession:!!t,sessionDisplayNameShort:P,onDisconnect:_,onRestart:z,statusNewSessionText:c("shell.status.newSession"),statusInitializingText:c("shell.status.initializing"),statusRestartingText:c("shell.status.restarting"),disconnectLabel:c("shell.actions.disconnect"),disconnectTitle:c("shell.actions.disconnectTitle"),restartLabel:c("shell.actions.restart"),restartTitle:c("shell.actions.restartTitle"),disableRestart:d||v}),i.jsxs("div",{className:"relative flex-1 overflow-hidden p-2",children:[i.jsx("div",{ref:b,className:"h-full w-full focus:outline-none",style:{outline:"none"}}),O&&i.jsx(jI,{mode:O,description:G,loadingLabel:c("shell.loading"),connectLabel:c("shell.actions.connect"),connectTitle:c("shell.actions.connectTitle"),connectingLabel:c("shell.connecting"),onConnect:j}),p&&v&&i.jsx("div",{className:"absolute inset-x-0 bottom-0 z-10 border-t border-gray-700/80 bg-gray-800/95 px-3 py-2 backdrop-blur-sm",onMouseDown:$=>$.preventDefault(),children:i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.map($=>i.jsxs("button",{type:"button",onClick:()=>{I($.number),f(null)},className:"max-w-36 truncate rounded bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-700",title:`${$.number}. ${$.label}`,children:[$.number,". ",$.label]},$.number)),i.jsx("button",{type:"button",onClick:()=>{I("\x1B"),f(null)},className:"rounded bg-gray-700 px-3 py-1.5 text-xs font-medium text-gray-200 transition-colors hover:bg-gray-600",children:"Esc"})]})})]}),i.jsx(Yv,{wsRef:y,terminalRef:x,isConnected:v})]})}function tO({className:e}){return i.jsx("div",{className:`flex h-full items-center justify-center ${e}`,children:i.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-gray-100 dark:bg-gray-800",children:i.jsx("svg",{className:"h-8 w-8 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 002 2z"})})}),i.jsx("h3",{className:"mb-2 text-lg font-semibold",children:"No Project Selected"}),i.jsx("p",{children:"A project is required to open a shell"})]})})}function rO({title:e,isCompleted:t,onClose:r=null}){return i.jsx("div",{className:"flex-shrink-0 border-b border-gray-700 bg-gray-800 px-4 py-2",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("h3",{className:"text-sm font-medium text-gray-200",children:e}),t&&i.jsx("span",{className:"text-xs text-green-400",children:"(Completed)"})]}),r&&i.jsx("button",{onClick:r,className:"text-gray-400 hover:text-white",title:"Close",children:i.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})})}function _E({project:e=null,session:t=null,command:r=null,isPlainShell:n=null,isActive:a=!0,autoConnect:s=!0,onComplete:o=null,onClose:l=null,title:c=null,className:d="",showHeader:u=!0,compact:p=!1,minimal:f=!1}){const[m,g]=h.useState(!1),b=n!==null?n:r!==null,x=h.useCallback(y=>{g(!0),o?.(y)},[o]);return e?i.jsxs("div",{className:`flex h-full w-full flex-col ${d}`,children:[!f&&u&&c&&i.jsx(rO,{title:c,isCompleted:m,onClose:l}),i.jsx("div",{className:"min-h-0 w-full flex-1",children:i.jsx(jE,{selectedProject:e,selectedSession:t,initialCommand:r,isPlainShell:b,isActive:a,onProcessComplete:x,minimal:f,autoConnect:f?!0:s})})]}):i.jsx(tO,{className:d})}const nO=(e,t)=>t||(e==="claude"?"claude --dangerously-skip-permissions /login":e==="cursor"?"cursor-agent login":e==="codex"?"codex login":e==="qwen"?"qwen auth":e==="opencode"?"opencode auth login":"gemini"),aO={claude:{keyLabel:"Anthropic API Key",keyExample:"sk-ant-...",supportsBaseUrl:!0,baseUrlExample:"https://api.anthropic.com",keyConsoleUrl:"https://console.anthropic.com/settings/keys",keyConsoleLabel:"Anthropic Console"},codex:{keyLabel:"OpenAI API Key",keyExample:"sk-...",supportsBaseUrl:!0,baseUrlExample:"https://api.openai.com/v1",keyConsoleUrl:"https://platform.openai.com/api-keys",keyConsoleLabel:"OpenAI Platform"},gemini:{keyLabel:"Gemini API Key",keyExample:"AI...",supportsBaseUrl:!1,keyConsoleUrl:"https://aistudio.google.com/app/apikey",keyConsoleLabel:"Google AI Studio"},qwen:{keyLabel:"OpenAI-Compatible API Key",keyExample:"sk-... or sk-sp-...",supportsBaseUrl:!0,baseUrlExample:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",keyConsoleUrl:"https://github.com/QwenLM/qwen-code",keyConsoleLabel:"Qwen Code Docs",notes:"Accepts any OpenAI-compatible endpoint — Alibaba Cloud, ModelScope, OpenRouter, self-hosted, etc."},opencode:{keyLabel:"Anthropic API Key (default backend)",keyExample:"sk-ant-...",supportsBaseUrl:!0,baseUrlExample:"https://api.anthropic.com",keyConsoleUrl:"https://console.anthropic.com/settings/keys",keyConsoleLabel:"Anthropic Console",notes:"OpenCode is multi-provider — this sets the Anthropic credentials. Switch providers via `opencode auth login` or opencode.json."}};function Zv({active:e,children:t,onClick:r}){return i.jsx("button",{onClick:r,className:`flex-1 border-b-2 px-4 py-2.5 text-sm font-medium transition-colors ${e?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,children:t})}function iO({provider:e}){const[t,r]=h.useState(""),[n,a]=h.useState(!1),[s,o]=h.useState("idle"),[l,c]=h.useState(null),d=async()=>{const u=t.trim();if(u){a(!0),c(null),o("idle");try{const p=await ve(`/api/providers/${e}/oauth-paste`,{method:"POST",body:JSON.stringify({callbackUrl:u})}),f=await p.json().catch(()=>({}));if(!p.ok||!f?.success)throw new Error(f?.error||`Request failed (${p.status})`);o("ok"),r("")}catch(p){c(p?.message||"Forward failed"),o("error")}finally{a(!1)}}};return i.jsxs("div",{className:"mt-3 rounded-lg border border-border/60 bg-muted/30 p-3 text-sm",children:[i.jsx("div",{className:"mb-2 font-medium text-foreground",children:"Remote login? Paste the callback URL here"}),i.jsxs("p",{className:"mb-3 text-xs text-muted-foreground",children:["When the CLI shows ",i.jsx("code",{className:"rounded bg-background px-1 font-mono text-[11px]",children:"http://127.0.0.1:PORT/…"})," and your browser can't reach it (VPS setups), copy the failing URL from your address bar and paste it below. Pixcode forwards the token exchange to the CLI process on this host."]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"url",value:t,onChange:u=>r(u.target.value),placeholder:"http://127.0.0.1:49312/callback?code=...",className:"flex-1 rounded-md border border-border bg-background px-3 py-2 font-mono text-xs text-foreground focus:border-primary focus:outline-none",onKeyDown:u=>{u.key==="Enter"&&d()}}),i.jsx("button",{onClick:()=>void d(),disabled:n||!t.trim(),className:"flex items-center gap-1.5 rounded-md bg-foreground px-3 py-2 text-xs font-medium text-background transition-opacity hover:opacity-90 disabled:opacity-40",children:n?i.jsx(Ot,{className:"h-3.5 w-3.5 animate-spin"}):"Forward"})]}),s==="ok"&&i.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs text-emerald-600 dark:text-emerald-400",children:[i.jsx(rr,{className:"h-3.5 w-3.5"})," Forwarded — check the terminal above for the completion message."]}),s==="error"&&l&&i.jsx("div",{className:"mt-2 text-xs text-red-600 dark:text-red-400",children:l})]})}function sO({provider:e,onSaved:t}){const r=aO[e],[n,a]=h.useState(""),[s,o]=h.useState(""),[l,c]=h.useState(!1),[d,u]=h.useState("idle"),[p,f]=h.useState(null);h.useEffect(()=>{let g=!1;return(async()=>{try{const x=await(await ve("/api/providers/credentials")).json().catch(()=>({}));if(g||!x?.success)return;const y=x.data?.[e];y?.baseUrl&&o(y.baseUrl)}catch{}})(),()=>{g=!0}},[e]);const m=async()=>{const g=n.trim();if(g){c(!0),f(null),u("idle");try{const b=await ve(`/api/providers/${e}/auth/api-key`,{method:"POST",body:JSON.stringify({apiKey:g,baseUrl:r.supportsBaseUrl&&s.trim()?s.trim():""})}),x=await b.json().catch(()=>({}));if(!b.ok||!x?.success)throw new Error(x?.error||`Request failed (${b.status})`);u("ok"),a(""),t()}catch(b){f(b?.message||"Save failed"),u("error")}finally{c(!1)}}};return r?i.jsx("div",{className:"flex h-full flex-col overflow-y-auto p-6",children:i.jsxs("div",{className:"mx-auto w-full max-w-lg space-y-5",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-muted",children:i.jsx(FD,{className:"h-5 w-5 text-foreground"})}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-base font-semibold text-foreground",children:r.keyLabel}),i.jsxs("a",{href:r.keyConsoleUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:["Get a key from ",r.keyConsoleLabel,i.jsx(Kr,{className:"h-3 w-3"})]})]})]}),r.notes&&i.jsx("div",{className:"rounded-md border border-border/60 bg-muted/40 p-3 text-xs text-muted-foreground",children:r.notes}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("label",{className:"text-xs font-medium text-foreground",children:"API Key"}),i.jsx("input",{type:"password",value:n,onChange:g=>a(g.target.value),placeholder:r.keyExample,className:"w-full rounded-md border border-border bg-background px-3 py-2 font-mono text-sm text-foreground focus:border-primary focus:outline-none",autoComplete:"off",spellCheck:!1}),i.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Stored locally at ",i.jsx("code",{className:"rounded bg-muted px-1 font-mono text-[10px]",children:"~/.pixcode/provider-credentials.json"})," with 0600 permissions."]})]}),r.supportsBaseUrl&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs font-medium text-foreground",children:["Base URL ",i.jsx("span",{className:"font-normal text-muted-foreground",children:"(optional — use a custom endpoint)"})]}),i.jsx("input",{type:"url",value:s,onChange:g=>o(g.target.value),placeholder:r.baseUrlExample,className:"w-full rounded-md border border-border bg-background px-3 py-2 font-mono text-sm text-foreground focus:border-primary focus:outline-none",autoComplete:"off",spellCheck:!1}),i.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Point at any OpenAI-compatible proxy (OpenRouter, local LLM, self-hosted, budget provider) to cut costs or hit different models."})]}),i.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[i.jsxs("button",{onClick:()=>void m(),disabled:l||!n.trim(),className:"inline-flex items-center gap-2 rounded-md bg-foreground px-4 py-2 text-sm font-medium text-background transition-opacity hover:opacity-90 disabled:opacity-40",children:[l?i.jsx(Ot,{className:"h-4 w-4 animate-spin"}):i.jsx(rr,{className:"h-4 w-4"}),"Save API Key"]}),d==="ok"&&i.jsx("span",{className:"text-xs text-emerald-600 dark:text-emerald-400",children:"Saved — reconnect to pick it up."}),d==="error"&&p&&i.jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:p})]})]})}):i.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"This provider uses OAuth only — use the Browser tab to log in."})}function IE({isOpen:e,onClose:t,provider:r="claude",onComplete:n,customCommand:a,isAuthenticated:s=!1}){const{t:o}=Me("common"),l=r!=="cursor",[c,d]=h.useState(l?"apiKey":"browser");h.useEffect(()=>{e&&d(l?"apiKey":"browser")},[e,r,l]);const u=h.useMemo(()=>`${ul[r]??r} Login`,[r]);if(!e)return null;const p=nO(r,a),f=m=>n?.(m);return i.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black bg-opacity-50 max-md:items-stretch max-md:justify-stretch",children:i.jsxs("div",{className:"flex h-3/4 w-full max-w-4xl flex-col rounded-lg bg-white shadow-xl dark:bg-gray-800 max-md:m-0 max-md:h-full max-md:max-w-none max-md:rounded-none md:m-4 md:h-3/4 md:max-w-4xl md:rounded-lg",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-gray-200 p-4 dark:border-gray-700",children:[i.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:u}),i.jsx("button",{onClick:t,className:"text-gray-400 transition-colors hover:text-gray-600 dark:hover:text-gray-300","aria-label":"Close login modal",children:i.jsx(xt,{className:"h-6 w-6"})})]}),i.jsxs("div",{className:"flex border-b border-gray-200 dark:border-gray-700",children:[i.jsx(Zv,{active:c==="browser",onClick:()=>d("browser"),children:"Browser / OAuth"}),l&&i.jsx(Zv,{active:c==="apiKey",onClick:()=>d("apiKey"),children:"API Key"})]}),i.jsx("div",{className:"flex flex-1 flex-col overflow-hidden",children:c==="browser"?i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[i.jsx("div",{className:"min-h-0 flex-1",children:i.jsx(_E,{project:G_,command:p,onComplete:f,minimal:!0})}),i.jsx("div",{className:"border-t border-border/40 bg-background/50 px-4 py-3",children:i.jsx(iO,{provider:r})})]}):i.jsx(sO,{provider:r,onSaved:()=>f(0)})})]})})}const oO=({className:e="w-5 h-5"})=>i.jsx("img",{src:"/icons/claude-ai-icon.svg",alt:"Claude",className:e}),lO=({className:e="w-5 h-5"})=>{const{isDarkMode:t}=Oa();return i.jsx("img",{src:t?"/icons/codex-white.svg":"/icons/codex.svg",alt:"Codex",className:e})},cO=({className:e="w-5 h-5"})=>{const{isDarkMode:t}=Oa();return i.jsx("img",{src:t?"/icons/cursor-white.svg":"/icons/cursor.svg",alt:"Cursor",className:e})},dO=({className:e="w-5 h-5"})=>i.jsx("img",{src:"/icons/gemini-ai-icon.svg",alt:"Gemini",className:e}),uO=({className:e="w-5 h-5"})=>{const{isDarkMode:t}=Oa(),r=t?"/icons/opencode-logo-dark.svg":"/icons/opencode-logo-light.svg";return i.jsx("img",{src:r,alt:"OpenCode",className:e})},pO=({className:e="w-5 h-5"})=>i.jsx("img",{src:"/icons/qwen-logo.svg",alt:"Qwen Code",className:e});function dr({provider:e="claude",className:t="w-5 h-5"}){return e==="cursor"?i.jsx(cO,{className:t}):e==="codex"?i.jsx(lO,{className:t}):e==="gemini"?i.jsx(dO,{className:t}):e==="qwen"?i.jsx(pO,{className:t}):e==="opencode"?i.jsx(uO,{className:t}):i.jsx(oO,{className:t})}function mO({provider:e,title:t,status:r,connectedClassName:n,iconContainerClassName:a,loginButtonClassName:s,onLogin:o}){const l=r.authenticated?n:"border-border bg-card",c=r.loading?"Checking...":r.authenticated?r.email||"Connected":r.error||"Not connected";return i.jsx("div",{className:`rounded-lg border p-4 transition-colors ${l}`,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:`flex h-10 w-10 items-center justify-center rounded-full ${a}`,children:i.jsx(dr,{provider:e,className:"h-5 w-5"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 font-medium text-foreground",children:[t,r.authenticated&&i.jsx(rr,{className:"h-4 w-4 text-green-500"})]}),i.jsx("div",{className:"text-xs text-muted-foreground",children:c})]})]}),!r.authenticated&&!r.loading&&i.jsx("button",{onClick:o,className:`${s} rounded-lg px-4 py-2 text-sm font-medium text-white transition-colors`,children:"Login"})]})})}const hO=[{provider:"claude",title:"Claude Code",connectedClassName:"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800",iconContainerClassName:"bg-blue-100 dark:bg-blue-900/30",loginButtonClassName:"bg-blue-600 hover:bg-blue-700"},{provider:"cursor",title:"Cursor",connectedClassName:"bg-purple-50 dark:bg-purple-900/20 border-purple-200 dark:border-purple-800",iconContainerClassName:"bg-purple-100 dark:bg-purple-900/30",loginButtonClassName:"bg-purple-600 hover:bg-purple-700"},{provider:"codex",title:"OpenAI Codex",connectedClassName:"bg-gray-100 dark:bg-gray-800/50 border-gray-300 dark:border-gray-600",iconContainerClassName:"bg-gray-100 dark:bg-gray-800",loginButtonClassName:"bg-gray-800 hover:bg-gray-900 dark:bg-gray-700 dark:hover:bg-gray-600"},{provider:"gemini",title:"Gemini",connectedClassName:"bg-teal-50 dark:bg-teal-900/20 border-teal-200 dark:border-teal-800",iconContainerClassName:"bg-teal-100 dark:bg-teal-900/30",loginButtonClassName:"bg-teal-600 hover:bg-teal-700"},{provider:"qwen",title:"Qwen Code",connectedClassName:"bg-orange-50 dark:bg-orange-900/20 border-orange-200 dark:border-orange-800",iconContainerClassName:"bg-orange-100 dark:bg-orange-900/30",loginButtonClassName:"bg-orange-600 hover:bg-orange-700"}];function fO({providerStatuses:e,onOpenProviderLogin:t}){return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"mb-6 text-center",children:[i.jsx("h2",{className:"mb-2 text-2xl font-bold text-foreground",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.jsx("div",{className:"space-y-3",children:hO.map(r=>i.jsx(mO,{provider:r.provider,title:r.title,status:e[r.provider],connectedClassName:r.connectedClassName,iconContainerClassName:r.iconContainerClassName,loginButtonClassName:r.loginButtonClassName,onLogin:()=>t(r.provider)},r.provider))}),i.jsx("div",{className:"pt-2 text-center text-sm text-muted-foreground",children:i.jsx("p",{children:"You can configure these later in Settings."})})]})}function gO({gitName:e,gitEmail:t,isSubmitting:r,onGitNameChange:n,onGitEmailChange:a}){return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"mb-8 text-center",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-blue-100 dark:bg-blue-900/30",children:i.jsx(Qr,{className:"h-8 w-8 text-blue-600 dark:text-blue-400"})}),i.jsx("h2",{className:"mb-2 text-2xl font-bold text-foreground",children:"Git Configuration"}),i.jsx("p",{className:"text-muted-foreground",children:"Configure your git identity to ensure proper attribution for commits."})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsxs("label",{htmlFor:"gitName",className:"mb-2 flex items-center gap-2 text-sm font-medium text-foreground",children:[i.jsx(PD,{className:"h-4 w-4"}),"Git Name ",i.jsx("span",{className:"text-red-500",children:"*"})]}),i.jsx("input",{type:"text",id:"gitName",value:e,onChange:s=>n(s.target.value),className:"w-full rounded-lg border border-border bg-background px-4 py-3 text-foreground focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500",placeholder:"John Doe",required:!0,disabled:r}),i.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Saved as `git config --global user.name`."})]}),i.jsxs("div",{children:[i.jsxs("label",{htmlFor:"gitEmail",className:"mb-2 flex items-center gap-2 text-sm font-medium text-foreground",children:[i.jsx(OD,{className:"h-4 w-4"}),"Git Email ",i.jsx("span",{className:"text-red-500",children:"*"})]}),i.jsx("input",{type:"email",id:"gitEmail",value:t,onChange:s=>a(s.target.value),className:"w-full rounded-lg border border-border bg-background px-4 py-3 text-foreground focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500",placeholder:"john@example.com",required:!0,disabled:r}),i.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Saved as `git config --global user.email`."})]})]})]})}const Xv=[{title:"Git Configuration",icon:Qr,required:!0},{title:"Connect Agents",icon:hE,required:!1},{title:"Task System",icon:Ef,required:!1}];function bO({currentStep:e}){return i.jsx("div",{className:"mb-8",children:i.jsx("div",{className:"flex items-center justify-between",children:Xv.map((t,r)=>{const n=r<e,a=r===e,s=t.icon;return i.jsxs("div",{className:"contents",children:[i.jsxs("div",{className:"flex flex-1 flex-col items-center",children:[i.jsx("div",{className:`flex h-12 w-12 items-center justify-center rounded-full border-2 transition-colors duration-200 ${n?"border-green-500 bg-green-500 text-white":a?"border-blue-600 bg-blue-600 text-white":"border-border bg-background text-muted-foreground"}`,children:n?i.jsx(rr,{className:"h-6 w-6"}):i.jsx(s,{className:"h-6 w-6"})}),i.jsxs("div",{className:"mt-2 text-center",children:[i.jsx("p",{className:`text-sm font-medium ${a?"text-foreground":"text-muted-foreground"}`,children:t.title}),t.required&&i.jsx("span",{className:"text-xs text-red-500",children:"Required"})]})]}),r<Xv.length-1&&i.jsx("div",{className:`mx-2 h-0.5 flex-1 transition-colors duration-200 ${n?"bg-green-500":"bg-border"}`})]},t.title)})})})}const xO=e=>e?e.installation?.isInstalled?e.installation.version?`TaskMaster CLI installed (${e.installation.version}).`:"TaskMaster CLI installed.":e.installation?.reason||"TaskMaster CLI is not installed yet.":"Checking TaskMaster installation...";function yO({enabled:e,onEnabledChange:t,onReadyChange:r}){const[n,a]=h.useState(null),[s,o]=h.useState(!0),[l,c]=h.useState(!1),[d,u]=h.useState([]),[p,f]=h.useState(""),m=h.useRef(null),g=!!n?.installation?.isInstalled,b=!!n?.mcpServer?.hasMCPServer,x=h.useMemo(()=>!e||g,[e,g]);h.useEffect(()=>{r(x)},[r,x]);const y=h.useCallback(async()=>{o(!0),f("");try{const w=await ve("/api/taskmaster/installation-status"),k=await w.json();a(k),w.ok||f(k.installation?.reason||"TaskMaster status check failed.")}catch(w){a(null),f(w instanceof Error?w.message:"TaskMaster status check failed.")}finally{o(!1)}},[]);h.useEffect(()=>(y(),()=>{m.current?.close(),m.current=null}),[y]);const v=h.useCallback(async()=>{c(!0),f(""),u([]);try{const w=await ve("/api/taskmaster/install",{method:"POST"}),k=await w.json();if(!w.ok||!k.success||!k.jobId)throw new Error(k.error||k.message||"TaskMaster install could not start.");const E=localStorage.getItem(Ud),S=E?`?token=${encodeURIComponent(E)}`:"",j=new EventSource(`/api/taskmaster/install/${encodeURIComponent(k.jobId)}/stream${S}`);m.current=j,j.addEventListener("log",_=>{const T=JSON.parse(_.data);u(C=>[...C,T].slice(-80))}),j.addEventListener("done",_=>{const T=JSON.parse(_.data);if(j.close(),m.current=null,c(!1),!T.success){f(T.error||T.message||"TaskMaster install failed.");return}y()}),j.onerror=()=>{j.close(),m.current=null,c(!1),f("TaskMaster install stream disconnected.")}}catch(w){c(!1),f(w instanceof Error?w.message:"TaskMaster install could not start.")}},[y]);return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"Task System"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Decide whether Pixcode should enable TaskMaster-backed planning, kanban tasks, PRD parsing, and agent task execution from the start."})]}),i.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border border-border bg-background p-4 transition-colors hover:bg-muted/40",children:[i.jsx("input",{type:"checkbox",checked:e,onChange:w=>t(w.target.checked),className:"mt-1 h-4 w-4"}),i.jsxs("span",{className:"min-w-0 space-y-1",children:[i.jsx("span",{className:"block text-sm font-medium text-foreground",children:"Enable TaskMaster features"}),i.jsx("span",{className:"block text-sm leading-6 text-muted-foreground",children:"This keeps the Tasks panel, PRD tools, and orchestration task sync available. You can change it later in Settings."})]})]}),e&&i.jsxs("div",{className:"space-y-4 rounded-lg border border-border bg-card p-4",children:[i.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[g?i.jsx(ra,{className:"h-5 w-5 text-green-600"}):i.jsx(Gr,{className:"h-5 w-5 text-primary"}),i.jsx("h3",{className:"font-medium text-foreground",children:"TaskMaster CLI"})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:xO(n)}),g&&!b&&i.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400",children:"MCP server is not configured yet. Core task files work now; MCP can be connected later from Settings."})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{type:"button",onClick:()=>void y(),disabled:s||l,className:"rounded-md border border-border px-3 py-2 text-sm text-foreground transition-colors hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50",children:s?"Checking...":"Refresh"}),!g&&i.jsxs("button",{type:"button",onClick:()=>void v(),disabled:l,className:"inline-flex items-center gap-2 rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-60",children:[l&&i.jsx(Ot,{className:"h-4 w-4 animate-spin"}),l?"Installing...":"Install"]})]})]}),p&&i.jsx("div",{className:"rounded-md border border-red-300 bg-red-50 p-3 text-sm text-red-700 dark:border-red-800 dark:bg-red-950/30 dark:text-red-300",children:p}),d.length>0&&i.jsx("pre",{className:"max-h-48 overflow-auto rounded-md bg-black p-3 text-xs leading-5 text-green-200",children:d.map(w=>`${w.stream}> ${w.chunk}`).join("")})]})]})}const Jv=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Qv=async(e,t)=>{try{return(await e.json()).error||t}catch{return t}};function vO({onComplete:e}){const[t,r]=h.useState(0),[n,a]=h.useState(""),[s,o]=h.useState(""),[l,c]=h.useState(!1),[d,u]=h.useState(""),[p,f]=h.useState(null),[m,g]=h.useState(()=>{try{const A=localStorage.getItem("tasks-enabled");return A===null?!0:JSON.parse(A)!==!1}catch{return!0}}),[b,x]=h.useState(!1),{providerAuthStatus:y,checkProviderAuthStatus:v,refreshProviderAuthStatuses:w}=yf(),k=h.useRef(void 0),E=h.useCallback(async()=>{try{const A=await ve("/api/user/git-config");if(!A.ok)return;const I=await A.json();I.gitName&&a(I.gitName),I.gitEmail&&o(I.gitEmail)}catch(A){console.error("Error loading git config:",A)}},[]);h.useEffect(()=>{E(),w()},[E,w]),h.useEffect(()=>{const A=k.current;k.current=p,A!=null&&p===null&&w()},[p,w]);const S=A=>{f(A)},j=A=>{A===0&&p&&v(p)},_=async()=>{if(u(""),t!==0){r(A=>A+1);return}if(!n.trim()||!s.trim()){u("Both git name and email are required.");return}if(!Jv.test(s)){u("Please enter a valid email address.");return}c(!0);try{const A=await ve("/api/user/git-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gitName:n,gitEmail:s})});if(!A.ok){const I=await Qv(A,"Failed to save git configuration");throw new Error(I)}r(I=>I+1)}catch(A){u(A instanceof Error?A.message:"Failed to save git configuration")}finally{c(!1)}},T=()=>{u(""),r(A=>A-1)},C=async()=>{if(m&&!b){u("Install TaskMaster or disable TaskMaster features to finish setup.");return}c(!0),u("");try{localStorage.setItem("tasks-enabled",JSON.stringify(m));const A=await ve("/api/user/complete-onboarding",{method:"POST"});if(!A.ok){const I=await Qv(A,"Failed to complete onboarding");throw new Error(I)}await e?.()}catch(A){u(A instanceof Error?A.message:"Failed to complete onboarding")}finally{c(!1)}},L=t===0?!!(n.trim()&&s.trim()&&Jv.test(s)):t===2?!m||b:!0;return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:i.jsxs("div",{className:"w-full max-w-2xl",children:[i.jsx(bO,{currentStep:t}),i.jsxs("div",{className:"rounded-lg border border-border bg-card p-8 shadow-lg",children:[t===0?i.jsx(gO,{gitName:n,gitEmail:s,isSubmitting:l,onGitNameChange:a,onGitEmailChange:o}):t===1?i.jsx(fO,{providerStatuses:y,onOpenProviderLogin:S}):i.jsx(yO,{enabled:m,onEnabledChange:g,onReadyChange:x}),d&&i.jsx("div",{className:"mt-6 rounded-lg border border-red-300 bg-red-100 p-4 dark:border-red-800 dark:bg-red-900/20",children:i.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:d})}),i.jsxs("div",{className:"mt-8 flex items-center justify-between border-t border-border pt-6",children:[i.jsxs("button",{onClick:T,disabled:t===0||l,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-muted-foreground transition-colors duration-200 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",children:[i.jsx(Sf,{className:"h-4 w-4"}),"Previous"]}),i.jsx("div",{className:"flex items-center gap-3",children:t<2?i.jsx("button",{onClick:_,disabled:!L||l,className:"flex items-center gap-2 rounded-lg bg-blue-600 px-6 py-3 font-medium text-white transition-colors duration-200 hover:bg-blue-700 disabled:cursor-not-allowed disabled:bg-blue-400",children:l?i.jsxs(i.Fragment,{children:[i.jsx(Ot,{className:"h-4 w-4 animate-spin"}),"Saving..."]}):i.jsxs(i.Fragment,{children:["Next",i.jsx(An,{className:"h-4 w-4"})]})}):i.jsx("button",{onClick:C,disabled:l,className:"flex items-center gap-2 rounded-lg bg-green-600 px-6 py-3 font-medium text-white transition-colors duration-200 hover:bg-green-700 disabled:cursor-not-allowed disabled:bg-green-400",children:l?i.jsxs(i.Fragment,{children:[i.jsx(Ot,{className:"h-4 w-4 animate-spin"}),"Completing..."]}):i.jsxs(i.Fragment,{children:[i.jsx(rr,{className:"h-4 w-4"}),"Complete Setup"]})})})]})]})]})}),p&&i.jsx(IE,{isOpen:!!p,onClose:()=>f(null),provider:p,onComplete:j})]})}const wO=["0s","0.1s","0.2s"];function kO(){return i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"mb-4 flex justify-center",children:i.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-lg bg-primary shadow-sm",children:i.jsx(na,{className:"h-8 w-8 text-primary-foreground"})})}),i.jsx("h1",{className:"mb-2 text-2xl font-bold text-foreground",children:"Pixcode"}),i.jsx("div",{className:"flex items-center justify-center space-x-2",children:wO.map(e=>i.jsx("div",{className:"h-2 w-2 animate-bounce rounded-full bg-blue-500",style:{animationDelay:e}},e))}),i.jsx("p",{className:"mt-2 text-muted-foreground",children:"Loading..."})]})})}function RE({errorMessage:e}){return e?i.jsx("div",{className:"rounded-md border border-red-300 bg-red-100 p-3 dark:border-red-800 dark:bg-red-900/20",children:i.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:e})}):null}function Ii({id:e,label:t,value:r,onChange:n,placeholder:a,isDisabled:s,type:o="text",name:l,autoComplete:c}){return i.jsxs("div",{children:[i.jsx("label",{htmlFor:e,className:"mb-1 block text-sm font-medium text-foreground",children:t}),i.jsx("input",{id:e,type:o,name:l??e,autoComplete:c,value:r,onChange:d=>n(d.target.value),className:"w-full rounded-md border border-border bg-background px-3 py-2 text-foreground focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500",placeholder:a,required:!0,disabled:s})]})}function LE({title:e,description:t,children:r,footerText:n,logo:a}){return i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:i.jsx("div",{className:"w-full max-w-md",children:i.jsxs("div",{className:"space-y-6 rounded-lg border border-border bg-card p-8 shadow-lg",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"mb-4 flex justify-center",children:a??i.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-lg bg-primary shadow-sm",children:i.jsx(na,{className:"h-8 w-8 text-primary-foreground"})})}),i.jsx("h1",{className:"text-2xl font-bold text-foreground",children:e}),i.jsx("p",{className:"mt-2 text-muted-foreground",children:t})]}),r,i.jsx("div",{className:"text-center",children:i.jsx("p",{className:"text-sm text-muted-foreground",children:n})}),i.jsxs("div",{className:"flex items-center justify-center gap-1.5 pt-2",children:[i.jsx("svg",{className:"h-3.5 w-3.5 text-muted-foreground/50",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:i.jsx("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"})}),i.jsx("a",{href:"https://github.com/alicomert/pixcode",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground/50 transition-colors hover:text-muted-foreground",children:"Pixcode is open source"})]})]})})})}const SO={username:"",password:""};function EO(){const{t:e}=Me("auth"),{login:t}=Ki(),[r,n]=h.useState(SO),[a,s]=h.useState(""),[o,l]=h.useState(!1),c=h.useCallback((u,p)=>{n(f=>({...f,[u]:p}))},[]),d=h.useCallback(async u=>{if(u.preventDefault(),s(""),!r.username.trim()||!r.password){s(e("login.errors.requiredFields"));return}l(!0);const p=await t(r.username.trim(),r.password);p.success||s(p.error),l(!1)},[r.password,r.username,t,e]);return i.jsx(LE,{title:e("login.title"),description:e("login.description"),footerText:"Enter your credentials to access Pixcode",children:i.jsxs("form",{onSubmit:d,className:"space-y-4",children:[i.jsx(Ii,{id:"username",label:e("login.username"),value:r.username,onChange:u=>c("username",u),placeholder:e("login.placeholders.username"),isDisabled:o,autoComplete:"username"}),i.jsx(Ii,{id:"password",label:e("login.password"),value:r.password,onChange:u=>c("password",u),placeholder:e("login.placeholders.password"),isDisabled:o,type:"password",autoComplete:"current-password"}),i.jsx(RE,{errorMessage:a}),i.jsx("button",{type:"submit",disabled:o,className:"w-full rounded-md bg-blue-600 px-4 py-2 font-medium text-white transition-colors duration-200 hover:bg-blue-700 disabled:bg-blue-400",children:e(o?"login.loading":"login.submit")})]})})}const NO={username:"",password:"",confirmPassword:"",connectionMode:"local",remoteUrl:"",remoteApiKey:""};function CO(e){return!e.username.trim()||!e.password||!e.confirmPassword?"Please fill in all fields.":e.username.trim().length<3?"Username must be at least 3 characters long.":e.password.length<6?"Password must be at least 6 characters long.":e.password!==e.confirmPassword?"Passwords do not match.":e.connectionMode==="remote"&&!e.remoteUrl.trim()?"Remote Pixcode server URL is required.":null}function AO(){const{register:e}=Ki(),[t,r]=h.useState(NO),[n,a]=h.useState(""),[s,o]=h.useState(!1),l=h.useCallback((d,u)=>{r(p=>({...p,[d]:u}))},[]),c=h.useCallback(async d=>{d.preventDefault(),a("");const u=CO(t);if(u){a(u);return}o(!0);const p=await fetch("/api/auth/connection-mode",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:t.connectionMode,remoteUrl:t.connectionMode==="remote"?t.remoteUrl.trim():null,apiKey:t.connectionMode==="remote"?t.remoteApiKey.trim():null})});if(!p.ok){const m=await p.json().catch(()=>null);a(m?.error||"Could not save connection mode."),o(!1);return}const f=await e(t.username.trim(),t.password);f.success||a(f.error),o(!1)},[t,e]);return i.jsx(LE,{title:"Welcome to Pixcode",description:"Set up your account to get started",footerText:"This is a single-user system. Only one account can be created.",logo:i.jsx("img",{src:"/logo.svg",alt:"Pixcode",className:"h-16 w-16"}),children:i.jsxs("form",{onSubmit:c,className:"space-y-4",children:[i.jsxs("div",{className:"grid gap-2 rounded-lg border border-border/70 bg-muted/30 p-2 sm:grid-cols-2",children:[i.jsxs("button",{type:"button",onClick:()=>l("connectionMode","local"),disabled:s,className:`rounded-md px-3 py-2 text-left text-sm transition-colors ${t.connectionMode==="local"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-background/60 hover:text-foreground"}`,children:[i.jsx("span",{className:"block font-medium",children:"Use this computer directly"}),i.jsx("span",{className:"block text-xs opacity-80",children:"Run Pixcode and CLIs on this machine."})]}),i.jsxs("button",{type:"button",onClick:()=>l("connectionMode","remote"),disabled:s,className:`rounded-md px-3 py-2 text-left text-sm transition-colors ${t.connectionMode==="remote"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-background/60 hover:text-foreground"}`,children:[i.jsx("span",{className:"block font-medium",children:"Connect to a remote Pixcode server"}),i.jsx("span",{className:"block text-xs opacity-80",children:"Control another always-on Pixcode host by API."})]})]}),t.connectionMode==="remote"&&i.jsxs("div",{className:"space-y-3 rounded-lg border border-border/70 bg-muted/20 p-3",children:[i.jsx(Ii,{id:"remoteUrl",name:"remoteUrl",label:"Remote API URL",value:t.remoteUrl,onChange:d=>l("remoteUrl",d),placeholder:"https://your-server.example.com",isDisabled:s,autoComplete:"url"}),i.jsx(Ii,{id:"remoteApiKey",name:"remoteApiKey",label:"Remote API Key",value:t.remoteApiKey,onChange:d=>l("remoteApiKey",d),placeholder:"px_...",isDisabled:s,type:"password",autoComplete:"off"})]}),i.jsx(Ii,{id:"username",name:"username",label:"Username",value:t.username,onChange:d=>l("username",d),placeholder:"Enter your username",isDisabled:s,autoComplete:"username"}),i.jsx(Ii,{id:"password",name:"password",label:"Password",value:t.password,onChange:d=>l("password",d),placeholder:"Enter your password",isDisabled:s,type:"password",autoComplete:"new-password"}),i.jsx(Ii,{id:"confirmPassword",name:"confirmPassword",label:"Confirm Password",value:t.confirmPassword,onChange:d=>l("confirmPassword",d),placeholder:"Confirm your password",isDisabled:s,type:"password",autoComplete:"new-password"}),i.jsx(RE,{errorMessage:n}),i.jsx("button",{type:"submit",disabled:s,className:"w-full rounded-md bg-blue-600 px-4 py-2 font-medium text-white transition-colors duration-200 hover:bg-blue-700 disabled:bg-blue-400",children:s?"Setting up...":"Create Account"})]})})}function TO({children:e}){const{user:t,isLoading:r,needsSetup:n,hasCompletedOnboarding:a,refreshOnboardingStatus:s}=Ki();return r?i.jsx(kO,{}):n?i.jsx(AO,{}):t?a?i.jsx(i.Fragment,{children:e}):i.jsx(vO,{onComplete:s}):i.jsx(EO,{})}const DE=h.createContext(null),OE=()=>{const e=h.useContext(DE);if(!e)throw new Error("useWebSocket must be used within a WebSocketProvider");return e},jO=e=>{const t=window.location.protocol==="https:"?"wss:":"ws:";return e?`${t}//${window.location.host}/ws?token=${encodeURIComponent(e)}`:null},_O=()=>{const e=h.useRef(null),t=h.useRef(!1),r=h.useRef(!1),[n,a]=h.useState(null),[s,o]=h.useState(!1),l=h.useRef(null),{token:c}=Ki(),d=h.useCallback(()=>{if(!t.current)try{const f=jO(c);if(!f)return console.warn("No authentication token found for WebSocket connection");const m=new WebSocket(f);m.onopen=()=>{o(!0),e.current=m,r.current&&a({type:"websocket-reconnected",timestamp:Date.now()}),r.current=!0},m.onmessage=g=>{try{const b=JSON.parse(g.data);a(b)}catch(b){console.error("Error parsing WebSocket message:",b)}},m.onclose=()=>{o(!1),e.current=null,l.current=setTimeout(()=>{t.current||d()},3e3)},m.onerror=g=>{console.error("WebSocket error:",g)}}catch(f){console.error("Error creating WebSocket connection:",f)}},[c]);h.useEffect(()=>(d(),()=>{t.current=!0,l.current&&clearTimeout(l.current),e.current&&e.current.close()}),[d]);const u=h.useCallback(f=>{const m=e.current;m&&m.readyState===WebSocket.OPEN?m.send(JSON.stringify(f)):console.warn("WebSocket not connected")},[]);return h.useMemo(()=>({ws:e.current,sendMessage:u,latestMessage:n,isConnected:s}),[u,n,s])},IO=({children:e})=>{const t=_O();return i.jsx(DE.Provider,{value:t,children:e})},ME=h.createContext(null);function RO(e,t){return{message:t instanceof Error?t.message:`Failed to ${e}`,context:e,timestamp:new Date().toISOString()}}function ew(e){return{...e,taskMasterConfigured:e.taskmaster?.hasTaskmaster??!1,taskMasterStatus:e.taskmaster?.status??"not-configured",taskCount:Number(e.taskmaster?.metadata?.taskCount??0),completedCount:Number(e.taskmaster?.metadata?.completed??0)}}function LO(e){return e.find(t=>t.status==="pending"||t.status==="in-progress")??null}function DO(e){return e?.type?e.type.startsWith("taskmaster-"):!1}function eo(){const e=h.useContext(ME);if(!e)throw new Error("useTaskMaster must be used within a TaskMasterProvider");return e}function OO({children:e}){const{latestMessage:t}=OE(),{user:r,token:n,isLoading:a}=Ki(),[s,o]=h.useState([]),[l,c]=h.useState(null),[d,u]=h.useState(null),[p,f]=h.useState(null),[m,g]=h.useState([]),[b,x]=h.useState(null),[y,v]=h.useState(!1),[w,k]=h.useState(!1),[E,S]=h.useState(!1),[j,_]=h.useState(null),T=h.useRef(null);h.useEffect(()=>{T.current=l?.name??null},[l?.name]);const C=h.useCallback(()=>{_(null)},[]),L=h.useCallback((z,U)=>{console.error(`TaskMaster ${z} error:`,U),_(RO(z,U))},[]),A=h.useCallback(z=>{const U=z?ew(z):null;c(U),u(U?.taskmaster??null),g([]),x(null)},[]),I=h.useCallback(async()=>{if(!r||!n){o([]),c(null),u(null),g([]),x(null);return}try{v(!0),C();const z=await ot.get("/projects");if(!z.ok)throw new Error(`Failed to fetch projects: ${z.status}`);const U=await z.json(),O=(Array.isArray(U)?U:[]).map(F=>ew(F));o(O);const G=T.current;if(!G)return;const $=O.find(F=>F.name===G)??null;c($),u($?.taskmaster??null)}catch(z){L("load projects",z)}finally{v(!1)}},[C,L,n,r]),N=h.useCallback(async()=>{const z=l?.name;if(!z||!r||!n){g([]),x(null);return}try{k(!0),C();const U=await ot.get(`/taskmaster/tasks/${encodeURIComponent(z)}`);if(!U.ok){const G=await U.json();throw new Error(G.message??"Failed to load tasks")}const V=await U.json(),O=Array.isArray(V.tasks)?V.tasks:[];g(O),x(LO(O))}catch(U){L("load tasks",U),g([]),x(null)}finally{k(!1)}},[C,l?.name,L,n,r]),P=h.useCallback(async()=>{if(!r||!n){f(null);return}try{S(!0),C();const z=await ot.get("/mcp-utils/taskmaster-server");if(!z.ok)throw new Error(`Failed to load MCP status: ${z.status}`);const U=await z.json();f(U)}catch(z){L("check MCP server status",z),f(null)}finally{S(!1)}},[C,L,n,r]);h.useEffect(()=>{!a&&r&&n&&(I(),P())},[a,P,I,n,r]),h.useEffect(()=>{l?.name&&r&&n&&N()},[l?.name,N,n,r]),h.useEffect(()=>{const z=t;if(DO(z)){if(z.type==="taskmaster-project-updated"&&z.projectName){I();return}if(z.type==="taskmaster-tasks-updated"&&z.projectName===l?.name){N();return}z.type==="taskmaster-mcp-status-changed"&&P()}},[l?.name,t,P,I,N]);const H=h.useMemo(()=>({projects:s,currentProject:l,projectTaskMaster:d,mcpServerStatus:p,tasks:m,nextTask:b,isLoading:y,isLoadingTasks:w,isLoadingMCP:E,error:j,refreshProjects:I,setCurrentProject:A,refreshTasks:N,refreshMCPStatus:P,clearError:C}),[C,l,j,y,E,w,p,b,d,s,P,I,N,A,m]);return i.jsx(ME.Provider,{value:H,children:e})}const PE=h.createContext({tasksEnabled:!0,setTasksEnabled:()=>{},toggleTasksEnabled:()=>{},isTaskMasterInstalled:null,isTaskMasterReady:null,installationStatus:null,isCheckingInstallation:!0,refreshTaskMasterInstallation:async()=>{}}),Kd=()=>{const e=h.useContext(PE);if(!e)throw new Error("useTasksSettings must be used within a TasksSettingsProvider");return e},MO=({children:e})=>{const{user:t,token:r,isLoading:n}=Ki(),[a,s]=h.useState(()=>{const v=localStorage.getItem("tasks-enabled");return v!==null?JSON.parse(v):!0}),[o,l]=h.useState(null),[c,d]=h.useState(null),[u,p]=h.useState(null),[f,m]=h.useState(!0),g=!!(t&&r);h.useEffect(()=>{localStorage.setItem("tasks-enabled",JSON.stringify(a))},[a]);const b=h.useCallback(async({signal:v}={})=>{if(!n){if(!g){p(null),l(null),d(null),m(!1);return}m(!0);try{const w=await ot.get("/taskmaster/installation-status");if(v?.aborted)return;if(w.ok){const k=await w.json();if(v?.aborted)return;p(k),l(k.installation?.isInstalled||!1),d(k.isReady||!1);const E=localStorage.getItem("tasks-enabled");!k.installation?.isInstalled&&!E&&s(!1)}else console.error("Failed to check TaskMaster installation status"),l(!1),d(!1)}catch(w){if(v?.aborted)return;console.error("Error checking TaskMaster installation:",w),l(!1),d(!1)}finally{v?.aborted||m(!1)}}},[g,n]);h.useEffect(()=>{const v=new AbortController,w=setTimeout(()=>{b({signal:v.signal})},0);return()=>{v.abort(),clearTimeout(w)}},[b]);const y={tasksEnabled:a,setTasksEnabled:s,toggleTasksEnabled:()=>{s(v=>!v)},isTaskMasterInstalled:o,isTaskMasterReady:c,installationStatus:u,isCheckingInstallation:f,refreshTaskMasterInstallation:b};return i.jsx(PE.Provider,{value:y,children:e})},FE=h.createContext(null);function Yd(){const e=h.useContext(FE);if(!e)throw new Error("usePlugins must be used within a PluginsProvider");return e}function PO({children:e}){const{user:t,token:r,isLoading:n}=Ki(),[a,s]=h.useState([]),[o,l]=h.useState(!0),[c,d]=h.useState(null),u=!!(t&&r),p=h.useCallback(async()=>{if(!u){s([]),d(null),l(!1);return}l(!0);try{const x=await ve("/api/plugins");if(x.ok){const y=await x.json();s(y.plugins||[]),d(null)}else{let y=`Failed to fetch plugins (${x.status})`;try{const v=await x.json();y=v.details||v.error||y}catch{y=x.statusText||y}d(y)}}catch(x){const y=x instanceof Error?x.message:"Failed to fetch plugins";d(y),console.error("[Plugins] Failed to fetch plugins:",x)}finally{l(!1)}},[u]);h.useEffect(()=>{n||p()},[n,p]);const f=h.useCallback(async x=>{try{const y=await ve("/api/plugins/install",{method:"POST",body:JSON.stringify({url:x})}),v=await y.json();return y.ok?(await p(),{success:!0}):{success:!1,error:v.details||v.error||"Install failed"}}catch(y){return{success:!1,error:y instanceof Error?y.message:"Install failed"}}},[p]),m=h.useCallback(async x=>{try{const y=await ve(`/api/plugins/${encodeURIComponent(x)}`,{method:"DELETE"}),v=await y.json();return y.ok?(await p(),{success:!0}):{success:!1,error:v.details||v.error||"Uninstall failed"}}catch(y){return{success:!1,error:y instanceof Error?y.message:"Uninstall failed"}}},[p]),g=h.useCallback(async x=>{try{const y=await ve(`/api/plugins/${encodeURIComponent(x)}/update`,{method:"POST"}),v=await y.json();return y.ok?(await p(),{success:!0}):{success:!1,error:v.details||v.error||"Update failed"}}catch(y){return{success:!1,error:y instanceof Error?y.message:"Update failed"}}},[p]),b=h.useCallback(async(x,y)=>{try{const v=await ve(`/api/plugins/${encodeURIComponent(x)}/enable`,{method:"PUT",body:JSON.stringify({enabled:y})});if(!v.ok){let w=`Toggle failed (${v.status})`;try{const k=await v.json();w=k.details||k.error||w}catch{w=v.statusText||w}return{success:!1,error:w}}return await p(),{success:!0,error:null}}catch(v){return{success:!1,error:v instanceof Error?v.message:"Toggle failed"}}},[p]);return i.jsx(FE.Provider,{value:{plugins:a,loading:o,pluginsError:c,refreshPlugins:p,installPlugin:f,uninstallPlugin:m,updatePlugin:g,togglePlugin:b},children:e})}const tw=e=>typeof window>"u"?!1:window.innerWidth<e,rw=()=>{if(typeof window>"u")return!1;const e=window.navigator;return window.matchMedia("(display-mode: standalone)").matches||!!e.standalone||document.referrer.includes("android-app://")};function Lf(e={}){const{mobileBreakpoint:t=768,trackMobile:r=!0,trackPWA:n=!0}=e,[a,s]=h.useState(()=>r?tw(t):!1),[o,l]=h.useState(()=>n?rw():!1);return h.useEffect(()=>{if(!r||typeof window>"u")return;const c=()=>{s(tw(t))};return c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}},[t,r]),h.useEffect(()=>{if(!n||typeof window>"u")return;const c=window.matchMedia("(display-mode: standalone)"),d=()=>{l(rw())};return d(),typeof c.addEventListener=="function"?(c.addEventListener("change",d),()=>{c.removeEventListener("change",d)}):(c.addListener(d),()=>{c.removeListener(d)})},[n]),{isMobile:a,isPWA:o}}const Df="pixcode.updateCheck.preferences",Zm="pixcode:update-check-settings-changed",Of=[{value:"30m",label:"Every 30 minutes",intervalMs:1800*1e3},{value:"24h",label:"Daily",intervalMs:1440*60*1e3},{value:"12h",label:"Every 12 hours",intervalMs:720*60*1e3},{value:"6h",label:"Every 6 hours",intervalMs:360*60*1e3},{value:"7d",label:"Weekly",intervalMs:10080*60*1e3},{value:"off",label:"Manual only",intervalMs:null}],Xm={frequency:"30m"};function nw(e){return Of.find(t=>t.value===e.frequency)?.intervalMs??null}function zE(e){if(!e||typeof e!="object")return Xm;const t=e.frequency;return Of.some(r=>r.value===t)?{frequency:t}:Xm}function aw(){try{const e=localStorage.getItem(Df);return zE(e?JSON.parse(e):null)}catch{return Xm}}function FO(e){const t=zE(e);localStorage.setItem(Df,JSON.stringify(t)),window.dispatchEvent(new CustomEvent(Zm,{detail:t}))}const $u=(e,t)=>{const r=e.split(".").map(Number),n=t.split(".").map(Number);for(let a=0;a<Math.max(r.length,n.length);a++){const s=r[a]||0,o=n[a]||0;if(s!==o)return s-o}return 0},zO="1.40.10",Jm="pixcode:update-available",BO=360*60*1e3,Uu=new Map;function BE(e,t){return`pixcode.updateCheck.cache.${e}.${t}`}function $O(e,t){try{const r=localStorage.getItem(BE(e,t));if(!r)return null;const n=JSON.parse(r);return{fetchedAt:typeof n.fetchedAt=="number"?n.fetchedAt:null,latestVersion:typeof n.latestVersion=="string"?n.latestVersion:null,releaseInfo:n.releaseInfo??null,rateLimitedUntil:typeof n.rateLimitedUntil=="number"?n.rateLimitedUntil:void 0}}catch{return null}}function iw(e,t,r){localStorage.setItem(BE(e,t),JSON.stringify(r))}function UO(e,t){const r=`${e}/${t}`,n=Uu.get(r);if(n)return n;const a=fetch(`https://api.github.com/repos/${e}/${t}/releases/latest`,{cache:"no-store",headers:{Accept:"application/vnd.github+json"}}).then(async s=>({status:s.status,ok:s.ok,data:await s.json().catch(()=>({}))})).finally(()=>{Uu.delete(r)});return Uu.set(r,a),a}const $E=(e,t)=>{const[r,n]=h.useState(!1),[a,s]=h.useState(null),[o,l]=h.useState(null),[c,d]=h.useState("git"),[u,p]=h.useState("idle"),[f,m]=h.useState(null),[g,b]=h.useState(()=>aw()),[x,y]=h.useState(zO),v=h.useRef(null),w=h.useCallback(E=>{FO(E),b(E)},[]);h.useEffect(()=>{const E=()=>b(aw()),S=j=>{j.key===Df&&E()};return window.addEventListener("storage",S),window.addEventListener(Zm,E),()=>{window.removeEventListener("storage",S),window.removeEventListener(Zm,E)}},[]),h.useEffect(()=>{let E=!1;const S=async()=>{try{const T=await(await fetch("/health",{cache:"no-store"})).json();if(E)return;(T.installMode==="npm"||T.installMode==="git")&&d(T.installMode),typeof T.version=="string"&&/^\d+\.\d+\.\d+/.test(T.version)&&y(T.version)}catch{}};S();const j=()=>{S()};return window.addEventListener("focus",j),()=>{E=!0,window.removeEventListener("focus",j)}},[]),h.useEffect(()=>{if(!x)return;let E=!1;const S=(A,I,N,P)=>({updateAvailable:!!(A&&$u(A,x)>0),latestVersion:A,releaseInfo:I,currentVersion:x,checkedAt:N,status:P}),j=A=>{!A.updateAvailable||!A.latestVersion||!A.releaseInfo||window.dispatchEvent(new CustomEvent(Jm,{detail:A}))},_=(A,I,N,P="success")=>{if(!A||!I)return n(!1),s(null),l(null),m(N),S(null,null,N,P);s(A),n($u(A,x)>0),l(I),m(N);const H=S(A,I,N,P);return j(H),H},T=async({force:A=!1}={})=>{const I=nw(g),N=$O(e,t),P=Date.now();if(!A&&I===null)return p("idle"),_(N?.latestVersion??null,N?.releaseInfo??null,N?.fetchedAt??null,"idle");if(!A&&N?.fetchedAt&&I!==null&&P-N.fetchedAt<I)return p("success"),_(N.latestVersion,N.releaseInfo,N.fetchedAt,"success");if(!A&&N?.rateLimitedUntil&&N.rateLimitedUntil>P)return p("error"),_(N.latestVersion,N.releaseInfo,N.fetchedAt,"error");try{p("checking");const H=await UO(e,t);if(E)return S(N?.latestVersion??null,N?.releaseInfo??null,N?.fetchedAt??null,"idle");const z=H.data;if(!H.ok)return H.status===403&&iw(e,t,{fetchedAt:N?.fetchedAt??null,latestVersion:N?.latestVersion??null,releaseInfo:N?.releaseInfo??null,rateLimitedUntil:P+Math.max(I??0,BO)}),p("error"),_(N?.latestVersion??null,N?.releaseInfo??null,N?.fetchedAt??null,"error");if(z.tag_name){const U=z.tag_name.replace(/^v/,""),V=$u(U,x)>0,O={title:z.name||z.tag_name,body:z.body||"",htmlUrl:z.html_url||`https://github.com/${e}/${t}/releases/latest`,publishedAt:z.published_at||""};iw(e,t,{fetchedAt:P,latestVersion:U,releaseInfo:O}),s(U),n(V),V&&W4({key:`app-update:${U}`,title:"Pixcode update available",body:`Pixcode ${x} can update to ${U}.`,tag:"pixcode-app-update",data:{type:"app-update",latestVersion:U,installMode:c}}),l(O),p("success"),m(P);const G=S(U,O,P,"success");return j(G),G}else return n(!1),s(null),l(null),p("error"),S(null,null,null,"error")}catch(H){return console.error("Version check failed:",H),n(!1),s(null),l(null),p("error"),S(null,null,null,"error")}};v.current=T,T();const C=nw(g),L=C===null?null:window.setInterval(()=>{T()},C);return()=>{E=!0,L!==null&&window.clearInterval(L)}},[e,t,x,c,g]);const k=h.useCallback(async()=>v.current?await v.current({force:!0}):null,[]);return{updateAvailable:r,latestVersion:a,currentVersion:x,releaseInfo:o,installMode:c,checkStatus:u,lastCheckedAt:f,manualCheck:k,updateCheckPreferences:g,updatePreferences:w}},Ri={autoExpandTools:!1,showRawParameters:!1,showThinking:!0,autoScrollToBottom:!0,sendByCtrlEnter:!1,changeAwareness:!1,sidebarVisible:!0,historyView:"flat"},GO=["flat","grouped"],HO=e=>typeof e=="string"&&GO.includes(e),id=Object.keys(Ri),VO=new Set(id),Gu="ui-preferences:sync",qO=(e,t)=>{if(typeof e=="boolean")return e;if(typeof e=="string"){if(e==="true")return!0;if(e==="false")return!1}return t},sd=(e,t,r)=>e==="historyView"?HO(t)?t:r:qO(t,r),WO=(e,t)=>{try{const r=localStorage.getItem(e);if(r===null)return t;const n=JSON.parse(r);return sd(e,n,t)}catch{return t}},KO=e=>{if(typeof window>"u")return Ri;try{const t=localStorage.getItem(e);if(t){const r=JSON.parse(t);if(r&&typeof r=="object"&&!Array.isArray(r)){const n=r;return id.reduce((a,s)=>(a[s]=sd(s,n[s],Ri[s]),a),{...Ri})}}}catch{}return id.reduce((t,r)=>(t[r]=WO(r,Ri[r]),t),{...Ri})};function YO(e,t){switch(t.type){case"set":{const{key:r,value:n}=t;if(!VO.has(r))return e;const a=sd(r,n,e[r]);return e[r]===a?e:{...e,[r]:a}}case"set_many":{const r=t.value||{};let n=!1;const a={...e};for(const s of id){if(!(s in r))continue;const o=r[s],l=sd(s,o,e[s]);a[s]!==l&&(a[s]=l,n=!0)}return n?a:e}case"reset":return{...Ri,...t.value||{}};default:return e}}function Mf(e="uiPreferences"){const t=h.useRef(`ui-preferences-${Math.random().toString(36).slice(2)}`),[r,n]=h.useReducer(YO,e,KO);return h.useEffect(()=>{typeof window>"u"||(localStorage.setItem(e,JSON.stringify(r)),window.dispatchEvent(new CustomEvent(Gu,{detail:{storageKey:e,sourceId:t.current,value:r}})))},[r,e]),h.useEffect(()=>{if(typeof window>"u")return;const l=u=>{!u||typeof u!="object"||Array.isArray(u)||n({type:"set_many",value:u})},c=u=>{if(!(u.key!==e||u.newValue===null))try{const p=JSON.parse(u.newValue);l(p)}catch{}},d=u=>{const f=u.detail;!f||f.storageKey!==e||f.sourceId===t.current||l(f.value)};return window.addEventListener("storage",c),window.addEventListener(Gu,d),()=>{window.removeEventListener("storage",c),window.removeEventListener(Gu,d)}},[e]),{preferences:r,setPreference:(l,c)=>{n({type:"set",key:l,value:c})},setPreferences:l=>{n({type:"set_many",value:l})},resetPreferences:l=>{n({type:"reset",value:l})},dispatch:n}}const ZO=()=>{try{const e=localStorage.getItem("claude-settings");return e&&JSON.parse(e).projectSortOrder==="date"?"date":"name"}catch{return"name"}},XO=()=>{try{const e=localStorage.getItem("starredProjects");return e?new Set(JSON.parse(e)):new Set}catch{return new Set}},JO=e=>{try{localStorage.setItem("starredProjects",JSON.stringify([...e]))}catch{}},sw=(e,t)=>`${e}::${t}`,QO=()=>{try{const e=localStorage.getItem("starredSessions");return e?new Set(JSON.parse(e)):new Set}catch{return new Set}},e9=e=>{try{localStorage.setItem("starredSessions",JSON.stringify([...e]))}catch{}},t9=/(?:^|[\s/\\(\[`"'])([\w./-]+?\.(?:ts|tsx|js|jsx|mjs|cjs|py|rb|go|rs|java|kt|swift|c|cc|cpp|h|hpp|cs|php|sh|bash|zsh|json|ya?ml|toml|md|mdx|html?|css|scss|less|sql|prisma|graphql|gql|vue|svelte|astro|dart|lua|r|pl|ps1|tf|dockerfile|env))(?:$|[\s:,)\]`"'])/i,r9=e=>{if(!e)return[];const t=new Set,r=new RegExp(t9.source,"gi");let n;for(;(n=r.exec(e))!==null;){const a=n[1],s=a.lastIndexOf(".");if(s>-1){const o=a.slice(s+1).toLowerCase();o&&o.length<=10&&t.add(o)}if(t.size>=3)break}return[...t]},Fi=e=>e.__provider==="cursor"?new Date(e.createdAt||0):e.__provider==="codex"?new Date(e.createdAt||e.lastActivity||0):new Date(e.lastActivity||e.createdAt||0),n9=(e,t)=>e.__provider==="cursor"?e.summary||e.name||t("projects.untitledSession"):e.__provider==="codex"?e.summary||e.name||t("projects.codexSession"):e.__provider==="gemini"||e.__provider==="qwen"||e.__provider==="opencode"?e.summary||e.name||t("projects.newSession"):e.summary||t("projects.newSession"),a9=e=>e.__provider==="cursor"?String(e.createdAt||""):e.__provider==="codex"?String(e.createdAt||e.lastActivity||""):String(e.lastActivity||e.createdAt||""),i9=(e,t,r)=>{const n=Fi(e),a=Math.floor((t.getTime()-n.getTime())/(1e3*60));return{isCursorSession:e.__provider==="cursor",isCodexSession:e.__provider==="codex",isGeminiSession:e.__provider==="gemini",isQwenSession:e.__provider==="qwen",isOpencodeSession:e.__provider==="opencode",isActive:a<10,sessionName:n9(e,r),sessionTime:a9(e),messageCount:Number(e.messageCount||0)}},UE=(e,t)=>{const r=[...e.sessions||[],...t[e.name]||[]].map(g=>({...g,__provider:"claude"})),n=(e.cursorSessions||[]).map(g=>({...g,__provider:"cursor"})),a=(e.codexSessions||[]).map(g=>({...g,__provider:"codex"})),s=g=>typeof g.id=="string"&&g.id.startsWith("qwen_")||g.provider==="qwen",o=g=>typeof g.id=="string"&&g.id.startsWith("opencode_")||g.provider==="opencode",l=e.geminiSessions||[],c=l.filter(g=>!s(g)&&!o(g)).map(g=>({...g,__provider:"gemini"})),d=l.filter(g=>s(g)).map(g=>({...g,__provider:"qwen"})),u=l.filter(g=>o(g)).map(g=>({...g,__provider:"opencode"})),p=[...(e.qwenSessions||[]).map(g=>({...g,__provider:"qwen"})),...d],f=[...(e.opencodeSessions||[]).map(g=>({...g,__provider:"opencode"})),...u],m=new Map;for(const g of[...r,...n,...a,...c,...p,...f])m.has(g.id)||m.set(g.id,g);return[...m.values()].sort((g,b)=>Fi(b).getTime()-Fi(g).getTime())},ow=(e,t)=>{const r=UE(e,t);return r.length===0?new Date(0):r.reduce((n,a)=>{const s=Fi(a);return s>n?s:n},new Date(0))},s9=(e,t,r,n)=>{const a=[...e];return a.sort((s,o)=>{const l=r.has(s.name),c=r.has(o.name);return l&&!c?-1:!l&&c?1:t==="date"?ow(o,n).getTime()-ow(s,n).getTime():(s.displayName||s.name).localeCompare(o.displayName||o.name)}),a},o9=(e,t)=>{const r=t.trim().toLowerCase();return r?e.filter(n=>{const a=(n.displayName||n.name).toLowerCase(),s=n.name.toLowerCase();return a.includes(r)||s.includes(r)}):e},l9=(e,t)=>{const r=!!e.taskmaster?.hasTaskmaster,n=!!(t?.hasMCPServer&&t?.isConfigured);return r&&n?"fully-configured":r?"taskmaster-only":n?"mcp-only":"not-configured"},c9=e=>{const t=typeof e.fullPath=="string"&&e.fullPath.length>0?e.fullPath:typeof e.path=="string"?e.path:"";return{name:e.name,displayName:typeof e.displayName=="string"&&e.displayName.trim().length>0?e.displayName:e.name,fullPath:t,path:typeof e.path=="string"&&e.path.length>0?e.path:t}};function d9({projects:e,selectedProject:t,selectedSession:r,isLoading:n,isMobile:a,t:s,onRefresh:o,onProjectSelect:l,onSessionSelect:c,onSessionDelete:d,onProjectDelete:u,setCurrentProject:p,setSidebarVisible:f,sidebarVisible:m}){const[g,b]=h.useState(new Set),[x,y]=h.useState(null),[v,w]=h.useState(!1),[k,E]=h.useState(""),[S,j]=h.useState({}),[_,T]=h.useState({}),[C,L]=h.useState(new Set),[A,I]=h.useState(new Date),[N,P]=h.useState("name"),[H,z]=h.useState(!1),[U,V]=h.useState({}),[O,G]=h.useState(null),[$,F]=h.useState(""),[te,Q]=h.useState(""),[ge,ae]=h.useState(new Set),[me,pe]=h.useState(null),[be,Ne]=h.useState(null),[xe,Be]=h.useState(!1),[M,de]=h.useState(()=>XO()),[ce,Y]=h.useState(()=>QO()),[W,ne]=h.useState("projects"),[fe,ye]=h.useState(null),[se,Se]=h.useState(!1),[re,X]=h.useState(null),Z=h.useRef(null),le=h.useRef(0),Ee=h.useRef(null),Te=!a&&!m;h.useEffect(()=>{const Ce=setInterval(()=>{I(new Date)},6e4);return()=>clearInterval(Ce)},[]),h.useEffect(()=>{T({}),L(new Set),V({})},[e]),h.useEffect(()=>{t&&b(Ce=>{if(Ce.has(t.name))return Ce;const Oe=new Set(Ce);return Oe.add(t.name),Oe})},[r,t]),h.useEffect(()=>{if(e.length>0&&!n){const Ce=new Set;e.forEach(Oe=>{Oe.sessions&&Oe.sessions.length>=0&&Ce.add(Oe.name)}),L(Ce)}},[e,n]),h.useEffect(()=>{const Ce=()=>{P(ZO())};Ce();const Oe=Ge=>{Ge.key==="claude-settings"&&Ce()},ct=()=>Ce();return window.addEventListener("storage",Oe),window.addEventListener("pixcode:settings-changed",ct),()=>{window.removeEventListener("storage",Oe),window.removeEventListener("pixcode:settings-changed",ct)}},[]),h.useEffect(()=>{Z.current&&clearTimeout(Z.current),Ee.current&&(Ee.current.close(),Ee.current=null);const Ce=te.trim();if(W!=="conversations"||Ce.length<2){le.current+=1,ye(null),X(null),Se(!1);return}Se(!0);const Oe=++le.current;return Z.current=setTimeout(()=>{if(Oe!==le.current)return;const ct=ot.searchConversationsUrl(Ce),Ge=new EventSource(ct);Ee.current=Ge;const He=[];let je=0;Ge.addEventListener("result",Ue=>{if(Oe!==le.current){Ge.close();return}try{const Fe=JSON.parse(Ue.data);He.push(Fe.projectResult),je=Fe.totalMatches,ye({results:[...He],totalMatches:je,query:Ce}),X({scannedProjects:Fe.scannedProjects,totalProjects:Fe.totalProjects})}catch{}}),Ge.addEventListener("progress",Ue=>{if(Oe!==le.current){Ge.close();return}try{const Fe=JSON.parse(Ue.data);je=Fe.totalMatches,X({scannedProjects:Fe.scannedProjects,totalProjects:Fe.totalProjects})}catch{}}),Ge.addEventListener("done",()=>{if(Oe!==le.current){Ge.close();return}Ge.close(),Ee.current=null,Se(!1),X(null),He.length===0&&ye({results:[],totalMatches:0,query:Ce})}),Ge.addEventListener("error",()=>{if(Oe!==le.current){Ge.close();return}Ge.close(),Ee.current=null,Se(!1),X(null),He.length===0&&ye({results:[],totalMatches:0,query:Ce})})},400),()=>{Z.current&&clearTimeout(Z.current),Ee.current&&(Ee.current.close(),Ee.current=null)}},[te,W]);const Ke=h.useCallback(Ce=>{b(Oe=>{const ct=new Set;return Oe.has(Ce)||ct.add(Ce),ct})},[]),Ze=h.useCallback((Ce,Oe)=>{c({...Ce,__projectName:Oe})},[c]),vt=h.useCallback(Ce=>{de(Oe=>{const ct=new Set(Oe);return ct.has(Ce)?ct.delete(Ce):ct.add(Ce),JO(ct),ct})},[]),Qe=h.useCallback(Ce=>M.has(Ce),[M]),jt=h.useCallback((Ce,Oe)=>{Y(ct=>{const Ge=sw(Ce,Oe),He=new Set(ct);return He.has(Ge)?He.delete(Ge):He.add(Ge),e9(He),He})},[]),wt=h.useCallback((Ce,Oe)=>ce.has(sw(Ce,Oe)),[ce]),st=h.useCallback(Ce=>UE(Ce,_),[_]),lt=h.useMemo(()=>e.map(Ce=>{const Oe=U[Ce.name];return Oe===void 0?Ce:{...Ce,sessionMeta:{...Ce.sessionMeta,hasMore:Oe}}}),[U,e]),kt=h.useMemo(()=>s9(lt,N,M,_),[_,N,lt,M]),_t=h.useMemo(()=>o9(kt,te),[te,kt]),At=h.useCallback(Ce=>{y(Ce.name),E(Ce.displayName)},[]),pr=h.useCallback(()=>{y(null),E("")},[]),nr=h.useCallback(async Ce=>{try{(await ot.renameProject(Ce,k)).ok?window.refreshProjects?await window.refreshProjects():window.location.reload():console.error("Failed to rename project")}catch(Oe){console.error("Error renaming project:",Oe)}finally{y(null),E("")}},[k]),Xt=h.useCallback((Ce,Oe,ct,Ge="claude")=>{Ne({projectName:Ce,sessionId:Oe,sessionTitle:ct,provider:Ge})},[]),zr=h.useCallback(async()=>{if(!be)return;const{projectName:Ce,sessionId:Oe,provider:ct}=be;Ne(null);try{let Ge;if(ct==="codex"?Ge=await ot.deleteCodexSession(Oe):ct==="gemini"?Ge=await ot.deleteGeminiSession(Oe):ct==="qwen"?Ge=await ot.deleteQwenSession(Oe):Ge=await ot.deleteSession(Ce,Oe),Ge.ok)d?.(Oe);else{const He=await Ge.text();console.error("[Sidebar] Failed to delete session:",{status:Ge.status,error:He}),alert(s("messages.deleteSessionFailed"))}}catch(Ge){console.error("[Sidebar] Error deleting session:",Ge),alert(s("messages.deleteSessionError"))}},[d,be,s]),De=h.useCallback(Ce=>{pe({project:Ce,sessionCount:st(Ce).length})},[st]),Xe=h.useCallback(async(Ce=!1)=>{if(!me)return;const{project:Oe,sessionCount:ct}=me,Ge=ct===0;pe(null),ae(He=>new Set([...He,Oe.name]));try{const He=await ot.deleteProject(Oe.name,!Ge,Ce);if(He.ok)u?.(Oe.name);else{const je=await He.json();alert(je.error||s("messages.deleteProjectFailed"))}}catch(He){console.error("Error deleting project:",He),alert(s("messages.deleteProjectError"))}finally{ae(He=>{const je=new Set(He);return je.delete(Oe.name),je})}},[me,u,s]),Je=h.useCallback(async Ce=>{const Oe=U[Ce.name];if(!(!(Oe!==void 0?Oe:Ce.sessionMeta?.hasMore===!0)||S[Ce.name])){j(Ge=>({...Ge,[Ce.name]:!0}));try{const Ge=(Ce.sessions?.length||0)+(_[Ce.name]?.length||0),He=await ot.sessions(Ce.name,5,Ge);if(!He.ok)return;const je=await He.json();T(Ue=>({...Ue,[Ce.name]:[...Ue[Ce.name]||[],...je.sessions||[]]})),je.hasMore===!1&&V(Ue=>({...Ue,[Ce.name]:!1}))}catch(Ge){console.error("Error loading more sessions:",Ge)}finally{j(Ge=>({...Ge,[Ce.name]:!1}))}}},[_,S,U]),ie=h.useCallback(Ce=>{l(Ce),p(Ce)},[l,p]),ke=h.useCallback(async()=>{z(!0);try{await o()}finally{z(!1)}},[o]),we=h.useCallback(async(Ce,Oe,ct,Ge)=>{const He=ct.trim();if(!He){G(null),F("");return}try{const je=await ot.renameSession(Oe,He,Ge);je.ok?await o():(console.error("[Sidebar] Failed to rename session:",je.status),alert(s("messages.renameSessionFailed")))}catch(je){console.error("[Sidebar] Error renaming session:",je),alert(s("messages.renameSessionError"))}finally{G(null),F("")}},[o,s]),Ve=h.useCallback(()=>{f(!1)},[f]),et=h.useCallback(()=>{f(!0)},[f]);return{isSidebarCollapsed:Te,expandedProjects:g,editingProject:x,showNewProject:v,editingName:k,loadingSessions:S,additionalSessions:_,initialSessionsLoaded:C,currentTime:A,projectSortOrder:N,isRefreshing:H,editingSession:O,editingSessionName:$,searchFilter:te,deletingProjects:ge,deleteConfirmation:me,sessionDeleteConfirmation:be,showVersionModal:xe,starredProjects:M,starredSessions:ce,filteredProjects:_t,toggleProject:Ke,handleSessionClick:Ze,toggleStarProject:vt,isProjectStarred:Qe,toggleStarSession:jt,isSessionStarred:wt,getProjectSessions:st,startEditing:At,cancelEditing:pr,saveProjectName:nr,showDeleteSessionConfirmation:Xt,confirmDeleteSession:zr,requestProjectDelete:De,confirmDeleteProject:Xe,loadMoreSessions:Je,handleProjectSelect:ie,refreshProjects:ke,updateSessionSummary:we,collapseSidebar:Ve,expandSidebar:et,setShowNewProject:w,setEditingName:E,setEditingSession:G,setEditingSessionName:F,searchMode:W,setSearchMode:ne,conversationResults:fe,isSearching:se,searchProgress:re,clearConversationResults:h.useCallback(()=>{le.current+=1,Ee.current&&(Ee.current.close(),Ee.current=null),Se(!1),X(null),ye(null)},[]),setSearchFilter:Q,setDeleteConfirmation:pe,setSessionDeleteConfirmation:Ne,setShowVersionModal:Be}}const u9="https://discord.gg/buxwujPNRE",p9="https://github.com/alicomert/pixcode/issues/new";function m9({className:e}){return i.jsx("svg",{className:e,fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:i.jsx("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"})})}function h9({onExpand:e,onShowSettings:t,updateAvailable:r,onShowVersionModal:n,t:a}){return i.jsxs("div",{className:"flex h-full w-12 flex-col items-center gap-1 bg-background/80 py-3 backdrop-blur-sm",children:[i.jsx("button",{onClick:e,className:"group flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":a("common:versionUpdate.ariaLabels.showSidebar"),title:a("common:versionUpdate.ariaLabels.showSidebar"),children:i.jsx(xD,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),i.jsx("div",{className:"nav-divider my-1 w-6"}),i.jsx("button",{onClick:t,className:"group flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":a("actions.settings"),title:a("actions.settings"),children:i.jsx(Lt,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),i.jsx("a",{href:p9,target:"_blank",rel:"noopener noreferrer",className:"group flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":a("actions.reportIssue"),title:a("actions.reportIssue"),children:i.jsx(ml,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),i.jsx("a",{href:u9,target:"_blank",rel:"noopener noreferrer",className:"group flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":a("actions.joinCommunity"),title:a("actions.joinCommunity"),children:i.jsx(m9,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),r&&i.jsxs("button",{onClick:n,className:"relative flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":a("common:versionUpdate.ariaLabels.updateAvailable"),title:a("common:versionUpdate.ariaLabels.updateAvailable"),children:[i.jsx(Na,{className:"h-4 w-4 text-blue-500"}),i.jsx("span",{className:"absolute right-1.5 top-1.5 h-1.5 w-1.5 animate-pulse rounded-full bg-blue-500"})]})]})}function GE(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=GE(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function HE(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=GE(e))&&(n&&(n+=" "),n+=t);return n}const lw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,cw=HE,Pf=(e,t)=>r=>{var n;if(t?.variants==null)return cw(e,r?.class,r?.className);const{variants:a,defaultVariants:s}=t,o=Object.keys(a).map(d=>{const u=r?.[d],p=s?.[d];if(u===null)return null;const f=lw(u)||lw(p);return a[d][f]}),l=r&&Object.entries(r).reduce((d,u)=>{let[p,f]=u;return f===void 0||(d[p]=f),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,u)=>{let{class:p,className:f,...m}=u;return Object.entries(m).every(g=>{let[b,x]=g;return Array.isArray(x)?x.includes({...s,...l}[b]):{...s,...l}[b]===x})?[...d,p,f]:d},[]);return cw(e,o,c,r?.class,r?.className)},Ff="-",f9=e=>{const t=b9(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(Ff);return l[0]===""&&l.length!==1&&l.shift(),VE(l,t)||g9(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},VE=(e,t)=>{if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?VE(e.slice(1),n):void 0;if(a)return a;if(t.validators.length===0)return;const s=e.join(Ff);return t.validators.find(({validator:o})=>o(s))?.classGroupId},dw=/^\[(.+)\]$/,g9=e=>{if(dw.test(e)){const t=dw.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},b9=e=>{const{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(const a in r)Qm(r[a],n,a,t);return n},Qm=(e,t,r,n)=>{e.forEach(a=>{if(typeof a=="string"){const s=a===""?t:uw(t,a);s.classGroupId=r;return}if(typeof a=="function"){if(x9(a)){Qm(a(n),t,r,n);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([s,o])=>{Qm(o,uw(t,s),r,n)})})},uw=(e,t)=>{let r=e;return t.split(Ff).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},x9=e=>e.isThemeGetter,y9=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(s,o)=>{r.set(s,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(s){let o=r.get(s);if(o!==void 0)return o;if((o=n.get(s))!==void 0)return a(s,o),o},set(s,o){r.has(s)?r.set(s,o):a(s,o)}}},eh="!",th=":",v9=th.length,w9=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=a=>{const s=[];let o=0,l=0,c=0,d;for(let g=0;g<a.length;g++){let b=a[g];if(o===0&&l===0){if(b===th){s.push(a.slice(c,g)),c=g+v9;continue}if(b==="/"){d=g;continue}}b==="["?o++:b==="]"?o--:b==="("?l++:b===")"&&l--}const u=s.length===0?a:a.substring(c),p=k9(u),f=p!==u,m=d&&d>c?d-c:void 0;return{modifiers:s,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}};if(t){const a=t+th,s=n;n=o=>o.startsWith(a)?s(o.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(r){const a=n;n=s=>r({className:s,parseClassName:a})}return n},k9=e=>e.endsWith(eh)?e.substring(0,e.length-1):e.startsWith(eh)?e.substring(1):e,S9=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const a=[];let s=[];return n.forEach(o=>{o[0]==="["||t[o]?(a.push(...s.sort(),o),s=[]):s.push(o)}),a.push(...s.sort()),a}},E9=e=>({cache:y9(e.cacheSize),parseClassName:w9(e),sortModifiers:S9(e),...f9(e)}),N9=/\s+/,C9=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:s}=t,o=[],l=e.trim().split(N9);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:p,modifiers:f,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:b}=r(u);if(p){c=u+(c.length>0?" "+c:c);continue}let x=!!b,y=n(x?g.substring(0,b):g);if(!y){if(!x){c=u+(c.length>0?" "+c:c);continue}if(y=n(g),!y){c=u+(c.length>0?" "+c:c);continue}x=!1}const v=s(f).join(":"),w=m?v+eh:v,k=w+y;if(o.includes(k))continue;o.push(k);const E=a(y,x);for(let S=0;S<E.length;++S){const j=E[S];o.push(w+j)}c=u+(c.length>0?" "+c:c)}return c};function A9(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=qE(t))&&(n&&(n+=" "),n+=r);return n}const qE=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=qE(e[n]))&&(r&&(r+=" "),r+=t);return r};function T9(e,...t){let r,n,a,s=o;function o(c){const d=t.reduce((u,p)=>p(u),e());return r=E9(d),n=r.cache.get,a=r.cache.set,s=l,l(c)}function l(c){const d=n(c);if(d)return d;const u=C9(c,r);return a(c,u),u}return function(){return s(A9.apply(null,arguments))}}const mr=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},WE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,KE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,j9=/^\d+\/\d+$/,_9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,I9=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,R9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,L9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,D9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cs=e=>j9.test(e),mt=e=>!!e&&!Number.isNaN(Number(e)),$a=e=>!!e&&Number.isInteger(Number(e)),Hu=e=>e.endsWith("%")&&mt(e.slice(0,-1)),ma=e=>_9.test(e),O9=()=>!0,M9=e=>I9.test(e)&&!R9.test(e),YE=()=>!1,P9=e=>L9.test(e),F9=e=>D9.test(e),z9=e=>!qe(e)&&!We(e),B9=e=>to(e,JE,YE),qe=e=>WE.test(e),vi=e=>to(e,QE,M9),Vu=e=>to(e,V9,mt),pw=e=>to(e,ZE,YE),$9=e=>to(e,XE,F9),tc=e=>to(e,eN,P9),We=e=>KE.test(e),jo=e=>ro(e,QE),U9=e=>ro(e,q9),mw=e=>ro(e,ZE),G9=e=>ro(e,JE),H9=e=>ro(e,XE),rc=e=>ro(e,eN,!0),to=(e,t,r)=>{const n=WE.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},ro=(e,t,r=!1)=>{const n=KE.exec(e);return n?n[1]?t(n[1]):r:!1},ZE=e=>e==="position"||e==="percentage",XE=e=>e==="image"||e==="url",JE=e=>e==="length"||e==="size"||e==="bg-size",QE=e=>e==="length",V9=e=>e==="number",q9=e=>e==="family-name",eN=e=>e==="shadow",W9=()=>{const e=mr("color"),t=mr("font"),r=mr("text"),n=mr("font-weight"),a=mr("tracking"),s=mr("leading"),o=mr("breakpoint"),l=mr("container"),c=mr("spacing"),d=mr("radius"),u=mr("shadow"),p=mr("inset-shadow"),f=mr("text-shadow"),m=mr("drop-shadow"),g=mr("blur"),b=mr("perspective"),x=mr("aspect"),y=mr("ease"),v=mr("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...k(),We,qe],S=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],_=()=>[We,qe,c],T=()=>[cs,"full","auto",..._()],C=()=>[$a,"none","subgrid",We,qe],L=()=>["auto",{span:["full",$a,We,qe]},$a,We,qe],A=()=>[$a,"auto",We,qe],I=()=>["auto","min","max","fr",We,qe],N=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],P=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",..._()],z=()=>[cs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",..._()],U=()=>[e,We,qe],V=()=>[...k(),mw,pw,{position:[We,qe]}],O=()=>["no-repeat",{repeat:["","x","y","space","round"]}],G=()=>["auto","cover","contain",G9,B9,{size:[We,qe]}],$=()=>[Hu,jo,vi],F=()=>["","none","full",d,We,qe],te=()=>["",mt,jo,vi],Q=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[mt,Hu,mw,pw],me=()=>["","none",g,We,qe],pe=()=>["none",mt,We,qe],be=()=>["none",mt,We,qe],Ne=()=>[mt,We,qe],xe=()=>[cs,"full",..._()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ma],breakpoint:[ma],color:[O9],container:[ma],"drop-shadow":[ma],ease:["in","out","in-out"],font:[z9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ma],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ma],shadow:[ma],spacing:["px",mt],text:[ma],"text-shadow":[ma],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",cs,qe,We,x]}],container:["container"],columns:[{columns:[mt,qe,We,l]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{start:T()}],end:[{end:T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[$a,"auto",We,qe]}],basis:[{basis:[cs,"full","auto",l,..._()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[mt,cs,"auto","initial","none",qe]}],grow:[{grow:["",mt,We,qe]}],shrink:[{shrink:["",mt,We,qe]}],order:[{order:[$a,"first","last","none",We,qe]}],"grid-cols":[{"grid-cols":C()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":C()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":I()}],"auto-rows":[{"auto-rows":I()}],gap:[{gap:_()}],"gap-x":[{"gap-x":_()}],"gap-y":[{"gap-y":_()}],"justify-content":[{justify:[...N(),"normal"]}],"justify-items":[{"justify-items":[...P(),"normal"]}],"justify-self":[{"justify-self":["auto",...P()]}],"align-content":[{content:["normal",...N()]}],"align-items":[{items:[...P(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...P(),{baseline:["","last"]}]}],"place-content":[{"place-content":N()}],"place-items":[{"place-items":[...P(),"baseline"]}],"place-self":[{"place-self":["auto",...P()]}],p:[{p:_()}],px:[{px:_()}],py:[{py:_()}],ps:[{ps:_()}],pe:[{pe:_()}],pt:[{pt:_()}],pr:[{pr:_()}],pb:[{pb:_()}],pl:[{pl:_()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":_()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":_()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[l,"screen",...z()]}],"min-w":[{"min-w":[l,"screen","none",...z()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",r,jo,vi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,We,Vu]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Hu,qe]}],"font-family":[{font:[U9,qe,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,We,qe]}],"line-clamp":[{"line-clamp":[mt,"none",We,Vu]}],leading:[{leading:[s,..._()]}],"list-image":[{"list-image":["none",We,qe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",We,qe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[mt,"from-font","auto",We,vi]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[mt,"auto",We,qe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",We,qe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",We,qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:V()}],"bg-repeat":[{bg:O()}],"bg-size":[{bg:G()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},$a,We,qe],radial:["",We,qe],conic:[$a,We,qe]},H9,$9]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[mt,We,qe]}],"outline-w":[{outline:["",mt,jo,vi]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",u,rc,tc]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",p,rc,tc]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[mt,vi]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",f,rc,tc]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[mt,We,qe]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[mt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[We,qe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[mt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:O()}],"mask-size":[{mask:G()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",We,qe]}],filter:[{filter:["","none",We,qe]}],blur:[{blur:me()}],brightness:[{brightness:[mt,We,qe]}],contrast:[{contrast:[mt,We,qe]}],"drop-shadow":[{"drop-shadow":["","none",m,rc,tc]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",mt,We,qe]}],"hue-rotate":[{"hue-rotate":[mt,We,qe]}],invert:[{invert:["",mt,We,qe]}],saturate:[{saturate:[mt,We,qe]}],sepia:[{sepia:["",mt,We,qe]}],"backdrop-filter":[{"backdrop-filter":["","none",We,qe]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[mt,We,qe]}],"backdrop-contrast":[{"backdrop-contrast":[mt,We,qe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",mt,We,qe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[mt,We,qe]}],"backdrop-invert":[{"backdrop-invert":["",mt,We,qe]}],"backdrop-opacity":[{"backdrop-opacity":[mt,We,qe]}],"backdrop-saturate":[{"backdrop-saturate":[mt,We,qe]}],"backdrop-sepia":[{"backdrop-sepia":["",mt,We,qe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":_()}],"border-spacing-x":[{"border-spacing-x":_()}],"border-spacing-y":[{"border-spacing-y":_()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",We,qe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[mt,"initial",We,qe]}],ease:[{ease:["linear","initial",y,We,qe]}],delay:[{delay:[mt,We,qe]}],animate:[{animate:["none",v,We,qe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,We,qe]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:Ne()}],"skew-x":[{"skew-x":Ne()}],"skew-y":[{"skew-y":Ne()}],transform:[{transform:[We,qe,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:xe()}],"translate-x":[{"translate-x":xe()}],"translate-y":[{"translate-y":xe()}],"translate-z":[{"translate-z":xe()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",We,qe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",We,qe]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[mt,jo,vi,Vu]}],stroke:[{stroke:["none",...U()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},K9=T9(W9);function ue(...e){return K9(HE(e))}function Y9(e){if(!e||typeof e!="string")return null;try{return JSON.parse(e)}catch{return null}}const Z9=Pf("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}}),tN=h.forwardRef(({className:e,variant:t,...r},n)=>i.jsx("div",{ref:n,role:"alert","data-slot":"alert",className:ue(Z9({variant:t}),e),...r}));tN.displayName="Alert";const X9=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"alert-title",className:ue("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t}));X9.displayName="AlertTitle";const J9=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"alert-description",className:ue("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t}));J9.displayName="AlertDescription";const Q9=Pf("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function er({className:e,variant:t,...r}){return i.jsx("div",{className:ue(Q9({variant:t}),e),...r})}const eM=Pf("inline-flex touch-manipulation items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90 active:bg-primary/80",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 active:bg-destructive/80",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground active:bg-accent/80",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80 active:bg-secondary/70",ghost:"hover:bg-accent hover:text-accent-foreground active:bg-accent/80",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3 text-sm",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),_e=h.forwardRef(({className:e,variant:t,size:r,...n},a)=>i.jsx("button",{className:ue(eM({variant:t,size:r,className:e})),ref:a,...n}));_e.displayName="Button";const rN=h.createContext(null),nN=()=>{const e=h.useContext(rN);if(!e)throw new Error("Confirmation components must be used within Confirmation");return e},aN=({className:e,approval:t="pending",children:r,...n})=>{const a=h.useMemo(()=>({approval:t}),[t]);return i.jsx(rN.Provider,{value:a,children:i.jsx(tN,{className:ue("flex flex-col gap-2",e),...n,children:r})})};aN.displayName="Confirmation";const iN=({className:e,...t})=>i.jsx("div",{"data-slot":"confirmation-title",className:ue("text-muted-foreground inline text-sm",e),...t});iN.displayName="ConfirmationTitle";const sN=({children:e})=>{const{approval:t}=nN();return t!=="pending"?null:i.jsx(i.Fragment,{children:e})};sN.displayName="ConfirmationRequest";const oN=({className:e,...t})=>{const{approval:r}=nN();return r!=="pending"?null:i.jsx("div",{"data-slot":"confirmation-actions",className:ue("flex items-center justify-end gap-2 self-end",e),...t})};oN.displayName="ConfirmationActions";const Fc=({variant:e="default",...t})=>i.jsx(_e,{className:"h-8 px-3 text-sm",variant:e,type:"button",...t});Fc.displayName="ConfirmationAction";const lN=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:ue("rounded-xl border bg-card text-card-foreground shadow-sm",e),...t}));lN.displayName="Card";const cN=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:ue("flex flex-col space-y-1.5 p-4",e),...t}));cN.displayName="CardHeader";const dN=h.forwardRef(({className:e,...t},r)=>i.jsx("h3",{ref:r,className:ue("font-semibold leading-none tracking-tight",e),...t}));dN.displayName="CardTitle";const tM=h.forwardRef(({className:e,...t},r)=>i.jsx("p",{ref:r,className:ue("text-sm text-muted-foreground",e),...t}));tM.displayName="CardDescription";const uN=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:ue("p-4 pt-0",e),...t}));uN.displayName="CardContent";const pN=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:ue("flex items-center p-4 pt-0",e),...t}));pN.displayName="CardFooter";const rM=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:ue("ml-auto shrink-0",e),...t}));rM.displayName="CardAction";const mN=h.createContext(null);function hN(){const e=h.useContext(mN);if(!e)throw new Error("Collapsible components must be used within <Collapsible>");return e}const ii=h.forwardRef(({defaultOpen:e=!1,open:t,onOpenChange:r,className:n,children:a,...s},o)=>{const[l,c]=h.useState(e),d=t!==void 0,u=d?t:l,p=h.useCallback(m=>{d||c(m),r?.(m)},[d,r]),f=h.useMemo(()=>({open:u,onOpenChange:p}),[u,p]);return i.jsx(mN.Provider,{value:f,children:i.jsx("div",{ref:o,"data-state":u?"open":"closed",className:n,...s,children:a})})});ii.displayName="Collapsible";const Ca=h.forwardRef(({onClick:e,children:t,className:r,...n},a)=>{const{open:s,onOpenChange:o}=hN(),l=h.useCallback(c=>{o(!s),e?.(c)},[s,o,e]);return i.jsx("button",{ref:a,type:"button","aria-expanded":s,"data-state":s?"open":"closed",onClick:l,className:r,...n,children:t})});Ca.displayName="CollapsibleTrigger";const si=h.forwardRef(({className:e,children:t,...r},n)=>{const{open:a}=hN();return i.jsx("div",{ref:n,"data-state":a?"open":"closed",className:ue("grid transition-[grid-template-rows] duration-200 ease-out",a?"grid-rows-[1fr]":"grid-rows-[0fr]",e),...r,children:i.jsx("div",{className:"overflow-hidden",children:t})})});si.displayName="CollapsibleContent";const fN=h.createContext(null);function zf(){const e=h.useContext(fN);if(!e)throw new Error("Command components must be used within <Command>");return e}const gN=h.forwardRef(({className:e,children:t,...r},n)=>{const[a,s]=h.useState(""),o=h.useRef(new Map),[l,c]=h.useState(0),d=h.useCallback(v=>{o.current.set(v.id,v),c(w=>w+1)},[]),u=h.useCallback(v=>{o.current.delete(v),c(w=>w+1)},[]),p=h.useCallback((v,w)=>{const k=o.current.get(v);k&&Object.assign(k,w)},[]),f=h.useMemo(()=>{const v=a.toLowerCase(),w=new Set;for(const[k,E]of o.current)(!v||E.value.includes(v))&&w.add(k);return w},[a,l]),m=h.useMemo(()=>{const v=[];for(const[,w]of o.current)f.has(w.id)&&v.push(w);return v},[f]),[g,b]=h.useState(null);h.useEffect(()=>{b(m.length>0?m[0].id:null)},[m]);const x=h.useCallback(v=>{if(v.key==="ArrowDown"||v.key==="ArrowUp"||v.key==="Enter")v.preventDefault();else return;const w=m;if(w.length===0)return;if(v.key==="Enter"){w.find(T=>T.id===g)?.onSelect();return}const k=w.findIndex(_=>_.id===g);let E;v.key==="ArrowDown"?E=k<w.length-1?k+1:0:E=k>0?k-1:w.length-1;const S=w[E].id;b(S),w[E].element?.scrollIntoView({block:"nearest"})},[m,g]),y=h.useMemo(()=>({search:a,setSearch:s,visibleIds:f,activeId:g,setActiveId:b,register:d,unregister:u,updateEntry:p}),[a,f,g,d,u,p]);return i.jsx(fN.Provider,{value:y,children:i.jsx("div",{ref:n,role:"combobox","aria-expanded":"true","aria-haspopup":"listbox",className:ue("flex flex-col",e),onKeyDown:x,...r,children:t})})});gN.displayName="Command";const bN=h.forwardRef(({className:e,placeholder:t="Search...",...r},n)=>{const{search:a,setSearch:s}=zf();return i.jsxs("div",{className:"flex items-center border-b px-3",role:"presentation",children:[i.jsx(Ea,{className:"mr-2 h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),i.jsx("input",{ref:n,type:"text",role:"searchbox","aria-autocomplete":"list",autoComplete:"off",autoCorrect:"off",spellCheck:!1,value:a,onChange:o=>s(o.target.value),placeholder:t,className:ue("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none","placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]})});bN.displayName="CommandInput";const xN=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,role:"listbox",className:ue("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));xN.displayName="CommandList";const yN=h.forwardRef(({className:e,...t},r)=>{const{search:n,visibleIds:a}=zf();return!n||a.size>0?null:i.jsx("div",{ref:r,className:ue("py-6 text-center text-sm text-muted-foreground",e),...t})});yN.displayName="CommandEmpty";const vN=h.forwardRef(({className:e,heading:t,children:r,...n},a)=>i.jsxs("div",{ref:a,className:ue("overflow-hidden p-1",e),role:"group","aria-label":typeof t=="string"?t:void 0,...n,children:[t&&i.jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",role:"presentation",children:t}),r]}));vN.displayName="CommandGroup";const wN=h.forwardRef(({className:e,value:t,onSelect:r,disabled:n,children:a,...s},o)=>{const{visibleIds:l,activeId:c,setActiveId:d,register:u,unregister:p,updateEntry:f}=zf(),m=h.useId(),g=h.useRef(null),b=t||(typeof a=="string"?a:"");h.useEffect(()=>(u({id:m,value:b.toLowerCase(),onSelect:r||(()=>{}),element:g.current}),()=>p(m)),[m,b,u,p]),h.useEffect(()=>{f(m,{onSelect:r||(()=>{})})},[m,r,f]);const x=h.useCallback(v=>{g.current=v,f(m,{element:v}),typeof o=="function"?o(v):o&&(o.current=v)},[m,f,o]);if(!l.has(m))return null;const y=c===m;return i.jsx("div",{ref:x,role:"option","aria-selected":y,"aria-disabled":n||void 0,"data-active":y||void 0,className:ue("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none",y&&"bg-accent text-accent-foreground",n&&"pointer-events-none opacity-50",e),onPointerMove:()=>{!n&&c!==m&&d(m)},onClick:()=>!n&&r?.(),...s,children:a})});wN.displayName="CommandItem";const nM=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:ue("-mx-1 h-px bg-border",e),...t}));nM.displayName="CommandSeparator";function rh({checked:e,onToggle:t,ariaLabel:r="Toggle dark mode"}){const{isDarkMode:n,toggleDarkMode:a}=Oa(),s=typeof e=="boolean"&&typeof t=="function",o=s?e:n,l=()=>{if(s&&t){t(!o);return}a()};return i.jsxs("button",{onClick:l,className:ue("relative inline-flex h-7 w-12 flex-shrink-0 touch-manipulation cursor-pointer items-center rounded-full border-2 transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",o?"border-primary bg-primary":"border-border bg-muted"),role:"switch","aria-checked":o,"aria-label":r,children:[i.jsx("span",{className:"sr-only",children:r}),i.jsx("span",{className:ue("flex h-5 w-5 transform items-center justify-center rounded-full shadow-sm transition-transform duration-200",o?"translate-x-[22px] bg-white":"translate-x-[2px] bg-foreground/60 dark:bg-foreground/80"),children:o?i.jsx(Tf,{className:"h-3 w-3 text-primary"}):i.jsx(_f,{className:"h-3 w-3 text-white dark:text-background"})})]})}const kN=h.createContext(null);function SN(){const e=h.useContext(kN);if(!e)throw new Error("Dialog components must be used within <Dialog>");return e}const EN=({open:e,onOpenChange:t,defaultOpen:r=!1,children:n})=>{const[a,s]=h.useState(r),o=h.useRef(null),l=e!==void 0,c=l?e:a,d=h.useCallback(p=>{l||s(p),t?.(p)},[l,t]),u=h.useMemo(()=>({open:c,onOpenChange:d,triggerRef:o}),[c,d]);return i.jsx(kN.Provider,{value:u,children:n})},aM=h.forwardRef(({onClick:e,children:t,asChild:r,...n},a)=>{const{onOpenChange:s,triggerRef:o}=SN(),l=h.useCallback(c=>{s(!0),e?.(c)},[s,e]);if(r&&h.isValidElement(t)){const c=t;return h.cloneElement(c,{onClick:d=>{s(!0),c.props.onClick?.(d)},ref:d=>{o.current=d,typeof a=="function"?a(d):a&&(a.current=d)}})}return i.jsx("button",{ref:c=>{o.current=c,typeof a=="function"?a(c):a&&(a.current=c)},type:"button",onClick:l,...n,children:t})});aM.displayName="DialogTrigger";const hw='a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',Bf=h.forwardRef(({className:e,children:t,onEscapeKeyDown:r,onPointerDownOutside:n,...a},s)=>{const{open:o,onOpenChange:l,triggerRef:c}=SN(),d=h.useRef(null),u=h.useRef(null);return h.useEffect(()=>{o?u.current=document.activeElement:u.current&&((c.current||u.current)?.focus(),u.current=null)},[o,c]),h.useEffect(()=>{if(!o)return;const p=m=>{if(m.key==="Escape"){m.stopPropagation(),r?.(),l(!1);return}if(m.key==="Tab"&&d.current){const g=Array.from(d.current.querySelectorAll(hw));if(g.length===0)return;const b=g[0],x=g[g.length-1];m.shiftKey&&document.activeElement===b?(m.preventDefault(),x.focus()):!m.shiftKey&&document.activeElement===x&&(m.preventDefault(),b.focus())}};document.addEventListener("keydown",p,!0);const f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",p,!0),document.body.style.overflow=f}},[o,l,r]),h.useEffect(()=>{o&&d.current&&requestAnimationFrame(()=>{d.current?.querySelector(hw)?.focus()})},[o]),o?Bd.createPortal(i.jsxs("div",{className:"fixed inset-0 z-50",children:[i.jsx("div",{className:"fixed inset-0 animate-dialog-overlay-show bg-black/50 backdrop-blur-sm",onClick:()=>{n?.(),l(!1)},"aria-hidden":!0}),i.jsx("div",{ref:p=>{d.current=p,typeof s=="function"?s(p):s&&(s.current=p)},role:"dialog","aria-modal":"true",className:ue("fixed left-1/2 top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2","rounded-xl border bg-popover text-popover-foreground shadow-lg","animate-dialog-content-show",e),...a,children:t})]}),document.body):null});Bf.displayName="DialogContent";const $f=h.forwardRef(({className:e,...t},r)=>i.jsx("h2",{ref:r,className:ue("sr-only",e),...t}));$f.displayName="DialogTitle";const Nt=h.forwardRef(({className:e,type:t,...r},n)=>i.jsx("input",{type:t,className:ue("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...r}));Nt.displayName="Input";const Uf=h.forwardRef(({className:e,contentClassName:t,children:r,...n},a)=>i.jsx("div",{className:ue("relative overflow-hidden",e),...n,children:i.jsx("div",{ref:a,className:ue("h-full w-full overflow-auto rounded-[inherit]",t),style:{WebkitOverflowScrolling:"touch",touchAction:"pan-y"},children:r})}));Uf.displayName="ScrollArea";const od=h.memo(({children:e,className:t,as:r="span"})=>i.jsx(r,{className:ue("animate-shimmer inline-block bg-[length:250%_100%] bg-clip-text text-transparent","bg-[linear-gradient(90deg,transparent_33%,hsl(var(--foreground))_50%,transparent_67%),linear-gradient(hsl(var(--muted-foreground)),hsl(var(--muted-foreground)))]",t),children:e}));od.displayName="Shimmer";const NN=h.createContext(null),iM=()=>{const e=h.useContext(NN);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},sM=1e3,oM=1e3,nh=h.memo(({className:e,isStreaming:t=!1,open:r,defaultOpen:n,onOpenChange:a,duration:s,children:o,...l})=>{const c=n??t,d=n===!1,[u,p]=h.useState(c),f=r!==void 0,m=f?r:u,g=h.useCallback(S=>{f||p(S),a?.(S)},[f,a]),[b,x]=h.useState(s),y=h.useRef(t),[v,w]=h.useState(!1),k=h.useRef(null);h.useEffect(()=>{s!==void 0&&x(s)},[s]),h.useEffect(()=>{t?(y.current=!0,k.current===null&&(k.current=Date.now())):k.current!==null&&(x(Math.ceil((Date.now()-k.current)/oM)),k.current=null)},[t]),h.useEffect(()=>{t&&!m&&!d&&g(!0)},[t,m,g,d]),h.useEffect(()=>{if(y.current&&!t&&m&&!v){const S=setTimeout(()=>{g(!1),w(!0)},sM);return()=>clearTimeout(S)}},[t,m,g,v]);const E=h.useMemo(()=>({duration:b,isOpen:m,isStreaming:t,setIsOpen:g}),[b,m,t,g]);return i.jsx(NN.Provider,{value:E,children:i.jsx(ii,{open:m,onOpenChange:g,className:ue("not-prose",e),...l,children:o})})});nh.displayName="Reasoning";const lM=(e,t)=>e||t===0?i.jsx(od,{children:"Thinking..."}):t===void 0?i.jsx("p",{children:"Thought for a few seconds"}):i.jsxs("p",{children:["Thought for ",t," seconds"]}),ah=h.memo(({className:e,children:t,getThinkingMessage:r=lM,...n})=>{const{isStreaming:a,isOpen:s,duration:o}=iM();return i.jsx(Ca,{className:ue("flex w-full items-center gap-2 text-sm text-muted-foreground transition-colors hover:text-foreground",e),...n,children:t??i.jsxs(i.Fragment,{children:[i.jsx(GD,{className:"h-4 w-4"}),r(a,o),i.jsx(iE,{className:ue("h-4 w-4 transition-transform",s?"rotate-180":"rotate-0")})]})})});ah.displayName="ReasoningTrigger";const ih=h.memo(({className:e,children:t,...r})=>i.jsx(si,{className:ue("mt-4 text-sm text-muted-foreground",e),...r,children:t}));ih.displayName="ReasoningContent";function cM(e){switch(e){case"top":return"top-full left-1/2 transform -translate-x-1/2 border-t-gray-900 dark:border-t-gray-100";case"bottom":return"bottom-full left-1/2 transform -translate-x-1/2 border-b-gray-900 dark:border-b-gray-100";case"left":return"left-full top-1/2 transform -translate-y-1/2 border-l-gray-900 dark:border-l-gray-100";case"right":return"right-full top-1/2 transform -translate-y-1/2 border-r-gray-900 dark:border-r-gray-100";default:return"top-full left-1/2 transform -translate-x-1/2 border-t-gray-900 dark:border-t-gray-100"}}function Yn({children:e,content:t,position:r="top",className:n="",delay:a=350}){const[s,o]=h.useState(!1),l=h.useRef(null),c=h.useRef(!1),d=h.useRef(null),u=h.useRef(null),[p,f]=h.useState(null),m=h.useCallback(()=>{const w=d.current;if(!w)return;const k=w.getBoundingClientRect(),E=8,S={position:"fixed",zIndex:9999};switch(r){case"bottom":S.left=k.left+k.width/2,S.top=k.bottom+E,S.transform="translateX(-50%)";break;case"left":S.left=k.left-E,S.top=k.top+k.height/2,S.transform="translate(-100%, -50%)";break;case"right":S.left=k.right+E,S.top=k.top+k.height/2,S.transform="translateY(-50%)";break;case"top":default:S.left=k.left+k.width/2,S.top=k.top-E,S.transform="translate(-50%, -100%)";break}f(S)},[r]),g=()=>{l.current!==null&&(window.clearTimeout(l.current),l.current=null)},b=()=>{g(),l.current=window.setTimeout(()=>{o(!0)},a)},x=()=>{g(),o(!1)},y=()=>{g(),c.current=!1,l.current=window.setTimeout(()=>{c.current=!0,o(!0)},a)},v=()=>{g(),!c.current&&o(!1)};return h.useEffect(()=>()=>{g()},[]),h.useEffect(()=>{if(!s||typeof document>"u")return;const w=k=>{const E=k.target;E instanceof Node&&d.current?.contains(E)||(o(!1),c.current=!1)};return document.addEventListener("pointerdown",w,!0),()=>document.removeEventListener("pointerdown",w,!0)},[s]),h.useEffect(()=>{if(!s){f(null);return}const w=window.requestAnimationFrame(m),k=()=>m();return window.addEventListener("resize",k),window.addEventListener("scroll",k,!0),()=>{window.cancelAnimationFrame(w),window.removeEventListener("resize",k),window.removeEventListener("scroll",k,!0)}},[s,m]),t?i.jsxs("div",{ref:d,className:"relative inline-block",onMouseEnter:b,onMouseLeave:x,onTouchStart:y,onTouchEnd:v,onTouchCancel:v,children:[e,s&&typeof document<"u"&&Bd.createPortal(i.jsxs("div",{ref:u,style:p||{position:"fixed",top:"-9999px",left:"-9999px",opacity:0},className:ue("px-2 py-1 text-xs font-medium text-white bg-gray-900 dark:bg-gray-100 dark:text-gray-900 rounded shadow-lg whitespace-nowrap pointer-events-none","animate-in fade-in-0 zoom-in-95 duration-200",n),children:[t,i.jsx("div",{className:ue("absolute w-0 h-0 border-4 border-transparent",cM(r))})]}),document.body)]}):i.jsx(i.Fragment,{children:e})}const CN=h.createContext(null),AN=h.forwardRef(({className:e,status:t="ready",children:r,...n},a)=>{const s=h.useMemo(()=>({status:t}),[t]);return i.jsx(CN.Provider,{value:s,children:i.jsx("form",{ref:a,"data-slot":"prompt-input",className:ue("relative overflow-hidden rounded-xl border border-border/70 bg-zinc-50/95 shadow-sm shadow-zinc-950/5 backdrop-blur-sm transition-all duration-200 focus-within:border-primary/40 focus-within:shadow-md focus-within:ring-1 focus-within:ring-primary/20 dark:bg-zinc-950/90",e),...n,children:r})})});AN.displayName="PromptInput";const TN=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"prompt-input-header",className:ue("px-3 pt-3",e),...t}));TN.displayName="PromptInputHeader";const jN=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"prompt-input-body",className:ue("relative",e),...t}));jN.displayName="PromptInputBody";const _N=h.forwardRef(({className:e,...t},r)=>i.jsx("textarea",{ref:r,"data-slot":"prompt-input-textarea",className:ue("chat-input-placeholder block max-h-[40vh] w-full resize-none overflow-y-auto bg-transparent px-4 py-2 font-mono text-sm leading-6 text-foreground placeholder-muted-foreground/50 focus:outline-none sm:max-h-[300px]",e),...t}));_N.displayName="PromptInputTextarea";const IN=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"prompt-input-footer",className:ue("flex items-center justify-between border-t border-border/30 px-3 py-2",e),...t}));IN.displayName="PromptInputFooter";const RN=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"prompt-input-tools",className:ue("flex items-center gap-1",e),...t}));RN.displayName="PromptInputTools";const zc=h.forwardRef(({className:e,tooltip:t,children:r,...n},a)=>{const s=i.jsx(_e,{ref:a,type:"button",variant:"ghost",size:"icon",className:ue("h-8 w-8 [&_svg]:size-4",e),...n,children:r});return t?i.jsx(Yn,{content:t.shortcut?i.jsxs("span",{className:"flex items-center gap-1.5",children:[t.content,i.jsx("kbd",{className:"rounded bg-white/20 px-1 text-[10px]",children:t.shortcut})]}):t.content,position:t.side??"top",children:s}):s});zc.displayName="PromptInputButton";const LN=h.forwardRef(({className:e,status:t,children:r,...n},a)=>{const s=h.useContext(CN),o=t??s?.status??"ready",l=o==="submitted"||o==="streaming";return i.jsx(_e,{ref:a,type:l?"button":"submit",variant:"default",size:"icon",className:ue("h-8 w-8 rounded-lg",e),...n,children:r??(l?i.jsx(qd,{className:"h-3.5 w-3.5 fill-current"}):i.jsx(yD,{className:"h-4 w-4"}))})});LN.displayName="PromptInputSubmit";function Gf({children:e,className:t}){return i.jsx("div",{className:ue("inline-flex items-center gap-[2px] rounded-lg bg-muted/60 p-[3px]",t),children:e})}function Hf({isActive:e,onClick:t,children:r,className:n}){return i.jsx("button",{onClick:t,className:ue("flex touch-manipulation items-center gap-1.5 rounded-md px-3 py-2 text-sm font-medium transition-all duration-150",e?"bg-background text-foreground shadow-sm":"text-muted-foreground active:bg-background/50",n),children:r})}const DN=h.createContext(null);function ON(){const e=h.useContext(DN);if(!e)throw new Error("QueueItem sub-components must be used within <QueueItem>");return e}const MN=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"queue",role:"list",className:ue("space-y-0.5",e),...t}));MN.displayName="Queue";const PN=h.forwardRef(({status:e="pending",className:t,children:r,...n},a)=>{const s=h.useMemo(()=>({status:e}),[e]);return i.jsx(DN.Provider,{value:s,children:i.jsx("div",{ref:a,"data-slot":"queue-item","data-status":e,role:"listitem",className:ue("flex items-start gap-2 py-0.5",t),...n,children:r})})});PN.displayName="QueueItem";const FN=h.forwardRef(({className:e,...t},r)=>{const{status:n}=ON();return i.jsxs("div",{ref:r,"data-slot":"queue-item-indicator","aria-hidden":"true",className:ue("mt-0.5 flex h-3.5 w-3.5 flex-shrink-0 items-center justify-center",e),...t,children:[n==="completed"&&i.jsx("svg",{className:"h-3.5 w-3.5 text-green-500 dark:text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),n==="in_progress"&&i.jsx("span",{className:"h-2 w-2 animate-pulse rounded-full bg-blue-500 dark:bg-blue-400"}),n==="pending"&&i.jsx("svg",{className:"h-3.5 w-3.5 text-muted-foreground/50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("circle",{cx:"12",cy:"12",r:"9",strokeWidth:2})})]})});FN.displayName="QueueItemIndicator";const zN=h.forwardRef(({className:e,children:t,...r},n)=>{const{status:a}=ON();return i.jsx("div",{ref:n,"data-slot":"queue-item-content",className:ue("min-w-0 flex-1 text-xs",a==="completed"&&"text-muted-foreground line-through",a==="in_progress"&&"font-medium text-foreground",a==="pending"&&"text-foreground",e),...r,children:t})});zN.displayName="QueueItemContent";const fw="https://github.com/alicomert/pixcode/issues/new",dM="https://github.com/alicomert/pixcode",gw="https://discord.gg/buxwujPNRE";function bw({className:e}){return i.jsx("svg",{className:e,fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:i.jsx("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"})})}function uM({updateAvailable:e,releaseInfo:t,latestVersion:r,currentVersion:n,onShowVersionModal:a,onShowSettings:s,t:o}){return i.jsxs("div",{className:"flex-shrink-0",style:{paddingBottom:"env(safe-area-inset-bottom, 0)"},children:[e&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"nav-divider"}),i.jsx("div",{className:"hidden px-2 py-1.5 md:block",children:i.jsxs("button",{className:"group flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left transition-colors hover:bg-blue-50/80 dark:hover:bg-blue-900/15",onClick:a,children:[i.jsxs("div",{className:"relative flex-shrink-0",children:[i.jsx(Vv,{className:"h-4 w-4 text-blue-500 dark:text-blue-400"}),i.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-1.5 w-1.5 animate-pulse rounded-full bg-blue-500"})]}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block truncate text-sm font-medium text-blue-600 dark:text-blue-300",children:t?.title||`v${r}`}),i.jsx("span",{className:"text-[10px] text-blue-500/70 dark:text-blue-400/60",children:o("version.updateAvailable")})]})]})}),i.jsx("div",{className:"px-3 py-2 md:hidden",children:i.jsxs("button",{className:"flex h-11 w-full items-center gap-3 rounded-xl border border-blue-200/60 bg-blue-50/80 px-3.5 transition-all active:scale-[0.98] dark:border-blue-700/40 dark:bg-blue-900/15",onClick:a,children:[i.jsxs("div",{className:"relative flex-shrink-0",children:[i.jsx(Vv,{className:"w-4.5 h-4.5 text-blue-500 dark:text-blue-400"}),i.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-1.5 w-1.5 animate-pulse rounded-full bg-blue-500"})]}),i.jsxs("div",{className:"min-w-0 flex-1 text-left",children:[i.jsx("span",{className:"block truncate text-sm font-medium text-blue-600 dark:text-blue-300",children:t?.title||`v${r}`}),i.jsx("span",{className:"text-xs text-blue-500/70 dark:text-blue-400/60",children:o("version.updateAvailable")})]})]})})]}),i.jsx("div",{className:"nav-divider"}),i.jsx("div",{className:"hidden px-2 pt-1.5 md:block",children:i.jsxs("a",{href:fw,target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground",children:[i.jsx(ml,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"text-sm",children:o("actions.reportIssue")})]})}),i.jsx("div",{className:"hidden px-2 md:block",children:i.jsxs("a",{href:gw,target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground",children:[i.jsx(bw,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"text-sm",children:o("actions.joinCommunity")})]})}),i.jsx("div",{className:"hidden px-2 py-1.5 md:block",children:i.jsxs("button",{className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground",onClick:s,children:[i.jsx(Lt,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"text-sm",children:o("actions.settings")})]})}),i.jsx("div",{className:"hidden px-3 py-2 text-center md:block",children:i.jsxs("a",{href:dM,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-muted-foreground/40 transition-colors hover:text-muted-foreground",children:["Pixcode v",n," – ",o("branding.openSource")]})}),i.jsx("div",{className:"px-3 pt-3 md:hidden",children:i.jsxs("a",{href:fw,target:"_blank",rel:"noopener noreferrer",className:"flex h-12 w-full items-center gap-3.5 rounded-xl bg-muted/40 px-4 transition-all hover:bg-muted/60 active:scale-[0.98]",children:[i.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-xl bg-background/80",children:i.jsx(ml,{className:"w-4.5 h-4.5 text-muted-foreground"})}),i.jsx("span",{className:"text-base font-medium text-foreground",children:o("actions.reportIssue")})]})}),i.jsx("div",{className:"px-3 pt-2 md:hidden",children:i.jsxs("a",{href:gw,target:"_blank",rel:"noopener noreferrer",className:"flex h-12 w-full items-center gap-3.5 rounded-xl bg-muted/40 px-4 transition-all hover:bg-muted/60 active:scale-[0.98]",children:[i.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-xl bg-background/80",children:i.jsx(bw,{className:"w-4.5 h-4.5 text-muted-foreground"})}),i.jsx("span",{className:"text-base font-medium text-foreground",children:o("actions.joinCommunity")})]})}),i.jsx("div",{className:"px-3 pb-3 pt-2 md:hidden",children:i.jsxs("button",{className:"flex h-12 w-full items-center gap-3.5 rounded-xl bg-muted/40 px-4 transition-all hover:bg-muted/60 active:scale-[0.98]",onClick:s,children:[i.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-xl bg-background/80",children:i.jsx(Lt,{className:"w-4.5 h-4.5 text-muted-foreground"})}),i.jsx("span",{className:"text-base font-medium text-foreground",children:o("actions.settings")})]})})]})}const xw="PIXCODE_GITHUB_STARS",yw="PIXCODE_HIDE_GITHUB_STAR",pM=3600*1e3,mM=(e,t)=>{const[r,n]=h.useState(null),[a,s]=h.useState(()=>{try{return localStorage.getItem(yw)==="true"}catch{return!1}});h.useEffect(()=>{if(a)return;try{const d=localStorage.getItem(xw);if(d){const u=JSON.parse(d);if(Date.now()-u.timestamp<pM){n(u.count);return}}}catch{}(async()=>{try{const d=await fetch(`https://api.github.com/repos/${e}/${t}`);if(!d.ok)return;const p=(await d.json()).stargazers_count;if(typeof p=="number"){n(p);try{localStorage.setItem(xw,JSON.stringify({count:p,timestamp:Date.now()}))}catch{}}}catch{}})()},[e,t,a]);const o=h.useCallback(()=>{s(!0);try{localStorage.setItem(yw,"true")}catch{}},[]),l=r!==null?r>=1e3?`${(r/1e3).toFixed(1)}k`:`${r}`:null;return{starCount:r,formattedCount:l,isDismissed:a,dismiss:o}},hM="https://github.com/alicomert/pixcode";function fM({className:e}){return i.jsx("svg",{className:e,fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:i.jsx("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"})})}function gM(){const{formattedCount:e,isDismissed:t,dismiss:r}=mM("alicomert","pixcode");return t?null:i.jsxs("div",{className:"group/star relative hidden md:block",children:[i.jsxs("a",{href:hM,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-lg border border-border/50 bg-muted/30 px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground",children:[i.jsx(fM,{className:"h-3.5 w-3.5"}),i.jsx(Is,{className:"h-3 w-3"}),i.jsx("span",{className:"font-medium",children:"Star"}),e&&i.jsx("span",{className:"border-l border-border/50 pl-1.5 tabular-nums",children:e})]}),i.jsx("button",{onClick:n=>{n.preventDefault(),n.stopPropagation(),r()},className:"absolute -right-1.5 -top-1.5 hidden h-4 w-4 items-center justify-center rounded-full border border-border/50 bg-muted text-muted-foreground transition-colors hover:text-foreground group-hover/star:flex","aria-label":"Dismiss",children:i.jsx(xt,{className:"h-2.5 w-2.5"})})]})}function vw({value:e,onChange:t,t:r}){const n="flex flex-1 items-center justify-center gap-1 rounded-md px-2 py-1 text-[11px] font-medium transition-all";return i.jsxs("div",{role:"tablist","aria-label":r("tooltips.historyView",{defaultValue:"History view"}),className:"flex rounded-lg bg-muted/40 p-0.5",children:[i.jsxs("button",{type:"button",role:"tab","aria-selected":e==="flat",onClick:()=>t("flat"),className:ue(n,e==="flat"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),title:r("tooltips.historyViewFlat",{defaultValue:"Recent conversations"}),children:[i.jsx(pl,{className:"h-3 w-3"}),r("historyView.flat",{defaultValue:"Recent"})]}),i.jsxs("button",{type:"button",role:"tab","aria-selected":e==="grouped",onClick:()=>t("grouped"),className:ue(n,e==="grouped"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),title:r("tooltips.historyViewGrouped",{defaultValue:"Grouped by project"}),children:[i.jsx(ED,{className:"h-3 w-3"}),r("historyView.grouped",{defaultValue:"By project"})]})]})}function bM({isPWA:e,isMobile:t,isLoading:r,projectsCount:n,searchFilter:a,onSearchFilterChange:s,onClearSearchFilter:o,searchMode:l,onSearchModeChange:c,onRefresh:d,isRefreshing:u,onCreateProject:p,onQuickStartSession:f,onCollapseSidebar:m,historyView:g,onHistoryViewChange:b,t:x}){const y=()=>i.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[i.jsx("svg",{className:"h-6 w-6 flex-shrink-0",viewBox:"0 0 500 500","aria-hidden":"true",children:i.jsx("g",{transform:"translate(250 250) scale(1.25) translate(-250 -250)",children:i.jsxs("g",{transform:"translate(0 500) scale(0.1 -0.1)",fill:"#5C3FFC",children:[i.jsx("path",{d:"M2037 3800 c-104 -40 -191 -134 -231 -250 -23 -67 -20 -82 22 -109 31 -20 287 -177 1009 -618 40 -24 82 -56 93 -70 27 -34 27 -102 0 -136 -11 -13 -106 -78 -212 -143 -106 -64 -201 -124 -210 -132 -16 -14 -18 -41 -18 -302 0 -291 2 -310 38 -310 16 0 267 148 610 359 180 111 270 173 310 213 216 217 215 574 -3 793 -37 38 -107 89 -185 136 -69 42 -253 154 -410 249 -434 264 -509 307 -563 326 -57 20 -191 17 -250 -6z"}),i.jsx("path",{d:"M1803 2994 c-10 -5 -13 -156 -13 -709 0 -671 1 -706 20 -767 27 -89 93 -184 167 -240 89 -67 157 -90 281 -96 92 -4 105 -2 117 14 12 16 14 134 15 735 0 669 -1 718 -17 737 -20 23 -514 322 -541 327 -9 2 -23 2 -29 -1z"})]})})}),i.jsx("h1",{className:"truncate text-sm font-semibold tracking-tight text-foreground",children:x("app.title")})]});return i.jsxs("div",{className:"flex-shrink-0",children:[i.jsxs("div",{className:"hidden px-4 pb-3 pt-4 md:block",style:{},children:[i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx(y,{}),i.jsxs("div",{className:"flex flex-shrink-0 items-center gap-0.5",children:[i.jsx(_e,{variant:"ghost",size:"sm",className:"h-8 w-8 rounded-lg p-0 text-muted-foreground hover:bg-accent/80 hover:text-foreground",onClick:d,disabled:u,title:x("tooltips.refresh"),children:i.jsx(ht,{className:`h-4 w-4 ${u?"animate-spin":""}`})}),i.jsx(_e,{variant:"ghost",size:"sm",className:"h-8 w-8 rounded-lg p-0 text-muted-foreground hover:bg-accent/80 hover:text-foreground",onClick:p,title:x("tooltips.createProject"),children:i.jsx(Ut,{className:"h-4 w-4"})}),i.jsx(_e,{variant:"ghost",size:"sm",className:"h-8 w-8 rounded-lg p-0 text-muted-foreground hover:bg-accent/80 hover:text-foreground",onClick:m,title:x("tooltips.hideSidebar"),children:i.jsx(bD,{className:"h-4 w-4"})})]})]}),i.jsx(gM,{}),f&&i.jsxs("button",{type:"button",onClick:()=>{f()},className:"mt-2.5 flex w-full items-center justify-center gap-2 rounded-lg border border-primary/20 bg-primary/5 px-3 py-2 text-sm font-medium text-primary transition-colors hover:bg-primary/10",children:[i.jsx(Na,{className:"h-4 w-4"}),x("sidebar.newChat",{defaultValue:"New chat"})]}),n>0&&!r&&i.jsxs("div",{className:"mt-2.5 space-y-2",children:[i.jsx(vw,{value:g,onChange:b,t:x}),i.jsxs("div",{className:"flex rounded-lg bg-muted/50 p-0.5",children:[i.jsxs("button",{onClick:()=>c("projects"),"aria-pressed":l==="projects",className:ue("flex-1 flex items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium transition-all",l==="projects"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[i.jsx(Pn,{className:"h-3 w-3"}),x("search.modeProjects")]}),i.jsxs("button",{onClick:()=>c("conversations"),"aria-pressed":l==="conversations",className:ue("flex-1 flex items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium transition-all",l==="conversations"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[i.jsx(na,{className:"h-3 w-3"}),x("search.modeConversations")]})]}),i.jsxs("div",{className:"relative",children:[i.jsx(Ea,{className:"pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/50"}),i.jsx(Nt,{type:"text",placeholder:x(l==="conversations"?"search.conversationsPlaceholder":"projects.searchPlaceholder"),value:a,onChange:v=>s(v.target.value),className:"nav-search-input h-9 rounded-xl border-0 pl-9 pr-8 text-sm transition-all duration-200 placeholder:text-muted-foreground/40 focus-visible:ring-0 focus-visible:ring-offset-0"}),a&&i.jsx("button",{onClick:o,"aria-label":x("tooltips.clearSearch"),className:"absolute right-2.5 top-1/2 -translate-y-1/2 rounded-md p-0.5 hover:bg-accent",children:i.jsx(xt,{className:"h-3 w-3 text-muted-foreground"})})]})]})]}),i.jsx("div",{className:"nav-divider hidden md:block"}),i.jsxs("div",{className:"p-3 pb-2 md:hidden",style:e&&t?{paddingTop:"16px"}:{},children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(y,{}),i.jsxs("div",{className:"flex flex-shrink-0 gap-1.5",children:[i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-muted/50 transition-all active:scale-95",onClick:d,disabled:u,children:i.jsx(ht,{className:`h-4 w-4 text-muted-foreground ${u?"animate-spin":""}`})}),i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-primary/90 text-primary-foreground transition-all active:scale-95",onClick:p,children:i.jsx(ai,{className:"h-4 w-4"})})]})]}),n>0&&!r&&i.jsxs("div",{className:"mt-2.5 space-y-2",children:[l==="projects"&&i.jsx(vw,{value:g,onChange:b,t:x}),i.jsxs("div",{className:"flex rounded-lg bg-muted/50 p-0.5",children:[i.jsxs("button",{onClick:()=>c("projects"),"aria-pressed":l==="projects",className:ue("flex-1 flex items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium transition-all",l==="projects"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[i.jsx(Pn,{className:"h-3 w-3"}),x("search.modeProjects")]}),i.jsxs("button",{onClick:()=>c("conversations"),"aria-pressed":l==="conversations",className:ue("flex-1 flex items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium transition-all",l==="conversations"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[i.jsx(na,{className:"h-3 w-3"}),x("search.modeConversations")]})]}),i.jsxs("div",{className:"relative",children:[i.jsx(Ea,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground/50"}),i.jsx(Nt,{type:"text",placeholder:x(l==="conversations"?"search.conversationsPlaceholder":"projects.searchPlaceholder"),value:a,onChange:v=>s(v.target.value),className:"nav-search-input h-10 rounded-xl border-0 pl-10 pr-9 text-sm transition-all duration-200 placeholder:text-muted-foreground/40 focus-visible:ring-0 focus-visible:ring-offset-0"}),a&&i.jsx("button",{onClick:o,"aria-label":x("tooltips.clearSearch"),className:"absolute right-2.5 top-1/2 -translate-y-1/2 rounded-md p-1 hover:bg-accent",children:i.jsx(xt,{className:"h-3.5 w-3.5 text-muted-foreground"})})]})]})]}),i.jsx("div",{className:"nav-divider md:hidden"})]})}const xM=160,ww=180;function BN({actions:e,className:t,triggerLabel:r}){const[n,a]=h.useState(!1),[s,o]=h.useState(null),l=h.useRef(null),c=h.useRef(null);h.useLayoutEffect(()=>{if(!n||!l.current)return;const u=l.current.getBoundingClientRect();let p=u.right-xM;p<8&&(p=8);let f=u.bottom+4;f+ww>window.innerHeight&&(f=Math.max(8,u.top-4-ww)),o({top:f,left:p})},[n]),h.useEffect(()=>{if(!n)return;const u=m=>{const g=m.target;l.current?.contains(g)||c.current?.contains(g)||a(!1)},p=m=>{m.key==="Escape"&&a(!1)},f=()=>a(!1);return document.addEventListener("mousedown",u),document.addEventListener("keydown",p),window.addEventListener("scroll",f,!0),window.addEventListener("resize",f),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",p),window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f)}},[n]);const d=u=>p=>{p.stopPropagation(),p.preventDefault(),a(!1),u.onClick()};return i.jsxs(i.Fragment,{children:[i.jsx("button",{ref:l,type:"button","aria-haspopup":"menu","aria-expanded":n,"aria-label":r||"Actions",title:r||"Actions",onClick:u=>{u.stopPropagation(),u.preventDefault(),a(p=>!p)},className:ue("flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground","opacity-0 transition-all duration-150 hover:bg-accent hover:text-foreground","group-hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary","touch:opacity-100",n&&"bg-accent text-foreground opacity-100",t),children:i.jsx(LD,{className:"h-3.5 w-3.5"})}),n&&s&&Bd.createPortal(i.jsx("div",{ref:c,role:"menu",style:{position:"fixed",top:s.top,left:s.left,zIndex:9999},className:ue("w-40 rounded-xl border border-border/60 bg-popover p-1 shadow-lg","animate-in fade-in-0 zoom-in-95 duration-100"),onClick:u=>u.stopPropagation(),onMouseDown:u=>u.stopPropagation(),children:e.map((u,p)=>{const f=u.icon,m=e[p-1],g=p>0&&u.danger&&!m?.danger;return i.jsxs("div",{children:[g&&i.jsx("div",{className:"my-1 h-px bg-border/60"}),i.jsxs("button",{type:"button",role:"menuitem",onClick:d(u),className:ue("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs",u.danger?"text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-900/20":"text-foreground hover:bg-accent"),children:[i.jsx(f,{className:"h-3 w-3"}),u.label]})]},u.id)})}),document.body)]})}const kw={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},yM={xs:"p-0.5",sm:"p-1",md:"p-1.5",lg:"p-2"},vM=e=>e==="fully-configured"?{icon:ra,colorClassName:"text-green-500 dark:text-green-400",backgroundClassName:"bg-green-50 dark:bg-green-950",label:"TaskMaster Ready",title:"TaskMaster fully configured with MCP server"}:e==="taskmaster-only"?{icon:Lt,colorClassName:"text-blue-500 dark:text-blue-400",backgroundClassName:"bg-blue-50 dark:bg-blue-950",label:"TaskMaster Init",title:"TaskMaster initialized, MCP server needs setup"}:e==="mcp-only"?{icon:En,colorClassName:"text-amber-500 dark:text-amber-400",backgroundClassName:"bg-amber-50 dark:bg-amber-950",label:"MCP Ready",title:"MCP server configured, TaskMaster needs initialization"}:{icon:xt,colorClassName:"text-gray-400 dark:text-gray-500",backgroundClassName:"bg-gray-50 dark:bg-gray-900",label:"No TaskMaster",title:"TaskMaster not configured"};function wM({status:e="not-configured",size:t="sm",className:r="",showLabel:n=!1}){const a=vM(e),s=a.icon;return n?i.jsxs("div",{className:ue("inline-flex items-center gap-1.5 text-xs rounded-md px-2 py-1 transition-colors",a.backgroundClassName,a.colorClassName,r),title:a.title,children:[i.jsx(s,{className:kw[t]}),i.jsx("span",{className:"font-medium",children:a.label})]}):i.jsx("div",{className:ue("inline-flex items-center justify-center rounded-full transition-colors",a.backgroundClassName,yM[t],r),title:a.title,children:i.jsx(s,{className:ue(kw[t],a.colorClassName)})})}const kM=(e,t,r)=>{const n=new Date(e),a=t;if(isNaN(n.getTime()))return r?r("status.unknown"):"Unknown";const s=a.getTime()-n.getTime(),o=Math.floor(s/1e3),l=Math.floor(s/(1e3*60)),c=Math.floor(s/(1e3*60*60)),d=Math.floor(s/(1e3*60*60*24));return o<60?r?r("time.justNow"):"Just now":l===1?r?r("time.oneMinuteAgo"):"1 min ago":l<60?r?r("time.minutesAgo",{count:l}):`${l} mins ago`:c===1?r?r("time.oneHourAgo"):"1 hour ago":c<24?r?r("time.hoursAgo",{count:c}):`${c} hours ago`:d===1?r?r("time.oneDayAgo"):"1 day ago":d<7?r?r("time.daysAgo",{count:d}):`${d} days ago`:n.toLocaleDateString()};function Sw({isStarred:e,canDelete:t,onRename:r,onToggleStar:n,onDelete:a,t:s,className:o}){const l=d=>i.jsx(Is,{className:`${d.className??""} ${e?"fill-yellow-400 text-yellow-500":""}`}),c=[{id:"rename",label:s("actions.rename"),icon:AD,onClick:r},{id:"star",label:e?s("actions.unstarSession",{defaultValue:"Remove star"}):s("actions.starSession",{defaultValue:"Star"}),icon:l,onClick:n}];return t&&c.push({id:"delete",label:s("actions.delete"),icon:kr,onClick:a,danger:!0}),i.jsx(BN,{actions:c,className:o,triggerLabel:s("tooltips.sessionActions",{defaultValue:"Session actions"})})}const SM={claude:"Claude",cursor:"Cursor",codex:"Codex",gemini:"Gemini",qwen:"Qwen Code",opencode:"OpenCode"},Ew={claude:"bg-orange-500/10 text-orange-600 dark:bg-orange-400/10 dark:text-orange-300 ring-1 ring-orange-500/15",cursor:"bg-sky-500/10 text-sky-600 dark:bg-sky-400/10 dark:text-sky-300 ring-1 ring-sky-500/15",codex:"bg-violet-500/10 text-violet-600 dark:bg-violet-400/10 dark:text-violet-300 ring-1 ring-violet-500/15",gemini:"bg-emerald-500/10 text-emerald-600 dark:bg-emerald-400/10 dark:text-emerald-300 ring-1 ring-emerald-500/15",qwen:"bg-amber-500/10 text-amber-600 dark:bg-amber-400/10 dark:text-amber-300 ring-1 ring-amber-500/15",opencode:"bg-teal-500/10 text-teal-600 dark:bg-teal-400/10 dark:text-teal-300 ring-1 ring-teal-500/15"};function $N({project:e,session:t,selectedSession:r,currentTime:n,editingSession:a,editingSessionName:s,isStarred:o,compact:l=!1,onEditingSessionNameChange:c,onStartEditingSession:d,onCancelEditingSession:u,onSaveEditingSession:p,onToggleStarSession:f,onProjectSelect:m,onSessionSelect:g,onDeleteSession:b,t:x}){const y=i9(t,n,x),v=r?.id===t.id,w=a===t.id,k=t.__provider,E=SM[k]??k,S=Ew[k]??Ew.claude,j=r9(y.sessionName),_=()=>{m(e),g(t,e.name)},T=()=>{p(e.name,t.id,s,k)},C=()=>{b(e.name,t.id,y.sessionName,k)},L=()=>d(t.id,y.sessionName),A=()=>f(e.name,t.id),I=i.jsxs("div",{className:"mt-0.5 flex min-w-0 flex-wrap items-center gap-1 text-[10px] leading-tight",children:[i.jsxs("span",{className:ue("inline-flex items-center gap-1 rounded-full px-1.5 py-px font-medium",S),children:[i.jsx(dr,{provider:k,className:"h-2.5 w-2.5"}),E]}),i.jsx("span",{className:"text-muted-foreground/80",children:kM(y.sessionTime,n,x)}),y.isActive&&i.jsxs("span",{className:"inline-flex items-center gap-1 text-green-600 dark:text-green-400",children:[i.jsx("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),x("status.active",{defaultValue:"Active"})]}),j.slice(0,3).map(z=>i.jsxs("span",{className:"rounded-md bg-muted/60 px-1 py-px font-mono text-[9px] uppercase tracking-wide text-muted-foreground ring-1 ring-border/40",children:[".",z]},z))]}),N=i.jsxs(i.Fragment,{children:[i.jsx("input",{type:"text",value:s,onChange:z=>c(z.target.value),onKeyDown:z=>{z.stopPropagation(),z.key==="Enter"?T():z.key==="Escape"&&u()},onClick:z=>z.stopPropagation(),className:"w-full rounded-md border border-primary/40 bg-background px-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-primary",autoFocus:!0}),i.jsx("button",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-green-50 hover:bg-green-100 dark:bg-green-900/20 dark:hover:bg-green-900/40",onClick:z=>{z.stopPropagation(),T()},title:x("tooltips.save"),children:i.jsx(rr,{className:"h-3 w-3 text-green-600 dark:text-green-400"})}),i.jsx("button",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-gray-50 hover:bg-gray-100 dark:bg-gray-900/20 dark:hover:bg-gray-900/40",onClick:z=>{z.stopPropagation(),u()},title:x("tooltips.cancel"),children:i.jsx(xt,{className:"h-3 w-3 text-gray-600 dark:text-gray-400"})})]}),P=i.jsx("div",{className:"md:hidden",children:i.jsx("div",{className:ue("relative mx-3 my-0.5 rounded-lg border border-border/30 bg-card p-2 transition-all duration-150 active:scale-[0.98]",v&&"border-primary/30 bg-primary/5 shadow-sm",!v&&y.isActive&&"border-green-500/25 bg-green-50/5 dark:bg-green-900/5",o&&!v&&"ring-1 ring-yellow-300/50 dark:ring-yellow-500/30"),onClick:w?void 0:_,children:w?i.jsx("div",{className:"flex items-center gap-1",children:N}):i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:ue("flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-md",v?"bg-primary/10":"bg-muted/60"),children:i.jsx(dr,{provider:k,className:"h-3 w-3"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[o&&i.jsx("span",{className:"text-yellow-500","aria-hidden":!0,children:"★"}),i.jsx("span",{className:"truncate text-xs font-medium text-foreground",children:y.sessionName})]}),I]}),i.jsx("div",{className:"flex-shrink-0",onClick:z=>z.stopPropagation(),children:i.jsx(Sw,{isStarred:o,canDelete:!y.isCursorSession,onRename:L,onToggleStar:A,onDelete:C,t:x,className:"!opacity-100"})})]})})}),H=i.jsxs("div",{className:ue("group/item relative hidden md:block"),children:[i.jsxs(_e,{variant:"ghost",className:ue("relative h-auto w-full justify-start overflow-hidden p-0 text-left font-normal transition-colors duration-150","hover:bg-accent/60",v&&"bg-accent text-accent-foreground",o&&!v&&"bg-yellow-50/40 hover:bg-yellow-100/40 dark:bg-yellow-900/10 dark:hover:bg-yellow-900/20",l?"rounded-xl px-3 py-2.5":"rounded-lg px-3 py-2"),onClick:w?void 0:()=>g(t,e.name),children:[v&&i.jsx("span",{"aria-hidden":!0,className:"absolute left-0 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-r bg-primary"}),!v&&!w&&i.jsx("span",{"aria-hidden":!0,className:"session-item-accent"}),i.jsxs("div",{className:"flex w-full min-w-0 items-start gap-2 pr-6",children:[i.jsx("div",{className:ue("mt-0.5 flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-md",v?"bg-primary/10":"bg-muted/50 group-hover/item:bg-muted/80"),children:i.jsx(dr,{provider:k,className:"h-3 w-3"})}),i.jsx("div",{className:"min-w-0 flex-1",children:w?i.jsx("div",{className:"flex items-center gap-1",children:N}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[o&&i.jsx("span",{className:"flex-shrink-0 text-yellow-500","aria-hidden":!0,children:"★"}),i.jsx("span",{className:"truncate text-xs font-medium text-foreground",children:y.sessionName})]}),I]})})]})]}),!w&&i.jsx("div",{className:"absolute right-1.5 top-1/2 -translate-y-1/2",onClick:z=>z.stopPropagation(),children:i.jsx(Sw,{isStarred:o,canDelete:!y.isCursorSession,onRename:L,onToggleStar:A,onDelete:C,t:x,className:"opacity-0 focus-visible:opacity-100 group-hover/item:opacity-100"})})]});return i.jsxs("div",{className:"group relative",children:[P,H]})}const EM=e=>e==="claude-code"?"claude":e==="codex"?"codex":e==="gemini"?"gemini":e==="qwen"?"qwen":e==="opencode"?"opencode":null;function NM(){return i.jsx(i.Fragment,{children:Array.from({length:3}).map((e,t)=>i.jsx("div",{className:"rounded-md p-2",children:i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx("div",{className:"mt-0.5 h-3 w-3 animate-pulse rounded-full bg-muted"}),i.jsxs("div",{className:"flex-1 space-y-1",children:[i.jsx("div",{className:"h-3 animate-pulse rounded bg-muted",style:{width:`${60+t*15}%`}}),i.jsx("div",{className:"h-2 w-1/2 animate-pulse rounded bg-muted"})]})]})},t))})}function CM({project:e,isExpanded:t,sessions:r,selectedSession:n,initialSessionsLoaded:a,isLoadingSessions:s,currentTime:o,editingSession:l,editingSessionName:c,isSessionStarred:d,onEditingSessionNameChange:u,onStartEditingSession:p,onCancelEditingSession:f,onSaveEditingSession:m,onToggleStarSession:g,onProjectSelect:b,onSessionSelect:x,onDeleteSession:y,onLoadMoreSessions:v,onNewSession:w,onOpenOrchestration:k,t:E}){const[S,j]=h.useState([]);if(h.useEffect(()=>{if(!t)return;let C=!1;const L=async()=>{const I=await ve(`/api/orchestration/workflows/runs?projectId=${encodeURIComponent(e.name)}`);if(!I.ok)return;const N=await I.json();C||j((N.runs??[]).slice(0,5))};L();const A=window.setInterval(()=>{L()},15e3);return()=>{C=!0,window.clearInterval(A)}},[t,e.name]),!t)return null;const _=r.length>0,T=e.sessionMeta?.hasMore===!0;return i.jsxs("div",{className:"ml-3 space-y-1 border-l border-border pl-3",children:[i.jsx("div",{className:"px-3 pb-1 pt-1 md:hidden",children:i.jsxs("button",{className:"flex h-8 w-full items-center justify-center gap-2 rounded-md bg-primary text-xs font-medium text-primary-foreground transition-all duration-150 hover:bg-primary/90 active:scale-[0.98]",onClick:()=>{b(e),w(e)},children:[i.jsx(Ut,{className:"h-3 w-3"}),E("sessions.newSession")]})}),i.jsxs(_e,{variant:"default",size:"sm",className:"hidden h-8 w-full justify-start gap-2 bg-primary text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90 md:flex",onClick:()=>w(e),children:[i.jsx(Ut,{className:"h-3 w-3"}),E("sessions.newSession")]}),S.length>0&&i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center gap-1 px-3 pt-2 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:[i.jsx(aa,{className:"h-3 w-3"}),E("orchestration.section")]}),S.map(C=>{const L=[...new Set(C.nodeRuns.map(A=>EM(A.adapterId)).filter(Boolean))];return i.jsx("button",{type:"button",onClick:()=>k?.(e,C.id),className:"w-full rounded-lg px-3 py-2 text-left transition-colors hover:bg-accent/60",children:i.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[i.jsx(aa,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-primary"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"truncate text-xs font-medium text-foreground",children:C.input||E("orchestration.fallbackTitle")}),i.jsxs("div",{className:"mt-1 flex items-center gap-1",children:[L.slice(0,4).map(A=>i.jsx("span",{className:"flex h-4 w-4 items-center justify-center rounded bg-muted",children:i.jsx(dr,{provider:A,className:"h-3 w-3"})},A)),i.jsx("span",{className:"text-[10px] text-muted-foreground",children:E(`common:orchestration.status.${C.status}`,{defaultValue:C.status})})]})]})]})},C.id)})]}),a?!_&&!s?i.jsx("div",{className:"px-3 py-2 text-left",children:i.jsx("p",{className:"text-xs text-muted-foreground",children:E("sessions.noSessions")})}):r.map(C=>i.jsx($N,{project:e,session:C,selectedSession:n,currentTime:o,editingSession:l,editingSessionName:c,isStarred:d(e.name,C.id),onEditingSessionNameChange:u,onStartEditingSession:p,onCancelEditingSession:f,onSaveEditingSession:m,onToggleStarSession:g,onProjectSelect:b,onSessionSelect:x,onDeleteSession:y,t:E},C.id)):i.jsx(NM,{}),_&&T&&i.jsx(_e,{variant:"ghost",size:"sm",className:"mt-2 w-full justify-center gap-2 text-muted-foreground",onClick:()=>v(e),disabled:s,children:s?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"h-3 w-3 animate-spin rounded-full border border-muted-foreground border-t-transparent"}),E("sessions.loading")]}):i.jsxs(i.Fragment,{children:[i.jsx(Pr,{className:"h-3 w-3"}),E("sessions.showMore")]})})]})}const AM=(e,t)=>{const r=e.length;return t&&r>=5?`${r}+`:`${r}`};function TM({project:e,selectedProject:t,selectedSession:r,isExpanded:n,isDeleting:a,isStarred:s,editingProject:o,editingName:l,sessions:c,initialSessionsLoaded:d,isLoadingSessions:u,currentTime:p,editingSession:f,editingSessionName:m,tasksEnabled:g,mcpServerStatus:b,isSessionStarred:x,onEditingNameChange:y,onToggleProject:v,onProjectSelect:w,onToggleStarProject:k,onToggleStarSession:E,onStartEditingProject:S,onCancelEditingProject:j,onSaveProjectName:_,onDeleteProject:T,onSessionSelect:C,onDeleteSession:L,onLoadMoreSessions:A,onNewSession:I,onOpenOrchestration:N,onEditingSessionNameChange:P,onStartEditingSession:H,onCancelEditingSession:z,onSaveEditingSession:U,t:V}){const O=t?.name===e.name,G=o===e.name,$=e.sessionMeta?.hasMore===!0,F=AM(c,$),te=`${F} session${c.length===1?"":"s"}`,Q=l9(e,b),ge=()=>v(e.name),ae=()=>k(e.name),me=()=>{_(e.name)},pe=()=>{t?.name!==e.name&&w(e),ge()};return i.jsxs("div",{className:ue("md:space-y-1",a&&"opacity-50 pointer-events-none"),children:[i.jsxs("div",{className:"md:group group",children:[i.jsx("div",{className:"md:hidden",children:i.jsx("div",{className:ue("p-3 mx-3 my-1 rounded-lg bg-card border border-border/50 active:scale-[0.98] transition-all duration-150",O&&"bg-primary/5 border-primary/20",s&&!O&&"bg-yellow-50/50 dark:bg-yellow-900/5 border-yellow-200/30 dark:border-yellow-800/30"),onClick:ge,children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[i.jsx("div",{className:ue("w-8 h-8 rounded-lg flex items-center justify-center transition-colors",n?"bg-primary/10":"bg-muted"),children:n?i.jsx(Sa,{className:"h-4 w-4 text-primary"}):i.jsx(Pn,{className:"h-4 w-4 text-muted-foreground"})}),i.jsx("div",{className:"min-w-0 flex-1",children:G?i.jsx("input",{type:"text",value:l,onChange:be=>y(be.target.value),className:"w-full rounded-lg border-2 border-primary/40 bg-background px-3 py-2 text-sm text-foreground shadow-sm transition-all duration-200 focus:border-primary focus:shadow-md focus:outline-none",placeholder:V("projects.projectNamePlaceholder"),autoFocus:!0,autoComplete:"off",onClick:be=>be.stopPropagation(),onKeyDown:be=>{be.key==="Enter"&&me(),be.key==="Escape"&&j()},style:{fontSize:"16px",WebkitAppearance:"none",borderRadius:"8px"}}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex min-w-0 flex-1 items-center justify-between",children:[i.jsx("h3",{className:"truncate text-sm font-medium text-foreground",children:e.displayName}),g&&i.jsx(wM,{status:Q,size:"xs",className:"ml-2 hidden flex-shrink-0 md:inline-flex"})]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:te})]})})]}),i.jsx("div",{className:"flex items-center gap-1",children:G?i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-green-500 shadow-sm transition-all duration-150 active:scale-90 active:shadow-none dark:bg-green-600",onClick:be=>{be.stopPropagation(),me()},children:i.jsx(rr,{className:"h-4 w-4 text-white"})}),i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-gray-500 shadow-sm transition-all duration-150 active:scale-90 active:shadow-none dark:bg-gray-600",onClick:be=>{be.stopPropagation(),j()},children:i.jsx(xt,{className:"h-4 w-4 text-white"})})]}):i.jsxs(i.Fragment,{children:[i.jsx("button",{className:ue("w-8 h-8 rounded-lg flex items-center justify-center active:scale-90 transition-all duration-150 border",s?"bg-yellow-500/10 dark:bg-yellow-900/30 border-yellow-200 dark:border-yellow-800":"bg-gray-500/10 dark:bg-gray-900/30 border-gray-200 dark:border-gray-800"),onClick:be=>{be.stopPropagation(),ae()},title:V(s?"tooltips.removeFromFavorites":"tooltips.addToFavorites"),children:i.jsx(Is,{className:ue("w-4 h-4 transition-colors",s?"text-yellow-600 dark:text-yellow-400 fill-current":"text-gray-600 dark:text-gray-400")})}),i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg border border-red-200 bg-red-500/10 active:scale-90 dark:border-red-800 dark:bg-red-900/30",onClick:be=>{be.stopPropagation(),T(e)},children:i.jsx(kr,{className:"h-4 w-4 text-red-600 dark:text-red-400"})}),i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg border border-primary/20 bg-primary/10 active:scale-90 dark:border-primary/30 dark:bg-primary/20",onClick:be=>{be.stopPropagation(),S(e)},children:i.jsx(Um,{className:"h-4 w-4 text-primary"})}),i.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-muted/30",children:n?i.jsx(Pr,{className:"h-3 w-3 text-muted-foreground"}):i.jsx(An,{className:"h-3 w-3 text-muted-foreground"})})]})})]})})}),i.jsxs(_e,{variant:"ghost",className:ue("hidden md:flex w-full justify-between p-2 h-auto font-normal hover:bg-accent/50",O&&"bg-accent text-accent-foreground",s&&!O&&"bg-yellow-50/50 dark:bg-yellow-900/10 hover:bg-yellow-100/50 dark:hover:bg-yellow-900/20"),onClick:pe,children:[i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[n?i.jsx(Sa,{className:"h-4 w-4 flex-shrink-0 text-primary"}):i.jsx(Pn,{className:"h-4 w-4 flex-shrink-0 text-muted-foreground"}),i.jsx("div",{className:"min-w-0 flex-1 text-left",children:G?i.jsxs("div",{className:"space-y-1",children:[i.jsx("input",{type:"text",value:l,onChange:be=>y(be.target.value),className:"w-full rounded border border-border bg-background px-2 py-1 text-sm text-foreground focus:ring-2 focus:ring-primary/20",placeholder:V("projects.projectNamePlaceholder"),autoFocus:!0,onKeyDown:be=>{be.key==="Enter"&&me(),be.key==="Escape"&&j()}}),i.jsx("div",{className:"truncate text-xs text-muted-foreground",title:e.fullPath,children:e.fullPath})]}):i.jsxs("div",{children:[i.jsx("div",{className:"truncate text-sm font-semibold text-foreground",title:e.displayName,children:e.displayName}),i.jsxs("div",{className:"text-xs text-muted-foreground",children:[F,e.fullPath!==e.displayName&&i.jsxs("span",{className:"ml-1 opacity-60",title:e.fullPath,children:[" - ",e.fullPath.length>25?`...${e.fullPath.slice(-22)}`:e.fullPath]})]})]})})]}),i.jsx("div",{className:"flex flex-shrink-0 items-center gap-1",children:G?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex h-6 w-6 cursor-pointer items-center justify-center rounded text-green-600 transition-colors hover:bg-green-50 hover:text-green-700 dark:hover:bg-green-900/20",onClick:be=>{be.stopPropagation(),me()},children:i.jsx(rr,{className:"h-3 w-3"})}),i.jsx("div",{className:"flex h-6 w-6 cursor-pointer items-center justify-center rounded text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700 dark:hover:bg-gray-800",onClick:be=>{be.stopPropagation(),j()},children:i.jsx(xt,{className:"h-3 w-3"})})]}):i.jsxs(i.Fragment,{children:[s&&i.jsx("div",{className:"flex h-6 w-6 cursor-pointer items-center justify-center rounded hover:bg-yellow-50 dark:hover:bg-yellow-900/20",onClick:be=>{be.stopPropagation(),ae()},title:V("tooltips.removeFromFavorites"),children:i.jsx(Is,{className:"h-3 w-3 fill-current text-yellow-600 dark:text-yellow-400"})}),i.jsx(BN,{triggerLabel:V("tooltips.projectActions",{defaultValue:"Project actions"}),actions:[{id:"rename",label:V("actions.rename"),icon:Um,onClick:()=>S(e)},{id:"star",label:V(s?"tooltips.removeFromFavorites":"tooltips.addToFavorites"),icon:Is,onClick:ae},{id:"delete",label:V("actions.delete",{defaultValue:"Delete"}),icon:kr,onClick:()=>T(e),danger:!0}]}),n?i.jsx(Pr,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"}):i.jsx(An,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})]})})]})]}),i.jsx(CM,{project:e,isExpanded:n,sessions:c,selectedSession:r,initialSessionsLoaded:d,isLoadingSessions:u,currentTime:p,editingSession:f,editingSessionName:m,isSessionStarred:x,onEditingSessionNameChange:P,onStartEditingSession:H,onCancelEditingSession:z,onSaveEditingSession:U,onToggleStarSession:E,onProjectSelect:w,onSessionSelect:C,onDeleteSession:L,onLoadMoreSessions:A,onNewSession:I,onOpenOrchestration:N,t:V})]})}function UN({isLoading:e,loadingProgress:t,projectsCount:r,filteredProjectsCount:n,t:a}){return e?i.jsxs("div",{className:"px-4 py-12 text-center md:py-8",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-lg bg-muted md:mb-3",children:i.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent"})}),i.jsx("h3",{className:"mb-2 text-base font-medium text-foreground md:mb-1",children:a("projects.loadingProjects")}),t&&t.total>0?i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-muted",children:i.jsx("div",{className:"h-full bg-primary transition-all duration-300 ease-out",style:{width:`${t.current/t.total*100}%`}})}),i.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.current,"/",t.total," ",a("projects.projects")]}),t.currentProject&&i.jsx("p",{className:"mx-auto max-w-[200px] truncate text-xs text-muted-foreground/70",title:t.currentProject,children:t.currentProject.split("-").slice(-2).join("/")})]}):i.jsx("p",{className:"text-sm text-muted-foreground",children:a("projects.fetchingProjects")})]}):r===0?i.jsxs("div",{className:"px-4 py-12 text-center md:py-8",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-lg bg-muted md:mb-3",children:i.jsx(Pn,{className:"h-6 w-6 text-muted-foreground"})}),i.jsx("h3",{className:"mb-2 text-base font-medium text-foreground md:mb-1",children:a("projects.noProjects")}),i.jsx("p",{className:"text-sm text-muted-foreground",children:a("projects.runClaudeCli")})]}):n===0?i.jsxs("div",{className:"px-4 py-12 text-center md:py-8",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-lg bg-muted md:mb-3",children:i.jsx(Ea,{className:"h-6 w-6 text-muted-foreground"})}),i.jsx("h3",{className:"mb-2 text-base font-medium text-foreground md:mb-1",children:a("projects.noMatchingProjects")}),i.jsx("p",{className:"text-sm text-muted-foreground",children:a("projects.tryDifferentSearch")})]}):null}function jM({projects:e,filteredProjects:t,selectedProject:r,selectedSession:n,isLoading:a,loadingProgress:s,expandedProjects:o,editingProject:l,editingName:c,loadingSessions:d,initialSessionsLoaded:u,currentTime:p,editingSession:f,editingSessionName:m,deletingProjects:g,tasksEnabled:b,mcpServerStatus:x,getProjectSessions:y,isProjectStarred:v,isSessionStarred:w,onEditingNameChange:k,onToggleProject:E,onProjectSelect:S,onToggleStarProject:j,onToggleStarSession:_,onStartEditingProject:T,onCancelEditingProject:C,onSaveProjectName:L,onDeleteProject:A,onSessionSelect:I,onDeleteSession:N,onLoadMoreSessions:P,onNewSession:H,onOpenOrchestration:z,onEditingSessionNameChange:U,onStartEditingSession:V,onCancelEditingSession:O,onSaveEditingSession:G,t:$}){const F=i.jsx(UN,{isLoading:a,loadingProgress:s,projectsCount:e.length,filteredProjectsCount:t.length,t:$});h.useEffect(()=>{let pe="Pixcode";const be=r?.displayName?.trim();be&&(pe=`${be} - ${pe}`),document.title=pe},[r]);const te=!a&&e.length>0&&t.length>0,Q=pe=>pe.source==="history"||pe.autoDiscovered===!0&&pe.isManuallyAdded!==!0,ge=t.filter(pe=>!Q(pe)),ae=t.filter(pe=>Q(pe)),me=pe=>i.jsx(TM,{project:pe,selectedProject:r,selectedSession:n,isExpanded:o.has(pe.name),isDeleting:g.has(pe.name),isStarred:v(pe.name),editingProject:l,editingName:c,sessions:y(pe),initialSessionsLoaded:u.has(pe.name),isLoadingSessions:!!d[pe.name],currentTime:p,editingSession:f,editingSessionName:m,tasksEnabled:b,mcpServerStatus:x,isSessionStarred:w,onEditingNameChange:k,onToggleProject:E,onProjectSelect:S,onToggleStarProject:j,onToggleStarSession:_,onStartEditingProject:T,onCancelEditingProject:C,onSaveProjectName:L,onDeleteProject:A,onSessionSelect:I,onDeleteSession:N,onLoadMoreSessions:P,onNewSession:H,onOpenOrchestration:z,onEditingSessionNameChange:U,onStartEditingSession:V,onCancelEditingSession:O,onSaveEditingSession:G,t:$},pe.name);return i.jsx("div",{className:"pb-safe-area-inset-bottom md:space-y-1",children:te?i.jsxs(i.Fragment,{children:[ge.map(pe=>me(pe)),ae.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"px-3 pb-1 pt-3 text-[11px] font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",children:$("projects.detectedFromHistory")}),ae.map(pe=>me(pe))]})]}):F})}function fa(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GN(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}/*!
|
|
229
|
+
*/const dD=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],uD=gt("workflow",dD),wf=rE,mE=XI,Vv=WI,pD=i7,mD=FI,kf=GI,hD=tE,Pr=iE,fD=z7,Sf=L7,An=O7,gD=P7,Kr=VI,ta=tE,nd=YI,hE=$I,bD=T7,xD=_7,fE=QI,ht=nE,Ot=nE,Gd=n7,gE=t7,yD=Y8,En=p8,Tr=h8,rr=C7,ra=E7,bE=D8,ln=xR,vD=lE,wD=lE,ad=b7,Hd=G7,xE=$7,Vd=sE,Qo=K7,Bs=a8,$t=s8,Pn=C8,Sa=k8,ai=E8,kD=rR,SD=R8,pl=z8,Ef=pR,ED=o7,Ll=y7,ND=LR,CD=vf,AD=vf,Um=Q8,TD=T8,jD=v8,_D=SR,ID=dR,RD=V8,yE=X8,Gm=vf,Nf=aR,Ut=sR,kr=OR,LD=l8,Ea=G8,xt=cE,Hm=cE,qd=AR,Cf=m7,DD=u7,Vm=c7,OD=d8,na=aE,MD=aE,PD=PR,vE=zR,ml=w7,wE=q7,Yi=x8,Af=g8,Fn=_8,kE=sE,Wd=oE,FD=oE,SE=P8,yn=$8,Tf=W8,EE=e8,NE=IR,zD=lR,jf=gR,BD=hR,Lt=Z7,$D=DI,CE=r8,Na=wR,Is=NR,_f=jR,Gr=J7,If=f7,UD=YR,Dl=tL,Rf=uE,GD=uE,Qr=FL,Pc=BL,HD=UL,ss=WR,os=XR,VD=QR,zo=nL,Rs=iL,qv=dL,Bo=pL,Eo=gL,qD=xL,AE=_L,qm=vL,_i=EL,No=kL,Wv=CL,Co=TL,Wm=RL,WD=DL,Km=ML,Ns=qL,$o=KL,Ba=ZL,ls=JL,KD=eD,Ym=rD,YD=iD,Ao=cD,aa=uD,hl=lL,TE=hL,ZD=HL,XD=oD,JD=[{type:"key",id:"esc",label:"Esc",sequence:"\x1B"},{type:"key",id:"tab",label:"Tab",sequence:" "},{type:"key",id:"shift-tab",label:"⇧Tab",sequence:"\x1B[Z"},{type:"modifier",id:"ctrl",label:"CTRL",modifier:"ctrl"},{type:"modifier",id:"alt",label:"ALT",modifier:"alt"},{type:"arrow",id:"arrow-up",sequence:"\x1B[A",icon:"up"},{type:"arrow",id:"arrow-down",sequence:"\x1B[B",icon:"down"},{type:"arrow",id:"arrow-left",sequence:"\x1B[D",icon:"left"},{type:"arrow",id:"arrow-right",sequence:"\x1B[C",icon:"right"}],QD={up:mE,down:wf,left:mD,right:kf},To=e=>e.preventDefault(),Kv="shrink-0 rounded-md border border-gray-600 bg-gray-700 px-2.5 py-1.5 text-xs font-medium text-gray-100 transition-colors select-none active:bg-blue-600 active:text-white active:border-blue-600 disabled:cursor-not-allowed disabled:opacity-40",eO="shrink-0 rounded-md border border-blue-500 bg-blue-600 px-2.5 py-1.5 text-xs font-medium text-white transition-colors select-none disabled:cursor-not-allowed disabled:opacity-40",Bu="shrink-0 rounded-md border border-gray-600 bg-gray-700 p-1.5 text-gray-100 transition-colors select-none active:bg-blue-600 active:text-white active:border-blue-600 disabled:cursor-not-allowed disabled:opacity-40";function Yv({wsRef:e,terminalRef:t,isConnected:r,bottomOffset:n="bottom-0"}){const{t:a}=Me("settings"),[s,o]=h.useState(!1),[l,c]=h.useState(!1),d=h.useCallback(m=>{Mi(e.current,{type:"input",data:m})},[e]),u=h.useCallback(()=>{t.current?.scrollToBottom()},[t]),p=h.useCallback(async()=>{if(!(typeof navigator>"u"||!navigator.clipboard?.readText))try{const m=await navigator.clipboard.readText();m.length>0&&d(m)}catch{}},[d]),f=h.useCallback(m=>{let g=m;if(s&&m.length===1){const b=m.toLowerCase().charCodeAt(0);b>=97&&b<=122&&(g=String.fromCharCode(b-96)),o(!1)}l&&m.length===1&&(g="\x1B"+g,c(!1)),d(g)},[s,l,d]);return i.jsx("div",{className:`pointer-events-none fixed inset-x-0 ${n} z-20 px-2 md:hidden`,children:i.jsxs("div",{className:"pointer-events-auto flex items-center gap-1 overflow-x-auto rounded-lg border border-gray-700/80 bg-gray-900/95 px-1.5 py-1.5 shadow-lg backdrop-blur-sm [-webkit-overflow-scrolling:touch] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[i.jsx("button",{type:"button",onPointerDown:To,onClick:()=>{p()},disabled:!r,className:Bu,title:a("terminalShortcuts.paste",{defaultValue:"Paste"}),"aria-label":a("terminalShortcuts.paste",{defaultValue:"Paste"}),children:i.jsx(Hd,{className:"h-4 w-4"})}),JD.map(m=>{if(m.type==="modifier"){const g=m.modifier==="ctrl"?s:l,b=m.modifier==="ctrl"?()=>o(x=>!x):()=>c(x=>!x);return i.jsx("button",{type:"button",onPointerDown:To,onClick:b,disabled:!r,className:g?eO:Kv,children:m.label},m.id)}if(m.type==="arrow"){const g=QD[m.icon];return i.jsx("button",{type:"button",onPointerDown:To,onClick:()=>d(m.sequence),disabled:!r,className:Bu,children:i.jsx(g,{className:"h-4 w-4"})},m.id)}return i.jsx("button",{type:"button",onPointerDown:To,onClick:()=>f(m.sequence),disabled:!r,className:Kv,children:m.label},m.id)}),i.jsx("button",{type:"button",onPointerDown:To,onClick:u,disabled:!r,className:Bu,title:a("terminalShortcuts.scrollDown"),"aria-label":a("terminalShortcuts.scrollDown"),children:i.jsx(hD,{className:"h-4 w-4"})})]})})}function jE({selectedProject:e=null,selectedSession:t=null,initialCommand:r=null,isPlainShell:n=!1,onProcessComplete:a=null,minimal:s=!1,autoConnect:o=!1,isActive:l=!0}){const{t:c}=Me("chat"),[d,u]=h.useState(!1),[p,f]=h.useState(null),m=h.useRef(null),g=h.useRef(null),{terminalContainerRef:b,terminalRef:x,wsRef:y,isConnected:v,isInitialized:w,isConnecting:k,authUrl:E,authUrlVersion:S,connectToShell:j,disconnectFromShell:_,openAuthUrlInBrowser:T,copyAuthUrlToClipboard:C}=TI({selectedProject:e,selectedSession:t,initialCommand:r,isPlainShell:n,minimal:s,autoConnect:o,isRestarting:d,onProcessComplete:a,onOutputRef:g}),L=h.useCallback(()=>{const $=x.current;if(!$)return;const F=$.buffer.active,te=F.baseY+F.cursorY,Q=Math.min(F.baseY+F.length-1,te+10),ge=Math.max(0,te-oI),ae=[];for(let xe=ge;xe<=Q;xe++){const Be=F.getLine(xe);Be&&ae.push(Be.translateToString().trimEnd())}let me=-1;for(let xe=ae.length-1;xe>=0;xe--)if(/esc to cancel/i.test(ae[xe])||/enter to select/i.test(ae[xe])){me=xe;break}if(me===-1){f(null);return}const pe=new Map,be=Math.max(0,me-lI);for(let xe=me-1;xe>=be;xe--){const Be=ae[xe].match(/^\s*[❯›>]?\s*(\d+)\.\s+(.+)/);if(Be){const M=Be[1],de=Be[2].trim();parseInt(M,10)<=cI&&de.length>0&&!pe.has(M)&&pe.set(M,de)}}const Ne=[];for(let xe=1;xe<=pe.size&&pe.has(String(xe));xe++)Ne.push({number:String(xe),label:pe.get(String(xe))});f(Ne.length>=dI?Ne:null)},[x]),A=h.useCallback(()=>{m.current&&clearTimeout(m.current),m.current=setTimeout(L,sI)},[L]);h.useEffect(()=>{g.current=A},[A]),h.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]),h.useEffect(()=>{v||(m.current&&(clearTimeout(m.current),m.current=null),f(null))},[v]),h.useEffect(()=>{if(!l||!w||!v)return;const $=()=>{x.current?.focus()},F=window.requestAnimationFrame($),te=window.setTimeout($,0);return()=>{window.cancelAnimationFrame(F),window.clearTimeout(te)}},[l,v,w,x]);const I=h.useCallback($=>{Mi(y.current,{type:"input",data:$})},[y]),N=h.useMemo(()=>EI(t),[t]),P=h.useMemo(()=>N?N.slice(0,30):null,[N]),H=h.useMemo(()=>N?N.slice(0,50):null,[N]),z=h.useCallback(()=>{u(!0),window.setTimeout(()=>{u(!1)},aI)},[]);if(!e)return i.jsx(_I,{title:c("shell.selectProject.title"),description:c("shell.selectProject.description")});if(s)return i.jsxs(i.Fragment,{children:[i.jsx(RI,{terminalContainerRef:b,authUrl:E,authUrlVersion:S,initialCommand:r,isConnected:v,openAuthUrlInBrowser:T,copyAuthUrlToClipboard:C}),i.jsx(Yv,{wsRef:y,terminalRef:x,isConnected:v,bottomOffset:"bottom-0"})]});const U=n?c("shell.runCommand",{command:r||c("shell.defaultCommand"),projectName:e.displayName}):t?c("shell.resumeSession",{displayName:H}):c("shell.startSession"),V=n?c("shell.runCommand",{command:r||c("shell.defaultCommand"),projectName:e.displayName}):c("shell.startCli",{projectName:e.displayName}),O=w?k?"connecting":v?null:"connect":"loading",G=O==="connecting"?V:U;return i.jsxs("div",{className:"flex h-full w-full flex-col bg-gray-900",children:[i.jsx(II,{isConnected:v,isInitialized:w,isRestarting:d,hasSession:!!t,sessionDisplayNameShort:P,onDisconnect:_,onRestart:z,statusNewSessionText:c("shell.status.newSession"),statusInitializingText:c("shell.status.initializing"),statusRestartingText:c("shell.status.restarting"),disconnectLabel:c("shell.actions.disconnect"),disconnectTitle:c("shell.actions.disconnectTitle"),restartLabel:c("shell.actions.restart"),restartTitle:c("shell.actions.restartTitle"),disableRestart:d||v}),i.jsxs("div",{className:"relative flex-1 overflow-hidden p-2",children:[i.jsx("div",{ref:b,className:"h-full w-full focus:outline-none",style:{outline:"none"}}),O&&i.jsx(jI,{mode:O,description:G,loadingLabel:c("shell.loading"),connectLabel:c("shell.actions.connect"),connectTitle:c("shell.actions.connectTitle"),connectingLabel:c("shell.connecting"),onConnect:j}),p&&v&&i.jsx("div",{className:"absolute inset-x-0 bottom-0 z-10 border-t border-gray-700/80 bg-gray-800/95 px-3 py-2 backdrop-blur-sm",onMouseDown:$=>$.preventDefault(),children:i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.map($=>i.jsxs("button",{type:"button",onClick:()=>{I($.number),f(null)},className:"max-w-36 truncate rounded bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-700",title:`${$.number}. ${$.label}`,children:[$.number,". ",$.label]},$.number)),i.jsx("button",{type:"button",onClick:()=>{I("\x1B"),f(null)},className:"rounded bg-gray-700 px-3 py-1.5 text-xs font-medium text-gray-200 transition-colors hover:bg-gray-600",children:"Esc"})]})})]}),i.jsx(Yv,{wsRef:y,terminalRef:x,isConnected:v})]})}function tO({className:e}){return i.jsx("div",{className:`flex h-full items-center justify-center ${e}`,children:i.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-gray-100 dark:bg-gray-800",children:i.jsx("svg",{className:"h-8 w-8 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 002 2z"})})}),i.jsx("h3",{className:"mb-2 text-lg font-semibold",children:"No Project Selected"}),i.jsx("p",{children:"A project is required to open a shell"})]})})}function rO({title:e,isCompleted:t,onClose:r=null}){return i.jsx("div",{className:"flex-shrink-0 border-b border-gray-700 bg-gray-800 px-4 py-2",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("h3",{className:"text-sm font-medium text-gray-200",children:e}),t&&i.jsx("span",{className:"text-xs text-green-400",children:"(Completed)"})]}),r&&i.jsx("button",{onClick:r,className:"text-gray-400 hover:text-white",title:"Close",children:i.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})})}function _E({project:e=null,session:t=null,command:r=null,isPlainShell:n=null,isActive:a=!0,autoConnect:s=!0,onComplete:o=null,onClose:l=null,title:c=null,className:d="",showHeader:u=!0,compact:p=!1,minimal:f=!1}){const[m,g]=h.useState(!1),b=n!==null?n:r!==null,x=h.useCallback(y=>{g(!0),o?.(y)},[o]);return e?i.jsxs("div",{className:`flex h-full w-full flex-col ${d}`,children:[!f&&u&&c&&i.jsx(rO,{title:c,isCompleted:m,onClose:l}),i.jsx("div",{className:"min-h-0 w-full flex-1",children:i.jsx(jE,{selectedProject:e,selectedSession:t,initialCommand:r,isPlainShell:b,isActive:a,onProcessComplete:x,minimal:f,autoConnect:f?!0:s})})]}):i.jsx(tO,{className:d})}const nO=(e,t)=>t||(e==="claude"?"claude --dangerously-skip-permissions /login":e==="cursor"?"cursor-agent login":e==="codex"?"codex login":e==="qwen"?"qwen auth":e==="opencode"?"opencode auth login":"gemini"),aO={claude:{keyLabel:"Anthropic API Key",keyExample:"sk-ant-...",supportsBaseUrl:!0,baseUrlExample:"https://api.anthropic.com",keyConsoleUrl:"https://console.anthropic.com/settings/keys",keyConsoleLabel:"Anthropic Console"},codex:{keyLabel:"OpenAI API Key",keyExample:"sk-...",supportsBaseUrl:!0,baseUrlExample:"https://api.openai.com/v1",keyConsoleUrl:"https://platform.openai.com/api-keys",keyConsoleLabel:"OpenAI Platform"},gemini:{keyLabel:"Gemini API Key",keyExample:"AI...",supportsBaseUrl:!1,keyConsoleUrl:"https://aistudio.google.com/app/apikey",keyConsoleLabel:"Google AI Studio"},qwen:{keyLabel:"OpenAI-Compatible API Key",keyExample:"sk-... or sk-sp-...",supportsBaseUrl:!0,baseUrlExample:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",keyConsoleUrl:"https://github.com/QwenLM/qwen-code",keyConsoleLabel:"Qwen Code Docs",notes:"Accepts any OpenAI-compatible endpoint — Alibaba Cloud, ModelScope, OpenRouter, self-hosted, etc."},opencode:{keyLabel:"Anthropic API Key (default backend)",keyExample:"sk-ant-...",supportsBaseUrl:!0,baseUrlExample:"https://api.anthropic.com",keyConsoleUrl:"https://console.anthropic.com/settings/keys",keyConsoleLabel:"Anthropic Console",notes:"OpenCode is multi-provider — this sets the Anthropic credentials. Switch providers via `opencode auth login` or opencode.json."}};function Zv({active:e,children:t,onClick:r}){return i.jsx("button",{onClick:r,className:`flex-1 border-b-2 px-4 py-2.5 text-sm font-medium transition-colors ${e?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,children:t})}function iO({provider:e}){const[t,r]=h.useState(""),[n,a]=h.useState(!1),[s,o]=h.useState("idle"),[l,c]=h.useState(null),d=async()=>{const u=t.trim();if(u){a(!0),c(null),o("idle");try{const p=await ve(`/api/providers/${e}/oauth-paste`,{method:"POST",body:JSON.stringify({callbackUrl:u})}),f=await p.json().catch(()=>({}));if(!p.ok||!f?.success)throw new Error(f?.error||`Request failed (${p.status})`);o("ok"),r("")}catch(p){c(p?.message||"Forward failed"),o("error")}finally{a(!1)}}};return i.jsxs("div",{className:"mt-3 rounded-lg border border-border/60 bg-muted/30 p-3 text-sm",children:[i.jsx("div",{className:"mb-2 font-medium text-foreground",children:"Remote login? Paste the callback URL here"}),i.jsxs("p",{className:"mb-3 text-xs text-muted-foreground",children:["When the CLI shows ",i.jsx("code",{className:"rounded bg-background px-1 font-mono text-[11px]",children:"http://127.0.0.1:PORT/…"})," and your browser can't reach it (VPS setups), copy the failing URL from your address bar and paste it below. Pixcode forwards the token exchange to the CLI process on this host."]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"url",value:t,onChange:u=>r(u.target.value),placeholder:"http://127.0.0.1:49312/callback?code=...",className:"flex-1 rounded-md border border-border bg-background px-3 py-2 font-mono text-xs text-foreground focus:border-primary focus:outline-none",onKeyDown:u=>{u.key==="Enter"&&d()}}),i.jsx("button",{onClick:()=>void d(),disabled:n||!t.trim(),className:"flex items-center gap-1.5 rounded-md bg-foreground px-3 py-2 text-xs font-medium text-background transition-opacity hover:opacity-90 disabled:opacity-40",children:n?i.jsx(Ot,{className:"h-3.5 w-3.5 animate-spin"}):"Forward"})]}),s==="ok"&&i.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs text-emerald-600 dark:text-emerald-400",children:[i.jsx(rr,{className:"h-3.5 w-3.5"})," Forwarded — check the terminal above for the completion message."]}),s==="error"&&l&&i.jsx("div",{className:"mt-2 text-xs text-red-600 dark:text-red-400",children:l})]})}function sO({provider:e,onSaved:t}){const r=aO[e],[n,a]=h.useState(""),[s,o]=h.useState(""),[l,c]=h.useState(!1),[d,u]=h.useState("idle"),[p,f]=h.useState(null);h.useEffect(()=>{let g=!1;return(async()=>{try{const x=await(await ve("/api/providers/credentials")).json().catch(()=>({}));if(g||!x?.success)return;const y=x.data?.[e];y?.baseUrl&&o(y.baseUrl)}catch{}})(),()=>{g=!0}},[e]);const m=async()=>{const g=n.trim();if(g){c(!0),f(null),u("idle");try{const b=await ve(`/api/providers/${e}/auth/api-key`,{method:"POST",body:JSON.stringify({apiKey:g,baseUrl:r.supportsBaseUrl&&s.trim()?s.trim():""})}),x=await b.json().catch(()=>({}));if(!b.ok||!x?.success)throw new Error(x?.error||`Request failed (${b.status})`);u("ok"),a(""),t()}catch(b){f(b?.message||"Save failed"),u("error")}finally{c(!1)}}};return r?i.jsx("div",{className:"flex h-full flex-col overflow-y-auto p-6",children:i.jsxs("div",{className:"mx-auto w-full max-w-lg space-y-5",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-muted",children:i.jsx(FD,{className:"h-5 w-5 text-foreground"})}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-base font-semibold text-foreground",children:r.keyLabel}),i.jsxs("a",{href:r.keyConsoleUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:["Get a key from ",r.keyConsoleLabel,i.jsx(Kr,{className:"h-3 w-3"})]})]})]}),r.notes&&i.jsx("div",{className:"rounded-md border border-border/60 bg-muted/40 p-3 text-xs text-muted-foreground",children:r.notes}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("label",{className:"text-xs font-medium text-foreground",children:"API Key"}),i.jsx("input",{type:"password",value:n,onChange:g=>a(g.target.value),placeholder:r.keyExample,className:"w-full rounded-md border border-border bg-background px-3 py-2 font-mono text-sm text-foreground focus:border-primary focus:outline-none",autoComplete:"off",spellCheck:!1}),i.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Stored locally at ",i.jsx("code",{className:"rounded bg-muted px-1 font-mono text-[10px]",children:"~/.pixcode/provider-credentials.json"})," with 0600 permissions."]})]}),r.supportsBaseUrl&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs font-medium text-foreground",children:["Base URL ",i.jsx("span",{className:"font-normal text-muted-foreground",children:"(optional — use a custom endpoint)"})]}),i.jsx("input",{type:"url",value:s,onChange:g=>o(g.target.value),placeholder:r.baseUrlExample,className:"w-full rounded-md border border-border bg-background px-3 py-2 font-mono text-sm text-foreground focus:border-primary focus:outline-none",autoComplete:"off",spellCheck:!1}),i.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Point at any OpenAI-compatible proxy (OpenRouter, local LLM, self-hosted, budget provider) to cut costs or hit different models."})]}),i.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[i.jsxs("button",{onClick:()=>void m(),disabled:l||!n.trim(),className:"inline-flex items-center gap-2 rounded-md bg-foreground px-4 py-2 text-sm font-medium text-background transition-opacity hover:opacity-90 disabled:opacity-40",children:[l?i.jsx(Ot,{className:"h-4 w-4 animate-spin"}):i.jsx(rr,{className:"h-4 w-4"}),"Save API Key"]}),d==="ok"&&i.jsx("span",{className:"text-xs text-emerald-600 dark:text-emerald-400",children:"Saved — reconnect to pick it up."}),d==="error"&&p&&i.jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:p})]})]})}):i.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"This provider uses OAuth only — use the Browser tab to log in."})}function IE({isOpen:e,onClose:t,provider:r="claude",onComplete:n,customCommand:a,isAuthenticated:s=!1}){const{t:o}=Me("common"),l=r!=="cursor",[c,d]=h.useState(l?"apiKey":"browser");h.useEffect(()=>{e&&d(l?"apiKey":"browser")},[e,r,l]);const u=h.useMemo(()=>`${ul[r]??r} Login`,[r]);if(!e)return null;const p=nO(r,a),f=m=>n?.(m);return i.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black bg-opacity-50 max-md:items-stretch max-md:justify-stretch",children:i.jsxs("div",{className:"flex h-3/4 w-full max-w-4xl flex-col rounded-lg bg-white shadow-xl dark:bg-gray-800 max-md:m-0 max-md:h-full max-md:max-w-none max-md:rounded-none md:m-4 md:h-3/4 md:max-w-4xl md:rounded-lg",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-gray-200 p-4 dark:border-gray-700",children:[i.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:u}),i.jsx("button",{onClick:t,className:"text-gray-400 transition-colors hover:text-gray-600 dark:hover:text-gray-300","aria-label":"Close login modal",children:i.jsx(xt,{className:"h-6 w-6"})})]}),i.jsxs("div",{className:"flex border-b border-gray-200 dark:border-gray-700",children:[i.jsx(Zv,{active:c==="browser",onClick:()=>d("browser"),children:"Browser / OAuth"}),l&&i.jsx(Zv,{active:c==="apiKey",onClick:()=>d("apiKey"),children:"API Key"})]}),i.jsx("div",{className:"flex flex-1 flex-col overflow-hidden",children:c==="browser"?i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[i.jsx("div",{className:"min-h-0 flex-1",children:i.jsx(_E,{project:G_,command:p,onComplete:f,minimal:!0})}),i.jsx("div",{className:"border-t border-border/40 bg-background/50 px-4 py-3",children:i.jsx(iO,{provider:r})})]}):i.jsx(sO,{provider:r,onSaved:()=>f(0)})})]})})}const oO=({className:e="w-5 h-5"})=>i.jsx("img",{src:"/icons/claude-ai-icon.svg",alt:"Claude",className:e}),lO=({className:e="w-5 h-5"})=>{const{isDarkMode:t}=Oa();return i.jsx("img",{src:t?"/icons/codex-white.svg":"/icons/codex.svg",alt:"Codex",className:e})},cO=({className:e="w-5 h-5"})=>{const{isDarkMode:t}=Oa();return i.jsx("img",{src:t?"/icons/cursor-white.svg":"/icons/cursor.svg",alt:"Cursor",className:e})},dO=({className:e="w-5 h-5"})=>i.jsx("img",{src:"/icons/gemini-ai-icon.svg",alt:"Gemini",className:e}),uO=({className:e="w-5 h-5"})=>{const{isDarkMode:t}=Oa(),r=t?"/icons/opencode-logo-dark.svg":"/icons/opencode-logo-light.svg";return i.jsx("img",{src:r,alt:"OpenCode",className:e})},pO=({className:e="w-5 h-5"})=>i.jsx("img",{src:"/icons/qwen-logo.svg",alt:"Qwen Code",className:e});function dr({provider:e="claude",className:t="w-5 h-5"}){return e==="cursor"?i.jsx(cO,{className:t}):e==="codex"?i.jsx(lO,{className:t}):e==="gemini"?i.jsx(dO,{className:t}):e==="qwen"?i.jsx(pO,{className:t}):e==="opencode"?i.jsx(uO,{className:t}):i.jsx(oO,{className:t})}function mO({provider:e,title:t,status:r,connectedClassName:n,iconContainerClassName:a,loginButtonClassName:s,onLogin:o}){const l=r.authenticated?n:"border-border bg-card",c=r.loading?"Checking...":r.authenticated?r.email||"Connected":r.error||"Not connected";return i.jsx("div",{className:`rounded-lg border p-4 transition-colors ${l}`,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:`flex h-10 w-10 items-center justify-center rounded-full ${a}`,children:i.jsx(dr,{provider:e,className:"h-5 w-5"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 font-medium text-foreground",children:[t,r.authenticated&&i.jsx(rr,{className:"h-4 w-4 text-green-500"})]}),i.jsx("div",{className:"text-xs text-muted-foreground",children:c})]})]}),!r.authenticated&&!r.loading&&i.jsx("button",{onClick:o,className:`${s} rounded-lg px-4 py-2 text-sm font-medium text-white transition-colors`,children:"Login"})]})})}const hO=[{provider:"claude",title:"Claude Code",connectedClassName:"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800",iconContainerClassName:"bg-blue-100 dark:bg-blue-900/30",loginButtonClassName:"bg-blue-600 hover:bg-blue-700"},{provider:"cursor",title:"Cursor",connectedClassName:"bg-purple-50 dark:bg-purple-900/20 border-purple-200 dark:border-purple-800",iconContainerClassName:"bg-purple-100 dark:bg-purple-900/30",loginButtonClassName:"bg-purple-600 hover:bg-purple-700"},{provider:"codex",title:"OpenAI Codex",connectedClassName:"bg-gray-100 dark:bg-gray-800/50 border-gray-300 dark:border-gray-600",iconContainerClassName:"bg-gray-100 dark:bg-gray-800",loginButtonClassName:"bg-gray-800 hover:bg-gray-900 dark:bg-gray-700 dark:hover:bg-gray-600"},{provider:"gemini",title:"Gemini",connectedClassName:"bg-teal-50 dark:bg-teal-900/20 border-teal-200 dark:border-teal-800",iconContainerClassName:"bg-teal-100 dark:bg-teal-900/30",loginButtonClassName:"bg-teal-600 hover:bg-teal-700"},{provider:"qwen",title:"Qwen Code",connectedClassName:"bg-orange-50 dark:bg-orange-900/20 border-orange-200 dark:border-orange-800",iconContainerClassName:"bg-orange-100 dark:bg-orange-900/30",loginButtonClassName:"bg-orange-600 hover:bg-orange-700"}];function fO({providerStatuses:e,onOpenProviderLogin:t}){return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"mb-6 text-center",children:[i.jsx("h2",{className:"mb-2 text-2xl font-bold text-foreground",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.jsx("div",{className:"space-y-3",children:hO.map(r=>i.jsx(mO,{provider:r.provider,title:r.title,status:e[r.provider],connectedClassName:r.connectedClassName,iconContainerClassName:r.iconContainerClassName,loginButtonClassName:r.loginButtonClassName,onLogin:()=>t(r.provider)},r.provider))}),i.jsx("div",{className:"pt-2 text-center text-sm text-muted-foreground",children:i.jsx("p",{children:"You can configure these later in Settings."})})]})}function gO({gitName:e,gitEmail:t,isSubmitting:r,onGitNameChange:n,onGitEmailChange:a}){return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"mb-8 text-center",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-blue-100 dark:bg-blue-900/30",children:i.jsx(Qr,{className:"h-8 w-8 text-blue-600 dark:text-blue-400"})}),i.jsx("h2",{className:"mb-2 text-2xl font-bold text-foreground",children:"Git Configuration"}),i.jsx("p",{className:"text-muted-foreground",children:"Configure your git identity to ensure proper attribution for commits."})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsxs("label",{htmlFor:"gitName",className:"mb-2 flex items-center gap-2 text-sm font-medium text-foreground",children:[i.jsx(PD,{className:"h-4 w-4"}),"Git Name ",i.jsx("span",{className:"text-red-500",children:"*"})]}),i.jsx("input",{type:"text",id:"gitName",value:e,onChange:s=>n(s.target.value),className:"w-full rounded-lg border border-border bg-background px-4 py-3 text-foreground focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500",placeholder:"John Doe",required:!0,disabled:r}),i.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Saved as `git config --global user.name`."})]}),i.jsxs("div",{children:[i.jsxs("label",{htmlFor:"gitEmail",className:"mb-2 flex items-center gap-2 text-sm font-medium text-foreground",children:[i.jsx(OD,{className:"h-4 w-4"}),"Git Email ",i.jsx("span",{className:"text-red-500",children:"*"})]}),i.jsx("input",{type:"email",id:"gitEmail",value:t,onChange:s=>a(s.target.value),className:"w-full rounded-lg border border-border bg-background px-4 py-3 text-foreground focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500",placeholder:"john@example.com",required:!0,disabled:r}),i.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Saved as `git config --global user.email`."})]})]})]})}const Xv=[{title:"Git Configuration",icon:Qr,required:!0},{title:"Connect Agents",icon:hE,required:!1},{title:"Task System",icon:Ef,required:!1}];function bO({currentStep:e}){return i.jsx("div",{className:"mb-8",children:i.jsx("div",{className:"flex items-center justify-between",children:Xv.map((t,r)=>{const n=r<e,a=r===e,s=t.icon;return i.jsxs("div",{className:"contents",children:[i.jsxs("div",{className:"flex flex-1 flex-col items-center",children:[i.jsx("div",{className:`flex h-12 w-12 items-center justify-center rounded-full border-2 transition-colors duration-200 ${n?"border-green-500 bg-green-500 text-white":a?"border-blue-600 bg-blue-600 text-white":"border-border bg-background text-muted-foreground"}`,children:n?i.jsx(rr,{className:"h-6 w-6"}):i.jsx(s,{className:"h-6 w-6"})}),i.jsxs("div",{className:"mt-2 text-center",children:[i.jsx("p",{className:`text-sm font-medium ${a?"text-foreground":"text-muted-foreground"}`,children:t.title}),t.required&&i.jsx("span",{className:"text-xs text-red-500",children:"Required"})]})]}),r<Xv.length-1&&i.jsx("div",{className:`mx-2 h-0.5 flex-1 transition-colors duration-200 ${n?"bg-green-500":"bg-border"}`})]},t.title)})})})}const xO=e=>e?e.installation?.isInstalled?e.installation.version?`TaskMaster CLI installed (${e.installation.version}).`:"TaskMaster CLI installed.":e.installation?.reason||"TaskMaster CLI is not installed yet.":"Checking TaskMaster installation...";function yO({enabled:e,onEnabledChange:t,onReadyChange:r}){const[n,a]=h.useState(null),[s,o]=h.useState(!0),[l,c]=h.useState(!1),[d,u]=h.useState([]),[p,f]=h.useState(""),m=h.useRef(null),g=!!n?.installation?.isInstalled,b=!!n?.mcpServer?.hasMCPServer,x=h.useMemo(()=>!e||g,[e,g]);h.useEffect(()=>{r(x)},[r,x]);const y=h.useCallback(async()=>{o(!0),f("");try{const w=await ve("/api/taskmaster/installation-status"),k=await w.json();a(k),w.ok||f(k.installation?.reason||"TaskMaster status check failed.")}catch(w){a(null),f(w instanceof Error?w.message:"TaskMaster status check failed.")}finally{o(!1)}},[]);h.useEffect(()=>(y(),()=>{m.current?.close(),m.current=null}),[y]);const v=h.useCallback(async()=>{c(!0),f(""),u([]);try{const w=await ve("/api/taskmaster/install",{method:"POST"}),k=await w.json();if(!w.ok||!k.success||!k.jobId)throw new Error(k.error||k.message||"TaskMaster install could not start.");const E=localStorage.getItem(Ud),S=E?`?token=${encodeURIComponent(E)}`:"",j=new EventSource(`/api/taskmaster/install/${encodeURIComponent(k.jobId)}/stream${S}`);m.current=j,j.addEventListener("log",_=>{const T=JSON.parse(_.data);u(C=>[...C,T].slice(-80))}),j.addEventListener("done",_=>{const T=JSON.parse(_.data);if(j.close(),m.current=null,c(!1),!T.success){f(T.error||T.message||"TaskMaster install failed.");return}y()}),j.onerror=()=>{j.close(),m.current=null,c(!1),f("TaskMaster install stream disconnected.")}}catch(w){c(!1),f(w instanceof Error?w.message:"TaskMaster install could not start.")}},[y]);return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"Task System"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Decide whether Pixcode should enable TaskMaster-backed planning, kanban tasks, PRD parsing, and agent task execution from the start."})]}),i.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border border-border bg-background p-4 transition-colors hover:bg-muted/40",children:[i.jsx("input",{type:"checkbox",checked:e,onChange:w=>t(w.target.checked),className:"mt-1 h-4 w-4"}),i.jsxs("span",{className:"min-w-0 space-y-1",children:[i.jsx("span",{className:"block text-sm font-medium text-foreground",children:"Enable TaskMaster features"}),i.jsx("span",{className:"block text-sm leading-6 text-muted-foreground",children:"This keeps the Tasks panel, PRD tools, and orchestration task sync available. You can change it later in Settings."})]})]}),e&&i.jsxs("div",{className:"space-y-4 rounded-lg border border-border bg-card p-4",children:[i.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[g?i.jsx(ra,{className:"h-5 w-5 text-green-600"}):i.jsx(Gr,{className:"h-5 w-5 text-primary"}),i.jsx("h3",{className:"font-medium text-foreground",children:"TaskMaster CLI"})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:xO(n)}),g&&!b&&i.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400",children:"MCP server is not configured yet. Core task files work now; MCP can be connected later from Settings."})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{type:"button",onClick:()=>void y(),disabled:s||l,className:"rounded-md border border-border px-3 py-2 text-sm text-foreground transition-colors hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50",children:s?"Checking...":"Refresh"}),!g&&i.jsxs("button",{type:"button",onClick:()=>void v(),disabled:l,className:"inline-flex items-center gap-2 rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-60",children:[l&&i.jsx(Ot,{className:"h-4 w-4 animate-spin"}),l?"Installing...":"Install"]})]})]}),p&&i.jsx("div",{className:"rounded-md border border-red-300 bg-red-50 p-3 text-sm text-red-700 dark:border-red-800 dark:bg-red-950/30 dark:text-red-300",children:p}),d.length>0&&i.jsx("pre",{className:"max-h-48 overflow-auto rounded-md bg-black p-3 text-xs leading-5 text-green-200",children:d.map(w=>`${w.stream}> ${w.chunk}`).join("")})]})]})}const Jv=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Qv=async(e,t)=>{try{return(await e.json()).error||t}catch{return t}};function vO({onComplete:e}){const[t,r]=h.useState(0),[n,a]=h.useState(""),[s,o]=h.useState(""),[l,c]=h.useState(!1),[d,u]=h.useState(""),[p,f]=h.useState(null),[m,g]=h.useState(()=>{try{const A=localStorage.getItem("tasks-enabled");return A===null?!0:JSON.parse(A)!==!1}catch{return!0}}),[b,x]=h.useState(!1),{providerAuthStatus:y,checkProviderAuthStatus:v,refreshProviderAuthStatuses:w}=yf(),k=h.useRef(void 0),E=h.useCallback(async()=>{try{const A=await ve("/api/user/git-config");if(!A.ok)return;const I=await A.json();I.gitName&&a(I.gitName),I.gitEmail&&o(I.gitEmail)}catch(A){console.error("Error loading git config:",A)}},[]);h.useEffect(()=>{E(),w()},[E,w]),h.useEffect(()=>{const A=k.current;k.current=p,A!=null&&p===null&&w()},[p,w]);const S=A=>{f(A)},j=A=>{A===0&&p&&v(p)},_=async()=>{if(u(""),t!==0){r(A=>A+1);return}if(!n.trim()||!s.trim()){u("Both git name and email are required.");return}if(!Jv.test(s)){u("Please enter a valid email address.");return}c(!0);try{const A=await ve("/api/user/git-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({gitName:n,gitEmail:s})});if(!A.ok){const I=await Qv(A,"Failed to save git configuration");throw new Error(I)}r(I=>I+1)}catch(A){u(A instanceof Error?A.message:"Failed to save git configuration")}finally{c(!1)}},T=()=>{u(""),r(A=>A-1)},C=async()=>{if(m&&!b){u("Install TaskMaster or disable TaskMaster features to finish setup.");return}c(!0),u("");try{localStorage.setItem("tasks-enabled",JSON.stringify(m));const A=await ve("/api/user/complete-onboarding",{method:"POST"});if(!A.ok){const I=await Qv(A,"Failed to complete onboarding");throw new Error(I)}await e?.()}catch(A){u(A instanceof Error?A.message:"Failed to complete onboarding")}finally{c(!1)}},L=t===0?!!(n.trim()&&s.trim()&&Jv.test(s)):t===2?!m||b:!0;return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:i.jsxs("div",{className:"w-full max-w-2xl",children:[i.jsx(bO,{currentStep:t}),i.jsxs("div",{className:"rounded-lg border border-border bg-card p-8 shadow-lg",children:[t===0?i.jsx(gO,{gitName:n,gitEmail:s,isSubmitting:l,onGitNameChange:a,onGitEmailChange:o}):t===1?i.jsx(fO,{providerStatuses:y,onOpenProviderLogin:S}):i.jsx(yO,{enabled:m,onEnabledChange:g,onReadyChange:x}),d&&i.jsx("div",{className:"mt-6 rounded-lg border border-red-300 bg-red-100 p-4 dark:border-red-800 dark:bg-red-900/20",children:i.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:d})}),i.jsxs("div",{className:"mt-8 flex items-center justify-between border-t border-border pt-6",children:[i.jsxs("button",{onClick:T,disabled:t===0||l,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-muted-foreground transition-colors duration-200 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",children:[i.jsx(Sf,{className:"h-4 w-4"}),"Previous"]}),i.jsx("div",{className:"flex items-center gap-3",children:t<2?i.jsx("button",{onClick:_,disabled:!L||l,className:"flex items-center gap-2 rounded-lg bg-blue-600 px-6 py-3 font-medium text-white transition-colors duration-200 hover:bg-blue-700 disabled:cursor-not-allowed disabled:bg-blue-400",children:l?i.jsxs(i.Fragment,{children:[i.jsx(Ot,{className:"h-4 w-4 animate-spin"}),"Saving..."]}):i.jsxs(i.Fragment,{children:["Next",i.jsx(An,{className:"h-4 w-4"})]})}):i.jsx("button",{onClick:C,disabled:l,className:"flex items-center gap-2 rounded-lg bg-green-600 px-6 py-3 font-medium text-white transition-colors duration-200 hover:bg-green-700 disabled:cursor-not-allowed disabled:bg-green-400",children:l?i.jsxs(i.Fragment,{children:[i.jsx(Ot,{className:"h-4 w-4 animate-spin"}),"Completing..."]}):i.jsxs(i.Fragment,{children:[i.jsx(rr,{className:"h-4 w-4"}),"Complete Setup"]})})})]})]})]})}),p&&i.jsx(IE,{isOpen:!!p,onClose:()=>f(null),provider:p,onComplete:j})]})}const wO=["0s","0.1s","0.2s"];function kO(){return i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"mb-4 flex justify-center",children:i.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-lg bg-primary shadow-sm",children:i.jsx(na,{className:"h-8 w-8 text-primary-foreground"})})}),i.jsx("h1",{className:"mb-2 text-2xl font-bold text-foreground",children:"Pixcode"}),i.jsx("div",{className:"flex items-center justify-center space-x-2",children:wO.map(e=>i.jsx("div",{className:"h-2 w-2 animate-bounce rounded-full bg-blue-500",style:{animationDelay:e}},e))}),i.jsx("p",{className:"mt-2 text-muted-foreground",children:"Loading..."})]})})}function RE({errorMessage:e}){return e?i.jsx("div",{className:"rounded-md border border-red-300 bg-red-100 p-3 dark:border-red-800 dark:bg-red-900/20",children:i.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:e})}):null}function Ii({id:e,label:t,value:r,onChange:n,placeholder:a,isDisabled:s,type:o="text",name:l,autoComplete:c}){return i.jsxs("div",{children:[i.jsx("label",{htmlFor:e,className:"mb-1 block text-sm font-medium text-foreground",children:t}),i.jsx("input",{id:e,type:o,name:l??e,autoComplete:c,value:r,onChange:d=>n(d.target.value),className:"w-full rounded-md border border-border bg-background px-3 py-2 text-foreground focus:border-transparent focus:outline-none focus:ring-2 focus:ring-blue-500",placeholder:a,required:!0,disabled:s})]})}function LE({title:e,description:t,children:r,footerText:n,logo:a}){return i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:i.jsx("div",{className:"w-full max-w-md",children:i.jsxs("div",{className:"space-y-6 rounded-lg border border-border bg-card p-8 shadow-lg",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"mb-4 flex justify-center",children:a??i.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-lg bg-primary shadow-sm",children:i.jsx(na,{className:"h-8 w-8 text-primary-foreground"})})}),i.jsx("h1",{className:"text-2xl font-bold text-foreground",children:e}),i.jsx("p",{className:"mt-2 text-muted-foreground",children:t})]}),r,i.jsx("div",{className:"text-center",children:i.jsx("p",{className:"text-sm text-muted-foreground",children:n})}),i.jsxs("div",{className:"flex items-center justify-center gap-1.5 pt-2",children:[i.jsx("svg",{className:"h-3.5 w-3.5 text-muted-foreground/50",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:i.jsx("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"})}),i.jsx("a",{href:"https://github.com/alicomert/pixcode",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground/50 transition-colors hover:text-muted-foreground",children:"Pixcode is open source"})]})]})})})}const SO={username:"",password:""};function EO(){const{t:e}=Me("auth"),{login:t}=Ki(),[r,n]=h.useState(SO),[a,s]=h.useState(""),[o,l]=h.useState(!1),c=h.useCallback((u,p)=>{n(f=>({...f,[u]:p}))},[]),d=h.useCallback(async u=>{if(u.preventDefault(),s(""),!r.username.trim()||!r.password){s(e("login.errors.requiredFields"));return}l(!0);const p=await t(r.username.trim(),r.password);p.success||s(p.error),l(!1)},[r.password,r.username,t,e]);return i.jsx(LE,{title:e("login.title"),description:e("login.description"),footerText:"Enter your credentials to access Pixcode",children:i.jsxs("form",{onSubmit:d,className:"space-y-4",children:[i.jsx(Ii,{id:"username",label:e("login.username"),value:r.username,onChange:u=>c("username",u),placeholder:e("login.placeholders.username"),isDisabled:o,autoComplete:"username"}),i.jsx(Ii,{id:"password",label:e("login.password"),value:r.password,onChange:u=>c("password",u),placeholder:e("login.placeholders.password"),isDisabled:o,type:"password",autoComplete:"current-password"}),i.jsx(RE,{errorMessage:a}),i.jsx("button",{type:"submit",disabled:o,className:"w-full rounded-md bg-blue-600 px-4 py-2 font-medium text-white transition-colors duration-200 hover:bg-blue-700 disabled:bg-blue-400",children:e(o?"login.loading":"login.submit")})]})})}const NO={username:"",password:"",confirmPassword:"",connectionMode:"local",remoteUrl:"",remoteApiKey:""};function CO(e){return!e.username.trim()||!e.password||!e.confirmPassword?"Please fill in all fields.":e.username.trim().length<3?"Username must be at least 3 characters long.":e.password.length<6?"Password must be at least 6 characters long.":e.password!==e.confirmPassword?"Passwords do not match.":e.connectionMode==="remote"&&!e.remoteUrl.trim()?"Remote Pixcode server URL is required.":null}function AO(){const{register:e}=Ki(),[t,r]=h.useState(NO),[n,a]=h.useState(""),[s,o]=h.useState(!1),l=h.useCallback((d,u)=>{r(p=>({...p,[d]:u}))},[]),c=h.useCallback(async d=>{d.preventDefault(),a("");const u=CO(t);if(u){a(u);return}o(!0);const p=await fetch("/api/auth/connection-mode",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:t.connectionMode,remoteUrl:t.connectionMode==="remote"?t.remoteUrl.trim():null,apiKey:t.connectionMode==="remote"?t.remoteApiKey.trim():null})});if(!p.ok){const m=await p.json().catch(()=>null);a(m?.error||"Could not save connection mode."),o(!1);return}const f=await e(t.username.trim(),t.password);f.success||a(f.error),o(!1)},[t,e]);return i.jsx(LE,{title:"Welcome to Pixcode",description:"Set up your account to get started",footerText:"This is a single-user system. Only one account can be created.",logo:i.jsx("img",{src:"/logo.svg",alt:"Pixcode",className:"h-16 w-16"}),children:i.jsxs("form",{onSubmit:c,className:"space-y-4",children:[i.jsxs("div",{className:"grid gap-2 rounded-lg border border-border/70 bg-muted/30 p-2 sm:grid-cols-2",children:[i.jsxs("button",{type:"button",onClick:()=>l("connectionMode","local"),disabled:s,className:`rounded-md px-3 py-2 text-left text-sm transition-colors ${t.connectionMode==="local"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-background/60 hover:text-foreground"}`,children:[i.jsx("span",{className:"block font-medium",children:"Use this computer directly"}),i.jsx("span",{className:"block text-xs opacity-80",children:"Run Pixcode and CLIs on this machine."})]}),i.jsxs("button",{type:"button",onClick:()=>l("connectionMode","remote"),disabled:s,className:`rounded-md px-3 py-2 text-left text-sm transition-colors ${t.connectionMode==="remote"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-background/60 hover:text-foreground"}`,children:[i.jsx("span",{className:"block font-medium",children:"Connect to a remote Pixcode server"}),i.jsx("span",{className:"block text-xs opacity-80",children:"Control another always-on Pixcode host by API."})]})]}),t.connectionMode==="remote"&&i.jsxs("div",{className:"space-y-3 rounded-lg border border-border/70 bg-muted/20 p-3",children:[i.jsx(Ii,{id:"remoteUrl",name:"remoteUrl",label:"Remote API URL",value:t.remoteUrl,onChange:d=>l("remoteUrl",d),placeholder:"https://your-server.example.com",isDisabled:s,autoComplete:"url"}),i.jsx(Ii,{id:"remoteApiKey",name:"remoteApiKey",label:"Remote API Key",value:t.remoteApiKey,onChange:d=>l("remoteApiKey",d),placeholder:"px_...",isDisabled:s,type:"password",autoComplete:"off"})]}),i.jsx(Ii,{id:"username",name:"username",label:"Username",value:t.username,onChange:d=>l("username",d),placeholder:"Enter your username",isDisabled:s,autoComplete:"username"}),i.jsx(Ii,{id:"password",name:"password",label:"Password",value:t.password,onChange:d=>l("password",d),placeholder:"Enter your password",isDisabled:s,type:"password",autoComplete:"new-password"}),i.jsx(Ii,{id:"confirmPassword",name:"confirmPassword",label:"Confirm Password",value:t.confirmPassword,onChange:d=>l("confirmPassword",d),placeholder:"Confirm your password",isDisabled:s,type:"password",autoComplete:"new-password"}),i.jsx(RE,{errorMessage:n}),i.jsx("button",{type:"submit",disabled:s,className:"w-full rounded-md bg-blue-600 px-4 py-2 font-medium text-white transition-colors duration-200 hover:bg-blue-700 disabled:bg-blue-400",children:s?"Setting up...":"Create Account"})]})})}function TO({children:e}){const{user:t,isLoading:r,needsSetup:n,hasCompletedOnboarding:a,refreshOnboardingStatus:s}=Ki();return r?i.jsx(kO,{}):n?i.jsx(AO,{}):t?a?i.jsx(i.Fragment,{children:e}):i.jsx(vO,{onComplete:s}):i.jsx(EO,{})}const DE=h.createContext(null),OE=()=>{const e=h.useContext(DE);if(!e)throw new Error("useWebSocket must be used within a WebSocketProvider");return e},jO=e=>{const t=window.location.protocol==="https:"?"wss:":"ws:";return e?`${t}//${window.location.host}/ws?token=${encodeURIComponent(e)}`:null},_O=()=>{const e=h.useRef(null),t=h.useRef(!1),r=h.useRef(!1),[n,a]=h.useState(null),[s,o]=h.useState(!1),l=h.useRef(null),{token:c}=Ki(),d=h.useCallback(()=>{if(!t.current)try{const f=jO(c);if(!f)return console.warn("No authentication token found for WebSocket connection");const m=new WebSocket(f);m.onopen=()=>{o(!0),e.current=m,r.current&&a({type:"websocket-reconnected",timestamp:Date.now()}),r.current=!0},m.onmessage=g=>{try{const b=JSON.parse(g.data);a(b)}catch(b){console.error("Error parsing WebSocket message:",b)}},m.onclose=()=>{o(!1),e.current=null,l.current=setTimeout(()=>{t.current||d()},3e3)},m.onerror=g=>{console.error("WebSocket error:",g)}}catch(f){console.error("Error creating WebSocket connection:",f)}},[c]);h.useEffect(()=>(d(),()=>{t.current=!0,l.current&&clearTimeout(l.current),e.current&&e.current.close()}),[d]);const u=h.useCallback(f=>{const m=e.current;m&&m.readyState===WebSocket.OPEN?m.send(JSON.stringify(f)):console.warn("WebSocket not connected")},[]);return h.useMemo(()=>({ws:e.current,sendMessage:u,latestMessage:n,isConnected:s}),[u,n,s])},IO=({children:e})=>{const t=_O();return i.jsx(DE.Provider,{value:t,children:e})},ME=h.createContext(null);function RO(e,t){return{message:t instanceof Error?t.message:`Failed to ${e}`,context:e,timestamp:new Date().toISOString()}}function ew(e){return{...e,taskMasterConfigured:e.taskmaster?.hasTaskmaster??!1,taskMasterStatus:e.taskmaster?.status??"not-configured",taskCount:Number(e.taskmaster?.metadata?.taskCount??0),completedCount:Number(e.taskmaster?.metadata?.completed??0)}}function LO(e){return e.find(t=>t.status==="pending"||t.status==="in-progress")??null}function DO(e){return e?.type?e.type.startsWith("taskmaster-"):!1}function eo(){const e=h.useContext(ME);if(!e)throw new Error("useTaskMaster must be used within a TaskMasterProvider");return e}function OO({children:e}){const{latestMessage:t}=OE(),{user:r,token:n,isLoading:a}=Ki(),[s,o]=h.useState([]),[l,c]=h.useState(null),[d,u]=h.useState(null),[p,f]=h.useState(null),[m,g]=h.useState([]),[b,x]=h.useState(null),[y,v]=h.useState(!1),[w,k]=h.useState(!1),[E,S]=h.useState(!1),[j,_]=h.useState(null),T=h.useRef(null);h.useEffect(()=>{T.current=l?.name??null},[l?.name]);const C=h.useCallback(()=>{_(null)},[]),L=h.useCallback((z,U)=>{console.error(`TaskMaster ${z} error:`,U),_(RO(z,U))},[]),A=h.useCallback(z=>{const U=z?ew(z):null;c(U),u(U?.taskmaster??null),g([]),x(null)},[]),I=h.useCallback(async()=>{if(!r||!n){o([]),c(null),u(null),g([]),x(null);return}try{v(!0),C();const z=await ot.get("/projects");if(!z.ok)throw new Error(`Failed to fetch projects: ${z.status}`);const U=await z.json(),O=(Array.isArray(U)?U:[]).map(F=>ew(F));o(O);const G=T.current;if(!G)return;const $=O.find(F=>F.name===G)??null;c($),u($?.taskmaster??null)}catch(z){L("load projects",z)}finally{v(!1)}},[C,L,n,r]),N=h.useCallback(async()=>{const z=l?.name;if(!z||!r||!n){g([]),x(null);return}try{k(!0),C();const U=await ot.get(`/taskmaster/tasks/${encodeURIComponent(z)}`);if(!U.ok){const G=await U.json();throw new Error(G.message??"Failed to load tasks")}const V=await U.json(),O=Array.isArray(V.tasks)?V.tasks:[];g(O),x(LO(O))}catch(U){L("load tasks",U),g([]),x(null)}finally{k(!1)}},[C,l?.name,L,n,r]),P=h.useCallback(async()=>{if(!r||!n){f(null);return}try{S(!0),C();const z=await ot.get("/mcp-utils/taskmaster-server");if(!z.ok)throw new Error(`Failed to load MCP status: ${z.status}`);const U=await z.json();f(U)}catch(z){L("check MCP server status",z),f(null)}finally{S(!1)}},[C,L,n,r]);h.useEffect(()=>{!a&&r&&n&&(I(),P())},[a,P,I,n,r]),h.useEffect(()=>{l?.name&&r&&n&&N()},[l?.name,N,n,r]),h.useEffect(()=>{const z=t;if(DO(z)){if(z.type==="taskmaster-project-updated"&&z.projectName){I();return}if(z.type==="taskmaster-tasks-updated"&&z.projectName===l?.name){N();return}z.type==="taskmaster-mcp-status-changed"&&P()}},[l?.name,t,P,I,N]);const H=h.useMemo(()=>({projects:s,currentProject:l,projectTaskMaster:d,mcpServerStatus:p,tasks:m,nextTask:b,isLoading:y,isLoadingTasks:w,isLoadingMCP:E,error:j,refreshProjects:I,setCurrentProject:A,refreshTasks:N,refreshMCPStatus:P,clearError:C}),[C,l,j,y,E,w,p,b,d,s,P,I,N,A,m]);return i.jsx(ME.Provider,{value:H,children:e})}const PE=h.createContext({tasksEnabled:!0,setTasksEnabled:()=>{},toggleTasksEnabled:()=>{},isTaskMasterInstalled:null,isTaskMasterReady:null,installationStatus:null,isCheckingInstallation:!0,refreshTaskMasterInstallation:async()=>{}}),Kd=()=>{const e=h.useContext(PE);if(!e)throw new Error("useTasksSettings must be used within a TasksSettingsProvider");return e},MO=({children:e})=>{const{user:t,token:r,isLoading:n}=Ki(),[a,s]=h.useState(()=>{const v=localStorage.getItem("tasks-enabled");return v!==null?JSON.parse(v):!0}),[o,l]=h.useState(null),[c,d]=h.useState(null),[u,p]=h.useState(null),[f,m]=h.useState(!0),g=!!(t&&r);h.useEffect(()=>{localStorage.setItem("tasks-enabled",JSON.stringify(a))},[a]);const b=h.useCallback(async({signal:v}={})=>{if(!n){if(!g){p(null),l(null),d(null),m(!1);return}m(!0);try{const w=await ot.get("/taskmaster/installation-status");if(v?.aborted)return;if(w.ok){const k=await w.json();if(v?.aborted)return;p(k),l(k.installation?.isInstalled||!1),d(k.isReady||!1);const E=localStorage.getItem("tasks-enabled");!k.installation?.isInstalled&&!E&&s(!1)}else console.error("Failed to check TaskMaster installation status"),l(!1),d(!1)}catch(w){if(v?.aborted)return;console.error("Error checking TaskMaster installation:",w),l(!1),d(!1)}finally{v?.aborted||m(!1)}}},[g,n]);h.useEffect(()=>{const v=new AbortController,w=setTimeout(()=>{b({signal:v.signal})},0);return()=>{v.abort(),clearTimeout(w)}},[b]);const y={tasksEnabled:a,setTasksEnabled:s,toggleTasksEnabled:()=>{s(v=>!v)},isTaskMasterInstalled:o,isTaskMasterReady:c,installationStatus:u,isCheckingInstallation:f,refreshTaskMasterInstallation:b};return i.jsx(PE.Provider,{value:y,children:e})},FE=h.createContext(null);function Yd(){const e=h.useContext(FE);if(!e)throw new Error("usePlugins must be used within a PluginsProvider");return e}function PO({children:e}){const{user:t,token:r,isLoading:n}=Ki(),[a,s]=h.useState([]),[o,l]=h.useState(!0),[c,d]=h.useState(null),u=!!(t&&r),p=h.useCallback(async()=>{if(!u){s([]),d(null),l(!1);return}l(!0);try{const x=await ve("/api/plugins");if(x.ok){const y=await x.json();s(y.plugins||[]),d(null)}else{let y=`Failed to fetch plugins (${x.status})`;try{const v=await x.json();y=v.details||v.error||y}catch{y=x.statusText||y}d(y)}}catch(x){const y=x instanceof Error?x.message:"Failed to fetch plugins";d(y),console.error("[Plugins] Failed to fetch plugins:",x)}finally{l(!1)}},[u]);h.useEffect(()=>{n||p()},[n,p]);const f=h.useCallback(async x=>{try{const y=await ve("/api/plugins/install",{method:"POST",body:JSON.stringify({url:x})}),v=await y.json();return y.ok?(await p(),{success:!0}):{success:!1,error:v.details||v.error||"Install failed"}}catch(y){return{success:!1,error:y instanceof Error?y.message:"Install failed"}}},[p]),m=h.useCallback(async x=>{try{const y=await ve(`/api/plugins/${encodeURIComponent(x)}`,{method:"DELETE"}),v=await y.json();return y.ok?(await p(),{success:!0}):{success:!1,error:v.details||v.error||"Uninstall failed"}}catch(y){return{success:!1,error:y instanceof Error?y.message:"Uninstall failed"}}},[p]),g=h.useCallback(async x=>{try{const y=await ve(`/api/plugins/${encodeURIComponent(x)}/update`,{method:"POST"}),v=await y.json();return y.ok?(await p(),{success:!0}):{success:!1,error:v.details||v.error||"Update failed"}}catch(y){return{success:!1,error:y instanceof Error?y.message:"Update failed"}}},[p]),b=h.useCallback(async(x,y)=>{try{const v=await ve(`/api/plugins/${encodeURIComponent(x)}/enable`,{method:"PUT",body:JSON.stringify({enabled:y})});if(!v.ok){let w=`Toggle failed (${v.status})`;try{const k=await v.json();w=k.details||k.error||w}catch{w=v.statusText||w}return{success:!1,error:w}}return await p(),{success:!0,error:null}}catch(v){return{success:!1,error:v instanceof Error?v.message:"Toggle failed"}}},[p]);return i.jsx(FE.Provider,{value:{plugins:a,loading:o,pluginsError:c,refreshPlugins:p,installPlugin:f,uninstallPlugin:m,updatePlugin:g,togglePlugin:b},children:e})}const tw=e=>typeof window>"u"?!1:window.innerWidth<e,rw=()=>{if(typeof window>"u")return!1;const e=window.navigator;return window.matchMedia("(display-mode: standalone)").matches||!!e.standalone||document.referrer.includes("android-app://")};function Lf(e={}){const{mobileBreakpoint:t=768,trackMobile:r=!0,trackPWA:n=!0}=e,[a,s]=h.useState(()=>r?tw(t):!1),[o,l]=h.useState(()=>n?rw():!1);return h.useEffect(()=>{if(!r||typeof window>"u")return;const c=()=>{s(tw(t))};return c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}},[t,r]),h.useEffect(()=>{if(!n||typeof window>"u")return;const c=window.matchMedia("(display-mode: standalone)"),d=()=>{l(rw())};return d(),typeof c.addEventListener=="function"?(c.addEventListener("change",d),()=>{c.removeEventListener("change",d)}):(c.addListener(d),()=>{c.removeListener(d)})},[n]),{isMobile:a,isPWA:o}}const Df="pixcode.updateCheck.preferences",Zm="pixcode:update-check-settings-changed",Of=[{value:"30m",label:"Every 30 minutes",intervalMs:1800*1e3},{value:"24h",label:"Daily",intervalMs:1440*60*1e3},{value:"12h",label:"Every 12 hours",intervalMs:720*60*1e3},{value:"6h",label:"Every 6 hours",intervalMs:360*60*1e3},{value:"7d",label:"Weekly",intervalMs:10080*60*1e3},{value:"off",label:"Manual only",intervalMs:null}],Xm={frequency:"30m"};function nw(e){return Of.find(t=>t.value===e.frequency)?.intervalMs??null}function zE(e){if(!e||typeof e!="object")return Xm;const t=e.frequency;return Of.some(r=>r.value===t)?{frequency:t}:Xm}function aw(){try{const e=localStorage.getItem(Df);return zE(e?JSON.parse(e):null)}catch{return Xm}}function FO(e){const t=zE(e);localStorage.setItem(Df,JSON.stringify(t)),window.dispatchEvent(new CustomEvent(Zm,{detail:t}))}const $u=(e,t)=>{const r=e.split(".").map(Number),n=t.split(".").map(Number);for(let a=0;a<Math.max(r.length,n.length);a++){const s=r[a]||0,o=n[a]||0;if(s!==o)return s-o}return 0},zO="1.41.0",Jm="pixcode:update-available",BO=360*60*1e3,Uu=new Map;function BE(e,t){return`pixcode.updateCheck.cache.${e}.${t}`}function $O(e,t){try{const r=localStorage.getItem(BE(e,t));if(!r)return null;const n=JSON.parse(r);return{fetchedAt:typeof n.fetchedAt=="number"?n.fetchedAt:null,latestVersion:typeof n.latestVersion=="string"?n.latestVersion:null,releaseInfo:n.releaseInfo??null,rateLimitedUntil:typeof n.rateLimitedUntil=="number"?n.rateLimitedUntil:void 0}}catch{return null}}function iw(e,t,r){localStorage.setItem(BE(e,t),JSON.stringify(r))}function UO(e,t){const r=`${e}/${t}`,n=Uu.get(r);if(n)return n;const a=fetch(`https://api.github.com/repos/${e}/${t}/releases/latest`,{cache:"no-store",headers:{Accept:"application/vnd.github+json"}}).then(async s=>({status:s.status,ok:s.ok,data:await s.json().catch(()=>({}))})).finally(()=>{Uu.delete(r)});return Uu.set(r,a),a}const $E=(e,t)=>{const[r,n]=h.useState(!1),[a,s]=h.useState(null),[o,l]=h.useState(null),[c,d]=h.useState("git"),[u,p]=h.useState("idle"),[f,m]=h.useState(null),[g,b]=h.useState(()=>aw()),[x,y]=h.useState(zO),v=h.useRef(null),w=h.useCallback(E=>{FO(E),b(E)},[]);h.useEffect(()=>{const E=()=>b(aw()),S=j=>{j.key===Df&&E()};return window.addEventListener("storage",S),window.addEventListener(Zm,E),()=>{window.removeEventListener("storage",S),window.removeEventListener(Zm,E)}},[]),h.useEffect(()=>{let E=!1;const S=async()=>{try{const T=await(await fetch("/health",{cache:"no-store"})).json();if(E)return;(T.installMode==="npm"||T.installMode==="git")&&d(T.installMode),typeof T.version=="string"&&/^\d+\.\d+\.\d+/.test(T.version)&&y(T.version)}catch{}};S();const j=()=>{S()};return window.addEventListener("focus",j),()=>{E=!0,window.removeEventListener("focus",j)}},[]),h.useEffect(()=>{if(!x)return;let E=!1;const S=(A,I,N,P)=>({updateAvailable:!!(A&&$u(A,x)>0),latestVersion:A,releaseInfo:I,currentVersion:x,checkedAt:N,status:P}),j=A=>{!A.updateAvailable||!A.latestVersion||!A.releaseInfo||window.dispatchEvent(new CustomEvent(Jm,{detail:A}))},_=(A,I,N,P="success")=>{if(!A||!I)return n(!1),s(null),l(null),m(N),S(null,null,N,P);s(A),n($u(A,x)>0),l(I),m(N);const H=S(A,I,N,P);return j(H),H},T=async({force:A=!1}={})=>{const I=nw(g),N=$O(e,t),P=Date.now();if(!A&&I===null)return p("idle"),_(N?.latestVersion??null,N?.releaseInfo??null,N?.fetchedAt??null,"idle");if(!A&&N?.fetchedAt&&I!==null&&P-N.fetchedAt<I)return p("success"),_(N.latestVersion,N.releaseInfo,N.fetchedAt,"success");if(!A&&N?.rateLimitedUntil&&N.rateLimitedUntil>P)return p("error"),_(N.latestVersion,N.releaseInfo,N.fetchedAt,"error");try{p("checking");const H=await UO(e,t);if(E)return S(N?.latestVersion??null,N?.releaseInfo??null,N?.fetchedAt??null,"idle");const z=H.data;if(!H.ok)return H.status===403&&iw(e,t,{fetchedAt:N?.fetchedAt??null,latestVersion:N?.latestVersion??null,releaseInfo:N?.releaseInfo??null,rateLimitedUntil:P+Math.max(I??0,BO)}),p("error"),_(N?.latestVersion??null,N?.releaseInfo??null,N?.fetchedAt??null,"error");if(z.tag_name){const U=z.tag_name.replace(/^v/,""),V=$u(U,x)>0,O={title:z.name||z.tag_name,body:z.body||"",htmlUrl:z.html_url||`https://github.com/${e}/${t}/releases/latest`,publishedAt:z.published_at||""};iw(e,t,{fetchedAt:P,latestVersion:U,releaseInfo:O}),s(U),n(V),V&&W4({key:`app-update:${U}`,title:"Pixcode update available",body:`Pixcode ${x} can update to ${U}.`,tag:"pixcode-app-update",data:{type:"app-update",latestVersion:U,installMode:c}}),l(O),p("success"),m(P);const G=S(U,O,P,"success");return j(G),G}else return n(!1),s(null),l(null),p("error"),S(null,null,null,"error")}catch(H){return console.error("Version check failed:",H),n(!1),s(null),l(null),p("error"),S(null,null,null,"error")}};v.current=T,T();const C=nw(g),L=C===null?null:window.setInterval(()=>{T()},C);return()=>{E=!0,L!==null&&window.clearInterval(L)}},[e,t,x,c,g]);const k=h.useCallback(async()=>v.current?await v.current({force:!0}):null,[]);return{updateAvailable:r,latestVersion:a,currentVersion:x,releaseInfo:o,installMode:c,checkStatus:u,lastCheckedAt:f,manualCheck:k,updateCheckPreferences:g,updatePreferences:w}},Ri={autoExpandTools:!1,showRawParameters:!1,showThinking:!0,autoScrollToBottom:!0,sendByCtrlEnter:!1,changeAwareness:!1,sidebarVisible:!0,historyView:"flat"},GO=["flat","grouped"],HO=e=>typeof e=="string"&&GO.includes(e),id=Object.keys(Ri),VO=new Set(id),Gu="ui-preferences:sync",qO=(e,t)=>{if(typeof e=="boolean")return e;if(typeof e=="string"){if(e==="true")return!0;if(e==="false")return!1}return t},sd=(e,t,r)=>e==="historyView"?HO(t)?t:r:qO(t,r),WO=(e,t)=>{try{const r=localStorage.getItem(e);if(r===null)return t;const n=JSON.parse(r);return sd(e,n,t)}catch{return t}},KO=e=>{if(typeof window>"u")return Ri;try{const t=localStorage.getItem(e);if(t){const r=JSON.parse(t);if(r&&typeof r=="object"&&!Array.isArray(r)){const n=r;return id.reduce((a,s)=>(a[s]=sd(s,n[s],Ri[s]),a),{...Ri})}}}catch{}return id.reduce((t,r)=>(t[r]=WO(r,Ri[r]),t),{...Ri})};function YO(e,t){switch(t.type){case"set":{const{key:r,value:n}=t;if(!VO.has(r))return e;const a=sd(r,n,e[r]);return e[r]===a?e:{...e,[r]:a}}case"set_many":{const r=t.value||{};let n=!1;const a={...e};for(const s of id){if(!(s in r))continue;const o=r[s],l=sd(s,o,e[s]);a[s]!==l&&(a[s]=l,n=!0)}return n?a:e}case"reset":return{...Ri,...t.value||{}};default:return e}}function Mf(e="uiPreferences"){const t=h.useRef(`ui-preferences-${Math.random().toString(36).slice(2)}`),[r,n]=h.useReducer(YO,e,KO);return h.useEffect(()=>{typeof window>"u"||(localStorage.setItem(e,JSON.stringify(r)),window.dispatchEvent(new CustomEvent(Gu,{detail:{storageKey:e,sourceId:t.current,value:r}})))},[r,e]),h.useEffect(()=>{if(typeof window>"u")return;const l=u=>{!u||typeof u!="object"||Array.isArray(u)||n({type:"set_many",value:u})},c=u=>{if(!(u.key!==e||u.newValue===null))try{const p=JSON.parse(u.newValue);l(p)}catch{}},d=u=>{const f=u.detail;!f||f.storageKey!==e||f.sourceId===t.current||l(f.value)};return window.addEventListener("storage",c),window.addEventListener(Gu,d),()=>{window.removeEventListener("storage",c),window.removeEventListener(Gu,d)}},[e]),{preferences:r,setPreference:(l,c)=>{n({type:"set",key:l,value:c})},setPreferences:l=>{n({type:"set_many",value:l})},resetPreferences:l=>{n({type:"reset",value:l})},dispatch:n}}const ZO=()=>{try{const e=localStorage.getItem("claude-settings");return e&&JSON.parse(e).projectSortOrder==="date"?"date":"name"}catch{return"name"}},XO=()=>{try{const e=localStorage.getItem("starredProjects");return e?new Set(JSON.parse(e)):new Set}catch{return new Set}},JO=e=>{try{localStorage.setItem("starredProjects",JSON.stringify([...e]))}catch{}},sw=(e,t)=>`${e}::${t}`,QO=()=>{try{const e=localStorage.getItem("starredSessions");return e?new Set(JSON.parse(e)):new Set}catch{return new Set}},e9=e=>{try{localStorage.setItem("starredSessions",JSON.stringify([...e]))}catch{}},t9=/(?:^|[\s/\\(\[`"'])([\w./-]+?\.(?:ts|tsx|js|jsx|mjs|cjs|py|rb|go|rs|java|kt|swift|c|cc|cpp|h|hpp|cs|php|sh|bash|zsh|json|ya?ml|toml|md|mdx|html?|css|scss|less|sql|prisma|graphql|gql|vue|svelte|astro|dart|lua|r|pl|ps1|tf|dockerfile|env))(?:$|[\s:,)\]`"'])/i,r9=e=>{if(!e)return[];const t=new Set,r=new RegExp(t9.source,"gi");let n;for(;(n=r.exec(e))!==null;){const a=n[1],s=a.lastIndexOf(".");if(s>-1){const o=a.slice(s+1).toLowerCase();o&&o.length<=10&&t.add(o)}if(t.size>=3)break}return[...t]},Fi=e=>e.__provider==="cursor"?new Date(e.createdAt||0):e.__provider==="codex"?new Date(e.createdAt||e.lastActivity||0):new Date(e.lastActivity||e.createdAt||0),n9=(e,t)=>e.__provider==="cursor"?e.summary||e.name||t("projects.untitledSession"):e.__provider==="codex"?e.summary||e.name||t("projects.codexSession"):e.__provider==="gemini"||e.__provider==="qwen"||e.__provider==="opencode"?e.summary||e.name||t("projects.newSession"):e.summary||t("projects.newSession"),a9=e=>e.__provider==="cursor"?String(e.createdAt||""):e.__provider==="codex"?String(e.createdAt||e.lastActivity||""):String(e.lastActivity||e.createdAt||""),i9=(e,t,r)=>{const n=Fi(e),a=Math.floor((t.getTime()-n.getTime())/(1e3*60));return{isCursorSession:e.__provider==="cursor",isCodexSession:e.__provider==="codex",isGeminiSession:e.__provider==="gemini",isQwenSession:e.__provider==="qwen",isOpencodeSession:e.__provider==="opencode",isActive:a<10,sessionName:n9(e,r),sessionTime:a9(e),messageCount:Number(e.messageCount||0)}},UE=(e,t)=>{const r=[...e.sessions||[],...t[e.name]||[]].map(g=>({...g,__provider:"claude"})),n=(e.cursorSessions||[]).map(g=>({...g,__provider:"cursor"})),a=(e.codexSessions||[]).map(g=>({...g,__provider:"codex"})),s=g=>typeof g.id=="string"&&g.id.startsWith("qwen_")||g.provider==="qwen",o=g=>typeof g.id=="string"&&g.id.startsWith("opencode_")||g.provider==="opencode",l=e.geminiSessions||[],c=l.filter(g=>!s(g)&&!o(g)).map(g=>({...g,__provider:"gemini"})),d=l.filter(g=>s(g)).map(g=>({...g,__provider:"qwen"})),u=l.filter(g=>o(g)).map(g=>({...g,__provider:"opencode"})),p=[...(e.qwenSessions||[]).map(g=>({...g,__provider:"qwen"})),...d],f=[...(e.opencodeSessions||[]).map(g=>({...g,__provider:"opencode"})),...u],m=new Map;for(const g of[...r,...n,...a,...c,...p,...f])m.has(g.id)||m.set(g.id,g);return[...m.values()].sort((g,b)=>Fi(b).getTime()-Fi(g).getTime())},ow=(e,t)=>{const r=UE(e,t);return r.length===0?new Date(0):r.reduce((n,a)=>{const s=Fi(a);return s>n?s:n},new Date(0))},s9=(e,t,r,n)=>{const a=[...e];return a.sort((s,o)=>{const l=r.has(s.name),c=r.has(o.name);return l&&!c?-1:!l&&c?1:t==="date"?ow(o,n).getTime()-ow(s,n).getTime():(s.displayName||s.name).localeCompare(o.displayName||o.name)}),a},o9=(e,t)=>{const r=t.trim().toLowerCase();return r?e.filter(n=>{const a=(n.displayName||n.name).toLowerCase(),s=n.name.toLowerCase();return a.includes(r)||s.includes(r)}):e},l9=(e,t)=>{const r=!!e.taskmaster?.hasTaskmaster,n=!!(t?.hasMCPServer&&t?.isConfigured);return r&&n?"fully-configured":r?"taskmaster-only":n?"mcp-only":"not-configured"},c9=e=>{const t=typeof e.fullPath=="string"&&e.fullPath.length>0?e.fullPath:typeof e.path=="string"?e.path:"";return{name:e.name,displayName:typeof e.displayName=="string"&&e.displayName.trim().length>0?e.displayName:e.name,fullPath:t,path:typeof e.path=="string"&&e.path.length>0?e.path:t}};function d9({projects:e,selectedProject:t,selectedSession:r,isLoading:n,isMobile:a,t:s,onRefresh:o,onProjectSelect:l,onSessionSelect:c,onSessionDelete:d,onProjectDelete:u,setCurrentProject:p,setSidebarVisible:f,sidebarVisible:m}){const[g,b]=h.useState(new Set),[x,y]=h.useState(null),[v,w]=h.useState(!1),[k,E]=h.useState(""),[S,j]=h.useState({}),[_,T]=h.useState({}),[C,L]=h.useState(new Set),[A,I]=h.useState(new Date),[N,P]=h.useState("name"),[H,z]=h.useState(!1),[U,V]=h.useState({}),[O,G]=h.useState(null),[$,F]=h.useState(""),[te,Q]=h.useState(""),[ge,ae]=h.useState(new Set),[me,pe]=h.useState(null),[be,Ne]=h.useState(null),[xe,Be]=h.useState(!1),[M,de]=h.useState(()=>XO()),[ce,Y]=h.useState(()=>QO()),[W,ne]=h.useState("projects"),[fe,ye]=h.useState(null),[se,Se]=h.useState(!1),[re,X]=h.useState(null),Z=h.useRef(null),le=h.useRef(0),Ee=h.useRef(null),Te=!a&&!m;h.useEffect(()=>{const Ce=setInterval(()=>{I(new Date)},6e4);return()=>clearInterval(Ce)},[]),h.useEffect(()=>{T({}),L(new Set),V({})},[e]),h.useEffect(()=>{t&&b(Ce=>{if(Ce.has(t.name))return Ce;const Oe=new Set(Ce);return Oe.add(t.name),Oe})},[r,t]),h.useEffect(()=>{if(e.length>0&&!n){const Ce=new Set;e.forEach(Oe=>{Oe.sessions&&Oe.sessions.length>=0&&Ce.add(Oe.name)}),L(Ce)}},[e,n]),h.useEffect(()=>{const Ce=()=>{P(ZO())};Ce();const Oe=Ge=>{Ge.key==="claude-settings"&&Ce()},ct=()=>Ce();return window.addEventListener("storage",Oe),window.addEventListener("pixcode:settings-changed",ct),()=>{window.removeEventListener("storage",Oe),window.removeEventListener("pixcode:settings-changed",ct)}},[]),h.useEffect(()=>{Z.current&&clearTimeout(Z.current),Ee.current&&(Ee.current.close(),Ee.current=null);const Ce=te.trim();if(W!=="conversations"||Ce.length<2){le.current+=1,ye(null),X(null),Se(!1);return}Se(!0);const Oe=++le.current;return Z.current=setTimeout(()=>{if(Oe!==le.current)return;const ct=ot.searchConversationsUrl(Ce),Ge=new EventSource(ct);Ee.current=Ge;const He=[];let je=0;Ge.addEventListener("result",Ue=>{if(Oe!==le.current){Ge.close();return}try{const Fe=JSON.parse(Ue.data);He.push(Fe.projectResult),je=Fe.totalMatches,ye({results:[...He],totalMatches:je,query:Ce}),X({scannedProjects:Fe.scannedProjects,totalProjects:Fe.totalProjects})}catch{}}),Ge.addEventListener("progress",Ue=>{if(Oe!==le.current){Ge.close();return}try{const Fe=JSON.parse(Ue.data);je=Fe.totalMatches,X({scannedProjects:Fe.scannedProjects,totalProjects:Fe.totalProjects})}catch{}}),Ge.addEventListener("done",()=>{if(Oe!==le.current){Ge.close();return}Ge.close(),Ee.current=null,Se(!1),X(null),He.length===0&&ye({results:[],totalMatches:0,query:Ce})}),Ge.addEventListener("error",()=>{if(Oe!==le.current){Ge.close();return}Ge.close(),Ee.current=null,Se(!1),X(null),He.length===0&&ye({results:[],totalMatches:0,query:Ce})})},400),()=>{Z.current&&clearTimeout(Z.current),Ee.current&&(Ee.current.close(),Ee.current=null)}},[te,W]);const Ke=h.useCallback(Ce=>{b(Oe=>{const ct=new Set;return Oe.has(Ce)||ct.add(Ce),ct})},[]),Ze=h.useCallback((Ce,Oe)=>{c({...Ce,__projectName:Oe})},[c]),vt=h.useCallback(Ce=>{de(Oe=>{const ct=new Set(Oe);return ct.has(Ce)?ct.delete(Ce):ct.add(Ce),JO(ct),ct})},[]),Qe=h.useCallback(Ce=>M.has(Ce),[M]),jt=h.useCallback((Ce,Oe)=>{Y(ct=>{const Ge=sw(Ce,Oe),He=new Set(ct);return He.has(Ge)?He.delete(Ge):He.add(Ge),e9(He),He})},[]),wt=h.useCallback((Ce,Oe)=>ce.has(sw(Ce,Oe)),[ce]),st=h.useCallback(Ce=>UE(Ce,_),[_]),lt=h.useMemo(()=>e.map(Ce=>{const Oe=U[Ce.name];return Oe===void 0?Ce:{...Ce,sessionMeta:{...Ce.sessionMeta,hasMore:Oe}}}),[U,e]),kt=h.useMemo(()=>s9(lt,N,M,_),[_,N,lt,M]),_t=h.useMemo(()=>o9(kt,te),[te,kt]),At=h.useCallback(Ce=>{y(Ce.name),E(Ce.displayName)},[]),pr=h.useCallback(()=>{y(null),E("")},[]),nr=h.useCallback(async Ce=>{try{(await ot.renameProject(Ce,k)).ok?window.refreshProjects?await window.refreshProjects():window.location.reload():console.error("Failed to rename project")}catch(Oe){console.error("Error renaming project:",Oe)}finally{y(null),E("")}},[k]),Xt=h.useCallback((Ce,Oe,ct,Ge="claude")=>{Ne({projectName:Ce,sessionId:Oe,sessionTitle:ct,provider:Ge})},[]),zr=h.useCallback(async()=>{if(!be)return;const{projectName:Ce,sessionId:Oe,provider:ct}=be;Ne(null);try{let Ge;if(ct==="codex"?Ge=await ot.deleteCodexSession(Oe):ct==="gemini"?Ge=await ot.deleteGeminiSession(Oe):ct==="qwen"?Ge=await ot.deleteQwenSession(Oe):Ge=await ot.deleteSession(Ce,Oe),Ge.ok)d?.(Oe);else{const He=await Ge.text();console.error("[Sidebar] Failed to delete session:",{status:Ge.status,error:He}),alert(s("messages.deleteSessionFailed"))}}catch(Ge){console.error("[Sidebar] Error deleting session:",Ge),alert(s("messages.deleteSessionError"))}},[d,be,s]),De=h.useCallback(Ce=>{pe({project:Ce,sessionCount:st(Ce).length})},[st]),Xe=h.useCallback(async(Ce=!1)=>{if(!me)return;const{project:Oe,sessionCount:ct}=me,Ge=ct===0;pe(null),ae(He=>new Set([...He,Oe.name]));try{const He=await ot.deleteProject(Oe.name,!Ge,Ce);if(He.ok)u?.(Oe.name);else{const je=await He.json();alert(je.error||s("messages.deleteProjectFailed"))}}catch(He){console.error("Error deleting project:",He),alert(s("messages.deleteProjectError"))}finally{ae(He=>{const je=new Set(He);return je.delete(Oe.name),je})}},[me,u,s]),Je=h.useCallback(async Ce=>{const Oe=U[Ce.name];if(!(!(Oe!==void 0?Oe:Ce.sessionMeta?.hasMore===!0)||S[Ce.name])){j(Ge=>({...Ge,[Ce.name]:!0}));try{const Ge=(Ce.sessions?.length||0)+(_[Ce.name]?.length||0),He=await ot.sessions(Ce.name,5,Ge);if(!He.ok)return;const je=await He.json();T(Ue=>({...Ue,[Ce.name]:[...Ue[Ce.name]||[],...je.sessions||[]]})),je.hasMore===!1&&V(Ue=>({...Ue,[Ce.name]:!1}))}catch(Ge){console.error("Error loading more sessions:",Ge)}finally{j(Ge=>({...Ge,[Ce.name]:!1}))}}},[_,S,U]),ie=h.useCallback(Ce=>{l(Ce),p(Ce)},[l,p]),ke=h.useCallback(async()=>{z(!0);try{await o()}finally{z(!1)}},[o]),we=h.useCallback(async(Ce,Oe,ct,Ge)=>{const He=ct.trim();if(!He){G(null),F("");return}try{const je=await ot.renameSession(Oe,He,Ge);je.ok?await o():(console.error("[Sidebar] Failed to rename session:",je.status),alert(s("messages.renameSessionFailed")))}catch(je){console.error("[Sidebar] Error renaming session:",je),alert(s("messages.renameSessionError"))}finally{G(null),F("")}},[o,s]),Ve=h.useCallback(()=>{f(!1)},[f]),et=h.useCallback(()=>{f(!0)},[f]);return{isSidebarCollapsed:Te,expandedProjects:g,editingProject:x,showNewProject:v,editingName:k,loadingSessions:S,additionalSessions:_,initialSessionsLoaded:C,currentTime:A,projectSortOrder:N,isRefreshing:H,editingSession:O,editingSessionName:$,searchFilter:te,deletingProjects:ge,deleteConfirmation:me,sessionDeleteConfirmation:be,showVersionModal:xe,starredProjects:M,starredSessions:ce,filteredProjects:_t,toggleProject:Ke,handleSessionClick:Ze,toggleStarProject:vt,isProjectStarred:Qe,toggleStarSession:jt,isSessionStarred:wt,getProjectSessions:st,startEditing:At,cancelEditing:pr,saveProjectName:nr,showDeleteSessionConfirmation:Xt,confirmDeleteSession:zr,requestProjectDelete:De,confirmDeleteProject:Xe,loadMoreSessions:Je,handleProjectSelect:ie,refreshProjects:ke,updateSessionSummary:we,collapseSidebar:Ve,expandSidebar:et,setShowNewProject:w,setEditingName:E,setEditingSession:G,setEditingSessionName:F,searchMode:W,setSearchMode:ne,conversationResults:fe,isSearching:se,searchProgress:re,clearConversationResults:h.useCallback(()=>{le.current+=1,Ee.current&&(Ee.current.close(),Ee.current=null),Se(!1),X(null),ye(null)},[]),setSearchFilter:Q,setDeleteConfirmation:pe,setSessionDeleteConfirmation:Ne,setShowVersionModal:Be}}const u9="https://discord.gg/buxwujPNRE",p9="https://github.com/alicomert/pixcode/issues/new";function m9({className:e}){return i.jsx("svg",{className:e,fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:i.jsx("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"})})}function h9({onExpand:e,onShowSettings:t,updateAvailable:r,onShowVersionModal:n,t:a}){return i.jsxs("div",{className:"flex h-full w-12 flex-col items-center gap-1 bg-background/80 py-3 backdrop-blur-sm",children:[i.jsx("button",{onClick:e,className:"group flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":a("common:versionUpdate.ariaLabels.showSidebar"),title:a("common:versionUpdate.ariaLabels.showSidebar"),children:i.jsx(xD,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),i.jsx("div",{className:"nav-divider my-1 w-6"}),i.jsx("button",{onClick:t,className:"group flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":a("actions.settings"),title:a("actions.settings"),children:i.jsx(Lt,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),i.jsx("a",{href:p9,target:"_blank",rel:"noopener noreferrer",className:"group flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":a("actions.reportIssue"),title:a("actions.reportIssue"),children:i.jsx(ml,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),i.jsx("a",{href:u9,target:"_blank",rel:"noopener noreferrer",className:"group flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":a("actions.joinCommunity"),title:a("actions.joinCommunity"),children:i.jsx(m9,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})}),r&&i.jsxs("button",{onClick:n,className:"relative flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-accent/80","aria-label":a("common:versionUpdate.ariaLabels.updateAvailable"),title:a("common:versionUpdate.ariaLabels.updateAvailable"),children:[i.jsx(Na,{className:"h-4 w-4 text-blue-500"}),i.jsx("span",{className:"absolute right-1.5 top-1.5 h-1.5 w-1.5 animate-pulse rounded-full bg-blue-500"})]})]})}function GE(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=GE(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function HE(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=GE(e))&&(n&&(n+=" "),n+=t);return n}const lw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,cw=HE,Pf=(e,t)=>r=>{var n;if(t?.variants==null)return cw(e,r?.class,r?.className);const{variants:a,defaultVariants:s}=t,o=Object.keys(a).map(d=>{const u=r?.[d],p=s?.[d];if(u===null)return null;const f=lw(u)||lw(p);return a[d][f]}),l=r&&Object.entries(r).reduce((d,u)=>{let[p,f]=u;return f===void 0||(d[p]=f),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,u)=>{let{class:p,className:f,...m}=u;return Object.entries(m).every(g=>{let[b,x]=g;return Array.isArray(x)?x.includes({...s,...l}[b]):{...s,...l}[b]===x})?[...d,p,f]:d},[]);return cw(e,o,c,r?.class,r?.className)},Ff="-",f9=e=>{const t=b9(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(Ff);return l[0]===""&&l.length!==1&&l.shift(),VE(l,t)||g9(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},VE=(e,t)=>{if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?VE(e.slice(1),n):void 0;if(a)return a;if(t.validators.length===0)return;const s=e.join(Ff);return t.validators.find(({validator:o})=>o(s))?.classGroupId},dw=/^\[(.+)\]$/,g9=e=>{if(dw.test(e)){const t=dw.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},b9=e=>{const{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(const a in r)Qm(r[a],n,a,t);return n},Qm=(e,t,r,n)=>{e.forEach(a=>{if(typeof a=="string"){const s=a===""?t:uw(t,a);s.classGroupId=r;return}if(typeof a=="function"){if(x9(a)){Qm(a(n),t,r,n);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([s,o])=>{Qm(o,uw(t,s),r,n)})})},uw=(e,t)=>{let r=e;return t.split(Ff).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},x9=e=>e.isThemeGetter,y9=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(s,o)=>{r.set(s,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(s){let o=r.get(s);if(o!==void 0)return o;if((o=n.get(s))!==void 0)return a(s,o),o},set(s,o){r.has(s)?r.set(s,o):a(s,o)}}},eh="!",th=":",v9=th.length,w9=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=a=>{const s=[];let o=0,l=0,c=0,d;for(let g=0;g<a.length;g++){let b=a[g];if(o===0&&l===0){if(b===th){s.push(a.slice(c,g)),c=g+v9;continue}if(b==="/"){d=g;continue}}b==="["?o++:b==="]"?o--:b==="("?l++:b===")"&&l--}const u=s.length===0?a:a.substring(c),p=k9(u),f=p!==u,m=d&&d>c?d-c:void 0;return{modifiers:s,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}};if(t){const a=t+th,s=n;n=o=>o.startsWith(a)?s(o.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(r){const a=n;n=s=>r({className:s,parseClassName:a})}return n},k9=e=>e.endsWith(eh)?e.substring(0,e.length-1):e.startsWith(eh)?e.substring(1):e,S9=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const a=[];let s=[];return n.forEach(o=>{o[0]==="["||t[o]?(a.push(...s.sort(),o),s=[]):s.push(o)}),a.push(...s.sort()),a}},E9=e=>({cache:y9(e.cacheSize),parseClassName:w9(e),sortModifiers:S9(e),...f9(e)}),N9=/\s+/,C9=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:s}=t,o=[],l=e.trim().split(N9);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:p,modifiers:f,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:b}=r(u);if(p){c=u+(c.length>0?" "+c:c);continue}let x=!!b,y=n(x?g.substring(0,b):g);if(!y){if(!x){c=u+(c.length>0?" "+c:c);continue}if(y=n(g),!y){c=u+(c.length>0?" "+c:c);continue}x=!1}const v=s(f).join(":"),w=m?v+eh:v,k=w+y;if(o.includes(k))continue;o.push(k);const E=a(y,x);for(let S=0;S<E.length;++S){const j=E[S];o.push(w+j)}c=u+(c.length>0?" "+c:c)}return c};function A9(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=qE(t))&&(n&&(n+=" "),n+=r);return n}const qE=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=qE(e[n]))&&(r&&(r+=" "),r+=t);return r};function T9(e,...t){let r,n,a,s=o;function o(c){const d=t.reduce((u,p)=>p(u),e());return r=E9(d),n=r.cache.get,a=r.cache.set,s=l,l(c)}function l(c){const d=n(c);if(d)return d;const u=C9(c,r);return a(c,u),u}return function(){return s(A9.apply(null,arguments))}}const mr=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},WE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,KE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,j9=/^\d+\/\d+$/,_9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,I9=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,R9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,L9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,D9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cs=e=>j9.test(e),mt=e=>!!e&&!Number.isNaN(Number(e)),$a=e=>!!e&&Number.isInteger(Number(e)),Hu=e=>e.endsWith("%")&&mt(e.slice(0,-1)),ma=e=>_9.test(e),O9=()=>!0,M9=e=>I9.test(e)&&!R9.test(e),YE=()=>!1,P9=e=>L9.test(e),F9=e=>D9.test(e),z9=e=>!qe(e)&&!We(e),B9=e=>to(e,JE,YE),qe=e=>WE.test(e),vi=e=>to(e,QE,M9),Vu=e=>to(e,V9,mt),pw=e=>to(e,ZE,YE),$9=e=>to(e,XE,F9),tc=e=>to(e,eN,P9),We=e=>KE.test(e),jo=e=>ro(e,QE),U9=e=>ro(e,q9),mw=e=>ro(e,ZE),G9=e=>ro(e,JE),H9=e=>ro(e,XE),rc=e=>ro(e,eN,!0),to=(e,t,r)=>{const n=WE.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},ro=(e,t,r=!1)=>{const n=KE.exec(e);return n?n[1]?t(n[1]):r:!1},ZE=e=>e==="position"||e==="percentage",XE=e=>e==="image"||e==="url",JE=e=>e==="length"||e==="size"||e==="bg-size",QE=e=>e==="length",V9=e=>e==="number",q9=e=>e==="family-name",eN=e=>e==="shadow",W9=()=>{const e=mr("color"),t=mr("font"),r=mr("text"),n=mr("font-weight"),a=mr("tracking"),s=mr("leading"),o=mr("breakpoint"),l=mr("container"),c=mr("spacing"),d=mr("radius"),u=mr("shadow"),p=mr("inset-shadow"),f=mr("text-shadow"),m=mr("drop-shadow"),g=mr("blur"),b=mr("perspective"),x=mr("aspect"),y=mr("ease"),v=mr("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...k(),We,qe],S=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],_=()=>[We,qe,c],T=()=>[cs,"full","auto",..._()],C=()=>[$a,"none","subgrid",We,qe],L=()=>["auto",{span:["full",$a,We,qe]},$a,We,qe],A=()=>[$a,"auto",We,qe],I=()=>["auto","min","max","fr",We,qe],N=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],P=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",..._()],z=()=>[cs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",..._()],U=()=>[e,We,qe],V=()=>[...k(),mw,pw,{position:[We,qe]}],O=()=>["no-repeat",{repeat:["","x","y","space","round"]}],G=()=>["auto","cover","contain",G9,B9,{size:[We,qe]}],$=()=>[Hu,jo,vi],F=()=>["","none","full",d,We,qe],te=()=>["",mt,jo,vi],Q=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[mt,Hu,mw,pw],me=()=>["","none",g,We,qe],pe=()=>["none",mt,We,qe],be=()=>["none",mt,We,qe],Ne=()=>[mt,We,qe],xe=()=>[cs,"full",..._()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ma],breakpoint:[ma],color:[O9],container:[ma],"drop-shadow":[ma],ease:["in","out","in-out"],font:[z9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ma],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ma],shadow:[ma],spacing:["px",mt],text:[ma],"text-shadow":[ma],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",cs,qe,We,x]}],container:["container"],columns:[{columns:[mt,qe,We,l]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{start:T()}],end:[{end:T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[$a,"auto",We,qe]}],basis:[{basis:[cs,"full","auto",l,..._()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[mt,cs,"auto","initial","none",qe]}],grow:[{grow:["",mt,We,qe]}],shrink:[{shrink:["",mt,We,qe]}],order:[{order:[$a,"first","last","none",We,qe]}],"grid-cols":[{"grid-cols":C()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":C()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":I()}],"auto-rows":[{"auto-rows":I()}],gap:[{gap:_()}],"gap-x":[{"gap-x":_()}],"gap-y":[{"gap-y":_()}],"justify-content":[{justify:[...N(),"normal"]}],"justify-items":[{"justify-items":[...P(),"normal"]}],"justify-self":[{"justify-self":["auto",...P()]}],"align-content":[{content:["normal",...N()]}],"align-items":[{items:[...P(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...P(),{baseline:["","last"]}]}],"place-content":[{"place-content":N()}],"place-items":[{"place-items":[...P(),"baseline"]}],"place-self":[{"place-self":["auto",...P()]}],p:[{p:_()}],px:[{px:_()}],py:[{py:_()}],ps:[{ps:_()}],pe:[{pe:_()}],pt:[{pt:_()}],pr:[{pr:_()}],pb:[{pb:_()}],pl:[{pl:_()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":_()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":_()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[l,"screen",...z()]}],"min-w":[{"min-w":[l,"screen","none",...z()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",r,jo,vi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,We,Vu]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Hu,qe]}],"font-family":[{font:[U9,qe,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,We,qe]}],"line-clamp":[{"line-clamp":[mt,"none",We,Vu]}],leading:[{leading:[s,..._()]}],"list-image":[{"list-image":["none",We,qe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",We,qe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[mt,"from-font","auto",We,vi]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[mt,"auto",We,qe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",We,qe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",We,qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:V()}],"bg-repeat":[{bg:O()}],"bg-size":[{bg:G()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},$a,We,qe],radial:["",We,qe],conic:[$a,We,qe]},H9,$9]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[mt,We,qe]}],"outline-w":[{outline:["",mt,jo,vi]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",u,rc,tc]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",p,rc,tc]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[mt,vi]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",f,rc,tc]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[mt,We,qe]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[mt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[We,qe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[mt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:O()}],"mask-size":[{mask:G()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",We,qe]}],filter:[{filter:["","none",We,qe]}],blur:[{blur:me()}],brightness:[{brightness:[mt,We,qe]}],contrast:[{contrast:[mt,We,qe]}],"drop-shadow":[{"drop-shadow":["","none",m,rc,tc]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",mt,We,qe]}],"hue-rotate":[{"hue-rotate":[mt,We,qe]}],invert:[{invert:["",mt,We,qe]}],saturate:[{saturate:[mt,We,qe]}],sepia:[{sepia:["",mt,We,qe]}],"backdrop-filter":[{"backdrop-filter":["","none",We,qe]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[mt,We,qe]}],"backdrop-contrast":[{"backdrop-contrast":[mt,We,qe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",mt,We,qe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[mt,We,qe]}],"backdrop-invert":[{"backdrop-invert":["",mt,We,qe]}],"backdrop-opacity":[{"backdrop-opacity":[mt,We,qe]}],"backdrop-saturate":[{"backdrop-saturate":[mt,We,qe]}],"backdrop-sepia":[{"backdrop-sepia":["",mt,We,qe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":_()}],"border-spacing-x":[{"border-spacing-x":_()}],"border-spacing-y":[{"border-spacing-y":_()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",We,qe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[mt,"initial",We,qe]}],ease:[{ease:["linear","initial",y,We,qe]}],delay:[{delay:[mt,We,qe]}],animate:[{animate:["none",v,We,qe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,We,qe]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:Ne()}],"skew-x":[{"skew-x":Ne()}],"skew-y":[{"skew-y":Ne()}],transform:[{transform:[We,qe,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:xe()}],"translate-x":[{"translate-x":xe()}],"translate-y":[{"translate-y":xe()}],"translate-z":[{"translate-z":xe()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",We,qe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",We,qe]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[mt,jo,vi,Vu]}],stroke:[{stroke:["none",...U()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},K9=T9(W9);function ue(...e){return K9(HE(e))}function Y9(e){if(!e||typeof e!="string")return null;try{return JSON.parse(e)}catch{return null}}const Z9=Pf("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}}),tN=h.forwardRef(({className:e,variant:t,...r},n)=>i.jsx("div",{ref:n,role:"alert","data-slot":"alert",className:ue(Z9({variant:t}),e),...r}));tN.displayName="Alert";const X9=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"alert-title",className:ue("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t}));X9.displayName="AlertTitle";const J9=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"alert-description",className:ue("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t}));J9.displayName="AlertDescription";const Q9=Pf("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function er({className:e,variant:t,...r}){return i.jsx("div",{className:ue(Q9({variant:t}),e),...r})}const eM=Pf("inline-flex touch-manipulation items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90 active:bg-primary/80",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 active:bg-destructive/80",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground active:bg-accent/80",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80 active:bg-secondary/70",ghost:"hover:bg-accent hover:text-accent-foreground active:bg-accent/80",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3 text-sm",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),_e=h.forwardRef(({className:e,variant:t,size:r,...n},a)=>i.jsx("button",{className:ue(eM({variant:t,size:r,className:e})),ref:a,...n}));_e.displayName="Button";const rN=h.createContext(null),nN=()=>{const e=h.useContext(rN);if(!e)throw new Error("Confirmation components must be used within Confirmation");return e},aN=({className:e,approval:t="pending",children:r,...n})=>{const a=h.useMemo(()=>({approval:t}),[t]);return i.jsx(rN.Provider,{value:a,children:i.jsx(tN,{className:ue("flex flex-col gap-2",e),...n,children:r})})};aN.displayName="Confirmation";const iN=({className:e,...t})=>i.jsx("div",{"data-slot":"confirmation-title",className:ue("text-muted-foreground inline text-sm",e),...t});iN.displayName="ConfirmationTitle";const sN=({children:e})=>{const{approval:t}=nN();return t!=="pending"?null:i.jsx(i.Fragment,{children:e})};sN.displayName="ConfirmationRequest";const oN=({className:e,...t})=>{const{approval:r}=nN();return r!=="pending"?null:i.jsx("div",{"data-slot":"confirmation-actions",className:ue("flex items-center justify-end gap-2 self-end",e),...t})};oN.displayName="ConfirmationActions";const Fc=({variant:e="default",...t})=>i.jsx(_e,{className:"h-8 px-3 text-sm",variant:e,type:"button",...t});Fc.displayName="ConfirmationAction";const lN=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:ue("rounded-xl border bg-card text-card-foreground shadow-sm",e),...t}));lN.displayName="Card";const cN=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:ue("flex flex-col space-y-1.5 p-4",e),...t}));cN.displayName="CardHeader";const dN=h.forwardRef(({className:e,...t},r)=>i.jsx("h3",{ref:r,className:ue("font-semibold leading-none tracking-tight",e),...t}));dN.displayName="CardTitle";const tM=h.forwardRef(({className:e,...t},r)=>i.jsx("p",{ref:r,className:ue("text-sm text-muted-foreground",e),...t}));tM.displayName="CardDescription";const uN=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:ue("p-4 pt-0",e),...t}));uN.displayName="CardContent";const pN=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:ue("flex items-center p-4 pt-0",e),...t}));pN.displayName="CardFooter";const rM=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:ue("ml-auto shrink-0",e),...t}));rM.displayName="CardAction";const mN=h.createContext(null);function hN(){const e=h.useContext(mN);if(!e)throw new Error("Collapsible components must be used within <Collapsible>");return e}const ii=h.forwardRef(({defaultOpen:e=!1,open:t,onOpenChange:r,className:n,children:a,...s},o)=>{const[l,c]=h.useState(e),d=t!==void 0,u=d?t:l,p=h.useCallback(m=>{d||c(m),r?.(m)},[d,r]),f=h.useMemo(()=>({open:u,onOpenChange:p}),[u,p]);return i.jsx(mN.Provider,{value:f,children:i.jsx("div",{ref:o,"data-state":u?"open":"closed",className:n,...s,children:a})})});ii.displayName="Collapsible";const Ca=h.forwardRef(({onClick:e,children:t,className:r,...n},a)=>{const{open:s,onOpenChange:o}=hN(),l=h.useCallback(c=>{o(!s),e?.(c)},[s,o,e]);return i.jsx("button",{ref:a,type:"button","aria-expanded":s,"data-state":s?"open":"closed",onClick:l,className:r,...n,children:t})});Ca.displayName="CollapsibleTrigger";const si=h.forwardRef(({className:e,children:t,...r},n)=>{const{open:a}=hN();return i.jsx("div",{ref:n,"data-state":a?"open":"closed",className:ue("grid transition-[grid-template-rows] duration-200 ease-out",a?"grid-rows-[1fr]":"grid-rows-[0fr]",e),...r,children:i.jsx("div",{className:"overflow-hidden",children:t})})});si.displayName="CollapsibleContent";const fN=h.createContext(null);function zf(){const e=h.useContext(fN);if(!e)throw new Error("Command components must be used within <Command>");return e}const gN=h.forwardRef(({className:e,children:t,...r},n)=>{const[a,s]=h.useState(""),o=h.useRef(new Map),[l,c]=h.useState(0),d=h.useCallback(v=>{o.current.set(v.id,v),c(w=>w+1)},[]),u=h.useCallback(v=>{o.current.delete(v),c(w=>w+1)},[]),p=h.useCallback((v,w)=>{const k=o.current.get(v);k&&Object.assign(k,w)},[]),f=h.useMemo(()=>{const v=a.toLowerCase(),w=new Set;for(const[k,E]of o.current)(!v||E.value.includes(v))&&w.add(k);return w},[a,l]),m=h.useMemo(()=>{const v=[];for(const[,w]of o.current)f.has(w.id)&&v.push(w);return v},[f]),[g,b]=h.useState(null);h.useEffect(()=>{b(m.length>0?m[0].id:null)},[m]);const x=h.useCallback(v=>{if(v.key==="ArrowDown"||v.key==="ArrowUp"||v.key==="Enter")v.preventDefault();else return;const w=m;if(w.length===0)return;if(v.key==="Enter"){w.find(T=>T.id===g)?.onSelect();return}const k=w.findIndex(_=>_.id===g);let E;v.key==="ArrowDown"?E=k<w.length-1?k+1:0:E=k>0?k-1:w.length-1;const S=w[E].id;b(S),w[E].element?.scrollIntoView({block:"nearest"})},[m,g]),y=h.useMemo(()=>({search:a,setSearch:s,visibleIds:f,activeId:g,setActiveId:b,register:d,unregister:u,updateEntry:p}),[a,f,g,d,u,p]);return i.jsx(fN.Provider,{value:y,children:i.jsx("div",{ref:n,role:"combobox","aria-expanded":"true","aria-haspopup":"listbox",className:ue("flex flex-col",e),onKeyDown:x,...r,children:t})})});gN.displayName="Command";const bN=h.forwardRef(({className:e,placeholder:t="Search...",...r},n)=>{const{search:a,setSearch:s}=zf();return i.jsxs("div",{className:"flex items-center border-b px-3",role:"presentation",children:[i.jsx(Ea,{className:"mr-2 h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),i.jsx("input",{ref:n,type:"text",role:"searchbox","aria-autocomplete":"list",autoComplete:"off",autoCorrect:"off",spellCheck:!1,value:a,onChange:o=>s(o.target.value),placeholder:t,className:ue("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none","placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]})});bN.displayName="CommandInput";const xN=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,role:"listbox",className:ue("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));xN.displayName="CommandList";const yN=h.forwardRef(({className:e,...t},r)=>{const{search:n,visibleIds:a}=zf();return!n||a.size>0?null:i.jsx("div",{ref:r,className:ue("py-6 text-center text-sm text-muted-foreground",e),...t})});yN.displayName="CommandEmpty";const vN=h.forwardRef(({className:e,heading:t,children:r,...n},a)=>i.jsxs("div",{ref:a,className:ue("overflow-hidden p-1",e),role:"group","aria-label":typeof t=="string"?t:void 0,...n,children:[t&&i.jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",role:"presentation",children:t}),r]}));vN.displayName="CommandGroup";const wN=h.forwardRef(({className:e,value:t,onSelect:r,disabled:n,children:a,...s},o)=>{const{visibleIds:l,activeId:c,setActiveId:d,register:u,unregister:p,updateEntry:f}=zf(),m=h.useId(),g=h.useRef(null),b=t||(typeof a=="string"?a:"");h.useEffect(()=>(u({id:m,value:b.toLowerCase(),onSelect:r||(()=>{}),element:g.current}),()=>p(m)),[m,b,u,p]),h.useEffect(()=>{f(m,{onSelect:r||(()=>{})})},[m,r,f]);const x=h.useCallback(v=>{g.current=v,f(m,{element:v}),typeof o=="function"?o(v):o&&(o.current=v)},[m,f,o]);if(!l.has(m))return null;const y=c===m;return i.jsx("div",{ref:x,role:"option","aria-selected":y,"aria-disabled":n||void 0,"data-active":y||void 0,className:ue("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none",y&&"bg-accent text-accent-foreground",n&&"pointer-events-none opacity-50",e),onPointerMove:()=>{!n&&c!==m&&d(m)},onClick:()=>!n&&r?.(),...s,children:a})});wN.displayName="CommandItem";const nM=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:ue("-mx-1 h-px bg-border",e),...t}));nM.displayName="CommandSeparator";function rh({checked:e,onToggle:t,ariaLabel:r="Toggle dark mode"}){const{isDarkMode:n,toggleDarkMode:a}=Oa(),s=typeof e=="boolean"&&typeof t=="function",o=s?e:n,l=()=>{if(s&&t){t(!o);return}a()};return i.jsxs("button",{onClick:l,className:ue("relative inline-flex h-7 w-12 flex-shrink-0 touch-manipulation cursor-pointer items-center rounded-full border-2 transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",o?"border-primary bg-primary":"border-border bg-muted"),role:"switch","aria-checked":o,"aria-label":r,children:[i.jsx("span",{className:"sr-only",children:r}),i.jsx("span",{className:ue("flex h-5 w-5 transform items-center justify-center rounded-full shadow-sm transition-transform duration-200",o?"translate-x-[22px] bg-white":"translate-x-[2px] bg-foreground/60 dark:bg-foreground/80"),children:o?i.jsx(Tf,{className:"h-3 w-3 text-primary"}):i.jsx(_f,{className:"h-3 w-3 text-white dark:text-background"})})]})}const kN=h.createContext(null);function SN(){const e=h.useContext(kN);if(!e)throw new Error("Dialog components must be used within <Dialog>");return e}const EN=({open:e,onOpenChange:t,defaultOpen:r=!1,children:n})=>{const[a,s]=h.useState(r),o=h.useRef(null),l=e!==void 0,c=l?e:a,d=h.useCallback(p=>{l||s(p),t?.(p)},[l,t]),u=h.useMemo(()=>({open:c,onOpenChange:d,triggerRef:o}),[c,d]);return i.jsx(kN.Provider,{value:u,children:n})},aM=h.forwardRef(({onClick:e,children:t,asChild:r,...n},a)=>{const{onOpenChange:s,triggerRef:o}=SN(),l=h.useCallback(c=>{s(!0),e?.(c)},[s,e]);if(r&&h.isValidElement(t)){const c=t;return h.cloneElement(c,{onClick:d=>{s(!0),c.props.onClick?.(d)},ref:d=>{o.current=d,typeof a=="function"?a(d):a&&(a.current=d)}})}return i.jsx("button",{ref:c=>{o.current=c,typeof a=="function"?a(c):a&&(a.current=c)},type:"button",onClick:l,...n,children:t})});aM.displayName="DialogTrigger";const hw='a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',Bf=h.forwardRef(({className:e,children:t,onEscapeKeyDown:r,onPointerDownOutside:n,...a},s)=>{const{open:o,onOpenChange:l,triggerRef:c}=SN(),d=h.useRef(null),u=h.useRef(null);return h.useEffect(()=>{o?u.current=document.activeElement:u.current&&((c.current||u.current)?.focus(),u.current=null)},[o,c]),h.useEffect(()=>{if(!o)return;const p=m=>{if(m.key==="Escape"){m.stopPropagation(),r?.(),l(!1);return}if(m.key==="Tab"&&d.current){const g=Array.from(d.current.querySelectorAll(hw));if(g.length===0)return;const b=g[0],x=g[g.length-1];m.shiftKey&&document.activeElement===b?(m.preventDefault(),x.focus()):!m.shiftKey&&document.activeElement===x&&(m.preventDefault(),b.focus())}};document.addEventListener("keydown",p,!0);const f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",p,!0),document.body.style.overflow=f}},[o,l,r]),h.useEffect(()=>{o&&d.current&&requestAnimationFrame(()=>{d.current?.querySelector(hw)?.focus()})},[o]),o?Bd.createPortal(i.jsxs("div",{className:"fixed inset-0 z-50",children:[i.jsx("div",{className:"fixed inset-0 animate-dialog-overlay-show bg-black/50 backdrop-blur-sm",onClick:()=>{n?.(),l(!1)},"aria-hidden":!0}),i.jsx("div",{ref:p=>{d.current=p,typeof s=="function"?s(p):s&&(s.current=p)},role:"dialog","aria-modal":"true",className:ue("fixed left-1/2 top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2","rounded-xl border bg-popover text-popover-foreground shadow-lg","animate-dialog-content-show",e),...a,children:t})]}),document.body):null});Bf.displayName="DialogContent";const $f=h.forwardRef(({className:e,...t},r)=>i.jsx("h2",{ref:r,className:ue("sr-only",e),...t}));$f.displayName="DialogTitle";const Nt=h.forwardRef(({className:e,type:t,...r},n)=>i.jsx("input",{type:t,className:ue("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...r}));Nt.displayName="Input";const Uf=h.forwardRef(({className:e,contentClassName:t,children:r,...n},a)=>i.jsx("div",{className:ue("relative overflow-hidden",e),...n,children:i.jsx("div",{ref:a,className:ue("h-full w-full overflow-auto rounded-[inherit]",t),style:{WebkitOverflowScrolling:"touch",touchAction:"pan-y"},children:r})}));Uf.displayName="ScrollArea";const od=h.memo(({children:e,className:t,as:r="span"})=>i.jsx(r,{className:ue("animate-shimmer inline-block bg-[length:250%_100%] bg-clip-text text-transparent","bg-[linear-gradient(90deg,transparent_33%,hsl(var(--foreground))_50%,transparent_67%),linear-gradient(hsl(var(--muted-foreground)),hsl(var(--muted-foreground)))]",t),children:e}));od.displayName="Shimmer";const NN=h.createContext(null),iM=()=>{const e=h.useContext(NN);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},sM=1e3,oM=1e3,nh=h.memo(({className:e,isStreaming:t=!1,open:r,defaultOpen:n,onOpenChange:a,duration:s,children:o,...l})=>{const c=n??t,d=n===!1,[u,p]=h.useState(c),f=r!==void 0,m=f?r:u,g=h.useCallback(S=>{f||p(S),a?.(S)},[f,a]),[b,x]=h.useState(s),y=h.useRef(t),[v,w]=h.useState(!1),k=h.useRef(null);h.useEffect(()=>{s!==void 0&&x(s)},[s]),h.useEffect(()=>{t?(y.current=!0,k.current===null&&(k.current=Date.now())):k.current!==null&&(x(Math.ceil((Date.now()-k.current)/oM)),k.current=null)},[t]),h.useEffect(()=>{t&&!m&&!d&&g(!0)},[t,m,g,d]),h.useEffect(()=>{if(y.current&&!t&&m&&!v){const S=setTimeout(()=>{g(!1),w(!0)},sM);return()=>clearTimeout(S)}},[t,m,g,v]);const E=h.useMemo(()=>({duration:b,isOpen:m,isStreaming:t,setIsOpen:g}),[b,m,t,g]);return i.jsx(NN.Provider,{value:E,children:i.jsx(ii,{open:m,onOpenChange:g,className:ue("not-prose",e),...l,children:o})})});nh.displayName="Reasoning";const lM=(e,t)=>e||t===0?i.jsx(od,{children:"Thinking..."}):t===void 0?i.jsx("p",{children:"Thought for a few seconds"}):i.jsxs("p",{children:["Thought for ",t," seconds"]}),ah=h.memo(({className:e,children:t,getThinkingMessage:r=lM,...n})=>{const{isStreaming:a,isOpen:s,duration:o}=iM();return i.jsx(Ca,{className:ue("flex w-full items-center gap-2 text-sm text-muted-foreground transition-colors hover:text-foreground",e),...n,children:t??i.jsxs(i.Fragment,{children:[i.jsx(GD,{className:"h-4 w-4"}),r(a,o),i.jsx(iE,{className:ue("h-4 w-4 transition-transform",s?"rotate-180":"rotate-0")})]})})});ah.displayName="ReasoningTrigger";const ih=h.memo(({className:e,children:t,...r})=>i.jsx(si,{className:ue("mt-4 text-sm text-muted-foreground",e),...r,children:t}));ih.displayName="ReasoningContent";function cM(e){switch(e){case"top":return"top-full left-1/2 transform -translate-x-1/2 border-t-gray-900 dark:border-t-gray-100";case"bottom":return"bottom-full left-1/2 transform -translate-x-1/2 border-b-gray-900 dark:border-b-gray-100";case"left":return"left-full top-1/2 transform -translate-y-1/2 border-l-gray-900 dark:border-l-gray-100";case"right":return"right-full top-1/2 transform -translate-y-1/2 border-r-gray-900 dark:border-r-gray-100";default:return"top-full left-1/2 transform -translate-x-1/2 border-t-gray-900 dark:border-t-gray-100"}}function Yn({children:e,content:t,position:r="top",className:n="",delay:a=350}){const[s,o]=h.useState(!1),l=h.useRef(null),c=h.useRef(!1),d=h.useRef(null),u=h.useRef(null),[p,f]=h.useState(null),m=h.useCallback(()=>{const w=d.current;if(!w)return;const k=w.getBoundingClientRect(),E=8,S={position:"fixed",zIndex:9999};switch(r){case"bottom":S.left=k.left+k.width/2,S.top=k.bottom+E,S.transform="translateX(-50%)";break;case"left":S.left=k.left-E,S.top=k.top+k.height/2,S.transform="translate(-100%, -50%)";break;case"right":S.left=k.right+E,S.top=k.top+k.height/2,S.transform="translateY(-50%)";break;case"top":default:S.left=k.left+k.width/2,S.top=k.top-E,S.transform="translate(-50%, -100%)";break}f(S)},[r]),g=()=>{l.current!==null&&(window.clearTimeout(l.current),l.current=null)},b=()=>{g(),l.current=window.setTimeout(()=>{o(!0)},a)},x=()=>{g(),o(!1)},y=()=>{g(),c.current=!1,l.current=window.setTimeout(()=>{c.current=!0,o(!0)},a)},v=()=>{g(),!c.current&&o(!1)};return h.useEffect(()=>()=>{g()},[]),h.useEffect(()=>{if(!s||typeof document>"u")return;const w=k=>{const E=k.target;E instanceof Node&&d.current?.contains(E)||(o(!1),c.current=!1)};return document.addEventListener("pointerdown",w,!0),()=>document.removeEventListener("pointerdown",w,!0)},[s]),h.useEffect(()=>{if(!s){f(null);return}const w=window.requestAnimationFrame(m),k=()=>m();return window.addEventListener("resize",k),window.addEventListener("scroll",k,!0),()=>{window.cancelAnimationFrame(w),window.removeEventListener("resize",k),window.removeEventListener("scroll",k,!0)}},[s,m]),t?i.jsxs("div",{ref:d,className:"relative inline-block",onMouseEnter:b,onMouseLeave:x,onTouchStart:y,onTouchEnd:v,onTouchCancel:v,children:[e,s&&typeof document<"u"&&Bd.createPortal(i.jsxs("div",{ref:u,style:p||{position:"fixed",top:"-9999px",left:"-9999px",opacity:0},className:ue("px-2 py-1 text-xs font-medium text-white bg-gray-900 dark:bg-gray-100 dark:text-gray-900 rounded shadow-lg whitespace-nowrap pointer-events-none","animate-in fade-in-0 zoom-in-95 duration-200",n),children:[t,i.jsx("div",{className:ue("absolute w-0 h-0 border-4 border-transparent",cM(r))})]}),document.body)]}):i.jsx(i.Fragment,{children:e})}const CN=h.createContext(null),AN=h.forwardRef(({className:e,status:t="ready",children:r,...n},a)=>{const s=h.useMemo(()=>({status:t}),[t]);return i.jsx(CN.Provider,{value:s,children:i.jsx("form",{ref:a,"data-slot":"prompt-input",className:ue("relative overflow-hidden rounded-xl border border-border/70 bg-zinc-50/95 shadow-sm shadow-zinc-950/5 backdrop-blur-sm transition-all duration-200 focus-within:border-primary/40 focus-within:shadow-md focus-within:ring-1 focus-within:ring-primary/20 dark:bg-zinc-950/90",e),...n,children:r})})});AN.displayName="PromptInput";const TN=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"prompt-input-header",className:ue("px-3 pt-3",e),...t}));TN.displayName="PromptInputHeader";const jN=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"prompt-input-body",className:ue("relative",e),...t}));jN.displayName="PromptInputBody";const _N=h.forwardRef(({className:e,...t},r)=>i.jsx("textarea",{ref:r,"data-slot":"prompt-input-textarea",className:ue("chat-input-placeholder block max-h-[40vh] w-full resize-none overflow-y-auto bg-transparent px-4 py-2 font-mono text-sm leading-6 text-foreground placeholder-muted-foreground/50 focus:outline-none sm:max-h-[300px]",e),...t}));_N.displayName="PromptInputTextarea";const IN=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"prompt-input-footer",className:ue("flex items-center justify-between border-t border-border/30 px-3 py-2",e),...t}));IN.displayName="PromptInputFooter";const RN=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"prompt-input-tools",className:ue("flex items-center gap-1",e),...t}));RN.displayName="PromptInputTools";const zc=h.forwardRef(({className:e,tooltip:t,children:r,...n},a)=>{const s=i.jsx(_e,{ref:a,type:"button",variant:"ghost",size:"icon",className:ue("h-8 w-8 [&_svg]:size-4",e),...n,children:r});return t?i.jsx(Yn,{content:t.shortcut?i.jsxs("span",{className:"flex items-center gap-1.5",children:[t.content,i.jsx("kbd",{className:"rounded bg-white/20 px-1 text-[10px]",children:t.shortcut})]}):t.content,position:t.side??"top",children:s}):s});zc.displayName="PromptInputButton";const LN=h.forwardRef(({className:e,status:t,children:r,...n},a)=>{const s=h.useContext(CN),o=t??s?.status??"ready",l=o==="submitted"||o==="streaming";return i.jsx(_e,{ref:a,type:l?"button":"submit",variant:"default",size:"icon",className:ue("h-8 w-8 rounded-lg",e),...n,children:r??(l?i.jsx(qd,{className:"h-3.5 w-3.5 fill-current"}):i.jsx(yD,{className:"h-4 w-4"}))})});LN.displayName="PromptInputSubmit";function Gf({children:e,className:t}){return i.jsx("div",{className:ue("inline-flex items-center gap-[2px] rounded-lg bg-muted/60 p-[3px]",t),children:e})}function Hf({isActive:e,onClick:t,children:r,className:n}){return i.jsx("button",{onClick:t,className:ue("flex touch-manipulation items-center gap-1.5 rounded-md px-3 py-2 text-sm font-medium transition-all duration-150",e?"bg-background text-foreground shadow-sm":"text-muted-foreground active:bg-background/50",n),children:r})}const DN=h.createContext(null);function ON(){const e=h.useContext(DN);if(!e)throw new Error("QueueItem sub-components must be used within <QueueItem>");return e}const MN=h.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-slot":"queue",role:"list",className:ue("space-y-0.5",e),...t}));MN.displayName="Queue";const PN=h.forwardRef(({status:e="pending",className:t,children:r,...n},a)=>{const s=h.useMemo(()=>({status:e}),[e]);return i.jsx(DN.Provider,{value:s,children:i.jsx("div",{ref:a,"data-slot":"queue-item","data-status":e,role:"listitem",className:ue("flex items-start gap-2 py-0.5",t),...n,children:r})})});PN.displayName="QueueItem";const FN=h.forwardRef(({className:e,...t},r)=>{const{status:n}=ON();return i.jsxs("div",{ref:r,"data-slot":"queue-item-indicator","aria-hidden":"true",className:ue("mt-0.5 flex h-3.5 w-3.5 flex-shrink-0 items-center justify-center",e),...t,children:[n==="completed"&&i.jsx("svg",{className:"h-3.5 w-3.5 text-green-500 dark:text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),n==="in_progress"&&i.jsx("span",{className:"h-2 w-2 animate-pulse rounded-full bg-blue-500 dark:bg-blue-400"}),n==="pending"&&i.jsx("svg",{className:"h-3.5 w-3.5 text-muted-foreground/50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("circle",{cx:"12",cy:"12",r:"9",strokeWidth:2})})]})});FN.displayName="QueueItemIndicator";const zN=h.forwardRef(({className:e,children:t,...r},n)=>{const{status:a}=ON();return i.jsx("div",{ref:n,"data-slot":"queue-item-content",className:ue("min-w-0 flex-1 text-xs",a==="completed"&&"text-muted-foreground line-through",a==="in_progress"&&"font-medium text-foreground",a==="pending"&&"text-foreground",e),...r,children:t})});zN.displayName="QueueItemContent";const fw="https://github.com/alicomert/pixcode/issues/new",dM="https://github.com/alicomert/pixcode",gw="https://discord.gg/buxwujPNRE";function bw({className:e}){return i.jsx("svg",{className:e,fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:i.jsx("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"})})}function uM({updateAvailable:e,releaseInfo:t,latestVersion:r,currentVersion:n,onShowVersionModal:a,onShowSettings:s,t:o}){return i.jsxs("div",{className:"flex-shrink-0",style:{paddingBottom:"env(safe-area-inset-bottom, 0)"},children:[e&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"nav-divider"}),i.jsx("div",{className:"hidden px-2 py-1.5 md:block",children:i.jsxs("button",{className:"group flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left transition-colors hover:bg-blue-50/80 dark:hover:bg-blue-900/15",onClick:a,children:[i.jsxs("div",{className:"relative flex-shrink-0",children:[i.jsx(Vv,{className:"h-4 w-4 text-blue-500 dark:text-blue-400"}),i.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-1.5 w-1.5 animate-pulse rounded-full bg-blue-500"})]}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"block truncate text-sm font-medium text-blue-600 dark:text-blue-300",children:t?.title||`v${r}`}),i.jsx("span",{className:"text-[10px] text-blue-500/70 dark:text-blue-400/60",children:o("version.updateAvailable")})]})]})}),i.jsx("div",{className:"px-3 py-2 md:hidden",children:i.jsxs("button",{className:"flex h-11 w-full items-center gap-3 rounded-xl border border-blue-200/60 bg-blue-50/80 px-3.5 transition-all active:scale-[0.98] dark:border-blue-700/40 dark:bg-blue-900/15",onClick:a,children:[i.jsxs("div",{className:"relative flex-shrink-0",children:[i.jsx(Vv,{className:"w-4.5 h-4.5 text-blue-500 dark:text-blue-400"}),i.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-1.5 w-1.5 animate-pulse rounded-full bg-blue-500"})]}),i.jsxs("div",{className:"min-w-0 flex-1 text-left",children:[i.jsx("span",{className:"block truncate text-sm font-medium text-blue-600 dark:text-blue-300",children:t?.title||`v${r}`}),i.jsx("span",{className:"text-xs text-blue-500/70 dark:text-blue-400/60",children:o("version.updateAvailable")})]})]})})]}),i.jsx("div",{className:"nav-divider"}),i.jsx("div",{className:"hidden px-2 pt-1.5 md:block",children:i.jsxs("a",{href:fw,target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground",children:[i.jsx(ml,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"text-sm",children:o("actions.reportIssue")})]})}),i.jsx("div",{className:"hidden px-2 md:block",children:i.jsxs("a",{href:gw,target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground",children:[i.jsx(bw,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"text-sm",children:o("actions.joinCommunity")})]})}),i.jsx("div",{className:"hidden px-2 py-1.5 md:block",children:i.jsxs("button",{className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground",onClick:s,children:[i.jsx(Lt,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"text-sm",children:o("actions.settings")})]})}),i.jsx("div",{className:"hidden px-3 py-2 text-center md:block",children:i.jsxs("a",{href:dM,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-muted-foreground/40 transition-colors hover:text-muted-foreground",children:["Pixcode v",n," – ",o("branding.openSource")]})}),i.jsx("div",{className:"px-3 pt-3 md:hidden",children:i.jsxs("a",{href:fw,target:"_blank",rel:"noopener noreferrer",className:"flex h-12 w-full items-center gap-3.5 rounded-xl bg-muted/40 px-4 transition-all hover:bg-muted/60 active:scale-[0.98]",children:[i.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-xl bg-background/80",children:i.jsx(ml,{className:"w-4.5 h-4.5 text-muted-foreground"})}),i.jsx("span",{className:"text-base font-medium text-foreground",children:o("actions.reportIssue")})]})}),i.jsx("div",{className:"px-3 pt-2 md:hidden",children:i.jsxs("a",{href:gw,target:"_blank",rel:"noopener noreferrer",className:"flex h-12 w-full items-center gap-3.5 rounded-xl bg-muted/40 px-4 transition-all hover:bg-muted/60 active:scale-[0.98]",children:[i.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-xl bg-background/80",children:i.jsx(bw,{className:"w-4.5 h-4.5 text-muted-foreground"})}),i.jsx("span",{className:"text-base font-medium text-foreground",children:o("actions.joinCommunity")})]})}),i.jsx("div",{className:"px-3 pb-3 pt-2 md:hidden",children:i.jsxs("button",{className:"flex h-12 w-full items-center gap-3.5 rounded-xl bg-muted/40 px-4 transition-all hover:bg-muted/60 active:scale-[0.98]",onClick:s,children:[i.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-xl bg-background/80",children:i.jsx(Lt,{className:"w-4.5 h-4.5 text-muted-foreground"})}),i.jsx("span",{className:"text-base font-medium text-foreground",children:o("actions.settings")})]})})]})}const xw="PIXCODE_GITHUB_STARS",yw="PIXCODE_HIDE_GITHUB_STAR",pM=3600*1e3,mM=(e,t)=>{const[r,n]=h.useState(null),[a,s]=h.useState(()=>{try{return localStorage.getItem(yw)==="true"}catch{return!1}});h.useEffect(()=>{if(a)return;try{const d=localStorage.getItem(xw);if(d){const u=JSON.parse(d);if(Date.now()-u.timestamp<pM){n(u.count);return}}}catch{}(async()=>{try{const d=await fetch(`https://api.github.com/repos/${e}/${t}`);if(!d.ok)return;const p=(await d.json()).stargazers_count;if(typeof p=="number"){n(p);try{localStorage.setItem(xw,JSON.stringify({count:p,timestamp:Date.now()}))}catch{}}}catch{}})()},[e,t,a]);const o=h.useCallback(()=>{s(!0);try{localStorage.setItem(yw,"true")}catch{}},[]),l=r!==null?r>=1e3?`${(r/1e3).toFixed(1)}k`:`${r}`:null;return{starCount:r,formattedCount:l,isDismissed:a,dismiss:o}},hM="https://github.com/alicomert/pixcode";function fM({className:e}){return i.jsx("svg",{className:e,fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:i.jsx("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"})})}function gM(){const{formattedCount:e,isDismissed:t,dismiss:r}=mM("alicomert","pixcode");return t?null:i.jsxs("div",{className:"group/star relative hidden md:block",children:[i.jsxs("a",{href:hM,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-lg border border-border/50 bg-muted/30 px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground",children:[i.jsx(fM,{className:"h-3.5 w-3.5"}),i.jsx(Is,{className:"h-3 w-3"}),i.jsx("span",{className:"font-medium",children:"Star"}),e&&i.jsx("span",{className:"border-l border-border/50 pl-1.5 tabular-nums",children:e})]}),i.jsx("button",{onClick:n=>{n.preventDefault(),n.stopPropagation(),r()},className:"absolute -right-1.5 -top-1.5 hidden h-4 w-4 items-center justify-center rounded-full border border-border/50 bg-muted text-muted-foreground transition-colors hover:text-foreground group-hover/star:flex","aria-label":"Dismiss",children:i.jsx(xt,{className:"h-2.5 w-2.5"})})]})}function vw({value:e,onChange:t,t:r}){const n="flex flex-1 items-center justify-center gap-1 rounded-md px-2 py-1 text-[11px] font-medium transition-all";return i.jsxs("div",{role:"tablist","aria-label":r("tooltips.historyView",{defaultValue:"History view"}),className:"flex rounded-lg bg-muted/40 p-0.5",children:[i.jsxs("button",{type:"button",role:"tab","aria-selected":e==="flat",onClick:()=>t("flat"),className:ue(n,e==="flat"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),title:r("tooltips.historyViewFlat",{defaultValue:"Recent conversations"}),children:[i.jsx(pl,{className:"h-3 w-3"}),r("historyView.flat",{defaultValue:"Recent"})]}),i.jsxs("button",{type:"button",role:"tab","aria-selected":e==="grouped",onClick:()=>t("grouped"),className:ue(n,e==="grouped"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),title:r("tooltips.historyViewGrouped",{defaultValue:"Grouped by project"}),children:[i.jsx(ED,{className:"h-3 w-3"}),r("historyView.grouped",{defaultValue:"By project"})]})]})}function bM({isPWA:e,isMobile:t,isLoading:r,projectsCount:n,searchFilter:a,onSearchFilterChange:s,onClearSearchFilter:o,searchMode:l,onSearchModeChange:c,onRefresh:d,isRefreshing:u,onCreateProject:p,onQuickStartSession:f,onCollapseSidebar:m,historyView:g,onHistoryViewChange:b,t:x}){const y=()=>i.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[i.jsx("svg",{className:"h-6 w-6 flex-shrink-0",viewBox:"0 0 500 500","aria-hidden":"true",children:i.jsx("g",{transform:"translate(250 250) scale(1.25) translate(-250 -250)",children:i.jsxs("g",{transform:"translate(0 500) scale(0.1 -0.1)",fill:"#5C3FFC",children:[i.jsx("path",{d:"M2037 3800 c-104 -40 -191 -134 -231 -250 -23 -67 -20 -82 22 -109 31 -20 287 -177 1009 -618 40 -24 82 -56 93 -70 27 -34 27 -102 0 -136 -11 -13 -106 -78 -212 -143 -106 -64 -201 -124 -210 -132 -16 -14 -18 -41 -18 -302 0 -291 2 -310 38 -310 16 0 267 148 610 359 180 111 270 173 310 213 216 217 215 574 -3 793 -37 38 -107 89 -185 136 -69 42 -253 154 -410 249 -434 264 -509 307 -563 326 -57 20 -191 17 -250 -6z"}),i.jsx("path",{d:"M1803 2994 c-10 -5 -13 -156 -13 -709 0 -671 1 -706 20 -767 27 -89 93 -184 167 -240 89 -67 157 -90 281 -96 92 -4 105 -2 117 14 12 16 14 134 15 735 0 669 -1 718 -17 737 -20 23 -514 322 -541 327 -9 2 -23 2 -29 -1z"})]})})}),i.jsx("h1",{className:"truncate text-sm font-semibold tracking-tight text-foreground",children:x("app.title")})]});return i.jsxs("div",{className:"flex-shrink-0",children:[i.jsxs("div",{className:"hidden px-4 pb-3 pt-4 md:block",style:{},children:[i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx(y,{}),i.jsxs("div",{className:"flex flex-shrink-0 items-center gap-0.5",children:[i.jsx(_e,{variant:"ghost",size:"sm",className:"h-8 w-8 rounded-lg p-0 text-muted-foreground hover:bg-accent/80 hover:text-foreground",onClick:d,disabled:u,title:x("tooltips.refresh"),children:i.jsx(ht,{className:`h-4 w-4 ${u?"animate-spin":""}`})}),i.jsx(_e,{variant:"ghost",size:"sm",className:"h-8 w-8 rounded-lg p-0 text-muted-foreground hover:bg-accent/80 hover:text-foreground",onClick:p,title:x("tooltips.createProject"),children:i.jsx(Ut,{className:"h-4 w-4"})}),i.jsx(_e,{variant:"ghost",size:"sm",className:"h-8 w-8 rounded-lg p-0 text-muted-foreground hover:bg-accent/80 hover:text-foreground",onClick:m,title:x("tooltips.hideSidebar"),children:i.jsx(bD,{className:"h-4 w-4"})})]})]}),i.jsx(gM,{}),f&&i.jsxs("button",{type:"button",onClick:()=>{f()},className:"mt-2.5 flex w-full items-center justify-center gap-2 rounded-lg border border-primary/20 bg-primary/5 px-3 py-2 text-sm font-medium text-primary transition-colors hover:bg-primary/10",children:[i.jsx(Na,{className:"h-4 w-4"}),x("sidebar.newChat",{defaultValue:"New chat"})]}),n>0&&!r&&i.jsxs("div",{className:"mt-2.5 space-y-2",children:[i.jsx(vw,{value:g,onChange:b,t:x}),i.jsxs("div",{className:"flex rounded-lg bg-muted/50 p-0.5",children:[i.jsxs("button",{onClick:()=>c("projects"),"aria-pressed":l==="projects",className:ue("flex-1 flex items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium transition-all",l==="projects"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[i.jsx(Pn,{className:"h-3 w-3"}),x("search.modeProjects")]}),i.jsxs("button",{onClick:()=>c("conversations"),"aria-pressed":l==="conversations",className:ue("flex-1 flex items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium transition-all",l==="conversations"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[i.jsx(na,{className:"h-3 w-3"}),x("search.modeConversations")]})]}),i.jsxs("div",{className:"relative",children:[i.jsx(Ea,{className:"pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/50"}),i.jsx(Nt,{type:"text",placeholder:x(l==="conversations"?"search.conversationsPlaceholder":"projects.searchPlaceholder"),value:a,onChange:v=>s(v.target.value),className:"nav-search-input h-9 rounded-xl border-0 pl-9 pr-8 text-sm transition-all duration-200 placeholder:text-muted-foreground/40 focus-visible:ring-0 focus-visible:ring-offset-0"}),a&&i.jsx("button",{onClick:o,"aria-label":x("tooltips.clearSearch"),className:"absolute right-2.5 top-1/2 -translate-y-1/2 rounded-md p-0.5 hover:bg-accent",children:i.jsx(xt,{className:"h-3 w-3 text-muted-foreground"})})]})]})]}),i.jsx("div",{className:"nav-divider hidden md:block"}),i.jsxs("div",{className:"p-3 pb-2 md:hidden",style:e&&t?{paddingTop:"16px"}:{},children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(y,{}),i.jsxs("div",{className:"flex flex-shrink-0 gap-1.5",children:[i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-muted/50 transition-all active:scale-95",onClick:d,disabled:u,children:i.jsx(ht,{className:`h-4 w-4 text-muted-foreground ${u?"animate-spin":""}`})}),i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-primary/90 text-primary-foreground transition-all active:scale-95",onClick:p,children:i.jsx(ai,{className:"h-4 w-4"})})]})]}),n>0&&!r&&i.jsxs("div",{className:"mt-2.5 space-y-2",children:[l==="projects"&&i.jsx(vw,{value:g,onChange:b,t:x}),i.jsxs("div",{className:"flex rounded-lg bg-muted/50 p-0.5",children:[i.jsxs("button",{onClick:()=>c("projects"),"aria-pressed":l==="projects",className:ue("flex-1 flex items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium transition-all",l==="projects"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[i.jsx(Pn,{className:"h-3 w-3"}),x("search.modeProjects")]}),i.jsxs("button",{onClick:()=>c("conversations"),"aria-pressed":l==="conversations",className:ue("flex-1 flex items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-xs font-medium transition-all",l==="conversations"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[i.jsx(na,{className:"h-3 w-3"}),x("search.modeConversations")]})]}),i.jsxs("div",{className:"relative",children:[i.jsx(Ea,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground/50"}),i.jsx(Nt,{type:"text",placeholder:x(l==="conversations"?"search.conversationsPlaceholder":"projects.searchPlaceholder"),value:a,onChange:v=>s(v.target.value),className:"nav-search-input h-10 rounded-xl border-0 pl-10 pr-9 text-sm transition-all duration-200 placeholder:text-muted-foreground/40 focus-visible:ring-0 focus-visible:ring-offset-0"}),a&&i.jsx("button",{onClick:o,"aria-label":x("tooltips.clearSearch"),className:"absolute right-2.5 top-1/2 -translate-y-1/2 rounded-md p-1 hover:bg-accent",children:i.jsx(xt,{className:"h-3.5 w-3.5 text-muted-foreground"})})]})]})]}),i.jsx("div",{className:"nav-divider md:hidden"})]})}const xM=160,ww=180;function BN({actions:e,className:t,triggerLabel:r}){const[n,a]=h.useState(!1),[s,o]=h.useState(null),l=h.useRef(null),c=h.useRef(null);h.useLayoutEffect(()=>{if(!n||!l.current)return;const u=l.current.getBoundingClientRect();let p=u.right-xM;p<8&&(p=8);let f=u.bottom+4;f+ww>window.innerHeight&&(f=Math.max(8,u.top-4-ww)),o({top:f,left:p})},[n]),h.useEffect(()=>{if(!n)return;const u=m=>{const g=m.target;l.current?.contains(g)||c.current?.contains(g)||a(!1)},p=m=>{m.key==="Escape"&&a(!1)},f=()=>a(!1);return document.addEventListener("mousedown",u),document.addEventListener("keydown",p),window.addEventListener("scroll",f,!0),window.addEventListener("resize",f),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",p),window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f)}},[n]);const d=u=>p=>{p.stopPropagation(),p.preventDefault(),a(!1),u.onClick()};return i.jsxs(i.Fragment,{children:[i.jsx("button",{ref:l,type:"button","aria-haspopup":"menu","aria-expanded":n,"aria-label":r||"Actions",title:r||"Actions",onClick:u=>{u.stopPropagation(),u.preventDefault(),a(p=>!p)},className:ue("flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground","opacity-0 transition-all duration-150 hover:bg-accent hover:text-foreground","group-hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary","touch:opacity-100",n&&"bg-accent text-foreground opacity-100",t),children:i.jsx(LD,{className:"h-3.5 w-3.5"})}),n&&s&&Bd.createPortal(i.jsx("div",{ref:c,role:"menu",style:{position:"fixed",top:s.top,left:s.left,zIndex:9999},className:ue("w-40 rounded-xl border border-border/60 bg-popover p-1 shadow-lg","animate-in fade-in-0 zoom-in-95 duration-100"),onClick:u=>u.stopPropagation(),onMouseDown:u=>u.stopPropagation(),children:e.map((u,p)=>{const f=u.icon,m=e[p-1],g=p>0&&u.danger&&!m?.danger;return i.jsxs("div",{children:[g&&i.jsx("div",{className:"my-1 h-px bg-border/60"}),i.jsxs("button",{type:"button",role:"menuitem",onClick:d(u),className:ue("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs",u.danger?"text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-900/20":"text-foreground hover:bg-accent"),children:[i.jsx(f,{className:"h-3 w-3"}),u.label]})]},u.id)})}),document.body)]})}const kw={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},yM={xs:"p-0.5",sm:"p-1",md:"p-1.5",lg:"p-2"},vM=e=>e==="fully-configured"?{icon:ra,colorClassName:"text-green-500 dark:text-green-400",backgroundClassName:"bg-green-50 dark:bg-green-950",label:"TaskMaster Ready",title:"TaskMaster fully configured with MCP server"}:e==="taskmaster-only"?{icon:Lt,colorClassName:"text-blue-500 dark:text-blue-400",backgroundClassName:"bg-blue-50 dark:bg-blue-950",label:"TaskMaster Init",title:"TaskMaster initialized, MCP server needs setup"}:e==="mcp-only"?{icon:En,colorClassName:"text-amber-500 dark:text-amber-400",backgroundClassName:"bg-amber-50 dark:bg-amber-950",label:"MCP Ready",title:"MCP server configured, TaskMaster needs initialization"}:{icon:xt,colorClassName:"text-gray-400 dark:text-gray-500",backgroundClassName:"bg-gray-50 dark:bg-gray-900",label:"No TaskMaster",title:"TaskMaster not configured"};function wM({status:e="not-configured",size:t="sm",className:r="",showLabel:n=!1}){const a=vM(e),s=a.icon;return n?i.jsxs("div",{className:ue("inline-flex items-center gap-1.5 text-xs rounded-md px-2 py-1 transition-colors",a.backgroundClassName,a.colorClassName,r),title:a.title,children:[i.jsx(s,{className:kw[t]}),i.jsx("span",{className:"font-medium",children:a.label})]}):i.jsx("div",{className:ue("inline-flex items-center justify-center rounded-full transition-colors",a.backgroundClassName,yM[t],r),title:a.title,children:i.jsx(s,{className:ue(kw[t],a.colorClassName)})})}const kM=(e,t,r)=>{const n=new Date(e),a=t;if(isNaN(n.getTime()))return r?r("status.unknown"):"Unknown";const s=a.getTime()-n.getTime(),o=Math.floor(s/1e3),l=Math.floor(s/(1e3*60)),c=Math.floor(s/(1e3*60*60)),d=Math.floor(s/(1e3*60*60*24));return o<60?r?r("time.justNow"):"Just now":l===1?r?r("time.oneMinuteAgo"):"1 min ago":l<60?r?r("time.minutesAgo",{count:l}):`${l} mins ago`:c===1?r?r("time.oneHourAgo"):"1 hour ago":c<24?r?r("time.hoursAgo",{count:c}):`${c} hours ago`:d===1?r?r("time.oneDayAgo"):"1 day ago":d<7?r?r("time.daysAgo",{count:d}):`${d} days ago`:n.toLocaleDateString()};function Sw({isStarred:e,canDelete:t,onRename:r,onToggleStar:n,onDelete:a,t:s,className:o}){const l=d=>i.jsx(Is,{className:`${d.className??""} ${e?"fill-yellow-400 text-yellow-500":""}`}),c=[{id:"rename",label:s("actions.rename"),icon:AD,onClick:r},{id:"star",label:e?s("actions.unstarSession",{defaultValue:"Remove star"}):s("actions.starSession",{defaultValue:"Star"}),icon:l,onClick:n}];return t&&c.push({id:"delete",label:s("actions.delete"),icon:kr,onClick:a,danger:!0}),i.jsx(BN,{actions:c,className:o,triggerLabel:s("tooltips.sessionActions",{defaultValue:"Session actions"})})}const SM={claude:"Claude",cursor:"Cursor",codex:"Codex",gemini:"Gemini",qwen:"Qwen Code",opencode:"OpenCode"},Ew={claude:"bg-orange-500/10 text-orange-600 dark:bg-orange-400/10 dark:text-orange-300 ring-1 ring-orange-500/15",cursor:"bg-sky-500/10 text-sky-600 dark:bg-sky-400/10 dark:text-sky-300 ring-1 ring-sky-500/15",codex:"bg-violet-500/10 text-violet-600 dark:bg-violet-400/10 dark:text-violet-300 ring-1 ring-violet-500/15",gemini:"bg-emerald-500/10 text-emerald-600 dark:bg-emerald-400/10 dark:text-emerald-300 ring-1 ring-emerald-500/15",qwen:"bg-amber-500/10 text-amber-600 dark:bg-amber-400/10 dark:text-amber-300 ring-1 ring-amber-500/15",opencode:"bg-teal-500/10 text-teal-600 dark:bg-teal-400/10 dark:text-teal-300 ring-1 ring-teal-500/15"};function $N({project:e,session:t,selectedSession:r,currentTime:n,editingSession:a,editingSessionName:s,isStarred:o,compact:l=!1,onEditingSessionNameChange:c,onStartEditingSession:d,onCancelEditingSession:u,onSaveEditingSession:p,onToggleStarSession:f,onProjectSelect:m,onSessionSelect:g,onDeleteSession:b,t:x}){const y=i9(t,n,x),v=r?.id===t.id,w=a===t.id,k=t.__provider,E=SM[k]??k,S=Ew[k]??Ew.claude,j=r9(y.sessionName),_=()=>{m(e),g(t,e.name)},T=()=>{p(e.name,t.id,s,k)},C=()=>{b(e.name,t.id,y.sessionName,k)},L=()=>d(t.id,y.sessionName),A=()=>f(e.name,t.id),I=i.jsxs("div",{className:"mt-0.5 flex min-w-0 flex-wrap items-center gap-1 text-[10px] leading-tight",children:[i.jsxs("span",{className:ue("inline-flex items-center gap-1 rounded-full px-1.5 py-px font-medium",S),children:[i.jsx(dr,{provider:k,className:"h-2.5 w-2.5"}),E]}),i.jsx("span",{className:"text-muted-foreground/80",children:kM(y.sessionTime,n,x)}),y.isActive&&i.jsxs("span",{className:"inline-flex items-center gap-1 text-green-600 dark:text-green-400",children:[i.jsx("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),x("status.active",{defaultValue:"Active"})]}),j.slice(0,3).map(z=>i.jsxs("span",{className:"rounded-md bg-muted/60 px-1 py-px font-mono text-[9px] uppercase tracking-wide text-muted-foreground ring-1 ring-border/40",children:[".",z]},z))]}),N=i.jsxs(i.Fragment,{children:[i.jsx("input",{type:"text",value:s,onChange:z=>c(z.target.value),onKeyDown:z=>{z.stopPropagation(),z.key==="Enter"?T():z.key==="Escape"&&u()},onClick:z=>z.stopPropagation(),className:"w-full rounded-md border border-primary/40 bg-background px-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-primary",autoFocus:!0}),i.jsx("button",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-green-50 hover:bg-green-100 dark:bg-green-900/20 dark:hover:bg-green-900/40",onClick:z=>{z.stopPropagation(),T()},title:x("tooltips.save"),children:i.jsx(rr,{className:"h-3 w-3 text-green-600 dark:text-green-400"})}),i.jsx("button",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-gray-50 hover:bg-gray-100 dark:bg-gray-900/20 dark:hover:bg-gray-900/40",onClick:z=>{z.stopPropagation(),u()},title:x("tooltips.cancel"),children:i.jsx(xt,{className:"h-3 w-3 text-gray-600 dark:text-gray-400"})})]}),P=i.jsx("div",{className:"md:hidden",children:i.jsx("div",{className:ue("relative mx-3 my-0.5 rounded-lg border border-border/30 bg-card p-2 transition-all duration-150 active:scale-[0.98]",v&&"border-primary/30 bg-primary/5 shadow-sm",!v&&y.isActive&&"border-green-500/25 bg-green-50/5 dark:bg-green-900/5",o&&!v&&"ring-1 ring-yellow-300/50 dark:ring-yellow-500/30"),onClick:w?void 0:_,children:w?i.jsx("div",{className:"flex items-center gap-1",children:N}):i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:ue("flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-md",v?"bg-primary/10":"bg-muted/60"),children:i.jsx(dr,{provider:k,className:"h-3 w-3"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[o&&i.jsx("span",{className:"text-yellow-500","aria-hidden":!0,children:"★"}),i.jsx("span",{className:"truncate text-xs font-medium text-foreground",children:y.sessionName})]}),I]}),i.jsx("div",{className:"flex-shrink-0",onClick:z=>z.stopPropagation(),children:i.jsx(Sw,{isStarred:o,canDelete:!y.isCursorSession,onRename:L,onToggleStar:A,onDelete:C,t:x,className:"!opacity-100"})})]})})}),H=i.jsxs("div",{className:ue("group/item relative hidden md:block"),children:[i.jsxs(_e,{variant:"ghost",className:ue("relative h-auto w-full justify-start overflow-hidden p-0 text-left font-normal transition-colors duration-150","hover:bg-accent/60",v&&"bg-accent text-accent-foreground",o&&!v&&"bg-yellow-50/40 hover:bg-yellow-100/40 dark:bg-yellow-900/10 dark:hover:bg-yellow-900/20",l?"rounded-xl px-3 py-2.5":"rounded-lg px-3 py-2"),onClick:w?void 0:()=>g(t,e.name),children:[v&&i.jsx("span",{"aria-hidden":!0,className:"absolute left-0 top-1/2 h-5 w-0.5 -translate-y-1/2 rounded-r bg-primary"}),!v&&!w&&i.jsx("span",{"aria-hidden":!0,className:"session-item-accent"}),i.jsxs("div",{className:"flex w-full min-w-0 items-start gap-2 pr-6",children:[i.jsx("div",{className:ue("mt-0.5 flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-md",v?"bg-primary/10":"bg-muted/50 group-hover/item:bg-muted/80"),children:i.jsx(dr,{provider:k,className:"h-3 w-3"})}),i.jsx("div",{className:"min-w-0 flex-1",children:w?i.jsx("div",{className:"flex items-center gap-1",children:N}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[o&&i.jsx("span",{className:"flex-shrink-0 text-yellow-500","aria-hidden":!0,children:"★"}),i.jsx("span",{className:"truncate text-xs font-medium text-foreground",children:y.sessionName})]}),I]})})]})]}),!w&&i.jsx("div",{className:"absolute right-1.5 top-1/2 -translate-y-1/2",onClick:z=>z.stopPropagation(),children:i.jsx(Sw,{isStarred:o,canDelete:!y.isCursorSession,onRename:L,onToggleStar:A,onDelete:C,t:x,className:"opacity-0 focus-visible:opacity-100 group-hover/item:opacity-100"})})]});return i.jsxs("div",{className:"group relative",children:[P,H]})}const EM=e=>e==="claude-code"?"claude":e==="codex"?"codex":e==="gemini"?"gemini":e==="qwen"?"qwen":e==="opencode"?"opencode":null;function NM(){return i.jsx(i.Fragment,{children:Array.from({length:3}).map((e,t)=>i.jsx("div",{className:"rounded-md p-2",children:i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx("div",{className:"mt-0.5 h-3 w-3 animate-pulse rounded-full bg-muted"}),i.jsxs("div",{className:"flex-1 space-y-1",children:[i.jsx("div",{className:"h-3 animate-pulse rounded bg-muted",style:{width:`${60+t*15}%`}}),i.jsx("div",{className:"h-2 w-1/2 animate-pulse rounded bg-muted"})]})]})},t))})}function CM({project:e,isExpanded:t,sessions:r,selectedSession:n,initialSessionsLoaded:a,isLoadingSessions:s,currentTime:o,editingSession:l,editingSessionName:c,isSessionStarred:d,onEditingSessionNameChange:u,onStartEditingSession:p,onCancelEditingSession:f,onSaveEditingSession:m,onToggleStarSession:g,onProjectSelect:b,onSessionSelect:x,onDeleteSession:y,onLoadMoreSessions:v,onNewSession:w,onOpenOrchestration:k,t:E}){const[S,j]=h.useState([]);if(h.useEffect(()=>{if(!t)return;let C=!1;const L=async()=>{const I=await ve(`/api/orchestration/workflows/runs?projectId=${encodeURIComponent(e.name)}`);if(!I.ok)return;const N=await I.json();C||j((N.runs??[]).slice(0,5))};L();const A=window.setInterval(()=>{L()},15e3);return()=>{C=!0,window.clearInterval(A)}},[t,e.name]),!t)return null;const _=r.length>0,T=e.sessionMeta?.hasMore===!0;return i.jsxs("div",{className:"ml-3 space-y-1 border-l border-border pl-3",children:[i.jsx("div",{className:"px-3 pb-1 pt-1 md:hidden",children:i.jsxs("button",{className:"flex h-8 w-full items-center justify-center gap-2 rounded-md bg-primary text-xs font-medium text-primary-foreground transition-all duration-150 hover:bg-primary/90 active:scale-[0.98]",onClick:()=>{b(e),w(e)},children:[i.jsx(Ut,{className:"h-3 w-3"}),E("sessions.newSession")]})}),i.jsxs(_e,{variant:"default",size:"sm",className:"hidden h-8 w-full justify-start gap-2 bg-primary text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90 md:flex",onClick:()=>w(e),children:[i.jsx(Ut,{className:"h-3 w-3"}),E("sessions.newSession")]}),S.length>0&&i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center gap-1 px-3 pt-2 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:[i.jsx(aa,{className:"h-3 w-3"}),E("orchestration.section")]}),S.map(C=>{const L=[...new Set(C.nodeRuns.map(A=>EM(A.adapterId)).filter(Boolean))];return i.jsx("button",{type:"button",onClick:()=>k?.(e,C.id),className:"w-full rounded-lg px-3 py-2 text-left transition-colors hover:bg-accent/60",children:i.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[i.jsx(aa,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-primary"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"truncate text-xs font-medium text-foreground",children:C.input||E("orchestration.fallbackTitle")}),i.jsxs("div",{className:"mt-1 flex items-center gap-1",children:[L.slice(0,4).map(A=>i.jsx("span",{className:"flex h-4 w-4 items-center justify-center rounded bg-muted",children:i.jsx(dr,{provider:A,className:"h-3 w-3"})},A)),i.jsx("span",{className:"text-[10px] text-muted-foreground",children:E(`common:orchestration.status.${C.status}`,{defaultValue:C.status})})]})]})]})},C.id)})]}),a?!_&&!s?i.jsx("div",{className:"px-3 py-2 text-left",children:i.jsx("p",{className:"text-xs text-muted-foreground",children:E("sessions.noSessions")})}):r.map(C=>i.jsx($N,{project:e,session:C,selectedSession:n,currentTime:o,editingSession:l,editingSessionName:c,isStarred:d(e.name,C.id),onEditingSessionNameChange:u,onStartEditingSession:p,onCancelEditingSession:f,onSaveEditingSession:m,onToggleStarSession:g,onProjectSelect:b,onSessionSelect:x,onDeleteSession:y,t:E},C.id)):i.jsx(NM,{}),_&&T&&i.jsx(_e,{variant:"ghost",size:"sm",className:"mt-2 w-full justify-center gap-2 text-muted-foreground",onClick:()=>v(e),disabled:s,children:s?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"h-3 w-3 animate-spin rounded-full border border-muted-foreground border-t-transparent"}),E("sessions.loading")]}):i.jsxs(i.Fragment,{children:[i.jsx(Pr,{className:"h-3 w-3"}),E("sessions.showMore")]})})]})}const AM=(e,t)=>{const r=e.length;return t&&r>=5?`${r}+`:`${r}`};function TM({project:e,selectedProject:t,selectedSession:r,isExpanded:n,isDeleting:a,isStarred:s,editingProject:o,editingName:l,sessions:c,initialSessionsLoaded:d,isLoadingSessions:u,currentTime:p,editingSession:f,editingSessionName:m,tasksEnabled:g,mcpServerStatus:b,isSessionStarred:x,onEditingNameChange:y,onToggleProject:v,onProjectSelect:w,onToggleStarProject:k,onToggleStarSession:E,onStartEditingProject:S,onCancelEditingProject:j,onSaveProjectName:_,onDeleteProject:T,onSessionSelect:C,onDeleteSession:L,onLoadMoreSessions:A,onNewSession:I,onOpenOrchestration:N,onEditingSessionNameChange:P,onStartEditingSession:H,onCancelEditingSession:z,onSaveEditingSession:U,t:V}){const O=t?.name===e.name,G=o===e.name,$=e.sessionMeta?.hasMore===!0,F=AM(c,$),te=`${F} session${c.length===1?"":"s"}`,Q=l9(e,b),ge=()=>v(e.name),ae=()=>k(e.name),me=()=>{_(e.name)},pe=()=>{t?.name!==e.name&&w(e),ge()};return i.jsxs("div",{className:ue("md:space-y-1",a&&"opacity-50 pointer-events-none"),children:[i.jsxs("div",{className:"md:group group",children:[i.jsx("div",{className:"md:hidden",children:i.jsx("div",{className:ue("p-3 mx-3 my-1 rounded-lg bg-card border border-border/50 active:scale-[0.98] transition-all duration-150",O&&"bg-primary/5 border-primary/20",s&&!O&&"bg-yellow-50/50 dark:bg-yellow-900/5 border-yellow-200/30 dark:border-yellow-800/30"),onClick:ge,children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[i.jsx("div",{className:ue("w-8 h-8 rounded-lg flex items-center justify-center transition-colors",n?"bg-primary/10":"bg-muted"),children:n?i.jsx(Sa,{className:"h-4 w-4 text-primary"}):i.jsx(Pn,{className:"h-4 w-4 text-muted-foreground"})}),i.jsx("div",{className:"min-w-0 flex-1",children:G?i.jsx("input",{type:"text",value:l,onChange:be=>y(be.target.value),className:"w-full rounded-lg border-2 border-primary/40 bg-background px-3 py-2 text-sm text-foreground shadow-sm transition-all duration-200 focus:border-primary focus:shadow-md focus:outline-none",placeholder:V("projects.projectNamePlaceholder"),autoFocus:!0,autoComplete:"off",onClick:be=>be.stopPropagation(),onKeyDown:be=>{be.key==="Enter"&&me(),be.key==="Escape"&&j()},style:{fontSize:"16px",WebkitAppearance:"none",borderRadius:"8px"}}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex min-w-0 flex-1 items-center justify-between",children:[i.jsx("h3",{className:"truncate text-sm font-medium text-foreground",children:e.displayName}),g&&i.jsx(wM,{status:Q,size:"xs",className:"ml-2 hidden flex-shrink-0 md:inline-flex"})]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:te})]})})]}),i.jsx("div",{className:"flex items-center gap-1",children:G?i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-green-500 shadow-sm transition-all duration-150 active:scale-90 active:shadow-none dark:bg-green-600",onClick:be=>{be.stopPropagation(),me()},children:i.jsx(rr,{className:"h-4 w-4 text-white"})}),i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-gray-500 shadow-sm transition-all duration-150 active:scale-90 active:shadow-none dark:bg-gray-600",onClick:be=>{be.stopPropagation(),j()},children:i.jsx(xt,{className:"h-4 w-4 text-white"})})]}):i.jsxs(i.Fragment,{children:[i.jsx("button",{className:ue("w-8 h-8 rounded-lg flex items-center justify-center active:scale-90 transition-all duration-150 border",s?"bg-yellow-500/10 dark:bg-yellow-900/30 border-yellow-200 dark:border-yellow-800":"bg-gray-500/10 dark:bg-gray-900/30 border-gray-200 dark:border-gray-800"),onClick:be=>{be.stopPropagation(),ae()},title:V(s?"tooltips.removeFromFavorites":"tooltips.addToFavorites"),children:i.jsx(Is,{className:ue("w-4 h-4 transition-colors",s?"text-yellow-600 dark:text-yellow-400 fill-current":"text-gray-600 dark:text-gray-400")})}),i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg border border-red-200 bg-red-500/10 active:scale-90 dark:border-red-800 dark:bg-red-900/30",onClick:be=>{be.stopPropagation(),T(e)},children:i.jsx(kr,{className:"h-4 w-4 text-red-600 dark:text-red-400"})}),i.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-lg border border-primary/20 bg-primary/10 active:scale-90 dark:border-primary/30 dark:bg-primary/20",onClick:be=>{be.stopPropagation(),S(e)},children:i.jsx(Um,{className:"h-4 w-4 text-primary"})}),i.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-muted/30",children:n?i.jsx(Pr,{className:"h-3 w-3 text-muted-foreground"}):i.jsx(An,{className:"h-3 w-3 text-muted-foreground"})})]})})]})})}),i.jsxs(_e,{variant:"ghost",className:ue("hidden md:flex w-full justify-between p-2 h-auto font-normal hover:bg-accent/50",O&&"bg-accent text-accent-foreground",s&&!O&&"bg-yellow-50/50 dark:bg-yellow-900/10 hover:bg-yellow-100/50 dark:hover:bg-yellow-900/20"),onClick:pe,children:[i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[n?i.jsx(Sa,{className:"h-4 w-4 flex-shrink-0 text-primary"}):i.jsx(Pn,{className:"h-4 w-4 flex-shrink-0 text-muted-foreground"}),i.jsx("div",{className:"min-w-0 flex-1 text-left",children:G?i.jsxs("div",{className:"space-y-1",children:[i.jsx("input",{type:"text",value:l,onChange:be=>y(be.target.value),className:"w-full rounded border border-border bg-background px-2 py-1 text-sm text-foreground focus:ring-2 focus:ring-primary/20",placeholder:V("projects.projectNamePlaceholder"),autoFocus:!0,onKeyDown:be=>{be.key==="Enter"&&me(),be.key==="Escape"&&j()}}),i.jsx("div",{className:"truncate text-xs text-muted-foreground",title:e.fullPath,children:e.fullPath})]}):i.jsxs("div",{children:[i.jsx("div",{className:"truncate text-sm font-semibold text-foreground",title:e.displayName,children:e.displayName}),i.jsxs("div",{className:"text-xs text-muted-foreground",children:[F,e.fullPath!==e.displayName&&i.jsxs("span",{className:"ml-1 opacity-60",title:e.fullPath,children:[" - ",e.fullPath.length>25?`...${e.fullPath.slice(-22)}`:e.fullPath]})]})]})})]}),i.jsx("div",{className:"flex flex-shrink-0 items-center gap-1",children:G?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex h-6 w-6 cursor-pointer items-center justify-center rounded text-green-600 transition-colors hover:bg-green-50 hover:text-green-700 dark:hover:bg-green-900/20",onClick:be=>{be.stopPropagation(),me()},children:i.jsx(rr,{className:"h-3 w-3"})}),i.jsx("div",{className:"flex h-6 w-6 cursor-pointer items-center justify-center rounded text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700 dark:hover:bg-gray-800",onClick:be=>{be.stopPropagation(),j()},children:i.jsx(xt,{className:"h-3 w-3"})})]}):i.jsxs(i.Fragment,{children:[s&&i.jsx("div",{className:"flex h-6 w-6 cursor-pointer items-center justify-center rounded hover:bg-yellow-50 dark:hover:bg-yellow-900/20",onClick:be=>{be.stopPropagation(),ae()},title:V("tooltips.removeFromFavorites"),children:i.jsx(Is,{className:"h-3 w-3 fill-current text-yellow-600 dark:text-yellow-400"})}),i.jsx(BN,{triggerLabel:V("tooltips.projectActions",{defaultValue:"Project actions"}),actions:[{id:"rename",label:V("actions.rename"),icon:Um,onClick:()=>S(e)},{id:"star",label:V(s?"tooltips.removeFromFavorites":"tooltips.addToFavorites"),icon:Is,onClick:ae},{id:"delete",label:V("actions.delete",{defaultValue:"Delete"}),icon:kr,onClick:()=>T(e),danger:!0}]}),n?i.jsx(Pr,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"}):i.jsx(An,{className:"h-4 w-4 text-muted-foreground transition-colors group-hover:text-foreground"})]})})]})]}),i.jsx(CM,{project:e,isExpanded:n,sessions:c,selectedSession:r,initialSessionsLoaded:d,isLoadingSessions:u,currentTime:p,editingSession:f,editingSessionName:m,isSessionStarred:x,onEditingSessionNameChange:P,onStartEditingSession:H,onCancelEditingSession:z,onSaveEditingSession:U,onToggleStarSession:E,onProjectSelect:w,onSessionSelect:C,onDeleteSession:L,onLoadMoreSessions:A,onNewSession:I,onOpenOrchestration:N,t:V})]})}function UN({isLoading:e,loadingProgress:t,projectsCount:r,filteredProjectsCount:n,t:a}){return e?i.jsxs("div",{className:"px-4 py-12 text-center md:py-8",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-lg bg-muted md:mb-3",children:i.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent"})}),i.jsx("h3",{className:"mb-2 text-base font-medium text-foreground md:mb-1",children:a("projects.loadingProjects")}),t&&t.total>0?i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-muted",children:i.jsx("div",{className:"h-full bg-primary transition-all duration-300 ease-out",style:{width:`${t.current/t.total*100}%`}})}),i.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.current,"/",t.total," ",a("projects.projects")]}),t.currentProject&&i.jsx("p",{className:"mx-auto max-w-[200px] truncate text-xs text-muted-foreground/70",title:t.currentProject,children:t.currentProject.split("-").slice(-2).join("/")})]}):i.jsx("p",{className:"text-sm text-muted-foreground",children:a("projects.fetchingProjects")})]}):r===0?i.jsxs("div",{className:"px-4 py-12 text-center md:py-8",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-lg bg-muted md:mb-3",children:i.jsx(Pn,{className:"h-6 w-6 text-muted-foreground"})}),i.jsx("h3",{className:"mb-2 text-base font-medium text-foreground md:mb-1",children:a("projects.noProjects")}),i.jsx("p",{className:"text-sm text-muted-foreground",children:a("projects.runClaudeCli")})]}):n===0?i.jsxs("div",{className:"px-4 py-12 text-center md:py-8",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-lg bg-muted md:mb-3",children:i.jsx(Ea,{className:"h-6 w-6 text-muted-foreground"})}),i.jsx("h3",{className:"mb-2 text-base font-medium text-foreground md:mb-1",children:a("projects.noMatchingProjects")}),i.jsx("p",{className:"text-sm text-muted-foreground",children:a("projects.tryDifferentSearch")})]}):null}function jM({projects:e,filteredProjects:t,selectedProject:r,selectedSession:n,isLoading:a,loadingProgress:s,expandedProjects:o,editingProject:l,editingName:c,loadingSessions:d,initialSessionsLoaded:u,currentTime:p,editingSession:f,editingSessionName:m,deletingProjects:g,tasksEnabled:b,mcpServerStatus:x,getProjectSessions:y,isProjectStarred:v,isSessionStarred:w,onEditingNameChange:k,onToggleProject:E,onProjectSelect:S,onToggleStarProject:j,onToggleStarSession:_,onStartEditingProject:T,onCancelEditingProject:C,onSaveProjectName:L,onDeleteProject:A,onSessionSelect:I,onDeleteSession:N,onLoadMoreSessions:P,onNewSession:H,onOpenOrchestration:z,onEditingSessionNameChange:U,onStartEditingSession:V,onCancelEditingSession:O,onSaveEditingSession:G,t:$}){const F=i.jsx(UN,{isLoading:a,loadingProgress:s,projectsCount:e.length,filteredProjectsCount:t.length,t:$});h.useEffect(()=>{let pe="Pixcode";const be=r?.displayName?.trim();be&&(pe=`${be} - ${pe}`),document.title=pe},[r]);const te=!a&&e.length>0&&t.length>0,Q=pe=>pe.source==="history"||pe.autoDiscovered===!0&&pe.isManuallyAdded!==!0,ge=t.filter(pe=>!Q(pe)),ae=t.filter(pe=>Q(pe)),me=pe=>i.jsx(TM,{project:pe,selectedProject:r,selectedSession:n,isExpanded:o.has(pe.name),isDeleting:g.has(pe.name),isStarred:v(pe.name),editingProject:l,editingName:c,sessions:y(pe),initialSessionsLoaded:u.has(pe.name),isLoadingSessions:!!d[pe.name],currentTime:p,editingSession:f,editingSessionName:m,tasksEnabled:b,mcpServerStatus:x,isSessionStarred:w,onEditingNameChange:k,onToggleProject:E,onProjectSelect:S,onToggleStarProject:j,onToggleStarSession:_,onStartEditingProject:T,onCancelEditingProject:C,onSaveProjectName:L,onDeleteProject:A,onSessionSelect:I,onDeleteSession:N,onLoadMoreSessions:P,onNewSession:H,onOpenOrchestration:z,onEditingSessionNameChange:U,onStartEditingSession:V,onCancelEditingSession:O,onSaveEditingSession:G,t:$},pe.name);return i.jsx("div",{className:"pb-safe-area-inset-bottom md:space-y-1",children:te?i.jsxs(i.Fragment,{children:[ge.map(pe=>me(pe)),ae.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"px-3 pb-1 pt-3 text-[11px] font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",children:$("projects.detectedFromHistory")}),ae.map(pe=>me(pe))]})]}):F})}function fa(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GN(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}/*!
|
|
230
230
|
* GSAP 3.15.0
|
|
231
231
|
* https://gsap.com
|
|
232
232
|
*
|
|
@@ -846,7 +846,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
846
846
|
</svg>
|
|
847
847
|
</button>
|
|
848
848
|
`),S+="</div>",S+="</div>",p.innerHTML=S,g){const C=p.querySelector(".cm-diff-nav-prev"),L=p.querySelector(".cm-diff-nav-next");C?.addEventListener("click",()=>{if(x.length===0)return;f=f>0?f-1:x.length-1;const A=x[f];A&&u.dispatch({effects:Nn.scrollIntoView(A.fromB,{y:"center"})}),m()}),L?.addEventListener("click",()=>{if(x.length===0)return;f=f<x.length-1?f+1:0;const A=x[f];A&&u.dispatch({effects:Nn.scrollIntoView(A.fromB,{y:"center"})}),m()})}p.querySelector(".cm-toggle-diff-btn")?.addEventListener("click",a),p.querySelector(".cm-popout-btn")?.addEventListener("click",()=>{s?.()}),p.querySelector(".cm-expand-btn")?.addEventListener("click",()=>{o?.()})};return m(),{top:!0,dom:p,update:m}};return[Dj.of(d)]};function lae({content:e,linesLabel:t,charactersLabel:r,shortcutsLabel:n}){return i.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between border-t border-border bg-muted px-3 py-1.5",children:[i.jsxs("div",{className:"flex items-center gap-3 text-xs text-gray-600 dark:text-gray-400",children:[i.jsxs("span",{children:[t," ",e.split(`
|
|
849
|
-
`).length]}),i.jsxs("span",{children:[r," ",e.length]})]}),i.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:n})]})}function cae({file:e,isSidebar:t,isFullscreen:r,isMarkdownFile:n,markdownPreview:a,saving:s,saveSuccess:o,onToggleMarkdownPreview:l,onOpenSettings:c,onDownload:d,onSave:u,onToggleFullscreen:p,onClose:f,labels:m}){const g=o?m.saved:s?m.saving:m.save;return i.jsxs("div",{className:"flex min-w-0 flex-shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:[i.jsx("div",{className:"flex min-w-0 flex-1 shrink items-center gap-2",children:i.jsxs("div",{className:"min-w-0 shrink",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[i.jsx("h3",{className:"truncate text-sm font-medium text-gray-900 dark:text-white",children:e.name}),e.diffInfo&&i.jsx("span",{className:"shrink-0 whitespace-nowrap rounded bg-blue-100 px-1.5 py-0.5 text-[10px] text-blue-600 dark:bg-blue-900 dark:text-blue-300",children:m.showingChanges})]}),i.jsx("p",{className:"truncate text-xs text-gray-500 dark:text-gray-400",children:e.path})]})}),i.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[n&&i.jsx("button",{type:"button",onClick:l,className:`flex items-center justify-center rounded-md p-1.5 transition-colors ${a?"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400":"text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white"}`,title:a?m.editMarkdown:m.previewMarkdown,children:a?i.jsx(Qo,{className:"h-4 w-4"}):i.jsx(Yi,{className:"h-4 w-4"})}),i.jsx("button",{type:"button",onClick:c,className:"flex items-center justify-center rounded-md p-1.5 text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",title:m.settings,children:i.jsx(Lt,{className:"h-4 w-4"})}),i.jsx("button",{type:"button",onClick:d,className:"flex items-center justify-center rounded-md p-1.5 text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",title:m.download,children:i.jsx(ta,{className:"h-4 w-4"})}),i.jsx("button",{type:"button",onClick:u,disabled:s,className:`flex items-center justify-center rounded-md p-1.5 transition-colors disabled:opacity-50 ${o?"bg-green-50 text-green-600 dark:bg-green-900/30 dark:text-green-400":"text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white"}`,title:g,children:o?i.jsx("svg",{className:"h-4 w-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(Ll,{className:"h-4 w-4"})}),!t&&i.jsx("button",{type:"button",onClick:p,className:"flex items-center justify-center rounded-md p-1.5 text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",title:r?m.exitFullscreen:m.fullscreen,children:r?i.jsx(gE,{className:"h-4 w-4"}):i.jsx(Gd,{className:"h-4 w-4"})}),i.jsx("button",{type:"button",onClick:f,className:"flex items-center justify-center rounded-md p-1.5 text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",title:m.close,children:i.jsx(xt,{className:"h-4 w-4"})})]})]})}function dae({isDarkMode:e,isSidebar:t,loadingText:r}){return i.jsxs(i.Fragment,{children:[i.jsx("style",{children:nae(e)}),t?i.jsx("div",{className:"flex h-full w-full items-center justify-center bg-background",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-b-2 border-blue-600"}),i.jsx("span",{className:"text-gray-900 dark:text-white",children:r})]})}):i.jsx("div",{className:"fixed inset-0 z-[9999] md:flex md:items-center md:justify-center md:bg-black/50",children:i.jsx("div",{className:"code-editor-loading flex h-full w-full items-center justify-center p-8 md:h-auto md:w-auto md:rounded-lg",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-b-2 border-blue-600"}),i.jsx("span",{className:"text-gray-900 dark:text-white",children:r})]})})})]})}function uae({content:e,onChange:t,markdownPreview:r,isMarkdownFile:n,isDarkMode:a,fontSize:s,showLineNumbers:o,extensions:l}){return r&&n?i.jsx("div",{className:"h-full overflow-y-auto bg-white dark:bg-gray-900",children:i.jsx("div",{className:"prose prose-sm mx-auto max-w-none px-8 py-6 dark:prose-invert prose-headings:font-semibold prose-a:text-blue-600 prose-code:text-sm prose-pre:bg-gray-900 prose-img:rounded-lg dark:prose-a:text-blue-400",children:i.jsx(c6,{content:e})})}):i.jsx(hf,{value:e,onChange:t,extensions:l,theme:a?ff:void 0,height:"100%",style:{fontSize:`${s}px`,height:"100%"},basicSetup:{lineNumbers:o,foldGutter:!0,dropCursor:!1,allowMultipleSelections:!1,indentOnInput:!0,bracketMatching:!0,closeBrackets:!0,autocompletion:!0,highlightSelectionMatches:!0,searchKeymap:!0}})}function pae({file:e,isSidebar:t,isFullscreen:r,onClose:n,onToggleFullscreen:a,title:s,message:o}){const l=i.jsx("div",{className:"flex h-full w-full flex-col items-center justify-center bg-background p-8 text-muted-foreground",children:i.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 text-center",children:[i.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:i.jsx("svg",{className:"h-8 w-8 text-muted-foreground",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),i.jsxs("div",{children:[i.jsx("h3",{className:"mb-2 text-lg font-medium text-foreground",children:s}),i.jsx("p",{className:"text-sm text-muted-foreground",children:o})]}),i.jsx("button",{onClick:n,className:"mt-4 rounded-md bg-primary px-4 py-2 text-sm text-primary-foreground transition-colors hover:bg-primary/90",children:"Close"})]})});if(t)return i.jsxs("div",{className:"flex h-full w-full flex-col bg-background",children:[i.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between border-b border-border px-3 py-1.5",children:[i.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:i.jsx("h3",{className:"truncate text-sm font-medium text-gray-900 dark:text-white",children:e.name})}),i.jsx("button",{type:"button",onClick:n,className:"flex items-center justify-center rounded-md p-1.5 text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",title:"Close",children:i.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),l]});const c=r?"fixed inset-0 z-[9999] bg-background flex flex-col":"fixed inset-0 z-[9999] md:bg-black/50 md:flex md:items-center md:justify-center md:p-4",d=r?"bg-background flex flex-col w-full h-full":"bg-background shadow-2xl flex flex-col w-full h-full md:rounded-lg md:shadow-2xl md:w-full md:max-w-2xl md:h-auto md:max-h-[60vh]";return i.jsx("div",{className:c,children:i.jsxs("div",{className:d,children:[i.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between border-b border-border px-3 py-1.5",children:[i.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:i.jsx("h3",{className:"truncate text-sm font-medium text-gray-900 dark:text-white",children:e.name})}),i.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[i.jsx("button",{type:"button",onClick:a,className:"flex items-center justify-center rounded-md p-1.5 text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",title:r?"Exit fullscreen":"Fullscreen",children:r?i.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 9V4.5M9 9H4.5M9 9L3.5 3.5M9 15v4.5M9 15H4.5M9 15l-5.5 5.5M15 9h4.5M15 9V4.5M15 9l5.5-5.5M15 15h4.5M15 15v4.5m0-4.5l5.5 5.5"})}):i.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"})})}),i.jsx("button",{type:"button",onClick:n,className:"flex items-center justify-center rounded-md p-1.5 text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",title:"Close",children:i.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),l]})})}function f4({file:e,onClose:t,projectPath:r,isSidebar:n=!1,isExpanded:a=!1,onToggleExpand:s=null,onPopOut:o=null}){const{t:l}=Me("codeEditor"),[c,d]=h.useState(!1),[u,p]=h.useState(!!e.diffInfo),[f,m]=h.useState(!1),{isDarkMode:g,wordWrap:b,minimapEnabled:x,showLineNumbers:y,fontSize:v}=zne(),{content:w,setContent:k,loading:E,saving:S,saveSuccess:j,saveError:_,isBinary:T,handleSave:C,handleDownload:L}=Fne({file:e,projectPath:r}),A=h.useMemo(()=>{const V=e.name.split(".").pop()?.toLowerCase();return V==="md"||V==="markdown"},[e.name]),I=h.useMemo(()=>tae({file:e,showDiff:u,minimapEnabled:x,isDarkMode:g}),[e,g,x,u]),N=h.useMemo(()=>rae({file:e,showDiff:u}),[e,u]),P=h.useMemo(()=>oae({file:e,showDiff:u,isSidebar:n,isExpanded:a,onToggleDiff:()=>p(V=>!V),onPopOut:o,onToggleExpand:s,labels:{changes:l("toolbar.changes"),previousChange:l("toolbar.previousChange"),nextChange:l("toolbar.nextChange"),hideDiff:l("toolbar.hideDiff"),showDiff:l("toolbar.showDiff"),collapse:l("toolbar.collapse"),expand:l("toolbar.expand")}}),[e,a,n,o,s,u,l]),H=h.useMemo(()=>{const V=[...eae(e.name),...P];return e.diffInfo&&u&&e.diffInfo.old_string!==void 0&&(V.push(Ane({original:e.diffInfo.old_string,mergeControls:!1,highlightChanges:!0,syntaxHighlightDeletions:!1,gutter:!0})),V.push(...I),V.push(...N)),b&&V.push(Nn.lineWrapping),V},[e.diffInfo,e.name,I,N,u,P,b]);if(Bne({onSave:C,onClose:t,dependency:w}),E)return i.jsx(dae,{isDarkMode:g,isSidebar:n,loadingText:l("loading",{fileName:e.name})});if(T)return i.jsx(pae,{file:e,isSidebar:n,isFullscreen:c,onClose:t,onToggleFullscreen:()=>d(V=>!V),title:l("binaryFile.title","Binary File"),message:l("binaryFile.message",'The file "{{fileName}}" cannot be displayed in the text editor because it is a binary file.',{fileName:e.name})});const z=n?"w-full h-full flex flex-col":`fixed inset-0 z-[9999] md:bg-black/50 md:flex md:items-center md:justify-center md:p-4 ${c?"md:p-0":""}`,U=n?"bg-background flex flex-col w-full h-full":`bg-background shadow-2xl flex flex-col w-full h-full md:rounded-lg md:shadow-2xl${c?" md:w-full md:h-full md:rounded-none":" md:w-full md:max-w-6xl md:h-[80vh] md:max-h-[80vh]"}`;return i.jsxs(i.Fragment,{children:[i.jsx("style",{children:aae(g)}),i.jsx("div",{className:z,children:i.jsxs("div",{className:U,children:[i.jsx(cae,{file:e,isSidebar:n,isFullscreen:c,isMarkdownFile:A,markdownPreview:f,saving:S,saveSuccess:j,onToggleMarkdownPreview:()=>m(V=>!V),onOpenSettings:()=>window.openSettings?.("appearance"),onDownload:L,onSave:C,onToggleFullscreen:()=>d(V=>!V),onClose:t,labels:{showingChanges:l("header.showingChanges"),editMarkdown:l("actions.editMarkdown"),previewMarkdown:l("actions.previewMarkdown"),settings:l("toolbar.settings"),download:l("actions.download"),save:l("actions.save"),saving:l("actions.saving"),saved:l("actions.saved"),fullscreen:l("actions.fullscreen"),exitFullscreen:l("actions.exitFullscreen"),close:l("actions.close")}}),_&&i.jsx("div",{className:"border-b border-red-200 bg-red-50 px-3 py-1.5 text-xs text-red-700 dark:border-red-900/40 dark:bg-red-900/20 dark:text-red-300",children:_}),i.jsx("div",{className:"flex-1 overflow-hidden",children:i.jsx(uae,{content:w,onChange:k,markdownPreview:f,isMarkdownFile:A,isDarkMode:g,fontSize:v,showLineNumbers:y,extensions:H})}),i.jsx(lae,{content:w,linesLabel:l("footer.lines"),charactersLabel:l("footer.characters"),shortcutsLabel:l("footer.shortcuts")})]})})]})}const mae=200,Lm=280;function g4({editingFile:e,isMobile:t,editorExpanded:r,editorWidth:n,hasManualWidth:a,resizeHandleRef:s,onResizeStart:o,onCloseEditor:l,onToggleEditorExpand:c,projectPath:d,fillSpace:u}){const[p,f]=h.useState(!1),m=h.useRef(null),[g,b]=h.useState(n);if(h.useEffect(()=>{if(!e||t||p)return;const y=()=>{if(!m.current)return;const k=m.current.parentElement;if(!k)return;const S=k.clientWidth-mae;S<Lm?f(!0):n>S?b(S):b(n)};y(),window.addEventListener("resize",y);const v=new ResizeObserver(y),w=m.current?.parentElement;return w&&v.observe(w),()=>{window.removeEventListener("resize",y),v.disconnect()}},[e,t,p,n]),!e)return null;if(t||p)return i.jsx(f4,{file:e,onClose:()=>{f(!1),l()},projectPath:d,isSidebar:!1});const x=r||u&&!a;return i.jsxs("div",{ref:m,className:`flex h-full min-w-0 flex-shrink-0 ${x?"flex-1":""}`,children:[!r&&i.jsx("div",{ref:s,onMouseDown:o,className:"group relative w-1 flex-shrink-0 cursor-col-resize bg-gray-200 transition-colors hover:bg-blue-500 dark:bg-gray-700 dark:hover:bg-blue-600",title:"Drag to resize",children:i.jsx("div",{className:"absolute inset-y-0 left-1/2 w-1 -translate-x-1/2 bg-blue-500 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-blue-600"})}),i.jsx("div",{className:`h-full overflow-hidden border-l border-gray-200 dark:border-gray-700 ${x?"min-w-0 flex-1":`min-w-[ flex-shrink-0${Lm}px]`}`,style:x?void 0:{width:`${g}px`,minWidth:`${Lm}px`},children:i.jsx(f4,{file:e,onClose:l,projectPath:d,isSidebar:!0,isExpanded:r,onToggleExpand:c,onPopOut:()=>f(!0)})})]})}function hae(e){const t=h.useRef(!1),r=h.useCallback(s=>{s&&(s.preventDefault(),s.stopPropagation()),e()},[e]),n=h.useCallback(s=>{t.current=!0,r(s),window.setTimeout(()=>{t.current=!1},350)},[r]);return{handleMobileMenuClick:h.useCallback(s=>{if(t.current){s.preventDefault(),s.stopPropagation();return}r(s)},[r]),handleMobileMenuTouchEnd:n}}function J6({onMenuClick:e,compact:t=!1}){const{handleMobileMenuClick:r,handleMobileMenuTouchEnd:n}=hae(e),a=t?"p-1.5 text-muted-foreground hover:text-foreground rounded-lg hover:bg-accent/60 pwa-menu-button":"p-1.5 text-muted-foreground hover:text-foreground rounded-lg hover:bg-accent/60 touch-manipulation active:scale-95 pwa-menu-button flex-shrink-0";return i.jsx("button",{onClick:r,onTouchEnd:n,className:a,"aria-label":"Open menu",children:i.jsx("svg",{className:"h-5 w-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"})})})}const b4=[{kind:"builtin",id:"chat",labelKey:"tabs.chat",icon:na},{kind:"builtin",id:"orchestration",labelKey:"tabs.orchestration",icon:aa},{kind:"builtin",id:"shell",labelKey:"tabs.shell",icon:Gr},{kind:"builtin",id:"files",labelKey:"tabs.files",icon:Pn},{kind:"builtin",id:"git",labelKey:"tabs.git",icon:Qr},{kind:"builtin",id:"changes",labelKey:"tabs.changes",icon:_i},{kind:"builtin",id:"liveView",labelKey:"tabs.liveView",icon:Fn}],fae={kind:"builtin",id:"tasks",labelKey:"tabs.tasks",icon:xE},gae=new Set(["files","shell","git","changes","liveView"]);function bae({activeTab:e,setActiveTab:t,shouldShowTasksTab:r,liveViewAvailable:n=!1,activeSidePanelTab:a,sidePanelMode:s="split",canUseSidePanelSplit:o=!0,isMobile:l=!1,onCloseSidePanel:c}){const{t:d}=Me(),{plugins:u}=Yd(),p=r?[...b4,fae]:b4,f=u.filter(g=>g.enabled).map(g=>({kind:"plugin",id:`plugin:${g.name}`,label:g.displayName,pluginName:g.name,iconFile:g.icon})),m=[...p,...f];return i.jsx(Gf,{children:m.map(g=>{const b=g.id===e,x=g.kind==="builtin"?d(g.labelKey):g.label,y=!!(!l&&o&&b&&a===g.id&&gae.has(g.id)),v=s==="split",k=y?`${x} · ${v?"Split":"Full"} view`:x;return i.jsxs("div",{className:"relative inline-flex items-center",children:[i.jsx(Yn,{content:k,position:"bottom",children:i.jsxs(Hf,{isActive:b,onClick:()=>t(g.id),className:y?"px-2 py-[5px] pr-7":"px-2.5 py-[5px]",children:[g.kind==="builtin"?i.jsx(g.icon,{className:"h-3.5 w-3.5"}):i.jsx(qC,{pluginName:g.pluginName,iconFile:g.iconFile,className:"flex h-3.5 w-3.5 items-center justify-center [&>svg]:h-full [&>svg]:w-full"}),i.jsx("span",{className:"hidden lg:inline",children:x}),g.id==="liveView"&&n&&i.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 shadow-[0_0_8px_rgba(16,185,129,0.75)]","aria-hidden":"true"}),y&&i.jsx("span",{className:`ml-0.5 inline-flex h-4 w-4 items-center justify-center rounded border ${v?"border-foreground/20 bg-foreground/5 text-foreground/70":"border-border bg-muted/60 text-muted-foreground"}`,"aria-hidden":"true",children:v?i.jsx(TE,{className:"h-3 w-3"}):i.jsx(Gd,{className:"h-3 w-3"})})]})}),y&&c&&i.jsx(Yn,{content:d("tabs.closeSidePanel","Close side panel"),position:"bottom",children:i.jsx("button",{type:"button",className:"absolute right-1 top-1/2 flex h-4 w-4 -translate-y-1/2 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",onClick:E=>{E.stopPropagation(),c()},"aria-label":d("tabs.closeSidePanel","Close side panel"),title:d("tabs.closeSidePanel","Close side panel"),children:i.jsx(xt,{className:"h-3 w-3"})})})]},g.id)})})}function xae(e,t,r,n){return e.startsWith("plugin:")&&n?n:e==="files"?r("mainContent.projectFiles"):e==="orchestration"?r("tabs.orchestration"):e==="git"?r("tabs.git"):e==="changes"?r("tabs.changes"):e==="liveView"?r("tabs.liveView"):e==="tasks"&&t?"TaskMaster":"Project"}function yae(e){return e.__provider==="cursor"?e.name||"Untitled Session":e.summary||e.name||e.title||"New Session"}function vae({activeTab:e,selectedProject:t,selectedSession:r,shouldShowTasksTab:n}){const{t:a}=Me(),{plugins:s}=Yd(),o=e.startsWith("plugin:")?s.find(d=>d.name===e.replace("plugin:",""))?.displayName:void 0,l=e==="chat"&&!!r,c=e==="chat"&&!r;return i.jsxs("div",{className:"scrollbar-hide flex min-w-0 flex-1 items-center gap-2 overflow-x-auto",children:[l&&i.jsx("div",{className:"flex h-5 w-5 flex-shrink-0 items-center justify-center",children:i.jsx(dr,{provider:r?.__provider,className:"h-4 w-4"})}),i.jsx("div",{className:"min-w-0 flex-1",children:e==="chat"&&r?i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"scrollbar-hide overflow-x-auto whitespace-nowrap text-sm font-semibold leading-tight text-foreground",children:yae(r)}),i.jsx("div",{className:"truncate text-[11px] leading-tight text-muted-foreground",children:t.displayName})]}):c?i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-base font-semibold leading-tight text-foreground",children:a("mainContent.newSession")}),i.jsx("div",{className:"truncate text-xs leading-tight text-muted-foreground",children:t.displayName})]}):i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-sm font-semibold leading-tight text-foreground",children:xae(e,n,a,o)}),i.jsx("div",{className:"truncate text-[11px] leading-tight text-muted-foreground",children:t.displayName})]})})]})}function wae({activeTab:e,setActiveTab:t,selectedProject:r,selectedSession:n,shouldShowTasksTab:a,liveViewAvailable:s,activeSidePanelTab:o,sidePanelMode:l,canUseSidePanelSplit:c,isMobile:d,onMenuClick:u,onCloseSidePanel:p}){const f=h.useRef(null),[m,g]=h.useState(!1),[b,x]=h.useState(!1),y=h.useCallback(()=>{const v=f.current;v&&(g(v.scrollLeft>2),x(v.scrollLeft<v.scrollWidth-v.clientWidth-2))},[]);return h.useEffect(()=>{const v=f.current;if(!v)return;y();const w=new ResizeObserver(y);return w.observe(v),()=>w.disconnect()},[y]),i.jsx("div",{className:"pwa-header-safe flex-shrink-0 border-b border-border/60 bg-background px-3 py-1.5 sm:px-4 sm:py-2",children:i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[d&&i.jsx(J6,{onMenuClick:u}),i.jsx(vae,{activeTab:e,selectedProject:r,selectedSession:n,shouldShowTasksTab:a})]}),i.jsxs("div",{className:"relative min-w-0 flex-shrink overflow-hidden sm:flex-shrink-0",children:[m&&i.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 z-10 w-6 bg-gradient-to-r from-background to-transparent"}),i.jsx("div",{ref:f,onScroll:y,className:"scrollbar-hide overflow-x-auto",children:i.jsx(bae,{activeTab:e,setActiveTab:t,shouldShowTasksTab:a,liveViewAvailable:s,activeSidePanelTab:o,sidePanelMode:l,canUseSidePanelSplit:c,isMobile:d,onCloseSidePanel:p})}),b&&i.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 z-10 w-6 bg-gradient-to-l from-background to-transparent"})]})]})})}function x4({mode:e,isMobile:t,onMenuClick:r,onQuickStartSession:n,onQuickStartOrchestration:a}){const{t:s}=Me(),o=e==="loading";return i.jsxs("div",{className:"flex h-full flex-col",children:[t&&i.jsx("div",{className:"pwa-header-safe flex-shrink-0 border-b border-border/50 bg-background/80 p-2 backdrop-blur-sm sm:p-3",children:i.jsx(J6,{onMenuClick:r,compact:!0})}),o?i.jsx("div",{className:"flex flex-1 items-center justify-center",children:i.jsxs("div",{className:"text-center text-muted-foreground",children:[i.jsx("div",{className:"mx-auto mb-4 h-10 w-10",children:i.jsx("div",{className:"h-full w-full rounded-full border-[3px] border-muted border-t-primary",style:{animation:"spin 1s linear infinite",WebkitAnimation:"spin 1s linear infinite",MozAnimation:"spin 1s linear infinite"}})}),i.jsx("h2",{className:"mb-1 text-lg font-semibold text-foreground",children:s("mainContent.loading")}),i.jsx("p",{className:"text-sm",children:s("mainContent.settingUpWorkspace")})]})}):i.jsx("div",{className:"flex flex-1 items-center justify-center overflow-auto p-5",children:i.jsxs("div",{className:"w-full max-w-4xl",children:[i.jsxs("div",{className:"mb-6",children:[i.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-lg bg-muted/60",children:i.jsx(Pn,{className:"h-6 w-6 text-muted-foreground"})}),i.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:s("mainContent.landing.title")}),i.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:s("mainContent.landing.description")})]}),i.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[i.jsxs("button",{type:"button",onClick:()=>{a?.()},className:"rounded-md border border-primary/30 bg-primary/5 p-4 text-left transition-colors hover:bg-primary/10",children:[i.jsx(aa,{className:"mb-3 h-5 w-5 text-primary"}),i.jsx("div",{className:"text-sm font-semibold",children:s("mainContent.landing.startOrchestration")}),i.jsx("p",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:s("mainContent.landing.startOrchestrationDescription")})]}),i.jsxs("button",{type:"button",onClick:()=>{n?.()},className:"rounded-md border border-border p-4 text-left transition-colors hover:bg-muted/40",children:[i.jsx(Na,{className:"mb-3 h-5 w-5 text-foreground"}),i.jsx("div",{className:"text-sm font-semibold",children:s("mainContent.landing.startChat")}),i.jsx("p",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:s("mainContent.landing.startChatDescription")})]}),i.jsxs("button",{type:"button",onClick:()=>window.dispatchEvent(new CustomEvent("pixcode:create-project")),className:"rounded-md border border-border p-4 text-left transition-colors hover:bg-muted/40",children:[i.jsx(ai,{className:"mb-3 h-5 w-5 text-foreground"}),i.jsx("div",{className:"text-sm font-semibold",children:s("mainContent.landing.createProject",{defaultValue:"Create New Project"})}),i.jsx("p",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:s("mainContent.landing.createProjectDescription",{defaultValue:"Add an existing workspace or create a folder, then open the provider picker for coding."})})]}),i.jsxs("button",{type:"button",onClick:()=>window.dispatchEvent(new CustomEvent("pixcode:create-project")),className:"rounded-md border border-border p-4 text-left transition-colors hover:bg-muted/40",children:[i.jsx(xE,{className:"mb-3 h-5 w-5 text-foreground"}),i.jsx("div",{className:"text-sm font-semibold",children:s("mainContent.landing.taskSystem")}),i.jsx("p",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:s("mainContent.landing.taskSystemDescription")})]})]}),i.jsx("div",{className:"mt-5 rounded-md border border-border/70 bg-muted/20 p-4 text-sm text-muted-foreground",children:s("mainContent.landing.sidebarHint")})]})})]})}const kae={M:"M",A:"A",D:"D",U:"U"},Sae={M:"border-amber-400/40 bg-amber-500/10 text-amber-700 dark:text-amber-200",A:"border-emerald-400/40 bg-emerald-500/10 text-emerald-700 dark:text-emerald-200",D:"border-red-400/40 bg-red-500/10 text-red-700 dark:text-red-200",U:"border-sky-400/40 bg-sky-500/10 text-sky-700 dark:text-sky-200"};function Eae(e){return e?new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(e):null}function Nae({changedFiles:e,isLoading:t,error:r,latestChangedFilePath:n,lastCheckedAt:a,trackingMode:s,onTrackingModeChange:o,onRefresh:l,onOpenFile:c,variant:d="rail"}){const u=Eae(a),p=d==="panel";return i.jsxs("aside",{className:ue("h-full min-h-0 flex-col overflow-hidden bg-card/45",p?"flex w-full rounded-none border-0":"hidden w-[260px] shrink-0 rounded-lg border border-border/60 shadow-sm xl:flex"),children:[i.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border/60 px-3 py-2",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:[i.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500 shadow-[0_0_10px_rgba(16,185,129,0.75)]"}),"Command Center"]}),i.jsx("p",{className:"mt-0.5 truncate text-[11px] text-muted-foreground",children:e.length>0?`${e.length} local change${e.length===1?"":"s"}`:"Watching agent writes"})]}),i.jsx("button",{type:"button",onClick:l,className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-border bg-background text-muted-foreground transition-colors hover:bg-accent hover:text-foreground","aria-label":"Refresh changed files",title:"Refresh changed files",children:t?i.jsx(Ot,{className:"h-3.5 w-3.5 animate-spin"}):i.jsx(ht,{className:"h-3.5 w-3.5"})})]}),i.jsx("div",{className:"border-b border-border/60 px-3 py-2",children:i.jsxs("div",{className:"grid grid-cols-2 rounded-md border border-border bg-background p-0.5 text-[11px] font-medium",children:[i.jsx("button",{type:"button",onClick:()=>o("local"),className:`rounded px-2 py-1 transition-colors ${s==="local"?"bg-foreground text-background shadow-sm":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,title:"Local changes: agent writes and filesystem edits",children:"Local changes"}),i.jsx("button",{type:"button",onClick:()=>o("git"),className:`rounded px-2 py-1 transition-colors ${s==="git"?"bg-foreground text-background shadow-sm":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,title:"Git changes: git status only",children:"Git changes"})]})}),r&&i.jsx("div",{className:"mx-3 mt-3 rounded-md border border-amber-500/25 bg-amber-500/10 px-2 py-1.5 text-[11px] leading-5 text-amber-700 dark:text-amber-200",children:r}),i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-2",children:e.length===0?i.jsxs("div",{className:"flex h-full flex-col items-center justify-center px-3 text-center text-muted-foreground",children:[i.jsx(_i,{className:"mb-2 h-8 w-8 opacity-45"}),i.jsx("p",{className:"text-xs font-medium text-foreground",children:"No local changes detected"}),i.jsx("p",{className:"mt-1 text-[11px] leading-5",children:"When an agent writes or edits files, they will appear here."})]}):i.jsxs("div",{className:"space-y-1",children:[e.slice(0,12).map(f=>{const m=n===f.path;return i.jsxs("button",{type:"button",onClick:()=>c(f),className:`group flex w-full items-center gap-2 rounded-md border px-2 py-1.5 text-left transition-all ${m?"changed-file-flash border-emerald-500/60 bg-emerald-500/15":"border-border/60 bg-background/70 hover:border-emerald-500/35 hover:bg-emerald-500/10"}`,title:f.path,children:[i.jsx("span",{className:`inline-flex h-5 min-w-5 items-center justify-center rounded border px-1 text-[10px] font-semibold ${Sae[f.status]}`,children:kae[f.status]}),i.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-foreground",children:f.path})]},`${f.status}:${f.path}`)}),e.length>12&&i.jsxs("p",{className:"px-1 pt-1 text-[11px] text-muted-foreground",children:["+",e.length-12," more files"]})]})}),u&&i.jsxs("div",{className:"border-t border-border/60 px-3 py-2 text-[10px] text-muted-foreground",children:["Last check ",u]})]})}const Cae=h.createContext(null),Dm={didCatch:!1,error:null};let Aae=class extends h.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Dm}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var r,n,a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:s,reason:"imperative-api"}),this.setState(Dm)}}componentDidCatch(t,r){var n,a;(n=(a=this.props).onError)===null||n===void 0||n.call(a,t,r)}componentDidUpdate(t,r){const{didCatch:n}=this.state,{resetKeys:a}=this.props;if(n&&r.error!==null&&Tae(t.resetKeys,a)){var s,o;(s=(o=this.props).onReset)===null||s===void 0||s.call(o,{next:a,prev:t.resetKeys,reason:"keys"}),this.setState(Dm)}}render(){const{children:t,fallbackRender:r,FallbackComponent:n,fallback:a}=this.props,{didCatch:s,error:o}=this.state;let l=t;if(s){const c={error:o,resetErrorBoundary:this.resetErrorBoundary};if(typeof r=="function")l=r(c);else if(n)l=h.createElement(n,c);else if(a!==void 0)l=a;else throw o}return h.createElement(Cae.Provider,{value:{didCatch:s,error:o,resetErrorBoundary:this.resetErrorBoundary}},l)}};function Tae(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}function jae(e){return e instanceof Error?`${e.name}: ${e.message}`:String(e)}function _ae({error:e,resetErrorBoundary:t,showDetails:r,componentStack:n}){return i.jsx("div",{className:"flex flex-col items-center justify-center p-8 text-center",children:i.jsxs("div",{className:"max-w-md rounded-lg border border-red-200 bg-red-50 p-6",children:[i.jsxs("div",{className:"mb-4 flex items-center",children:[i.jsx("div",{className:"flex-shrink-0",children:i.jsx("svg",{className:"h-5 w-5 text-red-400",viewBox:"0 0 20 20",fill:"currentColor",children:i.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})}),i.jsx("h3",{className:"ml-3 text-sm font-medium text-red-800",children:"Something went wrong"})]}),i.jsxs("div",{className:"text-sm text-red-700",children:[i.jsx("p",{className:"mb-2",children:"An error occurred while loading the chat interface."}),r&&i.jsxs("details",{className:"mt-4",children:[i.jsx("summary",{className:"cursor-pointer font-mono text-xs",children:"Error Details"}),i.jsxs("pre",{className:"mt-2 max-h-40 overflow-auto rounded bg-red-100 p-2 text-xs",children:[jae(e),n]})]})]}),i.jsx("div",{className:"mt-4",children:i.jsx("button",{onClick:t,className:"rounded bg-red-600 px-4 py-2 text-sm text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500",children:"Try Again"})})]})})}function Iae({children:e,showDetails:t=!1,onRetry:r=void 0,resetKeys:n=void 0}){const[a,s]=h.useState(null),o=h.useCallback((d,u)=>{console.error("ErrorBoundary caught an error:",d,u),s(u?.componentStack??null)},[]),l=h.useCallback(()=>{s(null),r?.()},[r]),c=h.useCallback(({error:d,resetErrorBoundary:u})=>i.jsx(_ae,{error:d,resetErrorBoundary:u,showDetails:t,componentStack:a}),[t,a]);return i.jsx(Aae,{fallbackRender:c,onError:o,onReset:l,resetKeys:n,children:e})}const Rae=new Set(["files","shell","git","changes","liveView"]),Lae=40,Dae=50,Oae=46,y4="command-center-tracking-mode";function Oc(e){return Rae.has(e)}function Mae(e){return Math.min(Dae,Math.max(Lae,e))}function v4(){return typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}function Pae({selectedProject:e,selectedSession:t,activeTab:r,setActiveTab:n,ws:a,sendMessage:s,latestMessage:o,isMobile:l,onMenuClick:c,isLoading:d,onInputFocusChange:u,onSessionActive:p,onSessionInactive:f,onSessionProcessing:m,onSessionNotProcessing:g,processingSessions:b,onReplaceTemporarySession:x,onNavigateToSession:y,onShowSettings:v,externalMessageUpdate:w,onQuickStartSession:k,onQuickStartOrchestration:E}){const{preferences:S}=Mf(),{autoExpandTools:j,showRawParameters:_,showThinking:T,autoScrollToBottom:C,sendByCtrlEnter:L}=S,{currentProject:A,setCurrentProject:I}=eo(),{tasksEnabled:N,isTaskMasterInstalled:P}=Kd(),[H,z]=h.useState("split"),[U,V]=h.useState(Oae),[O,G]=h.useState(!1),[$,F]=h.useState(!1),[te,Q]=h.useState(()=>typeof window>"u"?"local":window.localStorage.getItem(y4)==="git"?"git":"local"),[ge,ae]=h.useState(()=>Oc(r)?"chat":r),[me,pe]=h.useState(()=>typeof window<"u"&&window.innerWidth>=1024),be=!!(N&&P),Ne=Oc(r)?r:null,xe=!!(Ne&&!l&&me&&H==="split"),Be=h.useRef(null),M=h.useRef(null),de=h.useRef(null),ce=h.useRef(null),Y=h.useRef(null);zC(Be,r);const{editingFile:W,editorWidth:ne,editorExpanded:fe,hasManualWidth:ye,resizeHandleRef:se,handleFileOpen:Se,handleCloseEditor:re,handleToggleEditorExpand:X,handleResizeStart:Z}=sne({selectedProject:e,isMobile:l}),le=ge==="orchestration"?"orchestration":"chat",Ee=Ne?le:r,Te=!!xe,Ke=!!(Ne==="files"&&W&&!l),Ze=Ee==="chat"&&(!Ne||Te),vt=Ee==="orchestration"&&Te,{changedFiles:Qe,isLoading:jt,error:wt,lastCheckedAt:st,latestDetectedFile:lt,refresh:kt}=ine(e,!!e,o,te),[_t,At]=h.useState(null),pr=h.useRef(0),nr=h.useMemo(()=>Qe.map(ke=>ke.path),[Qe]),Xt=h.useCallback(async ke=>{if(ke.diffInfo)return ke.diffInfo;if(!e)return null;try{const we=await ve(`/api/git/file-with-diff?project=${encodeURIComponent(e.name)}&file=${encodeURIComponent(ke.path)}`,{cache:"no-store"}),Ve=await we.json();if(we.ok&&!Ve.error&&typeof Ve.currentContent=="string"&&typeof Ve.oldContent=="string")return{old_string:Ve.oldContent,new_string:Ve.currentContent}}catch{}if(ke.status==="A"||ke.status==="U")try{const we=await ot.readFile(e.name,ke.path);if(!we.ok)return null;const Ve=await we.json();if(typeof Ve.content=="string")return{old_string:"",new_string:Ve.content}}catch{return null}return null},[e]),zr=h.useCallback(ke=>{At(ke.path),Se(ke.path,ke.diffInfo??null),!l&&me&&z("split"),n("files"),ke.diffInfo||Xt(ke).then(we=>{we&&Se(ke.path,we)})},[me,Se,Xt,l,n]),De=h.useCallback(()=>{z("split"),n(le)},[n,le]),Xe=ke=>ke==="files"?Ke?i.jsxs("div",{className:"flex h-full min-w-0 overflow-hidden",children:[!fe&&i.jsx("div",{className:"h-full min-w-[220px] max-w-[50%] flex-[0_0_46%] overflow-hidden border-r border-border/60",children:i.jsx(S5,{selectedProject:e,onFileOpen:Se,changedFilePaths:nr,focusedFilePath:_t})}),i.jsx(g4,{editingFile:W,isMobile:l,editorExpanded:fe,editorWidth:ne,hasManualWidth:ye,resizeHandleRef:se,onResizeStart:Z,onCloseEditor:re,onToggleEditorExpand:X,projectPath:e?.path,fillSpace:!0})]}):i.jsx(S5,{selectedProject:e,onFileOpen:Se,changedFilePaths:nr,focusedFilePath:_t}):ke==="shell"?i.jsx(_E,{project:e,session:t,showHeader:!1,isActive:r==="shell"}):ke==="changes"?i.jsx(Nae,{changedFiles:Qe,isLoading:jt,error:wt,latestChangedFilePath:lt?.path??_t,lastCheckedAt:st,trackingMode:te,onTrackingModeChange:Q,onRefresh:()=>{kt("manual")},onOpenFile:zr,variant:"panel"}):ke==="liveView"?e?i.jsx(Ere,{selectedProject:e,onAvailabilityChange:F}):null:i.jsx(Kte,{selectedProject:e,isMobile:l,onFileOpen:Se});h.useEffect(()=>{const ke=e?.name,we=A?.name;e&&ke!==we&&I?.(e)},[e,A?.name,I]),h.useEffect(()=>{!be&&r==="tasks"&&n("chat")},[be,r,n]),h.useEffect(()=>{if(!e){F(!1);return}let ke=!1;return ve(`/api/live-view/${encodeURIComponent(e.name)}/status`,{cache:"no-store"}).then(we=>we.ok?we.json():null).then(we=>{ke||F(!!(we?.target?.available||we?.session))}).catch(()=>{ke||F(!1)}),()=>{ke=!0}},[e]),h.useEffect(()=>{if(typeof window>"u")return;const ke=()=>{pe(window.innerWidth>=1024)};return ke(),window.addEventListener("resize",ke),()=>{window.removeEventListener("resize",ke)}},[]),h.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(y4,te)},[te]),h.useEffect(()=>{Oc(r)||ae(r)},[r]);const Je=h.useCallback(ke=>{const we=typeof ke=="function"?ke(r):ke;!l&&me&&Oc(we)?r===we?(Y.current=ce.current?.getBoundingClientRect()??null,z(Ve=>Ve==="split"?"full":"split")):z("split"):(z("split"),ae(we)),n(we)},[r,me,l,n]),ie=h.useCallback(ke=>{if(!M.current||!Te)return;ke.preventDefault(),ke.currentTarget.setPointerCapture?.(ke.pointerId),G(!0);const we=Ce=>{const Oe=M.current?.getBoundingClientRect();if(!Oe||Oe.width<=0)return;const ct=(Oe.right-Ce)/Oe.width*100;V(Mae(ct))};we(ke.clientX);const Ve=Ce=>{we(Ce.clientX)},et=()=>{G(!1),window.removeEventListener("pointermove",Ve),window.removeEventListener("pointerup",et),window.removeEventListener("pointercancel",et)};window.addEventListener("pointermove",Ve),window.addEventListener("pointerup",et,{once:!0}),window.addEventListener("pointercancel",et,{once:!0})},[Te]);return h.useLayoutEffect(()=>{const ke=Y.current,we=ce.current;if(!ke||!we||v4()){Y.current=null;return}const Ve=we.getBoundingClientRect();if(Ve.width<=0||Ve.height<=0){Y.current=null;return}const et=ke.left-Ve.left,Ce=ke.width/Ve.width;Xn.fromTo(we,{x:et,scaleX:Ce,opacity:.94,transformOrigin:"right center"},{x:0,scaleX:1,opacity:1,duration:Vr.duration.enter,ease:Vr.ease.soft,clearProps:"transform,opacity,transformOrigin"}),Y.current=null},[H,xe]),h.useEffect(()=>{xe||G(!1)},[xe]),h.useEffect(()=>{if(!Te||v4())return;const ke=de.current,we=ce.current;if(!ke||!we)return;const Ve=Xn.context(()=>{Xn.fromTo(ke,{opacity:.92,x:-14},{opacity:1,x:0,duration:Vr.duration.base,ease:Vr.ease.out,clearProps:"transform,opacity"}),Xn.fromTo(we,{opacity:0,x:28,scaleX:.96,transformOrigin:"right center"},{opacity:1,x:0,scaleX:1,duration:Vr.duration.enter,ease:Vr.ease.soft,clearProps:"transform,opacity,transformOrigin"})},M);return()=>Ve.revert()},[Ne,Te]),h.useEffect(()=>{lt&<.detectedAt!==pr.current&&(pr.current=lt.detectedAt,At(lt.path))},[lt]),h.useEffect(()=>{if(!_t)return;const ke=window.setTimeout(()=>At(null),7e3);return()=>window.clearTimeout(ke)},[_t]),d?i.jsx(x4,{mode:"loading",isMobile:l,onMenuClick:c}):e?i.jsxs("div",{className:"flex h-full flex-col",children:[i.jsx(wae,{activeTab:r,setActiveTab:Je,selectedProject:e,selectedSession:t,shouldShowTasksTab:be,liveViewAvailable:$,activeSidePanelTab:Ne,sidePanelMode:H,canUseSidePanelSplit:me,isMobile:l,onCloseSidePanel:Ne?De:void 0,onMenuClick:c}),i.jsxs("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[i.jsxs("div",{ref:Be,className:ue("flex min-h-0 min-w-[200px] flex-1 flex-col overflow-hidden",fe&&"hidden",!W&&!Ne&&!xe&&"mx-auto w-full max-w-[1100px] px-4 md:px-8",!W&&Ne&&!Te&&"w-full px-3 md:px-4",!W&&Te&&"w-full px-3 md:px-4",!W&&r==="orchestration"&&"max-w-none px-0 md:px-0"),children:[(Ze||vt||Ne)&&i.jsxs("div",{ref:M,className:ue("h-full min-h-0",Te&&"flex overflow-hidden",O&&"select-none"),children:[Ze&&i.jsx("div",{ref:de,className:ue("min-h-0 overflow-hidden",Te&&"min-w-[320px] flex-none transition-[width,opacity,transform] duration-300 ease-out",O&&"transition-none",!Te&&"h-full"),style:Te?{width:`${100-U}%`}:void 0,children:i.jsx("div",{className:"flex h-full min-h-0 min-w-0 flex-1",children:i.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:i.jsx(Iae,{showDetails:!0,children:i.jsx(Uee,{selectedProject:e,selectedSession:t,ws:a,sendMessage:s,latestMessage:o,onFileOpen:Se,onInputFocusChange:u,onSessionActive:p,onSessionInactive:f,onSessionProcessing:m,onSessionNotProcessing:g,processingSessions:b,onReplaceTemporarySession:x,onNavigateToSession:y,onShowSettings:v,autoExpandTools:j,showRawParameters:_,showThinking:T,autoScrollToBottom:C,sendByCtrlEnter:L,externalMessageUpdate:w,onShowAllTasks:N?()=>Je("tasks"):null})})})})}),vt&&i.jsx("div",{ref:de,className:ue("min-h-0 overflow-hidden",Te&&"min-w-[320px] flex-none transition-[width,opacity,transform] duration-300 ease-out",O&&"transition-none"),style:Te?{width:`${100-U}%`}:void 0,children:i.jsx("div",{className:"flex h-full min-h-0 min-w-0 flex-1",children:i.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:i.jsx(z5,{selectedProject:e})})})}),Te&&i.jsxs("button",{type:"button",className:"group relative z-20 mx-1 flex w-3 shrink-0 cursor-col-resize touch-none items-center justify-center rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",onPointerDown:ie,"aria-label":"Resize side panel",title:"Drag to resize",children:[i.jsx("span",{className:"absolute inset-y-3 -left-2 -right-2 rounded-full"}),i.jsx("span",{className:ue("h-16 w-1 rounded-full bg-border transition-all duration-200 group-hover:h-24 group-hover:bg-foreground/40",O&&"h-28 bg-foreground/55 shadow-[0_0_18px_rgba(120,120,120,0.22)]")})]}),Ne&&i.jsx("div",{ref:ce,className:ue("min-h-0 overflow-hidden rounded-lg border border-border/60 bg-card/40",Te&&"min-w-[360px] flex-none shadow-sm transition-[width,opacity,transform] duration-300 ease-out",O&&"transition-none",!Te&&"h-full w-full"),style:Te?{width:`${U}%`}:void 0,children:Xe(Ne)})]}),!Ne&&r==="orchestration"&&i.jsx("div",{className:"flex h-full min-h-0 min-w-0 overflow-hidden",children:i.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:i.jsx(z5,{selectedProject:e})})}),be&&i.jsx(gee,{isVisible:r==="tasks"}),i.jsx("div",{className:`h-full overflow-hidden ${r==="preview"?"block":"hidden"}`}),r.startsWith("plugin:")&&i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(Nre,{pluginName:r.replace("plugin:",""),selectedProject:e,selectedSession:t})})]}),!Ke&&i.jsx(g4,{editingFile:W,isMobile:l,editorExpanded:fe,editorWidth:ne,hasManualWidth:ye,resizeHandleRef:se,onResizeStart:Z,onCloseEditor:re,onToggleEditorExpand:X,projectPath:e.path,fillSpace:r==="files"})]}),i.jsx($re,{})]}):i.jsx(x4,{mode:"empty",isMobile:l,onMenuClick:c,onQuickStartSession:k,onQuickStartOrchestration:E})}const Fae=qr.memo(Pae),Q6="pixcode.inAppNotifications.v1",zae="pixcode.notificationPreferences.v1",uv=25;function Bae(){try{const e=JSON.parse(localStorage.getItem(Q6)??"[]");return Array.isArray(e)?e.slice(0,uv):[]}catch{return[]}}function w4(e){try{localStorage.setItem(Q6,JSON.stringify(e.slice(0,uv)))}catch{}}function k4(){try{return JSON.parse(localStorage.getItem(zae)??"null")?.channels?.inApp!==!1}catch{return!0}}function $ae(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.id!="string"||typeof t.title!="string"||typeof t.body!="string"?null:{id:t.id,title:t.title,body:t.body,kind:t.kind,code:t.code,severity:t.severity||"info",provider:t.provider??null,sessionId:t.sessionId??null,createdAt:t.createdAt||new Date().toISOString(),data:t.data}}function Uae(e){return e==="error"?"border-red-500/50 bg-red-50 text-red-950 dark:bg-red-950/35 dark:text-red-50":e==="warning"?"border-amber-500/50 bg-amber-50 text-amber-950 dark:bg-amber-950/35 dark:text-amber-50":"border-border bg-card text-card-foreground"}function Gae(e){if(!e)return"";try{return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(new Date(e))}catch{return""}}function Hae({latestMessage:e}){const[t,r]=h.useState(()=>typeof window>"u"?[]:Bae()),[n,a]=h.useState(!1),[s,o]=h.useState(()=>new Set),[l,c]=h.useState(()=>typeof window>"u"?!0:k4());h.useEffect(()=>{const f=()=>c(k4());return window.addEventListener("storage",f),window.addEventListener("pixcode:notification-preferences-changed",f),()=>{window.removeEventListener("storage",f),window.removeEventListener("pixcode:notification-preferences-changed",f)}},[]),h.useEffect(()=>{const f=e;if(!f||f.type!=="notification:event")return;const m=$ae(f.notification);m&&(K4({key:m.id,title:m.title,body:m.body,event:m.kind||"updates",tag:typeof m.data?.tag=="string"?m.data.tag:m.id,data:m.data}),l&&(r(g=>{if(g.some(x=>x.id===m.id))return g;const b=[m,...g].slice(0,uv);return w4(b),b}),o(g=>{const b=new Set(g);return b.delete(m.id),b}),a(!0)))},[l,e]);const d=h.useMemo(()=>t.filter(f=>!s.has(f.id)).length,[t,s]),u=h.useCallback(()=>{o(new Set(t.map(f=>f.id)))},[t]),p=h.useCallback(f=>{r(m=>{const g=m.filter(b=>b.id!==f);return w4(g),g}),o(m=>{const g=new Set(m);return g.delete(f),g})},[]);return!l||t.length===0?null:i.jsxs("div",{className:"pointer-events-none fixed bottom-4 right-4 z-40 flex max-w-[calc(100vw-2rem)] flex-col items-end gap-3",children:[n&&i.jsxs("div",{className:"pointer-events-auto w-[min(24rem,calc(100vw-2rem))] overflow-hidden rounded-lg border border-border bg-popover shadow-xl shadow-black/10",children:[i.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border px-3 py-2",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[i.jsx(Vm,{className:"h-4 w-4 flex-shrink-0 text-primary"}),i.jsx("span",{className:"truncate text-sm font-medium text-popover-foreground",children:"Notifications"}),d>0&&i.jsx("span",{className:"rounded-full bg-primary px-2 py-0.5 text-xs font-medium text-primary-foreground",children:d})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("button",{type:"button",onClick:u,className:"rounded px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:"Read"}),i.jsx("button",{type:"button",onClick:()=>a(!1),className:"rounded p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground","aria-label":"Close notifications",children:i.jsx(xt,{className:"h-4 w-4"})})]})]}),i.jsx("div",{className:"max-h-[22rem] space-y-2 overflow-y-auto p-2",children:t.slice(0,6).map(f=>i.jsx("div",{className:`rounded-md border p-3 shadow-sm ${Uae(f.severity)}`,children:i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[!s.has(f.id)&&i.jsx("span",{className:"h-2 w-2 flex-shrink-0 rounded-full bg-primary"}),i.jsx("p",{className:"truncate text-sm font-medium",children:f.title})]}),i.jsx("p",{className:"mt-1 text-sm leading-5 opacity-85",children:f.body}),i.jsx("p",{className:"mt-2 text-xs opacity-60",children:Gae(f.createdAt)})]}),i.jsx("button",{type:"button",onClick:()=>p(f.id),className:"rounded p-1 opacity-60 transition-opacity hover:opacity-100","aria-label":"Dismiss notification",children:i.jsx(xt,{className:"h-4 w-4"})})]})},f.id))})]}),i.jsxs("button",{type:"button",onClick:()=>{a(f=>!f),n||u()},className:"pointer-events-auto relative inline-flex h-11 w-11 items-center justify-center rounded-full border border-border bg-card text-card-foreground shadow-lg shadow-black/10 transition-transform hover:scale-105","aria-label":"Open notifications",children:[i.jsx(Cf,{className:"h-5 w-5"}),d>0&&i.jsx("span",{className:"absolute -right-1 -top-1 min-w-5 rounded-full bg-primary px-1.5 py-0.5 text-xs font-semibold text-primary-foreground",children:d>9?"9+":d})]})]})}function Vae(){const[e,t]=h.useState(new Set),[r,n]=h.useState(new Set),a=h.useCallback(d=>{d&&t(u=>new Set([...u,d]))},[]),s=h.useCallback(d=>{d&&t(u=>{const p=new Set(u);return p.delete(d),p})},[]),o=h.useCallback(d=>{d&&n(u=>new Set([...u,d]))},[]),l=h.useCallback(d=>{d&&n(u=>{const p=new Set(u);return p.delete(d),p})},[]),c=h.useCallback(d=>{d&&t(u=>{const p=new Set;for(const f of u)f.startsWith("new-session-")||p.add(f);return p.add(d),p})},[]);return{activeSessions:e,processingSessions:r,markSessionAsActive:a,markSessionAsInactive:s,markSessionAsProcessing:o,markSessionAsNotProcessing:l,replaceTemporarySession:c}}const Qt=e=>JSON.stringify(e??null),S4=(e,t,r)=>e.length!==t.length?!0:t.some((n,a)=>{const s=e[a];return!s||n.name!==s.name||n.displayName!==s.displayName||n.fullPath!==s.fullPath||Qt(n.sessionMeta)!==Qt(s.sessionMeta)||Qt(n.sessions)!==Qt(s.sessions)||Qt(n.taskmaster)!==Qt(s.taskmaster)?!0:Qt(n.cursorSessions)!==Qt(s.cursorSessions)||Qt(n.codexSessions)!==Qt(s.codexSessions)||Qt(n.geminiSessions)!==Qt(s.geminiSessions)||Qt(n.qwenSessions)!==Qt(s.qwenSessions)||Qt(n.opencodeSessions)!==Qt(s.opencodeSessions)}),vs=(e,t)=>(e??[]).map(r=>({...r,__provider:r.__provider??t})),Pd=e=>[...vs(e.sessions,"claude"),...vs(e.codexSessions,"codex"),...vs(e.cursorSessions,"cursor"),...vs(e.geminiSessions,"gemini"),...vs(e.qwenSessions,"qwen"),...vs(e.opencodeSessions,"opencode")],qae=(e,t,r,n)=>{if(!r||!n)return!0;const a=e.find(c=>c.name===r.name),s=t.find(c=>c.name===r.name);if(!a||!s)return!1;const o=Pd(a).find(c=>c.id===n.id),l=Pd(s).find(c=>c.id===n.id);return!o||!l?!1:o.id===l.id&&o.title===l.title&&o.created_at===l.created_at&&o.updated_at===l.updated_at},Wae=new Set(["chat","orchestration","files","shell","git","changes","liveView","tasks","preview"]),Kae=e=>Wae.has(e)||e.startsWith("plugin:"),Yae=()=>{if(typeof window<"u"&&window.location.pathname.endsWith("/orchestration"))return"orchestration";try{const e=localStorage.getItem("activeTab");if(e&&Kae(e))return e}catch{}return"chat"};function Zae({sessionId:e,navigate:t,latestMessage:r,isMobile:n,activeSessions:a}){const[s,o]=h.useState([]),[l,c]=h.useState(null),[d,u]=h.useState(null),[p,f]=h.useState(Yae);h.useEffect(()=>{try{localStorage.setItem("activeTab",p)}catch{}},[p]);const[m,g]=h.useState(!1),[b,x]=h.useState(!0),[y,v]=h.useState(null),[w,k]=h.useState(!1),[E,S]=h.useState(!1),[j,_]=h.useState("agents"),[T,C]=h.useState(0),L=h.useRef(null),A=h.useCallback(async({showLoadingState:ae=!0}={})=>{try{ae&&x(!0);const pe=await(await ot.projects()).json();o(be=>be.length===0||S4(be,pe,!0)?pe:be)}catch(me){console.error("Error fetching projects:",me)}finally{ae&&x(!1)}},[]),I=h.useCallback(async()=>{await A({showLoadingState:!1})},[A]),N=h.useCallback((ae="tools")=>{_(ae),S(!0)},[]);h.useEffect(()=>{A()},[A]),h.useEffect(()=>{!b&&s.length===1&&!l&&!e&&c(s[0])},[b,s,l,e]),h.useEffect(()=>{if(!r)return;if(r.type==="loading_progress"){L.current&&(clearTimeout(L.current),L.current=null),v(r),r.phase==="complete"&&(L.current=setTimeout(()=>{v(null),L.current=null},500));return}if(r.type!=="projects_updated")return;const ae=r;if(ae.changedFile&&d&&l){const Be=ae.changedFile.replace(/\\/g,"/").split("/");Be.length>=2&&Be[Be.length-1].replace(".jsonl","")===d.id&&(a.has(d.id)||C(Y=>Y+1))}const me=d&&a.has(d.id)||a.size>0&&Array.from(a).some(xe=>xe.startsWith("new-session-")),pe=ae.projects;if(me&&!qae(s,pe,l,d)||(o(pe),!l))return;const be=pe.find(xe=>xe.name===l.name);if(!be||(Qt(be)!==Qt(l)&&c(be),!d))return;Pd(be).find(xe=>xe.id===d.id)||u(null)},[r,l,d,a,s]),h.useEffect(()=>()=>{L.current&&(clearTimeout(L.current),L.current=null)},[]),h.useEffect(()=>{if(!(!e||s.length===0)){for(const ae of s){const me=ae.sessions?.find(M=>M.id===e);if(me){const M=l?.name!==ae.name,de=d?.id!==e||d.__provider!=="claude";M&&c(ae),de&&u({...me,__provider:"claude"});return}const pe=ae.cursorSessions?.find(M=>M.id===e);if(pe){const M=l?.name!==ae.name,de=d?.id!==e||d.__provider!=="cursor";M&&c(ae),de&&u({...pe,__provider:"cursor"});return}const be=ae.codexSessions?.find(M=>M.id===e);if(be){const M=l?.name!==ae.name,de=d?.id!==e||d.__provider!=="codex";M&&c(ae),de&&u({...be,__provider:"codex"});return}const Ne=ae.geminiSessions?.find(M=>M.id===e);if(Ne){const M=typeof Ne.id=="string"&&Ne.id.startsWith("qwen_")||Ne.provider==="qwen",ce=typeof Ne.id=="string"&&Ne.id.startsWith("opencode_")||Ne.provider==="opencode"?"opencode":M?"qwen":"gemini",Y=l?.name!==ae.name,W=d?.id!==e||d.__provider!==ce;Y&&c(ae),W&&u({...Ne,__provider:ce});return}const xe=ae.qwenSessions?.find(M=>M.id===e);if(xe){const M=l?.name!==ae.name,de=d?.id!==e||d.__provider!=="qwen";M&&c(ae),de&&u({...xe,__provider:"qwen"});return}const Be=ae.opencodeSessions?.find(M=>M.id===e);if(Be){const M=l?.name!==ae.name,de=d?.id!==e||d.__provider!=="opencode";M&&c(ae),de&&u({...Be,__provider:"opencode"});return}}if(e&&d?.id!==e){const ae=e.startsWith("opencode_")?"opencode":e.startsWith("qwen_")?"qwen":e.startsWith("codex-")||e.startsWith("codex_")?"codex":e.startsWith("gemini_")?"gemini":null,me=(typeof window<"u"?localStorage.getItem("selected-provider"):null)||"claude";u({id:e,__provider:ae||me})}}},[e,s,l?.name,d?.id,d?.__provider]);const P=h.useCallback(ae=>{c(ae),u(null),t("/"),n&&g(!1)},[n,t]),H=h.useCallback(ae=>{u(ae),(p==="tasks"||p==="preview"||p==="liveView"||p==="orchestration")&&f("chat");const me=ae.__provider||localStorage.getItem("selected-provider")||"claude";if(ae.__provider&&localStorage.setItem("selected-provider",ae.__provider),me==="cursor"&&sessionStorage.setItem("cursorSessionId",ae.id),n){const pe=ae.__projectName,be=l?.name;pe!==be&&g(!1)}t(`/session/${ae.id}`)},[p,n,t,l?.name]),z=h.useCallback(ae=>{o(me=>{const pe=me.findIndex(Ne=>Ne.name===ae.name);if(pe===-1)return[ae,...me];const be=[...me];return be[pe]={...be[pe],...ae},be}),c(ae),u(null),f("chat"),t("/"),n&&g(!1)},[n,t]),U=h.useCallback(ae=>{z(ae)},[z]),V=h.useCallback(async ae=>{try{const me=await ot.quickStartProject(),pe=await me.json().catch(()=>({}));if(!me.ok||!pe?.project){console.error("[quick-start] failed:",pe);return}const be=pe.project;if(ae==="chat"){z(be);return}o(Ne=>Ne.some(xe=>xe.name===be.name)?Ne:[be,...Ne]),c(be),u(null),f(ae),t("/"),n&&g(!1)}catch(me){console.error("[quick-start] error:",me)}},[n,t,z]),O=h.useCallback(async()=>{await V("chat")},[V]),G=h.useCallback(async()=>{await V("orchestration")},[V]),$=h.useCallback((ae,me)=>{c(ae),u(null),f("orchestration"),me&&localStorage.setItem("pixcode.orchestration.selectedRunId",me),t("/"),n&&g(!1)},[n,t]),F=h.useCallback(ae=>{d?.id===ae&&(u(null),t("/")),o(me=>me.map(pe=>({...pe,sessions:pe.sessions?.filter(be=>be.id!==ae)??[],sessionMeta:{...pe.sessionMeta,total:Math.max(0,(pe.sessionMeta?.total??0)-1)}})))},[t,d?.id]),te=h.useCallback(async()=>{try{const me=await(await ot.projects()).json();if(o(Ne=>S4(Ne,me,!0)?me:Ne),!l)return;const pe=me.find(Ne=>Ne.name===l.name);if(!pe||(Qt(pe)!==Qt(l)&&c(pe),!d))return;const be=Pd(pe).find(Ne=>Ne.id===d.id);if(be){const Ne=be.__provider||!d.__provider?be:{...be,__provider:d.__provider};Qt(Ne)!==Qt(d)&&u(Ne)}}catch(ae){console.error("Error refreshing sidebar:",ae)}},[l,d]),Q=h.useCallback(ae=>{l?.name===ae&&(c(null),u(null),t("/")),o(me=>me.filter(pe=>pe.name!==ae))},[t,l?.name]),ge=h.useMemo(()=>({projects:s,selectedProject:l,selectedSession:d,onProjectSelect:P,onSessionSelect:H,onNewSession:U,onProjectCreated:z,onQuickStartSession:O,onOpenOrchestration:$,onSessionDelete:F,onProjectDelete:Q,isLoading:b,loadingProgress:y,onRefresh:te,onShowSettings:()=>S(!0),showSettings:E,settingsInitialTab:j,onCloseSettings:()=>S(!1),isMobile:n}),[U,$,z,O,Q,P,F,H,te,b,n,y,s,j,l,d,E]);return{projects:s,selectedProject:l,selectedSession:d,activeTab:p,sidebarOpen:m,isLoadingProjects:b,loadingProgress:y,isInputFocused:w,showSettings:E,settingsInitialTab:j,externalMessageUpdate:T,setActiveTab:f,setSidebarOpen:g,setIsInputFocused:k,setShowSettings:S,openSettings:N,fetchProjects:A,refreshProjectsSilently:I,sidebarSharedProps:ge,handleProjectSelect:P,handleSessionSelect:H,handleNewSession:U,handleOpenOrchestration:$,handleQuickStartOrchestration:G,handleSessionDelete:F,handleProjectDelete:Q,handleSidebarRefresh:te}}function Om(){const e=Pj(),{sessionId:t}=Fj(),{t:r}=Me("common"),{isMobile:n}=Lf({trackPWA:!1}),{ws:a,sendMessage:s,latestMessage:o,isConnected:l}=OE(),c=h.useRef(!1),{activeSessions:d,processingSessions:u,markSessionAsActive:p,markSessionAsInactive:f,markSessionAsProcessing:m,markSessionAsNotProcessing:g,replaceTemporarySession:b}=Vae(),{selectedProject:x,selectedSession:y,activeTab:v,sidebarOpen:w,isLoadingProjects:k,externalMessageUpdate:E,setActiveTab:S,setSidebarOpen:j,setIsInputFocused:_,setShowSettings:T,openSettings:C,refreshProjectsSilently:L,sidebarSharedProps:A,handleQuickStartOrchestration:I}=Zae({sessionId:t,navigate:e,latestMessage:o,isMobile:n,activeSessions:d});return h.useEffect(()=>(window.refreshProjects=L,()=>{window.refreshProjects===L&&delete window.refreshProjects}),[L]),h.useEffect(()=>(window.openSettings=C,()=>{window.openSettings===C&&delete window.openSettings}),[C]),h.useEffect(()=>{if(typeof navigator>"u"||!("serviceWorker"in navigator))return;const N=P=>{const H=P.data;if(!(!H||H.type!=="notification:navigate")){if(typeof H.provider=="string"&&H.provider.trim()&&localStorage.setItem("selected-provider",H.provider),S("chat"),j(!1),L(),typeof H.sessionId=="string"&&H.sessionId){e(`/session/${H.sessionId}`);return}e("/")}};return navigator.serviceWorker.addEventListener("message",N),()=>{navigator.serviceWorker.removeEventListener("message",N)}},[e,L,S,j]),h.useEffect(()=>{l&&!c.current?c.current=!0:l||(c.current=!1),l&&y?.id&&s({type:"get-pending-permissions",sessionId:y.id})},[l,y?.id,s]),h.useEffect(()=>{const N=window.visualViewport;if(!N)return;const P=()=>{const H=Math.max(0,window.innerHeight-N.height);document.documentElement.style.setProperty("--keyboard-height",`${H}px`)};return N.addEventListener("resize",P),()=>N.removeEventListener("resize",P)},[]),i.jsxs("div",{className:"fixed inset-0 flex bg-background",style:{bottom:"var(--keyboard-height, 0px)"},children:[n?i.jsxs("div",{className:`fixed inset-0 z-50 flex transition-all duration-150 ease-out ${w?"visible opacity-100":"invisible opacity-0"}`,children:[i.jsx("button",{className:"fixed inset-0 bg-background/60 backdrop-blur-sm transition-opacity duration-150 ease-out",onClick:N=>{N.stopPropagation(),j(!1)},onTouchStart:N=>{N.preventDefault(),N.stopPropagation(),j(!1)},"aria-label":r("versionUpdate.ariaLabels.closeSidebar")}),i.jsx("div",{className:`relative h-full w-[85vw] max-w-sm transform border-r border-border/40 bg-card transition-transform duration-150 ease-out sm:w-80 ${w?"translate-x-0":"-translate-x-full"}`,onClick:N=>N.stopPropagation(),onTouchStart:N=>N.stopPropagation(),children:i.jsx(Gk,{...A})})]}):i.jsx("div",{className:"h-full flex-shrink-0 border-r border-border/50",children:i.jsx(Gk,{...A})}),i.jsx("div",{className:"flex min-w-0 flex-1 flex-col",children:i.jsx(Fae,{selectedProject:x,selectedSession:y,activeTab:v,setActiveTab:S,ws:a,sendMessage:s,latestMessage:o,isMobile:n,onMenuClick:()=>j(!0),isLoading:k,onInputFocusChange:_,onSessionActive:p,onSessionInactive:f,onSessionProcessing:m,onSessionNotProcessing:g,processingSessions:u,onReplaceTemporarySession:b,onNavigateToSession:N=>e(`/session/${N}`),onShowSettings:()=>T(!0),externalMessageUpdate:E,onQuickStartSession:A.onQuickStartSession,onQuickStartOrchestration:I})}),i.jsx(Hae,{latestMessage:o})]})}const{slice:Xae,forEach:Jae}=[];function Qae(e){return Jae.call(Xae.call(arguments,1),t=>{if(t)for(const r in t)e[r]===void 0&&(e[r]=t[r])}),e}function eie(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 E4=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,tie=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(!E4.test(n.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${n.domain}`}if(n.path){if(!E4.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},N4={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=tie(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 rie={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return N4.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:r,cookieMinutes:n,cookieDomain:a,cookieOptions:s}=t;r&&typeof document<"u"&&N4.create(r,e,n,a,s)}},nie={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}},aie={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 ws=null;const C4=()=>{if(ws!==null)return ws;try{if(ws=typeof window<"u"&&window.localStorage!==null,!ws)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{ws=!1}return ws};var iie={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&C4())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:r}=t;r&&C4()&&window.localStorage.setItem(r,e)}};let ks=null;const A4=()=>{if(ks!==null)return ks;try{if(ks=typeof window<"u"&&window.sessionStorage!==null,!ks)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{ks=!1}return ks};var sie={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&A4())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:r}=t;r&&A4()&&window.sessionStorage.setItem(r,e)}},oie={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}},lie={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}},cie={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}},die={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 ej=!1;try{document.cookie,ej=!0}catch{}const tj=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];ej||tj.splice(1,1);const uie=()=>({order:tj,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class rj{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=Qae(r,this.options||{},uie()),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(rie),this.addDetector(nie),this.addDetector(iie),this.addDetector(sie),this.addDetector(oie),this.addDetector(lie),this.addDetector(cie),this.addDetector(die),this.addDetector(aie)}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&&!eie(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)}))}}rj.type="languageDetector";const pie={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"},mie={chat:"Chat",shell:"Shell",files:"Files",git:"Source Control",changes:"Changes",liveView:"Live View",tasks:"Tasks",orchestration:"Orchestration"},hie={loading:"Loading...",success:"Success",error:"Error",failed:"Failed",pending:"Pending",completed:"Completed",inProgress:"In Progress"},fie={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"},gie={settings:"Settings",home:"Home",back:"Back",next:"Next",previous:"Previous",logout:"Logout"},bie={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"},xie={justNow:"Just now",minutesAgo:"{{count}} mins ago",hoursAgo:"{{count}} hours ago",daysAgo:"{{count}} days ago",yesterday:"Yesterday"},yie={newFile:"New File",newFolder:"New Folder",rename:"Rename",move:"Move",copyPath:"Copy Path",openInEditor:"Open in Editor"},vie={loading:"Loading Pixcode",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",landing:{title:"Start a Pixcode workspace",description:"Choose a project, start a new chat, or launch Orchestration with one goal. Orchestration manages the CLI agents you select, shows every step, and surfaces errors directly.",startOrchestration:"Start Orchestration",startOrchestrationDescription:"Creates an automatic project and opens the Orchestration screen with agent control and run history.",startChat:"Start a new chat",startChatDescription:"Creates a folder automatically and opens the normal chat screen with one agent.",taskSystem:"Task system",taskSystemDescription:"Use the TaskMaster tab inside a project to track work items, status, and planned work.",sidebarHint:"When you select an existing project from the sidebar, chat history, files, git status, tasks, and orchestration stay in the same main screen.",createProject:"Create New Project",createProjectDescription:"Add an existing workspace or create a folder, then open the provider picker for coding."}},wie={title:"Orchestration",subtitle:"Give one goal inside {{project}}; choose the CLI workers, duplicate any CLI when needed, and assign work directly or let the coordinator split it.",refresh:"Refresh",goal:"Goal",goalPlaceholder:"Example: Fix the auth screen for single-port deployment, capture errors, and verify with lint and typecheck.",mode:"Run mode",systemPlan:"System plan",noMode:"No mode selected",loadingPlan:"Loading agent plan.",start:"Start team",starting:"Starting",stop:"Stop team",stopping:"Stopping",cancelFailed:"Workflow could not be stopped.",needAgent:"Enable at least one CLI worker.",needRoles:"Assign at least one enabled agent to these role(s) for this mode: {{roles}}.",startFailed:"Workflow could not start.",quickPrompts:{label:"Quick prompt:",liveTrading:{label:"8024 live trading screen",prompt:"Hi, please create a small project and then run it on port 8024. I want a Binance FAPI-connected TradingView-style design with a TradingView chart and a star/favorites system on the left. Split the work logically and manage the process automatically."}},cliControl:"CLI team",enabledCount:"{{count}} enabled",enabled:"Enabled",disabled:"Disabled",history:"History",emptyHistory:"No runs yet. Write a goal and start the agents.",steps:"{{done}}/{{total}} steps",notSelected:"No run selected",notSelectedDescription:"Select a previous run or start a new goal. Agent messages, errors, change summaries, and preview outputs appear here.",loadFailed:"Run details could not be loaded.",loadingRun:"Loading run...",teamHistory:"Team history",agentSteps:"Agent steps",changeSummary:"Change summary",noChangeSummary:"The final summary is not ready yet. A readable Markdown summary appears here when the agents finish.",prepareTeamFromReport:"Prepare agent team from this report",prepareTeamTitle:"Prepare agent team prompt",prepareTeamDescription:"The debate output was turned into a new Agent Team prompt. Edit it, then move it into Agent Team mode.",usePreparedPrompt:"Use prompt",reportToPromptPrefix:"Prepare and execute an agent team from the following debate/decision report. Split the needs into tasks, propose sensible assignments for the available CLI agents, and start only after user confirmation.",generatedSummaryTitle:"Automatic run summary",summaryStatus:"Overall status",summarySteps:"Completed steps",summaryFailures:"Failed steps",summaryCanceled:"Canceled steps",summaryDiffs:"Diff/change outputs",summaryPreviews:"Preview outputs",summaryErrorPrefix:"Error",assignedWork:"Assigned work",autoAssigned:"Automatic / coordinator decides",noStepOutput:"No step output.",agentMessages:"Agent messages",noAgentMessages:"This agent has not produced a message yet. If the run failed, the real CLI error appears above.",outputs:"Outputs",noOutputs:"No change summary, preview, or command output yet.",open:"Open",artifact:{fileDiff:"Change summary",previewUrl:"Preview",commandOutput:"Command output"},role:{user:"User",agent:"Agent"},status:{queued:"Queued",running:"Running",completed:"Completed",failed:"Failed",canceled:"Canceled",skipped:"Skipped"},nodes:{codex_review:"Codex review",gemini_review:"Gemini review",claude_review:"Claude review",claude_code_review:"Claude review",cursor_review:"Cursor review",aggregate:"Aggregate",architect:"Planning",implement:"Implementation",review:"Review",proposal:"Proposal",critique:"Critique",response:"Response",judge:"Decision",coordinator:"Coordinator",final_report:"Final report"},stages:{coordinator:"Coordinator",handoff:"Handoff",backend:"Backend",frontend:"Frontend",implementation:"Implementation",review:"Review",repair:"Repair",proposal:"Proposal",critique:"Critique",response:"Response",decision:"Decision",report:"Report",fallback:"Fallback",final_report:"Final report"},workflows:{multi_model_review:{name:"Multi-model review",description:"Enabled CLI agents review the same goal separately, then one enabled agent aggregates the result."},sequential_handoff:{name:"Sequential handoff",description:"Agents plan, implement, and review in order. Disabled CLI steps are skipped."},adversarial_debate:{name:"Decision debate",description:"Agents propose, critique, respond, and produce a final recommendation."},agent_team:{name:"Agent team",description:"A coordinator reads the goal and active CLI instances, assigns work, then collects the result."}},adapters:{"claude-code":{label:"Claude Code",role:"CLI worker"},cursor:{label:"Cursor",role:"CLI worker"},codex:{label:"Codex",role:"CLI worker"},gemini:{label:"Gemini",role:"CLI worker"},qwen:{label:"Qwen Code",role:"CLI worker"},opencode:{label:"OpenCode",role:"CLI worker"}},activeCount:"{{active}}/{{total}} active",teamHint:"Each row is one CLI worker. You can create multiple Claude, Codex, Cursor, Gemini, Qwen, or OpenCode workers and give each a different assignment.",parallelLimit:"Parallel limit",fallbackAgent:"Fallback CLI",noFallbackAgent:"No automatic fallback",fallbackAgentHint:"If a CLI step fails, Pixcode retries that step with this backup agent.",agentRole:"Stage",agentModel:"Model",agentRoles:{auto:"Auto",backend:"Backend",frontend:"Frontend",review:"Test / review",implementation:"Implementation",proposal:"Proposal",critique:"Critique",response:"Response",decision:"Decision / report",report:"Report",custom:"Custom"},customRolePlaceholder:"Example: Security, Mobile UX, DB architecture",roleHints:{default:"Leave empty and the coordinator assigns this agent from the goal.",agent_team:"Pick backend, frontend, or review stages, or leave agents on auto.",multi_model_review:"Enabled agents review; if a report role is selected, that agent aggregates the final summary.",sequential_handoff:"Agents run in your selected order; assignment text defines each step.",adversarial_debate:"Stage selection is optional in decision debate; if left empty, the system assigns selected agents to Proposal, Critique, and Response in order."},addAgent:"Add {{agent}}",soloAgent:"Run only with {{agent}}",soloAgentShort:"Solo",duplicateAgent:"Duplicate {{agent}}",removeAgent:"Remove {{agent}}",assignment:"Assignment",assignmentPlaceholder:"Optional: tell this worker exactly what to handle. Leave empty for coordinator assignment.",agentInstance:"{{name}} #{{number}}",taskTitle:"Task",taskTitlePlaceholder:"Implement feature",taskDescription:"Description",taskDescriptionPlaceholder:"Scope, constraints, expected output",addTask:"Add",runTask:"Run",cancelTask:"Cancel",dispatchTask:"Dispatch task",syncTaskMaster:"Sync TaskMaster",taskMasterSource:"TaskMaster",adapter:"Adapter",isolation:"Isolation",dispatch:"Dispatch",auto:"Auto",cliSettings:"CLI settings",waitingForStream:"Waiting for stream...",workflow:"Workflow",input:"Input",taskStates:{todo:"To Do",in_progress:"In Progress",in_review:"In Review",done:"Done",failed:"Failed",canceled:"Canceled"},isolationKind:{worktree:"Worktree",host:"Host",docker:"Docker"},workspaceTarget:"Target workspace",workspaceTargets:{selectedProject:"Selected project",pixcodeApp:"Pixcode system",custom:"Custom path"},customWorkspacePlaceholder:"/path/to/project",workspaceTargetHint:"Agents will run in: {{path}}",autoDetect:"auto-detect",needWorkspacePath:"Enter a custom workspace path."},kie={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",newFile:"New File (Cmd+N)",newFolder:"New Folder (Cmd+Shift+N)",refresh:"Refresh",collapseAll:"Collapse All",context:{rename:"Rename",delete:"Delete",copyPath:"Copy Path",download:"Download",newFile:"New File",newFolder:"New Folder",refresh:"Refresh",menuLabel:"File context menu",loading:"Loading..."}},Sie={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"},githubClone:{title:"Clone from GitHub",description:"Pick a target folder and clone a repository into it"},subfolder:{title:"Create Subfolder",description:"Pick a parent folder and create a fresh subfolder inside it"}},step2:{existingPath:"Workspace Path",newPath:"Workspace Path",subfolderParentPath:"Parent Folder",subfolderParentHelp:"Path to the folder where the new subfolder will be created",subfolderName:"Subfolder Name",subfolderNameHelp:"A new folder with this name will be created inside the parent above",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",subfolderWorkspace:"New Subfolder",path:"Path:",parentPath:"Parent Path:",subfolderName:"Subfolder Name:",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.",subfolderInfo:"A new subfolder will be created inside the parent folder and added to your project list.",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",provideSubfolderName:"Please provide a name for the subfolder",subfolderNameInvalid:"Subfolder name cannot contain path separators or be . / ..",failedToCreate:"Failed to create workspace",failedToCreateFolder:"Failed to create folder"}},Eie={genericTool:"a tool",codes:{generic:{info:{title:"Notification"}},permission:{required:{title:"Action Required",body:"{{toolName}} is waiting for your decision."}},run:{stopped:{title:"Run Stopped",body:"Reason: {{reason}}"},failed:{title:"Run Failed"}},agent:{notification:{title:"Agent Notification"}}}},Nie={title:"Update Available",newVersionReady:"A new version is ready",currentVersion:"Current Version",latestVersion:"Latest Version",latestRelease:"Latest Release",releaseNotesTitle:"Release Notes",releaseNotesSubtitle:"Latest Pixcode changes",whatsNew:"What's New:",viewFullRelease:"View full release",updateProgress:"Update Progress:",manualUpgrade:"Manual upgrade:",npmUpgradeCommand:"npm install -g @pixelbyte-software/pixcode@latest",manualUpgradeHint:'Or click "Update Now" to run the update automatically.',updateCompleted:"Update completed successfully!",restartServer:"Please restart the server to apply changes.",updateFailed:"Update failed",buttons:{close:"Close",later:"Later",copyCommand:"Copy Command",updateNow:"Update Now",updating:"Updating..."},ariaLabels:{closeModal:"Close version upgrade modal",showSidebar:"Show sidebar",settings:"Settings",updateAvailable:"Update available",closeSidebar:"Close sidebar"}},Cie={title:"Live View",subtitle:"Run this project locally and share it through the active secure tunnel when one is running.",start:"Start",restart:"Restart",stop:"Stop",runnerError:"Runner error",runnerUnavailable:"Runner unavailable",managedRuntimePreparing:"Pixcode will prepare the runtime",managedRuntimeDescription:"Press Start and Pixcode will prepare the required local runtime automatically.",preparingRuntime:"Preparing runtime…",preparingRuntimeDescription:"Pixcode is downloading and installing the runtime locally. This can take a moment on first use.",runnerErrorFallback:"The runner stopped before the preview became available.",detecting:"Detecting project runner…",noRunner:"No runner detected",staticHint:"Static HTML will be served directly when index.html exists.",customCommand:"Custom command",customPlaceholder:"npm run dev, python app.py, go run .",viewport:"Viewport",viewportDesktop:"Desktop",viewportTablet:"Tablet",viewportMobile:"Mobile",viewportWidth:"Width",viewportHeight:"Height",controls:"Runner, viewport and logs",shareLink:"Share link",starting:"Starting",openExternal:"Open externally",externalActive:"Secure tunnel is active; this link can be shared outside your network.",localOnly:"External Access is off; this link is local to this Pixcode server.",frameTitle:"Project Live View",emptyTitle:"Start Live View",emptyDescription:"Pixcode will detect the project stack, start the local web server, and expose it here."},Aie={buttons:pie,tabs:mie,status:hie,messages:fie,navigation:gie,common:bie,time:xie,fileOperations:yie,mainContent:vie,orchestration:wie,fileTree:kie,projectWizard:Sie,notifications:Eie,versionUpdate:Nie,liveView:Cie},Tie="Settings",jie={account:"Account",permissions:"Permissions",mcpServers:"MCP Servers",pluginsMcp:"Plugins / MCP",configuration:"Configuration",appearance:"Appearance"},_ie={title:"Account",language:"Language",languageLabel:"Display Language",languageDescription:"Choose your preferred language for the interface",username:"Username",email:"Email",profile:"Profile",changePassword:"Change Password"},Iie={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"}},Rie={title:"Appearance",theme:"Theme",codeEditor:"Code Editor",editorTheme:"Editor Theme",wordWrap:"Word Wrap",showMinimap:"Show Minimap",lineNumbers:"Line Numbers",fontSize:"Font Size"},Lie={saveChanges:"Save Changes",resetToDefaults:"Reset to Defaults",cancelChanges:"Cancel Changes"},Die={title:"Quick Settings",sections:{appearance:"Appearance",toolDisplay:"Tool Display",viewOptions:"View Options",inputSettings:"Input Settings",changeAwareness:"Command Center"},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.",changeAwareness:"Command Center",changedFiles:{title:"Changed files",description:"Tracks local file changes and opens the Files panel when a new change appears.",noProject:"Select a project to track local changes.",refresh:"Refresh changed files",empty:"No local changes detected",disabled:"Enable Command Center to watch local changes.",more:"+{{count}} more files",lastChecked:"Checked {{value}}",guideTitle:"Right panel guide",guideFiles:"Changed files glow green in Files.",guidePanel:"New changes appear beside the active chat.",status:{M:"M",A:"A",D:"D",U:"U"}},dragHandle:{dragging:"Dragging handle",closePanel:"Close settings panel",openPanel:"Open settings panel",draggingStatus:"Dragging...",toggleAndMove:"Click to toggle, drag to move"}},Oie={title:"Terminal Shortcuts",sectionKeys:"Keys",sectionNavigation:"Navigation",escape:"Escape",tab:"Tab",shiftTab:"Shift+Tab",arrowUp:"Arrow Up",arrowDown:"Arrow Down",scrollDown:"Scroll Down",handle:{closePanel:"Close shortcuts panel",openPanel:"Open shortcuts panel"}},Mie={label:"Settings",agents:"Agents",appearance:"Appearance",git:"Git",apiTokens:"API & Tokens",tasks:"Tasks",notifications:"Notifications",plugins:"Plugins",mobile:"Use from Mobile",telegram:"Telegram",diagnostics:"Diagnostics",about:"About"},Pie={title:"Use from Mobile",description:"Scan a QR code with your phone to open Pixcode on any device in the same network.",refresh:"Refresh",copy:"Copy",copied:"Copied!",loading:"Detecting network addresses…",noEndpoints:"No LAN addresses were detected. Make sure your device is connected to a network.",error:"Could not load network endpoints.",hostLabel:"Host",portLabel:"Port",steps:{sameNetwork:"Connect your phone to the same Wi-Fi network as this computer.",scan:"Open the camera app and scan one of the QR codes below.",login:"Sign in with your Pixcode credentials the first time."},external:{title:"External Access",description:"Expose Pixcode beyond your local network so you can reach it from the internet.",upnpTitle:"Router port mapping (UPnP)",upnpDescription:"One-click port forwarding via your router. Works on most home routers; fails silently on CGNAT or enterprise networks.",upnpEnable:"Enable UPnP",upnpDisable:"Disable UPnP",upnpEnabled:"UPnP mapping active",upnpUnsupported:"UPnP is not available on this network.",tunnelTitle:"Secure tunnel",tunnelDescription:"If UPnP is unavailable, install cloudflared or ngrok and start a tunnel — we'll auto-detect and show the QR here.",tunnelStart:"Start tunnel",tunnelStop:"Stop tunnel",tunnelRunning:"Tunnel running",tunnelUnavailable:"No tunnel binary found on this machine.",externalUrl:"External URL"}},Fie={title:"Telegram",description:"Receive task completion notifications and chat with your agents from Telegram.",comingSoon:"Telegram integration is being prepared.",botToken:"Bot Token",botTokenPlaceholder:"123456:ABC-DEF…",botTokenHelp:"Create a bot with @BotFather and paste the token here.",saveToken:"Save & Start Bot",saving:"Saving…",botRunning:"Bot running as @{{username}}",botStopped:"Bot stopped",stopBot:"Stop Bot",removeToken:"Remove Token",pairing:{title:"Pair with your Telegram account",description:"Message your bot, then enter this 6-digit code inside the chat. The code refreshes every 10 minutes.",code:"Pairing Code",regenerate:"Generate new code",verified:"Paired with Telegram account",notPaired:"No Telegram account paired yet."},linkedAccount:{title:"Paired Account",username:"@{{username}}",language:"Replies in {{language}}",unpair:"Unpair"},notifications:{title:"Notifications",description:"Send agent completion and error events to your Telegram chat.",enabled:"Enabled",disabled:"Disabled"},bridge:{title:"Chat Bridge",description:"Messages you send to the bot become prompts for your most recent session. Replies come back to Telegram.",enabled:"Enabled",disabled:"Disabled"},control:{title:"Remote Control",description:"Use Telegram as a full Pixcode control surface for agents, orchestration, provider setup, and run status.",enabled:"Enable Telegram control",enabledDescription:"When enabled, paired Telegram messages can start agent and orchestration work on the selected project.",progressMode:"Progress mode",progressModeDescription:"Choose how much run output Telegram should send back.",progressModes:{final:"Final answer only",steps:"Important steps and final answer",all:"All visible step changes"},selectedProject:"Selected project",selectedProvider:"Selected provider",selectedModel:"Selected model",selectedWorkflow:"Selected workflow"},errors:{invalidToken:"Telegram rejected this bot token.",networkError:"Could not reach Telegram servers."}},zie={title:"Notifications",description:"Control which notification events you receive.",webPush:{title:"Web Push Notifications",enable:"Enable Push Notifications",disable:"Disable Push Notifications",enabled:"Push notifications are enabled",loading:"Updating...",unsupported:"Push notifications are not supported in this browser.",denied:"Push notifications are blocked. Please allow them in your browser settings."},events:{title:"Event Types",actionRequired:"Action required",stop:"Run stopped",error:"Run failed",updates:"App and CLI updates"}},Bie={darkMode:{label:"Dark Mode",description:"Toggle between light and dark themes"},colorTheme:{title:"Color theme",palette:{label:"Accent palette",description:"Choose the product accent used by buttons, focus rings, navigation, and active states."},custom:{label:"Custom light/dark colors",description:"Pick separate accent colors for light and dark mode. Select Custom above to use them.",light:"Light",dark:"Dark"}},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"}}},$ie={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"}},Uie={success:"Settings saved successfully!",error:"Failed to save settings",saving:"Saving..."},Gie={save:"Save Settings",cancel:"Cancel"},Hie={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"}},Vie={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}}"}},qie={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"}},Wie={status:{title:"CLI status",notChecked:"Not checked yet",lastChecked:"Last checked: {{value}}",updatesFound:"{{count}} update available",refresh:"Refresh CLI status"},config:{blurb:"View or edit the files the {{name}} CLI reads on startup. Saves write directly to your home directory.",refresh:"Refresh",save:"Save",revert:"Revert",saved:"Saved",loading:"Loading…",notCreated:"new",readonly:"read-only",noFiles:"No config files are registered for this agent yet."},cliVersion:{title:"CLI version",installed:"Installed: {{version}}",unknownInstalled:"Installed version unknown",latest:"Latest: {{version}}",checkedAt:"Checked: {{value}}",cached:"cached",updateAvailable:"Update available",refresh:"Refresh",skipped:{external_installer:"External installer",installed_version_unavailable:"Installed version unavailable",latest_version_unavailable:"Latest version unavailable",not_installed:"Not installed"}},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"},gemini:{description:"Google Gemini AI assistant"},qwen:{description:"Alibaba Qwen Code CLI (Gemini CLI fork)"},opencode:{description:"Multi-provider terminal coding agent — Claude, OpenAI, Gemini, or local models"}},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}}"},Kie={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",opencodeDescription:"Equivalent to --dangerously-skip-permissions flag in OpenCode"},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"},opencodeAllowed:{title:"Allowed Bash Patterns",description:"Bash command patterns OpenCode auto-approves without prompting",placeholder:'e.g., "git *" or "npm test"',quickAdd:"Quick add common patterns:",empty:"No allowed patterns configured"},opencodeBlocked:{title:"Blocked Bash Patterns",description:"Bash command patterns OpenCode always denies",placeholder:'e.g., "rm -rf *" or "sudo *"',empty:"No blocked patterns configured"},opencodeExamples:{title:"Pattern Examples:",gitAll:"- Allow all git commands",gitPush:"- Block git push specifically",rmRf:"- Block recursive delete",npm:"- Allow all npm commands"},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"}},Yie={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."}},Zie={updateCheckFrequency:"Update check frequency",updateCheckFrequencyHint:"Pixcode caches GitHub release checks locally so shared IPs do not hit GitHub rate limits.",updateCheckFrequencyOptions:{"30m":"Every 30 minutes","6h":"Every 6 hours","12h":"Every 12 hours","24h":"Daily","7d":"Weekly",off:"Manual only"},checkForUpdate:"Check for updates",checkingForUpdate:"Checking...",updateFound:"Update found",upToDate:"Up to date",lastChecked:"Last checked {{when}}",notCheckedYet:"Update check has not completed yet",checkFailed:"check failed or delayed by rate limit"},Xie={title:"Plugins",description:"Extend the interface with custom plugins. Install from git or drop a folder in ~/.pixcode/plugins/",installPlaceholder:"https://github.com/user/my-plugin",installButton:"Install",installing:"Installing…",securityWarning:"Only install plugins whose source code you have reviewed or from authors you trust.",scanningPlugins:"Scanning plugins…",noPluginsInstalled:"No plugins installed",pullLatest:"Pull latest from git",noGitRemote:"No git remote — update not available",uninstallPlugin:"Uninstall plugin",confirmUninstall:"Click again to confirm",confirmUninstallMessage:"Remove {{name}}? This cannot be undone.",cancel:"Cancel",remove:"Remove",updateFailed:"Update failed",installFailed:"Installation failed",uninstallFailed:"Uninstall failed",toggleFailed:"Toggle failed",starterPluginLabel:"Starter Plugin",starter:"Starter",docs:"Docs",starterPlugin:{name:"Project Stats",badge:"starter",description:"File counts, lines of code, file-type breakdown, and recent activity for your project.",install:"Install"},terminalPlugin:{name:"Terminal",badge:"official",description:"Integrated terminal with full shell access directly within the interface.",install:"Install"},morePlugins:"More",enable:"Enable",disable:"Disable",installAriaLabel:"Plugin git repository URL",tab:"tab",runningStatus:"running"},Jie={title:Tie,tabs:jie,account:_ie,mcp:Iie,appearance:Rie,actions:Lie,quickSettings:Die,terminalShortcuts:Oie,mainTabs:Mie,mobile:Pie,telegram:Fie,notifications:zie,appearanceSettings:Bie,mcpForm:$ie,saveStatus:Uie,footerActions:Gie,git:Hie,apiKeys:Vie,tasks:qie,agents:Wie,permissions:Kie,mcpServers:Yie,about:Zie,pluginSettings:Xie},Qie={title:"Welcome Back",description:"Sign in to your Pixcode self-hosted account",username:"Username",password:"Password",submit:"Sign In",loading:"Signing in...",errors:{invalidCredentials:"Invalid username or password",requiredFields:"Please fill in all fields",networkError:"Network error. Please try again."},placeholders:{username:"Enter your username",password:"Enter your password"}},ese={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"}},tse={title:"Sign Out",confirm:"Are you sure you want to sign out?",button:"Sign Out"},rse={login:Qie,register:ese,logout:tse},nse={title:"Projects",newProject:"New Project",deleteProject:"Remove Project",renameProject:"Rename Project",noProjects:"No projects found",loadingProjects:"Loading projects...",searchPlaceholder:"Search projects...",projectNamePlaceholder:"Project name",starred:"Starred",all:"All",untitledSession:"Untitled Session",newSession:"New Session",codexSession:"Codex Session",fetchingProjects:"Fetching your Claude projects and sessions",projects:"projects",detectedFromHistory:"Detected from history",noMatchingProjects:"No matching projects",tryDifferentSearch:"Try adjusting your search term",runClaudeCli:"Run Claude CLI in a project directory to get started"},ase={title:"Pixcode",subtitle:"AI coding assistant interface"},ise={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",startToSee:"Start a new session to see it here."},sse={section:"Orchestration",fallbackTitle:"Orchestration run"},ose={flat:"Recent",grouped:"By project"},lse={viewEnvironments:"View Environments",hideSidebar:"Hide sidebar",createProject:"Create new project",refresh:"Refresh projects and sessions (Ctrl+R)",renameProject:"Rename project (F2)",deleteProject:"Remove project from sidebar (Delete)",addToFavorites:"Add to favorites",removeFromFavorites:"Remove from favorites",editSessionName:"Manually edit session name",deleteSession:"Delete this session permanently",sessionActions:"Session actions",historyView:"History view",historyViewFlat:"Recent conversations",historyViewGrouped:"Grouped by project",save:"Save",cancel:"Cancel",clearSearch:"Clear search"},cse={chat:"Chat",files:"Files",git:"Git",terminal:"Terminal",tasks:"Tasks"},dse={refresh:"Refresh",settings:"Settings",collapseAll:"Collapse All",expandAll:"Expand All",cancel:"Cancel",save:"Save",delete:"Delete",rename:"Rename",starSession:"Star",unstarSession:"Remove star",joinCommunity:"Join Community",reportIssue:"Report Issue",starOnGithub:"Star on GitHub"},use={openSource:"Open Source"},pse={active:"Active",inactive:"Inactive",thinking:"Thinking...",error:"Error",aborted:"Aborted",unknown:"Unknown"},mse={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",buckets:{today:"Today",yesterday:"Yesterday",thisWeek:"Previous 7 days",thisMonth:"Previous 30 days",older:"Older"}},hse={deleteConfirm:"Are you sure you want to delete this?",renameSuccess:"Renamed successfully",deleteSuccess:"Deleted successfully",errorOccurred:"An error occurred",deleteSessionConfirm:"Are you sure you want to delete this session? This action cannot be undone.",deleteProjectConfirm:"Remove this project from the sidebar? Your project files, memories, and session data will not be deleted.",enterProjectPath:"Please enter a project path",deleteSessionFailed:"Failed to delete session. Please try again.",deleteSessionError:"Error deleting session. Please try again.",renameSessionFailed:"Failed to rename session. Please try again.",renameSessionError:"Error renaming session. Please try again.",deleteProjectFailed:"Failed to remove project. Please try again.",deleteProjectError:"Error removing project. Please try again.",createProjectFailed:"Failed to create project. Please try again.",createProjectError:"Error creating project. Please try again."},fse={updateAvailable:"Update available"},gse={modeProjects:"Projects",modeConversations:"Conversations",conversationsPlaceholder:"Search in conversations...",searching:"Searching...",noResults:"No results found",tryDifferentQuery:"Try a different search query",matches_one:"{{count}} match",matches_other:"{{count}} matches",projectsScanned_one:"{{count}} project scanned",projectsScanned_other:"{{count}} projects scanned"},bse={deleteProject:"Remove Project",deleteSession:"Delete Session",confirmDelete:"What would you like to do with",sessionCount_one:"This project contains {{count}} conversation.",sessionCount_other:"This project contains {{count}} conversations.",removeFromSidebar:"Remove from sidebar only",deleteAllData:"Delete all data permanently",allConversationsDeleted:"The project will be removed from the sidebar. Your files, memories, and session data will be preserved.",cannotUndo:"You can re-add the project later."},xse={projects:nse,app:ase,sessions:ise,orchestration:sse,historyView:ose,tooltips:lse,navigation:cse,actions:dse,branding:use,status:pse,time:mse,messages:hse,version:fse,search:gse,deleteConfirmation:bse},yse={copy:"Copy",copied:"Copied",copyCode:"Copy code"},vse={copy:"Copy message",copied:"Message copied",selectFormat:"Select copy format",copyAsMarkdown:"Copy as markdown",copyAsText:"Copy as text"},wse={user:"U",error:"Error",tool:"Tool",claude:"Claude",cursor:"Cursor",codex:"Codex",gemini:"Gemini",qwen:"Qwen Code"},kse={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"},Sse={found:"Found {{count}} {{type}}",file:"file",files:"files",pattern:"pattern:",in:"in:"},Ese={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"},Nse={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."},Cse={title:"Thinking...",emoji:"💭 Thinking..."},Ase={response:"JSON Response"},Tse={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"},jse={updated:"Todo list has been updated successfully",current:"Current Todo List"},_se={viewPlan:"📋 View implementation plan",title:"Implementation Plan"},Ise={resetAt:"Claude usage limit reached. Your limit will reset at **{{time}} {{timezone}}** - {{date}}"},Rse={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"},Lse={permissionMode:"Gemini Permission Mode",description:"Control how Gemini CLI handles operation approvals.",modes:{default:{title:"Standard (Ask for Approval)",description:"Gemini will prompt for approval before executing commands, writing files, and fetching web resources."},autoEdit:{title:"Auto Edit (Skip File Approvals)",description:"Gemini will automatically approve file edits and web fetches, but will still prompt for shell commands."},yolo:{title:"YOLO (Bypass All Permissions)",description:"Gemini will execute all operations without asking for approval. Exercise caution."}}},Dse={permissionMode:"Qwen Permission Mode",description:"Control how Qwen Code handles operation approvals.",modes:{default:{title:"Standard (Ask for Approval)",description:"Qwen Code will prompt for approval before executing commands, writing files, and fetching web resources."},autoEdit:{title:"Auto Edit (Skip File Approvals)",description:"Qwen Code will automatically approve file edits and web fetches, but will still prompt for shell commands."},yolo:{title:"YOLO (Bypass All Permissions)",description:"Qwen Code will execute all operations without asking for approval. Exercise caution."}}},Ose={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",clickToChangeMode:"Click to change permission mode (or press Tab in input)",showAllCommands:"Show all commands",clearInput:"Clear input",scrollToBottom:"Scroll to bottom"},Mse={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}}"},Pse={title:"Choose Your AI Assistant",description:"Select a provider to start a new conversation",selectModel:"Select Model",providerInfo:{anthropic:"by Anthropic",openai:"by OpenAI",cursorEditor:"AI Code Editor",google:"by Google"},readyPrompt:{claude:"Ready to use Claude with {{model}}. Start typing your message below.",cursor:"Ready to use Cursor with {{model}}. Start typing your message below.",codex:"Ready to use Codex with {{model}}. Start typing your message below.",gemini:"Ready to use Gemini with {{model}}. Start typing your message below.",default:"Select a provider above to begin"}},Fse={continue:{title:"Continue your conversation",description:"Ask questions about your code, request changes, or get help with development tasks"},loading:{olderMessages:"Loading older messages...",sessionMessages:"Loading session messages..."},messages:{showingOf:"Showing {{shown}} of {{total}} messages",scrollToLoad:"Scroll up to load more",showingLast:"Showing last {{count}} messages ({{total}} total)",loadEarlier:"Load earlier messages",loadAll:"Load all messages",loadingAll:"Loading all messages...",allLoaded:"All messages loaded",perfWarning:'All messages loaded — scrolling may be slower. Click "Scroll to bottom" to restore performance.'}},zse={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"},Bse={actions:{thinking:"Thinking",processing:"Processing",analyzing:"Analyzing",working:"Working",computing:"Computing",reasoning:"Reasoning"},state:{live:"Live",paused:"Paused"},elapsed:{seconds:"{{count}}s",minutesSeconds:"{{minutes}}m {{seconds}}s",label:"{{time}} elapsed",startingNow:"Starting now"},controls:{stopGeneration:"Stop Generation",pressEscToStop:"Press Esc anytime to stop"},providers:{assistant:"Assistant"}},$se={startChatWithProvider:"Select a project to start chatting with {{provider}}"},Use={nextTaskPrompt:"Start the next task"},Gse={codeBlock:yse,copyMessage:vse,messageTypes:wse,tools:kse,search:Sse,fileOperations:Ese,interactive:Nse,thinking:Cse,json:Ase,permissions:Tse,todo:jse,plan:_se,usageLimit:Ise,codex:Rse,gemini:Lse,qwen:Dse,input:Ose,thinkingMode:Mse,providerSelection:Pse,session:Fse,shell:zse,claudeStatus:Bse,projectSelection:$se,tasks:Use},Hse={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"},Vse="Loading {{fileName}}...",qse={showingChanges:"Showing changes"},Wse={download:"Download file",save:"Save",saving:"Saving...",saved:"Saved!",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",close:"Close",previewMarkdown:"Preview markdown",editMarkdown:"Edit markdown"},Kse={lines:"Lines:",characters:"Characters:",shortcuts:"Press Ctrl+S to save • Esc to close"},Yse={title:"Binary File",message:'The file "{{fileName}}" cannot be displayed in the text editor because it is a binary file.'},Zse={toolbar:Hse,loading:Vse,header:qse,actions:Wse,footer:Kse,binaryFile:Yse},Xse={title:"TaskMaster AI is not configured",description:"TaskMaster helps break down complex projects into manageable tasks with AI-powered assistance",whatIsTitle:"🎯 What is TaskMaster?",features:{aiPowered:"AI-Powered Task Management: Break complex projects into manageable subtasks",prdTemplates:"PRD Templates: Generate tasks from Product Requirements Documents",dependencyTracking:"Dependency Tracking: Understand task relationships and execution order",progressVisualization:"Progress Visualization: Kanban boards and detailed task analytics",cliIntegration:"CLI Integration: Use taskmaster commands for advanced workflows"},initializeButton:"Initialize TaskMaster AI"},Jse={title:"Getting Started with TaskMaster",subtitle:"TaskMaster is initialized! Here's what to do next:",steps:{createPRD:{title:"Create a Product Requirements Document (PRD)",description:"Discuss your project idea and create a PRD that describes what you want to build.",addButton:"Add PRD",existingPRDs:"Existing PRDs:"},generateTasks:{title:"Generate Tasks from PRD",description:"Once you have a PRD, ask your AI assistant to parse it and TaskMaster will automatically break it down into manageable tasks with implementation details."},analyzeTasks:{title:"Analyze & Expand Tasks",description:"Ask your AI assistant to analyze task complexity and expand them into detailed subtasks for easier implementation."},startBuilding:{title:"Start Building",description:"Ask your AI assistant to begin working on tasks, update their status, and add new tasks as your project evolves."}},tip:"💡 Tip: Start with a PRD to get the most out of TaskMaster's AI-powered task generation"},Qse={title:"TaskMaster Setup",subtitle:"Interactive CLI for {{projectName}}",willStart:"TaskMaster initialization will start automatically",completed:"TaskMaster setup completed! You can now close this window.",closeButton:"Close",closeContinueButton:"Close & Continue"},eoe={title:"Getting Started with TaskMaster",subtitle:"Your guide to productive task management",examples:{parsePRD:`💬 Example:
|
|
849
|
+
`).length]}),i.jsxs("span",{children:[r," ",e.length]})]}),i.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:n})]})}function cae({file:e,isSidebar:t,isFullscreen:r,isMarkdownFile:n,markdownPreview:a,saving:s,saveSuccess:o,onToggleMarkdownPreview:l,onOpenSettings:c,onDownload:d,onSave:u,onToggleFullscreen:p,onClose:f,labels:m}){const g=o?m.saved:s?m.saving:m.save;return i.jsxs("div",{className:"flex min-w-0 flex-shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:[i.jsx("div",{className:"flex min-w-0 flex-1 shrink items-center gap-2",children:i.jsxs("div",{className:"min-w-0 shrink",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[i.jsx("h3",{className:"truncate text-sm font-medium text-gray-900 dark:text-white",children:e.name}),e.diffInfo&&i.jsx("span",{className:"shrink-0 whitespace-nowrap rounded bg-blue-100 px-1.5 py-0.5 text-[10px] text-blue-600 dark:bg-blue-900 dark:text-blue-300",children:m.showingChanges})]}),i.jsx("p",{className:"truncate text-xs text-gray-500 dark:text-gray-400",children:e.path})]})}),i.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[n&&i.jsx("button",{type:"button",onClick:l,className:`flex items-center justify-center rounded-md p-1.5 transition-colors ${a?"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400":"text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white"}`,title:a?m.editMarkdown:m.previewMarkdown,children:a?i.jsx(Qo,{className:"h-4 w-4"}):i.jsx(Yi,{className:"h-4 w-4"})}),i.jsx("button",{type:"button",onClick:c,className:"flex items-center justify-center rounded-md p-1.5 text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",title:m.settings,children:i.jsx(Lt,{className:"h-4 w-4"})}),i.jsx("button",{type:"button",onClick:d,className:"flex items-center justify-center rounded-md p-1.5 text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",title:m.download,children:i.jsx(ta,{className:"h-4 w-4"})}),i.jsx("button",{type:"button",onClick:u,disabled:s,className:`flex items-center justify-center rounded-md p-1.5 transition-colors disabled:opacity-50 ${o?"bg-green-50 text-green-600 dark:bg-green-900/30 dark:text-green-400":"text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white"}`,title:g,children:o?i.jsx("svg",{className:"h-4 w-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(Ll,{className:"h-4 w-4"})}),!t&&i.jsx("button",{type:"button",onClick:p,className:"flex items-center justify-center rounded-md p-1.5 text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",title:r?m.exitFullscreen:m.fullscreen,children:r?i.jsx(gE,{className:"h-4 w-4"}):i.jsx(Gd,{className:"h-4 w-4"})}),i.jsx("button",{type:"button",onClick:f,className:"flex items-center justify-center rounded-md p-1.5 text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",title:m.close,children:i.jsx(xt,{className:"h-4 w-4"})})]})]})}function dae({isDarkMode:e,isSidebar:t,loadingText:r}){return i.jsxs(i.Fragment,{children:[i.jsx("style",{children:nae(e)}),t?i.jsx("div",{className:"flex h-full w-full items-center justify-center bg-background",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-b-2 border-blue-600"}),i.jsx("span",{className:"text-gray-900 dark:text-white",children:r})]})}):i.jsx("div",{className:"fixed inset-0 z-[9999] md:flex md:items-center md:justify-center md:bg-black/50",children:i.jsx("div",{className:"code-editor-loading flex h-full w-full items-center justify-center p-8 md:h-auto md:w-auto md:rounded-lg",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-b-2 border-blue-600"}),i.jsx("span",{className:"text-gray-900 dark:text-white",children:r})]})})})]})}function uae({content:e,onChange:t,markdownPreview:r,isMarkdownFile:n,isDarkMode:a,fontSize:s,showLineNumbers:o,extensions:l}){return r&&n?i.jsx("div",{className:"h-full overflow-y-auto bg-white dark:bg-gray-900",children:i.jsx("div",{className:"prose prose-sm mx-auto max-w-none px-8 py-6 dark:prose-invert prose-headings:font-semibold prose-a:text-blue-600 prose-code:text-sm prose-pre:bg-gray-900 prose-img:rounded-lg dark:prose-a:text-blue-400",children:i.jsx(c6,{content:e})})}):i.jsx(hf,{value:e,onChange:t,extensions:l,theme:a?ff:void 0,height:"100%",style:{fontSize:`${s}px`,height:"100%"},basicSetup:{lineNumbers:o,foldGutter:!0,dropCursor:!1,allowMultipleSelections:!1,indentOnInput:!0,bracketMatching:!0,closeBrackets:!0,autocompletion:!0,highlightSelectionMatches:!0,searchKeymap:!0}})}function pae({file:e,isSidebar:t,isFullscreen:r,onClose:n,onToggleFullscreen:a,title:s,message:o}){const l=i.jsx("div",{className:"flex h-full w-full flex-col items-center justify-center bg-background p-8 text-muted-foreground",children:i.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 text-center",children:[i.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:i.jsx("svg",{className:"h-8 w-8 text-muted-foreground",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),i.jsxs("div",{children:[i.jsx("h3",{className:"mb-2 text-lg font-medium text-foreground",children:s}),i.jsx("p",{className:"text-sm text-muted-foreground",children:o})]}),i.jsx("button",{onClick:n,className:"mt-4 rounded-md bg-primary px-4 py-2 text-sm text-primary-foreground transition-colors hover:bg-primary/90",children:"Close"})]})});if(t)return i.jsxs("div",{className:"flex h-full w-full flex-col bg-background",children:[i.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between border-b border-border px-3 py-1.5",children:[i.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:i.jsx("h3",{className:"truncate text-sm font-medium text-gray-900 dark:text-white",children:e.name})}),i.jsx("button",{type:"button",onClick:n,className:"flex items-center justify-center rounded-md p-1.5 text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",title:"Close",children:i.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),l]});const c=r?"fixed inset-0 z-[9999] bg-background flex flex-col":"fixed inset-0 z-[9999] md:bg-black/50 md:flex md:items-center md:justify-center md:p-4",d=r?"bg-background flex flex-col w-full h-full":"bg-background shadow-2xl flex flex-col w-full h-full md:rounded-lg md:shadow-2xl md:w-full md:max-w-2xl md:h-auto md:max-h-[60vh]";return i.jsx("div",{className:c,children:i.jsxs("div",{className:d,children:[i.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between border-b border-border px-3 py-1.5",children:[i.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:i.jsx("h3",{className:"truncate text-sm font-medium text-gray-900 dark:text-white",children:e.name})}),i.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[i.jsx("button",{type:"button",onClick:a,className:"flex items-center justify-center rounded-md p-1.5 text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",title:r?"Exit fullscreen":"Fullscreen",children:r?i.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 9V4.5M9 9H4.5M9 9L3.5 3.5M9 15v4.5M9 15H4.5M9 15l-5.5 5.5M15 9h4.5M15 9V4.5M15 9l5.5-5.5M15 15h4.5M15 15v4.5m0-4.5l5.5 5.5"})}):i.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"})})}),i.jsx("button",{type:"button",onClick:n,className:"flex items-center justify-center rounded-md p-1.5 text-gray-600 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",title:"Close",children:i.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),l]})})}function f4({file:e,onClose:t,projectPath:r,isSidebar:n=!1,isExpanded:a=!1,onToggleExpand:s=null,onPopOut:o=null}){const{t:l}=Me("codeEditor"),[c,d]=h.useState(!1),[u,p]=h.useState(!!e.diffInfo),[f,m]=h.useState(!1),{isDarkMode:g,wordWrap:b,minimapEnabled:x,showLineNumbers:y,fontSize:v}=zne(),{content:w,setContent:k,loading:E,saving:S,saveSuccess:j,saveError:_,isBinary:T,handleSave:C,handleDownload:L}=Fne({file:e,projectPath:r}),A=h.useMemo(()=>{const V=e.name.split(".").pop()?.toLowerCase();return V==="md"||V==="markdown"},[e.name]),I=h.useMemo(()=>tae({file:e,showDiff:u,minimapEnabled:x,isDarkMode:g}),[e,g,x,u]),N=h.useMemo(()=>rae({file:e,showDiff:u}),[e,u]),P=h.useMemo(()=>oae({file:e,showDiff:u,isSidebar:n,isExpanded:a,onToggleDiff:()=>p(V=>!V),onPopOut:o,onToggleExpand:s,labels:{changes:l("toolbar.changes"),previousChange:l("toolbar.previousChange"),nextChange:l("toolbar.nextChange"),hideDiff:l("toolbar.hideDiff"),showDiff:l("toolbar.showDiff"),collapse:l("toolbar.collapse"),expand:l("toolbar.expand")}}),[e,a,n,o,s,u,l]),H=h.useMemo(()=>{const V=[...eae(e.name),...P];return e.diffInfo&&u&&e.diffInfo.old_string!==void 0&&(V.push(Ane({original:e.diffInfo.old_string,mergeControls:!1,highlightChanges:!0,syntaxHighlightDeletions:!1,gutter:!0})),V.push(...I),V.push(...N)),b&&V.push(Nn.lineWrapping),V},[e.diffInfo,e.name,I,N,u,P,b]);if(Bne({onSave:C,onClose:t,dependency:w}),E)return i.jsx(dae,{isDarkMode:g,isSidebar:n,loadingText:l("loading",{fileName:e.name})});if(T)return i.jsx(pae,{file:e,isSidebar:n,isFullscreen:c,onClose:t,onToggleFullscreen:()=>d(V=>!V),title:l("binaryFile.title","Binary File"),message:l("binaryFile.message",'The file "{{fileName}}" cannot be displayed in the text editor because it is a binary file.',{fileName:e.name})});const z=n?"w-full h-full flex flex-col":`fixed inset-0 z-[9999] md:bg-black/50 md:flex md:items-center md:justify-center md:p-4 ${c?"md:p-0":""}`,U=n?"bg-background flex flex-col w-full h-full":`bg-background shadow-2xl flex flex-col w-full h-full md:rounded-lg md:shadow-2xl${c?" md:w-full md:h-full md:rounded-none":" md:w-full md:max-w-6xl md:h-[80vh] md:max-h-[80vh]"}`;return i.jsxs(i.Fragment,{children:[i.jsx("style",{children:aae(g)}),i.jsx("div",{className:z,children:i.jsxs("div",{className:U,children:[i.jsx(cae,{file:e,isSidebar:n,isFullscreen:c,isMarkdownFile:A,markdownPreview:f,saving:S,saveSuccess:j,onToggleMarkdownPreview:()=>m(V=>!V),onOpenSettings:()=>window.openSettings?.("appearance"),onDownload:L,onSave:C,onToggleFullscreen:()=>d(V=>!V),onClose:t,labels:{showingChanges:l("header.showingChanges"),editMarkdown:l("actions.editMarkdown"),previewMarkdown:l("actions.previewMarkdown"),settings:l("toolbar.settings"),download:l("actions.download"),save:l("actions.save"),saving:l("actions.saving"),saved:l("actions.saved"),fullscreen:l("actions.fullscreen"),exitFullscreen:l("actions.exitFullscreen"),close:l("actions.close")}}),_&&i.jsx("div",{className:"border-b border-red-200 bg-red-50 px-3 py-1.5 text-xs text-red-700 dark:border-red-900/40 dark:bg-red-900/20 dark:text-red-300",children:_}),i.jsx("div",{className:"flex-1 overflow-hidden",children:i.jsx(uae,{content:w,onChange:k,markdownPreview:f,isMarkdownFile:A,isDarkMode:g,fontSize:v,showLineNumbers:y,extensions:H})}),i.jsx(lae,{content:w,linesLabel:l("footer.lines"),charactersLabel:l("footer.characters"),shortcutsLabel:l("footer.shortcuts")})]})})]})}const mae=200,Lm=280;function g4({editingFile:e,isMobile:t,editorExpanded:r,editorWidth:n,hasManualWidth:a,resizeHandleRef:s,onResizeStart:o,onCloseEditor:l,onToggleEditorExpand:c,projectPath:d,fillSpace:u}){const[p,f]=h.useState(!1),m=h.useRef(null),[g,b]=h.useState(n);if(h.useEffect(()=>{if(!e||t||p)return;const y=()=>{if(!m.current)return;const k=m.current.parentElement;if(!k)return;const S=k.clientWidth-mae;S<Lm?f(!0):n>S?b(S):b(n)};y(),window.addEventListener("resize",y);const v=new ResizeObserver(y),w=m.current?.parentElement;return w&&v.observe(w),()=>{window.removeEventListener("resize",y),v.disconnect()}},[e,t,p,n]),!e)return null;if(t||p)return i.jsx(f4,{file:e,onClose:()=>{f(!1),l()},projectPath:d,isSidebar:!1});const x=r||u&&!a;return i.jsxs("div",{ref:m,className:`flex h-full min-w-0 flex-shrink-0 ${x?"flex-1":""}`,children:[!r&&i.jsx("div",{ref:s,onMouseDown:o,className:"group relative w-1 flex-shrink-0 cursor-col-resize bg-gray-200 transition-colors hover:bg-blue-500 dark:bg-gray-700 dark:hover:bg-blue-600",title:"Drag to resize",children:i.jsx("div",{className:"absolute inset-y-0 left-1/2 w-1 -translate-x-1/2 bg-blue-500 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-blue-600"})}),i.jsx("div",{className:`h-full overflow-hidden border-l border-gray-200 dark:border-gray-700 ${x?"min-w-0 flex-1":`min-w-[ flex-shrink-0${Lm}px]`}`,style:x?void 0:{width:`${g}px`,minWidth:`${Lm}px`},children:i.jsx(f4,{file:e,onClose:l,projectPath:d,isSidebar:!0,isExpanded:r,onToggleExpand:c,onPopOut:()=>f(!0)})})]})}function hae(e){const t=h.useRef(!1),r=h.useCallback(s=>{s&&(s.preventDefault(),s.stopPropagation()),e()},[e]),n=h.useCallback(s=>{t.current=!0,r(s),window.setTimeout(()=>{t.current=!1},350)},[r]);return{handleMobileMenuClick:h.useCallback(s=>{if(t.current){s.preventDefault(),s.stopPropagation();return}r(s)},[r]),handleMobileMenuTouchEnd:n}}function J6({onMenuClick:e,compact:t=!1}){const{handleMobileMenuClick:r,handleMobileMenuTouchEnd:n}=hae(e),a=t?"p-1.5 text-muted-foreground hover:text-foreground rounded-lg hover:bg-accent/60 pwa-menu-button":"p-1.5 text-muted-foreground hover:text-foreground rounded-lg hover:bg-accent/60 touch-manipulation active:scale-95 pwa-menu-button flex-shrink-0";return i.jsx("button",{onClick:r,onTouchEnd:n,className:a,"aria-label":"Open menu",children:i.jsx("svg",{className:"h-5 w-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"})})})}const b4=[{kind:"builtin",id:"chat",labelKey:"tabs.chat",icon:na},{kind:"builtin",id:"orchestration",labelKey:"tabs.orchestration",icon:aa},{kind:"builtin",id:"shell",labelKey:"tabs.shell",icon:Gr},{kind:"builtin",id:"files",labelKey:"tabs.files",icon:Pn},{kind:"builtin",id:"git",labelKey:"tabs.git",icon:Qr},{kind:"builtin",id:"changes",labelKey:"tabs.changes",icon:_i},{kind:"builtin",id:"liveView",labelKey:"tabs.liveView",icon:Fn}],fae={kind:"builtin",id:"tasks",labelKey:"tabs.tasks",icon:xE},gae=new Set(["files","shell","git","changes","liveView"]);function bae({activeTab:e,setActiveTab:t,shouldShowTasksTab:r,liveViewAvailable:n=!1,activeSidePanelTab:a,sidePanelMode:s="split",canUseSidePanelSplit:o=!0,isMobile:l=!1,onCloseSidePanel:c}){const{t:d}=Me(),{plugins:u}=Yd(),p=r?[...b4,fae]:b4,f=u.filter(g=>g.enabled).map(g=>({kind:"plugin",id:`plugin:${g.name}`,label:g.displayName,pluginName:g.name,iconFile:g.icon})),m=[...p,...f];return i.jsx(Gf,{children:m.map(g=>{const b=g.id===e,x=g.kind==="builtin"?d(g.labelKey):g.label,y=!!(!l&&o&&b&&a===g.id&&gae.has(g.id)),v=s==="split",k=y?`${x} · ${v?"Split":"Full"} view`:x;return i.jsxs("div",{className:"relative inline-flex items-center",children:[i.jsx(Yn,{content:k,position:"bottom",children:i.jsxs(Hf,{isActive:b,onClick:()=>t(g.id),className:y?"px-2 py-[5px] pr-7":"px-2.5 py-[5px]",children:[g.kind==="builtin"?i.jsx(g.icon,{className:"h-3.5 w-3.5"}):i.jsx(qC,{pluginName:g.pluginName,iconFile:g.iconFile,className:"flex h-3.5 w-3.5 items-center justify-center [&>svg]:h-full [&>svg]:w-full"}),i.jsx("span",{className:"hidden lg:inline",children:x}),g.id==="liveView"&&n&&i.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 shadow-[0_0_8px_rgba(16,185,129,0.75)]","aria-hidden":"true"}),y&&i.jsx("span",{className:`ml-0.5 inline-flex h-4 w-4 items-center justify-center rounded border ${v?"border-foreground/20 bg-foreground/5 text-foreground/70":"border-border bg-muted/60 text-muted-foreground"}`,"aria-hidden":"true",children:v?i.jsx(TE,{className:"h-3 w-3"}):i.jsx(Gd,{className:"h-3 w-3"})})]})}),y&&c&&i.jsx(Yn,{content:d("tabs.closeSidePanel","Close side panel"),position:"bottom",children:i.jsx("button",{type:"button",className:"absolute right-1 top-1/2 flex h-4 w-4 -translate-y-1/2 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",onClick:E=>{E.stopPropagation(),c()},"aria-label":d("tabs.closeSidePanel","Close side panel"),title:d("tabs.closeSidePanel","Close side panel"),children:i.jsx(xt,{className:"h-3 w-3"})})})]},g.id)})})}function xae(e,t,r,n){return e.startsWith("plugin:")&&n?n:e==="files"?r("mainContent.projectFiles"):e==="orchestration"?r("tabs.orchestration"):e==="git"?r("tabs.git"):e==="changes"?r("tabs.changes"):e==="liveView"?r("tabs.liveView"):e==="tasks"&&t?"TaskMaster":"Project"}function yae(e){return e.__provider==="cursor"?e.name||"Untitled Session":e.summary||e.name||e.title||"New Session"}function vae({activeTab:e,selectedProject:t,selectedSession:r,shouldShowTasksTab:n}){const{t:a}=Me(),{plugins:s}=Yd(),o=e.startsWith("plugin:")?s.find(d=>d.name===e.replace("plugin:",""))?.displayName:void 0,l=e==="chat"&&!!r,c=e==="chat"&&!r;return i.jsxs("div",{className:"scrollbar-hide flex min-w-0 flex-1 items-center gap-2 overflow-x-auto",children:[l&&i.jsx("div",{className:"flex h-5 w-5 flex-shrink-0 items-center justify-center",children:i.jsx(dr,{provider:r?.__provider,className:"h-4 w-4"})}),i.jsx("div",{className:"min-w-0 flex-1",children:e==="chat"&&r?i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"scrollbar-hide overflow-x-auto whitespace-nowrap text-sm font-semibold leading-tight text-foreground",children:yae(r)}),i.jsx("div",{className:"truncate text-[11px] leading-tight text-muted-foreground",children:t.displayName})]}):c?i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-base font-semibold leading-tight text-foreground",children:a("mainContent.newSession")}),i.jsx("div",{className:"truncate text-xs leading-tight text-muted-foreground",children:t.displayName})]}):i.jsxs("div",{className:"min-w-0",children:[i.jsx("h2",{className:"text-sm font-semibold leading-tight text-foreground",children:xae(e,n,a,o)}),i.jsx("div",{className:"truncate text-[11px] leading-tight text-muted-foreground",children:t.displayName})]})})]})}function wae({activeTab:e,setActiveTab:t,selectedProject:r,selectedSession:n,shouldShowTasksTab:a,liveViewAvailable:s,activeSidePanelTab:o,sidePanelMode:l,canUseSidePanelSplit:c,isMobile:d,onMenuClick:u,onCloseSidePanel:p}){const f=h.useRef(null),[m,g]=h.useState(!1),[b,x]=h.useState(!1),y=h.useCallback(()=>{const v=f.current;v&&(g(v.scrollLeft>2),x(v.scrollLeft<v.scrollWidth-v.clientWidth-2))},[]);return h.useEffect(()=>{const v=f.current;if(!v)return;y();const w=new ResizeObserver(y);return w.observe(v),()=>w.disconnect()},[y]),i.jsx("div",{className:"pwa-header-safe flex-shrink-0 border-b border-border/60 bg-background px-3 py-1.5 sm:px-4 sm:py-2",children:i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[d&&i.jsx(J6,{onMenuClick:u}),i.jsx(vae,{activeTab:e,selectedProject:r,selectedSession:n,shouldShowTasksTab:a})]}),i.jsxs("div",{className:"relative min-w-0 flex-shrink overflow-hidden sm:flex-shrink-0",children:[m&&i.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 z-10 w-6 bg-gradient-to-r from-background to-transparent"}),i.jsx("div",{ref:f,onScroll:y,className:"scrollbar-hide overflow-x-auto",children:i.jsx(bae,{activeTab:e,setActiveTab:t,shouldShowTasksTab:a,liveViewAvailable:s,activeSidePanelTab:o,sidePanelMode:l,canUseSidePanelSplit:c,isMobile:d,onCloseSidePanel:p})}),b&&i.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 z-10 w-6 bg-gradient-to-l from-background to-transparent"})]})]})})}function x4({mode:e,isMobile:t,onMenuClick:r,onQuickStartSession:n,onQuickStartOrchestration:a}){const{t:s}=Me(),o=e==="loading";return i.jsxs("div",{className:"flex h-full flex-col",children:[t&&i.jsx("div",{className:"pwa-header-safe flex-shrink-0 border-b border-border/50 bg-background/80 p-2 backdrop-blur-sm sm:p-3",children:i.jsx(J6,{onMenuClick:r,compact:!0})}),o?i.jsx("div",{className:"flex flex-1 items-center justify-center",children:i.jsxs("div",{className:"text-center text-muted-foreground",children:[i.jsx("div",{className:"mx-auto mb-4 h-10 w-10",children:i.jsx("div",{className:"h-full w-full rounded-full border-[3px] border-muted border-t-primary",style:{animation:"spin 1s linear infinite",WebkitAnimation:"spin 1s linear infinite",MozAnimation:"spin 1s linear infinite"}})}),i.jsx("h2",{className:"mb-1 text-lg font-semibold text-foreground",children:s("mainContent.loading")}),i.jsx("p",{className:"text-sm",children:s("mainContent.settingUpWorkspace")})]})}):i.jsx("div",{className:"flex flex-1 items-center justify-center overflow-auto p-5",children:i.jsxs("div",{className:"w-full max-w-4xl",children:[i.jsxs("div",{className:"mb-6",children:[i.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-lg bg-muted/60",children:i.jsx(Pn,{className:"h-6 w-6 text-muted-foreground"})}),i.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:s("mainContent.landing.title")}),i.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:s("mainContent.landing.description")})]}),i.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[i.jsxs("button",{type:"button",onClick:()=>{a?.()},className:"rounded-md border border-primary/30 bg-primary/5 p-4 text-left transition-colors hover:bg-primary/10",children:[i.jsx(aa,{className:"mb-3 h-5 w-5 text-primary"}),i.jsx("div",{className:"text-sm font-semibold",children:s("mainContent.landing.startOrchestration")}),i.jsx("p",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:s("mainContent.landing.startOrchestrationDescription")})]}),i.jsxs("button",{type:"button",onClick:()=>{n?.()},className:"rounded-md border border-border p-4 text-left transition-colors hover:bg-muted/40",children:[i.jsx(Na,{className:"mb-3 h-5 w-5 text-foreground"}),i.jsx("div",{className:"text-sm font-semibold",children:s("mainContent.landing.startChat")}),i.jsx("p",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:s("mainContent.landing.startChatDescription")})]}),i.jsxs("button",{type:"button",onClick:()=>window.dispatchEvent(new CustomEvent("pixcode:create-project")),className:"rounded-md border border-border p-4 text-left transition-colors hover:bg-muted/40",children:[i.jsx(ai,{className:"mb-3 h-5 w-5 text-foreground"}),i.jsx("div",{className:"text-sm font-semibold",children:s("mainContent.landing.createProject",{defaultValue:"Create New Project"})}),i.jsx("p",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:s("mainContent.landing.createProjectDescription",{defaultValue:"Add an existing workspace or create a folder, then open the provider picker for coding."})})]}),i.jsxs("button",{type:"button",onClick:()=>window.dispatchEvent(new CustomEvent("pixcode:create-project")),className:"rounded-md border border-border p-4 text-left transition-colors hover:bg-muted/40",children:[i.jsx(xE,{className:"mb-3 h-5 w-5 text-foreground"}),i.jsx("div",{className:"text-sm font-semibold",children:s("mainContent.landing.taskSystem")}),i.jsx("p",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:s("mainContent.landing.taskSystemDescription")})]})]}),i.jsx("div",{className:"mt-5 rounded-md border border-border/70 bg-muted/20 p-4 text-sm text-muted-foreground",children:s("mainContent.landing.sidebarHint")})]})})]})}const kae={M:"M",A:"A",D:"D",U:"U"},Sae={M:"border-amber-400/40 bg-amber-500/10 text-amber-700 dark:text-amber-200",A:"border-emerald-400/40 bg-emerald-500/10 text-emerald-700 dark:text-emerald-200",D:"border-red-400/40 bg-red-500/10 text-red-700 dark:text-red-200",U:"border-sky-400/40 bg-sky-500/10 text-sky-700 dark:text-sky-200"};function Eae(e){return e?new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(e):null}function Nae({changedFiles:e,isLoading:t,error:r,latestChangedFilePath:n,lastCheckedAt:a,trackingMode:s,onTrackingModeChange:o,onRefresh:l,onOpenFile:c,variant:d="rail"}){const u=Eae(a),p=d==="panel";return i.jsxs("aside",{className:ue("h-full min-h-0 flex-col overflow-hidden bg-card/45",p?"flex w-full rounded-none border-0":"hidden w-[260px] shrink-0 rounded-lg border border-border/60 shadow-sm xl:flex"),children:[i.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border/60 px-3 py-2",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:[i.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500 shadow-[0_0_10px_rgba(16,185,129,0.75)]"}),"Command Center"]}),i.jsx("p",{className:"mt-0.5 truncate text-[11px] text-muted-foreground",children:e.length>0?`${e.length} local change${e.length===1?"":"s"}`:"Watching agent writes"})]}),i.jsx("button",{type:"button",onClick:l,className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-border bg-background text-muted-foreground transition-colors hover:bg-accent hover:text-foreground","aria-label":"Refresh changed files",title:"Refresh changed files",children:t?i.jsx(Ot,{className:"h-3.5 w-3.5 animate-spin"}):i.jsx(ht,{className:"h-3.5 w-3.5"})})]}),i.jsx("div",{className:"border-b border-border/60 px-3 py-2",children:i.jsxs("div",{className:"grid grid-cols-2 rounded-md border border-border bg-background p-0.5 text-[11px] font-medium",children:[i.jsx("button",{type:"button",onClick:()=>o("local"),className:`rounded px-2 py-1 transition-colors ${s==="local"?"bg-foreground text-background shadow-sm":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,title:"Local changes: agent writes and filesystem edits",children:"Local changes"}),i.jsx("button",{type:"button",onClick:()=>o("git"),className:`rounded px-2 py-1 transition-colors ${s==="git"?"bg-foreground text-background shadow-sm":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,title:"Git changes: git status only",children:"Git changes"})]})}),r&&i.jsx("div",{className:"mx-3 mt-3 rounded-md border border-amber-500/25 bg-amber-500/10 px-2 py-1.5 text-[11px] leading-5 text-amber-700 dark:text-amber-200",children:r}),i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-2",children:e.length===0?i.jsxs("div",{className:"flex h-full flex-col items-center justify-center px-3 text-center text-muted-foreground",children:[i.jsx(_i,{className:"mb-2 h-8 w-8 opacity-45"}),i.jsx("p",{className:"text-xs font-medium text-foreground",children:"No local changes detected"}),i.jsx("p",{className:"mt-1 text-[11px] leading-5",children:"When an agent writes or edits files, they will appear here."})]}):i.jsxs("div",{className:"space-y-1",children:[e.slice(0,12).map(f=>{const m=n===f.path;return i.jsxs("button",{type:"button",onClick:()=>c(f),className:`group flex w-full items-center gap-2 rounded-md border px-2 py-1.5 text-left transition-all ${m?"changed-file-flash border-emerald-500/60 bg-emerald-500/15":"border-border/60 bg-background/70 hover:border-emerald-500/35 hover:bg-emerald-500/10"}`,title:f.path,children:[i.jsx("span",{className:`inline-flex h-5 min-w-5 items-center justify-center rounded border px-1 text-[10px] font-semibold ${Sae[f.status]}`,children:kae[f.status]}),i.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-foreground",children:f.path})]},`${f.status}:${f.path}`)}),e.length>12&&i.jsxs("p",{className:"px-1 pt-1 text-[11px] text-muted-foreground",children:["+",e.length-12," more files"]})]})}),u&&i.jsxs("div",{className:"border-t border-border/60 px-3 py-2 text-[10px] text-muted-foreground",children:["Last check ",u]})]})}const Cae=h.createContext(null),Dm={didCatch:!1,error:null};let Aae=class extends h.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Dm}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var r,n,a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:s,reason:"imperative-api"}),this.setState(Dm)}}componentDidCatch(t,r){var n,a;(n=(a=this.props).onError)===null||n===void 0||n.call(a,t,r)}componentDidUpdate(t,r){const{didCatch:n}=this.state,{resetKeys:a}=this.props;if(n&&r.error!==null&&Tae(t.resetKeys,a)){var s,o;(s=(o=this.props).onReset)===null||s===void 0||s.call(o,{next:a,prev:t.resetKeys,reason:"keys"}),this.setState(Dm)}}render(){const{children:t,fallbackRender:r,FallbackComponent:n,fallback:a}=this.props,{didCatch:s,error:o}=this.state;let l=t;if(s){const c={error:o,resetErrorBoundary:this.resetErrorBoundary};if(typeof r=="function")l=r(c);else if(n)l=h.createElement(n,c);else if(a!==void 0)l=a;else throw o}return h.createElement(Cae.Provider,{value:{didCatch:s,error:o,resetErrorBoundary:this.resetErrorBoundary}},l)}};function Tae(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}function jae(e){return e instanceof Error?`${e.name}: ${e.message}`:String(e)}function _ae({error:e,resetErrorBoundary:t,showDetails:r,componentStack:n}){return i.jsx("div",{className:"flex flex-col items-center justify-center p-8 text-center",children:i.jsxs("div",{className:"max-w-md rounded-lg border border-red-200 bg-red-50 p-6",children:[i.jsxs("div",{className:"mb-4 flex items-center",children:[i.jsx("div",{className:"flex-shrink-0",children:i.jsx("svg",{className:"h-5 w-5 text-red-400",viewBox:"0 0 20 20",fill:"currentColor",children:i.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})}),i.jsx("h3",{className:"ml-3 text-sm font-medium text-red-800",children:"Something went wrong"})]}),i.jsxs("div",{className:"text-sm text-red-700",children:[i.jsx("p",{className:"mb-2",children:"An error occurred while loading the chat interface."}),r&&i.jsxs("details",{className:"mt-4",children:[i.jsx("summary",{className:"cursor-pointer font-mono text-xs",children:"Error Details"}),i.jsxs("pre",{className:"mt-2 max-h-40 overflow-auto rounded bg-red-100 p-2 text-xs",children:[jae(e),n]})]})]}),i.jsx("div",{className:"mt-4",children:i.jsx("button",{onClick:t,className:"rounded bg-red-600 px-4 py-2 text-sm text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500",children:"Try Again"})})]})})}function Iae({children:e,showDetails:t=!1,onRetry:r=void 0,resetKeys:n=void 0}){const[a,s]=h.useState(null),o=h.useCallback((d,u)=>{console.error("ErrorBoundary caught an error:",d,u),s(u?.componentStack??null)},[]),l=h.useCallback(()=>{s(null),r?.()},[r]),c=h.useCallback(({error:d,resetErrorBoundary:u})=>i.jsx(_ae,{error:d,resetErrorBoundary:u,showDetails:t,componentStack:a}),[t,a]);return i.jsx(Aae,{fallbackRender:c,onError:o,onReset:l,resetKeys:n,children:e})}const Rae=new Set(["files","shell","git","changes","liveView"]),Lae=40,Dae=50,Oae=46,y4="command-center-tracking-mode";function Oc(e){return Rae.has(e)}function Mae(e){return Math.min(Dae,Math.max(Lae,e))}function v4(){return typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}function Pae({selectedProject:e,selectedSession:t,activeTab:r,setActiveTab:n,ws:a,sendMessage:s,latestMessage:o,isMobile:l,onMenuClick:c,isLoading:d,onInputFocusChange:u,onSessionActive:p,onSessionInactive:f,onSessionProcessing:m,onSessionNotProcessing:g,processingSessions:b,onReplaceTemporarySession:x,onNavigateToSession:y,onShowSettings:v,externalMessageUpdate:w,onQuickStartSession:k,onQuickStartOrchestration:E}){const{preferences:S}=Mf(),{autoExpandTools:j,showRawParameters:_,showThinking:T,autoScrollToBottom:C,sendByCtrlEnter:L}=S,{currentProject:A,setCurrentProject:I}=eo(),{tasksEnabled:N,isTaskMasterInstalled:P}=Kd(),[H,z]=h.useState("split"),[U,V]=h.useState(Oae),[O,G]=h.useState(!1),[$,F]=h.useState(!1),[te,Q]=h.useState(()=>typeof window>"u"?"local":window.localStorage.getItem(y4)==="git"?"git":"local"),[ge,ae]=h.useState(()=>Oc(r)?"chat":r),[me,pe]=h.useState(()=>typeof window<"u"&&window.innerWidth>=1024),be=!!(N&&P),Ne=Oc(r)?r:null,xe=!!(Ne&&!l&&me&&H==="split"),Be=h.useRef(null),M=h.useRef(null),de=h.useRef(null),ce=h.useRef(null),Y=h.useRef(null);zC(Be,r);const{editingFile:W,editorWidth:ne,editorExpanded:fe,hasManualWidth:ye,resizeHandleRef:se,handleFileOpen:Se,handleCloseEditor:re,handleToggleEditorExpand:X,handleResizeStart:Z}=sne({selectedProject:e,isMobile:l}),le=ge==="orchestration"?"orchestration":"chat",Ee=Ne?le:r,Te=!!xe,Ke=!!(Ne==="files"&&W&&!l),Ze=Ee==="chat"&&(!Ne||Te),vt=Ee==="orchestration"&&Te,{changedFiles:Qe,isLoading:jt,error:wt,lastCheckedAt:st,latestDetectedFile:lt,refresh:kt}=ine(e,!!e,o,te),[_t,At]=h.useState(null),pr=h.useRef(0),nr=h.useMemo(()=>Qe.map(ke=>ke.path),[Qe]),Xt=h.useCallback(async ke=>{if(ke.diffInfo)return ke.diffInfo;if(!e)return null;try{const we=await ve(`/api/git/file-with-diff?project=${encodeURIComponent(e.name)}&file=${encodeURIComponent(ke.path)}`,{cache:"no-store"}),Ve=await we.json();if(we.ok&&!Ve.error&&typeof Ve.currentContent=="string"&&typeof Ve.oldContent=="string")return{old_string:Ve.oldContent,new_string:Ve.currentContent}}catch{}if(ke.status==="A"||ke.status==="U")try{const we=await ot.readFile(e.name,ke.path);if(!we.ok)return null;const Ve=await we.json();if(typeof Ve.content=="string")return{old_string:"",new_string:Ve.content}}catch{return null}return null},[e]),zr=h.useCallback(ke=>{At(ke.path),Se(ke.path,ke.diffInfo??null),!l&&me&&z("split"),n("files"),ke.diffInfo||Xt(ke).then(we=>{we&&Se(ke.path,we)})},[me,Se,Xt,l,n]),De=h.useCallback(()=>{z("split"),n(le)},[n,le]),Xe=ke=>ke==="files"?Ke?i.jsxs("div",{className:"flex h-full min-w-0 overflow-hidden",children:[!fe&&i.jsx("div",{className:"h-full min-w-[220px] max-w-[50%] flex-[0_0_46%] overflow-hidden border-r border-border/60",children:i.jsx(S5,{selectedProject:e,onFileOpen:Se,changedFilePaths:nr,focusedFilePath:_t})}),i.jsx(g4,{editingFile:W,isMobile:l,editorExpanded:fe,editorWidth:ne,hasManualWidth:ye,resizeHandleRef:se,onResizeStart:Z,onCloseEditor:re,onToggleEditorExpand:X,projectPath:e?.path,fillSpace:!0})]}):i.jsx(S5,{selectedProject:e,onFileOpen:Se,changedFilePaths:nr,focusedFilePath:_t}):ke==="shell"?i.jsx(_E,{project:e,session:t,showHeader:!1,isActive:r==="shell"}):ke==="changes"?i.jsx(Nae,{changedFiles:Qe,isLoading:jt,error:wt,latestChangedFilePath:lt?.path??_t,lastCheckedAt:st,trackingMode:te,onTrackingModeChange:Q,onRefresh:()=>{kt("manual")},onOpenFile:zr,variant:"panel"}):ke==="liveView"?e?i.jsx(Ere,{selectedProject:e,onAvailabilityChange:F}):null:i.jsx(Kte,{selectedProject:e,isMobile:l,onFileOpen:Se});h.useEffect(()=>{const ke=e?.name,we=A?.name;e&&ke!==we&&I?.(e)},[e,A?.name,I]),h.useEffect(()=>{!be&&r==="tasks"&&n("chat")},[be,r,n]),h.useEffect(()=>{if(!e){F(!1);return}let ke=!1;return ve(`/api/live-view/${encodeURIComponent(e.name)}/status`,{cache:"no-store"}).then(we=>we.ok?we.json():null).then(we=>{ke||F(!!(we?.target?.available||we?.session))}).catch(()=>{ke||F(!1)}),()=>{ke=!0}},[e]),h.useEffect(()=>{if(typeof window>"u")return;const ke=()=>{pe(window.innerWidth>=1024)};return ke(),window.addEventListener("resize",ke),()=>{window.removeEventListener("resize",ke)}},[]),h.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(y4,te)},[te]),h.useEffect(()=>{Oc(r)||ae(r)},[r]);const Je=h.useCallback(ke=>{const we=typeof ke=="function"?ke(r):ke;!l&&me&&Oc(we)?r===we?(Y.current=ce.current?.getBoundingClientRect()??null,z(Ve=>Ve==="split"?"full":"split")):z("split"):(z("split"),ae(we)),n(we)},[r,me,l,n]),ie=h.useCallback(ke=>{if(!M.current||!Te)return;ke.preventDefault(),ke.currentTarget.setPointerCapture?.(ke.pointerId),G(!0);const we=Ce=>{const Oe=M.current?.getBoundingClientRect();if(!Oe||Oe.width<=0)return;const ct=(Oe.right-Ce)/Oe.width*100;V(Mae(ct))};we(ke.clientX);const Ve=Ce=>{we(Ce.clientX)},et=()=>{G(!1),window.removeEventListener("pointermove",Ve),window.removeEventListener("pointerup",et),window.removeEventListener("pointercancel",et)};window.addEventListener("pointermove",Ve),window.addEventListener("pointerup",et,{once:!0}),window.addEventListener("pointercancel",et,{once:!0})},[Te]);return h.useLayoutEffect(()=>{const ke=Y.current,we=ce.current;if(!ke||!we||v4()){Y.current=null;return}const Ve=we.getBoundingClientRect();if(Ve.width<=0||Ve.height<=0){Y.current=null;return}const et=ke.left-Ve.left,Ce=ke.width/Ve.width;Xn.fromTo(we,{x:et,scaleX:Ce,opacity:.94,transformOrigin:"right center"},{x:0,scaleX:1,opacity:1,duration:Vr.duration.enter,ease:Vr.ease.soft,clearProps:"transform,opacity,transformOrigin"}),Y.current=null},[H,xe]),h.useEffect(()=>{xe||G(!1)},[xe]),h.useEffect(()=>{if(!Te||v4())return;const ke=de.current,we=ce.current;if(!ke||!we)return;const Ve=Xn.context(()=>{Xn.fromTo(ke,{opacity:.92,x:-14},{opacity:1,x:0,duration:Vr.duration.base,ease:Vr.ease.out,clearProps:"transform,opacity"}),Xn.fromTo(we,{opacity:0,x:28,scaleX:.96,transformOrigin:"right center"},{opacity:1,x:0,scaleX:1,duration:Vr.duration.enter,ease:Vr.ease.soft,clearProps:"transform,opacity,transformOrigin"})},M);return()=>Ve.revert()},[Ne,Te]),h.useEffect(()=>{lt&<.detectedAt!==pr.current&&(pr.current=lt.detectedAt,At(lt.path))},[lt]),h.useEffect(()=>{if(!_t)return;const ke=window.setTimeout(()=>At(null),7e3);return()=>window.clearTimeout(ke)},[_t]),d?i.jsx(x4,{mode:"loading",isMobile:l,onMenuClick:c}):e?i.jsxs("div",{className:"flex h-full flex-col",children:[i.jsx(wae,{activeTab:r,setActiveTab:Je,selectedProject:e,selectedSession:t,shouldShowTasksTab:be,liveViewAvailable:$,activeSidePanelTab:Ne,sidePanelMode:H,canUseSidePanelSplit:me,isMobile:l,onCloseSidePanel:Ne?De:void 0,onMenuClick:c}),i.jsxs("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[i.jsxs("div",{ref:Be,className:ue("flex min-h-0 min-w-[200px] flex-1 flex-col overflow-hidden",fe&&"hidden",!W&&!Ne&&!xe&&"mx-auto w-full max-w-[1100px] px-4 md:px-8",!W&&Ne&&!Te&&"w-full px-3 md:px-4",!W&&Te&&"w-full px-3 md:px-4",!W&&r==="orchestration"&&"max-w-none px-0 md:px-0"),children:[(Ze||vt||Ne)&&i.jsxs("div",{ref:M,className:ue("h-full min-h-0",Te&&"flex overflow-hidden",O&&"select-none"),children:[Ze&&i.jsx("div",{ref:de,className:ue("min-h-0 overflow-hidden",Te&&"min-w-[320px] flex-none transition-[width,opacity,transform] duration-300 ease-out",O&&"transition-none",!Te&&"h-full"),style:Te?{width:`${100-U}%`}:void 0,children:i.jsx("div",{className:"flex h-full min-h-0 min-w-0 flex-1",children:i.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:i.jsx(Iae,{showDetails:!0,children:i.jsx(Uee,{selectedProject:e,selectedSession:t,ws:a,sendMessage:s,latestMessage:o,onFileOpen:Se,onInputFocusChange:u,onSessionActive:p,onSessionInactive:f,onSessionProcessing:m,onSessionNotProcessing:g,processingSessions:b,onReplaceTemporarySession:x,onNavigateToSession:y,onShowSettings:v,autoExpandTools:j,showRawParameters:_,showThinking:T,autoScrollToBottom:C,sendByCtrlEnter:L,externalMessageUpdate:w,onShowAllTasks:N?()=>Je("tasks"):null})})})})}),vt&&i.jsx("div",{ref:de,className:ue("min-h-0 overflow-hidden",Te&&"min-w-[320px] flex-none transition-[width,opacity,transform] duration-300 ease-out",O&&"transition-none"),style:Te?{width:`${100-U}%`}:void 0,children:i.jsx("div",{className:"flex h-full min-h-0 min-w-0 flex-1",children:i.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:i.jsx(z5,{selectedProject:e})})})}),Te&&i.jsxs("button",{type:"button",className:"group relative z-20 mx-1 flex w-3 shrink-0 cursor-col-resize touch-none items-center justify-center rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",onPointerDown:ie,"aria-label":"Resize side panel",title:"Drag to resize",children:[i.jsx("span",{className:"absolute inset-y-3 -left-2 -right-2 rounded-full"}),i.jsx("span",{className:ue("h-16 w-1 rounded-full bg-border transition-all duration-200 group-hover:h-24 group-hover:bg-foreground/40",O&&"h-28 bg-foreground/55 shadow-[0_0_18px_rgba(120,120,120,0.22)]")})]}),Ne&&i.jsx("div",{ref:ce,className:ue("min-h-0 overflow-hidden rounded-lg border border-border/60 bg-card/40",Te&&"min-w-[360px] flex-none shadow-sm transition-[width,opacity,transform] duration-300 ease-out",O&&"transition-none",!Te&&"h-full w-full"),style:Te?{width:`${U}%`}:void 0,children:Xe(Ne)})]}),!Ne&&r==="orchestration"&&i.jsx("div",{className:"flex h-full min-h-0 min-w-0 overflow-hidden",children:i.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:i.jsx(z5,{selectedProject:e})})}),be&&i.jsx(gee,{isVisible:r==="tasks"}),i.jsx("div",{className:`h-full overflow-hidden ${r==="preview"?"block":"hidden"}`}),r.startsWith("plugin:")&&i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(Nre,{pluginName:r.replace("plugin:",""),selectedProject:e,selectedSession:t})})]}),!Ke&&i.jsx(g4,{editingFile:W,isMobile:l,editorExpanded:fe,editorWidth:ne,hasManualWidth:ye,resizeHandleRef:se,onResizeStart:Z,onCloseEditor:re,onToggleEditorExpand:X,projectPath:e.path,fillSpace:r==="files"})]}),i.jsx($re,{})]}):i.jsx(x4,{mode:"empty",isMobile:l,onMenuClick:c,onQuickStartSession:k,onQuickStartOrchestration:E})}const Fae=qr.memo(Pae),Q6="pixcode.inAppNotifications.v1",zae="pixcode.notificationPreferences.v1",uv=25;function Bae(){try{const e=JSON.parse(localStorage.getItem(Q6)??"[]");return Array.isArray(e)?e.slice(0,uv):[]}catch{return[]}}function w4(e){try{localStorage.setItem(Q6,JSON.stringify(e.slice(0,uv)))}catch{}}function k4(){try{return JSON.parse(localStorage.getItem(zae)??"null")?.channels?.inApp!==!1}catch{return!0}}function $ae(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.id!="string"||typeof t.title!="string"||typeof t.body!="string"?null:{id:t.id,title:t.title,body:t.body,eventType:t.eventType,category:t.category,preferenceKey:t.preferenceKey,kind:t.kind,code:t.code,severity:t.severity||"info",provider:t.provider??null,sessionId:t.sessionId??null,createdAt:t.createdAt||new Date().toISOString(),data:t.data}}function Uae(e){return e==="error"?"border-red-500/50 bg-red-50 text-red-950 dark:bg-red-950/35 dark:text-red-50":e==="warning"?"border-amber-500/50 bg-amber-50 text-amber-950 dark:bg-amber-950/35 dark:text-amber-50":"border-border bg-card text-card-foreground"}function Gae(e){if(!e)return"";try{return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(new Date(e))}catch{return""}}function Hae({latestMessage:e}){const[t,r]=h.useState(()=>typeof window>"u"?[]:Bae()),[n,a]=h.useState(!1),[s,o]=h.useState(()=>new Set),[l,c]=h.useState(()=>typeof window>"u"?!0:k4());h.useEffect(()=>{const f=()=>c(k4());return window.addEventListener("storage",f),window.addEventListener("pixcode:notification-preferences-changed",f),()=>{window.removeEventListener("storage",f),window.removeEventListener("pixcode:notification-preferences-changed",f)}},[]),h.useEffect(()=>{const f=e;if(!f||f.type!=="notification:event")return;const m=$ae(f.notification);m&&(K4({key:m.id,title:m.title,body:m.body,event:m.eventType||m.kind||"updates",tag:typeof m.data?.tag=="string"?m.data.tag:m.id,data:m.data}),l&&(r(g=>{if(g.some(x=>x.id===m.id))return g;const b=[m,...g].slice(0,uv);return w4(b),b}),o(g=>{const b=new Set(g);return b.delete(m.id),b}),a(!0)))},[l,e]);const d=h.useMemo(()=>t.filter(f=>!s.has(f.id)).length,[t,s]),u=h.useCallback(()=>{o(new Set(t.map(f=>f.id)))},[t]),p=h.useCallback(f=>{r(m=>{const g=m.filter(b=>b.id!==f);return w4(g),g}),o(m=>{const g=new Set(m);return g.delete(f),g})},[]);return!l||t.length===0?null:i.jsxs("div",{className:"pointer-events-none fixed bottom-4 right-4 z-40 flex max-w-[calc(100vw-2rem)] flex-col items-end gap-3",children:[n&&i.jsxs("div",{className:"pointer-events-auto w-[min(24rem,calc(100vw-2rem))] overflow-hidden rounded-lg border border-border bg-popover shadow-xl shadow-black/10",children:[i.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border px-3 py-2",children:[i.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[i.jsx(Vm,{className:"h-4 w-4 flex-shrink-0 text-primary"}),i.jsx("span",{className:"truncate text-sm font-medium text-popover-foreground",children:"Notifications"}),d>0&&i.jsx("span",{className:"rounded-full bg-primary px-2 py-0.5 text-xs font-medium text-primary-foreground",children:d})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("button",{type:"button",onClick:u,className:"rounded px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:"Read"}),i.jsx("button",{type:"button",onClick:()=>a(!1),className:"rounded p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground","aria-label":"Close notifications",children:i.jsx(xt,{className:"h-4 w-4"})})]})]}),i.jsx("div",{className:"max-h-[22rem] space-y-2 overflow-y-auto p-2",children:t.slice(0,6).map(f=>i.jsx("div",{className:`rounded-md border p-3 shadow-sm ${Uae(f.severity)}`,children:i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[!s.has(f.id)&&i.jsx("span",{className:"h-2 w-2 flex-shrink-0 rounded-full bg-primary"}),i.jsx("p",{className:"truncate text-sm font-medium",children:f.title})]}),i.jsx("p",{className:"mt-1 text-sm leading-5 opacity-85",children:f.body}),i.jsx("p",{className:"mt-2 text-xs opacity-60",children:Gae(f.createdAt)})]}),i.jsx("button",{type:"button",onClick:()=>p(f.id),className:"rounded p-1 opacity-60 transition-opacity hover:opacity-100","aria-label":"Dismiss notification",children:i.jsx(xt,{className:"h-4 w-4"})})]})},f.id))})]}),i.jsxs("button",{type:"button",onClick:()=>{a(f=>!f),n||u()},className:"pointer-events-auto relative inline-flex h-11 w-11 items-center justify-center rounded-full border border-border bg-card text-card-foreground shadow-lg shadow-black/10 transition-transform hover:scale-105","aria-label":"Open notifications",children:[i.jsx(Cf,{className:"h-5 w-5"}),d>0&&i.jsx("span",{className:"absolute -right-1 -top-1 min-w-5 rounded-full bg-primary px-1.5 py-0.5 text-xs font-semibold text-primary-foreground",children:d>9?"9+":d})]})]})}function Vae(){const[e,t]=h.useState(new Set),[r,n]=h.useState(new Set),a=h.useCallback(d=>{d&&t(u=>new Set([...u,d]))},[]),s=h.useCallback(d=>{d&&t(u=>{const p=new Set(u);return p.delete(d),p})},[]),o=h.useCallback(d=>{d&&n(u=>new Set([...u,d]))},[]),l=h.useCallback(d=>{d&&n(u=>{const p=new Set(u);return p.delete(d),p})},[]),c=h.useCallback(d=>{d&&t(u=>{const p=new Set;for(const f of u)f.startsWith("new-session-")||p.add(f);return p.add(d),p})},[]);return{activeSessions:e,processingSessions:r,markSessionAsActive:a,markSessionAsInactive:s,markSessionAsProcessing:o,markSessionAsNotProcessing:l,replaceTemporarySession:c}}const Qt=e=>JSON.stringify(e??null),S4=(e,t,r)=>e.length!==t.length?!0:t.some((n,a)=>{const s=e[a];return!s||n.name!==s.name||n.displayName!==s.displayName||n.fullPath!==s.fullPath||Qt(n.sessionMeta)!==Qt(s.sessionMeta)||Qt(n.sessions)!==Qt(s.sessions)||Qt(n.taskmaster)!==Qt(s.taskmaster)?!0:Qt(n.cursorSessions)!==Qt(s.cursorSessions)||Qt(n.codexSessions)!==Qt(s.codexSessions)||Qt(n.geminiSessions)!==Qt(s.geminiSessions)||Qt(n.qwenSessions)!==Qt(s.qwenSessions)||Qt(n.opencodeSessions)!==Qt(s.opencodeSessions)}),vs=(e,t)=>(e??[]).map(r=>({...r,__provider:r.__provider??t})),Pd=e=>[...vs(e.sessions,"claude"),...vs(e.codexSessions,"codex"),...vs(e.cursorSessions,"cursor"),...vs(e.geminiSessions,"gemini"),...vs(e.qwenSessions,"qwen"),...vs(e.opencodeSessions,"opencode")],qae=(e,t,r,n)=>{if(!r||!n)return!0;const a=e.find(c=>c.name===r.name),s=t.find(c=>c.name===r.name);if(!a||!s)return!1;const o=Pd(a).find(c=>c.id===n.id),l=Pd(s).find(c=>c.id===n.id);return!o||!l?!1:o.id===l.id&&o.title===l.title&&o.created_at===l.created_at&&o.updated_at===l.updated_at},Wae=new Set(["chat","orchestration","files","shell","git","changes","liveView","tasks","preview"]),Kae=e=>Wae.has(e)||e.startsWith("plugin:"),Yae=()=>{if(typeof window<"u"&&window.location.pathname.endsWith("/orchestration"))return"orchestration";try{const e=localStorage.getItem("activeTab");if(e&&Kae(e))return e}catch{}return"chat"};function Zae({sessionId:e,navigate:t,latestMessage:r,isMobile:n,activeSessions:a}){const[s,o]=h.useState([]),[l,c]=h.useState(null),[d,u]=h.useState(null),[p,f]=h.useState(Yae);h.useEffect(()=>{try{localStorage.setItem("activeTab",p)}catch{}},[p]);const[m,g]=h.useState(!1),[b,x]=h.useState(!0),[y,v]=h.useState(null),[w,k]=h.useState(!1),[E,S]=h.useState(!1),[j,_]=h.useState("agents"),[T,C]=h.useState(0),L=h.useRef(null),A=h.useCallback(async({showLoadingState:ae=!0}={})=>{try{ae&&x(!0);const pe=await(await ot.projects()).json();o(be=>be.length===0||S4(be,pe,!0)?pe:be)}catch(me){console.error("Error fetching projects:",me)}finally{ae&&x(!1)}},[]),I=h.useCallback(async()=>{await A({showLoadingState:!1})},[A]),N=h.useCallback((ae="tools")=>{_(ae),S(!0)},[]);h.useEffect(()=>{A()},[A]),h.useEffect(()=>{!b&&s.length===1&&!l&&!e&&c(s[0])},[b,s,l,e]),h.useEffect(()=>{if(!r)return;if(r.type==="loading_progress"){L.current&&(clearTimeout(L.current),L.current=null),v(r),r.phase==="complete"&&(L.current=setTimeout(()=>{v(null),L.current=null},500));return}if(r.type!=="projects_updated")return;const ae=r;if(ae.changedFile&&d&&l){const Be=ae.changedFile.replace(/\\/g,"/").split("/");Be.length>=2&&Be[Be.length-1].replace(".jsonl","")===d.id&&(a.has(d.id)||C(Y=>Y+1))}const me=d&&a.has(d.id)||a.size>0&&Array.from(a).some(xe=>xe.startsWith("new-session-")),pe=ae.projects;if(me&&!qae(s,pe,l,d)||(o(pe),!l))return;const be=pe.find(xe=>xe.name===l.name);if(!be||(Qt(be)!==Qt(l)&&c(be),!d))return;Pd(be).find(xe=>xe.id===d.id)||u(null)},[r,l,d,a,s]),h.useEffect(()=>()=>{L.current&&(clearTimeout(L.current),L.current=null)},[]),h.useEffect(()=>{if(!(!e||s.length===0)){for(const ae of s){const me=ae.sessions?.find(M=>M.id===e);if(me){const M=l?.name!==ae.name,de=d?.id!==e||d.__provider!=="claude";M&&c(ae),de&&u({...me,__provider:"claude"});return}const pe=ae.cursorSessions?.find(M=>M.id===e);if(pe){const M=l?.name!==ae.name,de=d?.id!==e||d.__provider!=="cursor";M&&c(ae),de&&u({...pe,__provider:"cursor"});return}const be=ae.codexSessions?.find(M=>M.id===e);if(be){const M=l?.name!==ae.name,de=d?.id!==e||d.__provider!=="codex";M&&c(ae),de&&u({...be,__provider:"codex"});return}const Ne=ae.geminiSessions?.find(M=>M.id===e);if(Ne){const M=typeof Ne.id=="string"&&Ne.id.startsWith("qwen_")||Ne.provider==="qwen",ce=typeof Ne.id=="string"&&Ne.id.startsWith("opencode_")||Ne.provider==="opencode"?"opencode":M?"qwen":"gemini",Y=l?.name!==ae.name,W=d?.id!==e||d.__provider!==ce;Y&&c(ae),W&&u({...Ne,__provider:ce});return}const xe=ae.qwenSessions?.find(M=>M.id===e);if(xe){const M=l?.name!==ae.name,de=d?.id!==e||d.__provider!=="qwen";M&&c(ae),de&&u({...xe,__provider:"qwen"});return}const Be=ae.opencodeSessions?.find(M=>M.id===e);if(Be){const M=l?.name!==ae.name,de=d?.id!==e||d.__provider!=="opencode";M&&c(ae),de&&u({...Be,__provider:"opencode"});return}}if(e&&d?.id!==e){const ae=e.startsWith("opencode_")?"opencode":e.startsWith("qwen_")?"qwen":e.startsWith("codex-")||e.startsWith("codex_")?"codex":e.startsWith("gemini_")?"gemini":null,me=(typeof window<"u"?localStorage.getItem("selected-provider"):null)||"claude";u({id:e,__provider:ae||me})}}},[e,s,l?.name,d?.id,d?.__provider]);const P=h.useCallback(ae=>{c(ae),u(null),t("/"),n&&g(!1)},[n,t]),H=h.useCallback(ae=>{u(ae),(p==="tasks"||p==="preview"||p==="liveView"||p==="orchestration")&&f("chat");const me=ae.__provider||localStorage.getItem("selected-provider")||"claude";if(ae.__provider&&localStorage.setItem("selected-provider",ae.__provider),me==="cursor"&&sessionStorage.setItem("cursorSessionId",ae.id),n){const pe=ae.__projectName,be=l?.name;pe!==be&&g(!1)}t(`/session/${ae.id}`)},[p,n,t,l?.name]),z=h.useCallback(ae=>{o(me=>{const pe=me.findIndex(Ne=>Ne.name===ae.name);if(pe===-1)return[ae,...me];const be=[...me];return be[pe]={...be[pe],...ae},be}),c(ae),u(null),f("chat"),t("/"),n&&g(!1)},[n,t]),U=h.useCallback(ae=>{z(ae)},[z]),V=h.useCallback(async ae=>{try{const me=await ot.quickStartProject(),pe=await me.json().catch(()=>({}));if(!me.ok||!pe?.project){console.error("[quick-start] failed:",pe);return}const be=pe.project;if(ae==="chat"){z(be);return}o(Ne=>Ne.some(xe=>xe.name===be.name)?Ne:[be,...Ne]),c(be),u(null),f(ae),t("/"),n&&g(!1)}catch(me){console.error("[quick-start] error:",me)}},[n,t,z]),O=h.useCallback(async()=>{await V("chat")},[V]),G=h.useCallback(async()=>{await V("orchestration")},[V]),$=h.useCallback((ae,me)=>{c(ae),u(null),f("orchestration"),me&&localStorage.setItem("pixcode.orchestration.selectedRunId",me),t("/"),n&&g(!1)},[n,t]),F=h.useCallback(ae=>{d?.id===ae&&(u(null),t("/")),o(me=>me.map(pe=>({...pe,sessions:pe.sessions?.filter(be=>be.id!==ae)??[],sessionMeta:{...pe.sessionMeta,total:Math.max(0,(pe.sessionMeta?.total??0)-1)}})))},[t,d?.id]),te=h.useCallback(async()=>{try{const me=await(await ot.projects()).json();if(o(Ne=>S4(Ne,me,!0)?me:Ne),!l)return;const pe=me.find(Ne=>Ne.name===l.name);if(!pe||(Qt(pe)!==Qt(l)&&c(pe),!d))return;const be=Pd(pe).find(Ne=>Ne.id===d.id);if(be){const Ne=be.__provider||!d.__provider?be:{...be,__provider:d.__provider};Qt(Ne)!==Qt(d)&&u(Ne)}}catch(ae){console.error("Error refreshing sidebar:",ae)}},[l,d]),Q=h.useCallback(ae=>{l?.name===ae&&(c(null),u(null),t("/")),o(me=>me.filter(pe=>pe.name!==ae))},[t,l?.name]),ge=h.useMemo(()=>({projects:s,selectedProject:l,selectedSession:d,onProjectSelect:P,onSessionSelect:H,onNewSession:U,onProjectCreated:z,onQuickStartSession:O,onOpenOrchestration:$,onSessionDelete:F,onProjectDelete:Q,isLoading:b,loadingProgress:y,onRefresh:te,onShowSettings:()=>S(!0),showSettings:E,settingsInitialTab:j,onCloseSettings:()=>S(!1),isMobile:n}),[U,$,z,O,Q,P,F,H,te,b,n,y,s,j,l,d,E]);return{projects:s,selectedProject:l,selectedSession:d,activeTab:p,sidebarOpen:m,isLoadingProjects:b,loadingProgress:y,isInputFocused:w,showSettings:E,settingsInitialTab:j,externalMessageUpdate:T,setActiveTab:f,setSidebarOpen:g,setIsInputFocused:k,setShowSettings:S,openSettings:N,fetchProjects:A,refreshProjectsSilently:I,sidebarSharedProps:ge,handleProjectSelect:P,handleSessionSelect:H,handleNewSession:U,handleOpenOrchestration:$,handleQuickStartOrchestration:G,handleSessionDelete:F,handleProjectDelete:Q,handleSidebarRefresh:te}}function Om(){const e=Pj(),{sessionId:t}=Fj(),{t:r}=Me("common"),{isMobile:n}=Lf({trackPWA:!1}),{ws:a,sendMessage:s,latestMessage:o,isConnected:l}=OE(),c=h.useRef(!1),{activeSessions:d,processingSessions:u,markSessionAsActive:p,markSessionAsInactive:f,markSessionAsProcessing:m,markSessionAsNotProcessing:g,replaceTemporarySession:b}=Vae(),{selectedProject:x,selectedSession:y,activeTab:v,sidebarOpen:w,isLoadingProjects:k,externalMessageUpdate:E,setActiveTab:S,setSidebarOpen:j,setIsInputFocused:_,setShowSettings:T,openSettings:C,refreshProjectsSilently:L,sidebarSharedProps:A,handleQuickStartOrchestration:I}=Zae({sessionId:t,navigate:e,latestMessage:o,isMobile:n,activeSessions:d});return h.useEffect(()=>(window.refreshProjects=L,()=>{window.refreshProjects===L&&delete window.refreshProjects}),[L]),h.useEffect(()=>(window.openSettings=C,()=>{window.openSettings===C&&delete window.openSettings}),[C]),h.useEffect(()=>{if(typeof navigator>"u"||!("serviceWorker"in navigator))return;const N=P=>{const H=P.data;if(!(!H||H.type!=="notification:navigate")){if(typeof H.provider=="string"&&H.provider.trim()&&localStorage.setItem("selected-provider",H.provider),S("chat"),j(!1),L(),typeof H.sessionId=="string"&&H.sessionId){e(`/session/${H.sessionId}`);return}e("/")}};return navigator.serviceWorker.addEventListener("message",N),()=>{navigator.serviceWorker.removeEventListener("message",N)}},[e,L,S,j]),h.useEffect(()=>{l&&!c.current?c.current=!0:l||(c.current=!1),l&&y?.id&&s({type:"get-pending-permissions",sessionId:y.id})},[l,y?.id,s]),h.useEffect(()=>{const N=window.visualViewport;if(!N)return;const P=()=>{const H=Math.max(0,window.innerHeight-N.height);document.documentElement.style.setProperty("--keyboard-height",`${H}px`)};return N.addEventListener("resize",P),()=>N.removeEventListener("resize",P)},[]),i.jsxs("div",{className:"fixed inset-0 flex bg-background",style:{bottom:"var(--keyboard-height, 0px)"},children:[n?i.jsxs("div",{className:`fixed inset-0 z-50 flex transition-all duration-150 ease-out ${w?"visible opacity-100":"invisible opacity-0"}`,children:[i.jsx("button",{className:"fixed inset-0 bg-background/60 backdrop-blur-sm transition-opacity duration-150 ease-out",onClick:N=>{N.stopPropagation(),j(!1)},onTouchStart:N=>{N.preventDefault(),N.stopPropagation(),j(!1)},"aria-label":r("versionUpdate.ariaLabels.closeSidebar")}),i.jsx("div",{className:`relative h-full w-[85vw] max-w-sm transform border-r border-border/40 bg-card transition-transform duration-150 ease-out sm:w-80 ${w?"translate-x-0":"-translate-x-full"}`,onClick:N=>N.stopPropagation(),onTouchStart:N=>N.stopPropagation(),children:i.jsx(Gk,{...A})})]}):i.jsx("div",{className:"h-full flex-shrink-0 border-r border-border/50",children:i.jsx(Gk,{...A})}),i.jsx("div",{className:"flex min-w-0 flex-1 flex-col",children:i.jsx(Fae,{selectedProject:x,selectedSession:y,activeTab:v,setActiveTab:S,ws:a,sendMessage:s,latestMessage:o,isMobile:n,onMenuClick:()=>j(!0),isLoading:k,onInputFocusChange:_,onSessionActive:p,onSessionInactive:f,onSessionProcessing:m,onSessionNotProcessing:g,processingSessions:u,onReplaceTemporarySession:b,onNavigateToSession:N=>e(`/session/${N}`),onShowSettings:()=>T(!0),externalMessageUpdate:E,onQuickStartSession:A.onQuickStartSession,onQuickStartOrchestration:I})}),i.jsx(Hae,{latestMessage:o})]})}const{slice:Xae,forEach:Jae}=[];function Qae(e){return Jae.call(Xae.call(arguments,1),t=>{if(t)for(const r in t)e[r]===void 0&&(e[r]=t[r])}),e}function eie(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 E4=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,tie=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(!E4.test(n.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${n.domain}`}if(n.path){if(!E4.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},N4={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=tie(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 rie={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return N4.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:r,cookieMinutes:n,cookieDomain:a,cookieOptions:s}=t;r&&typeof document<"u"&&N4.create(r,e,n,a,s)}},nie={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}},aie={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 ws=null;const C4=()=>{if(ws!==null)return ws;try{if(ws=typeof window<"u"&&window.localStorage!==null,!ws)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{ws=!1}return ws};var iie={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&C4())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:r}=t;r&&C4()&&window.localStorage.setItem(r,e)}};let ks=null;const A4=()=>{if(ks!==null)return ks;try{if(ks=typeof window<"u"&&window.sessionStorage!==null,!ks)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{ks=!1}return ks};var sie={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&A4())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:r}=t;r&&A4()&&window.sessionStorage.setItem(r,e)}},oie={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}},lie={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}},cie={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}},die={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 ej=!1;try{document.cookie,ej=!0}catch{}const tj=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];ej||tj.splice(1,1);const uie=()=>({order:tj,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class rj{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=Qae(r,this.options||{},uie()),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(rie),this.addDetector(nie),this.addDetector(iie),this.addDetector(sie),this.addDetector(oie),this.addDetector(lie),this.addDetector(cie),this.addDetector(die),this.addDetector(aie)}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&&!eie(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)}))}}rj.type="languageDetector";const pie={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"},mie={chat:"Chat",shell:"Shell",files:"Files",git:"Source Control",changes:"Changes",liveView:"Live View",tasks:"Tasks",orchestration:"Orchestration"},hie={loading:"Loading...",success:"Success",error:"Error",failed:"Failed",pending:"Pending",completed:"Completed",inProgress:"In Progress"},fie={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"},gie={settings:"Settings",home:"Home",back:"Back",next:"Next",previous:"Previous",logout:"Logout"},bie={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"},xie={justNow:"Just now",minutesAgo:"{{count}} mins ago",hoursAgo:"{{count}} hours ago",daysAgo:"{{count}} days ago",yesterday:"Yesterday"},yie={newFile:"New File",newFolder:"New Folder",rename:"Rename",move:"Move",copyPath:"Copy Path",openInEditor:"Open in Editor"},vie={loading:"Loading Pixcode",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",landing:{title:"Start a Pixcode workspace",description:"Choose a project, start a new chat, or launch Orchestration with one goal. Orchestration manages the CLI agents you select, shows every step, and surfaces errors directly.",startOrchestration:"Start Orchestration",startOrchestrationDescription:"Creates an automatic project and opens the Orchestration screen with agent control and run history.",startChat:"Start a new chat",startChatDescription:"Creates a folder automatically and opens the normal chat screen with one agent.",taskSystem:"Task system",taskSystemDescription:"Use the TaskMaster tab inside a project to track work items, status, and planned work.",sidebarHint:"When you select an existing project from the sidebar, chat history, files, git status, tasks, and orchestration stay in the same main screen.",createProject:"Create New Project",createProjectDescription:"Add an existing workspace or create a folder, then open the provider picker for coding."}},wie={title:"Orchestration",subtitle:"Give one goal inside {{project}}; choose the CLI workers, duplicate any CLI when needed, and assign work directly or let the coordinator split it.",refresh:"Refresh",goal:"Goal",goalPlaceholder:"Example: Fix the auth screen for single-port deployment, capture errors, and verify with lint and typecheck.",mode:"Run mode",systemPlan:"System plan",noMode:"No mode selected",loadingPlan:"Loading agent plan.",start:"Start team",starting:"Starting",stop:"Stop team",stopping:"Stopping",cancelFailed:"Workflow could not be stopped.",needAgent:"Enable at least one CLI worker.",needRoles:"Assign at least one enabled agent to these role(s) for this mode: {{roles}}.",startFailed:"Workflow could not start.",quickPrompts:{label:"Quick prompt:",liveTrading:{label:"8024 live trading screen",prompt:"Hi, please create a small project and then run it on port 8024. I want a Binance FAPI-connected TradingView-style design with a TradingView chart and a star/favorites system on the left. Split the work logically and manage the process automatically."}},cliControl:"CLI team",enabledCount:"{{count}} enabled",enabled:"Enabled",disabled:"Disabled",history:"History",emptyHistory:"No runs yet. Write a goal and start the agents.",steps:"{{done}}/{{total}} steps",notSelected:"No run selected",notSelectedDescription:"Select a previous run or start a new goal. Agent messages, errors, change summaries, and preview outputs appear here.",loadFailed:"Run details could not be loaded.",loadingRun:"Loading run...",teamHistory:"Team history",agentSteps:"Agent steps",changeSummary:"Change summary",noChangeSummary:"The final summary is not ready yet. A readable Markdown summary appears here when the agents finish.",prepareTeamFromReport:"Prepare agent team from this report",prepareTeamTitle:"Prepare agent team prompt",prepareTeamDescription:"The debate output was turned into a new Agent Team prompt. Edit it, then move it into Agent Team mode.",usePreparedPrompt:"Use prompt",reportToPromptPrefix:"Prepare and execute an agent team from the following debate/decision report. Split the needs into tasks, propose sensible assignments for the available CLI agents, and start only after user confirmation.",generatedSummaryTitle:"Automatic run summary",summaryStatus:"Overall status",summarySteps:"Completed steps",summaryFailures:"Failed steps",summaryCanceled:"Canceled steps",summaryDiffs:"Diff/change outputs",summaryPreviews:"Preview outputs",summaryErrorPrefix:"Error",assignedWork:"Assigned work",autoAssigned:"Automatic / coordinator decides",noStepOutput:"No step output.",agentMessages:"Agent messages",noAgentMessages:"This agent has not produced a message yet. If the run failed, the real CLI error appears above.",outputs:"Outputs",noOutputs:"No change summary, preview, or command output yet.",open:"Open",artifact:{fileDiff:"Change summary",previewUrl:"Preview",commandOutput:"Command output"},role:{user:"User",agent:"Agent"},status:{queued:"Queued",running:"Running",completed:"Completed",failed:"Failed",canceled:"Canceled",skipped:"Skipped"},nodes:{codex_review:"Codex review",gemini_review:"Gemini review",claude_review:"Claude review",claude_code_review:"Claude review",cursor_review:"Cursor review",aggregate:"Aggregate",architect:"Planning",implement:"Implementation",review:"Review",proposal:"Proposal",critique:"Critique",response:"Response",judge:"Decision",coordinator:"Coordinator",final_report:"Final report"},stages:{coordinator:"Coordinator",handoff:"Handoff",backend:"Backend",frontend:"Frontend",implementation:"Implementation",review:"Review",repair:"Repair",proposal:"Proposal",critique:"Critique",response:"Response",decision:"Decision",report:"Report",fallback:"Fallback",final_report:"Final report"},workflows:{multi_model_review:{name:"Multi-model review",description:"Enabled CLI agents review the same goal separately, then one enabled agent aggregates the result."},sequential_handoff:{name:"Sequential handoff",description:"Agents plan, implement, and review in order. Disabled CLI steps are skipped."},adversarial_debate:{name:"Decision debate",description:"Agents propose, critique, respond, and produce a final recommendation."},agent_team:{name:"Agent team",description:"A coordinator reads the goal and active CLI instances, assigns work, then collects the result."}},adapters:{"claude-code":{label:"Claude Code",role:"CLI worker"},cursor:{label:"Cursor",role:"CLI worker"},codex:{label:"Codex",role:"CLI worker"},gemini:{label:"Gemini",role:"CLI worker"},qwen:{label:"Qwen Code",role:"CLI worker"},opencode:{label:"OpenCode",role:"CLI worker"}},activeCount:"{{active}}/{{total}} active",teamHint:"Each row is one CLI worker. You can create multiple Claude, Codex, Cursor, Gemini, Qwen, or OpenCode workers and give each a different assignment.",parallelLimit:"Parallel limit",fallbackAgent:"Fallback CLI",noFallbackAgent:"No automatic fallback",fallbackAgentHint:"If a CLI step fails, Pixcode retries that step with this backup agent.",agentRole:"Stage",agentModel:"Model",agentRoles:{auto:"Auto",backend:"Backend",frontend:"Frontend",review:"Test / review",implementation:"Implementation",proposal:"Proposal",critique:"Critique",response:"Response",decision:"Decision / report",report:"Report",custom:"Custom"},customRolePlaceholder:"Example: Security, Mobile UX, DB architecture",roleHints:{default:"Leave empty and the coordinator assigns this agent from the goal.",agent_team:"Pick backend, frontend, or review stages, or leave agents on auto.",multi_model_review:"Enabled agents review; if a report role is selected, that agent aggregates the final summary.",sequential_handoff:"Agents run in your selected order; assignment text defines each step.",adversarial_debate:"Stage selection is optional in decision debate; if left empty, the system assigns selected agents to Proposal, Critique, and Response in order."},addAgent:"Add {{agent}}",soloAgent:"Run only with {{agent}}",soloAgentShort:"Solo",duplicateAgent:"Duplicate {{agent}}",removeAgent:"Remove {{agent}}",assignment:"Assignment",assignmentPlaceholder:"Optional: tell this worker exactly what to handle. Leave empty for coordinator assignment.",agentInstance:"{{name}} #{{number}}",taskTitle:"Task",taskTitlePlaceholder:"Implement feature",taskDescription:"Description",taskDescriptionPlaceholder:"Scope, constraints, expected output",addTask:"Add",runTask:"Run",cancelTask:"Cancel",dispatchTask:"Dispatch task",syncTaskMaster:"Sync TaskMaster",taskMasterSource:"TaskMaster",adapter:"Adapter",isolation:"Isolation",dispatch:"Dispatch",auto:"Auto",cliSettings:"CLI settings",waitingForStream:"Waiting for stream...",workflow:"Workflow",input:"Input",taskStates:{todo:"To Do",in_progress:"In Progress",in_review:"In Review",done:"Done",failed:"Failed",canceled:"Canceled"},isolationKind:{worktree:"Worktree",host:"Host",docker:"Docker"},workspaceTarget:"Target workspace",workspaceTargets:{selectedProject:"Selected project",pixcodeApp:"Pixcode system",custom:"Custom path"},customWorkspacePlaceholder:"/path/to/project",workspaceTargetHint:"Agents will run in: {{path}}",autoDetect:"auto-detect",needWorkspacePath:"Enter a custom workspace path."},kie={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",newFile:"New File (Cmd+N)",newFolder:"New Folder (Cmd+Shift+N)",refresh:"Refresh",collapseAll:"Collapse All",context:{rename:"Rename",delete:"Delete",copyPath:"Copy Path",download:"Download",newFile:"New File",newFolder:"New Folder",refresh:"Refresh",menuLabel:"File context menu",loading:"Loading..."}},Sie={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"},githubClone:{title:"Clone from GitHub",description:"Pick a target folder and clone a repository into it"},subfolder:{title:"Create Subfolder",description:"Pick a parent folder and create a fresh subfolder inside it"}},step2:{existingPath:"Workspace Path",newPath:"Workspace Path",subfolderParentPath:"Parent Folder",subfolderParentHelp:"Path to the folder where the new subfolder will be created",subfolderName:"Subfolder Name",subfolderNameHelp:"A new folder with this name will be created inside the parent above",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",subfolderWorkspace:"New Subfolder",path:"Path:",parentPath:"Parent Path:",subfolderName:"Subfolder Name:",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.",subfolderInfo:"A new subfolder will be created inside the parent folder and added to your project list.",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",provideSubfolderName:"Please provide a name for the subfolder",subfolderNameInvalid:"Subfolder name cannot contain path separators or be . / ..",failedToCreate:"Failed to create workspace",failedToCreateFolder:"Failed to create folder"}},Eie={genericTool:"a tool",codes:{generic:{info:{title:"Notification"}},permission:{required:{title:"Action Required",body:"{{toolName}} is waiting for your decision."}},run:{stopped:{title:"Run Stopped",body:"Reason: {{reason}}"},failed:{title:"Run Failed"}},agent:{notification:{title:"Agent Notification"}}}},Nie={title:"Update Available",newVersionReady:"A new version is ready",currentVersion:"Current Version",latestVersion:"Latest Version",latestRelease:"Latest Release",releaseNotesTitle:"Release Notes",releaseNotesSubtitle:"Latest Pixcode changes",whatsNew:"What's New:",viewFullRelease:"View full release",updateProgress:"Update Progress:",manualUpgrade:"Manual upgrade:",npmUpgradeCommand:"npm install -g @pixelbyte-software/pixcode@latest",manualUpgradeHint:'Or click "Update Now" to run the update automatically.',updateCompleted:"Update completed successfully!",restartServer:"Please restart the server to apply changes.",updateFailed:"Update failed",buttons:{close:"Close",later:"Later",copyCommand:"Copy Command",updateNow:"Update Now",updating:"Updating..."},ariaLabels:{closeModal:"Close version upgrade modal",showSidebar:"Show sidebar",settings:"Settings",updateAvailable:"Update available",closeSidebar:"Close sidebar"}},Cie={title:"Live View",subtitle:"Run this project locally and share it through the active secure tunnel when one is running.",start:"Start",restart:"Restart",stop:"Stop",runnerError:"Runner error",runnerUnavailable:"Runner unavailable",managedRuntimePreparing:"Pixcode will prepare the runtime",managedRuntimeDescription:"Press Start and Pixcode will prepare the required local runtime automatically.",preparingRuntime:"Preparing runtime…",preparingRuntimeDescription:"Pixcode is downloading and installing the runtime locally. This can take a moment on first use.",runnerErrorFallback:"The runner stopped before the preview became available.",detecting:"Detecting project runner…",noRunner:"No runner detected",staticHint:"Static HTML will be served directly when index.html exists.",customCommand:"Custom command",customPlaceholder:"npm run dev, python app.py, go run .",viewport:"Viewport",viewportDesktop:"Desktop",viewportTablet:"Tablet",viewportMobile:"Mobile",viewportWidth:"Width",viewportHeight:"Height",controls:"Runner, viewport and logs",shareLink:"Share link",starting:"Starting",openExternal:"Open externally",externalActive:"Secure tunnel is active; this link can be shared outside your network.",localOnly:"External Access is off; this link is local to this Pixcode server.",frameTitle:"Project Live View",emptyTitle:"Start Live View",emptyDescription:"Pixcode will detect the project stack, start the local web server, and expose it here."},Aie={buttons:pie,tabs:mie,status:hie,messages:fie,navigation:gie,common:bie,time:xie,fileOperations:yie,mainContent:vie,orchestration:wie,fileTree:kie,projectWizard:Sie,notifications:Eie,versionUpdate:Nie,liveView:Cie},Tie="Settings",jie={account:"Account",permissions:"Permissions",mcpServers:"MCP Servers",pluginsMcp:"Plugins / MCP",configuration:"Configuration",appearance:"Appearance"},_ie={title:"Account",language:"Language",languageLabel:"Display Language",languageDescription:"Choose your preferred language for the interface",username:"Username",email:"Email",profile:"Profile",changePassword:"Change Password"},Iie={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"}},Rie={title:"Appearance",theme:"Theme",codeEditor:"Code Editor",editorTheme:"Editor Theme",wordWrap:"Word Wrap",showMinimap:"Show Minimap",lineNumbers:"Line Numbers",fontSize:"Font Size"},Lie={saveChanges:"Save Changes",resetToDefaults:"Reset to Defaults",cancelChanges:"Cancel Changes"},Die={title:"Quick Settings",sections:{appearance:"Appearance",toolDisplay:"Tool Display",viewOptions:"View Options",inputSettings:"Input Settings",changeAwareness:"Command Center"},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.",changeAwareness:"Command Center",changedFiles:{title:"Changed files",description:"Tracks local file changes and opens the Files panel when a new change appears.",noProject:"Select a project to track local changes.",refresh:"Refresh changed files",empty:"No local changes detected",disabled:"Enable Command Center to watch local changes.",more:"+{{count}} more files",lastChecked:"Checked {{value}}",guideTitle:"Right panel guide",guideFiles:"Changed files glow green in Files.",guidePanel:"New changes appear beside the active chat.",status:{M:"M",A:"A",D:"D",U:"U"}},dragHandle:{dragging:"Dragging handle",closePanel:"Close settings panel",openPanel:"Open settings panel",draggingStatus:"Dragging...",toggleAndMove:"Click to toggle, drag to move"}},Oie={title:"Terminal Shortcuts",sectionKeys:"Keys",sectionNavigation:"Navigation",escape:"Escape",tab:"Tab",shiftTab:"Shift+Tab",arrowUp:"Arrow Up",arrowDown:"Arrow Down",scrollDown:"Scroll Down",handle:{closePanel:"Close shortcuts panel",openPanel:"Open shortcuts panel"}},Mie={label:"Settings",agents:"Agents",appearance:"Appearance",git:"Git",apiTokens:"API & Tokens",tasks:"Tasks",notifications:"Notifications",plugins:"Plugins",mobile:"Use from Mobile",telegram:"Telegram",diagnostics:"Diagnostics",about:"About"},Pie={title:"Use from Mobile",description:"Scan a QR code with your phone to open Pixcode on any device in the same network.",refresh:"Refresh",copy:"Copy",copied:"Copied!",loading:"Detecting network addresses…",noEndpoints:"No LAN addresses were detected. Make sure your device is connected to a network.",error:"Could not load network endpoints.",hostLabel:"Host",portLabel:"Port",steps:{sameNetwork:"Connect your phone to the same Wi-Fi network as this computer.",scan:"Open the camera app and scan one of the QR codes below.",login:"Sign in with your Pixcode credentials the first time."},external:{title:"External Access",description:"Expose Pixcode beyond your local network so you can reach it from the internet.",upnpTitle:"Router port mapping (UPnP)",upnpDescription:"One-click port forwarding via your router. Works on most home routers; fails silently on CGNAT or enterprise networks.",upnpEnable:"Enable UPnP",upnpDisable:"Disable UPnP",upnpEnabled:"UPnP mapping active",upnpUnsupported:"UPnP is not available on this network.",tunnelTitle:"Secure tunnel",tunnelDescription:"If UPnP is unavailable, install cloudflared or ngrok and start a tunnel — we'll auto-detect and show the QR here.",tunnelStart:"Start tunnel",tunnelStop:"Stop tunnel",tunnelRunning:"Tunnel running",tunnelUnavailable:"No tunnel binary found on this machine.",externalUrl:"External URL"}},Fie={title:"Telegram",description:"Receive task completion notifications and chat with your agents from Telegram.",comingSoon:"Telegram integration is being prepared.",botToken:"Bot Token",botTokenPlaceholder:"123456:ABC-DEF…",botTokenHelp:"Create a bot with @BotFather and paste the token here.",saveToken:"Save & Start Bot",saving:"Saving…",botRunning:"Bot running as @{{username}}",botStopped:"Bot stopped",stopBot:"Stop Bot",removeToken:"Remove Token",pairing:{title:"Pair with your Telegram account",description:"Message your bot, then enter this 6-digit code inside the chat. The code refreshes every 10 minutes.",code:"Pairing Code",regenerate:"Generate new code",verified:"Paired with Telegram account",notPaired:"No Telegram account paired yet."},linkedAccount:{title:"Paired Account",username:"@{{username}}",language:"Replies in {{language}}",unpair:"Unpair"},notifications:{title:"Notifications",description:"Send agent completion and error events to your Telegram chat.",enabled:"Enabled",disabled:"Disabled"},bridge:{title:"Chat Bridge",description:"Messages you send to the bot become prompts for your most recent session. Replies come back to Telegram.",enabled:"Enabled",disabled:"Disabled"},control:{title:"Remote Control",description:"Use Telegram as a full Pixcode control surface for agents, orchestration, provider setup, and run status.",enabled:"Enable Telegram control",enabledDescription:"When enabled, paired Telegram messages can start agent and orchestration work on the selected project.",progressMode:"Progress mode",progressModeDescription:"Choose how much run output Telegram should send back.",progressModes:{final:"Final answer only",steps:"Important steps and final answer",all:"All visible step changes"},selectedProject:"Selected project",selectedProvider:"Selected provider",selectedModel:"Selected model",selectedWorkflow:"Selected workflow"},errors:{invalidToken:"Telegram rejected this bot token.",networkError:"Could not reach Telegram servers."}},zie={title:"Notifications",description:"Control which notification events you receive.",webPush:{title:"Web Push Notifications",enable:"Enable Push Notifications",disable:"Disable Push Notifications",enabled:"Push notifications are enabled",loading:"Updating...",unsupported:"Push notifications are not supported in this browser.",denied:"Push notifications are blocked. Please allow them in your browser settings."},events:{title:"Event Types",actionRequired:"Action required",stop:"Run stopped",error:"Run failed",updates:"App and CLI updates"}},Bie={darkMode:{label:"Dark Mode",description:"Toggle between light and dark themes"},colorTheme:{title:"Color theme",palette:{label:"Accent palette",description:"Choose the product accent used by buttons, focus rings, navigation, and active states."},custom:{label:"Custom light/dark colors",description:"Pick separate accent colors for light and dark mode. Select Custom above to use them.",light:"Light",dark:"Dark"}},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"}}},$ie={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"}},Uie={success:"Settings saved successfully!",error:"Failed to save settings",saving:"Saving..."},Gie={save:"Save Settings",cancel:"Cancel"},Hie={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"}},Vie={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}}"}},qie={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"}},Wie={status:{title:"CLI status",notChecked:"Not checked yet",lastChecked:"Last checked: {{value}}",updatesFound:"{{count}} update available",refresh:"Refresh CLI status"},config:{blurb:"View or edit the files the {{name}} CLI reads on startup. Saves write directly to your home directory.",refresh:"Refresh",save:"Save",revert:"Revert",saved:"Saved",loading:"Loading…",notCreated:"new",readonly:"read-only",noFiles:"No config files are registered for this agent yet."},cliVersion:{title:"CLI version",installed:"Installed: {{version}}",unknownInstalled:"Installed version unknown",latest:"Latest: {{version}}",checkedAt:"Checked: {{value}}",cached:"cached",updateAvailable:"Update available",refresh:"Refresh",skipped:{external_installer:"External installer",installed_version_unavailable:"Installed version unavailable",latest_version_unavailable:"Latest version unavailable",not_installed:"Not installed"}},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"},gemini:{description:"Google Gemini AI assistant"},qwen:{description:"Alibaba Qwen Code CLI (Gemini CLI fork)"},opencode:{description:"Multi-provider terminal coding agent — Claude, OpenAI, Gemini, or local models"}},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}}"},Kie={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",opencodeDescription:"Equivalent to --dangerously-skip-permissions flag in OpenCode"},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"},opencodeAllowed:{title:"Allowed Bash Patterns",description:"Bash command patterns OpenCode auto-approves without prompting",placeholder:'e.g., "git *" or "npm test"',quickAdd:"Quick add common patterns:",empty:"No allowed patterns configured"},opencodeBlocked:{title:"Blocked Bash Patterns",description:"Bash command patterns OpenCode always denies",placeholder:'e.g., "rm -rf *" or "sudo *"',empty:"No blocked patterns configured"},opencodeExamples:{title:"Pattern Examples:",gitAll:"- Allow all git commands",gitPush:"- Block git push specifically",rmRf:"- Block recursive delete",npm:"- Allow all npm commands"},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"}},Yie={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."}},Zie={updateCheckFrequency:"Update check frequency",updateCheckFrequencyHint:"Pixcode caches GitHub release checks locally so shared IPs do not hit GitHub rate limits.",updateCheckFrequencyOptions:{"30m":"Every 30 minutes","6h":"Every 6 hours","12h":"Every 12 hours","24h":"Daily","7d":"Weekly",off:"Manual only"},checkForUpdate:"Check for updates",checkingForUpdate:"Checking...",updateFound:"Update found",upToDate:"Up to date",lastChecked:"Last checked {{when}}",notCheckedYet:"Update check has not completed yet",checkFailed:"check failed or delayed by rate limit"},Xie={title:"Plugins",description:"Extend the interface with custom plugins. Install from git or drop a folder in ~/.pixcode/plugins/",installPlaceholder:"https://github.com/user/my-plugin",installButton:"Install",installing:"Installing…",securityWarning:"Only install plugins whose source code you have reviewed or from authors you trust.",scanningPlugins:"Scanning plugins…",noPluginsInstalled:"No plugins installed",pullLatest:"Pull latest from git",noGitRemote:"No git remote — update not available",uninstallPlugin:"Uninstall plugin",confirmUninstall:"Click again to confirm",confirmUninstallMessage:"Remove {{name}}? This cannot be undone.",cancel:"Cancel",remove:"Remove",updateFailed:"Update failed",installFailed:"Installation failed",uninstallFailed:"Uninstall failed",toggleFailed:"Toggle failed",starterPluginLabel:"Starter Plugin",starter:"Starter",docs:"Docs",starterPlugin:{name:"Project Stats",badge:"starter",description:"File counts, lines of code, file-type breakdown, and recent activity for your project.",install:"Install"},terminalPlugin:{name:"Terminal",badge:"official",description:"Integrated terminal with full shell access directly within the interface.",install:"Install"},morePlugins:"More",enable:"Enable",disable:"Disable",installAriaLabel:"Plugin git repository URL",tab:"tab",runningStatus:"running"},Jie={title:Tie,tabs:jie,account:_ie,mcp:Iie,appearance:Rie,actions:Lie,quickSettings:Die,terminalShortcuts:Oie,mainTabs:Mie,mobile:Pie,telegram:Fie,notifications:zie,appearanceSettings:Bie,mcpForm:$ie,saveStatus:Uie,footerActions:Gie,git:Hie,apiKeys:Vie,tasks:qie,agents:Wie,permissions:Kie,mcpServers:Yie,about:Zie,pluginSettings:Xie},Qie={title:"Welcome Back",description:"Sign in to your Pixcode self-hosted account",username:"Username",password:"Password",submit:"Sign In",loading:"Signing in...",errors:{invalidCredentials:"Invalid username or password",requiredFields:"Please fill in all fields",networkError:"Network error. Please try again."},placeholders:{username:"Enter your username",password:"Enter your password"}},ese={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"}},tse={title:"Sign Out",confirm:"Are you sure you want to sign out?",button:"Sign Out"},rse={login:Qie,register:ese,logout:tse},nse={title:"Projects",newProject:"New Project",deleteProject:"Remove Project",renameProject:"Rename Project",noProjects:"No projects found",loadingProjects:"Loading projects...",searchPlaceholder:"Search projects...",projectNamePlaceholder:"Project name",starred:"Starred",all:"All",untitledSession:"Untitled Session",newSession:"New Session",codexSession:"Codex Session",fetchingProjects:"Fetching your Claude projects and sessions",projects:"projects",detectedFromHistory:"Detected from history",noMatchingProjects:"No matching projects",tryDifferentSearch:"Try adjusting your search term",runClaudeCli:"Run Claude CLI in a project directory to get started"},ase={title:"Pixcode",subtitle:"AI coding assistant interface"},ise={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",startToSee:"Start a new session to see it here."},sse={section:"Orchestration",fallbackTitle:"Orchestration run"},ose={flat:"Recent",grouped:"By project"},lse={viewEnvironments:"View Environments",hideSidebar:"Hide sidebar",createProject:"Create new project",refresh:"Refresh projects and sessions (Ctrl+R)",renameProject:"Rename project (F2)",deleteProject:"Remove project from sidebar (Delete)",addToFavorites:"Add to favorites",removeFromFavorites:"Remove from favorites",editSessionName:"Manually edit session name",deleteSession:"Delete this session permanently",sessionActions:"Session actions",historyView:"History view",historyViewFlat:"Recent conversations",historyViewGrouped:"Grouped by project",save:"Save",cancel:"Cancel",clearSearch:"Clear search"},cse={chat:"Chat",files:"Files",git:"Git",terminal:"Terminal",tasks:"Tasks"},dse={refresh:"Refresh",settings:"Settings",collapseAll:"Collapse All",expandAll:"Expand All",cancel:"Cancel",save:"Save",delete:"Delete",rename:"Rename",starSession:"Star",unstarSession:"Remove star",joinCommunity:"Join Community",reportIssue:"Report Issue",starOnGithub:"Star on GitHub"},use={openSource:"Open Source"},pse={active:"Active",inactive:"Inactive",thinking:"Thinking...",error:"Error",aborted:"Aborted",unknown:"Unknown"},mse={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",buckets:{today:"Today",yesterday:"Yesterday",thisWeek:"Previous 7 days",thisMonth:"Previous 30 days",older:"Older"}},hse={deleteConfirm:"Are you sure you want to delete this?",renameSuccess:"Renamed successfully",deleteSuccess:"Deleted successfully",errorOccurred:"An error occurred",deleteSessionConfirm:"Are you sure you want to delete this session? This action cannot be undone.",deleteProjectConfirm:"Remove this project from the sidebar? Your project files, memories, and session data will not be deleted.",enterProjectPath:"Please enter a project path",deleteSessionFailed:"Failed to delete session. Please try again.",deleteSessionError:"Error deleting session. Please try again.",renameSessionFailed:"Failed to rename session. Please try again.",renameSessionError:"Error renaming session. Please try again.",deleteProjectFailed:"Failed to remove project. Please try again.",deleteProjectError:"Error removing project. Please try again.",createProjectFailed:"Failed to create project. Please try again.",createProjectError:"Error creating project. Please try again."},fse={updateAvailable:"Update available"},gse={modeProjects:"Projects",modeConversations:"Conversations",conversationsPlaceholder:"Search in conversations...",searching:"Searching...",noResults:"No results found",tryDifferentQuery:"Try a different search query",matches_one:"{{count}} match",matches_other:"{{count}} matches",projectsScanned_one:"{{count}} project scanned",projectsScanned_other:"{{count}} projects scanned"},bse={deleteProject:"Remove Project",deleteSession:"Delete Session",confirmDelete:"What would you like to do with",sessionCount_one:"This project contains {{count}} conversation.",sessionCount_other:"This project contains {{count}} conversations.",removeFromSidebar:"Remove from sidebar only",deleteAllData:"Delete all data permanently",allConversationsDeleted:"The project will be removed from the sidebar. Your files, memories, and session data will be preserved.",cannotUndo:"You can re-add the project later."},xse={projects:nse,app:ase,sessions:ise,orchestration:sse,historyView:ose,tooltips:lse,navigation:cse,actions:dse,branding:use,status:pse,time:mse,messages:hse,version:fse,search:gse,deleteConfirmation:bse},yse={copy:"Copy",copied:"Copied",copyCode:"Copy code"},vse={copy:"Copy message",copied:"Message copied",selectFormat:"Select copy format",copyAsMarkdown:"Copy as markdown",copyAsText:"Copy as text"},wse={user:"U",error:"Error",tool:"Tool",claude:"Claude",cursor:"Cursor",codex:"Codex",gemini:"Gemini",qwen:"Qwen Code"},kse={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"},Sse={found:"Found {{count}} {{type}}",file:"file",files:"files",pattern:"pattern:",in:"in:"},Ese={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"},Nse={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."},Cse={title:"Thinking...",emoji:"💭 Thinking..."},Ase={response:"JSON Response"},Tse={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"},jse={updated:"Todo list has been updated successfully",current:"Current Todo List"},_se={viewPlan:"📋 View implementation plan",title:"Implementation Plan"},Ise={resetAt:"Claude usage limit reached. Your limit will reset at **{{time}} {{timezone}}** - {{date}}"},Rse={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"},Lse={permissionMode:"Gemini Permission Mode",description:"Control how Gemini CLI handles operation approvals.",modes:{default:{title:"Standard (Ask for Approval)",description:"Gemini will prompt for approval before executing commands, writing files, and fetching web resources."},autoEdit:{title:"Auto Edit (Skip File Approvals)",description:"Gemini will automatically approve file edits and web fetches, but will still prompt for shell commands."},yolo:{title:"YOLO (Bypass All Permissions)",description:"Gemini will execute all operations without asking for approval. Exercise caution."}}},Dse={permissionMode:"Qwen Permission Mode",description:"Control how Qwen Code handles operation approvals.",modes:{default:{title:"Standard (Ask for Approval)",description:"Qwen Code will prompt for approval before executing commands, writing files, and fetching web resources."},autoEdit:{title:"Auto Edit (Skip File Approvals)",description:"Qwen Code will automatically approve file edits and web fetches, but will still prompt for shell commands."},yolo:{title:"YOLO (Bypass All Permissions)",description:"Qwen Code will execute all operations without asking for approval. Exercise caution."}}},Ose={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",clickToChangeMode:"Click to change permission mode (or press Tab in input)",showAllCommands:"Show all commands",clearInput:"Clear input",scrollToBottom:"Scroll to bottom"},Mse={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}}"},Pse={title:"Choose Your AI Assistant",description:"Select a provider to start a new conversation",selectModel:"Select Model",providerInfo:{anthropic:"by Anthropic",openai:"by OpenAI",cursorEditor:"AI Code Editor",google:"by Google"},readyPrompt:{claude:"Ready to use Claude with {{model}}. Start typing your message below.",cursor:"Ready to use Cursor with {{model}}. Start typing your message below.",codex:"Ready to use Codex with {{model}}. Start typing your message below.",gemini:"Ready to use Gemini with {{model}}. Start typing your message below.",default:"Select a provider above to begin"}},Fse={continue:{title:"Continue your conversation",description:"Ask questions about your code, request changes, or get help with development tasks"},loading:{olderMessages:"Loading older messages...",sessionMessages:"Loading session messages..."},messages:{showingOf:"Showing {{shown}} of {{total}} messages",scrollToLoad:"Scroll up to load more",showingLast:"Showing last {{count}} messages ({{total}} total)",loadEarlier:"Load earlier messages",loadAll:"Load all messages",loadingAll:"Loading all messages...",allLoaded:"All messages loaded",perfWarning:'All messages loaded — scrolling may be slower. Click "Scroll to bottom" to restore performance.'}},zse={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"},Bse={actions:{thinking:"Thinking",processing:"Processing",analyzing:"Analyzing",working:"Working",computing:"Computing",reasoning:"Reasoning"},state:{live:"Live",paused:"Paused"},elapsed:{seconds:"{{count}}s",minutesSeconds:"{{minutes}}m {{seconds}}s",label:"{{time}} elapsed",startingNow:"Starting now"},controls:{stopGeneration:"Stop Generation",pressEscToStop:"Press Esc anytime to stop"},providers:{assistant:"Assistant"}},$se={startChatWithProvider:"Select a project to start chatting with {{provider}}"},Use={nextTaskPrompt:"Start the next task"},Gse={codeBlock:yse,copyMessage:vse,messageTypes:wse,tools:kse,search:Sse,fileOperations:Ese,interactive:Nse,thinking:Cse,json:Ase,permissions:Tse,todo:jse,plan:_se,usageLimit:Ise,codex:Rse,gemini:Lse,qwen:Dse,input:Ose,thinkingMode:Mse,providerSelection:Pse,session:Fse,shell:zse,claudeStatus:Bse,projectSelection:$se,tasks:Use},Hse={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"},Vse="Loading {{fileName}}...",qse={showingChanges:"Showing changes"},Wse={download:"Download file",save:"Save",saving:"Saving...",saved:"Saved!",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",close:"Close",previewMarkdown:"Preview markdown",editMarkdown:"Edit markdown"},Kse={lines:"Lines:",characters:"Characters:",shortcuts:"Press Ctrl+S to save • Esc to close"},Yse={title:"Binary File",message:'The file "{{fileName}}" cannot be displayed in the text editor because it is a binary file.'},Zse={toolbar:Hse,loading:Vse,header:qse,actions:Wse,footer:Kse,binaryFile:Yse},Xse={title:"TaskMaster AI is not configured",description:"TaskMaster helps break down complex projects into manageable tasks with AI-powered assistance",whatIsTitle:"🎯 What is TaskMaster?",features:{aiPowered:"AI-Powered Task Management: Break complex projects into manageable subtasks",prdTemplates:"PRD Templates: Generate tasks from Product Requirements Documents",dependencyTracking:"Dependency Tracking: Understand task relationships and execution order",progressVisualization:"Progress Visualization: Kanban boards and detailed task analytics",cliIntegration:"CLI Integration: Use taskmaster commands for advanced workflows"},initializeButton:"Initialize TaskMaster AI"},Jse={title:"Getting Started with TaskMaster",subtitle:"TaskMaster is initialized! Here's what to do next:",steps:{createPRD:{title:"Create a Product Requirements Document (PRD)",description:"Discuss your project idea and create a PRD that describes what you want to build.",addButton:"Add PRD",existingPRDs:"Existing PRDs:"},generateTasks:{title:"Generate Tasks from PRD",description:"Once you have a PRD, ask your AI assistant to parse it and TaskMaster will automatically break it down into manageable tasks with implementation details."},analyzeTasks:{title:"Analyze & Expand Tasks",description:"Ask your AI assistant to analyze task complexity and expand them into detailed subtasks for easier implementation."},startBuilding:{title:"Start Building",description:"Ask your AI assistant to begin working on tasks, update their status, and add new tasks as your project evolves."}},tip:"💡 Tip: Start with a PRD to get the most out of TaskMaster's AI-powered task generation"},Qse={title:"TaskMaster Setup",subtitle:"Interactive CLI for {{projectName}}",willStart:"TaskMaster initialization will start automatically",completed:"TaskMaster setup completed! You can now close this window.",closeButton:"Close",closeContinueButton:"Close & Continue"},eoe={title:"Getting Started with TaskMaster",subtitle:"Your guide to productive task management",examples:{parsePRD:`💬 Example:
|
|
850
850
|
"I've just initialized a new project with Claude Task Master. I have a PRD at .taskmaster/docs/prd.txt. Can you help me parse it and set up the initial tasks?"`,expandTask:`💬 Example:
|
|
851
851
|
"Task 5 seems complex. Can you break it down into subtasks?"`,addTask:`💬 Example:
|
|
852
852
|
"Please add a new task to implement user profile image uploads using Cloudinary, research the best approach."`},moreExamples:"View more examples and usage patterns →",proTips:{title:"💡 Pro Tips",search:"Use the search bar to quickly find specific tasks",views:"Switch between Kanban, List, and Grid views using the view toggles",filters:"Use filters to focus on specific task statuses or priorities",details:"Click on any task to view detailed information and manage subtasks"},learnMore:{title:"📚 Learn More",description:"TaskMaster AI is an advanced task management system built for developers. Get documentation, examples, and contribute to the project.",githubButton:"View on GitHub"}},toe={placeholder:"Search tasks..."},roe={button:"Filters",status:"Status",priority:"Priority",sortBy:"Sort By",allStatuses:"All Statuses",allPriorities:"All Priorities",showing:"Showing {{filtered}} of {{total}} tasks",clearFilters:"Clear Filters"},noe={id:"ID",status:"Status",priority:"Priority",idAsc:"ID (Ascending)",idDesc:"ID (Descending)",titleAsc:"Title (A-Z)",titleDesc:"Title (Z-A)",statusAsc:"Status (Pending First)",statusDesc:"Status (Done First)",priorityAsc:"Priority (High First)",priorityDesc:"Priority (Low First)"},aoe={kanban:"Kanban view",list:"List view",grid:"Grid view"},ioe={pending:"📋 To Do",inProgress:"🚀 In Progress",done:"✅ Done",blocked:"🚫 Blocked",deferred:"⏳ Deferred",cancelled:"❌ Cancelled",noTasksYet:"No tasks yet",tasksWillAppear:"Tasks will appear here",moveTasksHere:"Move tasks here when started",completedTasksHere:"Completed tasks appear here",statusTasksHere:"Tasks with this status will appear here"},soe={help:"TaskMaster Getting Started Guide",prds:"PRDs",addPRD:"Add PRD",addTask:"Add Task",createNewPRD:"Create New PRD",prdsAvailable:"{{count}} PRD(s) available"},ooe={modified:"Modified: {{date}}"},loe={pending:"Pending","in-progress":"In Progress",done:"Done",blocked:"Blocked",deferred:"Deferred",cancelled:"Cancelled"},coe={high:"High",medium:"Medium",low:"Low"},doe={title:"No tasks match your filters",description:"Try adjusting your search or filter criteria."},uoe={notConfigured:Xse,gettingStarted:Jse,setupModal:Qse,helpGuide:eoe,search:toe,filters:roe,sort:noe,views:aoe,kanban:ioe,buttons:soe,prd:ooe,statuses:loe,priorities:coe,noMatchingTasks:doe},poe={save:"저장",cancel:"취소",delete:"삭제",create:"생성",edit:"편집",close:"닫기",confirm:"확인",submit:"제출",retry:"재시도",refresh:"새로고침",search:"검색",clear:"지우기",copy:"복사",download:"다운로드",upload:"업로드",browse:"찾아보기"},moe={chat:"채팅",shell:"Shell",files:"파일",git:"소스 관리",changes:"변경 사항",liveView:"라이브 보기",tasks:"작업",orchestration:"오케스트레이션"},hoe={loading:"로딩 중...",success:"성공",error:"오류",failed:"실패",pending:"대기 중",completed:"완료",inProgress:"진행 중"},foe={savedSuccessfully:"저장되었습니다",deletedSuccessfully:"삭제되었습니다",updatedSuccessfully:"업데이트되었습니다",operationFailed:"작업 실패",networkError:"네트워크 오류. 연결을 확인해주세요.",unauthorized:"인증되지 않았습니다. 로그인해주세요.",notFound:"찾을 수 없음",invalidInput:"잘못된 입력",requiredField:"필수 항목입니다",unknownError:"알 수 없는 오류가 발생했습니다"},goe={settings:"설정",home:"홈",back:"뒤로",next:"다음",previous:"이전",logout:"로그아웃"},boe={language:"언어",theme:"테마",darkMode:"다크 모드",lightMode:"라이트 모드",name:"이름",description:"설명",enabled:"활성화",disabled:"비활성화",optional:"선택사항",version:"버전",select:"선택",selectAll:"전체 선택",deselectAll:"전체 해제"},xoe={justNow:"방금 전",minutesAgo:"{{count}}분 전",hoursAgo:"{{count}}시간 전",daysAgo:"{{count}}일 전",yesterday:"어제"},yoe={newFile:"새 파일",newFolder:"새 폴더",rename:"이름 변경",move:"이동",copyPath:"경로 복사",openInEditor:"에디터에서 열기"},voe={loading:"Pixcode 로딩 중",settingUpWorkspace:"워크스페이스 설정 중...",chooseProject:"프로젝트 선택",selectProjectDescription:"사이드바에서 프로젝트를 선택하여 Claude와 코딩을 시작하세요. 각 프로젝트에는 채팅 세션과 파일 히스토리가 포함됩니다.",tip:"팁",createProjectMobile:"위의 메뉴 버튼을 눌러 프로젝트에 접근하세요",createProjectDesktop:"사이드바의 폴더 아이콘을 클릭하여 새 프로젝트를 생성하세요",newSession:"새 세션",untitledSession:"제목 없는 세션",projectFiles:"프로젝트 파일",landing:{title:"Pixcode 워크스페이스 시작",description:"프로젝트를 선택하거나 새 채팅을 시작하거나 하나의 목표로 오케스트레이션을 실행할 수 있습니다. 오케스트레이션은 선택한 CLI 에이전트를 관리하고 모든 단계와 오류를 보여줍니다.",startOrchestration:"오케스트레이션 시작",startOrchestrationDescription:"프로젝트를 자동 생성하고 에이전트 제어와 실행 기록이 있는 오케스트레이션 화면을 엽니다.",startChat:"새 채팅 시작",startChatDescription:"폴더를 자동 생성하고 단일 에이전트로 일반 채팅 화면을 엽니다.",taskSystem:"작업 시스템",taskSystemDescription:"프로젝트의 TaskMaster 탭에서 작업, 상태, 계획된 일을 추적합니다.",sidebarHint:"사이드바에서 기존 프로젝트를 선택하면 채팅 기록, 파일, git 상태, 작업, 오케스트레이션이 같은 메인 화면에 유지됩니다."}},woe={loading:"파일 로딩 중...",files:"파일",simpleView:"간단히 보기",compactView:"컴팩트 보기",detailedView:"상세히 보기",searchPlaceholder:"파일 및 폴더 검색...",clearSearch:"검색 지우기",name:"이름",size:"크기",modified:"수정일",permissions:"권한",noFilesFound:"파일을 찾을 수 없음",checkProjectPath:"프로젝트 경로가 접근 가능한지 확인하세요",noMatchesFound:"일치하는 항목 없음",tryDifferentSearch:"다른 검색어를 시도하거나 검색을 지우세요",justNow:"방금 전",minAgo:"{{count}}분 전",hoursAgo:"{{count}}시간 전",daysAgo:"{{count}}일 전",newFile:"새 파일 (Cmd+N)",newFolder:"새 폴더 (Cmd+Shift+N)",refresh:"새로고침",collapseAll:"모두 접기",context:{rename:"이름 변경",delete:"삭제",copyPath:"경로 복사",download:"다운로드",newFile:"새 파일",newFolder:"새 폴더",refresh:"새로 고침",menuLabel:"파일 컨텍스트 메뉴",loading:"로딩 중..."}},koe={title:"새 프로젝트 생성",steps:{type:"유형",configure:"설정",confirm:"확인"},step1:{question:"이미 워크스페이스가 있으신가요, 아니면 새로 생성하시겠습니까?",existing:{title:"기존 워크스페이스",description:"서버에 이미 워크스페이스가 있고 프로젝트 목록에 추가만 하면 됩니다"},new:{title:"새 워크스페이스",description:"새 워크스페이스를 생성하고, 선택적으로 GitHub 저장소에서 clone합니다"},githubClone:{title:"GitHub에서 클론",description:"대상 폴더를 선택하고 저장소를 그 안에 클론"},subfolder:{title:"하위 폴더 만들기",description:"상위 폴더를 선택하고 그 안에 새 하위 폴더 생성"}},step2:{existingPath:"워크스페이스 경로",newPath:"워크스페이스 경로",subfolderParentPath:"상위 폴더",subfolderParentHelp:"새 하위 폴더가 생성될 폴더 경로",subfolderName:"하위 폴더 이름",subfolderNameHelp:"이 이름으로 상위 폴더 안에 새 폴더가 생성됩니다",existingPlaceholder:"/path/to/existing/workspace",newPlaceholder:"/path/to/new/workspace",existingHelp:"기존 워크스페이스 디렉토리의 전체 경로",newHelp:"워크스페이스 디렉토리의 전체 경로",githubUrl:"GitHub URL (선택사항)",githubPlaceholder:"https://github.com/username/repository",githubHelp:"선택사항: 저장소를 clone하려면 GitHub URL을 입력하세요",githubAuth:"GitHub 인증 (선택사항)",githubAuthHelp:"비공개 저장소에만 필요합니다. 공개 저장소는 인증 없이 clone할 수 있습니다.",loadingTokens:"저장된 토큰 로딩 중...",storedToken:"저장된 토큰",newToken:"새 토큰",nonePublic:"없음 (공개)",selectToken:"토큰 선택",selectTokenPlaceholder:"-- 토큰 선택 --",tokenPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",tokenHelp:"이 토큰은 이 작업에만 사용됩니다",publicRepoInfo:"공개 저장소는 인증이 필요하지 않습니다. 공개 저장소를 clone하는 경우 토큰을 생략할 수 있습니다.",noTokensHelp:"저장된 토큰이 없습니다. 설정 → API Keys에서 토큰을 추가하면 재사용이 편리합니다.",optionalTokenPublic:"GitHub 토큰 (공개 저장소는 선택사항)",tokenPublicPlaceholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (공개 저장소는 비워두세요)"},step3:{reviewConfig:"설정 검토",workspaceType:"워크스페이스 유형:",existingWorkspace:"기존 워크스페이스",newWorkspace:"새 워크스페이스",subfolderWorkspace:"새 하위 폴더",path:"경로:",parentPath:"상위 경로:",subfolderName:"하위 폴더 이름:",cloneFrom:"Clone 소스:",authentication:"인증:",usingStoredToken:"저장된 토큰 사용:",usingProvidedToken:"제공된 토큰 사용",noAuthentication:"인증 없음",sshKey:"SSH 키",existingInfo:"워크스페이스가 프로젝트 목록에 추가되며 Claude/Cursor 세션에서 사용할 수 있습니다.",newWithClone:"이 폴더에 저장소가 clone됩니다.",newEmpty:"워크스페이스가 프로젝트 목록에 추가되며 Claude/Cursor 세션에서 사용할 수 있습니다.",subfolderInfo:"상위 폴더 안에 새 하위 폴더가 생성되어 프로젝트 목록에 추가됩니다.",cloningRepository:"저장소 clone 중..."},buttons:{cancel:"취소",back:"뒤로",next:"다음",createProject:"프로젝트 생성",creating:"생성 중...",cloning:"Clone 중..."},errors:{selectType:"기존 워크스페이스를 사용할지 새로 생성할지 선택해주세요",providePath:"워크스페이스 경로를 입력해주세요",provideSubfolderName:"하위 폴더 이름을 입력해주세요",subfolderNameInvalid:"하위 폴더 이름에 경로 구분자를 포함할 수 없으며 . / .. 도 허용되지 않습니다",failedToCreate:"워크스페이스 생성 실패",failedToCreateFolder:"폴더 생성 실패"}},Soe={genericTool:"도구",codes:{generic:{info:{title:"알림"}},permission:{required:{title:"작업 필요",body:"{{toolName}} 에 대한 결정을 기다리고 있습니다."}},run:{stopped:{title:"실행이 중지되었습니다",body:"사유: {{reason}}"},failed:{title:"실행 실패"}},agent:{notification:{title:"에이전트 알림"}}}},Eoe={title:"업데이트 가능",newVersionReady:"새 버전이 준비되었습니다",currentVersion:"현재 버전",latestVersion:"최신 버전",whatsNew:"새로운 기능:",viewFullRelease:"전체 릴리스 보기",updateProgress:"업데이트 진행 상황:",manualUpgrade:"수동 업그레이드:",npmUpgradeCommand:"npm install -g @pixelbyte-software/pixcode@latest",manualUpgradeHint:'또는 "지금 업데이트"를 클릭하여 자동으로 업데이트합니다.',updateCompleted:"업데이트가 완료되었습니다!",restartServer:"변경사항을 적용하려면 서버를 재시작하세요.",updateFailed:"업데이트 실패",buttons:{close:"닫기",later:"나중에",copyCommand:"명령어 복사",updateNow:"지금 업데이트",updating:"업데이트 중..."},ariaLabels:{closeModal:"버전 업그레이드 모달 닫기",showSidebar:"사이드바 표시",settings:"설정",updateAvailable:"업데이트 가능",closeSidebar:"사이드바 닫기"}},Noe={title:"오케스트레이션",subtitle:"{{project}} 안에서 하나의 목표를 입력하고 CLI 워커를 선택하세요. 필요하면 같은 CLI를 여러 개 만들고 직접 배정하거나 코디네이터가 나누게 할 수 있습니다.",refresh:"새로고침",goal:"목표",goalPlaceholder:"예: 인증 화면을 단일 포트 배포에 맞게 수정하고 오류를 수집한 뒤 lint와 typecheck로 검증합니다.",mode:"실행 모드",systemPlan:"시스템 계획",noMode:"선택된 모드 없음",loadingPlan:"에이전트 계획을 불러오는 중입니다.",start:"팀 시작",starting:"시작 중",needAgent:"CLI 워커를 하나 이상 활성화하세요.",startFailed:"워크플로를 시작할 수 없습니다.",cliControl:"CLI 팀",enabledCount:"{{count}}개 활성",enabled:"활성",disabled:"비활성",history:"기록",emptyHistory:"아직 실행 기록이 없습니다. 목표를 작성하고 에이전트를 시작하세요.",steps:"{{done}}/{{total}} 단계",notSelected:"선택된 실행 없음",notSelectedDescription:"이전 실행을 선택하거나 새 목표를 시작하세요. 에이전트 메시지, 오류, 변경 요약, 미리보기 출력이 여기에 표시됩니다.",loadFailed:"실행 상세를 불러올 수 없습니다.",loadingRun:"실행을 불러오는 중...",agentSteps:"에이전트 단계",noStepOutput:"단계 출력이 없습니다.",agentMessages:"에이전트 메시지",noAgentMessages:"이 에이전트는 아직 메시지를 생성하지 않았습니다. 실행이 실패했다면 실제 CLI 오류가 위에 표시됩니다.",outputs:"출력",noOutputs:"변경 요약, 미리보기 또는 명령 출력이 아직 없습니다.",open:"열기",artifact:{fileDiff:"변경 요약",previewUrl:"미리보기",commandOutput:"명령 출력"},role:{user:"사용자",agent:"에이전트"},status:{queued:"대기 중",running:"실행 중",completed:"완료",failed:"오류",canceled:"취소됨",skipped:"건너뜀"},nodes:{codex_review:"Codex 검토",gemini_review:"Gemini 검토",claude_review:"Claude 검토",claude_code_review:"Claude 검토",cursor_review:"Cursor 검토",aggregate:"집계",architect:"계획",implement:"구현",review:"검토",proposal:"제안",critique:"비판",response:"응답",judge:"결정",coordinator:"코디네이터",final_report:"최종 보고서"},workflows:{multi_model_review:{name:"멀티 모델 검토",description:"활성화된 CLI 에이전트가 같은 목표를 개별 검토한 뒤 활성 에이전트가 결과를 집계합니다."},sequential_handoff:{name:"순차 핸드오프",description:"에이전트가 순서대로 계획, 구현, 검토합니다. 비활성 CLI 단계는 건너뜁니다."},adversarial_debate:{name:"의사결정 토론",description:"에이전트가 제안, 비판, 응답하고 최종 권고를 생성합니다."},agent_team:{name:"에이전트 팀",description:"코디네이터가 목표와 활성 CLI 인스턴스를 읽고 작업을 배정한 뒤 결과를 모읍니다."}},adapters:{"claude-code":{label:"Claude Code",role:"CLI 워커"},cursor:{label:"Cursor",role:"CLI 워커"},codex:{label:"Codex",role:"CLI 워커"},gemini:{label:"Gemini",role:"CLI 워커"},qwen:{label:"Qwen Code",role:"CLI 워커"},opencode:{label:"OpenCode",role:"CLI 워커"}},activeCount:"{{active}}/{{total}} 활성",teamHint:"각 행은 하나의 CLI 워커입니다. Claude, Codex, Cursor, Gemini, Qwen, OpenCode 워커를 여러 개 만들고 각각 다른 작업을 줄 수 있습니다.",parallelLimit:"병렬 제한",addAgent:"{{agent}} 추가",duplicateAgent:"{{agent}} 복제",removeAgent:"{{agent}} 제거",assignment:"배정",assignmentPlaceholder:"선택 사항: 이 워커가 맡을 일을 정확히 적으세요. 비워 두면 코디네이터가 목표에 따라 배정합니다.",agentInstance:"{{name}} #{{number}}",taskTitle:"작업",taskTitlePlaceholder:"기능 구현",taskDescription:"설명",taskDescriptionPlaceholder:"범위, 제약, 기대 출력",addTask:"추가",runTask:"실행",cancelTask:"취소",dispatchTask:"작업 배정",syncTaskMaster:"TaskMaster 동기화",taskMasterSource:"TaskMaster",adapter:"어댑터",isolation:"격리",dispatch:"배정",auto:"자동",waitingForStream:"스트림 대기 중...",workflow:"워크플로",input:"입력",taskStates:{todo:"할 일",in_progress:"진행 중",in_review:"검토 중",done:"완료",failed:"실패",canceled:"취소됨"},isolationKind:{worktree:"Worktree",host:"Host",docker:"Docker"},stop:"팀 중지",stopping:"중지 중",cancelFailed:"워크플로를 중지할 수 없습니다.",needRoles:"이 모드에서는 다음 역할에 최소 한 명의 활성 에이전트를 할당해야 합니다: {{roles}}.",quickPrompts:{label:"빠른 프롬프트:",liveTrading:{label:"8024 라이브 트레이딩 화면",prompt:"안녕하세요. 작은 프로젝트를 만들고 이후 8024 포트에서 실행해 주세요. Binance FAPI와 연결된 TradingView 스타일 디자인, TradingView 차트, 왼쪽 별표/즐겨찾기 시스템을 원합니다. 작업을 논리적으로 나누고 프로세스를 자동으로 관리해 주세요."}},teamHistory:"팀 기록",changeSummary:"변경 요약",noChangeSummary:"최종 요약이 아직 준비되지 않았습니다. 에이전트가 완료되면 읽기 쉬운 Markdown 요약이 여기에 표시됩니다.",prepareTeamFromReport:"이 보고서로 에이전트 팀 준비",prepareTeamTitle:"에이전트 팀 프롬프트 준비",prepareTeamDescription:"토론 결과가 새 Agent Team 프롬프트로 변환되었습니다. 수정한 뒤 Agent Team 모드로 이동할 수 있습니다.",usePreparedPrompt:"프롬프트 사용",reportToPromptPrefix:"아래 토론/결정 보고서를 바탕으로 에이전트 팀을 준비하고 실행하세요. 요구사항을 작업으로 나누고 사용 가능한 CLI 에이전트에 적절한 할당을 제안한 뒤, 사용자 확인 후 시작하세요.",generatedSummaryTitle:"자동 실행 요약",summaryStatus:"전체 상태",summarySteps:"완료된 단계",summaryFailures:"실패한 단계",summaryCanceled:"취소된 단계",summaryDiffs:"Diff/변경 출력",summaryPreviews:"미리보기 출력",summaryErrorPrefix:"오류",assignedWork:"할당된 작업",autoAssigned:"자동 / 코디네이터 결정",stages:{coordinator:"코디네이터",handoff:"인계",backend:"백엔드",frontend:"프론트엔드",implementation:"구현",review:"리뷰",repair:"수정",proposal:"제안",critique:"비판",response:"응답",decision:"결정",report:"보고서",final_report:"최종 보고서"},agentRole:"단계",agentRoles:{auto:"자동",backend:"백엔드",frontend:"프론트엔드",review:"테스트 / 리뷰",implementation:"구현",proposal:"제안",critique:"비판",response:"응답",decision:"결정 / 보고서",report:"보고서",custom:"사용자 지정"},customRolePlaceholder:"예: 보안, 모바일 UX, DB 아키텍처",roleHints:{default:"비워두면 코디네이터가 목표에 따라 이 에이전트에 할당합니다.",agent_team:"백엔드, 프론트엔드, 리뷰 단계를 선택하거나 자동으로 둘 수 있습니다.",multi_model_review:"활성 에이전트가 리뷰합니다. 보고서 역할을 선택하면 해당 에이전트가 최종 요약을 모읍니다.",sequential_handoff:"에이전트는 선택한 순서대로 실행됩니다. 작업 문구가 각 단계의 범위를 정의합니다.",adversarial_debate:"결정 토론에서는 단계 선택이 선택사항입니다. 비워두면 시스템이 선택된 에이전트를 순서대로 제안, 비판, 응답에 배정합니다."},soloAgent:"{{agent}}만 실행",soloAgentShort:"단독",cliSettings:"CLI 설정",workspaceTarget:"대상 작업 영역",workspaceTargets:{selectedProject:"선택한 프로젝트",pixcodeApp:"Pixcode 시스템",custom:"사용자 지정 경로"},customWorkspacePlaceholder:"/path/to/project",workspaceTargetHint:"에이전트 실행 위치: {{path}}",autoDetect:"자동 감지",needWorkspacePath:"사용자 지정 작업 영역 경로를 입력하세요."},Coe={buttons:poe,tabs:moe,status:hoe,messages:foe,navigation:goe,common:boe,time:xoe,fileOperations:yoe,mainContent:voe,fileTree:woe,projectWizard:koe,notifications:Soe,versionUpdate:Eoe,orchestration:Noe},Aoe="설정",Toe={account:"계정",permissions:"권한",mcpServers:"MCP 서버",appearance:"외관"},joe={title:"계정",language:"언어",languageLabel:"표시 언어",languageDescription:"인터페이스에 사용할 언어를 선택하세요",username:"사용자명",email:"이메일",profile:"프로필",changePassword:"비밀번호 변경"},_oe={title:"MCP 서버",addServer:"서버 추가",editServer:"서버 편집",deleteServer:"서버 삭제",serverName:"서버 이름",serverType:"서버 유형",config:"설정",testConnection:"연결 테스트",status:"상태",connected:"연결됨",disconnected:"연결 끊김",scope:{label:"범위",user:"사용자",project:"프로젝트"}},Ioe={title:"외관",theme:"테마",codeEditor:"코드 에디터",editorTheme:"에디터 테마",wordWrap:"자동 줄바꿈",showMinimap:"미니맵 표시",lineNumbers:"줄 번호",fontSize:"글꼴 크기"},Roe={saveChanges:"변경사항 저장",resetToDefaults:"기본값으로 초기화",cancelChanges:"변경 취소"},Loe={title:"빠른 설정",sections:{appearance:"외관",toolDisplay:"도구 표시",viewOptions:"보기 옵션",inputSettings:"입력 설정",changeAwareness:"제어 센터"},darkMode:"다크 모드",autoExpandTools:"도구 자동 펼치기",showRawParameters:"Raw 파라미터 표시",showThinking:"생각 과정 표시",autoScrollToBottom:"자동 스크롤",sendByCtrlEnter:"Ctrl+Enter로 전송",sendByCtrlEnterDescription:"활성화하면 Enter 대신 Ctrl+Enter로 메시지를 전송합니다. IME 사용자가 실수로 전송하는 것을 방지하는 데 유용합니다.",changeAwareness:"제어 센터",changedFiles:{title:"변경된 파일",description:"로컬 파일 변경을 추적하고 새 변경이 생기면 파일 패널을 엽니다.",noProject:"로컬 변경을 추적할 프로젝트를 선택하세요.",refresh:"변경된 파일 새로고침",empty:"로컬 변경이 없습니다",disabled:"로컬 변경을 보려면 제어 센터를 켜세요.",more:"+{{count}}개 파일 더",lastChecked:"{{value}} 확인",guideTitle:"오른쪽 패널 가이드",guideFiles:"변경된 파일은 파일 패널에서 초록색으로 빛납니다.",guidePanel:"새 변경은 분할 패널을 자동으로 엽니다.",status:{M:"M",A:"A",D:"D",U:"U"}},dragHandle:{dragging:"드래그 핸들",closePanel:"설정 패널 닫기",openPanel:"설정 패널 열기",draggingStatus:"드래그 중...",toggleAndMove:"클릭하여 토글, 드래그하여 이동"}},Doe={title:"터미널 단축키",sectionKeys:"키",sectionNavigation:"탐색",escape:"Escape",tab:"Tab",shiftTab:"Shift+Tab",arrowUp:"위쪽 화살표",arrowDown:"아래쪽 화살표",scrollDown:"아래로 스크롤",handle:{closePanel:"단축키 패널 닫기",openPanel:"단축키 패널 열기"}},Ooe={label:"설정",agents:"에이전트",appearance:"외관",git:"Git",apiTokens:"API & 토큰",tasks:"작업",notifications:"알림",plugins:"플러그인",mobile:"모바일에서 사용",telegram:"Telegram",about:"정보"},Moe={title:"알림",description:"수신할 알림 이벤트를 설정합니다.",webPush:{title:"웹 푸시 알림",enable:"푸시 알림 활성화",disable:"푸시 알림 비활성화",enabled:"푸시 알림이 활성화되었습니다",loading:"업데이트 중...",unsupported:"이 브라우저에서는 푸시 알림이 지원되지 않습니다.",denied:"푸시 알림이 차단되었습니다. 브라우저 설정에서 허용해 주세요."},events:{title:"이벤트 유형",actionRequired:"작업 필요",stop:"실행 중지",error:"실행 실패"}},Poe={darkMode:{label:"다크 모드",description:"라이트/다크 테마 전환"},projectSorting:{label:"프로젝트 정렬",description:"사이드바에서 프로젝트 정렬 방식",alphabetical:"알파벳순",recentActivity:"최근 활동순"},codeEditor:{title:"코드 에디터",theme:{label:"에디터 테마",description:"코드 에디터의 기본 테마"},wordWrap:{label:"자동 줄바꿈",description:"에디터에서 기본적으로 자동 줄바꿈 활성화"},showMinimap:{label:"미니맵 표시",description:"Diff 보기에서 쉬운 탐색을 위한 미니맵 표시"},lineNumbers:{label:"줄 번호 표시",description:"에디터에 줄 번호 표시"},fontSize:{label:"글꼴 크기",description:"에디터 글꼴 크기 (픽셀)"}}},Foe={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=value, 한 줄에 하나씩)",headers:"헤더 (KEY=value, 한 줄에 하나씩)",selectProject:"프로젝트 선택..."},placeholders:{serverName:"my-server"},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:"서버 업데이트"}},zoe={success:"설정이 저장되었습니다!",error:"설정 저장 실패",saving:"저장 중..."},Boe={save:"설정 저장",cancel:"취소"},$oe={title:"Git 설정",description:"커밋을 위한 Git 정보를 설정합니다. 이 설정은 git config --global로 전역 적용됩니다",name:{label:"Git 이름",help:"Git 커밋에 사용될 이름"},email:{label:"Git 이메일",help:"Git 커밋에 사용될 이메일"},actions:{save:"설정 저장",saving:"저장 중..."},status:{success:"저장 완료"}},Uoe={title:"API 키",description:"다른 애플리케이션에서 외부 API에 접근하기 위한 API 키를 생성합니다.",newKey:{alertTitle:"⚠️ API 키를 저장하세요",alertMessage:"이 키는 지금만 볼 수 있습니다. 안전하게 보관하세요.",iveSavedIt:"저장했습니다"},form:{placeholder:"API 키 이름 (예: Production Server)",createButton:"생성",cancelButton:"취소"},newButton:"새 API 키",empty:"생성된 API 키가 없습니다.",list:{created:"생성일:",lastUsed:"마지막 사용:"},confirmDelete:"이 API 키를 삭제하시겠습니까?",status:{active:"활성",inactive:"비활성"},github:{title:"GitHub 토큰",description:"외부 API를 통해 비공개 저장소를 clone하기 위한 GitHub Personal Access Token을 추가합니다.",descriptionAlt:"비공개 저장소를 clone하기 위한 GitHub Personal Access Token을 추가합니다. 저장하지 않고 API 요청에 직접 토큰을 전달할 수도 있습니다.",addButton:"토큰 추가",form:{namePlaceholder:"토큰 이름 (예: Personal Repos)",tokenPlaceholder:"GitHub Personal Access Token (ghp_...)",descriptionPlaceholder:"설명 (선택사항)",addButton:"토큰 추가",cancelButton:"취소",howToCreate:"GitHub Personal Access Token 생성 방법 →"},empty:"추가된 GitHub 토큰이 없습니다.",added:"추가일:",confirmDelete:"이 GitHub 토큰을 삭제하시겠습니까?"},apiDocsLink:"API 문서",documentation:{title:"외부 API 문서",description:"외부 API를 사용하여 애플리케이션에서 Claude/Cursor 세션을 트리거하는 방법을 알아보세요.",viewLink:"API 문서 보기 →"},loading:"로딩 중...",version:{updateAvailable:"업데이트 가능: v{{version}}"}},Goe={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 작업, 배너 및 사이드바 표시"}},Hoe={authStatus:{checking:"확인 중...",connected:"연결됨",notConnected:"연결되지 않음",disconnected:"연결 끊김",checkingAuth:"인증 상태 확인 중...",loggedInAs:"{{email}}(으)로 로그인됨",authenticatedUser:"인증된 사용자"},account:{claude:{description:"Anthropic Claude AI 어시스턴트"},cursor:{description:"Cursor AI 기반 코드 에디터"},codex:{description:"OpenAI Codex AI 어시스턴트"},gemini:{description:"Google Gemini AI 어시스턴트"},qwen:{description:"Alibaba Qwen Code CLI (Gemini CLI 포크)"}},connectionStatus:"연결 상태",login:{title:"로그인",reAuthenticate:"재인증",description:"AI 기능을 활성화하려면 {{agent}} 계정에 로그인하세요",reAuthDescription:"다른 계정으로 로그인하거나 자격 증명을 새로고침하세요",button:"로그인",reLoginButton:"재로그인"},error:"오류: {{error}}"},Voe={title:"권한 설정",skipPermissions:{label:"권한 확인 건너뛰기 (주의해서 사용)",claudeDescription:"--dangerously-skip-permissions 플래그와 동일",cursorDescription:"Cursor CLI의 -f 플래그와 동일",opencodeDescription:"OpenCode의 --dangerously-skip-permissions 플래그와 동일"},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:"- 재귀 삭제 차단"},opencodeAllowed:{title:"허용된 Bash 패턴",description:"OpenCode가 확인 없이 자동 승인하는 Bash 명령 패턴",placeholder:'예: "git *" 또는 "npm test"',quickAdd:"자주 쓰는 패턴 빠른 추가:",empty:"허용 패턴이 없습니다"},opencodeBlocked:{title:"차단된 Bash 패턴",description:"OpenCode가 항상 거부하는 Bash 명령 패턴",placeholder:'예: "rm -rf *" 또는 "sudo *"',empty:"차단 패턴이 없습니다"},opencodeExamples:{title:"패턴 예시:",gitAll:"- 모든 git 명령 허용",gitPush:"- git push만 차단",rmRf:"- 재귀 삭제 차단",npm:"- 모든 npm 명령 허용"},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:"추가"}},qoe={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의 기능을 확장하는 서버를 추가할 수 있습니다."}},Woe={title:"플러그인",description:"커스텀 플러그인으로 인터페이스를 확장하세요. git에서 설치하거나 ~/.pixcode/plugins/ 폴더에 직접 추가할 수 있습니다.",installPlaceholder:"https://github.com/user/my-plugin",installButton:"설치",installing:"설치 중…",securityWarning:"소스 코드를 검토했거나 신뢰할 수 있는 작성자의 플러그인만 설치하세요.",scanningPlugins:"플러그인 스캔 중…",noPluginsInstalled:"설치된 플러그인이 없습니다",pullLatest:"git에서 최신 버전 가져오기",noGitRemote:"git 리모트가 없음 — 업데이트 불가",uninstallPlugin:"플러그인 삭제",confirmUninstall:"다시 클릭하여 확인",confirmUninstallMessage:"{{name}} 플러그인을 삭제하시겠습니까? 이 작업은 되돌릴 수 없습니다.",cancel:"취소",remove:"삭제",updateFailed:"업데이트 실패",installFailed:"설치 실패",uninstallFailed:"삭제 실패",toggleFailed:"토글 실패",buildYourOwn:"나만의 플러그인 만들기",starter:"스타터",docs:"문서",starterPlugin:{name:"프로젝트 통계",badge:"스타터",description:"프로젝트의 파일 수, 코드 라인 수, 파일 유형별 분석 및 최근 활동을 확인합니다.",install:"설치"},morePlugins:"더 보기",enable:"활성화",disable:"비활성화",installAriaLabel:"플러그인 git 저장소 URL",tab:"탭",runningStatus:"실행 중"},Koe={title:Aoe,tabs:Toe,account:joe,mcp:_oe,appearance:Ioe,actions:Roe,quickSettings:Loe,terminalShortcuts:Doe,mainTabs:Ooe,notifications:Moe,appearanceSettings:Poe,mcpForm:Foe,saveStatus:zoe,footerActions:Boe,git:$oe,apiKeys:Uoe,tasks:Goe,agents:Hoe,permissions:Voe,mcpServers:qoe,pluginSettings:Woe},Yoe={title:"다시 오신 것을 환영합니다",description:"Pixcode 계정에 로그인하세요",username:"사용자명",password:"비밀번호",submit:"로그인",loading:"로그인 중...",errors:{invalidCredentials:"사용자명 또는 비밀번호가 잘못되었습니다",requiredFields:"모든 항목을 입력해주세요",networkError:"네트워크 오류. 다시 시도해주세요."},placeholders:{username:"사용자명을 입력하세요",password:"비밀번호를 입력하세요"}},Zoe={title:"계정 생성",username:"사용자명",password:"비밀번호",confirmPassword:"비밀번호 확인",submit:"계정 생성",loading:"계정 생성 중...",errors:{passwordMismatch:"비밀번호가 일치하지 않습니다",usernameTaken:"이미 사용 중인 사용자명입니다",weakPassword:"비밀번호가 너무 약합니다"}},Xoe={title:"로그아웃",confirm:"정말 로그아웃하시겠습니까?",button:"로그아웃"},Joe={login:Yoe,register:Zoe,logout:Xoe},Qoe={title:"프로젝트",newProject:"새 프로젝트",deleteProject:"프로젝트 제거",renameProject:"프로젝트 이름 변경",noProjects:"프로젝트가 없습니다",loadingProjects:"프로젝트 로딩 중...",searchPlaceholder:"프로젝트 검색...",projectNamePlaceholder:"프로젝트 이름",starred:"즐겨찾기",all:"전체",untitledSession:"제목 없는 세션",newSession:"새 세션",codexSession:"Codex 세션",fetchingProjects:"Claude 프로젝트와 세션을 가져오는 중",projects:"프로젝트",detectedFromHistory:"기록에서 감지됨",noMatchingProjects:"일치하는 프로젝트 없음",tryDifferentSearch:"검색어를 변경해보세요",runClaudeCli:"프로젝트 디렉토리에서 Claude CLI를 실행하여 시작하세요"},ele={title:"Pixcode",subtitle:"AI 코딩 어시스턴트 UI"},tle={title:"세션",newSession:"새 세션",deleteSession:"세션 삭제",renameSession:"세션 이름 변경",noSessions:"세션이 없습니다",loadingSessions:"세션 로딩 중...",unnamed:"이름 없음",loading:"로딩 중...",showMore:"더 많은 세션 보기"},rle={viewEnvironments:"환경 보기",hideSidebar:"사이드바 숨기기",createProject:"새 프로젝트 생성",refresh:"프로젝트 및 세션 새로고침 (Ctrl+R)",renameProject:"프로젝트 이름 변경 (F2)",deleteProject:"사이드바에서 프로젝트 제거 (Delete)",addToFavorites:"즐겨찾기에 추가",removeFromFavorites:"즐겨찾기에서 제거",editSessionName:"세션 이름 직접 편집",deleteSession:"이 세션 영구 삭제",save:"저장",cancel:"취소"},nle={chat:"채팅",files:"파일",git:"Git",terminal:"터미널",tasks:"작업"},ale={refresh:"새로고침",settings:"설정",collapseAll:"모두 접기",expandAll:"모두 펼치기",cancel:"취소",save:"저장",delete:"삭제",rename:"이름 변경",joinCommunity:"커뮤니티 참여",reportIssue:"문제 신고",starOnGithub:"GitHub에서 스타"},ile={openSource:"오픈 소스"},sle={active:"활성",inactive:"비활성",thinking:"생각 중...",error:"오류",aborted:"중단됨",unknown:"알 수 없음"},ole={justNow:"방금 전",oneMinuteAgo:"1분 전",minutesAgo:"{{count}}분 전",oneHourAgo:"1시간 전",hoursAgo:"{{count}}시간 전",oneDayAgo:"1일 전",daysAgo:"{{count}}일 전"},lle={deleteConfirm:"정말 삭제하시겠습니까?",renameSuccess:"이름이 변경되었습니다",deleteSuccess:"삭제되었습니다",errorOccurred:"오류가 발생했습니다",deleteSessionConfirm:"이 세션을 삭제하시겠습니까? 이 작업은 취소할 수 없습니다.",deleteProjectConfirm:"사이드바에서 이 프로젝트를 제거하시겠습니까? 프로젝트 파일, 메모리 및 세션 데이터는 삭제되지 않습니다.",enterProjectPath:"프로젝트 경로를 입력해주세요",deleteSessionFailed:"세션 삭제 실패. 다시 시도해주세요.",deleteSessionError:"세션 삭제 오류. 다시 시도해주세요.",renameSessionFailed:"세션 이름 변경 실패. 다시 시도해주세요.",renameSessionError:"세션 이름 변경 오류. 다시 시도해주세요.",deleteProjectFailed:"프로젝트 제거 실패. 다시 시도해주세요.",deleteProjectError:"프로젝트 제거 오류. 다시 시도해주세요.",createProjectFailed:"프로젝트 생성 실패. 다시 시도해주세요.",createProjectError:"프로젝트 생성 오류. 다시 시도해주세요."},cle={updateAvailable:"업데이트 가능"},dle={deleteProject:"프로젝트 제거",deleteSession:"세션 삭제",confirmDelete:"이 프로젝트를 어떻게 하시겠습니까:",sessionCount_one:"이 프로젝트에는 {{count}}개의 대화가 있습니다.",sessionCount_other:"이 프로젝트에는 {{count}}개의 대화가 있습니다.",removeFromSidebar:"사이드바에서만 제거",deleteAllData:"모든 데이터 영구 삭제",allConversationsDeleted:"프로젝트가 사이드바에서 제거됩니다. 파일, 메모리 및 세션 데이터는 보존됩니다.",cannotUndo:"나중에 프로젝트를 다시 추가할 수 있습니다."},ule={section:"오케스트레이션",fallbackTitle:"오케스트레이션 실행"},ple={projects:Qoe,app:ele,sessions:tle,tooltips:rle,navigation:nle,actions:ale,branding:ile,status:sle,time:ole,messages:lle,version:cle,deleteConfirmation:dle,orchestration:ule},mle={copy:"복사",copied:"복사됨",copyCode:"코드 복사"},hle={copy:"메시지 복사",copied:"메시지 복사됨",selectFormat:"복사 형식 선택",copyAsMarkdown:"마크다운으로 복사",copyAsText:"텍스트로 복사"},fle={user:"U",error:"오류",tool:"도구",claude:"Claude",cursor:"Cursor",codex:"Codex",gemini:"Gemini",qwen:"Qwen Code"},gle={settings:"도구 설정",error:"도구 오류",result:"도구 결과",viewParams:"입력 파라미터 보기",viewRawParams:"Raw 파라미터 보기",viewDiff:"편집 Diff 보기:",creatingFile:"새 파일 생성:",updatingTodo:"Todo 리스트 업데이트",read:"읽기",readFile:"파일 읽기",updateTodo:"Todo 리스트 업데이트",readTodo:"Todo 리스트 읽기",searchResults:"결과"},ble={found:"{{count}}개의 {{type}} 발견",file:"파일",files:"파일",pattern:"패턴:",in:"위치:"},xle={updated:"파일이 업데이트되었습니다",created:"파일이 생성되었습니다",written:"파일이 작성되었습니다",diff:"Diff",newFile:"새 파일",viewContent:"파일 내용 보기",viewFullOutput:"전체 출력 보기 ({{count}}자)",contentDisplayed:"파일 내용이 위의 Diff 보기에 표시됩니다"},yle={title:"대화형 프롬프트",waiting:"CLI에서 응답을 기다리는 중",instruction:"Claude가 실행 중인 터미널에서 옵션을 선택해주세요.",selectedOption:"✓ Claude가 옵션 {{number}}을(를) 선택했습니다",instructionDetail:"CLI에서 화살표 키 또는 숫자를 입력하여 이 옵션을 대화형으로 선택합니다."},vle={title:"생각 중...",emoji:"💭 생각 중..."},wle={response:"JSON 응답"},kle={grant:"{{tool}}에 대한 권한 부여",added:"권한이 추가되었습니다",addTo:"{{entry}}을(를) 허용된 도구에 추가합니다.",retry:"권한이 저장되었습니다. 도구를 사용하려면 요청을 재시도하세요.",error:"권한을 업데이트할 수 없습니다. 다시 시도해주세요.",openSettings:"설정 열기"},Sle={updated:"Todo 리스트가 업데이트되었습니다",current:"현재 Todo 리스트"},Ele={viewPlan:"📋 구현 계획 보기",title:"구현 계획"},Nle={resetAt:"Claude 사용량 한도에 도달했습니다. 한도는 **{{time}} {{timezone}}** - {{date}}에 초기화됩니다"},Cle={permissionMode:"권한 모드",modes:{default:"기본 모드",acceptEdits:"편집 허용",bypassPermissions:"권한 우회",plan:"Plan 모드"},descriptions:{default:"신뢰할 수 있는 명령어(ls, cat, grep, git status 등)만 자동 실행됩니다. 다른 명령어는 건너뜁니다. 워크스페이스에 쓰기 가능.",acceptEdits:"워크스페이스 내에서 모든 명령어가 자동 실행됩니다. 샌드박스 내 완전 자동 모드.",bypassPermissions:"제한 없는 전체 시스템 접근. 모든 명령어가 전체 디스크 및 네트워크 접근 권한으로 자동 실행됩니다. 주의해서 사용하세요.",plan:"계획 모드 - 명령어가 실행되지 않습니다"},technicalDetails:"기술 상세"},Ale={placeholder:"/를 입력하여 명령어, @를 입력하여 파일, 또는 {{provider}}에게 무엇이든 물어보세요...",placeholderDefault:"메시지를 입력하세요...",disabled:"입력 비활성화",attachFiles:"파일 첨부",attachImages:"이미지 첨부",send:"전송",stop:"중지",clickToChangeMode:"클릭하여 권한 모드 변경 (또는 입력창에서 Tab)",showAllCommands:"모든 명령어 보기",clearInput:"입력 지우기",scrollToBottom:"맨 아래로 스크롤"},Tle={selector:{title:"Thinking 모드",description:"확장된 thinking은 Claude에게 대안을 평가할 시간을 더 줍니다",active:"활성",tip:"높은 thinking 모드는 시간이 더 걸리지만 더 철저한 분석을 제공합니다"},modes:{none:{name:"Standard",description:"일반 Claude 응답",prefix:""},think:{name:"Think",description:"기본 확장 thinking",prefix:"think"},thinkHard:{name:"Think Hard",description:"더 철저한 평가",prefix:"think hard"},thinkHarder:{name:"Think Harder",description:"대안을 포함한 심층 분석",prefix:"think harder"},ultrathink:{name:"Ultrathink",description:"최대 thinking 예산",prefix:"ultrathink"}},buttonTitle:"Thinking 모드: {{mode}}"},jle={title:"AI 어시스턴트 선택",description:"새 대화를 시작할 프로바이더를 선택하세요",selectModel:"모델 선택",providerInfo:{anthropic:"Anthropic 제공",openai:"OpenAI 제공",cursorEditor:"AI 코드 에디터",google:"Google 제공"},readyPrompt:{claude:"{{model}} 모델로 Claude를 사용할 준비가 되었습니다. 아래에 메시지를 입력하세요.",cursor:"{{model}} 모델로 Cursor를 사용할 준비가 되었습니다. 아래에 메시지를 입력하세요.",codex:"{{model}} 모델로 Codex를 사용할 준비가 되었습니다. 아래에 메시지를 입력하세요.",gemini:"{{model}} 모델로 Gemini를 사용할 준비가 되었습니다. 아래에 메시지를 입력하세요.",default:"시작하려면 위에서 제공자를 선택하세요"}},_le={continue:{title:"대화 계속하기",description:"코드에 대해 질문하거나, 변경을 요청하거나, 개발 작업에 도움을 받으세요"},loading:{olderMessages:"이전 메시지 로딩 중...",sessionMessages:"세션 메시지 로딩 중..."},messages:{showingOf:"{{total}}개 중 {{shown}}개 표시",scrollToLoad:"위로 스크롤하여 더 로드",showingLast:"마지막 {{count}}개 메시지 표시 (총 {{total}}개)",loadEarlier:"이전 메시지 로드",loadAll:"모든 메시지 로드",loadingAll:"모든 메시지 로딩 중...",allLoaded:"모든 메시지 로드 완료",perfWarning:'모든 메시지가 로드됨 - 스크롤이 느려질 수 있습니다. "맨 아래로 스크롤"을 클릭하면 성능이 복구됩니다.'}},Ile={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:"명령어"},Rle={actions:{thinking:"Thinking",processing:"Processing",analyzing:"Analyzing",working:"Working",computing:"Computing",reasoning:"Reasoning"},state:{live:"Live",paused:"Paused"},elapsed:{seconds:"{{count}}s",minutesSeconds:"{{minutes}}m {{seconds}}s",label:"{{time}} elapsed",startingNow:"Starting now"},controls:{stopGeneration:"Stop Generation",pressEscToStop:"Press Esc anytime to stop"},providers:{assistant:"Assistant"}},Lle={startChatWithProvider:"{{provider}}와 채팅을 시작하려면 프로젝트를 선택하세요"},Dle={nextTaskPrompt:"다음 작업 시작"},Ole={codeBlock:mle,copyMessage:hle,messageTypes:fle,tools:gle,search:ble,fileOperations:xle,interactive:yle,thinking:vle,json:wle,permissions:kle,todo:Sle,plan:Ele,usageLimit:Nle,codex:Cle,input:Ale,thinkingMode:Tle,providerSelection:jle,session:_le,shell:Ile,claudeStatus:Rle,projectSelection:Lle,tasks:Dle},Mle={changes:"변경사항",previousChange:"이전 변경",nextChange:"다음 변경",hideDiff:"Diff 하이라이트 숨기기",showDiff:"Diff 하이라이트 표시",settings:"에디터 설정",collapse:"에디터 접기",expand:"에디터 전체 너비로 펼치기"},Ple="{{fileName}} 로딩 중...",Fle={showingChanges:"변경사항 표시"},zle={download:"파일 다운로드",save:"저장",saving:"저장 중...",saved:"저장됨!",exitFullscreen:"전체화면 종료",fullscreen:"전체화면",close:"닫기"},Ble={lines:"줄:",characters:"문자:",shortcuts:"Ctrl+S로 저장 • Esc로 닫기"},$le={title:"바이너리 파일",message:'파일 "{{fileName}}"은(는) 바이너리 파일이므로 텍스트 편집기에서 표시할 수 없습니다.'},Ule={toolbar:Mle,loading:Ple,header:Fle,actions:zle,footer:Ble,binaryFile:$le},Gle={save:"保存",cancel:"取消",delete:"删除",create:"创建",edit:"编辑",close:"关闭",confirm:"确认",submit:"提交",retry:"重试",refresh:"刷新",search:"搜索",clear:"清除",copy:"复制",download:"下载",upload:"上传",browse:"浏览"},Hle={chat:"聊天",shell:"终端",files:"文件",git:"源代码管理",changes:"更改",liveView:"实时预览",tasks:"任务",orchestration:"编排"},Vle={loading:"加载中...",success:"成功",error:"错误",failed:"失败",pending:"待处理",completed:"已完成",inProgress:"进行中"},qle={savedSuccessfully:"保存成功",deletedSuccessfully:"删除成功",updatedSuccessfully:"更新成功",operationFailed:"操作失败",networkError:"网络错误,请检查您的连接。",unauthorized:"未授权,请登录。",notFound:"未找到",invalidInput:"输入无效",requiredField:"此字段为必填项",unknownError:"发生未知错误"},Wle={settings:"设置",home:"首页",back:"返回",next:"下一步",previous:"上一步",logout:"退出登录"},Kle={language:"语言",theme:"主题",darkMode:"深色模式",lightMode:"浅色模式",name:"名称",description:"描述",enabled:"已启用",disabled:"已禁用",optional:"可选",version:"版本",select:"选择",selectAll:"全选",deselectAll:"取消全选"},Yle={justNow:"刚刚",minutesAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",daysAgo:"{{count}} 天前",yesterday:"昨天"},Zle={newFile:"新建文件",newFolder:"新建文件夹",rename:"重命名",move:"移动",copyPath:"复制路径",openInEditor:"在编辑器中打开"},Xle={loading:"正在加载 Pixcode",settingUpWorkspace:"正在设置您的工作空间...",chooseProject:"选择您的项目",selectProjectDescription:"从侧边栏选择一个项目以开始使用 Claude 进行编程。每个项目包含您的聊天会话和文件历史。",tip:"提示",createProjectMobile:"点击上方的菜单按钮以访问项目",createProjectDesktop:"点击侧边栏中的文件夹图标以创建新项目",newSession:"新会话",untitledSession:"未命名会话",projectFiles:"项目文件",landing:{title:"启动 Pixcode 工作区",description:"选择一个项目、开始新聊天,或用一个目标启动编排。编排会管理你选择的 CLI Agent,显示每一步,并直接展示错误。",startOrchestration:"启动编排",startOrchestrationDescription:"自动创建项目,并打开带有 Agent 控制和运行历史的编排界面。",startChat:"开始新聊天",startChatDescription:"自动创建文件夹,并用单个 Agent 打开普通聊天界面。",taskSystem:"任务系统",taskSystemDescription:"在项目内使用 TaskMaster 标签页跟踪工作项、状态和计划任务。",sidebarHint:"从侧边栏选择现有项目时,聊天历史、文件、git 状态、任务和编排会保留在同一个主界面中。"}},Jle={loading:"正在加载文件...",files:"文件",simpleView:"简单视图",compactView:"紧凑视图",detailedView:"详细视图",searchPlaceholder:"搜索文件和文件夹...",clearSearch:"清除搜索",name:"名称",size:"大小",modified:"修改时间",permissions:"权限",noFilesFound:"未找到文件",checkProjectPath:"检查项目路径是否可访问",noMatchesFound:"未找到匹配项",tryDifferentSearch:"尝试不同的搜索词或清除搜索",justNow:"刚刚",minAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",daysAgo:"{{count}} 天前",newFile:"新建文件 (Cmd+N)",newFolder:"新建文件夹 (Cmd+Shift+N)",refresh:"刷新",collapseAll:"全部折叠",context:{rename:"重命名",delete:"删除",copyPath:"复制路径",download:"下载",newFile:"新建文件",newFolder:"新建文件夹",refresh:"刷新",menuLabel:"文件上下文菜单",loading:"加载中..."}},Qle={title:"创建新项目",steps:{type:"类型",configure:"配置",confirm:"确认"},step1:{question:"您已经有工作区,还是想创建一个新的工作区?",existing:{title:"现有工作区",description:"我的服务器上已经有工作区,只需要将其添加到项目列表中"},new:{title:"新建工作区",description:"创建一个新工作区,可选择从 GitHub 仓库克隆"},githubClone:{title:"从 GitHub 克隆",description:"选择目标文件夹并将仓库克隆到其中"},subfolder:{title:"创建子文件夹",description:"选择父文件夹并在其中创建新的子文件夹"}},step2:{existingPath:"工作区路径",newPath:"工作区路径",subfolderParentPath:"父文件夹",subfolderParentHelp:"将创建新子文件夹的父文件夹路径",subfolderName:"子文件夹名称",subfolderNameHelp:"将以此名称在父文件夹内创建新文件夹",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:"新建工作区",subfolderWorkspace:"新子文件夹",path:"路径:",parentPath:"父路径:",subfolderName:"子文件夹名称:",cloneFrom:"克隆自:",authentication:"身份验证:",usingStoredToken:"使用已保存的令牌:",usingProvidedToken:"使用提供的令牌",noAuthentication:"无身份验证",sshKey:"SSH 密钥",existingInfo:"工作区将被添加到您的项目列表中,并可用于 Claude/Cursor 会话。",newWithClone:"仓库将从此文件夹克隆。",newEmpty:"工作区将被添加到您的项目列表中,并可用于 Claude/Cursor 会话。",subfolderInfo:"将在父文件夹内创建新子文件夹并添加到您的项目列表。",cloningRepository:"正在克隆仓库..."},buttons:{cancel:"取消",back:"返回",next:"下一步",createProject:"创建项目",creating:"创建中...",cloning:"正在克隆..."},errors:{selectType:"请选择您已有现有工作区还是想创建新工作区",providePath:"请提供工作区路径",provideSubfolderName:"请为子文件夹提供一个名称",subfolderNameInvalid:"子文件夹名称不能包含路径分隔符或为 . / ..",failedToCreate:"创建工作区失败",failedToCreateFolder:"创建文件夹失败"}},ece={genericTool:"工具",codes:{generic:{info:{title:"通知"}},permission:{required:{title:"需要处理",body:"{{toolName}} 正在等待你的决策。"}},run:{stopped:{title:"运行已停止",body:"原因:{{reason}}"},failed:{title:"运行失败"}},agent:{notification:{title:"Agent 通知"}}}},tce={title:"有可用更新",newVersionReady:"新版本已准备就绪",currentVersion:"当前版本",latestVersion:"最新版本",whatsNew:"新内容:",viewFullRelease:"查看完整发布",updateProgress:"更新进度:",manualUpgrade:"手动升级:",npmUpgradeCommand:"npm install -g @pixelbyte-software/pixcode@latest",manualUpgradeHint:"或点击'立即更新'以自动运行更新。",updateCompleted:"更新成功完成!",restartServer:"请重启服务器以应用更改。",updateFailed:"更新失败",buttons:{close:"关闭",later:"稍后",copyCommand:"复制命令",updateNow:"立即更新",updating:"更新中..."},ariaLabels:{closeModal:"关闭版本升级模态框",showSidebar:"显示侧边栏",settings:"设置",updateAvailable:"有可用更新",closeSidebar:"关闭侧边栏"}},rce={title:"编排",subtitle:"在 {{project}} 中输入一个目标;选择 CLI 工作单元,需要时复制同一种 CLI,并直接分配任务或交给协调器拆分。",refresh:"刷新",goal:"目标",goalPlaceholder:"示例:修复认证界面以适配单端口部署,捕获错误,并用 lint 和 typecheck 验证。",mode:"运行模式",systemPlan:"系统计划",noMode:"未选择模式",loadingPlan:"正在加载 Agent 计划。",start:"启动团队",starting:"正在启动",needAgent:"至少启用一个 CLI 工作单元。",startFailed:"无法启动 workflow。",cliControl:"CLI 团队",enabledCount:"已启用 {{count}} 个",enabled:"启用",disabled:"禁用",history:"历史",emptyHistory:"还没有运行记录。输入目标并启动 Agent。",steps:"{{done}}/{{total}} 步",notSelected:"未选择运行",notSelectedDescription:"选择以前的运行或启动新目标。Agent 消息、错误、变更摘要和预览输出会显示在这里。",loadFailed:"无法加载运行详情。",loadingRun:"正在加载运行...",agentSteps:"Agent 步骤",noStepOutput:"没有步骤输出。",agentMessages:"Agent 消息",noAgentMessages:"此 Agent 尚未生成消息。如果运行失败,真实 CLI 错误会显示在上方。",outputs:"输出",noOutputs:"还没有变更摘要、预览或命令输出。",open:"打开",artifact:{fileDiff:"变更摘要",previewUrl:"预览",commandOutput:"命令输出"},role:{user:"用户",agent:"Agent"},status:{queued:"排队中",running:"运行中",completed:"已完成",failed:"错误",canceled:"已取消",skipped:"已跳过"},nodes:{codex_review:"Codex 审查",gemini_review:"Gemini 审查",claude_review:"Claude 审查",claude_code_review:"Claude 审查",cursor_review:"Cursor 审查",aggregate:"汇总",architect:"规划",implement:"实现",review:"审查",proposal:"方案",critique:"批评",response:"回应",judge:"决策",coordinator:"协调器",final_report:"最终报告"},workflows:{multi_model_review:{name:"多模型审查",description:"启用的 CLI Agent 会分别审查同一个目标,然后由一个启用的 Agent 汇总结果。"},sequential_handoff:{name:"顺序交接",description:"Agent 按顺序规划、实现并审查。禁用的 CLI 步骤会被跳过。"},adversarial_debate:{name:"决策辩论",description:"Agent 提出方案、批评、回应,并生成最终建议。"},agent_team:{name:"智能体团队",description:"协调器读取目标和已启用的 CLI 实例,分配工作,然后汇总结果。"}},adapters:{"claude-code":{label:"Claude Code",role:"CLI 工作单元"},cursor:{label:"Cursor",role:"CLI 工作单元"},codex:{label:"Codex",role:"CLI 工作单元"},gemini:{label:"Gemini",role:"CLI 工作单元"},qwen:{label:"Qwen Code",role:"CLI 工作单元"},opencode:{label:"OpenCode",role:"CLI 工作单元"}},activeCount:"{{active}}/{{total}} 已启用",teamHint:"每一行都是一个 CLI 工作单元。你可以创建多个 Claude、Codex、Cursor、Gemini、Qwen 或 OpenCode,并为每个单元写不同任务。",parallelLimit:"并行上限",addAgent:"添加 {{agent}}",duplicateAgent:"复制 {{agent}}",removeAgent:"移除 {{agent}}",assignment:"任务分配",assignmentPlaceholder:"可选:明确写下这个工作单元要处理什么。留空则由协调器按目标分配。",agentInstance:"{{name}} #{{number}}",taskTitle:"任务",taskTitlePlaceholder:"实现功能",taskDescription:"描述",taskDescriptionPlaceholder:"范围、约束、预期输出",addTask:"添加",runTask:"运行",cancelTask:"取消",dispatchTask:"分配任务",syncTaskMaster:"同步 TaskMaster",taskMasterSource:"TaskMaster",adapter:"适配器",isolation:"隔离",dispatch:"分配",auto:"自动",waitingForStream:"等待流输出...",workflow:"工作流",input:"输入",taskStates:{todo:"待办",in_progress:"进行中",in_review:"审核中",done:"完成",failed:"失败",canceled:"已取消"},isolationKind:{worktree:"Worktree",host:"Host",docker:"Docker"},stop:"停止团队",stopping:"正在停止",cancelFailed:"无法停止工作流。",needRoles:"此模式需要至少为以下角色分配一个已启用的 Agent:{{roles}}。",quickPrompts:{label:"快速提示:",liveTrading:{label:"8024 实时交易界面",prompt:"你好,请创建一个小项目,然后在 8024 端口运行。我需要一个连接 Binance FAPI 的 TradingView 风格设计,包含 TradingView 图表以及左侧星标/收藏系统。请合理拆分工作并自动管理流程。"}},teamHistory:"团队历史",changeSummary:"变更摘要",noChangeSummary:"最终摘要尚未生成。Agent 完成后,这里会显示可读的 Markdown 摘要。",prepareTeamFromReport:"用此报告准备 Agent 团队",prepareTeamTitle:"准备 Agent 团队提示词",prepareTeamDescription:"讨论输出已转换为新的 Agent Team 提示词。你可以编辑它,然后切换到 Agent Team 模式。",usePreparedPrompt:"使用提示词",reportToPromptPrefix:"根据以下讨论/决策报告准备并执行一个 Agent 团队。将需求拆分为任务,为可用 CLI Agent 提出合理分配,并在用户确认后启动。",generatedSummaryTitle:"自动运行摘要",summaryStatus:"整体状态",summarySteps:"已完成步骤",summaryFailures:"失败步骤",summaryCanceled:"已取消步骤",summaryDiffs:"Diff/变更输出",summaryPreviews:"预览输出",summaryErrorPrefix:"错误",assignedWork:"已分配工作",autoAssigned:"自动 / 由协调器决定",stages:{coordinator:"协调器",handoff:"交接",backend:"后端",frontend:"前端",implementation:"实现",review:"审查",repair:"修复",proposal:"提案",critique:"批评",response:"回应",decision:"决策",report:"报告",final_report:"最终报告"},agentRole:"阶段",agentRoles:{auto:"自动",backend:"后端",frontend:"前端",review:"测试 / 审查",implementation:"实现",proposal:"提案",critique:"批评",response:"回应",decision:"决策 / 报告",report:"报告",custom:"自定义"},customRolePlaceholder:"例如:安全、移动端 UX、数据库架构",roleHints:{default:"留空时,协调器会根据目标为此 Agent 分配任务。",agent_team:"可选择后端、前端或审查阶段,也可保持自动。",multi_model_review:"已启用的 Agent 会进行审查;如果选择报告角色,该 Agent 会汇总最终摘要。",sequential_handoff:"Agent 按你选择的顺序运行;任务文本定义每一步的范围。",adversarial_debate:"决策讨论中阶段选择是可选的;留空时系统会按顺序将所选 Agent 分配为提案、批评和回应。"},soloAgent:"仅使用 {{agent}} 运行",soloAgentShort:"单独",cliSettings:"CLI 设置",workspaceTarget:"目标工作区",workspaceTargets:{selectedProject:"已选项目",pixcodeApp:"Pixcode 系统",custom:"自定义路径"},customWorkspacePlaceholder:"/path/to/project",workspaceTargetHint:"智能体将在此目录运行:{{path}}",autoDetect:"自动检测",needWorkspacePath:"请输入自定义工作区路径。"},nce={buttons:Gle,tabs:Hle,status:Vle,messages:qle,navigation:Wle,common:Kle,time:Yle,fileOperations:Zle,mainContent:Xle,fileTree:Jle,projectWizard:Qle,notifications:ece,versionUpdate:tce,orchestration:rce},ace="设置",ice={account:"账户",permissions:"权限",mcpServers:"MCP 服务器",appearance:"外观"},sce={title:"账户",language:"语言",languageLabel:"显示语言",languageDescription:"选择您偏好的界面语言",username:"用户名",email:"邮箱",profile:"个人资料",changePassword:"修改密码"},oce={title:"MCP 服务器",addServer:"添加服务器",editServer:"编辑服务器",deleteServer:"删除服务器",serverName:"服务器名称",serverType:"服务器类型",config:"配置",testConnection:"测试连接",status:"状态",connected:"已连接",disconnected:"未连接",scope:{label:"范围",user:"用户",project:"项目"}},lce={title:"外观",theme:"主题",codeEditor:"代码编辑器",editorTheme:"编辑器主题",wordWrap:"自动换行",showMinimap:"显示缩略图",lineNumbers:"行号",fontSize:"字体大小"},cce={saveChanges:"保存更改",resetToDefaults:"重置为默认值",cancelChanges:"取消更改"},dce={title:"快速设置",sections:{appearance:"外观",toolDisplay:"工具显示",viewOptions:"视图选项",inputSettings:"输入设置",changeAwareness:"掌控中心"},darkMode:"深色模式",autoExpandTools:"自动展开工具",showRawParameters:"显示原始参数",showThinking:"显示思考过程",autoScrollToBottom:"自动滚动到底部",sendByCtrlEnter:"使用 Ctrl+Enter 发送",sendByCtrlEnterDescription:"启用后,按 Ctrl+Enter 发送消息,而不是仅按 Enter。这对于使用输入法的用户可以避免意外发送。",changeAwareness:"掌控中心",changedFiles:{title:"已更改文件",description:"跟踪本地文件更改,并在出现新更改时打开文件面板。",noProject:"选择一个项目以跟踪本地更改。",refresh:"刷新已更改文件",empty:"未检测到本地更改",disabled:"启用掌控中心以监控本地更改。",more:"还有 {{count}} 个文件",lastChecked:"检查于 {{value}}",guideTitle:"右侧面板指南",guideFiles:"已更改文件会在文件面板中以绿色高亮。",guidePanel:"新更改会自动打开分屏面板。",status:{M:"M",A:"A",D:"D",U:"U"}},dragHandle:{dragging:"正在拖拽手柄",closePanel:"关闭设置面板",openPanel:"打开设置面板",draggingStatus:"正在拖拽...",toggleAndMove:"点击切换,拖拽移动"}},uce={title:"终端快捷键",sectionKeys:"按键",sectionNavigation:"导航",escape:"Escape",tab:"Tab",shiftTab:"Shift+Tab",arrowUp:"上箭头",arrowDown:"下箭头",scrollDown:"滚动到底部",handle:{closePanel:"关闭快捷键面板",openPanel:"打开快捷键面板"}},pce={label:"设置",agents:"智能体",appearance:"外观",git:"Git",apiTokens:"API 和令牌",tasks:"任务",notifications:"通知",plugins:"插件",mobile:"移动端使用",telegram:"Telegram",about:"关于"},mce={title:"通知",description:"控制你希望接收的通知事件。",webPush:{title:"Web 推送通知",enable:"启用推送通知",disable:"关闭推送通知",enabled:"推送通知已启用",loading:"更新中...",unsupported:"此浏览器不支持推送通知。",denied:"推送通知已被阻止,请在浏览器设置中允许。"},events:{title:"事件类型",actionRequired:"需要处理",stop:"运行已停止",error:"运行失败"}},hce={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)"}}},fce={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:"更新服务器"}},gce={success:"设置保存成功!",error:"保存设置失败",saving:"保存中..."},bce={save:"保存设置",cancel:"取消"},xce={title:"Git 配置",description:"配置您的 git 提交身份。这些设置将通过 git config --global 全局应用",name:{label:"Git 名称",help:"您的 git 提交名称"},email:{label:"Git 邮箱",help:"您的 git 提交邮箱"},actions:{save:"保存配置",saving:"保存中..."},status:{success:"保存成功"}},yce={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}}"}},vce={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 任务、横幅和侧边栏指示器"}},wce={authStatus:{checking:"检查中...",connected:"已连接",notConnected:"未连接",disconnected:"已断开",checkingAuth:"正在检查认证状态...",loggedInAs:"登录为 {{email}}",authenticatedUser:"已认证用户"},account:{claude:{description:"Anthropic Claude AI 助手"},cursor:{description:"Cursor AI 驱动的代码编辑器"},codex:{description:"OpenAI Codex AI 助手"},gemini:{description:"Google Gemini AI 助手"},qwen:{description:"阿里巴巴 Qwen Code CLI (Gemini CLI 分支)"}},connectionStatus:"连接状态",login:{title:"登录",reAuthenticate:"重新认证",description:"登录您的 {{agent}} 账户以启用 AI 功能",reAuthDescription:"使用其他账户登录或刷新凭据",button:"登录",reLoginButton:"重新登录"},error:"错误:{{error}}"},kce={title:"权限设置",skipPermissions:{label:"跳过权限提示(请谨慎使用)",claudeDescription:"等同于 --dangerously-skip-permissions 标志",cursorDescription:"等同于 Cursor CLI 中的 -f 标志",opencodeDescription:"等同于 OpenCode 的 --dangerously-skip-permissions 标志"},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:"- 阻止递归删除"},opencodeAllowed:{title:"允许的 Bash 模式",description:"OpenCode 自动批准、无需提示的 Bash 命令模式",placeholder:'如:"git *" 或 "npm test"',quickAdd:"快速添加常用模式:",empty:"尚未配置允许的模式"},opencodeBlocked:{title:"屏蔽的 Bash 模式",description:"OpenCode 始终拒绝的 Bash 命令模式",placeholder:'如:"rm -rf *" 或 "sudo *"',empty:"尚未配置屏蔽的模式"},opencodeExamples:{title:"模式示例:",gitAll:"- 允许所有 git 命令",gitPush:"- 单独屏蔽 git push",rmRf:"- 屏蔽递归删除",npm:"- 允许所有 npm 命令"},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:"添加"}},Sce={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 的功能。"}},Ece={title:"插件",description:"通过自定义插件扩展界面。从 git 安装或直接将文件夹放入 ~/.pixcode/plugins/",installPlaceholder:"https://github.com/user/my-plugin",installButton:"安装",installing:"安装中…",securityWarning:"仅安装您已审查过源代码或信任作者的插件。",scanningPlugins:"正在扫描插件…",noPluginsInstalled:"未安装插件",pullLatest:"从 git 拉取最新内容",noGitRemote:"无 git 远程仓库 — 无法更新",uninstallPlugin:"卸载插件",confirmUninstall:"再次点击确认",confirmUninstallMessage:"移除 {{name}}?此操作无法撤销。",cancel:"取消",remove:"移除",updateFailed:"更新失败",installFailed:"安装失败",uninstallFailed:"卸载失败",toggleFailed:"切换失败",buildYourOwn:"构建您自己的插件",starter:"入门模板",docs:"文档",starterPlugin:{name:"项目统计",badge:"入门",description:"查看项目的文件数、代码行数、文件类型分布以及最近活动。",install:"安装"},morePlugins:"更多",enable:"启用",disable:"禁用",installAriaLabel:"插件 git 仓库 URL",tab:"标签",runningStatus:"运行中"},Nce={title:ace,tabs:ice,account:sce,mcp:oce,appearance:lce,actions:cce,quickSettings:dce,terminalShortcuts:uce,mainTabs:pce,notifications:mce,appearanceSettings:hce,mcpForm:fce,saveStatus:gce,footerActions:bce,git:xce,apiKeys:yce,tasks:vce,agents:wce,permissions:kce,mcpServers:Sce,pluginSettings:Ece},Cce={title:"欢迎回来",description:"登录您的 Pixcode 账户",username:"用户名",password:"密码",submit:"登录",loading:"登录中...",errors:{invalidCredentials:"用户名或密码无效",requiredFields:"请填写所有字段",networkError:"网络错误,请重试。"},placeholders:{username:"输入您的用户名",password:"输入您的密码"}},Ace={title:"创建账户",username:"用户名",password:"密码",confirmPassword:"确认密码",submit:"创建账户",loading:"创建账户中...",errors:{passwordMismatch:"密码不匹配",usernameTaken:"用户名已被占用",weakPassword:"密码强度太弱"}},Tce={title:"退出登录",confirm:"确定要退出登录吗?",button:"退出登录"},jce={login:Cce,register:Ace,logout:Tce},_ce={title:"项目",newProject:"新建项目",deleteProject:"移除项目",renameProject:"重命名项目",noProjects:"未找到项目",loadingProjects:"加载项目中...",searchPlaceholder:"搜索项目...",projectNamePlaceholder:"项目名称",starred:"星标",all:"全部",untitledSession:"未命名会话",newSession:"新会话",codexSession:"Codex 会话",fetchingProjects:"正在获取您的 Claude 项目和会话",projects:"项目",detectedFromHistory:"从历史记录检测",noMatchingProjects:"未找到匹配的项目",tryDifferentSearch:"尝试调整您的搜索词",runClaudeCli:"在项目目录中运行 Claude CLI 以开始使用"},Ice={title:"Pixcode",subtitle:"AI 编程助手"},Rce={title:"会话",newSession:"新建会话",deleteSession:"删除会话",renameSession:"重命名会话",noSessions:"暂无会话",loadingSessions:"加载会话中...",unnamed:"未命名",loading:"加载中...",showMore:"显示更多会话"},Lce={viewEnvironments:"查看环境",hideSidebar:"隐藏侧边栏",createProject:"创建新项目",refresh:"刷新项目和会话 (Ctrl+R)",renameProject:"重命名项目 (F2)",deleteProject:"从侧边栏移除项目 (Delete)",addToFavorites:"添加到收藏",removeFromFavorites:"从收藏移除",editSessionName:"手动编辑会话名称",deleteSession:"永久删除此会话",save:"保存",cancel:"取消",clearSearch:"清除搜索"},Dce={chat:"聊天",files:"文件",git:"Git",terminal:"终端",tasks:"任务"},Oce={refresh:"刷新",settings:"设置",collapseAll:"全部折叠",expandAll:"全部展开",cancel:"取消",save:"保存",delete:"删除",rename:"重命名",joinCommunity:"加入社区",reportIssue:"报告问题",starOnGithub:"在GitHub上加星"},Mce={openSource:"开源"},Pce={active:"活动",inactive:"非活动",thinking:"思考中...",error:"错误",aborted:"已中止",unknown:"未知"},Fce={justNow:"刚刚",oneMinuteAgo:"1 分钟前",minutesAgo:"{{count}} 分钟前",oneHourAgo:"1 小时前",hoursAgo:"{{count}} 小时前",oneDayAgo:"1 天前",daysAgo:"{{count}} 天前"},zce={deleteConfirm:"确定要删除吗?",renameSuccess:"重命名成功",deleteSuccess:"删除成功",errorOccurred:"发生错误",deleteSessionConfirm:"确定要删除此会话吗?此操作无法撤销。",deleteProjectConfirm:"从侧边栏移除此项目?您的项目文件、记忆和会话数据不会被删除。",enterProjectPath:"请输入项目路径",deleteSessionFailed:"删除会话失败,请重试。",deleteSessionError:"删除会话时出错,请重试。",renameSessionFailed:"重命名会话失败,请重试。",renameSessionError:"重命名会话时出错,请重试。",deleteProjectFailed:"移除项目失败,请重试。",deleteProjectError:"移除项目时出错,请重试。",createProjectFailed:"创建项目失败,请重试。",createProjectError:"创建项目时出错,请重试。"},Bce={updateAvailable:"有可用更新"},$ce={modeProjects:"项目",modeConversations:"对话",conversationsPlaceholder:"搜索对话内容...",searching:"搜索中...",noResults:"未找到结果",tryDifferentQuery:"尝试不同的搜索词",matches_one:"{{count}} 个匹配",matches_other:"{{count}} 个匹配",projectsScanned_one:"{{count}} 个项目已扫描",projectsScanned_other:"{{count}} 个项目已扫描"},Uce={deleteProject:"移除项目",deleteSession:"删除会话",confirmDelete:"您想如何处理",sessionCount_one:"此项目包含 {{count}} 个对话。",sessionCount_other:"此项目包含 {{count}} 个对话。",removeFromSidebar:"仅从侧边栏移除",deleteAllData:"永久删除所有数据",allConversationsDeleted:"项目将从侧边栏中移除。您的文件、记忆和会话数据将会保留。",cannotUndo:"您可以稍后重新添加此项目。"},Gce={section:"编排",fallbackTitle:"编排运行"},Hce={projects:_ce,app:Ice,sessions:Rce,tooltips:Lce,navigation:Dce,actions:Oce,branding:Mce,status:Pce,time:Fce,messages:zce,version:Bce,search:$ce,deleteConfirmation:Uce,orchestration:Gce},Vce={copy:"复制",copied:"已复制",copyCode:"复制代码"},qce={copy:"复制消息",copied:"消息已复制",selectFormat:"选择复制格式",copyAsMarkdown:"复制为 Markdown",copyAsText:"复制为纯文本"},Wce={user:"U",error:"错误",tool:"工具",claude:"Claude",cursor:"Cursor",codex:"Codex",gemini:"Gemini",qwen:"Qwen Code"},Kce={settings:"工具设置",error:"工具错误",result:"工具结果",viewParams:"查看输入参数",viewRawParams:"查看原始参数",viewDiff:"查看编辑差异",creatingFile:"创建新文件:",updatingTodo:"更新待办事项",read:"读取",readFile:"读取文件",updateTodo:"更新待办列表",readTodo:"读取待办列表",searchResults:"结果"},Yce={found:"找到 {{count}} 个{{type}}",file:"文件",files:"文件",pattern:"模式:",in:"在:"},Zce={updated:"文件更新成功",created:"文件创建成功",written:"文件写入成功",diff:"差异",newFile:"新文件",viewContent:"查看文件内容",viewFullOutput:"查看完整输出({{count}} 个字符)",contentDisplayed:"文件内容显示在上面的差异视图中"},Xce={title:"交互式提示",waiting:"等待您在 CLI 中响应",instruction:"请在 Claude 运行的终端中选择一个选项。",selectedOption:"✓ Claude 选择了选项 {{number}}",instructionDetail:"在 CLI 中,您可以使用方向键或输入数字来交互式地选择此选项。"},Jce={title:"思考中...",emoji:"💭 思考中..."},Qce={response:"JSON 响应"},ede={grant:"授予 {{tool}} 权限",added:"权限已添加",addTo:"将 {{entry}} 添加到允许的工具。",retry:"权限已保存。重试请求以使用该工具。",error:"无法更新权限。请重试。",openSettings:"打开设置"},tde={updated:"待办列表已成功更新",current:"当前待办列表"},rde={viewPlan:"📋 查看实施计划",title:"实施计划"},nde={resetAt:"Claude 使用限制已达到。您的限制将在 **{{time}} {{timezone}}** - {{date}} 重置"},ade={permissionMode:"权限模式",modes:{default:"默认模式",acceptEdits:"编辑模式",bypassPermissions:"无限制模式",plan:"计划模式"},descriptions:{default:"只有受信任的命令(ls、cat、grep、git status 等)自动运行。其他命令将被跳过。可以写入工作区。",acceptEdits:"工作区内的所有命令自动运行。完全自动模式,具有沙盒执行功能。",bypassPermissions:"完全的系统访问,无限制。所有命令自动运行,具有完整的磁盘和网络访问权限。请谨慎使用。",plan:"计划模式 - 不执行任何命令"},technicalDetails:"技术细节"},ide={placeholder:"输入 / 调用命令,@ 选择文件,或向 {{provider}} 提问...",placeholderDefault:"输入您的消息...",disabled:"输入已禁用",attachFiles:"附加文件",attachImages:"附加图片",send:"发送",stop:"停止",clickToChangeMode:"点击更改权限模式(或在输入框中按 Tab)",showAllCommands:"显示所有命令",clearInput:"清空输入",scrollToBottom:"滚动到底部"},sde={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}}"},ode={title:"选择您的 AI 助手",description:"选择一个供应商以开始新对话",selectModel:"选择模型",providerInfo:{anthropic:"由 Anthropic 提供",openai:"由 OpenAI 提供",cursorEditor:"AI 代码编辑器",google:"由 Google 提供"},readyPrompt:{claude:"准备好使用带有 {{model}} 的 Claude。请在下方开始输入您的消息。",cursor:"准备好使用带有 {{model}} 的 Cursor。请在下方开始输入您的消息。",codex:"准备好使用带有 {{model}} 的 Codex。请在下方开始输入您的消息。",gemini:"准备好使用带有 {{model}} 的 Gemini。请在下方开始输入您的消息。",default:"请在上方选择一个提供者以开始"}},lde={continue:{title:"继续您的对话",description:"询问有关代码的问题、请求更改或获取开发任务的帮助"},loading:{olderMessages:"正在加载更早的消息...",sessionMessages:"正在加载会话消息..."},messages:{showingOf:"显示 {{shown}} / {{total}} 条消息",scrollToLoad:"向上滚动以加载更多",showingLast:"显示最近 {{count}} 条消息(共 {{total}} 条)",loadEarlier:"加载更早的消息",loadAll:"加载全部消息",loadingAll:"正在加载全部消息...",allLoaded:"全部消息已加载",perfWarning:"已加载全部消息 - 滚动可能变慢。点击「滚动到底部」恢复性能。"}},cde={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:"命令"},dde={actions:{thinking:"Thinking",processing:"Processing",analyzing:"Analyzing",working:"Working",computing:"Computing",reasoning:"Reasoning"},state:{live:"Live",paused:"Paused"},elapsed:{seconds:"{{count}}s",minutesSeconds:"{{minutes}}m {{seconds}}s",label:"{{time}} elapsed",startingNow:"Starting now"},controls:{stopGeneration:"Stop Generation",pressEscToStop:"Press Esc anytime to stop"},providers:{assistant:"Assistant"}},ude={startChatWithProvider:"选择一个项目以开始与 {{provider}} 聊天"},pde={nextTaskPrompt:"开始下一个任务"},mde={codeBlock:Vce,copyMessage:qce,messageTypes:Wce,tools:Kce,search:Yce,fileOperations:Zce,interactive:Xce,thinking:Jce,json:Qce,permissions:ede,todo:tde,plan:rde,usageLimit:nde,codex:ade,input:ide,thinkingMode:sde,providerSelection:ode,session:lde,shell:cde,claudeStatus:dde,projectSelection:ude,tasks:pde},hde={changes:"个更改",previousChange:"上一个更改",nextChange:"下一个更改",hideDiff:"隐藏差异高亮",showDiff:"显示差异高亮",settings:"编辑器设置",collapse:"折叠编辑器",expand:"展开编辑器到全宽"},fde="正在加载 {{fileName}}...",gde={showingChanges:"显示更改"},bde={download:"下载文件",save:"保存",saving:"保存中...",saved:"已保存!",exitFullscreen:"退出全屏",fullscreen:"全屏",close:"关闭"},xde={lines:"行数:",characters:"字符数:",shortcuts:"按 Ctrl+S 保存 • Esc 关闭"},yde={title:"二进制文件",message:'文件 "{{fileName}}" 无法在文本编辑器中显示,因为它是二进制文件。'},vde={toolbar:hde,loading:fde,header:gde,actions:bde,footer:xde,binaryFile:yde},wde={save:"保存",cancel:"キャンセル",delete:"削除",create:"作成",edit:"編集",close:"閉じる",confirm:"確認",submit:"送信",retry:"再試行",refresh:"更新",search:"検索",clear:"クリア",copy:"コピー",download:"ダウンロード",upload:"アップロード",browse:"参照"},kde={chat:"チャット",shell:"シェル",files:"ファイル",git:"ソース管理",changes:"変更",liveView:"ライブビュー",tasks:"タスク",orchestration:"オーケストレーション"},Sde={loading:"読み込み中...",success:"成功",error:"エラー",failed:"失敗",pending:"保留中",completed:"完了",inProgress:"進行中"},Ede={savedSuccessfully:"保存しました",deletedSuccessfully:"削除しました",updatedSuccessfully:"更新しました",operationFailed:"操作に失敗しました",networkError:"ネットワークエラー。接続を確認してください。",unauthorized:"認証されていません。ログインしてください。",notFound:"見つかりません",invalidInput:"入力が無効です",requiredField:"この項目は必須です",unknownError:"不明なエラーが発生しました"},Nde={settings:"設定",home:"ホーム",back:"戻る",next:"次へ",previous:"前へ",logout:"ログアウト"},Cde={language:"言語",theme:"テーマ",darkMode:"ダークモード",lightMode:"ライトモード",name:"名前",description:"説明",enabled:"有効",disabled:"無効",optional:"任意",version:"バージョン",select:"選択",selectAll:"すべて選択",deselectAll:"すべて解除"},Ade={justNow:"たった今",minutesAgo:"{{count}}分前",hoursAgo:"{{count}}時間前",daysAgo:"{{count}}日前",yesterday:"昨日"},Tde={newFile:"新規ファイル",newFolder:"新規フォルダ",rename:"名前の変更",move:"移動",copyPath:"パスをコピー",openInEditor:"エディタで開く"},jde={loading:"Pixcode を読み込んでいます",settingUpWorkspace:"ワークスペースを準備しています...",chooseProject:"プロジェクトを選択",selectProjectDescription:"サイドバーからプロジェクトを選択して、Claudeとコーディングを始めましょう。各プロジェクトにはチャットセッションとファイル履歴が含まれています。",tip:"ヒント",createProjectMobile:"上部のメニューボタンからプロジェクトにアクセスできます",createProjectDesktop:"サイドバーのフォルダアイコンをクリックして新しいプロジェクトを作成できます",newSession:"新しいセッション",untitledSession:"無題のセッション",projectFiles:"プロジェクトファイル",landing:{title:"Pixcode ワークスペースを開始",description:"プロジェクトを選ぶか、新しいチャットを始めるか、1つの目標でオーケストレーションを開始できます。オーケストレーションは選択したCLIエージェントを管理し、各ステップとエラーを表示します。",startOrchestration:"オーケストレーションを開始",startOrchestrationDescription:"自動でプロジェクトを作成し、エージェント制御と実行履歴を持つオーケストレーション画面を開きます。",startChat:"新しいチャットを開始",startChatDescription:"フォルダを自動作成し、通常のチャット画面を1つのエージェントで開きます。",taskSystem:"タスクシステム",taskSystemDescription:"プロジェクト内のTaskMasterタブで作業項目、状態、計画作業を追跡します。",sidebarHint:"サイドバーから既存プロジェクトを選ぶと、チャット履歴、ファイル、git状態、タスク、オーケストレーションが同じメイン画面に残ります。"}},_de={loading:"ファイルを読み込んでいます...",files:"ファイル",simpleView:"シンプル表示",compactView:"コンパクト表示",detailedView:"詳細表示",searchPlaceholder:"ファイルやフォルダを検索...",clearSearch:"検索をクリア",name:"名前",size:"サイズ",modified:"更新日時",permissions:"権限",noFilesFound:"ファイルが見つかりません",checkProjectPath:"プロジェクトのパスがアクセス可能か確認してください",noMatchesFound:"一致するものが見つかりません",tryDifferentSearch:"別の検索語を試すか、検索をクリアしてください",justNow:"たった今",minAgo:"{{count}}分前",hoursAgo:"{{count}}時間前",daysAgo:"{{count}}日前",newFile:"新規ファイル (Cmd+N)",newFolder:"新規フォルダ (Cmd+Shift+N)",refresh:"更新",collapseAll:"すべて折りたたむ",context:{rename:"名前を変更",delete:"削除",copyPath:"パスをコピー",download:"ダウンロード",newFile:"新しいファイル",newFolder:"新しいフォルダ",refresh:"更新",menuLabel:"ファイルのコンテキストメニュー",loading:"読み込み中..."}},Ide={title:"新規プロジェクトを作成",steps:{type:"種類",configure:"設定",confirm:"確認"},step1:{question:"既存のワークスペースがありますか?それとも新しく作成しますか?",existing:{title:"既存のワークスペース",description:"サーバー上に既存のワークスペースがあり、プロジェクト一覧に追加したい"},new:{title:"新しいワークスペース",description:"新しいワークスペースを作成し、必要に応じてGitHubリポジトリからクローンする"},githubClone:{title:"GitHub からクローン",description:"対象フォルダを選び、リポジトリをそこにクローン"},subfolder:{title:"サブフォルダを作成",description:"親フォルダを選び、その中に新しいサブフォルダを作成"}},step2:{existingPath:"ワークスペースのパス",newPath:"ワークスペースのパス",subfolderParentPath:"親フォルダ",subfolderParentHelp:"新しいサブフォルダを作成する親フォルダのパス",subfolderName:"サブフォルダ名",subfolderNameHelp:"この名前のフォルダが親フォルダ内に作成されます",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:"新しいワークスペース",subfolderWorkspace:"新しいサブフォルダ",path:"パス:",parentPath:"親パス:",subfolderName:"サブフォルダ名:",cloneFrom:"クローン元:",authentication:"認証:",usingStoredToken:"保存済みトークンを使用:",usingProvidedToken:"入力されたトークンを使用",noAuthentication:"認証なし",sshKey:"SSHキー",existingInfo:"ワークスペースがプロジェクト一覧に追加され、Claude/Cursorセッションで使用できるようになります。",newWithClone:"このフォルダからリポジトリがクローンされます。",newEmpty:"ワークスペースがプロジェクト一覧に追加され、Claude/Cursorセッションで使用できるようになります。",subfolderInfo:"親フォルダ内に新しいサブフォルダが作成され、プロジェクト一覧に追加されます。",cloningRepository:"リポジトリをクローンしています..."},buttons:{cancel:"キャンセル",back:"戻る",next:"次へ",createProject:"プロジェクトを作成",creating:"作成中...",cloning:"クローン中..."},errors:{selectType:"既存のワークスペースか新規作成かを選択してください",providePath:"ワークスペースのパスを入力してください",provideSubfolderName:"サブフォルダ名を入力してください",subfolderNameInvalid:"サブフォルダ名にパス区切りを含めることはできず、. / .. もできません",failedToCreate:"ワークスペースの作成に失敗しました",failedToCreateFolder:"フォルダの作成に失敗しました"}},Rde={genericTool:"ツール",codes:{generic:{info:{title:"通知"}},permission:{required:{title:"対応が必要です",body:"{{toolName}} があなたの判断を待っています。"}},run:{stopped:{title:"実行が停止しました",body:"理由: {{reason}}"},failed:{title:"実行に失敗しました"}},agent:{notification:{title:"エージェント通知"}}}},Lde={title:"アップデートのお知らせ",newVersionReady:"新しいバージョンが利用可能です",currentVersion:"現在のバージョン",latestVersion:"最新バージョン",whatsNew:"変更点:",viewFullRelease:"リリース全文を見る",updateProgress:"アップデートの進捗:",manualUpgrade:"手動アップグレード:",npmUpgradeCommand:"npm install -g @pixelbyte-software/pixcode@latest",manualUpgradeHint:"または「今すぐ更新」をクリックして自動的にアップデートを実行できます。",updateCompleted:"アップデートが完了しました!",restartServer:"変更を適用するにはサーバーを再起動してください。",updateFailed:"アップデートに失敗しました",buttons:{close:"閉じる",later:"後で",copyCommand:"コマンドをコピー",updateNow:"今すぐ更新",updating:"更新中..."},ariaLabels:{closeModal:"バージョンアップグレードモーダルを閉じる",showSidebar:"サイドバーを表示",settings:"設定",updateAvailable:"アップデートあり",closeSidebar:"サイドバーを閉じる"}},Dde={title:"オーケストレーション",subtitle:"{{project}} で1つの目標を入力し、CLIワーカーを選択します。必要なら同じCLIを複製し、直接割り当てるかコーディネーターに分担させます。",refresh:"更新",goal:"目標",goalPlaceholder:"例: 認証画面を単一ポート配信に合わせて修正し、エラーを捕捉し、lint と typecheck で検証する。",mode:"実行モード",systemPlan:"システム計画",noMode:"モード未選択",loadingPlan:"エージェント計画を読み込み中。",start:"チームを開始",starting:"開始中",needAgent:"少なくとも1つのCLIワーカーを有効にしてください。",startFailed:"ワークフローを開始できませんでした。",cliControl:"CLIチーム",enabledCount:"{{count}} 有効",enabled:"有効",disabled:"無効",history:"履歴",emptyHistory:"実行はまだありません。目標を書いてエージェントを開始してください。",steps:"{{done}}/{{total}} ステップ",notSelected:"実行が選択されていません",notSelectedDescription:"過去の実行を選択するか新しい目標を開始してください。エージェントのメッセージ、エラー、変更概要、プレビュー出力がここに表示されます。",loadFailed:"実行詳細を読み込めませんでした。",loadingRun:"実行を読み込み中...",agentSteps:"エージェント手順",noStepOutput:"ステップ出力はありません。",agentMessages:"エージェントメッセージ",noAgentMessages:"このエージェントはまだメッセージを生成していません。失敗した場合、実際のCLIエラーが上に表示されます。",outputs:"出力",noOutputs:"変更概要、プレビュー、コマンド出力はまだありません。",open:"開く",artifact:{fileDiff:"変更概要",previewUrl:"プレビュー",commandOutput:"コマンド出力"},role:{user:"ユーザー",agent:"エージェント"},status:{queued:"待機中",running:"実行中",completed:"完了",failed:"エラー",canceled:"キャンセル",skipped:"スキップ"},nodes:{codex_review:"Codexレビュー",gemini_review:"Geminiレビュー",claude_review:"Claudeレビュー",claude_code_review:"Claudeレビュー",cursor_review:"Cursorレビュー",aggregate:"集約",architect:"計画",implement:"実装",review:"レビュー",proposal:"提案",critique:"批評",response:"応答",judge:"判断",coordinator:"コーディネーター",final_report:"最終レポート"},workflows:{multi_model_review:{name:"マルチモデルレビュー",description:"有効なCLIエージェントが同じ目標を個別にレビューし、その後有効なエージェントが結果を集約します。"},sequential_handoff:{name:"順次ハンドオフ",description:"エージェントが順番に計画、実装、レビューします。無効なCLIステップはスキップされます。"},adversarial_debate:{name:"意思決定ディベート",description:"エージェントが提案、批評、応答し、最終推奨を生成します。"},agent_team:{name:"エージェントチーム",description:"コーディネーターが目標と有効なCLIインスタンスを読み取り、作業を割り当てて結果を集約します。"}},adapters:{"claude-code":{label:"Claude Code",role:"CLIワーカー"},cursor:{label:"Cursor",role:"CLIワーカー"},codex:{label:"Codex",role:"CLIワーカー"},gemini:{label:"Gemini",role:"CLIワーカー"},qwen:{label:"Qwen Code",role:"CLIワーカー"},opencode:{label:"OpenCode",role:"CLIワーカー"}},activeCount:"{{active}}/{{total}} 有効",teamHint:"各行は1つのCLIワーカーです。Claude、Codex、Cursor、Gemini、Qwen、OpenCodeを複数作成し、それぞれに別の割り当てを書けます。",parallelLimit:"並列上限",addAgent:"{{agent}}を追加",duplicateAgent:"{{agent}}を複製",removeAgent:"{{agent}}を削除",assignment:"割り当て",assignmentPlaceholder:"任意: このワーカーが担当する内容を具体的に書きます。空欄ならコーディネーターが割り当てます。",agentInstance:"{{name}} #{{number}}",taskTitle:"タスク",taskTitlePlaceholder:"機能を実装",taskDescription:"説明",taskDescriptionPlaceholder:"範囲、制約、期待する出力",addTask:"追加",runTask:"実行",cancelTask:"キャンセル",dispatchTask:"タスクを割り当て",syncTaskMaster:"TaskMaster を同期",taskMasterSource:"TaskMaster",adapter:"アダプター",isolation:"分離",dispatch:"割り当て",auto:"自動",waitingForStream:"ストリーム待機中...",workflow:"ワークフロー",input:"入力",taskStates:{todo:"未着手",in_progress:"進行中",in_review:"レビュー中",done:"完了",failed:"失敗",canceled:"キャンセル済み"},isolationKind:{worktree:"Worktree",host:"Host",docker:"Docker"},stop:"チームを停止",stopping:"停止中",cancelFailed:"ワークフローを停止できませんでした。",needRoles:"このモードでは、次のロールに少なくとも1つの有効なエージェントを割り当ててください: {{roles}}。",quickPrompts:{label:"クイックプロンプト:",liveTrading:{label:"8024 ライブ取引画面",prompt:"こんにちは。小さなプロジェクトを作成し、その後ポート8024で起動してください。Binance FAPIに接続したTradingView風デザインで、TradingViewチャートと左側のスター/お気に入りシステムが必要です。作業を論理的に分割し、プロセスを自動管理してください。"}},teamHistory:"チーム履歴",changeSummary:"変更概要",noChangeSummary:"最終概要はまだ準備できていません。エージェント完了後、読みやすいMarkdown概要がここに表示されます。",prepareTeamFromReport:"このレポートからエージェントチームを準備",prepareTeamTitle:"エージェントチームのプロンプトを準備",prepareTeamDescription:"議論の出力を新しいAgent Teamプロンプトに変換しました。編集してAgent Teamモードへ移せます。",usePreparedPrompt:"プロンプトを使用",reportToPromptPrefix:"以下の議論/意思決定レポートからエージェントチームを準備して実行してください。必要事項をタスクに分け、利用可能なCLIエージェントへ適切な割り当てを提案し、ユーザー確認後に開始してください。",generatedSummaryTitle:"自動実行概要",summaryStatus:"全体ステータス",summarySteps:"完了ステップ",summaryFailures:"失敗ステップ",summaryCanceled:"キャンセルされたステップ",summaryDiffs:"差分/変更出力",summaryPreviews:"プレビュー出力",summaryErrorPrefix:"エラー",assignedWork:"割り当て作業",autoAssigned:"自動 / コーディネーターが決定",stages:{coordinator:"コーディネーター",handoff:"引き継ぎ",backend:"バックエンド",frontend:"フロントエンド",implementation:"実装",review:"レビュー",repair:"修正",proposal:"提案",critique:"批評",response:"応答",decision:"決定",report:"レポート",final_report:"最終レポート"},agentRole:"フェーズ",agentRoles:{auto:"自動",backend:"バックエンド",frontend:"フロントエンド",review:"テスト / レビュー",implementation:"実装",proposal:"提案",critique:"批評",response:"応答",decision:"決定 / レポート",report:"レポート",custom:"カスタム"},customRolePlaceholder:"例: セキュリティ、モバイルUX、DB設計",roleHints:{default:"空欄にすると、コーディネーターが目標に基づいてこのエージェントへ割り当てます。",agent_team:"バックエンド、フロントエンド、レビューなどのフェーズを選ぶか、自動のままにできます。",multi_model_review:"有効なエージェントがレビューします。レポートロールを選ぶと、そのエージェントが最終概要をまとめます。",sequential_handoff:"エージェントは選択順に実行されます。タスク文が各ステップの範囲を定義します。",adversarial_debate:"意思決定ディベートではフェーズ選択は任意です。未指定の場合、選択されたエージェントを順に提案、批評、必要に応じて応答へ割り当てます。"},soloAgent:"{{agent}} のみで実行",soloAgentShort:"単独",cliSettings:"CLI設定",workspaceTarget:"対象ワークスペース",workspaceTargets:{selectedProject:"選択中のプロジェクト",pixcodeApp:"Pixcode システム",custom:"カスタムパス"},customWorkspacePlaceholder:"/path/to/project",workspaceTargetHint:"エージェントは次で実行されます: {{path}}",autoDetect:"自動検出",needWorkspacePath:"カスタムワークスペースのパスを入力してください。"},Ode={buttons:wde,tabs:kde,status:Sde,messages:Ede,navigation:Nde,common:Cde,time:Ade,fileOperations:Tde,mainContent:jde,fileTree:_de,projectWizard:Ide,notifications:Rde,versionUpdate:Lde,orchestration:Dde},Mde="設定",Pde={account:"アカウント",permissions:"権限",mcpServers:"MCPサーバー",appearance:"外観"},Fde={title:"アカウント",language:"言語",languageLabel:"表示言語",languageDescription:"インターフェースの表示言語を選択してください",username:"ユーザー名",email:"メールアドレス",profile:"プロフィール",changePassword:"パスワードを変更"},zde={title:"MCPサーバー",addServer:"サーバーを追加",editServer:"サーバーを編集",deleteServer:"サーバーを削除",serverName:"サーバー名",serverType:"サーバーの種類",config:"設定",testConnection:"接続テスト",status:"状態",connected:"接続済み",disconnected:"未接続",scope:{label:"スコープ",user:"ユーザー",project:"プロジェクト"}},Bde={title:"外観",theme:"テーマ",codeEditor:"コードエディタ",editorTheme:"エディタのテーマ",wordWrap:"折り返し",showMinimap:"ミニマップを表示",lineNumbers:"行番号",fontSize:"フォントサイズ"},$de={saveChanges:"変更を保存",resetToDefaults:"デフォルトに戻す",cancelChanges:"変更をキャンセル"},Ude={title:"クイック設定",sections:{appearance:"外観",toolDisplay:"ツール表示",viewOptions:"表示オプション",inputSettings:"入力設定",changeAwareness:"コントロール"},darkMode:"ダークモード",autoExpandTools:"ツールを自動展開",showRawParameters:"生パラメータを表示",showThinking:"思考を表示",autoScrollToBottom:"自動スクロール",sendByCtrlEnter:"Ctrl+Enterで送信",sendByCtrlEnterDescription:"有効にすると、Enterではなく Ctrl+Enter でメッセージを送信します。IMEユーザーの誤送信防止に便利です。",changeAwareness:"コントロール",changedFiles:{title:"変更されたファイル",description:"ローカル変更を追跡し、新しい変更が出たらファイルパネルを開きます。",noProject:"ローカル変更を追跡するプロジェクトを選択してください。",refresh:"変更ファイルを更新",empty:"ローカル変更はありません",disabled:"ローカル変更を監視するにはコントロールを有効にしてください。",more:"ほか {{count}} 件",lastChecked:"{{value}} に確認",guideTitle:"右パネルガイド",guideFiles:"変更されたファイルはファイル内で緑に光ります。",guidePanel:"新しい変更で分割パネルが自動的に開きます。",status:{M:"M",A:"A",D:"D",U:"U"}},dragHandle:{dragging:"ドラッグ中",closePanel:"設定パネルを閉じる",openPanel:"設定パネルを開く",draggingStatus:"ドラッグ中...",toggleAndMove:"クリックで切替、ドラッグで移動"}},Gde={title:"ターミナルショートカット",sectionKeys:"キー",sectionNavigation:"ナビゲーション",escape:"Escape",tab:"Tab",shiftTab:"Shift+Tab",arrowUp:"上矢印",arrowDown:"下矢印",scrollDown:"下にスクロール",handle:{closePanel:"ショートカットパネルを閉じる",openPanel:"ショートカットパネルを開く"}},Hde={label:"設定",agents:"エージェント",appearance:"外観",git:"Git",apiTokens:"API & トークン",tasks:"タスク",notifications:"通知",plugins:"プラグイン",mobile:"モバイルで使う",telegram:"Telegram",about:"概要"},Vde={title:"通知",description:"受信する通知イベントを設定します。",webPush:{title:"Webプッシュ通知",enable:"プッシュ通知を有効にする",disable:"プッシュ通知を無効にする",enabled:"プッシュ通知は有効です",loading:"更新中...",unsupported:"このブラウザではプッシュ通知がサポートされていません。",denied:"プッシュ通知がブロックされています。ブラウザの設定で許可してください。"},events:{title:"イベント種別",actionRequired:"対応が必要",stop:"実行停止",error:"実行失敗"}},qde={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:"エディタのフォントサイズ(ピクセル)"}}},Wde={title:{add:"MCPサーバーを追加",edit:"MCPサーバーを編集"},importMode:{form:"フォーム入力",json:"JSONインポート"},scope:{label:"スコープ",userGlobal:"ユーザー(グローバル)",projectLocal:"プロジェクト(ローカル)",userDescription:"ユーザースコープ: すべてのプロジェクトで利用可能",projectDescription:"ローカルスコープ: 選択したプロジェクトでのみ利用可能",cannotChange:"既存のサーバーを編集する場合、スコープは変更できません"},fields:{serverName:"サーバー名",transportType:"トランスポートの種類",command:"コマンド",arguments:"引数(1行に1つ)",jsonConfig:"JSON設定",url:"URL",envVars:"環境変数(KEY=value、1行に1つ)",headers:"ヘッダー(KEY=value、1行に1つ)",selectProject:"プロジェクトを選択..."},placeholders:{serverName:"my-server"},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:"サーバーを更新"}},Kde={success:"設定を保存しました!",error:"設定の保存に失敗しました",saving:"保存中..."},Yde={save:"設定を保存",cancel:"キャンセル"},Zde={title:"Git設定",description:"コミット用のGit IDを設定します。この設定は git config --global で適用されます",name:{label:"Git名前",help:"コミットに使用する名前"},email:{label:"Gitメールアドレス",help:"コミットに使用するメールアドレス"},actions:{save:"設定を保存",saving:"保存中..."},status:{success:"保存しました"}},Xde={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:"外部APIからプライベートリポジトリをクローンするためのGitHubパーソナルアクセストークンを追加します。",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}}"}},Jde={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のタスク、バナー、サイドバーインジケータを表示します"}},Qde={authStatus:{checking:"確認中...",connected:"接続済み",notConnected:"未接続",disconnected:"切断",checkingAuth:"認証状態を確認しています...",loggedInAs:"{{email}}でログイン中",authenticatedUser:"認証済みユーザー"},account:{claude:{description:"Anthropic Claude AIアシスタント"},cursor:{description:"Cursor AI搭載コードエディタ"},codex:{description:"OpenAI Codex AIアシスタント"},gemini:{description:"Google Gemini AIアシスタント"},qwen:{description:"Alibaba Qwen Code CLI (Gemini CLI フォーク)"}},connectionStatus:"接続状態",login:{title:"ログイン",reAuthenticate:"再認証",description:"{{agent}}アカウントにサインインしてAI機能を有効にします",reAuthDescription:"別のアカウントでサインインするか、認証情報を更新します",button:"ログイン",reLoginButton:"再ログイン"},error:"エラー: {{error}}"},eue={title:"権限設定",skipPermissions:{label:"権限プロンプトをスキップ(注意して使用)",claudeDescription:"--dangerously-skip-permissions フラグに相当",cursorDescription:"Cursor CLIの -f フラグに相当",opencodeDescription:"OpenCode の --dangerously-skip-permissions フラグに相当"},allowedTools:{title:"許可されたツール",description:"権限の確認なしに自動的に許可されるツール",placeholder:'例: "Bash(git log:*)" または "Write"',quickAdd:"よく使うツールを追加:",empty:"許可されたツールはありません"},blockedTools:{title:"ブロックされたツール",description:"権限の確認なしに自動的にブロックされるツール",placeholder:'例: "Bash(rm:*)"',empty:"ブロックされたツールはありません"},allowedCommands:{title:"許可されたシェルコマンド",description:"権限の確認なしに自動的に許可されるシェルコマンド",placeholder:'例: "Shell(ls)" または "Shell(git status)"',quickAdd:"よく使うコマンドを追加:",empty:"許可されたコマンドはありません"},blockedCommands:{title:"ブロックされたシェルコマンド",description:"自動的にブロックされるシェルコマンド",placeholder:'例: "Shell(rm -rf)" または "Shell(sudo)"',empty:"ブロックされたコマンドはありません"},toolExamples:{title:"ツールパターンの例:",bashGitLog:"- すべてのgit logコマンドを許可",bashGitDiff:"- すべてのgit diffコマンドを許可",write:"- すべてのWriteツールの使用を許可",bashRm:"- すべてのrmコマンドをブロック(危険)"},shellExamples:{title:"シェルコマンドの例:",ls:"- lsコマンドを許可",gitStatus:"- git statusを許可",npmInstall:"- npm installを許可",rmRf:"- 再帰的削除をブロック"},opencodeAllowed:{title:"許可された Bash パターン",description:"OpenCode が確認せず自動承認する Bash コマンドパターン",placeholder:'例: "git *" または "npm test"',quickAdd:"よく使うパターンを追加:",empty:"許可パターンはありません"},opencodeBlocked:{title:"ブロックされた Bash パターン",description:"OpenCode が常に拒否する Bash コマンドパターン",placeholder:'例: "rm -rf *" または "sudo *"',empty:"ブロックパターンはありません"},opencodeExamples:{title:"パターン例:",gitAll:"- すべての git コマンドを許可",gitPush:"- git push のみをブロック",rmRf:"- 再帰削除をブロック",npm:"- すべての npm コマンドを許可"},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:"追加"}},tue={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ベースのツールサーバーをサポートしています。追加のツールやリソースでCodexの機能を拡張するサーバーを追加できます。"}},rue={title:"プラグイン",description:"カスタムプラグインでインターフェースを拡張します。gitからインストールするか、~/.pixcode/plugins/ にフォルダを配置してください。",installPlaceholder:"https://github.com/user/my-plugin",installButton:"インストール",installing:"インストール中…",securityWarning:"信頼できる作成者のプラグイン、またはソースコードを確認済みのプラグインのみをインストールしてください。",scanningPlugins:"プラグインをスキャン中…",noPluginsInstalled:"プラグインがインストールされていません",pullLatest:"gitから最新を取得",noGitRemote:"リモートgitリポジトリがありません — アップデート不可",uninstallPlugin:"プラグインを削除",confirmUninstall:"クリックして確定",confirmUninstallMessage:"{{name}} を削除しますか?この操作は取り消せません。",cancel:"キャンセル",remove:"削除",updateFailed:"アップデートに失敗しました",installFailed:"インストールに失敗しました",uninstallFailed:"削除に失敗しました",toggleFailed:"切り替えに失敗しました",buildYourOwn:"プラグインを自作する",starter:"スターター",docs:"ドキュメント",starterPlugin:{name:"プロジェクト統計",badge:"スターター",description:"プロジェクトのファイル数、コード行数、ファイルタイプの内訳、最近のアクティビティを表示します。",install:"インストール"},morePlugins:"詳細",enable:"有効にする",disable:"無効にする",installAriaLabel:"プラグインのgitリポジトリURL",tab:"タブ",runningStatus:"実行中"},nue={title:Mde,tabs:Pde,account:Fde,mcp:zde,appearance:Bde,actions:$de,quickSettings:Ude,terminalShortcuts:Gde,mainTabs:Hde,notifications:Vde,appearanceSettings:qde,mcpForm:Wde,saveStatus:Kde,footerActions:Yde,git:Zde,apiKeys:Xde,tasks:Jde,agents:Qde,permissions:eue,mcpServers:tue,pluginSettings:rue},aue={title:"おかえりなさい",description:"Pixcodeアカウントにサインイン",username:"ユーザー名",password:"パスワード",submit:"サインイン",loading:"サインイン中...",errors:{invalidCredentials:"ユーザー名またはパスワードが正しくありません",requiredFields:"すべての項目を入力してください",networkError:"ネットワークエラー。もう一度お試しください。"},placeholders:{username:"ユーザー名を入力",password:"パスワードを入力"}},iue={title:"アカウント作成",username:"ユーザー名",password:"パスワード",confirmPassword:"パスワードの確認",submit:"アカウントを作成",loading:"アカウントを作成中...",errors:{passwordMismatch:"パスワードが一致しません",usernameTaken:"このユーザー名は既に使用されています",weakPassword:"パスワードが弱すぎます"}},sue={title:"サインアウト",confirm:"サインアウトしてもよろしいですか?",button:"サインアウト"},oue={login:aue,register:iue,logout:sue},lue={title:"プロジェクト",newProject:"新規プロジェクト",deleteProject:"プロジェクトを除去",renameProject:"プロジェクト名を変更",noProjects:"プロジェクトが見つかりません",loadingProjects:"プロジェクトを読み込んでいます...",searchPlaceholder:"プロジェクトを検索...",projectNamePlaceholder:"プロジェクト名",starred:"お気に入り",all:"すべて",untitledSession:"無題のセッション",newSession:"新しいセッション",codexSession:"Codexセッション",fetchingProjects:"Claudeのプロジェクトとセッションを取得しています",projects:"プロジェクト",detectedFromHistory:"履歴から検出",noMatchingProjects:"一致するプロジェクトがありません",tryDifferentSearch:"検索語を変えてお試しください",runClaudeCli:"プロジェクトディレクトリでClaude CLIを実行して始めましょう"},cue={title:"Pixcode",subtitle:"AIコーディングアシスタント"},due={title:"セッション",newSession:"新しいセッション",deleteSession:"セッションを削除",renameSession:"セッション名を変更",noSessions:"セッションはまだありません",loadingSessions:"セッションを読み込んでいます...",unnamed:"名称未設定",loading:"読み込み中...",showMore:"さらにセッションを表示"},uue={viewEnvironments:"環境を表示",hideSidebar:"サイドバーを隠す",createProject:"新しいプロジェクトを作成",refresh:"プロジェクトとセッションを更新 (Ctrl+R)",renameProject:"プロジェクト名を変更 (F2)",deleteProject:"サイドバーからプロジェクトを除去 (Delete)",addToFavorites:"お気に入りに追加",removeFromFavorites:"お気に入りから削除",editSessionName:"セッション名を手動で編集",deleteSession:"このセッションを完全に削除",save:"保存",cancel:"キャンセル"},pue={chat:"チャット",files:"ファイル",git:"Git",terminal:"ターミナル",tasks:"タスク"},mue={refresh:"更新",settings:"設定",collapseAll:"すべて折りたたむ",expandAll:"すべて展開",cancel:"キャンセル",save:"保存",delete:"削除",rename:"名前の変更",joinCommunity:"コミュニティに参加",reportIssue:"問題を報告",starOnGithub:"GitHubでスター"},hue={openSource:"オープンソース"},fue={active:"アクティブ",inactive:"非アクティブ",thinking:"思考中...",error:"エラー",aborted:"中断",unknown:"不明"},gue={justNow:"たった今",oneMinuteAgo:"1分前",minutesAgo:"{{count}}分前",oneHourAgo:"1時間前",hoursAgo:"{{count}}時間前",oneDayAgo:"1日前",daysAgo:"{{count}}日前"},bue={deleteConfirm:"本当に削除しますか?",renameSuccess:"名前を変更しました",deleteSuccess:"削除しました",errorOccurred:"エラーが発生しました",deleteSessionConfirm:"このセッションを削除してもよろしいですか?この操作は取り消せません。",deleteProjectConfirm:"サイドバーからこのプロジェクトを除去しますか?プロジェクトファイル、メモリ、セッションデータは削除されません。",enterProjectPath:"プロジェクトのパスを入力してください",deleteSessionFailed:"セッションの削除に失敗しました。もう一度お試しください。",deleteSessionError:"セッションの削除でエラーが発生しました。もう一度お試しください。",renameSessionFailed:"セッション名の変更に失敗しました。もう一度お試しください。",renameSessionError:"セッション名の変更でエラーが発生しました。もう一度お試しください。",deleteProjectFailed:"プロジェクトの除去に失敗しました。もう一度お試しください。",deleteProjectError:"プロジェクトの除去でエラーが発生しました。もう一度お試しください。",createProjectFailed:"プロジェクトの作成に失敗しました。もう一度お試しください。",createProjectError:"プロジェクトの作成でエラーが発生しました。もう一度お試しください。"},xue={updateAvailable:"アップデートあり"},yue={deleteProject:"プロジェクトを除去",deleteSession:"セッションを削除",confirmDelete:"このプロジェクトをどうしますか:",sessionCount:"このプロジェクトには{{count}}件の会話があります。",removeFromSidebar:"サイドバーからのみ除去",deleteAllData:"すべてのデータを完全に削除",allConversationsDeleted:"プロジェクトはサイドバーから除去されます。ファイル、メモリ、セッションデータは保持されます。",cannotUndo:"後からプロジェクトを再追加できます。"},vue={section:"オーケストレーション",fallbackTitle:"オーケストレーション実行"},wue={projects:lue,app:cue,sessions:due,tooltips:uue,navigation:pue,actions:mue,branding:hue,status:fue,time:gue,messages:bue,version:xue,deleteConfirmation:yue,orchestration:vue},kue={copy:"コピー",copied:"コピーしました",copyCode:"コードをコピー"},Sue={copy:"メッセージをコピー",copied:"メッセージをコピーしました",selectFormat:"コピー形式を選択",copyAsMarkdown:"Markdownとしてコピー",copyAsText:"テキストとしてコピー"},Eue={user:"U",error:"エラー",tool:"ツール",claude:"Claude",cursor:"Cursor",codex:"Codex"},Nue={settings:"ツール設定",error:"ツールエラー",result:"ツール結果",viewParams:"入力パラメータを表示",viewRawParams:"生パラメータを表示",viewDiff:"編集差分を表示:",creatingFile:"新規ファイルを作成:",updatingTodo:"Todoリストを更新中",read:"読み取り",readFile:"ファイルを読み取り",updateTodo:"Todoリストを更新",readTodo:"Todoリストを読み取り",searchResults:"件の結果"},Cue={found:"{{count}}件の{{type}}が見つかりました",file:"ファイル",files:"ファイル",pattern:"パターン:",in:"場所:"},Aue={updated:"ファイルを更新しました",created:"ファイルを作成しました",written:"ファイルを書き込みました",diff:"差分",newFile:"新規ファイル",viewContent:"ファイルの内容を表示",viewFullOutput:"全出力を表示({{count}}文字)",contentDisplayed:"ファイルの内容は上の差分ビューに表示されています"},Tue={title:"インタラクティブプロンプト",waiting:"CLIでの応答を待っています",instruction:"Claudeが実行されているターミナルでオプションを選択してください。",selectedOption:"✓ Claudeがオプション{{number}}を選択しました",instructionDetail:"CLIでは、矢印キーまたは番号を入力してオプションを選択します。"},jue={title:"思考中...",emoji:"💭 思考中..."},_ue={response:"JSONレスポンス"},Iue={grant:"{{tool}}に権限を付与",added:"権限を追加しました",addTo:"{{entry}}を許可されたツールに追加します。",retry:"権限を保存しました。ツールを使用するにはリクエストを再試行してください。",error:"権限を更新できませんでした。もう一度お試しください。",openSettings:"設定を開く"},Rue={updated:"Todoリストを更新しました",current:"現在のTodoリスト"},Lue={viewPlan:"📋 実装プランを表示",title:"実装プラン"},Due={resetAt:"Claudeの使用制限に達しました。制限は**{{time}} {{timezone}}** - {{date}}にリセットされます"},Oue={permissionMode:"権限モード",modes:{default:"デフォルトモード",acceptEdits:"編集を許可",bypassPermissions:"権限をバイパス",plan:"プランモード"},descriptions:{default:"信頼されたコマンド(ls、cat、grep、git statusなど)のみ自動実行。その他のコマンドはスキップ。ワークスペースへの書き込みは可能。",acceptEdits:"ワークスペース内ですべてのコマンドを自動実行。サンドボックス環境での完全自動モード。",bypassPermissions:"制限なしの完全なシステムアクセス。すべてのコマンドがディスクとネットワークへの完全なアクセスで自動実行されます。注意して使用してください。",plan:"プランニングモード - コマンドは実行されません"},technicalDetails:"技術的な詳細"},Mue={placeholder:"/ でコマンド、@ でファイル指定、または {{provider}} に何でも聞いてください...",placeholderDefault:"メッセージを入力...",disabled:"入力無効",attachFiles:"ファイルを添付",attachImages:"画像を添付",send:"送信",stop:"停止",clickToChangeMode:"クリックで権限モードを変更(または入力欄でTab)",showAllCommands:"すべてのコマンドを表示"},Pue={selector:{title:"思考モード",description:"拡張思考によりClaudeがより多くの選択肢を検討できます",active:"有効",tip:"高い思考モードは時間がかかりますが、より深い分析が得られます"},modes:{none:{name:"標準",description:"通常のClaudeの応答",prefix:""},think:{name:"Think",description:"基本的な拡張思考",prefix:"think"},thinkHard:{name:"Think Hard",description:"より深い検討",prefix:"think hard"},thinkHarder:{name:"Think Harder",description:"代替案を含む深い分析",prefix:"think harder"},ultrathink:{name:"Ultrathink",description:"最大限の思考予算",prefix:"ultrathink"}},buttonTitle:"思考モード: {{mode}}"},Fue={title:"AIアシスタントを選択",description:"新しい会話を始めるプロバイダーを選択してください",selectModel:"モデルを選択",providerInfo:{anthropic:"by Anthropic",openai:"by OpenAI",cursorEditor:"AIコードエディタ"},readyPrompt:{claude:"{{model}}でClaudeを使用する準備ができました。下にメッセージを入力してください。",cursor:"{{model}}でCursorを使用する準備ができました。下にメッセージを入力してください。",codex:"{{model}}でCodexを使用する準備ができました。下にメッセージを入力してください。",default:"上からプロバイダーを選択して開始してください"}},zue={continue:{title:"会話を続ける",description:"コードについて質問したり、変更をリクエストしたり、開発タスクのサポートを受けられます"},loading:{olderMessages:"過去のメッセージを読み込んでいます...",sessionMessages:"セッションメッセージを読み込んでいます..."},messages:{showingOf:"{{total}}件中{{shown}}件を表示",scrollToLoad:"上にスクロールしてさらに読み込む",showingLast:"最新{{count}}件を表示(全{{total}}件)",loadEarlier:"過去のメッセージを読み込む"}},Bue={selectProject:{title:"プロジェクトを選択",description:"プロジェクトを選択してそのディレクトリでシェルを開きます"},status:{newSession:"新しいセッション",initializing:"初期化中...",restarting:"再起動中..."},actions:{disconnect:"切断",disconnectTitle:"シェルから切断",restart:"再起動",restartTitle:"シェルを再起動(先に切断してください)",connect:"シェルで続行",connectTitle:"シェルに接続"},loading:"ターミナルを読み込んでいます...",connecting:"シェルに接続しています...",startSession:"新しいClaudeセッションを開始",resumeSession:"セッションを再開: {{displayName}}...",runCommand:"{{projectName}}で{{command}}を実行",startCli:"{{projectName}}でClaude CLIを起動しています",defaultCommand:"コマンド"},$ue={actions:{thinking:"Thinking",processing:"Processing",analyzing:"Analyzing",working:"Working",computing:"Computing",reasoning:"Reasoning"},state:{live:"Live",paused:"Paused"},elapsed:{seconds:"{{count}}s",minutesSeconds:"{{minutes}}m {{seconds}}s",label:"{{time}} elapsed",startingNow:"Starting now"},controls:{stopGeneration:"Stop Generation",pressEscToStop:"Press Esc anytime to stop"},providers:{assistant:"Assistant"}},Uue={codeBlock:kue,copyMessage:Sue,messageTypes:Eue,tools:Nue,search:Cue,fileOperations:Aue,interactive:Tue,thinking:jue,json:_ue,permissions:Iue,todo:Rue,plan:Lue,usageLimit:Due,codex:Oue,input:Mue,thinkingMode:Pue,providerSelection:Fue,session:zue,shell:Bue,claudeStatus:$ue},Gue={changes:"件の変更",previousChange:"前の変更",nextChange:"次の変更",hideDiff:"差分ハイライトを非表示",showDiff:"差分ハイライトを表示",settings:"エディタ設定",collapse:"エディタを折りたたむ",expand:"エディタを全幅に展開"},Hue="{{fileName}}を読み込んでいます...",Vue={showingChanges:"変更を表示中"},que={download:"ファイルをダウンロード",save:"保存",saving:"保存中...",saved:"保存しました!",exitFullscreen:"全画面を終了",fullscreen:"全画面",close:"閉じる"},Wue={lines:"行数:",characters:"文字数:",shortcuts:"Ctrl+Sで保存 • Escで閉じる"},Kue={title:"バイナリファイル",message:'ファイル "{{fileName}}" はバイナリファイルのため、テキストエディタで表示できません。'},Yue={toolbar:Gue,loading:Hue,header:Vue,actions:que,footer:Wue,binaryFile:Kue},Zue={title:"TaskMaster AIが設定されていません",description:"TaskMasterは、AIを活用した支援により、複雑なプロジェクトを管理しやすいタスクに分解するのに役立ちます",whatIsTitle:"🎯 TaskMasterとは?",features:{aiPowered:"AIを活用したタスク管理:複雑なプロジェクトを管理しやすいサブタスクに分解",prdTemplates:"PRDテンプレート:Product Requirements Documentからタスクを生成",dependencyTracking:"依存関係の追跡:タスクの関係性と実行順序を理解",progressVisualization:"進捗の可視化:カンバンボードと詳細なタスク分析",cliIntegration:"CLI統合:高度なワークフローのためにtaskmasterコマンドを使用"},initializeButton:"TaskMaster AIを初期化"},Xue={title:"TaskMasterを始める",subtitle:"TaskMasterが初期化されました!次にすることは:",steps:{createPRD:{title:"Product Requirements Document (PRD) を作成",description:"プロジェクトのアイデアについて話し合い、構築したい内容を説明するPRDを作成します。",addButton:"PRDを追加",existingPRDs:"既存のPRD:"},generateTasks:{title:"PRDからタスクを生成",description:"PRDができたら、AIアシスタントに解析を依頼してください。TaskMasterが自動的に実装の詳細を含む管理しやすいタスクに分解します。"},analyzeTasks:{title:"タスクの分析と展開",description:"AIアシスタントにタスクの複雑さを分析してもらい、より簡単に実装できる詳細なサブタスクに展開します。"},startBuilding:{title:"開発を始める",description:"AIアシスタントにタスクの作業を開始してもらい、ステータスを更新し、プロジェクトの進行に応じて新しいタスクを追加します。"}},tip:"💡 ヒント:TaskMasterのAIを活用したタスク生成を最大限に活用するには、PRDから始めましょう"},Jue={title:"TaskMasterのセットアップ",subtitle:"{{projectName}}のインタラクティブCLI",willStart:"TaskMasterの初期化が自動的に開始されます",completed:"TaskMasterのセットアップが完了しました!このウィンドウを閉じることができます。",closeButton:"閉じる",closeContinueButton:"閉じて続ける"},Que={title:"TaskMasterを始める",subtitle:"生産的なタスク管理のガイド",examples:{parsePRD:`💬 例:
|